summaryrefslogtreecommitdiffstats
path: root/libavcodec/libvpxdec.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2016-07-22 09:33:04 +0200
committerLuca Barbato <lu_zero@gentoo.org>2016-07-23 08:27:29 +0200
commitb183abfb5b6366b177cf44f244c66156257a6fd6 (patch)
treed22b568fe2941d2067ada1b09fe71ad191a59393 /libavcodec/libvpxdec.c
parentad71d3276fef0ee7e791e62bbfe9c4e540047417 (diff)
downloadffmpeg-streaming-b183abfb5b6366b177cf44f244c66156257a6fd6.zip
ffmpeg-streaming-b183abfb5b6366b177cf44f244c66156257a6fd6.tar.gz
vpx: Support color range
The range field has been introduced in version 1.6.0
Diffstat (limited to 'libavcodec/libvpxdec.c')
-rw-r--r--libavcodec/libvpxdec.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
index 28b7733..93a720f 100644
--- a/libavcodec/libvpxdec.c
+++ b/libavcodec/libvpxdec.c
@@ -99,6 +99,16 @@ static int vp8_decode(AVCodecContext *avctx,
return ret;
av_image_copy(picture->data, picture->linesize, img->planes,
img->stride, avctx->pix_fmt, img->d_w, img->d_h);
+#if VPX_IMAGE_ABI_VERSION >= 4
+ switch (img->range) {
+ case VPX_CR_STUDIO_RANGE:
+ picture->color_range = AVCOL_RANGE_MPEG;
+ break;
+ case VPX_CR_FULL_RANGE:
+ picture->color_range = AVCOL_RANGE_JPEG;
+ break;
+ }
+#endif
*got_frame = 1;
}
return avpkt->size;
OpenPOWER on IntegriCloud