From 2544b74a62ee6b9f5c56f933790a04f2da22d8ae Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Wed, 5 Feb 2025 19:46:23 +0530 Subject: [PATCH] Added missing instrumentation for MR !789 and bug fix in swb_tbe --- lib_com/swb_tbe_com.c | 11 ++++++----- lib_com/swb_tbe_com_fx.c | 7 +++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lib_com/swb_tbe_com.c b/lib_com/swb_tbe_com.c index bc5538aeb..105c4db15 100644 --- a/lib_com/swb_tbe_com.c +++ b/lib_com/swb_tbe_com.c @@ -72,8 +72,9 @@ void GenSHBSynth_fx_32( #ifdef FIX_881_HILBERT_FILTER Word16 shift = 0; Word32 maxm32, input_synspeech_temp[L_FRAME16k]; + move16(); - /* find the maximum value and derive the shift to improve precision of the Hilbert filter */ + /* find the maximum value and derive the shift to improve precision of the Hilber filter */ maxm32 = L_deposit_l( 0 ); FOR( i = 0; i < L_FRAME16k; i++ ) { @@ -98,7 +99,7 @@ void GenSHBSynth_fx_32( Scale_sig32( state_lsyn_filt_shb_local, 2 * ALLPASSSECTIONS_STEEP, shift ); Scale_sig32( Hilbert_Mem, HILBERT_MEM_SIZE, shift ); } - else + ELSE { Copy32( input_synspeech, input_synspeech_temp, L_FRAME16k ); } @@ -132,9 +133,9 @@ void GenSHBSynth_fx_32( #ifdef FIX_881_HILBERT_FILTER IF( maxm32 != 0 ) { - Scale_sig32( shb_syn_speech_32k, L_FRAME32k, -shift ); - Scale_sig32( state_lsyn_filt_shb_local, 2 * ALLPASSSECTIONS_STEEP, -shift ); - Scale_sig32( Hilbert_Mem, HILBERT_MEM_SIZE, -shift ); + Scale_sig32( shb_syn_speech_32k, L_FRAME32k, negate( shift ) ); + Scale_sig32( state_lsyn_filt_shb_local, 2 * ALLPASSSECTIONS_STEEP, negate( shift ) ); + Scale_sig32( Hilbert_Mem, HILBERT_MEM_SIZE, negate( shift ) ); } #endif diff --git a/lib_com/swb_tbe_com_fx.c b/lib_com/swb_tbe_com_fx.c index 27ce60448..92271c1f1 100644 --- a/lib_com/swb_tbe_com_fx.c +++ b/lib_com/swb_tbe_com_fx.c @@ -3480,6 +3480,9 @@ void GenShapedSHBExcitation_ivas_enc_fx( { // g = 1.0f; g = MAX16B; /* Q15 */ + move16(); + g_e = 0; + move16(); } // else if ( g < shl( delta, ( 15 - g_e ) - 14 ) ) ELSE IF( BASOP_Util_Cmp_Mant32Exp( g, add( 16, g_e ), delta, 17 ) < 0 ) @@ -3487,8 +3490,12 @@ void GenShapedSHBExcitation_ivas_enc_fx( /* prevent low gains to be quantized to 0 as this is reserved for plosives */ // g = delta; g = shl( delta, 1 ); /* Q15 */ + g_e = 0; + move16(); } + g = shl_sat( g, g_e ); /* Q15 */ + *vf_ind = usquant_fx( g, &mix_factor, 0, delta, cbsize ); move16(); } -- GitLab