summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2015-09-03 09:32:46 -0400
committerRonald S. Bultje <rsbultje@gmail.com>2015-09-04 09:33:46 -0400
commit10142f994acb8b640a09b615da7a1091502bd6fb (patch)
tree1bc877ecdf768b29466916b9df3faede85e36a82
parent4ecb8b4191838c01d888a6b3490b31241439eb65 (diff)
libvpxdec: explicitly signal RGB.
-rw-r--r--libavcodec/libvpxdec.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
index 52a89ca308..eb05f267ea 100644
--- a/libavcodec/libvpxdec.c
+++ b/libavcodec/libvpxdec.c
@@ -90,7 +90,12 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img)
#endif
case VPX_IMG_FMT_I444:
avctx->profile = FF_PROFILE_VP9_1;
+#if VPX_IMAGE_ABI_VERSION >= 3
+ avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
+ AV_PIX_FMT_GBRP : AV_PIX_FMT_YUV444P;
+#else
avctx->pix_fmt = AV_PIX_FMT_YUV444P;
+#endif
return 0;
#ifdef VPX_IMG_FMT_HIGHBITDEPTH
case VPX_IMG_FMT_I42016:
@@ -107,10 +112,20 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img)
case VPX_IMG_FMT_I42216:
avctx->profile = FF_PROFILE_VP9_3;
if (img->bit_depth == 10) {
+#if VPX_IMAGE_ABI_VERSION >= 3
+ avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
+ AV_PIX_FMT_GBRP10LE : AV_PIX_FMT_YUV422P10LE;
+#else
avctx->pix_fmt = AV_PIX_FMT_YUV422P10LE;
+#endif
return 0;
} else if (img->bit_depth == 12) {
+#if VPX_IMAGE_ABI_VERSION >= 3
+ avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
+ AV_PIX_FMT_GBRP12LE : AV_PIX_FMT_YUV422P12LE;
+#else
avctx->pix_fmt = AV_PIX_FMT_YUV422P12LE;
+#endif
return 0;
} else {
return AVERROR_INVALIDDATA;