[FFmpeg-devel] [PATCH]Force tv range for mpeg4 gray output

wm4 nfxjfg at googlemail.com
Sat May 9 11:53:13 CEST 2015


On Sat, 9 May 2015 11:12:46 +0200
Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

> diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
> index c47f5b1..162c295 100644
> --- a/libavcodec/h263dec.c
> +++ b/libavcodec/h263dec.c
> @@ -48,8 +48,10 @@ static enum AVPixelFormat h263_get_format(AVCodecContext *avctx)
>      if (avctx->codec->id == AV_CODEC_ID_MSS2)
>          return AV_PIX_FMT_YUV420P;
>  
> -    if (CONFIG_GRAY && (avctx->flags & CODEC_FLAG_GRAY))
> +    if (CONFIG_GRAY && (avctx->flags & CODEC_FLAG_GRAY)) {
> +        avctx->color_range = AVCOL_RANGE_MPEG;
>          return AV_PIX_FMT_GRAY8;
> +    }
>  
>      return avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts);
>  }

Are you sure this doesn't overwrite color_range values read from the
file? (I didn't check, but please make sure.)

It appears to me that making GRAY full range by default wasn't such a
good idea. Also, this patch is libswscale specific - unless you
document somewhere that GRAY is in fact not just like the Y plane of
normal YUV formats, but is full range by default. The API is
inconsistent and undocumented in this aspect.


More information about the ffmpeg-devel mailing list