[FFmpeg-devel] [PATCH 3/5] avcodec/aacdectab: add mapping for 22.2

Jan Ekström jeebjp at gmail.com
Wed Jul 29 14:39:50 EEST 2020


Utilizes the newly added 22.2 channel layout for channel_layout 13.
---
 libavcodec/aacdectab.h | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/libavcodec/aacdectab.h b/libavcodec/aacdectab.h
index baf51a74bf..c54a3eb943 100644
--- a/libavcodec/aacdectab.h
+++ b/libavcodec/aacdectab.h
@@ -35,9 +35,9 @@
 
 #include <stdint.h>
 
-static const int8_t tags_per_config[16] = { 0, 1, 1, 2, 3, 3, 4, 5, 0, 0, 0, 4, 5, 0, 5, 0 };
+static const int8_t tags_per_config[16] = { 0, 1, 1, 2, 3, 3, 4, 5, 0, 0, 0, 4, 5, 16, 5, 0 };
 
-static const uint8_t aac_channel_layout_map[16][5][3] = {
+static const uint8_t aac_channel_layout_map[16][16][3] = {
     { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, },
     { { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, },
     { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, },
@@ -50,6 +50,24 @@ static const uint8_t aac_channel_layout_map[16][5][3] = {
     { { 0, } },
     { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, { TYPE_SCE, 1, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE  }, },
     { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_SIDE }, { TYPE_CPE, 2, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE  }, },
+    {
+      { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, // SCE1 = FC,
+      { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, // CPE1 = FLc and FRc,
+      { TYPE_CPE, 1, AAC_CHANNEL_FRONT }, // CPE2 = FL and FR,
+      { TYPE_CPE, 2, AAC_CHANNEL_SIDE  }, // CPE3 = SiL and SiR,
+      { TYPE_CPE, 3, AAC_CHANNEL_BACK  }, // CPE4 = BL and BR,
+      { TYPE_SCE, 1, AAC_CHANNEL_BACK  }, // SCE2 = BC,
+      { TYPE_LFE, 0, AAC_CHANNEL_LFE   }, // LFE1 = LFE1,
+      { TYPE_LFE, 1, AAC_CHANNEL_LFE   }, // LFE2 = LFE2,
+      { TYPE_SCE, 2, AAC_CHANNEL_FRONT }, // SCE3 = TpFC,
+      { TYPE_CPE, 4, AAC_CHANNEL_FRONT }, // CPE5 = TpFL and TpFR,
+      { TYPE_CPE, 5, AAC_CHANNEL_SIDE  }, // CPE6 = TpSiL and TpSiR,
+      { TYPE_SCE, 3, AAC_CHANNEL_FRONT }, // SCE4 = TpC,
+      { TYPE_CPE, 6, AAC_CHANNEL_BACK  }, // CPE7 = TpBL and TpBR,
+      { TYPE_SCE, 4, AAC_CHANNEL_BACK  }, // SCE5 = TpBC,
+      { TYPE_SCE, 5, AAC_CHANNEL_FRONT }, // SCE6 = BtFC,
+      { TYPE_CPE, 7, AAC_CHANNEL_FRONT }, // CPE8 = BtFL and BtFR
+    },
     { { 0, } },
     /* TODO: Add 7+1 TOP configuration */
 };
@@ -67,6 +85,7 @@ static const uint64_t aac_channel_layout[16] = {
     0,
     AV_CH_LAYOUT_6POINT1,
     AV_CH_LAYOUT_7POINT1,
+    AV_CH_LAYOUT_22POINT2,
     0,
     /* AV_CH_LAYOUT_7POINT1_TOP, */
 };
-- 
2.26.2



More information about the ffmpeg-devel mailing list