diff options
author | Fraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de> | 2019-05-15 09:27:01 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-05-15 09:27:01 -0700 |
commit | 94cac56aeb602c444b07f6dcbd6842203a45ff7d (patch) | |
tree | 0bb085787fb4099383f8d933d8f3f49a429480af /libSBRdec | |
parent | 2a6d4c38e3c02c18a8ce1a26d004ec51692e2e7b (diff) | |
parent | b1f3f352195bffa680fb81e83749d1d3a3540b11 (diff) | |
download | fdk-aac-94cac56aeb602c444b07f6dcbd6842203a45ff7d.tar.gz fdk-aac-94cac56aeb602c444b07f6dcbd6842203a45ff7d.tar.bz2 fdk-aac-94cac56aeb602c444b07f6dcbd6842203a45ff7d.zip |
Avoid -1.0 autocorrelation input data. am: e51063ca54
am: b1f3f35219
Change-Id: I2ec13443e41b2a92571a22d6b968b3eb2590c960
Diffstat (limited to 'libSBRdec')
-rw-r--r-- | libSBRdec/src/lpp_tran.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/libSBRdec/src/lpp_tran.cpp b/libSBRdec/src/lpp_tran.cpp index 2ef07eb..6acb626 100644 --- a/libSBRdec/src/lpp_tran.cpp +++ b/libSBRdec/src/lpp_tran.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 @@ -446,8 +446,26 @@ void lppTransposer( pSettings->nCols) + lowBandShift); } - dynamicScale = fixMax( - 0, dynamicScale - 1); /* one additional bit headroom to prevent -1.0 */ + + if (dynamicScale == 0) { + /* In this special case the available headroom bits as well as + ovLowBandShift and lowBandShift are zero. The spectrum is limited to + prevent -1.0, so negative values for dynamicScale can be avoided. */ + for (i = 0; i < (LPC_ORDER + pSettings->overlap + pSettings->nCols); + i++) { + lowBandReal[i] = fixMax(lowBandReal[i], (FIXP_DBL)0x80000001); + } + if (!useLP) { + for (i = 0; i < (LPC_ORDER + pSettings->overlap + pSettings->nCols); + i++) { + lowBandImag[i] = fixMax(lowBandImag[i], (FIXP_DBL)0x80000001); + } + } + } else { + dynamicScale = + fixMax(0, dynamicScale - + 1); /* one additional bit headroom to prevent -1.0 */ + } /* Scale temporal QMF buffer. |