diff mbox series

[FFmpeg-devel] lavu/hwcontext_cuda: declare support for argb/abgr/rgba/bgra

Message ID 20230611025935.21732-1-philipl@overt.org
State New
Headers show
Series [FFmpeg-devel] lavu/hwcontext_cuda: declare support for argb/abgr/rgba/bgra | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Philip Langdale June 11, 2023, 2:59 a.m. UTC
These are physically compatible formats and are potentially useful.

Signed-off-by: Philip Langdale <philipl@overt.org>
---
 libavutil/hwcontext_cuda.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Philip Langdale June 15, 2023, 7:38 p.m. UTC | #1
On Sat, 10 Jun 2023 19:59:35 -0700
Philip Langdale <philipl@overt.org> wrote:

> These are physically compatible formats and are potentially useful.
> 
> Signed-off-by: Philip Langdale <philipl@overt.org>
> ---
>  libavutil/hwcontext_cuda.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/libavutil/hwcontext_cuda.c b/libavutil/hwcontext_cuda.c
> index 5ae7711c94..22eb9f5513 100644
> --- a/libavutil/hwcontext_cuda.c
> +++ b/libavutil/hwcontext_cuda.c
> @@ -45,6 +45,10 @@ static const enum AVPixelFormat
> supported_formats[] = { AV_PIX_FMT_YUV444P16,
>      AV_PIX_FMT_0RGB32,
>      AV_PIX_FMT_0BGR32,
> +    AV_PIX_FMT_ARGB,
> +    AV_PIX_FMT_ABGR,
> +    AV_PIX_FMT_RGBA,
> +    AV_PIX_FMT_BGRA,
>  #if CONFIG_VULKAN
>      AV_PIX_FMT_VULKAN,
>  #endif

After discussion with Timo, pushed as:

> @@ -45,6 +45,8 @@ static const enum AVPixelFormat supported_formats[]
> = { AV_PIX_FMT_YUV444P16,
>      AV_PIX_FMT_0RGB32,
>      AV_PIX_FMT_0BGR32,
> +    AV_PIX_FMT_RGB32,
> +    AV_PIX_FMT_BGR32,
>  #if CONFIG_VULKAN
>      AV_PIX_FMT_VULKAN,
>  #endif

to fix that nvenc accepts RGB32 and BGR32 but the hwcontext does not.

RGB32 and BGR32 map to RGBA and BGRA on little-endian, so it achieves
the main result I was originally looking for as well.

--phil
diff mbox series

Patch

diff --git a/libavutil/hwcontext_cuda.c b/libavutil/hwcontext_cuda.c
index 5ae7711c94..22eb9f5513 100644
--- a/libavutil/hwcontext_cuda.c
+++ b/libavutil/hwcontext_cuda.c
@@ -45,6 +45,10 @@  static const enum AVPixelFormat supported_formats[] = {
     AV_PIX_FMT_YUV444P16,
     AV_PIX_FMT_0RGB32,
     AV_PIX_FMT_0BGR32,
+    AV_PIX_FMT_ARGB,
+    AV_PIX_FMT_ABGR,
+    AV_PIX_FMT_RGBA,
+    AV_PIX_FMT_BGRA,
 #if CONFIG_VULKAN
     AV_PIX_FMT_VULKAN,
 #endif