[PR] avutil/hwcontext_d3d11va: support native P016 format (PR #23552)

Kacper Michajłow via ffmpeg-devel <[email protected]>
Newsgroups gmane.comp.video.ffmpeg.devel
Message-ID <178212367424.59.7881232474422545794@29965ddac10e>
PR #23552 opened by Kacper Michajłow (kasper93)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23552
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23552.patch

Map DXGI_FORMAT_P016 to AV_PIX_FMT_P016 and keep the 12-bit P012 as a
compatibility entry, matching how Y216 and Y416 already expose both their
native 16-bit and 12-bit variants.


From e703db2da3518a48c84a517dc31f300149b05654 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
Date: Mon, 22 Jun 2026 12:19:19 +0200
Subject: [PATCH] avutil/hwcontext_d3d11va: support native P016 format
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Map DXGI_FORMAT_P016 to AV_PIX_FMT_P016 and keep the 12-bit P012 as a
compatibility entry, matching how Y216 and Y416 already expose both their
native 16-bit and 12-bit variants.

Signed-off-by: Kacper Michajłow <[email protected]>
---
 libavutil/hwcontext_d3d11va.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavutil/hwcontext_d3d11va.c b/libavutil/hwcontext_d3d11va.c
index 418fe9dfda..834c2ce3dd 100644
--- a/libavutil/hwcontext_d3d11va.c
+++ b/libavutil/hwcontext_d3d11va.c
@@ -103,11 +103,12 @@ static const struct {
     { DXGI_FORMAT_YUY2,         AV_PIX_FMT_YUYV422 },
     { DXGI_FORMAT_Y210,         AV_PIX_FMT_Y210 },
     { DXGI_FORMAT_Y410,         AV_PIX_FMT_XV30 },
-    { DXGI_FORMAT_P016,         AV_PIX_FMT_P012 },
+    { DXGI_FORMAT_P016,         AV_PIX_FMT_P016 },
     { DXGI_FORMAT_Y216,         AV_PIX_FMT_Y216 },
     { DXGI_FORMAT_Y416,         AV_PIX_FMT_XV48 },
     // There is no 12bit pixel format defined in DXGI_FORMAT*, use 16bit to compatible
     // with 12 bit AV_PIX_FMT* formats.
+    { DXGI_FORMAT_P016,         AV_PIX_FMT_P012 },
     { DXGI_FORMAT_Y216,         AV_PIX_FMT_Y212 },
     { DXGI_FORMAT_Y416,         AV_PIX_FMT_XV36 },
     // Special opaque formats. The pix_fmt is merely a place holder, as the
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.