[PR] avutil/channel_layout: remove back suffix from some layouts (PR #24236)

James Almer via ffmpeg-devel <[email protected]>
Newsgroups gmane.comp.video.ffmpeg.devel
Message-ID <[email protected]>
PR #24236 opened by James Almer (jamrial)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24236
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24236.patch

The idea was for the suffix to refer to the fact they feature Top Back channels instead of Top Side, but this distinction is unnecessary given there's no confusion between back and side like with base level channels (Ls/Rs, Lss/Rss, Lrs/Rsr), nor known specs where Top Side channels are used without Top Back also being used.

Deprecate and schedule to remove the old legacy 7.1(top) alias as well while at it.


>From 244cc7f92408bfbcf85896e73a26f814b6ff98ab Mon Sep 17 00:00:00 2001
From: James Almer <[email protected]>
Date: Fri, 21 Aug 2026 18:55:13 -0300
Subject: [PATCH 1/2] avutil/channel_layout: remove back suffix from some
 layouts

The idea was for the suffix to refer to the fact they feature Top Back channels
instead of Top Side, but this distinction is unnecessary given there's no
confusion between back and side like with base level channels (Ls/Rs, Lss/Rss,
Lrs/Rsr), nor known specs where Top Side channels are used without Top Back
also being used.

Signed-off-by: James Almer <[email protected]>
---
 libavutil/channel_layout.c |  6 +++---
 libavutil/channel_layout.h | 24 +++++++++++++++++-------
 libavutil/version.h        |  1 +
 3 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c
index bd4aabaaa8..53ac5cd56d 100644
--- a/libavutil/channel_layout.c
+++ b/libavutil/channel_layout.c
@@ -218,11 +218,11 @@ static const struct channel_layout_name channel_layout_map[] = {
     { "5.1.2(back)",    AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK  },
     { "octagonal",      AV_CHANNEL_LAYOUT_OCTAGONAL           },
     { "cube",           AV_CHANNEL_LAYOUT_CUBE                },
-    { "5.1.4",          AV_CHANNEL_LAYOUT_5POINT1POINT4_BACK  },
+    { "5.1.4",          AV_CHANNEL_LAYOUT_5POINT1POINT4       },
     { "7.1.2",          AV_CHANNEL_LAYOUT_7POINT1POINT2       },
-    { "7.1.4",          AV_CHANNEL_LAYOUT_7POINT1POINT4_BACK  },
+    { "7.1.4",          AV_CHANNEL_LAYOUT_7POINT1POINT4       },
     { "7.2.3",          AV_CHANNEL_LAYOUT_7POINT2POINT3       },
-    { "9.1.4",          AV_CHANNEL_LAYOUT_9POINT1POINT4_BACK  },
+    { "9.1.4",          AV_CHANNEL_LAYOUT_9POINT1POINT4       },
     { "9.1.6",          AV_CHANNEL_LAYOUT_9POINT1POINT6       },
     { "hexadecagonal",  AV_CHANNEL_LAYOUT_HEXADECAGONAL       },
     { "binaural",       AV_CHANNEL_LAYOUT_BINAURAL            },
diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h
index 5ad2d5ed98..c28f2c24bf 100644
--- a/libavutil/channel_layout.h
+++ b/libavutil/channel_layout.h
@@ -244,18 +244,23 @@ enum AVChannelOrder {
 #define AV_CH_LAYOUT_5POINT1POINT2_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
 #define AV_CH_LAYOUT_OCTAGONAL         (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT)
 #define AV_CH_LAYOUT_CUBE              (AV_CH_LAYOUT_QUAD|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT)
-#define AV_CH_LAYOUT_5POINT1POINT4_BACK (AV_CH_LAYOUT_5POINT1POINT2|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT)
+#define AV_CH_LAYOUT_5POINT1POINT4     (AV_CH_LAYOUT_5POINT1POINT2|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT)
 #define AV_CH_LAYOUT_7POINT1POINT2     (AV_CH_LAYOUT_7POINT1|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
-#define AV_CH_LAYOUT_7POINT1POINT4_BACK (AV_CH_LAYOUT_7POINT1POINT2|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT)
+#define AV_CH_LAYOUT_7POINT1POINT4     (AV_CH_LAYOUT_7POINT1POINT2|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT)
 #define AV_CH_LAYOUT_7POINT2POINT3     (AV_CH_LAYOUT_7POINT1POINT2|AV_CH_TOP_BACK_CENTER|AV_CH_LOW_FREQUENCY_2)
-#define AV_CH_LAYOUT_9POINT1POINT4_BACK (AV_CH_LAYOUT_7POINT1POINT4_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
-#define AV_CH_LAYOUT_9POINT1POINT6     (AV_CH_LAYOUT_9POINT1POINT4_BACK|AV_CH_TOP_SIDE_LEFT|AV_CH_TOP_SIDE_RIGHT)
+#define AV_CH_LAYOUT_9POINT1POINT4     (AV_CH_LAYOUT_7POINT1POINT4|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
+#define AV_CH_LAYOUT_9POINT1POINT6     (AV_CH_LAYOUT_9POINT1POINT4|AV_CH_TOP_SIDE_LEFT|AV_CH_TOP_SIDE_RIGHT)
 #define AV_CH_LAYOUT_HEXADECAGONAL     (AV_CH_LAYOUT_OCTAGONAL|AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
 #define AV_CH_LAYOUT_BINAURAL          (AV_CH_BINAURAL_LEFT|AV_CH_BINAURAL_RIGHT)
 #define AV_CH_LAYOUT_STEREO_DOWNMIX    (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT)
 #define AV_CH_LAYOUT_22POINT2          (AV_CH_LAYOUT_9POINT1POINT6|AV_CH_BACK_CENTER|AV_CH_LOW_FREQUENCY_2|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_CENTER|AV_CH_TOP_BACK_CENTER|AV_CH_BOTTOM_FRONT_CENTER|AV_CH_BOTTOM_FRONT_LEFT|AV_CH_BOTTOM_FRONT_RIGHT)
 
+#if FF_API_CHANNEL_LAYOUT_BACK
+#define AV_CH_LAYOUT_5POINT1POINT4_BACK AV_CH_LAYOUT_5POINT1POINT4
+#define AV_CH_LAYOUT_7POINT1POINT4_BACK AV_CH_LAYOUT_7POINT1POINT4
+#define AV_CH_LAYOUT_9POINT1POINT4_BACK AV_CH_LAYOUT_9POINT1POINT4
 #define AV_CH_LAYOUT_7POINT1_TOP_BACK AV_CH_LAYOUT_5POINT1POINT2_BACK
+#endif
 
 enum AVMatrixEncoding {
     AV_MATRIX_ENCODING_NONE,
@@ -421,18 +426,23 @@ typedef struct AVChannelLayout {
 #define AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_5POINT1POINT2_BACK)
 #define AV_CHANNEL_LAYOUT_OCTAGONAL         AV_CHANNEL_LAYOUT_MASK(8,  AV_CH_LAYOUT_OCTAGONAL)
 #define AV_CHANNEL_LAYOUT_CUBE              AV_CHANNEL_LAYOUT_MASK(8,  AV_CH_LAYOUT_CUBE)
-#define AV_CHANNEL_LAYOUT_5POINT1POINT4_BACK AV_CHANNEL_LAYOUT_MASK(10, AV_CH_LAYOUT_5POINT1POINT4_BACK)
+#define AV_CHANNEL_LAYOUT_5POINT1POINT4     AV_CHANNEL_LAYOUT_MASK(10, AV_CH_LAYOUT_5POINT1POINT4)
 #define AV_CHANNEL_LAYOUT_7POINT1POINT2     AV_CHANNEL_LAYOUT_MASK(10, AV_CH_LAYOUT_7POINT1POINT2)
-#define AV_CHANNEL_LAYOUT_7POINT1POINT4_BACK AV_CHANNEL_LAYOUT_MASK(12, AV_CH_LAYOUT_7POINT1POINT4_BACK)
+#define AV_CHANNEL_LAYOUT_7POINT1POINT4     AV_CHANNEL_LAYOUT_MASK(12, AV_CH_LAYOUT_7POINT1POINT4)
 #define AV_CHANNEL_LAYOUT_7POINT2POINT3     AV_CHANNEL_LAYOUT_MASK(12, AV_CH_LAYOUT_7POINT2POINT3)
-#define AV_CHANNEL_LAYOUT_9POINT1POINT4_BACK AV_CHANNEL_LAYOUT_MASK(14, AV_CH_LAYOUT_9POINT1POINT4_BACK)
+#define AV_CHANNEL_LAYOUT_9POINT1POINT4     AV_CHANNEL_LAYOUT_MASK(14, AV_CH_LAYOUT_9POINT1POINT4)
 #define AV_CHANNEL_LAYOUT_9POINT1POINT6     AV_CHANNEL_LAYOUT_MASK(16, AV_CH_LAYOUT_9POINT1POINT6)
 #define AV_CHANNEL_LAYOUT_HEXADECAGONAL     AV_CHANNEL_LAYOUT_MASK(16, AV_CH_LAYOUT_HEXADECAGONAL)
 #define AV_CHANNEL_LAYOUT_BINAURAL          AV_CHANNEL_LAYOUT_MASK(2,  AV_CH_LAYOUT_BINAURAL)
 #define AV_CHANNEL_LAYOUT_STEREO_DOWNMIX    AV_CHANNEL_LAYOUT_MASK(2,  AV_CH_LAYOUT_STEREO_DOWNMIX)
 #define AV_CHANNEL_LAYOUT_22POINT2          AV_CHANNEL_LAYOUT_MASK(24, AV_CH_LAYOUT_22POINT2)
 
+#if FF_API_CHANNEL_LAYOUT_BACK
+#define AV_CHANNEL_LAYOUT_5POINT1POINT4_BACK AV_CHANNEL_LAYOUT_5POINT1POINT4
+#define AV_CHANNEL_LAYOUT_7POINT1POINT4_BACK AV_CHANNEL_LAYOUT_7POINT1POINT4
+#define AV_CHANNEL_LAYOUT_9POINT1POINT4_BACK AV_CHANNEL_LAYOUT_9POINT1POINT4
 #define AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK  AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK
+#endif
 
 #define AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER \
     { /* .order */ AV_CHANNEL_ORDER_AMBISONIC, \
diff --git a/libavutil/version.h b/libavutil/version.h
index d5bf20cf89..60c2a454e8 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -109,6 +109,7 @@
 #define FF_API_DOVI_L11_INVALID_PROPS   (LIBAVUTIL_VERSION_MAJOR < 62)
 #define FF_API_ASSERT_FPU               (LIBAVUTIL_VERSION_MAJOR < 62)
 #define FF_API_VULKAN_SYNC_QUEUES       (LIBAVUTIL_VERSION_MAJOR < 62)
+#define FF_API_CHANNEL_LAYOUT_BACK      (LIBAVUTIL_VERSION_MAJOR < 62)
 
 /**
  * @}
-- 
2.52.0


>From c951076a893218e02258cd6cec5580296fd6da0e Mon Sep 17 00:00:00 2001
From: James Almer <[email protected]>
Date: Fri, 21 Aug 2026 19:04:13 -0300
Subject: [PATCH 2/2] avformat/iamf: use the new channel layout macros

Signed-off-by: James Almer <[email protected]>
---
 libavformat/iamf.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavformat/iamf.c b/libavformat/iamf.c
index 03c2c239e2..325b499be8 100644
--- a/libavformat/iamf.c
+++ b/libavformat/iamf.c
@@ -32,13 +32,13 @@ const AVChannelLayout ff_iamf_scalable_ch_layouts[10] = {
     // "Loudspeaker configuration for Sound System C"
     AV_CHANNEL_LAYOUT_5POINT1POINT2,
     // "Loudspeaker configuration for Sound System D"
-    AV_CHANNEL_LAYOUT_5POINT1POINT4_BACK,
+    AV_CHANNEL_LAYOUT_5POINT1POINT4,
     // "Loudspeaker configuration for Sound System I"
     AV_CHANNEL_LAYOUT_7POINT1,
     // "Loudspeaker configuration for Sound System I" + Ltf + Rtf
     AV_CHANNEL_LAYOUT_7POINT1POINT2,
     // "Loudspeaker configuration for Sound System J"
-    AV_CHANNEL_LAYOUT_7POINT1POINT4_BACK,
+    AV_CHANNEL_LAYOUT_7POINT1POINT4,
     // Front subset of "Loudspeaker configuration for Sound System J"
     AV_CHANNEL_LAYOUT_3POINT1POINT2,
     // Binaural
@@ -121,7 +121,7 @@ const struct IAMFSoundSystemMap ff_iamf_sound_system_map[14] = {
     { SOUND_SYSTEM_A_0_2_0, AV_CHANNEL_LAYOUT_STEREO },
     { SOUND_SYSTEM_B_0_5_0, AV_CHANNEL_LAYOUT_5POINT1 },
     { SOUND_SYSTEM_C_2_5_0, AV_CHANNEL_LAYOUT_5POINT1POINT2 },
-    { SOUND_SYSTEM_D_4_5_0, AV_CHANNEL_LAYOUT_5POINT1POINT4_BACK },
+    { SOUND_SYSTEM_D_4_5_0, AV_CHANNEL_LAYOUT_5POINT1POINT4 },
     { SOUND_SYSTEM_E_4_5_1,
         {
             .nb_channels = 11,
@@ -130,10 +130,10 @@ const struct IAMFSoundSystemMap ff_iamf_sound_system_map[14] = {
         },
     },
     { SOUND_SYSTEM_F_3_7_0,  AV_CHANNEL_LAYOUT_7POINT2POINT3 },
-    { SOUND_SYSTEM_G_4_9_0,  AV_CHANNEL_LAYOUT_9POINT1POINT4_BACK },
+    { SOUND_SYSTEM_G_4_9_0,  AV_CHANNEL_LAYOUT_9POINT1POINT4 },
     { SOUND_SYSTEM_H_9_10_3, AV_CHANNEL_LAYOUT_22POINT2 },
     { SOUND_SYSTEM_I_0_7_0,  AV_CHANNEL_LAYOUT_7POINT1 },
-    { SOUND_SYSTEM_J_4_7_0,  AV_CHANNEL_LAYOUT_7POINT1POINT4_BACK },
+    { SOUND_SYSTEM_J_4_7_0,  AV_CHANNEL_LAYOUT_7POINT1POINT4 },
     { SOUND_SYSTEM_10_2_7_0, AV_CHANNEL_LAYOUT_7POINT1POINT2 },
     { SOUND_SYSTEM_11_2_3_0, AV_CHANNEL_LAYOUT_3POINT1POINT2 },
     { SOUND_SYSTEM_12_0_1_0, AV_CHANNEL_LAYOUT_MONO },
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.