Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PR] avcodec/d3d12va_encode: Bug fix for D3D12 AV1 encoder support structure (PR #21399)
@ 2026-01-06 19:51 Edison Ling via ffmpeg-devel
  0 siblings, 0 replies; only message in thread
From: Edison Ling via ffmpeg-devel @ 2026-01-06 19:51 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Edison Ling

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-01-06 19:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-06 19:51 [FFmpeg-devel] [PR] avcodec/d3d12va_encode: Bug fix for D3D12 AV1 encoder support structure (PR #21399) Edison Ling via ffmpeg-devel

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