[vlc-commits] [Git][videolan/vlc][master] fourcc: rename VLC_CODEC_RGBA10 to VLC_CODEC_RGBA10LE

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Oct 20 11:56:07 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
6906faa1 by Steve Lhomme at 2023-10-20T11:34:24+00:00
fourcc: rename VLC_CODEC_RGBA10 to VLC_CODEC_RGBA10LE

As said in bf2f64958b262a0429d5714aa42e367d9c1f10b4, it's supposed
to match DXGI_FORMAT_R10G10B10A2_UNORM which is in fact
ABGR [1] in memory order. We declare it like 15/16-bit RGB.

We can't map it to D3D11 opaque BGRA/RGBA directly.

[1] https://learn.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format#portable-coding-for-endian-independence

- - - - -


9 changed files:

- include/vlc_fourcc.h
- modules/codec/avcodec/chroma.c
- modules/hw/d3d11/d3d11_surface.c
- modules/video_chroma/chain.c
- modules/video_chroma/dxgi_fmt.c
- modules/video_output/drm/fourcc.c
- modules/video_output/win32/d3d11_scaler.cpp
- src/misc/fourcc.c
- src/misc/fourcc_list.h


Changes:

=====================================
include/vlc_fourcc.h
=====================================
@@ -406,8 +406,8 @@
 #define VLC_CODEC_BGRA            VLC_FOURCC('B','G','R','A')
 /* 32-bit RGBA, in memory address order: "ABGR" */
 #define VLC_CODEC_ABGR            VLC_FOURCC('A','B','G','R')
-/* 32 bits BGRA 10:10:10:2 */
-#define VLC_CODEC_RGBA10          VLC_FOURCC('R','G','A','0')
+/* 32 bits Little-Endian RGBA with 10-bit colors "A2B6 b4G4 g6R2 r8" */
+#define VLC_CODEC_RGBA10LE        VLC_FOURCC('R','G','A','0')
 /* 64 bits RGBA */
 #define VLC_CODEC_RGBA64          VLC_FOURCC('R','G','A','4')
 


=====================================
modules/codec/avcodec/chroma.c
=====================================
@@ -155,7 +155,7 @@ static const struct
 #endif /* !WORDS_BIGENDIAN */
 
 #ifdef AV_PIX_FMT_X2BGR10
-    {VLC_CODEC_RGBA10, AV_PIX_FMT_X2BGR10,  COLOR_RANGE_UNDEF },
+    {VLC_CODEC_RGBA10LE, AV_PIX_FMT_X2BGR10,  COLOR_RANGE_UNDEF },
 #endif
 
     {VLC_CODEC_GREY, AV_PIX_FMT_GRAY8,  COLOR_RANGE_UNDEF},


=====================================
modules/hw/d3d11/d3d11_surface.c
=====================================
@@ -718,7 +718,6 @@ int D3D11OpenConverter( filter_t *p_filter )
         pixel_bytes = 2;
         break;
     case VLC_CODEC_RGBA:
-    case VLC_CODEC_RGBA10:
         if( p_filter->fmt_in.video.i_chroma != VLC_CODEC_D3D11_OPAQUE_RGBA )
             return VLC_EGENERIC;
         p_filter->ops = &D3D11_RGBA_ops;


