aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vp9.c
diff options
context:
space:
mode:
authorrcombs <rcombs@rcombs.me>2021-11-13 02:43:06 -0600
committerrcombs <rcombs@rcombs.me>2021-11-28 16:40:58 -0600
commita41a2efc85f8c88caec10040ee437562f9d0b947 (patch)
tree133c31e9eb66bc1a180f9da2d545b5beebcd1ad8 /libavcodec/vp9.c
parente3c6cc96cf2f0b2c22dee80a53a01a5fe4fea009 (diff)
downloadffmpeg-a41a2efc85f8c88caec10040ee437562f9d0b947.tar.gz
lavc/videotoolbox: add VP9 hardware acceleration
On M1 Max, this supports profiles 0 and 2, but not 1 and 3.
Diffstat (limited to 'libavcodec/vp9.c')
-rw-r--r--libavcodec/vp9.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 8317ac6bd8..24841c5b9f 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -181,7 +181,8 @@ static int update_size(AVCodecContext *avctx, int w, int h)
CONFIG_VP9_D3D11VA_HWACCEL * 2 + \
CONFIG_VP9_NVDEC_HWACCEL + \
CONFIG_VP9_VAAPI_HWACCEL + \
- CONFIG_VP9_VDPAU_HWACCEL)
+ CONFIG_VP9_VDPAU_HWACCEL + \
+ CONFIG_VP9_VIDEOTOOLBOX_HWACCEL)
enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmtp = pix_fmts;
VP9Context *s = avctx->priv_data;
uint8_t *p;
@@ -213,6 +214,9 @@ static int update_size(AVCodecContext *avctx, int w, int h)
#if CONFIG_VP9_VDPAU_HWACCEL
*fmtp++ = AV_PIX_FMT_VDPAU;
#endif
+#if CONFIG_VP9_VIDEOTOOLBOX_HWACCEL
+ *fmtp++ = AV_PIX_FMT_VIDEOTOOLBOX;
+#endif
break;
case AV_PIX_FMT_YUV420P12:
#if CONFIG_VP9_NVDEC_HWACCEL
@@ -1894,6 +1898,9 @@ const AVCodec ff_vp9_decoder = {
#if CONFIG_VP9_VDPAU_HWACCEL
HWACCEL_VDPAU(vp9),
#endif
+#if CONFIG_VP9_VIDEOTOOLBOX_HWACCEL
+ HWACCEL_VIDEOTOOLBOX(vp9),
+#endif
NULL
},
};