[vlc-commits] [Git][videolan/vlc][master] 3 commits: fourcc: use ARRAY_SIZE to iterate the chroma description list

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Oct 10 18:45:00 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
53fff425 by Steve Lhomme at 2023-10-10T18:26:38+00:00
fourcc: use ARRAY_SIZE to iterate the chroma description list

This should be slightly faster than dereferencing the table fourcc.
And it makes the table 1 item smaller!

- - - - -
5acc3f6f by Steve Lhomme at 2023-10-10T18:26:38+00:00
fourcc: flatten the chroma description list

Having holes in the list makes iterating slower.

Eventually each chroma should be unique and so should have a unique
chroma description.

- - - - -
10c001bc by Steve Lhomme at 2023-10-10T18:26:38+00:00
vlc_fourcc: store the VLC FourCC in the chroma description

So we can pass a chroma description in place of a chroma, rather than having
to combine them.

It's the same storage size in memory/code but provides extra possibilities.

- - - - -


2 changed files:

- include/vlc_fourcc.h
- src/misc/fourcc.c


Changes:

=====================================
include/vlc_fourcc.h
=====================================
@@ -802,6 +802,7 @@ VLC_API bool vlc_fourcc_AreUVPlanesSwapped(vlc_fourcc_t , vlc_fourcc_t );
  * Chroma related information.
  */
 typedef struct {
+    vlc_fourcc_t fcc;
     unsigned plane_count;
     struct {
         vlc_rational_t w;


=====================================
src/misc/fourcc.c
=====================================
@@ -687,166 +687,180 @@ bool vlc_fourcc_IsYUV(vlc_fourcc_t fcc)
 }
 
 #define PLANAR(n, w_den, h_den, size, bits) \
-    { .plane_count = n, \
+      .plane_count = n, \
       .p = { {.w = {1,    1}, .h = {1,    1}}, \
              {.w = {1,w_den}, .h = {1,h_den}}, \
              {.w = {1,w_den}, .h = {1,h_den}}, \
              {.w = {1,    1}, .h = {1,    1}} }, \
       .pixel_size = size, \
-      .pixel_bits = bits }
+      .pixel_bits = bits
 
 #define PLANAR_8(n, w_den, h_den)        PLANAR(n, w_den, h_den, 1, 8)
 #define PLANAR_16(n, w_den, h_den, bits) PLANAR(n, w_den, h_den, 2, bits)
 
 #define SEMIPLANAR(w_den, h_den, size, bits) \
-    { .plane_count = 2, \
+      .plane_count = 2, \
       .p = { {.w = {1,    1}, .h = {1,    1}}, \
              {.w = {2,w_den}, .h = {1,h_den}} }, \
       .pixel_size = size, \
-      .pixel_bits = bits }
+      .pixel_bits = bits
 
 #define PACKED_FMT(size, bits) \
-    { .plane_count = 1, \
+      .plane_count = 1, \
       .p = { {.w = {1,1}, .h = {1,1}} }, \
       .pixel_size = size, \
-      .pixel_bits = bits }
+      .pixel_bits = bits
 
 /* Zero planes for hardware picture handles. Cannot be manipulated directly. */
 #define FAKE_FMT() \
-    { .plane_count = 0, \
+      .plane_count = 0, \
       .p = { {.w = {1,1}, .h = {1,1}} }, \
       .pixel_size = 0, \
-      .pixel_bits = 0 }
-
-static const struct
-{
-    vlc_fourcc_t             p_fourcc[4];
-    vlc_chroma_description_t description;
-} p_list_chroma_description[] = {
-    { { VLC_CODEC_I411 },                      PLANAR_8(3, 4, 1) },
-    { { VLC_CODEC_YUV_PLANAR_410 },            PLANAR_8(3, 4, 4) },
-    { { VLC_CODEC_YUV_PLANAR_420 },            PLANAR_8(3, 2, 2) },
-    { { VLC_CODEC_NV12, VLC_CODEC_NV21 },      SEMIPLANAR(2, 2, 1, 8) },
-    { { VLC_CODEC_I422 },                      PLANAR_8(3, 2, 1) },
-    { { VLC_CODEC_NV16, VLC_CODEC_NV61 },      SEMIPLANAR(2, 1, 1, 8) },
-    { { VLC_CODEC_I440 },                      PLANAR_8(3, 1, 2) },
-    { { VLC_CODEC_I444 },                      PLANAR_8(3, 1, 1) },
-    { { VLC_CODEC_NV24, VLC_CODEC_NV42 },      SEMIPLANAR(1, 1, 1, 8) },
-    { { VLC_CODEC_YUVA },                      PLANAR_8(4, 1, 1) },
-    { { VLC_CODEC_YUV420A },                   PLANAR_8(4, 2, 2) },
-    { { VLC_CODEC_YUV422A },                   PLANAR_8(4, 2, 1) },
-
-    { { VLC_CODEC_GBR_PLANAR },                PLANAR_8(3, 1, 1) },
-    { { VLC_CODEC_GBR_PLANAR_9L,
-        VLC_CODEC_GBR_PLANAR_9B },             PLANAR_16(3, 1, 1, 9) },
-    { { VLC_CODEC_GBR_PLANAR_10L,
-        VLC_CODEC_GBR_PLANAR_10B },            PLANAR_16(3, 1, 1, 10) },
-    { { VLC_CODEC_GBR_PLANAR_12L,
-        VLC_CODEC_GBR_PLANAR_12B },            PLANAR_16(3, 1, 1, 12) },
-    { { VLC_CODEC_GBR_PLANAR_14L,
-        VLC_CODEC_GBR_PLANAR_14B },            PLANAR_16(3, 1, 1, 14) },
-    { { VLC_CODEC_GBR_PLANAR_16L,
-        VLC_CODEC_GBR_PLANAR_16B },            PLANAR_16(3, 1, 1, 16) },
-    { { VLC_CODEC_GBRA_PLANAR },               PLANAR_8(4, 1, 1) },
-    { { VLC_CODEC_GBRA_PLANAR_10L,
-        VLC_CODEC_GBRA_PLANAR_10B },           PLANAR_16(4, 1, 1, 10) },
-    { { VLC_CODEC_GBRA_PLANAR_12L,
-        VLC_CODEC_GBRA_PLANAR_12B },           PLANAR_16(4, 1, 1, 12) },
-    { { VLC_CODEC_GBRA_PLANAR_16L,
-        VLC_CODEC_GBRA_PLANAR_16B },           PLANAR_16(4, 1, 1, 16) },
-
-    { { VLC_CODEC_I420_16L,
-        VLC_CODEC_I420_16B },                  PLANAR_16(3, 2, 2, 16) },
-    { { VLC_CODEC_I420_12L,
-        VLC_CODEC_I420_12B },                  PLANAR_16(3, 2, 2, 12) },
-    { { VLC_CODEC_I420_10L,
-        VLC_CODEC_I420_10B },                  PLANAR_16(3, 2, 2, 10) },
-    { { VLC_CODEC_I420_9L,
-        VLC_CODEC_I420_9B },                   PLANAR_16(3, 2, 2,  9) },
-    { { VLC_CODEC_I422_16L,
-        VLC_CODEC_I422_16B },                  PLANAR_16(3, 2, 1, 16) },
-    { { VLC_CODEC_I422_12L,
-        VLC_CODEC_I422_12B },                  PLANAR_16(3, 2, 1, 12) },
-    { { VLC_CODEC_I422_10L,
-        VLC_CODEC_I422_10B },                  PLANAR_16(3, 2, 1, 10) },
-    { { VLC_CODEC_I422_9L,
-        VLC_CODEC_I422_9B },                   PLANAR_16(3, 2, 1,  9) },
-    { { VLC_CODEC_I444_12L,
-        VLC_CODEC_I444_12B },                  PLANAR_16(3, 1, 1, 12) },
-    { { VLC_CODEC_I444_10L,
-        VLC_CODEC_I444_10B },                  PLANAR_16(3, 1, 1, 10) },
-    { { VLC_CODEC_I444_9L,
-        VLC_CODEC_I444_9B },                   PLANAR_16(3, 1, 1,  9) },
-    { { VLC_CODEC_I444_16L,
-        VLC_CODEC_I444_16B },                  PLANAR_16(3, 1, 1, 16) },
-    { { VLC_CODEC_YUVA_444_10L,
-        VLC_CODEC_YUVA_444_10B },              PLANAR_16(4, 1, 1, 10) },
-    { { VLC_CODEC_YUVA_444_12L,
-        VLC_CODEC_YUVA_444_12B },              PLANAR_16(4, 1, 1, 12) },
-    { { VLC_CODEC_P010 },                      SEMIPLANAR(2, 2, 2, 10) },
-    { { VLC_CODEC_P016 },                      SEMIPLANAR(2, 2, 2, 16) },
-
-    { { VLC_CODEC_YUYV, VLC_CODEC_YVYU,
-        VLC_CODEC_UYVY, VLC_CODEC_VYUY },      PACKED_FMT(2, 16) },
-    { { VLC_CODEC_YUV2 },                      PACKED_FMT(2, 16) },
-    { { VLC_CODEC_RGB233, VLC_CODEC_BGR233,
-        VLC_CODEC_RGB332, 0 },                 PACKED_FMT(1, 8) },
-    { { VLC_CODEC_YUVP, VLC_CODEC_RGBP,
-        VLC_CODEC_GREY, 0 },                   PACKED_FMT(1, 8) },
-
-    { { VLC_CODEC_GREY_10L,
-        VLC_CODEC_GREY_10B },                  PACKED_FMT(2, 10) },
-    { { VLC_CODEC_GREY_12L,
-        VLC_CODEC_GREY_12B },                  PACKED_FMT(2, 12) },
-    { { VLC_CODEC_GREY_16L,
-        VLC_CODEC_GREY_16B },                  PACKED_FMT(2, 16) },
-
-    { { VLC_CODEC_RGB555BE, VLC_CODEC_RGB555LE,
-        VLC_CODEC_BGR555LE, VLC_CODEC_BGR555BE }, PACKED_FMT(2, 15) },
-    { { VLC_CODEC_RGB565LE, VLC_CODEC_RGB565BE,
-        VLC_CODEC_BGR565LE, VLC_CODEC_BGR565BE }, PACKED_FMT(2, 16) },
-    { { VLC_CODEC_RGB24, VLC_CODEC_BGR24,
-        0 },                                   PACKED_FMT(3, 24) },
-    { { VLC_CODEC_RGBX, VLC_CODEC_XRGB,
-        VLC_CODEC_BGRX, VLC_CODEC_XBGR },      PACKED_FMT(4, 24) },
-    { { VLC_CODEC_RGBA, VLC_CODEC_ARGB,
-        VLC_CODEC_BGRA, VLC_CODEC_ABGR },      PACKED_FMT(4, 32) },
-    { { VLC_CODEC_RGBA10 },                    PACKED_FMT(4, 32) },
-    { { VLC_CODEC_RGBA64, 0 },                 PACKED_FMT(8, 64) },
-    { { VLC_CODEC_VUYA, VLC_CODEC_Y210,
-        VLC_CODEC_Y410, 0 },                   PACKED_FMT(4, 32) },
-
-    { { VLC_CODEC_Y211, 0 },                   { 1, { {{1,4}, {1,1}} }, 4, 32 } },
-    { { VLC_CODEC_XYZ12,  0 },                 PACKED_FMT(6, 48) },
-
-    { { VLC_CODEC_VDPAU_VIDEO, VLC_CODEC_VDPAU_OUTPUT },
-                                               FAKE_FMT() },
-    { { VLC_CODEC_ANDROID_OPAQUE, VLC_CODEC_MMAL_OPAQUE,
-        VLC_CODEC_D3D9_OPAQUE,    VLC_CODEC_D3D11_OPAQUE },
-                                               FAKE_FMT() },
-    { { VLC_CODEC_D3D11_OPAQUE_10B, VLC_CODEC_D3D9_OPAQUE_10B,
-        VLC_CODEC_D3D11_OPAQUE_RGBA, VLC_CODEC_D3D11_OPAQUE_BGRA },
-                                               FAKE_FMT() },
-
-    { { VLC_CODEC_NVDEC_OPAQUE_16B,
-        VLC_CODEC_NVDEC_OPAQUE_10B, VLC_CODEC_NVDEC_OPAQUE },
-                                               FAKE_FMT() },
-
-    { { VLC_CODEC_NVDEC_OPAQUE_444, VLC_CODEC_NVDEC_OPAQUE_444_16B },
-                                               FAKE_FMT() },
-
-    { { VLC_CODEC_CVPX_NV12, VLC_CODEC_CVPX_UYVY,
-        VLC_CODEC_CVPX_I420, VLC_CODEC_CVPX_BGRA },
-                                               FAKE_FMT() },
-
-    { { VLC_CODEC_CVPX_P010, 0 },              FAKE_FMT() },
-
-    { { VLC_CODEC_GST_MEM_OPAQUE, 0 },         FAKE_FMT() },
-
-    { { VLC_CODEC_VAAPI_420, VLC_CODEC_VAAPI_420_10BPP },
-                                               FAKE_FMT() },
-
-    { { 0 },                                   FAKE_FMT() }
+      .pixel_bits = 0
+
+static const vlc_chroma_description_t p_list_chroma_description[] = {
+    { VLC_CODEC_I411,                  PLANAR_8(3, 4, 1) },
+    { VLC_CODEC_I410,                  PLANAR_8(3, 4, 4) },
+    { VLC_CODEC_YV9,                   PLANAR_8(3, 4, 4) },
+    { VLC_CODEC_I420,                  PLANAR_8(3, 2, 2) },
+    { VLC_CODEC_YV12,                  PLANAR_8(3, 2, 2) },
+    { VLC_CODEC_NV12,                  SEMIPLANAR(2, 2, 1, 8) },
+    { VLC_CODEC_NV21,                  SEMIPLANAR(2, 2, 1, 8) },
+    { VLC_CODEC_I422,                  PLANAR_8(3, 2, 1) },
+    { VLC_CODEC_NV16,                  SEMIPLANAR(2, 1, 1, 8) },
+    { VLC_CODEC_NV61,                  SEMIPLANAR(2, 1, 1, 8) },
+    { VLC_CODEC_I440,                  PLANAR_8(3, 1, 2) },
+    { VLC_CODEC_I444,                  PLANAR_8(3, 1, 1) },
+    { VLC_CODEC_NV24,                  SEMIPLANAR(1, 1, 1, 8) },
+    { VLC_CODEC_NV42,                  SEMIPLANAR(1, 1, 1, 8) },
+    { VLC_CODEC_YUVA,                  PLANAR_8(4, 1, 1) },
+    { VLC_CODEC_YUV420A,               PLANAR_8(4, 2, 2) },
+    { VLC_CODEC_YUV422A,               PLANAR_8(4, 2, 1) },
+
+    { VLC_CODEC_GBR_PLANAR,            PLANAR_8(3, 1, 1) },
+    { VLC_CODEC_GBR_PLANAR_9L,         PLANAR_16(3, 1, 1, 9) },
+    { VLC_CODEC_GBR_PLANAR_9B,         PLANAR_16(3, 1, 1, 9) },
+    { VLC_CODEC_GBR_PLANAR_10L,        PLANAR_16(3, 1, 1, 10) },
+    { VLC_CODEC_GBR_PLANAR_10B,        PLANAR_16(3, 1, 1, 10) },
+    { VLC_CODEC_GBR_PLANAR_12L,        PLANAR_16(3, 1, 1, 12) },
+    { VLC_CODEC_GBR_PLANAR_12B,        PLANAR_16(3, 1, 1, 12) },
+    { VLC_CODEC_GBR_PLANAR_14L,        PLANAR_16(3, 1, 1, 14) },
+    { VLC_CODEC_GBR_PLANAR_14B,        PLANAR_16(3, 1, 1, 14) },
+    { VLC_CODEC_GBR_PLANAR_16L,        PLANAR_16(3, 1, 1, 16) },
+    { VLC_CODEC_GBR_PLANAR_16B,        PLANAR_16(3, 1, 1, 16) },
+    { VLC_CODEC_GBRA_PLANAR,           PLANAR_8(4, 1, 1) },
+    { VLC_CODEC_GBRA_PLANAR_10L,       PLANAR_16(4, 1, 1, 10) },
+    { VLC_CODEC_GBRA_PLANAR_10B,       PLANAR_16(4, 1, 1, 10) },
+    { VLC_CODEC_GBRA_PLANAR_12L,       PLANAR_16(4, 1, 1, 12) },
+    { VLC_CODEC_GBRA_PLANAR_12B,       PLANAR_16(4, 1, 1, 12) },
+    { VLC_CODEC_GBRA_PLANAR_16L,       PLANAR_16(4, 1, 1, 16) },
+    { VLC_CODEC_GBRA_PLANAR_16B,       PLANAR_16(4, 1, 1, 16) },
+
+    { VLC_CODEC_I420_16L,              PLANAR_16(3, 2, 2, 16) },
+    { VLC_CODEC_I420_16B,              PLANAR_16(3, 2, 2, 16) },
+    { VLC_CODEC_I420_12L,              PLANAR_16(3, 2, 2, 12) },
+    { VLC_CODEC_I420_12B,              PLANAR_16(3, 2, 2, 12) },
+    { VLC_CODEC_I420_10L,              PLANAR_16(3, 2, 2, 10) },
+    { VLC_CODEC_I420_10B,              PLANAR_16(3, 2, 2, 10) },
+    { VLC_CODEC_I420_9L,               PLANAR_16(3, 2, 2,  9) },
+    { VLC_CODEC_I420_9B,               PLANAR_16(3, 2, 2,  9) },
+    { VLC_CODEC_I422_16L,              PLANAR_16(3, 2, 1, 16) },
+    { VLC_CODEC_I422_16B,              PLANAR_16(3, 2, 1, 16) },
+    { VLC_CODEC_I422_12L,              PLANAR_16(3, 2, 1, 12) },
+    { VLC_CODEC_I422_12B,              PLANAR_16(3, 2, 1, 12) },
+    { VLC_CODEC_I422_10L,              PLANAR_16(3, 2, 1, 10) },
+    { VLC_CODEC_I422_10B,              PLANAR_16(3, 2, 1, 10) },
+    { VLC_CODEC_I422_9L,               PLANAR_16(3, 2, 1,  9) },
+    { VLC_CODEC_I422_9B,               PLANAR_16(3, 2, 1,  9) },
+    { VLC_CODEC_I444_12L,              PLANAR_16(3, 1, 1, 12) },
+    { VLC_CODEC_I444_12B,              PLANAR_16(3, 1, 1, 12) },
+    { VLC_CODEC_I444_10L,              PLANAR_16(3, 1, 1, 10) },
+    { VLC_CODEC_I444_10B,              PLANAR_16(3, 1, 1, 10) },
+    { VLC_CODEC_I444_9L,               PLANAR_16(3, 1, 1,  9) },
+    { VLC_CODEC_I444_9B,               PLANAR_16(3, 1, 1,  9) },
+    { VLC_CODEC_I444_16L,              PLANAR_16(3, 1, 1, 16) },
+    { VLC_CODEC_I444_16B,              PLANAR_16(3, 1, 1, 16) },
+    { VLC_CODEC_YUVA_444_10L,          PLANAR_16(4, 1, 1, 10) },
+    { VLC_CODEC_YUVA_444_10B,          PLANAR_16(4, 1, 1, 10) },
+    { VLC_CODEC_YUVA_444_12L,          PLANAR_16(4, 1, 1, 12) },
+    { VLC_CODEC_YUVA_444_12B,          PLANAR_16(4, 1, 1, 12) },
+    { VLC_CODEC_P010,                  SEMIPLANAR(2, 2, 2, 10) },
+    { VLC_CODEC_P016,                  SEMIPLANAR(2, 2, 2, 16) },
+
+    { VLC_CODEC_YUYV,                  PACKED_FMT(2, 16) },
+    { VLC_CODEC_YVYU,                  PACKED_FMT(2, 16) },
+    { VLC_CODEC_UYVY,                  PACKED_FMT(2, 16) },
+    { VLC_CODEC_VYUY,                  PACKED_FMT(2, 16) },
+    { VLC_CODEC_YUV2,                  PACKED_FMT(2, 16) },
+    { VLC_CODEC_RGB233,                PACKED_FMT(1, 8) },
+    { VLC_CODEC_BGR233,                PACKED_FMT(1, 8) },
+    { VLC_CODEC_RGB332,                PACKED_FMT(1, 8) },
+    { VLC_CODEC_YUVP,                  PACKED_FMT(1, 8) },
+    { VLC_CODEC_RGBP,                  PACKED_FMT(1, 8) },
+    { VLC_CODEC_GREY,                  PACKED_FMT(1, 8) },
+    { VLC_CODEC_GREY_10L,              PACKED_FMT(2, 10) },
+    { VLC_CODEC_GREY_10B,              PACKED_FMT(2, 10) },
+    { VLC_CODEC_GREY_12L,              PACKED_FMT(2, 12) },
+    { VLC_CODEC_GREY_12B,              PACKED_FMT(2, 12) },
+    { VLC_CODEC_GREY_16L,              PACKED_FMT(2, 16) },
+    { VLC_CODEC_GREY_16B,              PACKED_FMT(2, 16) },
+
+    { VLC_CODEC_RGB555BE,              PACKED_FMT(2, 15) },
+    { VLC_CODEC_RGB555LE,              PACKED_FMT(2, 15) },
+    { VLC_CODEC_BGR555LE,              PACKED_FMT(2, 15) },
+    { VLC_CODEC_BGR555BE,              PACKED_FMT(2, 15) },
+    { VLC_CODEC_RGB565LE,              PACKED_FMT(2, 16) },
+    { VLC_CODEC_RGB565BE,              PACKED_FMT(2, 16) },
+    { VLC_CODEC_BGR565LE,              PACKED_FMT(2, 16) },
+    { VLC_CODEC_BGR565BE,              PACKED_FMT(2, 16) },
+    { VLC_CODEC_RGB24,                 PACKED_FMT(3, 24) },
+    { VLC_CODEC_BGR24,                 PACKED_FMT(3, 24) },
+    { VLC_CODEC_RGBX,                  PACKED_FMT(4, 24) },
+    { VLC_CODEC_XRGB,                  PACKED_FMT(4, 24) },
+    { VLC_CODEC_BGRX,                  PACKED_FMT(4, 24) },
+    { VLC_CODEC_XBGR,                  PACKED_FMT(4, 24) },
+    { VLC_CODEC_RGBA,                  PACKED_FMT(4, 32) },
+    { 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_RGBA64,                PACKED_FMT(8, 64) },
+    { VLC_CODEC_VUYA,                  PACKED_FMT(4, 32) },
+    { VLC_CODEC_Y210,                  PACKED_FMT(4, 32) },
+    { VLC_CODEC_Y410,                  PACKED_FMT(4, 32) },
+
+    { VLC_CODEC_Y211,                 1, { {{1,4}, {1,1}} }, 4, 32 },
+    { VLC_CODEC_XYZ12,                 PACKED_FMT(6, 48) },
+
+    { VLC_CODEC_VDPAU_VIDEO,           FAKE_FMT() },
+    { VLC_CODEC_VDPAU_OUTPUT,          FAKE_FMT() },
+    { VLC_CODEC_ANDROID_OPAQUE,        FAKE_FMT() },
+    { VLC_CODEC_MMAL_OPAQUE,           FAKE_FMT() },
+    { VLC_CODEC_D3D9_OPAQUE,           FAKE_FMT() },
+    { VLC_CODEC_D3D11_OPAQUE,          FAKE_FMT() },
+    { VLC_CODEC_D3D9_OPAQUE_10B,       FAKE_FMT() },
+    { VLC_CODEC_D3D11_OPAQUE_10B,      FAKE_FMT() },
+    { VLC_CODEC_D3D11_OPAQUE_RGBA,     FAKE_FMT() },
+    { VLC_CODEC_D3D11_OPAQUE_BGRA,     FAKE_FMT() },
+
+    { VLC_CODEC_NVDEC_OPAQUE_16B,      FAKE_FMT() },
+    { VLC_CODEC_NVDEC_OPAQUE_10B,      FAKE_FMT() },
+    { VLC_CODEC_NVDEC_OPAQUE,          FAKE_FMT() },
+
+    { VLC_CODEC_NVDEC_OPAQUE_444,      FAKE_FMT() },
+    { VLC_CODEC_NVDEC_OPAQUE_444_16B,  FAKE_FMT() },
+
+    { VLC_CODEC_CVPX_NV12,             FAKE_FMT() },
+    { VLC_CODEC_CVPX_UYVY,             FAKE_FMT() },
+    { VLC_CODEC_CVPX_I420,             FAKE_FMT() },
+    { VLC_CODEC_CVPX_BGRA,             FAKE_FMT() },
+
+    { VLC_CODEC_CVPX_P010,             FAKE_FMT() },
+
+    { VLC_CODEC_GST_MEM_OPAQUE,        FAKE_FMT() },
+
+    { VLC_CODEC_VAAPI_420,             FAKE_FMT() },
+    { VLC_CODEC_VAAPI_420_10BPP,       FAKE_FMT() },
 };
 
 #undef PACKED_FMT
@@ -856,14 +870,10 @@ static const struct
 
 const vlc_chroma_description_t *vlc_fourcc_GetChromaDescription( vlc_fourcc_t i_fourcc )
 {
-    for( unsigned i = 0; p_list_chroma_description[i].p_fourcc[0]; i++ )
+    for( size_t i = 0; i < ARRAY_SIZE(p_list_chroma_description); i++ )
     {
-        const vlc_fourcc_t *p_fourcc = p_list_chroma_description[i].p_fourcc;
-        for( unsigned j = 0; j < 4 && p_fourcc[j] != 0; j++ )
-        {
-            if( p_fourcc[j] == i_fourcc )
-                return &p_list_chroma_description[i].description;
-        }
+        if( p_list_chroma_description[i].fcc == i_fourcc )
+            return &p_list_chroma_description[i];
     }
     return NULL;
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e79b1dea71fe0801fc2d3846f8c5c77c084ca030...10c001bc3b9d1004ce1be365bdaf911eb2fd0596

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e79b1dea71fe0801fc2d3846f8c5c77c084ca030...10c001bc3b9d1004ce1be365bdaf911eb2fd0596
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