[MPlayer-dev-eng] key frame extractor / vo_jpeg use YV12 instead of RGB patch

Michael Niedermayer michaelni at gmx.at
Sun Mar 18 13:29:56 CET 2007


Hi

On Sat, Mar 17, 2007 at 01:03:51PM -0700, Trent Piepho wrote:
> On Sat, 17 Mar 2007, Michael Niedermayer wrote:
> > On Fri, Mar 16, 2007 at 05:03:23PM -0700, Trent Piepho wrote:
> > > Chroma is scaled too.  swscaler has some support for JPEG range YUV data,
> > > if you look at the code you can see stubs for it.  I don't think it totally
> > > works.
> >
> > swscaler itself supports it, mplayer and mencoder dont, problem is they
> > dont distinguish full range from non full range yuv
> 
> I was thinking of this function in swscaler.c:
> /**
>  * @param inv_table the yuv2rgb coeffs, normally Inverse_Table_6_9[x]
>  * @param fullRange if 1 then the luma range is 0..255 if 0 its 16..235
>  * @return -1 if not supported
>  */
> int sws_setColorspaceDetails(SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation){
> 
> The comment is wrong, there is no 'fullRange' param, it's really srcRange
> and dstRange.  

patch welcome


> Anyway, srcRange is used to scale luma:
>         if(!srcRange){
>                 cy= (cy*255) / 219;
>                 oy= 16<<16;
>         }
> dstRange is never used.  So I think one can convert from full-range luma to
> rgb with swscaler (if mplayer allowed one to set the format to
> PIX_FMT_J420P), but not the other way around.  No RGB to full-range YUV.
> 
> I also don't see where 601 range YUV to full-range YUV would be done.  It
> doesn't seem like there is any general YUV->YUV conversion.

patch welcome 


> 
> I don't think these ranges are correct either.  Only Y is being scaled to
> 0..255, U and V are not changed.  From the libjpeg source:

fixed

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you really think that XML is the answer, then you definitly missunderstood
the question -- Attila Kinali
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070318/db3d054c/attachment.pgp>


More information about the MPlayer-dev-eng mailing list