[FFmpeg-cvslog] libvpxdec: report colorspace

James Zern git at videolan.org
Thu Jun 25 00:11:02 CEST 2015


ffmpeg | branch: master | James Zern <jzern at google.com> | Tue Jun 23 14:41:26 2015 -0700| [766a8346cfb4e3553be207852266058d9edb9945] | committer: James Zern

libvpxdec: report colorspace

Reviewed-by: Ronald S. Bultje <rsbultje at gmail.com>
Signed-off-by: James Zern <jzern at google.com>

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

 libavcodec/libvpxdec.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
index d94561e..33af775 100644
--- a/libavcodec/libvpxdec.c
+++ b/libavcodec/libvpxdec.c
@@ -62,6 +62,13 @@ static av_cold int vpx_init(AVCodecContext *avctx,
 // returns 0 on success, AVERROR_INVALIDDATA otherwise
 static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img)
 {
+#if VPX_IMAGE_ABI_VERSION >= 3
+    static const enum AVColorSpace colorspaces[8] = {
+        AVCOL_SPC_UNSPECIFIED, AVCOL_SPC_BT470BG, AVCOL_SPC_BT709, AVCOL_SPC_SMPTE170M,
+        AVCOL_SPC_SMPTE240M, AVCOL_SPC_BT2020_NCL, AVCOL_SPC_RESERVED, AVCOL_SPC_RGB,
+    };
+    avctx->colorspace = colorspaces[img->cs];
+#endif
     if (avctx->codec_id == AV_CODEC_ID_VP8 && img->fmt != VPX_IMG_FMT_I420)
         return AVERROR_INVALIDDATA;
     switch (img->fmt) {



More information about the ffmpeg-cvslog mailing list