aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2018-10-19 16:41:01 +0200
committerJean-Michel Trivi <jmtrivi@google.com>2018-12-27 14:48:15 -0500
commit0271d6a6f3111be142456bf185e834aa5bc10309 (patch)
treebb2ced674e4890f61414d47f441b682c984b8121
parent804f41ac64168ea32bdf822aba930b1cfa4e1646 (diff)
downloadfdk-aac-0271d6a6f3111be142456bf185e834aa5bc10309.tar.gz
fdk-aac-0271d6a6f3111be142456bf185e834aa5bc10309.tar.bz2
fdk-aac-0271d6a6f3111be142456bf185e834aa5bc10309.zip
Call QMF transposer initialization only with successful SBR processing
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc Change-Id: I8a8626a83e1bd87b2c14fad7c90174e4172c01b6
-rw-r--r--libSBRdec/src/hbe.cpp4
-rw-r--r--libSBRdec/src/sbr_dec.cpp2
-rw-r--r--libSBRdec/src/sbrdecoder.cpp7
3 files changed, 11 insertions, 2 deletions
diff --git a/libSBRdec/src/hbe.cpp b/libSBRdec/src/hbe.cpp
index 53b21c9..1141e9c 100644
--- a/libSBRdec/src/hbe.cpp
+++ b/libSBRdec/src/hbe.cpp
@@ -1056,6 +1056,10 @@ SBR_ERROR QmfTransposerReInit(HANDLE_HBE_TRANSPOSER hQmfTransposer,
const FIXP_QTW* tmp_t_sin;
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->synthSize =
diff --git a/libSBRdec/src/sbr_dec.cpp b/libSBRdec/src/sbr_dec.cpp
index 2e18e6c..30611e7 100644
--- a/libSBRdec/src/sbr_dec.cpp
+++ b/libSBRdec/src/sbr_dec.cpp
@@ -1248,7 +1248,7 @@ resetSbrDec(HANDLE_SBR_DEC hSbrDec, HANDLE_SBR_HEADER_DATA hHeaderData,
hSbrDec->savedStates = 0;
- if (flags & SBRDEC_USAC_HARMONICSBR) {
+ if ((flags & SBRDEC_USAC_HARMONICSBR) && applySbrProc) {
sbrError = QmfTransposerReInit(hSbrDec->hHBE,
hHeaderData->freqBandData.freqBandTable,
hHeaderData->freqBandData.nSfb);
diff --git a/libSBRdec/src/sbrdecoder.cpp b/libSBRdec/src/sbrdecoder.cpp
index e2455da..f40639b 100644
--- a/libSBRdec/src/sbrdecoder.cpp
+++ b/libSBRdec/src/sbrdecoder.cpp
@@ -1677,6 +1677,9 @@ static SBR_ERROR sbrDecoder_DecodeElement(
/* reset */
if (hSbrHeader->status & SBRDEC_HDR_STAT_RESET) {
int ch;
+ int applySbrProc = (hSbrHeader->syncState == SBR_ACTIVE ||
+ (hSbrHeader->frameErrorFlag == 0 &&
+ hSbrHeader->syncState == SBR_HEADER));
for (ch = 0; ch < numElementChannels; ch++) {
SBR_ERROR errorStatusTmp = SBRDEC_OK;
@@ -1688,7 +1691,9 @@ static SBR_ERROR sbrDecoder_DecodeElement(
hSbrHeader->syncState = UPSAMPLING;
}
}
- hSbrHeader->status &= ~SBRDEC_HDR_STAT_RESET;
+ if (applySbrProc) {
+ hSbrHeader->status &= ~SBRDEC_HDR_STAT_RESET;
+ }
}
/* decoding */