From 47c680c62246594107da0a8995c953dfb8040bce Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Fri, 27 Dec 2013 16:13:22 -0800 Subject: AAC Decoder: support 6.1/7.1 decoded as 5.1 - Add 6.1 and 7.1 channel support including downmixer. Per default the decoder creates a 5.1 channel output for all streams with more than six encoded channels. Modified file(s): libPCMutils/include/pcmutils_lib.h libPCMutils/src/pcmutils_lib.cpp libAACdec/include/aacdecoder_lib.h libAACdec/src/aac_rom.h libAACdec/src/aacdecoder.cpp libAACdec/src/aac_ram.cpp libAACdec/src/aacdec_drc.cpp libAACdec/src/aacdecoder_lib.cpp libAACdec/src/aac_rom.cpp libAACdec/src/aacdecoder.h libSBRdec/include/sbrdecoder.h libSBRdec/src/sbrdec_drc.h libSBRdec/src/sbrdecoder.cpp libSBRdec/src/sbr_ram.cpp libSBRdec/src/sbr_ram.h libMpegTPDec/include/tp_data.h libMpegTPDec/include/tpdec_lib.h libMpegTPDec/src/version libMpegTPDec/src/tpdec_asc.cpp libMpegTPEnc/include/tp_data.h libMpegTPEnc/src/version libSYS/include/FDK_audio.h libSYS/src/genericStds.cpp - Fix error concealment modules fade-out/in mechanism. Modified file(s): libAACdec/src/conceal.cpp Bug 9428126 Change-Id: I3230bd2072314b730911cd7ec1740e290cb1d254 --- libAACdec/src/aac_rom.cpp | 50 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 15 deletions(-) (limited to 'libAACdec/src/aac_rom.cpp') diff --git a/libAACdec/src/aac_rom.cpp b/libAACdec/src/aac_rom.cpp index fa04c42..607cb3b 100644 --- a/libAACdec/src/aac_rom.cpp +++ b/libAACdec/src/aac_rom.cpp @@ -1777,42 +1777,62 @@ const FIXP_TCC FDKaacDec_tnsCoeff4 [16] = }; /* MPEG like mapping (no change). */ -const UCHAR channelMappingTablePassthrough[8][8] = +const UCHAR channelMappingTablePassthrough[15][8] = { + { 0, 1, 2, 3, 4, 5, 6, 7}, /* fallback */ { 0, 1,255,255,255,255,255,255}, /* mono / PS */ { 0, 1,255,255,255,255,255,255}, /* stereo */ { 0, 1, 2,255,255,255,255,255}, /* 3ch */ { 0, 1, 2, 3,255,255,255,255}, /* 4ch */ { 0, 1, 2, 3, 4,255,255,255}, /* 5ch */ { 0, 1, 2, 3, 4, 5,255,255}, /* 5.1ch */ - { 0, 1, 2, 3, 4, 5, 6, 7}, /* 7ch */ - { 0, 1, 2, 3, 4, 5, 6, 7} /* 7.1ch */ + { 0, 1, 2, 3, 4, 5, 6, 7}, /* 7.1 front */ + { 0, 1, 2, 3, 4, 5, 6, 7}, /* reserved */ + { 0, 1, 2, 3, 4, 5, 6, 7}, /* reserved */ + { 0, 1, 2, 3, 4, 5, 6, 7}, /* reserved */ + { 0, 1, 2, 3, 4, 5, 6,255}, /* 6.1ch */ + { 0, 1, 2, 3, 4, 5, 6, 7}, /* 7.1 rear */ + { 0, 1, 2, 3, 4, 5, 6, 7}, /* reserved */ + { 0, 1, 2, 3, 4, 5, 6, 7} /* 7.1 top */ }; /* WAV file like mapping (from MPEG mapping). */ -const UCHAR channelMappingTableWAV[8][8] = +const UCHAR channelMappingTableWAV[15][8] = { + { 0, 1, 2, 3, 4, 5, 6, 7}, /* fallback */ { 0, 1,255,255,255,255,255,255}, /* mono / PS */ { 0, 1,255,255,255,255,255,255}, /* stereo */ { 2, 0, 1,255,255,255,255,255}, /* 3ch */ { 2, 0, 1, 3,255,255,255,255}, /* 4ch */ { 2, 0, 1, 3, 4,255,255,255}, /* 5ch */ { 2, 0, 1, 4, 5, 3,255,255}, /* 5.1ch */ - { 0, 1, 2, 3, 4, 5, 6, 7}, /* 7ch */ - { 2, 0, 1, 6, 7, 4, 5, 3} /* 7.1ch */ + { 2, 6, 7, 0, 1, 4, 5, 3}, /* 7.1 front */ + { 0, 1, 2, 3, 4, 5, 6, 7}, /* reserved */ + { 0, 1, 2, 3, 4, 5, 6, 7}, /* reserved */ + { 0, 1, 2, 3, 4, 5, 6, 7}, /* reserved */ + { 2, 0, 1, 4, 5, 6, 3,255}, /* 6.1ch */ + { 2, 0, 1, 6, 7, 4, 5, 3}, /* 7.1 rear */ + { 0, 1, 2, 3, 4, 5, 6, 7}, /* reserved */ + { 2, 0, 1, 4, 5, 3, 6, 7} /* 7.1 top */ }; /* Lookup tables for elements in ER bitstream */ -const MP4_ELEMENT_ID elementsTab[8][7] = +const MP4_ELEMENT_ID elementsTab[15][7] = { - {ID_SCE, ID_EXT, ID_END, ID_NONE, ID_NONE,ID_NONE,ID_NONE }, /* 1 channel */ - {ID_CPE, ID_EXT, ID_END, ID_NONE, ID_NONE,ID_NONE,ID_NONE } /* 2 channels */ - , - {ID_SCE, ID_CPE, ID_EXT, ID_END, ID_NONE,ID_NONE,ID_NONE }, /* 3 channels */ - {ID_SCE, ID_CPE, ID_SCE, ID_EXT, ID_END, ID_NONE,ID_NONE }, /* 4 channels */ - {ID_SCE, ID_CPE, ID_CPE, ID_EXT, ID_END, ID_NONE,ID_NONE }, /* 5 channels */ - {ID_SCE, ID_CPE, ID_CPE, ID_LFE, ID_EXT, ID_END, ID_NONE }, /* 6 channels */ - {ID_SCE, ID_CPE, ID_CPE, ID_CPE, ID_LFE, ID_EXT, ID_END} /* 8 channels */ + /* 1 */ { ID_SCE, ID_EXT, ID_END, ID_NONE, ID_NONE, ID_NONE, ID_NONE }, /* 1 channel */ + /* 2 */ { ID_CPE, ID_EXT, ID_END, ID_NONE, ID_NONE, ID_NONE, ID_NONE } /* 2 channels */ + /* 3 */ ,{ ID_SCE, ID_CPE, ID_EXT, ID_END, ID_NONE, ID_NONE, ID_NONE }, /* 3 channels */ + /* 4 */ { ID_SCE, ID_CPE, ID_SCE, ID_EXT, ID_END, ID_NONE, ID_NONE }, /* 4 channels */ + /* 5 */ { ID_SCE, ID_CPE, ID_CPE, ID_EXT, ID_END, ID_NONE, ID_NONE }, /* 5 channels */ + /* 6 */ { ID_SCE, ID_CPE, ID_CPE, ID_LFE, ID_EXT, ID_END, ID_NONE } /* 6 channels */ + /* 7 */ ,{ ID_SCE, ID_CPE, ID_CPE, ID_CPE, ID_LFE, ID_EXT, ID_END }, /* 8 channels */ + /* 8 */ { ID_NONE, ID_NONE, ID_NONE, ID_NONE, ID_NONE, ID_NONE, ID_NONE }, /* reserved */ + /* 9 */ { ID_NONE, ID_NONE, ID_NONE, ID_NONE, ID_NONE, ID_NONE, ID_NONE }, /* reserved */ + /* 10 */ { ID_NONE, ID_NONE, ID_NONE, ID_NONE, ID_NONE, ID_NONE, ID_NONE }, /* reserved */ + /* 11 */ { ID_SCE, ID_CPE, ID_CPE, ID_SCE, ID_LFE, ID_EXT, ID_END }, /* 7 channels */ + /* 12 */ { ID_SCE, ID_CPE, ID_CPE, ID_CPE, ID_LFE, ID_EXT, ID_END }, /* 8 channels */ + /* 13 */ { ID_NONE, ID_NONE, ID_NONE, ID_NONE, ID_NONE, ID_NONE, ID_NONE }, /* reserved */ + /* 14 */ { ID_SCE, ID_CPE, ID_CPE, ID_LFE, ID_CPE, ID_EXT, ID_END } /* 8 channels */ }; /*! Random sign bit used for concealment -- cgit v1.2.3