=====================================
modules/video_chroma/chain.c
=====================================
@@ -104,7 +104,7 @@ static const vlc_fourcc_t pi_allowed_chromas_yuv444[] = {
 };
 
 static const vlc_fourcc_t pi_allowed_chromas_yuv444_10[] = {
-    VLC_CODEC_RGBA10,
+    VLC_CODEC_RGBA10LE,
     VLC_CODEC_RGBA64,
     ALLOWED_CHROMAS_YUV10,
     VLC_CODEC_I422,


=====================================
modules/video_chroma/dxgi_fmt.c
=====================================
@@ -57,7 +57,7 @@ static const dxgi_format_t dxgi_formats[] = {
     { "Y210",        DXGI_FORMAT_Y210,                VLC_CODEC_Y210     },
     { "Y410",        DXGI_FORMAT_Y410,                VLC_CODEC_Y410     },
     { "NV11",        DXGI_FORMAT_NV11,                0                  },
-    { "RGB10A2",     DXGI_FORMAT_R10G10B10A2_UNORM,   VLC_CODEC_RGBA10   },
+    { "RGB10A2",     DXGI_FORMAT_R10G10B10A2_UNORM,   VLC_CODEC_RGBA10LE },
     { "RGB16",       DXGI_FORMAT_R16G16B16A16_UNORM,  VLC_CODEC_RGBA64   },
     { "RGB16_FLOAT", DXGI_FORMAT_R16G16B16A16_FLOAT,  0                  },
     { "UNKNOWN",     DXGI_FORMAT_UNKNOWN,             0                  },
@@ -96,7 +96,7 @@ static const d3d_format_t d3d_formats[] = {
     { "VA_RGBA",  DXGI_FORMAT_R8G8B8A8_UNORM, VLC_CODEC_D3D11_OPAQUE_RGBA,  8, 1, 1, 1, { DXGI_FORMAT_R8G8B8A8_UNORM } },
     { "R8G8B8X8", DXGI_FORMAT_B8G8R8X8_UNORM, VLC_CODEC_BGRX ,         8, 1, 1, 1, { DXGI_FORMAT_B8G8R8X8_UNORM } },
     { "RGBA64",   DXGI_FORMAT_R16G16B16A16_UNORM, VLC_CODEC_RGBA64,   16, 1, 1, 1, { DXGI_FORMAT_R16G16B16A16_UNORM } },
-    { "RGB10A2",  DXGI_FORMAT_R10G10B10A2_UNORM, VLC_CODEC_RGBA10,    10, 1, 1, 1, { DXGI_FORMAT_R10G10B10A2_UNORM } },
+    { "RGB10A2",  DXGI_FORMAT_R10G10B10A2_UNORM, VLC_CODEC_RGBA10LE,  10, 1, 1, 1, { DXGI_FORMAT_R10G10B10A2_UNORM } },
     { "VA_RGB10", DXGI_FORMAT_R10G10B10A2_UNORM, VLC_CODEC_D3D11_OPAQUE_RGBA, 10, 1, 1, 1, { DXGI_FORMAT_R10G10B10A2_UNORM } },
     { "AYUV",     DXGI_FORMAT_AYUV,           VLC_CODEC_VUYA,          8, 1, 1, 1, { DXGI_FORMAT_R8G8B8A8_UNORM } },
     { "B5G6R5",   DXGI_FORMAT_B5G6R5_UNORM,   VLC_CODEC_RGB565LE,      5, 1, 1, 1, { DXGI_FORMAT_B5G6R5_UNORM } },


=====================================
modules/video_output/drm/fourcc.c
=====================================
@@ -119,7 +119,7 @@ static const struct {
     { DRM_FORMAT_BGRA8888, VLC_CODEC_ARGB },
     { DRM_FORMAT_RGBA8888, VLC_CODEC_ABGR },
 #ifndef WORDS_BIGENDIAN
-    { DRM_FORMAT_ABGR2101010, VLC_CODEC_RGBA10 },
+    { DRM_FORMAT_ABGR2101010, VLC_CODEC_RGBA10LE },
 #endif
 
     /* Packed RGB+x formats */


=====================================
modules/video_output/win32/d3d11_scaler.cpp
=====================================
@@ -76,7 +76,7 @@ d3d11_scaler *D3D11_UpscalerCreate(vlc_object_t *vd, d3d11_device_t *d3d_dev, vl
     if ((*out_fmt)->bitsPerChannel > 10)
         fmt = GetDirectRenderingFormat(vd, d3d_dev, VLC_CODEC_RGBA64);
     if (fmt == nullptr && (*out_fmt)->bitsPerChannel > 8)
-        fmt = GetDirectRenderingFormat(vd, d3d_dev, VLC_CODEC_RGBA10);
+        fmt = GetDirectRenderingFormat(vd, d3d_dev, VLC_CODEC_RGBA10LE);
     if (fmt == nullptr)
         fmt = GetDirectRenderingFormat(vd, d3d_dev, VLC_CODEC_RGBA);
     if (fmt == nullptr)


=====================================
src/misc/fourcc.c
=====================================
@@ -818,7 +818,7 @@ static const vlc_chroma_description_t p_list_chroma_description[] = {
     { VLC_CODEC_ARGB,                  PACKED_FMT(4, 32) },
     { VLC_CODEC_BGRA,                  PACKED_FMT(4, 32) },
     { VLC_CODEC_ABGR,                  PACKED_FMT(4, 32) },
-    { VLC_CODEC_RGBA10,                PACKED_FMT(4, 32) },
+    { VLC_CODEC_RGBA10LE,              PACKED_FMT(4, 32) },
     { VLC_CODEC_RGBA64,                PACKED_FMT(8, 64) },
     { VLC_CODEC_VUYA,                  PACKED_FMT(4, 32) },
     { VLC_CODEC_Y210,                  PACKED_FMT(4, 32) },


=====================================
src/misc/fourcc_list.h
=====================================
@@ -808,7 +808,7 @@ static const staticentry_t p_list_video[] = {
     B(VLC_CODEC_BGRA, "32 bits BGRA"),
         A("BGRA"),
     B(VLC_CODEC_ABGR, "32 bits ABGR"),
-    B(VLC_CODEC_RGBA10, "32 bits RGB 10bits A 2bits"),
+    B(VLC_CODEC_RGBA10LE, "32 bits RGB 10bits A 2bits LE"),
         A("RGA0"),
     B(VLC_CODEC_RGBA64, "64 bits RGBA"),
         A("RGA4"),



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/6906faa15f274a44e93b041ec2da5ddc5d58c2d6

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/6906faa15f274a44e93b041ec2da5ddc5d58c2d6
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list