[FFmpeg-cvslog] vp9: initialize color space and range properties

Vittorio Giovara git at videolan.org
Thu Oct 9 02:54:35 CEST 2014


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Sun Oct  5 22:58:50 2014 +0100| [eddf95283fbba1b469b76e7518bc3941f671b193] | committer: Vittorio Giovara

vp9: initialize color space and range properties

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

 libavcodec/vp9.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 2a6a138..50b84ae 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -1040,6 +1040,18 @@ static int vp9_decode_frame(AVCodecContext *avctx, AVFrame *frame,
     s->cur_frame->pict_type = s->keyframe ? AV_PICTURE_TYPE_I
                                           : AV_PICTURE_TYPE_P;
 
+    if (s->fullrange)
+        avctx->color_range = AVCOL_RANGE_JPEG;
+    else
+        avctx->color_range = AVCOL_RANGE_MPEG;
+
+    switch (s->colorspace) {
+    case 1: avctx->colorspace = AVCOL_SPC_BT470BG; break;
+    case 2: avctx->colorspace = AVCOL_SPC_BT709; break;
+    case 3: avctx->colorspace = AVCOL_SPC_SMPTE170M; break;
+    case 4: avctx->colorspace = AVCOL_SPC_SMPTE240M; break;
+    }
+
     // main tile decode loop
     memset(s->above_partition_ctx, 0, s->cols);
     memset(s->above_skip_ctx, 0, s->cols);



More information about the ffmpeg-cvslog mailing list