summaryrefslogtreecommitdiff
path: root/libavcodec/hevc.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-01-25 12:58:50 +0100
committerAnton Khirnov <anton@khirnov.net>2015-01-27 09:05:31 +0100
commit7e850fa67e32ebe98581c2e4ca4a4655dee7f116 (patch)
treee1f6c5c29ad3233a79b229a55cfa09626c435e28 /libavcodec/hevc.c
parentb82722df9b2911bd41e0928db4804067b39e6528 (diff)
Add DXVA2 HEVC HWAccel
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r--libavcodec/hevc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 7a687a9e15..0511be92c9 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -385,7 +385,7 @@ static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb)
static int set_sps(HEVCContext *s, const HEVCSPS *sps)
{
- #define HWACCEL_MAX (0)
+ #define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL)
enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts;
int ret;
unsigned int num = 0, den = 0;
@@ -401,6 +401,12 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps)
s->avctx->height = sps->output_height;
s->avctx->has_b_frames = sps->temporal_layer[sps->max_sub_layers - 1].num_reorder_pics;
+ if (sps->pix_fmt == AV_PIX_FMT_YUV420P || sps->pix_fmt == AV_PIX_FMT_YUVJ420P) {
+#if CONFIG_HEVC_DXVA2_HWACCEL
+ *fmt++ = AV_PIX_FMT_DXVA2_VLD;
+#endif
+ }
+
*fmt++ = sps->pix_fmt;
*fmt = AV_PIX_FMT_NONE;