diff options
| author | Jean-Michel Trivi <jmtrivi@google.com> | 2018-12-26 17:59:40 -0800 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2018-12-26 17:59:40 -0800 |
| commit | eaad782db3d81611164cc195587c53a6b51b0922 (patch) | |
| tree | 3362d8feed35d84e40977a7889c22065cfa481df /libAACdec/src/usacdec_fac.cpp | |
| parent | 8879fb1fd6bc6f7840b92a1bc78b33d0a3f3f9ef (diff) | |
| parent | 4053380094904317c5c3ef57256abac28fb8f62e (diff) | |
| download | fdk-aac-eaad782db3d81611164cc195587c53a6b51b0922.tar.gz fdk-aac-eaad782db3d81611164cc195587c53a6b51b0922.tar.bz2 fdk-aac-eaad782db3d81611164cc195587c53a6b51b0922.zip | |
Merge "Prevent overflow in usac filters"
am: 4053380094
Change-Id: If0b450840199cde16e10e9a7911c7a8d331b7caa
Diffstat (limited to 'libAACdec/src/usacdec_fac.cpp')
| -rw-r--r-- | libAACdec/src/usacdec_fac.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libAACdec/src/usacdec_fac.cpp b/libAACdec/src/usacdec_fac.cpp index 25d3119..c10a3fe 100644 --- a/libAACdec/src/usacdec_fac.cpp +++ b/libAACdec/src/usacdec_fac.cpp @@ -191,13 +191,11 @@ static void Syn_filt_zero(const FIXP_LPC a[], const INT a_exp, INT length, L_tmp = (FIXP_DBL)0; for (j = 0; j < fMin(i, M_LP_FILTER_ORDER); j++) { - L_tmp -= fMultDiv2(a[j], x[i - (j + 1)]); + L_tmp -= fMultDiv2(a[j], x[i - (j + 1)]) >> (LP_FILTER_SCALE - 1); } - L_tmp = scaleValue(L_tmp, a_exp + 1); - - x[i] = scaleValueSaturate((x[i] >> 1) + (L_tmp >> 1), - 1); /* Avoid overflow issues and saturate. */ + L_tmp = scaleValue(L_tmp, a_exp + LP_FILTER_SCALE); + x[i] = fAddSaturate(x[i], L_tmp); } } |
