X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Flibvpxdec.c;h=eb05f267ea0ad473f3c5dbbbc2bc64507b29b315;hb=10142f994acb8b640a09b615da7a1091502bd6fb;hp=33af775a75225aa1f05e13c28605dc4645442d0e;hpb=0b6f092ed31b83e01e980b596ef8bdd9db6cfff6;p=ffmpeg diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c index 33af775a752..eb05f267ea0 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; @@ -217,7 +232,7 @@ AVCodec ff_libvpx_vp8_decoder = { .init = vp8_init, .close = vp8_free, .decode = vp8_decode, - .capabilities = CODEC_CAP_AUTO_THREADS | CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_AUTO_THREADS | AV_CODEC_CAP_DR1, }; #endif /* CONFIG_LIBVPX_VP8_DECODER */ @@ -244,7 +259,7 @@ AVCodec ff_libvpx_vp9_decoder = { .init = vp9_init, .close = vp8_free, .decode = vp8_decode, - .capabilities = CODEC_CAP_AUTO_THREADS | CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_AUTO_THREADS | AV_CODEC_CAP_DR1, .init_static_data = ff_vp9_init_static, .profiles = NULL_IF_CONFIG_SMALL(profiles), };