diff --git a/lib_com/options.h b/lib_com/options.h index d2f32a1ce007d4746ef7d73e0ced4c49b5092d07..5840a67ddce7fb37e15a147583477c9c799cae8b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -115,4 +115,5 @@ #define FIX_ISSUE_1154 /* Ittiam: Fix for Issue 1154: Encoder crash for ParamMC 7.1 at 96kbps in ivas_param_mc_param_est_enc_fx() */ #define FIX_ISSUE_1157 /* Ittiam: Fix for Issue 1157: Encoder crash for Stereo at 48/64kbps DTX on/off in kernel_switch_trafo_fx() */ #define FIX_ISSUE_1152 /* Ittiam: Fix for issue 1152: Assertion error observed in evs_enc_fx (with option stereo_dmx_evs) from find_tilt_fx function*/ +#define FIX_ISSUE_1156 /* Ittiam: Fix for Issue 1156: Encoder crash for Stereo at 32kbps in SWB_BWE_encoding_ivas_fx() */ #endif diff --git a/lib_enc/swb_bwe_enc_fx.c b/lib_enc/swb_bwe_enc_fx.c index ef16b333c8ba897e299e4bfa8a3b6f88d9f4ec51..355246ec8960b09b083d0a655077e1d90bfefdc8 100644 --- a/lib_enc/swb_bwe_enc_fx.c +++ b/lib_enc/swb_bwe_enc_fx.c @@ -3309,7 +3309,7 @@ static Word16 SWB_BWE_encoding_ivas_fx( #ifdef BASOP_NOGLOB L_SWB_tenv = L_add_sat( L_SWB_tenv, L_mult0( insig_hp_fx[i + tmp], insig_hp_fx[i + tmp] ) ); /*2*Q_shb */ #else - L_SWB_tenv = L_add( L_SWB_tenv, L_mult0( insig_hp_fx[i + tmp], insig_hp_fx[i + tmp] ) ); /*2*Q_shb */ + L_SWB_tenv = L_add( L_SWB_tenv, L_mult0( insig_hp_fx[i + tmp], insig_hp_fx[i + tmp] ) ); /*2*Q_shb */ #endif } @@ -3336,7 +3336,7 @@ static Word16 SWB_BWE_encoding_ivas_fx( #ifdef BASOP_NOGLOB SWB_tenv_fx[n_band] = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 12 ) ) ); /*Q3 */ #else - SWB_tenv_fx[n_band] = round_fx( L_shl( L_tmp, sub( exp, 12 ) ) ); /*Q3 */ + SWB_tenv_fx[n_band] = round_fx( L_shl( L_tmp, sub( exp, 12 ) ) ); /*Q3 */ #endif move16(); } @@ -3349,7 +3349,15 @@ static Word16 SWB_BWE_encoding_ivas_fx( expn = sub( sub( 30, expn ), sub( shl( Q_insig_lp, 1 ), 7 ) ); expd = norm_l( WB_tenv_syn_fx ); +#ifdef FIX_ISSUE_1156 +#ifdef BASOP_NOGLOB + den = round_fx_o( L_shl( WB_tenv_syn_fx, expd ), &Overflow ); +#else den = round_fx( L_shl( WB_tenv_syn_fx, expd ) ); +#endif +#else + den = round_fx( L_shl( WB_tenv_syn_fx, expd ) ); +#endif expd = sub( sub( 30, expd ), sub( shl( st_fx->Q_syn2, 1 ), 7 ) ); scale = shr( sub( den, num ), 15 );