From 8cbfea6c3aa81df3b8df6e8a0764dae0860be894 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Fri, 25 Apr 2025 12:28:57 +0530 Subject: [PATCH] Fix for LTV crash observed for test case: [ltv_basop_encoder-MASA 2TC at 192 kbps, 48kHz in, 48kHz out, EXT out] --- lib_enc/speech_music_classif_fx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_enc/speech_music_classif_fx.c b/lib_enc/speech_music_classif_fx.c index cf6ba543b..65000a7b3 100644 --- a/lib_enc/speech_music_classif_fx.c +++ b/lib_enc/speech_music_classif_fx.c @@ -2006,8 +2006,8 @@ Word16 ivas_smc_gmm_fx( { Word32 tmp_max; tmp_max = L_max( PS_norm_fx[i], hSpMusClas->past_PS_fx[i - LOWEST_FBIN] ); - - temp32 = BASOP_Util_Divide3232_Scale_newton( tmp_max, L_add( dPS_fx[i], avoid_divide_by_zero ), &temp_exp ); // 31-temp_exp + /* Saturation doesn't have a significant impact here, as a value of 1e-5 in Q31 format is added to prevent division by zero */ + temp32 = BASOP_Util_Divide3232_Scale_newton( tmp_max, L_add_sat( dPS_fx[i], avoid_divide_by_zero ), &temp_exp ); // 31-temp_exp ps_sta_fx = BASOP_Util_Add_Mant32Exp( temp32, temp_exp, ps_sta_fx, ps_sta_exp, &ps_sta_exp ); } temp32_log = L_add( BASOP_Util_Log2( L_add_sat( ps_sta_fx, L_shr( 21475, ps_sta_exp ) ) ), L_shl( ps_sta_exp, Q25 ) ); -- GitLab