summaryrefslogtreecommitdiffstats
path: root/libAACenc/src/channel_map.cpp
diff options
context:
space:
mode:
authorSergio Ammirata <sergio@ammirata.net>2012-10-04 15:51:05 -0400
committerMartin Storsjo <martin@martin.st>2012-10-05 12:17:37 +0300
commit790bf9f088f8960b62d189eb44322d078109f272 (patch)
tree35757a4b7d1b112cb2a6f4c0ce6acda178781c6b /libAACenc/src/channel_map.cpp
parente79b172ba6f62855b7d5d5b86cd3c118be8750ea (diff)
downloadODR-AudioEnc-790bf9f088f8960b62d189eb44322d078109f272.tar.gz
ODR-AudioEnc-790bf9f088f8960b62d189eb44322d078109f272.tar.bz2
ODR-AudioEnc-790bf9f088f8960b62d189eb44322d078109f272.zip
Add support for Workgroup 4 (WG4) channel mapping
This is the channel ordering used in DVD Audio, and is the standard used internally in the VLC media player.
Diffstat (limited to 'libAACenc/src/channel_map.cpp')
-rw-r--r--libAACenc/src/channel_map.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/libAACenc/src/channel_map.cpp b/libAACenc/src/channel_map.cpp
index 687ed83..6eddd47 100644
--- a/libAACenc/src/channel_map.cpp
+++ b/libAACenc/src/channel_map.cpp
@@ -153,6 +153,18 @@ static const CHANNEL_ASSIGNMENT_INFO_TAB assignmentInfoTabWav[] =
{ MODE_1_2_2_2_1, { 2, 0, 1, 6, 7, 4, 5, 3,-1,-1,-1,-1} }, /* 7.1ch */
};
+static const CHANNEL_ASSIGNMENT_INFO_TAB assignmentInfoTabWg4[] =
+{
+ { MODE_INVALID, {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} }, /* invalid */
+ { MODE_1, { 0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} }, /* mono */
+ { MODE_2, { 0, 1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} }, /* stereo */
+ { MODE_1_2, { 2, 0, 1,-1,-1,-1,-1,-1,-1,-1,-1,-1} }, /* 3ch */
+ { MODE_1_2_1, { 3, 0, 1, 2,-1,-1,-1,-1,-1,-1,-1,-1} }, /* 4ch */
+ { MODE_1_2_2, { 4, 0, 1, 2, 3,-1,-1,-1,-1,-1,-1,-1} }, /* 5ch */
+ { MODE_1_2_2_1, { 4, 0, 1, 2, 3, 5,-1,-1,-1,-1,-1,-1} }, /* 5.1ch */
+ { MODE_1_2_2_2_1, { 6, 0, 1, 2, 3, 4, 5, 7,-1,-1,-1,-1} }, /* 7.1ch */
+};
+
/* Channel mode configuration tab provides,
corresponding number of channels and elements
*/
@@ -176,8 +188,10 @@ const INT* FDKaacEnc_getChannelAssignment(CHANNEL_MODE encMode, CHANNEL_ORDER co
if (co == CH_ORDER_MPEG)
pTab = assignmentInfoTabMpeg;
- else
+ else if (co == CH_ORDER_WAV)
pTab = assignmentInfoTabWav;
+ else
+ pTab = assignmentInfoTabWg4;
for(i=MAX_MODES-1; i>0; i--) {
if (encMode== pTab[i].encoderMode) {