aboutsummaryrefslogtreecommitdiffstats
path: root/libSBRdec/src
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2019-11-13 16:08:57 +0100
committerJean-Michel Trivi <jmtrivi@google.com>2020-01-16 12:15:04 -0800
commit5d095631969aa7136ac2cb7e0e13664516054097 (patch)
treed33e05965bc9e844568c949afe2328e4a11f635a /libSBRdec/src
parent1020e48d6e76506ac85a7678fe950ce7245d3aea (diff)
downloadfdk-aac-5d095631969aa7136ac2cb7e0e13664516054097.tar.gz
fdk-aac-5d095631969aa7136ac2cb7e0e13664516054097.tar.bz2
fdk-aac-5d095631969aa7136ac2cb7e0e13664516054097.zip
Avoid too large shift exponent in apply_inter_tes() by using fIsLessThan.
Bug: 146936613 Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc Change-Id: I8414072929ec8f786e0c003f18ab453dbacb9e5e
Diffstat (limited to 'libSBRdec/src')
-rw-r--r--libSBRdec/src/env_calc.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/libSBRdec/src/env_calc.cpp b/libSBRdec/src/env_calc.cpp
index 81f03f3..0b2f651 100644
--- a/libSBRdec/src/env_calc.cpp
+++ b/libSBRdec/src/env_calc.cpp
@@ -702,20 +702,11 @@ static void apply_inter_tes(FIXP_DBL **qmfReal, FIXP_DBL **qmfImag,
gain_sf[i] += gamma_sf + 1; /* +1 because of fMultDiv2() */
/* set gain to at least 0.2f */
- FIXP_DBL point_two = FL2FXCONST_DBL(0.8f); /* scaled up by 2 */
- int point_two_sf = -2;
-
- FIXP_DBL tmp = gain[i];
- if (point_two_sf < gain_sf[i]) {
- point_two >>= gain_sf[i] - point_two_sf;
- } else {
- tmp >>= point_two_sf - gain_sf[i];
- }
-
/* limit and calculate gain[i]^2 too */
FIXP_DBL gain_pow2;
int gain_pow2_sf;
- if (tmp < point_two) {
+
+ if (fIsLessThan(gain[i], gain_sf[i], FL2FXCONST_DBL(0.2f), 0)) {
gain[i] = FL2FXCONST_DBL(0.8f);
gain_sf[i] = -2;
gain_pow2 = FL2FXCONST_DBL(0.64f);