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

Michael Niedermayer michaelni
Sat May 9 12:35:26 CEST 2009


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


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090509/82eb27f1/attachment.pgp>



More information about the ffmpeg-devel mailing list