mirror of https://github.com/mstorsjo/fdk-aac.git
Merge "Prevent energy overflow in acelp calc_period_factor()" am: eb9319afb2
am: 196f1ce484
am: b29fd0db45
Change-Id: Ic3acadc0a8a48485b96075882eebfd867cfc709e
This commit is contained in:
commit
b6c47c51b2
|
@ -309,7 +309,7 @@ static FIXP_DBL calc_period_factor(FIXP_DBL exc[], FIXP_SGL gain_pit,
|
||||||
ener_exc = (FIXP_DBL)0;
|
ener_exc = (FIXP_DBL)0;
|
||||||
for (int i = 0; i < L_SUBFR; i++) {
|
for (int i = 0; i < L_SUBFR; i++) {
|
||||||
ener_exc += fPow2Div2(exc[i]) >> s;
|
ener_exc += fPow2Div2(exc[i]) >> s;
|
||||||
if (ener_exc > FL2FXCONST_DBL(0.5f)) {
|
if (ener_exc >= FL2FXCONST_DBL(0.5f)) {
|
||||||
ener_exc >>= 1;
|
ener_exc >>= 1;
|
||||||
s++;
|
s++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue