From patchwork Fri Jun 2 08:06:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wu, Tong1" X-Patchwork-Id: 41951 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c51c:b0:10c:5e6f:955f with SMTP id gm28csp1055194pzb; Fri, 2 Jun 2023 01:12:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ737qTRG65cNez/q08nSdMA+NnLeT5ChBvtABiUxqhyaidLv9uVyr17GSC5vjjIs9xG/jdo X-Received: by 2002:a17:906:4fc3:b0:974:2169:5f81 with SMTP id i3-20020a1709064fc300b0097421695f81mr11445094ejw.22.1685693527752; Fri, 02 Jun 2023 01:12:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685693527; cv=none; d=google.com; s=arc-20160816; b=GqhRaA7M/jyxHr4rMtVIVziWZBVmj8XIyzs8LNNXWiYQCSMkJEIDuzolq7OlCRmnEC +7iMlqiE+NPpLAFzUpbv93cZ/4sjdcBoIAAcMMghA/+vO2nSBk5stY1p/EP08uvlMHR4 ufWzaFlH72xiU5zlmnQouA6acp7tJ/vH2ArmXWDuA09r/ylZ3bcaW4G6sqrWnNov4EHR ldYBhGuMdKGYBitIRpCerCWAwXGRDZ5ZcriOUp+lNSSJGPSKTH43tnk+yfoIOvOFFzrP MsAw/uFCXrKZZv0E4p7eRC1f/BDuctu6N5RaGTSKulp4A3b6dW3nIaCLCW0BChwyss9B j5oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=ZGwl4QWtZwD8Xj2A6MgI4rH3jUjefIWJOPrp2Tq7t9s=; b=xqAFvMvf4oI5TLEEVa0XsbDTGvM4sQGFWf2EymZV7L225LLSNxMLxzndHNV+BK3IFZ kO73L3PtoA6+W7KrJtei+vole2Zik127fd5gSUoQKg3PKmCxw5SQwouQcSotZDc6Cd03 EyErPwgawT53qFrYWiO0o6aMitSItqbcl+o+2g4Y3zAkNeM3ZiFzxp9GxhSbMYEwLEdW 4TgmmpkhVUHX43EnkTbhBJdtXbZMEyK/GBTepJtTFU+CjOf9fgHoBL0ROi+AFNWvH1qf s0GLMU3NMqH+OaIWEsuBcbAyI84E+jiJMfbKvrapFhi+cOSy9RvKXC7xJk1H7Ihp1keB XsLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=SWFf1XiY; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id n7-20020a170906700700b0094a86ccb630si446342ejj.893.2023.06.02.01.12.07; Fri, 02 Jun 2023 01:12:07 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=SWFf1XiY; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 93BC968C329; Fri, 2 Jun 2023 11:11:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7300868C31A for ; Fri, 2 Jun 2023 11:11:37 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685693502; x=1717229502; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7xsawuJEMa1kODF9OZQzU4hPSwfBtZgZdtt1ALHRO+o=; b=SWFf1XiYN/tsso8oKvdW+LP54EwKKapdkFhFYE1U+so9j+yyJNvpKQjB /OPYyzU/6fDGqDATJzM8U3CvC0atVItm5/8VqRA2sPoCGgmkJu9IgzgNs kOPpWtRr63Rj5W2wQGSfXJ/L8JdZUaUkiFOGpLuYCM68KIygmgXtVHwKB u1cCJAfxWaeMQQAeyzEWRJApIWSL1viWHwZAo5nhxJHkQEZWdaD2380NE 6/wYmHX+/OYPBr1TkOvVSpUNiXrRZStMoc6PTVLWhYf5pPUpjFySD76sD +gySF6nbXp4yOEF6MaInd0YhYWV/eJz62OPuM3NWI42aeo+1B4YVBzks8 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10728"; a="421629856" X-IronPort-AV: E=Sophos;i="6.00,212,1681196400"; d="scan'208";a="421629856" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2023 01:11:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10728"; a="852060671" X-IronPort-AV: E=Sophos;i="6.00,212,1681196400"; d="scan'208";a="852060671" Received: from desktop-qn7n0nf.sh.intel.com (HELO localhost.localdomain) ([10.239.160.59]) by fmsmga001.fm.intel.com with ESMTP; 02 Jun 2023 01:11:21 -0700 From: Tong Wu To: ffmpeg-devel@ffmpeg.org Date: Fri, 2 Jun 2023 16:06:55 +0800 Message-Id: <20230602080701.1754-3-tong1.wu@intel.com> X-Mailer: git-send-email 2.35.1.windows.2 In-Reply-To: <20230602080701.1754-1-tong1.wu@intel.com> References: <20230602080701.1754-1-tong1.wu@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 3/9] avcodec: add D3D12VA hardware accelerated HEVC decoding X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Tong Wu , Wu Jianhua Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 28X8Xpr5+m+8 From: Wu Jianhua The command below is how to enable d3d12va: ffmpeg -hwaccel d3d12va -i input.mp4 output.mp4 Signed-off-by: Wu Jianhua Signed-off-by: Tong Wu --- configure | 2 + libavcodec/Makefile | 1 + libavcodec/d3d12va_hevc.c | 211 ++++++++++++++++++++++++++++++++++++ libavcodec/dxva2_hevc.c | 10 +- libavcodec/dxva2_internal.h | 4 + libavcodec/hevcdec.c | 10 ++ libavcodec/hwaccels.h | 1 + 7 files changed, 235 insertions(+), 4 deletions(-) create mode 100644 libavcodec/d3d12va_hevc.c diff --git a/configure b/configure index f5dad4653f..3d25e5fdea 100755 --- a/configure +++ b/configure @@ -3051,6 +3051,8 @@ hevc_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_HEVC" hevc_d3d11va_hwaccel_select="hevc_decoder" hevc_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_HEVC" hevc_d3d11va2_hwaccel_select="hevc_decoder" +hevc_d3d12va_hwaccel_deps="d3d12va DXVA_PicParams_HEVC" +hevc_d3d12va_hwaccel_select="hevc_decoder" hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC" hevc_dxva2_hwaccel_select="hevc_decoder" hevc_nvdec_hwaccel_deps="nvdec" diff --git a/libavcodec/Makefile b/libavcodec/Makefile index ae143d8821..6cc28f2fd0 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -1004,6 +1004,7 @@ OBJS-$(CONFIG_H264_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o OBJS-$(CONFIG_H264_VULKAN_HWACCEL) += vulkan_decode.o vulkan_h264.o OBJS-$(CONFIG_HEVC_D3D11VA_HWACCEL) += dxva2_hevc.o OBJS-$(CONFIG_HEVC_DXVA2_HWACCEL) += dxva2_hevc.o +OBJS-$(CONFIG_HEVC_D3D12VA_HWACCEL) += dxva2_hevc.o d3d12va_hevc.o OBJS-$(CONFIG_HEVC_NVDEC_HWACCEL) += nvdec_hevc.o OBJS-$(CONFIG_HEVC_QSV_HWACCEL) += qsvdec.o OBJS-$(CONFIG_HEVC_VAAPI_HWACCEL) += vaapi_hevc.o h265_profile_level.o diff --git a/libavcodec/d3d12va_hevc.c b/libavcodec/d3d12va_hevc.c new file mode 100644 index 0000000000..1d94831e01 --- /dev/null +++ b/libavcodec/d3d12va_hevc.c @@ -0,0 +1,211 @@ +/* + * Direct3D 12 HEVC HW acceleration + * + * copyright (c) 2022-2023 Wu Jianhua + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "config_components.h" + +#include "libavutil/avassert.h" +#include "libavutil/hwcontext_d3d12va_internal.h" +#include "hevc_data.h" +#include "hevcdec.h" +#include "dxva2_internal.h" +#include "d3d12va.h" +#include + +#define MAX_SLICES 256 + +typedef struct HEVCDecodePictureContext { + DXVA_PicParams_HEVC pp; + DXVA_Qmatrix_HEVC qm; + unsigned slice_count; + DXVA_Slice_HEVC_Short slice_short[MAX_SLICES]; + const uint8_t *bitstream; + unsigned bitstream_size; +} HEVCDecodePictureContext; + +static void fill_slice_short(DXVA_Slice_HEVC_Short *slice, unsigned position, unsigned size) +{ + memset(slice, 0, sizeof(*slice)); + slice->BSNALunitDataLocation = position; + slice->SliceBytesInBuffer = size; + slice->wBadSliceChopping = 0; +} + +static int d3d12va_hevc_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size) +{ + const HEVCContext *h = avctx->priv_data; + D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx); + HEVCDecodePictureContext *ctx_pic = h->ref->hwaccel_picture_private; + + if (!ctx) + return -1; + + av_assert0(ctx_pic); + + ff_dxva2_hevc_fill_picture_parameters(avctx, (AVDXVAContext *)ctx, &ctx_pic->pp); + + ff_dxva2_hevc_fill_scaling_lists(avctx, (AVDXVAContext *)ctx, &ctx_pic->qm); + + ctx_pic->slice_count = 0; + ctx_pic->bitstream_size = 0; + ctx_pic->bitstream = NULL; + + return 0; +} + +static int d3d12va_hevc_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) +{ + const HEVCContext *h = avctx->priv_data; + const HEVCFrame *current_picture = h->ref; + HEVCDecodePictureContext *ctx_pic = current_picture->hwaccel_picture_private; + unsigned position; + + if (ctx_pic->slice_count >= MAX_SLICES) + return AVERROR(ERANGE); + + if (!ctx_pic->bitstream) + ctx_pic->bitstream = buffer; + ctx_pic->bitstream_size += size; + + position = buffer - ctx_pic->bitstream; + fill_slice_short(&ctx_pic->slice_short[ctx_pic->slice_count], position, size); + ctx_pic->slice_count++; + + return 0; +} + +#define START_CODE 65536 +#define START_CODE_SIZE 3 +static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource *buffer) +{ + D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx); + AVHWFramesContext *frames_ctx = D3D12VA_FRAMES_CONTEXT(avctx); + AVD3D12VAFramesContext *frames_hwctx = frames_ctx->hwctx; + + const HEVCContext *h = avctx->priv_data; + const HEVCFrame *current_picture = h->ref; + HEVCDecodePictureContext *ctx_pic = current_picture->hwaccel_picture_private; + + int i, index; + uint8_t *mapped_data, *mapped_ptr; + DXVA_Slice_HEVC_Short *slice; + D3D12_VIDEO_DECODE_FRAME_ARGUMENT *args; + + if (FAILED(ID3D12Resource_Map(buffer, 0, NULL, &mapped_data))) { + av_log(avctx, AV_LOG_ERROR, "Failed to map D3D12 Buffer resource!\n"); + return AVERROR(EINVAL); + } + + mapped_ptr = mapped_data; + for (i = 0; i < ctx_pic->slice_count; i++) { + UINT position, size; + slice = &ctx_pic->slice_short[i]; + + position = slice->BSNALunitDataLocation; + size = slice->SliceBytesInBuffer; + + slice->SliceBytesInBuffer += START_CODE_SIZE; + slice->BSNALunitDataLocation = mapped_ptr - mapped_data; + + *(uint32_t *)mapped_ptr = START_CODE; + mapped_ptr += START_CODE_SIZE; + + memcpy(mapped_ptr, &ctx_pic->bitstream[position], size); + mapped_ptr += size; + } + + ID3D12Resource_Unmap(buffer, 0, NULL); + + input_args->CompressedBitstream = (D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM){ + .pBuffer = buffer, + .Offset = 0, + .Size = mapped_ptr - mapped_data, + }; + + args = &input_args->FrameArguments[input_args->NumFrameArguments++]; + args->Type = D3D12_VIDEO_DECODE_ARGUMENT_TYPE_SLICE_CONTROL; + args->Size = sizeof(DXVA_Slice_HEVC_Short) * ctx_pic->slice_count; + args->pData = ctx_pic->slice_short; + + index = ctx_pic->pp.CurrPic.Index7Bits; + ctx->ref_resources[index] = frames_hwctx->texture_infos[index].texture; + for (i = 0; i < FF_ARRAY_ELEMS(ctx_pic->pp.RefPicList); i++) { + index = ctx_pic->pp.RefPicList[i].Index7Bits; + if (index != 0x7f) + ctx->ref_resources[index] = frames_hwctx->texture_infos[index].texture; + } + + return 0; +} + +static int d3d12va_hevc_end_frame(AVCodecContext *avctx) +{ + HEVCContext *h = avctx->priv_data; + HEVCDecodePictureContext *ctx_pic = h->ref->hwaccel_picture_private; + + int scale = ctx_pic->pp.dwCodingParamToolFlags & 1; + + if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) + return -1; + + return ff_d3d12va_common_end_frame(avctx, h->ref->frame, &ctx_pic->pp, sizeof(ctx_pic->pp), + scale ? &ctx_pic->qm : NULL, scale ? sizeof(ctx_pic->qm) : 0, update_input_arguments); +} + +static int d3d12va_hevc_decode_init(AVCodecContext *avctx) +{ + HEVCContext *h = avctx->priv_data; + D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx); + + switch (avctx->profile) { + case FF_PROFILE_HEVC_MAIN_10: + ctx->cfg.DecodeProfile = D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN10; + break; + + case FF_PROFILE_HEVC_MAIN_STILL_PICTURE: + av_log(avctx, AV_LOG_ERROR, "D3D12 doesn't support PROFILE_HEVC_MAIN_STILL_PICTURE!\n"); + return AVERROR(EINVAL); + + case FF_PROFILE_HEVC_MAIN: + default: + ctx->cfg.DecodeProfile = D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN; + break; + }; + + return ff_d3d12va_decode_init(avctx); +} + +#if CONFIG_HEVC_D3D12VA_HWACCEL +const AVHWAccel ff_hevc_d3d12va_hwaccel = { + .name = "hevc_d3d12va", + .type = AVMEDIA_TYPE_VIDEO, + .id = AV_CODEC_ID_HEVC, + .pix_fmt = AV_PIX_FMT_D3D12, + .init = d3d12va_hevc_decode_init, + .uninit = ff_d3d12va_decode_uninit, + .start_frame = d3d12va_hevc_start_frame, + .decode_slice = d3d12va_hevc_decode_slice, + .end_frame = d3d12va_hevc_end_frame, + .frame_params = ff_d3d12va_common_frame_params, + .frame_priv_data_size = sizeof(HEVCDecodePictureContext), + .priv_data_size = sizeof(D3D12VADecodeContext), +}; +#endif diff --git a/libavcodec/dxva2_hevc.c b/libavcodec/dxva2_hevc.c index 6b239d9917..2b8c0e2a9a 100644 --- a/libavcodec/dxva2_hevc.c +++ b/libavcodec/dxva2_hevc.c @@ -56,9 +56,10 @@ static int get_refpic_index(const DXVA_PicParams_HEVC *pp, int surface_index) return 0xff; } -static void fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *ctx, const HEVCContext *h, +void ff_dxva2_hevc_fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_PicParams_HEVC *pp) { + const HEVCContext *h = avctx->priv_data; const HEVCFrame *current_picture = h->ref; const HEVCSPS *sps = h->ps.sps; const HEVCPPS *pps = h->ps.pps; @@ -199,8 +200,9 @@ static void fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext * pp->StatusReportFeedbackNumber = 1 + DXVA_CONTEXT_REPORT_ID(avctx, ctx)++; } -static void fill_scaling_lists(AVDXVAContext *ctx, const HEVCContext *h, DXVA_Qmatrix_HEVC *qm) +void ff_dxva2_hevc_fill_scaling_lists(const AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_Qmatrix_HEVC *qm) { + const HEVCContext *h = avctx->priv_data; unsigned i, j, pos; const ScalingList *sl = h->ps.pps->scaling_list_data_present_flag ? &h->ps.pps->scaling_list : &h->ps.sps->scaling_list; @@ -368,10 +370,10 @@ static int dxva2_hevc_start_frame(AVCodecContext *avctx, av_assert0(ctx_pic); /* Fill up DXVA_PicParams_HEVC */ - fill_picture_parameters(avctx, ctx, h, &ctx_pic->pp); + ff_dxva2_hevc_fill_picture_parameters(avctx, ctx, &ctx_pic->pp); /* Fill up DXVA_Qmatrix_HEVC */ - fill_scaling_lists(ctx, h, &ctx_pic->qm); + ff_dxva2_hevc_fill_scaling_lists(avctx, ctx, &ctx_pic->qm); ctx_pic->slice_count = 0; ctx_pic->bitstream_size = 0; diff --git a/libavcodec/dxva2_internal.h b/libavcodec/dxva2_internal.h index a9a1fc090e..08847aef22 100644 --- a/libavcodec/dxva2_internal.h +++ b/libavcodec/dxva2_internal.h @@ -166,4 +166,8 @@ void ff_dxva2_h264_fill_picture_parameters(const AVCodecContext *avctx, AVDXVACo void ff_dxva2_h264_fill_scaling_lists(const AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_Qmatrix_H264 *qm); +void ff_dxva2_hevc_fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_PicParams_HEVC *pp); + +void ff_dxva2_hevc_fill_scaling_lists(const AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_Qmatrix_HEVC *qm); + #endif /* AVCODEC_DXVA2_INTERNAL_H */ diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index eee77ec4db..f515725aa7 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -402,6 +402,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps) { #define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL + \ CONFIG_HEVC_D3D11VA_HWACCEL * 2 + \ + CONFIG_HEVC_D3D12VA_HWACCEL + \ CONFIG_HEVC_NVDEC_HWACCEL + \ CONFIG_HEVC_VAAPI_HWACCEL + \ CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL + \ @@ -419,6 +420,9 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps) *fmt++ = AV_PIX_FMT_D3D11VA_VLD; *fmt++ = AV_PIX_FMT_D3D11; #endif +#if CONFIG_HEVC_D3D12VA_HWACCEL + *fmt++ = AV_PIX_FMT_D3D12; +#endif #if CONFIG_HEVC_VAAPI_HWACCEL *fmt++ = AV_PIX_FMT_VAAPI; #endif @@ -443,6 +447,9 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps) *fmt++ = AV_PIX_FMT_D3D11VA_VLD; *fmt++ = AV_PIX_FMT_D3D11; #endif +#if CONFIG_HEVC_D3D12VA_HWACCEL + *fmt++ = AV_PIX_FMT_D3D12; +#endif #if CONFIG_HEVC_VAAPI_HWACCEL *fmt++ = AV_PIX_FMT_VAAPI; #endif @@ -3778,6 +3785,9 @@ const FFCodec ff_hevc_decoder = { #if CONFIG_HEVC_D3D11VA2_HWACCEL HWACCEL_D3D11VA2(hevc), #endif +#if CONFIG_HEVC_D3D12VA_HWACCEL + HWACCEL_D3D12VA(hevc), +#endif #if CONFIG_HEVC_NVDEC_HWACCEL HWACCEL_NVDEC(hevc), #endif diff --git a/libavcodec/hwaccels.h b/libavcodec/hwaccels.h index be54604b81..70e115f78a 100644 --- a/libavcodec/hwaccels.h +++ b/libavcodec/hwaccels.h @@ -41,6 +41,7 @@ extern const AVHWAccel ff_h264_videotoolbox_hwaccel; extern const AVHWAccel ff_h264_vulkan_hwaccel; extern const AVHWAccel ff_hevc_d3d11va_hwaccel; extern const AVHWAccel ff_hevc_d3d11va2_hwaccel; +extern const AVHWAccel ff_hevc_d3d12va_hwaccel; extern const AVHWAccel ff_hevc_dxva2_hwaccel; extern const AVHWAccel ff_hevc_nvdec_hwaccel; extern const AVHWAccel ff_hevc_vaapi_hwaccel;