1
0
mirror of https://github.com/mstorsjo/fdk-aac.git synced 2025-06-05 22:39:13 +02:00

Remove obsolete uni drc precedence handling

Bug: 241391733
Test: see bug
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:4c41b05b6c60275c2a6b28918f40c218a8b818f6)
Merged-In: I0ddc479626fb6a89d04bc989256ad1d8ec4275a3
Change-Id: I0ddc479626fb6a89d04bc989256ad1d8ec4275a3
This commit is contained in:
Jean-Michel Trivi
2023-04-25 17:04:25 +00:00
parent 0f065e796b
commit 167dcc380a
5 changed files with 11 additions and 48 deletions

View File

@ -1689,8 +1689,6 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(HANDLE_AACDECODER self,
FIXP_DBL channelGain[(8)];
int reverseInChannelMap[(8)];
int reverseOutChannelMap[(8)];
int numDrcOutChannels = FDK_drcDec_GetParam(
self->hUniDrcDecoder, DRC_DEC_TARGET_CHANNEL_COUNT_SELECTED);
FDKmemclear(channelGain, sizeof(channelGain));
for (ch = 0; ch < (8); ch++) {
reverseInChannelMap[ch] = ch;
@ -1713,17 +1711,6 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(HANDLE_AACDECODER self,
drcDelay += CConcealment_GetDelay(&self->concealCommonData) *
self->streamInfo.frameSize;
for (ch = 0; ch < self->streamInfo.numChannels; ch++) {
UCHAR mapValue = FDK_chMapDescr_getMapValue(
&self->mapDescr, (UCHAR)ch, self->chMapIndex);
if (mapValue < (8)) reverseInChannelMap[mapValue] = ch;
}
for (ch = 0; ch < (int)numDrcOutChannels; ch++) {
UCHAR mapValue = FDK_chMapDescr_getMapValue(
&self->mapDescr, (UCHAR)ch, numDrcOutChannels);
if (mapValue < (8)) reverseOutChannelMap[mapValue] = ch;
}
/* The output of SBR and MPS is interleaved. Deinterleaving may be
* necessary for FDK_drcDec_ProcessTime, which accepts deinterleaved
* audio only. */
@ -1758,11 +1745,9 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(HANDLE_AACDECODER self,
FDK_drcDec_Preprocess(self->hUniDrcDecoder);
/* apply DRC1 gain sequence */
for (ch = 0; ch < self->streamInfo.numChannels; ch++) {
FDK_drcDec_ProcessTime(self->hUniDrcDecoder, drcDelay, DRC_DEC_DRC1,
ch, reverseInChannelMap[ch] - ch, 1,
drcWorkBuffer, self->streamInfo.frameSize);
}
FDK_drcDec_ProcessTime(self->hUniDrcDecoder, drcDelay, DRC_DEC_DRC1,
0, 0, self->streamInfo.numChannels,
drcWorkBuffer, self->streamInfo.frameSize);
/* apply downmix */
FDK_drcDec_ApplyDownmix(
self->hUniDrcDecoder, reverseInChannelMap, reverseOutChannelMap,
@ -1770,12 +1755,10 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(HANDLE_AACDECODER self,
&self->streamInfo.numChannels); /* self->streamInfo.numChannels
may change here */
/* apply DRC2/3 gain sequence */
for (ch = 0; ch < self->streamInfo.numChannels; ch++) {
FDK_drcDec_ProcessTime(self->hUniDrcDecoder, drcDelay,
DRC_DEC_DRC2_DRC3, ch,
reverseOutChannelMap[ch] - ch, 1,
drcWorkBuffer, self->streamInfo.frameSize);
}
FDK_drcDec_ProcessTime(self->hUniDrcDecoder, drcDelay,
DRC_DEC_DRC2_DRC3, 0, 0,
self->streamInfo.numChannels, drcWorkBuffer,
self->streamInfo.frameSize);
if (needsDeinterleaving) {
FDK_interleave(