mirror of
https://github.com/mstorsjo/fdk-aac.git
synced 2025-06-05 22:39:13 +02:00
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
This commit is contained in:
@ -110,7 +110,7 @@ amm-info@iis.fraunhofer.de
|
||||
/* Decoder library info */
|
||||
#define AACDECODER_LIB_VL0 2
|
||||
#define AACDECODER_LIB_VL1 5
|
||||
#define AACDECODER_LIB_VL2 5
|
||||
#define AACDECODER_LIB_VL2 6
|
||||
#define AACDECODER_LIB_TITLE "AAC Decoder Lib"
|
||||
#define AACDECODER_LIB_BUILD_DATE __DATE__
|
||||
#define AACDECODER_LIB_BUILD_TIME __TIME__
|
||||
@ -420,8 +420,8 @@ aacDecoder_SetParam ( const HANDLE_AACDECODER self, /*!< Handle of the decode
|
||||
self->outputInterleaved = value;
|
||||
break;
|
||||
|
||||
case AAC_PCM_OUTPUT_CHANNELS:
|
||||
if (value < -1 || value > (6)) {
|
||||
case AAC_PCM_MIN_OUTPUT_CHANNELS:
|
||||
if (value < -1 || value > (8)) {
|
||||
return AAC_DEC_SET_PARAM_FAIL;
|
||||
}
|
||||
{
|
||||
@ -429,7 +429,30 @@ aacDecoder_SetParam ( const HANDLE_AACDECODER self, /*!< Handle of the decode
|
||||
|
||||
err = pcmDmx_SetParam (
|
||||
hPcmDmx,
|
||||
NUMBER_OF_OUTPUT_CHANNELS,
|
||||
MIN_NUMBER_OF_OUTPUT_CHANNELS,
|
||||
value );
|
||||
|
||||
switch (err) {
|
||||
case PCMDMX_OK:
|
||||
break;
|
||||
case PCMDMX_INVALID_HANDLE:
|
||||
return AAC_DEC_INVALID_HANDLE;
|
||||
default:
|
||||
return AAC_DEC_SET_PARAM_FAIL;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case AAC_PCM_MAX_OUTPUT_CHANNELS:
|
||||
if (value < -1 || value > (8)) {
|
||||
return AAC_DEC_SET_PARAM_FAIL;
|
||||
}
|
||||
{
|
||||
PCMDMX_ERROR err;
|
||||
|
||||
err = pcmDmx_SetParam (
|
||||
hPcmDmx,
|
||||
MAX_NUMBER_OF_OUTPUT_CHANNELS,
|
||||
value );
|
||||
|
||||
switch (err) {
|
||||
@ -449,7 +472,7 @@ aacDecoder_SetParam ( const HANDLE_AACDECODER self, /*!< Handle of the decode
|
||||
|
||||
err = pcmDmx_SetParam (
|
||||
hPcmDmx,
|
||||
DUAL_CHANNEL_DOWNMIX_MODE,
|
||||
DMX_DUAL_CHANNEL_MODE,
|
||||
value );
|
||||
|
||||
switch (err) {
|
||||
@ -825,6 +848,7 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(
|
||||
if (self->sbrEnabled)
|
||||
{
|
||||
SBR_ERROR sbrError = SBRDEC_OK;
|
||||
int chOutMapIdx = ((self->chMapIndex==0) && (self->streamInfo.numChannels<7)) ? self->streamInfo.numChannels : self->chMapIndex;
|
||||
|
||||
/* set params */
|
||||
sbrDecoder_SetParam ( self->hSbrDecoder,
|
||||
@ -838,7 +862,16 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(
|
||||
(self->flags & AC_LD_MPS) ? 1 : 0 );
|
||||
}
|
||||
|
||||
{
|
||||
PCMDMX_ERROR dmxErr;
|
||||
INT maxOutCh = 0;
|
||||
|
||||
dmxErr = pcmDmx_GetParam(self->hPcmUtils, MAX_NUMBER_OF_OUTPUT_CHANNELS, &maxOutCh);
|
||||
if ( (dmxErr == PCMDMX_OK) && (maxOutCh == 1) ) {
|
||||
/* Disable PS processing if we have to create a mono output signal. */
|
||||
self->psPossible = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* apply SBR processing */
|
||||
@ -846,7 +879,7 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(
|
||||
pTimeData,
|
||||
&self->streamInfo.numChannels,
|
||||
&self->streamInfo.sampleRate,
|
||||
self->channelOutputMapping[self->streamInfo.numChannels-1],
|
||||
self->channelOutputMapping[chOutMapIdx],
|
||||
interleaved,
|
||||
self->frameOK,
|
||||
&self->psPossible);
|
||||
@ -870,19 +903,19 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(
|
||||
self->channelType[1] = ACT_FRONT;
|
||||
self->channelIndices[0] = 0;
|
||||
self->channelIndices[1] = 1;
|
||||
} else {
|
||||
self->flags &= ~AC_PS_PRESENT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
PCMDMX_ERROR dmxErr = PCMDMX_OK;
|
||||
if ( flags & (AACDEC_INTR | AACDEC_CLRHIST) ) {
|
||||
/* delete data from the past (e.g. mixdown coeficients) */
|
||||
pcmDmx_Reset( self->hPcmUtils, PCMDMX_RESET_BS_DATA );
|
||||
}
|
||||
/* do PCM post processing */
|
||||
pcmDmx_ApplyFrame (
|
||||
dmxErr = pcmDmx_ApplyFrame (
|
||||
self->hPcmUtils,
|
||||
pTimeData,
|
||||
self->streamInfo.frameSize,
|
||||
@ -890,9 +923,15 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(
|
||||
interleaved,
|
||||
self->channelType,
|
||||
self->channelIndices,
|
||||
self->channelOutputMapping
|
||||
self->channelOutputMapping,
|
||||
NULL
|
||||
);
|
||||
|
||||
if (dmxErr == PCMDMX_INVALID_MODE) {
|
||||
/* Announce the framework that the current combination of channel configuration and downmix
|
||||
* settings are not know to produce a predictable behavior and thus maybe produce strange output. */
|
||||
ErrorStatus = AAC_DEC_DECODE_FRAME_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Signal interruption to take effect in next frame. */
|
||||
|
Reference in New Issue
Block a user