Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Philip Langdale <philipl@overt.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Philip Langdale <philipl@overt.org>
Subject: [FFmpeg-devel] [PATCH 3/3] lavu/hwcontext_[vaapi|vulkan]: support mapping VUYA and Y416
Date: Sun, 14 Aug 2022 14:33:13 -0700
Message-ID: <20220814213313.37948-4-philipl@overt.org> (raw)
In-Reply-To: <20220814213313.37948-1-philipl@overt.org>

These two of the Microsoft formats used by Intel VAAPI are sufficiently
conventional that we can add simple mappings for them in the hwcontexts
to enable back and forth mapping so that Vulkan filters can be used
with vaapi decoding/encoding of these formats.

Signed-off-by: Philip Langdale <philipl@overt.org>
---
 libavutil/hwcontext_vaapi.c  | 4 ++++
 libavutil/hwcontext_vulkan.c | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index c3e79907fd..d2d327567e 100644
--- a/libavutil/hwcontext_vaapi.c
+++ b/libavutil/hwcontext_vaapi.c
@@ -1021,6 +1021,10 @@ static const struct {
 #endif
     DRM_MAP(ARGB, 1, DRM_FORMAT_BGRA8888),
     DRM_MAP(XRGB, 1, DRM_FORMAT_BGRX8888),
+#ifdef VA_FOURCC_Y416
+    DRM_MAP(AYUV, 1, DRM_FORMAT_AYUV),
+    DRM_MAP(Y416, 1, DRM_FORMAT_Y416),
+#endif
 };
 #undef DRM_MAP
 
diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 237caa4bc0..be08238ff3 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -210,6 +210,9 @@ static const struct {
     { AV_PIX_FMT_YUVA444P12, { VK_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM } },
     { AV_PIX_FMT_YUVA444P16, { VK_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM } },
 
+    { AV_PIX_FMT_VUYA,   { VK_FORMAT_R8G8B8A8_UNORM } },
+    { AV_PIX_FMT_Y416,   { VK_FORMAT_R16G16B16A16_UNORM } },
+
     { AV_PIX_FMT_BGRA,   { VK_FORMAT_B8G8R8A8_UNORM } },
     { AV_PIX_FMT_RGBA,   { VK_FORMAT_R8G8B8A8_UNORM } },
     { AV_PIX_FMT_RGB24,  { VK_FORMAT_R8G8B8_UNORM } },
@@ -2629,6 +2632,9 @@ static const struct {
     { DRM_FORMAT_XRGB8888, VK_FORMAT_B8G8R8A8_UNORM },
     { DRM_FORMAT_ABGR8888, VK_FORMAT_R8G8B8A8_UNORM },
     { DRM_FORMAT_XBGR8888, VK_FORMAT_R8G8B8A8_UNORM },
+
+    { DRM_FORMAT_AYUV,     VK_FORMAT_R8G8B8A8_UNORM     },
+    { DRM_FORMAT_Y416,     VK_FORMAT_R16G16B16A16_UNORM },
 };
 
 static inline VkFormat drm_to_vulkan_fmt(uint32_t drm_fourcc)
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

      parent reply	other threads:[~2022-08-14 21:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-14 21:33 [FFmpeg-devel] [PATCH 0/3] V2: VAAPI: Add high bit depth encode/decode support Philip Langdale
2022-08-14 21:33 ` [FFmpeg-devel] [PATCH 1/3] lavu/pixfmt: Add Y216, Y410, and Y416 formats Philip Langdale
2022-08-15  6:12   ` Xiang, Haihao
2022-08-15 17:42     ` Philip Langdale
2022-08-15 23:06       ` Philip Langdale
2022-08-14 21:33 ` [FFmpeg-devel] [PATCH 2/3] lavc/vaapi: Add support for remaining 10/12bit profiles Philip Langdale
2022-08-15 22:10   ` Michael Niedermayer
2022-08-15 22:23     ` Philip Langdale
2022-08-16 17:29       ` Michael Niedermayer
2022-08-16 19:52         ` Philip Langdale
2022-08-16 19:55           ` Philip Langdale
2022-08-17 14:34             ` Michael Niedermayer
2022-08-14 21:33 ` Philip Langdale [this message]

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=20220814213313.37948-4-philipl@overt.org \
    --to=philipl@overt.org \
    --cc=ffmpeg-devel@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