diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-01-25 13:01:11 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-01-27 12:37:34 +0100 |
commit | 36962ad2339d003f327336afd6d00ad3a5a58816 (patch) | |
tree | 2baf38cb7d262418ca34bdc1ea9ee89d9672b881 /libavcodec/hevc.c | |
parent | f8ecffa9b7e49860ce030fb3cabb60b3143384db (diff) | |
download | ffmpeg-36962ad2339d003f327336afd6d00ad3a5a58816.tar.gz |
Add DXVA2 HEVC HWAccel
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r-- | libavcodec/hevc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index 7173c10a40..4fe20790fc 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -300,7 +300,7 @@ static int get_buffer_sao(HEVCContext *s, AVFrame *frame, const HEVCSPS *sps) 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; @@ -316,6 +316,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; |