aboutsummaryrefslogtreecommitdiffstats
path: root/libAACdec/src
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-01-18 04:29:58 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-01-18 04:29:58 +0000
commit7d1449b89a620a476a47ba3edf140dc9c66115b1 (patch)
treeb3e70f7d8522d66bf0720b4111d9debcbfdd6e7c /libAACdec/src
parent2dc3e5c1f26f578d4c09590cf3f1e01ec8c68105 (diff)
parentcee316ab3ebde92047b5e76d15c00768b92cb890 (diff)
downloadfdk-aac-7d1449b89a620a476a47ba3edf140dc9c66115b1.tar.gz
fdk-aac-7d1449b89a620a476a47ba3edf140dc9c66115b1.tar.bz2
fdk-aac-7d1449b89a620a476a47ba3edf140dc9c66115b1.zip
Snap for 6145313 from cee316ab3ebde92047b5e76d15c00768b92cb890 to rvc-release
Change-Id: I642e8bbffa03f9c9e718eb115125c1e0fa852556
Diffstat (limited to 'libAACdec/src')
-rw-r--r--libAACdec/src/conceal.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/libAACdec/src/conceal.cpp b/libAACdec/src/conceal.cpp
index ae98874..379e63a 100644
--- a/libAACdec/src/conceal.cpp
+++ b/libAACdec/src/conceal.cpp
@@ -1228,7 +1228,6 @@ static void CConcealment_InterpolateBuffer(FIXP_DBL *spectrum,
int sfb, line = 0;
int fac_shift;
int fac_mod;
- FIXP_DBL accu;
for (sfb = 0; sfb < sfbCnt; sfb++) {
fac_shift =
@@ -1236,15 +1235,11 @@ static void CConcealment_InterpolateBuffer(FIXP_DBL *spectrum,
fac_mod = fac_shift & 3;
fac_shift = (fac_shift >> 2) + 1;
fac_shift += *pSpecScalePrv - fixMax(*pSpecScalePrv, *pSpecScaleAct);
+ fac_shift = fMax(fMin(fac_shift, DFRACT_BITS - 1), -(DFRACT_BITS - 1));
for (; line < pSfbOffset[sfb + 1]; line++) {
- accu = fMult(*(spectrum + line), facMod4Table[fac_mod]);
- if (fac_shift < 0) {
- accu >>= -fac_shift;
- } else {
- accu <<= fac_shift;
- }
- *(spectrum + line) = accu;
+ FIXP_DBL accu = fMult(*(spectrum + line), facMod4Table[fac_mod]);
+ *(spectrum + line) = scaleValue(accu, fac_shift);
}
}
*pSpecScaleOut = fixMax(*pSpecScalePrv, *pSpecScaleAct);