diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2019-10-16 03:05:53 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2019-10-16 03:05:53 +0000 |
commit | dcf27337e1865276b5cf73dc42019b48b5687372 (patch) | |
tree | de347f8af20db2eabac232391c34ea8ee7eae36c /libSBRdec | |
parent | b56a4ce3f7bee6d24a8658b08d6277bea99e425e (diff) | |
parent | da5b0dcb3c01197b3499e0b569babcb0f5a09bbe (diff) | |
download | fdk-aac-dcf27337e1865276b5cf73dc42019b48b5687372.tar.gz fdk-aac-dcf27337e1865276b5cf73dc42019b48b5687372.tar.bz2 fdk-aac-dcf27337e1865276b5cf73dc42019b48b5687372.zip |
Snap for 5942013 from da5b0dcb3c01197b3499e0b569babcb0f5a09bbe to rvc-release
Change-Id: I84e4e06054e0d2c04fe64b23f963e056b8e72947
Diffstat (limited to 'libSBRdec')
-rw-r--r-- | libSBRdec/src/env_calc.cpp | 17 | ||||
-rw-r--r-- | libSBRdec/src/hbe.cpp | 4 |
2 files changed, 11 insertions, 10 deletions
diff --git a/libSBRdec/src/env_calc.cpp b/libSBRdec/src/env_calc.cpp index 1242833..c34ce96 100644 --- a/libSBRdec/src/env_calc.cpp +++ b/libSBRdec/src/env_calc.cpp @@ -1477,7 +1477,7 @@ void calculateSbrEnvelope( for (k = 0; k < noSubbands; k++) { int sc = scale_change - pNrgs->nrgGain_e[k] + (sc_change - 1); - pNrgs->nrgGain[k] >>= sc; + pNrgs->nrgGain[k] >>= fixMin(sc, DFRACT_BITS - 1); pNrgs->nrgGain_e[k] += sc; } @@ -1485,7 +1485,7 @@ void calculateSbrEnvelope( for (k = 0; k < noSubbands; k++) { int sc = scale_change - h_sbr_cal_env->filtBuffer_e[k] + (sc_change - 1); - h_sbr_cal_env->filtBuffer[k] >>= sc; + h_sbr_cal_env->filtBuffer[k] >>= fixMin(sc, DFRACT_BITS - 1); } } @@ -1576,12 +1576,13 @@ void calculateSbrEnvelope( FDK_ASSERT(!iTES_enable); /* not supported */ if (flags & SBRDEC_ELD_GRID) { /* FDKmemset(analysBufferReal[j], 0, 64 * sizeof(FIXP_DBL)); */ - adjustTimeSlot_EldGrid(&analysBufferReal[j][lowSubband], pNrgs, - &h_sbr_cal_env->harmIndex, lowSubband, - noSubbands, - fMin(scale_change, DFRACT_BITS - 1), - noNoiseFlag, &h_sbr_cal_env->phaseIndex, - EXP2SCALE(adj_e) - sbrScaleFactor->lb_scale); + adjustTimeSlot_EldGrid( + &analysBufferReal[j][lowSubband], pNrgs, + &h_sbr_cal_env->harmIndex, lowSubband, noSubbands, + fMin(scale_change, DFRACT_BITS - 1), noNoiseFlag, + &h_sbr_cal_env->phaseIndex, + fMax(EXP2SCALE(adj_e) - sbrScaleFactor->lb_scale, + -(DFRACT_BITS - 1))); } else { adjustTimeSlotLC(&analysBufferReal[j][lowSubband], pNrgs, &h_sbr_cal_env->harmIndex, lowSubband, noSubbands, diff --git a/libSBRdec/src/hbe.cpp b/libSBRdec/src/hbe.cpp index 1141e9c..2284c42 100644 --- a/libSBRdec/src/hbe.cpp +++ b/libSBRdec/src/hbe.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 @@ -1339,7 +1339,7 @@ static void addHighBandPart(FIXP_DBL g_r_m, FIXP_DBL g_i_m, INT g_e, g_r_m = fMultDiv2(tmp_r, factor_m) << shift; g_i_m = fMultDiv2(tmp_i, factor_m) << shift; g_e = scale_factor_hbe - (g_e + factor_e + gammaCenter_e + add); - fMax((INT)0, g_e); + g_e = fMax((INT)0, g_e); *qmfHBEBufReal_F += g_r_m >> g_e; *qmfHBEBufImag_F += g_i_m >> g_e; } |