This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 83990124157b32461ca318b19fe643d6147925b8
Author:     James Almer <[email protected]>
AuthorDate: Thu Sep 24 16:02:12 2026 -0300
Commit:     James Almer <[email protected]>
CommitDate: Sun Sep 27 18:38:11 2026 -0300

    avcodec/libmpeghdec: make the mask list from channel_layout_to_cicp() a 
shared table
    
    And move it to mpegaudiotabs.h
    
    Signed-off-by: James Almer <[email protected]>
---
 libavcodec/Makefile        |  2 +-
 libavcodec/libmpeghdec.c   | 20 ++++----------------
 libavcodec/mpegaudiodata.h |  1 +
 libavcodec/mpegaudiotabs.h | 16 ++++++++++++++++
 4 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index e2c60e9051..a8ba25aa14 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -1202,7 +1202,7 @@ OBJS-$(CONFIG_LIBKVAZAAR_ENCODER)         += libkvazaar.o
 OBJS-$(CONFIG_LIBLC3_ENCODER)             += liblc3enc.o
 OBJS-$(CONFIG_LIBLC3_DECODER)             += liblc3dec.o
 OBJS-$(CONFIG_LIBMP3LAME_ENCODER)         += libmp3lame.o
-OBJS-$(CONFIG_LIBMPEGHDEC_DECODER)        += libmpeghdec.o
+OBJS-$(CONFIG_LIBMPEGHDEC_DECODER)        += libmpeghdec.o mpegaudiotabs.o
 OBJS-$(CONFIG_LIBOAPV_ENCODER)            += liboapvenc.o
 OBJS-$(CONFIG_LIBOPENCORE_AMRNB_DECODER)  += libopencore-amr.o
 OBJS-$(CONFIG_LIBOPENCORE_AMRNB_ENCODER)  += libopencore-amr.o
diff --git a/libavcodec/libmpeghdec.c b/libavcodec/libmpeghdec.c
index d29ac354ac..49e7a5b1ec 100644
--- a/libavcodec/libmpeghdec.c
+++ b/libavcodec/libmpeghdec.c
@@ -38,6 +38,7 @@
 
 #include "codec_internal.h"
 #include "decode.h"
+#include "mpegaudiodata.h"
 #include "profiles.h"
 
 #define MAX_LOST_FRAMES 2
@@ -69,23 +70,10 @@ static av_cold int mpegh3dadec_close(AVCodecContext *avctx)
 // 
https://github.com/Fraunhofer-IIS/mpeghdec/wiki/MPEG-H-decoder-target-layouts
 static av_cold int channel_layout_to_cicp(const AVChannelLayout *layout)
 {
-    static const uint64_t channel_layout_masks[] = {
-        0,
-        AV_CH_LAYOUT_MONO,               AV_CH_LAYOUT_STEREO,
-        AV_CH_LAYOUT_SURROUND,           AV_CH_LAYOUT_4POINT0,
-        AV_CH_LAYOUT_5POINT0,            AV_CH_LAYOUT_5POINT1,
-        AV_CH_LAYOUT_7POINT1_WIDE,       0,
-        AV_CH_LAYOUT_2_1,                AV_CH_LAYOUT_2_2,
-        AV_CH_LAYOUT_6POINT1,            AV_CH_LAYOUT_7POINT1,
-        AV_CH_LAYOUT_22POINT2,           AV_CH_LAYOUT_5POINT1POINT2,
-        AV_CH_LAYOUT_7POINT2POINT3,      AV_CH_LAYOUT_5POINT1POINT4,
-        AV_CH_LAYOUT_5POINT1POINT6,      AV_CH_LAYOUT_7POINT1POINT6,
-        AV_CH_LAYOUT_7POINT1POINT4,
-    };
-    for (size_t i = 0; i < FF_ARRAY_ELEMS(channel_layout_masks); ++i) {
-        if (channel_layout_masks[i]) {
+    for (size_t i = 0; i < FF_ARRAY_ELEMS(ff_mpa_cicp_channel_layout_masks); 
++i) {
+        if (ff_mpa_cicp_channel_layout_masks[i]) {
             AVChannelLayout ch_layout;
-            av_channel_layout_from_mask(&ch_layout, channel_layout_masks[i]);
+            av_channel_layout_from_mask(&ch_layout, 
ff_mpa_cicp_channel_layout_masks[i]);
             if (!av_channel_layout_compare(layout, &ch_layout))
                 return i;
         }
diff --git a/libavcodec/mpegaudiodata.h b/libavcodec/mpegaudiodata.h
index 720c4bee64..75e5befcb3 100644
--- a/libavcodec/mpegaudiodata.h
+++ b/libavcodec/mpegaudiodata.h
@@ -40,6 +40,7 @@
 FF_VISIBILITY_PUSH_HIDDEN
 extern const uint16_t ff_mpa_bitrate_tab[2][3][15];
 extern const uint16_t ff_mpa_freq_tab[3];
+extern const uint64_t ff_mpa_cicp_channel_layout_masks[20];
 extern const int ff_mpa_sblimit_table[5];
 extern const int ff_mpa_quant_steps[17];
 extern const int ff_mpa_quant_bits[17];
diff --git a/libavcodec/mpegaudiotabs.h b/libavcodec/mpegaudiotabs.h
index 671b83848d..d7cbba3be5 100644
--- a/libavcodec/mpegaudiotabs.h
+++ b/libavcodec/mpegaudiotabs.h
@@ -24,6 +24,8 @@
 
 #include <stdint.h>
 
+#include "libavutil/channel_layout.h"
+
 const uint16_t ff_mpa_bitrate_tab[2][3][15] = {
     { { 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448 },
       { 0, 32, 48, 56,  64,  80,  96, 112, 128, 160, 192, 224, 256, 320, 384 },
@@ -36,4 +38,18 @@ const uint16_t ff_mpa_bitrate_tab[2][3][15] = {
 
 const uint16_t ff_mpa_freq_tab[3] = { 44100, 48000, 32000 };
 
+const uint64_t ff_mpa_cicp_channel_layout_masks[20] = {
+    0,
+    AV_CH_LAYOUT_MONO,               AV_CH_LAYOUT_STEREO,
+    AV_CH_LAYOUT_SURROUND,           AV_CH_LAYOUT_4POINT0,
+    AV_CH_LAYOUT_5POINT0,            AV_CH_LAYOUT_5POINT1,
+    AV_CH_LAYOUT_7POINT1_WIDE,       0,
+    AV_CH_LAYOUT_2_1,                AV_CH_LAYOUT_2_2,
+    AV_CH_LAYOUT_6POINT1,            AV_CH_LAYOUT_7POINT1,
+    AV_CH_LAYOUT_22POINT2,           AV_CH_LAYOUT_5POINT1POINT2,
+    AV_CH_LAYOUT_7POINT2POINT3,      AV_CH_LAYOUT_5POINT1POINT4,
+    AV_CH_LAYOUT_5POINT1POINT6,      AV_CH_LAYOUT_7POINT1POINT6,
+    AV_CH_LAYOUT_7POINT1POINT4,
+};
+
 #endif

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to