diff options
author | Martin Storsjo <martin@martin.st> | 2019-01-21 15:54:25 +0200 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2019-01-21 15:54:25 +0200 |
commit | 02103fd6308a40c58013d8ec8610ad8a71075aca (patch) | |
tree | 77e30d296d5cec1f24b5c0e03b49f197d5bf080e /libAACdec/src/usacdec_acelp.cpp | |
parent | 2326faaf8f2cdf2c3a9108ccdaf1d7551aec543e (diff) | |
parent | ed56e77acb1ca4524bf49d9cdec7d11a51f5134d (diff) | |
download | fdk-aac-02103fd6308a40c58013d8ec8610ad8a71075aca.tar.gz fdk-aac-02103fd6308a40c58013d8ec8610ad8a71075aca.tar.bz2 fdk-aac-02103fd6308a40c58013d8ec8610ad8a71075aca.zip |
Merge remote-tracking branch 'aosp/master'
Diffstat (limited to 'libAACdec/src/usacdec_acelp.cpp')
-rw-r--r-- | libAACdec/src/usacdec_acelp.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libAACdec/src/usacdec_acelp.cpp b/libAACdec/src/usacdec_acelp.cpp index ed775d2..a606459 100644 --- a/libAACdec/src/usacdec_acelp.cpp +++ b/libAACdec/src/usacdec_acelp.cpp @@ -309,7 +309,7 @@ static FIXP_DBL calc_period_factor(FIXP_DBL exc[], FIXP_SGL gain_pit, ener_exc = (FIXP_DBL)0; for (int i = 0; i < L_SUBFR; i++) { ener_exc += fPow2Div2(exc[i]) >> s; - if (ener_exc > FL2FXCONST_DBL(0.5f)) { + if (ener_exc >= FL2FXCONST_DBL(0.5f)) { ener_exc >>= 1; s++; } @@ -579,11 +579,11 @@ void Syn_filt(const FIXP_LPC a[], /* (i) : a[m] prediction coefficients Q12 */ L_tmp = (FIXP_DBL)0; for (j = 0; j < M_LP_FILTER_ORDER; j++) { - L_tmp -= fMultDiv2(a[j], y[i - (j + 1)]); + L_tmp -= fMultDiv2(a[j], y[i - (j + 1)]) >> (LP_FILTER_SCALE - 1); } - L_tmp = scaleValue(L_tmp, a_exp + 1); - y[i] = L_tmp + x[i]; + L_tmp = scaleValue(L_tmp, a_exp + LP_FILTER_SCALE); + y[i] = fAddSaturate(L_tmp, x[i]); } return; @@ -631,10 +631,10 @@ void E_UTIL_residu(const FIXP_LPC *a, const INT a_exp, FIXP_DBL *x, FIXP_DBL *y, s = (FIXP_DBL)0; for (j = 0; j < M_LP_FILTER_ORDER; j++) { - s += fMultDiv2(a[j], x[i - j - 1]); + s += fMultDiv2(a[j], x[i - j - 1]) >> (LP_FILTER_SCALE - 1); } - s = scaleValue(s, a_exp + 1); + s = scaleValue(s, a_exp + LP_FILTER_SCALE); y[i] = fAddSaturate(s, x[i]); } |