From: Edison Ling via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Edison Ling <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PR] avcodec/d3d12va_encode: Bug fix for D3D12 AV1 encoder support structure (PR #21399)
Date: Tue, 06 Jan 2026 19:51:31 -0000
Message-ID: <176772909174.25.410728626851431973@4457048688e7> (raw)
PR #21399 opened by Edison Ling (edisonling)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21399
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21399.patch
- switch from `D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT` to `D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT1` support structure if AV1 codec is part of FFmpeg configuration
- otherwise continue using `D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT`
- this adds `.SubregionFrameEncodingData.pTilesPartition_AV1 = ctx->subregions_layout.pTilesPartition_AV1` to the structure when AV1 is supported
>From 9323c2d65b565266eded7c3cfd2be44acfbca016 Mon Sep 17 00:00:00 2001
From: "Ling, Edison" <Edison.Ling+amdeng@amd.com>
Date: Tue, 6 Jan 2026 14:05:17 -0500
Subject: [PATCH] avcodec/d3d12va_encode: Bug fix for D3D12 AV1 encoder support
structure
- switch from `D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT` to `D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT1` support structure if AV1 codec is part of FFmpeg configuration
- otherwise continue using `D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT`
- this adds `.SubregionFrameEncodingData.pTilesPartition_AV1 = ctx->subregions_layout.pTilesPartition_AV1` to the structure when AV1 is supported
---
libavcodec/d3d12va_encode.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/libavcodec/d3d12va_encode.c b/libavcodec/d3d12va_encode.c
index de95518be5..d230507c1b 100644
--- a/libavcodec/d3d12va_encode.c
+++ b/libavcodec/d3d12va_encode.c
@@ -1191,7 +1191,28 @@ static int d3d12va_encode_init_motion_estimation_precision(AVCodecContext *avctx
default:
av_assert0(0);
}
+#if CONFIG_AV1_D3D12VA_ENCODER
+ D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT1 support = {
+ .NodeIndex = 0,
+ .Codec = ctx->codec->d3d12_codec,
+ .InputFormat = hwctx->format,
+ .RateControl = ctx->rc,
+ .IntraRefresh = D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE_NONE,
+ .SubregionFrameEncoding = D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_FULL_FRAME,
+ .ResolutionsListCount = 1,
+ .pResolutionList = &ctx->resolution,
+ .CodecGopSequence = ctx->gop,
+ .MaxReferenceFramesInDPB = MAX_DPB_SIZE - 1,
+ .CodecConfiguration = ctx->codec_conf,
+ .SuggestedProfile = profile,
+ .SuggestedLevel = level,
+ .pResolutionDependentSupport = &ctx->res_limits,
+ .SubregionFrameEncodingData.pTilesPartition_AV1 = ctx->subregions_layout.pTilesPartition_AV1,
+ };
+ hr = ID3D12VideoDevice3_CheckFeatureSupport(ctx->video_device3, D3D12_FEATURE_VIDEO_ENCODER_SUPPORT1,
+ &support, sizeof(support));
+#else
D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT support = {
.NodeIndex = 0,
.Codec = ctx->codec->d3d12_codec,
@@ -1211,6 +1232,7 @@ static int d3d12va_encode_init_motion_estimation_precision(AVCodecContext *avctx
hr = ID3D12VideoDevice3_CheckFeatureSupport(ctx->video_device3, D3D12_FEATURE_VIDEO_ENCODER_SUPPORT,
&support, sizeof(support));
+#endif
if (FAILED(hr)) {
av_log(avctx, AV_LOG_ERROR, "Failed to check encoder support for motion estimation.\n");
return AVERROR(EINVAL);
--
2.49.1
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
reply other threads:[~2026-01-06 19:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=176772909174.25.410728626851431973@4457048688e7 \
--to=ffmpeg-devel@ffmpeg.org \
--cc=code@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git