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

Carl Eugen Hoyos cehoyos at ag.or.at
Sat May 9 12:32:03 CEST 2015


On Saturday 09 May 2015 11:00:02 am Carl Eugen Hoyos wrote:
> Hi!
>
> I believe attached patch makes vc1 gray output more correct.

New patch attached that allows users to set the range.

Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 86e214a..ad1d4d9 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -429,8 +429,11 @@ 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;
+        if (avctx->color_range == AVCOL_RANGE_UNSPECIFIED)
+            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