diff --git a/lib_com/low_rate_band_att_fx.c b/lib_com/low_rate_band_att_fx.c index d70da04dd0371357f667cb1d6f95bbd544819f7f..be06b8b0184b1d3cb7730c21276e3827b4915465 100644 --- a/lib_com/low_rate_band_att_fx.c +++ b/lib_com/low_rate_band_att_fx.c @@ -74,8 +74,17 @@ void ivas_fine_gain_pred_fx( exp = norm_l( xx ); L_tmp = L_shl( xx, exp ); /*2*(15-shift)+exp */ exp = sub( 31, add( exp, sub( 30, shl( shift, 1 ) ) ) ); - L_tmp = Isqrt_lc( L_tmp, &exp ); /*31 - exp */ + L_tmp = Isqrt_lc( L_tmp, &exp ); /*31 - exp */ +#ifndef FIX_ISSUE_987 Mpy_32_16_ss( L_tmp, ivas_fine_gain_pred_sqrt_bw[bw_idx], &L_tmp, &lsb ); /*31-exp+11-15=27-exp */ +#else + Word16 norm = norm_s( bw ); + Word16 tmp1, tmp_exp = sub( 15, norm ); + tmp1 = Sqrt16( shl( bw, norm ), &tmp_exp ); + tmp1 = shr( tmp1, sub( sub( 15, tmp_exp ), Q11 ) ); + Mpy_32_16_ss( L_tmp, tmp1, &L_tmp, &lsb ); /*31-exp+11-15=27-exp */ +#endif + #ifdef BASOP_NOGLOB gp = round_fx_o( L_shl_o( L_tmp, add( 1, exp ), &Overflow ), &Overflow ); /*27-exp+1+exp-16=12 */ #else diff --git a/lib_com/options.h b/lib_com/options.h index cacefdab4fdb59427afcd30a35fccb3cd3bb7165..d78638fb7b3103b572096dbcf9c32862592da32f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -83,6 +83,7 @@ #define NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS /* DLB: adjust prerendering and mixing gain in OSBA encoder. This is fix to float codes*/ #define NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO /* Eri: issue 1233: Address possible division by zero in hf_spectrum_sparseness() */ #define FIX_ISSUE_1062_AND_1068_TON_ENE_EST_FX +#define FIX_ISSUE_987 #define FIX_1054_IF_ELSE_CMPLX /* VA: Fix 1054 incorrect counting of complexity when ELSE-IF sequence is encoutered in two functions */ #define FIX_1052_COPY_CMPLX_DISCREPANCY /* VA: modify IF-ELSE statements used in Copy*() functions to avoid dependency on x[] and y[] in RAM */ #define FIX_1049_SHR_RO_COMPLEXITY /* VA: fix for issue 1049: incorrect counting of complexity in the shr_ro() function */