diff --git a/lib_com/hq2_bit_alloc_fx.c b/lib_com/hq2_bit_alloc_fx.c index 1f5a146c0072b9bc011d0eda9e82592052471c05..c43b11ae58935660c6b83c4ccf490609a6f7b543 100644 --- a/lib_com/hq2_bit_alloc_fx.c +++ b/lib_com/hq2_bit_alloc_fx.c @@ -312,6 +312,12 @@ void hq2_bit_alloc_har_fx( Word16 exp_shift; +#ifdef BASOP_NOGLOB + Flag Overflow; + Overflow = 0; + move32(); +#endif + L_THR1 = L_shl( L_deposit_l( THR1 ), SWB_BWE_LR_QRk ); L_THR2 = L_shl( L_deposit_l( THR2 ), SWB_BWE_LR_QRk ); L_THR3 = L_shl( L_deposit_l( THR3 ), SWB_BWE_LR_QRk ); @@ -566,7 +572,13 @@ void hq2_bit_alloc_har_fx( L_temp = Mult_32_16( L_Ravg_sub[GRP_SB - 1], sub( GRP_SB, 1 ) ); /* Qbe+0+1 */ L_temp = Mult_32_16( L_temp, Inv_norm_sum_fx ); /* Qbe+1+QIpb+1 */ +#ifdef BASOP_NOGLOB + lf_hf_ge_r_fx = round_fx_o( L_shl_o( L_temp, sub( 15 + 16, sub( add( SWB_BWE_LR_Qbe, QIns ), 30 ) ), &Overflow ), &Overflow ); + Overflow = 0; /* reset BASOP Overflow */ + move32(); +#else lf_hf_ge_r_fx = round_fx( L_shl( L_temp, sub( 15 + 16, sub( add( SWB_BWE_LR_Qbe, QIns ), 30 ) ) ) ); +#endif exp_normn = norm_s( norm_sum_fx ); exp_normn = sub( exp_normn, 1 ); diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 5dcff25ea2276aa0359197b249de2ba299e7d791..e476e3a4942688e2ea4ebb7b178e890491482592 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5521,13 +5521,13 @@ ivas_error ivas_sba_linear_renderer( ); #ifdef IVAS_FLOAT_FIXED void ivas_sba_mix_matrix_determiner_fx( - SPAR_DEC_HANDLE hSpar, /* i/o: SPAR decoder handle */ - Word32 *output_fx[], /* i/o: transport/output audio channels */ - const Word16 bfi, /* i : BFI flag */ - const Word16 nchan_remapped, /* i : num channels after remapping of TCs */ - const Word16 output_frame, /* i : output frame length */ - const Word16 num_md_sub_frames, /* i : number of subframes in mixing matrix */ - const Word16 Q_p_Output /* i : number of subframes in mixing matrix */ + SPAR_DEC_HANDLE hSpar, /* i/o: SPAR decoder handle */ + Word32 *output_fx[], /* i/o: transport/output audio channels */ + const Word16 bfi, /* i : BFI flag */ + const Word16 nchan_remapped, /* i : num channels after remapping of TCs */ + const Word16 output_frame, /* i : output frame length */ + const Word16 num_md_sub_frames, /* i : number of subframes in mixing matrix*/ + const Word16 Q_output /* i : Q of transport/output audio channels */ ); #endif // IVAS_FLOAT_FIXED diff --git a/lib_dec/ivas_sba_rendering_internal.c b/lib_dec/ivas_sba_rendering_internal.c index e925bd3e6e582f27be15571d709ba299a16b06b9..19113a09ae1141b8d11189c980271e7e7c825090 100644 --- a/lib_dec/ivas_sba_rendering_internal.c +++ b/lib_dec/ivas_sba_rendering_internal.c @@ -861,7 +861,7 @@ void ivas_sba_mix_matrix_determiner_fx( const Word16 nchan_remapped, /* i : num channels after remapping of TCs */ const Word16 output_frame, /* i : output frame length */ const Word16 num_md_sub_frames, /* i : number of subframes in mixing matrix*/ - const Word16 Q_output /* i : number of subframes in mixing matrix*/ + const Word16 Q_output /* i : Q of transport/output audio channels */ ) { Word16 i, ch; @@ -899,6 +899,7 @@ void ivas_sba_mix_matrix_determiner_fx( nchan_out = nchan_transport; move16(); ivas_agc_dec_process_fx( hSpar->hAgcDec, ( output_fx ), ( output_fx ), nchan_transport, output_frame ); + Q_p_output = sub( Q_p_output, 3 ); #ifdef DUMPS_ENABLED dbgwrite_txt( &output[0][0], output_frame, "fix_ivas_agc_dec_process_output.txt", NULL ); #endif // DUMPS_ENABLED @@ -908,7 +909,7 @@ void ivas_sba_mix_matrix_determiner_fx( { FOR( i = 0; i < output_frame; i++ ) { - output_fx[ch][i] = Mult_32_32( L_shl_sat( output_fx[ch][i], sub( 18, Q_p_output ) ), L_shl_sat( PCM16_TO_FLT_FAC_FX, 16 ) ); /*Q-0*/ + output_fx[ch][i] = Mult_32_32( L_shl_sat( output_fx[ch][i], sub( 15, Q_p_output ) ), L_shl_sat( PCM16_TO_FLT_FAC_FX, 16 ) ); /* Q0 */ } } diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index f0e08363a2e93ea6e4b677edc95beae9c3d3a242..44b398a8911843eb6452ea4f7da79c84efd7988f 100644 --- a/lib_enc/init_enc.c +++ b/lib_enc/init_enc.c @@ -490,6 +490,9 @@ ivas_error init_encoder( st->lp_speech = 45.0f; /* Initialize the long-term active speech level in dB */ st->lp_noise = 0.0f; +#ifdef IVAS_FLOAT_FIXED + st->lp_noise_fx = 0; +#endif st->flag_noisy_speech_snr = 0; st->fd_cng_reset_flag = 0; st->cng_type = -1; diff --git a/lib_enc/ivas_core_pre_proc_front.c b/lib_enc/ivas_core_pre_proc_front.c index acf6568660f7be912cc2f6a635f50133e9a1dabd..616d5cc15975f4fb1a97e528003f8dcab4ab6636 100644 --- a/lib_enc/ivas_core_pre_proc_front.c +++ b/lib_enc/ivas_core_pre_proc_front.c @@ -1730,6 +1730,7 @@ ivas_error pre_proc_front_ivas_fx( st->lt_mean_NB_fx = (Word16) st->lt_mean_NB * ( 1 << 11 ); st->lt_mean_WB_fx = (Word16) st->lt_mean_WB * ( 1 << 11 ); st->lt_mean_SWB_fx = (Word16) st->lt_mean_SWB * ( 1 << 11 ); + st->lp_noise_fx = (Word16) st->lp_noise * ( 1 << 8 ); // have taken Q8 as above one functions uses Q8 #endif bw_detect_fx( st, st->input_fx, NULL, enerBuffer_fx, sf_energySum, ivas_format, 0 ); diff --git a/lib_enc/ivas_mc_paramupmix_enc.c b/lib_enc/ivas_mc_paramupmix_enc.c index ea0fd5bfb11fff03956e30da42968de6dd5b3fb2..9c3d0bfb1cf024c471415a89d26e87038e4798a2 100644 --- a/lib_enc/ivas_mc_paramupmix_enc.c +++ b/lib_enc/ivas_mc_paramupmix_enc.c @@ -859,7 +859,11 @@ static void ivas_mc_paramupmix_param_est_enc( } set_s( q_ppIn_FR, Q31, MC_PARAMUPMIX_COMBINATIONS * MC_PARAMUPMIX_NCH ); +#ifdef MSAN_FIX + FOR( i = 0; i < MC_PARAMUPMIX_NCH; i++ ) +#else FOR( i = 0; i < MC_PARAMUPMIX_COMBINATIONS * MC_PARAMUPMIX_NCH; i++ ) +#endif { q_ppIn_FR[i] = L_get_q_buf1( pp_in_fr_real[i], input_frame ); q_ppIn_FR[i] = min( q_ppIn_FR[i], L_get_q_buf1( pp_in_fr_imag[i], input_frame ) ); diff --git a/lib_enc/speech_music_classif.c b/lib_enc/speech_music_classif.c index 8f536dbd55c174c6c65b347a21a4ec21762621ca..e41e50052810541fe574f13e9e9b744a244bcc42 100644 --- a/lib_enc/speech_music_classif.c +++ b/lib_enc/speech_music_classif.c @@ -126,6 +126,7 @@ void speech_music_clas_init( hSpMusClas->dlp_var_LT_fx = 0; #ifdef MSAN_FIX hSpMusClas->dlp_mean_LT_fx = 0; + set16_fx( hSpMusClas->past_dlp_fx, 0, HANG_LEN - 1 ); #endif // MSAN_FIX #endif hSpMusClas->dlp_mean_LT = 0.0f;