[FFmpeg-devel] [PATCH] avcodec/d3d12va_vc1: add support for D3D12_VIDEO_DECODE_PROFILE_VC1_D2010 guid.

Tong Wu tong1.wu at intel.com
Wed Jan 31 13:30:27 EET 2024


From: Aleksoid <Aleksoid1978 at mail.ru>

The VC1_D2010 profile, also known as VC1_VLD2010, has the same functionality
and specification as the VC1_D profile. Support for this profile serves only
as a positive indication that the accelerator has been designed with awareness
of the modifications specified in the August 2010 version of this specification.

Hardware accelerator drivers that expose support for this profile must not
also expose the previously specified VC1_D GUID, unless the accelerator works
properly with existing software decoders that use VC1_D and that do not incorporate
the corrections added to the August 2010 version of this specification.

As a result, we could give VC1_VLD2010 a higher priority and initialize
it first.

Signed-off-by: Aleksoid <Aleksoid1978 at mail.ru>
Signed-off-by: Tong Wu <tong1.wu at intel.com>
---
 libavcodec/d3d12va_vc1.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/libavcodec/d3d12va_vc1.c b/libavcodec/d3d12va_vc1.c
index 3aa2743107..110926be82 100644
--- a/libavcodec/d3d12va_vc1.c
+++ b/libavcodec/d3d12va_vc1.c
@@ -164,12 +164,19 @@ static int d3d12va_vc1_end_frame(AVCodecContext *avctx)
 
 static int d3d12va_vc1_decode_init(AVCodecContext *avctx)
 {
+    int ret;
     D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
-    ctx->cfg.DecodeProfile = D3D12_VIDEO_DECODE_PROFILE_VC1;
+    ctx->cfg.DecodeProfile = D3D12_VIDEO_DECODE_PROFILE_VC1_D2010;
 
     ctx->max_num_ref = 3;
 
-    return ff_d3d12va_decode_init(avctx);
+    ret = ff_d3d12va_decode_init(avctx);
+    if (ret < 0) {
+        ctx->cfg.DecodeProfile = D3D12_VIDEO_DECODE_PROFILE_VC1;
+        ret = ff_d3d12va_decode_init(avctx);
+    }
+
+    return ret;
 }
 
 #if CONFIG_WMV3_D3D12VA_HWACCEL
-- 
2.43.0.windows.1



More information about the ffmpeg-devel mailing list