diff options
author | Fraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de> | 2018-08-15 14:36:49 +0200 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2018-12-27 12:29:27 -0500 |
commit | e93cd75ea41e0b374ffc519400a202714c819a59 (patch) | |
tree | ab428167f95adb4a9cdc0188fca5334b91af6424 /libSBRdec/src/env_calc.cpp | |
parent | 55930c28afb15d2a05ef5106e887d3e6b998524d (diff) | |
download | fdk-aac-e93cd75ea41e0b374ffc519400a202714c819a59.tar.gz fdk-aac-e93cd75ea41e0b374ffc519400a202714c819a59.tar.bz2 fdk-aac-e93cd75ea41e0b374ffc519400a202714c819a59.zip |
Limit too large scale_change exponent used in adjustTimeSlot
Bug: 112892953
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I4fe66defb40a36612850582cb0f1da7fb07a8bed
Diffstat (limited to 'libSBRdec/src/env_calc.cpp')
-rw-r--r-- | libSBRdec/src/env_calc.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libSBRdec/src/env_calc.cpp b/libSBRdec/src/env_calc.cpp index d7a8bb5..10c73ec 100644 --- a/libSBRdec/src/env_calc.cpp +++ b/libSBRdec/src/env_calc.cpp @@ -1561,13 +1561,14 @@ void calculateSbrEnvelope( adjustTimeSlotHQ_GainAndNoise( &analysBufferReal[j][lowSubband], &analysBufferImag[j][lowSubband], h_sbr_cal_env, pNrgs, - lowSubband, noSubbands, scale_change, smooth_ratio, noNoiseFlag, - filtBufferNoiseShift); + lowSubband, noSubbands, fMin(scale_change, DFRACT_BITS - 1), + smooth_ratio, noNoiseFlag, filtBufferNoiseShift); } else { adjustTimeSlotHQ(&analysBufferReal[j][lowSubband], &analysBufferImag[j][lowSubband], h_sbr_cal_env, - pNrgs, lowSubband, noSubbands, scale_change, - smooth_ratio, noNoiseFlag, filtBufferNoiseShift); + pNrgs, lowSubband, noSubbands, + fMin(scale_change, DFRACT_BITS - 1), smooth_ratio, + noNoiseFlag, filtBufferNoiseShift); } } else { FDK_ASSERT(!iTES_enable); /* not supported */ @@ -1575,13 +1576,14 @@ void calculateSbrEnvelope( /* FDKmemset(analysBufferReal[j], 0, 64 * sizeof(FIXP_DBL)); */ adjustTimeSlot_EldGrid(&analysBufferReal[j][lowSubband], pNrgs, &h_sbr_cal_env->harmIndex, lowSubband, - noSubbands, scale_change, noNoiseFlag, - &h_sbr_cal_env->phaseIndex, + noSubbands, + fMin(scale_change, DFRACT_BITS - 1), + noNoiseFlag, &h_sbr_cal_env->phaseIndex, EXP2SCALE(adj_e) - sbrScaleFactor->lb_scale); } else { adjustTimeSlotLC(&analysBufferReal[j][lowSubband], pNrgs, &h_sbr_cal_env->harmIndex, lowSubband, noSubbands, - scale_change, noNoiseFlag, + fMin(scale_change, DFRACT_BITS - 1), noNoiseFlag, &h_sbr_cal_env->phaseIndex); } } |