[FFmpeg-devel] [PATCH] Set generic yuv420 sampling in yuv4mpeg by default

David Conrad lessen42
Sun May 10 02:05:34 CEST 2009


On May 9, 2009, at 6:35 AM, Michael Niedermayer wrote:

> On Sat, May 09, 2009 at 05:54:54AM -0400, David Conrad wrote:
>> On May 8, 2009, at 9:49 AM, Michael Niedermayer wrote:
>>
>>> anyway Thusneldas dump_psnr is broken if it does care about these  
>>> values.
>>> One cannot compare 2 raw images if chroma sample locations dont  
>>> match
>>> i guess theres no play that is too foul for xiphs propaganda  
>>> machinery
>>>
>>> the patch is fine but its not completly setting that field correctly
>>> either
>>
>> I'd rather set the values as correctly as possible and leave  
>> dump_psnr to
>> be fixed to not automatically munge chroma silently.
>
> [...]
>
>> commit cecdc96d42fbc97d0b3f76b9a3ade04004b63fd6
>> Author: David Conrad <lessen42 at gmail.com>
>> Date:   Sat May 9 05:51:01 2009 -0400
>>
>>    Use chroma_sample_location in reading/writing yuv4mpeg
>>
>> diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c
>> index 3fd7927..6b563fc 100644
>> --- a/libavformat/yuv4mpeg.c
>> +++ b/libavformat/yuv4mpeg.c
>> @@ -62,7 +62,9 @@ static int yuv4_generate_header(AVFormatContext  
>> *s, char* buf)
>>         colorspace = " C411 XYSCSS=411";
>>         break;
>>     case PIX_FMT_YUV420P:
>> -        colorspace = (st->codec->codec_id == CODEC_ID_DVVIDEO)?"  
>> C420paldv XYSCSS=420PALDV":" C420mpeg2 XYSCSS=420MPEG2";
>> +        colorspace = (st->codec->chroma_sample_location == 3)?"  
>> C420paldv XYSCSS=420PALDV":
>> +                     (st->codec->chroma_sample_location == 1)?"  
>> C420mpeg2 XYSCSS=420MPEG2":
>> +                     " C420jpeg XYSCSS=420JPEG";
>
> i think an enum would be nicer than these litteral numbers


Fixed in the previous patch as well.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ffmpeg-y4m-chromapos.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090509/8d4d5a78/attachment.txt>
-------------- next part --------------




More information about the ffmpeg-devel mailing list