[FFmpeg-cvslog] lavc/h263: Set color_range for gray decoding.

Carl Eugen Hoyos git at videolan.org
Sun May 17 03:05:03 CEST 2015


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sat May 16 23:32:27 2015 +0200| [101f26e758001dac564a8f1726c74cdde75ed8d1] | committer: Carl Eugen Hoyos

lavc/h263: Set color_range for gray decoding.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=101f26e758001dac564a8f1726c74cdde75ed8d1
---

 libavcodec/h263dec.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index c47f5b1..3e115eb 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -48,8 +48,11 @@ 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)) {
+        if (avctx->color_range == AVCOL_RANGE_UNSPECIFIED)
+            avctx->color_range = AVCOL_RANGE_MPEG;
         return AV_PIX_FMT_GRAY8;
+    }
 
     return avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts);
 }



More information about the ffmpeg-cvslog mailing list