diff options
author | Xin Li <delphij@google.com> | 2019-09-04 13:33:32 -0700 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2019-09-04 13:33:32 -0700 |
commit | a209adb315f970aa97044a82551a6f5617d61ded (patch) | |
tree | fa62c4f58bc140ba5c0a27e2c913d3ea0a5bfe98 /libDRCdec/src/drcGainDec_init.cpp | |
parent | c2eb64586d6dfc0f067ea66631b38d1922a106ed (diff) | |
parent | 62661035192a7f66b3722d8a1fd365391a35f292 (diff) | |
download | fdk-aac-a209adb315f970aa97044a82551a6f5617d61ded.tar.gz fdk-aac-a209adb315f970aa97044a82551a6f5617d61ded.tar.bz2 fdk-aac-a209adb315f970aa97044a82551a6f5617d61ded.zip |
DO NOT MERGE - Merge Android 10 into master
Bug: 139893257
Change-Id: I7e02014b30f1ae5d19dbb7126ebb2a69c411fe5c
Diffstat (limited to 'libDRCdec/src/drcGainDec_init.cpp')
-rw-r--r-- | libDRCdec/src/drcGainDec_init.cpp | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/libDRCdec/src/drcGainDec_init.cpp b/libDRCdec/src/drcGainDec_init.cpp index 38f3243..89d0f55 100644 --- a/libDRCdec/src/drcGainDec_init.cpp +++ b/libDRCdec/src/drcGainDec_init.cpp @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -184,24 +184,11 @@ static DRC_ERROR _generateDrcInstructionsDerivedData( } DRC_ERROR -initGainDec(HANDLE_DRC_GAIN_DECODER hGainDec, const int frameSize, - const int sampleRate) { +initGainDec(HANDLE_DRC_GAIN_DECODER hGainDec) { int i, j, k; - if (frameSize < 1) { - return DE_NOT_OK; - } - - hGainDec->frameSize = frameSize; - - if (hGainDec->frameSize * 1000 < sampleRate) { - return DE_NOT_OK; - } - - hGainDec->deltaTminDefault = getDeltaTmin(sampleRate); - if (hGainDec->deltaTminDefault > hGainDec->frameSize) { - return DE_NOT_OK; - } + /* sanity check */ + if (hGainDec->deltaTminDefault > hGainDec->frameSize) return DE_NOT_OK; for (i = 0; i < MAX_ACTIVE_DRCS; i++) { for (j = 0; j < 8; j++) { @@ -336,9 +323,11 @@ initActiveDrcOffset(HANDLE_DRC_GAIN_DECODER hGainDec) { for (a = 0; a < hGainDec->nActiveDrcs; a++) { hGainDec->activeDrc[a].activeDrcOffset = accGainElementCount; accGainElementCount += hGainDec->activeDrc[a].gainElementCount; + if (accGainElementCount > 12) { + hGainDec->nActiveDrcs = a; + return DE_NOT_OK; + } } - if (accGainElementCount > 12) return DE_NOT_OK; - return DE_OK; } |