aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vp9.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-12-03 11:09:51 +0100
committerHendrik Leppkes <h.leppkes@gmail.com>2015-12-07 09:38:59 +0100
commit1e6cf7272fa8910fa44f1cf9e8b643326c2cf407 (patch)
tree8536f24a8ccb5a9c9213a50aa0f25f9c81991ede /libavcodec/vp9.c
parent585083dd1fc33b42ecd3f8095d49608c7c3dfe0d (diff)
downloadffmpeg-1e6cf7272fa8910fa44f1cf9e8b643326c2cf407.tar.gz
avcodec: implement vp9 dxva2 hwaccel
Diffstat (limited to 'libavcodec/vp9.c')
-rw-r--r--libavcodec/vp9.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 2f661325a0..fdcb89520e 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -240,7 +240,7 @@ fail:
static int update_size(AVCodecContext *ctx, int w, int h)
{
-#define HWACCEL_MAX (0)
+#define HWACCEL_MAX (CONFIG_VP9_DXVA2_HWACCEL + CONFIG_VP9_D3D11VA_HWACCEL)
enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmtp = pix_fmts;
VP9Context *s = ctx->priv_data;
uint8_t *p;
@@ -254,6 +254,15 @@ static int update_size(AVCodecContext *ctx, int w, int h)
if ((res = ff_set_dimensions(ctx, w, h)) < 0)
return res;
+ if (s->pix_fmt == AV_PIX_FMT_YUV420P) {
+#if CONFIG_VP9_DXVA2_HWACCEL
+ *fmtp++ = AV_PIX_FMT_DXVA2_VLD;
+#endif
+#if CONFIG_VP9_D3D11VA_HWACCEL
+ *fmtp++ = AV_PIX_FMT_D3D11VA_VLD;
+#endif
+ }
+
*fmtp++ = s->pix_fmt;
*fmtp = AV_PIX_FMT_NONE;