Merge "Integer overflow fix in _compressorIO_sigmoid()" am: 7c908b13b9

am: 195d913e65

Change-Id: I7482706e761f2faeeb0fa42ec7f58427409d3519
This commit is contained in:
Fraunhofer IIS FDK 2019-01-03 17:04:12 -08:00 committed by android-build-merger
commit 1ce3f9e135
1 changed files with 3 additions and 2 deletions

View File

@ -300,8 +300,9 @@ static DRC_ERROR _compressorIO_sigmoid(const CUSTOM_DRC_CHAR_SIGMOID* pCChar,
FIXP_SGL exp = pCChar->exp; FIXP_SGL exp = pCChar->exp;
DRC_ERROR err = DE_OK; DRC_ERROR err = DE_OK;
tmp = fMultDiv2(DRC_INPUT_LOUDNESS_TARGET - inLevelDb, pCChar->ioRatio); tmp = fMultDiv2((DRC_INPUT_LOUDNESS_TARGET >> 1) - (inLevelDb >> 1),
tmp = SATURATE_LEFT_SHIFT(tmp, 2 + 1, DFRACT_BITS); pCChar->ioRatio);
tmp = SATURATE_LEFT_SHIFT(tmp, 2 + 1 + 1, DFRACT_BITS);
if (exp < (FIXP_SGL)MAXVAL_SGL) { if (exp < (FIXP_SGL)MAXVAL_SGL) {
/* x = tmp / gainDbLimit; */ /* x = tmp / gainDbLimit; */
/* *outGainDb = tmp / pow(1.0f + pow(x, exp), 1.0f/exp); */ /* *outGainDb = tmp / pow(1.0f + pow(x, exp), 1.0f/exp); */