summaryrefslogtreecommitdiff
path: root/libavcodec/dxva2_vc1.c
diff options
context:
space:
mode:
authorWu Jianhua <toqsxw@outlook.com>2023-12-05 14:46:44 +0800
committerHaihao Xiang <haihao.xiang@intel.com>2023-12-21 16:15:23 +0800
commit349ce30e4ea3ded1e776270976d291d2adec608d (patch)
treefa26217b10e857ac39ee6447b86b1e3c84e8f50f /libavcodec/dxva2_vc1.c
parent142f727b9ca21c95414536074e3f89c687271dd4 (diff)
avcodec: add D3D12VA hardware accelerated H264 decoding
The implementation is based on: https://learn.microsoft.com/en-us/windows/win32/medfound/direct3d-12-video-overview With the Direct3D 12 video decoding support, we can render or process the decoded images by the pixel shaders or compute shaders directly without the extra copy overhead, which is beneficial especially if you are trying to render or post-process a 4K or 8K video. The command below is how to enable d3d12va: ffmpeg -hwaccel d3d12va -i input.mp4 output.mp4 Signed-off-by: Wu Jianhua <toqsxw@outlook.com> Signed-off-by: Tong Wu <tong1.wu@intel.com>
Diffstat (limited to 'libavcodec/dxva2_vc1.c')
-rw-r--r--libavcodec/dxva2_vc1.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/dxva2_vc1.c b/libavcodec/dxva2_vc1.c
index b35fb115f7..8ee23feabf 100644
--- a/libavcodec/dxva2_vc1.c
+++ b/libavcodec/dxva2_vc1.c
@@ -58,13 +58,13 @@ static void fill_picture_parameters(AVCodecContext *avctx,
memset(pp, 0, sizeof(*pp));
pp->wDecodedPictureIndex =
- pp->wDeblockedPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, current_picture->f);
+ pp->wDeblockedPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, current_picture->f, 1);
if (s->pict_type != AV_PICTURE_TYPE_I && !v->bi_type)
- pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->last_picture.f);
+ pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->last_picture.f, 0);
else
pp->wForwardRefPictureIndex = 0xffff;
if (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type)
- pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_picture.f);
+ pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_picture.f, 0);
else
pp->wBackwardRefPictureIndex = 0xffff;
if (v->profile == PROFILE_ADVANCED) {