diff --git a/lib_com/tns_base.c b/lib_com/tns_base.c index 5009389940a452825ce6868366b38c87093a9d39..200bf1a788edbcce6d57a0a6db162cedd0a33654 100644 --- a/lib_com/tns_base.c +++ b/lib_com/tns_base.c @@ -600,7 +600,7 @@ Word16 ITF_Detect_ivas_fx( assert(n < (Word16)(sizeof(tmpbuf)/sizeof(Word16))); FOR (i = 0; i < n; i++) { - tmpbuf[i] = round_fx(L_shl(pSpectrum[iStartLine+i-IGF_START_MN], shift)); + tmpbuf[i] = round_fx_o(L_shl(pSpectrum[iStartLine+i-IGF_START_MN], shift), &Overflow); } FOR (lag = 0; lag <= maxOrder; lag++) diff --git a/lib_dec/dec_tcx.c b/lib_dec/dec_tcx.c index 46ed2dd3324dec0223470590d4db0d05e68f08b2..f011ec80ca30d7b6f0fdcd5a2f59a2337e0441bc 100644 --- a/lib_dec/dec_tcx.c +++ b/lib_dec/dec_tcx.c @@ -360,7 +360,7 @@ void IMDCT_flt( Word32 x_fx[L_MDCT_OVLP_MAX + L_FRAME_PLUS + L_MDCT_OVLP_MAX]; Word16 win_fx[810] = { 0 }; Word16 q_x = Q16, q_win, x_e_hdrm; - x_e_hdrm = sub(q_x, 13); + x_e_hdrm = sub(q_x, 15); q_win = q_x + x_e_hdrm - 16; for ( int k = 0; k < L_ola + L_win; k++ ) { @@ -2125,12 +2125,17 @@ void decoder_tcx_imdct_fx( Word16 s = getScaleFactor32(x_fx, s_max(endLine, shr(L, 1))); s = sub(s, 2); - FOR(j = 0; j < s_max(endLine, shr(L, 1)); j++) + IF(s <= 0) { - x_fx[j] = L_shl(x_fx[j], s); - move32(); + FOR(j = 0; j < s_max(endLine, shr(L, 1)); j++) + { + x_fx[j] = L_shl(x_fx[j], s); + move32(); + } + x_e = sub(x_e, s); + } ELSE { + s = 0; } - x_e = sub(x_e, s); ITF_Apply_fx( x_fx, startLine, endLine, A_itf_fx, q_a_itf, curr_order );