aboutsummaryrefslogtreecommitdiffstats
path: root/libAACdec/src/aacdecoder.cpp
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-01-24 04:13:28 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-01-24 04:13:28 +0000
commit5d864894785ccf240717f78aa35e8a2b9371b62f (patch)
treee4bd2c8d1c13085e3c2babcfeb39ea867a3f596e /libAACdec/src/aacdecoder.cpp
parent3a6eca5c661f7e7596c39aa9e4a5c6763bbef035 (diff)
parentf04a8a855cf8ddb5996c8e191fd3fa15b3808657 (diff)
downloadfdk-aac-5d864894785ccf240717f78aa35e8a2b9371b62f.tar.gz
fdk-aac-5d864894785ccf240717f78aa35e8a2b9371b62f.tar.bz2
fdk-aac-5d864894785ccf240717f78aa35e8a2b9371b62f.zip
Snap for 6157842 from f04a8a855cf8ddb5996c8e191fd3fa15b3808657 to rvc-release
Change-Id: Icd800c3d313c30fc67595fc70baaf69b12188cd7
Diffstat (limited to 'libAACdec/src/aacdecoder.cpp')
-rw-r--r--libAACdec/src/aacdecoder.cpp39
1 files changed, 32 insertions, 7 deletions
diff --git a/libAACdec/src/aacdecoder.cpp b/libAACdec/src/aacdecoder.cpp
index 6b5a86c..bd12d96 100644
--- a/libAACdec/src/aacdecoder.cpp
+++ b/libAACdec/src/aacdecoder.cpp
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten
+© Copyright 1995 - 2020 Fraunhofer-Gesellschaft zur Förderung der angewandten
Forschung e.V. All rights reserved.
1. INTRODUCTION
@@ -1848,6 +1848,12 @@ CAacDecoder_Init(HANDLE_AACDECODER self, const CSAudioSpecificConfig *asc,
self->streamInfo.extSamplingRate / self->downscaleFactor;
}
}
+ if ((asc->m_aot == AOT_AAC_LC) && (asc->m_sbrPresentFlag == 1) &&
+ (asc->m_extensionSamplingFrequency > (2 * asc->m_samplingFrequency))) {
+ return AAC_DEC_UNSUPPORTED_SAMPLINGRATE; /* Core decoder supports at most a
+ 1:2 upsampling for HE-AAC and
+ HE-AACv2 */
+ }
/* --------- vcb11 ------------ */
self->flags[streamIndex] |= (asc->m_vcb11Flag) ? AC_ER_VCB11 : 0;
@@ -2366,6 +2372,13 @@ CAacDecoder_Init(HANDLE_AACDECODER self, const CSAudioSpecificConfig *asc,
goto bail;
}
+ if (*configChanged) {
+ if (asc->m_aot == AOT_USAC) {
+ self->hDrcInfo->enable = 0;
+ self->hDrcInfo->progRefLevelPresent = 0;
+ }
+ }
+
if (asc->m_aot == AOT_USAC) {
pcmLimiter_SetAttack(self->hLimiter, (5));
pcmLimiter_SetThreshold(self->hLimiter, FL2FXCONST_DBL(0.89125094f));
@@ -3172,9 +3185,15 @@ LINKSPEC_CPP AAC_DECODER_ERROR CAacDecoder_DecodeFrame(
self->hDrcInfo, bs, self->pAacDecoderStaticChannelInfo,
pce->ElementInstanceTag, drcChMap, aacChannels);
if (mapped > 0) {
- /* If at least one DRC thread has been mapped to a channel threre was DRC
- * data in the bitstream. */
- self->flags[streamIndex] |= AC_DRC_PRESENT;
+ if (!(self->flags[streamIndex] & (AC_USAC | AC_RSV603DA))) {
+ /* If at least one DRC thread has been mapped to a channel there was DRC
+ * data in the bitstream. */
+ self->flags[streamIndex] |= AC_DRC_PRESENT;
+ } else {
+ self->hDrcInfo->enable = 0;
+ self->hDrcInfo->progRefLevelPresent = 0;
+ ErrorStatus = AAC_DEC_UNSUPPORTED_FORMAT;
+ }
}
/* Create a reverse mapping table */
@@ -3419,9 +3438,15 @@ LINKSPEC_CPP AAC_DECODER_ERROR CAacDecoder_DecodeFrame(
self->hDrcInfo, bs, self->pAacDecoderStaticChannelInfo,
pce->ElementInstanceTag, drcChMap, aacChannels);
if (mapped > 0) {
- /* If at least one DRC thread has been mapped to a channel threre was DRC
- * data in the bitstream. */
- self->flags[streamIndex] |= AC_DRC_PRESENT;
+ if (!(self->flags[streamIndex] & (AC_USAC | AC_RSV603DA))) {
+ /* If at least one DRC thread has been mapped to a channel there was DRC
+ * data in the bitstream. */
+ self->flags[streamIndex] |= AC_DRC_PRESENT;
+ } else {
+ self->hDrcInfo->enable = 0;
+ self->hDrcInfo->progRefLevelPresent = 0;
+ ErrorStatus = AAC_DEC_UNSUPPORTED_FORMAT;
+ }
}
}