aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-10-05 22:58:50 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-10-08 18:17:50 +0100
commiteddf95283fbba1b469b76e7518bc3941f671b193 (patch)
tree61008b1feea9b84fdb3ba222bf981a85be73318c
parent65875a8b3b079752da25a61ec188d2e3d90a569f (diff)
downloadffmpeg-eddf95283fbba1b469b76e7518bc3941f671b193.tar.gz
vp9: initialize color space and range properties
-rw-r--r--libavcodec/vp9.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 2a6a138aa1..50b84ae97e 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);