diff options
author | Fraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de> | 2019-01-03 17:04:12 -0800 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-01-03 17:04:12 -0800 |
commit | 1ce3f9e135acc3383251751cea3e174a355e1f94 (patch) | |
tree | 060a58219f65bed01bca33475066859655092e82 /libDRCdec/src | |
parent | 9cc8070883b24126085012c0a742d3746450bab8 (diff) | |
parent | 195d913e654401e0b8a20d012b906c3e1f29db59 (diff) | |
download | fdk-aac-1ce3f9e135acc3383251751cea3e174a355e1f94.tar.gz fdk-aac-1ce3f9e135acc3383251751cea3e174a355e1f94.tar.bz2 fdk-aac-1ce3f9e135acc3383251751cea3e174a355e1f94.zip |
Merge "Integer overflow fix in _compressorIO_sigmoid()" am: 7c908b13b9
am: 195d913e65
Change-Id: I7482706e761f2faeeb0fa42ec7f58427409d3519
Diffstat (limited to 'libDRCdec/src')
-rw-r--r-- | libDRCdec/src/drcGainDec_preprocess.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libDRCdec/src/drcGainDec_preprocess.cpp b/libDRCdec/src/drcGainDec_preprocess.cpp index 7919589..c543c53 100644 --- a/libDRCdec/src/drcGainDec_preprocess.cpp +++ b/libDRCdec/src/drcGainDec_preprocess.cpp @@ -300,8 +300,9 @@ static DRC_ERROR _compressorIO_sigmoid(const CUSTOM_DRC_CHAR_SIGMOID* pCChar, FIXP_SGL exp = pCChar->exp; DRC_ERROR err = DE_OK; - tmp = fMultDiv2(DRC_INPUT_LOUDNESS_TARGET - inLevelDb, pCChar->ioRatio); - tmp = SATURATE_LEFT_SHIFT(tmp, 2 + 1, DFRACT_BITS); + tmp = fMultDiv2((DRC_INPUT_LOUDNESS_TARGET >> 1) - (inLevelDb >> 1), + pCChar->ioRatio); + tmp = SATURATE_LEFT_SHIFT(tmp, 2 + 1 + 1, DFRACT_BITS); if (exp < (FIXP_SGL)MAXVAL_SGL) { /* x = tmp / gainDbLimit; */ /* *outGainDb = tmp / pow(1.0f + pow(x, exp), 1.0f/exp); */ |