[FFmpeg-devel] [PATCH]Force colour range for vc1 gray output

Carl Eugen Hoyos cehoyos at ag.or.at
Sat May 9 11:00:02 CEST 2015


Hi!

I believe attached patch makes vc1 gray output more correct.

Or should this be set unconditionally for all output pix_fmts?

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 86e214a..1a9e596 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -429,8 +429,10 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
         return -1;
     if (!(avctx->flags & CODEC_FLAG_GRAY))
         avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts);
-    else
+    else {
         avctx->pix_fmt = AV_PIX_FMT_GRAY8;
+        avctx->color_range = AVCOL_RANGE_MPEG;
+    }
     v->s.avctx = avctx;
 
     if ((ret = ff_vc1_init_common(v)) < 0)


More information about the ffmpeg-devel mailing list