[vlc-commits] [Git][videolan/vlc][master] aom: make BGR matching stricter

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Sep 16 07:50:08 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
0001e85a by Tristan Matthews at 2024-09-16T07:05:27+00:00
aom: make BGR matching stricter

This is equivalent to the fix in ece317a245e8c32a5efc11d5e82dcd8a28a2f10b
as the aom decoder had the same issue reported in #28776.

- - - - -


1 changed file:

- modules/codec/aom.c


Changes:

=====================================
modules/codec/aom.c
=====================================
@@ -169,28 +169,30 @@ static const struct
     enum aom_img_fmt i_chroma_id;
     uint8_t          i_bitdepth;
     enum aom_transfer_characteristics transfer_characteristics;
-
+    enum aom_color_primaries color_primaries;
+    enum aom_matrix_coefficients matrix_coefficients;
 } chroma_table[] =
 {
     /* Transfer characteristic-dependent mappings must come first */
-    { VLC_CODEC_GBR_PLANAR, AOM_IMG_FMT_I444, 8, AOM_CICP_TC_SRGB },
-    { VLC_CODEC_GBR_PLANAR_10L, AOM_IMG_FMT_I44416, 10, AOM_CICP_TC_SRGB },
+    { VLC_CODEC_GBR_PLANAR, AOM_IMG_FMT_I444, 8, AOM_CICP_TC_SRGB, AOM_CICP_CP_BT_709, AOM_CICP_MC_IDENTITY },
+    { VLC_CODEC_GBR_PLANAR_10L, AOM_IMG_FMT_I44416, 10, AOM_CICP_TC_SRGB , AOM_CICP_CP_BT_709, AOM_CICP_MC_IDENTITY },
+    { VLC_CODEC_GBR_PLANAR_12L, AOM_IMG_FMT_I44416, 12, AOM_CICP_TC_SRGB , AOM_CICP_CP_BT_709, AOM_CICP_MC_IDENTITY },
 
-    { VLC_CODEC_I420, AOM_IMG_FMT_I420, 8, AOM_CICP_TC_UNSPECIFIED },
-    { VLC_CODEC_I422, AOM_IMG_FMT_I422, 8, AOM_CICP_TC_UNSPECIFIED },
-    { VLC_CODEC_I444, AOM_IMG_FMT_I444, 8, AOM_CICP_TC_UNSPECIFIED },
+    { VLC_CODEC_I420, AOM_IMG_FMT_I420, 8, AOM_CICP_TC_UNSPECIFIED, AOM_CICP_CP_UNSPECIFIED, AOM_CICP_MC_UNSPECIFIED },
+    { VLC_CODEC_I422, AOM_IMG_FMT_I422, 8, AOM_CICP_TC_UNSPECIFIED, AOM_CICP_CP_UNSPECIFIED, AOM_CICP_MC_UNSPECIFIED },
+    { VLC_CODEC_I444, AOM_IMG_FMT_I444, 8, AOM_CICP_TC_UNSPECIFIED, AOM_CICP_CP_UNSPECIFIED, AOM_CICP_MC_UNSPECIFIED },
 
-    { VLC_CODEC_YV12, AOM_IMG_FMT_YV12, 8, AOM_CICP_TC_UNSPECIFIED },
+    { VLC_CODEC_YV12, AOM_IMG_FMT_YV12, 8, AOM_CICP_TC_UNSPECIFIED, AOM_CICP_CP_UNSPECIFIED, AOM_CICP_MC_UNSPECIFIED },
 
-    { VLC_CODEC_I420_10L, AOM_IMG_FMT_I42016, 10, AOM_CICP_TC_UNSPECIFIED },
-    { VLC_CODEC_I422_10L, AOM_IMG_FMT_I42216, 10, AOM_CICP_TC_UNSPECIFIED },
-    { VLC_CODEC_I444_10L, AOM_IMG_FMT_I44416, 10, AOM_CICP_TC_UNSPECIFIED },
+    { VLC_CODEC_I420_10L, AOM_IMG_FMT_I42016, 10, AOM_CICP_TC_UNSPECIFIED, AOM_CICP_CP_UNSPECIFIED, AOM_CICP_MC_UNSPECIFIED },
+    { VLC_CODEC_I422_10L, AOM_IMG_FMT_I42216, 10, AOM_CICP_TC_UNSPECIFIED, AOM_CICP_CP_UNSPECIFIED, AOM_CICP_MC_UNSPECIFIED },
+    { VLC_CODEC_I444_10L, AOM_IMG_FMT_I44416, 10, AOM_CICP_TC_UNSPECIFIED, AOM_CICP_CP_UNSPECIFIED, AOM_CICP_MC_UNSPECIFIED },
 
-    { VLC_CODEC_I420_12L, AOM_IMG_FMT_I42016, 12, AOM_CICP_TC_UNSPECIFIED },
-    { VLC_CODEC_I422_12L, AOM_IMG_FMT_I42216, 12, AOM_CICP_TC_UNSPECIFIED },
-    { VLC_CODEC_I444_12L, AOM_IMG_FMT_I44416, 12, AOM_CICP_TC_UNSPECIFIED },
+    { VLC_CODEC_I420_12L, AOM_IMG_FMT_I42016, 12, AOM_CICP_TC_UNSPECIFIED, AOM_CICP_CP_UNSPECIFIED, AOM_CICP_MC_UNSPECIFIED },
+    { VLC_CODEC_I422_12L, AOM_IMG_FMT_I42216, 12, AOM_CICP_TC_UNSPECIFIED, AOM_CICP_CP_UNSPECIFIED, AOM_CICP_MC_UNSPECIFIED },
+    { VLC_CODEC_I444_12L, AOM_IMG_FMT_I44416, 12, AOM_CICP_TC_UNSPECIFIED, AOM_CICP_CP_UNSPECIFIED, AOM_CICP_MC_UNSPECIFIED },
 
-    { VLC_CODEC_I444_16L, AOM_IMG_FMT_I44416, 16, AOM_CICP_TC_UNSPECIFIED },
+    { VLC_CODEC_I444_16L, AOM_IMG_FMT_I44416, 16, AOM_CICP_TC_UNSPECIFIED, AOM_CICP_CP_UNSPECIFIED, AOM_CICP_MC_UNSPECIFIED },
 };
 
 static vlc_fourcc_t FindVlcChroma( struct aom_image *img )
@@ -199,7 +201,11 @@ static vlc_fourcc_t FindVlcChroma( struct aom_image *img )
         if( chroma_table[i].i_chroma_id == img->fmt &&
             chroma_table[i].i_bitdepth == img->bit_depth &&
             ( chroma_table[i].transfer_characteristics == AOM_CICP_TC_UNSPECIFIED ||
-              chroma_table[i].transfer_characteristics == img->tc ) )
+              chroma_table[i].transfer_characteristics == img->tc ) &&
+            ( chroma_table[i].color_primaries == AOM_CICP_CP_UNSPECIFIED ||
+              chroma_table[i].color_primaries == img->cp ) &&
+            ( chroma_table[i].matrix_coefficients == AOM_CICP_MC_UNSPECIFIED ||
+              chroma_table[i].matrix_coefficients == img->mc ) )
             return chroma_table[i].i_chroma;
 
     return 0;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0001e85a098ee4e6e2526eaec8a76899c2b23b90

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0001e85a098ee4e6e2526eaec8a76899c2b23b90
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