aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libvpxdec.c
diff options
context:
space:
mode:
authorSasi Inguva <isasi@google.com>2016-01-09 12:48:49 -0300
committerJames Almer <jamrial@gmail.com>2016-01-09 12:51:34 -0300
commitcbcc88c0393f15512cbf06b895f3f58210376614 (patch)
tree25475e8c57f80e8ff8936058c6a4325e26c81fe1 /libavcodec/libvpxdec.c
parent2039b3e7511ef183dae206575114e15b6d99c134 (diff)
downloadffmpeg-cbcc88c0393f15512cbf06b895f3f58210376614.tar.gz
libvpx: Support setting color range for vp9.
Pass through color range to vp9 encoder. Parse color range in libvpxdec.c. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: Sasi Inguva <isasi@google.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/libvpxdec.c')
-rw-r--r--libavcodec/libvpxdec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
index 698c546277..de72be9103 100644
--- a/libavcodec/libvpxdec.c
+++ b/libavcodec/libvpxdec.c
@@ -69,6 +69,12 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img)
AVCOL_SPC_SMPTE240M, AVCOL_SPC_BT2020_NCL, AVCOL_SPC_RESERVED, AVCOL_SPC_RGB,
};
avctx->colorspace = colorspaces[img->cs];
+#if VPX_IMAGE_ABI_VERSION >= 4
+ static const enum AVColorRange color_ranges[] = {
+ AVCOL_RANGE_MPEG, AVCOL_RANGE_JPEG
+ };
+ avctx->color_range = color_ranges[img->range];
+#endif
#endif
if (avctx->codec_id == AV_CODEC_ID_VP8 && img->fmt != VPX_IMG_FMT_I420)
return AVERROR_INVALIDDATA;