mirror of https://github.com/mstorsjo/fdk-aac.git
Call QMF transposer initialization only with successful SBR processing
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc Change-Id: I8a8626a83e1bd87b2c14fad7c90174e4172c01b6
This commit is contained in:
parent
804f41ac64
commit
0271d6a6f3
|
@ -1056,6 +1056,10 @@ SBR_ERROR QmfTransposerReInit(HANDLE_HBE_TRANSPOSER hQmfTransposer,
|
||||||
const FIXP_QTW* tmp_t_sin;
|
const FIXP_QTW* tmp_t_sin;
|
||||||
|
|
||||||
hQmfTransposer->startBand = FreqBandTable[0][0];
|
hQmfTransposer->startBand = FreqBandTable[0][0];
|
||||||
|
FDK_ASSERT((!hQmfTransposer->bSbr41 && hQmfTransposer->startBand <= 32) ||
|
||||||
|
(hQmfTransposer->bSbr41 &&
|
||||||
|
hQmfTransposer->startBand <=
|
||||||
|
16)); /* is checked by resetFreqBandTables() */
|
||||||
hQmfTransposer->stopBand = FreqBandTable[0][NSfb[0]];
|
hQmfTransposer->stopBand = FreqBandTable[0][NSfb[0]];
|
||||||
|
|
||||||
hQmfTransposer->synthSize =
|
hQmfTransposer->synthSize =
|
||||||
|
|
|
@ -1248,7 +1248,7 @@ resetSbrDec(HANDLE_SBR_DEC hSbrDec, HANDLE_SBR_HEADER_DATA hHeaderData,
|
||||||
|
|
||||||
hSbrDec->savedStates = 0;
|
hSbrDec->savedStates = 0;
|
||||||
|
|
||||||
if (flags & SBRDEC_USAC_HARMONICSBR) {
|
if ((flags & SBRDEC_USAC_HARMONICSBR) && applySbrProc) {
|
||||||
sbrError = QmfTransposerReInit(hSbrDec->hHBE,
|
sbrError = QmfTransposerReInit(hSbrDec->hHBE,
|
||||||
hHeaderData->freqBandData.freqBandTable,
|
hHeaderData->freqBandData.freqBandTable,
|
||||||
hHeaderData->freqBandData.nSfb);
|
hHeaderData->freqBandData.nSfb);
|
||||||
|
|
|
@ -1677,6 +1677,9 @@ static SBR_ERROR sbrDecoder_DecodeElement(
|
||||||
/* reset */
|
/* reset */
|
||||||
if (hSbrHeader->status & SBRDEC_HDR_STAT_RESET) {
|
if (hSbrHeader->status & SBRDEC_HDR_STAT_RESET) {
|
||||||
int ch;
|
int ch;
|
||||||
|
int applySbrProc = (hSbrHeader->syncState == SBR_ACTIVE ||
|
||||||
|
(hSbrHeader->frameErrorFlag == 0 &&
|
||||||
|
hSbrHeader->syncState == SBR_HEADER));
|
||||||
for (ch = 0; ch < numElementChannels; ch++) {
|
for (ch = 0; ch < numElementChannels; ch++) {
|
||||||
SBR_ERROR errorStatusTmp = SBRDEC_OK;
|
SBR_ERROR errorStatusTmp = SBRDEC_OK;
|
||||||
|
|
||||||
|
@ -1688,7 +1691,9 @@ static SBR_ERROR sbrDecoder_DecodeElement(
|
||||||
hSbrHeader->syncState = UPSAMPLING;
|
hSbrHeader->syncState = UPSAMPLING;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hSbrHeader->status &= ~SBRDEC_HDR_STAT_RESET;
|
if (applySbrProc) {
|
||||||
|
hSbrHeader->status &= ~SBRDEC_HDR_STAT_RESET;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* decoding */
|
/* decoding */
|
||||||
|
|
Loading…
Reference in New Issue