[FFmpeg-devel] [PATCH] set pix_fmt to YUVJ420P for h264 full range

Laurent Aimar fenrir
Fri May 28 15:51:33 CEST 2010


Hi,

On Thu, May 27, 2010 at 07:05:10PM -0700, Baptiste Coudurier wrote:
> Index: libavcodec/h264.c
> ===================================================================
> --- libavcodec/h264.c	(revision 23288)
> +++ libavcodec/h264.c	(working copy)
> @@ -1834,6 +1834,10 @@
>          s->avctx->pix_fmt = s->avctx->get_format(s->avctx, s->avctx->codec->pix_fmts);
>          s->avctx->hwaccel = ff_find_hwaccel(s->avctx->codec->id, s->avctx->pix_fmt);
>  
> +        if (s->avctx->pix_fmt == PIX_FMT_YUV420P &&
> +            s->avctx->color_range == AVCOL_RANGE_JPEG)
> +            s->avctx->pix_fmt = PIX_FMT_YUVJ420P;
> +
 As an avcodec user, I don't think it is ok to ignore what
avctx->get_format() have selected.
I think it might be better to changes the array given to
avctx->get_format() instead.

Regards,

-- 
fenrir



More information about the ffmpeg-devel mailing list