diff --git a/lib_com/swb_tbe_com.c b/lib_com/swb_tbe_com.c index bc5538aebbfff469a11ccf5a281a8115c9d87395..105c4db1521a14414ccd68f214f4c2f619475b69 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 27ce6044829478fc10327cb275305e4745a7e19e..92271c1f1f56d2dd27e163c2190496e0988c4efa 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(); }