Commit 790bf9f0 authored by Sergio Ammirata's avatar Sergio Ammirata Committed by Martin Storsjo

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.
parent e79b172b
......@@ -174,7 +174,8 @@ typedef enum {
typedef enum {
CH_ORDER_MPEG = 0, /*!< MPEG channel ordering (e. g. 5.1: C, L, R, SL, SR, LFE) */
CH_ORDER_WAV /*!< WAV fileformat channel ordering (e. g. 5.1: L, R, C, LFE, SL, SR) */
CH_ORDER_WAV, /*!< WAV fileformat channel ordering (e. g. 5.1: L, R, C, LFE, SL, SR) */
CH_ORDER_WG4 /*!< WG4 fileformat channel ordering (e. g. 5.1: L, R, SL, SR, C, LFE) */
} CHANNEL_ORDER;
......
......@@ -1657,7 +1657,7 @@ AACENC_ERROR aacEncoder_SetParam(
break;
case AACENC_CHANNELORDER:
if (hAacEncoder->aacConfig.channelOrder != (CHANNEL_ORDER)value) {
if (! ((value==0) || (value==1)) ) {
if (! ((value==0) || (value==1) || (value==2)) ) {
err = AACENC_INVALID_CONFIG;
break;
}
......
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment