aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vp8.c
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
commit65875a8b3b079752da25a61ec188d2e3d90a569f (patch)
treec81197047842d30e47843889e9a019d423f9a02b /libavcodec/vp8.c
parent0d8a3656ba4c0ae8e4e0c91ff6b07d72a317f9f6 (diff)
downloadffmpeg-65875a8b3b079752da25a61ec188d2e3d90a569f.tar.gz
vp8: initialize color space and range properties
Diffstat (limited to 'libavcodec/vp8.c')
-rw-r--r--libavcodec/vp8.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 5426555793..0d2cab31ff 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -670,9 +670,10 @@ static int vp8_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
buf_size -= header_size;
if (s->keyframe) {
- if (vp8_rac_get(c))
+ s->colorspace = vp8_rac_get(c);
+ if (s->colorspace)
av_log(s->avctx, AV_LOG_WARNING, "Unspecified colorspace\n");
- vp8_rac_get(c); // whether we can skip clamping in dsp functions
+ s->fullrange = vp8_rac_get(c);
}
if ((s->segmentation.enabled = vp8_rac_get(c)))
@@ -2490,6 +2491,13 @@ int vp78_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
curframe = s->framep[VP56_FRAME_CURRENT] = vp8_find_free_buffer(s);
+ if (!s->colorspace)
+ avctx->colorspace = AVCOL_SPC_BT470BG;
+ if (s->fullrange)
+ avctx->color_range = AVCOL_RANGE_JPEG;
+ else
+ avctx->color_range = AVCOL_RANGE_MPEG;
+
/* Given that arithmetic probabilities are updated every frame, it's quite
* likely that the values we have on a random interframe are complete
* junk if we didn't start decode on a keyframe. So just don't display