aboutsummaryrefslogtreecommitdiffstats
path: root/libAACdec
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2018-10-19 16:41:27 +0200
committerJean-Michel Trivi <jmtrivi@google.com>2018-12-27 14:51:52 -0500
commit0cebd077b61cc0946ea4062bf816defdffaef72b (patch)
treee78e88638c742d3dcd5f704d6ad50758d256a945 /libAACdec
parent0271d6a6f3111be142456bf185e834aa5bc10309 (diff)
downloadfdk-aac-0cebd077b61cc0946ea4062bf816defdffaef72b.tar.gz
fdk-aac-0cebd077b61cc0946ea4062bf816defdffaef72b.tar.bz2
fdk-aac-0cebd077b61cc0946ea4062bf816defdffaef72b.zip
Apply sbrDecoder_Parse() function for all explict SBR elements
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc Change-Id: I97471c4db309307a21100f1d5d88d3c4e24d2670
Diffstat (limited to 'libAACdec')
-rw-r--r--libAACdec/src/aacdecoder.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/libAACdec/src/aacdecoder.cpp b/libAACdec/src/aacdecoder.cpp
index c2ddc48..a529389 100644
--- a/libAACdec/src/aacdecoder.cpp
+++ b/libAACdec/src/aacdecoder.cpp
@@ -1111,12 +1111,13 @@ static AAC_DECODER_ERROR aacDecoder_ParseExplicitMpsAndSbr(
/* get the remaining bits of this frame */
bitCnt = transportDec_GetAuBitsRemaining(self->hInput, 0);
- if ((bitCnt > 0) && (self->flags[0] & AC_SBR_PRESENT) &&
+ if ((self->flags[0] & AC_SBR_PRESENT) &&
(self->flags[0] & (AC_USAC | AC_RSVD50 | AC_ELD | AC_DRM))) {
SBR_ERROR err = SBRDEC_OK;
int chElIdx, numChElements = el_cnt[ID_SCE] + el_cnt[ID_CPE] +
el_cnt[ID_LFE] + el_cnt[ID_USAC_SCE] +
el_cnt[ID_USAC_CPE] + el_cnt[ID_USAC_LFE];
+ INT bitCntTmp = bitCnt;
if (self->flags[0] & AC_USAC) {
chElIdx = numChElements - 1;
@@ -1126,6 +1127,7 @@ static AAC_DECODER_ERROR aacDecoder_ParseExplicitMpsAndSbr(
for (; chElIdx < numChElements; chElIdx += 1) {
MP4_ELEMENT_ID sbrType;
+ SBR_ERROR errTmp;
if (self->flags[0] & (AC_USAC)) {
FDK_ASSERT((self->elements[element_index] == ID_USAC_SCE) ||
(self->elements[element_index] == ID_USAC_CPE));
@@ -1135,19 +1137,21 @@ static AAC_DECODER_ERROR aacDecoder_ParseExplicitMpsAndSbr(
: ID_SCE;
} else
sbrType = self->elements[chElIdx];
- err = sbrDecoder_Parse(self->hSbrDecoder, bs, self->pDrmBsBuffer,
- self->drmBsBufferSize, &bitCnt, -1,
- self->flags[0] & AC_SBRCRC, sbrType, chElIdx,
- self->flags[0], self->elFlags);
- if (err != SBRDEC_OK) {
- break;
+ errTmp = sbrDecoder_Parse(self->hSbrDecoder, bs, self->pDrmBsBuffer,
+ self->drmBsBufferSize, &bitCnt, -1,
+ self->flags[0] & AC_SBRCRC, sbrType, chElIdx,
+ self->flags[0], self->elFlags);
+ if (errTmp != SBRDEC_OK) {
+ err = errTmp;
+ bitCntTmp = bitCnt;
+ bitCnt = 0;
}
}
switch (err) {
case SBRDEC_PARSE_ERROR:
/* Can not go on parsing because we do not
know the length of the SBR extension data. */
- FDKpushFor(bs, bitCnt);
+ FDKpushFor(bs, bitCntTmp);
bitCnt = 0;
break;
case SBRDEC_OK: