From 1585217f3c445ff0d5aba0089f994c30b0c4a7ed Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 22 Jan 2025 20:57:28 +0100 Subject: [PATCH 1/2] [cleanup] accept BASOP_NOGLOB --- lib_com/arith_coder_fx.c | 16 - lib_com/basop32.c | 300 --------------- lib_com/basop32.h | 80 ---- lib_com/basop_lsf_tools.c | 4 - lib_com/basop_util.c | 57 --- lib_com/bitalloc_fx.c | 12 - lib_com/cldfb_evs.c | 50 --- lib_com/cng_exc_fx.c | 124 ------ lib_com/codec_tcx_common.c | 20 - lib_com/deemph.c | 24 -- lib_com/edct_fx.c | 29 -- lib_com/enh1632.c | 14 - lib_com/enh1632.h | 2 - lib_com/enh32.c | 12 - lib_com/enh40.c | 90 ----- lib_com/enh40.h | 4 - lib_com/enh64.c | 84 ----- lib_com/enh64.h | 2 - lib_com/enhancer_fx.c | 114 ------ lib_com/enr_1_az.c | 33 -- lib_com/env_adj.c | 8 - lib_com/env_stab.c | 23 -- lib_com/est_tilt_fx.c | 18 - lib_com/fd_cng_com_fx.c | 53 --- lib_com/fft_fx_evs.c | 540 --------------------------- lib_com/fft_rel.c | 34 -- lib_com/fft_rel_fx.c | 102 ----- lib_com/frame_ener.c | 26 -- lib_com/frame_ener_fx.c | 26 -- lib_com/get_gain.c | 9 - lib_com/get_gain_fx.c | 9 - lib_com/gs_bitallocation_fx.c | 4 - lib_com/gs_bitallocation_ivas_fx.c | 4 - lib_com/gs_gains_fx.c | 26 -- lib_com/gs_inact_switching_fx.c | 10 - lib_com/gs_noisefill_fx.c | 48 --- lib_com/gs_preech.c | 16 - lib_com/gs_preech_fx.c | 16 - lib_com/hp50.c | 70 ---- lib_com/hp50_fx.c | 70 ---- lib_com/hq2_bit_alloc_fx.c | 6 - lib_com/hq2_core_com_fx.c | 16 - lib_com/hq2_noise_inject_fx.c | 45 --- lib_com/hq_tools_fx.c | 94 ----- lib_com/ifft_rel.c | 86 ----- lib_com/igf_base_fx.c | 12 - lib_com/interpol.c | 12 - lib_com/ivas_prot_fx.h | 4 - lib_com/ivas_stereo_mdct_bands_com.c | 4 - lib_com/lerp.c | 16 - lib_com/log2.c | 4 - lib_com/low_rate_band_att_fx.c | 16 - lib_com/lpc_tools_fx.c | 92 ----- lib_com/lsf_tools_fx.c | 143 ------- lib_com/lsp_conv_poly_fx.c | 69 ---- lib_com/math_op.c | 43 --- lib_com/modif_fs_fx.c | 227 ----------- lib_com/oper_32b.c | 21 -- lib_com/options.h | 1 - lib_com/phase_dispersion_fx.c | 13 - lib_com/ppp_fx.c | 8 - lib_com/pred_lt4_fx.c | 18 - lib_com/preemph_fx.c | 28 -- lib_com/prot_fx.h | 2 - lib_com/pvq_com_fx.c | 12 - lib_com/re8_util_fx.c | 4 - lib_com/residu_fx.c | 38 -- lib_com/stab_est_fx.c | 12 - lib_com/stat_noise_uv_mod_fx.c | 68 ---- lib_com/swb_bwe_com_fx.c | 246 ------------ lib_com/swb_bwe_com_lr_fx.c | 49 --- lib_com/swb_tbe_com_fx.c | 537 -------------------------- lib_com/syn_filt_fx.c | 60 --- lib_com/tcq_position_arith_fx.c | 5 - lib_com/tcx_ltp_fx.c | 61 --- lib_com/tcx_mdct_fx.c | 29 -- lib_com/tcx_utils_fx.c | 51 --- lib_com/tec_com.c | 4 - lib_com/tns_base.c | 8 - lib_com/tools.c | 4 - lib_com/tools_fx.c | 297 --------------- lib_com/trans_inv_fx.c | 86 ----- lib_com/weight_a_fx.c | 4 - lib_com/wi_fx.c | 356 ------------------ lib_com/window_fx.c | 10 - lib_com/window_ola_fx.c | 46 --- lib_dec/FEC_HQ_core_fx.c | 55 --- lib_dec/FEC_HQ_phase_ecu_fx.c | 118 ------ lib_dec/FEC_clas_estim_fx.c | 37 -- lib_dec/FEC_fx.c | 52 --- lib_dec/FEC_pitch_estim_fx.c | 4 - lib_dec/FEC_scale_syn_fx.c | 108 ------ lib_dec/LD_music_post_filter_fx.c | 53 --- lib_dec/TonalComponentDetection_fx.c | 8 - lib_dec/acelp_core_switch_dec_fx.c | 8 - lib_dec/amr_wb_dec_fx.c | 4 - lib_dec/arith_coder_dec_fx.c | 4 - lib_dec/bass_psfilter_fx.c | 93 ----- lib_dec/cng_dec_fx.c | 64 ---- lib_dec/core_switching_dec_fx.c | 44 --- lib_dec/d_gain2p_fx.c | 20 - lib_dec/dec_ace_fx.c | 16 - lib_dec/dec_gen_voic_fx.c | 69 ---- lib_dec/dec_higher_acelp_fx.c | 9 - lib_dec/dec_pit_exc_fx.c | 17 - lib_dec/dec_post_fx.c | 87 ----- lib_dec/dec_tcx_fx.c | 262 ------------- lib_dec/dec_tran_fx.c | 9 - lib_dec/dec_uv_fx.c | 4 - lib_dec/er_dec_acelp_fx.c | 54 --- lib_dec/er_dec_tcx_fx.c | 116 ------ lib_dec/er_scale_syn_fx.c | 4 - lib_dec/er_sync_exc_fx.c | 20 - lib_dec/er_util_fx.c | 8 - lib_dec/evs_dec_fx.c | 44 --- lib_dec/fd_cng_dec_fx.c | 113 ------ lib_dec/gain_dec_fx.c | 90 ----- lib_dec/gs_dec_amr_wb_fx.c | 20 - lib_dec/hf_synth_fx.c | 127 ------- lib_dec/hq_core_dec_fx.c | 17 - lib_dec/hq_hr_dec_fx.c | 4 - lib_dec/hq_lr_dec_fx.c | 63 ---- lib_dec/igf_dec_fx.c | 56 --- lib_dec/ivas_core_dec.c | 6 - lib_dec/nelp_dec_fx.c | 12 - lib_dec/pitch_extr_fx.c | 6 - lib_dec/post_dec_fx.c | 45 --- lib_dec/ppp_dec_fx.c | 13 - lib_dec/pvq_core_dec_fx.c | 4 - lib_dec/pvq_decode_fx.c | 5 - lib_dec/rst_dec_fx.c | 4 - lib_dec/swb_bwe_dec_fx.c | 28 -- lib_dec/swb_bwe_dec_hr_fx.c | 36 -- lib_dec/swb_tbe_dec.c | 82 ---- lib_dec/swb_tbe_dec_fx.c | 194 ---------- lib_dec/syn_outp_fx.c | 8 - lib_dec/tonalMDCTconcealment_fx.c | 36 -- lib_dec/transition_dec_fx.c | 4 - lib_dec/updt_dec_fx.c | 8 - lib_dec/voiced_dec_fx.c | 15 - lib_dec/waveadjust_fec_dec_fx.c | 35 -- lib_enc/SNR_calc_fx.c | 4 - lib_enc/acelp_core_switch_enc_fx.c | 34 -- lib_enc/acelp_enc_util_fx.c | 23 -- lib_enc/amr_wb_enc_fx.c | 4 - lib_enc/analy_sp_fx.c | 20 - lib_enc/ari_hm_enc_fx.c | 8 - lib_enc/arith_coder_enc_fx.c | 31 -- lib_enc/avq_cod_fx.c | 8 - lib_enc/bass_psfilter_enc_fx.c | 47 --- lib_enc/bw_detect_fx.c | 12 - lib_enc/cng_enc.c | 16 - lib_enc/cng_enc_fx.c | 92 ----- lib_enc/cod2t32_fx.c | 60 --- lib_enc/cod_ace_fx.c | 22 -- lib_enc/cod_tcx_fx.c | 132 ------- lib_enc/cod_uv_fx.c | 12 - lib_enc/cor_shif_fx.c | 4 - lib_enc/core_enc_init.c | 8 - lib_enc/core_enc_init_fx.c | 8 - lib_enc/core_enc_ol_fx.c | 37 -- lib_enc/corr_xh_fx.c | 27 -- lib_enc/detect_transient_fx.c | 60 --- lib_enc/dtx_fx.c | 32 -- lib_enc/enc_acelp_fx.c | 137 ------- lib_enc/enc_acelpx_fx.c | 48 --- lib_enc/enc_amr_wb_fx.c | 24 -- lib_enc/enc_gen_voic_fx.c | 74 ---- lib_enc/enc_gen_voic_rf_fx.c | 32 -- lib_enc/enc_higher_acelp_fx.c | 85 ----- lib_enc/enc_nelp_fx.c | 8 - lib_enc/enc_pit_exc_fx.c | 84 ----- lib_enc/enc_tran_fx.c | 62 --- lib_enc/enc_uv_fx.c | 29 -- lib_enc/energy_fx.c | 10 - lib_enc/ext_sig_ana_fx.c | 56 --- lib_enc/fd_cng_enc_fx.c | 20 - lib_enc/find_tar_fx.c | 64 ---- lib_enc/find_tilt.c | 27 -- lib_enc/find_tilt_fx.c | 43 --- lib_enc/find_uv.c | 60 --- lib_enc/find_uv_fx.c | 60 --- lib_enc/gain_enc_fx.c | 121 ------ lib_enc/gaus_enc_fx.c | 78 ---- lib_enc/gp_clip_fx.c | 12 - lib_enc/gs_enc_fx.c | 8 - lib_enc/guided_plc_enc_fx.c | 12 - lib_enc/hf_cod_amrwb_fx.c | 8 - lib_enc/hq_classifier_enc_fx.c | 18 - lib_enc/hq_lr_enc_fx.c | 155 -------- lib_enc/hvq_enc_fx.c | 32 -- lib_enc/igf_enc_fx.c | 73 ---- lib_enc/lp_exc_e_fx.c | 30 -- lib_enc/lsf_enc_fx.c | 52 --- lib_enc/lsf_msvq_ma_enc_fx.c | 33 -- lib_enc/ltd_stable_fx.c | 16 - lib_enc/mdct_classifier_fx.c | 16 - lib_enc/multi_harm_fx.c | 28 -- lib_enc/nelp_enc_fx.c | 177 --------- lib_enc/nois_est_fx.c | 108 ------ lib_enc/normalizecoefs_fx.c | 6 - lib_enc/pit_enc_fx.c | 46 --- lib_enc/pitch_ol2.c | 28 -- lib_enc/pitch_ol2_fx.c | 50 --- lib_enc/pitch_ol_fx.c | 40 -- lib_enc/ppp_enc_fx.c | 42 --- lib_enc/pre_proc_fx.c | 4 - lib_enc/prot_fx_enc.h | 6 - lib_enc/pvq_core_enc_fx.c | 16 - lib_enc/pvq_encode_fx.c | 23 -- lib_enc/q_gain2p_fx.c | 36 -- lib_enc/qlpc_stoch_fx.c | 8 - lib_enc/scale_enc_fx.c | 35 -- lib_enc/set_impulse_fx.c | 41 -- lib_enc/sig_clas_fx.c | 4 - lib_enc/spec_flatness_fx.c | 4 - lib_enc/speech_music_classif_fx.c | 120 ------ lib_enc/stat_noise_uv_enc_fx.c | 24 -- lib_enc/swb_bwe_enc_fx.c | 204 ---------- lib_enc/swb_bwe_enc_hr_fx.c | 13 - lib_enc/swb_bwe_enc_lr_fx.c | 18 - lib_enc/swb_pre_proc_fx.c | 10 - lib_enc/swb_tbe_enc_fx.c | 279 -------------- lib_enc/tcq_core_enc_fx.c | 8 - lib_enc/tcx_ltp_enc_fx.c | 64 ---- lib_enc/tcx_utils_enc_fx.c | 70 ---- lib_enc/tfa_enc_fx.c | 4 - lib_enc/tns_base_enc_fx.c | 32 -- lib_enc/transient_detection_fx.c | 16 - lib_enc/transition_enc_fx.c | 33 -- lib_enc/updt_tar_fx.c | 11 - lib_enc/vad_basop_fx.c | 4 - lib_enc/vad_fx.c | 110 ------ lib_enc/vad_param_updt_fx.c | 5 - lib_enc/vbr_average_rate_fx.c | 4 - lib_enc/vlpc_1st_cod_fx.c | 16 - lib_enc/vlpc_2st_cod_fx.c | 4 - lib_enc/voiced_enc_fx.c | 141 ------- lib_enc/waveadjust_fec_cod_fx.c | 4 - 239 files changed, 11756 deletions(-) diff --git a/lib_com/arith_coder_fx.c b/lib_com/arith_coder_fx.c index 12a4fa670..a776a38b9 100644 --- a/lib_com/arith_coder_fx.c +++ b/lib_com/arith_coder_fx.c @@ -224,11 +224,7 @@ void tcx_arith_scale_envelope( tmp = norm_l( env[k] ); tmp2 = sub( 15, tmp ); -#ifdef BASOP_NOGLOB tmp = Inv16( round_fx_o( L_shl_o( env[k], tmp, &Overflow ), &Overflow ), &tmp2 ); /* exp(tmp2) */ -#else - tmp = Inv16( round_fx( L_shl( env[k], tmp ) ), &tmp2 ); -#endif ienv[k] = L_shl( L_deposit_h( tmp ), sub( tmp2, 15 ) ); /* Q16 */ move32(); mean = L_add( mean, ienv[k] ); /* Q16 */ @@ -276,11 +272,7 @@ void tcx_arith_scale_envelope( tmp2 = BASOP_Util_Add_MantExp( negate( b ), b_e, tmp, tmp2, &scale ); /* exp(scale) */ scale = BASOP_Util_Divide1616_Scale( scale, round_fx( a ), &tmp ); -#ifdef BASOP_NOGLOB scale = shl_o( scale, sub( sub( add( tmp, tmp2 ), a_e ), 1 ), &Overflow ); /* Q15 */ -#else - scale = shl( scale, sub( sub( add( tmp, tmp2 ), a_e ), 1 ) ); /* Q15 */ -#endif /* iscale = 1.0f / scale; */ iscale_e = 0; @@ -329,11 +321,7 @@ void tcx_arith_scale_envelope( L_tmp = L_add( L_tmp, L_shl( Mpy_32_16_1( env[k], mult_r( 1147 /*0.035f Q15*/, iscale ) ), iscale_e ) ); /* Q16 */ tmp = norm_l( L_tmp ); -#ifdef BASOP_NOGLOB statesi = mult_r( statesi, round_fx_o( L_shl_o( L_tmp, tmp, &Overflow ), &Overflow ) ); -#else - statesi = mult_r( statesi, round_fx( L_shl( L_tmp, tmp ) ) ); -#endif bits = add( bits, sub( 15, tmp ) ); tmp = norm_s( statesi ); @@ -420,11 +408,7 @@ void tcx_arith_scale_envelope( *s_env_e = sub( add( 15, iscale_e ), tmp ); move16(); BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB a = L_shl_o( 1265000, sub( 15, *s_env_e ), &Overflow ); -#else /* BASOP_NOGLOB */ - a = L_shl( 1265000, sub( 15, *s_env_e ) ); -#endif BASOP_SATURATE_WARNING_ON_EVS; FOR( k = 0; k < L_frame; k++ ) diff --git a/lib_com/basop32.c b/lib_com/basop32.c index 7f947a64c..200757026 100644 --- a/lib_com/basop32.c +++ b/lib_com/basop32.c @@ -162,9 +162,7 @@ HISTORY: #include "options.h" #include "stl.h" -#ifdef BASOP_NOGLOB #include -#endif /* BASOP_NOGLOB */ #define WMC_TOOL_SKIP @@ -178,9 +176,7 @@ HISTORY: | Local Functions | |___________________________________________________________________________| */ -#ifdef BASOP_NOGLOB static Word16 saturate_o( Word32 L_var1, Flag *Overflow ); -#endif /* BASOP_NOGLOB */ static Word16 saturate( Word32 L_var1 ); @@ -189,7 +185,6 @@ static Word16 saturate( Word32 L_var1 ); | Constants and Globals | |___________________________________________________________________________| */ -#ifdef BASOP_NOGLOB #ifdef BASOP_PRINT_ON_WARNING #include @@ -416,10 +411,6 @@ Flag get_carry( const Flag *carry ) #undef B_HELPER_SET_GLOBAL #undef B_HELPER_GET_GLOBAL -#else /* BASOP_NOGLOB */ -Flag Overflow = 0; -Flag Carry = 0; -#endif /* BASOP_NOGLOB */ /*___________________________________________________________________________ | | @@ -456,30 +447,18 @@ Flag Carry = 0; | range : 0xffff 8000 <= var_out <= 0x0000 7fff. | |___________________________________________________________________________| */ -#ifndef BASOP_NOGLOB -static Word16 saturate( Word32 L_var1 ) -#else /* BASOP_NOGLOB */ static Word16 saturate_o( Word32 L_var1, Flag *Overflow ) -#endif /* BASOP_NOGLOB */ { Word16 var_out; if ( L_var1 > 0X00007fffL ) { -#ifndef BASOP_NOGLOB - Overflow = 1; -#else /* BASOP_NOGLOB */ *Overflow = 1; -#endif /* BASOP_NOGLOB */ var_out = MAX_16; } else if ( L_var1 < (Word32) 0xffff8000L ) { -#ifndef BASOP_NOGLOB - Overflow = 1; -#else /* BASOP_NOGLOB */ *Overflow = 1; -#endif /* BASOP_NOGLOB */ var_out = MIN_16; } else @@ -495,7 +474,6 @@ static Word16 saturate_o( Word32 L_var1, Flag *Overflow ) return ( var_out ); } -#ifdef BASOP_NOGLOB static Word16 saturate( Word32 L_var1 ) { Word16 var_out; @@ -522,7 +500,6 @@ static Word16 saturate( Word32 L_var1 ) return ( var_out ); } -#endif /* BASOP_NOGLOB */ /*___________________________________________________________________________ | | @@ -557,7 +534,6 @@ static Word16 saturate( Word32 L_var1 ) | range : 0xffff 8000 <= var_out <= 0x0000 7fff. | |___________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word16 add_o( Word16 var1, Word16 var2, Flag *Overflow ) { Word16 var_out; @@ -572,7 +548,6 @@ Word16 add_o( Word16 var1, Word16 var2, Flag *Overflow ) return ( var_out ); } -#endif /* BASOP_NOGLOB */ Word16 add( Word16 var1, Word16 var2 ) { Word16 var_out; @@ -586,13 +561,11 @@ Word16 add( Word16 var1, Word16 var2 ) #endif return ( var_out ); } -#ifdef BASOP_NOGLOB Word16 add_sat( Word16 var1, Word16 var2 ) { Flag Overflow; return add_o( var1, var2, &Overflow ); } -#endif /*___________________________________________________________________________ | | | Function Name : sub | @@ -626,7 +599,6 @@ Word16 add_sat( Word16 var1, Word16 var2 ) | range : 0xffff 8000 <= var_out <= 0x0000 7fff. | |___________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word16 sub_o( Word16 var1, Word16 var2, Flag *Overflow ) { Word16 var_out; @@ -641,7 +613,6 @@ Word16 sub_o( Word16 var1, Word16 var2, Flag *Overflow ) return ( var_out ); } -#endif /* BASOP_NOGLOB */ Word16 sub( Word16 var1, Word16 var2 ) { Word16 var_out; @@ -655,13 +626,11 @@ Word16 sub( Word16 var1, Word16 var2 ) #endif return ( var_out ); } -#ifdef BASOP_NOGLOB Word16 sub_sat( Word16 var1, Word16 var2 ) { Flag Overflow; return sub_o( var1, var2, &Overflow ); } -#endif /*___________________________________________________________________________ | | | Function Name : abs_s | @@ -753,11 +722,7 @@ Word16 abs_s( Word16 var1 ) | range : 0xffff 8000 <= var_out <= 0x0000 7fff. | |___________________________________________________________________________| */ -#ifndef BASOP_NOGLOB -Word16 shl( Word16 var1, Word16 var2 ) -#else /* BASOP_NOGLOB */ Word16 shl_o( Word16 var1, Word16 var2, Flag *Overflow ) -#endif /* BASOP_NOGLOB */ { Word16 var_out; Word32 result; @@ -779,11 +744,7 @@ Word16 shl_o( Word16 var1, Word16 var2, Flag *Overflow ) if ( ( var2 > 15 && var1 != 0 ) || ( result != (Word32) ( (Word16) result ) ) ) { -#ifndef BASOP_NOGLOB - Overflow = 1; -#else /* BASOP_NOGLOB */ *Overflow = 1; -#endif /* BASOP_NOGLOB */ var_out = ( var1 > 0 ) ? MAX_16 : MIN_16; } else @@ -806,7 +767,6 @@ Word16 shl_o( Word16 var1, Word16 var2, Flag *Overflow ) return ( var_out ); } -#ifdef BASOP_NOGLOB Word16 shl( Word16 var1, Word16 var2 ) { Word16 var_out; @@ -856,7 +816,6 @@ Word16 shl_sat( Word16 var1, Word16 var2 ) Flag Overflow; return shl_o( var1, var2, &Overflow ); } -#endif /* BASOP_NOGLOB */ /*___________________________________________________________________________ | | @@ -892,11 +851,7 @@ Word16 shl_sat( Word16 var1, Word16 var2 ) | range : 0xffff 8000 <= var_out <= 0x0000 7fff. | |___________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word16 shr_o( Word16 var1, Word16 var2, Flag *Overflow ) -#else /* BASOP_NOGLOB */ -Word16 shr( Word16 var1, Word16 var2 ) -#endif /* BASOP_NOGLOB */ { Word16 var_out; @@ -905,11 +860,7 @@ Word16 shr( Word16 var1, Word16 var2 ) if ( var2 < -16 ) var2 = -16; var2 = -var2; -#ifdef BASOP_NOGLOB var_out = shl_o( var1, var2, Overflow ); -#else /* BASOP_NOGLOB */ - var_out = shl( var1, var2 ); -#endif /* BASOP_NOGLOB */ #ifdef WMOPS multiCounter[currCounter].shl--; @@ -943,7 +894,6 @@ Word16 shr( Word16 var1, Word16 var2 ) return ( var_out ); } -#ifdef BASOP_NOGLOB Word16 shr( Word16 var1, Word16 var2 ) { return shr_o( var1, var2, NULL ); @@ -953,7 +903,6 @@ Word16 shr_sat( Word16 var1, Word16 var2 ) Flag Overflow; return shr_o( var1, var2, &Overflow ); } -#endif /* BASOP_NOGLOB */ /*___________________________________________________________________________ @@ -990,11 +939,7 @@ Word16 shr_sat( Word16 var1, Word16 var2 ) | range : 0xffff 8000 <= var_out <= 0x0000 7fff. | |___________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word16 mult_o( Word16 var1, Word16 var2, Flag *Overflow ) -#else /* BASOP_NOGLOB */ -Word16 mult( Word16 var1, Word16 var2 ) -#endif /* BASOP_NOGLOB */ { Word16 var_out; Word32 L_product; @@ -1006,11 +951,7 @@ Word16 mult( Word16 var1, Word16 var2 ) if ( L_product & (Word32) 0x00010000L ) L_product = L_product | (Word32) 0xffff0000L; -#ifdef BASOP_NOGLOB var_out = saturate_o( L_product, Overflow ); -#else /* BASOP_NOGLOB */ - var_out = saturate( L_product ); -#endif /* BASOP_NOGLOB */ #ifdef WMOPS multiCounter[currCounter].mult++; @@ -1019,7 +960,6 @@ Word16 mult( Word16 var1, Word16 var2 ) BASOP_CHECK(); return ( var_out ); } -#ifdef BASOP_NOGLOB Word16 mult( Word16 var1, Word16 var2 ) { Word16 var_out; @@ -1046,7 +986,6 @@ Word16 mult_sat( Word16 var1, Word16 var2 ) return mult_o( var1, var2, &Overflow ); } -#endif /*___________________________________________________________________________ | | @@ -1082,11 +1021,7 @@ Word16 mult_sat( Word16 var1, Word16 var2 ) | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | |___________________________________________________________________________| */ -#ifndef BASOP_NOGLOB -Word32 L_mult( Word16 var1, Word16 var2 ) -#else /* BASOP_NOGLOB */ Word32 L_mult_o( Word16 var1, Word16 var2, Flag *Overflow ) -#endif /* BASOP_NOGLOB */ { Word32 L_var_out; @@ -1098,11 +1033,7 @@ Word32 L_mult_o( Word16 var1, Word16 var2, Flag *Overflow ) } else { -#ifndef BASOP_NOGLOB - Overflow = 1; -#else /* BASOP_NOGLOB */ *Overflow = 1; -#endif /* BASOP_NOGLOB */ L_var_out = MAX_32; } @@ -1115,7 +1046,6 @@ Word32 L_mult_o( Word16 var1, Word16 var2, Flag *Overflow ) return ( L_var_out ); } -#ifdef BASOP_NOGLOB Word32 L_mult( Word16 var1, Word16 var2 ) { Word32 L_var_out; @@ -1146,7 +1076,6 @@ Word32 L_mult_sat( Word16 var1, Word16 var2 ) Flag Overflow; return L_mult_o( var1, var2, &Overflow ); } -#endif /* BASOP_NOGLOB */ /*___________________________________________________________________________ | | @@ -1312,7 +1241,6 @@ Word16 extract_l( Word32 L_var1 ) | range : 0xffff 8000 <= var_out <= 0x0000 7fff. | |___________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word16 round_fx_o( Word32 L_var1, Flag *Overflow ) { Word16 var_out; @@ -1334,7 +1262,6 @@ Word16 round_fx_o( Word32 L_var1, Flag *Overflow ) return ( var_out ); } -#endif /* BASOP_NOGLOB */ Word16 round_fx( Word32 L_var1 ) { Word16 var_out; @@ -1354,13 +1281,11 @@ Word16 round_fx( Word32 L_var1 ) return ( var_out ); } -#ifdef BASOP_NOGLOB Word16 round_fx_sat( Word32 L_var1 ) { Flag Overflow; return round_fx_o( L_var1, &Overflow ); } -#endif /*___________________________________________________________________________ | | | Function Name : L_mac | @@ -1397,7 +1322,6 @@ Word16 round_fx_sat( Word32 L_var1 ) | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | |___________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word32 L_mac_o( Word32 L_var3, Word16 var1, Word16 var2, Flag *Overflow ) { Word32 L_var_out; @@ -1415,7 +1339,6 @@ Word32 L_mac_o( Word32 L_var3, Word16 var1, Word16 var2, Flag *Overflow ) return ( L_var_out ); } -#endif /* BASOP_NOGLOB */ Word32 L_mac( Word32 L_var3, Word16 var1, Word16 var2 ) { Word32 L_var_out; @@ -1433,13 +1356,11 @@ Word32 L_mac( Word32 L_var3, Word16 var1, Word16 var2 ) return ( L_var_out ); } -#ifdef BASOP_NOGLOB Word32 L_mac_sat( Word32 L_var3, Word16 var1, Word16 var2 ) { Flag Overflow; return L_mac_o( L_var3, var1, var2, &Overflow ); } -#endif /*___________________________________________________________________________ | | | Function Name : L_msu | @@ -1476,7 +1397,6 @@ Word32 L_mac_sat( Word32 L_var3, Word16 var1, Word16 var2 ) | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | |___________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word32 L_msu_o( Word32 L_var3, Word16 var1, Word16 var2, Flag *Overflow ) { Word32 L_var_out; @@ -1494,7 +1414,6 @@ Word32 L_msu_o( Word32 L_var3, Word16 var1, Word16 var2, Flag *Overflow ) return ( L_var_out ); } -#endif /* BASOP_NOGLOB */ Word32 L_msu( Word32 L_var3, Word16 var1, Word16 var2 ) { Word32 L_var_out; @@ -1512,13 +1431,11 @@ Word32 L_msu( Word32 L_var3, Word16 var1, Word16 var2 ) return ( L_var_out ); } -#ifdef BASOP_NOGLOB Word32 L_msu_sat( Word32 L_var3, Word16 var1, Word16 var2 ) { Flag Overflow; return L_msu_o( L_var3, var1, var2, &Overflow ); } -#endif /*___________________________________________________________________________ | | | Function Name : L_macNs | @@ -1557,15 +1474,10 @@ Word32 L_msu_sat( Word32 L_var3, Word16 var1, Word16 var2 ) | | | Caution : | | | -#ifndef BASOP_NOGLOB - | In some cases the Carry flag has to be cleared or set before using | -#else | In some cases the BASOP_Carry flag has to be cleared or set before using | -#endif | operators which take into account its value. | |___________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word32 DEPR_L_macNs( Word32 L_var3, Word16 var1, Word16 var2, Flag *Carry ) { Word32 L_var_out; @@ -1582,25 +1494,14 @@ Word32 DEPR_L_macNs( Word32 L_var3, Word16 var1, Word16 var2, Flag *Carry ) /* BASOP_CHECK(); Do not check for overflow here, function produces the carry bit instead */ return ( L_var_out ); } -#endif -#ifdef BASOP_NOGLOB Word32 L_macNs_co( Word32 L_var3, Word16 var1, Word16 var2, Flag *Carry, Flag *Overflow ) -#else /* BASOP_NOGLOB */ -Word32 L_macNs( Word32 L_var3, Word16 var1, Word16 var2 ) -#endif /* BASOP_NOGLOB */ { Word32 L_var_out; -#ifdef BASOP_NOGLOB L_var_out = L_mult_o( var1, var2, Overflow ); L_var_out = L_add_co( L_var3, L_var_out, Carry, Overflow ); -#else /* BASOP_NOGLOB */ - L_var_out = L_mult( var1, var2 ); - L_var_out = L_add_c( L_var3, L_var_out ); -#endif /* BASOP_NOGLOB */ return ( L_var_out ); } -#ifdef BASOP_NOGLOB Word32 L_macNs( Word32 L_var3, Word16 var1, Word16 var2 ) { return L_macNs_co( L_var3, var1, var2, NULL, NULL ); @@ -1610,7 +1511,6 @@ Word32 L_macNs_sat( Word32 L_var3, Word16 var1, Word16 var2 ) Flag Carry, Overflow; return L_macNs_co( L_var3, var1, var2, &Carry, &Overflow ); } -#endif /*___________________________________________________________________________ | | | Function Name : L_msuNs | @@ -1649,28 +1549,16 @@ Word32 L_macNs_sat( Word32 L_var3, Word16 var1, Word16 var2 ) | | | Caution : | | | -#ifndef BASOP_NOGLOB - | In some cases the Carry flag has to be cleared or set before using | -#else | In some cases the BASOP_Carry flag has to be cleared or set before using | -#endif | operators which take into account its value. | |___________________________________________________________________________| */ -#ifndef BASOP_NOGLOB -Word32 L_msuNs( Word32 L_var3, Word16 var1, Word16 var2 ) -#else /* BASOP_NOGLOB */ Word32 DEPR_L_msuNs( Word32 L_var3, Word16 var1, Word16 var2, Flag *Carry ) -#endif /* BASOP_NOGLOB */ { Word32 L_var_out; L_var_out = L_mult( var1, var2 ); -#ifndef BASOP_NOGLOB - L_var_out = L_sub_c( L_var3, L_var_out ); -#else /* BASOP_NOGLOB */ L_var_out = DEPR_L_sub_c( L_var3, L_var_out, Carry ); -#endif /* BASOP_NOGLOB */ #ifdef WMOPS multiCounter[currCounter].L_mult--; @@ -1683,7 +1571,6 @@ Word32 DEPR_L_msuNs( Word32 L_var3, Word16 var1, Word16 var2, Flag *Carry ) return ( L_var_out ); } -#ifdef BASOP_NOGLOB Word32 L_msuNs_co( Word32 L_var3, Word16 var1, Word16 var2, Flag *Carry, Flag *Overflow ) { Word32 L_var_out; @@ -1704,7 +1591,6 @@ Word32 L_msuNs_sat( Word32 L_var3, Word16 var1, Word16 var2 ) Flag Carry, Overflow; return L_msuNs_co( L_var3, var1, var2, &Carry, &Overflow ); } -#endif /*___________________________________________________________________________ | | | Function Name : L_add | @@ -1736,11 +1622,7 @@ Word32 L_msuNs_sat( Word32 L_var3, Word16 var1, Word16 var2 ) | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | |___________________________________________________________________________| */ -#ifndef BASOP_NOGLOB -Word32 L_add( Word32 L_var1, Word32 L_var2 ) -#else /* BASOP_NOGLOB */ Word32 L_add_o( Word32 L_var1, Word32 L_var2, Flag *Overflow ) -#endif /* BASOP_NOGLOB */ { Word32 L_var_out; @@ -1751,11 +1633,7 @@ Word32 L_add_o( Word32 L_var1, Word32 L_var2, Flag *Overflow ) if ( ( L_var_out ^ L_var1 ) & MIN_32 ) { L_var_out = ( L_var1 < 0 ) ? MIN_32 : MAX_32; -#ifndef BASOP_NOGLOB - Overflow = 1; -#else /* BASOP_NOGLOB */ *Overflow = 1; -#endif /* BASOP_NOGLOB */ } } @@ -1769,7 +1647,6 @@ Word32 L_add_o( Word32 L_var1, Word32 L_var2, Flag *Overflow ) return ( L_var_out ); } -#ifdef BASOP_NOGLOB Word32 L_add( Word32 L_var1, Word32 L_var2 ) { Word32 L_var_out; @@ -1795,7 +1672,6 @@ Word32 L_add_sat( Word32 L_var1, Word32 L_var2 ) Flag Overflow; return L_add_o( L_var1, L_var2, &Overflow ); } -#endif /* BASOP_NOGLOB */ /*___________________________________________________________________________ | | @@ -1828,11 +1704,7 @@ Word32 L_add_sat( Word32 L_var1, Word32 L_var2 ) | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | |___________________________________________________________________________| */ -#ifndef BASOP_NOGLOB -Word32 L_sub( Word32 L_var1, Word32 L_var2 ) -#else /* BASOP_NOGLOB */ Word32 L_sub_o( Word32 L_var1, Word32 L_var2, Flag *Overflow ) -#endif /* BASOP_NOGLOB */ { Word32 L_var_out; @@ -1843,11 +1715,7 @@ Word32 L_sub_o( Word32 L_var1, Word32 L_var2, Flag *Overflow ) if ( ( L_var_out ^ L_var1 ) & MIN_32 ) { L_var_out = ( L_var1 < 0L ) ? MIN_32 : MAX_32; -#ifndef BASOP_NOGLOB - Overflow = 1; -#else /* BASOP_NOGLOB */ *Overflow = 1; -#endif /* BASOP_NOGLOB */ } } @@ -1860,7 +1728,6 @@ Word32 L_sub_o( Word32 L_var1, Word32 L_var2, Flag *Overflow ) return ( L_var_out ); } -#ifdef BASOP_NOGLOB Word32 L_sub( Word32 L_var1, Word32 L_var2 ) { Word32 L_var_out; @@ -1888,7 +1755,6 @@ Word32 L_sub_sat( Word32 L_var1, Word32 L_var2 ) Flag Overflow; return L_sub_o( L_var1, L_var2, &Overflow ); } -#endif /* BASOP_NOGLOB */ /*___________________________________________________________________________ | | @@ -1897,11 +1763,7 @@ Word32 L_sub_sat( Word32 L_var1, Word32 L_var2 ) | Purpose : | | | | Performs 32 bits addition of the two 32 bits variables (L_var1+L_var2+C)| -#ifndef BASOP_NOGLOB - | with carry. No saturation. Generate carry and Overflow values. The car- | -#else | with carry. No saturation. Generate carry and BASOP_Overflow values. The car- | -#endif | ry and overflow values are binary variables which can be tested and as- | | signed values. | | | @@ -1927,37 +1789,22 @@ Word32 L_sub_sat( Word32 L_var1, Word32 L_var2 ) | | | Caution : | | | -#ifndef BASOP_NOGLOB - | In some cases the Carry flag has to be cleared or set before using | -#else | In some cases the BASOP_Carry flag has to be cleared or set before using | -#endif | operators which take into account its value. | |___________________________________________________________________________| */ -#ifndef BASOP_NOGLOB -Word32 L_add_c( Word32 L_var1, Word32 L_var2 ) -#else /* BASOP_NOGLOB */ Word32 L_add_c( Word32 L_var1, Word32 L_var2, Flag *Carry ) -#endif /* BASOP_NOGLOB */ { Word32 L_var_out; Word32 L_test; Flag carry_int = 0; -#ifndef BASOP_NOGLOB - L_var_out = L_var1 + L_var2 + Carry; -#else /* BASOP_NOGLOB */ L_var_out = L_var1 + L_var2 + *Carry; -#endif /* BASOP_NOGLOB */ L_test = L_var1 + L_var2; if ( ( L_var1 > 0 ) && ( L_var2 > 0 ) && ( L_test < 0 ) ) { -#ifndef BASOP_NOGLOB - Overflow = 1; -#endif /* ! BASOP_NOGLOB */ carry_int = 0; } else @@ -1966,16 +1813,10 @@ Word32 L_add_c( Word32 L_var1, Word32 L_var2, Flag *Carry ) { if ( L_test >= 0 ) { -#ifndef BASOP_NOGLOB - Overflow = 1; -#endif /* ! BASOP_NOGLOB */ carry_int = 1; } else { -#ifndef BASOP_NOGLOB - Overflow = 0; -#endif /* ! BASOP_NOGLOB */ carry_int = 1; } } @@ -1983,63 +1824,36 @@ Word32 L_add_c( Word32 L_var1, Word32 L_var2, Flag *Carry ) { if ( ( ( L_var1 ^ L_var2 ) < 0 ) && ( L_test >= 0 ) ) { -#ifndef BASOP_NOGLOB - Overflow = 0; -#endif /* ! BASOP_NOGLOB */ carry_int = 1; } else { -#ifndef BASOP_NOGLOB - Overflow = 0; -#endif /* ! BASOP_NOGLOB */ carry_int = 0; } } } -#ifndef BASOP_NOGLOB - if ( Carry ) -#else /* BASOP_NOGLOB */ if ( *Carry ) -#endif /* BASOP_NOGLOB */ { if ( L_test == MAX_32 ) { -#ifndef BASOP_NOGLOB - Overflow = 1; - Carry = carry_int; -#else /* BASOP_NOGLOB */ *Carry = carry_int; -#endif /* BASOP_NOGLOB */ } else { if ( L_test == (Word32) 0xFFFFFFFFL ) { -#ifndef BASOP_NOGLOB - Carry = 1; -#else /* BASOP_NOGLOB */ *Carry = 1; -#endif /* BASOP_NOGLOB */ } else { -#ifndef BASOP_NOGLOB - Carry = carry_int; -#else /* BASOP_NOGLOB */ *Carry = carry_int; -#endif /* BASOP_NOGLOB */ } } } else { -#ifndef BASOP_NOGLOB - Carry = carry_int; -#else /* BASOP_NOGLOB */ *Carry = carry_int; -#endif /* BASOP_NOGLOB */ } #ifdef WMOPS @@ -2051,7 +1865,6 @@ Word32 L_add_c( Word32 L_var1, Word32 L_var2, Flag *Carry ) return ( L_var_out ); } -#ifdef BASOP_NOGLOB Word32 L_add_co( Word32 L_var1, Word32 L_var2, Flag *Carry, Flag *Overflow ) { Word32 L_var_out; @@ -2126,7 +1939,6 @@ Word32 L_add_co( Word32 L_var1, Word32 L_var2, Flag *Carry, Flag *Overflow ) #endif return ( L_var_out ); } -#endif /*___________________________________________________________________________ | | @@ -2135,11 +1947,7 @@ Word32 L_add_co( Word32 L_var1, Word32 L_var2, Flag *Carry, Flag *Overflow ) | Purpose : | | | | Performs 32 bits subtraction of the two 32 bits variables with carry | -#ifndef BASOP_NOGLOB - | (borrow) : L_var1-L_var2-C. No saturation. Generate carry and Overflow | -#else | (borrow) : L_var1-L_var2-C. No saturation. Generate carry and BASOP_Overflow | -#endif | values. The carry and overflow values are binary variables which can | | be tested and assigned values. | | | @@ -2165,42 +1973,22 @@ Word32 L_add_co( Word32 L_var1, Word32 L_var2, Flag *Carry, Flag *Overflow ) | | | Caution : | | | -#ifndef BASOP_NOGLOB - | In some cases the Carry flag has to be cleared or set before using | -#else | In some cases the BASOP_Carry flag has to be cleared or set before using | -#endif | operators which take into account its value. | |___________________________________________________________________________| */ -#ifndef BASOP_NOGLOB -Word32 L_sub_c( Word32 L_var1, Word32 L_var2 ) -#else /* BASOP_NOGLOB */ Word32 DEPR_L_sub_c( Word32 L_var1, Word32 L_var2, Flag *Carry ) -#endif /* BASOP_NOGLOB */ { Word32 L_var_out; Word32 L_test; Flag carry_int = 0; -#ifndef BASOP_NOGLOB - if ( Carry ) -#else /* BASOP_NOGLOB */ if ( *Carry ) -#endif /* BASOP_NOGLOB */ { -#ifndef BASOP_NOGLOB - Carry = 0; -#else /* BASOP_NOGLOB */ *Carry = 0; -#endif /* BASOP_NOGLOB */ if ( L_var2 != MIN_32 ) { -#ifndef BASOP_NOGLOB - L_var_out = L_add_c( L_var1, -L_var2 ); -#else /* BASOP_NOGLOB */ L_var_out = L_add_c( L_var1, -L_var2, Carry ); -#endif /* BASOP_NOGLOB */ #ifdef WMOPS multiCounter[currCounter].L_add_c--; #endif @@ -2210,12 +1998,7 @@ Word32 DEPR_L_sub_c( Word32 L_var1, Word32 L_var2, Flag *Carry ) L_var_out = L_var1 - L_var2; if ( L_var1 > 0L ) { -#ifndef BASOP_NOGLOB - Overflow = 1; - Carry = 0; -#else /* BASOP_NOGLOB */ *Carry = 0; -#endif /* BASOP_NOGLOB */ } } } @@ -2226,41 +2009,23 @@ Word32 DEPR_L_sub_c( Word32 L_var1, Word32 L_var2, Flag *Carry ) if ( ( L_test < 0 ) && ( L_var1 > 0 ) && ( L_var2 < 0 ) ) { -#ifndef BASOP_NOGLOB - Overflow = 1; -#endif /* ! BASOP_NOGLOB */ carry_int = 0; } else if ( ( L_test > 0 ) && ( L_var1 < 0 ) && ( L_var2 > 0 ) ) { -#ifndef BASOP_NOGLOB - Overflow = 1; -#endif /* ! BASOP_NOGLOB */ carry_int = 1; } else if ( ( L_test > 0 ) && ( ( L_var1 ^ L_var2 ) > 0 ) ) { -#ifndef BASOP_NOGLOB - Overflow = 0; -#endif /* ! BASOP_NOGLOB */ carry_int = 1; } if ( L_test == MIN_32 ) { -#ifndef BASOP_NOGLOB - Overflow = 1; - Carry = carry_int; -#else /* BASOP_NOGLOB */ *Carry = carry_int; -#endif /* BASOP_NOGLOB */ } else { -#ifndef BASOP_NOGLOB - Carry = carry_int; -#else /* BASOP_NOGLOB */ *Carry = carry_int; -#endif /* BASOP_NOGLOB */ } } @@ -2273,7 +2038,6 @@ Word32 DEPR_L_sub_c( Word32 L_var1, Word32 L_var2, Flag *Carry ) return ( L_var_out ); } -#ifdef BASOP_NOGLOB Word32 L_sub_co( Word32 L_var1, Word32 L_var2, Flag *Carry, Flag *Overflow ) { Word32 L_var_out; @@ -2329,7 +2093,6 @@ Word32 L_sub_c( Word32 L_var1, Word32 L_var2 ) { return L_sub_co( L_var1, L_var2, NULL, NULL ); } -#endif /*___________________________________________________________________________ | | | Function Name : L_negate | @@ -2407,7 +2170,6 @@ Word32 L_negate( Word32 L_var1 ) | range : 0x8000 <= var_out <= 0x7fff. | |___________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word16 mult_ro( Word16 var1, Word16 var2, Flag *Overflow ) { Word16 var_out; @@ -2431,7 +2193,6 @@ Word16 mult_ro( Word16 var1, Word16 var2, Flag *Overflow ) return ( var_out ); } -#endif /* BASOP_NOGLOB */ Word16 mult_r( Word16 var1, Word16 var2 ) { Word16 var_out; @@ -2454,13 +2215,11 @@ Word16 mult_r( Word16 var1, Word16 var2 ) return ( var_out ); } -#ifdef BASOP_NOGLOB Word16 mult_r_sat( Word16 var1, Word16 var2 ) { Flag Overflow; return mult_ro( var1, var2, &Overflow ); } -#endif /*___________________________________________________________________________ | | | Function Name : L_shl | @@ -2494,11 +2253,7 @@ Word16 mult_r_sat( Word16 var1, Word16 var2 ) | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | |___________________________________________________________________________| */ -#ifndef BASOP_NOGLOB -Word32 L_shl( Word32 L_var1, Word16 var2 ) -#else /* BASOP_NOGLOB */ Word32 L_shl_o( Word32 L_var1, Word16 var2, Flag *Overflow ) -#endif /* BASOP_NOGLOB */ { Word32 L_var_out = 0L; @@ -2519,11 +2274,7 @@ Word32 L_shl_o( Word32 L_var1, Word16 var2, Flag *Overflow ) { if ( L_var1 > (Word32) 0X3fffffffL ) { -#ifndef BASOP_NOGLOB - Overflow = 1; -#else /* BASOP_NOGLOB */ *Overflow = 1; -#endif /* BASOP_NOGLOB */ L_var_out = MAX_32; break; } @@ -2531,11 +2282,7 @@ Word32 L_shl_o( Word32 L_var1, Word16 var2, Flag *Overflow ) { if ( L_var1 < (Word32) 0xc0000000L ) { -#ifndef BASOP_NOGLOB - Overflow = 1; -#else /* BASOP_NOGLOB */ *Overflow = 1; -#endif /* BASOP_NOGLOB */ L_var_out = MIN_32; break; } @@ -2555,7 +2302,6 @@ Word32 L_shl_o( Word32 L_var1, Word16 var2, Flag *Overflow ) return ( L_var_out ); } -#ifdef BASOP_NOGLOB Word32 L_shl( Word32 L_var1, Word16 var2 ) { @@ -2610,7 +2356,6 @@ Word32 L_shl_sat( Word32 L_var1, Word16 var2 ) return L_shl_o( L_var1, var2, &Overflow ); } -#endif /* BASOP_NOGLOB */ /*___________________________________________________________________________ | | | Function Name : L_shr | @@ -2644,7 +2389,6 @@ Word32 L_shl_sat( Word32 L_var1, Word16 var2 ) | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | |___________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word32 L_shr_o( Word32 L_var1, Word16 var2, Flag *Overflow ) { Word32 L_var_out; @@ -2688,7 +2432,6 @@ Word32 L_shr_o( Word32 L_var1, Word16 var2, Flag *Overflow ) return ( L_var_out ); } -#endif /* BASOP_NOGLOB */ Word32 L_shr( Word32 L_var1, Word16 var2 ) { Word32 L_var_out; @@ -2730,13 +2473,11 @@ Word32 L_shr( Word32 L_var1, Word16 var2 ) return ( L_var_out ); } -#ifdef BASOP_NOGLOB Word32 L_shr_sat( Word32 L_var1, Word16 var2 ) { Flag Overflow; return L_shr_o( L_var1, var2, &Overflow ); } -#endif /*___________________________________________________________________________ | | | Function Name : shr_r | @@ -2810,7 +2551,6 @@ Word16 shr_r( Word16 var1, Word16 var2 ) return ( var_out ); } -#ifdef BASOP_NOGLOB Word16 shr_ro( Word16 var1, Word16 var2, Flag *Overflow ) { Word16 var_out; @@ -2852,7 +2592,6 @@ Word16 shr_r_sat( Word16 var1, Word16 var2 ) Flag Overflow; return shr_ro( var1, var2, &Overflow ); } -#endif /*___________________________________________________________________________ | | | Function Name : mac_r | @@ -2891,7 +2630,6 @@ Word16 shr_r_sat( Word16 var1, Word16 var2 ) | range : 0x0000 8000 <= L_var_out <= 0x0000 7fff. | |___________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word16 mac_ro( Word32 L_var3, Word16 var1, Word16 var2, Flag *Overflow ) { Word16 var_out; @@ -2913,7 +2651,6 @@ Word16 mac_ro( Word32 L_var3, Word16 var1, Word16 var2, Flag *Overflow ) return ( var_out ); } -#endif /* BASOP_NOGLOB */ Word16 mac_r( Word32 L_var3, Word16 var1, Word16 var2 ) { Word16 var_out; @@ -2934,13 +2671,11 @@ Word16 mac_r( Word32 L_var3, Word16 var1, Word16 var2 ) return ( var_out ); } -#ifdef BASOP_NOGLOB Word16 mac_r_sat( Word32 L_var3, Word16 var1, Word16 var2 ) { Flag Overflow; return mac_ro( L_var3, var1, var2, &Overflow ); } -#endif /*___________________________________________________________________________ | | | Function Name : msu_r | @@ -2979,7 +2714,6 @@ Word16 mac_r_sat( Word32 L_var3, Word16 var1, Word16 var2 ) | range : 0x0000 8000 <= L_var_out <= 0x0000 7fff. | |___________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word16 msu_ro( Word32 L_var3, Word16 var1, Word16 var2, Flag *Overflow ) { Word16 var_out; @@ -2999,7 +2733,6 @@ Word16 msu_ro( Word32 L_var3, Word16 var1, Word16 var2, Flag *Overflow ) return ( var_out ); } -#endif /* BASOP_NOGLOB */ Word16 msu_r( Word32 L_var3, Word16 var1, Word16 var2 ) { Word16 var_out; @@ -3018,13 +2751,11 @@ Word16 msu_r( Word32 L_var3, Word16 var1, Word16 var2 ) return ( var_out ); } -#ifdef BASOP_NOGLOB Word16 msu_r_sat( Word32 L_var3, Word16 var1, Word16 var2 ) { Flag Overflow; return msu_ro( L_var3, var1, var2, &Overflow ); } -#endif /*___________________________________________________________________________ | | | Function Name : L_deposit_h | @@ -3189,7 +2920,6 @@ Word32 L_shr_r( Word32 L_var1, Word16 var2 ) return ( L_var_out ); } -#ifdef BASOP_NOGLOB Word32 L_shr_ro( Word32 L_var1, Word16 var2, Flag *Overflow ) { Word32 L_var_out; @@ -3217,7 +2947,6 @@ Word32 L_shr_r_sat( Word32 L_var1, Word16 var2 ) Flag Overflow = 0; return L_shr_ro( L_var1, var2, &Overflow ); } -#endif /*___________________________________________________________________________ | | | Function Name : L_abs | @@ -3307,11 +3036,7 @@ Word32 L_abs( Word32 L_var1 ) | range : 0x8000 0000 <= var_out <= 0x7fff ffff. | |___________________________________________________________________________| */ -#ifndef BASOP_NOGLOB -Word32 L_sat( Word32 L_var1 ) -#else /* BASOP_NOGLOB */ Word32 DEPR_L_sat_co( Word32 L_var1, Flag Overflow, Flag Carry ) -#endif /* BASOP_NOGLOB */ { Word32 L_var_out; @@ -3328,11 +3053,6 @@ Word32 DEPR_L_sat_co( Word32 L_var1, Flag Overflow, Flag Carry ) { L_var_out = MAX_32; } -#ifndef BASOP_NOGLOB - - Carry = 0; - Overflow = 0; -#endif /* ! BASOP_NOGLOB */ } #ifdef WMOPS @@ -3344,7 +3064,6 @@ Word32 DEPR_L_sat_co( Word32 L_var1, Flag Overflow, Flag Carry ) return ( L_var_out ); } -#ifdef BASOP_NOGLOB Word32 L_sat_co( Word32 L_var1, Flag Carry, Flag Overflow ) { Word32 L_var_out; @@ -3371,7 +3090,6 @@ Word32 L_sat( Word32 L_var1 ) assert( 0 ); /* Overflow and Carry are no longer global, must be passed as parameters */ return L_sat_co( L_var1, 0, 0 ); } -#endif /*___________________________________________________________________________ | | | Function Name : norm_s | @@ -3661,7 +3379,6 @@ Word16 norm_l( Word32 L_var1 ) | | |___________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word32 L_mls_o( Word32 Lv, Word16 v, Flag *Overflow ) { Word32 Temp; @@ -3683,7 +3400,6 @@ Word32 L_mls_o( Word32 Lv, Word16 v, Flag *Overflow ) return Temp; } -#endif /* BASOP_NOGLOB */ Word32 L_mls( Word32 Lv, Word16 v ) { Word32 Temp; @@ -3704,13 +3420,11 @@ Word32 L_mls( Word32 Lv, Word16 v ) return Temp; } -#ifdef BASOP_NOGLOB Word32 L_mls_sat( Word32 Lv, Word16 v ) { Flag Overflow; return L_mls_o( Lv, v, &Overflow ); } -#endif /*__________________________________________________________________________ | | @@ -3848,11 +3562,7 @@ Word16 div_l( Word32 L_num, Word16 den ) | are performed if ORIGINAL_G7231 is defined. | |___________________________________________________________________________| */ -#ifndef BASOP_NOGLOB -Word16 i_mult( Word16 a, Word16 b ) -#else /* BASOP_NOGLOB */ Word16 DEPR_i_mult( Word16 a, Word16 b ) -#endif /* BASOP_NOGLOB */ { #ifdef ORIGINAL_G7231 return a * b; @@ -3865,7 +3575,6 @@ Word16 DEPR_i_mult( Word16 a, Word16 b ) #endif } -#ifdef BASOP_NOGLOB Word16 i_mult_o( Word16 a, Word16 b, Flag *Overflow ) { #ifdef ORIGINAL_G7231 @@ -3884,7 +3593,6 @@ Word16 i_mult_sat( Word16 a, Word16 b ) Flag Overflow; return i_mult_o( a, b, &Overflow ); } -#endif /* ****************************************************************************** * The following three operators are not part of the original @@ -3964,7 +3672,6 @@ Word32 L_mult0( Word16 var1, Word16 var2 ) | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. |___________________________________________________________________________ */ -#ifdef BASOP_NOGLOB Word32 L_mac0_o( Word32 L_var3, Word16 var1, Word16 var2, Flag *Overflow ) { Word32 L_var_out; @@ -3984,7 +3691,6 @@ Word32 L_mac0_o( Word32 L_var3, Word16 var1, Word16 var2, Flag *Overflow ) return ( L_var_out ); } -#endif /* BASOP_NOGLOB */ Word32 L_mac0( Word32 L_var3, Word16 var1, Word16 var2 ) { Word32 L_var_out; @@ -4004,13 +3710,11 @@ Word32 L_mac0( Word32 L_var3, Word16 var1, Word16 var2 ) return ( L_var_out ); } -#ifdef BASOP_NOGLOB Word32 L_mac0_sat( Word32 L_var3, Word16 var1, Word16 var2 ) { Flag Overflow; return L_mac0_o( L_var3, var1, var2, &Overflow ); } -#endif /*___________________________________________________________________________ | | Function Name : L_msu0 @@ -4041,7 +3745,6 @@ Word32 L_mac0_sat( Word32 L_var3, Word16 var1, Word16 var2 ) | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. |___________________________________________________________________________ */ -#ifdef BASOP_NOGLOB Word32 L_msu0_o( Word32 L_var3, Word16 var1, Word16 var2, Flag *Overflow ) { Word32 L_var_out; @@ -4061,7 +3764,6 @@ Word32 L_msu0_o( Word32 L_var3, Word16 var1, Word16 var2, Flag *Overflow ) return ( L_var_out ); } -#endif /* BASOP_NOGLOB */ Word32 L_msu0( Word32 L_var3, Word16 var1, Word16 var2 ) { Word32 L_var_out; @@ -4081,12 +3783,10 @@ Word32 L_msu0( Word32 L_var3, Word16 var1, Word16 var2 ) return ( L_var_out ); } -#ifdef BASOP_NOGLOB Word32 L_msu0_sat( Word32 L_var3, Word16 var1, Word16 var2 ) { Flag Overflow; return L_msu0_o( L_var3, var1, var2, &Overflow ); } -#endif #undef WMC_TOOL_SKIP diff --git a/lib_com/basop32.h b/lib_com/basop32.h index 42b4d2d0b..21efdae56 100644 --- a/lib_com/basop32.h +++ b/lib_com/basop32.h @@ -86,17 +86,11 @@ | Constants and Globals | |___________________________________________________________________________| */ -#ifndef BASOP_NOGLOB -extern Flag Overflow, Overflow2; -extern Flag Carry; - -#else /* BASOP_NOGLOB */ /* DISABLED TO AVOID GLOBAL VARIABLES */ /* extern Flag BASOP_Overflow, BASOP_Overflow2; extern Flag BASOP_Carry; */ -#endif /* BASOP_NOGLOB */ #define BASOP_SATURATE_WARNING_ON_EVS #define BASOP_SATURATE_WARNING_OFF_EVS #define BASOP_SATURATE_ERROR_ON_EVS @@ -114,36 +108,17 @@ extern Flag BASOP_Carry; #define MAX_16 (Word16) 0x7fff #define MIN_16 (Word16) 0x8000 -#ifdef BASOP_NOGLOB void set_overflow( Flag *overflow ); void unset_overflow( Flag *overflow ); void set_carry( Flag *carry ); void unset_carry( Flag *carry ); Flag get_carry( const Flag *carry ); -#endif /* BASOP_NOGLOB */ /*___________________________________________________________________________ | | | Prototypes for basic arithmetic operators | |___________________________________________________________________________| */ -#ifndef BASOP_NOGLOB -Word16 add( Word16 var1, Word16 var2 ); /* Short add, 1 */ -Word16 sub( Word16 var1, Word16 var2 ); /* Short sub, 1 */ -Word16 abs_s( Word16 var1 ); /* Short abs, 1 */ -Word16 shl( Word16 var1, Word16 var2 ); /* Short shift left, 1 */ -Word16 shr( Word16 var1, Word16 var2 ); /* Short shift right, 1 */ -Word16 mult( Word16 var1, Word16 var2 ); /* Short mult, 1 */ -Word32 L_mult( Word16 var1, Word16 var2 ); /* Long mult, 1 */ -Word16 negate( Word16 var1 ); /* Short negate, 1 */ -Word16 extract_h( Word32 L_var1 ); /* Extract high, 1 */ -Word16 extract_l( Word32 L_var1 ); /* Extract low, 1 */ -Word16 round_fx( Word32 L_var1 ); /* Round, 1 */ -Word32 L_mac( Word32 L_var3, Word16 var1, Word16 var2 ); /* Mac, 1 */ -Word32 L_msu( Word32 L_var3, Word16 var1, Word16 var2 ); /* Msu, 1 */ -Word32 L_macNs( Word32 L_var3, Word16 var1, Word16 var2 ); /* Mac without - sat, 1 */ -#else /* BASOP_NOGLOB */ Word16 add( Word16 var1, Word16 var2 ); /* Short add, 1 */ Word16 sub( Word16 var1, Word16 var2 ); /* Short sub, 1 */ Word16 abs_s( Word16 var1 ); /* Short abs, 1 */ @@ -165,27 +140,9 @@ Word32 L_add_co( Word32 L_var1, Word32 L_var2, Flag *Carry, Flag *Overflow ); Word32 L_sub_co( Word32 L_var1, Word32 L_var2, Flag *Carry, Flag *Overflow ); Word32 L_sub_c( Word32 L_var1, Word32 L_var2 ); /* Long sub with c, 2 */ -#endif /* BASOP_NOGLOB */ -#ifndef BASOP_NOGLOB -Word32 L_msuNs( Word32 L_var3, Word16 var1, Word16 var2 ); /* Msu without - sat, 1 */ -#else /* BASOP_NOGLOB */ Word32 DEPR_L_msuNs( Word32 L_var3, Word16 var1, Word16 var2, Flag *Carry ); /* Msu without sat, 1 */ -#endif /* BASOP_NOGLOB */ -#ifndef BASOP_NOGLOB -Word32 L_add( Word32 L_var1, Word32 L_var2 ); /* Long add, 1 */ -Word32 L_sub( Word32 L_var1, Word32 L_var2 ); /* Long sub, 1 */ -Word32 L_add_c( Word32 L_var1, Word32 L_var2 ); /* Long add with c, 2 */ -Word32 L_sub_c( Word32 L_var1, Word32 L_var2 ); /* Long sub with c, 2 */ -Word32 L_negate( Word32 L_var1 ); /* Long negate, 1 */ -Word16 mult_r( Word16 var1, Word16 var2 ); /* Mult with round, 1 */ -Word32 L_shl( Word32 L_var1, Word16 var2 ); /* Long shift left, 1 */ -Word32 L_shr( Word32 L_var1, Word16 var2 ); /* Long shift right, 1 */ -Word16 shr_r( Word16 var1, Word16 var2 ); /* Shift right with - round, 2 */ -#else /* BASOP_NOGLOB */ Word32 L_add( Word32 L_var1, Word32 L_var2 ); /* Long add, 1 */ Word32 L_sub( Word32 L_var1, Word32 L_var2 ); /* Long sub, 1 */ Word32 L_add_c( Word32 L_var1, Word32 L_var2, Flag *Carry ); /* Long add with c, 2 */ @@ -196,44 +153,16 @@ Word32 L_shl( Word32 L_var1, Word16 var2 ); /* Word32 L_shr( Word32 L_var1, Word16 var2 ); /* Long shift right, 1 */ Word16 shr_r( Word16 var1, Word16 var2 ); /* Shift right with round, 2 */ -#endif /* BASOP_NOGLOB */ -#ifndef BASOP_NOGLOB -Word16 mac_r( Word32 L_var3, Word16 var1, Word16 var2 ); /* Mac with - rounding, 1 */ -#else /* BASOP_NOGLOB */ Word16 mac_r( Word32 L_var3, Word16 var1, Word16 var2 ); /* Mac with rounding, 1 */ -#endif /* BASOP_NOGLOB */ -#ifndef BASOP_NOGLOB -Word16 msu_r( Word32 L_var3, Word16 var1, Word16 var2 ); /* Msu with - rounding, 1 */ -#else /* BASOP_NOGLOB */ Word16 msu_r( Word32 L_var3, Word16 var1, Word16 var2 ); /* Msu with rounding, 1 */ -#endif /* BASOP_NOGLOB */ -#ifndef BASOP_NOGLOB -Word32 L_deposit_h( Word16 var1 ); /* 16 bit var1 -> MSB, 1 */ -Word32 L_deposit_l( Word16 var1 ); /* 16 bit var1 -> LSB, 1 */ -#else /* BASOP_NOGLOB */ Word32 L_deposit_h( Word16 var1 ); /* 16 bit var1 -> MSB, 1 */ Word32 L_deposit_l( Word16 var1 ); /* 16 bit var1 -> LSB, 1 */ -#endif /* BASOP_NOGLOB */ -#ifndef BASOP_NOGLOB -Word32 L_shr_r( Word32 L_var1, Word16 var2 ); /* Long shift right with - round, 3 */ -#else /* BASOP_NOGLOB */ Word32 L_shr_r( Word32 L_var1, Word16 var2 ); /* Long shift right with round, 3 */ -#endif /* BASOP_NOGLOB */ -#ifndef BASOP_NOGLOB -Word32 L_abs( Word32 L_var1 ); /* Long abs, 1 */ -Word32 L_sat( Word32 L_var1 ); /* Long saturation, 4 */ -Word16 norm_s( Word16 var1 ); /* Short norm, 1 */ -Word16 div_s( Word16 var1, Word16 var2 ); /* Short division, 18 */ -Word16 norm_l( Word32 L_var1 ); /* Long norm, 1 */ -#else /* BASOP_NOGLOB */ Word32 L_abs( Word32 L_var1 ); /* Long abs, 1 */ Word32 DEPR_L_sat_co( Word32 L_var1, Flag Overflow, Flag Carry ); /* Long saturation, 4 */ Word16 norm_s( Word16 var1 ); /* Short norm, 1 */ @@ -241,22 +170,15 @@ Word16 div_s( Word16 var1, Word16 var2 ); /* Word32 div_w( Word32 L_num, Word32 L_den ); Word16 norm_l( Word32 L_var1 ); /* Long norm, 1 */ Word32 L_sat( Word32 L_var1 ); /* Long saturation, 4 */ -#endif /* BASOP_NOGLOB */ /* * Additional G.723.1 operators */ -#ifndef BASOP_NOGLOB -Word32 L_mls( Word32, Word16 ); /* Weight FFS; currently assigned 5 */ -Word16 div_l( Word32, Word16 ); /* Weight FFS; currently assigned 32 */ -Word16 i_mult( Word16 a, Word16 b ); /* Weight FFS; currently assigned 3 */ -#else /* BASOP_NOGLOB */ Word32 L_mls( Word32, Word16 ); /* Weight FFS; currently assigned 5 */ Word16 div_l( Word32, Word16 ); /* Weight FFS; currently assigned 32 */ Word16 i_mult( Word16 a, Word16 b ); /* Weight FFS; currently assigned 3 */ Word16 DEPR_i_mult( Word16 a, Word16 b ); /* Weight FFS; currently assigned 3 */ -#endif /* BASOP_NOGLOB */ /* * New shiftless operators, not used in G.729/G.723.1 @@ -264,7 +186,6 @@ Word16 DEPR_i_mult( Word16 a, Word16 b ); /* Weight FFS; currently assigned 3 */ Word32 L_mult0( Word16 v1, Word16 v2 ); /* 32-bit Multiply w/o shift 1 */ Word32 L_mac0( Word32 L_v3, Word16 v1, Word16 v2 ); /* 32-bit Mac w/o shift 1 */ Word32 L_msu0( Word32 L_v3, Word16 v1, Word16 v2 ); /* 32-bit Msu w/o shift 1 */ -#ifdef BASOP_NOGLOB /* * Overflowing operators @@ -295,7 +216,6 @@ Word32 L_shr_ro( Word32 L_var1, Word16 var2, Flag *Overflow ); Word32 L_macNs_co( Word32 L_var3, Word16 var1, Word16 var2, Flag *Carry, Flag *Overflow ); Word32 L_msuNs_co( Word32 L_var3, Word16 var1, Word16 var2, Flag *Carry, Flag *Overflow ); -#endif /* BASOP_NOGLOB */ /* * Saturating operators diff --git a/lib_com/basop_lsf_tools.c b/lib_com/basop_lsf_tools.c index aac96ae5f..3e49411d6 100644 --- a/lib_com/basop_lsf_tools.c +++ b/lib_com/basop_lsf_tools.c @@ -245,9 +245,7 @@ static Word16 E_LPC_f_lsp_pol_get( Word16 Ovf = 0; Word16 Q_out; Word16 m2; -#ifdef BASOP_NOGLOB Flag Overflow; -#endif /* BASOP_NOGLOB */ move16(); // move for Ovf = 0 Q_out = 31 - 23; @@ -302,9 +300,7 @@ static Word16 E_LPC_f_lsp_pol_get( test(); IF( Overflow > 0 && isMODE1 ) { -#ifdef BASOP_NOGLOB assert( 0 ); -#endif /* BASOP_NOGLOB */ /* If an overflow is detected, redo the computation with 1 bit less */ Ovf = add( Ovf, 1 ); Ovf = E_LPC_f_lsp_pol_get( lsp, f, n, Ovf, isMODE1 ); /* Q0 */ diff --git a/lib_com/basop_util.c b/lib_com/basop_util.c index c4f40c6df..cef466471 100644 --- a/lib_com/basop_util.c +++ b/lib_com/basop_util.c @@ -306,11 +306,7 @@ void BASOP_Util_Divide_MantExp( Word16 a_m, /*!< Mantissa of dividend a /* normalize result */ postShift = norm_l( m32 ); -#ifdef BASOP_NOGLOB m = round_fx_o( L_shl( m32, postShift ), &Overflow ); -#else - m = round_fx( L_shl( m32, postShift ) ); -#endif /* exponent */ *ptrResult_e = sub( add( add( a_e, sub( 1, b_e ) ), preShift ), postShift ); @@ -326,9 +322,7 @@ static Word16 Sqrt16_common( Word16 m, Word16 e ) { Word16 index, frac; -#ifdef BASOP_NOGLOB Flag Overflow; -#endif assert( ( m >= 0x4000 ) || ( m == 0 ) ); @@ -344,11 +338,7 @@ static Word16 Sqrt16_common( Word16 m, if ( m != 0 ) { BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB m = mac_ro( SqrtTable[index], SqrtDiffTable[index], frac, &Overflow ); -#else - m = mac_r( SqrtTable[index], SqrtDiffTable[index], frac ); -#endif BASOP_SATURATE_WARNING_ON_EVS; } @@ -371,11 +361,7 @@ static Word32 Sqrt32_common( Word32 m, assert( ( m >= 0x40000000 ) || ( m == 0 ) ); -#ifdef BASOP_NOGLOB m16 = round_fx_o( m, &Overflow ); -#else /* BASOP_NOGLOB */ - m16 = round_fx( m ); -#endif /* BASOP_NOGLOB */ /* get table index (upper 6 bits minus 32) */ /* index = (m16 >> 9) - 32; */ @@ -388,11 +374,7 @@ static Word32 Sqrt32_common( Word32 m, if ( m != 0 ) { BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB m = L_mac_sat( SqrtTable[index], SqrtDiffTable[index], frac ); -#else - m = L_mac( SqrtTable[index], SqrtDiffTable[index], frac ); -#endif BASOP_SATURATE_WARNING_ON_EVS; } @@ -439,11 +421,7 @@ static Word32 ISqrt32_common( Word32 m, assert( m >= 0x40000000 ); -#ifdef BASOP_NOGLOB m16 = round_fx_o( m, &Overflow ); -#else - m16 = round_fx( m ); -#endif /* get table index (upper 6 bits minus 32) */ /* index = (m16 >> 25) - 32; */ @@ -676,13 +654,8 @@ void BASOP_Util_Sqrt_InvSqrt_MantExp( Word16 mantissa, /*!< mantissa */ /* interpolate */ BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB m = mac_r_sat( SqrtTable[index], SqrtDiffTable[index], frac ); mi = msu_r_sat( ISqrtTable[index], ISqrtDiffTable[index], frac ); -#else - m = mac_r( SqrtTable[index], SqrtDiffTable[index], frac ); - mi = msu_r( ISqrtTable[index], ISqrtDiffTable[index], frac ); -#endif BASOP_SATURATE_WARNING_ON_EVS; /* handle even/odd exponents */ @@ -929,11 +902,7 @@ Word16 divide3232( Word32 L_num, Word32 L_denom ) L_denom = L_shl( L_denom, z ); /* round_fx instead of extract_h improves spectral distortion in E_UTIL_lev_dur (schur version). */ -#ifdef BASOP_NOGLOB z = div_l( L_num, round_fx_o( L_denom, &Overflow ) ); -#else - z = div_l( L_num, round_fx( L_denom ) ); -#endif if ( 0 != sign ) { z = negate( z ); @@ -1436,11 +1405,7 @@ Word16 getCosWord16R2( BASOP_SATURATE_WARNING_OFF sine = negate( sine ); /* Saturation has been included based on the recommendation from the PC group */ -#ifdef BASOP_NOGLOB result = msu_r_sat( L_mult( sine, residual ), cosine, -32768 ); -#else - result = msu_r( L_mult( sine, residual ), cosine, -32768 ); -#endif BASOP_SATURATE_WARNING_ON return result; @@ -1483,11 +1448,7 @@ Word16 getSqrtWord32( Word32 val ) exp = sub( 31 - 32, exp2 ); L_temp = Isqrt_lc( L_temp2, &exp ); /* 12 clks */ -#ifdef BASOP_NOGLOB temp = round_fx_sat( L_temp ); -#else - temp = round_fx( L_temp ); -#endif L_temp = Mpy_32_16_1( L_temp2, temp ); /* 2 clks */ L_temp = L_shl( L_temp, sub( exp, exp2 ) ); @@ -1675,13 +1636,8 @@ Word32 norm_llQ31( /* o : normalized result Q31 */ /* Move MSBit of L_sum into L_c */ Carry = 0; -#ifdef BASOP_NOGLOB L_tmp = L_add_co( L_sum, L_sum, &Carry, &Overflow ); /* L_tmp = L_sum << 1 */ L_c = L_add_co( L_c, L_c, &Carry, &Overflow ); -#else /* BASOP_NOGLOB */ - L_tmp = L_add_c( L_sum, L_sum ); /* L_tmp = L_sum << 1 */ - L_c = L_add_c( L_c, L_c ); -#endif L_add( 0, 0 ); test(); IF( ( L_c != (Word32) 0L ) && ( L_c != (Word32) 0xFFFFFFFFL ) ) @@ -1777,13 +1733,8 @@ Word32 Norm32Norm( const Word32 *x, const Word16 headroom, const Word16 length, if ( L_tmp2 >= 0 ) L_tmp = L_shr( L_tmp, 2 ); -#ifdef BASOP_NOGLOB tmp = round_fx_sat( L_shl_sat( x[i], shift ) ); L_tmp = L_mac0_sat( L_tmp, tmp, tmp ); /* exponent = (1-shift*2) , Q(30+shift*2) */ -#else - tmp = round_fx( L_shl( x[i], shift ) ); - L_tmp = L_mac0( L_tmp, tmp, tmp ); /* exponent = (1-shift*2) , Q(30+shift*2) */ -#endif } move16(); @@ -2217,11 +2168,7 @@ Word16 BASOP_Util_Cmp_Mant32Exp /*!< o: flag: result of comparison */ } BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB diff_m = L_sub_sat( a_m, b_m ); -#else - diff_m = L_sub( a_m, b_m ); -#endif BASOP_SATURATE_WARNING_ON_EVS diff_e = sub( a_e, b_e ); @@ -2392,11 +2339,7 @@ void bufferCopyFx( { FOR( i = 0; i < length; i++ ) { -#ifdef BASOP_NOGLOB *( dest + i ) = shr_sat( *( src + i ), tmp_16 ); -#else - *( dest + i ) = shr( *( src + i ), tmp_16 ); -#endif move16(); } } diff --git a/lib_com/bitalloc_fx.c b/lib_com/bitalloc_fx.c index 3400b533d..b8ce51bd1 100644 --- a/lib_com/bitalloc_fx.c +++ b/lib_com/bitalloc_fx.c @@ -55,11 +55,7 @@ void bitalloc_fx( move16(); FOR( m = 1; m < im; m++ ) { -#ifdef BASOP_NOGLOB v = sub_o( temp, y[m], &Overflow ); /* Q0 */ -#else /* BASOP_NOGLOB */ - v = sub( temp, y[m] ); -#endif temp = s_max( temp, y[m] ); if ( v < 0 ) { @@ -380,11 +376,7 @@ Word16 BitAllocF_fx( exp1 = sub( norm_l( L_tmp1 ), 1 ); exp2 = norm_s( n ); tmp = div_s( extract_h( L_shl( L_tmp1, exp1 ) ), shl( n, exp2 ) ); /*15 + 15 + exp1 - 16 - exp2*/ -#ifdef BASOP_NOGLOB m_fx = shl_sat( tmp, sub( exp2, exp1 ) ); /*Q14*/ -#else - m_fx = shl( tmp, sub( exp2, exp1 ) ); /*Q14*/ -#endif t_fx = L_deposit_l( 0 ); n = 0; move16(); @@ -451,11 +443,7 @@ Word16 BitAllocF_fx( exp1 = sub( norm_l( L_tmp2 ), 1 ); exp2 = norm_s( n ); tmp = div_s( extract_h( L_shl( L_tmp2, exp1 ) ), shl( n, exp2 ) ); /*15 + 15 + exp1 - 16 - exp2*/ -#ifdef BASOP_NOGLOB m_fx = shl_o( tmp, sub( exp2, exp1 ), &Overflow ); /*Q14*/ -#else - m_fx = shl( tmp, sub( exp2, exp1 ) ); /*Q14*/ -#endif if ( L_tmp1 < 0 ) { m_fx = negate( m_fx ); diff --git a/lib_com/cldfb_evs.c b/lib_com/cldfb_evs.c index 923d2b887..d74b9b646 100644 --- a/lib_com/cldfb_evs.c +++ b/lib_com/cldfb_evs.c @@ -72,7 +72,6 @@ cldfb_init_proto_and_twiddles( HANDLE_CLDFB_FILTER_BANK hs ); iyr = CL_Extract_real( CL_iy ); \ iyi = CL_Extract_imag( CL_iy ); \ rxr += sx, rxi += sx, ixr += sx, ixi += sx, cr += sr, ci += sr -#ifdef BASOP_NOGLOB #define add1( y1, y2, y3, y4, rr12, ri12, ir12, ii12, s ) \ *y1 = round_fx_sat( L_shl_sat( L_negate( L_add_sat( rr12, ii12 ) ), s ) ); \ @@ -88,21 +87,6 @@ cldfb_init_proto_and_twiddles( HANDLE_CLDFB_FILTER_BANK hs ); *y4 = round_fx_sat( L_shl_sat( L_sub_sat( rr12, ii12 ), s ) ); \ y1 += 2, y2 -= 2, y3 -= 2, y4 += 2 -#else -#define add1( y1, y2, y3, y4, rr12, ri12, ir12, ii12, s ) \ - *y1 = round_fx( L_shl( L_negate( L_add( rr12, ii12 ) ), s ) ); \ - *y2 = round_fx( L_shl( L_negate( L_add( ri12, ir12 ) ), s ) ); \ - *y3 = round_fx( L_shl( L_sub( rr12, ii12 ), s ) ); \ - *y4 = round_fx( L_shl( L_sub( ir12, ri12 ), s ) ); \ - y1 += 2, y2 -= 2, y3 -= 2, y4 += 2 - -#define add2( y1, y2, y3, y4, rr12, ri12, ir12, ii12, s ) \ - *y1 = round_fx( L_shl( L_add( ri12, ir12 ), s ) ); \ - *y2 = round_fx( L_shl( L_add( rr12, ii12 ), s ) ); \ - *y3 = round_fx( L_shl( L_sub( ir12, ri12 ), s ) ); \ - *y4 = round_fx( L_shl( L_sub( rr12, ii12 ), s ) ); \ - y1 += 2, y2 -= 2, y3 -= 2, y4 += 2 -#endif #define ptrUpdate16( y11, y12, y13, y14, r11, x11, x12, x13, x14, r12, y21, y22, y23, y24, r21, x21, x22, x23, x24, r22 ) \ y11 += 2 * N8, y12 -= 2 * N8, y13 -= 2 * N8, y14 += 2 * N8, r11 -= 1 * N8; \ @@ -497,11 +481,7 @@ void cldfbAnalysisFiltering( HANDLE_CLDFB_FILTER_BANK cldfbBank, /* move and scale filter states */ FOR( i = 0; i < offset; i++ ) { -#ifdef BASOP_NOGLOB pStates[i] = shl_sat( pStates[i + nSamplesUpd], scale ); // Q(15-(timeIn_e-FilterStates_eg)) -#else - pStates[i] = shl( pStates[i + nSamplesUpd], scale ); -#endif move16(); } @@ -509,11 +489,7 @@ void cldfbAnalysisFiltering( HANDLE_CLDFB_FILTER_BANK cldfbBank, scale = sub( timeIn_e, cldfbBank->FilterStates_eg ); FOR( i = 0; i < nSamples; i++ ) { -#ifdef BASOP_NOGLOB pStates[offset + i] = shl_sat( *timeIn, scale ); // Q(15-scale) -#else - pStates[offset + i] = shl( *timeIn, scale ); -#endif move16(); timeIn = timeIn + stride; } @@ -880,11 +856,7 @@ void cldfbSynthesisFiltering( HANDLE_CLDFB_FILTER_BANK cldfbBank, acc = L_mac( acc, nBuffer[sub( channels1, i )], *pFilterM++ ); BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB timeOut[( offset1 - i ) * stride] = round_fx_sat( L_shl_sat( acc, outScale ) ); -#else - timeOut[( offset1 - i ) * stride] = round_fx( L_shl( acc, outScale ) ); -#endif BASOP_SATURATE_WARNING_ON_EVS move16(); } @@ -916,11 +888,7 @@ void cldfbSynthesisFiltering( HANDLE_CLDFB_FILTER_BANK cldfbBank, pFilterM++; BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB timeOut[( offset2 - i ) * stride] = round_fx_sat( L_shl_sat( acc, outScale ) ); -#else - timeOut[( offset2 - i ) * stride] = round_fx( L_shl( acc, outScale ) ); -#endif BASOP_SATURATE_WARNING_ON_EVS move16(); } @@ -1167,13 +1135,8 @@ AnalysisPostSpectrumScaling_Fx( HANDLE_CLDFB_FILTER_BANK cldfbBank, /*!< Handle { FOR( j = 0; j < cldfbBank->no_channels; j++ ) { -#ifdef BASOP_NOGLOB rSubband16[i][j] = round_fx_sat( L_shl_sat( rSubband32[i][j], headRoom ) ); // Q(cldfbSacle_headRoom) iSubband16[i][j] = round_fx_sat( L_shl_sat( iSubband32[i][j], headRoom ) ); // Q(cldfbSacle+headRoom) -#else - rSubband16[i][j] = round_fx( L_shl( rSubband32[i][j], headRoom ) ); - iSubband16[i][j] = round_fx( L_shl( iSubband32[i][j], headRoom ) ); -#endif move16(); move16(); } @@ -1378,11 +1341,7 @@ void GetEnergyCldfb( Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead) { FOR( j = 20; j < numberBandsM; j++ ) { -#ifdef BASOP_NOGLOB nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow ); -#else - nrg = L_add( nrg, L_shr( energyValues[k][j], s ) ); -#endif } } @@ -1405,11 +1364,7 @@ void GetEnergyCldfb( Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead) { FOR( j = 20; j < numberBandsM; j++ ) { -#ifdef BASOP_NOGLOB nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow ); -#else - nrg = L_add( nrg, L_shr( energyValues[k][j], s ) ); -#endif } } @@ -1417,13 +1372,8 @@ void GetEnergyCldfb( Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead) sm = sub( s_min( s, 44 ), 1 ); BASOP_SATURATE_WARNING_OFF_EVS /* nrg + 6.1e-5f => value 0x40000000, scale 44 */ -#ifdef BASOP_NOGLOB *energyLookahead = L_add_sat( L_shr_sat( nrg, sub( s, sm ) ), L_shr_sat( 0x40000000, s_max( -31, s_min( 31, sub( 44, sm ) ) ) ) ); -#else - *energyLookahead = L_add( L_shr( nrg, sub( s, sm ) ), - L_shr( 0x40000000, s_max( -31, s_min( 31, sub( 44, sm ) ) ) ) ); -#endif move32(); BASOP_SATURATE_WARNING_ON_EVS *sf_energyLookahead = sm; diff --git a/lib_com/cng_exc_fx.c b/lib_com/cng_exc_fx.c index 6ca0d4c3a..d2a7b6c28 100644 --- a/lib_com/cng_exc_fx.c +++ b/lib_com/cng_exc_fx.c @@ -194,11 +194,7 @@ FOR( i_subfr = 0; i_subfr < L_frame; i_subfr += L_SUBFR ) *------------------------------------------------------------*/ L_tmp = Mult_32_16( *lp_ener, Random( cng_ener_seed ) ); // Q6 L_tmp = Mult_32_16( L_tmp, GAIN_VAR ); // Q6 -#ifdef BASOP_NOGLOB L_tmp = L_add_sat( L_tmp, *lp_ener ); -#else - L_tmp = L_add( L_tmp, *lp_ener ); -#endif L_tmp = L_max( L_tmp, 1 ); /* enr = dot_product( exc2, exc2, L_SUBFR ) + 0.01f */ @@ -234,11 +230,7 @@ FOR( i_subfr = 0; i_subfr < L_frame; i_subfr += L_SUBFR ) { /* exc2[i] *= enr */ L_tmp = L_mult( exc2[i_subfr + i], tmp ); /* Q-4 * Q_exc+19 -> Q_exc +16 */ -#ifdef BASOP_NOGLOB exc2[i_subfr + i] = round_fx_sat( L_shl_sat( L_tmp, exp ) ); -#else - exc2[i_subfr + i] = round_fx( L_shl( L_tmp, exp ) ); -#endif move16(); } } @@ -250,11 +242,7 @@ IF( NE_16( Opt_AMR_WB, 1 ) ) exp = norm_l( *Enew ); L_tmp = L_shl( *Enew, exp ); /* Q(exp+6) */ L_tmp = Mult_32_16( L_tmp, shl( L_frame, 5 ) ); /* Q(exp+6+5-15=exp-4) */ -#ifdef BASOP_NOGLOB L_tmp = L_shr_sat( L_tmp, sub( exp, 10 ) ); /* Q6 */ -#else - L_tmp = L_shr( L_tmp, sub( exp, 10 ) ); /* Q6 */ -#endif exp = norm_l( L_tmp ); fra = Log2_norm_lc( L_shl( L_tmp, exp ) ); exp = sub( sub( 30, exp ), 6 ); @@ -321,18 +309,10 @@ IF( NE_16( Opt_AMR_WB, 1 ) ) { /* env[i] = 2.0f*(*ptR * *ptR + *ptI * *ptI)/L_FFT; */ L_tmp = L_mult0( *ptR, *ptR ); /* 2*Q_exc */ -#ifdef BASOP_NOGLOB L_tmp = L_mac0_sat( L_tmp, *ptI, *ptI ); /* 2*Q_exc */ -#else - L_tmp = L_mac0( L_tmp, *ptI, *ptI ); /* 2*Q_exc */ -#endif L_tmp = L_shr( L_tmp, 1 ); /* 2*Q_exc+6 */ tmp = add( Q_exc, Q_exc ); -#ifdef BASOP_NOGLOB env[i] = L_shr_sat( L_tmp, tmp ); -#else - env[i] = L_shr( L_tmp, tmp ); -#endif move32(); /* Q6 */ ptR++; ptI--; @@ -341,13 +321,8 @@ IF( NE_16( Opt_AMR_WB, 1 ) ) FOR( i = 0; i < NUM_ENV_CNG; i++ ) { /* denv[i] = lp_env[i] + 2*(*lp_ener) - env[i]; */ -#ifdef BASOP_NOGLOB L_tmp = L_add_sat( *lp_ener, *lp_ener ); denv[i] = L_sub_sat( L_add_sat( lp_env[i], L_tmp ), env[i] ); -#else - L_tmp = L_add( *lp_ener, *lp_ener ); - denv[i] = L_sub( L_add( lp_env[i], L_tmp ), env[i] ); -#endif move32(); /* Q6 */ if ( denv[i] < 0 ) @@ -384,13 +359,8 @@ IF( NE_16( Opt_AMR_WB, 1 ) ) /* itmp[i] += own_random( cng_ener_seed1 )*denv[i]*0.000011f + denv[i]; */ L_tmp = Mult_32_16( denv[i], Random( cng_ener_seed1 ) ); // Q6 L_tmp = Mult_32_16( L_tmp, GAIN_VAR ); // Q6 -#ifdef BASOP_NOGLOB L_tmp = L_add_sat( L_tmp, denv[i] ); itmp[i] = L_add_sat( L_tmp, itmp[i] ); -#else - L_tmp = L_add( L_tmp, denv[i] ); - itmp[i] = L_add( L_tmp, itmp[i] ); -#endif move32(); /* Q6 */ if ( itmp[i] < 0 ) @@ -428,18 +398,10 @@ IF( NE_16( Opt_AMR_WB, 1 ) ) L_tmp = Isqrt_lc( L_tmp, &exp ); /*Q(31-exp)*/ L_tmp2 = Mult_32_16( L_tmp, *ptR ); /*Q(16-exp)*/ -#ifdef BASOP_NOGLOB *ptR = extract_h( L_shl_sat( L_tmp2, add( exp, Q_exc ) ) ); /*Q_exc*/ -#else - *ptR = extract_h( L_shl( L_tmp2, add( exp, Q_exc ) ) ); /*Q_exc*/ -#endif move16(); L_tmp2 = Mult_32_16( L_tmp, *ptI ); /*Q(16-exp)*/ -#ifdef BASOP_NOGLOB *ptI = extract_h( L_shl_sat( L_tmp2, add( exp, Q_exc ) ) ); /*Q_exc*/ -#else - *ptI = extract_h( L_shl( L_tmp2, add( exp, Q_exc ) ) ); /*Q_exc*/ -#endif move16(); ptR++; ptI--; @@ -518,11 +480,7 @@ IF( NE_16( Opt_AMR_WB, 1 ) ) test(); IF( NE_32( last_core_brate, SID_2k40 ) && NE_32( last_core_brate, SID_1k75 ) && ( last_core_brate != FRAME_NO_DATA ) && EQ_32( core_brate, SID_2k40 ) ) { -#ifdef BASOP_NOGLOB IF( GT_32( L_tmp, L_shl_sat( 1, sub( 31, exp ) ) ) ) -#else - IF( GT_32( L_tmp, L_shl( 1, sub( 31, exp ) ) ) ) -#endif { L_tmp = L_shl( 1, sub( 31, exp ) ); } @@ -542,11 +500,7 @@ IF( NE_16( Opt_AMR_WB, 1 ) ) { /* fft_io[i] = 0.75f*fft_io[i] + exc2[i];*/ tmp = mult( fft_io[i], 24576 /*.75f in Q15*/ ); -#ifdef BASOP_NOGLOB fft_io[i] = add_sat( tmp, exc2[i] ); -#else - fft_io[i] = add( tmp, exc2[i] ); -#endif move16(); /*Q_exc*/ } @@ -561,15 +515,9 @@ IF( NE_16( Opt_AMR_WB, 1 ) ) { L_tmp = L_mult0( *pt_fft_io, *pt_fft_io ); pt_fft_io++; -#ifdef BASOP_NOGLOB L_tmp = L_mac0_sat( L_tmp, *pt_fft_io, *pt_fft_io ); /* 2*(Q_exc) */ pt_fft_io++; L_tmp2 = L_add_sat( L_tmp2, L_shr( L_tmp, 7 ) ); /* 2*(Q_exc)+1, divide by L_frame done here */ -#else - L_tmp = L_mac0( L_tmp, *pt_fft_io, *pt_fft_io ); /* 2*(Q_exc) */ - pt_fft_io++; - L_tmp2 = L_add( L_tmp2, L_shr( L_tmp, 7 ) ); /* 2*(Q_exc)+1, divide by L_frame done here */ -#endif } } ELSE /* L_FRAME16k */ @@ -578,11 +526,7 @@ IF( NE_16( Opt_AMR_WB, 1 ) ) { L_tmp = L_mult0( *pt_fft_io, *pt_fft_io ); pt_fft_io++; -#ifdef BASOP_NOGLOB L_tmp = L_mac0_sat( L_tmp, *pt_fft_io, *pt_fft_io ); /* 2*(Q_exc) */ -#else - L_tmp = L_mac0( L_tmp, *pt_fft_io, *pt_fft_io ); /* 2*(Q_exc) */ -#endif pt_fft_io++; L_tmp2 = L_add( L_tmp2, L_shr( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7 ) ); /* 2*(Q_exc)+15+1-16+1, divide by L_frame done here */ } @@ -614,11 +558,7 @@ IF( NE_16( Opt_AMR_WB, 1 ) ) L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp ); /*Q(31-exp)*/ -#ifdef BASOP_NOGLOB ftmp = extract_h( L_shl_sat( L_tmp, exp ) ); /* Q15 */ -#else /* BASOP_NOGLOB */ - ftmp = extract_h( L_shl( L_tmp, exp ) ); /* Q15 */ -#endif /* BASOP_NOGLOB */ FOR( i = 0; i < L_frame; i++ ) { /* fft_io[i] *= ftmp;*/ @@ -710,15 +650,9 @@ void cng_params_postupd_fx( FOR( i = 0; i < NUM_ENV_CNG; i++ ) { /* sp[i] = 2.0f*(*ptR * *ptR + *ptI * *ptI)/L_FFT; */ -#ifdef BASOP_NOGLOB L_tmp = L_mult_o( *ptR, *ptR, &Overflow ); /* 2*Q_exc+1 */ L_tmp = L_add_o( L_tmp, L_mult_o( *ptI, *ptI, &Overflow ), &Overflow ); /* 2*Q_exc+1 */ L_tmp = L_add_o( L_tmp, L_tmp, &Overflow ); /* 2*Q_exc+1 */ -#else /* BASOP_NOGLOB */ - L_tmp = L_mult( *ptR, *ptR ); /* 2*Q_exc+1 */ - L_tmp = L_add( L_tmp, L_mult( *ptI, *ptI ) ); /* 2*Q_exc+1 */ - L_tmp = L_add( L_tmp, L_tmp ); /* 2*Q_exc+1 */ -#endif /* BASOP_NOGLOB */ L_tmp = Mult_32_16( L_tmp, 128 ); /* 2*Q_exc+1 */ tmp = add( add( Q_exc, Q_exc ), 1 ); sp[i] = L_shr( L_tmp, sub( tmp, 6 ) ); @@ -835,15 +769,9 @@ void cng_params_postupd_ivas_fx( FOR( i = 0; i < NUM_ENV_CNG; i++ ) { /* sp[i] = 2.0f*(*ptR * *ptR + *ptI * *ptI)/L_FFT; */ -#ifdef BASOP_NOGLOB L_tmp = L_mult_o( *ptR, *ptR, &Overflow ); /* 2*Q_exc+1 */ L_tmp = L_add_o( L_tmp, L_mult_o( *ptI, *ptI, &Overflow ), &Overflow ); /* 2*Q_exc+1 */ L_tmp = L_add_o( L_tmp, L_tmp, &Overflow ); /* 2*Q_exc+1 */ -#else /* BASOP_NOGLOB */ - L_tmp = L_mult( *ptR, *ptR ); /* 2*Q_exc+1 */ - L_tmp = L_add( L_tmp, L_mult( *ptI, *ptI ) ); /* 2*Q_exc+1 */ - L_tmp = L_add( L_tmp, L_tmp ); /* 2*Q_exc+1 */ -#endif /* BASOP_NOGLOB */ L_tmp = Mult_32_16( L_tmp, 128 ); /* 2*Q_exc+1 */ tmp = add( add( Q_exc, Q_exc ), 1 ); // To do : Saturation to be re-validated. @@ -994,17 +922,9 @@ void cng_params_upd_fx( L_tmp = L_mult0( tmpv, tmpv ); /* 2*(Q_exc+scale) */ pt_exc2++; tmpv = shl( *pt_exc2, scale ); -#ifdef BASOP_NOGLOB L_tmp = L_mac0_o( L_tmp, tmpv, tmpv, &Overflow ); -#else - L_tmp = L_mac0( L_tmp, tmpv, tmpv ); -#endif pt_exc2++; -#ifdef BASOP_NOGLOB L_ener = L_add_o( L_ener, L_shr_o( L_tmp, 7, &Overflow ), &Overflow ); /* Q(2*(Q_exc+scale)+1) ,division by L_frame done here */ -#else - L_ener = L_add( L_ener, L_shr( L_tmp, 7 ) ); /* Q(2*(Q_exc+scale)+1) ,division by L_frame done here */ -#endif } } ELSE /* L_FRAME16k */ @@ -1015,24 +935,12 @@ void cng_params_upd_fx( L_tmp = L_mult0( tmpv, tmpv ); /* 2*(Q_exc+scale) */ pt_exc2++; tmpv = shl( *pt_exc2, scale ); -#ifdef BASOP_NOGLOB L_tmp = L_mac0_o( L_tmp, tmpv, tmpv, &Overflow ); -#else - L_tmp = L_mac0( L_tmp, tmpv, tmpv ); -#endif pt_exc2++; -#ifdef BASOP_NOGLOB L_ener = L_add_o( L_ener, L_shr_o( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7, &Overflow ), &Overflow ); /* Q(2*(Q_exc+scale)+15+1-16+1) ,division by L_frame done here */ -#else - L_ener = L_add( L_ener, L_shr( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7 ) ); /* Q(2*(Q_exc+scale)+15+1-16+1) ,division by L_frame done here */ -#endif } } -#ifdef BASOP_NOGLOB L_ener = L_shr_o( L_ener, sub( shl( add( Q_exc, scale ), 1 ), 5 ), &Overflow ); /* Q6 (2*(Q_exc+scale)+1-2*(Q_exc+scale)+5) */ -#else /* BASOP_NOGLOB */ - L_ener = L_shr( L_ener, sub( shl( add( Q_exc, scale ), 1 ), 5 ) ); /* Q6 (2*(Q_exc+scale)+1-2*(Q_exc+scale)+5) */ -#endif /* update the circular buffer of old energies */ ho_ener_circ[*ho_circ_ptr] = L_ener; @@ -1066,15 +974,9 @@ void cng_params_upd_fx( FOR( i = 0; i < NUM_ENV_CNG; i++ ) { /* sp[i] = 2.0f*(*ptR * *ptR + *ptI * *ptI)/L_FFT; */ -#ifdef BASOP_NOGLOB L_tmp = L_mult_o( *ptR, *ptR, &Overflow ); /* 2*Q_exc+1 */ L_tmp = L_add_o( L_tmp, L_mult_o( *ptI, *ptI, &Overflow ), &Overflow ); /* 2*Q_exc+1 */ L_tmp = L_add_o( L_tmp, L_tmp, &Overflow ); /* 2*Q_exc+1 */ -#else - L_tmp = L_mult( *ptR, *ptR ); /* 2*Q_exc+1 */ - L_tmp = L_add( L_tmp, L_mult( *ptI, *ptI ) ); /* 2*Q_exc+1 */ - L_tmp = L_add( L_tmp, L_tmp ); /* 2*Q_exc+1 */ -#endif L_tmp = Mult_32_16( L_tmp, 128 ); /* 2*Q_exc+1 */ tmp = add( add( Q_exc, Q_exc ), 1 ); sp[i] = L_shr( L_tmp, sub( tmp, 6 ) ); @@ -1207,17 +1109,9 @@ void cng_params_upd_ivas_fx( L_tmp = L_mult0( tmpv, tmpv ); /* 2*(Q_exc+scale) */ pt_exc2++; tmpv = shl( *pt_exc2, scale ); -#ifdef BASOP_NOGLOB L_tmp = L_mac0_o( L_tmp, tmpv, tmpv, &Overflow ); -#else - L_tmp = L_mac0( L_tmp, tmpv, tmpv ); -#endif pt_exc2++; -#ifdef BASOP_NOGLOB L_ener = L_add_o( L_ener, L_shr_o( L_tmp, 7, &Overflow ), &Overflow ); /* Q(2*(Q_exc+scale)+1) ,division by L_frame done here */ -#else - L_ener = L_add( L_ener, L_shr( L_tmp, 7 ) ); /* Q(2*(Q_exc+scale)+1) ,division by L_frame done here */ -#endif } } ELSE /* L_FRAME16k */ @@ -1228,24 +1122,12 @@ void cng_params_upd_ivas_fx( L_tmp = L_mult0( tmpv, tmpv ); /* 2*(Q_exc+scale) */ pt_exc2++; tmpv = shl( *pt_exc2, scale ); -#ifdef BASOP_NOGLOB L_tmp = L_mac0_o( L_tmp, tmpv, tmpv, &Overflow ); -#else - L_tmp = L_mac0( L_tmp, tmpv, tmpv ); -#endif pt_exc2++; -#ifdef BASOP_NOGLOB L_ener = L_add_o( L_ener, L_shr_o( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7, &Overflow ), &Overflow ); /* Q(2*(Q_exc+scale)+15+1-16+1) ,division by L_frame done here */ -#else - L_ener = L_add( L_ener, L_shr( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7 ) ); /* Q(2*(Q_exc+scale)+15+1-16+1) ,division by L_frame done here */ -#endif } } -#ifdef BASOP_NOGLOB L_ener = L_shr_o( L_ener, sub( shl( add( Q_exc, scale ), 1 ), 5 ), &Overflow ); /* Q6 (2*(Q_exc+scale)+1-2*(Q_exc+scale)+5) */ -#else /* BASOP_NOGLOB */ - L_ener = L_shr( L_ener, sub( shl( add( Q_exc, scale ), 1 ), 5 ) ); /* Q6 (2*(Q_exc+scale)+1-2*(Q_exc+scale)+5) */ -#endif /* update the circular buffer of old energies */ ho_ener_circ[*ho_circ_ptr] = L_ener; @@ -1279,15 +1161,9 @@ void cng_params_upd_ivas_fx( FOR( i = 0; i < NUM_ENV_CNG; i++ ) { /* sp[i] = 2.0f*(*ptR * *ptR + *ptI * *ptI)/L_FFT; */ -#ifdef BASOP_NOGLOB L_tmp = L_mult_o( *ptR, *ptR, &Overflow ); /* 2*Q_exc+1 */ L_tmp = L_add_o( L_tmp, L_mult_o( *ptI, *ptI, &Overflow ), &Overflow ); /* 2*Q_exc+1 */ L_tmp = L_add_o( L_tmp, L_tmp, &Overflow ); /* 2*Q_exc+1 */ -#else - L_tmp = L_mult( *ptR, *ptR ); /* 2*Q_exc+1 */ - L_tmp = L_add( L_tmp, L_mult( *ptI, *ptI ) ); /* 2*Q_exc+1 */ - L_tmp = L_add( L_tmp, L_tmp ); /* 2*Q_exc+1 */ -#endif L_tmp = Mult_32_16( L_tmp, 128 ); /* 2*Q_exc+1 */ tmp = add( add( Q_exc, Q_exc ), 1 ); sp[i] = L_shr( L_tmp, sub( tmp, 6 ) ); diff --git a/lib_com/codec_tcx_common.c b/lib_com/codec_tcx_common.c index 85e353d59..f6da34b55 100644 --- a/lib_com/codec_tcx_common.c +++ b/lib_com/codec_tcx_common.c @@ -40,11 +40,7 @@ Word16 tcxGetNoiseFillingTilt( Copy_Scale_sig( A, As, add( lpcorder, 1 ), sub( norm_s( A[0] ), 2 ) ); // Q(12) tmp = get_gain( As + 1, As, lpcorder ); BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB *noiseTiltFactor = add_sat( round_fx_sat( L_shl_sat( tmp, 15 ) ), 3072 /*0.09375f Q15*/ ); -#else - *noiseTiltFactor = add( round_fx( L_shl( tmp, 15 ) ), 3072 /*0.09375f Q15*/ ); -#endif move16(); BASOP_SATURATE_WARNING_ON_EVS; } @@ -144,11 +140,7 @@ void tcxFormantEnhancement( { fac = add( fac0, mult( d, extract_l( L_mult0( j, inv_int[n] ) ) ) ); BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB xn_buf[l + j] = s_min( xn_one, shl_o( mult( xn_buf[l + j], fac ), fac_e, &Overflow ) ); -#else - xn_buf[l + j] = s_min( xn_one, shl( mult( xn_buf[l + j], fac ), fac_e ) ); -#endif move16(); BASOP_SATURATE_WARNING_ON_EVS; } @@ -193,11 +185,7 @@ void tcxFormantEnhancement( { fac = add( fac0, mult( d, extract_l( L_mult0( j, inv_int[n] ) ) ) ); BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB xn_buf[l + j] = s_min( xn_one, shl_sat( mult( xn_buf[l + j], fac ), fac_e ) ); -#else - xn_buf[l + j] = s_min( xn_one, shl( mult( xn_buf[l + j], fac ), fac_e ) ); -#endif move16(); BASOP_SATURATE_WARNING_ON_EVS; } @@ -322,11 +310,7 @@ void tcxFormantEnhancement_with_shift( { fac = add( fac0, mult( d, extract_l( L_mult0( j, inv_int[n] ) ) ) ); BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB xn_buf[l + j] = s_min( xn_one, shl_o( mult( xn_buf[l + j], fac ), fac_e, &Overflow ) ); -#else - xn_buf[l + j] = s_min( xn_one, shl( mult( xn_buf[l + j], fac ), fac_e ) ); -#endif move16(); BASOP_SATURATE_WARNING_ON_EVS; } @@ -371,11 +355,7 @@ void tcxFormantEnhancement_with_shift( { fac = add( fac0, mult( d, extract_l( L_mult0( j, inv_int[n] ) ) ) ); BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB xn_buf[l + j] = s_min( xn_one, shl_o( mult( xn_buf[l + j], fac ), fac_e, &Overflow ) ); -#else - xn_buf[l + j] = s_min( xn_one, shl( mult( xn_buf[l + j], fac ), fac_e ) ); -#endif move16(); BASOP_SATURATE_WARNING_ON_EVS; } diff --git a/lib_com/deemph.c b/lib_com/deemph.c index 3f60bf44c..3ea9ba08b 100644 --- a/lib_com/deemph.c +++ b/lib_com/deemph.c @@ -104,25 +104,15 @@ void deemph_fx( #endif L_tmp = L_deposit_h( signal[0] ); /*Qx+16*/ -#ifdef BASOP_NOGLOB L_tmp = L_mac_o( L_tmp, *mem, mu, &Overflow ); /*Qx+16*/ signal[0] = round_fx_o( L_tmp, &Overflow ); /*Qx*/ -#else - L_tmp = L_mac( L_tmp, *mem, mu ); - signal[0] = round_fx( L_tmp ); -#endif move16(); FOR( i = 1; i < L; i++ ) { L_tmp = L_deposit_h( signal[i] ); /*Qx+16*/ -#ifdef BASOP_NOGLOB L_tmp = L_mac_o( L_tmp, signal[i - 1], mu, &Overflow ); /*Qx+16*/ signal[i] = round_fx_o( L_tmp, &Overflow ); /*Qx*/ -#else /* BASOP_NOGLOB */ - L_tmp = L_mac( L_tmp, signal[i - 1], mu ); - signal[i] = round_fx( L_tmp ); -#endif /* BASOP_NOGLOB */ move16(); } @@ -159,11 +149,7 @@ void Deemph2( FOR( i = 1; i < L; i++ ) { L_tmp = L_mult( x[i], 16384 /*0.5f in Q15*/ ); /*Qx+16*/ -#ifdef BASOP_NOGLOB x[i] = mac_ro( L_tmp, x[i - 1], mu, &Overflow ); /*Qx-1*/ -#else - x[i] = mac_r( L_tmp, x[i - 1], mu ); -#endif move16(); } @@ -206,13 +192,8 @@ void E_UTIL_deemph2( Word16 shift, Word16 *x, const Word16 mu, const Word16 L, W shift = shr( -32768, shift ); /*Q15 - shift*/ FOR( i = 0; i < L; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_msu_o( Mpy_32_16_1( L_tmp, mu ), x[i], shift, &Overflow ); /*Qx-shift+16*/ x[i] = round_fx_o( L_tmp, &Overflow ); /*Qx-shift*/ -#else - L_tmp = L_msu( Mpy_32_16_1( L_tmp, mu ), x[i], shift ); - x[i] = round_fx( L_tmp ); -#endif move16(); } } @@ -220,13 +201,8 @@ void E_UTIL_deemph2( Word16 shift, Word16 *x, const Word16 mu, const Word16 L, W { FOR( i = 0; i < L; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_msu_o( Mpy_32_16_1( L_tmp, mu ), shr_o( x[i], shift, &Overflow ), -32768 /*1.0f in Q15*/, &Overflow ); /*Qx-shift+16*/ x[i] = round_fx_o( L_tmp, &Overflow ); /*Qx-shift*/ -#else /* BASOP_NOGLOB */ - L_tmp = L_msu( Mpy_32_16_1( L_tmp, mu ), shr( x[i], shift ), -32768 ); - x[i] = round_fx( L_tmp ); -#endif move16(); } } diff --git a/lib_com/edct_fx.c b/lib_com/edct_fx.c index 301b66666..3cb33b7c5 100644 --- a/lib_com/edct_fx.c +++ b/lib_com/edct_fx.c @@ -458,22 +458,12 @@ void edct_16fx( i2 = shl( i, 1 ); L_tmp = L_mult( x[i2], edct_table[i] ); /*Q(Qx+16) */ -#ifdef BASOP_NOGLOB Lacc = L_mac_o( L_tmp, *px, *pt, &Overflow ); /*Q(Qx+16) */ re2[i] = round_fx_o( L_shl_o( Lacc, Q_edct, &Overflow ), &Overflow ); /* Q(Qx+Q_edct) */ -#else - Lacc = L_mac( L_tmp, *px, *pt ); /*Q(Qx+16) */ - re2[i] = round_fx( L_shl( Lacc, Q_edct ) ); /* Q(Qx+Q_edct) */ -#endif move16(); L_tmp = L_mult( *px, edct_table[i] ); /*Q(Qx+16) */ -#ifdef BASOP_NOGLOB Lacc = L_msu_o( L_tmp, x[i2], *pt, &Overflow ); /*Q(Qx+16) */ im2[i] = round_fx_o( L_shl_o( Lacc, Q_edct, &Overflow ), &Overflow ); /* Q(Qx+Q_edct) */ -#else - Lacc = L_msu( L_tmp, x[i2], *pt ); /*Q(Qx+16) */ - im2[i] = round_fx( L_shl( Lacc, Q_edct ) ); /* Q(Qx+Q_edct) */ -#endif move16(); px -= 2; pt--; @@ -499,22 +489,12 @@ void edct_16fx( FOR( i = 0; i < shr( length, 1 ); i++ ) { tmp = mult_r( im2[i], fact ); /*Q(Qx+Q_edct) */ -#ifdef BASOP_NOGLOB re[i] = sub_o( re2[i], tmp, &Overflow ); /*Q(Qx+Q_edct) */ move16(); -#else - re[i] = sub( re2[i], tmp ); /*Q(Qx+Q_edct) */ - move16(); -#endif tmp = mult_r( re2[i], fact ); /*Q(Qx+Q_edct) */ -#ifdef BASOP_NOGLOB im[i] = add_o( im2[i], tmp, &Overflow ); /*Q(Qx+Q_edct) */ move16(); -#else - im[i] = add( im2[i], tmp ); /*Q(Qx+Q_edct) */ - move16(); -#endif } /* Post-rotate and obtain the output data */ @@ -525,22 +505,13 @@ void edct_16fx( i2 = shl( i, 1 ); L_tmp = L_mult( re[i], edct_table[i] ); /*Q(Qx+Q_edct+16) */ -#ifdef BASOP_NOGLOB Lacc = L_mac_o( L_tmp, im[i], *pt, &Overflow ); /*Q(Qx+Q_edct+16) */ y[i2] = round_fx_o( L_shr_o( Lacc, Q_edct, &Overflow ), &Overflow ); /* Q(Qx) */ -#else /* BASOP_NOGLOB */ - Lacc = L_mac( L_tmp, im[i], *pt ); /*Q(Qx+Q_edct+16) */ - y[i2] = round_fx( L_shr( Lacc, Q_edct ) ); /* Q(Qx) */ -#endif /* BASOP_NOGLOB */ move16(); L_tmp = L_mult( re[i], edct_table[sub( shr( length, 1 ), add( 1, i ) )] ); /*Q(Qx+Q_edct+16) */ Lacc = L_msu( L_tmp, im[i], edct_table[i] ); /*Q(Qx+Q_edct+16) */ -#ifdef BASOP_NOGLOB *py = round_fx_o( L_shr_o( Lacc, Q_edct, &Overflow ), &Overflow ); /* Q(Qx) */ -#else /* BASOP_NOGLOB */ - *py = round_fx( L_shr( Lacc, Q_edct ) ); /* Q(Qx) */ -#endif move16(); py -= 2; diff --git a/lib_com/enh1632.c b/lib_com/enh1632.c index 04c22ae97..bac18231e 100644 --- a/lib_com/enh1632.c +++ b/lib_com/enh1632.c @@ -376,21 +376,13 @@ Word32 L_lshr( Word32 L_var1, Word16 var2 ) * the range : 0xffff 8000 <= var_out <= 0x0000 7fff. * *****************************************************************************/ -#ifdef BASOP_NOGLOB Word16 shl_ro( Word16 var1, Word16 var2, Flag *Overflow ) -#else -Word16 shl_r( Word16 var1, Word16 var2 ) -#endif { Word16 var_out; if ( var2 >= 0 ) { -#ifdef BASOP_NOGLOB var_out = shl_o( var1, var2, Overflow ); -#else - var_out = shl( var1, var2 ); -#endif #ifdef WMOPS multiCounter[currCounter].shl--; #endif /* ifdef WMOPS */ @@ -398,11 +390,7 @@ Word16 shl_r( Word16 var1, Word16 var2 ) else { var2 = -var2; -#ifdef BASOP_NOGLOB var_out = shr_ro( var1, var2, Overflow ); -#else - var_out = shr_r( var1, var2 ); -#endif #ifdef WMOPS multiCounter[currCounter].shr_r--; #endif /* ifdef WMOPS */ @@ -414,12 +402,10 @@ Word16 shl_r( Word16 var1, Word16 var2 ) return ( var_out ); } -#ifdef BASOP_NOGLOB Word16 shl_r( Word16 var1, Word16 var2 ) { return shl_ro( var1, var2, NULL ); } -#endif /***************************************************************************** * * Function Name : L_shl_r diff --git a/lib_com/enh1632.h b/lib_com/enh1632.h index eed55ccad..10c10866a 100644 --- a/lib_com/enh1632.h +++ b/lib_com/enh1632.h @@ -40,9 +40,7 @@ * Prototypes for enhanced 16/32 bit arithmetic operators * *****************************************************************************/ -#ifdef BASOP_NOGLOB Word16 shl_ro( Word16 var1, Word16 var2, Flag *Overflow ); -#endif Word16 shl_r( Word16 var1, Word16 var2 ); Word32 L_shl_r( Word32 L_var1, Word16 var2 ); diff --git a/lib_com/enh32.c b/lib_com/enh32.c index 64afe8986..cf40bbec9 100644 --- a/lib_com/enh32.c +++ b/lib_com/enh32.c @@ -76,11 +76,7 @@ Word32 Mpy_32_32( Word32 L_var1, Word32 L_var2 ) #endif L64_var1 = ( (Word64) L_var1 * L_var2 ); -#ifdef BASOP_NOGLOB L64_var1 = W_shl_o( L64_var1, 1, &Overflow ); -#else /* BASOP_NOGLOB */ - L64_var1 = W_shl( L64_var1, 1 ); -#endif /* BASOP_NOGLOB */ L_var_out = W_extract_h( L64_var1 ); #ifdef WMOPS multiCounter[currCounter].Mpy_32_32++; @@ -114,11 +110,7 @@ Word32 Madd_32_16( Word32 L_var3, Word32 L_var1, Word16 var2 ) #endif L_var_out = Mpy_32_16_1( L_var1, var2 ); -#ifdef BASOP_NOGLOB L_var_out = L_add_o( L_var3, L_var_out, &Overflow ); -#else /* BASOP_NOGLOB */ - L_var_out = L_add( L_var3, L_var_out ); -#endif /* BASOP_NOGLOB */ #ifdef WMOPS multiCounter[currCounter].Mpy_32_16_1--; @@ -151,11 +143,7 @@ Word32 Msub_32_16( Word32 L_var3, Word32 L_var1, Word16 var2 ) #endif L_var_out = Mpy_32_16_1( L_var1, var2 ); -#ifdef BASOP_NOGLOB L_var_out = L_sub_o( L_var3, L_var_out, &Overflow ); -#else /* BASOP_NOGLOB */ - L_var_out = L_sub( L_var3, L_var_out ); -#endif #ifdef WMOPS multiCounter[currCounter].Mpy_32_16_1--; diff --git a/lib_com/enh40.c b/lib_com/enh40.c index 929e3a950..89960030f 100644 --- a/lib_com/enh40.c +++ b/lib_com/enh40.c @@ -96,9 +96,7 @@ #include #include #include "stl.h" -#ifdef BASOP_NOGLOB #include -#endif /* BASOP_NOGLOB */ #define WMC_TOOL_SKIP @@ -160,11 +158,7 @@ * the range : MIN_40 <= L40_var_out <= MAX_40. * *****************************************************************************/ -#ifndef BASOP_NOGLOB -Word40 L40_shl( Word40 L40_var1, Word16 var2 ) -#else /* BASOP_NOGLOB */ Word40 L40_shl_o( Word40 L40_var1, Word16 var2, Flag *Overflow ) -#endif /* BASOP_NOGLOB */ { Word40 L40_var_out; @@ -194,27 +188,15 @@ Word40 L40_shl_o( Word40 L40_var1, Word16 var2, Flag *Overflow ) if ( L40_var_out > 0x003fffffffffLL ) #endif { -#ifndef BASOP_NOGLOB - Overflow = 1; - exit( 1 ); - /* L40_var_out = L40_OVERFLOW_OCCURED( L40_var_out); */ -#else /* BASOP_NOGLOB */ *Overflow = 1; L40_var_out = MAX_40; -#endif /* BASOP_NOGLOB */ break; } else if ( L40_var_out < L40_constant ) { -#ifndef BASOP_NOGLOB - Overflow = 1; - exit( 2 ); - /* L40_var_out = L40_UNDERFLOW_OCCURED( L40_var_out); */ -#else /* BASOP_NOGLOB */ *Overflow = 1; L40_var_out = MIN_40; -#endif /* BASOP_NOGLOB */ break; } @@ -234,7 +216,6 @@ Word40 L40_shl_o( Word40 L40_var1, Word16 var2, Flag *Overflow ) return ( L40_var_out ); } -#ifdef BASOP_NOGLOB Word40 L40_shl( Word40 L40_var1, Word16 var2 ) { @@ -293,7 +274,6 @@ Word40 L40_shl( Word40 L40_var1, Word16 var2 ) return ( L40_var_out ); } -#endif /* BASOP_NOGLOB */ /***************************************************************************** * @@ -422,7 +402,6 @@ Word40 L40_negate( Word40 L40_var1 ) * the range : MIN_40 <= L40_var_out <= MAX_40. * *****************************************************************************/ -#ifdef BASOP_NOGLOB Word40 L40_add_o( Word40 L40_var1, Word40 L40_var2, Flag *Overflow ) { @@ -465,7 +444,6 @@ Word40 L40_add_o( Word40 L40_var1, Word40 L40_var2, Flag *Overflow ) return ( L40_var_out ); } -#endif /* BASOP_NOGLOB */ Word40 L40_add( Word40 L40_var1, Word40 L40_var2 ) { Word40 L40_var_out; @@ -475,48 +453,24 @@ Word40 L40_add( Word40 L40_var1, Word40 L40_var2 ) #if defined( _MSC_VER ) && ( _MSC_VER <= 1200 ) if ( ( ( ( L40_var1 & 0x8000000000 ) >> 39 ) != 0 ) && ( ( ( L40_var2 & 0x8000000000 ) >> 39 ) != 0 ) && ( ( ( L40_var_out & 0x8000000000 ) >> 39 ) == 0 ) ) { -#ifndef BASOP_NOGLOB - Overflow = 1; - exit( 2 ); - /* L40_var_out = L40_UNDERFLOW_OCCURED( L40_var_out); */ -#else /* BASOP_NOGLOB */ assert( 0 ); L40_var_out = MIN_40; -#endif /* BASOP_NOGLOB */ } else if ( ( ( ( L40_var1 & 0x8000000000 ) >> 39 ) == 0 ) && ( ( ( L40_var2 & 0x8000000000 ) >> 39 ) == 0 ) && ( ( ( L40_var_out & 0x8000000000 ) >> 39 ) != 0 ) ) { -#ifndef BASOP_NOGLOB - Overflow = 1; - exit( 1 ); - /* L40_var_out = L40_OVERFLOW_OCCURED( L40_var_out); */ -#else /* BASOP_NOGLOB */ assert( 0 ); L40_var_out = MAX_40; -#endif /* BASOP_NOGLOB */ } #else if ( ( ( ( L40_var1 & 0x8000000000LL ) >> 39 ) != 0 ) && ( ( ( L40_var2 & 0x8000000000LL ) >> 39 ) != 0 ) && ( ( ( L40_var_out & 0x8000000000LL ) >> 39 ) == 0 ) ) { -#ifndef BASOP_NOGLOB - Overflow = 1; - exit( 2 ); - /* L40_var_out = L40_UNDERFLOW_OCCURED( L40_var_out); */ -#else /* BASOP_NOGLOB */ assert( 0 ); L40_var_out = MIN_40; -#endif /* BASOP_NOGLOB */ } else if ( ( ( ( L40_var1 & 0x8000000000LL ) >> 39 ) == 0 ) && ( ( ( L40_var2 & 0x8000000000LL ) >> 39 ) == 0 ) && ( ( ( L40_var_out & 0x8000000000LL ) >> 39 ) != 0 ) ) { -#ifndef BASOP_NOGLOB - Overflow = 1; - exit( 1 ); - /* L40_var_out = L40_OVERFLOW_OCCURED( L40_var_out); */ -#else /* BASOP_NOGLOB */ assert( 0 ); L40_var_out = MAX_40; -#endif /* BASOP_NOGLOB */ } #endif @@ -561,11 +515,7 @@ Word40 L40_add( Word40 L40_var1, Word40 L40_var2 ) * the range : MIN_40 <= L40_var_out <= MAX_40. * *****************************************************************************/ -#ifndef BASOP_NOGLOB -Word40 L40_sub( Word40 L40_var1, Word40 L40_var2 ) -#else /* BASOP_NOGLOB */ Word40 L40_sub_o( Word40 L40_var1, Word40 L40_var2, Flag *Overflow ) -#endif /* BASOP_NOGLOB */ { Word40 L40_var_out; @@ -574,48 +524,24 @@ Word40 L40_sub_o( Word40 L40_var1, Word40 L40_var2, Flag *Overflow ) #if defined( _MSC_VER ) && ( _MSC_VER <= 1200 ) if ( ( ( ( L40_var1 & 0x8000000000 ) >> 39 ) != 0 ) && ( ( ( L40_var2 & 0x8000000000 ) >> 39 ) == 0 ) && ( ( ( L40_var_out & 0x8000000000 ) >> 39 ) == 0 ) ) { -#ifndef BASOP_NOGLOB - Overflow = 1; - exit( 2 ); - /* L40_var_out = L40_UNDERFLOW_OCCURED( L40_var_out); */ -#else /* BASOP_NOGLOB */ *Overflow = 1; L40_var_out = MIN_40; -#endif /* BASOP_NOGLOB */ } else if ( ( ( ( L40_var1 & 0x8000000000 ) >> 39 ) == 0 ) && ( ( ( L40_var2 & 0x8000000000 ) >> 39 ) != 0 ) && ( ( ( L40_var_out & 0x8000000000 ) >> 39 ) != 0 ) ) { -#ifndef BASOP_NOGLOB - Overflow = 1; - exit( 1 ); - /* L40_var_out = L40_OVERFLOW_OCCURED( L40_var_out); */ -#else /* BASOP_NOGLOB */ *Overflow = 1; L40_var_out = MAX_40; -#endif /* BASOP_NOGLOB */ } #else if ( ( ( ( L40_var1 & 0x8000000000LL ) >> 39 ) != 0 ) && ( ( ( L40_var2 & 0x8000000000LL ) >> 39 ) == 0 ) && ( ( ( L40_var_out & 0x8000000000LL ) >> 39 ) == 0 ) ) { -#ifndef BASOP_NOGLOB - Overflow = 1; - exit( 2 ); - /* L40_var_out = L40_UNDERFLOW_OCCURED( L40_var_out); */ -#else /* BASOP_NOGLOB */ *Overflow = 1; L40_var_out = MIN_40; -#endif /* BASOP_NOGLOB */ } else if ( ( ( ( L40_var1 & 0x8000000000LL ) >> 39 ) == 0 ) && ( ( ( L40_var2 & 0x8000000000LL ) >> 39 ) != 0 ) && ( ( ( L40_var_out & 0x8000000000LL ) >> 39 ) != 0 ) ) { -#ifndef BASOP_NOGLOB - Overflow = 1; - exit( 1 ); - /* L40_var_out = L40_OVERFLOW_OCCURED( L40_var_out); */ -#else /* BASOP_NOGLOB */ *Overflow = 1; L40_var_out = MAX_40; -#endif /* BASOP_NOGLOB */ } #endif @@ -629,7 +555,6 @@ Word40 L40_sub_o( Word40 L40_var1, Word40 L40_var2, Flag *Overflow ) return ( L40_var_out ); } -#ifdef BASOP_NOGLOB Word40 L40_sub( Word40 L40_var1, Word40 L40_var2 ) { Word40 L40_var_out; @@ -669,7 +594,6 @@ Word40 L40_sub( Word40 L40_var1, Word40 L40_var2 ) return ( L40_var_out ); } -#endif /* BASOP_NOGLOB */ /***************************************************************************** * @@ -838,12 +762,8 @@ Word40 L40_min( Word40 L40_var1, Word40 L40_var2 ) * the range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. * *****************************************************************************/ -#ifndef BASOP_NOGLOB -Word32 L_saturate40( Word40 L40_var1 ) -#else /* BASOP_NOGLOB */ Word32 L_saturate40_o( Word40 L40_var1, Flag *Overflow ) -#endif /* BASOP_NOGLOB */ { Word32 L_var_out; @@ -853,21 +773,13 @@ Word32 L_saturate40_o( Word40 L40_var1, Flag *Overflow ) if ( L40_var1 < UNDER_L40_var2 ) { L40_var1 = UNDER_L40_var2; -#ifndef BASOP_NOGLOB - Overflow = 1; -#else /* BASOP_NOGLOB */ *Overflow = 1; -#endif /* BASOP_NOGLOB */ } if ( L40_var1 > OVER_L40_var2 ) { L40_var1 = OVER_L40_var2; -#ifndef BASOP_NOGLOB - Overflow = 1; -#else /* BASOP_NOGLOB */ *Overflow = 1; -#endif /* BASOP_NOGLOB */ } L_var_out = L_Extract40( L40_var1 ); @@ -882,7 +794,6 @@ Word32 L_saturate40_o( Word40 L40_var1, Flag *Overflow ) return ( L_var_out ); } -#ifdef BASOP_NOGLOB Word32 L_saturate40( Word40 L40_var1 ) { Word32 L_var_out; @@ -913,7 +824,6 @@ Word32 L_saturate40( Word40 L40_var1 ) return ( L_var_out ); } -#endif /* BASOP_NOGLOB */ /***************************************************************************** * diff --git a/lib_com/enh40.h b/lib_com/enh40.h index ca78cb33e..ff1a86b92 100644 --- a/lib_com/enh40.h +++ b/lib_com/enh40.h @@ -56,10 +56,8 @@ #include "stl.h" -#if defined( BASOP_NOGLOB ) || defined( _MSC_VER ) #define MAX_40 ( 0x0000007fffffffff ) #define MIN_40 ( 0xffffff8000000000 ) -#endif #define L40_OVERFLOW_OCCURED( L40_var1 ) ( Overflow = 1, exit( 1 ), L40_var1 ) #define L40_UNDERFLOW_OCCURED( L40_var1 ) ( Overflow = 1, exit( 2 ), L40_var1 ) @@ -111,7 +109,6 @@ Word40 L40_max( Word40 L40_var1, Word40 L40_var2 ); Word40 L40_min( Word40 L40_var1, Word40 L40_var2 ); Word32 L_saturate40( Word40 L40_var1 ); Word16 norm_L40( Word40 L40_var1 ); -#ifdef BASOP_NOGLOB /* * Overflowing operators */ @@ -119,7 +116,6 @@ Word40 L40_shl_o( Word40 L40_var1, Word16 var2, Flag *Overflow ); Word40 L40_add_o( Word40 L40_var1, Word40 L40_var2, Flag *Overflow ); Word40 L40_sub_o( Word40 L40_var1, Word40 L40_var2, Flag *Overflow ); Word32 L_saturate40_o( Word40 L40_var1, Flag *Overflow ); -#endif /* BASOP_NOGLOB */ /*#ifdef _MSC_VER*/ static __inline Word40 L40_set( Word40 L40_var1 ) { diff --git a/lib_com/enh64.c b/lib_com/enh64.c index 9eb58c4d3..8bffb620c 100644 --- a/lib_com/enh64.c +++ b/lib_com/enh64.c @@ -161,11 +161,7 @@ Word64 W_sub_nosat( Word64 L64_var1, Word64 L64_var2 ) | range : 0x80000000 00000000LL <= L64_var1 <= 0x7fffffff ffffffffLL. | |___________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word64 W_shl_o( Word64 L64_var1, Word16 var2, Flag *Overflow ) -#else /* BASOP_NOGLOB */ -Word64 W_shl( Word64 L64_var1, Word16 var2 ) -#endif /* BASOP_NOGLOB */ { Word64 L64_var_out = 0LL; @@ -183,11 +179,7 @@ Word64 W_shl( Word64 L64_var1, Word16 var2 ) { if ( L64_var1 > (Word64) 0X3fffffffffffffffLL ) { -#ifdef BASOP_NOGLOB set_overflow( Overflow ); -#else /* BASOP_NOGLOB */ - Overflow = 1; -#endif /* BASOP_NOGLOB */ L64_var_out = (Word64) 0X7fffffffffffffffLL; break; } @@ -195,11 +187,7 @@ Word64 W_shl( Word64 L64_var1, Word16 var2 ) { if ( L64_var1 < (Word64) 0xc000000000000000LL ) { -#ifdef BASOP_NOGLOB set_overflow( Overflow ); -#else /* BASOP_NOGLOB */ - Overflow = 1; -#endif /* BASOP_NOGLOB */ L64_var_out = (Word64) 0x8000000000000000LL; break; } @@ -217,12 +205,10 @@ Word64 W_shl( Word64 L64_var1, Word16 var2 ) return ( L64_var_out ); } -#ifdef BASOP_NOGLOB Word64 W_shl( Word64 L64_var1, Word16 var2 ) { return W_shl_o( L64_var1, var2, NULL ); } -#endif /* BASOP_NOGLOB */ /*___________________________________________________________________________ @@ -1185,11 +1171,7 @@ Word32 W_shl_sat_l( Word64 L64_var, Word16 n ) | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | |__________________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word32 W_round48_L_o( Word64 L64_var1, Flag *Overflow ) -#else /* BASOP_NOGLOB */ -Word32 W_round48_L( Word64 L64_var1 ) -#endif /* BASOP_NOGLOB */ { Word64 L64_var_out; Word32 L_result; @@ -1207,11 +1189,7 @@ Word32 W_round48_L( Word64 L64_var1 ) if ( ( L64_var_out ^ L64_var1 ) & L64_MIN ) { L64_var_out = ( L64_var1 < 0 ) ? L64_MIN : L64_MAX; -#ifdef BASOP_NOGLOB set_overflow( Overflow ); -#else /* BASOP_NOGLOB */ - Overflow = 1; -#endif /* BASOP_NOGLOB */ } } L_result = W_extract_h( L64_var_out ); @@ -1224,12 +1202,10 @@ Word32 W_round48_L( Word64 L64_var1 ) return ( L_result ); } -#ifdef BASOP_NOGLOB Word32 W_round48_L( Word64 L64_var1 ) { return W_round48_L_o( L64_var1, NULL ); } -#endif /* BASOP_NOGLOB */ /*__________________________________________________________________________________ | | @@ -1258,11 +1234,7 @@ Word32 W_round48_L( Word64 L64_var1 ) | range : 0xffff 8000 <= var_out <= 0x0000 7fff. | |__________________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word16 W_round32_s_o( Word64 L64_var1, Flag *Overflow ) -#else /* BASOP_NOGLOB */ -Word16 W_round32_s( Word64 L64_var1 ) -#endif /* BASOP_NOGLOB */ { Word64 L64_var_out; Word32 L_var; @@ -1281,11 +1253,7 @@ Word16 W_round32_s( Word64 L64_var1 ) if ( ( L64_var_out ^ L64_var1 ) & L64_MIN ) { L64_var_out = ( L64_var1 < 0 ) ? L64_MIN : L64_MAX; -#ifdef BASOP_NOGLOB set_overflow( Overflow ); -#else /* BASOP_NOGLOB */ - Overflow = 1; -#endif /* BASOP_NOGLOB */ } } L_var = W_extract_h( L64_var_out ); @@ -1300,12 +1268,10 @@ Word16 W_round32_s( Word64 L64_var1 ) return ( var_out ); } -#ifdef BASOP_NOGLOB Word16 W_round32_s( Word64 L64_var1 ) { return W_round32_s_o( L64_var1, NULL ); } -#endif /* BASOP_NOGLOB */ /*___________________________________________________________________________ | | @@ -1398,11 +1364,7 @@ Word16 W_norm( Word64 L64_var1 ) | range : 0x80000000 00000000LL <= L64_var1 <= 0x7fffffff ffffffffLL. | |_______________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word64 W_add_o( Word64 L64_var1, Word64 L64_var2, Flag *Overflow ) -#else /* BASOP_NOGLOB */ -Word64 W_add( Word64 L64_var1, Word64 L64_var2 ) -#endif /* BASOP_NOGLOB */ { Word64 L64_var_out; @@ -1413,11 +1375,7 @@ Word64 W_add( Word64 L64_var1, Word64 L64_var2 ) if ( ( L64_var_out ^ L64_var1 ) & MIN_64 ) { L64_var_out = ( L64_var1 < 0 ) ? MIN_64 : MAX_64; -#ifdef BASOP_NOGLOB set_overflow( Overflow ); -#else /* BASOP_NOGLOB */ - Overflow = 1; -#endif /* BASOP_NOGLOB */ } } @@ -1427,12 +1385,10 @@ Word64 W_add( Word64 L64_var1, Word64 L64_var2 ) return L64_var_out; } -#ifdef BASOP_NOGLOB Word64 W_add( Word64 L64_var1, Word64 L64_var2 ) { return W_add_o( L64_var1, L64_var2, NULL ); } -#endif /* BASOP_NOGLOB */ /*______________________________________________________________________________ | | @@ -1465,11 +1421,7 @@ Word64 W_add( Word64 L64_var1, Word64 L64_var2 ) | range : 0x80000000 00000000LL <= L64_var1 <= 0x7fffffff ffffffffLL. | |_______________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word64 W_sub_o( Word64 L64_var1, Word64 L64_var2, Flag *Overflow ) -#else /* BASOP_NOGLOB */ -Word64 W_sub( Word64 L64_var1, Word64 L64_var2 ) -#endif /* BASOP_NOGLOB */ { Word64 L64_var_out; @@ -1480,11 +1432,7 @@ Word64 W_sub( Word64 L64_var1, Word64 L64_var2 ) if ( ( L64_var_out ^ L64_var1 ) & MIN_64 ) { L64_var_out = ( L64_var1 < 0 ) ? MIN_64 : MAX_64; -#ifdef BASOP_NOGLOB set_overflow( Overflow ); -#else /* BASOP_NOGLOB */ - Overflow = 1; -#endif /* BASOP_NOGLOB */ } } @@ -1494,12 +1442,10 @@ Word64 W_sub( Word64 L64_var1, Word64 L64_var2 ) return L64_var_out; } -#ifdef BASOP_NOGLOB Word64 W_sub( Word64 L64_var1, Word64 L64_var2 ) { return W_sub_o( L64_var1, L64_var2, NULL ); } -#endif /* BASOP_NOGLOB */ /*______________________________________________________________________________ @@ -1529,22 +1475,14 @@ Word64 W_sub( Word64 L64_var1, Word64 L64_var2 ) | range : 0x80000000 00000000LL <= L64_var1 <= 0x7fffffff ffffffffLL. | |_______________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word64 W_neg_o( Word64 L64_var1, Flag *Overflow ) -#else /* BASOP_NOGLOB */ -Word64 W_neg( Word64 L64_var1 ) -#endif /* BASOP_NOGLOB */ { Word64 L64_var_out; if ( L64_var1 == MIN_64 ) { L64_var_out = MAX_64; -#ifdef BASOP_NOGLOB set_overflow( Overflow ); -#else /* BASOP_NOGLOB */ - Overflow = 1; -#endif /* BASOP_NOGLOB */ } else { @@ -1558,12 +1496,10 @@ Word64 W_neg( Word64 L64_var1 ) return ( L64_var_out ); } -#ifdef BASOP_NOGLOB Word64 W_neg( Word64 L64_var1 ) { return W_neg_o( L64_var1, NULL ); } -#endif /* BASOP_NOGLOB */ /*___________________________________________________________________________ @@ -1593,22 +1529,14 @@ Word64 W_neg( Word64 L64_var1 ) | range : 0x80000000 00000000LL <= L64_var1 <= 0x7fffffff ffffffffLL. | |___________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word64 W_abs_o( Word64 L64_var1, Flag *Overflow ) -#else /* BASOP_NOGLOB */ -Word64 W_abs( Word64 L64_var1 ) -#endif /* BASOP_NOGLOB */ { Word64 L64_var_out; if ( L64_var1 == MIN_64 ) { L64_var_out = MAX_64; -#ifdef BASOP_NOGLOB set_overflow( Overflow ); -#else /* BASOP_NOGLOB */ - Overflow = 1; -#endif /* BASOP_NOGLOB */ } else { @@ -1629,12 +1557,10 @@ Word64 W_abs( Word64 L64_var1 ) return ( L64_var_out ); } -#ifdef BASOP_NOGLOB Word64 W_abs( Word64 L64_var1 ) { return W_abs_o( L64_var1, NULL ); } -#endif /* BASOP_NOGLOB */ /*_________________________________________________________________________________________________ | | @@ -1668,22 +1594,14 @@ Word64 W_abs( Word64 L64_var1 ) | range : 0x80000000 00000000LL <= L64_var_out <= 0x7fffffff ffffffffLL. | |_________________________________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word64 W_mult_32_32_o( Word32 L_var1, Word32 L_var2, Flag *Overflow ) -#else /* BASOP_NOGLOB */ -Word64 W_mult_32_32( Word32 L_var1, Word32 L_var2 ) -#endif /* BASOP_NOGLOB */ { Word64 L64_var_out; if ( ( L_var1 == MIN_32 ) && ( L_var2 == MIN_32 ) ) { L64_var_out = MAX_64; -#ifdef BASOP_NOGLOB set_overflow( Overflow ); -#else /* BASOP_NOGLOB */ - Overflow = 1; -#endif /* BASOP_NOGLOB */ } else { @@ -1696,12 +1614,10 @@ Word64 W_mult_32_32( Word32 L_var1, Word32 L_var2 ) return L64_var_out; } -#ifdef BASOP_NOGLOB Word64 W_mult_32_32( Word32 L_var1, Word32 L_var2 ) { return W_mult_32_32_o( L_var1, L_var2, NULL ); } -#endif /* BASOP_NOGLOB */ /*_________________________________________________________________________________________________ | | diff --git a/lib_com/enh64.h b/lib_com/enh64.h index 8aed870a6..c3896bb0d 100644 --- a/lib_com/enh64.h +++ b/lib_com/enh64.h @@ -65,7 +65,6 @@ UWord64 W_lshl( UWord64 L64_var1, Word16 var2 ); UWord64 W_lshr( UWord64 L64_var1, Word16 var2 ); Word32 W_round64_L( Word64 L64_var1 ); -#ifdef BASOP_NOGLOB /* * Overflowing operators */ @@ -77,7 +76,6 @@ Word64 W_sub_o( Word64 L64_var1, Word64 L64_var2, Flag *Overflow ); Word64 W_neg_o( Word64 L64_var1, Flag *Overflow ); Word64 W_abs_o( Word64 L64_var1, Flag *Overflow ); Word64 W_mult_32_32_o( Word32 L_var1, Word32 L_var2, Flag *Overflow ); -#endif /* BASOP_NOGLOB */ #endif /* #ifdef ENH_64_BIT_OPERATOR */ diff --git a/lib_com/enhancer_fx.c b/lib_com/enhancer_fx.c index 88bc70497..7df474a5d 100644 --- a/lib_com/enhancer_fx.c +++ b/lib_com/enhancer_fx.c @@ -137,11 +137,7 @@ void enhancer_fx( *-----------------------------------------------------------*/ /* tmp = 0.5f * (1.0f - voice_fac) */ -#ifdef BASOP_NOGLOB tmp = msu_r_sat( 0x40000000 /*0.5.Q31*/, voice_fac, 16384 /*0.5.Q15*/ ); /*Q15 */ /* 1=unvoiced, 0=voiced */ -#else - tmp = msu_r( 0x40000000, voice_fac, 16384 ); /*Q15 */ /* 1=unvoiced, 0=voiced */ -#endif /* fac = stab_fac * tmp */ fac = mult( stab_fac, tmp ); /*Q15*/ @@ -193,11 +189,7 @@ void enhancer_fx( test(); IF( Opt_AMR_WB && ( EQ_32( core_brate, ACELP_8k85 ) || EQ_32( core_brate, ACELP_6k60 ) ) ) { -#ifdef BASOP_NOGLOB pit_sharp = shl_sat( gain_pit, 1 ); /* saturation can occur here Q14 -> Q15 */ -#else - pit_sharp = shl( gain_pit, 1 ); /* saturation can occur here Q14 -> Q15 */ -#endif /* saturation takes care of "if (pit_sharp > 1.0) { pit_sharp=1.0; }" */ IF( GT_16( pit_sharp, 16384 /*0.5.Q15*/ ) ) { @@ -232,45 +224,27 @@ void enhancer_fx( /* pt_exc2[0] += code[0] - tmp * code[1] */ L_tmp = L_deposit_h( code[0] ); /* if Enc :Q9 * Q15 -> Q25 */ L_tmp = L_msu( L_tmp, code[1], tmp ); /* Q12 * Q15 -> Q28 */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_mult( gain_code_hi, extract_h( L_tmp ) ), sc ); pt_exc2[0] = msu_r_sat( L_tmp, -32768, pt_exc2[0] ); move16(); -#else - L_tmp = L_shl( L_mult( gain_code_hi, extract_h( L_tmp ) ), sc ); - pt_exc2[0] = msu_r( L_tmp, -32768, pt_exc2[0] ); - move16(); -#endif FOR( i = 1; i < L_SUBFR - 1; i++ ) { /* pt_exc2[i] += code[i] - tmp * code[i-1] - tmp * code[i+1] */ L_tmp = L_msu( -32768, code[i], -32768 ); L_tmp = L_msu( L_tmp, code[i + 1], tmp ); -#ifdef BASOP_NOGLOB tmp16 = msu_r_sat( L_tmp, code[i - 1], tmp ); L_tmp = L_shl_sat( L_mult( gain_code_hi, tmp16 ), sc ); pt_exc2[i] = msu_r_sat( L_tmp, -32768, pt_exc2[i] ); move16(); -#else - tmp16 = msu_r( L_tmp, code[i - 1], tmp ); - L_tmp = L_shl( L_mult( gain_code_hi, tmp16 ), sc ); - pt_exc2[i] = msu_r( L_tmp, -32768, pt_exc2[i] ); - move16(); /* in Q_exc */ -#endif } /* pt_exc2[L_SUBFR-1] += code[L_SUBFR-1] - tmp * code[L_SUBFR-2] */ L_tmp = L_deposit_h( code[L_SUBFR - 1] ); /*Q28 */ L_tmp = L_msu( L_tmp, code[L_SUBFR - 2], tmp ); /*Q28 */ L_tmp = L_shl( L_mult( gain_code_hi, extract_h( L_tmp ) ), sc ); -#ifdef BASOP_NOGLOB pt_exc2[L_SUBFR - 1] = msu_r_sat( L_tmp, -32768, pt_exc2[L_SUBFR - 1] ); move16(); -#else - pt_exc2[L_SUBFR - 1] = msu_r( L_tmp, -32768, pt_exc2[L_SUBFR - 1] ); - move16(); -#endif test(); test(); IF( Opt_AMR_WB && ( EQ_32( core_brate, ACELP_8k85 ) || EQ_32( core_brate, ACELP_6k60 ) ) ) @@ -280,11 +254,7 @@ void enhancer_fx( FOR( i = 0; i < L_SUBFR; i++ ) { /* excp[i] += pt_exc2[i] */ -#ifdef BASOP_NOGLOB excp[i] = add_sat( excp[i], pt_exc2[i] ); -#else - excp[i] = add( excp[i], pt_exc2[i] ); -#endif move16(); } agc2_fx( pt_exc2, excp, L_SUBFR ); @@ -440,11 +410,7 @@ void enhancer_ivas_fx( *-----------------------------------------------------------*/ /* tmp = 0.5f * (1.0f - voice_fac) */ -#ifdef BASOP_NOGLOB tmp = msu_r_sat( 0x40000000 /*0.5.Q31*/, voice_fac, 16384 /*0.5.Q14*/ ); /*Q15 */ /* 1=unvoiced, 0=voiced */ -#else - tmp = msu_r( 0x40000000, voice_fac, 16384 ); /*Q15 */ /* 1=unvoiced, 0=voiced */ -#endif /* fac = stab_fac * tmp */ fac = mult( stab_fac, tmp ); /*Q15*/ @@ -496,11 +462,7 @@ void enhancer_ivas_fx( test(); IF( Opt_AMR_WB && ( EQ_32( core_brate, ACELP_8k85 ) || EQ_32( core_brate, ACELP_6k60 ) ) ) { -#ifdef BASOP_NOGLOB pit_sharp = shl_sat( gain_pit, 1 ); /* saturation can occur here Q14 -> Q15 */ -#else - pit_sharp = shl( gain_pit, 1 ); /* saturation can occur here Q14 -> Q15 */ -#endif /* saturation takes care of "if (pit_sharp > 1.0) { pit_sharp=1.0; }" */ IF( GT_16( pit_sharp, 16384 /*0.5.Q15*/ ) ) { @@ -546,11 +508,7 @@ void enhancer_ivas_fx( L_tmp = L_msu( L_tmp, code[i + 1], tmp ); tmp16 = msu_r( L_tmp, code[i - 1], tmp ); L_tmp = L_shl( L_mult( gain_code_hi, tmp16 ), sc ); -#ifdef BASOP_NOGLOB pt_exc2[i] = msu_r_sat( L_tmp, -32768, pt_exc2[i] ); -#else - pt_exc2[i] = msu_r( L_tmp, -32768, pt_exc2[i] ); -#endif move16(); /* in Q_exc */ } @@ -661,11 +619,7 @@ void enhancer_ivas_fx2( *-----------------------------------------------------------*/ /* tmp = 0.5f * (1.0f - voice_fac) */ -#ifdef BASOP_NOGLOB tmp = msu_r_sat( 0x40000000 /*0.5.Q31*/, voice_fac, 16384 /*0.5.Q15*/ ); /*Q15 */ /* 1=unvoiced, 0=voiced */ -#else - tmp = msu_r( 0x40000000, voice_fac, 16384 ); /*Q15 */ /* 1=unvoiced, 0=voiced */ -#endif /* fac = stab_fac * tmp */ fac = mult( stab_fac, tmp ); /*Q15*/ @@ -717,11 +671,7 @@ void enhancer_ivas_fx2( test(); IF( Opt_AMR_WB && ( EQ_32( core_brate, ACELP_8k85 ) || EQ_32( core_brate, ACELP_6k60 ) ) ) { -#ifdef BASOP_NOGLOB pit_sharp = shl_sat( gain_pit, 1 ); /* saturation can occur here Q14 -> Q15 */ -#else - pit_sharp = shl( gain_pit, 1 ); /* saturation can occur here Q14 -> Q15 */ -#endif /* saturation takes care of "if (pit_sharp > 1.0) { pit_sharp=1.0; }" */ IF( GT_16( pit_sharp, 16384 /*0.5.Q15*/ ) ) { @@ -788,11 +738,7 @@ void enhancer_ivas_fx2( FOR( i = 0; i < L_SUBFR; i++ ) { /* excp[i] += pt_exc2[i] */ -#ifdef BASOP_NOGLOB excp[i] = add_sat( excp[i], pt_exc2[i] ); -#else - excp[i] = add( excp[i], pt_exc2[i] ); -#endif move16(); } agc2_fx( pt_exc2, excp, L_SUBFR ); @@ -877,11 +823,7 @@ Word16 E_UTIL_enhancer( /* if gain_code is computed function of energy, noise enhancer is by-passed.*/ BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB tmp = msu_r_sat( 1073741824l /*0.5f Q31*/, 16384 /*0.5f Q15*/, voice_fac ); /* 1=unvoiced, 0=voiced */ -#else /* BASOP_NOGLOB */ - tmp = msu_r( 1073741824l /*0.5f Q31*/, 16384 /*0.5f Q15*/, voice_fac ); /* 1=unvoiced, 0=voiced */ -#endif BASOP_SATURATE_WARNING_ON_EVS fac = mult_r( stab_fac, tmp ); /* fac in Q15 */ @@ -912,13 +854,8 @@ Word16 E_UTIL_enhancer( /* exponent of code: 31-16 + 15-11 - tmp + code_exp */ code_exp = sub( add( 31 - 16 + 15 - 11, code_exp ), tmp ); -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, tmp ); gain = round_fx_sat( L_tmp ); -#else - L_tmp = L_shl( L_tmp, tmp ); - gain = round_fx( L_tmp ); -#endif FOR( i = 0; i < L_subfr; i++ ) { @@ -948,24 +885,15 @@ Word16 E_UTIL_enhancer( L_tmp = L_msu0( L_tmp, tmp, code[1] ); IF( gain ) { -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, gain ); -#else - L_tmp = L_shl( L_tmp, gain ); -#endif } -#ifdef BASOP_NOGLOB exc2[0] = msu_r_sat( L_tmp, -32768, exc2[0] ); -#else - exc2[0] = msu_r( L_tmp, -32768, exc2[0] ); -#endif move16(); FOR( i = 1; i < L_subfr - 1; i++ ) { /* exc2[i] = exc2[i] + code[i] - tmp*(code[i+1]+code[i-1]); */ L_tmp = L_mult( code[i], 16384 ); -#ifdef BASOP_NOGLOB L_tmp = L_msu0_sat( L_tmp, tmp, code[i - 1] ); L_tmp = L_msu0_sat( L_tmp, tmp, code[i + 1] ); IF( gain ) @@ -973,34 +901,16 @@ Word16 E_UTIL_enhancer( L_tmp = L_shl_sat( L_tmp, gain ); } exc2[i] = msu_r_sat( L_tmp, -32768, exc2[i] ); -#else - L_tmp = L_msu0( L_tmp, tmp, code[i - 1] ); - L_tmp = L_msu0( L_tmp, tmp, code[i + 1] ); - if ( gain ) - { - L_tmp = L_shl( L_tmp, gain ); - } - exc2[i] = msu_r( L_tmp, -32768, exc2[i] ); -#endif move16(); } /* exc2[L_subfr-1] = exc2[L_subfr-1] + code[L_subfr-1] - tmp*code[L_subfr-2]; */ L_tmp = L_mult( code[i], 16384 ); -#ifdef BASOP_NOGLOB L_tmp = L_msu0_sat( L_tmp, tmp, code[i - 1] ); IF( gain ) { L_tmp = L_shl_sat( L_tmp, gain ); } exc2[i] = msu_r_sat( L_tmp, -32768, exc2[i] ); -#else - L_tmp = L_msu0( L_tmp, tmp, code[i - 1] ); - if ( gain ) - { - L_tmp = L_shl( L_tmp, gain ); - } - exc2[i] = msu_r( L_tmp, -32768, exc2[i] ); -#endif move16(); return code_exp; @@ -1079,11 +989,7 @@ static void phase_dispersion_fx( prev_gain_pit[0] = gain_pit; move16(); -#ifdef BASOP_NOGLOB IF( GT_32( L_sub_sat( gain_code, *prev_gain_code ), L_shl_sat( *prev_gain_code, 1 ) ) ) -#else - IF( GT_32( L_sub( gain_code, *prev_gain_code ), L_shl( *prev_gain_code, 1 ) ) ) -#endif { state = s_min( add( state, 1 ), 2 ); } @@ -1208,11 +1114,7 @@ static void agc2_fx( FOR( i = 1; i < l_trm; i++ ) { temp = shr( sig_out[i], 2 ); -#ifdef BASOP_NOGLOB s = L_mac0_sat( s, temp, temp ); -#else - s = L_mac0( s, temp, temp ); -#endif } IF( s != 0 ) { @@ -1225,11 +1127,7 @@ static void agc2_fx( FOR( i = 1; i < l_trm; i++ ) { temp = shr( sig_in[i], 2 ); -#ifdef BASOP_NOGLOB s = L_mac0_sat( s, temp, temp ); -#else - s = L_mac0( s, temp, temp ); -#endif } g0 = 0; @@ -1237,11 +1135,7 @@ static void agc2_fx( IF( s != 0 ) { i = norm_l( s ); -#ifdef BASOP_NOGLOB gain_in = round_fx_sat( L_shl_sat( s, i ) ); -#else - gain_in = round_fx( L_shl( s, i ) ); -#endif exp = sub( exp, i ); /*---------------------------------------------------* @@ -1251,21 +1145,13 @@ static void agc2_fx( s = L_shr( s, exp ); /* add exponent */ s = Isqrt( s ); -#ifdef BASOP_NOGLOB g0 = round_fx_sat( L_shl_sat( s, 9 ) ); -#else - g0 = round_fx( L_shl( s, 9 ) ); -#endif } /* sig_out(n) = gain(n) sig_out(n) */ FOR( i = 0; i < l_trm; i++ ) { -#ifdef BASOP_NOGLOB sig_out[i] = round_fx_sat( L_shl_sat( L_mac( -8192, sig_out[i], g0 ), 2 ) ); -#else - sig_out[i] = round_fx( L_shl( L_mac( -8192, sig_out[i], g0 ), 2 ) ); -#endif move16(); } } diff --git a/lib_com/enr_1_az.c b/lib_com/enr_1_az.c index 8bc24ddbe..e11a500db 100644 --- a/lib_com/enr_1_az.c +++ b/lib_com/enr_1_az.c @@ -42,18 +42,11 @@ #include "prot_fx.h" -#ifdef BASOP_NOGLOB Word16 Enr_1_Az_fx_o( /* o : impulse response energy Q3 */ const Word16 Aq[], /* i : LP filter coefs Qx based on the fact that Aq[0] == 1.0 */ const Word16 len, /* i : impulse response length Q0 */ Flag *Overflow_out /* o : propagating the Overflow flag to upper level */ ) -#else -Word16 Enr_1_Az_fx( /* o : impulse response energy Q3 */ - const Word16 Aq[], /* i : LP filter coefs Qx based on the fact that Aq[0] == 1.0 */ - const Word16 len /* i : impulse response length Q0 */ -) -#endif { Word16 h1[2 * L_SUBFR]; Word16 *y; @@ -94,23 +87,13 @@ Word16 Enr_1_Az_fx( /* o : impulse response energy Q3 L_tmp = L_msu( 0, Aq[1], y[-1] ); FOR( j = 2; j <= i; j++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_msu_o( L_tmp, Aq[j], y[-j], &Overflow ); -#else - L_tmp = L_msu( L_tmp, Aq[j], y[-j] ); -#endif } -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( L_tmp, q, &Overflow ); *y = round_fx_o( L_tmp, &Overflow ); move16(); L_tmp2 = L_mac_o( L_tmp2, *y, *y, &Overflow ); -#else - L_tmp = L_shl( L_tmp, q ); - *y = round_fx( L_tmp ); - L_tmp2 = L_mac( L_tmp2, *y, *y ); -#endif y++; } /* Normal Filtering */ @@ -119,34 +102,19 @@ Word16 Enr_1_Az_fx( /* o : impulse response energy Q3 L_tmp = L_msu( 0, Aq[1], y[-1] ); FOR( j = 2; j <= M; j++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_msu_o( L_tmp, Aq[j], y[-j], &Overflow ); -#else - L_tmp = L_msu( L_tmp, Aq[j], y[-j] ); -#endif } -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( L_tmp, q, &Overflow ); *y = round_fx_o( L_tmp, &Overflow ); move16(); L_tmp2 = L_mac_o( L_tmp2, *y, *y, &Overflow ); -#else - L_tmp = L_shl( L_tmp, q ); - *y = round_fx( L_tmp ); - L_tmp2 = L_mac( L_tmp2, *y, *y ); -#endif y++; } -#ifdef BASOP_NOGLOB *Overflow_out = Overflow; move32(); return round_fx_o( L_tmp2, Overflow_out ); /* Q19 to Q3 */ -#else - return round_fx( L_tmp2 ); /* Q19 to Q3 */ -#endif } -#ifdef BASOP_NOGLOB Word16 Enr_1_Az_fx( /* o : impulse response energy Q3 */ const Word16 Aq[], /* i : LP filter coefs Qx based on the fact that Aq[0] == 1.0 */ const Word16 len /* i : impulse response length Q0 */ @@ -156,4 +124,3 @@ Word16 Enr_1_Az_fx( /* o : impulse response energy Q3 move32(); return Enr_1_Az_fx_o( Aq, len, &Overflow ); } -#endif diff --git a/lib_com/env_adj.c b/lib_com/env_adj.c index d0e3877de..8ec13f925 100644 --- a/lib_com/env_adj.c +++ b/lib_com/env_adj.c @@ -145,11 +145,7 @@ void env_adj_fx( IF( EQ_16( att_state, 1 ) ) /* End of attenuation region found */ { /* tmp = min(1, max(0, len-ENV_ADJ_START)*(1.0f/ENV_ADJ_INCL)); */ -#ifdef BASOP_NOGLOB tmp = round_fx_sat( L_shl_sat( L_mult0( s_max( 0, sub( len, ENV_ADJ_START_FX ) ), ENV_ADJ_INV_INCL_FX ), 16 ) ); /* Q15 (15+16-16) */ -#else - tmp = round_fx( L_shl( L_mult0( s_max( 0, sub( len, ENV_ADJ_START_FX ) ), ENV_ADJ_INV_INCL_FX ), 16 ) ); /* Q15 (15+16-16) */ -#endif tmp_diff = sub( MAX_16, tmp ); /* Q15 */ FOR( j = start; j < i; j++ ) { @@ -192,11 +188,7 @@ void env_adj_fx( IF( EQ_16( att_state, 1 ) ) { /* tmp = min(1, max(0, len-ENV_ADJ_START)*(1.0f/ENV_ADJ_INCL)); */ -#ifdef BASOP_NOGLOB tmp = round_fx_sat( L_shl_sat( L_mult0( s_max( 0, sub( len, ENV_ADJ_START_FX ) ), ENV_ADJ_INV_INCL_FX ), 16 ) ); /* Q15 (15+16-16) */ -#else - tmp = round_fx( L_shl( L_mult0( s_max( 0, sub( len, ENV_ADJ_START_FX ) ), ENV_ADJ_INV_INCL_FX ), 16 ) ); /* Q15 (15+16-16) */ -#endif tmp_diff = sub( MAX_16, tmp ); /* Q15 */ move16(); FOR( j = start; j < i; j++ ) diff --git a/lib_com/env_stab.c b/lib_com/env_stab.c index 0a04508b6..be19b55e0 100644 --- a/lib_com/env_stab.c +++ b/lib_com/env_stab.c @@ -88,11 +88,7 @@ Word16 env_stability_fx( /* in Q15 */ } Overflow = 0; move16(); -#ifdef BASOP_NOGLOB /* Critical Overflow */ env_delta = shl_o( *mem_env_delta, 1, &Overflow ); -#else - env_delta = shl( *mem_env_delta, 1 ); -#endif } ELSE { @@ -125,29 +121,15 @@ Word16 env_stability_fx( /* in Q15 */ } exp = shr( exp, 1 ); -#ifdef BASOP_NOGLOB /* Critical Overflow */ env_delta = round_fx_sat( L_shl_sat( L_tmp, sub( 26, exp ) ) ); /* Q10 */ -#else - env_delta = round_fx( L_shl( L_tmp, sub( 26, exp ) ) ); /* Q10 */ -#endif L_tmp = L_mult0( 26214, env_delta ); /* 26214 is 0.1 in Q18. Q28 */ -#ifdef BASOP_NOGLOB /* Critical Overflow */ L_tmp = L_mac_sat( L_tmp, 29491, *mem_env_delta ); /* 29491 is 0.9 in Q15. Q28 */ *mem_env_delta = round_fx_sat( L_tmp ); /* Q12 */ -#else - L_tmp = L_mac( L_tmp, 29491, *mem_env_delta ); /* 29491 is 0.9 in Q15. Q28 */ - - *mem_env_delta = round_fx( L_tmp ); /* Q12 */ -#endif Overflow = 0; move16(); -#ifdef BASOP_NOGLOB /* Critical Overflow */ env_delta = round_fx_o( L_shl_o( L_tmp, 1, &Overflow ), &Overflow ); /* Q13 */ -#else - env_delta = round_fx( L_shl( L_tmp, 1 ) ); /* Q13 */ -#endif } IF( Overflow != 0 ) /* Saturated due to the above up-shifting operation. */ { @@ -245,13 +227,8 @@ Word16 env_stab_smo_fx( /* Q0 */ /*tmp = shl(tmp, add(exp, 1));*/ /* Q15 */ FOR( i = 0; i < NUM_ENV_STAB_PLC_STATES; i++ ) { -#ifdef BASOP_NOGLOB env_stab_state_p[i] = round_fx_o( L_shl_o( L_mult_o( env_stab_state_p[i], tmp, &Overflow ), add( exp, 1 ), &Overflow ), &Overflow ); /* Q15 */ move16(); -#else - env_stab_state_p[i] = round_fx( L_shl( L_mult( env_stab_state_p[i], tmp ), add( exp, 1 ) ) ); /* Q15 */ - move16(); -#endif } /* find maximum index as return value */ diff --git a/lib_com/est_tilt_fx.c b/lib_com/est_tilt_fx.c index d47a47191..138b8c1bc 100644 --- a/lib_com/est_tilt_fx.c +++ b/lib_com/est_tilt_fx.c @@ -70,13 +70,8 @@ Word16 est_tilt_fx( /* o : tilt of the code i = sub( exp1, exp2 ); BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB ener1 = shr_sat( ener1, sub( 1, s_min( i, 0 ) ) ); ener2 = shr_sat( ener2, add( s_max( 0, i ), 1 ) ); -#else - ener1 = shr( ener1, sub( 1, s_min( i, 0 ) ) ); - ener2 = shr( ener2, add( s_max( 0, i ), 1 ) ); -#endif BASOP_SATURATE_WARNING_ON_EVS tmp = sub( ener1, ener2 ); ener1 = add( add( ener1, ener2 ), 1 ); @@ -160,13 +155,8 @@ Word16 est_tilt_ivas_fx( /* o : tilt of the code i = sub( exp1, exp2 ); BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB ener1 = shr_sat( ener1, sub( 1, s_min( i, 0 ) ) ); ener2 = shr_sat( ener2, add( s_max( 0, i ), 1 ) ); -#else - ener1 = shr( ener1, sub( 1, s_min( i, 0 ) ) ); - ener2 = shr( ener2, add( s_max( 0, i ), 1 ) ); -#endif BASOP_SATURATE_WARNING_ON_EVS tmp = sub( ener1, ener2 ); ener1 = add( add( ener1, ener2 ), 1 ); @@ -341,21 +331,13 @@ void E_UTIL_voice_factor( Word16 *exc, /* i : pointer to the excitation f IF( i >= 0 ) { ener = L_shr( ener, 1 ); -#ifdef BASOP_NOGLOB tmp = L_shr_sat( tmp, add( 1, i ) ); -#else - tmp = L_shr( tmp, add( 1, i ) ); -#endif } ELSE { tmp = L_shr( tmp, 1 ); BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB ener = L_shr_sat( ener, sub( 1, i ) ); -#else - ener = L_shr( ener, sub( 1, i ) ); -#endif BASOP_SATURATE_WARNING_ON_EVS } diff --git a/lib_com/fd_cng_com_fx.c b/lib_com/fd_cng_com_fx.c index 86e27427e..f4468bd0b 100644 --- a/lib_com/fd_cng_com_fx.c +++ b/lib_com/fd_cng_com_fx.c @@ -692,11 +692,7 @@ void minimum_statistics( { /* calculate scalar with normalized msPeriodogSum[cnt], exponent -2*s1 */ s1 = norm_l( msPeriodogSum[cnt] ); -#ifdef BASOP_NOGLOB msPeriodogSum16 = round_fx_sat( L_shl_sat( msPeriodogSum[cnt], s1 ) ); -#else - msPeriodogSum16 = round_fx( L_shl( msPeriodogSum[cnt], s1 ) ); -#endif scalar = L_mult( msPeriodogSum16, msPeriodogSum16 ); /* calculate difference, both elements in 16Q15 format, use absolute value @@ -710,11 +706,7 @@ void minimum_statistics( /* use absolute value to avoid -1.0 x -1.0 multiplications */ s2 = norm_l( scalar2 ); } -#ifdef BASOP_NOGLOB scalar216 = round_fx_o( L_shl_o( scalar2, s2, &Overflow ), &Overflow ); -#else - scalar216 = round_fx( L_shl( scalar2, s2 ) ); -#endif scalar2 = L_mult( scalar216, scalar216 ); /* find common exponent */ @@ -864,11 +856,7 @@ void minimum_statistics( s2 = s_min( s2, WORD32_BITS - 1 ); /* beta: scaled by s2 */ -#ifdef BASOP_NOGLOB tmp16 = round_fx_o( L_shl_o( tmp, s1, &Overflow ), &Overflow ); -#else - tmp16 = round_fx( L_shl( tmp, s1 ) ); -#endif beta = mult_r( tmp16, tmp16 ); /* scalar3: scaled by s3 */ @@ -956,11 +944,7 @@ void minimum_statistics( move32(); /* exponent msCurrentMinSubWindow[j]: CNG_S */ BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB msCurrentMinSubWindow[j] = L_shl_o( Mpy_32_32( scalar, msBminSubWin[j] ), 5, &Overflow ); -#else /* BASOP_NOGLOB */ - msCurrentMinSubWindow[j] = L_shl( Mpy_32_32( scalar, msBminSubWin[j] ), 5 ); -#endif /* BASOP_NOGLOB */ move32(); BASOP_SATURATE_WARNING_ON_EVS; } @@ -1327,11 +1311,7 @@ void minimum_statistics_fx( /* use absolute value to avoid -1.0 x -1.0 multiplications */ s2 = norm_l( scalar2 ); } -#ifdef BASOP_NOGLOB scalar216 = round_fx_o( L_shl_o( scalar2, s2, &Overflow ), &Overflow ); -#else - scalar216 = round_fx( L_shl( scalar2, s2 ) ); -#endif scalar2 = L_mult( scalar216, scalar216 ); /* find common exponent */ @@ -1479,11 +1459,7 @@ void minimum_statistics_fx( s2 = s_min( s2, WORD32_BITS - 1 ); /* beta: scaled by s2 */ -#ifdef BASOP_NOGLOB tmp16 = round_fx_o( L_shl_o( tmp, s1, &Overflow ), &Overflow ); -#else - tmp16 = round_fx( L_shl( tmp, s1 ) ); -#endif beta = mult_r( tmp16, tmp16 ); /* scalar3: scaled by s3 */ @@ -1571,11 +1547,7 @@ void minimum_statistics_fx( move32(); /* exponent msCurrentMinSubWindow[j]: CNG_S */ BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB msCurrentMinSubWindow[j] = L_shl_o( Mpy_32_32( scalar, msBminSubWin[j] ), 5, &Overflow ); -#else /* BASOP_NOGLOB */ - msCurrentMinSubWindow[j] = L_shl( Mpy_32_32( scalar, msBminSubWin[j] ), 5 ); -#endif /* BASOP_NOGLOB */ move32(); BASOP_SATURATE_WARNING_ON_EVS; } @@ -2044,11 +2016,7 @@ void scalebands( s = norm_l( tmp ); s1 = sub( delta_s, s ); -#ifdef BASOP_NOGLOB delta = round_fx_sat( L_shl_sat( tmp, s ) ); // Q(14+s) -#else - delta = round_fx( L_shl( tmp, s ) ); -#endif /* Choose scale such that the interpolation start and end point both are representable and add 1 additional bit hr. */ delta_s = sub( s_min( norm_l( partpow[j - 1] ), norm_l( partpow[j] ) ), 1 ); val = L_shl( partpow[j - 1], delta_s ); @@ -2192,11 +2160,7 @@ void scalebands_fx( s = norm_l( tmp ); s1 = sub( delta_s, s ); -#ifdef BASOP_NOGLOB delta = round_fx_sat( L_shl_sat( tmp, s ) ); // Q(14+s) -#else - delta = round_fx( L_shl( tmp, s ) ); -#endif /* Choose scale such that the interpolation start and end point both are representable and add 1 additional bit hr. */ delta_s = sub( s_min( norm_l( partpow[j - 1] ), norm_l( partpow[j] ) ), 1 ); val = L_shl( partpow[j - 1], delta_s ); @@ -2306,11 +2270,7 @@ static void getmidbands( move16(); FOR( j = 0; j < npart; j++ ) { -#ifdef BASOP_NOGLOB psize_norm[j] = shl_o( psize[j], shift, &Overflow ); // Q(15 - psize_norm_exp) -#else /* BASOP_NOGLOB */ - psize_norm[j] = shl( psize[j], shift ); -#endif move16(); } /* minimum_statistics needs fixed exponent of 6 */ @@ -2364,13 +2324,8 @@ void AnalysisSTFT( { move32(); move32(); -#ifdef BASOP_NOGLOB fftBuffer[i + len] = L_mult( shr_sat( timeDomainInput[i], Q ), mult_r( olapWin[i].v.re, 23170 /*1.4142135623730950488016887242097 Q14*/ ) ); fftBuffer[i + len + len2] = L_mult( shr_sat( timeDomainInput[i + len2], Q ), mult_r( olapWin[len2 - 1 - i].v.im, 23170 /*1.4142135623730950488016887242097 Q14*/ ) ); -#else - fftBuffer[i + len] = L_mult( shr( timeDomainInput[i], Q ), mult_r( olapWin[i].v.re, 23170 /*1.4142135623730950488016887242097 Q14*/ ) ); - fftBuffer[i + len + len2] = L_mult( shr( timeDomainInput[i + len2], Q ), mult_r( olapWin[len2 - 1 - i].v.im, 23170 /*1.4142135623730950488016887242097 Q14*/ ) ); -#endif } /* Perform FFT */ @@ -2378,11 +2333,7 @@ void AnalysisSTFT( FOR( i = 0; i < len; i++ ) { -#ifdef BASOP_NOGLOB olapBuffer[i] = shr_sat( timeDomainInput[sub( hFdCngCom->frameSize, len ) + i], Q ); -#else - olapBuffer[i] = shr( timeDomainInput[sub( hFdCngCom->frameSize, len ) + i], Q ); -#endif move16(); } } @@ -3064,11 +3015,7 @@ void lpc_from_spectrum( maxVal = L_max( maxVal, L_abs( powspec[i] ) ); } s1 = norm_l( maxVal ); -#ifdef BASOP_NOGLOB nf = L_shr_r_sat( 1099511680l /*1e-3f Q40*/, add( sub( powspec_exp, s1 ), 9 ) ); -#else - nf = L_shr_r( 1099511680l /*1e-3f Q40*/, add( sub( powspec_exp, s1 ), 9 ) ); -#endif ptr = fftBuffer; pti = fftBuffer + 1; diff --git a/lib_com/fft_fx_evs.c b/lib_com/fft_fx_evs.c index e2fce166c..8b63fab55 100644 --- a/lib_com/fft_fx_evs.c +++ b/lib_com/fft_fx_evs.c @@ -1096,34 +1096,18 @@ static void fft5_shift4_16fx( move16(); T3 = zRe[i4]; move16(); -#ifdef BASOP_NOGLOB T4 = add_sat( T2, T3 ); -#else - T4 = add( T2, T3 ); -#endif T5 = zRe[i2]; move16(); T6 = zRe[i3]; move16(); -#ifdef BASOP_NOGLOB T7 = add_sat( T5, T6 ); T8 = add_sat( T4, T7 ); Tt = sub_sat( T5, T6 ); -#else - T7 = add( T5, T6 ); - T8 = add( T4, T7 ); - Tt = sub( T5, T6 ); -#endif /* T9 = KP559016994 * (T4 - T7); */ -#ifdef BASOP_NOGLOB L_tmp = Mult_32_16( KP559016994_16FX, sub_sat( T4, T7 ) ); // Q(16 +x) T9 = round_fx_sat( L_tmp ); // Qx Ts = sub_sat( T2, T3 ); -#else - L_tmp = Mult_32_16( KP559016994_16FX, sub( T4, T7 ) ); - T9 = round_fx( L_tmp ); - Ts = sub( T2, T3 ); -#endif T2 = zIm[i1]; move16(); @@ -1134,52 +1118,27 @@ static void fft5_shift4_16fx( move16(); T6 = zIm[i3]; move16(); -#ifdef BASOP_NOGLOB T7 = add_sat( T5, T6 ); Te = sub_sat( T2, T3 ); Tp = add_sat( T4, T7 ); Th = sub_sat( T5, T6 ); -#else - T7 = add( T5, T6 ); - Te = sub( T2, T3 ); - Tp = add( T4, T7 ); - Th = sub( T5, T6 ); -#endif -#ifdef BASOP_NOGLOB /* Tn = KP559016994 * (T4 - T7); */ L_tmp = Mult_32_16( KP559016994_16FX, sub_sat( T4, T7 ) ); // Q(16 +x) Tn = round_fx_sat( L_tmp ); // Qx zRe[i0] = add_sat( T1, T8 ); move16(); zIm[i0] = add_sat( To, Tp ); -#else - /* Tn = KP559016994 * (T4 - T7); */ - L_tmp = Mult_32_16( KP559016994_16FX, sub( T4, T7 ) ); - Tn = round_fx( L_tmp ); - zRe[i0] = add( T1, T8 ); - move16(); - zIm[i0] = add( To, Tp ); -#endif move16(); /* T2 = KP951056516*Te + KP587785252*Th; */ L_tmp = Mult_32_16( KP951056516_16FX, Te ); // Q(16 +x) L_tmp = Madd_32_16( L_tmp, KP587785252_16FX, Th ); // Q(16 +x) -#ifdef BASOP_NOGLOB T2 = round_fx_sat( L_tmp ); // Qx -#else - T2 = round_fx( L_tmp ); -#endif /*T3 = KP951056516*Th - KP587785252*Te; */ L_tmp = Mult_32_16( KP951056516_16FX, Th ); // Q(16 +x) L_tmp = Msub_32_16( L_tmp, KP587785252_16FX, Te ); // Q(16 +x) -#ifdef BASOP_NOGLOB T3 = round_fx_sat( L_tmp ); // Qx -#else - T3 = round_fx( L_tmp ); -#endif -#ifdef BASOP_NOGLOB T6 = sub_sat( T1, shr_sat( T8, 2 ) ); T4 = add_sat( T9, T6 ); T5 = sub_sat( T6, T9 ); @@ -1191,37 +1150,15 @@ static void fft5_shift4_16fx( move16(); zRe[i3] = sub_sat( T5, T3 ); move16(); -#else - T6 = sub( T1, shr( T8, 2 ) ); - T4 = add( T9, T6 ); - T5 = sub( T6, T9 ); - zRe[i1] = sub( T4, T2 ); - move16(); - zRe[i2] = add( T5, T3 ); - move16(); - zRe[i4] = add( T4, T2 ); - move16(); - zRe[i3] = sub( T5, T3 ); - move16(); -#endif /* T2 = KP951056516 * Ts + KP587785252 * Tt; */ L_tmp = Mult_32_16( KP951056516_16FX, Ts ); // Q(16 +x) L_tmp = Madd_32_16( L_tmp, KP587785252_16FX, Tt ); // Q(16 +x) -#ifdef BASOP_NOGLOB T2 = round_fx_sat( L_tmp ); // Qx -#else - T2 = round_fx( L_tmp ); -#endif /* T3 = KP951056516 * Tt - KP587785252 * Ts; */ L_tmp = Mult_32_16( KP951056516_16FX, Tt ); // Q(16 +x) L_tmp = Msub_32_16( L_tmp, KP587785252_16FX, Ts ); // Q(16 +x) -#ifdef BASOP_NOGLOB T3 = round_fx_sat( L_tmp ); // Qx -#else - T3 = round_fx( L_tmp ); -#endif -#ifdef BASOP_NOGLOB T6 = sub_sat( To, shr( Tp, 2 ) ); // To - (Tp / 4) T4 = add_sat( Tn, T6 ); T5 = sub_sat( T6, Tn ); @@ -1233,19 +1170,6 @@ static void fft5_shift4_16fx( move16(); zIm[i3] = add_sat( T3, T5 ); move16(); -#else - T6 = sub( To, shr( Tp, 2 ) ); - T4 = add( Tn, T6 ); - T5 = sub( T6, Tn ); - zIm[i4] = sub( T4, T2 ); - move16(); - zIm[i2] = sub( T5, T3 ); - move16(); - zIm[i1] = add( T2, T4 ); - move16(); - zIm[i3] = add( T3, T5 ); - move16(); -#endif return; } @@ -1287,7 +1211,6 @@ static void fft5_32_16fx( T3 = zRe[i4]; // Qx move16(); -#ifdef BASOP_NOGLOB T4 = add_sat( T2, T3 ); T5 = zRe[i2]; move16(); @@ -1296,17 +1219,6 @@ static void fft5_32_16fx( T7 = add_o( T5, T6, &Overflow ); T8 = add_o( T4, T7, &Overflow ); Tt = sub_o( T5, T6, &Overflow ); -#else - T4 = add( T2, T3 ); - T5 = zRe[i2]; - move16(); - T6 = zRe[i3]; - move16(); - T7 = add( T5, T6 ); - T8 = add( T4, T7 ); - Tt = sub( T5, T6 ); -#endif -#ifdef BASOP_NOGLOB /* T9 = KP559016994 * (T4 - T7); */ L_tmp = Mult_32_16( KP559016994_16FX, sub_sat( T4, T7 ) ); // Q(16 +x) T9 = round_fx_sat( L_tmp ); // Qx @@ -1327,43 +1239,13 @@ static void fft5_32_16fx( Th = sub_sat( T5, T6 ); L_tmp = Mult_32_16( KP559016994_16FX, sub_sat( T4, T7 ) ); // Q(16 +x) Tn = round_fx_sat( L_tmp ); // Qx -#else - /* T9 = KP559016994 * (T4 - T7); */ - L_tmp = Mult_32_16( KP559016994_16FX, sub( T4, T7 ) ); - T9 = round_fx( L_tmp ); - Ts = sub( T2, T3 ); - T2 = zIm[i1]; - move16(); - T3 = zIm[i4]; - move16(); - T4 = add( T2, T3 ); - T5 = zIm[i2]; - move16(); - T6 = zIm[i3]; - move16(); - T7 = add( T5, T6 ); - Te = sub( T2, T3 ); - Tp = add( T4, T7 ); - Th = sub( T5, T6 ); - L_tmp = Mult_32_16( KP559016994_16FX, sub( T4, T7 ) ); - Tn = round_fx( L_tmp ); -#endif - -#ifdef BASOP_NOGLOB zRe[i0] = add_o( T1, T8, &Overflow ); move16(); zIm[i0] = add_o( To, Tp, &Overflow ); move32(); -#else - zRe[i0] = add( T1, T8 ); - move16(); - zIm[i0] = add( To, Tp ); - move32(); -#endif -#ifdef BASOP_NOGLOB /*T2 = KP951056516*Te + KP587785252*Th; */ L_tmp = Mult_32_16( KP951056516_16FX, Te ); // Q(16 +x) L_tmp = Madd_32_16( L_tmp, KP587785252_16FX, Th ); // Q(16 +x) @@ -1387,31 +1269,6 @@ static void fft5_32_16fx( move32(); zRe[i4] = sub_o( T5, T3, &Overflow ); move32(); -#else - /*T2 = KP951056516*Te + KP587785252*Th; */ - L_tmp = Mult_32_16( KP951056516_16FX, Te ); - L_tmp = Madd_32_16( L_tmp, KP587785252_16FX, Th ); - T2 = round_fx( L_tmp ); - - /*T3 = KP951056516*Th - KP587785252*Te; */ - L_tmp = Mult_32_16( KP951056516_16FX, Th ); - L_tmp = Msub_32_16( L_tmp, KP587785252_16FX, Te ); - T3 = round_fx( L_tmp ); - - - T6 = sub( T1, shr( T8, 2 ) ); - T4 = add( T9, T6 ); - T5 = sub( T6, T9 ); - - zRe[i3] = sub( T4, T2 ); - move32(); - zRe[i1] = add( T5, T3 ); - move32(); - zRe[i2] = add( T4, T2 ); - move32(); - zRe[i4] = sub( T5, T3 ); - move32(); -#endif /* T2 = KP951056516 * Ts + KP587785252 * Tt; */ L_tmp = Mult_32_16( KP951056516_16FX, Ts ); // Q(16 +x) @@ -1422,7 +1279,6 @@ static void fft5_32_16fx( L_tmp = Mult_32_16( KP951056516_16FX, Tt ); // Q(16 +x) L_tmp = Msub_32_16( L_tmp, KP587785252_16FX, Ts ); // Q(16 +x) -#ifdef BASOP_NOGLOB T3 = round_fx_sat( L_tmp ); // Qx T6 = sub_sat( To, shr( Tp, 2 ) ); @@ -1436,21 +1292,6 @@ static void fft5_32_16fx( move16(); zIm[i4] = add_sat( T3, T5 ); move16(); -#else - T3 = round_fx( L_tmp ); - - T6 = sub( To, shr( Tp, 2 ) ); - T4 = add( Tn, T6 ); - T5 = sub( T6, Tn ); - zIm[i2] = sub( T4, T2 ); - move16(); - zIm[i1] = sub( T5, T3 ); - move16(); - zIm[i3] = add( T2, T4 ); - move16(); - zIm[i4] = add( T3, T5 ); - move16(); -#endif return; } @@ -1890,7 +1731,6 @@ static void cftfsub_16fx( { FOR( j = 0; j < l; j += 2 ) { -#ifdef BASOP_NOGLOB j1 = add_o( j, l, &Overflow ); x0r = sub_o( a[j], a[j1], &Overflow ); x0i = sub_o( a[j + 1], a[j1 + 1], &Overflow ); @@ -1902,19 +1742,6 @@ static void cftfsub_16fx( move16(); a[j1 + 1] = x0i; move16(); -#else - j1 = add( j, l ); - x0r = sub( a[j], a[j1] ); - x0i = sub( a[j + 1], a[j1 + 1] ); - a[j] = add( a[j], a[j1] ); - move16(); - a[j + 1] = add( a[j + 1], a[j1 + 1] ); - move16(); - a[j1] = x0r; - move16(); - a[j1 + 1] = x0i; - move16(); -#endif } } return; @@ -1940,7 +1767,6 @@ static void cft1st_16fx( move32(); #endif -#ifdef BASOP_NOGLOB x0r = add_o( a[0], a[2], &Overflow ); x0i = add_o( a[1], a[3], &Overflow ); x1r = sub_o( a[0], a[2], &Overflow ); @@ -1964,36 +1790,9 @@ static void cft1st_16fx( a[6] = add_o( x1r, x3i, &Overflow ); move16(); a[7] = sub_o( x1i, x3r, &Overflow ); -#else - x0r = add( a[0], a[2] ); - x0i = add( a[1], a[3] ); - x1r = sub( a[0], a[2] ); - x1i = sub( a[1], a[3] ); - x2r = add( a[4], a[6] ); - x2i = add( a[5], a[7] ); - x3r = sub( a[4], a[6] ); - x3i = sub( a[5], a[7] ); - a[0] = add( x0r, x2r ); - move16(); - a[1] = add( x0i, x2i ); - move16(); - a[4] = sub( x0r, x2r ); - move16(); - a[5] = sub( x0i, x2i ); - move16(); - a[2] = sub( x1r, x3i ); - move16(); - a[3] = add( x1i, x3r ); - move16(); - a[6] = add( x1r, x3i ); - move16(); - a[7] = sub( x1i, x3r ); - move16(); -#endif wk1r = w[2]; move32(); -#ifdef BASOP_NOGLOB x0r = add_o( a[8], a[10], &Overflow ); x0i = add_o( a[9], a[11], &Overflow ); x1r = sub_o( a[8], a[10], &Overflow ); @@ -2014,31 +1813,8 @@ static void cft1st_16fx( x0r = sub_o( x1r, x3i, &Overflow ); x0i = add_o( x1i, x3r, &Overflow ); tmp = sub_o( x0r, x0i, &Overflow ); -#else - x0r = add( a[8], a[10] ); - x0i = add( a[9], a[11] ); - x1r = sub( a[8], a[10] ); - x1i = sub( a[9], a[11] ); - x2r = add( a[12], a[14] ); - x2i = add( a[13], a[15] ); - x3r = sub( a[12], a[14] ); - x3i = sub( a[13], a[15] ); - a[8] = add( x0r, x2r ); - move16(); - a[9] = add( x0i, x2i ); - move16(); - a[12] = sub( x2i, x0i ); - move16(); - a[13] = sub( x0r, x2r ); - move16(); - - x0r = sub( x1r, x3i ); - x0i = add( x1i, x3r ); - tmp = sub( x0r, x0i ); -#endif L_tmp = Mult_32_16( wk1r, tmp ); /*Q(15+Qx+Q_edct) */ -#ifdef BASOP_NOGLOB a[10] = round_fx_o( L_shl_o( L_tmp, 1, &Overflow ), &Overflow ); /*Q(Qx+Q_edct) */ move16(); @@ -2058,23 +1834,6 @@ static void cft1st_16fx( L_tmp = Mult_32_16( wk1r, tmp ); /*Q(15+Qx+Q_edct) */ a[15] = round_fx_o( L_shl_o( L_tmp, 1, &Overflow ), &Overflow ); /*Q(Qx+Q_edct) */ move16(); -#else - a[10] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - tmp = add( x0r, x0i ); - L_tmp = Mult_32_16( wk1r, tmp ); /*Q(15+Qx+Q_edct) */ - a[11] = round_fx( L_shl( L_tmp, 1 ) ); /* Q(Qx+Q_edct) */ - - x0r = add( x3i, x1r ); - x0i = sub( x3r, x1i ); - tmp = sub( x0i, x0r ); - L_tmp = Mult_32_16( wk1r, tmp ); /*Q(15+Qx+Q_edct) */ - a[14] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - tmp = add( x0i, x0r ); - L_tmp = Mult_32_16( wk1r, tmp ); /*Q(15+Qx+Q_edct) */ - a[15] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ -#endif k1 = 0; move16(); @@ -2097,7 +1856,6 @@ static void cft1st_16fx( L_tmp = L_shl( Mult_32_32( wk2i, wk1r ), 1 ); /*Q29 */ wk3i = L_sub( L_shl( L_tmp, 1 ), wk1i ); /*Q30 */ -#ifdef BASOP_NOGLOB x0r = add_o( a[j], a[j + 2], &Overflow ); x0i = add_o( a[j + 1], a[j + 3], &Overflow ); x1r = sub_o( a[j], a[j + 2], &Overflow ); @@ -2208,106 +1966,6 @@ static void cft1st_16fx( L_tmp = Madd_32_16( L_tmp, wk3i, x0r ); /*Q(15+Qx+Q_edct) */ a[j + 15] = round_fx_o( L_shl_o( L_tmp, 1, &Overflow ), &Overflow ); /*Q(Qx+Q_edct) */ move16(); -#else - x0r = add( a[j], a[j + 2] ); - x0i = add( a[j + 1], a[j + 3] ); - x1r = sub( a[j], a[j + 2] ); - x1i = sub( a[j + 1], a[j + 3] ); - x2r = add( a[j + 4], a[j + 6] ); - x2i = add( a[j + 5], a[j + 7] ); - x3r = sub( a[j + 4], a[j + 6] ); - x3i = sub( a[j + 5], a[j + 7] ); - a[j] = add( x0r, x2r ); - move16(); - a[j + 1] = add( x0i, x2i ); - move16(); - - x0r = sub( x0r, x2r ); - x0i = sub( x0i, x2i ); - L_tmp = Mult_32_16( wk2r, x0r ); /*Q(15+Qx+Q_edct) */ - L_tmp = Msub_32_16( L_tmp, wk2i, x0i ); /*Q(15+Qx+Q_edct) */ - a[j + 4] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - L_tmp = Mult_32_16( wk2r, x0i ); /*Q(15+Qx+Q_edct) */ - L_tmp = Madd_32_16( L_tmp, wk2i, x0r ); /*Q(15+Qx+Q_edct) */ - a[j + 5] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - x0r = sub( x1r, x3i ); - x0i = add( x1i, x3r ); - L_tmp = Mult_32_16( wk1r, x0r ); /*Q(15+Qx+Q_edct) */ - L_tmp = Msub_32_16( L_tmp, wk1i, x0i ); /*Q(15+Qx+Q_edct) */ - a[j + 2] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - L_tmp = Mult_32_16( wk1r, x0i ); /*Q(15+Qx+Q_edct) */ - L_tmp = Madd_32_16( L_tmp, wk1i, x0r ); /*Q(15+Qx+Q_edct) */ - a[j + 3] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - x0r = add( x1r, x3i ); - x0i = sub( x1i, x3r ); - L_tmp = Mult_32_16( wk3r, x0r ); /*Q(15+Qx+Q_edct) */ - L_tmp = Msub_32_16( L_tmp, wk3i, x0i ); /*Q(15+Qx+Q_edct) */ - a[j + 6] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - L_tmp = Mult_32_16( wk3r, x0i ); /*Q(15+Qx+Q_edct) */ - L_tmp = Madd_32_16( L_tmp, wk3i, x0r ); /*Q(15+Qx+Q_edct) */ - a[j + 7] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - wk1r = w[k2 + 2]; - move32(); - wk1i = w[k2 + 3]; - move32(); - L_tmp = L_shl( Mult_32_32( wk2r, wk1i ), 1 ); /*Q29 */ - wk3r = L_sub( wk1r, L_shl( L_tmp, 1 ) ); /*Q30 */ - - L_tmp = L_shl( Mult_32_32( wk2r, wk1r ), 1 ); /*Q29 */ - wk3i = L_sub( L_shl( L_tmp, 1 ), wk1i ); /*Q30 */ - - x0r = add( a[j + 8], a[j + 10] ); - x0i = add( a[j + 9], a[j + 11] ); - x1r = sub( a[j + 8], a[j + 10] ); - x1i = sub( a[j + 9], a[j + 11] ); - x2r = add( a[j + 12], a[j + 14] ); - x2i = add( a[j + 13], a[j + 15] ); - x3r = sub( a[j + 12], a[j + 14] ); - x3i = sub( a[j + 13], a[j + 15] ); - a[j + 8] = add( x0r, x2r ); - move16(); - a[j + 9] = add( x0i, x2i ); - move16(); - - x0r = sub( x0r, x2r ); - x0i = sub( x0i, x2i ); - tmp = negate( x0r ); - L_tmp = Mult_32_16( wk2i, tmp ); /*Q(15+Qx+Q_edct) */ - L_tmp = Msub_32_16( L_tmp, wk2r, x0i ); /*Q(15+Qx+Q_edct) */ - a[j + 12] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - tmp = negate( x0i ); - L_tmp = Mult_32_16( wk2i, tmp ); /*Q(15+Qx+Q_edct) */ - L_tmp = Madd_32_16( L_tmp, wk2r, x0r ); /*Q(15+Qx+Q_edct) */ - a[j + 13] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - x0r = sub( x1r, x3i ); - x0i = add( x1i, x3r ); - L_tmp = Mult_32_16( wk1r, x0r ); /*Q(15+Qx+Q_edct) */ - L_tmp = Msub_32_16( L_tmp, wk1i, x0i ); /*Q(15+Qx+Q_edct) */ - a[j + 10] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - L_tmp = Mult_32_16( wk1r, x0i ); /*Q(15+Qx+Q_edct) */ - L_tmp = Madd_32_16( L_tmp, wk1i, x0r ); /*Q(15+Qx+Q_edct) */ - a[j + 11] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - x0r = add( x1r, x3i ); - x0i = sub( x1i, x3r ); - - L_tmp = Mult_32_16( wk3r, x0r ); /*Q(15+Qx+Q_edct) */ - L_tmp = Msub_32_16( L_tmp, wk3i, x0i ); /*Q(15+Qx+Q_edct) */ - a[j + 14] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - L_tmp = Mult_32_16( wk3r, x0i ); /*Q(15+Qx+Q_edct) */ - L_tmp = Madd_32_16( L_tmp, wk3i, x0r ); /*Q(15+Qx+Q_edct) */ - a[j + 15] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ -#endif } return; @@ -2337,7 +1995,6 @@ static void cftmdl_16fx( m = shl( l, 2 ); FOR( j = 0; j < l; j += 2 ) { -#ifdef BASOP_NOGLOB j1 = add_o( j, l, &Overflow ); j2 = add_o( j1, l, &Overflow ); j3 = add_o( j2, l, &Overflow ); @@ -2365,35 +2022,6 @@ static void cftmdl_16fx( move16(); a[j3 + 1] = sub_o( x1i, x3r, &Overflow ); move16(); -#else - j1 = add( j, l ); - j2 = add( j1, l ); - j3 = add( j2, l ); - x0r = add( a[j], a[j1] ); - x0i = add( a[j + 1], a[j1 + 1] ); - x1r = sub( a[j], a[j1] ); - x1i = sub( a[j + 1], a[j1 + 1] ); - x2r = add( a[j2], a[j3] ); - x2i = add( a[j2 + 1], a[j3 + 1] ); - x3r = sub( a[j2], a[j3] ); - x3i = sub( a[j2 + 1], a[j3 + 1] ); - a[j] = add( x0r, x2r ); - move16(); - a[j + 1] = add( x0i, x2i ); - move16(); - a[j2] = sub( x0r, x2r ); - move16(); - a[j2 + 1] = sub( x0i, x2i ); - move16(); - a[j1] = sub( x1r, x3i ); - move16(); - a[j1 + 1] = add( x1i, x3r ); - move16(); - a[j3] = add( x1r, x3i ); - move16(); - a[j3 + 1] = sub( x1i, x3r ); - move16(); -#endif } wk1r = w[2]; @@ -2401,7 +2029,6 @@ static void cftmdl_16fx( tmp2 = add( l, m ); FOR( j = m; j < tmp2; j += 2 ) { -#ifdef BASOP_NOGLOB j1 = add_o( j, l, &Overflow ); j2 = add_o( j1, l, &Overflow ); j3 = add_o( j2, l, &Overflow ); @@ -2445,47 +2072,6 @@ static void cftmdl_16fx( L_tmp = Mult_32_16( wk1r, tmp ); /*Q(15+Qx+Q_edct) */ a[j3 + 1] = round_fx_o( L_shl_o( L_tmp, 1, &Overflow ), &Overflow ); /*Q(Qx+Q_edct) */ move16(); -#else - j1 = add( j, l ); - j2 = add( j1, l ); - j3 = add( j2, l ); - x0r = add( a[j], a[j1] ); - x0i = add( a[j + 1], a[j1 + 1] ); - x1r = sub( a[j], a[j1] ); - x1i = sub( a[j + 1], a[j1 + 1] ); - x2r = add( a[j2], a[j3] ); - x2i = add( a[j2 + 1], a[j3 + 1] ); - x3r = sub( a[j2], a[j3] ); - x3i = sub( a[j2 + 1], a[j3 + 1] ); - a[j] = add( x0r, x2r ); - move16(); - a[j + 1] = add( x0i, x2i ); - move16(); - a[j2] = sub( x2i, x0i ); - move16(); - a[j2 + 1] = sub( x0r, x2r ); - move16(); - - x0r = sub( x1r, x3i ); - x0i = add( x1i, x3r ); - tmp = sub( x0r, x0i ); - L_tmp = Mult_32_16( wk1r, tmp ); /*Q(15+Qx+Q_edct) */ - a[j1] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - tmp = add( x0r, x0i ); - L_tmp = Mult_32_16( wk1r, tmp ); /*Q(15+Qx+Q_edct) */ - a[j1 + 1] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - x0r = add( x3i, x1r ); - x0i = sub( x3r, x1i ); - tmp = sub( x0i, x0r ); - L_tmp = Mult_32_16( wk1r, tmp ); /*Q(15+Qx+Q_edct) */ - a[j3] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - tmp = add( x0i, x0r ); - L_tmp = Mult_32_16( wk1r, tmp ); /*Q(15+Qx+Q_edct) */ - a[j3 + 1] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ -#endif } k1 = 0; @@ -2512,7 +2098,6 @@ static void cftmdl_16fx( tmp2 = add( l, k ); FOR( j = k; j < tmp2; j += 2 ) { -#ifdef BASOP_NOGLOB j1 = add_o( j, l, &Overflow ); j2 = add_o( j1, l, &Overflow ); j3 = add_o( j2, l, &Overflow ); @@ -2568,80 +2153,20 @@ static void cftmdl_16fx( L_tmp = Madd_32_16( L_tmp, wk3i, x0r ); /*Q(15+Qx+Q_edct) */ a[j3 + 1] = round_fx_o( L_shl_o( L_tmp, 1, &Overflow ), &Overflow ); /*Q(Qx+Q_edct) */ move16(); -#else - j1 = add( j, l ); - j2 = add( j1, l ); - j3 = add( j2, l ); - x0r = add( a[j], a[j1] ); - x0i = add( a[j + 1], a[j1 + 1] ); - x1r = sub( a[j], a[j1] ); - x1i = sub( a[j + 1], a[j1 + 1] ); - x2r = add( a[j2], a[j3] ); - x2i = add( a[j2 + 1], a[j3 + 1] ); - x3r = sub( a[j2], a[j3] ); - x3i = sub( a[j2 + 1], a[j3 + 1] ); - a[j] = add( x0r, x2r ); - move16(); - a[j + 1] = add( x0i, x2i ); - move16(); - - x0r = sub( x0r, x2r ); - x0i = sub( x0i, x2i ); - - L_tmp = Mult_32_16( wk2r, x0r ); /*Q(15+Qx+Q_edct) */ - L_tmp = Msub_32_16( L_tmp, wk2i, x0i ); /*Q(15+Qx+Q_edct) */ - a[j2] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - L_tmp = Mult_32_16( wk2r, x0i ); /*Q(15+Qx+Q_edct) */ - L_tmp = Madd_32_16( L_tmp, wk2i, x0r ); /*Q(15+Qx+Q_edct) */ - a[j2 + 1] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - x0r = sub( x1r, x3i ); - x0i = add( x1i, x3r ); - - L_tmp = Mult_32_16( wk1r, x0r ); /*Q(15+Qx+Q_edct) */ - L_tmp = Msub_32_16( L_tmp, wk1i, x0i ); /*Q(15+Qx+Q_edct) */ - a[j1] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - L_tmp = Mult_32_16( wk1r, x0i ); /*Q(15+Qx+Q_edct) */ - L_tmp = Madd_32_16( L_tmp, wk1i, x0r ); /*Q(15+Qx+Q_edct) */ - a[j1 + 1] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - L_x0r = L_add( (Word32) x1r, (Word32) x3i ); - L_x0i = L_sub( (Word32) x1i, (Word32) x3r ); - x0r = extract_l( L_x0r ); - x0i = extract_l( L_x0i ); - L_tmp = Mult_32_16( wk3r, x0r ); /*Q(15+Qx+Q_edct) */ - L_tmp = Msub_32_16( L_tmp, wk3i, x0i ); /*Q(15+Qx+Q_edct) */ - a[j3] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - L_tmp = Mult_32_16( wk3r, x0i ); /*Q(15+Qx+Q_edct) */ - L_tmp = Madd_32_16( L_tmp, wk3i, x0r ); /*Q(15+Qx+Q_edct) */ - a[j3 + 1] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ -#endif } wk1r = w[k2 + 2]; move32(); wk1i = w[k2 + 3]; move32(); -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( Mult_32_32( wk2r, wk1i ), 1, &Overflow ); /*Q29 */ wk3r = L_sub_o( wk1r, L_shl_o( L_tmp, 1, &Overflow ), &Overflow ); /*Q30 */ L_tmp = L_shl_o( Mult_32_32( wk2r, wk1r ), 1, &Overflow ); /*Q29 */ wk3i = L_sub_o( L_shl_o( L_tmp, 1, &Overflow ), wk1i, &Overflow ); /*Q30 */ -#else - L_tmp = L_shl( Mult_32_32( wk2r, wk1i ), 1 ); /*Q29 */ - wk3r = L_sub( wk1r, L_shl( L_tmp, 1 ) ); /*Q30 */ - - L_tmp = L_shl( Mult_32_32( wk2r, wk1r ), 1 ); /*Q29 */ - wk3i = L_sub( L_shl( L_tmp, 1 ), wk1i ); /*Q30 */ -#endif tmp2 = add( l, add( k, m ) ); FOR( j = add( k, m ); j < tmp2; j += 2 ) { -#ifdef BASOP_NOGLOB j1 = add_o( j, l, &Overflow ); j2 = add_o( j1, l, &Overflow ); j3 = add_o( j2, l, &Overflow ); @@ -2698,58 +2223,6 @@ static void cftmdl_16fx( L_tmp = Madd_32_16( L_tmp, wk3i, x0r ); /*Q(15+Qx+Q_edct) */ a[j3 + 1] = round_fx_o( L_shl_o( L_tmp, 1, &Overflow ), &Overflow ); /*Q(Qx+Q_edct) */ move16(); -#else - j1 = add( j, l ); - j2 = add( j1, l ); - j3 = add( j2, l ); - x0r = add( a[j], a[j1] ); - x0i = add( a[j + 1], a[j1 + 1] ); - x1r = sub( a[j], a[j1] ); - x1i = sub( a[j + 1], a[j1 + 1] ); - x2r = add( a[j2], a[j3] ); - x2i = add( a[j2 + 1], a[j3 + 1] ); - x3r = sub( a[j2], a[j3] ); - x3i = sub( a[j2 + 1], a[j3 + 1] ); - a[j] = add( x0r, x2r ); - move16(); - a[j + 1] = add( x0i, x2i ); - move16(); - - x0r = sub( x0r, x2r ); - x0i = sub( x0i, x2i ); - - tmp = negate( x0r ); - L_tmp = Mult_32_16( wk2i, tmp ); /*Q(15+Qx+Q_edct) */ - L_tmp = Msub_32_16( L_tmp, wk2r, x0i ); /*Q(15+Qx+Q_edct) */ - a[j2] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - tmp = negate( x0i ); - L_tmp = Mult_32_16( wk2i, tmp ); /*Q(15+Qx+Q_edct) */ - L_tmp = Madd_32_16( L_tmp, wk2r, x0r ); /*Q(15+Qx+Q_edct) */ - a[j2 + 1] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - x0r = sub( x1r, x3i ); - x0i = add( x1i, x3r ); - - L_tmp = Mult_32_16( wk1r, x0r ); /*Q(15+Qx+Q_edct) */ - L_tmp = Msub_32_16( L_tmp, wk1i, x0i ); /*Q(15+Qx+Q_edct) */ - a[j1] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - L_tmp = Mult_32_16( wk1r, x0i ); /*Q(15+Qx+Q_edct) */ - L_tmp = Madd_32_16( L_tmp, wk1i, x0r ); /*Q(15+Qx+Q_edct) */ - a[j1 + 1] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - x0r = add( x1r, x3i ); - x0i = sub( x1i, x3r ); - - L_tmp = Mult_32_16( wk3r, x0r ); /*Q(15+Qx+Q_edct) */ - L_tmp = Msub_32_16( L_tmp, wk3i, x0i ); /*Q(15+Qx+Q_edct) */ - a[j3] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ - - L_tmp = Mult_32_16( wk3r, x0i ); /*Q(15+Qx+Q_edct) */ - L_tmp = Madd_32_16( L_tmp, wk3i, x0r ); /*Q(15+Qx+Q_edct) */ - a[j3 + 1] = round_fx( L_shl( L_tmp, 1 ) ); /*Q(Qx+Q_edct) */ -#endif } } @@ -2856,11 +2329,7 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n ) /* special case: i = 0 */ acc = L_mult( *RZ0++, 0x4000 /*1.Q14*/ ); // Q15 + Qx acc = L_mac( acc, *RZ1++, 0x4000 /*1.Q14*/ ); // Q15 + Qx -#ifdef BASOP_NOGLOB *RY++ = mac_r_sat( acc, *RZ2++, 0x4000 /*1.Q14*/ ); // Qx -#else - *RY++ = mac_r( acc, *RZ2++, 0x4000 ); -#endif move16(); /* first 3/12-- from 1 to (3*m/8)-1 */ @@ -3456,21 +2925,12 @@ void ifft3_fx( const Word16 Z[] /*Qx*/, Word16 X[] /*Qx*/, const Word16 n ) pX = X; FOR( i = 0; i < m; i++ ) { -#ifdef BASOP_NOGLOB *pX++ = shl_sat( mult_r( *y0++, FFT3_ONE_THIRD ), 1 ); // Qx move16(); *pX++ = shl_sat( mult_r( *y1++, FFT3_ONE_THIRD ), 1 ); // Qx move16(); *pX++ = shl_sat( mult_r( *y2++, FFT3_ONE_THIRD ), 1 ); // Qx move16(); -#else - *pX++ = shl( mult_r( *y0++, FFT3_ONE_THIRD ), 1 ); - move16(); - *pX++ = shl( mult_r( *y1++, FFT3_ONE_THIRD ), 1 ); - move16(); - *pX++ = shl( mult_r( *y2++, FFT3_ONE_THIRD ), 1 ); - move16(); -#endif } return; diff --git a/lib_com/fft_rel.c b/lib_com/fft_rel.c index 88f80e798..85d0ae76a 100644 --- a/lib_com/fft_rel.c +++ b/lib_com/fft_rel.c @@ -361,17 +361,9 @@ void fft_rel_fx( { xt = *x0; move16(); -#ifdef BASOP_NOGLOB *x0 = add_o( xt, *x1, &Overflow ); -#else - *x0 = add( xt, *x1 ); -#endif move16(); -#ifdef BASOP_NOGLOB *x1 = sub_o( xt, *x1, &Overflow ); -#else - *x1 = sub( xt, *x1 ); -#endif move16(); x0++; x0++; @@ -409,17 +401,9 @@ void fft_rel_fx( { xt = *x0; move16(); /* xt = x[i]; */ -#ifdef BASOP_NOGLOB *x0 = add_o( xt, *x1, &Overflow ); -#else /* BASOP_NOGLOB */ - *x0 = add( xt, *x1 ); -#endif /* BASOP_NOGLOB */ move16(); /* x[i] = xt + x[i+n2]; */ -#ifdef BASOP_NOGLOB *x1 = sub_o( xt, *x1, &Overflow ); -#else /* BASOP_NOGLOB */ - *x1 = sub( xt, *x1 ); -#endif /* BASOP_NOGLOB */ move16(); /* x[i+n2] = xt - x[i+n2]; */ *x2 = negate( *x2 ); move16(); /* x[i+n2+n4] = -x[i+n2+n4]; */ @@ -434,33 +418,15 @@ void fft_rel_fx( FOR( j = 1; j < n4; j++ ) { -#ifdef BASOP_NOGLOB t1 = add_o( mult_r( *xi3, *c ), mult_r( *xi4, *s ), &Overflow ); /* t1 = *xi3**(pt_c+ind) + *xi4**(pt_s+ind); Qx */ t2 = sub_o( mult_r( *xi3, *s ), mult_r( *xi4, *c ), &Overflow ); /* t2 = *xi3**(pt_s+ind) - *xi4**(pt_c+ind); Qx */ *xi4 = sub_o( *xi2, t2, &Overflow ); -#else /* BASOP_NOGLOB */ - t1 = add( mult_r( *xi3, *c ), mult_r( *xi4, *s ) ); /* t1 = *xi3**(pt_c+ind) + *xi4**(pt_s+ind); */ - t2 = sub( mult_r( *xi3, *s ), mult_r( *xi4, *c ) ); /* t2 = *xi3**(pt_s+ind) - *xi4**(pt_c+ind); */ - *xi4 = sub( *xi2, t2 ); -#endif /* BASOP_NOGLOB */ move16(); -#ifdef BASOP_NOGLOB *xi3 = negate( add_o( *xi2, t2, &Overflow ) ); -#else /* BASOP_NOGLOB */ - *xi3 = negate( add( *xi2, t2 ) ); -#endif /* BASOP_NOGLOB */ move16(); -#ifdef BASOP_NOGLOB *xi2 = sub_o( *xi1, t1, &Overflow ); -#else /* BASOP_NOGLOB */ - *xi2 = sub( *xi1, t1 ); -#endif /* BASOP_NOGLOB */ move16(); -#ifdef BASOP_NOGLOB *xi1 = add_o( *xi1, t1, &Overflow ); -#else /* BASOP_NOGLOB */ - *xi1 = add( *xi1, t1 ); -#endif /* BASOP_NOGLOB */ move16(); xi4--; diff --git a/lib_com/fft_rel_fx.c b/lib_com/fft_rel_fx.c index 1285049bc..5461ce55b 100644 --- a/lib_com/fft_rel_fx.c +++ b/lib_com/fft_rel_fx.c @@ -136,26 +136,15 @@ static void c_fft_fx( input_ptr1 = in_ptr + ( const Word16 )( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); -#ifdef BASOP_NOGLOB tmp1 = msu_r_sat( L_tmp1, *input_ptr1, 16384 ); tmp3 = mac_r_sat( L_tmp1, *input_ptr1++, 16384 ); -#else - tmp1 = msu_r( L_tmp1, *input_ptr1, 16384 ); - tmp3 = mac_r( L_tmp1, *input_ptr1++, 16384 ); -#endif input_ptr2 = in_ptr + ( const Word16 )( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); input_ptr3 = in_ptr + ( const Word16 )( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); L_tmp1 = L_mult( *input_ptr2++, 16384 ); -#ifdef BASOP_NOGLOB tmp2 = mac_r_sat( L_tmp1, *input_ptr3, 16384 ); tmp4 = msu_r_sat( L_tmp1, *input_ptr3++, 16384 ); -#else - tmp2 = mac_r( L_tmp1, *input_ptr3, 16384 ); - tmp4 = msu_r( L_tmp1, *input_ptr3++, 16384 ); -#endif L_tmp1 = L_mult( tmp3, 16384 ); -#ifdef BASOP_NOGLOB out_ptr[k] = mac_r_sat( L_tmp1, tmp2, 16384 ); move16(); out_ptr[k + 4] = msu_r_sat( L_tmp1, tmp2, 16384 ); @@ -163,57 +152,25 @@ static void c_fft_fx( tmp2 = mac_r_sat( L_tmp2, *input_ptr1, 16384 ); tmp3 = msu_r_sat( L_tmp2, *input_ptr1, 16384 ); -#else - out_ptr[k] = mac_r( L_tmp1, tmp2, 16384 ); - move16(); - out_ptr[k + 4] = msu_r( L_tmp1, tmp2, 16384 ); - move16(); - - tmp2 = mac_r( L_tmp2, *input_ptr1, 16384 ); - tmp3 = msu_r( L_tmp2, *input_ptr1, 16384 ); -#endif L_tmp2 = L_mult( *input_ptr2, 16384 ); L_tmp1 = L_mult( tmp1, 16384 ); -#ifdef BASOP_NOGLOB tmp1 = msu_r_sat( L_tmp2, *input_ptr3, 16384 ); out_ptr[k + 2] = mac_r_sat( L_tmp1, tmp1, 16384 ); move16(); out_ptr[k + 6] = msu_r_sat( L_tmp1, tmp1, 16384 ); move16(); -#else - tmp1 = msu_r( L_tmp2, *input_ptr3, 16384 ); - out_ptr[k + 2] = mac_r( L_tmp1, tmp1, 16384 ); - move16(); - out_ptr[k + 6] = msu_r( L_tmp1, tmp1, 16384 ); - move16(); -#endif L_tmp1 = L_mult( tmp2, 16384 ); -#ifdef BASOP_NOGLOB tmp2 = mac_r_sat( L_tmp2, *input_ptr3, 16384 ); out_ptr[k + 1] = mac_r_sat( L_tmp1, tmp2, 16384 ); move16(); out_ptr[k + 5] = msu_r_sat( L_tmp1, tmp2, 16384 ); move16(); -#else - tmp2 = mac_r( L_tmp2, *input_ptr3, 16384 ); - out_ptr[k + 1] = mac_r( L_tmp1, tmp2, 16384 ); - move16(); - out_ptr[k + 5] = msu_r( L_tmp1, tmp2, 16384 ); - move16(); -#endif L_tmp1 = L_mult( tmp3, 16384 ); -#ifdef BASOP_NOGLOB out_ptr[k + 3] = msu_r_sat( L_tmp1, tmp4, 16384 ); move16(); out_ptr[k + 7] = mac_r_sat( L_tmp1, tmp4, 16384 ); move16(); -#else - out_ptr[k + 3] = msu_r( L_tmp1, tmp4, 16384 ); - move16(); - out_ptr[k + 7] = mac_r( L_tmp1, tmp4, 16384 ); - move16(); -#endif } /* Remaining Stages */ @@ -333,7 +290,6 @@ static void c_fft_fx( kj = add( k, jj ); /* kj is butterfly bottom */ /* Butterfly computations */ -#ifdef BASOP_NOGLOB tmp1 = mac_r_sat( L_mult_sat( out_ptr[kj], table_ptr[ji] ), out_ptr[kj + 1], table_ptr[ji + 1] ); tmp2 = msu_r_sat( L_mult_sat( out_ptr[kj + 1], table_ptr[ji] ), out_ptr[kj], table_ptr[ji + 1] ); @@ -346,22 +302,6 @@ static void c_fft_fx( move16(); out_ptr[k + 1] = add_sat( out_ptr[k + 1], tmp2 ); move16(); -#else - tmp1 = mac_r( L_mult( out_ptr[kj], table_ptr[ji] ), - out_ptr[kj + 1], table_ptr[ji + 1] ); - - tmp2 = msu_r( L_mult( out_ptr[kj + 1], table_ptr[ji] ), - out_ptr[kj], table_ptr[ji + 1] ); - - out_ptr[kj] = sub( out_ptr[k], tmp1 ); - move16(); - out_ptr[kj + 1] = sub( out_ptr[k + 1], tmp2 ); - move16(); - out_ptr[k] = add( out_ptr[k], tmp1 ); - move16(); - out_ptr[k + 1] = add( out_ptr[k + 1], tmp2 ); - move16(); -#endif } ji = add( ji, ii ); } @@ -420,7 +360,6 @@ void r_fft_fx_lc( FOR( i = 2; i <= SIZE2; i += 2 ) { Ltmp1_imag = L_mult( temp[i + 1], 16384 ); -#ifdef BASOP_NOGLOB Ltmp1_imag = L_msu_sat( Ltmp1_imag, *ptrDn, 16384 ); tmp2_real = add_sat( temp[i + 1], *ptrDn-- ); @@ -439,26 +378,6 @@ void r_fft_fx_lc( move16(); *ptRealDn-- = mac_r_sat( Ltmp1_real, tmp2_real, *phstbl_ptrDn-- ); move16(); -#else - Ltmp1_imag = L_msu( Ltmp1_imag, *ptrDn, 16384 ); - tmp2_real = add( temp[i + 1], *ptrDn-- ); - - Ltmp1_real = L_mult( temp[i], 16384 ); - Ltmp1_real = L_mac( Ltmp1_real, *ptrDn, 16384 ); - tmp2_imag = sub( *ptrDn--, temp[i] ); - - - *ptRealUp++ = msu_r( L_mac( Ltmp1_real, tmp2_real, phs_tbl[i] ), tmp2_imag, phs_tbl[i + 1] ); - move16(); - *ptImaDn-- = mac_r( L_mac( Ltmp1_imag, tmp2_imag, phs_tbl[i] ), tmp2_real, phs_tbl[i + 1] ); - move16(); - Ltmp1 = L_mac( L_negate( Ltmp1_imag ), tmp2_real, *phstbl_ptrDn ); - Ltmp1_real = L_mac( Ltmp1_real, tmp2_imag, *phstbl_ptrDn-- ); - *ptImaUp++ = msu_r( Ltmp1, tmp2_imag, *phstbl_ptrDn ); - move16(); - *ptRealDn-- = mac_r( Ltmp1_real, tmp2_real, *phstbl_ptrDn-- ); - move16(); -#endif } } ELSE /* The ifFT part */ @@ -486,7 +405,6 @@ void r_fft_fx_lc( /* Now, handle the remaining positive frequencies */ FOR( i = 2; i <= SIZE2; i += 2 ) { -#ifdef BASOP_NOGLOB Ltmp1_imag = L_mult( *ptImaDn, 16384 ); Ltmp1_imag = L_msu_sat( Ltmp1_imag, *ptImaUp, 16384 ); tmp2_real = add_sat( *ptImaDn--, *ptImaUp++ ); @@ -503,26 +421,6 @@ void r_fft_fx_lc( move16(); *ptrDn-- = msu_r_sat( Ltmp1_real, tmp2_real, *phstbl_ptrDn-- ); move16(); -#else - Ltmp1_imag = L_mult( *ptImaDn, 16384 ); - Ltmp1_imag = L_msu( Ltmp1_imag, *ptImaUp, 16384 ); - tmp2_real = add( *ptImaDn--, *ptImaUp++ ); - Ltmp1_real = L_mult( *ptRealUp, 16384 ); - Ltmp1_real = L_mac( Ltmp1_real, *ptRealDn, 16384 ); - tmp2_imag = sub( *ptRealUp++, *ptRealDn-- ); - - - temp[i] = mac_r( L_msu( Ltmp1_real, tmp2_real, phs_tbl[i] ), tmp2_imag, phs_tbl[i + 1] ); - move16(); - temp[i + 1] = mac_r( L_mac( Ltmp1_imag, tmp2_imag, phs_tbl[i] ), tmp2_real, phs_tbl[i + 1] ); - move16(); - Ltmp1 = L_mac( L_negate( Ltmp1_imag ), tmp2_real, *phstbl_ptrDn ); - Ltmp1_real = L_msu( Ltmp1_real, tmp2_imag, *phstbl_ptrDn-- ); - *ptrDn-- = msu_r( Ltmp1, tmp2_imag, *phstbl_ptrDn ); - move16(); - *ptrDn-- = msu_r( Ltmp1_real, tmp2_real, *phstbl_ptrDn-- ); - move16(); -#endif } /* Perform the complex ifFT */ diff --git a/lib_com/frame_ener.c b/lib_com/frame_ener.c index 03e31126a..5b37a5606 100644 --- a/lib_com/frame_ener.c +++ b/lib_com/frame_ener.c @@ -202,18 +202,10 @@ Word16 frame_ener_fx( { pos = sub( L_frame, L_frame2 ); } -#ifdef BASOP_NOGLOB Ltmp = L_mult_sat( synth[pos], synth[pos] ); /*2 * Qnew + 1*/ -#else - Ltmp = L_mult( synth[pos], synth[pos] ); -#endif FOR( i = 1; i < L_frame2; i++ ) { -#ifdef BASOP_NOGLOB Ltmp = L_mac_sat( Ltmp, synth[pos + i], synth[pos + i] ); /*2 * Qnew + 1*/ -#else /* BASOP_NOGLOB */ - Ltmp = L_mac( Ltmp, synth[pos + i], synth[pos + i] ); -#endif } test(); IF( EQ_32( Ltmp, MAX_32 ) || enc != 0 ) @@ -296,11 +288,7 @@ Word16 frame_energy_fx( /* o : Frame energy in Q8 /* len = (0.5f * (pitch[2]/64.0 + pitch[3]/64.0) + 0.5f) */ -#ifdef BASOP_NOGLOB len = mult_r( add_o( pitch[2], pitch[3], &Overflow ), 256 ); -#else - len = mult_r( add( pitch[2], pitch[3] ), 256 ); -#endif if ( LT_16( len, L_SUBFR ) ) { @@ -331,29 +319,15 @@ Word16 frame_energy_fx( /* o : Frame energy in Q8 /*add ld(2^exp1)=exp1 but check format, first*/ tmp16 = sub( sub( 15, norm_s( exp1 ) ), 5 ); /*factor to shift Ltmp and exp1 with (shr) to avoid overflows when adding*/ -#ifdef BASOP_NOGLOB Ltmp = L_shr_o( Ltmp, tmp16, &Overflow ); /*Q25, tmp16*/ -#else - Ltmp = L_shr( Ltmp, tmp16 ); /*Q25, tmp16*/ -#endif exp2 = shr( exp1, tmp16 ); /*Q0 , tmp16*/ -#ifdef BASOP_NOGLOB Ltmp = L_add_o( Ltmp, L_shl( L_deposit_l( exp2 ), 25 ), &Overflow ); /*Q25, tmp16, normalized*/ -#else - Ltmp = L_add( Ltmp, L_shl( L_deposit_l( exp2 ), 25 ) ); /*Q25, tmp16, normalized*/ -#endif /*make 10*log10 out of log2*/ Ltmp = Mpy_32_16_1( Ltmp, LG10 ); /*Q25,tmp16 * Q13 = Q23, tmp16*/ -#ifdef BASOP_NOGLOB *frame_ener = extract_h( L_shl_o( Ltmp, add( tmp16, 1 ), &Overflow ) ); /*Q8*/ move16(); enern = sub_o( *frame_ener, lp_speech, &Overflow ); /*Q8*/ -#else - *frame_ener = extract_h( L_shl( Ltmp, add( tmp16, 1 ) ) ); /*Q8*/ - move16(); - enern = sub( *frame_ener, lp_speech ); /*Q8*/ -#endif return enern; } diff --git a/lib_com/frame_ener_fx.c b/lib_com/frame_ener_fx.c index e9075a024..2dd5fed56 100644 --- a/lib_com/frame_ener_fx.c +++ b/lib_com/frame_ener_fx.c @@ -161,18 +161,10 @@ Word16 frame_ener_fx( { pos = sub( L_frame, L_frame2 ); } -#ifdef BASOP_NOGLOB Ltmp = L_mult_sat( synth[pos], synth[pos] ); /*2 * Qnew + 1*/ -#else - Ltmp = L_mult( synth[pos], synth[pos] ); -#endif FOR( i = 1; i < L_frame2; i++ ) { -#ifdef BASOP_NOGLOB Ltmp = L_mac_sat( Ltmp, synth[pos + i], synth[pos + i] ); /*2 * Qnew + 1*/ -#else /* BASOP_NOGLOB */ - Ltmp = L_mac( Ltmp, synth[pos + i], synth[pos + i] ); -#endif } test(); IF( EQ_32( Ltmp, MAX_32 ) || enc != 0 ) @@ -255,11 +247,7 @@ Word16 frame_energy_fx( /* o : Frame energy in Q8 /* len = (0.5f * (pitch[2]/64.0 + pitch[3]/64.0) + 0.5f) */ -#ifdef BASOP_NOGLOB len = mult_r( add_o( pitch[2], pitch[3], &Overflow ), 256 ); -#else - len = mult_r( add( pitch[2], pitch[3] ), 256 ); -#endif if ( LT_16( len, L_SUBFR ) ) { @@ -290,29 +278,15 @@ Word16 frame_energy_fx( /* o : Frame energy in Q8 /*add ld(2^exp1)=exp1 but check format, first*/ tmp16 = sub( sub( 15, norm_s( exp1 ) ), 5 ); /*factor to shift Ltmp and exp1 with (shr) to avoid overflows when adding*/ -#ifdef BASOP_NOGLOB Ltmp = L_shr_o( Ltmp, tmp16, &Overflow ); /*Q25, tmp16*/ -#else - Ltmp = L_shr( Ltmp, tmp16 ); /*Q25, tmp16*/ -#endif exp2 = shr( exp1, tmp16 ); /*Q0 , tmp16*/ -#ifdef BASOP_NOGLOB Ltmp = L_add_o( Ltmp, L_shl( L_deposit_l( exp2 ), 25 ), &Overflow ); /*Q25, tmp16, normalized*/ -#else - Ltmp = L_add( Ltmp, L_shl( L_deposit_l( exp2 ), 25 ) ); /*Q25, tmp16, normalized*/ -#endif /*make 10*log10 out of log2*/ Ltmp = Mpy_32_16_1( Ltmp, LG10 ); /*Q25,tmp16 * Q13 = Q23, tmp16*/ -#ifdef BASOP_NOGLOB *frame_ener = extract_h( L_shl_o( Ltmp, add( tmp16, 1 ), &Overflow ) ); /*Q8*/ move16(); enern = sub_o( *frame_ener, lp_speech, &Overflow ); /*Q8*/ -#else - *frame_ener = extract_h( L_shl( Ltmp, add( tmp16, 1 ) ) ); /*Q8*/ - move16(); - enern = sub( *frame_ener, lp_speech ); /*Q8*/ -#endif return enern; } diff --git a/lib_com/get_gain.c b/lib_com/get_gain.c index d222bd68d..bf4c1adfb 100644 --- a/lib_com/get_gain.c +++ b/lib_com/get_gain.c @@ -98,13 +98,8 @@ Word32 get_gain( /* output: codebook gain (adaptive or fixed) tcorr = Dot_product16HQ( 0, x, y, n, &exp_c ); tener = Dot_productSq16HQ( 0, y, n, &exp_e ); -#ifdef BASOP_NOGLOB BASOP_Util_Divide_MantExp( round_fx_o( tcorr, &Overflow ), exp_c, s_max( round_fx_o( tener, &Overflow ), 1 ), exp_e, &tmp, &exp ); Lgain = L_shl_o( L_deposit_l( tmp ) /*Q15*/, add( 1, exp ), &Overflow ) /*Q16*/; -#else - BASOP_Util_Divide_MantExp( round_fx( tcorr ), exp_c, s_max( round_fx( tener ), 1 ), exp_e, &tmp, &exp ); - Lgain = L_shl( L_deposit_l( tmp ) /*Q15*/, add( 1, exp ) ) /*Q16*/; -#endif return Lgain; } @@ -163,11 +158,7 @@ Word32 get_gain2( /* output: codebook gain (adaptive or fixed) Q_corr = sub( Q_corr, Q_ener ); -#ifdef BASOP_NOGLOB Lgain = L_shl_o( L_deposit_l( m_corr ), add( Q_corr, 1 ), &Overflow ); /* Lgain in Q16 */ -#else - Lgain = L_shl( L_deposit_l( m_corr ), add( Q_corr, 1 ) ); /* Lgain in Q16 */ -#endif if ( negative != 0 ) { diff --git a/lib_com/get_gain_fx.c b/lib_com/get_gain_fx.c index be4d063e7..66abe96ae 100644 --- a/lib_com/get_gain_fx.c +++ b/lib_com/get_gain_fx.c @@ -71,13 +71,8 @@ Word32 get_gain( /* output: codebook gain (adaptive or fixed) tcorr = Dot_product16HQ( 0, x, y, n, &exp_c ); tener = Dot_productSq16HQ( 0, y, n, &exp_e ); -#ifdef BASOP_NOGLOB BASOP_Util_Divide_MantExp( round_fx_o( tcorr, &Overflow ), exp_c, s_max( round_fx_o( tener, &Overflow ), 1 ), exp_e, &tmp, &exp ); Lgain = L_shl_o( L_deposit_l( tmp ) /*Q15*/, add( 1, exp ), &Overflow ) /*Q16*/; -#else - BASOP_Util_Divide_MantExp( round_fx( tcorr ), exp_c, s_max( round_fx( tener ), 1 ), exp_e, &tmp, &exp ); - Lgain = L_shl( L_deposit_l( tmp ) /*Q15*/, add( 1, exp ) ) /*Q16*/; -#endif return Lgain; } @@ -136,11 +131,7 @@ Word32 get_gain2( /* output: codebook gain (adaptive or fixed) Q_corr = sub( Q_corr, Q_ener ); -#ifdef BASOP_NOGLOB Lgain = L_shl_o( L_deposit_l( m_corr ), add( Q_corr, 1 ), &Overflow ); /* Lgain in Q16 */ -#else - Lgain = L_shl( L_deposit_l( m_corr ), add( Q_corr, 1 ) ); /* Lgain in Q16 */ -#endif if ( negative != 0 ) { diff --git a/lib_com/gs_bitallocation_fx.c b/lib_com/gs_bitallocation_fx.c index 5bd82fdab..5065ab7e0 100644 --- a/lib_com/gs_bitallocation_fx.c +++ b/lib_com/gs_bitallocation_fx.c @@ -95,11 +95,7 @@ void bands_and_bit_alloc_fx( set16_fx( out_bits_per_bands, 0, MBANDS_GN_BITALLOC16k ); /* To adapt current energy band to PVQ freq band for sorting*/ -#ifdef BASOP_NOGLOB ener_vec[0] = add_o( Ener_per_bd_iQ[0], Ener_per_bd_iQ[1], &Overflow ); /*Q12 */ -#else /* BASOP_NOGLOB */ - ener_vec[0] = add( Ener_per_bd_iQ[0], Ener_per_bd_iQ[1] ); /*Q12 */ -#endif Copy( Ener_per_bd_iQ_tmp + 1, ener_vec, MBANDS_GN - 1 ); /*Q12 */ ener_vec[MBANDS_GN - 1] = ener_vec[MBANDS_GN - 2]; move16(); diff --git a/lib_com/gs_bitallocation_ivas_fx.c b/lib_com/gs_bitallocation_ivas_fx.c index 787d562c7..0ab167015 100644 --- a/lib_com/gs_bitallocation_ivas_fx.c +++ b/lib_com/gs_bitallocation_ivas_fx.c @@ -122,11 +122,7 @@ void bands_and_bit_alloc_ivas_fx( set16_fx( out_bits_per_bands, 0, MBANDS_GN_BITALLOC16k ); /* To adapt current energy band to PVQ freq band for sorting*/ -#ifdef BASOP_NOGLOB ener_vec[0] = add_o( Ener_per_bd_iQ[0], Ener_per_bd_iQ[1], &Overflow ); /*Q12 */ -#else /* BASOP_NOGLOB */ - ener_vec[0] = add( Ener_per_bd_iQ[0], Ener_per_bd_iQ[1] ); /*Q12 */ -#endif move16(); Copy( Ener_per_bd_iQ + 1, ener_vec, MBANDS_GN - 1 ); /*Q12 */ ener_vec[MBANDS_GN - 1] = ener_vec[MBANDS_GN - 2]; diff --git a/lib_com/gs_gains_fx.c b/lib_com/gs_gains_fx.c index 8e603e15c..376f2560f 100644 --- a/lib_com/gs_gains_fx.c +++ b/lib_com/gs_gains_fx.c @@ -104,13 +104,8 @@ void Comp_and_apply_gain_fx( FOR( i = StartBin; i < NB_Qbins + StartBin; i++ ) { -#ifdef BASOP_NOGLOB L32 = L_shl_o( L_mult( exc_diffQ[i], y_gain ), tmp_exp, &Overflow ); /*Q_exc+16 */ exc_diffQ[i] = round_fx_o( L32, &Overflow ); /*Q_exc */ -#else /* BASOP_NOGLOB */ - L32 = L_shl( L_mult( exc_diffQ[i], y_gain ), tmp_exp ); /*Q_exc+16 */ - exc_diffQ[i] = round_fx( L32 ); /*Q_exc */ -#endif /* BASOP_NOGLOB */ move16(); } } @@ -127,23 +122,15 @@ void Comp_and_apply_gain_fx( y_gain = extract_l( Pow2( 14, frac ) ); /* Put 14 as exponent so that */ /* output of Pow2() will be: */ /* 16384 < Pow2() <= 32767 */ -#ifdef BASOP_NOGLOB Ener_per_bd_yQ[i_band] = shl_o( y_gain, sub( exp1, 13 ), &Overflow ); -#else /* BASOP_NOGLOB */ - Ener_per_bd_yQ[i_band] = shl( y_gain, sub( exp1, 13 ) ); -#endif /* BASOP_NOGLOB */ move16(); /*Q1 */ tmp_exp = add( add( exp1, 1 ), sub( Q_exc, Qexc_diff ) ); FOR( i = StartBin; i < NB_Qbins + StartBin; i++ ) { L32 = L_mult( exc_diffQ[i], y_gain ); /*Qexc_diff+15 */ -#ifdef BASOP_NOGLOB exc_diffQ[i] = round_fx_o( L_shl_o( L32, tmp_exp, &Overflow ), &Overflow ); /*Q_exc */ move16(); -#else /* BASOP_NOGLOB */ - exc_diffQ[i] = round_fx( L_shl( L32, tmp_exp ) ); /*Q_exc */ -#endif } } } @@ -190,13 +177,8 @@ void Comp_and_apply_gain_ivas_fx( FOR( i = StartBin; i < NB_Qbins + StartBin; i++ ) { -#ifdef BASOP_NOGLOB L32 = L_mult( exc_diffQ[i], y_gain ); /*Q_exc+16-tmp_exp */ exc_diffQ[i] = round_fx_o( L32, &Overflow ); /*Q_exc-tmp_exp */ -#else /* BASOP_NOGLOB */ - L32 = L_mult( exc_diffQ[i], y_gain ); /*Q_exc+16 */ - exc_diffQ[i] = round_fx( L32 ); /*Q_exc */ -#endif /* BASOP_NOGLOB */ move16(); IF( exc_diffQ[i] ) { @@ -222,22 +204,14 @@ void Comp_and_apply_gain_ivas_fx( y_gain = extract_l( Pow2( 14, frac ) ); /* Put 14 as exponent so that */ /* output of Pow2() will be: */ /* 16384 < Pow2() <= 32767 */ -#ifdef BASOP_NOGLOB Ener_per_bd_yQ[i_band] = shl_o( y_gain, sub( exp1, 13 ), &Overflow ); /*Q13*/ -#else /* BASOP_NOGLOB */ - Ener_per_bd_yQ[i_band] = shl( y_gain, sub( exp1, 13 ) ); -#endif /* BASOP_NOGLOB */ move16(); /*Q1 */ tmp_exp = add( add( exp1, 1 ), sub( *Q_exc, Qexc_diff ) ); FOR( i = StartBin; i < NB_Qbins + StartBin; i++ ) { L32 = L_mult( exc_diffQ[i], y_gain ); /*Qexc_diff+15 */ -#ifdef BASOP_NOGLOB exc_diffQ[i] = round_fx_o( L32, &Overflow ); /*Q_exc-tmp_exp */ -#else /* BASOP_NOGLOB */ - exc_diffQ[i] = round_fx( L_shl( L32, tmp_exp ) ); /*Q_exc */ -#endif move16(); IF( exc_diffQ[i] ) { diff --git a/lib_com/gs_inact_switching_fx.c b/lib_com/gs_inact_switching_fx.c index 18bff8d43..89d879974 100644 --- a/lib_com/gs_inact_switching_fx.c +++ b/lib_com/gs_inact_switching_fx.c @@ -130,13 +130,8 @@ void Inac_swtch_ematch_fx( FOR( j = 0; j < 8; j++ ) { L_tmp = L_mult( *pt_exc, ftmp ); /* Q_exc*Q0 -> Q(Q_exc+1) */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, add( exp, 15 ) ); /* Q(Q_exc+1) -> Q(16+Q_exc)*/ *pt_exc = round_fx_sat( L_tmp ); -#else - L_tmp = L_shl( L_tmp, add( exp, 15 ) ); /* Q(Q_exc+1) -> Q(16+Q_exc)*/ - *pt_exc = round_fx( L_tmp ); -#endif move16(); pt_exc++; } @@ -146,13 +141,8 @@ void Inac_swtch_ematch_fx( FOR( j = 0; j < 16; j++ ) { L_tmp = L_mult( *pt_exc, ftmp ); /* Q_exc*Q0 -> Q(Q_exc+1) */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, add( exp, 15 ) ); /* Q(Q_exc+1) -> Q(16+Q_exc)*/ *pt_exc = round_fx_sat( L_tmp ); /*Q_exc*/ -#else - L_tmp = L_shl( L_tmp, add( exp, 15 ) ); /* Q(Q_exc+1) -> Q(16+Q_exc)*/ - *pt_exc = round_fx( L_tmp ); /*Q_exc*/ -#endif move16(); pt_exc++; } diff --git a/lib_com/gs_noisefill_fx.c b/lib_com/gs_noisefill_fx.c index 3761debf2..b5b8fe9ba 100644 --- a/lib_com/gs_noisefill_fx.c +++ b/lib_com/gs_noisefill_fx.c @@ -472,11 +472,7 @@ static void Decreas_freqPeak_fx( exp = norm_s( max_val ); tmp1 = div_s( shl( 1, sub( 14, exp ) ), max_val ); /*Q(29 - exp - Q_exc) */ L_tmp = L_mult( tmp, tmp1 ); /*Q(30 - exp) */ -#ifdef BASOP_NOGLOB tmp = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); /*Q14 */ -#else - tmp = round_fx( L_shl( L_tmp, exp ) ); /*Q14 */ -#endif tmp = sub( 32767, tmp ); /*Q14 */ L_tmp = L_mult( avrg, tmp ); /*Q_exc +15 */ @@ -569,11 +565,7 @@ static void envelop_modify_fx( /* output of Pow2() will be: */ /* 16384 < Pow2() <= 32767 */ exp = sub( exp, 14 ); -#ifdef BASOP_NOGLOB Ener1_fx = mult_ro( 13107, shl_o( tmp, exp, &Overflow ), &Overflow ); /*Q0 */ -#else /* BASOP_NOGLOB */ - Ener1_fx = mult_r( 13107, shl( tmp, exp ) ); /*Q0 */ -#endif /* BASOP_NOGLOB */ FOR( j = 0; j < 16; j++ ) { @@ -599,11 +591,7 @@ static void envelop_modify_fx( /* output of Pow2() will be: */ /* 16384 < Pow2() <= 32767 */ exp = sub( exp, 14 ); -#ifdef BASOP_NOGLOB Ener1_fx = mult_r( 13107, shl_o( tmp, exp, &Overflow ) ); /*Q0 */ -#else /* BASOP_NOGLOB */ - Ener1_fx = mult_r( 13107, shl( tmp, exp ) ); /*Q0 */ -#endif /* BASOP_NOGLOB */ src_fx = &exc_diffQ_fx[224]; FOR( j = 0; j < 32; j++ ) @@ -720,17 +708,9 @@ void highband_exc_dct_in_fx( /* output of Pow2() will be: */ /* 16384 < Pow2() <= 32767 */ exp = sub( exp, 14 ); -#ifdef BASOP_NOGLOB tmp1 = shl_o( tmp, exp, &Overflow ); -#else /* BASOP_NOGLOB */ - tmp1 = shl( tmp, exp ); -#endif /* BASOP_NOGLOB */ move16(); -#ifdef BASOP_NOGLOB ener = add_o( tmp1, ener, &Overflow ); /*Q0 */ -#else /* BASOP_NOGLOB */ - ener = add( tmp1, ener ); /*Q0 */ -#endif /* BASOP_NOGLOB */ } test(); @@ -1022,11 +1002,7 @@ void highband_exc_dct_in_fx( tmp = mult_r( 17564, shl( i, 6 ) ); /*0.067 in Q18 and i in Q6= Q9 */ tmp = sub( tmp, 7680 ); /*15 in Q9 = Q9 */ L_tmp = L_mult( exc_dct_in[i], tmp ); /*Q(Q_exc+10) */ -#ifdef BASOP_NOGLOB exc_dct_in[i] = round_fx_o( L_shl_o( L_tmp, 6, &Overflow ), &Overflow ); /*Q_exc */ -#else /* BASOP_NOGLOB */ - exc_dct_in[i] = round_fx( L_shl( L_tmp, 6 ) ); /*Q_exc */ -#endif /* BASOP_NOGLOB */ } } @@ -1061,15 +1037,9 @@ void highband_exc_dct_in_fx( IF( GT_16( tmp, abs_s( *dst ) ) ) { tmp2 = *src; -#ifdef BASOP_NOGLOB *src = mult_r( 16384, sub_o( *src, abs_s( *dst ), &Overflow ) ); /*Q_exc */ move16(); tmp = mult_r( 16384, add_o( tmp2, abs_s( *dst ), &Overflow ) ); /*Q_exc */ -#else /* BASOP_NOGLOB */ - *src = mult_r( 16384, sub( *src, abs_s( *dst ) ) ); /*Q_exc */ - move16(); - tmp = mult_r( 16384, add( tmp2, abs_s( *dst ) ) ); /*Q_exc */ -#endif if ( tmp2 > 0 ) { *src = tmp; @@ -1176,17 +1146,9 @@ void highband_exc_dct_in_ivas_fx( /* output of Pow2() will be: */ /* 16384 < Pow2() <= 32767 */ exp = sub( exp, 14 ); -#ifdef BASOP_NOGLOB tmp1 = shl_o( tmp, exp, &Overflow ); -#else /* BASOP_NOGLOB */ - tmp1 = shl( tmp, exp ); -#endif /* BASOP_NOGLOB */ move16(); -#ifdef BASOP_NOGLOB ener = add_o( tmp1, ener, &Overflow ); /*Q0 */ -#else /* BASOP_NOGLOB */ - ener = add( tmp1, ener ); /*Q0 */ -#endif /* BASOP_NOGLOB */ } test(); @@ -1536,11 +1498,7 @@ void highband_exc_dct_in_ivas_fx( tmp = mult_r( 17564, shl( i, 6 ) ); /*0.067 in Q18 and i in Q6= Q9 */ tmp = sub( tmp, 7680 ); /*15 in Q9 = Q9 */ L_tmp = L_mult( exc_dct_in[i], tmp ); /*Q(Q_exc+10) */ -#ifdef BASOP_NOGLOB exc_dct_in[i] = round_fx_o( L_shl_o( L_tmp, 6, &Overflow ), &Overflow ); /*Q_exc */ -#else /* BASOP_NOGLOB */ - exc_dct_in[i] = round_fx( L_shl( L_tmp, 6 ) ); /*Q_exc */ -#endif /* BASOP_NOGLOB */ } } @@ -1575,15 +1533,9 @@ void highband_exc_dct_in_ivas_fx( IF( GT_16( tmp, abs_s( *dst ) ) ) { tmp2 = *src; -#ifdef BASOP_NOGLOB *src = mult_r( 16384, sub_o( *src, abs_s( *dst ), &Overflow ) ); /*Q_exc */ move16(); tmp = mult_r( 16384, add_o( tmp2, abs_s( *dst ), &Overflow ) ); /*Q_exc */ -#else /* BASOP_NOGLOB */ - *src = mult_r( 16384, sub( *src, abs_s( *dst ) ) ); /*Q_exc */ - move16(); - tmp = mult_r( 16384, add( tmp2, abs_s( *dst ) ) ); /*Q_exc */ -#endif IF( tmp2 > 0 ) { *src = tmp; diff --git a/lib_com/gs_preech.c b/lib_com/gs_preech.c index 092558fb8..a2b2405db 100644 --- a/lib_com/gs_preech.c +++ b/lib_com/gs_preech.c @@ -195,11 +195,7 @@ void pre_echo_att_fx( etmp_fx = L_shr( etmp_fx, add( 2 + 1 - 4, shl( Q_new, 1 ) ) ); /*2*Q_new+1 //INV_ATT_SEG_LEN=1/4(=shr(x,2)) -> Q4 */ etmp1_fx = etmp_fx; move32(); -#ifdef BASOP_NOGLOB *Last_frame_ener_fx = L_shl_sat( *Last_frame_ener_fx, 2 ); -#else - *Last_frame_ener_fx = L_shl( *Last_frame_ener_fx, 2 ); -#endif move32(); /*2*Q_new+1 */ /* If the maximum normalized energy > last frame energy + 6dB */ @@ -227,11 +223,7 @@ void pre_echo_att_fx( exp = sub( n1, n2 ); frac1 = round_fx( L_shl( etmp_fx, n1 ) ); -#ifdef BASOP_NOGLOB frac2 = round_fx_sat( L_shl_sat( *Last_frame_ener_fx, n2 ) ); -#else - frac2 = round_fx( L_shl( *Last_frame_ener_fx, n2 ) ); -#endif L_tmp = L_mult0( 128, div_s( frac1, frac2 ) ); /* s = gain_out / gain_in */ L_tmp = L_shr( L_tmp, exp ); /* add exponent */ @@ -320,11 +312,7 @@ void pre_echo_att_ivas_fx( etmp_fx = L_shr( etmp_fx, add( 2 + 1 - 4, shl( Q_new, 1 ) ) ); /*2*Q_new+1 //INV_ATT_SEG_LEN=1/4(=shr(x,2)) -> Q4 */ etmp1_fx = etmp_fx; move32(); -#ifdef BASOP_NOGLOB *Last_frame_ener_fx = L_shl_sat( *Last_frame_ener_fx, 2 ); -#else - *Last_frame_ener_fx = L_shl( *Last_frame_ener_fx, 2 ); -#endif move32(); /*2*Q_new+1 */ /* If the maximum normalized energy > last frame energy + 6dB */ @@ -352,11 +340,7 @@ void pre_echo_att_ivas_fx( exp = sub( n1, n2 ); frac1 = round_fx( L_shl( etmp_fx, n1 ) ); -#ifdef BASOP_NOGLOB frac2 = round_fx_sat( L_shl_sat( *Last_frame_ener_fx, n2 ) ); -#else - frac2 = round_fx( L_shl( *Last_frame_ener_fx, n2 ) ); -#endif L_tmp = L_mult0( 128, div_s( frac1, frac2 ) ); /* s = gain_out / gain_in */ L_tmp = L_shr( L_tmp, exp ); /* add exponent */ diff --git a/lib_com/gs_preech_fx.c b/lib_com/gs_preech_fx.c index 548cba204..a75604a14 100644 --- a/lib_com/gs_preech_fx.c +++ b/lib_com/gs_preech_fx.c @@ -101,11 +101,7 @@ void pre_echo_att_fx( etmp_fx = L_shr( etmp_fx, add( 2 + 1 - 4, shl( Q_new, 1 ) ) ); /*2*Q_new+1 //INV_ATT_SEG_LEN=1/4(=shr(x,2)) -> Q4 */ etmp1_fx = etmp_fx; move32(); -#ifdef BASOP_NOGLOB *Last_frame_ener_fx = L_shl_sat( *Last_frame_ener_fx, 2 ); -#else - *Last_frame_ener_fx = L_shl( *Last_frame_ener_fx, 2 ); -#endif move32(); /*2*Q_new+1 */ /* If the maximum normalized energy > last frame energy + 6dB */ @@ -133,11 +129,7 @@ void pre_echo_att_fx( exp = sub( n1, n2 ); frac1 = round_fx( L_shl( etmp_fx, n1 ) ); -#ifdef BASOP_NOGLOB frac2 = round_fx_sat( L_shl_sat( *Last_frame_ener_fx, n2 ) ); -#else - frac2 = round_fx( L_shl( *Last_frame_ener_fx, n2 ) ); -#endif L_tmp = L_mult0( 128, div_s( frac1, frac2 ) ); /* s = gain_out / gain_in */ L_tmp = L_shr( L_tmp, exp ); /* add exponent */ @@ -226,11 +218,7 @@ void pre_echo_att_ivas_fx( etmp_fx = L_shr( etmp_fx, add( 2 + 1 - 4, shl( Q_new, 1 ) ) ); /*2*Q_new+1 //INV_ATT_SEG_LEN=1/4(=shr(x,2)) -> Q4 */ etmp1_fx = etmp_fx; move32(); -#ifdef BASOP_NOGLOB *Last_frame_ener_fx = L_shl_sat( *Last_frame_ener_fx, 2 ); -#else - *Last_frame_ener_fx = L_shl( *Last_frame_ener_fx, 2 ); -#endif move32(); /*2*Q_new+1 */ /* If the maximum normalized energy > last frame energy + 6dB */ @@ -258,11 +246,7 @@ void pre_echo_att_ivas_fx( exp = sub( n1, n2 ); frac1 = round_fx( L_shl( etmp_fx, n1 ) ); -#ifdef BASOP_NOGLOB frac2 = round_fx_sat( L_shl_sat( *Last_frame_ener_fx, n2 ) ); -#else - frac2 = round_fx( L_shl( *Last_frame_ener_fx, n2 ) ); -#endif L_tmp = L_mult0( 128, div_s( frac1, frac2 ) ); /* s = gain_out / gain_in */ L_tmp = L_shr( L_tmp, exp ); /* add exponent */ diff --git a/lib_com/hp50.c b/lib_com/hp50.c index 02c11ce6c..cd9ed3e98 100644 --- a/lib_com/hp50.c +++ b/lib_com/hp50.c @@ -199,18 +199,10 @@ static void filter_2nd_order( L_sum = L_add( L_sum, HP50_Mpy_32_32_fix( mem[0], a2 ) ); /* y2*a2 */ L_sum = L_add( L_sum, HP50_Mpy_32_32_fix( mem[1], a1 ) ); /* y1*a1 */ -#ifdef BASOP_NOGLOB L_y2 = L_shl_o( L_sum, HP20_COEFF_SCALE, &Overflow ); -#else - L_y2 = L_shl( L_sum, HP20_COEFF_SCALE ); -#endif BASOP_SATURATE_ERROR_OFF_EVS BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB signal[0] = round_fx_o( L_shl_o( L_y2, prescale, &Overflow ), &Overflow ); -#else /* BASOP_NOGLOB */ - signal[0] = round_fx( L_shl( L_y2, prescale ) ); -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS BASOP_SATURATE_ERROR_ON_EVS @@ -221,18 +213,10 @@ static void filter_2nd_order( L_sum = L_add( L_sum, HP50_Mpy_32_32_fix( mem[1], a2 ) ); /* y2*a2 */ L_sum = L_add( L_sum, HP50_Mpy_32_32_fix( L_y2, a1 ) ); /* y1*a1 */ -#ifdef BASOP_NOGLOB L_y1 = L_shl_o( L_sum, HP20_COEFF_SCALE, &Overflow ); -#else - L_y1 = L_shl( L_sum, HP20_COEFF_SCALE ); -#endif BASOP_SATURATE_ERROR_OFF_EVS BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB signal[stride] = round_fx_o( L_shl_o( L_y1, prescale, &Overflow ), &Overflow ); -#else /* BASOP_NOGLOB */ - signal[stride] = round_fx( L_shl( L_y1, prescale ) ); -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS move16(); @@ -248,19 +232,10 @@ static void filter_2nd_order( L_sum = L_add( L_sum, HP50_Mpy_32_32_fix( L_y2, a2 ) ); L_sum = L_add( L_sum, HP50_Mpy_32_32_fix( L_y1, a1 ) ); -#ifdef BASOP_NOGLOB L_y2 = L_shl_o( L_sum, HP20_COEFF_SCALE, &Overflow ); -#else - L_y2 = L_shl( L_sum, HP20_COEFF_SCALE ); -#endif BASOP_SATURATE_ERROR_OFF_EVS BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB signal[i_mult( i, stride )] = round_fx_o( L_shl_o( L_y2, prescale, &Overflow ), &Overflow ); -#else /* BASOP_NOGLOB */ - signal[i_mult( i, stride )] = round_fx( L_shl( L_y2, prescale ) ); - move16(); -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS /* y[i+1] = b2*x[i-1] + b1*x[i-0] + b2*x[i+1] + a2*y[i-1] + a1*y[i+0]; */ BASOP_SATURATE_ERROR_ON_EVS @@ -271,18 +246,10 @@ static void filter_2nd_order( L_sum = L_add( L_sum, HP50_Mpy_32_32_fix( L_y1, a2 ) ); L_sum = L_add( L_sum, HP50_Mpy_32_32_fix( L_y2, a1 ) ); -#ifdef BASOP_NOGLOB L_y1 = L_shl_o( L_sum, HP20_COEFF_SCALE, &Overflow ); -#else - L_y1 = L_shl( L_sum, HP20_COEFF_SCALE ); -#endif BASOP_SATURATE_ERROR_OFF_EVS BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB signal[i_mult( add( i, 1 ), stride )] = round_fx_o( L_shl_o( L_y1, prescale, &Overflow ), &Overflow ); -#else /* BASOP_NOGLOB */ - signal[i_mult( add( i, 1 ), stride )] = round_fx( L_shl( L_y1, prescale ) ); -#endif BASOP_SATURATE_WARNING_ON_EVS move16(); } @@ -322,20 +289,12 @@ void hp20( Word16 signal[], /* i/o: signal to filter any * prescale = getScaleFactor16( signal, lg ); prescaleOld = extract_l( mem[4] ); -#ifdef BASOP_NOGLOB diff = norm_l( L_shl_sat( mem[2], prescaleOld ) ); -#else - diff = norm_l( L_shl( mem[2], prescaleOld ) ); -#endif if ( mem[2] != 0 ) { prescale = s_min( prescale, diff ); } -#ifdef BASOP_NOGLOB diff = norm_l( L_shl_o( mem[3], prescaleOld, &Overflow ) ); -#else - diff = norm_l( L_shl( mem[3], prescaleOld ) ); -#endif if ( mem[3] != 0 ) { prescale = s_min( prescale, diff ); @@ -345,7 +304,6 @@ void hp20( Word16 signal[], /* i/o: signal to filter any * IF( prescale != prescaleOld ) { diff = sub( prescale, prescaleOld ); -#ifdef BASOP_NOGLOB mem[0] = L_shr_o( mem[0], diff, &Overflow ); move32(); mem[1] = L_shr_o( mem[1], diff, &Overflow ); @@ -354,16 +312,6 @@ void hp20( Word16 signal[], /* i/o: signal to filter any * move32(); mem[3] = L_shr_o( mem[3], diff, &Overflow ); move32(); -#else - mem[0] = L_shr( mem[0], diff ); - move32(); - mem[1] = L_shr( mem[1], diff ); - move32(); - mem[2] = L_shr( mem[2], diff ); - move32(); - mem[3] = L_shr( mem[3], diff ); - move32(); -#endif mem[4] = L_deposit_l( prescale ); } @@ -447,9 +395,7 @@ void hp20_fx_32( Word32 i; Word32 a1_fx, a2_fx, b1_fx, b2_fx; Word32 diff_pos, diff_neg; -#ifdef BASOP_NOGLOB Flag Overflow = 0; -#endif Word16 prescale, prescaleOld, prescale_current_frame, diff; prescale = getScaleFactor32( signal_fx, lg ); @@ -458,13 +404,8 @@ void hp20_fx_32( prescaleOld = extract_l( mem_fx[4] ); -#ifdef BASOP_NOGLOB diff_pos = norm_l( L_shl_o( L_max( mem_fx[2], mem_fx[3] ), prescaleOld, &Overflow ) ); diff_neg = norm_l( L_shl_o( L_min( mem_fx[2], mem_fx[3] ), prescaleOld, &Overflow ) ); -#else - diff_pos = norm_l( L_shl( L_max( mem_fx[2], mem_fx[3] ), prescaleOld ) ); - diff_neg = norm_l( L_shl( L_min( mem_fx[2], mem_fx[3] ), prescaleOld ) ); -#endif diff = L_max( diff_pos, diff_neg ); @@ -476,7 +417,6 @@ void hp20_fx_32( prescale = s_min( 3, sub( 1 + HP20_COEFF_SCALE, prescale ) ); diff = sub( prescale, prescaleOld ); -#ifdef BASOP_NOGLOB mem_fx[0] = L_shr_o( mem_fx[0], diff, &Overflow ); move32(); mem_fx[1] = L_shr_o( mem_fx[1], diff, &Overflow ); @@ -485,16 +425,6 @@ void hp20_fx_32( move32(); mem_fx[3] = L_shr_o( mem_fx[3], diff, &Overflow ); move32(); -#else - mem_fx[0] = L_shr( mem_fx[0], diff ); - move32(); - mem_fx[1] = L_shr( mem_fx[1], diff ); - move32(); - mem_fx[2] = L_shr( mem_fx[2], diff ); - move32(); - mem_fx[3] = L_shr( mem_fx[3], diff ); - move32(); -#endif mem_fx[4] = L_deposit_l( prescale_current_frame ); move32(); diff --git a/lib_com/hp50_fx.c b/lib_com/hp50_fx.c index 78e358a80..a1700047e 100644 --- a/lib_com/hp50_fx.c +++ b/lib_com/hp50_fx.c @@ -118,18 +118,10 @@ static void filter_2nd_order( L_sum = L_add( L_sum, HP50_Mpy_32_32_fix( mem[0], a2 ) ); /* y2*a2 */ L_sum = L_add( L_sum, HP50_Mpy_32_32_fix( mem[1], a1 ) ); /* y1*a1 */ -#ifdef BASOP_NOGLOB L_y2 = L_shl_o( L_sum, HP20_COEFF_SCALE, &Overflow ); -#else - L_y2 = L_shl( L_sum, HP20_COEFF_SCALE ); -#endif BASOP_SATURATE_ERROR_OFF_EVS BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB signal[0] = round_fx_o( L_shl_o( L_y2, prescale, &Overflow ), &Overflow ); -#else /* BASOP_NOGLOB */ - signal[0] = round_fx( L_shl( L_y2, prescale ) ); -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS BASOP_SATURATE_ERROR_ON_EVS @@ -140,18 +132,10 @@ static void filter_2nd_order( L_sum = L_add( L_sum, HP50_Mpy_32_32_fix( mem[1], a2 ) ); /* y2*a2 */ L_sum = L_add( L_sum, HP50_Mpy_32_32_fix( L_y2, a1 ) ); /* y1*a1 */ -#ifdef BASOP_NOGLOB L_y1 = L_shl_o( L_sum, HP20_COEFF_SCALE, &Overflow ); -#else - L_y1 = L_shl( L_sum, HP20_COEFF_SCALE ); -#endif BASOP_SATURATE_ERROR_OFF_EVS BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB signal[stride] = round_fx_o( L_shl_o( L_y1, prescale, &Overflow ), &Overflow ); -#else /* BASOP_NOGLOB */ - signal[stride] = round_fx( L_shl( L_y1, prescale ) ); -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS move16(); @@ -167,19 +151,10 @@ static void filter_2nd_order( L_sum = L_add( L_sum, HP50_Mpy_32_32_fix( L_y2, a2 ) ); L_sum = L_add( L_sum, HP50_Mpy_32_32_fix( L_y1, a1 ) ); -#ifdef BASOP_NOGLOB L_y2 = L_shl_o( L_sum, HP20_COEFF_SCALE, &Overflow ); -#else - L_y2 = L_shl( L_sum, HP20_COEFF_SCALE ); -#endif BASOP_SATURATE_ERROR_OFF_EVS BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB signal[i_mult( i, stride )] = round_fx_o( L_shl_o( L_y2, prescale, &Overflow ), &Overflow ); -#else /* BASOP_NOGLOB */ - signal[i_mult( i, stride )] = round_fx( L_shl( L_y2, prescale ) ); - move16(); -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS /* y[i+1] = b2*x[i-1] + b1*x[i-0] + b2*x[i+1] + a2*y[i-1] + a1*y[i+0]; */ BASOP_SATURATE_ERROR_ON_EVS @@ -190,18 +165,10 @@ static void filter_2nd_order( L_sum = L_add( L_sum, HP50_Mpy_32_32_fix( L_y1, a2 ) ); L_sum = L_add( L_sum, HP50_Mpy_32_32_fix( L_y2, a1 ) ); -#ifdef BASOP_NOGLOB L_y1 = L_shl_o( L_sum, HP20_COEFF_SCALE, &Overflow ); -#else - L_y1 = L_shl( L_sum, HP20_COEFF_SCALE ); -#endif BASOP_SATURATE_ERROR_OFF_EVS BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB signal[i_mult( add( i, 1 ), stride )] = round_fx_o( L_shl_o( L_y1, prescale, &Overflow ), &Overflow ); -#else /* BASOP_NOGLOB */ - signal[i_mult( add( i, 1 ), stride )] = round_fx( L_shl( L_y1, prescale ) ); -#endif BASOP_SATURATE_WARNING_ON_EVS move16(); } @@ -241,20 +208,12 @@ void hp20( Word16 signal[], /* i/o: signal to filter any * prescale = getScaleFactor16( signal, lg ); prescaleOld = extract_l( mem[4] ); -#ifdef BASOP_NOGLOB diff = norm_l( L_shl_sat( mem[2], prescaleOld ) ); -#else - diff = norm_l( L_shl( mem[2], prescaleOld ) ); -#endif if ( mem[2] != 0 ) { prescale = s_min( prescale, diff ); } -#ifdef BASOP_NOGLOB diff = norm_l( L_shl_o( mem[3], prescaleOld, &Overflow ) ); -#else - diff = norm_l( L_shl( mem[3], prescaleOld ) ); -#endif if ( mem[3] != 0 ) { prescale = s_min( prescale, diff ); @@ -264,7 +223,6 @@ void hp20( Word16 signal[], /* i/o: signal to filter any * IF( prescale != prescaleOld ) { diff = sub( prescale, prescaleOld ); -#ifdef BASOP_NOGLOB mem[0] = L_shr_o( mem[0], diff, &Overflow ); move32(); mem[1] = L_shr_o( mem[1], diff, &Overflow ); @@ -273,16 +231,6 @@ void hp20( Word16 signal[], /* i/o: signal to filter any * move32(); mem[3] = L_shr_o( mem[3], diff, &Overflow ); move32(); -#else - mem[0] = L_shr( mem[0], diff ); - move32(); - mem[1] = L_shr( mem[1], diff ); - move32(); - mem[2] = L_shr( mem[2], diff ); - move32(); - mem[3] = L_shr( mem[3], diff ); - move32(); -#endif mem[4] = L_deposit_l( prescale ); } @@ -366,9 +314,7 @@ void hp20_fx_32( Word32 i; Word32 a1_fx, a2_fx, b1_fx, b2_fx; Word32 diff_pos, diff_neg; -#ifdef BASOP_NOGLOB Flag Overflow = 0; -#endif Word16 prescale, prescaleOld, prescale_current_frame, diff; prescale = getScaleFactor32( signal_fx, lg ); @@ -377,13 +323,8 @@ void hp20_fx_32( prescaleOld = extract_l( mem_fx[4] ); -#ifdef BASOP_NOGLOB diff_pos = norm_l( L_shl_o( L_max( mem_fx[2], mem_fx[3] ), prescaleOld, &Overflow ) ); diff_neg = norm_l( L_shl_o( L_min( mem_fx[2], mem_fx[3] ), prescaleOld, &Overflow ) ); -#else - diff_pos = norm_l( L_shl( L_max( mem_fx[2], mem_fx[3] ), prescaleOld ) ); - diff_neg = norm_l( L_shl( L_min( mem_fx[2], mem_fx[3] ), prescaleOld ) ); -#endif diff = L_max( diff_pos, diff_neg ); @@ -395,7 +336,6 @@ void hp20_fx_32( prescale = s_min( 3, sub( 1 + HP20_COEFF_SCALE, prescale ) ); diff = sub( prescale, prescaleOld ); -#ifdef BASOP_NOGLOB mem_fx[0] = L_shr_o( mem_fx[0], diff, &Overflow ); move32(); mem_fx[1] = L_shr_o( mem_fx[1], diff, &Overflow ); @@ -404,16 +344,6 @@ void hp20_fx_32( move32(); mem_fx[3] = L_shr_o( mem_fx[3], diff, &Overflow ); move32(); -#else - mem_fx[0] = L_shr( mem_fx[0], diff ); - move32(); - mem_fx[1] = L_shr( mem_fx[1], diff ); - move32(); - mem_fx[2] = L_shr( mem_fx[2], diff ); - move32(); - mem_fx[3] = L_shr( mem_fx[3], diff ); - move32(); -#endif mem_fx[4] = L_deposit_l( prescale_current_frame ); move32(); diff --git a/lib_com/hq2_bit_alloc_fx.c b/lib_com/hq2_bit_alloc_fx.c index 395854d5f..4742c81c2 100644 --- a/lib_com/hq2_bit_alloc_fx.c +++ b/lib_com/hq2_bit_alloc_fx.c @@ -312,11 +312,9 @@ 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 ); @@ -572,13 +570,9 @@ 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/hq2_core_com_fx.c b/lib_com/hq2_core_com_fx.c index a7c71ea9f..86c02fa88 100644 --- a/lib_com/hq2_core_com_fx.c +++ b/lib_com/hq2_core_com_fx.c @@ -163,11 +163,7 @@ void mdct_spectrum_denorm_fx( pd_fx = div_s( shl( npulses[k], exp_normn ), shl( band_width[k], exp_normd ) ); /* 15 + (exp_norm - exp_normd) */ Qpd = add( sub( exp_normn, exp_normd ), 15 ); -#ifdef BASOP_NOGLOB cond_fx = sub( shl_o( pd_fx, sub( 15, Qpd ), &Overflow ), pd_thresh_fx /*Q15*/ ); /* Q15 */ -#else /* BASOP_NOGLOB */ - cond_fx = sub( shl( pd_fx, sub( 15, Qpd ) ), pd_thresh_fx /*Q15*/ ); -#endif Overflow = 0; move16(); /* allow overflow happen. */ IF( cond_fx < 0 ) @@ -200,11 +196,7 @@ void mdct_spectrum_denorm_fx( /*gamma *= gain_tweak; */ L_tmp = L_mult( gamma_fx, gain_tweak_fx ); /* Qgamma+Qtweak+1 */ exp_norm = norm_l( L_tmp ); -#ifdef BASOP_NOGLOB gamma_fx = round_fx_o( L_shl_o( L_tmp, exp_norm, &Overflow ), &Overflow ); -#else - gamma_fx = round_fx( L_shl( L_tmp, exp_norm ) ); -#endif Qgamma = sub( add( add( Qgamma, Qtweak ), exp_norm ), 15 ); /*Qgamma+Qtweak+1+exp_norm-16; */ } @@ -343,11 +335,7 @@ void mdct_spectrum_denorm_ivas_fx( pd_fx = div_s( shl( npulses[k], exp_normn ), shl( band_width[k], exp_normd ) ); /* 15 + (exp_normn + exp_normd) */ Qpd = add( sub( exp_normn, exp_normd ), 15 ); -#ifdef BASOP_NOGLOB cond_fx = sub( shl_o( pd_fx, sub( 15, Qpd ), &Overflow ), pd_thresh_fx /*Q15*/ ); /* Q15 */ -#else /* BASOP_NOGLOB */ - cond_fx = sub( shl( pd_fx, sub( 15, Qpd ) ), pd_thresh_fx /*Q15*/ ); -#endif Overflow = 0; move16(); /* allow overflow happen. */ IF( cond_fx < 0 ) @@ -380,11 +368,7 @@ void mdct_spectrum_denorm_ivas_fx( /*gamma *= gain_tweak; */ L_tmp = L_mult( gamma_fx, gain_tweak_fx ); /* Qgamma+Qtweak+1 */ exp_norm = norm_l( L_tmp ); -#ifdef BASOP_NOGLOB gamma_fx = round_fx_o( L_shl_o( L_tmp, exp_norm, &Overflow ), &Overflow ); -#else - gamma_fx = round_fx( L_shl( L_tmp, exp_norm ) ); -#endif Qgamma = sub( add( add( Qgamma, Qtweak ), exp_norm ), 15 ); /*Qgamma+Qtweak+1+exp_norm-16; */ } diff --git a/lib_com/hq2_noise_inject_fx.c b/lib_com/hq2_noise_inject_fx.c index c37ae1236..3595efd06 100644 --- a/lib_com/hq2_noise_inject_fx.c +++ b/lib_com/hq2_noise_inject_fx.c @@ -90,13 +90,8 @@ void hq2_noise_inject_fx( FOR( i = 0; i < bands; i++ ) { -#ifdef BASOP_NOGLOB Ep_fx[i] = L_shl_o( Ep_fx[i], 6, &Overflow ); /* Q-6 -> Q0 */ move32(); -#else /* BASOP_NOGLOB */ - Ep_fx[i] = L_shl( Ep_fx[i], 6 ); /* Q-6 -> Q0 */ - move32(); -#endif /* BASOP_NOGLOB */ } tmp = add( band_end[bands - 1], 1 ); @@ -160,11 +155,7 @@ void hq2_noise_inject_fx( Q_env_fx[k] = sub( 31, exp2 ); move16(); tmp = sub( 17, Q_env_fx[k] ); -#ifdef BASOP_NOGLOB env_fx2[k] = extract_h( L_shl_o( env_fx[k], tmp, &Overflow ) ); /*Q1 */ -#else /* BASOP_NOGLOB */ - env_fx2[k] = extract_h( L_shl( env_fx[k], tmp ) ); /*Q1 */ -#endif /* BASOP_NOGLOB */ peak_fx[k] = 0; move16(); count[k] = 0; @@ -175,11 +166,7 @@ void hq2_noise_inject_fx( FOR( i = band_start[k]; i <= band_end[k]; i++ ) { L_tmp = L_mult0( y2hat_fx[i], y2hat_fx[i] ); /* Q0 */ -#ifdef BASOP_NOGLOB Ep_fx[k] = L_sub_o( Ep_fx[k], L_tmp, &Overflow ); -#else /* BASOP_NOGLOB */ - Ep_fx[k] = L_sub( Ep_fx[k], L_tmp ); -#endif /* BASOP_NOGLOB */ move32(); /* Q0 */ IF( GT_16( abs_s( y2hat_fx[i] ), peak_fx[k] ) ) { @@ -400,11 +387,7 @@ void hq2_noise_inject_fx( ELSE IF( count[k - 1] == 0 && tmp4 > 0 ) { L_tmp = L_mult( env_fx2[k - 1], tmp ); /* Q(1+Q_speech+1 = Q_speech+2) */ -#ifdef BASOP_NOGLOB fac_fx = extract_h( L_shl_o( L_tmp, sub( 26, Q_speech ), &Overflow ) ); /*Q12 */ -#else - fac_fx = extract_h( L_shl( L_tmp, sub( 26, Q_speech ) ) ); /*Q12 */ -#endif } } @@ -453,11 +436,7 @@ void hq2_noise_inject_fx( tmp = sub( Q_env_fx[k], Q_Ep_fx[k] ); tmp = sub( tmp, Q_speech ); tmp = add( tmp, 25 ); -#ifdef BASOP_NOGLOB L_tmp = L_shr_sat( L_tmp2, tmp ); /*Q7 */ -#else - L_tmp = L_shr( L_tmp2, tmp ); /*Q7 */ -#endif tmp = extract_l( L_min( L_tmp, 192 /* 1.5 in Q7 */ ) ); /* */ fac_fx = extract_h( L_shl( L_mult( fac_fx, tmp ), 8 ) ); /*Q12 */ } @@ -467,11 +446,7 @@ void hq2_noise_inject_fx( L_tmp2 = Mult_32_16( env_fx[k], tmp ); /*Q(Q_env_fx[k]+0-15 = Q_env_fx[k]-15) */ L_tmp2 = Mult_32_16( L_tmp2, 20480 /* 1.25 in Q14 */ ); /*Q(Q_env_fx[k]-15+14-15 = Q_env_fx[k]-16) */ tmp = sub( Q_env_fx[k], 23 ); -#ifdef BASOP_NOGLOB L_tmp = L_shr_sat( L_tmp2, tmp ); /*Q7 */ -#else - L_tmp = L_shr( L_tmp2, tmp ); /*Q7 */ -#endif tmp = extract_l( ( L_min( L_tmp, 192 /* 1.5 in Q7 */ ) ) ); /* Q7 */ fac_fx = extract_h( L_shl( L_mult( fac_fx, tmp ), 8 ) ); /*Q12 */ } @@ -492,11 +467,7 @@ void hq2_noise_inject_fx( } L_tmp = Mult_32_16( Ep_fx[k], fac_fx ); /*Q(Q_Ep_fx[k]+12-15 = Q_Ep_fx[k]-3) */ -#ifdef BASOP_NOGLOB ni_gain_fx[k] = L_shr_o( L_tmp, sub( Q_Ep_fx[k], 20 ), &Overflow ); -#else /* BASOP_NOGLOB */ - ni_gain_fx[k] = L_shr( L_tmp, sub( Q_Ep_fx[k], 20 ) ); -#endif move32(); /*Q17 */ } ELSE @@ -618,22 +589,14 @@ void hq2_noise_inject_fx( L_tmp = Mult_32_16( Ep_fx[k], tmp ); /*Q(Q_Ep_fx[k]+28-Q_speech-15 = Q_Ep_fx[k]+13-Q_speech) */ tmp = sub( Q_Ep_fx[k], Q_speech ); tmp = sub( 15, tmp ); -#ifdef BASOP_NOGLOB tmp = extract_h( L_shl_o( L_tmp, tmp, &Overflow ) ); /*Q12 */ -#else - tmp = extract_h( L_shl( L_tmp, tmp ) ); /*Q12 */ -#endif } ELSE { tmp = 0x7fff; /*Q0 */ L_tmp = Mult_32_16( Ep_fx[k], tmp ); /*Q(Q_Ep_fx[k]+0-15 = Q_Ep_fx[k]-15) */ tmp = sub( 43, Q_Ep_fx[k] ); -#ifdef BASOP_NOGLOB tmp = extract_h( L_shl_o( L_tmp, tmp, &Overflow ) ); /*Q12 */ -#else - tmp = extract_h( L_shl( L_tmp, tmp ) ); /*Q12 */ -#endif } fac_fx = s_max( tmp, 4096 /* 1 in Q12 */ ); /*Q12 */ @@ -645,11 +608,7 @@ void hq2_noise_inject_fx( IF( band_width[k] != 0 ) { Q_speech = norm_s( band_width[k] ); -#ifdef BASOP_NOGLOB tmp = shl_o( band_width[k], Q_speech, &Overflow ); /*Q(Q_speech) */ -#else - tmp = shl( band_width[k], Q_speech ); /*Q(Q_speech) */ -#endif tmp = div_s( 16384 /* 0.5 in Q15 */, tmp ); /*Q(15+14-Q_speech) */ } ELSE @@ -662,11 +621,7 @@ void hq2_noise_inject_fx( tmp1 = sub( fac_fx, 4096 /* 1 in Q12 */ ); /*Q12 */ L_tmp = L_mult( tmp1, j ); /*Q13 */ L_tmp = Mult_32_16( L_tmp, tmp ); /*Q(13+29-Q_speech-15 = 27-Q_speech) */ -#ifdef BASOP_NOGLOB tmp = extract_h( L_shl_o( L_tmp, add( 1, Q_speech ), &Overflow ) ); /*Q12 */ -#else - tmp = extract_h( L_shl( L_tmp, add( 1, Q_speech ) ) ); /*Q12 */ -#endif tmp = sub( fac_fx, tmp ); /*Q12 */ L_tmp = Mult_32_16( ni_gain_fx[k], tmp ); /*Q(17+12-15=14) */ L_y2[i] = L_add( L_y2[i], L_shr( Mult_32_16( L_tmp, rand_fx ), 2 ) ); diff --git a/lib_com/hq_tools_fx.c b/lib_com/hq_tools_fx.c index 468bdd9a5..eabf20c1f 100644 --- a/lib_com/hq_tools_fx.c +++ b/lib_com/hq_tools_fx.c @@ -85,11 +85,7 @@ void hq_swb_harmonic_calc_norm_envelop_fx( FOR( n_lag = 0; n_lag < n_lag_now; n_lag++ ) { L_tmp = L_abs( L_SWB_signal[n_lag] ); /*Q12*/ -#ifdef BASOP_NOGLOB L_envelope[env_index] = L_add_sat( L_envelope[env_index], L_tmp ); /*Q12*/ -#else - L_envelope[env_index] = L_add( L_envelope[env_index], L_tmp ); -#endif move32(); } env_index = add( env_index, 1 ); @@ -106,11 +102,7 @@ void hq_swb_harmonic_calc_norm_envelop_fx( FOR( n_lag = 0; n_lag < n_lag_now; n_lag++ ) { L_tmp = L_abs( L_SWB_signal[( n_freq + n_lag )] ); /*Q12*/ -#ifdef BASOP_NOGLOB L_envelope[env_index] = L_add_sat( L_envelope[env_index], L_tmp ); /*Q12*/ -#else - L_envelope[env_index] = L_add( L_envelope[env_index], L_tmp ); -#endif move32(); } env_index = add( env_index, 1 ); @@ -128,11 +120,7 @@ void hq_swb_harmonic_calc_norm_envelop_fx( FOR( n_lag = 0; n_lag < n_lag_now; n_lag++ ) { L_tmp = L_abs( L_SWB_signal[( n_freq + n_lag )] ); /*Q12*/ -#ifdef BASOP_NOGLOB L_envelope[env_index] = L_add_sat( L_envelope[env_index], L_tmp ); /*Q12*/ -#else - L_envelope[env_index] = L_add( L_envelope[env_index], L_tmp ); -#endif move32(); } env_index = add( env_index, 1 ); @@ -560,11 +548,7 @@ void harm_bwe_fine_fx( norm_signal = norm_l( envelope[i] ); enve_lo[i] = L_Extract_lc( L_shl( envelope[i], norm_signal ), &enve_hi[i] ); /*Q12+norm_signal-16*/ L_signal[i] = Div_32( L_signal[i], enve_hi[i], enve_lo[i] ); /*Q31 - norm_signal*/ -#ifdef BASOP_NOGLOB SWB_signal[i] = round_fx_sat( L_shl_sat( L_signal[i], norm_signal ) ); /*Q15*/ -#else - SWB_signal[i] = round_fx( L_shl( L_signal[i], norm_signal ) ); -#endif move16(); move16(); move32(); @@ -574,11 +558,7 @@ void harm_bwe_fine_fx( norm_signal = norm_l( envelope[i] ); enve_lo[i] = L_Extract_lc( L_shl( envelope[i], norm_signal ), &enve_hi[i] ); /*Q12+norm_signal-16*/ L_signal[i] = L_negate( Div_32( L_negate( L_signal[i] ), enve_hi[i], enve_lo[i] ) ); /*Q31 - norm_signal*/ -#ifdef BASOP_NOGLOB SWB_signal[i] = round_fx_sat( L_shl_sat( L_signal[i], norm_signal ) ); /*Q15*/ -#else - SWB_signal[i] = round_fx( L_shl( L_signal[i], norm_signal ) ); -#endif move16(); move16(); move32(); @@ -659,11 +639,7 @@ void hvq_bwe_fine_fx( /*SWB_signal[i] = SWB_signal[i] / envelope[i]; */ shift = norm_l( L_envelope[i] ); -#ifdef BASOP_NOGLOB tmp = round_fx_sat( L_shl_sat( L_envelope[i], shift ) ); /* 12+s-16=Q(-4+s) */ -#else - tmp = round_fx( L_shl( L_envelope[i], shift ) ); /* 12+s-16=Q(-4+s) */ -#endif /* Avoid division by zero */ if ( tmp == 0 ) { @@ -962,34 +938,19 @@ void ivas_harm_bwe_fx( L_tmp2 = L_deposit_h( tmp1 ); L_tmp2 = Isqrt_lc( L_tmp2, &exp1 ); /*Q31 - exp1*/ -#ifdef BASOP_NOGLOB beta = round_fx_sat( L_shl_sat( L_tmp2, exp1 ) ); /*Q15 */ beta = shr( beta, 1 ); /*Q15*/ -#else - beta = round_fx( L_shl( L_tmp2, exp1 ) ); - beta = shr( beta, 1 ); /*Q15 */ -#endif FOR( sfm = sfm_start[i]; sfm < sfm_end[i]; sfm++ ) { L_tmp = Mult_32_16( E_L, coeff_fine[sfm] ); /*Q19 19 + 15 +1-16 */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, 9 ); /*Q28 */ -#else - L_tmp = L_shl( L_tmp, 9 ); /*Q28 */ -#endif tmp = Random( bwe_seed ); /*Q15 */ L_tmp2 = L_shr( L_mult( beta, tmp ), 3 ); /* Q28 31-3 15+15 +1-3 */ -#ifdef BASOP_NOGLOB L_tmp = L_add_sat( L_tmp, L_tmp2 ); /*Q28 */ coeff_out[sfm] = L_shl_sat( Mult_32_32( L_tmp, normq ), 1 ); /*Q12 28 +14 +1 -31 */ move32(); -#else - L_tmp = L_add( L_tmp, L_tmp2 ); /*Q28 */ - coeff_out[sfm] = L_shl( Mult_32_32( L_tmp, normq ), 1 ); /*Q12 28 +14 +1 -31 */ - move32(); -#endif } } @@ -1153,22 +1114,12 @@ void harm_bwe_fx( FOR( sfm = sfm_start[i]; sfm < sfm_end[i]; sfm++ ) { L_tmp = Mult_32_16( E_L, coeff_fine[sfm] ); /*Q19 19 + 15 +1-16 */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, 9 ); /*Q28 */ -#else - L_tmp = L_shl( L_tmp, 9 ); /*Q28 */ -#endif tmp = Random( bwe_seed ); /*Q15 */ L_tmp2 = L_shr( L_mult( beta, tmp ), 3 ); /* Q28 31-3 15+15 +1-3 */ -#ifdef BASOP_NOGLOB L_tmp = L_add_sat( L_tmp, L_tmp2 ); /*Q28 */ coeff_out[sfm] = L_shl_sat( Mult_32_32( L_tmp, normq ), 1 ); /*Q12 28 +14 +1 -31 */ move32(); -#else - L_tmp = L_add( L_tmp, L_tmp2 ); /*Q28 */ - coeff_out[sfm] = L_shl( Mult_32_32( L_tmp, normq ), 1 ); /*Q12 28 +14 +1 -31 */ - move32(); -#endif } } @@ -2219,11 +2170,7 @@ void hq_wb_nf_bwe_fx( tmp = shl( total_bit, exp ); /*Q(exp) */ tmp = div_s( 16384, tmp ); /*Q(15+14-exp) */ L_tmp = L_mult( tmp, bitalloc_var_fx ); /*Q(29-exp+1) */ -#ifdef BASOP_NOGLOB bitalloc_var_fx = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /*Q14 */ -#else - bitalloc_var_fx = round_fx( L_shl( L_tmp, exp ) ); /*Q14 */ -#endif } ELSE { @@ -2239,11 +2186,7 @@ void hq_wb_nf_bwe_fx( { tmp = shl( sfmsize[sfm], 9 ); /*Q9 */ tmp = mult( rat_fx[sfm], tmp ); /*Q(14+9-15=8) */ -#ifdef BASOP_NOGLOB IF( GE_16( shl_sat( R[sfm], 8 ), tmp ) ) -#else - IF( GE_16( shl( R[sfm], 8 ), tmp ) ) -#endif { peak_fx = 0; move16(); @@ -2252,11 +2195,7 @@ void hq_wb_nf_bwe_fx( FOR( i = sfm_start[sfm]; i < sfm_end[sfm]; i++ ) { fabs_coeff_out_fx = L_abs( L_coeff_out[i] ); /*Q12*/ -#ifdef BASOP_NOGLOB mean_fx = L_add_sat( mean_fx, fabs_coeff_out_fx ); /*Q12 */ -#else - mean_fx = L_add( mean_fx, fabs_coeff_out_fx ); /*Q12 */ -#endif if ( GT_32( fabs_coeff_out_fx, peak_fx ) ) { peak_fx = fabs_coeff_out_fx; /*Q12 */ @@ -2267,13 +2206,8 @@ void hq_wb_nf_bwe_fx( IF( mean_fx != 0 ) { exp = norm_l( mean_fx ); -#ifdef BASOP_NOGLOB mean_fx = L_shl_sat( mean_fx, exp ); /*Q(exp+12) */ tmp = round_fx_sat( mean_fx ); /*Q(exp-4) */ -#else - mean_fx = L_shl( mean_fx, exp ); /*Q(exp+12) */ - tmp = round_fx( mean_fx ); /*Q(exp-4) */ -#endif tmp = div_s( 16384, tmp ); /*Q(15+14-exp+4 = 33-exp) */ L_tmp = Mult_32_16( peak_fx, tmp ); /*Q(12+33-exp-15 = 30-exp) */ tmp = shl( sfmsize[sfm], 9 ); /*Q9 */ @@ -2314,11 +2248,7 @@ void hq_wb_nf_bwe_fx( L_tmp = L_mult( 5, sharp_fx ); /*Q15 */ L_tmp = Mult_32_16( L_tmp, tmp ); /*Q15 */ -#ifdef BASOP_NOGLOB step_fx = round_fx_sat( L_shl_sat( L_tmp, 16 ) ); /*Q15 */ -#else - step_fx = round_fx( L_shl( L_tmp, 16 ) ); /*Q15 */ -#endif alfa_fx = 20480; /*Q13 = 2.5 */ move16(); /* fill noise for the insaturable subbands */ @@ -2455,18 +2385,10 @@ void hq_wb_nf_bwe_fx( exp = sub( 45, exp ); } -#ifdef BASOP_NOGLOB sharp_fx = add_sat( sharp_fx, shr( step_fx, 1 ) ); /*Q14*/ -#else - sharp_fx = add( sharp_fx, shr( step_fx, 1 ) ); -#endif } -#ifdef BASOP_NOGLOB IF( GT_32( L_tmp2, L_shl_sat( min_coef_fx, sub( exp, 13 ) ) ) ) /*exp */ -#else - IF( GT_32( L_tmp2, L_shl( min_coef_fx, sub( exp, 13 ) ) ) ) /*exp */ -#endif { L_tmp2 = L_shr( min_coef_fx, 1 ); exp = 12; @@ -2483,11 +2405,7 @@ void hq_wb_nf_bwe_fx( /* smooth the noise magnitudes between inter-frame */ test(); test(); -#ifdef BASOP_NOGLOB IF( GT_32( prev_avrg_norm_fx, L_shr( avrg_norm_fx, 1 ) ) && LT_32( prev_avrg_norm_fx, L_shl_sat( avrg_norm_fx, 1 ) ) && prev_is_transient == 0 ) -#else - IF( GT_32( prev_avrg_norm_fx, L_shr( avrg_norm_fx, 1 ) ) && LT_32( prev_avrg_norm_fx, L_shl( avrg_norm_fx, 1 ) ) && prev_is_transient == 0 ) -#endif { exp1 = norm_l( prev_env_fx[sfm] ); L_tmp1 = L_shl( prev_env_fx[sfm], exp1 ); /* prev_env_Q[sfm] +exp1 */ @@ -2545,11 +2463,7 @@ void hq_wb_nf_bwe_fx( test(); test(); test(); -#ifdef BASOP_NOGLOB IF( EQ_16( sfm, sub( SFM_N_WB, 1 ) ) && prev_is_transient == 0 && GT_32( prev_normq_fx[sfm], L_shr( L_normq_v[sfm], 1 ) ) && LT_32( prev_normq_fx[sfm], L_shl_sat( L_normq_v[sfm], 1 ) ) && LE_16( bitalloc_var_fx, 4915 ) ) -#else - IF( EQ_16( sfm, sub( SFM_N_WB, 1 ) ) && prev_is_transient == 0 && GT_32( prev_normq_fx[sfm], L_shr( L_normq_v[sfm], 1 ) ) && LT_32( prev_normq_fx[sfm], L_shl( L_normq_v[sfm], 1 ) ) && LE_16( bitalloc_var_fx, 4915 ) ) -#endif { Word32 *p_prev_coeff_out = prev_coeff_out_fx; /*Q12*/ FOR( i = add( sfm_start[sfm], 12 ); i < sfm_end[sfm]; i++ ) @@ -2558,17 +2472,9 @@ void hq_wb_nf_bwe_fx( test(); test(); test(); -#ifdef BASOP_NOGLOB IF( GT_32( L_abs( L_coeff_out[i] ), L_shl_sat( L_abs( *p_prev_coeff_out ), 2 ) ) || LT_32( L_abs( L_coeff_out[i] ), L_shr( L_abs( *p_prev_coeff_out ), 2 ) ) || ( ( R[sfm] == 0 || *prev_R == 0 ) && add_sat( R[sfm], *prev_R ) != 0 ) ) -#else - IF( GT_32( L_abs( L_coeff_out[i] ), L_shl( L_abs( *p_prev_coeff_out ), 2 ) ) || LT_32( L_abs( L_coeff_out[i] ), L_shr( L_abs( *p_prev_coeff_out ), 2 ) ) || ( ( R[sfm] == 0 || *prev_R == 0 ) && add( R[sfm], *prev_R ) != 0 ) ) -#endif { -#ifdef BASOP_NOGLOB L_tmp = L_add_sat( L_shr( L_abs( L_coeff_out[i] ), 1 ), L_shr( L_abs( *p_prev_coeff_out ), 1 ) ); /*Q12*/ -#else - L_tmp = L_add( L_shr( L_abs( L_coeff_out[i] ), 1 ), L_shr( L_abs( *p_prev_coeff_out ), 1 ) ); -#endif if ( L_coeff_out[i] <= 0 ) { L_tmp = L_negate( L_tmp ); /*Q12*/ diff --git a/lib_com/ifft_rel.c b/lib_com/ifft_rel.c index 40383cf3c..e3b62bdb5 100644 --- a/lib_com/ifft_rel.c +++ b/lib_com/ifft_rel.c @@ -109,66 +109,28 @@ void ifft_rel_fx( FOR( i = is; i < n; i += id ) { -#ifdef BASOP_NOGLOB t1 = sub_o( *xi1, *xi3, &Overflow ); /*Qx*/ *xi1 = add_o( *xi1, *xi3, &Overflow ); /*Qx*/ -#else /* BASOP_NOGLOB */ - t1 = sub( *xi1, *xi3 ); - *xi1 = add( *xi1, *xi3 ); -#endif /* BASOP_NOGLOB */ move16(); -#ifdef BASOP_NOGLOB *xi2 = shl_o( *xi2, 1, &Overflow ); /*Qx*/ -#else /* BASOP_NOGLOB */ - *xi2 = shl( *xi2, 1 ); -#endif /* BASOP_NOGLOB */ move16(); -#ifdef BASOP_NOGLOB *xi3 = sub_o( t1, shl_o( *xi4, 1, &Overflow ), &Overflow ); /*Qx*/ -#else /* BASOP_NOGLOB */ - *xi3 = sub( t1, shl( *xi4, 1 ) ); -#endif /* BASOP_NOGLOB */ move16(); -#ifdef BASOP_NOGLOB *xi4 = add_o( t1, shl_o( *xi4, 1, &Overflow ), &Overflow ); /*Qx*/ -#else /* BASOP_NOGLOB */ - *xi4 = add( t1, shl( *xi4, 1 ) ); -#endif /* BASOP_NOGLOB */ move16(); IF( NE_16( n4, 1 ) ) { -#ifdef BASOP_NOGLOB t1 = mult_r( sub_o( *( xi2 + n8 ), *( xi1 + n8 ), &Overflow ), INV_SQR2_FX /*Q15*/ ); /*Qx*/ t2 = mult_r( add_o( *( xi4 + n8 ), *( xi3 + n8 ), &Overflow ), INV_SQR2_FX /*Q15*/ ); /*Qx*/ -#else /* BASOP_NOGLOB */ - t1 = mult_r( sub( *( xi2 + n8 ), *( xi1 + n8 ) ), INV_SQR2_FX ); - t2 = mult_r( add( *( xi4 + n8 ), *( xi3 + n8 ) ), INV_SQR2_FX ); -#endif /* BASOP_NOGLOB */ -#ifdef BASOP_NOGLOB *( xi1 + n8 ) = add_o( *( xi1 + n8 ), *( xi2 + n8 ), &Overflow ); /*Qx*/ -#else /* BASOP_NOGLOB */ - *( xi1 + n8 ) = add( *( xi1 + n8 ), *( xi2 + n8 ) ); -#endif /* BASOP_NOGLOB */ move16(); -#ifdef BASOP_NOGLOB *( xi2 + n8 ) = sub_o( *( xi4 + n8 ), *( xi3 + n8 ), &Overflow ); /*Qx*/ -#else /* BASOP_NOGLOB */ - *( xi2 + n8 ) = sub( *( xi4 + n8 ), *( xi3 + n8 ) ); -#endif /* BASOP_NOGLOB */ move16(); -#ifdef BASOP_NOGLOB *( xi3 + n8 ) = negate( shl_o( add_o( t2, t1, &Overflow ), 1, &Overflow ) ); /*Qx*/ -#else /* BASOP_NOGLOB */ - *( xi3 + n8 ) = negate( shl( add( t2, t1 ), 1 ) ); -#endif /* BASOP_NOGLOB */ move16(); -#ifdef BASOP_NOGLOB *( xi4 + n8 ) = shl_o( sub_o( t1, t2, &Overflow ), 1, &Overflow ); /*Qx*/ -#else /* BASOP_NOGLOB */ - *( xi4 + n8 ) = shl( sub( t1, t2 ), 1 ); -#endif /* BASOP_NOGLOB */ move16(); } xi1 += id; @@ -217,82 +179,42 @@ void ifft_rel_fx( FOR( i = is; i < n; i += id ) { -#ifdef BASOP_NOGLOB t1 = sub_o( *xup1, *xdn6, &Overflow ); /*Qx*/ *xup1 = add_o( *xup1, *xdn6, &Overflow ); /*Qx*/ -#else /* BASOP_NOGLOB */ - t1 = sub( *xup1, *xdn6 ); - *xup1 = add( *xup1, *xdn6 ); -#endif /* BASOP_NOGLOB */ move16(); xup1 += n4; xdn6 -= n4; -#ifdef BASOP_NOGLOB t2 = sub_o( *xdn6, *xup1, &Overflow ); /*Qx*/ *xdn6 = add_o( *xup1, *xdn6, &Overflow ); /*Qx*/ -#else /* BASOP_NOGLOB */ - t2 = sub( *xdn6, *xup1 ); - *xdn6 = add( *xup1, *xdn6 ); -#endif /* BASOP_NOGLOB */ move16(); xdn6 += n4; -#ifdef BASOP_NOGLOB t3 = add_o( *xdn8, *xup3, &Overflow ); /*Qx*/ *xdn6 = sub_o( *xdn8, *xup3, &Overflow ); /*Qx*/ -#else /* BASOP_NOGLOB */ - t3 = add( *xdn8, *xup3 ); - *xdn6 = sub( *xdn8, *xup3 ); -#endif /* BASOP_NOGLOB */ move16(); xup3 += n4; xdn8 -= n4; -#ifdef BASOP_NOGLOB t4 = add_o( *xup3, *xdn8, &Overflow ); /*Qx*/ *xup1 = sub_o( *xup3, *xdn8, &Overflow ); /*Qx*/ -#else /* BASOP_NOGLOB */ - t4 = add( *xup3, *xdn8 ); - *xup1 = sub( *xup3, *xdn8 ); -#endif /* BASOP_NOGLOB */ move16(); -#ifdef BASOP_NOGLOB t5 = sub_o( t1, t4, &Overflow ); /*Qx*/ t1 = add_o( t1, t4, &Overflow ); /*Qx*/ t4 = sub_o( t2, t3, &Overflow ); /*Qx*/ t2 = add_o( t2, t3, &Overflow ); /*Qx*/ *xup3 = sub_o( mult_r( t1, cc3 ), mult_r( t2, ss3 ), &Overflow ); /*Qx*/ -#else /* BASOP_NOGLOB */ - t5 = sub( t1, t4 ); - t1 = add( t1, t4 ); - t4 = sub( t2, t3 ); - t2 = add( t2, t3 ); - *xup3 = sub( mult_r( t1, cc3 ), mult_r( t2, ss3 ) ); -#endif /* BASOP_NOGLOB */ move16(); xup3 -= n4; -#ifdef BASOP_NOGLOB *xup3 = add_o( mult_r( t5, cc1 ), mult_r( t4, ss1 ), &Overflow ); /*Qx*/ -#else /* BASOP_NOGLOB */ - *xup3 = add( mult_r( t5, cc1 ), mult_r( t4, ss1 ) ); -#endif /* BASOP_NOGLOB */ move16(); -#ifdef BASOP_NOGLOB *xdn8 = sub_o( mult_r( t5, ss1 ), mult_r( t4, cc1 ), &Overflow ); /*Qx*/ -#else /* BASOP_NOGLOB */ - *xdn8 = sub( mult_r( t5, ss1 ), mult_r( t4, cc1 ) ); -#endif /* BASOP_NOGLOB */ move16(); xdn8 += n4; -#ifdef BASOP_NOGLOB *xdn8 = add_o( mult_r( t2, cc3 ), mult_r( t1, ss3 ), &Overflow ); /*Qx*/ -#else /* BASOP_NOGLOB */ - *xdn8 = add( mult_r( t2, cc3 ), mult_r( t1, ss3 ) ); -#endif /* BASOP_NOGLOB */ move16(); xup1 -= n4; @@ -324,17 +246,9 @@ void ifft_rel_fx( { r1 = *xi0; move16(); -#ifdef BASOP_NOGLOB *xi0 = add_o( r1, *xi1, &Overflow ); /*Qx*/ -#else /* BASOP_NOGLOB */ - *xi0 = add( r1, *xi1 ); -#endif /* BASOP_NOGLOB */ move16(); -#ifdef BASOP_NOGLOB *xi1 = sub_o( r1, *xi1, &Overflow ); /*Qx*/ -#else /* BASOP_NOGLOB */ - *xi1 = sub( r1, *xi1 ); -#endif move16(); xi0 += id; xi1 += id; diff --git a/lib_com/igf_base_fx.c b/lib_com/igf_base_fx.c index 5670088d3..cd34348b0 100644 --- a/lib_com/igf_base_fx.c +++ b/lib_com/igf_base_fx.c @@ -1142,19 +1142,11 @@ void IGFCommonFuncsCalcSfbEnergyPowerSpec( const Word16 startSfb, /**< in { Carry = 0; move16(); -#ifdef BASOP_NOGLOB sfbEnergy[sfb] = L_add_co( sfbEnergy[sfb], pPowerSpectrum[line], &Carry, &Overflow ); -#else /* BASOP_NOGLOB */ - sfbEnergy[sfb] = L_add_c( sfbEnergy[sfb], pPowerSpectrum[line] ); -#endif /* BASOP_NOGLOB */ move32(); Overflow = 0; move16(); -#ifdef BASOP_NOGLOB L_c = L_macNs_co( L_c, 0, 0, &Carry, &Overflow ); -#else /* BASOP_NOGLOB */ - L_c = L_macNs( L_c, 0, 0 ); -#endif } sfbEnergy[sfb] = norm_llQ31( L_c, sfbEnergy[sfb], &( sfbEnergy_exp[sfb] ) ); move32(); @@ -1194,11 +1186,7 @@ void IGFCommonFuncsMDCTSquareSpec( const Word16 sqrtBgn, /**< in FOR( i = sqrtBgn; i < sqrtEnd; i++ ) { -#ifdef BASOP_NOGLOB tmp = round_fx_sat( L_shl_sat( mdctSpec[i], s1 ) ); /*(15 - mdctSpec_e)+ S1*/ -#else - tmp = round_fx( L_shl( mdctSpec[i], s1 ) ); -#endif mdctSquareSpec[j++] = L_mult0( tmp, tmp ); /*31 - mdctSquareSpec_e*/ move32(); } diff --git a/lib_com/interpol.c b/lib_com/interpol.c index 7d74298b1..ceafad116 100644 --- a/lib_com/interpol.c +++ b/lib_com/interpol.c @@ -73,11 +73,7 @@ Word32 Interpol_lc_fx( /* o : interpolated value } L_sum = W_sat_l( L_sum64 ); /*Q14*/ } -#ifdef BASOP_NOGLOB L_sum = L_shl_sat( L_sum, 1 ); /*Q15*/ -#else - L_sum = L_shl( L_sum, 1 ); -#endif return L_sum; } @@ -108,15 +104,7 @@ Word16 Interpol_4( /* Qx o : interpolated value */ } BASOP_SATURATE_WARNING_OFF_EVS /* Here, saturation might occur by intention */ -#ifdef BASOP_NOGLOB L_sum = L_shl_o( L_sum, 1, &Overflow ); /*Qx+14+2*/ -#else /* BASOP_NOGLOB */ - L_sum = L_shl( L_sum, 1 ); -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS -#ifdef BASOP_NOGLOB return round_fx_o( L_sum, &Overflow ); /*Qx*/ -#else /* BASOP_NOGLOB */ - return round_fx( L_sum ); -#endif } diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index e7eaea5b7..467ce5298 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -2226,11 +2226,7 @@ void ivas_mct_side_bits_fx( const Word16 nb_bits_metadata /* i : number of metadata bits */ ); -#ifdef BASOP_NOGLOB /*Critical overflow */ Flag conv_fx_32( -#else -void conv_fx_32( -#endif const Word16 x[], /* i : i vector Q_new*/ const Word16 h[], /* i : impulse response (or second i vector) Q(15)*/ Word32 y[], /* o : output vetor (result of convolution) 12 bits*/ diff --git a/lib_com/ivas_stereo_mdct_bands_com.c b/lib_com/ivas_stereo_mdct_bands_com.c index 153f477b6..8c21798b6 100644 --- a/lib_com/ivas_stereo_mdct_bands_com.c +++ b/lib_com/ivas_stereo_mdct_bands_com.c @@ -46,11 +46,7 @@ * Local union *-------------------------------------------------------------------*/ -#ifndef BASOP_NOGLOB typedef union -#else /* BASOP_NOGLOB */ -typedef union -#endif /* BASOP_NOGLOB */ { MDCTStereoBands_config const *steBands; SpectrumWarping const *lpcBndsParam; diff --git a/lib_com/lerp.c b/lib_com/lerp.c index ed2ee211c..2fd9321be 100644 --- a/lib_com/lerp.c +++ b/lib_com/lerp.c @@ -310,11 +310,7 @@ static void lerp_proc( const Word16 *f /*Qx*/, Word16 *f_out /*Qx*/, Word16 buff diff = shr( extract_l( pos ), 1 ); /*Q15*/ /*buf[0]=f[0]+pos*(f[1]-f[0]);*/ move16(); -#ifdef BASOP_NOGLOB *ptr++ = add_sat( f[0], msu_r( L_mult( diff, f[1] ), diff, f[0] ) ); /*Qx*/ -#else - *ptr++ = add( f[0], msu_r( L_mult( diff, f[1] ), diff, f[0] ) ); -#endif } ELSE { @@ -324,11 +320,7 @@ static void lerp_proc( const Word16 *f /*Qx*/, Word16 *f_out /*Qx*/, Word16 buff diff = lshr( extract_l( pos ), 1 ); /*Q15*/ move16(); -#ifdef BASOP_NOGLOB *ptr++ = add_sat( f[idx], msu_r_sat( L_mult( diff, f[idx + 1] ), diff, f[idx] ) ); /*Qx*/ -#else - *ptr++ = add( f[idx], msu_r( L_mult( diff, f[idx + 1] ), diff, f[idx] ) ); -#endif } pos = L_add( pos, shift ); @@ -343,11 +335,7 @@ static void lerp_proc( const Word16 *f /*Qx*/, Word16 *f_out /*Qx*/, Word16 buff diff = sub( 16384 /*0.5f Q15*/, diff ); /*Q15*/ } move16(); -#ifdef BASOP_NOGLOB *ptr++ = add_sat( f[idx], msu_r_sat( L_mult( diff, f[idx + 1] ), diff, f[idx] ) ); /*Qx*/ -#else - *ptr++ = add( f[idx], msu_r( L_mult( diff, f[idx + 1] ), diff, f[idx] ) ); -#endif pos = L_add( pos, shift ); @@ -366,11 +354,7 @@ static void lerp_proc( const Word16 *f /*Qx*/, Word16 *f_out /*Qx*/, Word16 buff diff = lshr( extract_l( L_shr( L_sub( pos, L_deposit_h( idx ) ), 1 ) ), 1 ); /*Q15*/ move16(); -#ifdef BASOP_NOGLOB *ptr++ = add_sat( f[idx], shl_sat( msu_r_sat( L_mult( diff, f[idx + 1] ), diff, f[idx] ), 1 ) ); /*Qx*/ -#else - *ptr++ = add( f[idx], shl( msu_r( L_mult( diff, f[idx + 1] ), diff, f[idx] ), 1 ) ); -#endif test(); test(); test(); diff --git a/lib_com/log2.c b/lib_com/log2.c index 1fef489e9..3df1a960e 100644 --- a/lib_com/log2.c +++ b/lib_com/log2.c @@ -193,11 +193,7 @@ Word32 pow_10( Word32 x, Word16 *Q ) /*o : Q15, i: Q26*/ { Overflow = 0; move16(); -#ifdef BASOP_NOGLOB /* Critical Overflow */ L_tmp = L_shl_o( L_tmp, i, &Overflow ); -#else - L_tmp = L_shl( L_tmp, i ); -#endif if ( Overflow ) { count = add( count, 1 ); diff --git a/lib_com/low_rate_band_att_fx.c b/lib_com/low_rate_band_att_fx.c index be06b8b01..e26cb4652 100644 --- a/lib_com/low_rate_band_att_fx.c +++ b/lib_com/low_rate_band_att_fx.c @@ -85,11 +85,7 @@ void ivas_fine_gain_pred_fx( Mpy_32_16_ss( L_tmp, tmp1, &L_tmp, &lsb ); /*31-exp+11-15=27-exp */ #endif -#ifdef BASOP_NOGLOB gp = round_fx_o( L_shl_o( L_tmp, add( 1, exp ), &Overflow ), &Overflow ); /*27-exp+1+exp-16=12 */ -#else - gp = round_fx( L_shl( L_tmp, add( 1, exp ) ) ); /*27-exp+1+exp-16=12 */ -#endif test(); test(); IF( EQ_16( core, HQ_CORE ) && R != NULL && LE_16( R[i_sort[band]], 256 ) ) /* 256 is 32 in Q3 */ @@ -105,11 +101,7 @@ void ivas_fine_gain_pred_fx( /*gp *= 1.0f - 0.05f / accuracy; */ tmp = div_s( 13107, accuracy ); /* 0.05 in Q18 */ -#ifdef BASOP_NOGLOB tmp = shr_o( tmp, sub( 34, exp ), &Overflow ); /*15+18-exp+16-15=34-exp */ -#else /* BASOP_NOGLOB */ - tmp = shr( tmp, sub( 34, exp ) ); /*15+18-exp+16-15=34-exp */ -#endif tmp = sub( 32767, tmp ); tmp = s_max( 27554, tmp ); /* Limit attenuation to norm quantizer error, 2^-0.25 in Q15 */ gp = mult_r( tmp, gp ); /*15+12+1-16=12 */ @@ -201,11 +193,7 @@ void fine_gain_pred_fx( exp = sub( 31, add( exp, sub( 30, shl( shift, 1 ) ) ) ); L_tmp = Isqrt_lc( L_tmp, &exp ); /*31 - exp */ Mpy_32_16_ss( L_tmp, fine_gain_pred_sqrt_bw[bw_idx], &L_tmp, &lsb ); /*31-exp+11-15=27-exp */ -#ifdef BASOP_NOGLOB gp = round_fx_o( L_shl_o( L_tmp, add( 1, exp ), &Overflow ), &Overflow ); /*27-exp+1+exp-16=12 */ -#else - gp = round_fx( L_shl( L_tmp, add( 1, exp ) ) ); /*27-exp+1+exp-16=12 */ -#endif test(); test(); IF( EQ_16( core, HQ_CORE ) && R != NULL && LE_16( R[i_sort[band]], 256 ) ) /* 256 is 32 in Q3 */ @@ -221,11 +209,7 @@ void fine_gain_pred_fx( /*gp *= 1.0f - 0.05f / accuracy; */ tmp = div_s( 13107, accuracy ); /* 0.05 in Q18 */ -#ifdef BASOP_NOGLOB tmp = shr_o( tmp, sub( 34, exp ), &Overflow ); /*15+18-exp+16-15=34-exp */ -#else /* BASOP_NOGLOB */ - tmp = shr( tmp, sub( 34, exp ) ); /*15+18-exp+16-15=34-exp */ -#endif tmp = sub( 32767, tmp ); tmp = s_max( 27554, tmp ); /* Limit attenuation to norm quantizer error, 2^-0.25 in Q15 */ gp = mult_r( tmp, gp ); /*15+12+1-16=12 */ diff --git a/lib_com/lpc_tools_fx.c b/lib_com/lpc_tools_fx.c index 8f478dde7..1c0fb7500 100644 --- a/lib_com/lpc_tools_fx.c +++ b/lib_com/lpc_tools_fx.c @@ -427,11 +427,7 @@ static Word32 Div_32_opt( Word32 L_num /*Q31*/, Word16 denom_hi /*Qx -16*/, Word L_32 = Mpy_32_32( L_num, L_32 ); -#ifdef BASOP_NOGLOB L_32 = L_shl_o( L_32, 2, &Overflow ); -#else /* BASOP_NOGLOB */ - L_32 = L_shl( L_32, 2 ); -#endif /* BASOP_NOGLOB */ return ( L_32 ); } @@ -530,21 +526,12 @@ Word16 E_LPC_lev_dur_stab( const Word16 Rh[] /*QR -16*/, const Word16 Rl[] /*QR t0 = Mac_32( t0, Rh[j], Rl[j], Ah[i - j], Al[i - j] ); } -#ifdef BASOP_NOGLOB t0 = L_shl_o( t0, 4, &Overflow ); /* result in Q27 -> convert to Q31 */ -#else /* BASOP_NOGLOB */ - t0 = L_shl( t0, 4 ); /* result in Q27 -> convert to Q31 */ -#endif /* BASOP_NOGLOB */ /* No overflow possible */ /* Compose and add R[i] in Q3 */ -#ifdef BASOP_NOGLOB t0 = L_mac_o( t0, Rl[i], 1, &Overflow ); t0 = L_msu_o( t0, Rh[i], -32768, &Overflow ); -#else /* BASOP_NOGLOB */ - t0 = L_mac( t0, Rl[i], 1 ); - t0 = L_msu( t0, Rh[i], -32768 ); -#endif /* BASOP_NOGLOB */ /* K = -t0 / Alpha */ t1 = L_abs( t0 ); @@ -559,11 +546,7 @@ Word16 E_LPC_lev_dur_stab( const Word16 Rh[] /*QR -16*/, const Word16 Rl[] /*QR { t2 = L_negate( t2 ); /* K =-t0/Alpha */ } -#ifdef BASOP_NOGLOB t2 = L_shl_o( t2, alp_exp, &Overflow ); /* denormalize; compare to Alpha */ -#else /* BASOP_NOGLOB */ - t2 = L_shl( t2, alp_exp ); /* denormalize; compare to Alpha */ -#endif /* BASOP_NOGLOB */ test(); if ( ( mem != NULL ) && ( ( GT_16( abs_s( extract_h( t2 ) ), k_max ) ) ) ) { @@ -602,11 +585,7 @@ Word16 E_LPC_lev_dur_stab( const Word16 Rh[] /*QR -16*/, const Word16 Rl[] /*QR L_Extract( t2, &Ah[i], &Al[i] ); /* An[i] in Q27 */ /* Alpha = Alpha * (1-K**2) */ -#ifdef BASOP_NOGLOB t1 = L_mult_o( Kh, Kh, &Overflow ); /* K*K in Q31 */ -#else /* BASOP_NOGLOB */ - t1 = L_mult( Kh, Kh ); /* K*K in Q31 */ -#endif /* BASOP_NOGLOB */ t0 = L_mac( t1, mult( Kh, Kl ), 2 ); t0 = L_abs( t0 ); /* Some case <0 !! */ t0 = L_sub( (Word32) 0x7fffffffL, t0 ); /* 1 - K*K in Q31 */ @@ -642,11 +621,7 @@ Word16 E_LPC_lev_dur_stab( const Word16 Rh[] /*QR -16*/, const Word16 Rl[] /*QR FOR( i = 1; i <= order; i++ ) { t0 = L_Comp( Ah[i], Al[i] ); -#ifdef BASOP_NOGLOB A[i] = round_fx_o( L_shl_o( t0, k, &Overflow ), &Overflow ); -#else - A[i] = round_fx( L_shl( t0, k ) ); -#endif move16(); } @@ -745,21 +720,12 @@ Word16 E_LPC_lev_dur_stab_ivas_fx( const Word16 Rh[], const Word16 Rl[], Word16 t0 = Mac_32( t0, Rh[j], Rl[j], Ah[i - j], Al[i - j] ); } -#ifdef BASOP_NOGLOB t0 = L_shl_o( t0, 4, &Overflow ); /* result in Q27 -> convert to Q31 */ -#else /* BASOP_NOGLOB */ - t0 = L_shl( t0, 4 ); /* result in Q27 -> convert to Q31 */ -#endif /* BASOP_NOGLOB */ /* No overflow possible */ /* Compose and add R[i] in Q3 */ -#ifdef BASOP_NOGLOB t0 = L_mac_o( t0, Rl[i], 1, &Overflow ); t0 = L_msu_o( t0, Rh[i], -32768, &Overflow ); -#else /* BASOP_NOGLOB */ - t0 = L_mac( t0, Rl[i], 1 ); - t0 = L_msu( t0, Rh[i], -32768 ); -#endif /* BASOP_NOGLOB */ /* K = -t0 / Alpha */ t1 = L_abs( t0 ); @@ -774,11 +740,7 @@ Word16 E_LPC_lev_dur_stab_ivas_fx( const Word16 Rh[], const Word16 Rl[], Word16 { t2 = L_negate( t2 ); /* K =-t0/Alpha */ } -#ifdef BASOP_NOGLOB t2 = L_shl_o( t2, alp_exp, &Overflow ); /* denormalize; compare to Alpha */ -#else /* BASOP_NOGLOB */ - t2 = L_shl( t2, alp_exp ); /* denormalize; compare to Alpha */ -#endif /* BASOP_NOGLOB */ test(); if ( ( mem != NULL ) && ( ( GT_16( abs_s( extract_h( t2 ) ), k_max ) ) ) ) { @@ -817,11 +779,7 @@ Word16 E_LPC_lev_dur_stab_ivas_fx( const Word16 Rh[], const Word16 Rl[], Word16 L_Extract( t2, &Ah[i], &Al[i] ); /* An[i] in Q27 */ /* Alpha = Alpha * (1-K**2) */ -#ifdef BASOP_NOGLOB t1 = L_mult_o( Kh, Kh, &Overflow ); /* K*K in Q31 */ -#else /* BASOP_NOGLOB */ - t1 = L_mult( Kh, Kh ); /* K*K in Q31 */ -#endif /* BASOP_NOGLOB */ t0 = L_mac( t1, mult( Kh, Kl ), 2 ); t0 = L_abs( t0 ); /* Some case <0 !! */ t0 = L_sub( (Word32) 0x7fffffffL, t0 ); /* 1 - K*K in Q31 */ @@ -857,11 +815,7 @@ Word16 E_LPC_lev_dur_stab_ivas_fx( const Word16 Rh[], const Word16 Rl[], Word16 FOR( i = 1; i <= order; i++ ) { t0 = L_Comp( Ah[i], Al[i] ); -#ifdef BASOP_NOGLOB A[i] = round_fx_o( L_shl_o( t0, k, &Overflow ), &Overflow ); -#else - A[i] = round_fx( L_shl( t0, k ) ); -#endif move16(); } @@ -961,21 +915,12 @@ Word16 E_LPC_lev_dur_stab_fx( const Word16 Rh[] /*QR -16*/, const Word16 Rl[] /* t0 = Mac_32( t0, Rh[j], Rl[j], Ah[i - j], Al[i - j] ); } -#ifdef BASOP_NOGLOB t0 = L_shl_o( t0, 4, &Overflow ); /* result in Q27 -> convert to Q31 */ -#else /* BASOP_NOGLOB */ - t0 = L_shl( t0, 4 ); /* result in Q27 -> convert to Q31 */ -#endif /* BASOP_NOGLOB */ /* No overflow possible */ /* Compose and add R[i] in Q3 */ -#ifdef BASOP_NOGLOB t0 = L_mac_o( t0, Rl[i], 1, &Overflow ); t0 = L_msu_o( t0, Rh[i], -32768, &Overflow ); -#else /* BASOP_NOGLOB */ - t0 = L_mac( t0, Rl[i], 1 ); - t0 = L_msu( t0, Rh[i], -32768 ); -#endif /* BASOP_NOGLOB */ /* K = -t0 / Alpha */ t1 = L_abs( t0 ); @@ -990,11 +935,7 @@ Word16 E_LPC_lev_dur_stab_fx( const Word16 Rh[] /*QR -16*/, const Word16 Rl[] /* { t2 = L_negate( t2 ); /* K =-t0/Alpha */ } -#ifdef BASOP_NOGLOB t2 = L_shl_o( t2, alp_exp, &Overflow ); /* denormalize; compare to Alpha */ -#else /* BASOP_NOGLOB */ - t2 = L_shl( t2, alp_exp ); /* denormalize; compare to Alpha */ -#endif /* BASOP_NOGLOB */ test(); if ( ( mem != NULL ) && ( ( GT_16( abs_s( extract_h( t2 ) ), k_max ) ) ) ) { @@ -1033,11 +974,7 @@ Word16 E_LPC_lev_dur_stab_fx( const Word16 Rh[] /*QR -16*/, const Word16 Rl[] /* L_Extract( t2, &Ah[i], &Al[i] ); /* An[i] in Q27 */ /* Alpha = Alpha * (1-K**2) */ -#ifdef BASOP_NOGLOB t1 = L_mult_o( Kh, Kh, &Overflow ); /* K*K in Q31 */ -#else /* BASOP_NOGLOB */ - t1 = L_mult( Kh, Kh ); /* K*K in Q31 */ -#endif /* BASOP_NOGLOB */ t0 = L_mac( t1, mult( Kh, Kl ), 2 ); t0 = L_abs( t0 ); /* Some case <0 !! */ t0 = L_sub( (Word32) 0x7fffffffL, t0 ); /* 1 - K*K in Q31 */ @@ -1073,11 +1010,7 @@ Word16 E_LPC_lev_dur_stab_fx( const Word16 Rh[] /*QR -16*/, const Word16 Rl[] /* FOR( i = 1; i <= order; i++ ) { t0 = L_Comp( Ah[i], Al[i] ); -#ifdef BASOP_NOGLOB A[i] = L_shl_o( t0, k, &Overflow ); -#else - A[i] = L_shl(t0, k)); -#endif move16(); } @@ -1638,30 +1571,20 @@ void E_LPC_a_lsf_isf_conversion( Word16 *lpcCoeffs /*Qx*/, Word16 *lsf /*15Q16*/ Word16 ImAr = extract_h( L_sub( ImagFFT[i], ImagFFT[N / 2 - i] ) ); Word16 ImBr = extract_h( L_add( ImagFFT[i], ImagFFT[N / 2 - i] ) ); BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB tmpw15.v.re = mac_ro( L_mult( ptwiddle->v.re, pwn17->v.re ), ptwiddle->v.im, pwn17->v.im, &Overflow ); move16(); tmpw15.v.im = msu_ro( L_mult( ptwiddle->v.re, pwn17->v.im ), ptwiddle->v.im, pwn17->v.re, &Overflow ); move16(); -#else /* BASOP_NOGLOB */ - tmpw15.v.re = mac_r( L_mult( ptwiddle->v.re, pwn17->v.re ), ptwiddle->v.im, pwn17->v.im ); - tmpw15.v.im = msu_r( L_mult( ptwiddle->v.re, pwn17->v.im ), ptwiddle->v.im, pwn17->v.re ); -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS RealOut[i] = mac_r( L_msu( L_msu( L_mult( ReAr, pwn17->v.re ), ImAr, pwn17->v.im ), ReBr, pwn15->v.im ), ImBr, pwn15->v.re ); move16(); ImagOut[i] = mac_r( L_mac( L_mac( L_mult( ReAr, pwn17->v.im ), ImAr, pwn17->v.re ), ReBr, pwn15->v.re ), ImBr, pwn15->v.im ); move16(); BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB tmpw15.v.re = msu_ro( L_mult( ptwiddle->v.im, pwn17i->v.im ), ptwiddle->v.re, pwn17i->v.re, &Overflow ); move16(); tmpw15.v.im = mac_ro( L_mult( ptwiddle->v.re, pwn17i->v.im ), ptwiddle->v.im, pwn17i->v.re, &Overflow ); move16(); -#else /* BASOP_NOGLOB */ - tmpw15.v.re = msu_r( L_mult( ptwiddle->v.im, pwn17i->v.im ), ptwiddle->v.re, pwn17i->v.re ); - tmpw15.v.im = mac_r( L_mult( ptwiddle->v.re, pwn17i->v.im ), ptwiddle->v.im, pwn17i->v.re ); -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS RealOut[N / 2 - i] = msu_r( L_mac( L_mac( L_mult( ReAr, pwn17i->v.re ), ImAr, pwn17i->v.im ), ImBr, pwn15i->v.re ), ReBr, pwn15i->v.im ); move16(); @@ -1682,30 +1605,20 @@ void E_LPC_a_lsf_isf_conversion( Word16 *lpcCoeffs /*Qx*/, Word16 *lsf /*15Q16*/ Word16 ImAr = extract_h( L_sub( ImagFFT[i], ImagFFT[N / 2 - i] ) ); Word16 ImBr = extract_h( L_add( ImagFFT[i], ImagFFT[N / 2 - i] ) ); BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB tmpw15.v.re = mac_ro( L_mult( ptwiddle->v.im, pwn17->v.re ), ptwiddle->v.re, pwn17->v.im, &Overflow ); move16(); tmpw15.v.im = msu_ro( L_mult( ptwiddle->v.im, pwn17->v.im ), ptwiddle->v.re, pwn17->v.re, &Overflow ); move16(); -#else /* BASOP_NOGLOB */ - tmpw15.v.re = mac_r( L_mult( ptwiddle->v.im, pwn17->v.re ), ptwiddle->v.re, pwn17->v.im ); - tmpw15.v.im = msu_r( L_mult( ptwiddle->v.im, pwn17->v.im ), ptwiddle->v.re, pwn17->v.re ); -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS RealOut[i] = mac_r( L_msu( L_msu( L_mult( ReAr, pwn17->v.re ), ImAr, pwn17->v.im ), ReBr, pwn15->v.im ), ImBr, pwn15->v.re ); move16(); ImagOut[i] = mac_r( L_mac( L_mac( L_mult( ReAr, pwn17->v.im ), ImAr, pwn17->v.re ), ReBr, pwn15->v.re ), ImBr, pwn15->v.im ); move16(); BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB tmpw15.v.re = msu_ro( L_mult( ptwiddle->v.re, pwn17i->v.im ), ptwiddle->v.im, pwn17i->v.re, &Overflow ); move16(); tmpw15.v.im = mac_ro( L_mult( ptwiddle->v.im, pwn17i->v.im ), ptwiddle->v.re, pwn17i->v.re, &Overflow ); move16(); -#else /* BASOP_NOGLOB */ - tmpw15.v.re = msu_r( L_mult( ptwiddle->v.re, pwn17i->v.im ), ptwiddle->v.im, pwn17i->v.re ); - tmpw15.v.im = mac_r( L_mult( ptwiddle->v.im, pwn17i->v.im ), ptwiddle->v.re, pwn17i->v.re ); -#endif BASOP_SATURATE_WARNING_ON_EVS RealOut[N / 2 - i] = msu_r( L_mac( L_mac( L_mult( ReAr, pwn17i->v.re ), ImAr, pwn17i->v.im ), ImBr, pwn15i->v.re ), ReBr, pwn15i->v.im ); move16(); @@ -1723,15 +1636,10 @@ void E_LPC_a_lsf_isf_conversion( Word16 *lpcCoeffs /*Qx*/, Word16 *lsf /*15Q16*/ Word16 ImAr = extract_h( L_sub( ImagFFT[i], ImagFFT[N / 2 - i] ) ); Word16 ImBr = extract_h( ( L_negate( L_add( ImagFFT[i], ImagFFT[N / 2 - i] ) ) ) ); BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB tmpw15.v.re = mac_r_sat( L_mult( ptwiddle->v.im, pwn17->v.re ), ptwiddle->v.re, pwn17->v.im ); move16(); tmpw15.v.im = msu_r_sat( L_mult( ptwiddle->v.im, pwn17->v.im ), ptwiddle->v.re, pwn17->v.re ); move16(); -#else - tmpw15.v.re = mac_r( L_mult( ptwiddle->v.im, pwn17->v.re ), ptwiddle->v.re, pwn17->v.im ); - tmpw15.v.im = msu_r( L_mult( ptwiddle->v.im, pwn17->v.im ), ptwiddle->v.re, pwn17->v.re ); -#endif BASOP_SATURATE_WARNING_ON_EVS RealOut[i] = msu_r( L_msu( L_msu( L_mult( ReAr, pwn17->v.re ), ImAr, pwn17->v.im ), ReBr, pwn15->v.im ), ImBr, pwn15->v.re ); move16(); diff --git a/lib_com/lsf_tools_fx.c b/lib_com/lsf_tools_fx.c index 853b4ffd5..a24f008d9 100644 --- a/lib_com/lsf_tools_fx.c +++ b/lib_com/lsf_tools_fx.c @@ -109,22 +109,14 @@ static Word16 chebyshev( Word16 x, Word32 *f, const Word16 n, const Word16 shift /* i = 5 */ t0 = Mpy_32_16_1( b2, x ); /* t0 = x*b1 */ if ( !cheb ) -#ifdef BASOP_NOGLOB t0 = L_shl_o( t0, 1, &Overflow ); /* t0 = 2*x*b1 */ -#else /* BASOP_NOGLOB */ - t0 = L_shl( t0, 1 ); /* t0 = 2*x*b1 */ -#endif /* BASOP_NOGLOB */ t0 = L_sub( t0, b1 ); /* t0 = 2*x*b1 - b2 */ b1 = L_add( t0, *f++ ); /* b0 = 2*x*b1 - b2 + f[i] */ /* i = 6 */ t0 = Mpy_32_16_1( b1, x ); /* t0 = x*b1 */ if ( !cheb ) -#ifdef BASOP_NOGLOB t0 = L_shl_o( t0, 1, &Overflow ); /* t0 = 2*x*b1 */ -#else /* BASOP_NOGLOB */ - t0 = L_shl( t0, 1 ); /* t0 = 2*x*b1 */ -#endif /* BASOP_NOGLOB */ t0 = L_sub( t0, b2 ); /* t0 = 2*x*b1 - b2 */ } /* IF (sub(n,8) == 0) */ @@ -134,11 +126,7 @@ static Word16 chebyshev( Word16 x, Word32 *f, const Word16 n, const Word16 shift /* i = 7 */ t0 = Mpy_32_16_1( b2, x ); /* t0 = x*b1 */ if ( !cheb ) -#ifdef BASOP_NOGLOB t0 = L_shl_o( t0, 1, &Overflow ); /* t0 = 2*x*b1 */ -#else /* BASOP_NOGLOB */ - t0 = L_shl( t0, 1 ); /* t0 = 2*x*b1 */ -#endif /* BASOP_NOGLOB */ t0 = L_sub( t0, b1 ); /* t0 = 2*x*b1 - b2 */ /*b1 = L_add(b2,0);*/ } @@ -158,13 +146,8 @@ static Word16 chebyshev( Word16 x, Word32 *f, const Word16 n, const Word16 shift BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB t0 = L_shl_o( t0, shift, &Overflow ); /* Qx to Q30 with saturation */ cheb = round_fx_o( t0, &Overflow ); /* Result in Q14 */ -#else /* BASOP_NOGLOB */ - t0 = L_shl( t0, shift ); /* Qx to Q30 with saturation */ - cheb = round_fx( t0 ); /* Result in Q14 */ -#endif /* BASOP_NOGLOB */ cheb = s_max( -32767, cheb ); /* to avoid saturation */ BASOP_SATURATE_WARNING_ON_EVS return ( cheb ); @@ -303,11 +286,7 @@ void E_LPC_a_isp_conversion( const Word16 a[], Word16 isp[], const Word16 old_is * xint = xlow - ylow*(xhigh-xlow)/(yhigh-ylow) *--------------------------------------------------------*/ -#ifdef BASOP_NOGLOB y = sub_o( yhigh, ylow, &Overflow ); -#else - y = sub( yhigh, ylow ); -#endif IF( y != 0 ) { x = sub( xhigh, xlow ); @@ -466,15 +445,9 @@ void E_LPC_f_isp_a_conversion( const Word16 *isp, Word16 *a, const Word16 m ) BASOP_SATURATE_WARNING_OFF_EVS /*overflow handling in loop expression*/ -#ifdef BASOP_NOGLOB t0 = L_shl_o( t0, q, &Overflow ); t0n = L_sub_o( t0, 0x7FFFFFFF, &Overflow ); /*check for positive overflow*/ t0p = L_sub_o( t0, 0x80000000, &Overflow ); /*check for negative overflow*/ -#else /* BASOP_NOGLOB */ - t0 = L_shl( t0, q ); - t0n = L_sub( t0, 0x7FFFFFFF ); /*check for positive overflow*/ - t0p = L_sub( t0, 0x80000000 ); /*check for negative overflow*/ -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS q = sub( q, 1 ); /*decrease q in case of overflow*/ @@ -830,11 +803,7 @@ void lsp2lpc_fx( move16(); FOR( i = 0; i < order / 2; i++ ) { -#ifdef BASOP_NOGLOB /* Critical Overflow */ Ltemp = L_add_o( pq[i], pq[i + 1], &Overflow ); -#else - Ltemp = L_add( pq[i], pq[i + 1] ); -#endif giOverflow = (Word16) Overflow; move16(); IF( EQ_16( giOverflow, 1 ) ) @@ -866,11 +835,7 @@ void lsp2lpc_fx( FOR( i = 0; i < order / 2; i++ ) { -#ifdef BASOP_NOGLOB /* Critical Overflow */ Ltemp = L_sub_o( pq[i + 1], pq[i], &Overflow ); -#else - Ltemp = L_sub( pq[i + 1], pq[i] ); -#endif giOverflow = (Word16) Overflow; move16(); IF( EQ_16( giOverflow, 1 ) ) @@ -896,11 +861,7 @@ void lsp2lpc_fx( { Overflow = 0; move16(); -#ifdef BASOP_NOGLOB /* Critical Overflow */ Lacc = L_add_o( p[i], q[i], &Overflow ); /* p[i], q[i] in Q24 */ -#else - Lacc = L_add( p[i], q[i] ); /* p[i], q[i] in Q24 */ -#endif if ( Overflow ) { giOverflow = 1; @@ -910,11 +871,7 @@ void lsp2lpc_fx( Lacc = L_negate( Lacc ); /* Lacc=-(p[i]-q[i])/2 in Q25 */ Overflow = 0; move16(); -#ifdef BASOP_NOGLOB /* Critical Overflow */ Lacc = L_add_o( L_shl_o( Lacc, 3, &Overflow ), 0x08000, &Overflow ); /* rounding */ -#else - Lacc = L_add( L_shl( Lacc, 3 ), 0x08000 ); /* rounding */ -#endif if ( Overflow ) { giOverflow = 1; @@ -932,11 +889,7 @@ void lsp2lpc_fx( { Overflow = 0; move16(); -#ifdef BASOP_NOGLOB /* Critical Overflow */ Lacc = L_sub_o( q[i], p[i], &Overflow ); /* p[i], q[i] in Q24 */ -#else - Lacc = L_sub( q[i], p[i] ); /* p[i], q[i] in Q24 */ -#endif if ( Overflow ) { giOverflow = 1; @@ -944,11 +897,7 @@ void lsp2lpc_fx( } Overflow = 0; move16(); -#ifdef BASOP_NOGLOB /* Critical Overflow */ Lacc = L_add_o( L_shl_o( Lacc, 3, &Overflow ), 0x08000, &Overflow ); /* rounding */ -#else - Lacc = L_add( L_shl( Lacc, 3 ), 0x08000 ); /* rounding */ -#endif if ( Overflow ) { giOverflow = 1; @@ -1037,22 +986,13 @@ Word16 E_LPC_f_lsp_pol_get( const Word16 lsp[], Word32 f[], const Word16 n, cons Overflow = 0; move16(); plsp = lsp; -#ifdef BASOP_NOGLOB /* Critical Overflow and all those below*/ f[0] = L_shl_o( 1, sub( 31, Q_out ), &Overflow ); -#else - f[0] = L_shl( 1, sub( 31, Q_out ) ); -#endif move32(); /*b = -2.0f * *plsp;*/ b = *plsp; move16(); -#ifdef BASOP_NOGLOB /* Critical Overflow */ m2 = shl_o( -2, sub( 15, Q_out ), &Overflow ); f[1] = L_mult_o( b, m2, &Overflow ); -#else - m2 = shl( -2, sub( 15, Q_out ) ); - f[1] = L_mult( b, m2 ); -#endif move32(); FOR( i = 2; i <= n; i++ ) @@ -1061,35 +1001,19 @@ Word16 E_LPC_f_lsp_pol_get( const Word16 lsp[], Word32 f[], const Word16 n, cons /*b = 2.0f * *plsp;*/ move16(); b = *plsp; -#ifdef BASOP_NOGLOB /* Critical Overflow */ b32 = L_mult_o( b, m2, &Overflow ); -#else - b32 = L_mult( b, m2 ); -#endif /*f[i] = -b*f[i-1] + 2.0f*f[i-2];*/ move32(); -#ifdef BASOP_NOGLOB /* Critical Overflow */ f[i] = L_shl_o( L_sub_o( f[i - 2], Mpy_32_16_1( f[i - 1], b ), &Overflow ), 1, &Overflow ); -#else - f[i] = L_shl( L_sub( f[i - 2], Mpy_32_16_1( f[i - 1], b ) ), 1 ); -#endif FOR( j = i - 1; j > 1; j-- ) { /*f[j] += b*f[j-1] + f[j-2];*/ move32(); -#ifdef BASOP_NOGLOB /* Critical Overflow */ f[j] = L_add_o( f[j], L_sub_o( f[j - 2], L_shl_o( Mpy_32_16_1( f[j - 1], b ), 1, &Overflow ), &Overflow ), &Overflow ); -#else - f[j] = L_add( f[j], L_sub( f[j - 2], L_shl( Mpy_32_16_1( f[j - 1], b ), 1 ) ) ); -#endif } move32(); -#ifdef BASOP_NOGLOB /* Critical Overflow */ f[1] = L_add_o( f[1], b32, &Overflow ); -#else - f[1] = L_add( f[1], b32 ); -#endif } @@ -1333,11 +1257,7 @@ void E_LPC_f_lsp_a_conversion( const Word16 *lsp, Word16 *a, const Word16 m ) { f1[nc - i] = L_add( f1[nc - i], f1[nc - i - 1] ); move32(); -#ifdef BASOP_NOGLOB f2[nc - i] = L_sub_o( f2[nc - i], f2[nc - i - 1], &Overflow ); -#else - f2[nc - i] = L_sub( f2[nc - i], f2[nc - i - 1] ); -#endif move32(); } @@ -1349,13 +1269,8 @@ void E_LPC_f_lsp_a_conversion( const Word16 *lsp, Word16 *a, const Word16 m ) t0 = L_deposit_l( 0 ); FOR( i = 1; i <= nc; i++ ) { -#ifdef BASOP_NOGLOB t0 = L_max( t0, L_abs( L_add_o( f1[i], f2[i], &Overflow ) ) ); t0 = L_max( t0, L_abs( L_sub_o( f1[i], f2[i], &Overflow ) ) ); -#else - t0 = L_max( t0, L_abs( L_add( f1[i], f2[i] ) ) ); - t0 = L_max( t0, L_abs( L_sub( f1[i], f2[i] ) ) ); -#endif } k = s_min( norm_l( t0 ), 6 ); a[0] = shl( 256, k ); @@ -1370,30 +1285,14 @@ void E_LPC_f_lsp_a_conversion( const Word16 *lsp, Word16 *a, const Word16 m ) FOR( i = 1; i <= nc; i++ ) { /* a[i] = 0.5*(f1[i] + f2[i]) */ -#ifdef BASOP_NOGLOB t0 = L_add_o( f1[i], f2[i], &Overflow ); -#else - t0 = L_add( f1[i], f2[i] ); -#endif t0 = L_shl( t0, k ); -#ifdef BASOP_NOGLOB a[i] = round_fx_o( t0, &Overflow ); /* from Q23 to Qx and * 0.5 */ -#else - a[i] = round_fx( t0 ); /* from Q23 to Qx and * 0.5 */ -#endif /* a[j] = 0.5*(f1[i] - f2[i]) */ -#ifdef BASOP_NOGLOB t0 = L_sub_o( f1[i], f2[i], &Overflow ); -#else - t0 = L_sub( f1[i], f2[i] ); -#endif t0 = L_shl( t0, k ); -#ifdef BASOP_NOGLOB a[j] = round_fx_o( t0, &Overflow ); /* from Q23 to Qx and * 0.5 */ -#else - a[j] = round_fx( t0 ); /* from Q23 to Qx and * 0.5 */ -#endif j--; } @@ -1826,40 +1725,22 @@ void a2rc_fx( const Word16 *a, /* i: can be any Q */ { n = sub( sub( m, (Word16) 1 ), j ); L_tmp1 = L_mult( denom_mant, f_fx[j] ); /* denom*f[j]. Q15*Q12 = Q28 (floating with exp) */ -#ifdef BASOP_NOGLOB L_tmp1 = L_mac_o( L_tmp1, tmp, f_fx[n], &Overflow ); /* denom*f[j]+km*denom*f[n] in Q28 (floating with exp) */ -#else - L_tmp1 = L_mac( L_tmp1, tmp, f_fx[n] ); /* denom*f[j]+km*denom*f[n] in Q28 (floating with exp) */ -#endif L_tmp2 = L_mult( denom_mant, f_fx[n] ); /* denom*f[n]. Q15*Q12 = Q28 (floating with exp) */ -#ifdef BASOP_NOGLOB L_tmp2 = L_mac_o( L_tmp2, tmp, f_fx[j], &Overflow ); /* denom*f[n]+km*denom*f[j] in Q28 (floating with exp) */ L_tmp1 = L_shr_o( L_tmp1, exp, &Overflow ); /* bringing to true Q28 */ L_tmp2 = L_shr_o( L_tmp2, exp, &Overflow ); /* bringing to true Q28 */ f_fx[j] = round_fx_o( L_tmp1, &Overflow ); /* extracting in q_a */ f_fx[n] = round_fx_o( L_tmp2, &Overflow ); /* extracting in q_a */ -#else - L_tmp2 = L_mac( L_tmp2, tmp, f_fx[j] ); /* denom*f[n]+km*denom*f[j] in Q28 (floating with exp) */ - L_tmp1 = L_shr( L_tmp1, exp ); /* bringing to true Q28 */ - L_tmp2 = L_shr( L_tmp2, exp ); /* bringing to true Q28 */ - f_fx[j] = round_fx( L_tmp1 ); /* extracting in q_a */ - f_fx[n] = round_fx( L_tmp2 ); /* extracting in q_a */ -#endif } IF( m & 1 ) { L_tmp1 = L_mult( denom_mant, f_fx[j] ); /* denom*f[j]. Q15*Q12 = Q28 (floating with exp) */ -#ifdef BASOP_NOGLOB L_tmp1 = L_mac_o( L_tmp1, tmp, f_fx[j], &Overflow ); /* denom*f[j]+km*denom*f[j] in Q28 (floating with exp) */ L_tmp1 = L_shr_o( L_tmp1, exp, &Overflow ); /* bringing to true Q28 */ f_fx[j] = round_fx_o( L_tmp1, &Overflow ); /* extracting in q_a */ move16(); -#else - L_tmp1 = L_mac( L_tmp1, tmp, f_fx[j] ); /* denom*f[j]+km*denom*f[j] in Q28 (floating with exp) */ - L_tmp1 = L_shr( L_tmp1, exp ); /* bringing to true Q28 */ - f_fx[j] = round_fx( L_tmp1 ); /* extracting in q_a */ -#endif } } @@ -2358,18 +2239,10 @@ Word16 lsf_stab_fx( /* o : LP filter stability Q15*/ } e = sub( 30 - 21 - 1, e ); -#ifdef BASOP_NOGLOB tmp = round_fx_o( L_shl_o( L_tmp, e, &Overflow ), &Overflow ); /*Q14*/ -#else /* BASOP_NOGLOB */ - tmp = round_fx( L_shl( L_tmp, e ) ); /*Q14*/ -#endif /* BASOP_NOGLOB */ tmp = sub( 20480, tmp ); /* 1.25 - tmp in Q14 */ -#ifdef BASOP_NOGLOB tmp = shl_o( tmp, 1, &Overflow ); /* Q14 -> Q15 with saturation */ -#else /* BASOP_NOGLOB */ - tmp = shl( tmp, 1 ); /* Q14 -> Q15 with saturation */ -#endif tmp = s_max( tmp, 0 ); @@ -2459,20 +2332,12 @@ Word16 lsf_stab_ivas_fx( /* o : LP filter stability } e = sub( 30 - 21 - 1, e ); -#ifdef BASOP_NOGLOB tmp = round_fx_o( L_shl_o( L_tmp, e, &Overflow ), &Overflow ); /*Q12*/ -#else /* BASOP_NOGLOB */ - tmp = round_fx( L_shl( L_tmp, e ) ); /*Q14*/ -#endif /* BASOP_NOGLOB */ // tmp = sub(20480, tmp); /* 1.25 - tmp in Q14 */ tmp = sub( 5120, tmp ); /* 1.25 - tmp in Q12 */ -#ifdef BASOP_NOGLOB // tmp = shl_o(tmcp, 1, &Overflow); /* Q14 -> Q15 with saturation */ tmp = shl_sat( tmp, 3 ); /* Q12 -> Q15 with saturation */ -#else /* BASOP_NOGLOB */ - tmp = shl( tmp, 1 ); /* Q14 -> Q15 with saturation */ -#endif tmp = s_max( tmp, 0 ); @@ -2694,11 +2559,7 @@ void lsf2lsp_fx( { offset = negate( offset ); } -#ifdef BASOP_NOGLOB L_tmp = L_mult( sub_sat( offset, lsf_tmp ), round_fx( L_shl( L_and( L_tmp, 0xFFFF ), 15 ) ) ); -#else - L_tmp = L_mult( sub( offset, lsf_tmp ), round_fx( L_shl( L_and( L_tmp, 0xFFFF ), 15 ) ) ); -#endif L_tmp = L_msu( L_tmp, lsf_tmp, -32768 ); lsp[i] = round_fx( L_tmp ); } @@ -3973,11 +3834,7 @@ Word16 root_search_fx( Word16 low, exp1 = sub( 30 - 25, exp1 ); tmp = div_s( 16384, tmp ); /* 15+exp1 */ Ltmp = Mult_32_16( *v_low, tmp ); /* 15+exp1+25-15 */ -#ifdef BASOP_NOGLOB Ltemp = L_shl_o( Ltmp, ( 6 - exp1 ), &Overflow ); /* Q31 */ -#else - Ltemp = L_shl( Ltmp, ( 6 - exp1 ) ); /* Q31 */ -#endif if ( LT_32( *v_low, vh ) ) { Ltemp = L_negate( Ltemp ); diff --git a/lib_com/lsp_conv_poly_fx.c b/lib_com/lsp_conv_poly_fx.c index 6c2c55520..61ead2bf2 100644 --- a/lib_com/lsp_conv_poly_fx.c +++ b/lib_com/lsp_conv_poly_fx.c @@ -346,18 +346,10 @@ static Word32 b_inv_sq( exp_den = add( sub( 30, exp_den ), sub( 16, exp_in ) ); m_den = mult_r( m_den, m_den ); -#ifdef BASOP_NOGLOB exp_den = shl_o( exp_den, 1, &Overflow ); -#else /* BASOP_NOGLOB */ - exp_den = shl( exp_den, 1 ); -#endif /* BASOP_NOGLOB */ div_out = div_s( 8192, m_den ); -#ifdef BASOP_NOGLOB Ltmp = L_shl_o( div_out, add( sub( 30 - 13, exp_den ), 15 ), &Overflow ); /*Q15*/ -#else /* BASOP_NOGLOB */ - Ltmp = L_shl( div_out, add( sub( 30 - 13, exp_den ), 15 ) ); /*Q15*/ -#endif /* BASOP_NOGLOB */ return Ltmp; } @@ -387,11 +379,7 @@ static Word32 inv_pow( { exp1 = norm_l( re ); tmp = extract_h( L_shl( re, exp1 ) ); -#ifdef BASOP_NOGLOB L_tmp = L_shr( L_mult_o( tmp, tmp, &Overflow ), 1 ); -#else /* BASOP_NOGLOB */ - L_tmp = L_shr( L_mult( tmp, tmp ), 1 ); -#endif /* BASOP_NOGLOB */ Mpy_32_16_ss( L_tmp, x, &mh, &ml ); r0 = L_add( L_tmp, mh ); } @@ -406,11 +394,7 @@ static Word32 inv_pow( { exp2 = norm_l( se ); tmp = extract_h( L_shl( se, exp2 ) ); -#ifdef BASOP_NOGLOB L_tmp = L_shr( L_mult_o( tmp, tmp, &Overflow ), 1 ); -#else /* BASOP_NOGLOB */ - L_tmp = L_shr( L_mult( tmp, tmp ), 1 ); -#endif /* BASOP_NOGLOB */ Mpy_32_16_ss( L_tmp, x, &mh, &ml ); s0 = L_sub( L_tmp, mh ); } @@ -440,11 +424,7 @@ static Word32 inv_pow( } tmp = div_s( (Word16) ( ( 1 << 14 ) - 1 ), tmp ); exp1 = add( exp1, exp2 ); -#ifdef BASOP_NOGLOB L_tmp = L_shr_o( tmp, sub( 31, exp1 ), &Overflow ); /* result in Q15 */ -#else /* BASOP_NOGLOB */ - L_tmp = L_shr( tmp, sub( 31, exp1 ) ); /* result in Q15 */ -#endif /* BASOP_NOGLOB */ return ( L_tmp ); } @@ -546,11 +526,7 @@ static void spectautocorr_fx( move32(); FOR( i = 2; i < N - 1; i++ ) { -#ifdef BASOP_NOGLOB r[0] = L_add_o( r[0], G[i], &Overflow ); -#else /* BASOP_NOGLOB */ - r[0] = L_add( r[0], G[i] ); -#endif /* BASOP_NOGLOB */ move32(); } @@ -584,20 +560,12 @@ static void spectautocorr_fx( move16(); /* 1.0 in Q15 */ FOR( i = 1; i < imid; i++ ) { -#ifdef BASOP_NOGLOB gp = L_add_o( G[i], G[N - i - 1], &Overflow ); -#else /* BASOP_NOGLOB */ - gp = L_add( G[i], G[N - i - 1] ); -#endif /* BASOP_NOGLOB */ gn = L_sub( G[i], G[N - i - 1] ); /*r[1] = L_mac(r[1], x[i-1], gn);*/ Mpy_32_16_ss( gn, x[i - 1], &mh, &ml ); -#ifdef BASOP_NOGLOB r[1] = L_add_o( r[1], mh, &Overflow ); -#else - r[1] = L_add( r[1], mh ); -#endif move32(); c[1] = x[i - 1]; move16(); @@ -606,55 +574,31 @@ static void spectautocorr_fx( { c[j] = mult_r( c[j - 1], x[i - 1] ); move16(); -#ifdef BASOP_NOGLOB c[j] = add_o( c[j], sub_o( c[j], c[j - 2], &Overflow ), &Overflow ); -#else /* BASOP_NOGLOB */ - c[j] = add( c[j], sub( c[j], c[j - 2] ) ); -#endif /* BASOP_NOGLOB */ move16(); /*r[j] = L_mac(r[j], c[j], gp);*/ Mpy_32_16_ss( gp, c[j], &mh, &ml ); -#ifdef BASOP_NOGLOB r[j] = L_add_o( r[j], mh, &Overflow ); -#else /* BASOP_NOGLOB */ - r[j] = L_add( r[j], mh ); -#endif /* BASOP_NOGLOB */ move32(); c[j + 1] = mult_r( c[j], x[i - 1] ); move16(); -#ifdef BASOP_NOGLOB c[j + 1] = add_o( c[j + 1], sub_o( c[j + 1], c[j - 1], &Overflow ), &Overflow ); -#else /* BASOP_NOGLOB */ - c[j + 1] = add( c[j + 1], sub( c[j + 1], c[j - 1] ) ); -#endif /* BASOP_NOGLOB */ move16(); /*r[j+1] = L_mac(r[j+1], c[j+1], gn);*/ Mpy_32_16_ss( gn, c[j + 1], &mh, &ml ); -#ifdef BASOP_NOGLOB r[j + 1] = L_add_o( r[j + 1], mh, &Overflow ); -#else /* BASOP_NOGLOB */ - r[j + 1] = L_add( r[j + 1], mh ); -#endif /* BASOP_NOGLOB */ move32(); } c[j] = mult_r( c[j - 1], x[i - 1] ); move16(); -#ifdef BASOP_NOGLOB c[j] = add_o( c[j], sub_o( c[j], c[j - 2], &Overflow ), &Overflow ); -#else /* BASOP_NOGLOB */ - c[j] = add( c[j], sub( c[j], c[j - 2] ) ); -#endif /* BASOP_NOGLOB */ move16(); Mpy_32_16_ss( gp, c[j], &mh, &ml ); -#ifdef BASOP_NOGLOB r[j] = L_add_o( r[j], mh, &Overflow ); -#else /* BASOP_NOGLOB */ - r[j] = L_add( r[j], mh ); -#endif /* BASOP_NOGLOB */ move32(); } @@ -662,31 +606,18 @@ static void spectautocorr_fx( * Add the endpoints x = cos(0) = 1 and x = cos(pi) = -1 as * well as the lower half of the unit circle. *---------------------------------------------------------------------*/ -#ifdef BASOP_NOGLOB gp = L_shr( L_add_o( G[0], G[N - 1], &Overflow ), 1 ); -#else /* BASOP_NOGLOB */ - gp = L_shr( L_add( G[0], G[N - 1] ), 1 ); -#endif /* BASOP_NOGLOB */ gn = L_shr( L_sub( G[0], G[N - 1] ), 1 ); -#ifdef BASOP_NOGLOB r[0] = L_add_o( r[0], gp, &Overflow ); -#else /* BASOP_NOGLOB */ - r[0] = L_add( r[0], gp ); -#endif /* BASOP_NOGLOB */ move32(); exp0 = norm_l( r[0] ); L_Extract( L_shl( r[0], exp0 ), &rh[0], &rl[0] ); FOR( j = 1; j < M; j += 2 ) { -#ifdef BASOP_NOGLOB L_Extract( L_shl( L_add_o( r[j], gn, &Overflow ), exp0 ), &rh[j], &rl[j] ); L_Extract( L_shl( L_add_o( r[j + 1], gp, &Overflow ), exp0 ), &rh[j + 1], &rl[j + 1] ); -#else /* BASOP_NOGLOB */ - L_Extract( L_shl( L_add( r[j], gn ), exp0 ), &rh[j], &rl[j] ); - L_Extract( L_shl( L_add( r[j + 1], gp ), exp0 ), &rh[j + 1], &rl[j + 1] ); -#endif } return; diff --git a/lib_com/math_op.c b/lib_com/math_op.c index ea0a7ef6c..7014988b8 100644 --- a/lib_com/math_op.c +++ b/lib_com/math_op.c @@ -169,7 +169,6 @@ Word32 Pow2( /* (o) Q0 : result (range: 0<=val<=0x7fffff |___________________________________________________________________________| */ -#ifdef BASOP_NOGLOB Word32 Dot_product12_o( /* (o) Q31: normalized result (1 < val <= -1) */ const Word16 x[], /* (i) 12bits: x vector */ const Word16 y[], /* (i) 12bits: y vector */ @@ -177,33 +176,15 @@ Word32 Dot_product12_o( /* (o) Q31: normalized result (1 < va Word16 *exp, /* (o) : exponent of result (0..+30) */ Flag *Overflow_out /* o : propagating the Overflow flag to upper level, set to NULL to ignore internal overflows */ ) -#else /* BASOP_NOGLOB */ -Word32 Dot_product12( /* (o) Q31: normalized result (1 < val <= -1) */ - const Word16 x[], /* (i) 12bits: x vector */ - const Word16 y[], /* (i) 12bits: y vector */ - const Word16 lg, /* (i) : vector length */ - Word16 *exp /* (o) : exponent of result (0..+30) */ -) -#endif /* BASOP_NOGLOB */ { Word16 i, sft; Word32 L_sum; -#ifdef BASOP_NOGLOB Flag Overflow_ignored = 0; -#endif /* BASOP_NOGLOB */ -#ifdef BASOP_NOGLOB L_sum = L_mac_o( 1, x[0], y[0], &Overflow_ignored ); -#else - L_sum = L_mac( 1, x[0], y[0] ); -#endif FOR( i = 1; i < lg; i++ ) { -#ifdef BASOP_NOGLOB L_sum = L_mac_o( L_sum, x[i], y[i], Overflow_out ? Overflow_out : &Overflow_ignored ); -#else /* BASOP_NOGLOB */ - L_sum = L_mac( L_sum, x[i], y[i] ); -#endif /* BASOP_NOGLOB */ } /* Normalize acc in Q31 */ @@ -217,7 +198,6 @@ Word32 Dot_product12( /* (o) Q31: normalized result (1 < val < return L_sum; } -#ifdef BASOP_NOGLOB Word32 Dot_product12( /* (o) Q31: normalized result (1 < val <= -1) */ const Word16 x[], /* (i) 12bits: x vector */ const Word16 y[], /* (i) 12bits: y vector */ @@ -228,7 +208,6 @@ Word32 Dot_product12( /* (o) Q31: normalized result (1 < val < /* Ignore internal overflows */ return Dot_product12_o( x, y, lg, exp, NULL ); } -#endif /* BASOP_NOGLOB */ /*___________________________________________________________________________ | | @@ -258,18 +237,10 @@ Word32 Energy_scale( /* (o) : Q31: normalized result (1 < val IF( expi == 0 ) { -#ifdef BASOP_NOGLOB L_sum = L_mac_o( 1, x[0], x[0], &Overflow ); -#else - L_sum = L_mac( 1, x[0], x[0] ); -#endif FOR( i = 1; i < lg; i++ ) { -#ifdef BASOP_NOGLOB L_sum = L_mac_o( L_sum, x[i], x[i], &Overflow ); -#else /* BASOP_NOGLOB */ - L_sum = L_mac( L_sum, x[i], x[i] ); -#endif } } IF( expi < 0 ) @@ -280,16 +251,11 @@ Word32 Energy_scale( /* (o) : Q31: normalized result (1 < val FOR( i = 1; i < lg; i++ ) { tmp = mult_r( x[i], sft ); -#ifdef BASOP_NOGLOB L_sum = L_mac_o( L_sum, tmp, tmp, &Overflow ); -#else - L_sum = L_mac( L_sum, tmp, tmp ); -#endif } } IF( expi > 0 ) { -#ifdef BASOP_NOGLOB tmp = shl_o( x[0], expi, &Overflow ); L_sum = L_mac_o( 1, tmp, tmp, &Overflow ); FOR( i = 1; i < lg; i++ ) @@ -297,15 +263,6 @@ Word32 Energy_scale( /* (o) : Q31: normalized result (1 < val tmp = shl_o( x[i], expi, &Overflow ); L_sum = L_mac_o( L_sum, tmp, tmp, &Overflow ); } -#else - tmp = shl( x[0], expi ); - L_sum = L_mac( 1, tmp, tmp ); - FOR( i = 1; i < lg; i++ ) - { - tmp = shl( x[i], expi ); - L_sum = L_mac( L_sum, tmp, tmp ); - } -#endif } /* Normalize acc in Q31 */ diff --git a/lib_com/modif_fs_fx.c b/lib_com/modif_fs_fx.c index b53bb9d1c..6dace6f05 100644 --- a/lib_com/modif_fs_fx.c +++ b/lib_com/modif_fs_fx.c @@ -206,13 +206,8 @@ Word16 modify_Fs_ivas_fx( /* o : length of output Q { sigPtr = signal_fx + add( lg, add( mem_len, i ) ); L_tmp = syn_kern_16( 0, A_fx, sigPtr ); -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, 3 ); *sigPtr = round_fx_sat( L_tmp ); /* AZ ringing padding */ -#else - L_tmp = L_shl( L_tmp, 3 ); - *sigPtr = round_fx( L_tmp ); /* AZ ringing padding */ -#endif move16(); } mem_preemph_fx = signal_fx[mem_len + lg - LEN_WIN_SSS - 1]; @@ -238,11 +233,7 @@ Word16 modify_Fs_ivas_fx( /* o : length of output Q Word16 norm_cfg_ptr = norm_s( sub( cfg_ptr_fx->filter_fx[0], 1 ) ); FOR( i = 0; i < lg_out; i++ ) { -#ifdef BASOP_NOGLOB sigOut_fx[i] = round_fx_sat( Interpol_lc_fx( sigIn_ptr, cfg_ptr_fx->filter_fx, frac, fac_num, filt_len_tmp ) ); -#else - sigOut_fx[i] = round_fx( Interpol_lc_fx( sigIn_ptr, cfg_ptr_fx->filter_fx, frac, fac_num, filt_len_tmp ) ); -#endif move16(); frac = add( frac, fracstep ); @@ -282,13 +273,9 @@ Word16 modify_Fs_ivas_fx( /* o : length of output Q test(); IF( GT_32( fin, 16000 ) && ( EQ_16( lg_out, L_FRAME ) || EQ_16( lg_out, L_FRAME16k ) || EQ_16( lg_out, 512 ) ) ) { -#ifdef BASOP_NOGLOB num_den = shl_o( num_den, 1, &Overflow ); *Q_new_inp = add( *Q_new_inp, 1 ); move16(); -#else - num_den = shl( num_den, 1 ); -#endif } FOR( i = 0; i < lg_out; i++ ) { @@ -512,13 +499,8 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ sigPtr = signal_fx + add( add( lg, mem_len ), i ); move16(); /*+i*/ L_tmp = syn_kern_16( 0, A_fx, sigPtr ); -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, 3 ); *sigPtr = round_fx_sat( L_tmp ); /* AZ ringing padding */ -#else - L_tmp = L_shl( L_tmp, 3 ); - *sigPtr = round_fx( L_tmp ); /* AZ ringing padding */ -#endif } mem_preemph_fx = signal_fx[mem_len + lg - LEN_WIN_SSS - 1]; move16(); @@ -542,11 +524,7 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ FOR( i = 0; i < lg_out; i++ ) { -#ifdef BASOP_NOGLOB sigOut_fx[i] = round_fx_sat( Interpol_lc_fx( sigIn_ptr, cfg_ptr_fx->filter_fx, frac, fac_num, filt_len_tmp ) ); -#else - sigOut_fx[i] = round_fx( Interpol_lc_fx( sigIn_ptr, cfg_ptr_fx->filter_fx, frac, fac_num, filt_len_tmp ) ); -#endif move16(); frac = add( frac, fracstep ); @@ -584,12 +562,8 @@ Word16 modify_Fs_fx( /* o : length of output Q0 */ test(); if ( GT_32( fin, 16000 ) && ( EQ_16( lg_out, L_FRAME ) || EQ_16( lg_out, L_FRAME16k ) || EQ_16( lg_out, 512 ) ) ) { -#ifdef BASOP_NOGLOB num_den = shl_o( num_den, 1, &Overflow ); //*Q_new_inp = 2; -#else - num_den = shl( num_den, 1 ); -#endif } FOR( i = 0; i < lg_out; i++ ) { @@ -981,36 +955,20 @@ void Decimate_allpass_steep_fx( { Lacc = L_deposit_h( mem[0] ); /* Q(16+x) */ -#ifdef BASOP_NOGLOB Lacc = L_mac_o( Lacc, AP1_STEEP_FX[0], in_fx[2 * k], &Overflow ); /* Q(16+x) */ -#else - Lacc = L_mac( Lacc, AP1_STEEP_FX[0], in_fx[2 * k] ); /* Q(16+x) */ -#endif Lacc1 = L_deposit_h( in_fx[2 * k] ); /* Q16+Qx */ temp1 = extract_h( Lacc ); /* Qx */ -#ifdef BASOP_NOGLOB Lacc1 = L_msu_o( Lacc1, AP1_STEEP_FX[0], temp1, &Overflow ); /* Q16+Qx */ -#else - Lacc1 = L_msu( Lacc1, AP1_STEEP_FX[0], temp1 ); /* Q16+Qx */ -#endif mem[0] = extract_h( Lacc1 ); /* Qx */ temp[0] = temp1; move16(); move16(); Lacc1 = L_deposit_h( mem[1] ); /* Q16+Qx */ -#ifdef BASOP_NOGLOB Lacc1 = ( L_mac_o( Lacc1, AP1_STEEP_FX[1], temp1, &Overflow ) ); /* Q16+Qx */ -#else - Lacc1 = ( L_mac( Lacc1, AP1_STEEP_FX[1], temp1 ) ); /* Q16+Qx */ -#endif temp2 = extract_h( Lacc1 ); /* Qx */ -#ifdef BASOP_NOGLOB Lacc = L_msu_o( Lacc, AP1_STEEP_FX[1], temp2, &Overflow ); /* Q16+Qx */ -#else - Lacc = L_msu( Lacc, AP1_STEEP_FX[1], temp2 ); /* Q16+Qx */ -#endif mem[1] = extract_h( Lacc ); /* Qx */ temp[1] = temp2; move16(); @@ -1018,74 +976,41 @@ void Decimate_allpass_steep_fx( Lacc = L_deposit_h( mem[ALLPASSSECTIONS_STEEP - 1] ); /* Q(16+x) */ -#ifdef BASOP_NOGLOB out_fx[k] = extract_h( L_mac_o( Lacc, AP1_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], temp2, &Overflow ) ); /* Qx format */ move16(); mem[ALLPASSSECTIONS_STEEP - 1] = extract_h( L_msu_o( Lacc1, AP1_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], out_fx[k], &Overflow ) ); /* Qx */ move16(); -#else - out_fx[k] = extract_h( L_mac( Lacc, AP1_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], temp2 ) ); /* Qx format */ - mem[ALLPASSSECTIONS_STEEP - 1] = extract_h( L_msu( Lacc1, AP1_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], out_fx[k] ) ); /* Qx */ -#endif } /* lower allpass filter chain */ Lacc = L_deposit_h( mem[ALLPASSSECTIONS_STEEP] ); /* Q(16+x) */ -#ifdef BASOP_NOGLOB Lacc = L_mac_o( Lacc, AP2_STEEP_FX[0], mem[2 * ALLPASSSECTIONS_STEEP], &Overflow ); /*Q(16+x) */ -#else - Lacc = L_mac( Lacc, AP2_STEEP_FX[0], mem[2 * ALLPASSSECTIONS_STEEP] ); /*Q(16+x) */ -#endif Lacc1 = L_deposit_h( mem[2 * ALLPASSSECTIONS_STEEP] ); /* Q(16+x) */ temp1 = extract_h( Lacc ); /* Qx */ -#ifdef BASOP_NOGLOB Lacc1 = L_msu_o( Lacc1, AP2_STEEP_FX[0], temp1, &Overflow ); /* Q(16+x) */ -#else - Lacc1 = L_msu( Lacc1, AP2_STEEP_FX[0], temp1 ); /* Q(16+x) */ -#endif mem[ALLPASSSECTIONS_STEEP] = extract_h( Lacc1 ); temp[0] = temp1; move16(); Lacc1 = L_deposit_h( mem[ALLPASSSECTIONS_STEEP + 1] ); /* Q(16+x) */ -#ifdef BASOP_NOGLOB Lacc1 = L_mac_o( Lacc1, AP2_STEEP_FX[1], temp1, &Overflow ); /* Q(16+x) */ -#else - Lacc1 = L_mac( Lacc1, AP2_STEEP_FX[1], temp1 ); /* Q(16+x) */ -#endif temp2 = extract_h( Lacc1 ); /* Qx */ temp[1] = temp2; move16(); -#ifdef BASOP_NOGLOB Lacc = L_msu_o( Lacc, AP2_STEEP_FX[1], temp2, &Overflow ); /* Q(16+x) */ -#else - Lacc = L_msu( Lacc, AP2_STEEP_FX[1], temp2 ); /* Q(16+x) */ -#endif mem[ALLPASSSECTIONS_STEEP + 1] = extract_h( Lacc ); /* Qx */ move16(); Lacc = L_deposit_h( mem[2 * ALLPASSSECTIONS_STEEP - 1] ); /* Q(16+x) */ -#ifdef BASOP_NOGLOB Lacc = L_mac_o( Lacc, AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], temp2, &Overflow ); /* Q(16+x) temp[ALLPASSSECTIONS_STEEP-1] */ -#else - Lacc = L_mac( Lacc, AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], temp2 ); /* Q(16+x) temp[ALLPASSSECTIONS_STEEP-1] */ -#endif temp[2] = extract_h( Lacc ); /* temp[2] in Qx */ move16(); -#ifdef BASOP_NOGLOB Lacc1 = L_msu_o( Lacc1, AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], temp[2], &Overflow ); /* Q(16+x) */ -#else - Lacc1 = L_msu( Lacc1, AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], temp[2] ); /* Q(16+x) */ -#endif mem[2 * ALLPASSSECTIONS_STEEP - 1] = extract_h( Lacc1 ); /* Qx */ move16(); sum = mult_r( out_fx[0], 16384 ); /* Qx */ -#ifdef BASOP_NOGLOB out_fx[0] = add_sat( sum, mult_r( temp[ALLPASSSECTIONS_STEEP - 1], 16384 ) ); /* Qx */ -#else - out_fx[0] = add( sum, mult_r( temp[ALLPASSSECTIONS_STEEP - 1], 16384 ) ); /* Qx */ -#endif move16(); @@ -1094,18 +1019,10 @@ void Decimate_allpass_steep_fx( Lacc = L_deposit_h( mem[ALLPASSSECTIONS_STEEP] ); /* Q(16+x) */ -#ifdef BASOP_NOGLOB Lacc = L_mac_o( Lacc, AP2_STEEP_FX[0], in_fx[2 * k - 1], &Overflow ); /* Q(16+x):temp[0] */ -#else - Lacc = L_mac( Lacc, AP2_STEEP_FX[0], in_fx[2 * k - 1] ); /* Q(16+x):temp[0] */ -#endif Lacc1 = L_deposit_h( in_fx[2 * k - 1] ); /* Q(16+x) */ temp1 = extract_h( Lacc ); /* Qx */ -#ifdef BASOP_NOGLOB Lacc1 = L_msu_o( Lacc1, AP2_STEEP_FX[0], temp1, &Overflow ); /* Q(16+x) */ -#else - Lacc1 = L_msu( Lacc1, AP2_STEEP_FX[0], temp1 ); /* Q(16+x) */ -#endif mem[ALLPASSSECTIONS_STEEP] = extract_h( Lacc1 ); /* Qx */ move16(); @@ -1114,44 +1031,24 @@ void Decimate_allpass_steep_fx( Lacc1 = L_deposit_h( mem[ALLPASSSECTIONS_STEEP + 1] ); /* Q(16+x) */ -#ifdef BASOP_NOGLOB Lacc1 = L_mac_o( Lacc1, AP2_STEEP_FX[1], temp1, &Overflow ); /* Q(16+x) */ -#else - Lacc1 = L_mac( Lacc1, AP2_STEEP_FX[1], temp1 ); /* Q(16+x) */ -#endif temp2 = extract_h( Lacc1 ); /* Qx */ temp[1] = temp2; move16(); -#ifdef BASOP_NOGLOB Lacc = L_msu_o( Lacc, AP2_STEEP_FX[1], temp2, &Overflow ); /* Q(16+x) */ -#else - Lacc = L_msu( Lacc, AP2_STEEP_FX[1], temp2 ); /* Q(16+x) */ -#endif mem[ALLPASSSECTIONS_STEEP + 1] = extract_h( Lacc ); /* Qx */ Lacc = L_deposit_h( mem[2 * ALLPASSSECTIONS_STEEP - 1] ); /* Q(16+x) */ -#ifdef BASOP_NOGLOB Lacc = L_mac_o( Lacc, AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], temp[1], &Overflow ); /* Q(16+x) temp[ALLPASSSECTIONS_STEEP-1] */ -#else - Lacc = L_mac( Lacc, AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], temp[1] ); /* Q(16+x) temp[ALLPASSSECTIONS_STEEP-1] */ -#endif temp[2] = extract_h( Lacc ); /*temp[2] in Qx */ -#ifdef BASOP_NOGLOB Lacc1 = L_msu_o( Lacc1, AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], temp[2], &Overflow ); /* Q(16+x) */ -#else - Lacc1 = L_msu( Lacc1, AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], temp[2] ); /* Q(16+x) */ -#endif mem[2 * ALLPASSSECTIONS_STEEP - 1] = extract_h( Lacc1 ); /* Qx */ sum = mult_r( out_fx[k], 16384 ); /* Qx */ -#ifdef BASOP_NOGLOB out_fx[k] = add_sat( sum, mult_r( temp[ALLPASSSECTIONS_STEEP - 1], 16384 ) ); move16(); -#else - out_fx[k] = add( sum, mult_r( temp[ALLPASSSECTIONS_STEEP - 1], 16384 ) ); -#endif move16(); /* Qx */ } @@ -1189,54 +1086,28 @@ void Interpolate_allpass_steep_fx( { Lacc = L_deposit_h( mem[0] ); /* Q(16+x) */ -#ifdef BASOP_NOGLOB Lacc = L_mac_o( Lacc, AP2_STEEP_FX[0], in_fx[k], &Overflow ); /* Q(16+x):temp[0] */ -#else - Lacc = L_mac( Lacc, AP2_STEEP_FX[0], in_fx[k] ); /* Q(16+x):temp[0] */ -#endif Lacc1 = L_deposit_h( in_fx[k] ); /* Q(16+x) */ -#ifdef BASOP_NOGLOB temp1 = round_fx_o( Lacc, &Overflow ); /* Qx */ Lacc1 = L_msu_o( Lacc1, AP2_STEEP_FX[0], temp1, &Overflow ); /* Q(16+x) */ mem[0] = round_fx_o( Lacc1, &Overflow ); move16(); -#else - temp1 = round_fx( Lacc ); /* Qx */ - Lacc1 = L_msu( Lacc1, AP2_STEEP_FX[0], temp1 ); /* Q(16+x) */ - - mem[0] = round_fx( Lacc1 ); -#endif Lacc1 = L_deposit_h( mem[1] ); /* Q(16+x) */ -#ifdef BASOP_NOGLOB Lacc1 = ( L_mac_o( Lacc1, AP2_STEEP_FX[1], temp1, &Overflow ) ); /* Q(16+x):temp[1] */ -#else - Lacc1 = ( L_mac( Lacc1, AP2_STEEP_FX[1], temp1 ) ); /* Q(16+x):temp[1] */ -#endif Lacc = L_deposit_h( temp1 ); -#ifdef BASOP_NOGLOB temp2 = round_fx_o( Lacc1, &Overflow ); /* Qx */ Lacc = L_msu_o( Lacc, AP2_STEEP_FX[1], temp2, &Overflow ); /* Q(16+x) */ mem[1] = round_fx_o( Lacc, &Overflow ); /* Qx */ move16(); -#else - temp2 = round_fx( Lacc1 ); /* Qx */ - Lacc = L_msu( Lacc, AP2_STEEP_FX[1], temp2 ); /* Q(16+x) */ - mem[1] = round_fx( Lacc ); /* Qx */ -#endif Lacc1 = L_deposit_h( temp2 ); Lacc = L_deposit_h( mem[ALLPASSSECTIONS_STEEP - 1] ); /* Q(16+x) */ -#ifdef BASOP_NOGLOB out_fx[2 * k + 1] = round_fx_o( L_mac_o( Lacc, AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], temp2, &Overflow ), &Overflow ); /* Qx format */ move16(); mem[ALLPASSSECTIONS_STEEP - 1] = round_fx_o( L_msu_o( Lacc1, AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], out_fx[2 * k + 1], &Overflow ), &Overflow ); /* Qx */ move16(); -#else - out_fx[2 * k + 1] = round_fx( L_mac( Lacc, AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], temp2 ) ); /* Qx format */ - mem[ALLPASSSECTIONS_STEEP - 1] = round_fx( L_msu( Lacc1, AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], out_fx[2 * k + 1] ) ); /* Qx */ -#endif } /* lower allpass filter chain */ @@ -1244,53 +1115,26 @@ void Interpolate_allpass_steep_fx( FOR( k = 0; k < N; k++ ) { Lacc = L_deposit_h( mem[ALLPASSSECTIONS_STEEP] ); /* Q(16+x) */ -#ifdef BASOP_NOGLOB Lacc = L_mac_o( Lacc, AP1_STEEP_FX[0], in_fx[k], &Overflow ); /* Q(16+x):temp[0] */ -#else - Lacc = L_mac( Lacc, AP1_STEEP_FX[0], in_fx[k] ); /* Q(16+x):temp[0] */ -#endif Lacc1 = L_deposit_h( in_fx[k] ); /* Q(16+x) */ -#ifdef BASOP_NOGLOB temp1 = round_fx_o( Lacc, &Overflow ); /* Qx */ Lacc1 = L_msu_o( Lacc1, AP1_STEEP_FX[0], temp1, &Overflow ); /* Q(16+x) */ mem[ALLPASSSECTIONS_STEEP] = round_fx_o( Lacc1, &Overflow ); -#else - temp1 = round_fx( Lacc ); /* Qx */ - Lacc1 = L_msu( Lacc1, AP1_STEEP_FX[0], temp1 ); /* Q(16+x) */ - - mem[ALLPASSSECTIONS_STEEP] = round_fx( Lacc1 ); -#endif Lacc1 = L_deposit_h( mem[ALLPASSSECTIONS_STEEP + 1] ); /* Q(16+x) */ -#ifdef BASOP_NOGLOB Lacc1 = L_mac_o( Lacc1, AP1_STEEP_FX[1], temp1, &Overflow ); /* Q(16+x):temp[1] */ temp2 = round_fx_o( Lacc1, &Overflow ); /* Qx */ -#else - Lacc1 = L_mac( Lacc1, AP1_STEEP_FX[1], temp1 ); /* Q(16+x):temp[1] */ - - temp2 = round_fx( Lacc1 ); /* Qx */ -#endif Lacc = L_deposit_h( temp1 ); -#ifdef BASOP_NOGLOB Lacc = L_msu_o( Lacc, AP1_STEEP_FX[1], temp2, &Overflow ); /* Q(16+x) */ mem[ALLPASSSECTIONS_STEEP + 1] = round_fx_o( Lacc, &Overflow ); /* Qx */ -#else - Lacc = L_msu( Lacc, AP1_STEEP_FX[1], temp2 ); /* Q(16+x) */ - mem[ALLPASSSECTIONS_STEEP + 1] = round_fx( Lacc ); /* Qx */ -#endif Lacc = L_deposit_h( mem[2 * ALLPASSSECTIONS_STEEP - 1] ); /* Q(16+x) */ Lacc1 = L_deposit_h( temp2 ); -#ifdef BASOP_NOGLOB out_fx[2 * k] = round_fx_o( L_mac_o( Lacc, AP1_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], temp2, &Overflow ), &Overflow ); /* Qx format */ move16(); mem[2 * ALLPASSSECTIONS_STEEP - 1] = round_fx_o( L_msu_o( Lacc1, AP1_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], out_fx[2 * k], &Overflow ), &Overflow ); /* Qx */ move16(); -#else - out_fx[2 * k] = round_fx( L_mac( Lacc, AP1_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], temp2 ) ); /* Qx format */ - mem[2 * ALLPASSSECTIONS_STEEP - 1] = round_fx( L_msu( Lacc1, AP1_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], out_fx[2 * k] ) ); /* Qx */ -#endif } return; @@ -1346,19 +1190,11 @@ void interpolate_3_over_2_allpass_fx( Vu[1] = mem[1] + filt_coeff[1] * ( Vu[0] - mem[2] ); mem[3] = mem[2] + filt_coeff[2] * ( Vu[1] - mem[3] );*/ -#ifdef BASOP_NOGLOB Vu[0] = add_sat( mem_fx[0], mult_r_sat( filt_coeff_fx[0], sub_sat( input_fx_temp[i], mem_fx[1] ) ) ); move16(); /* all Vu's in : Q_current*/ Vu[1] = add_sat( mem_fx[1], mult_r_sat( filt_coeff_fx[1], sub_sat( Vu[0], mem_fx[2] ) ) ); move16(); mem_fx[3] = add_sat( mem_fx[2], mult_r_sat( filt_coeff_fx[2], sub_sat( Vu[1], mem_fx[3] ) ) ); -#else - Vu[0] = add( mem_fx[0], mult_r( filt_coeff_fx[0], sub( input_fx_temp[i], mem_fx[1] ) ) ); - move16(); /* all Vu's in : Q_current*/ - Vu[1] = add( mem_fx[1], mult_r( filt_coeff_fx[1], sub( Vu[0], mem_fx[2] ) ) ); - move16(); - mem_fx[3] = add( mem_fx[2], mult_r( filt_coeff_fx[2], sub( Vu[1], mem_fx[3] ) ) ); -#endif move16(); @@ -1373,21 +1209,12 @@ void interpolate_3_over_2_allpass_fx( /* Vm[0] = mem[0] + filt_coeff[3] * (input[i]-mem[4]); Vm[1] = mem[4] + filt_coeff[4] * (Vm[0]-mem[5]); mem[6] = mem[5] + filt_coeff[5] * (Vm[1]-mem[6]); */ -#ifdef BASOP_NOGLOB Vm[0] = add_sat( mem_fx[0], mult_r_sat( filt_coeff_fx[3], sub_sat( input_fx_temp[i], mem_fx[4] ) ) ); move16(); Vm[1] = add_sat( mem_fx[4], mult_r_sat( filt_coeff_fx[4], sub_sat( Vm[0], mem_fx[5] ) ) ); move16(); mem_fx[6] = add_sat( mem_fx[5], mult_r_sat( filt_coeff_fx[5], sub_sat( Vm[1], mem_fx[6] ) ) ); move16(); -#else - Vm[0] = add( mem_fx[0], mult_r( filt_coeff_fx[3], sub( input_fx_temp[i], mem_fx[4] ) ) ); - move16(); - Vm[1] = add( mem_fx[4], mult_r( filt_coeff_fx[4], sub( Vm[0], mem_fx[5] ) ) ); - move16(); - mem_fx[6] = add( mem_fx[5], mult_r( filt_coeff_fx[5], sub( Vm[1], mem_fx[6] ) ) ); - move16(); -#endif mem_fx[4] = Vm[0]; move16(); mem_fx[5] = Vm[1]; @@ -1399,21 +1226,12 @@ void interpolate_3_over_2_allpass_fx( /* Vl[0] = mem[0] + filt_coeff[6] * (input[i]-mem[7]); Vl[1] = mem[7] + filt_coeff[7] * (Vl[0]-mem[8]); mem[9] = mem[8] + filt_coeff[8] * (Vl[1]-mem[9]); */ -#ifdef BASOP_NOGLOB Vl[0] = add_sat( mem_fx[0], mult_r_sat( filt_coeff_fx[6], sub_sat( input_fx_temp[i], mem_fx[7] ) ) ); move16(); Vl[1] = add_sat( mem_fx[7], mult_r_sat( filt_coeff_fx[7], sub_sat( Vl[0], mem_fx[8] ) ) ); move16(); mem_fx[9] = add_sat( mem_fx[8], mult_r_sat( filt_coeff_fx[8], sub_sat( Vl[1], mem_fx[9] ) ) ); move16(); -#else - Vl[0] = add( mem_fx[0], mult_r( filt_coeff_fx[6], sub( input_fx_temp[i], mem_fx[7] ) ) ); - move16(); - Vl[1] = add( mem_fx[7], mult_r( filt_coeff_fx[7], sub( Vl[0], mem_fx[8] ) ) ); - move16(); - mem_fx[9] = add( mem_fx[8], mult_r( filt_coeff_fx[8], sub( Vl[1], mem_fx[9] ) ) ); - move16(); -#endif mem_fx[0] = input_fx_temp[i]; move16(); mem_fx[7] = Vl[0]; @@ -1432,13 +1250,8 @@ void interpolate_3_over_2_allpass_fx( { mem_temp = out1_buff[shl( i, 1 )]; move16(); -#ifdef BASOP_NOGLOB out_fx[i] = add_sat( mult_r_sat( 1550 /* 0.0473147f Q15*/, add_sat( mem_temp, mem_fx[10] ) ), mult_r_sat( -4965 /*-0.151521f Q15*/, add_sat( mem_fx[11], mem_fx[14] ) ) ); out_fx[i] = add_sat( out_fx[i], mult_r_sat( 20125 /*0.614152f Q15*/, add_sat( mem_fx[12], mem_fx[13] ) ) ); -#else - out_fx[i] = add( mult_r( 1550 /* 0.0473147f Q15*/, add( mem_temp, mem_fx[10] ) ), mult_r( -4965 /*-0.151521f Q15*/, add( mem_fx[11], mem_fx[14] ) ) ); - out_fx[i] = add( out_fx[i], mult_r( 20125 /*0.614152f Q15*/, add( mem_fx[12], mem_fx[13] ) ) ); -#endif mem_fx[10] = mem_fx[11]; move16(); mem_fx[11] = mem_fx[12]; @@ -1581,23 +1394,11 @@ void interpolate_3_over_1_allpass_fx( Vu[1] = mem[1] + filt_coeff[1] * ( Vu[0] - mem[2] ); mem[3] = mem[2] + filt_coeff[2] * ( Vu[1] - mem[3] );*/ -#ifdef BASOP_NOGLOB Vu[0] = add_sat( mem_fx[0], mult_r( filt_coeff_fx[0], sub_sat( input_fx[i], mem_fx[1] ) ) ); -#else - Vu[0] = add( mem_fx[0], mult_r( filt_coeff_fx[0], sub( input_fx[i], mem_fx[1] ) ) ); -#endif move16(); /* all Vu's in : Q_current*/ -#ifdef BASOP_NOGLOB Vu[1] = add_sat( mem_fx[1], mult_r( filt_coeff_fx[1], sub_sat( Vu[0], mem_fx[2] ) ) ); -#else - Vu[1] = add( mem_fx[1], mult_r( filt_coeff_fx[1], sub( Vu[0], mem_fx[2] ) ) ); -#endif move16(); -#ifdef BASOP_NOGLOB mem_fx[3] = add_sat( mem_fx[2], mult_r( filt_coeff_fx[2], sub_sat( Vu[1], mem_fx[3] ) ) ); -#else - mem_fx[3] = add( mem_fx[2], mult_r( filt_coeff_fx[2], sub( Vu[1], mem_fx[3] ) ) ); -#endif move16(); @@ -1612,23 +1413,11 @@ void interpolate_3_over_1_allpass_fx( /* Vm[0] = mem[0] + filt_coeff[3] * (input[i]-mem[4]); Vm[1] = mem[4] + filt_coeff[4] * (Vm[0]-mem[5]); mem[6] = mem[5] + filt_coeff[5] * (Vm[1]-mem[6]); */ -#ifdef BASOP_NOGLOB Vm[0] = add_sat( mem_fx[0], mult_r( filt_coeff_fx[3], sub_sat( input_fx[i], mem_fx[4] ) ) ); -#else - Vm[0] = add( mem_fx[0], mult_r( filt_coeff_fx[3], sub( input_fx[i], mem_fx[4] ) ) ); -#endif move16(); -#ifdef BASOP_NOGLOB Vm[1] = add_sat( mem_fx[4], mult_r( filt_coeff_fx[4], sub_sat( Vm[0], mem_fx[5] ) ) ); -#else - Vm[1] = add( mem_fx[4], mult_r( filt_coeff_fx[4], sub( Vm[0], mem_fx[5] ) ) ); -#endif move16(); -#ifdef BASOP_NOGLOB mem_fx[6] = add_sat( mem_fx[5], mult_r( filt_coeff_fx[5], sub_sat( Vm[1], mem_fx[6] ) ) ); -#else - mem_fx[6] = add( mem_fx[5], mult_r( filt_coeff_fx[5], sub( Vm[1], mem_fx[6] ) ) ); -#endif move16(); mem_fx[4] = Vm[0]; @@ -1642,23 +1431,11 @@ void interpolate_3_over_1_allpass_fx( /* Vl[0] = mem[0] + filt_coeff[6] * (input[i]-mem[7]); Vl[1] = mem[7] + filt_coeff[7] * (Vl[0]-mem[8]); mem[9] = mem[8] + filt_coeff[8] * (Vl[1]-mem[9]); */ -#ifdef BASOP_NOGLOB Vl[0] = add_sat( mem_fx[0], mult_r( filt_coeff_fx[6], sub_sat( input_fx[i], mem_fx[7] ) ) ); -#else - Vl[0] = add( mem_fx[0], mult_r( filt_coeff_fx[6], sub( input_fx[i], mem_fx[7] ) ) ); -#endif move16(); -#ifdef BASOP_NOGLOB Vl[1] = add_sat( mem_fx[7], mult_r( filt_coeff_fx[7], sub_sat( Vl[0], mem_fx[8] ) ) ); -#else - Vl[1] = add( mem_fx[7], mult_r( filt_coeff_fx[7], sub( Vl[0], mem_fx[8] ) ) ); -#endif move16(); -#ifdef BASOP_NOGLOB mem_fx[9] = add_sat( mem_fx[8], mult_r( filt_coeff_fx[8], sub_sat( Vl[1], mem_fx[9] ) ) ); -#else - mem_fx[9] = add( mem_fx[8], mult_r( filt_coeff_fx[8], sub( Vl[1], mem_fx[9] ) ) ); -#endif move16(); mem_fx[0] = input_fx[i]; @@ -1675,11 +1452,7 @@ void interpolate_3_over_1_allpass_fx( { mem_temp = out_fx[i]; move16(); -#ifdef BASOP_NOGLOB out_fx[i] = sub_sat( mult_r( 18768 /*0.57276865021499168f Q15*/, add_sat( mem_fx[12], mem_fx[11] ) ), mult_r( 2425 /*0.074004974641176793f Q15*/, add_sat( mem_temp, mem_fx[10] ) ) ); -#else - out_fx[i] = sub( mult_r( 18768 /*0.57276865021499168f Q15*/, add( mem_fx[12], mem_fx[11] ) ), mult_r( 2425 /*0.074004974641176793f Q15*/, add( mem_temp, mem_fx[10] ) ) ); -#endif mem_fx[10] = mem_fx[11]; move16(); mem_fx[11] = mem_fx[12]; diff --git a/lib_com/oper_32b.c b/lib_com/oper_32b.c index 0b01cf957..be34a1248 100644 --- a/lib_com/oper_32b.c +++ b/lib_com/oper_32b.c @@ -128,15 +128,9 @@ Word32 Mpy_32( Word16 hi1, Word16 lo1, Word16 hi2, Word16 lo2 ) Flag Overflow = 0; #endif -#ifdef BASOP_NOGLOB L_32 = L_mult( hi1, hi2 ); L_32 = L_mac_o( L_32, mult( hi1, lo2 ), 1, &Overflow ); L_32 = L_mac_o( L_32, mult( lo1, hi2 ), 1, &Overflow ); -#else - L_32 = L_mult( hi1, hi2 ); - L_32 = L_mac( L_32, mult( hi1, lo2 ), 1 ); - L_32 = L_mac( L_32, mult( lo1, hi2 ), 1 ); -#endif return ( L_32 ); } @@ -169,15 +163,9 @@ Word32 Mac_32( Word32 L_num, Word16 hi1, Word16 lo1, Word16 hi2, Word16 lo2 ) Flag Overflow = 0; #endif -#ifdef BASOP_NOGLOB L_32 = L_mac_o( L_num, hi1, hi2, &Overflow ); L_32 = L_mac_o( L_32, mult( hi1, lo2 ), 1, &Overflow ); L_32 = L_mac_o( L_32, mult( lo1, hi2 ), 1, &Overflow ); -#else - L_32 = L_mac( L_num, hi1, hi2 ); - L_32 = L_mac( L_32, mult( hi1, lo2 ), 1 ); - L_32 = L_mac( L_32, mult( lo1, hi2 ), 1 ); -#endif return ( L_32 ); } @@ -209,13 +197,8 @@ Word32 Sqr_32( Word16 hi, Word16 lo ) Flag Overflow = 0; #endif -#ifdef BASOP_NOGLOB L_32 = L_mult_o( hi, hi, &Overflow ); L_32 = L_mac_o( L_32, mult( hi, lo ), 2, &Overflow ); -#else - L_32 = L_mult( hi, hi ); - L_32 = L_mac( L_32, mult( hi, lo ), 2 ); -#endif return ( L_32 ); } @@ -402,11 +385,7 @@ Word32 Div_32( Word32 L_num, Word16 denom_hi, Word16 denom_lo ) lo = L_Extract_lc( L_32, &hi ); n_lo = L_Extract_lc( L_num, &n_hi ); L_32 = Mpy_32( n_hi, n_lo, hi, lo ); -#ifdef BASOP_NOGLOB L_32 = L_shl_sat( L_32, 2 ); -#else - L_32 = L_shl( L_32, 2 ); -#endif return ( L_32 ); } diff --git a/lib_com/options.h b/lib_com/options.h index 250116483..9f226dc78 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -65,7 +65,6 @@ /* #################### End DEBUGGING switches ############################ */ -#define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ #ifndef BASOP_NOGLOB_DEV_USE_GLOBALS #define BASOP_NOGLOB_DECLARE_LOCAL #endif diff --git a/lib_com/phase_dispersion_fx.c b/lib_com/phase_dispersion_fx.c index 16feab191..723d173bc 100644 --- a/lib_com/phase_dispersion_fx.c +++ b/lib_com/phase_dispersion_fx.c @@ -57,11 +57,7 @@ void phase_dispersion( move16(); prev_gain_pit[0] = gain_pit; -#ifdef BASOP_NOGLOB IF( GT_32( gain_code, L_add_o( *prev_gain_code, L_shl_o( *prev_gain_code, 1, &Overflow ), &Overflow ) ) ) -#else - IF( GT_32( gain_code, L_add( *prev_gain_code, L_shl( *prev_gain_code, 1 ) ) ) ) -#endif { IF( LT_16( state, 2 ) ) { @@ -118,13 +114,8 @@ void phase_dispersion( scale2 = getScaleFactor32( x32, L_subfr ); FOR( i = 0; i < L_subfr / 2 - 1; i++ ) { -#ifdef BASOP_NOGLOB code[i] = round_fx_sat( L_shl_sat( x32[2 * i + 0], scale2 ) ); code[L_subfr - 1 - i] = round_fx_sat( L_shl_sat( x32[2 * i + 3], scale2 ) ); -#else - code[i] = round_fx( L_shl( x32[2 * i + 0], scale2 ) ); - code[L_subfr - 1 - i] = round_fx( L_shl( x32[2 * i + 3], scale2 ) ); -#endif } code[L_subfr / 2 - 1] = round_fx( L_shl( x32[L_subfr - 2], scale2 ) ); @@ -174,12 +165,8 @@ void phase_dispersion( scale2 = getScaleFactor32( x32, L_subfr ); FOR( i = 0; i < L_subfr; i++ ) { -#ifdef BASOP_NOGLOB code[i] = round_fx_o( L_shl_o( x32[i], scale2, &Overflow ), &Overflow ); move16(); -#else - code[i] = round_fx( L_shl( x32[i], scale2 ) ); -#endif } j = sub( j, scale2 ); } diff --git a/lib_com/ppp_fx.c b/lib_com/ppp_fx.c index 92831ce2b..791813dc7 100644 --- a/lib_com/ppp_fx.c +++ b/lib_com/ppp_fx.c @@ -115,11 +115,7 @@ void deemph_lpc_fx( { /* LPC_de_curr[k] = a[0]*b[k] + a[1]*b[k+1]; */ temp = mult( a_fx[0], b_fx[k] ); /* Q12 */ -#ifdef BASOP_NOGLOB LPC_de_curr_fx[k] = add_o( temp, b_fx[k + 1], &Overflow ); -#else - LPC_de_curr_fx[k] = add( temp, b_fx[k + 1] ); -#endif move16(); /* Q12 */ } @@ -141,11 +137,7 @@ void deemph_lpc_fx( { /* LPC_de_old[k] = a[0]*b[k] + a[1]*b[k+1]; */ temp = mult( a_fx[0], b_fx[k] ); /* Q12 */ -#ifdef BASOP_NOGLOB LPC_de_old_fx[k] = add_o( temp, b_fx[k + 1], &Overflow ); -#else - LPC_de_old_fx[k] = add( temp, b_fx[k + 1] ); -#endif move16(); /* Q12 */ } } diff --git a/lib_com/pred_lt4_fx.c b/lib_com/pred_lt4_fx.c index 935e6b33f..4f8dd8712 100644 --- a/lib_com/pred_lt4_fx.c +++ b/lib_com/pred_lt4_fx.c @@ -71,19 +71,11 @@ void pred_lt4( s = W_sat_l( s64 ); /* Q_exc + Q14 */ } #if ( INTERP_EXP != -1 ) -#ifdef BASOP_NOGLOB s = L_shl_o( s, INTERP_EXP + 1, &Overflow ); /* Q_exc + Q15 */ -#else /* BASOP_NOGLOB */ - s = L_shl( s, INTERP_EXP + 1 ); -#endif /* BASOP_NOGLOB */ #endif -#ifdef BASOP_NOGLOB excO[j] = round_fx_o( s, &Overflow ); /* Q_exc */ move16(); -#else /* BASOP_NOGLOB */ - excO[j] = round_fx( s ); -#endif } return; } @@ -163,25 +155,15 @@ void pred_lt4_tc_fx( k += UP_SAMP; L_sum = L_mac( L_sum, x0[i], win[k] ); /* Q15 */ } -#ifdef BASOP_NOGLOB L_sum = L_shl_o( L_sum, 1, &Overflow ); /* Q16 */ excO[j] = round_fx_o( L_sum, &Overflow ); /* Q0 */ move16(); -#else - L_sum = L_shl( L_sum, 1 ); /*Q0h */ - - excO[j] = round_fx( L_sum ); -#endif x0++; } FOR( i = T0; i < L_SUBFR; i++ ) { -#ifdef BASOP_NOGLOB exc[i + i_subfr] = add_o( exc[i + i_subfr], mult_r( PIT_SHARP_fx, excO[i] ), &Overflow ); /* Q0 */ -#else - exc[i + i_subfr] = add( exc[i + i_subfr], mult_r( PIT_SHARP_fx, excO[i] ) ); -#endif move16(); } } diff --git a/lib_com/preemph_fx.c b/lib_com/preemph_fx.c index 0864323b4..46dc88cdf 100644 --- a/lib_com/preemph_fx.c +++ b/lib_com/preemph_fx.c @@ -26,18 +26,10 @@ void preemph_copy_fx( move16(); FOR( i = lg - 1; i > 0; i-- ) { -#ifdef BASOP_NOGLOB y[i] = msu_ro( L_deposit_h( x[i] ), x[i - 1], mu, &Overflow ); /* Qx */ -#else - y[i] = msu_r( L_deposit_h( x[i] ), x[i - 1], mu ); -#endif move16(); } -#ifdef BASOP_NOGLOB y[0] = msu_ro( L_deposit_h( x[0] ), *mem, mu, &Overflow ); /* Qx */ -#else - y[0] = msu_r( L_deposit_h( x[0] ), *mem, mu ); -#endif move16(); *mem = temp; /* Qx */ @@ -61,18 +53,10 @@ void preemph_copy_32fx( move16(); FOR( i = lg - 1; i > 0; i-- ) { -#ifdef BASOP_NOGLOB y[i] = L_msu_o( L_deposit_h( x[i] ), x[i - 1], mu, &Overflow ); /* Qx+16 */ -#else - y[i] = L_msu( L_deposit_h( x[i] ), x[i - 1], mu ); -#endif move16(); } -#ifdef BASOP_NOGLOB y[0] = L_msu_o( L_deposit_h( x[0] ), *mem, mu, &Overflow ); /* Qx+16 */ -#else - y[0] = L_msu( L_deposit_h( x[0] ), *mem, mu ); -#endif move16(); *mem = temp; /* Qx */ @@ -115,29 +99,17 @@ void E_UTIL_f_preemph2( FOR( i = lg - 1; i > 0; i-- ) { L_tmp = L_mult( signal[i], 16384 ); /* Qx + 15 */ -#ifdef BASOP_NOGLOB L_tmp = L_msu0_o( L_tmp, signal[i - 1], mu, &Overflow ); /* Qx + 15 */ L_tmp = L_shl_o( L_tmp, add( shift, 1 ), &Overflow ); /* Qx + shift + 16 */ signal[i] = round_fx_o( L_tmp, &Overflow ); /* Qx + shift */ move16(); -#else - L_tmp = L_msu0( L_tmp, signal[i - 1], mu ); - L_tmp = L_shl( L_tmp, add( shift, 1 ) ); - signal[i] = round_fx( L_tmp ); -#endif } L_tmp = L_mult( signal[0], 16384 ); /* Qx + 15 */ -#ifdef BASOP_NOGLOB L_tmp = L_msu0_o( L_tmp, *mem, mu, &Overflow ); /* Qx + 15 */ L_tmp = L_shl_o( L_tmp, add( shift, 1 ), &Overflow ); /* Qx + shift + 16 */ signal[0] = round_fx_o( L_tmp, &Overflow ); /* Qx + shift */ move16(); -#else - L_tmp = L_msu0( L_tmp, *mem, mu ); - L_tmp = L_shl( L_tmp, add( shift, 1 ) ); - signal[0] = round_fx( L_tmp ); -#endif *mem = temp; /* Qx */ move16(); diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index c3e0cfba3..2aa3311b8 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -1697,13 +1697,11 @@ Word16 Enr_1_Az_fx( /* o : impulse response energy Q3 const Word16 Aq[], /* i : LP filter coefs Qx based on the fact that Aq[0] == 1.0 */ const Word16 len /* i : impulse response length Q0 */ ); -#ifdef BASOP_NOGLOB Word16 Enr_1_Az_fx_o( /* o : impulse response energy Q3 */ const Word16 Aq[], /* i : LP filter coefs Qx based on the fact that Aq[0] == 1.0 */ const Word16 len, /* i : impulse response length Q0 */ Flag *Overflow_out /* o : propagating the Overflow flag to upper level */ ); -#endif // gs_gains_fx.c void Ener_per_band_comp_fx( diff --git a/lib_com/pvq_com_fx.c b/lib_com/pvq_com_fx.c index 36fa528b8..2c9f7bb3c 100644 --- a/lib_com/pvq_com_fx.c +++ b/lib_com/pvq_com_fx.c @@ -457,11 +457,7 @@ void NearOppSplitAdjustment_fx( } *qnear = qboth; /* Q3 */ move16(); -#ifdef BASOP_NOGLOB QIb = extract_h( L_shl_o( L_QIb, 16, &Overflow ) ); /* may saturate Q0*/ -#else - QIb = extract_h( L_shl( L_QIb, 16 ) ); /* may saturate */ -#endif if ( LE_16( QIb, qboth ) ) { *qnear = QIb; /* Q0 */ @@ -557,11 +553,7 @@ void fine_gain_quant_ivas_fx( tmp1 = sub( tmp1, exp1 ); L_tmp = L_Comp( tmp1, exp2 ); Mpy_32_16_ss( L_tmp, 24660, &L_tmp, &lsb ); /* 24660 = 20*log10(2) in Q12 */ /*16+12-15=13 */ -#ifdef BASOP_NOGLOB gain_db = round_fx_sat( L_shl_o( L_tmp, 17, &Overflow ) ); /* Q14 */ -#else /* BASOP_NOGLOB */ - gain_db = round_fx( L_shl( L_tmp, 17 ) ); -#endif idx = squant_fx( gain_db, &gain_dbq, finegain_fx[gbits - 1], gain_cb_size[gbits - 1] ); /* Q0 */ push_indice( hBstr, IND_PVQ_FINE_GAIN, idx, gbits ); @@ -628,11 +620,7 @@ void fine_gain_quant_fx( tmp1 = sub( tmp1, exp1 ); L_tmp = L_Comp( tmp1, exp2 ); Mpy_32_16_ss( L_tmp, 24660, &L_tmp, &lsb ); /* 24660 = 20*log10(2) in Q12 */ /*16+12-15=13 */ -#ifdef BASOP_NOGLOB gain_db = round_fx_sat( L_shl_o( L_tmp, 17, &Overflow ) ); -#else /* BASOP_NOGLOB */ - gain_db = round_fx( L_shl( L_tmp, 17 ) ); -#endif idx = squant_fx( gain_db, &gain_dbq, finegain_fx[gbits - 1], gain_cb_size[gbits - 1] ); push_indice_fx( hBstr, IND_PVQ_FINE_GAIN, idx, gbits ); diff --git a/lib_com/re8_util_fx.c b/lib_com/re8_util_fx.c index 746b7152b..de70279eb 100644 --- a/lib_com/re8_util_fx.c +++ b/lib_com/re8_util_fx.c @@ -275,11 +275,7 @@ static Word16 re8_identify_absolute_leader_fx( /* o : integer i { Ls = L_mac( Ls, y[i], y[i] ); /* Q1 */ } -#ifdef BASOP_NOGLOB s = extract_h( L_shl_sat( Ls, 16 - ( 3 + 1 ) ) ); /* s can saturate here */ -#else - s = extract_h( L_shl( Ls, 16 - ( 3 + 1 ) ) ); /* s can saturate here */ -#endif /*-----------------------------------------------------------------------* * compute the index 0 <= ka <= NB_LEADER+1 which identifies an absolute leader of Q0, Q2, Q3 or Q4 * diff --git a/lib_com/residu_fx.c b/lib_com/residu_fx.c index 156e81ead..665dbfae6 100644 --- a/lib_com/residu_fx.c +++ b/lib_com/residu_fx.c @@ -73,62 +73,32 @@ void Residu3_lc_fx( { q = add( q, shift ); } -#ifdef BASOP_NOGLOB *y++ = shl_o( x[0], shift, &Overflow ); -#else - *y++ = shl( x[0], shift ); -#endif move16(); FOR( i = 1; i < m; i++ ) { -#ifdef BASOP_NOGLOB s = L_mult_o( x[i], a[0], &Overflow ); -#else - s = L_mult( x[i], a[0] ); -#endif /* Stop at i to Avoid Mults with Zeros */ FOR( j = 1; j <= i; j++ ) { -#ifdef BASOP_NOGLOB s = L_mac_o( s, x[i - j], a[j], &Overflow ); -#else - s = L_mac( s, x[i - j], a[j] ); -#endif } -#ifdef BASOP_NOGLOB s = L_shl_o( s, q, &Overflow ); *y++ = round_fx_o( s, &Overflow ); -#else - s = L_shl( s, q ); - *y++ = round_fx( s ); -#endif } FOR( ; i < lg; i++ ) { -#ifdef BASOP_NOGLOB s = L_mult_o( x[i], a[0], &Overflow ); -#else - s = L_mult( x[i], a[0] ); -#endif FOR( j = 1; j <= m; j++ ) { -#ifdef BASOP_NOGLOB s = L_mac_o( s, x[i - j], a[j], &Overflow ); -#else - s = L_mac( s, x[i - j], a[j] ); -#endif } -#ifdef BASOP_NOGLOB s = L_shl_o( s, q, &Overflow ); *y++ = round_fx_o( s, &Overflow ); -#else - s = L_shl( s, q ); - *y++ = round_fx( s ); -#endif } } @@ -161,11 +131,7 @@ void Residu3_10_fx( s64 = W_mac_16_16( s64, x[i - j], a[j] ); } s = W_shl_sat_l( s64, q ); -#ifdef BASOP_NOGLOB y[i] = round_fx_sat( s ); -#else - y[i] = round_fx( s ); -#endif } } /*--------------------------------------------------------------------* @@ -205,12 +171,8 @@ void Residu3_fx( } s64 = W_mac_16_16( s64, x[i - 16], a[16] ); s32 = W_shl_sat_l( s64, q ); -#ifdef BASOP_NOGLOB y[i] = round_fx_o( s32, &Overflow ); move16(); -#else /* BASOP_NOGLOB */ - y[i] = round_fx( s32 ); -#endif } } /*==========================================================================*/ diff --git a/lib_com/stab_est_fx.c b/lib_com/stab_est_fx.c index 73d58af44..af21bf6fe 100644 --- a/lib_com/stab_est_fx.c +++ b/lib_com/stab_est_fx.c @@ -73,11 +73,7 @@ Word16 stab_est_fx( { /*fcorr += ftmp_c*ftmp_c;*/ tmp16 = sub( lt_diff_etot[i], mean_diff ); -#ifdef BASOP_NOGLOB L_tmp = L_mac0_sat( L_tmp, tmp16, tmp16 ); -#else - L_tmp = L_mac0( L_tmp, tmp16, tmp16 ); -#endif } /*------------------------------------------------------------------------* * Update @@ -96,22 +92,14 @@ Word16 stab_est_fx( exp1 = norm_l( L_tmp ); L_tmp = L_shl( L_tmp, exp1 ); -#ifdef BASOP_NOGLOB tmp16 = round_fx_sat( L_tmp ); -#else - tmp16 = round_fx( L_tmp ); -#endif exp2 = sub( 31, exp1 ); L_tmp = Isqrt_lc( L_tmp, &exp2 ); L_tmp = Mpy_32_16_1( L_tmp, tmp16 ); /* we now have sqrt(L_corr) Q24 (8+16)*/ exp2 = sub( 31 - 15, sub( exp1, exp2 ) ); /* for Q8 (because of -8^2 from Etot)*/ L_tmp = L_shl( L_tmp, exp2 ); /* Q8 + Q16*/ -#ifdef BASOP_NOGLOB dev = extract_h( L_shl_sat( L_tmp, 3 ) ); /* Q(24+3-16) -> Q11 */ -#else /* BASOP_NOGLOB */ - dev = extract_h( L_shl( L_tmp, 3 ) ); /* Q(24+3-16) -> Q11 */ -#endif /*------------------------------------------------------------------------* * State machine to decide level of inter-harmonic noise reduction and diff --git a/lib_com/stat_noise_uv_mod_fx.c b/lib_com/stat_noise_uv_mod_fx.c index e4771a183..7adc0f05b 100644 --- a/lib_com/stat_noise_uv_mod_fx.c +++ b/lib_com/stat_noise_uv_mod_fx.c @@ -109,11 +109,7 @@ void stat_noise_uv_mod_fx( move16(); tmp_res = div_l( L_tmp_res, tmp_den ); move16(); -#ifdef BASOP_NOGLOB min_alpha = add_o( tmp_res, 16384, &Overflow ); -#else /* BASOP_NOGLOB */ - min_alpha = add( tmp_res, 16384 ); -#endif /* BASOP_NOGLOB */ move16(); /**st_min_alpha = sub(*st_min_alpha, 1638); move16();*/ @@ -165,11 +161,7 @@ void stat_noise_uv_mod_fx( FOR( i_subfr = 0; i_subfr < L_FRAME; i_subfr += L_SUBFR ) { exctilt = calc_tilt_fx( &Exc2_local[i_subfr], En_shift, L_SUBFR ); /*Q15 */ -#ifdef BASOP_NOGLOB exctilt = mult( shl_o( sub( TILT_COMP_LIM_FX, min_alpha ), 2, &Overflow ), exctilt ); /*Q15 */ -#else /* BASOP_NOGLOB */ - exctilt = mult( shl( sub( TILT_COMP_LIM_FX, min_alpha ), 2 ), exctilt ); /*Q15 */ -#endif /* BASOP_NOGLOB */ PREEMPH_FX( &Exc2_local[i_subfr], exctilt, L_SUBFR, exc_pe ); } @@ -194,11 +186,7 @@ void stat_noise_uv_mod_fx( tmp_shift = norm_s( tmp_den ); tmp_den = shl( tmp_den, tmp_shift ); tmp_res = div_s( tmp_nom, tmp_den ); -#ifdef BASOP_NOGLOB tmp_res = shl_o( tmp_res, tmp_shift, &Overflow ); -#else /* BASOP_NOGLOB */ - tmp_res = shl( tmp_res, tmp_shift ); -#endif alpha = add( 32767, mult( tmp_res, sub( min_alpha, 32767 ) ) ); *act_count = 0; @@ -213,11 +201,7 @@ void stat_noise_uv_mod_fx( FOR( i = 1; i < L_FRAME; i++ ) { Tmp = shr( Exc2_local[i], En_shift ); -#ifdef BASOP_NOGLOB vare = L_mac_sat( vare, Tmp, Tmp ); /* positive accumulation only */ -#else - vare = L_mac( vare, Tmp, Tmp ); /* positive accumulation only */ -#endif } /* obtain Ge in Q_local with safety saturation */ @@ -265,16 +249,8 @@ void stat_noise_uv_mod_fx( tmp_res = div_s( 1 << 14, tmp_den ); /* 15+14-Q_local-tmp_shift-Q_ge+16 */ L_tmp_res = Mult_32_16( *ge_sm, tmp_res ); /* Q_stat_noise_ge+45-Q_local-Q_ge-tmp_shift-15 */ L_tmp_res = Mult_32_16( L_tmp_res, sub( 32767, beta ) ); /*30-Q_local-tmp_shift+15-15 */ -#ifdef BASOP_NOGLOB L_tmp_res = L_add_sat( L_shl_sat( L_tmp_res, sub( add( Q_local, tmp_shift ), 15 ) ), beta ); /* Q15 */ -#else - L_tmp_res = L_add( L_shl( L_tmp_res, sub( add( Q_local, tmp_shift ), 15 ) ), beta ); /* Q15 */ -#endif -#ifdef BASOP_NOGLOB tmp_res = extract_h( L_shl_o( L_tmp_res, 15, &Overflow ) ); /* 15+15-16=14 */ -#else - tmp_res = extract_h( L_shl( L_tmp_res, 15 ) ); /* 15+15-16=14 */ -#endif Noimix_fract = extract_l( Mult_32_16( L_tmp_res, Noimix_fract ) ); /*15+15-15 */ @@ -295,11 +271,7 @@ void stat_noise_uv_mod_fx( L_tmp = L_mult( Exc2_local[i], alpha ); /* Q_local + 16 */ L_tmp = L_mac( L_tmp, randval, alpha_m1 ); /* Q_local + 16 */ L_tmp3 = Mult_32_16( L_tmp, Noimix_fract ); /* Q_local+16+15-15 */ -#ifdef BASOP_NOGLOB L_tmp = L_add_sat( L_tmp3, L_shl_sat( Mult_32_16( L_tmp, tmp_res ), 1 ) ); /* Q_local+16+14-15+1 */ -#else - L_tmp = L_add( L_tmp3, L_shl( Mult_32_16( L_tmp, tmp_res ), 1 ) ); /* Q_local+16+14-15+1 */ -#endif Exc2_local[i] = extract_h( L_tmp ); /*Q_local */ move16(); } @@ -443,11 +415,7 @@ void stat_noise_uv_mod_ivas_fx( L_tmp_res = L_shl( L_tmp_res, sub( tmp_shift, 1 ) ); tmp_den = shl( tmp_den, tmp_shift ); tmp_res = div_l( L_tmp_res, tmp_den ); -#ifdef BASOP_NOGLOB min_alpha = add_o( tmp_res, 16384, &Overflow ); -#else /* BASOP_NOGLOB */ - min_alpha = add( tmp_res, 16384 ); -#endif /* BASOP_NOGLOB */ /**st_min_alpha = sub(*st_min_alpha, 1638); move16();*/ min_alpha = s_max( min_alpha, sub( *st_min_alpha, 1638 ) ); @@ -498,11 +466,7 @@ void stat_noise_uv_mod_ivas_fx( FOR( i_subfr = 0; i_subfr < L_FRAME; i_subfr += L_SUBFR ) { exctilt = calc_tilt_fx( &Exc2_local[i_subfr], En_shift, L_SUBFR ); /*Q15 */ -#ifdef BASOP_NOGLOB exctilt = mult( shl_o( sub( TILT_COMP_LIM_FX, min_alpha ), 2, &Overflow ), exctilt ); /*Q15 */ -#else /* BASOP_NOGLOB */ - exctilt = mult( shl( sub( TILT_COMP_LIM_FX, min_alpha ), 2 ), exctilt ); /*Q15 */ -#endif /* BASOP_NOGLOB */ PREEMPH_FX( &Exc2_local[i_subfr], exctilt, L_SUBFR, exc_pe ); } @@ -527,11 +491,7 @@ void stat_noise_uv_mod_ivas_fx( tmp_shift = norm_s( tmp_den ); tmp_den = shl( tmp_den, tmp_shift ); tmp_res = div_s( tmp_nom, tmp_den ); -#ifdef BASOP_NOGLOB tmp_res = shl_o( tmp_res, tmp_shift, &Overflow ); -#else /* BASOP_NOGLOB */ - tmp_res = shl( tmp_res, tmp_shift ); -#endif alpha = add( 32767, mult( tmp_res, sub( min_alpha, 32767 ) ) ); *act_count = 0; @@ -546,11 +506,7 @@ void stat_noise_uv_mod_ivas_fx( FOR( i = 1; i < L_FRAME; i++ ) { Tmp = shr( Exc2_local[i], En_shift ); -#ifdef BASOP_NOGLOB vare = L_mac_sat( vare, Tmp, Tmp ); /* positive accumulation only */ -#else - vare = L_mac( vare, Tmp, Tmp ); /* positive accumulation only */ -#endif } /* obtain Ge in Q_local with safety saturation */ @@ -598,16 +554,8 @@ void stat_noise_uv_mod_ivas_fx( tmp_res = div_s( 1 << 14, tmp_den ); /* 15+14-Q_local-tmp_shift-Q_ge+16 */ L_tmp_res = Mult_32_16( *ge_sm, tmp_res ); /* Q_stat_noise_ge+45-Q_local-Q_ge-tmp_shift-15 */ L_tmp_res = Mult_32_16( L_tmp_res, sub( 32767, beta ) ); /*30-Q_local-tmp_shift+15-15 */ -#ifdef BASOP_NOGLOB L_tmp_res = L_add_sat( L_shl_sat( L_tmp_res, sub( add( Q_local, tmp_shift ), 15 ) ), beta ); /* Q15 */ -#else - L_tmp_res = L_add( L_shl( L_tmp_res, sub( add( Q_local, tmp_shift ), 15 ) ), beta ); /* Q15 */ -#endif -#ifdef BASOP_NOGLOB tmp_res = extract_h( L_shl_o( L_tmp_res, 15, &Overflow ) ); /* 15+15-16=14 */ -#else - tmp_res = extract_h( L_shl( L_tmp_res, 15 ) ); /* 15+15-16=14 */ -#endif Noimix_fract = extract_l( Mult_32_16( L_tmp_res, Noimix_fract ) ); /*15+15-15 */ @@ -628,11 +576,7 @@ void stat_noise_uv_mod_ivas_fx( L_tmp = L_mult( Exc2_local[i], alpha ); /* Q_local + 16 */ L_tmp = L_mac( L_tmp, randval, alpha_m1 ); /* Q_local + 16 */ L_tmp3 = Mult_32_16( L_tmp, Noimix_fract ); /* Q_local+16+15-15 */ -#ifdef BASOP_NOGLOB L_tmp = L_add_sat( L_tmp3, L_shl_sat( Mult_32_16( L_tmp, tmp_res ), 1 ) ); /* Q_local+16+14-15+1 */ -#else - L_tmp = L_add( L_tmp3, L_shl( Mult_32_16( L_tmp, tmp_res ), 1 ) ); /* Q_local+16+14-15+1 */ -#endif Exc2_local[i] = extract_h( L_tmp ); /*Q_local */ move16(); } @@ -717,17 +661,9 @@ static Word16 calc_tilt_fx( /* o : Excitation tilt Q15*/ { /* r0 = L_mac(r0,x[i],x[i]) */ /* r1 = L_mac(r1,x[i],x[i+1]) -> correlation loop can be optimized */ -#ifdef BASOP_NOGLOB r0 = L_mac_sat( r0, xi, xi ); -#else - r0 = L_mac( r0, xi, xi ); -#endif xi_p1 = shr( x[i + 1], Q_shift ); -#ifdef BASOP_NOGLOB r1 = L_mac_sat( r1, xi, xi_p1 ); -#else - r1 = L_mac( r1, xi, xi_p1 ); -#endif xi = xi_p1; move16(); } @@ -749,11 +685,7 @@ static Word16 calc_tilt_fx( /* o : Excitation tilt Q15*/ r1 = L_abs( r1 ); L_tmp_res = Div_32( r1, extract_h( r0 ), extract_l( r0 ) ); -#ifdef BASOP_NOGLOB L_tmp_res = L_shl_sat( L_tmp_res, tmp_shift ); /*Q31 */ -#else - L_tmp_res = L_shl( L_tmp_res, tmp_shift ); /*Q31 */ -#endif if ( tmp_sign != 0 ) { L_tmp_res = L_negate( L_tmp_res ); /*Q31 */ diff --git a/lib_com/swb_bwe_com_fx.c b/lib_com/swb_bwe_com_fx.c index 873a7093e..5ae5dee71 100644 --- a/lib_com/swb_bwe_com_fx.c +++ b/lib_com/swb_bwe_com_fx.c @@ -99,31 +99,19 @@ Word16 WB_BWE_gain_pred_fx( enerL = L_deposit_l( 0 ); FOR( n_freq = 128; n_freq < 192; n_freq++ ) { -#ifdef BASOP_NOGLOB enerL = L_mac0_sat( enerL, core_dec_freq[n_freq], core_dec_freq[n_freq] ); /*2(Q_syn) */ -#else - enerL = L_mac0( enerL, core_dec_freq[n_freq], core_dec_freq[n_freq] ); /*2(Q_syn) */ -#endif } L_WB_fenv0 = L_deposit_l( 0 ); FOR( n_freq = 192; n_freq < 224; n_freq++ ) { -#ifdef BASOP_NOGLOB L_WB_fenv0 = L_mac0_sat( L_WB_fenv0, core_dec_freq[n_freq], core_dec_freq[n_freq] ); /*2*Q_syn */ -#else - L_WB_fenv0 = L_mac0( L_WB_fenv0, core_dec_freq[n_freq], core_dec_freq[n_freq] ); /*2*Q_syn */ -#endif } L_WB_fenv1 = L_deposit_l( 0 ); FOR( n_freq = 224; n_freq < 256; n_freq++ ) { -#ifdef BASOP_NOGLOB L_WB_fenv1 = L_mac0_sat( L_WB_fenv1, core_dec_freq[n_freq], core_dec_freq[n_freq] ); /*2*Q_syn */ -#else - L_WB_fenv1 = L_mac0( L_WB_fenv1, core_dec_freq[n_freq], core_dec_freq[n_freq] ); /*2*Q_syn */ -#endif } L_tmp = sum16_32_fx( voice_factors, 4 ); @@ -141,11 +129,7 @@ Word16 WB_BWE_gain_pred_fx( } test(); -#ifdef BASOP_NOGLOB IF( GT_32( L_WB_fenv0, L_shl_sat( L_WB_fenv1, 1 ) ) ) -#else - IF( GT_32( L_WB_fenv0, L_shl( L_WB_fenv1, 1 ) ) ) -#endif { exp = norm_l( L_WB_fenv0 ); tmp = extract_h( L_shl( L_WB_fenv0, exp ) ); @@ -156,11 +140,7 @@ Word16 WB_BWE_gain_pred_fx( alfa = s_max( tmp, 3277 /* 0.1 in Q15 */ ); /*Q15 */ L_WB_fenv0 = Mult_32_16( L_WB_fenv0, alfa ); /*2*Q_syn+15-15->2*Q_syn */ } -#ifdef BASOP_NOGLOB ELSE IF( GT_32( L_WB_fenv1, L_shl_sat( L_WB_fenv0, 1 ) ) && NE_16( coder_type, UNVOICED ) ) -#else - ELSE IF( GT_32( L_WB_fenv1, L_shl( L_WB_fenv0, 1 ) ) && NE_16( coder_type, UNVOICED ) ) -#endif { exp = norm_l( L_WB_fenv1 ); tmp = extract_h( L_shl( L_WB_fenv1, exp ) ); @@ -187,11 +167,7 @@ Word16 WB_BWE_gain_pred_fx( enerL = L_deposit_l( 1 ); } -#ifdef BASOP_NOGLOB L_tmp = L_add_sat( L_WB_fenv0, L_WB_fenv1 ); /* In 2*Q_syn */ -#else - L_tmp = L_add( L_WB_fenv0, L_WB_fenv1 ); /* In 2*Q_syn */ -#endif exp = norm_l( L_tmp ); tmp = extract_h( L_shl( L_tmp, exp ) ); /*exp = sub(exp, 30-(2*Q_syn+6)); //+6(/64) */ @@ -201,21 +177,13 @@ Word16 WB_BWE_gain_pred_fx( L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp ); -#ifdef BASOP_NOGLOB WB_fenv[0] = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 12 ) ) ); /* Q3 */ move16(); -#else - WB_fenv[0] = round_fx( L_shl( L_tmp, sub( exp, 12 ) ) ); /* Q3 */ -#endif test(); test(); IF( NE_16( coder_type, AUDIO ) && NE_16( coder_type, UNVOICED ) && ener_var_flag == 0 ) { -#ifdef BASOP_NOGLOB WB_fenv[0] = add_sat( WB_fenv[0], mult_r_sat( WB_fenv[0], 16384 /* 0.5 in Q15 */ ) ); -#else - WB_fenv[0] = add( WB_fenv[0], mult_r( WB_fenv[0], 16384 /* 0.5 in Q15 */ ) ); -#endif move16(); } @@ -226,11 +194,7 @@ Word16 WB_BWE_gain_pred_fx( tmp = div_s( 16384, tmp ); L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp ); -#ifdef BASOP_NOGLOB enerL_16 = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 15 ) ) ); /* Q0 */ -#else - enerL_16 = round_fx( L_shl( L_tmp, sub( exp, 15 ) ) ); /* Q0 */ -#endif enerL_40 = mult_r( 6554 /* 0.2 in Q15 */, enerL_16 ); /*1/40 in Q18 ->Q3 */ test(); @@ -247,11 +211,7 @@ Word16 WB_BWE_gain_pred_fx( exp = norm_s( WB_fenv[0] ); tmp = div_s( shl( 1, sub( 14, exp ) ), WB_fenv[0] ); /*Q(29-exp-3) */ L_tmp = L_mult( enerL_40, tmp ); /*Q(30-exp) */ -#ifdef BASOP_NOGLOB tmp = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 2 ) ) ); /*Q12 */ -#else - tmp = round_fx( L_shl( L_tmp, sub( exp, 2 ) ) ); /*Q12 */ -#endif tmp = s_min( tmp, 16384 /*4 in Q12*/ ); L_tmp = L_shr( L_mult0( tmp, WB_fenv[0] ), 12 ); /*Q15 */ WB_fenv[0] = extract_l( L_tmp ); /*Q3 */ @@ -272,11 +232,7 @@ Word16 WB_BWE_gain_pred_fx( exp = norm_s( pitch ); tmp = div_s( shl( 1, sub( 14, exp ) ), pitch ); /*Q(29-exp-5) */ L_tmp = L_mult0( tmp1, tmp ); /*29-exp-5->24-exp */ -#ifdef BASOP_NOGLOB tmp = round_fx_sat( L_shl_sat( L_tmp, add( exp, 6 ) ) ); /*14 */ -#else - tmp = round_fx( L_shl( L_tmp, add( exp, 6 ) ) ); /*14 */ -#endif tmp1 = s_max( tmp, 8192 /* 0.5 in Q14 */ ); alfa = s_min( 24576 /* 1.5 in Q14 */, tmp1 ); /*Q14 */ @@ -286,11 +242,7 @@ Word16 WB_BWE_gain_pred_fx( enerL = L_deposit_l( enerL_16 ); enerL = L_shl( enerL, 6 ); /*Q6 */ -#ifdef BASOP_NOGLOB tmp1 = i_mult_sat( 3, WB_fenv[0] ); /*Q3 */ -#else - tmp1 = i_mult( 3, WB_fenv[0] ); /*Q3 */ -#endif L_tmp = L_mult0( tmp1, WB_fenv[0] ); /*Q6 */ test(); @@ -305,11 +257,7 @@ Word16 WB_BWE_gain_pred_fx( exp = norm_s( WB_fenv[0] ); tmp = div_s( shl( 1, sub( 14, exp ) ), WB_fenv[0] ); /*Q(29-exp-3) */ L_tmp = L_mult( enerL_64, tmp ); /*Q(30-exp) */ -#ifdef BASOP_NOGLOB tmp = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 2 ) ) ); /*Q12 */ -#else - tmp = round_fx( L_shl( L_tmp, sub( exp, 2 ) ) ); /*Q12 */ -#endif tmp = s_min( tmp, 16384 /*4 in Q12*/ ); L_tmp = L_shr( L_mult0( tmp, WB_fenv[0] ), 12 ); /*Q3 */ WB_fenv[0] = extract_l( L_tmp ); /*Q3 */ @@ -343,12 +291,8 @@ Word16 WB_BWE_gain_pred_fx( tmp = s_min( s_max( tmp1, 16 /* 0.125 in Q7 */ ), 256 /* 1 in Q7 */ ); /*Q7 */ L_tmp = L_shr( L_mult0( WB_fenv[0], tmp ), 7 ); /*Q3 */ /*WB_fenv[0] = saturate(L_tmp); //Q3 */ -#ifdef BASOP_NOGLOB WB_fenv[0] = round_fx_sat( L_shl_sat( L_tmp, 16 ) ); /*Q3 */ move16(); -#else - WB_fenv[0] = round_fx( L_shl( L_tmp, 16 ) ); /*Q3 */ -#endif } test(); IF( GT_32( last_core_brate, ACELP_8k00 ) && GT_16( WB_fenv[0], last_wb_bwe_ener ) ) @@ -454,11 +398,7 @@ static void calc_norm_envelop_lf_fx( tmp = add( lookback, n_freq ); FOR( n_lag = 0; n_lag < tmp; n_lag++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_add_sat( L_tmp, L_abs( SWB_signal[n_lag] ) ); -#else - L_tmp = L_add( L_tmp, L_abs( SWB_signal[n_lag] ) ); -#endif } envelope[env_index] = L_tmp; move32(); @@ -471,11 +411,7 @@ static void calc_norm_envelop_lf_fx( Word32 L_tmp = L_deposit_l( 1 ); FOR( n_lag = 0; n_lag < n_lag_now; n_lag++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_add_sat( L_tmp, L_abs( SWB_signal[n_freq - lookback + n_lag] ) ); -#else - L_tmp = L_add( L_tmp, L_abs( SWB_signal[n_freq - lookback + n_lag] ) ); -#endif } envelope[env_index] = L_tmp; @@ -649,30 +585,16 @@ Word32 calc_tilt_bwe_fx( /* o : Tilt in Q24 /* Divide Frame Length by 32 */ FOR( j = shr( N, 5 ); j > 0; j-- ) { -#ifdef BASOP_NOGLOB /* Critical Overflow and all those below*/ tmp1 = mult_ro( *ptr++, 8192 /*0.25 in Q15 */, &Overflow ); /* Divide by 4 */ -#else - tmp1 = mult_r( *ptr++, 8192 /*0.25 in Q15 */ ); /* Divide by 4 */ -#endif L_ener = L_mult0( tmp1, tmp1 ); /* With the shift by 4 and the L_mult0, no overflow possible for 32 samples */ FOR( i = 1; i < 32; i++ ) { -#ifdef BASOP_NOGLOB /* Critical Overflow */ tmp1 = mult_ro( *ptr++, 8192 /*0.25 in Q15 */, &Overflow ); /* Divide by 4 */ L_ener = L_mac0_o( L_ener, tmp1, tmp1, &Overflow ); -#else - tmp1 = mult_r( *ptr++, 8192 ); /* Divide by 4 */ - L_ener = L_mac0( L_ener, tmp1, tmp1 ); -#endif } -#ifdef BASOP_NOGLOB /* Critical Overflow */ L_ener = L_shr_o( L_ener, exp2, &Overflow ); L_temp = L_add_o( L_ener_tot, L_ener, &Overflow ); -#else - L_ener = L_shr( L_ener, exp2 ); - L_temp = L_add( L_ener_tot, L_ener ); -#endif IF( Overflow != 0 ) { L_ener_tot = L_shr( L_ener_tot, 1 ); @@ -682,27 +604,14 @@ Word32 calc_tilt_bwe_fx( /* o : Tilt in Q24 Overflow = 0; move16(); } -#ifdef BASOP_NOGLOB /* Critical Overflow */ L_ener_tot = L_add_o( L_ener_tot, L_ener, &Overflow ); -#else - L_ener_tot = L_add( L_ener_tot, L_ener ); -#endif } -#ifdef BASOP_NOGLOB L_ener = L_deposit_l( abs_s( sub_o( sp[1], sp[0], &Overflow ) ) ); -#else - L_ener = L_deposit_l( abs_s( sub( sp[1], sp[0] ) ) ); -#endif FOR( i = 2; i < N; i++ ) { /* Eq to (sp[i] - sp[i-1]) * (sp[i-1] - sp[i-2]) < 0 */ -#ifdef BASOP_NOGLOB tmp1 = sub_o( sp[i], sp[i - 1], &Overflow ); tmp2 = sub_o( sp[i - 1], sp[i - 2], &Overflow ); -#else - tmp1 = sub( sp[i], sp[i - 1] ); - tmp2 = sub( sp[i - 1], sp[i - 2] ); -#endif tmp2 = mult( tmp1, tmp2 ); tmp1 = abs_s( tmp1 ); /* to Get either 0 or -1 in 'tmp2' */ @@ -725,20 +634,12 @@ Word32 calc_tilt_bwe_fx( /* o : Tilt in Q24 /* *tilt_flt = (float)(r1/sqrt(r0)); */ exp2 = norm_l( L_ener ); -#ifdef BASOP_NOGLOB L_temp = Mult_32_16( L_temp, round_fx_sat( L_shl_sat( L_ener, exp2 ) ) ); -#else - L_temp = Mult_32_16( L_temp, round_fx( L_shl( L_ener, exp2 ) ) ); -#endif exp2 = sub( exp2, tmp1 ); exp2 = add( exp2, exp_sp ); /* Put in Q24 */ -#ifdef BASOP_NOGLOB L_temp = L_shr_sat( L_temp, sub( exp2, 24 ) ); -#else - L_temp = L_shr( L_temp, sub( exp2, 24 ) ); -#endif BASOP_SATURATE_WARNING_ON_EVS return L_temp; @@ -1397,20 +1298,12 @@ void SWB_BWE_decoding_fx( EnergyL = L_deposit_l( 0 ); FOR( n_freq = 224 + st_offset; n_freq < swb_bwe_trans_subband[0] + st_offset; n_freq++ ) { -#ifdef BASOP_NOGLOB fenvL = L_mac0_sat( fenvL, core_dec_freq[n_freq], core_dec_freq[n_freq] ); /*2*Q_syn */ -#else - fenvL = L_mac0( fenvL, core_dec_freq[n_freq], core_dec_freq[n_freq] ); /*2*Q_syn */ -#endif } FOR( n_freq = 16; n_freq < L_FRAME; n_freq++ ) { -#ifdef BASOP_NOGLOB EnergyL = L_mac0_sat( EnergyL, core_dec_freq[n_freq], core_dec_freq[n_freq] ); /*2*Q_syn */ -#else - EnergyL = L_mac0( EnergyL, core_dec_freq[n_freq], core_dec_freq[n_freq] ); /*2*Q_syn */ -#endif } fenvL_16 = 0; @@ -1425,17 +1318,9 @@ void SWB_BWE_decoding_fx( L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp ); -#ifdef BASOP_NOGLOB fenvL_16 = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 12 ) ) ); /* Q3 */ -#else - fenvL_16 = round_fx( L_shl( L_tmp, sub( exp, 12 ) ) ); /* Q3 */ -#endif } -#ifdef BASOP_NOGLOB IF( GT_16( fenvL_16, shl_sat( SWB_fenv[0], 5 ) ) ) -#else - IF( GT_16( fenvL_16, shl( SWB_fenv[0], 5 ) ) ) -#endif { fenvL_16 = shl( SWB_fenv[0], 2 ); move16(); @@ -1453,11 +1338,7 @@ void SWB_BWE_decoding_fx( L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp ); -#ifdef BASOP_NOGLOB EnergyL_16 = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 12 ) ) ); /* Q3 */ -#else - EnergyL_16 = round_fx( L_shl( L_tmp, sub( exp, 12 ) ) ); /* Q3 */ -#endif } calc_normal_length_fx( ACELP_CORE, core_dec_freq, mode, extl, &L_swb_norm, prev_L_swb_norm, Q_syn ); @@ -1509,13 +1390,8 @@ void SWB_BWE_decoding_fx( tmp = add( swb_bwe_trans_subband[n_band + 1], st_offset ); FOR( n_freq = add( swb_bwe_trans_subband[n_band], st_offset ); n_freq < tmp; n_freq++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mult_sat( SWB_signal[n_freq], SWB_signal[n_freq] ); /*Q31 */ energy = L_add_sat( energy, L_shr( L_tmp, 6 ) ); /*Q25 */ -#else - L_tmp = L_mult( SWB_signal[n_freq], SWB_signal[n_freq] ); /*Q31 */ - energy = L_add( energy, L_shr( L_tmp, 6 ) ); /*Q25 */ -#endif } IF( energy == 0 ) @@ -1581,11 +1457,7 @@ void SWB_BWE_decoding_fx( tmp = div_s( shl( 1, sub( 14, exp ) ), SWB_FENV ); /*Q(29-exp) */ L_tmp = Mult_32_16( L_energy, tmp ); /*Q(1+29-exp+1)->Q(15-exp) */ -#ifdef BASOP_NOGLOB Energy_16 = round_fx_sat( L_shl_sat( L_tmp, add( exp, 4 ) ) ); /* Q3 */ -#else - Energy_16 = round_fx( L_shl( L_tmp, add( exp, 4 ) ) ); /*Q3 */ -#endif test(); IF( NE_16( last_extl, SWB_BWE ) && NE_16( last_extl, FB_BWE ) ) @@ -1659,13 +1531,8 @@ void SWB_BWE_decoding_fx( Copy( &core_dec_freq[112], &SWB_signal[368 + st_offset], 128 ); Copy( &core_dec_freq[176], &SWB_signal[496 + st_offset], 64 ); -#ifdef BASOP_NOGLOB tmp1 = add_sat( abs_s( SWB_signal[368 + st_offset] ), abs_s( SWB_signal[369 + st_offset] ) ); /*Q_syn */ tmp2 = add_sat( abs_s( SWB_signal[365 + st_offset] ), abs_s( SWB_signal[366 + st_offset] ) ); /*Q_syn */ -#else - tmp1 = add( abs_s( SWB_signal[368 + st_offset] ), abs_s( SWB_signal[369 + st_offset] ) ); /*Q_syn */ - tmp2 = add( abs_s( SWB_signal[365 + st_offset] ), abs_s( SWB_signal[366 + st_offset] ) ); /*Q_syn */ -#endif pit1 = &SWB_signal[368 + st_offset]; move16(); @@ -1679,32 +1546,20 @@ void SWB_BWE_decoding_fx( *pit1 = mult_r( *pit1, tmp3 ); move16(); /*Q_syn */ pit1++; -#ifdef BASOP_NOGLOB tmp3 = add_sat( tmp3, 3277 /* 0.1 in Q15*/ ); /*Q15 */ -#else - tmp3 = add( tmp3, 3277 /* 0.1 in Q15*/ ); /*Q15 */ -#endif } } ELSE IF( LT_16( tmp2, tmp1 ) ) { exp = norm_s( tmp1 ); tmp = div_s( shl( 1, sub( 14, exp ) ), tmp1 ); /*Q(29-exp) */ -#ifdef BASOP_NOGLOB tmp3 = round_fx_sat( L_shl_sat( L_mult( tmp2, tmp ), add( exp, 2 ) ) ); /*Q15 */ -#else - tmp3 = round_fx( L_shl( L_mult( tmp2, tmp ), add( exp, 2 ) ) ); /*Q15 */ -#endif WHILE( LT_16( tmp3, 32767 ) ) { *pit1 = mult_r( *pit1, tmp3 ); move16(); /*Q_syn */ pit1++; -#ifdef BASOP_NOGLOB tmp3 = add_sat( tmp3, 3277 /* 0.1 in Q15*/ ); /*Q15 */ -#else - tmp3 = add( tmp3, 3277 ); /*Q15 */ -#endif } } @@ -1715,23 +1570,14 @@ void SWB_BWE_decoding_fx( /*20480 = 5 in Q12 */ FOR( tmp3 = 20480; tmp3 > 4096; tmp3 -= 2048 ) { -#ifdef BASOP_NOGLOB *pit1 = round_fx_sat( L_shl_sat( L_mult( *pit1, tmp3 ), 3 ) ); /*Q_syn */ -#else - *pit1 = round_fx( L_shl( L_mult( *pit1, tmp3 ), 3 ) ); /*Q_syn */ -#endif move16(); pit1--; } } -#ifdef BASOP_NOGLOB tmp1 = add_sat( abs_s( SWB_signal[496 + st_offset] ), abs_s( SWB_signal[497 + st_offset] ) ); /*Q_syn */ tmp2 = add_sat( add_sat( abs_s( SWB_signal[492 + st_offset] ), abs_s( SWB_signal[493 + st_offset] ) ), add_sat( abs_s( SWB_signal[494 + st_offset] ), abs_s( SWB_signal[495 + st_offset] ) ) ); -#else - tmp1 = add( abs_s( SWB_signal[496 + st_offset] ), abs_s( SWB_signal[497 + st_offset] ) ); /*Q_syn */ - tmp2 = add( add( abs_s( SWB_signal[492 + st_offset] ), abs_s( SWB_signal[493 + st_offset] ) ), add( abs_s( SWB_signal[494 + st_offset] ), abs_s( SWB_signal[495 + st_offset] ) ) ); -#endif pit1 = &SWB_signal[496 + st_offset]; test(); @@ -1744,32 +1590,20 @@ void SWB_BWE_decoding_fx( *pit1 = mult_r( *pit1, tmp3 ); move16(); /*Q_syn */ pit1++; -#ifdef BASOP_NOGLOB tmp3 = add_sat( tmp3, 3277 /* 0.1 in Q15 */ ); /*Q15 */ -#else - tmp3 = add( tmp3, 3277 /* 0.1 in Q15 */ ); /*Q15 */ -#endif } } ELSE IF( LT_16( tmp2, tmp1 ) ) { exp = norm_s( tmp1 ); tmp = div_s( shl( 1, sub( 14, exp ) ), tmp1 ); /*Q(29-exp) */ -#ifdef BASOP_NOGLOB tmp3 = round_fx_sat( L_shl_sat( L_mult( tmp2, tmp ), add( exp, 2 ) ) ); /*Q15 */ -#else - tmp3 = round_fx( L_shl( L_mult( tmp2, tmp ), add( exp, 2 ) ) ); /*Q15 */ -#endif WHILE( LT_16( tmp3, 32767 ) ) { *pit1 = mult_r( *pit1, tmp3 ); move16(); /*Q_syn */ pit1++; -#ifdef BASOP_NOGLOB tmp3 = add_sat( tmp3, 3277 /* 0.1 in Q15 */ ); /*Q15 */ -#else - tmp3 = add( tmp3, 3277 /* 0.1 in Q15 */ ); /*Q15 */ -#endif } } pit1 = &SWB_signal[495 + st_offset]; @@ -1967,11 +1801,7 @@ FOR( n_band = 0; n_band < SWB_FENV; n_band += L ) } } -#ifdef BASOP_NOGLOB IF( GT_16( *prev_Energy, add_sat( Energy_16, shr( Energy_16, 2 ) ) ) && Energy_16 > 0 ) -#else -IF( GT_16( *prev_Energy, add( Energy_16, shr( Energy_16, 2 ) ) ) && Energy_16 > 0 ) -#endif { weight = shr( div_s( Energy_16, *prev_Energy ), 1 ); /*Q15 */ } @@ -2005,11 +1835,7 @@ tmp2 = add( add( swb_bwe_subband[0], 8 ), st_offset ); FOR( n_freq = add( swb_bwe_subband[0], st_offset ); n_freq < tmp2; n_freq++ ) { L_tmp1 = Mult_32_16( SWB_signal_32[n_freq], factor ); -#ifdef BASOP_NOGLOB SWB_signal_32[n_freq] = L_shl_sat( L_tmp1, tmp - 1 ); -#else - SWB_signal_32[n_freq] = L_shl( L_tmp1, tmp - 1 ); -#endif move32(); /*15+Qsyn */ factor = add( factor, factor1 ); /*Q3 */ } @@ -2040,17 +1866,9 @@ FOR( n_band = 0; n_band < 12; n_band++ ) FOR( ; n_freq < tmp2; n_freq++ ) { L_tmp1 = Mult_32_16( SWB_signal_32[n_freq], factor ); -#ifdef BASOP_NOGLOB SWB_signal_32[n_freq] = L_shl_sat( L_tmp1, tmp - 1 ); -#else - SWB_signal_32[n_freq] = L_shl( L_tmp1, tmp - 1 ); -#endif move32(); /*15+Qsyn */ -#ifdef BASOP_NOGLOB factor = add_sat( factor, factor1 ); /*Q1 */ -#else - factor = add( factor, factor1 ); /*Q1 */ -#endif } } L_tmp = L_mult( weight, prev_SWB_fenv[13] ); /*Q17 */ @@ -2063,11 +1881,7 @@ tmp2 = add( swb_bwe_sm_subband[13], st_offset ); FOR( ; n_freq < tmp2; n_freq++ ) { L_tmp1 = Mult_32_16( SWB_signal_32[n_freq], factor ); -#ifdef BASOP_NOGLOB SWB_signal_32[n_freq] = L_shl_sat( L_tmp1, 13 ); -#else - SWB_signal_32[n_freq] = L_shl( L_tmp1, 13 ); -#endif move32(); /*15+Qsyn */ factor = add( factor, factor1 ); /*Q1 */ } @@ -2081,11 +1895,7 @@ FOR( n_band = 13; n_band < SWB_FENV; n_band++ ) FOR( ; n_freq < tmp2; n_freq++ ) { L_tmp1 = Mult_32_16( SWB_signal_32[n_freq], factor ); -#ifdef BASOP_NOGLOB SWB_signal_32[n_freq] = L_shl_sat( L_tmp1, 13 ); -#else - SWB_signal_32[n_freq] = L_shl( L_tmp1, 13 ); -#endif move32(); /*15+Qsyn */ } } @@ -2148,11 +1958,7 @@ void time_envelop_shaping_fx( Energy = L_deposit_l( 0 ); FOR( j = 0; j < L / 4; j++ ) { -#ifdef BASOP_NOGLOB Energy = L_mac0_sat( Energy, *pit, *pit ); /*(2*Q_synth) */ -#else - Energy = L_mac0( Energy, *pit, *pit ); /*(2*Q_synth) */ -#endif pit++; } Energy = Mult_32_16( Energy, inv_L ); /*Q(29-exp_L-15) -> Q(-exp_L+14+2*Q_synth) */ @@ -2175,11 +1981,7 @@ void time_envelop_shaping_fx( } test(); -#ifdef BASOP_NOGLOB IF( LT_32( SWB_tenv[i], 65536 /* 2 in Q15 */ ) && LT_32( Energy, L_shl_sat( SWB_tenv[i], sub( 16, exp ) ) ) ) -#else - IF( LT_32( SWB_tenv[i], 65536 /* 2 in Q15 */ ) && LT_32( Energy, L_shl( SWB_tenv[i], sub( 16, exp ) ) ) ) -#endif { *Q_synth = add( *Q_synth, 3 ); move16(); @@ -2204,11 +2006,7 @@ void time_envelop_shaping_fx( FOR( j = 0; j < L / 4; j++ ) { -#ifdef BASOP_NOGLOB *pit = round_fx_sat( L_shl_sat( L_mult( tmp, *pit ), sub( exp, 1 ) ) ); /*Q(13-exp+1)->Q(14-exp)->Qsyn-3 */ -#else - *pit = round_fx( L_shl( L_mult( tmp, *pit ), sub( exp, 1 ) ) ); /*Q(13-exp+1)->Q(14-exp)->Qsyn-3 */ -#endif move16(); pit++; } @@ -2267,11 +2065,7 @@ void time_envelop_shaping_ivas_fx( } test(); -#ifdef BASOP_NOGLOB IF( LT_32( SWB_tenv[i], 65536 /* 2 in Q15 */ ) && LT_32( Energy, L_shl_sat( SWB_tenv[i], sub( 16, exp ) ) ) ) -#else - IF( LT_32( SWB_tenv[i], 65536 /* 2 in Q15 */ ) && LT_32( Energy, L_shl( SWB_tenv[i], sub( 16, exp ) ) ) ) -#endif { *Q_synth = add( *Q_synth, 3 ); move16(); @@ -2295,11 +2089,7 @@ void time_envelop_shaping_ivas_fx( FOR( j = 0; j < L / 4; j++ ) { -#ifdef BASOP_NOGLOB *pit = round_fx_sat( L_shl_sat( L_mult( tmp, *pit ), sub( exp, 1 ) ) ); /*Q(13-exp+1)->Q(14-exp)->Qsyn-3 */ -#else - *pit = round_fx( L_shl( L_mult( tmp, *pit ), sub( exp, 1 ) ) ); /*Q(13-exp+1)->Q(14-exp)->Qsyn-3 */ -#endif move16(); pit++; } @@ -2356,11 +2146,7 @@ void time_reduce_pre_echo_fx( L_tmp = L_deposit_l( 0 ); FOR( j = 0; j < L; j++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac0_sat( L_tmp, synth[Len + j], synth[Len + j] ); /*2*Q_syn */ -#else - L_tmp = L_mac0( L_tmp, synth[Len + j], synth[Len + j] ); /*2*Q_syn */ -#endif } energyL[i] = Mult_32_16( L_shr( L_tmp, sub( 14, exp_L ) ), inv_L ); move32(); /*Q(2*Q_syn +29-exp_L-15 - (14-exp_L) ) -> Q(2*Q_syn) */ @@ -2400,11 +2186,7 @@ void time_reduce_pre_echo_fx( j = i_mult( L, pos ); FOR( i = 0; i < j; i++ ) { -#ifdef BASOP_NOGLOB energy = L_mac0_sat( energy, error[i], error[i] ); /*Q(2*Q_synth) */ -#else - energy = L_mac0( energy, error[i], error[i] ); /*Q(2*Q_synth) */ -#endif } exp_j = norm_s( j ); @@ -2445,22 +2227,14 @@ void time_reduce_pre_echo_fx( tmp_exp = add( 1, exp ); FOR( i = 0; i < j; i++ ) { -#ifdef BASOP_NOGLOB error[i] = round_fx_sat( L_shl_sat( Mult_32_16( L_tmp, error[i] ), tmp_exp ) ); /*Q(30-exp+1-16)->Q(15-exp)->Q_synth */ -#else - error[i] = round_fx( L_shl( Mult_32_16( L_tmp, error[i] ), tmp_exp ) ); /*Q(30-exp+1-16)->Q(15-exp)->Q_synth */ -#endif move16(); } energy = L_deposit_l( 0 ); FOR( i = j; i < ( j + L ); i++ ) { -#ifdef BASOP_NOGLOB energy = L_mac0_sat( energy, error[i], error[i] ); /*(2*Q_synth) */ -#else - energy = L_mac0( energy, error[i], error[i] ); /*(2*Q_synth) */ -#endif } energy = Mult_32_16( energy, inv_L ); /*Q(29-exp_L+1-16) -> Q(-exp_L+14) */ @@ -2499,11 +2273,7 @@ void time_reduce_pre_echo_fx( L_tmp = L_sub( L_tmp1, Ltmp_ener ); /*Q(30-exp) */ L_tmp = Mult_32_16( L_tmp, tmpi ); /*Q(30-exp) */ L_tmp = L_add( Ltmp_ener, L_tmp ); /*Q(30-exp) */ -#ifdef BASOP_NOGLOB tmp = round_fx_sat( L_shl_sat( Mult_32_16( L_tmp, *pit ), add( 1, exp ) ) ); /*Q0 */ -#else - tmp = round_fx( L_shl( Mult_32_16( L_tmp, *pit ), add( 1, exp ) ) ); /*Q0 */ -#endif *pit++ = tmp; move16(); } @@ -2572,11 +2342,7 @@ void calc_normal_length_fx_32( peak = mag; move16(); } -#ifdef BASOP_NOGLOB mean = L_add_sat( mean, mag ); -#else - mean = L_add( mean, mag ); -#endif pit++; } @@ -2666,11 +2432,7 @@ void calc_norm_envelop_fx_32( move16(); FOR( n_lag = 0; n_lag < n_lag_now; n_lag++ ) { -#ifdef BASOP_NOGLOB envelope_fx[env_index] = L_add_sat( envelope_fx[env_index], L_abs( SWB_signal_fx[n_freq + n_lag] ) ); -#else - envelope_fx[env_index] = L_add( envelope_fx[env_index], L_abs( SWB_signal_fx[n_freq + n_lag] ) ); -#endif move32(); } env_index = add( env_index, 1 ); @@ -2779,11 +2541,7 @@ void hq_generic_decoding_fx( tmp = div_s( 16384, frac ); /*15 + 14 - (cs+exp-16) */ exp = sub( add( cs, exp ), 30 ); L_tmp = Isqrt_lc( L_deposit_h( tmp ), &exp ); /*Q31 - exp */ -#ifdef BASOP_NOGLOB fenvL_fx = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 14 ) ) ); /*Q1 */ -#else - fenvL_fx = round_fx( L_shl( L_tmp, sub( exp, 14 ) ) ); /*Q1 */ -#endif } calc_normal_length_fx_32( HQ_CORE, coeff_out1_fx, HQ_GEN_SWB, -1, &L_swb_norm, prev_L_swb_norm ); @@ -3085,11 +2843,7 @@ void hq_generic_decoding_fx( tmp1_fx = extract_h( L_shl( L_tmp1, exp1 ) ); tmp2_fx = extract_h( L_shl( L_tmp2, exp2 ) ); tmp3_fx = div_s( tmp2_fx, tmp1_fx ); /*15 + exp2 + 15 - (exp1 + 15) */ -#ifdef BASOP_NOGLOB tmp3_fx = shr_sat( tmp3_fx, add( 5, sub( exp2, exp1 ) ) ); /*10 */ -#else - tmp3_fx = shr( tmp3_fx, add( 5, sub( exp2, exp1 ) ) ); /*10 */ -#endif if ( LT_16( tmp3_fx, 307 /* 0.3 in Q10*/ ) ) { tmp3_fx = 307; /* 0.3 in Q10*/ diff --git a/lib_com/swb_bwe_com_lr_fx.c b/lib_com/swb_bwe_com_lr_fx.c index 1f4fd1801..e3b2c6d5f 100644 --- a/lib_com/swb_bwe_com_lr_fx.c +++ b/lib_com/swb_bwe_com_lr_fx.c @@ -986,11 +986,7 @@ void SpectrumSmoothing_fx( IF( GT_32( L_max_val[i], 0x1L ) ) { exp_normd = norm_l( L_max_val[i] ); -#ifdef BASOP_NOGLOB max_val_norm_fx = div_s( 0x2800, round_fx_o( L_shl_o( L_max_val[i], exp_normd, &Overflow ), &Overflow ) ); /* Q10-(Qs+exp_normd-16) */ -#else - max_val_norm_fx = div_s( 0x2800, round_fx( L_shl( L_max_val[i], exp_normd ) ) ); /* Q10-(Qs+exp_normd-16) */ -#endif Qmax_val_norm[i] = sub( 10 - 12 + 16 + 15, exp_normd ); move16(); /* 10 - (12+exp_normd-16) +15 */ ; @@ -1016,20 +1012,12 @@ void SpectrumSmoothing_fx( { IF( L_inBuf_pss[j] >= 0 ) { -#ifdef BASOP_NOGLOB outBuf_pss_fx[j] = round_fx_o( L_shl_o( Mpy_32_16_r( L_shl_o( L_inBuf_pss[j], exp_norm, &Overflow ), max_val_norm_fx ), sub( exp_shift, exp_norm ), &Overflow ), &Overflow ); -#else - outBuf_pss_fx[j] = round_fx( L_shl( Mpy_32_16_r( L_shl( L_inBuf_pss[j], exp_norm ), max_val_norm_fx ), sub( exp_shift, exp_norm ) ) ); -#endif move32(); } ELSE { -#ifdef BASOP_NOGLOB outBuf_pss_fx[j] = negate( round_fx_o( L_shl_o( Mpy_32_16_r( L_shl_o( L_abs( L_inBuf_pss[j] ), exp_norm, &Overflow ), max_val_norm_fx ), sub( exp_shift, exp_norm ), &Overflow ), &Overflow ) ); -#else - outBuf_pss_fx[j] = negate( round_fx( L_shl( Mpy_32_16_r( L_shl( L_abs( L_inBuf_pss[j] ), exp_norm ), max_val_norm_fx ), sub( exp_shift, exp_norm ) ) ) ); -#endif move16(); } } @@ -2327,11 +2315,7 @@ void ton_ene_est_fx( exp_pow = sub( 14, temp_hi_fx ); L_band_energy_Linear[i] = Pow2( 14, temp_lo_fx ); move32(); /* Qexp_pow */ -#ifdef BASOP_NOGLOB L_band_energy_Linear[i] = L_shl_sat( L_band_energy_Linear[i], sub( *QbeL, exp_pow ) ); -#else - L_band_energy_Linear[i] = L_shl( L_band_energy_Linear[i], sub( *QbeL, exp_pow ) ); -#endif move32(); /* Div Part */ E_r_fx = 0x7fff; @@ -2354,11 +2338,7 @@ void ton_ene_est_fx( move16(); /* 0.06=15729(Q18) */ exp_shift = sub( 18, QE_r ); -#ifdef BASOP_NOGLOB E_r_shift_fx = shl_o( E_r_fx, exp_shift, &Overflow ); -#else - E_r_shift_fx = shl( E_r_fx, exp_shift ); -#endif IF( LT_16( E_r_shift_fx, 15729 ) ) /* E_r < 0.06 */ { /* avg_pe[k] = (float) sqrt(pow(2.0f,band_energy[i])/band_width[i]); */ @@ -2400,11 +2380,7 @@ void ton_ene_est_fx( L_temp = Mult_32_16( L_temp, E_r_fx ); /* 0.12f: 257698038 (Q31) */ -#ifdef BASOP_NOGLOB if ( GE_32( L_shl_o( L_temp, sub( 31, add( add( shl( Qavg_pe[k], 1 ), QE_r ), 1 - 15 ) ), &Overflow ), 257698038 ) ) -#else - if ( GE_32( L_shl( L_temp, sub( 31, add( add( shl( Qavg_pe[k], 1 ), QE_r ), 1 - 15 ) ) ), 257698038 ) ) -#endif { ni_gain_fx[k] = mult_r( 1638, ni_gain_fx[k] ); /* 0.05 : 1638(Q15) */ move16(); @@ -2430,11 +2406,7 @@ void ton_ene_est_fx( L_E = sum2_fx( &xSynth_har_fx[sub( band_start[i], fLenLow )], band_width[i] ); QE = add( shl( QxSynth_sft, 1 ), 1 ); -#ifdef BASOP_NOGLOB L_E = L_shl_sat( L_E, sub( *QbeL, QE ) ); -#else - L_E = L_shl( L_E, sub( *QbeL, QE ) ); -#endif QE = *QbeL; move16(); } @@ -2644,11 +2616,7 @@ void Gettonl_scalfact_fx( exp_pow = sub( 14, temp_hi_fx ); L_band_energy_Linear[band_pos_fx] = Pow2( 14, temp_lo_fx ); move32(); /* Qexp_pow */ -#ifdef BASOP_NOGLOB L_band_energy_Linear[band_pos_fx] = L_shl_sat( L_band_energy_Linear[band_pos_fx], sub( QbeL, exp_pow ) ); -#else - L_band_energy_Linear[band_pos_fx] = L_shl( L_band_energy_Linear[band_pos_fx], sub( QbeL, exp_pow ) ); -#endif move32(); /* Div Part */ exp_normd = norm_l( L_be_tonal[band_pos_fx] ); @@ -2656,11 +2624,7 @@ void Gettonl_scalfact_fx( exp_normn = norm_l( L_band_energy_Linear[band_pos_fx] ); temp_fx = div_l( L_shl( L_be_tonal[band_pos_fx], exp_normd ), extract_h( L_shl( L_band_energy_Linear[band_pos_fx], exp_normn ) ) ); /* QbeL+exp_normd-(QbeL+exp_normn-16)-1 */ sqrt_32n_16_fx( L_deposit_h( temp_fx ), add( sub( exp_normd, exp_normn ), 31 ), &temp_fx, &Qtemp ); -#ifdef BASOP_NOGLOB enrd_r_fx = extract_h( L_shl_sat( L_mult( enrd_r_fx, temp_fx ), sub( 15, Qtemp ) ) ); -#else - enrd_r_fx = extract_h( L_shl( L_mult( enrd_r_fx, temp_fx ), sub( 15, Qtemp ) ) ); -#endif enrd_r_fx = sub( enrd_r_fx, step_fx ); } ELSE @@ -3284,21 +3248,12 @@ void noiseinj_hf_fx( move16(); } } -#ifdef BASOP_NOGLOB *p_L_En = L_shl_sat( *p_L_En, sub( QbeL, QE ) ); -#else - *p_L_En = L_shl( *p_L_En, sub( QbeL, QE ) ); -#endif move32(); /**p_L_En = (float)sqrt(*p_En);*/ sqrt_32n_16_fx( *p_L_En, QbeL, p_sqrt_En_fx, &Qtemp ); -#ifdef BASOP_NOGLOB *p_sqrt_En_fx = shl_o( *p_sqrt_En_fx, sub( QsEn, Qtemp ), &Overflow ); /* -> Q2 */ move16(); -#else - *p_sqrt_En_fx = shl( *p_sqrt_En_fx, sub( QsEn, Qtemp ) ); /* -> Q2 */ - move16(); -#endif } p_L_En++; p_sqrt_En_fx++; @@ -3367,11 +3322,7 @@ void noiseinj_hf_fx( /* SQRT Part */ sqrt_32n_16_fx( L_deposit_h( div_fx ), add( Qdiv, 16 ), &ni_scale_fx, &Qtemp ); -#ifdef BASOP_NOGLOB ni_scale_fx = shl_o( ni_scale_fx, sub( 14, Qtemp ), &Overflow ); -#else - ni_scale_fx = shl( ni_scale_fx, sub( 14, Qtemp ) ); -#endif ni_scale_fx = s_min( 20408, ni_scale_fx ); /* 1.25=20408.0(Q14) */ ni_scale_fx = s_max( 12288, ni_scale_fx ); /* 0.75=12288.0(Q14) */ diff --git a/lib_com/swb_tbe_com_fx.c b/lib_com/swb_tbe_com_fx.c index 39fc266d0..0299e3a9c 100644 --- a/lib_com/swb_tbe_com_fx.c +++ b/lib_com/swb_tbe_com_fx.c @@ -1082,13 +1082,8 @@ static void scale_st_swb( temp = mult_r( agc_fac_para_fx, gain_fx ); /*15 +14 -15 =14 */ gain_fx = add( temp, g0_fx ); /* in Q14 */ L_temp = L_mult( gain_fx, sig_out_fx[i] ); /*14 + Q_bwe_exc-1 +1 = 14 + Q_bwe_exc */ -#ifdef BASOP_NOGLOB L_temp = L_shl_sat( L_temp, 1 ); /*14 + Q_bwe_exc +1 */ sig_out_fx[i] = round_fx_sat( L_temp ); /*Q_bwe_exc +15 -16 = Q_bwe_exc-1 */ -#else - L_temp = L_shl( L_temp, 1 ); /*14 + Q_bwe_exc +1 */ - sig_out_fx[i] = round_fx( L_temp ); /*Q_bwe_exc +15 -16 = Q_bwe_exc-1 */ -#endif move16(); } *gain_prec_fx = gain_fx; @@ -1487,11 +1482,7 @@ void GenShapedWBExcitation_ivas_fx( n1 = norm_s( max_val ); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { -#ifdef BASOP_NOGLOB excTmp2_frac[i] = shl_o( excTmp2[i], n1, &Overflow ); // Q_bwe_exc + n1 -#else - excTmp2_frac[i] = shl( excTmp2[i], n1 ); -#endif move16(); /* Q14 */ } n1 = sub( sub( 14, n1 ), Q_bwe_exc ); @@ -1499,23 +1490,14 @@ void GenShapedWBExcitation_ivas_fx( move32(); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mult_o( excTmp2_frac[i], excTmp2_frac[i], &Overflow ); /* Q29 */ pow1 = L_add_o( pow1, L_shr( L_tmp, 10 ), &Overflow ); /* Q22 */ -#else - L_tmp = L_mult( excTmp2_frac[i], excTmp2_frac[i] ); /* Q29 */ - pow1 = L_add( pow1, L_shr( L_tmp, 7 ) ); /* Q22 */ -#endif } } FOR( i = 0; i < L_FRAME16k / 4; i++ ) { -#ifdef BASOP_NOGLOB excNoisyEnv[i] = L_add_o( *mem_csfilt, L_mult_o( csfilt_num2[0], excTmp2[i], &Overflow ), &Overflow ); -#else - excNoisyEnv[i] = L_add( *mem_csfilt, L_mult( csfilt_num2[0], excTmp2[i] ) ); -#endif move32(); /* Q_bwe_exc+16 */ *mem_csfilt = Mult_32_16( excNoisyEnv[i], neg_csfilt_den2[1] ); move32(); /* Q_bwe_exc+16 */ @@ -1545,11 +1527,7 @@ void GenShapedWBExcitation_ivas_fx( n2 = norm_l( Lmax ); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { -#ifdef BASOP_NOGLOB exc4k_frac[i] = extract_h( L_shl_o( exc4k_32[i], n2, &Overflow ) ); /* Q(14-n2) */ -#else - exc4k_frac[i] = extract_h( L_shl( exc4k_32[i], n2 ) ); /* Q(14-n2) */ -#endif move16(); } n2 = 30 - n2 - ( Q_bwe_exc + 6 ); @@ -1557,13 +1535,8 @@ void GenShapedWBExcitation_ivas_fx( move32(); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mult_o( exc4k_frac[i], exc4k_frac[i], &Overflow ); /* Q29 */ pow22 = L_add_o( pow22, L_shr( L_tmp, 10 ), &Overflow ); /* Q22 */ -#else - L_tmp = L_mult( exc4k_frac[i], exc4k_frac[i] ); /* Q29 */ - pow22 = L_add( pow22, L_shr( L_tmp, 7 ) ); /* Q22 */ -#endif } } @@ -1572,19 +1545,11 @@ void GenShapedWBExcitation_ivas_fx( IF( EQ_16( coder_type, UNVOICED ) || ( igf_flag != 0 && LT_16( avg_voice_fac, 6654 /* 0.2 in Q15 */ ) ) ) { L_tmp = root_a_over_b_fx( pow1, sub( 19, shl( n1, 1 ) ), pow22, sub( 19, shl( n2, 1 ) ), &exp ); -#ifdef BASOP_NOGLOB scale = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); /*Q15 */ -#else - scale = round_fx( L_shl( L_tmp, exp ) ); /*Q15 */ -#endif sc = sub( add( n2, Q_bwe_exc ), 14 ); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { -#ifdef BASOP_NOGLOB exc4kWhtnd[i] = round_fx_o( L_shl_o( L_mult_o( exc4k_frac[i], scale, &Overflow ), sc, &Overflow ), &Overflow ); /* Q_bwe_exc+n2-10+16+ Q_bwe_exc + n2 -14 -16 = //Q_bwe_exc */ -#else - exc4kWhtnd[i] = round_fx( L_shl( L_mult( exc4k_frac[i], scale ), sc ) ); /* Q_bwe_exc+n2-10+16+ Q_bwe_exc + n2 -14 -16 = //Q_bwe_exc */ -#endif move16(); } } @@ -1600,13 +1565,7 @@ void GenShapedWBExcitation_ivas_fx( { /*tmp_vfac = 2*voice_factors[i]; tmp_vfac = min(1, tmp_vfac);*/ -#ifdef BASOP_NOGLOB tmp_vfac = shl_o( voice_factors[i], 1, &Overflow ); -#else - BASOP_SATURATE_WARNING_OFF_EVS - tmp_vfac = shl( voice_factors[i], 1 ); - BASOP_SATURATE_WARNING_ON_EVS -#endif } ELSE { @@ -1615,29 +1574,15 @@ void GenShapedWBExcitation_ivas_fx( } Ltemp1 = root_a_fx( L_deposit_h( tmp_vfac ), 31, &exp ); -#ifdef BASOP_NOGLOB temp1 = round_fx_o( L_shl_o( Ltemp1, exp, &Overflow ), &Overflow ); /* Q15 */ -#else - temp1 = round_fx( L_shl( Ltemp1, exp ) ); /* Q15 */ -#endif L_tmp = Mult_32_16( pow1, sub( 32767, tmp_vfac ) ); /* Q22*/ Ltemp2 = root_a_over_b_fx( L_tmp, sub( 19, shl( n1, 1 ) ), pow22, sub( 19, shl( n2, 1 ) ), &exp ); -#ifdef BASOP_NOGLOB temp2 = round_fx_o( L_shl_o( Ltemp2, exp, &Overflow ), &Overflow ); /* Q15 */ -#else - temp2 = round_fx( L_shl( Ltemp2, exp ) ); /* Q15 */ -#endif FOR( j = 0; j < L_FRAME16k / 16; j++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mult_o( temp1, exc4kWhtnd[k], &Overflow ); /* Q(16+Q_bwe_exc) */ L_tmp = L_add_o( L_tmp, L_shl_o( L_mult_o( temp2, exc4k_frac[k], &Overflow ), sc, &Overflow ), &Overflow ); /* Q(16+Q_bwe_exc) */ exc4kWhtnd[k] = round_fx_o( L_tmp, &Overflow ); /* Q_bwe_exc */ -#else - L_tmp = L_mult( temp1, exc4kWhtnd[k] ); /* Q(16+Q_bwe_exc) */ - L_tmp = L_add( L_tmp, L_shl( L_mult( temp2, exc4k_frac[k] ), sc ) ); /* Q(16+Q_bwe_exc) */ - exc4kWhtnd[k] = round_fx( L_tmp ); /* Q_bwe_exc */ -#endif move16(); k++; } @@ -1784,11 +1729,7 @@ void GenShapedWBExcitation_fx( n1 = norm_s( max_val ); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { -#ifdef BASOP_NOGLOB excTmp2_frac[i] = shl_o( excTmp2[i], n1, &Overflow ); -#else - excTmp2_frac[i] = shl( excTmp2[i], n1 ); -#endif move16(); /* Q14 */ } n1 = sub( sub( 14, n1 ), Q_bwe_exc ); @@ -1796,23 +1737,14 @@ void GenShapedWBExcitation_fx( move32(); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mult_o( excTmp2_frac[i], excTmp2_frac[i], &Overflow ); /* Q29 */ pow1 = L_add_o( pow1, L_shr( L_tmp, 7 ), &Overflow ); /* Q22 */ -#else - L_tmp = L_mult( excTmp2_frac[i], excTmp2_frac[i] ); /* Q29 */ - pow1 = L_add( pow1, L_shr( L_tmp, 7 ) ); /* Q22 */ -#endif } } FOR( i = 0; i < L_FRAME16k / 4; i++ ) { -#ifdef BASOP_NOGLOB excNoisyEnv[i] = L_add_o( *mem_csfilt, L_mult_o( csfilt_num2[0], excTmp2[i], &Overflow ), &Overflow ); -#else - excNoisyEnv[i] = L_add( *mem_csfilt, L_mult( csfilt_num2[0], excTmp2[i] ) ); -#endif move32(); /* Q_bwe_exc+16 */ *mem_csfilt = Mpy_32_16_1( excNoisyEnv[i], neg_csfilt_den2[1] ); move32(); /* Q_bwe_exc+16 */ @@ -1843,11 +1775,7 @@ void GenShapedWBExcitation_fx( n2 = norm_l( Lmax ); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { -#ifdef BASOP_NOGLOB exc4k_frac[i] = extract_h( L_shl_o( exc4k_32[i], n2, &Overflow ) ); /* Q(14-n2) */ -#else - exc4k_frac[i] = extract_h( L_shl( exc4k_32[i], n2 ) ); /* Q(14-n2) */ -#endif move16(); } n2 = sub( sub( 30, n2 ), add( Q_bwe_exc, 6 ) ); @@ -1855,13 +1783,8 @@ void GenShapedWBExcitation_fx( move32(); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mult_o( exc4k_frac[i], exc4k_frac[i], &Overflow ); /* Q29 */ pow22 = L_add_o( pow22, L_shr( L_tmp, 7 ), &Overflow ); /* Q22 */ -#else - L_tmp = L_mult( exc4k_frac[i], exc4k_frac[i] ); /* Q29 */ - pow22 = L_add( pow22, L_shr( L_tmp, 7 ) ); /* Q22 */ -#endif } } @@ -1870,19 +1793,11 @@ void GenShapedWBExcitation_fx( IF( EQ_16( coder_type, UNVOICED ) || ( igf_flag != 0 && LT_16( avg_voice_fac, 6654 /*0.2 in Q15 */ ) ) ) { L_tmp = root_a_over_b_fx( pow1, sub( 22, shl( n1, 1 ) ), pow22, sub( 22, shl( n2, 1 ) ), &exp ); -#ifdef BASOP_NOGLOB scale = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); /*Q15 */ -#else - scale = round_fx( L_shl( L_tmp, exp ) ); /*Q15 */ -#endif sc = sub( add( n2, Q_bwe_exc ), 14 ); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { -#ifdef BASOP_NOGLOB exc4kWhtnd[i] = round_fx_o( L_shl_o( L_mult_o( exc4k_frac[i], scale, &Overflow ), sc, &Overflow ), &Overflow ); /* Q_bwe_exc+n2-10+16+ Q_bwe_exc + n2 -14 -16 = //Q_bwe_exc */ -#else - exc4kWhtnd[i] = round_fx( L_shl( L_mult( exc4k_frac[i], scale ), sc ) ); /* Q_bwe_exc+n2-10+16+ Q_bwe_exc + n2 -14 -16 = //Q_bwe_exc */ -#endif move16(); } } @@ -1899,13 +1814,7 @@ void GenShapedWBExcitation_fx( { /*tmp_vfac = 2*voice_factors[i]; tmp_vfac = min(1, tmp_vfac);*/ -#ifdef BASOP_NOGLOB tmp_vfac = shl_o( voice_factors[i], 1, &Overflow ); -#else - BASOP_SATURATE_WARNING_OFF_EVS - tmp_vfac = shl( voice_factors[i], 1 ); - BASOP_SATURATE_WARNING_ON_EVS -#endif } ELSE { @@ -1914,29 +1823,15 @@ void GenShapedWBExcitation_fx( } Ltemp1 = root_a_fx( L_deposit_h( tmp_vfac ), 31, &exp ); -#ifdef BASOP_NOGLOB temp1 = round_fx_o( L_shl_o( Ltemp1, exp, &Overflow ), &Overflow ); /* Q15 */ -#else - temp1 = round_fx( L_shl( Ltemp1, exp ) ); /* Q15 */ -#endif L_tmp = Mpy_32_16_1( pow1, sub( 32767, tmp_vfac ) ); /* Q22*/ Ltemp2 = root_a_over_b_fx( L_tmp, sub( 22, shl( n1, 1 ) ), pow22, sub( 22, shl( n2, 1 ) ), &exp ); -#ifdef BASOP_NOGLOB temp2 = round_fx_o( L_shl_o( Ltemp2, exp, &Overflow ), &Overflow ); /* Q15 */ -#else - temp2 = round_fx( L_shl( Ltemp2, exp ) ); /* Q15 */ -#endif FOR( j = 0; j < L_FRAME16k / 16; j++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mult_o( temp1, exc4kWhtnd[k], &Overflow ); /* Q(16+Q_bwe_exc) */ L_tmp = L_add_o( L_tmp, L_shl_o( L_mult_o( temp2, exc4k_frac[k], &Overflow ), sc, &Overflow ), &Overflow ); /* Q(16+Q_bwe_exc) */ exc4kWhtnd[k] = round_fx_o( L_tmp, &Overflow ); /* Q_bwe_exc */ -#else - L_tmp = L_mult( temp1, exc4kWhtnd[k] ); /* Q(16+Q_bwe_exc) */ - L_tmp = L_add( L_tmp, L_shl( L_mult( temp2, exc4k_frac[k] ), sc ) ); /* Q(16+Q_bwe_exc) */ - exc4kWhtnd[k] = round_fx( L_tmp ); /* Q_bwe_exc */ -#endif move16(); k = add( k, 1 ); } @@ -2276,11 +2171,7 @@ void GenShapedSHBExcitation_fx( /* Estimate pow1 associated with Low band nonlinear extended excitation */ /* pow1=0.00001f */ tmp = sub( shl( *Q_bwe_exc, 1 ), 31 ); -#ifdef BASOP_NOGLOB pow1 = L_shl_sat( 21475l /*0.00001f Q31*/, tmp ); /* 0.00001f in 2*(Q_bwe_exc) */ -#else - pow1 = L_shl( 21475l /*0.00001f Q31*/, tmp ); /* 0.00001f in 2*(Q_bwe_exc) */ -#endif FOR( k = 0; k < L_FRAME16k; k++ ) { /*excTmp2[k ] = (float)(fabs(exc16kWhtnd[k]));*/ @@ -2288,11 +2179,7 @@ void GenShapedSHBExcitation_fx( move16(); /* pow1 += exc16kWhtnd[k] * exc16kWhtnd[k]; */ -#ifdef BASOP_NOGLOB pow1 = L_mac0_sat( pow1, exc16kWhtnd[k], exc16kWhtnd[k] ); /* 2*Q_bwe_exc */ -#else - pow1 = L_mac0( pow1, exc16kWhtnd[k], exc16kWhtnd[k] ); /* 2*Q_bwe_exc */ -#endif } Q_pow1 = shl( *Q_bwe_exc, 1 ); @@ -2454,11 +2341,7 @@ void GenShapedSHBExcitation_fx( tmp = add( *Q_bwe_exc, 1 ); FOR( k = 0; k < L_FRAME16k; k++ ) { -#ifdef BASOP_NOGLOB L_tmp4 = L_shl_sat( L_deposit_l( White_exc16k[k] ), tmp ); -#else - L_tmp4 = L_shl( L_deposit_l( White_exc16k[k] ), tmp ); -#endif if ( excNoisyEnv[k] != 0 ) { L_tmp4 = L_mult( excNoisyEnv[k], White_exc16k[k] ); /* (Q_bwe_exc) +5 +1*/ @@ -2490,11 +2373,7 @@ void GenShapedSHBExcitation_fx( /* i: White_exc16k in Q6 */ /* o: White_exc16k in (Q_bwe_exc-NOISE_QADJ) */ /* pow22 += White_exc16k[k] * White_exc16k[k]; */ -#ifdef BASOP_NOGLOB pow22 = L_mac0_sat( pow22, White_exc16k[k], White_exc16k[k] ); /* 2*(Q_bwe_exc-NOISE_QADJ)*/ -#else - pow22 = L_mac0( pow22, White_exc16k[k], White_exc16k[k] ); /* 2*(Q_bwe_exc-NOISE_QADJ)*/ -#endif } /*Q_pow22 = sub( shl(*Q_bwe_exc,1), 18 );*/ Q_pow22 = shl( sub( *Q_bwe_exc, NOISE_QADJ ), 1 ); @@ -2715,11 +2594,7 @@ void GenShapedSHBExcitation_fx( #endif { L_tmp = root_a_over_b_fx( pow1, Q_pow1, pow22, Q_pow22, &exp ); -#ifdef BASOP_NOGLOB scale = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /*Q15 */ -#else - scale = round_fx( L_shl( L_tmp, exp ) ); /*Q15 */ -#endif FOR( k = 0; k < L_FRAME16k; k++ ) { /* White_exc16k: (Q_bwe_exc-NOISE_QADJ), scale: Q15 */ @@ -2767,11 +2642,7 @@ void GenShapedSHBExcitation_fx( temp = sub( MAX_16, temp ); tempQ31 = Mult_32_16( pow1, temp ); L_tmp = root_a_over_b_fx( tempQ31, Q_pow1, pow22, Q_pow22, &exp ); -#ifdef BASOP_NOGLOB temp2 = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /* Q15 whiteEnvShapedExc scale factor */ -#else - temp2 = round_fx( L_shl( L_tmp, exp ) ); /* Q15 whiteEnvShapedExc scale factor */ -#endif } ELSE { @@ -2790,24 +2661,15 @@ void GenShapedSHBExcitation_fx( temp = sub( MAX_16, vf_tmp ); tempQ31 = Mult_32_16( pow1, temp ); L_tmp = root_a_over_b_fx( tempQ31, Q_pow1, pow22, Q_pow22, &exp ); -#ifdef BASOP_NOGLOB temp2 = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /* Q15 whiteEnvShapedExc scale factor */ -#else - temp2 = round_fx( L_shl( L_tmp, exp ) ); /* Q15 whiteEnvShapedExc scale factor */ -#endif } FOR( j = 0; j < lSubFr; j++ ) { /*exc16kWhtnd[k+j] = temp1 * exc16kWhtnd[k+j] + temp2 * White_exc16k[k+j]; */ L_tmp = L_mult( temp2, White_exc16k[k + j] ); /* 16+(Q_bwe_exc-NOISE_QADJ)*/ -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, NOISE_QADJ ); /* 16+(Q_bwe_exc) */ exc16kWhtnd[k + j] = mac_r_sat( L_tmp, temp1, exc16kWhtnd[k + j] ); -#else - L_tmp = L_shl( L_tmp, NOISE_QADJ ); /* 16+(Q_bwe_exc) */ - exc16kWhtnd[k + j] = mac_r( L_tmp, temp1, exc16kWhtnd[k + j] ); -#endif move16(); /* Q_bwe_exc */ } @@ -3113,11 +2975,7 @@ void GenShapedSHBExcitation_ivas_enc_fx( /* Estimate pow1 associated with Low band nonlinear extended excitation */ /* pow1=0.00001f */ tmp = sub( shl( *Q_bwe_exc, 1 ), 31 ); -#ifdef BASOP_NOGLOB pow1 = L_shl_sat( 21475l /*0.00001f Q31*/, tmp ); /* 0.00001f in 2*(Q_bwe_exc) */ -#else - pow1 = L_shl( 21475l /*0.00001f Q31*/, tmp ); /* 0.00001f in 2*(Q_bwe_exc) */ -#endif FOR( k = 0; k < L_FRAME16k; k++ ) { /*excTmp2[k ] = (float)(fabs(exc16kWhtnd[k]));*/ @@ -3126,11 +2984,7 @@ void GenShapedSHBExcitation_ivas_enc_fx( chk1 = s_or( chk1, exc16kWhtnd[k] ); /* pow1 += exc16kWhtnd[k] * exc16kWhtnd[k]; */ -#ifdef BASOP_NOGLOB pow1 = L_mac0_sat( pow1, exc16kWhtnd[k], exc16kWhtnd[k] ); /* 2*Q_bwe_exc */ -#else - pow1 = L_mac0( pow1, exc16kWhtnd[k], exc16kWhtnd[k] ); /* 2*Q_bwe_exc */ -#endif } Q_pow1 = shl( *Q_bwe_exc, 1 ); @@ -3788,11 +3642,7 @@ void GenShapedSHBExcitation_ivas_enc_fx( L_tmp = 0; move32(); } -#ifdef BASOP_NOGLOB scale = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /*Q15 */ -#else - scale = round_fx( L_shl( L_tmp, exp ) ); /*Q15 */ -#endif FOR( k = 0; k < L_FRAME16k; k++ ) { /* White_exc16k: (Q_bwe_exc-NOISE_QADJ), scale: Q15 */ @@ -3842,11 +3692,7 @@ void GenShapedSHBExcitation_ivas_enc_fx( temp = sub( MAX_16, temp ); tempQ31 = Mult_32_16( pow1, temp ); L_tmp = root_a_over_b_fx( tempQ31, Q_pow1, pow22, Q_pow22, &exp ); -#ifdef BASOP_NOGLOB temp2 = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /* Q15 whiteEnvShapedExc scale factor */ -#else - temp2 = round_fx( L_shl( L_tmp, exp ) ); /* Q15 whiteEnvShapedExc scale factor */ -#endif } ELSE { @@ -3865,24 +3711,15 @@ void GenShapedSHBExcitation_ivas_enc_fx( temp = sub( MAX_16, vf_tmp ); tempQ31 = Mult_32_16( pow1, temp ); L_tmp = root_a_over_b_fx( tempQ31, Q_pow1, pow22, Q_pow22, &exp ); -#ifdef BASOP_NOGLOB temp2 = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /* Q15 whiteEnvShapedExc scale factor */ -#else - temp2 = round_fx( L_shl( L_tmp, exp ) ); /* Q15 whiteEnvShapedExc scale factor */ -#endif } FOR( j = 0; j < lSubFr; j++ ) { /*exc16kWhtnd[k+j] = temp1 * exc16kWhtnd[k+j] + temp2 * White_exc16k[k+j]; */ L_tmp = L_mult( temp2, White_exc16k[k + j] ); /* 16+(Q_bwe_exc-NOISE_QADJ)*/ -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, NOISE_QADJ ); /* 16+(Q_bwe_exc) */ exc16kWhtnd[k + j] = mac_r_sat( L_tmp, temp1, exc16kWhtnd[k + j] ); -#else - L_tmp = L_shl( L_tmp, NOISE_QADJ ); /* 16+(Q_bwe_exc) */ - exc16kWhtnd[k + j] = mac_r( L_tmp, temp1, exc16kWhtnd[k + j] ); -#endif move16(); /* Q_bwe_exc */ } @@ -4213,11 +4050,7 @@ void GenShapedSHBExcitation_ivas_dec_fx( /* Estimate pow1 associated with Low band nonlinear extended excitation */ /* pow1=0.00001f */ tmp = sub( shl( *Q_bwe_exc, 1 ), 31 ); -#ifdef BASOP_NOGLOB pow1 = L_shl_sat( 21475l /*0.00001f Q31*/, tmp ); /* 0.00001f in 2*(Q_bwe_exc) */ -#else - pow1 = L_shl( 21475l /*0.00001f Q31*/, tmp ); /* 0.00001f in 2*(Q_bwe_exc) */ -#endif FOR( k = 0; k < L_FRAME16k; k++ ) { /*excTmp2[k ] = (float)(fabs(exc16kWhtnd[k]));*/ @@ -4226,11 +4059,7 @@ void GenShapedSHBExcitation_ivas_dec_fx( chk1 = s_or( chk1, exc16kWhtnd[k] ); /* pow1 += exc16kWhtnd[k] * exc16kWhtnd[k]; */ -#ifdef BASOP_NOGLOB pow1 = L_mac0_sat( pow1, exc16kWhtnd[k], exc16kWhtnd[k] ); /* 2*Q_bwe_exc */ -#else - pow1 = L_mac0( pow1, exc16kWhtnd[k], exc16kWhtnd[k] ); /* 2*Q_bwe_exc */ -#endif } Q_pow1 = shl( *Q_bwe_exc, 1 ); @@ -4487,11 +4316,7 @@ void GenShapedSHBExcitation_ivas_dec_fx( /* i: White_exc16k in Q6 */ /* o: White_exc16k in (Q_bwe_exc-NOISE_QADJ) */ /* pow22 += White_exc16k[k] * White_exc16k[k]; */ -#ifdef BASOP_NOGLOB pow22 = L_mac0_sat( pow22, White_exc16k[k], White_exc16k[k] ); /* 2*(Q_excTmp2-NOISE_QADJ)*/ -#else - pow22 = L_mac0( pow22, White_exc16k[k], White_exc16k[k] ); /* 2*(Q_bwe_exc-NOISE_QADJ)*/ -#endif } /*Q_pow22 = sub( shl(*Q_bwe_exc,1), 18 );*/ Q_pow22 = shl( sub( Q_excTmp2, NOISE_QADJ ), 1 ); @@ -4891,11 +4716,7 @@ void GenShapedSHBExcitation_ivas_dec_fx( L_tmp = 0; move32(); } -#ifdef BASOP_NOGLOB scale = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /*Q15 */ -#else - scale = round_fx( L_shl( L_tmp, exp ) ); /*Q15 */ -#endif FOR( k = 0; k < L_FRAME16k; k++ ) { /* White_exc16k: (Q_bwe_exc-NOISE_QADJ), scale: Q15 */ @@ -4945,11 +4766,7 @@ void GenShapedSHBExcitation_ivas_dec_fx( temp = sub( MAX_16, temp ); tempQ31 = Mult_32_16( pow1, temp ); L_tmp = root_a_over_b_fx( tempQ31, Q_pow1, pow22, Q_pow22, &exp ); -#ifdef BASOP_NOGLOB temp2 = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /* Q15 whiteEnvShapedExc scale factor */ -#else - temp2 = round_fx( L_shl( L_tmp, exp ) ); /* Q15 whiteEnvShapedExc scale factor */ -#endif } ELSE { @@ -4968,24 +4785,15 @@ void GenShapedSHBExcitation_ivas_dec_fx( temp = sub( MAX_16, vf_tmp ); tempQ31 = Mult_32_16( pow1, temp ); L_tmp = root_a_over_b_fx( tempQ31, Q_pow1, pow22, Q_pow22, &exp ); -#ifdef BASOP_NOGLOB temp2 = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /* Q15 whiteEnvShapedExc scale factor */ -#else - temp2 = round_fx( L_shl( L_tmp, exp ) ); /* Q15 whiteEnvShapedExc scale factor */ -#endif } FOR( j = 0; j < lSubFr; j++ ) { /*exc16kWhtnd[k+j] = temp1 * exc16kWhtnd[k+j] + temp2 * White_exc16k[k+j]; */ L_tmp = L_mult( temp2, White_exc16k[k + j] ); /* 16+(Q_bwe_exc-NOISE_QADJ)*/ -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, NOISE_QADJ ); /* 16+(Q_bwe_exc) */ exc16kWhtnd[k + j] = mac_r_sat( L_tmp, temp1, exc16kWhtnd[k + j] ); -#else - L_tmp = L_shl( L_tmp, NOISE_QADJ ); /* 16+(Q_bwe_exc) */ - exc16kWhtnd[k + j] = mac_r( L_tmp, temp1, exc16kWhtnd[k + j] ); -#endif move16(); /* Q_bwe_exc */ } @@ -5672,29 +5480,18 @@ void ScaleShapedWB_fx( { /* mod_syn in (16+Q_bwe_exc), frame_gain in Q18 */ L_tmp = Mult_32_32( mod_syn[i], frame_gain ); /* L_tmp in (Q_bwe_exc+3) */ -#ifdef BASOP_NOGLOB synSHB[i] = round_fx_sat( L_shl_sat( Mult_32_16( L_tmp, win[i] ), shift ) ); /* Qx */ move16(); synSHB[i] = add_sat( synSHB[i], overlap[i] ); move16(); /* Qx */ synSHB[i + l_shb_lahead] = round_fx_sat( L_shl_sat( L_tmp, shift ) ); /* Qx */ move16(); -#else - synSHB[i] = round_fx( L_shl( Mult_32_16( L_tmp, win[i] ), shift ) ); /* Qx */ - synSHB[i] = add( synSHB[i], overlap[i] ); - move16(); /* Qx */ - synSHB[i + l_shb_lahead] = round_fx( L_shl( L_tmp, shift ) ); /* Qx */ -#endif } FOR( ; i < l_frame; i++ ) { L_tmp = Mult_32_32( mod_syn[i], frame_gain ); /* L_tmp in (Q_bwe_exc+3) */ -#ifdef BASOP_NOGLOB synSHB[i] = round_fx_sat( L_shl_sat( L_tmp, shift ) ); /* Qx; */ -#else - synSHB[i] = round_fx( L_shl( L_tmp, shift ) ); /* Qx; */ -#endif move16(); } @@ -5702,11 +5499,7 @@ void ScaleShapedWB_fx( FOR( ; i < l_frame_tmp; i++ ) { L_tmp = Mult_32_32( mod_syn[i], frame_gain ); /* (Q_bwe_exc+3) */ -#ifdef BASOP_NOGLOB overlap[i - l_frame] = round_fx_sat( L_shl_sat( Mult_32_16( L_tmp, win[l_frame + l_shb_lahead - 1 - i] ), shift ) ); /* Qx */ -#else - overlap[i - l_frame] = round_fx( L_shl( Mult_32_16( L_tmp, win[l_frame + l_shb_lahead - 1 - i] ), shift ) ); /* Qx */ -#endif move16(); } @@ -5736,11 +5529,7 @@ static Word32 non_linearity_scaled_copy( { FOR( i = 0; i < j; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mult_sat( input[i], input[i] ); /* 2*Q_inp+1 */ -#else - L_tmp = L_mult( input[i], input[i] ); /* 2*Q_inp+1 */ -#endif L_tmp = Mult_32_32( L_tmp, prev_scale ); /* 2*Q_inp */ output[i] = L_tmp; move32(); @@ -5750,11 +5539,7 @@ static Word32 non_linearity_scaled_copy( } FOR( ; i < length; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mult_sat( input[i], input[i] ); /* 2*Q_inp+1 */ -#else - L_tmp = L_mult( input[i], input[i] ); /* 2*Q_inp+1 */ -#endif L_tmp = Mult_32_32( L_tmp, prev_scale ); /* 2*Q_inp */ output[i] = L_tmp; move32(); @@ -5764,11 +5549,7 @@ static Word32 non_linearity_scaled_copy( { FOR( i = 0; i < j; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mult_sat( input[i], input[i] ); /* 2*Q_inp+1 */ -#else - L_tmp = L_mult( input[i], input[i] ); /* 2*Q_inp+1 */ -#endif L_tmp = Mult_32_32( L_tmp, prev_scale ); /* 2*Q_inp */ if ( input[i] < 0 ) @@ -5784,11 +5565,7 @@ static Word32 non_linearity_scaled_copy( FOR( ; i < length; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mult_sat( input[i], input[i] ); /* 2*Q_inp+1 */ -#else /* BASOP_NOGLOB */ - L_tmp = L_mult( input[i], input[i] ); /* 2*Q_inp+1 */ -#endif /* BASOP_NOGLOB */ L_tmp = Mult_32_32( L_tmp, prev_scale ); /* 2*Q_inp */ if ( input[i] < 0 ) @@ -5890,11 +5667,7 @@ static Word32 non_linearity_scaled_copy_ivas( FOR( ; i < length; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mult_sat( input[i], input[i] ); /* 2*Q_inp+1 */ -#else /* BASOP_NOGLOB */ - L_tmp = L_mult( input[i], input[i] ); /* 2*Q_inp+1 */ -#endif /* BASOP_NOGLOB */ L_tmp = Mult_32_32( L_tmp, prev_scale ); /* 2*Q_inp */ test(); test(); @@ -6071,20 +5844,12 @@ void non_linearity_fx( tmp = div_s( shl( 1, sub( 14, exp ) ), j ); /* Q(29-exp) */ /* (log2(scale / prev_scale))/length */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( Mult_32_16( L_tmp, tmp ), sub( exp, 14 ), &Overflow ); /* Q(16+29-exp+1-16+exp-14)->Q16 */ -#else - L_tmp = L_shl( Mult_32_16( L_tmp, tmp ), sub( exp, 14 ) ); /* Q(16+29-exp+1-16+exp-14)->Q16 */ -#endif frac = L_Extract_lc( L_tmp, &exp ); /* Extract exponent of L_tmp */ tmp = extract_l( Pow2( 14, frac ) ); -#ifdef BASOP_NOGLOB scale_step = shl_o( tmp, exp, &Overflow ); /* Q14 */ -#else - scale_step = shl( tmp, exp ); /* Q14 */ -#endif } } @@ -6108,11 +5873,7 @@ void non_linearity_fx( { exp = norm_s( max_val ); tmp = div_s( shl( 1, sub( 14, exp ) ), max_val ); /* Q(29-exp-Q_inp) */ -#ifdef BASOP_NOGLOB scale = L_shl_o( L_mult( 21955 /* 0.67 in Q15 */, tmp ), add( exp, sub( Q_inp, 14 ) ), &Overflow ); /* Q31 */ -#else - scale = L_shl( L_mult( 21955, tmp ), add( exp, sub( Q_inp, 14 ) ) ); /* Q31 */ -#endif } ELSE { @@ -6161,20 +5922,12 @@ void non_linearity_fx( tmp = div_s( shl( 1, sub( 14, exp ) ), tmp ); /* Q(29-exp) */ /* (log2(scale / prev_scale))/length */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( Mult_32_16( L_tmp, tmp ), sub( exp, 14 ), &Overflow ); /*Q(16+29-exp+1-16+exp-14)->Q16 */ -#else - L_tmp = L_shl( Mult_32_16( L_tmp, tmp ), sub( exp, 14 ) ); /*Q(16+29-exp+1-16+exp-14)->Q16 */ -#endif frac = L_Extract_lc( L_tmp, &exp ); /* Extract exponent of L_tmp */ tmp = extract_l( Pow2( 14, frac ) ); -#ifdef BASOP_NOGLOB scale_step = shl_o( tmp, exp, &Overflow ); /*Q14 */ -#else - scale_step = shl( tmp, exp ); /*Q14 */ -#endif } } @@ -6343,20 +6096,12 @@ void non_linearity_ivas_fx( tmp = div_s( shl( 1, sub( 14, exp ) ), j ); /* Q(29-exp) */ /* (log2(scale / prev_scale))/length */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( Mult_32_16( L_tmp, tmp ), sub( exp, 14 ), &Overflow ); /* Q(16+29-exp+1-16+exp-14)->Q16 */ -#else - L_tmp = L_shl( Mult_32_16( L_tmp, tmp ), sub( exp, 14 ) ); /* Q(16+29-exp+1-16+exp-14)->Q16 */ -#endif frac = L_Extract_lc( L_tmp, &exp ); /* Extract exponent of L_tmp */ tmp = extract_l( Pow2( 14, frac ) ); -#ifdef BASOP_NOGLOB scale_step = shl_o( tmp, exp, &Overflow ); /* Q14 */ -#else - scale_step = shl( tmp, exp ); /* Q14 */ -#endif } } @@ -6380,11 +6125,7 @@ void non_linearity_ivas_fx( { exp = norm_s( max_val ); tmp = div_s( shl( 1, sub( 14, exp ) ), max_val ); /* Q(29-exp-Q_inp) */ -#ifdef BASOP_NOGLOB scale = L_shl_o( L_mult( 21955, tmp ), add( exp, sub( Q_inp, 14 ) ), &Overflow ); /* Q31 */ -#else - scale = L_shl( L_mult( 21955, tmp ), add( exp, sub( Q_inp, 14 ) ) ); /* Q31 */ -#endif } ELSE { @@ -6433,20 +6174,12 @@ void non_linearity_ivas_fx( tmp = div_s( shl( 1, sub( 14, exp ) ), tmp ); /* Q(29-exp) */ /* (log2(scale / prev_scale))/length */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( Mult_32_16( L_tmp, tmp ), sub( exp, 14 ), &Overflow ); /*Q(16+29-exp+1-16+exp-14)->Q16 */ -#else - L_tmp = L_shl( Mult_32_16( L_tmp, tmp ), sub( exp, 14 ) ); /*Q(16+29-exp+1-16+exp-14)->Q16 */ -#endif frac = L_Extract_lc( L_tmp, &exp ); /* Extract exponent of L_tmp */ tmp = extract_l( Pow2( 14, frac ) ); -#ifdef BASOP_NOGLOB scale_step = shl_o( tmp, exp, &Overflow ); /*Q14 */ -#else - scale_step = shl( tmp, exp ); /*Q14 */ -#endif } } @@ -6724,7 +6457,6 @@ void elliptic_bpf_48k_generic_fx( FOR( i = 0; i < 4; i++ ) { memory_fx0[0][i] = extract_l( memory_fx2[0][i] ); -#ifdef BASOP_NOGLOB memory_fx[0][i] = shl_sat( memory_fx0[0][i], sub( *Q_input_fx, memory_fx_Q[0] ) ); memory2_fx[1][i] = L_shl_sat( memory_fx2[1][i], sub( add( *Q_input_fx, 11 ), memory_fx_Q[1] ) ); memory2_fx[2][i] = L_shl_sat( memory_fx2[2][i], sub( add( *Q_input_fx, 6 ), memory_fx_Q[2] ) ); @@ -6734,12 +6466,6 @@ void elliptic_bpf_48k_generic_fx( move32(); move32(); move32(); -#else - memory_fx[0][i] = shl( memory_fx0[0][i], sub( *Q_input_fx, memory_fx_Q[0] ) ); - memory2_fx[1][i] = L_shl( memory_fx2[1][i], sub( add( *Q_input_fx, 11 ), memory_fx_Q[1] ) ); - memory2_fx[2][i] = L_shl( memory_fx2[2][i], sub( add( *Q_input_fx, 6 ), memory_fx_Q[2] ) ); - memory2_fx[3][i] = L_shl( memory_fx2[3][i], sub( add( *Q_input_fx, 1 ), memory_fx_Q[3] ) ); -#endif } L_tmpX = L_shr( L_mult( memory_fx[0][0], full_band_bpf_fx[0][4] ), 3 ); /*Q_input_fx + 13 + 1 - 3*/ @@ -6747,78 +6473,45 @@ void elliptic_bpf_48k_generic_fx( L_tmpX = L_add( L_shr( L_mult( memory_fx[0][2], full_band_bpf_fx[0][2] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ L_tmpX = L_add( L_shr( L_mult( memory_fx[0][3], full_band_bpf_fx[0][1] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ L_tmpX = L_add( L_shr( L_mult( input_fx[0], full_band_bpf_fx[0][0] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ -#ifdef BASOP_NOGLOB L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][1], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmp[0] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][0], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ move32(); -#else - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx[1][1], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmp[0] = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx[1][0], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - move32(); -#endif L_tmpX = L_shr( L_mult( memory_fx[0][1], full_band_bpf_fx[0][4] ), 3 ); /*Q_input_fx + 13 + 1 - 3*/ L_tmpX = L_add( L_shr( L_mult( memory_fx[0][2], full_band_bpf_fx[0][3] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ L_tmpX = L_add( L_shr( L_mult( memory_fx[0][3], full_band_bpf_fx[0][2] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ L_tmpX = L_add( L_shr( L_mult( input_fx[0], full_band_bpf_fx[0][1] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ L_tmpX = L_add( L_shr( L_mult( input_fx[1], full_band_bpf_fx[0][0] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ -#ifdef BASOP_NOGLOB L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[0], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmp[1] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][1], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ move32(); -#else - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_tmp[0], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmp[1] = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx[1][1], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - move32(); -#endif L_tmpX = L_shr( L_mult( memory_fx[0][2], full_band_bpf_fx[0][4] ), 3 ); /*Q_input_fx + 13 + 1 - 3*/ L_tmpX = L_add( L_shr( L_mult( memory_fx[0][3], full_band_bpf_fx[0][3] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ L_tmpX = L_add( L_shr( L_mult( input_fx[0], full_band_bpf_fx[0][2] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ L_tmpX = L_add( L_shr( L_mult( input_fx[1], full_band_bpf_fx[0][1] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ L_tmpX = L_add( L_shr( L_mult( input_fx[2], full_band_bpf_fx[0][0] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ -#ifdef BASOP_NOGLOB L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[1], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[0], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmp[2] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ move32(); -#else - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_tmp[1], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_tmp[0], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmp[2] = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - move32(); -#endif L_tmpX = L_shr( L_mult( memory_fx[0][3], full_band_bpf_fx[0][4] ), 3 ); /*Q_input_fx + 13 + 1 - 3*/ L_tmpX = L_add( L_shr( L_mult( input_fx[0], full_band_bpf_fx[0][3] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ L_tmpX = L_add( L_shr( L_mult( input_fx[1], full_band_bpf_fx[0][2] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ L_tmpX = L_add( L_shr( L_mult( input_fx[2], full_band_bpf_fx[0][1] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ L_tmpX = L_add( L_shr( L_mult( input_fx[3], full_band_bpf_fx[0][0] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ -#ifdef BASOP_NOGLOB L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[2], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[1], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[0], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmp[3] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ move32(); -#else - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_tmp[2], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_tmp[1], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_tmp[0], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmp[3] = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - move32(); -#endif FOR( i = 4; i < L_FRAME48k; i++ ) { -#ifdef BASOP_NOGLOB L_tmpX = L_shr( L_mult( input_fx[i - 4], full_band_bpf_fx[0][4] ), 3 ); /*Q_input_fx + 13 + 1 - 3*/ L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i - 3], full_band_bpf_fx[0][3] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 1], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ @@ -6829,18 +6522,6 @@ void elliptic_bpf_48k_generic_fx( L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i], full_band_bpf_fx[0][0] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ L_tmp[i] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 4], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ move32(); -#else - L_tmpX = L_shr( L_mult( input_fx [[i - 4]], full_band_bpf_fx[0][4] ), 3 ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[i - 3], full_band_bpf_fx[0][3] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_tmp[i - 1], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[i - 2], full_band_bpf_fx[0][2] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_tmp[i - 2], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[i - 1], full_band_bpf_fx[0][1] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_tmp[i - 3], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[i], full_band_bpf_fx[0][0] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmp[i] = L_sub( L_tmpX, L_shl( Mult_32_16( L_tmp[i - 4], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - move32(); -#endif } memory_fx2[0][0] = input_fx[L_FRAME48k - 4]; @@ -6857,84 +6538,47 @@ void elliptic_bpf_48k_generic_fx( L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[1][2] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[1][1] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[0], full_band_bpf_fx[1][0] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ -#ifdef BASOP_NOGLOB L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][3], full_band_bpf_fx[4][1] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][2], full_band_bpf_fx[4][2] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][1], full_band_bpf_fx[4][3] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2*/ L_tmp2[0] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][0], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2*/ move32(); L_tmpMax = L_abs( L_tmp2[0] ); -#else - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx[2][3], full_band_bpf_fx[4][1] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx[2][2], full_band_bpf_fx[4][2] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx[2][1], full_band_bpf_fx[4][3] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2*/ - L_tmp2[0] = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx[2][0], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2*/ - move32(); - L_tmpMax = L_abs( L_tmp2[0] ); -#endif L_tmpX = L_shr( Mult_32_16( memory2_fx[1][1], full_band_bpf_fx[1][4] ), 3 ); /*Q_input_fx + 11 + 13 - 15 -3*/ L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[1][3] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[1][2] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[0], full_band_bpf_fx[1][1] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[1], full_band_bpf_fx[1][0] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ -#ifdef BASOP_NOGLOB L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[0], full_band_bpf_fx[4][1] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][3], full_band_bpf_fx[4][2] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][2], full_band_bpf_fx[4][3] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ L_tmp2[1] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][1], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ move32(); L_tmpMax = L_max( L_tmpMax, L_abs( L_tmp2[1] ) ); -#else - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_tmp2[0], full_band_bpf_fx[4][1] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx[2][3], full_band_bpf_fx[4][2] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx[2][2], full_band_bpf_fx[4][3] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmp2[1] = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx[2][1], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - move32(); - L_tmpMax = L_max( L_tmpMax, L_abs( L_tmp2[1] ) ); -#endif L_tmpX = L_shr( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[1][4] ), 3 ); /*Q_input_fx + 11 + 13 - 15 -3*/ L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[1][3] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[0], full_band_bpf_fx[1][2] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[1], full_band_bpf_fx[1][1] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[2], full_band_bpf_fx[1][0] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ -#ifdef BASOP_NOGLOB L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[1], full_band_bpf_fx[4][1] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[0], full_band_bpf_fx[4][2] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][3], full_band_bpf_fx[4][3] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ L_tmp2[2] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][2], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ move32(); L_tmpMax = L_max( L_tmpMax, L_abs( L_tmp2[2] ) ); -#else - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_tmp2[1], full_band_bpf_fx[4][1] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_tmp2[0], full_band_bpf_fx[4][2] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx[2][3], full_band_bpf_fx[4][3] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmp2[2] = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx[2][2], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - move32(); - L_tmpMax = L_max( L_tmpMax, L_abs( L_tmp2[2] ) ); -#endif L_tmpX = L_shr( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[1][4] ), 3 ); /*Q_input_fx + 11 + 13 - 15 -3*/ L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[0], full_band_bpf_fx[1][3] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[1], full_band_bpf_fx[1][2] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[2], full_band_bpf_fx[1][1] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[3], full_band_bpf_fx[1][0] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ -#ifdef BASOP_NOGLOB L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[2], full_band_bpf_fx[4][1] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[1], full_band_bpf_fx[4][2] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[0], full_band_bpf_fx[4][3] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ L_tmp2[3] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][3], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ /*14 + Q_input_fx - shift_flag*/ move32(); L_tmpMax = L_max( L_tmpMax, L_abs( L_tmp2[3] ) ); -#else - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_tmp2[2], full_band_bpf_fx[4][1] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_tmp2[1], full_band_bpf_fx[4][2] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_tmp2[0], full_band_bpf_fx[4][3] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmp2[3] = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx[2][3], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ /*14 + Q_input_fx - shift_flag*/ - move32(); - L_tmpMax = L_max( L_tmpMax, L_abs( L_tmp2[3] ) ); -#endif FOR( i = 4; i < L_FRAME48k; i++ ) { -#ifdef BASOP_NOGLOB L_tmpX = L_shr( Mult_32_16( L_tmp[i - 4], full_band_bpf_fx[1][4] ), 3 ); /*Q_input_fx + 11 + 13 - 15 -3*/ L_tmpX = L_add_sat( L_shr( Mult_32_16( L_tmp[i - 3], full_band_bpf_fx[1][3] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[i - 1], full_band_bpf_fx[4][1] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ @@ -6945,18 +6589,6 @@ void elliptic_bpf_48k_generic_fx( L_tmpX = L_add_sat( L_shr( Mult_32_16( L_tmp[i], full_band_bpf_fx[1][0] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ L_tmp2[i] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[i - 4], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ move32(); -#else - L_tmpX = L_shr( Mult_32_16( L_tmp[i - 4], full_band_bpf_fx[1][4] ), 3 ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[i - 3], full_band_bpf_fx[1][3] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_tmp2[i - 1], full_band_bpf_fx[4][1] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[i - 2], full_band_bpf_fx[1][2] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_tmp2[i - 2], full_band_bpf_fx[4][2] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[i - 1], full_band_bpf_fx[1][1] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_tmp2[i - 3], full_band_bpf_fx[4][3] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[i], full_band_bpf_fx[1][0] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmp2[i] = L_sub( L_tmpX, L_shl( Mult_32_16( L_tmp2[i - 4], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - move32(); -#endif L_tmpMax = L_max( L_tmpMax, L_abs( L_tmp2[i] ) ); } @@ -6975,18 +6607,12 @@ void elliptic_bpf_48k_generic_fx( move32(); FOR( j = 0; j < 4; j++ ) { -#ifdef BASOP_NOGLOB memory2_fx_2[j] = L_shl_sat( memory_fx2[2][j], sub( add( add( *Q_input_fx, 6 ), Q_temp ), memory_fx_Q[2] ) ); memory2_fx_3[j] = L_shl_sat( memory_fx2[3][j], sub( add( add( *Q_input_fx, 1 ), Q_temp ), memory_fx_Q[3] ) ); -#else - memory2_fx_2[j] = L_shl( memory_fx2[2][j], sub( add( add( *Q_input_fx, 6 ), Q_temp ), memory_fx_Q[2] ) ); - memory2_fx_3[j] = L_shl( memory_fx2[3][j], sub( add( add( *Q_input_fx, 1 ), Q_temp ), memory_fx_Q[3] ) ); -#endif move32(); move32(); move32(); } -#ifdef BASOP_NOGLOB L_tmpX = L_shr( Mult_32_16( memory2_fx_2[0], full_band_bpf_fx[2][4] ), 3 ); /* *Q_input_fx+6 +Q_temp +13 -15 -3 */ L_tmpX = L_add_sat( L_shr( Mult_32_16( memory2_fx_2[1], full_band_bpf_fx[2][3] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp+13 -15 -3*/ L_tmpX = L_add_sat( L_shr( Mult_32_16( memory2_fx_2[2], full_band_bpf_fx[2][2] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp+13 -15 -3*/ @@ -7052,73 +6678,6 @@ void elliptic_bpf_48k_generic_fx( move32(); L_tmpMax = L_max( L_tmpMax, L_abs( L_output[i] ) ); } -#else - L_tmpX = L_shr( Mult_32_16( memory2_fx_2[0], full_band_bpf_fx[2][4] ), 3 ); /* *Q_input_fx+6 +Q_temp +13 -15 -3 */ - L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx_2[1], full_band_bpf_fx[2][3] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp+13 -15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx_2[2], full_band_bpf_fx[2][2] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp+13 -15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx_2[3], full_band_bpf_fx[2][1] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp+13 -15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp2[0], full_band_bpf_fx[2][0] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp+13 -15 -3*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx_3[3], full_band_bpf_fx[5][1] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2 */ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx_3[2], full_band_bpf_fx[5][2] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2 */ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx_3[1], full_band_bpf_fx[5][3] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2 */ - L_output[0] = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx_3[0], full_band_bpf_fx[5][4] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2 */ - move32(); - L_tmpMax = L_abs( L_output[0] ); - - L_tmpX = L_shr( Mult_32_16( memory2_fx_2[1], full_band_bpf_fx[2][4] ), 3 ); /*Q_input_fx + 6 +Q_temp +13 -15 -3 */ - L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx_2[2], full_band_bpf_fx[2][3] ), 3 ), L_tmpX ); /*Q_input_fx +Q_temp+ 6 +13 -15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx_2[3], full_band_bpf_fx[2][2] ), 3 ), L_tmpX ); /*Q_input_fx +Q_temp+ 6 +13 -15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp2[0], full_band_bpf_fx[2][1] ), 3 ), L_tmpX ); /*Q_input_fx +Q_temp+ 6 +13 -15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp2[1], full_band_bpf_fx[2][0] ), 3 ), L_tmpX ); /*Q_input_fx+Q_temp + 6 +13 -15 -3*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_output[0], full_band_bpf_fx[5][1] ), 2 ) ); /*Q_input_fx + 1 +13 -15 + 2+Q_temp*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx_3[3], full_band_bpf_fx[5][2] ), 2 ) ); /*Q_input_fx + 1 +13 -15 + 2+Q_temp*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx_3[2], full_band_bpf_fx[5][3] ), 2 ) ); /*Q_input_fx + 1 +13 -15 + 2+Q_temp*/ - L_output[1] = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx_3[1], full_band_bpf_fx[5][4] ), 2 ) ); /*Q_input_fx + 1 +13 -15 + 2+Q_temp*/ - move32(); - L_tmpMax = L_max( L_tmpMax, L_abs( L_output[1] ) ); - - L_tmpX = L_shr( Mult_32_16( memory2_fx_2[2], full_band_bpf_fx[2][4] ), 3 ); /*Q_input_fx + 6 +Q_temp+13 -15 -3 */ - L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx_2[3], full_band_bpf_fx[2][3] ), 3 ), L_tmpX ); /*Q_input_fx +Q_temp+ 6 +13 -15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp2[0], full_band_bpf_fx[2][2] ), 3 ), L_tmpX ); /*Q_input_fx +Q_temp+ 6 +13 -15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp2[1], full_band_bpf_fx[2][1] ), 3 ), L_tmpX ); /*Q_input_fx +Q_temp + 6 +13 -15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp2[2], full_band_bpf_fx[2][0] ), 3 ), L_tmpX ); /*Q_input_fx +Q_temp + 6 +13 -15 -3*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_output[1], full_band_bpf_fx[5][1] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_output[0], full_band_bpf_fx[5][2] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx_3[3], full_band_bpf_fx[5][3] ), 2 ) ); /*Q_input_fx + 1+Q_temp +13 -15 + 2*/ - L_output[2] = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx_3[2], full_band_bpf_fx[5][4] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - move32(); - L_tmpMax = L_max( L_tmpMax, L_abs( L_output[2] ) ); - - L_tmpX = L_shr( Mult_32_16( memory2_fx_2[3], full_band_bpf_fx[2][4] ), 3 ); /*Q_input_fx + 6 +Q_temp +13 -15 -3 */ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp2[0], full_band_bpf_fx[2][3] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp+13 -15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp2[1], full_band_bpf_fx[2][2] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp+13 -15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp2[2], full_band_bpf_fx[2][1] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp+13 -15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp2[3], full_band_bpf_fx[2][0] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp+13 -15 -3*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_output[2], full_band_bpf_fx[5][1] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_output[1], full_band_bpf_fx[5][2] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_output[0], full_band_bpf_fx[5][3] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - L_output[3] = L_sub( L_tmpX, L_shl( Mult_32_16( memory2_fx_3[3], full_band_bpf_fx[5][4] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - move32(); - L_tmpMax = L_max( L_tmpMax, L_abs( L_output[3] ) ); - - FOR( i = 4; i < L_FRAME48k; i++ ) - { - L_tmpX = L_shr( Mult_32_16( L_tmp2[i - 4], full_band_bpf_fx[2][4] ), 3 ); /*Q_input_fx + 6 +Q_temp+13 -15 -3 */ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp2[i - 3], full_band_bpf_fx[2][3] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp +13 -15 -3*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_output[i - 1], full_band_bpf_fx[5][1] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp2[i - 2], full_band_bpf_fx[2][2] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp+13 -15 -3*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_output[i - 2], full_band_bpf_fx[5][2] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp2[i - 1], full_band_bpf_fx[2][1] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp +13 -15 -3*/ - L_tmpX = L_sub( L_tmpX, L_shl( Mult_32_16( L_output[i - 3], full_band_bpf_fx[5][3] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp2[i], full_band_bpf_fx[2][0] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp +13 -15 -3*/ - L_output[i] = L_sub( L_tmpX, L_shl( Mult_32_16( L_output[i - 4], full_band_bpf_fx[5][4] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - move32(); - L_tmpMax = L_max( L_tmpMax, L_abs( L_output[i] ) ); - } -#endif memory_fx2[2][0] = L_tmp2[L_FRAME48k - 4]; memory_fx2[2][1] = L_tmp2[L_FRAME48k - 3]; memory_fx2[2][2] = L_tmp2[L_FRAME48k - 2]; @@ -7264,21 +6823,13 @@ void synthesise_fb_high_band_fx( L_tmp = Mult_32_16( ratio2, tmp[i] ); /* Q(16-exp+exp_tmp-15 = 1-exp+exp_tmp) */ IF( L_tmp < 0 ) { -#ifdef BASOP_NOGLOB output[i] = negate( extract_h( L_shl_sat( L_negate( L_tmp ), tmp3 ) ) ); /*Qout*/ move16(); -#else - output[i] = negate( extract_h( L_shl( L_negate( L_tmp ), tmp3 ) ) ); /*Qout*/ -#endif } ELSE { -#ifdef BASOP_NOGLOB output[i] = extract_h( L_shl_sat( L_tmp, tmp3 ) ); /*Qout*/ move16(); -#else - output[i] = extract_h( L_shl( L_tmp, tmp3 ) ); /*Qout*/ -#endif } } return; @@ -7347,20 +6898,12 @@ void Estimate_mix_factors_fx( shb_res_local[i] = round_fx( L_tmp2 ); move16(); /* temp_numer1[i] = sub(shb_res_local[i], WN_exc_local[i]); */ -#ifdef BASOP_NOGLOB temp_numer1[i] = round_fx_sat( L_sub_sat( L_shl_sat( L_tmp2, sc2 ), L_shl_sat( L_tmp1, sc1 ) ) ); -#else - temp_numer1[i] = round_fx( L_sub( L_shl( L_tmp2, sc2 ), L_shl( L_tmp1, sc1 ) ) ); -#endif move16(); /* (Q_bwe_exc) */ /* temp_numer2[i] = sub(exc16kWhtnd[i], WN_exc_local[i]); */ -#ifdef BASOP_NOGLOB temp_numer2[i] = sub_sat( exc16kWhtnd[i], round_fx_sat( L_shl_sat( L_tmp1, sc1 ) ) ); -#else - temp_numer2[i] = sub( exc16kWhtnd[i], round_fx( L_shl( L_tmp1, sc1 ) ) ); -#endif move16(); /* (Q_bwe_exc) */ } @@ -7380,11 +6923,7 @@ void Estimate_mix_factors_fx( expa = sub( 30, expa ); expb = norm_l( temp_p1_p2 ); -#ifdef BASOP_NOGLOB fracb = round_fx_o( L_shl_o( temp_p1_p2, expb, &Overflow ), &Overflow ); -#else - fracb = round_fx( L_shl( temp_p1_p2, expb ) ); -#endif expb = sub( 30, expb ); num_flag = 0; @@ -7411,11 +6950,7 @@ void Estimate_mix_factors_fx( tmp = div_s( fracb, fraca ); exp1 = sub( expb, expa ); -#ifdef BASOP_NOGLOB tmp = shl_sat( tmp, exp1 ); -#else - tmp = shl( tmp, exp1 ); -#endif if ( NE_16( num_flag, den_flag ) ) { tmp = negate( tmp ); @@ -7586,11 +7121,7 @@ void prep_tbe_exc_fx( tmp = MAX_16; move16(); -#ifdef BASOP_NOGLOB pitch = shl_o( add( shl_o( T0, 2, &Overflow ), T0_frac ), 5, &Overflow ); /* Q7 */ -#else /* BASOP_NOGLOB */ - pitch = shl( add( shl( T0, 2 ), T0_frac ), 5 ); /* Q7 */ -#endif /* BASOP_NOGLOB */ test(); test(); @@ -7618,28 +7149,14 @@ void prep_tbe_exc_fx( IF( EQ_16( L_frame_fx, L_FRAME ) ) { interp_code_5over2_fx( code_fx, tmp_code_fx, L_subfr ); /* code: Q9, tmp_code: Q9 */ -#ifdef BASOP_NOGLOB gain_code16 = round_fx_o( L_shl_o( gain_code_fx, Q_exc, &Overflow ), &Overflow ); /*Q_exc */ -#else - gain_code16 = round_fx( L_shl( gain_code_fx, Q_exc ) ); /*Q_exc */ -#endif FOR( i = 0; i < L_subfr * HIBND_ACB_L_FAC; i++ ) { L_tmp = L_mult( gain_code16, tmp_code_fx[i] ); /* Q9 + Q_exc + 1*/ -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, 5 ); /* Q9 + Q_exc + Q6*/ L_tmp = L_mac_sat( L_tmp, gain_pit_fx, bwe_exc_fx[i + i_subfr_fx * HIBND_ACB_L_FAC] ); /*Q15+Q_exc */ -#else - L_tmp = L_shl( L_tmp, 5 ); /* Q9 + Q_exc + Q6*/ - L_tmp = L_mac( L_tmp, gain_pit_fx, bwe_exc_fx[i + i_subfr_fx * HIBND_ACB_L_FAC] ); /*Q15+Q_exc */ -#endif -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( L_tmp, 1, &Overflow ); /*16+Q_exc */ /* saturation can occur here */ bwe_exc_fx[i + i_subfr_fx * HIBND_ACB_L_FAC] = round_fx_o( L_tmp, &Overflow ); /*Q_exc */ -#else /* BASOP_NOGLOB */ - L_tmp = L_shl( L_tmp, 1 ); /*16+Q_exc */ /* saturation can occur here */ - bwe_exc_fx[i + i_subfr_fx * HIBND_ACB_L_FAC] = round_fx( L_tmp ); /*Q_exc */ -#endif /* BASOP_NOGLOB */ move16(); } } @@ -7653,18 +7170,11 @@ void prep_tbe_exc_fx( Ltemp1 = Mult_32_16( gain_code_fx, code_fx[i] ); /* Q16 + Q9 + 1 - 16 = Q10 */ Ltemp2 = L_mult( gain_preQ_fx, code_preQ_fx[i] ); /*Q2 * Q10 -> Q12 */ -#ifdef BASOP_NOGLOB Ltemp1 = L_shl_o( Ltemp1, add( Q_exc, 6 ) /*Q_exc+16-19*/, &Overflow ); /*Q_exc+16 */ Ltemp2 = L_shl_o( Ltemp2, add( Q_exc, 4 ) /*Q_exc+16-13*/, &Overflow ); /*Q_exc+16 */ tmp_code_preInt_fx[i] = round_fx_o( L_add_o( Ltemp1, Ltemp2, &Overflow ), &Overflow ); /* Q_exc */ move16(); -#else /* BASOP_NOGLOB */ - Ltemp1 = L_shl( Ltemp1, Q_exc + 6 /*Q_exc+16-19*/ ); /*Q_exc+16 */ - Ltemp2 = L_shl( Ltemp2, Q_exc + 4 /*Q_exc+16-13*/ ); /*Q_exc+16 */ - - tmp_code_preInt_fx[i] = round_fx( L_add( Ltemp1, Ltemp2 ) ); /* Q_exc */ -#endif /* BASOP_NOGLOB */ } } ELSE @@ -7673,14 +7183,9 @@ void prep_tbe_exc_fx( { /*code in the encoder is Q9 and there is no <<1 with Mult_32_16 Q16 * Q9 -> Q9 */ Ltemp1 = Mult_32_16( gain_code_fx, code_fx[i] ); /* Q16 + Q9 + 1 - 16 = Q10 */ -#ifdef BASOP_NOGLOB Ltemp1 = L_shl_o( Ltemp1, add( Q_exc, 6 ) /*Q_exc+16-19*/, &Overflow ); /*Q_exc+16 */ tmp_code_preInt_fx[i] = round_fx_o( Ltemp1, &Overflow ); /* Q_exc */ move16(); -#else - Ltemp1 = L_shl( Ltemp1, Q_exc + 6 /*Q_exc+16-19*/ ); /*Q_exc+16 */ - tmp_code_preInt_fx[i] = round_fx( Ltemp1 ); /* Q_exc */ -#endif } } @@ -7688,15 +7193,9 @@ void prep_tbe_exc_fx( FOR( i = 0; i < L_subfr * 2; i++ ) { L_tmp = L_mult( gain_pit_fx, bwe_exc_fx[i + i_subfr_fx * 2] ); /*Q14+Q_exc+1 */ -#ifdef BASOP_NOGLOB tmp = round_fx_o( L_shl_o( L_tmp, 1 /* (Q_exc+16)-(14+Q_exc+1)*/, &Overflow ), &Overflow ); /* tmp in Q_exc */ bwe_exc_fx[i + i_subfr_fx * 2] = add_o( tmp, tmp_code_fx[i], &Overflow ); /*Q_exc */ move16(); -#else /* BASOP_NOGLOB */ - tmp = round_fx( L_shl( L_tmp, 1 /* (Q_exc+16)-(14+Q_exc+1)*/ ) ); /* tmp in Q_exc */ - bwe_exc_fx[i + i_subfr_fx * 2] = add( tmp, tmp_code_fx[i] ); /*Q_exc */ - move16(); -#endif } } @@ -7788,11 +7287,7 @@ void prep_tbe_exc_ivas_fx( tmp = MAX_16; move16(); -#ifdef BASOP_NOGLOB pitch = shl_o( add( shl_o( T0, 2, &Overflow ), T0_frac ), 5, &Overflow ); /* Q7 */ -#else /* BASOP_NOGLOB */ - pitch = shl( add( shl( T0, 2 ), T0_frac ), 5 ); /* Q7 */ -#endif /* BASOP_NOGLOB */ test(); test(); @@ -7823,24 +7318,14 @@ void prep_tbe_exc_ivas_fx( IF( EQ_16( L_frame_fx, L_FRAME ) ) { interp_code_5over2_fx( code_fx, tmp_code_fx, L_subfr ); /* code: Q9, tmp_code: Q9 */ -#ifdef BASOP_NOGLOB gain_code16 = round_fx_o( L_shl_o( gain_code_fx, Q_exc, &Overflow ), &Overflow ); /*Q_exc */ -#else - gain_code16 = round_fx( L_shl( gain_code_fx, Q_exc ) ); /*Q_exc */ -#endif FOR( i = 0; i < L_subfr * HIBND_ACB_L_FAC; i++ ) { L_tmp = L_mult( gain_code16, tmp_code_fx[i] ); /* Q9 + Q_exc + 1*/ L_tmp = L_shl( L_tmp, 5 ); /* Q9 + Q_exc + Q6*/ -#ifdef BASOP_NOGLOB L_tmp = L_mac_o( L_tmp, gain_pit_fx, bwe_exc_fx[i + i_subfr_fx * HIBND_ACB_L_FAC], &Overflow ); /*Q15+Q_exc */ L_tmp = L_shl_o( L_tmp, 1, &Overflow ); /*16+Q_exc */ /* saturation can occur here */ bwe_exc_fx[i + i_subfr_fx * HIBND_ACB_L_FAC] = round_fx_o( L_tmp, &Overflow ); /*Q_exc */ -#else /* BASOP_NOGLOB */ - L_tmp = L_mac( L_tmp, gain_pit_fx, bwe_exc_fx[i + i_subfr_fx * HIBND_ACB_L_FAC] ); /*Q15+Q_exc */ - L_tmp = L_shl( L_tmp, 1 ); /*16+Q_exc */ /* saturation can occur here */ - bwe_exc_fx[i + i_subfr_fx * HIBND_ACB_L_FAC] = round_fx( L_tmp ); /*Q_exc */ -#endif /* BASOP_NOGLOB */ move16(); } } @@ -7856,17 +7341,10 @@ void prep_tbe_exc_ivas_fx( Ltemp1 = Mult_32_16( gain_code_fx, code_fx[i] ); /* Q16 + Q9 + 1 - 16 = Q10 */ Ltemp2 = L_mult( gain_preQ_fx, code_preQ_fx[i] ); /*Q2 * Q10 -> Q12 */ -#ifdef BASOP_NOGLOB Ltemp1 = L_shl_o( Ltemp1, add( Q_exc, 6 ) /*Q_exc+16-19*/, &Overflow ); /*Q_exc+16 */ Ltemp2 = L_shl_o( Ltemp2, add( Q_exc, shift ) /*Q_exc+ 2 + 6 (or) 10 - 13*/, &Overflow ); /*Q_exc+16 */ tmp_code_preInt_fx[i] = round_fx_o( L_add_o( Ltemp1, Ltemp2, &Overflow ), &Overflow ); /* Q_exc */ -#else /* BASOP_NOGLOB */ - Ltemp1 = L_shl( Ltemp1, Q_exc + 6 /*Q_exc+16-19*/ ); /*Q_exc+16 */ - Ltemp2 = L_shl( Ltemp2, Q_exc + 4 /*Q_exc+16-13*/ ); /*Q_exc+16 */ - - tmp_code_preInt_fx[i] = round_fx( L_add( Ltemp1, Ltemp2 ) ); /* Q_exc */ -#endif /* BASOP_NOGLOB */ move16(); } } @@ -7876,13 +7354,8 @@ void prep_tbe_exc_ivas_fx( { /*code in the encoder is Q9 and there is no <<1 with Mult_32_16 Q16 * Q9 -> Q9 */ Ltemp1 = Mult_32_16( gain_code_fx, code_fx[i] ); /* Q16 + Q9 + 1 - 16 = Q10 */ -#ifdef BASOP_NOGLOB Ltemp1 = L_shl_o( Ltemp1, add( Q_exc, 6 ) /*Q_exc+16-19*/, &Overflow ); /*Q_exc+16 */ tmp_code_preInt_fx[i] = round_fx_o( Ltemp1, &Overflow ); /* Q_exc */ -#else - Ltemp1 = L_shl( Ltemp1, Q_exc + 6 /*Q_exc+16-19*/ ); /*Q_exc+16 */ - tmp_code_preInt_fx[i] = round_fx( Ltemp1 ); /* Q_exc */ -#endif move16(); } } @@ -7891,15 +7364,9 @@ void prep_tbe_exc_ivas_fx( FOR( i = 0; i < shl( L_subfr, 1 ); i++ ) { L_tmp = L_mult( gain_pit_fx, bwe_exc_fx[i + shl( i_subfr_fx, 1 )] ); /*Q14+Q_exc+1 */ -#ifdef BASOP_NOGLOB tmp = round_fx_o( L_shl_o( L_tmp, 1 /* (Q_exc+16)-(14+Q_exc+1)*/, &Overflow ), &Overflow ); /* tmp in Q_exc */ bwe_exc_fx[i + shl( i_subfr_fx, 1 )] = add_o( tmp, tmp_code_fx[i], &Overflow ); /*Q_exc */ move16(); -#else /* BASOP_NOGLOB */ - tmp = round_fx( L_shl( L_tmp, 1 /* (Q_exc+16)-(14+Q_exc+1)*/ ) ); /* tmp in Q_exc */ - bwe_exc_fx[i + i_subfr_fx * 2] = add( tmp, tmp_code_fx[i] ); /*Q_exc */ - move16(); -#endif } } @@ -7962,11 +7429,7 @@ Word16 swb_formant_fac_fx( /* o : Formant filter strength /* formant_fac = 1.0f - 0.5f*formant_fac */ tmp = mult_r( 16384, formant_fac ); /* 0.5 in Q15 */ -#ifdef BASOP_NOGLOB formant_fac = shl_o( sub( 4096 /* 1 in Q12 */, tmp ), 3, &Overflow ); -#else - formant_fac = shl( sub( 4096, tmp ), 3 ); -#endif return formant_fac; /*Q15 */ } diff --git a/lib_com/syn_filt_fx.c b/lib_com/syn_filt_fx.c index 082ccb4c8..169ca5767 100644 --- a/lib_com/syn_filt_fx.c +++ b/lib_com/syn_filt_fx.c @@ -14,13 +14,8 @@ static Word32 syn_kern_2( Word32 L_tmp, const Word16 a[], const Word16 y[] ) #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif -#ifdef BASOP_NOGLOB L_tmp = L_msu_o( L_tmp, y[-1], a[1], &Overflow ); return L_msu_o( L_tmp, y[-2], a[2], &Overflow ); -#else - L_tmp = L_msu( L_tmp, y[-1], a[1] ); - return L_msu( L_tmp, y[-2], a[2] ); -#endif } static Word32 syn_kern_4( Word32 L_tmp, const Word16 a[], const Word16 y[] ) @@ -135,33 +130,19 @@ void syn_filt_s_lc_fx( /* Stop at i to Avoid Mults with Zeros */ FOR( j = 1; j <= i; j++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_msu_sat( L_tmp, y[-j], a[j] ); -#else - L_tmp = L_msu( L_tmp, y[-j], a[j] ); -#endif } -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, q ); *y++ = round_fx_sat( L_tmp ); -#else - L_tmp = L_shl( L_tmp, q ); - *y++ = round_fx( L_tmp ); -#endif move16(); } FOR( ; i < lg; i++ ) { L_tmp = syn_kern_16( L_mult( *x++, a0 ), a, y ); -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, q ); *y++ = round_fx_sat( L_tmp ); -#else - L_tmp = L_shl( L_tmp, q ); - *y++ = round_fx( L_tmp ); -#endif move16(); } } @@ -206,20 +187,14 @@ void syn_filt_fx( Word16 buf[L_FRAME48k + L_FRAME48k / 2 + TCXLTP_LTP_ORDER]; /* temporary synthesis buffer */ Word16 s, *yy; Word16 q; -#ifdef BASOP_NOGLOB Flag Overflow = 0; move16(); -#endif Word16 a0; yy = &buf[0]; q = add( norm_s( a[0] ), 1 ); -#ifdef BASOP_NOGLOB a0 = shr_o( a[0], shift, &Overflow ); /* input / 2^shift */ -#else - a0 = shr( a[0], shift ); /* input / 2^shift */ -#endif /*------------------------------------------------------------------* * copy initial filter states into synthesis buffer and do synthesis @@ -237,18 +212,10 @@ void syn_filt_fx( FOR( i = 0; i < l; i++ ) { -#ifdef BASOP_NOGLOB s = mult_r( shl_o( a0, q, &Overflow ), x[i] ); -#else - s = mult_r( shl( a0, q ), x[i] ); -#endif FOR( j = 1; j <= m; j++ ) { -#ifdef BASOP_NOGLOB s = msu_ro( L_deposit_h( s ), shl_o( a[j], q, &Overflow ), yy[i - j], &Overflow ); -#else - s = msu_r( L_deposit_h( s ), shl( a[j], q ), yy[i - j] ); -#endif } yy[i] = s; @@ -330,23 +297,14 @@ void E_UTIL_synthesis( const Word16 shift, const Word16 a[], const Word16 x[], W *-----------------------------------------------------------------------*/ mem += m; /*move16();*/ -#ifdef BASOP_NOGLOB a0 = shr_o( a[0], shift, &Overflow ); /* input / 2^shift */ -#else - a0 = shr( a[0], shift ); /* input / 2^shift */ -#endif /*-----------------------------------------------------------------------* * Do the filtering *-----------------------------------------------------------------------*/ /* Filtering Only from Input + Memory */ L_tmp = syn_kern( L_mult( a0, *x++ ), a, mem ); -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( L_tmp, q, &Overflow ); *y++ = round_fx_o( L_tmp, &Overflow ); -#else - L_tmp = L_shl( L_tmp, q ); - *y++ = round_fx( L_tmp ); -#endif move16(); /* Filtering from Input + Mix of Memory & Output Signal Past */ @@ -356,28 +314,15 @@ void E_UTIL_synthesis( const Word16 shift, const Word16 a[], const Word16 x[], W /* Process Output Signal Past */ FOR( j = 1; j <= i; j++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_msu_o( L_tmp, a[j], y[-j], &Overflow ); -#else - L_tmp = L_msu( L_tmp, a[j], y[-j] ); -#endif } /* Process Memory */ FOR( ; j <= m; j++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_msu_sat( L_tmp, a[j], mem[i - j] ); -#else - L_tmp = L_msu( L_tmp, a[j], mem[i - j] ); -#endif } -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( L_tmp, q, &Overflow ); *y++ = round_fx_o( L_tmp, &Overflow ); -#else - L_tmp = L_shl( L_tmp, q ); - *y++ = round_fx( L_tmp ); -#endif move16(); } @@ -385,13 +330,8 @@ void E_UTIL_synthesis( const Word16 shift, const Word16 a[], const Word16 x[], W FOR( ; i < lg; i++ ) { L_tmp = syn_kern( L_mult( a0, *x++ ), a, y ); -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( L_tmp, q, &Overflow ); *y++ = round_fx_o( L_tmp, &Overflow ); -#else /* BASOP_NOGLOB */ - L_tmp = L_shl( L_tmp, q ); - *y++ = round_fx( L_tmp ); -#endif move16(); } diff --git a/lib_com/tcq_position_arith_fx.c b/lib_com/tcq_position_arith_fx.c index 581ef7395..cc885b6c8 100644 --- a/lib_com/tcq_position_arith_fx.c +++ b/lib_com/tcq_position_arith_fx.c @@ -942,13 +942,8 @@ Word32 GetISCScale_fx( tmp16 = extract_l( t32 ); } } -#ifdef BASOP_NOGLOB tmp32 = L_shl_sat( tmp32, sub( 1, SafeExp ) ); /* *2 */ tmp32 = L_sub_sat( L_shl_sat( L_mult0( g_fx, tmp16 ), sub( Qsxy, exp ) ), tmp32 ); /*Qsxy */ -#else - tmp32 = L_shl( tmp32, 1 - SafeExp ); /* *2 */ - tmp32 = L_sub( L_shl( L_mult0( g_fx, tmp16 ), sub( Qsxy, exp ) ), tmp32 ); /*Qsxy */ -#endif dist_fx[i] = Mult_32_16( tmp32, g_fx ); /*Qsxy + exp - 15 */ move32(); exp_dist[i] = add( sub( Qsxy, 15 ), exp ); diff --git a/lib_com/tcx_ltp_fx.c b/lib_com/tcx_ltp_fx.c index a42272f0b..c10346d70 100644 --- a/lib_com/tcx_ltp_fx.c +++ b/lib_com/tcx_ltp_fx.c @@ -45,11 +45,7 @@ void tcx_ltp_get_lpc( r = L_shr( r, 2 ); tmp = shl( x[j], s ); /* Qx + s */ -#ifdef BASOP_NOGLOB r = L_mac0_sat( r, tmp, tmp ); /* Q30 */ -#else - r = L_mac0( r, tmp, tmp ); -#endif } r = L_max( r, L_shl( 100, shl( s, 1 ) ) ); /* Q30 */ r = Mpy_32_16_1( r, 16386 /*1.0001f Q14*/ ); /* Q29 */ @@ -249,25 +245,15 @@ static void tcx_ltp_get_zir( move16(); FOR( i = 0; i < L; i++ ) { -#ifdef BASOP_NOGLOB s = L_mac_sat( L_mac_sat( s, w0[k], x0[i] ), w1[k], x1[-i] ); /* Qx */ s2 = L_mac_sat( L_mac_sat( s2, v0[k], y0[i] ), v1[k], y1[-i] ); /* Qx */ -#else - s = L_mac( L_mac( s, w0[k], x0[i] ), w1[k], x1[-i] ); - s2 = L_mac( L_mac( s2, v0[k], y0[i] ), v1[k], y1[-i] ); -#endif k = k + pitres; } /* s2 *= ALPHA; buf[j] = ( synth[j] - gain * s2 ) - ( synth_ltp[j] - gain * s ); */ -#ifdef BASOP_NOGLOB i = sub_sat( round_fx_sat( s ), mult_r_sat( round_fx_sat( s2 ), ALPHA ) ); buf[j] = add_sat( sub_sat( synth[j], synth_ltp[j] ), mult_r_sat( gain, i ) ); /* Qx */ -#else - i = sub( round_fx( s ), mult_r( round_fx( s2 ), ALPHA ) ); - buf[j] = add( sub( synth[j], synth_ltp[j] ), mult_r( gain, i ) ); -#endif move16(); x0++; @@ -422,17 +408,10 @@ void predict_signal( FOR( j = 0; j < L_subfr; j++ ) { -#ifdef BASOP_NOGLOB s = L_mult_o( win[0], x0[0], &Overflow ); /* Qx + 16 */ s = L_mac_o( s, win[1], x0[1], &Overflow ); /* Qx + 16 */ s = L_mac_o( s, win[2], x0[2], &Overflow ); /* Qx + 16 */ excO[j] = mac_ro( s, win[3], x0[3], &Overflow ); /* Qx + 16 */ -#else - s = L_mult( win[0], x0[0] ); - s = L_mac( s, win[1], x0[1] ); - s = L_mac( s, win[2], x0[2] ); - excO[j] = mac_r( s, win[3], x0[3] ); -#endif move16(); x0++; @@ -512,13 +491,8 @@ static void tcx_ltp_synth_filter( move16(); FOR( i = 0; i < L; i++ ) { -#ifdef BASOP_NOGLOB s = L_mac_sat( L_mac_sat( s, w0[k], x0[i] ), w1[k], x1[-i] ); /* Qx */ s2 = L_mac_sat( L_mac_sat( s2, v0[k], y0[i] ), v1[k], y1[-i] ); /* Qx */ -#else - s = L_mac( L_mac( s, w0[k], x0[i] ), w1[k], x1[-i] ); - s2 = L_mac( L_mac( s2, v0[k], y0[i] ), v1[k], y1[-i] ); -#endif k = k + pitch_res; } @@ -526,39 +500,24 @@ static void tcx_ltp_synth_filter( normal: synth_ltp[j] = synth[j] - gain * s2 + gain * s; zir: synth_ltp[j] = synth[j] - gain * s2 + gain * s - zir[j]; fade-in/out: synth_ltp[j] = synth[j] - alpha * gain * s2 + alpha * gain * s; */ -#ifdef BASOP_NOGLOB i = sub_sat( round_fx_sat( s ), mult_r_sat( round_fx_sat( s2 ), ALPHA ) ); /* Qx */ -#else - i = sub( round_fx( s ), mult_r( round_fx( s2 ), ALPHA ) ); -#endif k = mult_r( gain, i ); /* Qx */ if ( fade != 0 ) k = mult_r( k, alpha ); /* Qx */ -#ifdef BASOP_NOGLOB k = add_sat( synth[j], k ); /* Qx */ if ( zir != NULL ) { k = sub_sat( k, zir[j] ); /* Qx */ } -#else - k = add( synth[j], k ); - if ( zir != NULL ) - k = sub( k, zir[j] ); -#endif synth_ltp[j] = k; /* Qx */ move16(); BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB if ( fade != 0 ) { alpha = add_sat( alpha, step ); } -#else - if ( fade != 0 ) - alpha = add( alpha, step ); -#endif BASOP_SATURATE_WARNING_ON_EVS; x0++; @@ -646,13 +605,8 @@ static void tcx_ltp_synth_filter32( move16(); FOR( i = 0; i < L; i++ ) { -#ifdef BASOP_NOGLOB s = Madd_32_16_r( Madd_32_16_r( s, x0[i], w0[k] ), x1[-i], w1[k] ); /* Qx */ s2 = Madd_32_16_r( Madd_32_16_r( s2, y0[i], v0[k] ), y1[-i], v1[k] ); /* Qx */ -#else - s = L_mac( L_mac( s, w0[k], x0[i] ), w1[k], x1[-i] ); - s2 = L_mac( L_mac( s2, v0[k], y0[i] ), v1[k], y1[-i] ); -#endif k = k + pitch_res; } @@ -660,39 +614,24 @@ static void tcx_ltp_synth_filter32( normal: synth_ltp[j] = synth[j] - gain * s2 + gain * s; zir: synth_ltp[j] = synth[j] - gain * s2 + gain * s - zir[j]; fade-in/out: synth_ltp[j] = synth[j] - alpha * gain * s2 + alpha * gain * s; */ -#ifdef BASOP_NOGLOB L_tmp = L_sub_sat( s, Mpy_32_16_r( s2, ALPHA ) ); /* Qx */ -#else - i = sub( round_fx( s ), mult_r( round_fx( s2 ), ALPHA ) ); -#endif L_tmp2 = Mpy_32_16_r( L_tmp, gain ); /* Qx */ IF( fade != 0 ) L_tmp2 = Mpy_32_16_r( L_tmp2, alpha ); /* Qx */ -#ifdef BASOP_NOGLOB L_tmp2 = L_add_sat( synth[j], L_tmp2 ); /* Qx */ if ( zir != NULL ) { L_tmp2 = L_sub_sat( L_tmp2, zir[j] ); /* Qx */ } -#else - L_tmp2 = add( synth[j], L_tmp2 ); - if ( zir != NULL ) - L_tmp2 = sub( L_tmp2, zir[j] ); -#endif synth_ltp[j] = L_tmp2; /* Qx */ move16(); BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB if ( fade != 0 ) { alpha = add_sat( alpha, step ); } -#else - if ( fade != 0 ) - alpha = add( alpha, step ); -#endif BASOP_SATURATE_WARNING_ON_EVS; x0++; diff --git a/lib_com/tcx_mdct_fx.c b/lib_com/tcx_mdct_fx.c index 26e7e2345..1fc57871d 100644 --- a/lib_com/tcx_mdct_fx.c +++ b/lib_com/tcx_mdct_fx.c @@ -128,11 +128,7 @@ void TCX_MDCT( } FOR( i = 0; i < l / 2; i++ ) { -#ifdef BASOP_NOGLOB y[m / 2 + r / 2 + m / 2 + i] = L_msu_o( L_mult( x[i], factor ), x[l - 1 - i], factor, &Overflow ); /* exp(y_e) */ -#else /* BASOP_NOGLOB */ - y[m / 2 + r / 2 + m / 2 + i] = L_msu( L_mult( x[i], factor ), x[l - 1 - i], factor ); -#endif /* BASOP_NOGLOB */ move32(); } FOR( i = 0; i < m / 2; i++ ) @@ -142,11 +138,7 @@ void TCX_MDCT( } FOR( i = 0; i < r / 2; i++ ) { -#ifdef BASOP_NOGLOB y[m / 2 + r / 2 - 1 - m / 2 - i] = L_mac_o( L_mult( x[l + m + i], neg_factor ), x[l + m + r - 1 - i], neg_factor, &Overflow ); /* exp(y_e) */ -#else /* BASOP_NOGLOB */ - y[m / 2 + r / 2 - 1 - m / 2 - i] = L_mac( L_mult( x[l + m + i], neg_factor ), x[l + m + r - 1 - i], neg_factor ); -#endif /* BASOP_NOGLOB */ move32(); } @@ -194,11 +186,7 @@ void TCX_MDST( } FOR( i = 0; i < l / 2; i++ ) { -#ifdef BASOP_NOGLOB y[m / 2 + r / 2 + m / 2 + i] = L_msu_o( L_mult( x[i], neg_factor ), x[l - 1 - i], factor, &Overflow ); /* exp(y_e) */ -#else /* BASOP_NOGLOB */ - y[m / 2 + r / 2 + m / 2 + i] = L_msu( L_mult( x[i], neg_factor ), x[l - 1 - i], factor ); -#endif move32(); } FOR( i = 0; i < m / 2; i++ ) @@ -208,11 +196,7 @@ void TCX_MDST( } FOR( i = 0; i < r / 2; i++ ) { -#ifdef BASOP_NOGLOB y[m / 2 + r / 2 - 1 - m / 2 - i] = L_mac_sat( L_mult( x[l + m + i], neg_factor ), x[l + m + r - 1 - i], factor ); /* exp(y_e) */ -#else - y[m / 2 + r / 2 - 1 - m / 2 - i] = L_mac( L_mult( x[l + m + i], neg_factor ), x[l + m + r - 1 - i], factor ); -#endif move32(); } @@ -262,22 +246,14 @@ void TCX_MDCT_Inverse( FOR( i = 0; i < R2; i++ ) { -#ifdef BASOP_NOGLOB y[l + m + R2 + i] = round_fx_sat( L_shl_sat( Mpy_32_16_1( tmp_buf[L2 + i], negfac ), s ) ); /* fold out right end of DCT exp(fac_e)*/ -#else - y[l + m + R2 + i] = round_fx( L_shl( Mpy_32_16_1( tmp_buf[L2 + i], negfac ), s ) ); /* fold out right end of DCT */ -#endif move16(); } FOR( i = 0; i < L2; i++ ) { -#ifdef BASOP_NOGLOB y[i] = round_fx_sat( L_shl_sat( Mpy_32_16_1( tmp_buf[L2 + m + R2 + i], fac ), s ) ); /* negate, fold out left end of DCT exp(fac_e)*/ -#else - y[i] = round_fx( L_shl( Mpy_32_16_1( tmp_buf[L2 + m + R2 + i], fac ), s ) ); /* negate, fold out left end of DCT */ -#endif move16(); } @@ -285,13 +261,8 @@ void TCX_MDCT_Inverse( { Word16 f; -#ifdef BASOP_NOGLOB f = round_fx_sat( L_shl_sat( Mpy_32_16_1( tmp_buf[L2 + i], negfac ), s ) ); y[L2 + i] = round_fx_sat( L_shl_sat( Mpy_32_16_1( tmp_buf[l + m + R2 - 1 - i], negfac ), s ) ); /* time-reverse mid of DCT exp(fac_e)*/ -#else - f = round_fx( L_shl( Mpy_32_16_1( tmp_buf[L2 + i], negfac ), s ) ); - y[L2 + i] = round_fx( L_shl( Mpy_32_16_1( tmp_buf[l + m + R2 - 1 - i], negfac ), s ) ); /* time-reverse mid of DCT */ -#endif move16(); y[l + m + R2 - 1 - i] = f; move16(); diff --git a/lib_com/tcx_utils_fx.c b/lib_com/tcx_utils_fx.c index 26e29b104..4c04bf7a8 100644 --- a/lib_com/tcx_utils_fx.c +++ b/lib_com/tcx_utils_fx.c @@ -348,11 +348,7 @@ void tcx_windowing_synthesis_current_frame( } ELSE { -#ifdef BASOP_NOGLOB lerp( acelp_zir, tmp_buf, acelp_zir_len, idiv1616U( shl_sat( acelp_zir_len, LD_FSCALE_DENOM ), fullbandScale ) ); -#else - lerp( acelp_zir, tmp_buf, acelp_zir_len, idiv1616U( shl( acelp_zir_len, LD_FSCALE_DENOM ), fullbandScale ) ); -#endif acelp_zir = tmp_buf; /*Qx*/ } @@ -387,17 +383,10 @@ void tcx_windowing_synthesis_current_frame( tmp2 = mult_r( signal[i + overlap - acelp_mem_len], window_trans[i].v.im ); /*Qx*/ /*Time TDAC: 1)forward part of ACELP*/ -#ifdef BASOP_NOGLOB tmp2 = add_sat( tmp2, mult_r( old_syn[acelp_zir_len - tmp + i], mult_r( window_trans[i].v.re, window_trans[i].v.re ) ) ); /*Qx*/ /*Time TDAC: 1)reward part of ACELP*/ tmp2 = add_sat( tmp2, mult_r( old_syn[acelp_zir_len - i - 1], mult_r( window_trans[i].v.im, window_trans[i].v.re ) ) ); /*Qx*/ -#else - tmp2 = add( tmp2, mult_r( old_syn[acelp_zir_len - tmp + i], mult_r( window_trans[i].v.re, window_trans[i].v.re ) ) ); - - /*Time TDAC: 1)reward part of ACELP*/ - tmp2 = add( tmp2, mult_r( old_syn[acelp_zir_len - i - 1], mult_r( window_trans[i].v.im, window_trans[i].v.re ) ) ); -#endif move16(); signal[i + overlap - acelp_mem_len] = tmp2; /*Qx*/ } @@ -408,17 +397,9 @@ void tcx_windowing_synthesis_current_frame( tmp2 = mult_r( signal[i + overlap - acelp_mem_len], window_trans[tmp - 1 - i].v.re ); /*Qx*/ /*Time TDAC: 1)forward part of ACELP*/ -#ifdef BASOP_NOGLOB tmp2 = add_sat( tmp2, mult_r( old_syn[acelp_zir_len - tmp + i], mult_r( window_trans[tmp - 1 - i].v.im, window_trans[tmp - 1 - i].v.im ) ) ); /*Qx*/ -#else - tmp2 = add( tmp2, mult_r( old_syn[acelp_zir_len - tmp + i], mult_r( window_trans[tmp - 1 - i].v.im, window_trans[tmp - 1 - i].v.im ) ) ); -#endif /*Time TDAC: 1)reward part of ACELP*/ -#ifdef BASOP_NOGLOB tmp2 = add_sat( tmp2, mult_r( old_syn[acelp_zir_len - i - 1], mult_r( window_trans[tmp - 1 - i].v.re, window_trans[tmp - 1 - i].v.im ) ) ); /*Qx*/ -#else - tmp2 = add( tmp2, mult_r( old_syn[acelp_zir_len - i - 1], mult_r( window_trans[tmp - 1 - i].v.re, window_trans[tmp - 1 - i].v.im ) ) ); -#endif move16(); signal[i + overlap - acelp_mem_len] = tmp2; /*Qx*/ } @@ -426,11 +407,7 @@ void tcx_windowing_synthesis_current_frame( FOR( i = 0; i < M; i++ ) { move16(); -#ifdef BASOP_NOGLOB signal[overlap + acelp_mem_len - M + i] = sub_sat( signal[overlap + acelp_mem_len - M + i], old_syn[acelp_zir_len - M + i] ); /*Qx*/ -#else - signal[overlap + acelp_mem_len - M + i] = sub( signal[overlap + acelp_mem_len - M + i], old_syn[acelp_zir_len - M + i] ); -#endif } } /* ZIR at the end of the ACELP frame */ @@ -484,11 +461,7 @@ void tcx_windowing_synthesis_current_frame( { /*remove reconstructed ZIR and add ACELP ZIR*/ move16(); -#ifdef BASOP_NOGLOB signal[i + overlap + acelp_mem_len] = sub_sat( signal[i + overlap + acelp_mem_len], mult_r_sat( acelp_zir[i], div_s( sub_sat( acelp_zir_len, i ), acelp_zir_len ) ) ); /*Qx*/ -#else - signal[i + overlap + acelp_mem_len] = sub( signal[i + overlap + acelp_mem_len], mult_r( acelp_zir[i], div_s( sub( acelp_zir_len, i ), acelp_zir_len ) ) ); -#endif } } /* Rectangular window (past-frame is TCX) */ @@ -1072,11 +1045,7 @@ void mdct_shaping( FOR( l = 0; l < k; l++ ) { -#ifdef BASOP_NOGLOB *x = L_shl_o( Mpy_32_16_r( *x, *gains ), *gains_exp, &Overflow ); /*Qx*/ -#else - *x = L_shl( Mpy_32_16_r( *x, *gains ), *gains_exp ); /*Qx*/ -#endif move32(); x++; } @@ -1095,11 +1064,7 @@ void mdct_shaping( gains_exp = pgainsexp; FOR( i = 0; i < FDNS_NPTS; i++ ) { -#ifdef BASOP_NOGLOB *x = L_shl_o( Mpy_32_16_r( *x, *gains ), *gains_exp, &Overflow ); /*Qx*/ -#else - *x = L_shl( Mpy_32_16_r( *x, *gains ), *gains_exp ); -#endif move32(); x += k; gains++; @@ -1474,11 +1439,7 @@ void PsychAdaptLowFreqDeemph( L_tmp = BASOP_Util_Log2( L_tmp ); /* Q25 */ L_tmp = L_shr( L_tmp, 7 ); /* 0.0078125f = 1.f/(1<<7) */ L_tmp = BASOP_Util_InvLog2( L_tmp ); /* Q31 */ -#ifdef BASOP_NOGLOB tmp = round_fx_o( L_tmp, &Overflow ); /* Q15 */ -#else /* BASOP_NOGLOB */ - tmp = round_fx( L_tmp ); /* Q15 */ -#endif fac = tmp; /* Q15 */ move16(); @@ -1714,11 +1675,7 @@ void tcx_noise_filling( tmp32 = BASOP_Util_Log2( L_deposit_h( s_max( 0x3000, tiltCompFactor ) ) ); /* 6Q25 */ tmp32 = L_shr( Mpy_32_16_1( tmp32, tmp1 ), 6 ); /*Q25*/ BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB tilt_factor = round_fx_sat( BASOP_Util_InvLog2( tmp32 ) ); /*Q15*/ -#else - tilt_factor = round_fx( BASOP_Util_InvLog2( tmp32 ) ); -#endif BASOP_SATURATE_WARNING_ON_EVS; /* find last nonzero line below iFirstLine, use it as start offset */ @@ -1860,11 +1817,7 @@ void tcx_noise_filling_with_shift( tmp32 = BASOP_Util_Log2( L_deposit_h( s_max( 0x3000, tiltCompFactor ) ) ); /* 6Q25 */ tmp32 = L_shr( Mpy_32_16_1( tmp32, tmp1 ), 6 ); /*Q25*/ BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB tilt_factor = round_fx_sat( BASOP_Util_InvLog2( tmp32 ) ); /*Q15*/ -#else - tilt_factor = round_fx( BASOP_Util_InvLog2( tmp32 ) ); -#endif BASOP_SATURATE_WARNING_ON_EVS; /* find last nonzero line below iFirstLine, use it as start offset */ @@ -2177,11 +2130,7 @@ void tcx_get_gain( ener = L_shl( ener, tmp ); /*Q31 - ener_e + tmp*/ ener_e = sub( ener_e, tmp ); -#ifdef BASOP_NOGLOB tmp = div_s( abs_s( round_fx_o( corr, &Overflow ) ), round_fx_o( ener, &Overflow ) ); /*Q15 - (corr_e - ener_e)*/ -#else - tmp = div_s( abs_s( round_fx( corr ) ), round_fx( ener ) ); -#endif if ( corr < 0 ) tmp = negate( tmp ); diff --git a/lib_com/tec_com.c b/lib_com/tec_com.c index c51a2cd02..0a37504df 100644 --- a/lib_com/tec_com.c +++ b/lib_com/tec_com.c @@ -317,11 +317,7 @@ static void calcHiTempEnv_Fx( FOR( k = lowSubband; k < highSubband; k++ ) { -#ifdef BASOP_NOGLOB nrg = L_add_sat( nrg, L_shr( pCldfbPow[timeIndex][k], s1 ) ); /*Q31 - s1*/ -#else - nrg = L_add( nrg, L_shr( pCldfbPow[timeIndex][k], s1 ) ); -#endif } diff --git a/lib_com/tns_base.c b/lib_com/tns_base.c index 039c7a042..d4de526d6 100644 --- a/lib_com/tns_base.c +++ b/lib_com/tns_base.c @@ -496,11 +496,7 @@ Word16 ITF_Detect_fx( /* Check threshold HLM_MIN_NRG */ BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB tmp32 = L_sub( L_shl_o( L_tmp, sub( shift, sub( 24, Q ) ), &Overflow ), 4194304l /*HLM_MIN_NRG Q7*/ ); /*Q7*/ -#else /* BASOP_NOGLOB */ - tmp32 = L_sub( L_shl( L_tmp, sub( shift, 24 - Q ) ), 4194304l /*HLM_MIN_NRG Q7*/ ); -#endif BASOP_SATURATE_WARNING_ON_EVS; /* get pre-shift for autocorrelation */ @@ -531,11 +527,7 @@ Word16 ITF_Detect_fx( L_tmp = L_shl( L_tmp, sub( shift, tmp ) ); /* shift L_tmp to that exponent */ /* calc factor (with 2 bits headroom for sum of 3 subdivisions) */ -#ifdef BASOP_NOGLOB facs[iSubdivisions] = div_s( 0x2000, round_fx_sat( L_tmp ) ); /* L_tmp is >= 0x2000000 Q15*/ -#else - facs[iSubdivisions] = div_s( 0x2000, round_fx( L_tmp ) ); /* L_tmp is >= 0x2000000 */ -#endif move16(); } } diff --git a/lib_com/tools.c b/lib_com/tools.c index 7810edb94..733e5634a 100644 --- a/lib_com/tools.c +++ b/lib_com/tools.c @@ -2200,11 +2200,7 @@ double anint( int16_t is_numeric_float( float x ) { -#ifndef BASOP_NOGLOB union float_int -#else /* BASOP_NOGLOB */ - union float_int -#endif /* BASOP_NOGLOB */ { float float_val; int32_t int_val; diff --git a/lib_com/tools_fx.c b/lib_com/tools_fx.c index 746c2564a..e84c27081 100644 --- a/lib_com/tools_fx.c +++ b/lib_com/tools_fx.c @@ -281,11 +281,7 @@ Word16 usdequant_fx( /* Qx*/ /*g = idx * delta + qlow;*/ L_tmp = L_deposit_l( qlow ); /*Qx */ L_tmp = L_mac( L_tmp, idx, delta ); /*Qx */ -#ifdef BASOP_NOGLOB g = round_fx_sat( L_shl_sat( L_tmp, 16 ) ); /*Qx */ -#else - g = round_fx( L_shl( L_tmp, 16 ) ); /*Qx */ -#endif return ( g ); } @@ -317,13 +313,8 @@ Word16 usquant_fx( /* o: index of the winning codeword */ /* idx = (short)( (x - qlow)/delta + 0.5f); */ exp = norm_s( delta ); tmp = div_s( shl( 1, sub( 14, exp ) ), delta ); /*Q(29-exp-(Qx-1))->Q(30-exp-Qx) */ -#ifdef BASOP_NOGLOB L_tmp = L_mult( sub_o( x, qlow, &Overflow ), tmp ); /*Q(31-exp) */ idx = extract_l( L_shr_r( L_add( L_tmp, shl_o( 1, sub( 30, exp ), &Overflow ) ), sub( 31, exp ) ) ); /*Q0 */ -#else /* BASOP_NOGLOB */ - L_tmp = L_mult( sub( x, qlow ), tmp ); /*Q(31-exp) */ - idx = extract_l( L_shr_r( L_add( L_tmp, shl( 1, sub( 30, exp ) ) ), sub( 31, exp ) ) ); /*Q0 */ -#endif /* BASOP_NOGLOB */ idx = s_min( idx, sub( cbsize, 1 ) ); idx = s_max( idx, 0 ); @@ -331,11 +322,7 @@ Word16 usquant_fx( /* o: index of the winning codeword */ /* *xq = idx*delta + qlow; */ L_tmp = L_deposit_l( qlow ); /*Qx */ L_tmp = L_mac( L_tmp, idx, delta ); /*Qx */ -#ifdef BASOP_NOGLOB *xq = round_fx_o( L_shl_o( L_tmp, 16, &Overflow ), &Overflow ); /*Qx */ -#else - *xq = round_fx( L_shl( L_tmp, 16 ) ); /*Qx */ -#endif return idx; } /*-------------------------------------------------------------------* @@ -408,11 +395,7 @@ Word32 sum2_fx( /* o : sum of all squared vector elements L_tmp = L_deposit_l( 0 ); FOR( i = 0; i < lvec; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac_o( L_tmp, vec[i], vec[i], &Overflow ); /*Q(2x+1) */ -#else /* BASOP_NOGLOB */ - L_tmp = L_mac( L_tmp, vec[i], vec[i] ); /*Q(2x+1) */ -#endif /* BASOP_NOGLOB */ } return L_tmp; @@ -456,11 +439,7 @@ Word32 sum2_fx_mod( /* o : sum of all squared vector element L_tmp = L_deposit_l( 0 ); FOR( i = 0; i < lvec; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_add_o( L_tmp, L_shr( L_mult_o( vec[i], vec[i], &Overflow ), 9 ), &Overflow ); -#else - L_tmp = L_add( L_tmp, L_shr( L_mult( vec[i], vec[i] ), 9 ) ); -#endif } return L_tmp; @@ -762,11 +741,7 @@ void Copy_Scale_sig( } FOR( i = 0; i < lg; i++ ) { -#ifdef BASOP_NOGLOB y[i] = shl_o( x[i], exp0, &Overflow ); -#else - y[i] = shl( x[i], exp0 ); -#endif move16(); /* saturation can occur here */ } } @@ -804,20 +779,12 @@ void Copy_Scale_sig_16_32( /*Should not happen */ FOR( i = 0; i < lg; i++ ) { -#ifdef BASOP_NOGLOB y[i] = L_deposit_l( shl_o( x[i], exp0, &Overflow ) ); -#else - y[i] = L_deposit_l( shl( x[i], exp0 ) ); -#endif move32(); } return; } -#ifdef BASOP_NOGLOB tmp = shl_o( 1, exp0, &Overflow ); -#else - tmp = shl( 1, exp0 ); -#endif FOR( i = 0; i < lg; i++ ) { y[i] = L_mult0( x[i], tmp ); @@ -854,20 +821,12 @@ void Copy_Scale_sig_16_32_no_sat( /*Should not happen */ FOR( i = 0; i < lg; i++ ) { -#ifdef BASOP_NOGLOB y[i] = L_deposit_l( shl_o( x[i], exp0, &Overflow ) ); -#else - y[i] = L_deposit_l( shl( x[i], exp0 ) ); -#endif move32(); } return; } -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( 1, exp0 - 1, &Overflow ); -#else - tmp = shl( 1, exp0 ); -#endif FOR( i = 0; i < lg; i++ ) { // y[i] = L_mult0(x[i], L_tmp); @@ -895,11 +854,7 @@ void Copy_Scale_sig_32_16( { FOR( i = 0; i < lg; i++ ) { -#ifdef BASOP_NOGLOB y[i] = round_fx_o( L_shl_o( x[i], tmp, &Overflow ), &Overflow ); -#else - y[i] = round_fx( L_shl( x[i], tmp ) ); -#endif move16(); } } @@ -907,11 +862,7 @@ void Copy_Scale_sig_32_16( { FOR( i = 0; i < lg; i++ ) { -#ifdef BASOP_NOGLOB y[i] = round_fx_o( x[i], &Overflow ); -#else - y[i] = round_fx( x[i] ); -#endif move16(); } } @@ -936,11 +887,7 @@ void Scale_sig32( FOR( i = 0; i < lg; i++ ) { -#ifdef BASOP_NOGLOB x[i] = L_shl_o( x[i], exp0, &Overflow ); -#else - x[i] = L_shl( x[i], exp0 ); -#endif move32(); /* saturation can occur here */ } } @@ -990,31 +937,17 @@ void Scale_sig( { FOR( i = 0; i < lg; i++ ) { -#ifdef BASOP_NOGLOB x[i] = shl_sat( x[i], exp0 ); -#else /* BASOP_NOGLOB */ - x[i] = shl( x[i], exp0 ); -#endif /* BASOP_NOGLOB */ move16(); /* saturation can occur here */ } return; } IF( exp0 < 0 ) { -#ifdef BASOP_NOGLOB tmp = shl_sat( -32768, exp0 ); /* we use negative to correctly represent 1.0 */ -#else - BASOP_SATURATE_WARNING_OFF_EVS - tmp = shl( -32768, exp0 ); /* we use negative to correctly represent 1.0 */ - BASOP_SATURATE_WARNING_ON_EVS -#endif FOR( i = 0; i < lg; i++ ) { -#ifdef BASOP_NOGLOB x[i] = msu_r_sat( 0, x[i], tmp ); -#else - x[i] = msu_r( 0, x[i], tmp ); -#endif move16(); /* msu instead of mac because factor is negative */ } return; @@ -1108,11 +1041,7 @@ void Vr_add( FOR( i = 0; i < Len; i++ ) { -#ifdef BASOP_NOGLOB out[i] = add_sat( in1[i], in2[i] ); -#else /* BASOP_NOGLOB */ - out[i] = add( in1[i], in2[i] ); -#endif /* BASOP_NOGLOB */ move16(); } } @@ -1553,11 +1482,7 @@ Word32 var_fx_32( /* o: variance of vector Q FOR( i = 0; i < len; i++ ) { tmp = sub( x[i], m ); /*Qx */ -#ifdef BASOP_NOGLOB v = L_mac0_sat( v, tmp, tmp ); /*(Qx+Qx) */ -#else /* BASOP_NOGLOB */ - v = L_mac0( v, tmp, tmp ); /*(Qx+Qx) */ -#endif /* BASOP_NOGLOB */ } L_tmp = Mult_32_16( v, inv_len ); /*Q(14-exp+Qx+Qx) */ v = L_shl( L_tmp, add( exp, sub( 2, Qx ) ) ); /*Qx+16 */ @@ -1598,11 +1523,7 @@ Word32 var_fx_32in_32out( /* o: variance of vector * convolution are considered. *-------------------------------------------------------------------*/ -#ifdef BASOP_NOGLOB /*Critical overflow */ Flag conv_fx( -#else -void conv_fx( -#endif const Word16 x[], /* i : input vector Q_new*/ const Word16 h[], /* i : impulse response (or second input vector) Q(15)*/ Word16 y[], /* o : output vetor (result of convolution) 12 bits*/ @@ -1623,22 +1544,12 @@ void conv_fx( L_sum = L_mult( x[0], h[n] ); FOR( i = 1; i < n; i++ ) { -#ifdef BASOP_NOGLOB L_sum = L_mac_o( L_sum, x[i], h[n - i], &Overflow ); -#else - L_sum = L_mac( L_sum, x[i], h[n - i] ); -#endif } -#ifdef BASOP_NOGLOB y[n] = mac_ro( L_sum, x[i], h[0], &Overflow ); -#else - y[n] = mac_r( L_sum, x[i], h[0] ); -#endif move16(); } -#ifdef BASOP_NOGLOB return Overflow; -#endif } /*-------------------------------------------------------------------* @@ -1648,11 +1559,7 @@ void conv_fx( * All vectors are of length L. Only the first L samples of the * convolution are considered. *-------------------------------------------------------------------*/ -#ifdef BASOP_NOGLOB /*Critical overflow */ Flag conv_fx_32( -#else -void conv_fx_32( -#endif const Word16 x[], /* i : input vector Q_new*/ const Word16 h[], /* i : impulse response (or second input vector) Q(15)*/ Word32 y[], /* o : output vetor (result of convolution) 12 bits*/ @@ -1675,9 +1582,7 @@ void conv_fx_32( y[n] = L_mac_o( L_sum, x[i], h[0], &Overflow ); move32(); } -#ifdef BASOP_NOGLOB return Overflow; -#endif } Word16 var_fx( /* o: variance of vector Qx*/ const Word16 *x, /* i: input vector Qx*/ @@ -1706,20 +1611,11 @@ Word16 var_fx( /* o: variance of vector Qx*/ v = L_deposit_l( 0 ); FOR( i = 0; i < len; i++ ) { -#ifdef BASOP_NOGLOB tmp = sub_sat( x[i], m ); /*Qx */ v = L_mac0_sat( v, tmp, tmp ); /*(Qx+Qx) */ -#else - tmp = sub( x[i], m ); /*Qx */ - v = L_mac0( v, tmp, tmp ); /*(Qx+Qx) */ -#endif } L_tmp = Mult_32_16( v, inv_len ); /*Q(14-exp+Qx+Qx) */ -#ifdef BASOP_NOGLOB v_16 = round_fx_sat( L_shl_sat( L_tmp, add( exp, sub( 2, Qx ) ) ) ); /*Qx */ -#else /* BASOP_NOGLOB */ - v_16 = round_fx( L_shl( L_tmp, add( exp, sub( 2, Qx ) ) ) ); /*Qx */ -#endif /* BASOP_NOGLOB */ return v_16; } @@ -1811,11 +1707,7 @@ void Vr_subt( FOR( i = 0; i < N; i++ ) { -#ifdef BASOP_NOGLOB y[i] = sub_sat( x1[i], x2[i] ); -#else /* BASOP_NOGLOB */ - y[i] = sub( x1[i], x2[i] ); -#endif /* BASOP_NOGLOB */ move16(); } } @@ -2010,7 +1902,6 @@ Word16 w_vquant_fx( { dist = L_deposit_l( 0 ); -#ifdef BASOP_NOGLOB tmp = sub_o( x[3], shr( cb[j++], Qx ), &Overflow ); if ( weights[3] != 0 ) { @@ -2031,28 +1922,6 @@ Word16 w_vquant_fx( { dist = L_mac0_o( dist, tmp, tmp, &Overflow ); } -#else - tmp = sub( x[3], shr( cb[j++], Qx ) ); - if ( weights[3] != 0 ) - { - dist = L_mac0( dist, tmp, tmp ); - } - tmp = sub( x[2], shr( cb[j++], Qx ) ); - if ( weights[2] != 0 ) - { - dist = L_mac0( dist, tmp, tmp ); - } - tmp = sub( x[1], shr( cb[j++], Qx ) ); - if ( weights[1] != 0 ) - { - dist = L_mac0( dist, tmp, tmp ); - } - tmp = sub( x[0], shr( cb[j++], Qx ) ); - if ( weights[0] != 0 ) - { - dist = L_mac0( dist, tmp, tmp ); - } -#endif if ( LT_32( dist, minDist ) ) { idx = c; @@ -2082,7 +1951,6 @@ Word16 w_vquant_fx( { dist = L_deposit_l( 0 ); -#ifdef BASOP_NOGLOB tmp = sub_o( x[0], shr( cb[j++], Qx ), &Overflow ); if ( weights[0] != 0 ) { @@ -2103,28 +1971,6 @@ Word16 w_vquant_fx( { dist = L_mac0_o( dist, tmp, tmp, &Overflow ); } -#else - tmp = sub( x[0], shr( cb[j++], Qx ) ); - if ( weights[0] != 0 ) - { - dist = L_mac0( dist, tmp, tmp ); - } - tmp = sub( x[1], shr( cb[j++], Qx ) ); - if ( weights[1] != 0 ) - { - dist = L_mac0( dist, tmp, tmp ); - } - tmp = sub( x[2], shr( cb[j++], Qx ) ); - if ( weights[2] != 0 ) - { - dist = L_mac0( dist, tmp, tmp ); - } - tmp = sub( x[3], shr( cb[j++], Qx ) ); - if ( weights[3] != 0 ) - { - dist = L_mac0( dist, tmp, tmp ); - } -#endif if ( LT_32( dist, minDist ) ) { idx = c; @@ -2183,11 +2029,7 @@ Word16 emaximum_fx( /* o : return index with max energy valu emax = L_max( emax, L_tmp ); } -#ifdef BASOP_NOGLOB *ener_max = L_shr_sat( emax, add( Qvec, Qvec ) ); -#else /* BASOP_NOGLOB */ - *ener_max = L_shr( emax, add( Qvec, Qvec ) ); -#endif /* BASOP_NOGLOB */ move32(); return ind; @@ -2224,11 +2066,7 @@ Word16 emaximum_32fx( /* o : return index with max energy va } } -#ifdef BASOP_NOGLOB *ener_max = W_extract_l( W_shr( emax, add( Qvec, Qvec ) ) ); -#else /* BASOP_NOGLOB */ - *ener_max = L_shr( emax, add( Qvec, Qvec ) ); -#endif /* BASOP_NOGLOB */ move32(); return ind; @@ -2272,11 +2110,7 @@ Word32 sum32_fx( /* o : sum of all vector elements tmp = L_deposit_l( 0 ); FOR( i = 0; i < lvec; i++ ) { -#ifdef BASOP_NOGLOB tmp = L_add_sat( tmp, vec[i] ); /*Qx */ -#else /* BASOP_NOGLOB */ - tmp = L_add( tmp, vec[i] ); /*Qx */ -#endif /* BASOP_NOGLOB */ } return tmp; @@ -2292,11 +2126,7 @@ Word16 sum16_fx( /* o : sum of all vector elements move16(); FOR( i = 0; i < lvec; i++ ) { -#ifdef BASOP_NOGLOB tmp = add_sat( tmp, vec[i] ); /*Qx */ -#else - tmp = add( tmp, vec[i] ); /*Qx */ -#endif } return tmp; @@ -2539,30 +2369,17 @@ void pz_filter_sp_fx( Lacc = L_deposit_h( x[i] ); /* Lacc in Q(16+Qn)*/ Lacc = L_shl( Lacc, s ); /* Lacc=x[i] in Q(16+Qn-2Qa+1)*/ FOR( j = PDR - 1; j >= 0; j-- ) -#ifdef BASOP_NOGLOB Lacc = L_msu_sat( Lacc, buf[j], a[j + 1] ); /*Q(16+Qn-2Qa+1)*/ -#else - Lacc = L_msu( Lacc, buf[j], a[j + 1] ); /*Q(16+Qn-2Qa+1)*/ -#endif Lacc = L_shr( Lacc, 1 ); -#ifdef BASOP_NOGLOB Ltemp1 = L_add_sat( L_shl_sat( Lacc, Qa ), 0x08000 ); -#else - Ltemp1 = L_add( L_shl( Lacc, Qa ), 0x08000 ); -#endif s_mem = extract_h( Ltemp1 ); Lacc = L_deposit_l( 0 ); FOR( j = PNR - 1; j >= 0; j-- ) -#ifdef BASOP_NOGLOB Lacc = L_mac_sat( Lacc, buf[j], b[j + 1] ); Lacc = L_mac_sat( Lacc, s_mem, b[0] ); -#else - Lacc = L_mac( Lacc, buf[j], b[j + 1] ); - Lacc = L_mac( Lacc, s_mem, b[0] ); -#endif /* Lacc in Q(1+Qc+Qn-Qa)*/ FOR( j = s_max( PDR, PNR ) - 1; j > 0; j-- ) @@ -2574,11 +2391,7 @@ void pz_filter_sp_fx( buf[0] = s_mem; move16(); -#ifdef BASOP_NOGLOB Ltemp1 = L_add_sat( L_shr_sat( Lacc, s ), 0x08000 ); /* Ltemp1 in Qc+Qa+Qn=Q(Qn) */ -#else - Ltemp1 = L_add( L_shr( Lacc, s ), 0x08000 ); /* Ltemp1 in Qc+Qa+Qn=Q(Qn) */ -#endif y[i] = extract_h( Ltemp1 ); /* y[i] in Qn */ move16(); } @@ -2637,27 +2450,15 @@ Word32 root_a_over_b_fx( } exp_num = norm_l( b ); -#ifdef BASOP_NOGLOB num = round_fx_o( L_shl_o( b, exp_num, &Overflow ), &Overflow ); -#else - num = round_fx( L_shl( b, exp_num ) ); -#endif exp_num = sub( sub( 30, exp_num ), Q_b ); exp_den = norm_l( a ); -#ifdef BASOP_NOGLOB den = round_fx_o( L_shl_o( a, exp_den, &Overflow ), &Overflow ); -#else /* BASOP_NOGLOB */ - den = round_fx( L_shl( a, exp_den ) ); -#endif /* BASOP_NOGLOB */ exp_den = sub( sub( 30, exp_den ), Q_a ); scale = shr( sub( den, num ), 15 ); -#ifdef BASOP_NOGLOB num = shl_o( num, scale, &Overflow ); -#else - num = shl( num, scale ); -#endif exp_num = sub( exp_num, scale ); tmp = div_s( num, den ); @@ -2725,7 +2526,6 @@ void fir_fx( const Word16 x[], /* i : input vector /* do the filtering */ FOR( i = 0; i < L; i++ ) { -#ifdef BASOP_NOGLOB s = L_mult_o( buf_in[K + i], h[0], &Overflow ); FOR( j = 1; j <= K; j++ ) @@ -2734,16 +2534,6 @@ void fir_fx( const Word16 x[], /* i : input vector } s = L_shl_o( s, shift, &Overflow ); y[i] = round_fx_o( s, &Overflow ); /*Qx */ -#else - s = L_mult( buf_in[K + i], h[0] ); - - FOR( j = 1; j <= K; j++ ) - { - s = L_mac( s, h[j], buf_in[K + i - j] ); - } - s = L_shl( s, shift ); - y[i] = round_fx( s ); /*Qx */ -#endif move16(); } } @@ -2891,18 +2681,10 @@ Word16 squant_fx( /* o: index of the winning codeword */ FOR( c = 0; c < cbsize; c++ ) { L_dist = L_deposit_l( 0 ); -#ifdef BASOP_NOGLOB tmp = sub_o( x, cb[c], &Overflow ); -#else /* BASOP_NOGLOB */ - tmp = sub( x, cb[c] ); -#endif /* BASOP_NOGLOB */ /*dist += tmp*tmp; */ -#ifdef BASOP_NOGLOB L_dist = L_mac_o( L_dist, tmp, tmp, &Overflow ); -#else /* BASOP_NOGLOB */ - L_dist = L_mac( L_dist, tmp, tmp ); -#endif /* BASOP_NOGLOB */ if ( LT_32( L_dist, L_mindist ) ) { @@ -3003,11 +2785,7 @@ void pz_filter_dp_fx( FOR( j = PDR - 1; j >= 0; j-- ) Lacc = Msub_32_16( Lacc, buf[j], a[j + 1] ); /*Q(16+Qn-2Qa+1)*/ -#ifdef BASOP_NOGLOB s_mem = L_shl_sat( Lacc, sub( Qa, 1 ) ); /*Qn-Qa+16=Qn+Qc*/ -#else - s_mem = L_shl( Lacc, sub( Qa, 1 ) ); /*Qn-Qa+16=Qn+Qc*/ -#endif Lacc = L_deposit_l( 0 ); FOR( j = PNR - 1; j >= 0; j-- ) Lacc = Madd_32_16( Lacc, buf[j], b[j + 1] ); @@ -3023,11 +2801,7 @@ void pz_filter_dp_fx( buf[0] = s_mem; move16(); -#ifdef BASOP_NOGLOB Ltemp1 = L_shr_sat( Lacc, s ); /* Ltemp1 in Qc+Qa+Qn=Q(16+Qn) */ -#else - Ltemp1 = L_shr( Lacc, s ); /* Ltemp1 in Qc+Qa+Qn=Q(16+Qn) */ -#endif y[i] = extract_h( Ltemp1 ); /* y[i] in Qn */ move16(); } @@ -3065,20 +2839,12 @@ void Copy_Scale_sig32( { FOR( i = 0; i < lg; i++ ) { -#ifdef BASOP_NOGLOB y[i] = L_shl_o( x[i], tmp, &Overflow ); -#else - y[i] = L_shl( x[i], tmp ); -#endif move16(); } return; } -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( 1, exp0 - 1, &Overflow ); -#else - tmp = shl( 1, exp0 ); -#endif FOR( i = 0; i < lg; i++ ) { y[i] = W_extract_l( W_mult_32_32( L_tmp, x[i] ) ); @@ -3105,11 +2871,7 @@ void Copy_Scale_sig32_16( { FOR( i = 0; i < len; i++ ) { -#ifdef BASOP_NOGLOB *dst++ = round_fx_sat( *src++ ); -#else - *dst++ = round_fx( *src++ ); -#endif move16(); } return; @@ -3117,15 +2879,9 @@ void Copy_Scale_sig32_16( FOR( i = 0; i < len; i++ ) { -#ifdef BASOP_NOGLOB L_temp = L_shl_sat( *src++, exp0 ); *dst++ = round_fx_sat( L_temp ); -#else - L_temp = L_shl( *src++, exp0 ); - - *dst++ = round_fx( L_temp ); -#endif move16(); } } @@ -3275,11 +3031,7 @@ void add_vec_fx( { FOR( i = 0; i < N; i++ ) { -#ifdef BASOP_NOGLOB y[i] = add_o( x1[i], shr_ro( x2[i], Qyx2, &Overflow ), &Overflow ); -#else - y[i] = add( x1[i], shr_r( x2[i], Qyx2 ) ); -#endif move16(); } } @@ -3287,11 +3039,7 @@ void add_vec_fx( { FOR( i = 0; i < N; i++ ) { -#ifdef BASOP_NOGLOB y[i] = add_o( shr_ro( x1[i], Qyx1, &Overflow ), shr_ro( x2[i], Qyx2, &Overflow ), &Overflow ); -#else - y[i] = add( shr_r( x1[i], Qyx1 ), shr_r( x2[i], Qyx2 ) ); -#endif move16(); } } @@ -3418,39 +3166,21 @@ Word32 Calc_Energy_Autoscaled( /* o: Result (Energy) FOR( i = 0; i < j; i++ ) { /* divide by 2 so energy will be divided by 4 */ -#ifdef BASOP_NOGLOB /* Critical Overflow and all those below*/ temp = mult_ro( *signal++, 16384, &Overflow ); L_Energy = L_mac0_o( L_Energy, temp, temp, &Overflow ); -#else - temp = mult_r( *signal++, 16384 ); - L_Energy = L_mac0( L_Energy, temp, temp ); -#endif } FOR( i = j; i < len; i += 8 ) /* Process 8 Samples at a time */ { /* divide by 2 so energy will be divided by 4 */ -#ifdef BASOP_NOGLOB /* Critical Overflow */ temp = mult_ro( *signal++, 16384, &Overflow ); -#else - temp = mult_r( *signal++, 16384 ); -#endif L_temp = L_mult0( temp, temp ); FOR( j = 1; j < 8; j++ ) { -#ifdef BASOP_NOGLOB /* Critical Overflow */ temp = mult_ro( *signal++, 16384, &Overflow ); L_temp = L_mac0_o( L_temp, temp, temp, &Overflow ); -#else - temp = mult_r( *signal++, 16384 ); - L_temp = L_mac0( L_temp, temp, temp ); -#endif } -#ifdef BASOP_NOGLOB /* Critical Overflow */ L_temp = L_shr_o( L_temp, temp2, &Overflow ); -#else - L_temp = L_shr( L_temp, temp2 ); -#endif /* Here we try the addition just to check if we can sum the energy of the small (8 Iterations) loop with the total energy calculated so far without an overflow. @@ -3458,11 +3188,7 @@ Word32 Calc_Energy_Autoscaled( /* o: Result (Energy) energies are div by 2. Otherwise, nothing is done. After the 'IF', the sum is done again and will always be without an overflow. */ -#ifdef BASOP_NOGLOB /* Critical Overflow */ L_add_o( L_Energy, L_temp, &Overflow ); -#else - L_add( L_Energy, L_temp ); -#endif IF( Overflow != 0 ) { L_Energy = L_shr( L_Energy, 1 ); @@ -3471,11 +3197,7 @@ Word32 Calc_Energy_Autoscaled( /* o: Result (Energy) Overflow = 0; move16(); } -#ifdef BASOP_NOGLOB /* Critical Overflow */ L_Energy = L_add_o( L_Energy, L_temp, &Overflow ); -#else - L_Energy = L_add( L_Energy, L_temp ); -#endif } /* Calc Final Exponent (sub 2 because of the mult_r by 16384 that already divs the ener by 4) */ temp2 = sub( sub( shl( signal_exp, 1 ), temp2 ), 2 ); @@ -3547,11 +3269,7 @@ Word32 Sqrt_Ratio32( /* o: Result in Q31 exp2 = add( exp2, temp ); /* Prepare for Inverse */ -#ifdef BASOP_NOGLOB temp = round_fx_sat( L_val1 ); -#else - temp = round_fx( L_val1 ); -#endif temp = div_s( 16384, temp ); /* Mult Now */ L_val2 = Mult_32_16( L_val2, temp ); @@ -3849,17 +3567,10 @@ void Acelp_dec_total_exc( FOR( i = 0; i < L_subfr; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_mult( gain_pit_fx, exc_fx[i + i_subfr] ), 1 ); /*Q16+Q_exc*/ exc2_fx[i + i_subfr] = round_fx_sat( L_tmp ); /*Q_exc*/ L_tmp = L_add_sat( L_tmp, L_shl_sat( L_mult( gain_code16, code_fx[i] ), 6 ) ); /*Q16+Q_exc*/ exc_fx[i + i_subfr] = round_fx_sat( L_tmp ); /*Q_exc*/ -#else - L_tmp = L_shl( L_mult( gain_pit_fx, exc_fx[i + i_subfr] ), 1 ); /*Q16+Q_exc*/ - exc2_fx[i + i_subfr] = round_fx( L_tmp ); /*Q_exc*/ - L_tmp = L_add( L_tmp, L_shl( L_mult( gain_code16, code_fx[i] ), 6 ) ); /*Q16+Q_exc*/ - exc_fx[i + i_subfr] = round_fx( L_tmp ); /*Q_exc*/ -#endif move16(); move16(); } @@ -4053,20 +3764,12 @@ Word16 dot_prod_satcontr( const Word16 *x, const Word16 *y, Word16 qx, Word16 qy { Overflow = 0; move16(); -#ifdef BASOP_NOGLOB /* Critical Overflow and all those below*/ L_tmp = L_shl_o( 1, s_max( sub( add( add( qx, qy ), 7 ), shift ), 0 ), &Overflow ); -#else /* BASOP_NOGLOB */ - L_tmp = L_shl( 1, s_max( sub( add( add( qx, qy ), 7 ), shift ), 0 ) ); -#endif /* BASOP_NOGLOB */ pt1 = tmp_tab_x; pt2 = tmp_tab_y; FOR( i = 0; i < len; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac0_o( L_tmp, *pt1++, *pt2++, &Overflow ); /*Q(qx+qy-shift) */ -#else /* BASOP_NOGLOB */ - L_tmp = L_mac0( L_tmp, *pt1++, *pt2++ ); /*Q(qx+qy-shift) */ -#endif } IF( Overflow != 0 ) diff --git a/lib_com/trans_inv_fx.c b/lib_com/trans_inv_fx.c index cc562c899..cb50d030a 100644 --- a/lib_com/trans_inv_fx.c +++ b/lib_com/trans_inv_fx.c @@ -93,11 +93,7 @@ void preecho_sb_fx( { mean_prev_fx_loc = L_add( *mean_prev_fx, 0 ); -#ifdef BASOP_NOGLOB mean_prev_hb_fx_loc = L_shl_sat( *mean_prev_hb_fx, shl( q_sig16, 1 ) ); /*Q0 to q_sig16*/ -#else - mean_prev_hb_fx_loc = L_shl( *mean_prev_hb_fx, shl( q_sig16, 1 ) ); /*Q0 to q_sig16*/ -#endif mean_prev_nc_fx_loc = L_add( *mean_prev_nc_fx, 0 ); framelength_m1 = sub( framelength, 1 ); nb_flag = 0; @@ -144,20 +140,12 @@ void preecho_sb_fx( fx32ptr1 = wtda_audio_fx + len3xLp20 - 1; /*q_sig32*/ FOR( i = 0; i < len3xLp20; i++ ) { -#ifdef BASOP_NOGLOB *fxptr1++ = negate( extract_h( L_shl_sat( *fx32ptr1--, sub( 15, q_sig32 ) ) ) ); /*Q-1*/ -#else - *fxptr1++ = negate( extract_h( L_shl( *fx32ptr1--, 15 - q_sig32 ) ) ); -#endif move16(); /*convert to Word16 Q-1 with saturation (saturation not a problem here) */ } FOR( i = 0; i < L_shr( framelength, 1 ); i++ ) { -#ifdef BASOP_NOGLOB *fxptr1++ = negate( extract_h( L_shl_sat( wtda_audio_fx[i], sub( 15, q_sig32 ) ) ) ); /*Q-1*/ -#else - *fxptr1++ = negate( extract_h( L_shl( wtda_audio_fx[i], 15 - q_sig32 ) ) ); -#endif move16(); /*convert to Word16 Q-1 with saturation (saturation not a problem here) */ } qmemp1 = 0; /*already in q-1*/ @@ -195,11 +183,7 @@ void preecho_sb_fx( fxptr3 = rec_sig_fx + 1; /*q_sig16*/ fxptr4 = rec_sig_fx + 2; /*q_sig16*/ -#ifdef BASOP_NOGLOB tmp_fxL1 = L_mult( shl_sat( *memfilt_lb_fx, q_sig16 ), 8192 ); /* *memfilt_lb_fx in q0 */ -#else - tmp_fxL1 = L_mult( shl( *memfilt_lb_fx, q_sig16 ), 8192 ); /* *memfilt_lb_fx in q0 */ -#endif tmp_fxL1 = L_mac( tmp_fxL1, *fxptr3, 8192 /*Q15*/ ); /*Q16*/ *fxptr1 = mac_r( tmp_fxL1, *fxptr2, 16384 /*Q15*/ ); /*Q0*/ move16(); @@ -234,11 +218,7 @@ void preecho_sb_fx( } fxptr2--; -#ifdef BASOP_NOGLOB *memfilt_lb_fx = shr_sat( *fxptr2, q_sig16 ); /*Q0*/ -#else - *memfilt_lb_fx = shr( *fxptr2, q_sig16 ); -#endif move16(); /* *memfilt_lb_fx in q0 */ /* energy of low bands 8 present and 1 future sub-frames */ @@ -258,16 +238,9 @@ void preecho_sb_fx( FOR( j = 0; j < NUMSF; j++ ) /* 8 present subframes */ { tmp_fx2 = sub( j, 1 ); -#ifdef BASOP_NOGLOB tmp_fx1 = shr_sat( *fxptr2, q16p1 ); /*q-1 to avoisd saturation in energy*/ tmp_fxL1 = L_mac0_sat( 25, tmp_fx1, tmp_fx1 ); /*2*(Q-1)*/ tmp_fxL2 = L_mac0_sat( 100, *fxptr3, *fxptr3 ); /*2*(q_sig16)*/ -#else - tmp_fx1 = shr( *fxptr2, q16p1 ); /*q-1 to avoisd saturation in energy*/ - tmp_fxL1 = L_mac0( 25, tmp_fx1, tmp_fx1 ); - - tmp_fxL2 = L_mac0( 100, *fxptr3, *fxptr3 ); -#endif sptr2_loc = 0; move16(); @@ -287,15 +260,9 @@ void preecho_sb_fx( *fx32ptr6 = tmp_fxL1; /*2*(Q-1)*/ move32(); } -#ifdef BASOP_NOGLOB tmp_fx1 = shr_sat( *fxptr2, q16p1 ); /*q-1 to avoisd saturation in energy*/ tmp_fxL1 = L_mac0_sat( tmp_fxL1, tmp_fx1, tmp_fx1 ); /*2*(Q-1)*/ tmp_fxL2 = L_mac0_sat( tmp_fxL2, *fxptr3, *fxptr3 ); /*2*(q_sig16)*/ -#else - tmp_fx1 = shr( *fxptr2, q16p1 ); /*q-1 to avoisd saturation in energy*/ - tmp_fxL1 = L_mac0( tmp_fxL1, tmp_fx1, tmp_fx1 ); - tmp_fxL2 = L_mac0( tmp_fxL2, *fxptr3, *fxptr3 ); -#endif cntnzcr = add( cntnzcr, 1 ); IF( L_mult0( *fxptr2, *( fxptr2 - 1 ) ) <= 0 ) { @@ -357,11 +324,7 @@ void preecho_sb_fx( move32(); if ( LT_32( *fx32ptr5, L_shr( *fx32ptr1, 1 ) ) ) { -#ifdef BASOP_NOGLOB tmp_fxL1 = L_shl_sat( L_sub_sat( *fx32ptr1, *fx32ptr5 ), 1 ); /*2*(Q-1)*/ -#else - tmp_fxL1 = L_shl( L_sub( *fx32ptr1, *fx32ptr5 ), 1 ); -#endif } *fx32ptr5 = tmp_fxL1; /*2*(Q-1)*/ move32(); @@ -384,11 +347,7 @@ void preecho_sb_fx( FOR( i = 1; i < len3xLp20; i++ ) { tmp_fx1 = shr( *fxptr2, qmemp1 ); /*q-1 to avoisd saturation in energy*/ -#ifdef BASOP_NOGLOB tmp_fxL1 = L_mac0_sat( tmp_fxL1, tmp_fx1, tmp_fx1 ); /*2*(Q-1)*/ -#else - tmp_fxL1 = L_mac0( tmp_fxL1, tmp_fx1, tmp_fx1 ); -#endif if ( *fxptr2 * *( fxptr2 - 1 ) <= 0 ) { sptr1_loc = add( sptr1_loc, 1 ); @@ -412,30 +371,18 @@ void preecho_sb_fx( FOR( j = 1; j < tmp_fx3; j++ ) /* tmp_fx3 still contains subframelength*1.2-1 */ { tmp_fxL1 = L_mult( *fxptr2, -8192 /*Q15*/ ); /*q_sig16+Q16*/ -#ifdef BASOP_NOGLOB tmp_fxL1 = L_mac_sat( tmp_fxL1, *fxptr4, -8192 ); /*q_sig16+Q16*/ tmp_fx1 = mac_r_sat( tmp_fxL1, *fxptr3, 16384 /*Q15*/ ); /*q_sig16*/ tmp_fxL2 = L_mac0_sat( tmp_fxL2, tmp_fx1, tmp_fx1 ); /*2*(q_sig16)*/ -#else - tmp_fxL1 = L_mac( tmp_fxL1, *fxptr4, -8192 ); - tmp_fx1 = mac_r( tmp_fxL1, *fxptr3, 16384 ); - - tmp_fxL2 = L_mac0( tmp_fxL2, tmp_fx1, tmp_fx1 ); -#endif fxptr2++; fxptr3++; fxptr4++; } tmp_fxL1 = L_mult( *fxptr2, -8192 /*Q15*/ ); /*q_sig16+Q16*/ -#ifdef BASOP_NOGLOB tmp_fx1 = mac_r_sat( tmp_fxL1, *fxptr3, 16384 /*Q15*/ ); /*q_sig16*/ es_mdct_hb_fx[NUMSF] = L_mac0_sat( tmp_fxL2, tmp_fx1, tmp_fx1 ); /*2*(q_sig16)*/ -#else - tmp_fx1 = mac_r( tmp_fxL1, *fxptr3, 16384 ); - es_mdct_hb_fx[NUMSF] = L_mac0( tmp_fxL2, tmp_fx1, tmp_fx1 ); -#endif move32(); max_es_hb_fx = L_add( es_mdct_hb_fx[0], 0 ); /* for memorising the max energy */ @@ -467,11 +414,7 @@ void preecho_sb_fx( move16(); } -#ifdef BASOP_NOGLOB if ( LT_32( max_es_fx, L_shl_sat( mean_prev_fx_loc, 2 ) ) ) /*OK if saturated*/ -#else - if ( LT_32( max_es_fx, L_shl( mean_prev_fx_loc, 2 ) ) ) /*OK if saturated*/ -#endif { maxind = 0; move16(); @@ -709,11 +652,7 @@ void preecho_sb_fx( { tmp_fx1 = shr( *ptr_fx, qtmp ); /* q-1, to have same shift as es_mdct_.. */ -#ifdef BASOP_NOGLOB tmp_fxL1 = L_mac0_sat( tmp_fxL1, tmp_fx1, tmp_fx1 ); /*2*(Q-1)*/ -#else - tmp_fxL1 = L_mac0( tmp_fxL1, tmp_fx1, tmp_fx1 ); -#endif ptr_fx++; } if ( GT_32( tmp_fxL1, max_plus_es_mdct_fx ) ) @@ -721,11 +660,7 @@ void preecho_sb_fx( max_plus_es_mdct_fx = L_add( tmp_fxL1, 0 ); } -#ifdef BASOP_NOGLOB sum_plus_es_fx = L_add_sat( sum_plus_es_fx, L_shl_sat( tmp_fxL1, 2 ) ); /*2*(Q-1)*/ -#else - sum_plus_es_fx = L_add( sum_plus_es_fx, L_shl( tmp_fxL1, 2 ) ); -#endif *fx32ptr1 = tmp_fxL1; /*2*(Q-1)*/ fx32ptr1++; Mpy_32_16_ss( sum_plus_es_fx, inv_jp2[j], fx32ptr4, &tmp_u16 ); /* 410 for 1/80*/ @@ -899,11 +834,7 @@ void preecho_sb_fx( fxptr1 = preechogain_fx + tmp_fx2; /*Q15*/ FOR( j = 0; j < smooth_len; j++ ) { -#ifdef BASOP_NOGLOB *fxptr1 = add_sat( *fxptr1, tmp_fx1 ); /*Q15*/ -#else - *fxptr1 = add( *fxptr1, tmp_fx1 ); -#endif move16(); tmp_fx1 = add( tmp_fx1, tmp_fx3 ); /*Q15*/ fxptr1++; @@ -941,20 +872,12 @@ void preecho_sb_fx( { savehalfe_fx = L_add( mean_prev_nc_fx_loc, 0 ); /*2*(Q-1)*/ } -#ifdef BASOP_NOGLOB mean_prev_nc_fx_loc = L_add_sat( mean_prev_nc_fx_loc, es_mdct_fx[i] ); /*2*(Q-1)*/ -#else - mean_prev_nc_fx_loc = L_add( mean_prev_nc_fx_loc, es_mdct_fx[i] ); -#endif } if ( LT_32( savehalfe_fx, L_shr( mean_prev_nc_fx_loc, 1 ) ) ) { -#ifdef BASOP_NOGLOB mean_prev_nc_fx_loc = L_shl_sat( L_sub_sat( mean_prev_nc_fx_loc, savehalfe_fx ), 1 ); /*2*(Q-1)*/ -#else - mean_prev_nc_fx_loc = L_shl( L_sub( mean_prev_nc_fx_loc, savehalfe_fx ), 1 ); -#endif } mean_prev_nc_fx_loc = L_shr( mean_prev_nc_fx_loc, 3 ); /* >> LOG2_NUMSF in fixpoint 2*(Q-1)*/ @@ -994,13 +917,8 @@ void preecho_sb_fx( mean_prev_hb_fx_loc = L_shl( tmp_fxL1, 1 ); /*2*(q_sig16)*/ } -#ifdef BASOP_NOGLOB last2_fx = L_shr( L_add_sat( es_mdct_fx[NUMSF_M1], es_mdct_fx[NUMSF_M2] ), 1 ); /*q_sig16*/ last2_hb_fx = L_shr( L_add_sat( es_mdct_hb_fx[NUMSF_M1], es_mdct_hb_fx[NUMSF_M2] ), 1 ); /*q_sig16*/ -#else - last2_fx = L_shr( L_add( es_mdct_fx[NUMSF_M1], es_mdct_fx[NUMSF_M2] ), 1 ); - last2_hb_fx = L_shr( L_add( es_mdct_hb_fx[NUMSF_M1], es_mdct_hb_fx[NUMSF_M2] ), 1 ); -#endif if ( GT_32( last2_fx, mean_prev_fx_loc ) ) { mean_prev_fx_loc = L_add( last2_fx, 0 ); @@ -1012,11 +930,7 @@ void preecho_sb_fx( } *mean_prev_fx = mean_prev_fx_loc; /*2*(Q-1)*/ move32(); -#ifdef BASOP_NOGLOB *mean_prev_hb_fx = L_shr_sat( mean_prev_hb_fx_loc, shl_sat( q_sig16, 1 ) ); /*Q0*/ -#else - *mean_prev_hb_fx = L_shr( mean_prev_hb_fx_loc, shl( q_sig16, 1 ) ); -#endif move32(); /*save in Q0*/ *mean_prev_nc_fx = mean_prev_nc_fx_loc; /*2*(Q-1)*/ move32(); diff --git a/lib_com/weight_a_fx.c b/lib_com/weight_a_fx.c index 782979236..7bea66ea0 100644 --- a/lib_com/weight_a_fx.c +++ b/lib_com/weight_a_fx.c @@ -122,11 +122,7 @@ void weight_a_fx( move16(); FOR( i = 1; i < m; i++ ) { -#ifdef BASOP_NOGLOB ap[i] = round_fx_o( L_shl( L_mult0( a[i], fac ), shift ), &Overflow ); /* Q11 + shift */ -#else /* BASOP_NOGLOB */ - ap[i] = round_fx( L_shl( L_mult0( a[i], fac ), shift ) ); -#endif move16(); fac = mult_r( fac, gamma ); /* Q15 */ } diff --git a/lib_com/wi_fx.c b/lib_com/wi_fx.c index 19788dc0a..4872aff04 100644 --- a/lib_com/wi_fx.c +++ b/lib_com/wi_fx.c @@ -320,13 +320,8 @@ static Word16 DTFS_alignment_weight_fx( FOR( k = 0; k <= HalfLag; k++ ) { -#ifdef BASOP_NOGLOB ab1[k] = round_fx_o( L_mac0_o( L_mult0( X1.a_fx[k], X2.a_fx[k] ), X1.b_fx[k], X2.b_fx[k], &Overflow ), &Overflow ); /* Q(-15) */ ab2[k] = round_fx_o( L_msu0_o( L_mult0( X1.a_fx[k], X2.b_fx[k] ), X1.b_fx[k], X2.a_fx[k], &Overflow ), &Overflow ); /* Q(-15) */ -#else - ab1[k] = round_fx( L_mac0( L_mult0( X1.a_fx[k], X2.a_fx[k] ), X1.b_fx[k], X2.b_fx[k] ) ); /* Q(-15) */ - ab2[k] = round_fx( L_msu0( L_mult0( X1.a_fx[k], X2.b_fx[k] ), X1.b_fx[k], X2.a_fx[k] ) ); /* Q(-15) */ -#endif move16(); move16(); } @@ -349,13 +344,8 @@ static Word16 DTFS_alignment_weight_fx( FOR( k = 0; k <= HalfLag; k++ ) { -#ifdef BASOP_NOGLOB corr_fx = L_mac0_o( corr_fx, ab1[k], cos_table[s_and( temp, 511 )], &Overflow ); corr_fx = L_mac0_o( corr_fx, ab2[k], cos_table[s_and( add( temp, 128 ), 511 )], &Overflow ); -#else - corr_fx = L_mac0( corr_fx, ab1[k], cos_table[s_and( temp, 511 )] ); - corr_fx = L_mac0( corr_fx, ab2[k], cos_table[s_and( add( temp, 128 ), 511 )] ); -#endif move32(); move32(); temp = add( temp, temp1 ); @@ -368,28 +358,15 @@ static Word16 DTFS_alignment_weight_fx( move16(); } -#ifdef BASOP_NOGLOB temp1 = round_fx_o( (Word32) L_shl_o( corr_fx, Qcorr, &Overflow ), &Overflow ); /* Q(Qcorr-16) */ wcorr_fx = L_mult_o( temp1, shl_o( temp, 2, &Overflow ), &Overflow ); /* Q(Qcorr-16+13+2+1)=Q(Qcorr) */ -#else - temp1 = round_fx( (Word32) L_shl( corr_fx, Qcorr ) ); /* Q(Qcorr-16) */ - wcorr_fx = L_mult( temp1, shl( temp, 2 ) ); /* Q(Qcorr-16+13+2+1)=Q(Qcorr) */ -#endif IF( GE_16( Qmaxcorr, Qcorr ) ) { -#ifdef BASOP_NOGLOB diff_corr = L_sub_o( wcorr_fx, L_shl_o( maxcorr_fx, sub( Qcorr, Qmaxcorr ), &Overflow ), &Overflow ); /* Qcorr */ -#else - diff_corr = L_sub( wcorr_fx, L_shl( maxcorr_fx, sub( Qcorr, Qmaxcorr ) ) ); /* Qcorr */ -#endif } ELSE { -#ifdef BASOP_NOGLOB diff_corr = L_sub_o( L_shl_o( wcorr_fx, sub( Qmaxcorr, Qcorr ), &Overflow ), maxcorr_fx, &Overflow ); /* Qmaxcorr */ -#else - diff_corr = L_sub( L_shl( wcorr_fx, sub( Qmaxcorr, Qcorr ) ), maxcorr_fx ); /* Qmaxcorr */ -#endif } IF( diff_corr > 0 ) @@ -448,18 +425,10 @@ Word16 DTFS_alignment_full_fx( /* Calculating the expected alignment shift */ Eshift = mult_r( ph_offset_fx, shl( X2_DTFS_fx.lag_fx, 7 ) ); /* confirmed I<2 by smv12.org, Q7 */ find_rem( (Word16) L_FRAME, shr( add( X2_DTFS_fx.lag_fx, X1_DTFS_fx.lag_fx ), 1 ), &temp ); -#ifdef BASOP_NOGLOB temp = add_sat( shl( temp, 7 ), Eshift ); /* Q7 */ -#else - temp = add( shl( temp, 7 ), Eshift ); /* Q7 */ -#endif IF( temp < 0 ) { -#ifdef BASOP_NOGLOB temp = add_sat( temp, shl_sat( X1_DTFS_fx.lag_fx, 7 ) ); /* Q7 */ -#else - temp = add( temp, shl( X1_DTFS_fx.lag_fx, 7 ) ); /* Q7 */ -#endif } find_rem( temp, shl( X1_DTFS_fx.lag_fx, 7 ), &Eshift ); /* Q7 */ Eshift = shl( shr( Eshift, 7 ), 1 ); /* Q1 but integer */ @@ -484,13 +453,8 @@ Word16 DTFS_alignment_full_fx( FOR( k = 0; k <= HalfLag; k++ ) { -#ifdef BASOP_NOGLOB ab1[k] = round_fx_o( L_mac_o( L_mult_o( X1_DTFS_fx.a_fx[k], X2_DTFS_fx.a_fx[k], &Overflow ), X1_DTFS_fx.b_fx[k], X2_DTFS_fx.b_fx[k], &Overflow ), &Overflow ); /* Q(-15); */ ab2[k] = round_fx_o( L_msu_o( L_mult_o( X1_DTFS_fx.b_fx[k], X2_DTFS_fx.a_fx[k], &Overflow ), X1_DTFS_fx.a_fx[k], X2_DTFS_fx.b_fx[k], &Overflow ), &Overflow ); /* Q(-15); */ -#else - ab1[k] = round_fx( L_mac( L_mult( X1_DTFS_fx.a_fx[k], X2_DTFS_fx.a_fx[k] ), X1_DTFS_fx.b_fx[k], X2_DTFS_fx.b_fx[k] ) ); /* Q(-15); */ - ab2[k] = round_fx( L_msu( L_mult( X1_DTFS_fx.b_fx[k], X2_DTFS_fx.a_fx[k] ), X1_DTFS_fx.a_fx[k], X2_DTFS_fx.b_fx[k] ) ); /* Q(-15); */ -#endif } IF( FR_flag == 0 ) { @@ -520,15 +484,9 @@ Word16 DTFS_alignment_full_fx( temp1 = add( n, shl( X2_DTFS_fx.lag_fx, 1 ) ); /* add lag_fx in Q1to make positive */ FOR( k = 0; k <= HalfLag; k++ ) { -#ifdef BASOP_NOGLOB corr_fx = L_mac_o( corr_fx, ab1[k], C_fx[( 2 * temp ) % ( 4 * X2_DTFS_fx.lag_fx )], &Overflow ); corr_fx = L_mac_o( corr_fx, ab2[k], S_fx[( 2 * temp ) % ( 4 * X2_DTFS_fx.lag_fx )], &Overflow ); temp = add_o( temp, temp1, &Overflow ); -#else - corr_fx = L_mac( corr_fx, ab1[k], C_fx[( 2 * temp ) % ( 4 * X2_DTFS_fx.lag_fx )] ); - corr_fx = L_mac( corr_fx, ab2[k], S_fx[( 2 * temp ) % ( 4 * X2_DTFS_fx.lag_fx )] ); - temp = add( temp, temp1 ); -#endif } IF( GT_32( corr_fx, maxcorr_fx ) ) @@ -648,15 +606,9 @@ void Q2phaseShift_fx( FOR( k = 0; k <= HalfLag; k++ ) { temp = X_fx->a_fx[k]; -#ifdef BASOP_NOGLOB X_fx->a_fx[k] = round_fx_o( L_msu_o( L_mult_o( temp, C_fx[temp2 % ( 4 * Lag )], &Overflow ), X_fx->b_fx[k], S_fx[temp2 % ( 4 * Lag )], &Overflow ), &Overflow ); /* X.Q */ X_fx->b_fx[k] = round_fx_o( L_mac_o( L_mult_o( X_fx->b_fx[k], C_fx[temp2 % ( 4 * Lag )], &Overflow ), temp, S_fx[temp2 % ( 4 * Lag )], &Overflow ), &Overflow ); temp2 = L_add_o( temp2, (Word32) ph, &Overflow ); -#else - X_fx->a_fx[k] = round_fx( L_msu( L_mult( temp, C_fx[temp2 % ( 4 * Lag )] ), X_fx->b_fx[k], S_fx[temp2 % ( 4 * Lag )] ) ); /* X.Q */ - X_fx->b_fx[k] = round_fx( L_mac( L_mult( X_fx->b_fx[k], C_fx[temp2 % ( 4 * Lag )] ), temp, S_fx[temp2 % ( 4 * Lag )] ) ); - temp2 = L_add( temp2, (Word32) ph ); -#endif move16(); move16(); } @@ -668,15 +620,9 @@ void Q2phaseShift_fx( FOR( k = 0; k <= HalfLag; k++ ) { temp = X_fx->a_fx[k]; -#ifdef BASOP_NOGLOB X_fx->a_fx[k] = round_fx_o( L_mac_o( L_mult_o( temp, C_fx[temp2 % ( 4 * Lag )], &Overflow ), X_fx->b_fx[k], S_fx[temp2 % ( 4 * Lag )], &Overflow ), &Overflow ); /* X.Q */ X_fx->b_fx[k] = round_fx_o( L_msu_o( L_mult_o( X_fx->b_fx[k], C_fx[temp2 % ( 4 * Lag )], &Overflow ), temp, S_fx[temp2 % ( 4 * Lag )], &Overflow ), &Overflow ); temp2 = add_o( (Word16) temp2, negate( ph ), &Overflow ); -#else - X_fx->a_fx[k] = round_fx( L_mac( L_mult( temp, C_fx[temp2 % ( 4 * Lag )] ), X_fx->b_fx[k], S_fx[temp2 % ( 4 * Lag )] ) ); /* X.Q */ - X_fx->b_fx[k] = round_fx( L_msu( L_mult( X_fx->b_fx[k], C_fx[temp2 % ( 4 * Lag )] ), temp, S_fx[temp2 % ( 4 * Lag )] ) ); - temp2 = add( (Word16) temp2, negate( ph ) ); -#endif move16(); move16(); } @@ -820,23 +766,13 @@ void DTFS_to_fs_fx( exp = norm_s( X_fx->lag_fx ); tmp = div_s( shl( 1, sub( 14, exp ) ), X_fx->lag_fx ); /* Q29-exp */ -#ifdef BASOP_NOGLOB L_tmp1 = L_mult_o( 12800, tmp, &Overflow ); /* Q(30-exp) */ diff_fx = extract_h( L_shl_o( L_tmp1, sub( exp, 14 ), &Overflow ) ); /* Q0 */ -#else - L_tmp1 = L_mult( 12800, tmp ); /* Q(30-exp) */ - diff_fx = extract_h( L_shl( L_tmp1, sub( exp, 14 ) ) ); /* Q0 */ -#endif exp = norm_s( diff_fx ); tmp = div_s( shl( 1, sub( 14, exp ) ), diff_fx ); /* Q29-exp */ -#ifdef BASOP_NOGLOB L_tmp1 = L_mult_o( X_fx->upper_cut_off_freq_fx, tmp, &Overflow ); /* Q(30-exp) */ nH_band = extract_h( L_shl_o( L_tmp1, sub( exp, 14 ), &Overflow ) ); /* Q0 */ -#else - L_tmp1 = L_mult( X_fx->upper_cut_off_freq_fx, tmp ); /* Q(30-exp) */ - nH_band = extract_h( L_shl( L_tmp1, sub( exp, 14 ) ) ); /* Q0 */ -#endif nH_4kHz = mult( 10240, ( X_fx->lag_fx ) ); /* 4000/12800 in Q15 */ if ( GE_16( sub( X_fx->upper_cut_off_freq_fx, shr( (Word16) L_mult( diff_fx, nH_band ), 1 ) ), diff_fx ) ) @@ -860,13 +796,8 @@ void DTFS_to_fs_fx( exp = norm_s( N ); tmp = div_s( shl( 1, ( sub( 14, exp ) ) ), N ); -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( tmp, add( exp, 6 ), &Overflow ); inv_lag = round_fx_o( L_tmp, &Overflow ); -#else - L_tmp = L_shl( tmp, add( exp, 6 ) ); - inv_lag = round_fx( L_tmp ); -#endif Lx0 = L_deposit_h( x[0] ); Labmax = L_deposit_l( 0 ); FOR( k = 1; k <= nH; k++ ) @@ -880,13 +811,8 @@ void DTFS_to_fs_fx( move16(); FOR( n = 1; n < N; n++ ) { -#ifdef BASOP_NOGLOB L_a = L_mac0_o( L_a, x[n], C_fx[( 4 * sum ) % ( 4 * N )], &Overflow ); /* Q16 of x[n]*cos(sum) */ L_b = L_mac0_o( L_b, x[n], S_fx[( 4 * sum ) % ( 4 * N )], &Overflow ); /* Q16 of x[n]*sin(sum) */ -#else - L_a = L_mac0( L_a, x[n], C_fx[( 4 * sum ) % ( 4 * N )] ); /* Q16 of x[n]*cos(sum) */ - L_b = L_mac0( L_b, x[n], S_fx[( 4 * sum ) % ( 4 * N )] ); /* Q16 of x[n]*sin(sum) */ -#endif sum = add( sum, temp ); } La[k] = L_shr( L_a, 6 ); /* Q8 of a[k]*2.0 */ @@ -923,22 +849,13 @@ void DTFS_to_fs_fx( temp_neg = negate( temp ); FOR( n = 0; n < N - 1; n += 2 ) { -#ifdef BASOP_NOGLOB L_a = L_mac_o( L_a, x[n], temp, &Overflow ); /* Q1 */ L_a = L_mac_o( L_a, x[n + 1], temp_neg, &Overflow ); -#else - L_a = L_mac( L_a, x[n], temp ); /* Q1 */ - L_a = L_mac( L_a, x[n + 1], temp_neg ); -#endif /*temp= negate(temp); */ } if ( s_and( N, 1 ) ) /*if N is odd we need to calculate last */ { -#ifdef BASOP_NOGLOB L_a = L_mac_o( L_a, x[n], temp, &Overflow ); /* Q1 */ -#else - L_a = L_mac( L_a, x[n], temp ); /* Q1 */ -#endif } La[k] = L_shl( L_a, 7 ); @@ -965,7 +882,6 @@ void DTFS_to_fs_fx( FOR( k = 1; k <= nH; k++ ) { -#ifdef BASOP_NOGLOB X_fx->a_fx[k] = round_fx_o( L_shl_o( La[k], temp, &Overflow ), &Overflow ); /* Q(8+temp-16)=Q(temp-8) */ move16(); X_fx->a_fx[k] = mult_ro( X_fx->a_fx[k], inv_lag, &Overflow ); @@ -974,28 +890,13 @@ void DTFS_to_fs_fx( move16(); X_fx->b_fx[k] = mult_ro( X_fx->b_fx[k], inv_lag, &Overflow ); move16(); /* Q(temp-8+19+1-16)=Q(temp-4) of b[k]*2.0/N */ -#else - X_fx->a_fx[k] = round_fx( L_shl( La[k], temp ) ); /* Q(8+temp-16)=Q(temp-8) */ - move16(); - X_fx->a_fx[k] = mult_r( X_fx->a_fx[k], inv_lag ); - move16(); /* Q(temp-8+19+1-16)=Q(temp-4) of a[k]*2.0/N */ - X_fx->b_fx[k] = round_fx( L_shl( Lb[k], temp ) ); /* Q(8+temp-16)=Q(temp-8) */ - move16(); - X_fx->b_fx[k] = mult_r( X_fx->b_fx[k], inv_lag ); - move16(); /* Q(temp-8+19+1-16)=Q(temp-4) of b[k]*2.0/N */ -#endif } /* IF ( N%2 == 0 ) */ IF( s_and( N, 1 ) == 0 ) { -#ifdef BASOP_NOGLOB X_fx->a_fx[k] = round_fx_o( L_shl_o( La[k], temp, &Overflow ), &Overflow ); /* Q(8+temp-16)=Q(temp-8) */ X_fx->a_fx[k] = mult_ro( X_fx->a_fx[k], inv_lag, &Overflow ); -#else - X_fx->a_fx[k] = round_fx( L_shl( La[k], temp ) ); /* Q(8+temp-16)=Q(temp-8) */ - X_fx->a_fx[k] = mult_r( X_fx->a_fx[k], inv_lag ); -#endif move16(); move16(); /* Q(temp-8+19+1-16)=Q(temp-4) of a[k]*1.0/N */ X_fx->b_fx[k] = 0; @@ -1249,11 +1150,7 @@ static void DTFS_transform_fx( m = L_add( 1000 * LL - OSLENGTH / 2, add( l1, j ) ) % LL; /* use circular addressing */ tmptmp3_40_fx = L_add( tmptmp3_40_fx, Mult_32_16( x_r_fx[m], sinc_fx[k][j] ) ); } -#ifdef BASOP_NOGLOB out_fx[i] = round_fx_sat( L_shl_sat( tmptmp3_40_fx, 2 ) ); -#else - out_fx[i] = round_fx( L_shl( tmptmp3_40_fx, 2 ) ); -#endif move16(); } @@ -1320,17 +1217,11 @@ void DTFS_zeroFilter_fx( FOR( n = 0; n < N; n++ ) { -#ifdef BASOP_NOGLOB sum1_fx = L_mac_o( sum1_fx, LPC[n], C_fx[( 4 * temp2 ) % ( 4 * X_fx->lag_fx )], &Overflow ); /* Q(12+15+1) */ sum2_fx = L_mac_o( sum2_fx, LPC[n], S_fx[( 4 * temp2 ) % ( 4 * X_fx->lag_fx )], &Overflow ); -#else - sum1_fx = L_mac( sum1_fx, LPC[n], C_fx[i_mult( 4, temp2 ) % i_mult( 4, X_fx->lag_fx )] ); /* Q(12+15+1) */ - sum2_fx = L_mac( sum2_fx, LPC[n], S_fx[i_mult( 4, temp2 ) % i_mult( 4, X_fx->lag_fx )] ); -#endif temp2 = add( temp2, temp ); } -#ifdef BASOP_NOGLOB temp1 = round_fx_o( sum1_fx, &Overflow ); /* Q(12+15+1-16)=Q(12) */ temp2 = round_fx_o( sum2_fx, &Overflow ); /* Q(12) */ @@ -1339,16 +1230,6 @@ void DTFS_zeroFilter_fx( L_temp1 = L_msu_o( L_temp1, temp2, X_fx->b_fx[k], &Overflow ); /* Q(12+Q+1) */ L_temp2 = L_mult_o( temp1, X_fx->b_fx[k], &Overflow ); L_temp2 = L_mac_o( L_temp2, temp2, X_fx->a_fx[k], &Overflow ); /* Q(12+Q+1) */ -#else - temp1 = round_fx( sum1_fx ); /* Q(12+15+1-16)=Q(12) */ - temp2 = round_fx( sum2_fx ); /* Q(12) */ - - /* Calculate the circular convolution */ - L_temp1 = L_mult( temp1, X_fx->a_fx[k] ); - L_temp1 = L_msu( L_temp1, temp2, X_fx->b_fx[k] ); /* Q(12+Q+1) */ - L_temp2 = L_mult( temp1, X_fx->b_fx[k] ); - L_temp2 = L_mac( L_temp2, temp2, X_fx->a_fx[k] ); /* Q(12+Q+1) */ -#endif /* normalization */ na = norm_l( L_temp1 ); if ( L_temp1 == 0 ) @@ -1368,13 +1249,8 @@ void DTFS_zeroFilter_fx( nb = na; move16(); } -#ifdef BASOP_NOGLOB X_fx->a_fx[k] = round_fx_o( (Word32) L_shl_o( L_temp1, nb, &Overflow ), &Overflow ); /* Q(13+Q+nb-16)=Q(Q+nb-3) */ X_fx->b_fx[k] = round_fx_o( (Word32) L_shl_o( L_temp2, nb, &Overflow ), &Overflow ); /* Q(Q+nb-3) */ -#else - X_fx->a_fx[k] = round_fx( (Word32) L_shl( L_temp1, nb ) ); /* Q(13+Q+nb-16)=Q(Q+nb-3) */ - X_fx->b_fx[k] = round_fx( (Word32) L_shl( L_temp2, nb ) ); /* Q(Q+nb-3) */ -#endif move32(); move32(); @@ -1390,17 +1266,10 @@ void DTFS_zeroFilter_fx( /* bring to the same Q */ FOR( k = 0; k <= HalfLag; k++ ) { -#ifdef BASOP_NOGLOB X_fx->a_fx[k] = shl_o( X_fx->a_fx[k], sub( Qmin, Qab[k] ), &Overflow ); move16(); /* Q(Q+Qab[k]+Qmin-Qab[k]=Q(Q+Qmin) */ X_fx->b_fx[k] = shl_o( X_fx->b_fx[k], sub( Qmin, Qab[k] ), &Overflow ); move16(); /* Q(Q+Qmin) */ -#else - X_fx->a_fx[k] = shl( X_fx->a_fx[k], sub( Qmin, Qab[k] ) ); - move16(); /* Q(Q+Qab[k]+Qmin-Qab[k]=Q(Q+Qmin) */ - X_fx->b_fx[k] = shl( X_fx->b_fx[k], sub( Qmin, Qab[k] ) ); - move16(); /* Q(Q+Qmin) */ -#endif } X_fx->Q = add( X_fx->Q, Qmin ); @@ -1657,23 +1526,14 @@ Word32 DTFS_getEngy_fx( temp_b_fx = X_fx->b_fx[k]; move16(); -#ifdef BASOP_NOGLOB en_fx = L_mac0_o( en_fx, temp_a_fx, temp_a_fx, &Overflow ); en_fx = L_mac0_o( en_fx, temp_b_fx, temp_b_fx, &Overflow ); -#else - en_fx = L_mac0( en_fx, temp_a_fx, temp_a_fx ); - en_fx = L_mac0( en_fx, temp_b_fx, temp_b_fx ); -#endif } en_fx = L_shr( en_fx, 1 ); temp_a_fx = X_fx->a_fx[0]; move16(); -#ifdef BASOP_NOGLOB en_fx = L_mac0_o( en_fx, temp_a_fx, temp_a_fx, &Overflow ); -#else - en_fx = L_mac0( en_fx, temp_a_fx, temp_a_fx ); -#endif /* IF (X_fx->lag_fx%2 == 0) */ IF( s_and( X_fx->lag_fx, 1 ) == 0 ) { @@ -1682,13 +1542,8 @@ Word32 DTFS_getEngy_fx( temp_b_fx = X_fx->b_fx[k]; move16(); -#ifdef BASOP_NOGLOB en_fx = L_mac0_o( en_fx, temp_a_fx, temp_a_fx, &Overflow ); en_fx = L_mac0_o( en_fx, temp_b_fx, temp_b_fx, &Overflow ); -#else - en_fx = L_mac0( en_fx, temp_a_fx, temp_a_fx ); - en_fx = L_mac0( en_fx, temp_b_fx, temp_b_fx ); -#endif } return en_fx; /* 2*X1.Q+1=Q13 */ @@ -1727,30 +1582,16 @@ Word32 DTFS_getEngy_P2A_fx( HalfLag_fx = s_min( HalfLag_fx, X_fx->nH_fx ); FOR( k = 1; k <= HalfLag_fx; k++ ) { -#ifdef BASOP_NOGLOB en_fx = L_mac0_o( en_fx, X_fx->a_fx[k], X_fx->a_fx[k], &Overflow ); en_fx = L_mac0_o( en_fx, X_fx->b_fx[k], X_fx->b_fx[k], &Overflow ); -#else - en_fx = L_mac0( en_fx, X_fx->a_fx[k], X_fx->a_fx[k] ); - en_fx = L_mac0( en_fx, X_fx->b_fx[k], X_fx->b_fx[k] ); -#endif } en_fx = L_shr( en_fx, 1 ); -#ifdef BASOP_NOGLOB en_fx = L_mac0_o( en_fx, X_fx->a_fx[0], X_fx->a_fx[0], &Overflow ); -#else - en_fx = L_mac0( en_fx, X_fx->a_fx[0], X_fx->a_fx[0] ); -#endif /* IF (X_fx->lag_fx%2 == 0) */ IF( s_and( X_fx->lag_fx, 1 ) == 0 ) { -#ifdef BASOP_NOGLOB en_fx = L_mac0_o( en_fx, X_fx->a_fx[k], X_fx->a_fx[k], &Overflow ); en_fx = L_mac0_o( en_fx, X_fx->b_fx[k], X_fx->b_fx[k], &Overflow ); -#else - en_fx = L_mac0( en_fx, X_fx->a_fx[k], X_fx->a_fx[k] ); - en_fx = L_mac0( en_fx, X_fx->b_fx[k], X_fx->b_fx[k] ); -#endif } return en_fx; /* 2*X1.Q */ @@ -1810,11 +1651,7 @@ static Word32 DTFS_setEngy_fx( expb = norm_l( en1_fx ); -#ifdef BASOP_NOGLOB fracb = round_fx_sat( L_shl_sat( en1_fx, expb ) ); -#else - fracb = round_fx( L_shl( en1_fx, expb ) ); -#endif expb = sub( 30, add( expb, shl( X_DTFS_FX->Q, 1 ) ) ); @@ -1892,11 +1729,7 @@ void DTFS_car2pol_fx( { Lacc_fx = L_mult( X_fx->a_fx[k], X_fx->a_fx[k] ); /* a[k]^2, 2Q+1 */ -#ifdef BASOP_NOGLOB Lacc_fx = L_mac_o( Lacc_fx, X_fx->b_fx[k], X_fx->b_fx[k], &Overflow ); /* a[k]^2+b[k]^2, 2Q+1 */ -#else - Lacc_fx = L_mac( Lacc_fx, X_fx->b_fx[k], X_fx->b_fx[k] ); /* a[k]^2+b[k]^2, 2Q+1 */ -#endif Lacc_fx = L_shr( Lacc_fx, 3 ); /* Lacc=(a[k]^2+b[k]^2)/4, 2Q */ IF( Lacc_fx ) @@ -2019,11 +1852,7 @@ Word32 DTFS_setEngyHarm_fx( Lacc = L_deposit_l( 0 ); FOR( k = f_low_fx + 1; k <= HalfLag_fx; k++ ) { -#ifdef BASOP_NOGLOB Lacc = L_mac0_o( Lacc, X_fx->a_fx[k], X_fx->a_fx[k], &Overflow ); /* 2*X1.Q */ -#else - Lacc = L_mac0( Lacc, X_fx->a_fx[k], X_fx->a_fx[k] ); /* 2*X1.Q */ -#endif Lacc_max = L_max( Lacc_max, Lacc ); count = add( count, 1 ); @@ -2038,13 +1867,8 @@ Word32 DTFS_setEngyHarm_fx( Lacc = L_deposit_l( 0 ); FOR( k = f_low_fx + 1; k <= HalfLag_fx; k++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mult_o( X_fx->a_fx[k], X_fx->a_fx[k], &Overflow ); Lacc = L_add_o( Lacc, L_shr( L_tmp, expp ), &Overflow ); /* 2*X1.Q-expp */ -#else - L_tmp = L_mult( X_fx->a_fx[k], X_fx->a_fx[k] ); - Lacc = L_add( Lacc, L_shr( L_tmp, expp ) ); /* 2*X1.Q-expp */ -#endif count = add( count, 1 ); } } @@ -2057,11 +1881,7 @@ Word32 DTFS_setEngyHarm_fx( exp = norm_s( count ); tmp = div_s( shl( 1, sub( 14, exp ) ), count ); /* 29 - exp */ -#ifdef BASOP_NOGLOB en1_fx = L_shl_o( Mult_32_16( Lacc, tmp ), sub( exp, 14 ), &Overflow ); -#else - en1_fx = L_shl( Mult_32_16( Lacc, tmp ), sub( exp, 14 ) ); -#endif test(); IF( en1_fx > 0 && en2_fx > 0 ) { @@ -2072,11 +1892,7 @@ Word32 DTFS_setEngyHarm_fx( expb = norm_l( en1_fx ); -#ifdef BASOP_NOGLOB fracb = round_fx_o( L_shl_o( en1_fx, expb, &Overflow ), &Overflow ); -#else - fracb = round_fx( L_shl( en1_fx, expb ) ); -#endif IF( GE_32( Lacc_max, 2147483647 /*1.Q31*/ ) ) { expb = sub( 30, add( expb, sub( shl( X_fx->Q, 1 ), expp ) ) ); @@ -2114,11 +1930,7 @@ Word32 DTFS_setEngyHarm_fx( { /*L_temp_fx =(Word32)Mpy_32_16(extract_h(factor_fx),extract_l(factor_fx), X_fx->a_fx[k]); move32(); */ /* Q(temp+X1.Q-15) */ L_temp_fx = Mult_32_16( factor_fx, X_fx->a_fx[k] ); /* Q(temp+X1.Q-15) */ -#ifdef BASOP_NOGLOB X_fx->a_fx[k] = round_fx_o( L_temp_fx, &Overflow ); /* Q(temp+X1.Q-15-16)=Q(temp+X1.Q-31); */ -#else - X_fx->a_fx[k] = round_fx( L_temp_fx ); /* Q(temp+X1.Q-15-16)=Q(temp+X1.Q-31); */ -#endif move16(); } @@ -2254,11 +2066,7 @@ static void cubicPhase_fx( Ltemp3 = L_sub( Ltemp3, L_shl( Ltemp1, 1 ) ); /* Ltemp3=N*c1-2*Ltemp1, Q20 */ -#ifdef BASOP_NOGLOB IF( GE_32( L_abs( Ltemp3 ), L_shl_o( Ltemp2, 8, &Overflow ) ) ) -#else - IF( GE_32( L_abs( Ltemp3 ), L_shl( Ltemp2, 8 ) ) ) -#endif { Lacc = L_add( MIN_32, 0 ); if ( Ltemp3 > 0 ) @@ -2271,11 +2079,7 @@ static void cubicPhase_fx( ELSE { expa = norm_l( Ltemp3 ); -#ifdef BASOP_NOGLOB fraca = extract_h( L_shl_o( Ltemp3, expa, &Overflow ) ); -#else - fraca = extract_h( L_shl( Ltemp3, expa ) ); -#endif expa = sub( 30, add( expa, 20 ) ); if ( fraca < 0 ) { @@ -2284,11 +2088,7 @@ static void cubicPhase_fx( } expb = norm_l( Ltemp2 ); -#ifdef BASOP_NOGLOB fracb = extract_h( L_shl_o( Ltemp2, expb, &Overflow ) ); -#else - fracb = extract_h( L_shl( Ltemp2, expb ) ); -#endif expb = sub( 30, expb ); if ( fracb < 0 ) { @@ -2305,11 +2105,7 @@ static void cubicPhase_fx( fracb = negate( fracb ); } scale = shr( sub( fracb, fraca ), 15 ); -#ifdef BASOP_NOGLOB fraca = shl_o( fraca, scale, &Overflow ); -#else - fraca = shl( fraca, scale ); -#endif expa = sub( expa, scale ); tmp = div_s( fraca, fracb ); /* 15-exp */ @@ -2325,13 +2121,8 @@ static void cubicPhase_fx( tmp = negate( tmp ); } -#ifdef BASOP_NOGLOB Lacc = L_shl_o( tmp, add( exp, 34 ), &Overflow ); Lacc = L_add_o( Lacc, 0x08000, &Overflow ); -#else - Lacc = L_shl( tmp, add( exp, 34 ) ); - Lacc = L_add( Lacc, 0x08000 ); -#endif c0 = extract_h( Lacc ); /* c0 in Q33 */ } @@ -2457,11 +2248,7 @@ static void cubicPhase_fx( Ltemp3 = L_add( Ltemp3, 1 ); } -#ifdef BASOP_NOGLOB Ltemp3 = L_shl_o( Mult_32_16( L_shl_o( Ltemp3, 7, &Overflow ), c0 ), 2, &Overflow ); /* Ltemp3=c0*n^3, Q27 */ -#else - Ltemp3 = L_shl( Mult_32_16( L_shl( Ltemp3, 7 ), c0 ), 2 ); /* Ltemp3=c0*n^3, Q27 */ -#endif Ltemp2 = L_shl( Mult_32_16( N2, c1 ), 1 ); /* Ltemp2 = (Word32)L_mult_su(c1,(UNS_Word16)n2); : Ltemp2=c1*n^2, Q27 */ Ltemp1 = L_shl( L_mult( c2, n ), 7 ); /* Ltemp1=c2*n, Q27 */ @@ -2587,12 +2374,8 @@ void DTFS_to_erb_fx( FOR( i = 0; i < num_erb_fx; i++ ) { -#ifdef BASOP_NOGLOB out_fx[i] = round_fx_o( L_shl_o( sum_a_fx[i], n, &Overflow ), &Overflow ); /* Q13 */ move16(); -#else - out_fx[i] = round_fx( L_shl( sum_a_fx[i], n ) ); /* Q13 */ -#endif IF( GT_16( count[i], 1 ) ) { IF( sum_a_fx[i] < 0 ) @@ -2619,14 +2402,8 @@ void DTFS_to_erb_fx( tmp = div_s( fracb, fraca ); exp = sub( expb, expa ); -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( tmp, add( exp, 14 ) ); out_fx[i] = round_fx_sat( L_tmp ); -#else - L_tmp = L_shl( tmp, add( exp, 14 ) ); - - out_fx[i] = round_fx( L_tmp ); -#endif move16(); } } @@ -2754,29 +2531,17 @@ void erb_slot_fx( } FOR( j = 0; j < num_erb_fx; j++ ) { -#ifdef BASOP_NOGLOB mfreq_fx[j] = round_fx_o( L_shl_o( mf_fx[j], 11, &Overflow ), &Overflow ); /* Q15 */ -#else - mfreq_fx[j] = round_fx( L_shl( mf_fx[j], 11 ) ); /* Q15 */ -#endif move16(); IF( GT_16( out_fx[j], 1 ) ) { expb = norm_l( mf_fx[j] ); -#ifdef BASOP_NOGLOB fracb = round_fx_o( L_shl_o( mf_fx[j], expb, &Overflow ), &Overflow ); -#else - fracb = round_fx( L_shl( mf_fx[j], expb ) ); -#endif expb = sub( 30, add( expb, 20 ) ); expa = norm_l( out_fx[j] ); -#ifdef BASOP_NOGLOB fraca = extract_h( L_shl_o( out_fx[j], expa, &Overflow ) ); -#else - fraca = extract_h( L_shl( out_fx[j], expa ) ); -#endif expa = sub( 30, expa ); scale = shr( sub( fraca, fracb ), 15 ); @@ -2785,16 +2550,10 @@ void erb_slot_fx( tmp = div_s( fracb, fraca ); exp = sub( expb, expa ); -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( tmp, add( exp, 16 ), &Overflow ); mfreq_fx[j] = round_fx_o( L_tmp, &Overflow ); move16(); -#else - L_tmp = L_shl( tmp, add( exp, 16 ) ); - - mfreq_fx[j] = round_fx( L_tmp ); -#endif } } return; @@ -2933,11 +2692,7 @@ void DTFS_erb_inv_fx( d2h = 31; move16(); } -#ifdef BASOP_NOGLOB X_fx->a_fx[i] = round_fx_o( L_shl_o( Ltemp_fx, d2h, &Overflow ), &Overflow ); /* Q(28-n+d2h) */ -#else - X_fx->a_fx[i] = round_fx( L_shl( Ltemp_fx, d2h ) ); /* Q(28-n+d2h) */ -#endif move16(); q[i] = add( sub( 28, n ), d2h ); move16(); @@ -3481,11 +3236,7 @@ Word16 ppp_extract_pitch_period_fx( spike = i; move16(); } -#ifdef BASOP_NOGLOB en1 = L_mac0_sat( en1, ptr[i], ptr[i] ); /* Q0 */ -#else - en1 = L_mac0( en1, ptr[i], ptr[i] ); /* Q0 */ -#endif } IF( ptr[spike] > 0 ) @@ -3618,11 +3369,7 @@ Word16 ppp_extract_pitch_period_fx( Lacc = L_deposit_l( 0 ); FOR( i = 0; i < l; i++ ) { -#ifdef BASOP_NOGLOB Lacc = L_mac0_sat( Lacc, out[i], out[i] ); /* Q0 */ -#else - Lacc = L_mac0( Lacc, out[i], out[i] ); /* Q0 */ -#endif } @@ -3636,11 +3383,7 @@ Word16 ppp_extract_pitch_period_fx( expb = norm_l( Lacc ); -#ifdef BASOP_NOGLOB fracb = round_fx_sat( L_shl_sat( Lacc, expb ) ); -#else - fracb = round_fx( L_shl( Lacc, expb ) ); -#endif expb = sub( 30, add( expb, Qres ) ); scale1 = shr( sub( fraca, fracb ), 15 ); @@ -3700,11 +3443,7 @@ void DTFS_peaktoaverage_fx( DTFS_STRUCTURE X_fx, Word32 *pos_fx, Word16 *Qpos, W FOR( i = 0; i < 256; i++ ) { -#ifdef BASOP_NOGLOB L_temp = L_mult_sat( time_fx[i], time_fx[i] ); /* Q(1) */ -#else - L_temp = L_mult( time_fx[i], time_fx[i] ); /* Q(1) */ -#endif IF( time_fx[i] >= 0 ) { if ( GT_32( L_temp, maxPosEn_fx ) ) @@ -3742,29 +3481,17 @@ void DTFS_peaktoaverage_fx( DTFS_STRUCTURE X_fx, Word32 *pos_fx, Word16 *Qpos, W ELSE { expa = norm_l( maxPosEn_fx ); -#ifdef BASOP_NOGLOB fraca = extract_h( L_shl_o( maxPosEn_fx, expa, &Overflow ) ); -#else - fraca = extract_h( L_shl( maxPosEn_fx, expa ) ); -#endif expa = sub( 30, add( expa, 1 ) ); expb = norm_l( L_sum ); -#ifdef BASOP_NOGLOB fracb = round_fx_o( L_shl_o( L_sum, expb, &Overflow ), &Overflow ); -#else - fracb = round_fx( L_shl( L_sum, expb ) ); -#endif expb = sub( 30, add( expb, shl( X_fx.Q, 1 ) ) ); scale = shr( sub( fraca, fracb ), 15 ); -#ifdef BASOP_NOGLOB fracb = shl_o( fracb, scale, &Overflow ); -#else - fracb = shl( fracb, scale ); -#endif expb = sub( expb, scale ); tmp = div_s( fracb, fraca ); @@ -3788,29 +3515,17 @@ void DTFS_peaktoaverage_fx( DTFS_STRUCTURE X_fx, Word32 *pos_fx, Word16 *Qpos, W { expa = norm_l( maxNegEn_fx ); -#ifdef BASOP_NOGLOB fraca = extract_h( L_shl_o( maxNegEn_fx, expa, &Overflow ) ); -#else - fraca = extract_h( L_shl( maxNegEn_fx, expa ) ); -#endif expa = sub( Q29, expa ); // 30 - expa - 1; expb = norm_l( L_sum ); -#ifdef BASOP_NOGLOB fracb = round_fx_o( L_shl_o( L_sum, expb, &Overflow ), &Overflow ); -#else - fracb = round_fx( L_shl( L_sum, expb ) ); -#endif expb = sub( 30, add( expb, shl( X_fx.Q, 1 ) ) ); scale = shr( sub( fraca, fracb ), 15 ); -#ifdef BASOP_NOGLOB fracb = shl_o( fracb, scale, &Overflow ); -#else - fracb = shl( fracb, scale ); -#endif expb = sub( expb, scale ); tmp = div_s( fracb, fraca ); @@ -4109,7 +3824,6 @@ static void c_fft_wi_fx( Word16 *farray_ptr_fx, Word16 size, Word16 stage, Word1 tmp1 = round_fx( ftmp_real_fx ); tmp2 = round_fx( ftmp_imag_fx ); -#ifdef BASOP_NOGLOB *( farray_ptr_fx + kj ) = sub_sat( *( farray_ptr_fx + k ), tmp1 ); move16(); *( farray_ptr_fx + kj + 1 ) = sub_sat( *( farray_ptr_fx + k + 1 ), tmp2 ); @@ -4118,16 +3832,6 @@ static void c_fft_wi_fx( Word16 *farray_ptr_fx, Word16 size, Word16 stage, Word1 move16(); *( farray_ptr_fx + k + 1 ) = add_sat( *( farray_ptr_fx + k + 1 ), tmp2 ); move16(); -#else - *( farray_ptr_fx + kj ) = sub( *( farray_ptr_fx + k ), tmp1 ); - move16(); - *( farray_ptr_fx + kj + 1 ) = sub( *( farray_ptr_fx + k + 1 ), tmp2 ); - move16(); - *( farray_ptr_fx + k ) = add( *( farray_ptr_fx + k ), tmp1 ); - move16(); - *( farray_ptr_fx + k + 1 ) = add( *( farray_ptr_fx + k + 1 ), tmp2 ); - move16(); -#endif } } } @@ -4314,13 +4018,8 @@ void copy_phase_fx( DTFS_STRUCTURE *X1_fx, DTFS_STRUCTURE X2_fx, DTFS_STRUCTURE FOR( k = 1; k <= HalfLag; k++ ) { -#ifdef BASOP_NOGLOB Lacc_fx = L_mult_o( X1_fx->a_fx[k], X1_fx->a_fx[k], &Overflow ); Lacc_fx = L_mac_o( Lacc_fx, X1_fx->b_fx[k], X1_fx->b_fx[k], &Overflow ); /* 2*Q+1 */ -#else - Lacc_fx = L_mult( X1_fx->a_fx[k], X1_fx->a_fx[k] ); - Lacc_fx = L_mac( Lacc_fx, X1_fx->b_fx[k], X1_fx->b_fx[k] ); /* 2*Q+1 */ -#endif exp = norm_l( Lacc_fx ); tmp = extract_h( L_shl( Lacc_fx, exp ) ); @@ -4361,7 +4060,6 @@ void copy_phase_fx( DTFS_STRUCTURE *X1_fx, DTFS_STRUCTURE X2_fx, DTFS_STRUCTURE d1h = extract_h( Ltemp_fx ); d1l = extract_l( Ltemp_fx ); -#ifdef BASOP_NOGLOB Ltemp_fx = L_mult0( X1_fx->b_fx[k], d1l ); Ltemp_fx = L_add_o( L_shr( Ltemp_fx, 15 ), L_mult_o( X1_fx->b_fx[k], d1h, &Overflow ), &Overflow ); /* sin(w) in Q(q+16+Q-15) */ sn = round_fx_o( L_shl_o( Ltemp_fx, sub( 30, add( q, X1_fx->Q ) ), &Overflow ), &Overflow ); /* Q15 */ @@ -4373,19 +4071,6 @@ void copy_phase_fx( DTFS_STRUCTURE *X1_fx, DTFS_STRUCTURE X2_fx, DTFS_STRUCTURE cn = round_fx_o( L_shl_o( Ltemp_fx, sub( 30, add( q, X1_fx->Q ) ), &Overflow ), &Overflow ); /* Q15 */ retX_fx->a_fx[k] = mult_ro( X2_fx.a_fx[k], cn, &Overflow ); /* X2_fx.Q */ move16(); -#else - Ltemp_fx = L_mult0( X1_fx->b_fx[k], d1l ); - Ltemp_fx = L_add( L_shr( Ltemp_fx, 15 ), L_mult( X1_fx->b_fx[k], d1h ) ); /* sin(w) in Q(q+16+Q-15) */ - sn = round_fx( L_shl( Ltemp_fx, sub( 30, add( q, X1_fx->Q ) ) ) ); /* Q15 */ - retX_fx->b_fx[k] = mult_r( X2_fx.a_fx[k], sn ); /* X2_fx.Q */ - move16(); - - Ltemp_fx = L_mult0( X1_fx->a_fx[k], d1l ); - Ltemp_fx = L_add( L_shr( Ltemp_fx, 15 ), L_mult( X1_fx->a_fx[k], d1h ) ); /* cos(w) in Q(q+Q+1) */ - cn = round_fx( L_shl( Ltemp_fx, sub( 30, add( q, X1_fx->Q ) ) ) ); /* Q15 */ - retX_fx->a_fx[k] = mult_r( X2_fx.a_fx[k], cn ); /* X2_fx.Q */ - move16(); -#endif } k = sub( k, 1 ); @@ -4476,11 +4161,7 @@ Word32 getSpEngyFromResAmp_fx( DTFS_STRUCTURE *X_fx, Word16 lband, Word16 hband, FOR( i = 0; i < M + 1; i++ ) { /* Compute Re */ -#ifdef BASOP_NOGLOB Lacc = L_mac_o( Lacc, curr_lpc[i], cos_tab[n % M_fx], &Overflow ); /* Q28 */ -#else - Lacc = L_mac( Lacc, curr_lpc[i], cos_tab[n % M_fx] ); /* Q28 */ -#endif n = add( n, k4 ); /* n=4*i*k */ } Re = L_shr( Lacc, 1 ); /* Q27 */ @@ -4491,20 +4172,12 @@ Word32 getSpEngyFromResAmp_fx( DTFS_STRUCTURE *X_fx, Word16 lband, Word16 hband, FOR( i = 0; i < M + 1; i++ ) { /* Compute Im */ -#ifdef BASOP_NOGLOB Lacc = L_msu_o( Lacc, curr_lpc[i], sin_tab[n % M_fx], &Overflow ); /* Q28 */ -#else - Lacc = L_msu( Lacc, curr_lpc[i], sin_tab[n % M_fx] ); /* Q28 */ -#endif n = add( n, k4 ); /* n=4*i*k */ } Im = L_shr( Lacc, 1 ); /* Q27 */ /* Lacc=L_add(L_mult_ll(Re,Re),(Word32)L_mult_ll(Im,Im)); : Lacc=Re^2+Im^2 in Q23 */ -#ifdef BASOP_NOGLOB Lacc = L_add_o( Mult_32_32( Re, Re ), Mult_32_32( Im, Im ), &Overflow ); /* Lacc=Re^2+Im^2 in Q23 */ -#else - Lacc = L_add( Mult_32_32( Re, Re ), Mult_32_32( Im, Im ) ); /* Lacc=Re^2+Im^2 in Q23 */ -#endif Ltemp = L_mult0( X_fx->a_fx[k], X_fx->a_fx[k] ); /* 2*a[k]^2 in 2Q */ /* Ltemp=(Word32)L_sat32_40(divide_dp(Ltemp,Lacc,-19,1)); : Ltemp in Q(2Q-13) */ @@ -4531,11 +4204,7 @@ Word32 getSpEngyFromResAmp_fx( DTFS_STRUCTURE *X_fx, Word16 lband, Word16 hband, tmp = div_s( fracb, fraca ); /* 15-exp */ exp = sub( expb, expa ); -#ifdef BASOP_NOGLOB Ltemp = L_shl_o( tmp, sub( add( shl( X_fx->Q, 1 ), exp ), 27 ), &Overflow ); -#else - Ltemp = L_shl( tmp, sub( add( shl( X_fx->Q, 1 ), exp ), 27 ) ); -#endif } ELSE { @@ -4601,41 +4270,21 @@ void DTFS_poleFilter_fx( DTFS_STRUCTURE *X_fx, Word16 *LPC, Word16 N, Word16 *S_ sum2_fx = L_deposit_l( 0 ); FOR( n = 0; n < N; n++ ) { -#ifdef BASOP_NOGLOB sum1_fx = L_mac_o( sum1_fx, LPC[n], C_fx[shl( temp2, 2 ) % shl( X_fx->lag_fx, 2 )], &Overflow ); /* Q(12+15+1) */ sum2_fx = L_mac_o( sum2_fx, LPC[n], S_fx[shl( temp2, 2 ) % shl( X_fx->lag_fx, 2 )], &Overflow ); /* Q(12+15+1) */ -#else - sum1_fx = L_mac( sum1_fx, LPC[n], C_fx[( 4 * temp2 ) % ( 4 * X_fx->lag_fx )] ); /* Q(12+15+1) */ - sum2_fx = L_mac( sum2_fx, LPC[n], S_fx[( 4 * temp2 ) % ( 4 * X_fx->lag_fx )] ); /* Q(12+15+1) */ -#endif temp2 = add( temp2, k ); } -#ifdef BASOP_NOGLOB temp1 = round_fx_o( sum1_fx, &Overflow ); /* Q(12+15+1-16)=Q(12) */ temp2 = round_fx_o( sum2_fx, &Overflow ); /* Q(12) */ /* Calculate the circular convolution */ sum = L_mac_o( L_mult_o( temp1, temp1, &Overflow ), temp2, temp2, &Overflow ); /* Q(12+12+1)=Q(25) */ -#else - temp1 = round_fx( sum1_fx ); /* Q(12+15+1-16)=Q(12) */ - temp2 = round_fx( sum2_fx ); /* Q(12) */ - /* Calculate the circular convolution */ - sum = L_mac( L_mult( temp1, temp1 ), temp2, temp2 ); /* Q(12+12+1)=Q(25) */ -#endif L_temp1 = L_mult( temp1, X_fx->a_fx[k] ); -#ifdef BASOP_NOGLOB L_temp1 = L_mac_o( L_temp1, temp2, X_fx->b_fx[k], &Overflow ); /* Q(12+Q+1)=Q(13+Q) */ -#else - L_temp1 = L_mac( L_temp1, temp2, X_fx->b_fx[k] ); /* Q(12+Q+1)=Q(13+Q) */ -#endif L_temp2 = L_mult( temp1, X_fx->b_fx[k] ); -#ifdef BASOP_NOGLOB L_temp2 = L_msu_o( L_temp2, temp2, X_fx->a_fx[k], &Overflow ); /* Q(12+Q+1)=Q(13+Q) */ -#else - L_temp2 = L_msu( L_temp2, temp2, X_fx->a_fx[k] ); /* Q(12+Q+1)=Q(13+Q) */ -#endif IF( sum ) { exp = norm_l( sum ); @@ -4750,13 +4399,8 @@ void poleFilter_setup_fx( const Word16 *LPC, Word16 N, DTFS_STRUCTURE X_fx, Word sum2_fx = L_deposit_l( 0 ); FOR( n = 0; n < N; n++ ) { -#ifdef BASOP_NOGLOB sum1_fx = L_mac_o( sum1_fx, LPC[n], C_fx[( 4 * temp2 ) % ( 4 * X_fx.lag_fx )], &Overflow ); /* Q(12+15+1) */ sum2_fx = L_mac_o( sum2_fx, LPC[n], S_fx[( 4 * temp2 ) % ( 4 * X_fx.lag_fx )], &Overflow ); /* Q(12+15+1) */ -#else - sum1_fx = L_mac( sum1_fx, LPC[n], C_fx[( 4 * temp2 ) % ( 4 * X_fx.lag_fx )] ); /* Q(12+15+1) */ - sum2_fx = L_mac( sum2_fx, LPC[n], S_fx[( 4 * temp2 ) % ( 4 * X_fx.lag_fx )] ); /* Q(12+15+1) */ -#endif temp2 = add( temp2, k ); } diff --git a/lib_com/window_fx.c b/lib_com/window_fx.c index 2b3c50ac6..a1ff625b0 100644 --- a/lib_com/window_fx.c +++ b/lib_com/window_fx.c @@ -46,13 +46,8 @@ void ham_cos_window( { /* fh_f[i] = 0.54f - 0.46f * (Float32)cos(cc); */ BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB fh[i] = sub_o( P54_0Q15, mult_r( getCosWord16( round_fx_o( L_shl_o( cc, 9, &Overflow ), &Overflow ) ), P92_0Q15 ), &Overflow ); /*0Q15*/ move16(); -#else - fh[i] = sub( P54_0Q15, mult_r( getCosWord16( round_fx( L_shl( cc, 9 ) ) ), P92_0Q15 ) ); /*0Q15*/ - move16(); -#endif BASOP_SATURATE_WARNING_ON_EVS cc = L_add( cc, cte ); /*0Q15*/ } @@ -68,13 +63,8 @@ void ham_cos_window( FOR( i = n1; i < n1 + n2; i++ ) { /* fh_f[i] = (Float32)cos(cc); */ -#ifdef BASOP_NOGLOB fh[i] = shl_o( getCosWord16( round_fx( L_shl( cc, 10 ) ) ), 1, &Overflow ); /*0Q15*/ move16(); -#else - fh[i] = shl( getCosWord16( round_fx( L_shl( cc, 10 ) ) ), 1 ); /*0Q15*/ - move16(); -#endif cc = L_add( cc, cte ); } BASOP_SATURATE_WARNING_ON_EVS diff --git a/lib_com/window_ola_fx.c b/lib_com/window_ola_fx.c index 40763be99..d69d57365 100644 --- a/lib_com/window_ola_fx.c +++ b/lib_com/window_ola_fx.c @@ -28,11 +28,7 @@ void sinq_fx( tmp2 = round_fx( L_tmp ); /*Q15 */ x[1] = sub( tmp1, tmp2 ); move16(); /* sin(x) approximated by (x-x^3/3!); Q15 */ -#ifdef BASOP_NOGLOB tmp1 = add_sat( shl_sat( tmp, 1 ), phi ); /*Q15 */ -#else - tmp1 = add( shl( tmp, 1 ), phi ); /*Q15 */ -#endif L_tmp = L_mult( tmp1, tmp1 ); /*Q31 */ L_tmp = Mult_32_16( L_tmp, tmp1 ); /*Q31 */ L_tmp = Mult_32_16( L_tmp, 5461 ); /*Q31; division by 6 */ @@ -62,13 +58,8 @@ void sinq_fx( L_tmp = Mult_32_32( A32, tmp_old ); /*Q30 */ L_tmp = L_sub( L_tmp, L_shr( tmp_old_old, 1 ) ); /*Q30 */ tmp_old_old = L_add( tmp_old, 0 ); /*Q31 */ -#ifdef BASOP_NOGLOB tmp_old = L_shl_sat( L_tmp, 1 ); /*Q31 */ x[i] = round_fx_sat( tmp_old ); /*Q15 */ -#else - tmp_old = L_shl( L_tmp, 1 ); /*Q31 */ - x[i] = round_fx( tmp_old ); /*Q15 */ -#endif move16(); } @@ -328,11 +319,7 @@ void window_ola_fx( p4 = OldauOut + n; FOR( i = 0; i < temp; i++ ) { -#ifdef BASOP_NOGLOB *p1 = add_sat( mult( *p1, *p2 ), shl_sat( mult( *p4, *p3 ), 5 ) ); /*auOut[i]*SS2[i]+ OldauOut[i+n]*(SS2[L-n-i-1])/(wret2[i]+0.01f);;*/ -#else - *p1 = add( mult( *p1, *p2 ), shl( mult( *p4, *p3 ), 5 ) ); /*auOut[i]*SS2[i]+ OldauOut[i+n]*(SS2[L-n-i-1])/(wret2[i]+0.01f);;*/ -#endif move16(); p1++; p2++; @@ -359,15 +346,9 @@ void window_ola_fx( temp_len = sub( shr( L, 1 ), n ); FOR( i = 0; i < temp_len; i += 2 ) { -#ifdef BASOP_NOGLOB *p1++ = round_fx_sat( L_add_sat( L_shl_sat( Mult_32_16( *pa++, *p3 ), 1 ), L_deposit_h( *p4++ ) ) ); /* (( Qin + Q15 -15)+1 + ( Qin - 15 + 16))-1 */ p3 -= decimate; *p1++ = round_fx_sat( L_add_sat( L_shl_sat( Mult_32_16( *pa++, *p5-- ), 1 ), L_deposit_h( *p4++ ) ) ); /* (( Qin + Q15 -15)+1 + ( Qin - 15 + 16))-1 */ -#else - *p1++ = round_fx( L_add( L_shl( Mult_32_16( *pa++, *p3 ), 1 ), L_deposit_h( *p4++ ) ) ); /* (( Qin + Q15 -15)+1 + ( Qin - 15 + 16))-1 */ - p3 -= decimate; - *p1++ = round_fx( L_add( L_shl( Mult_32_16( *pa++, *p5-- ), 1 ), L_deposit_h( *p4++ ) ) ); /* (( Qin + Q15 -15)+1 + ( Qin - 15 + 16))-1 */ -#endif move16(); /* paout[i] = ImdctOut[L/2 + i] * win_right[(2*L_FRAME16k-(n16+(i-n)/2))*decimate-1-decay-windecay48]+OldauOut[i]; paout[i+1] = ImdctOut[L/2 + i +1] * win_int_right[2*L_FRAME16k-(n16+(i-n)/2)-1-windecay16]+OldauOut[i+1];*/ @@ -380,13 +361,8 @@ void window_ola_fx( temp_len = sub( shr( L, 1 ), n ); FOR( i = 0; i < temp_len; i += 2 ) { -#ifdef BASOP_NOGLOB *p1++ = round_fx_sat( L_sub_sat( L_deposit_h( *p4++ ), L_shl_sat( Mult_32_16( *pa--, *p5-- ), 1 ) ) ); /* (( Qin + Q15 -15)+1 + ( Qin - 15 + 16))-1 */ *p1++ = round_fx_sat( L_sub_sat( L_deposit_h( *p4++ ), L_shl_sat( Mult_32_16( *pa--, *p3 ), 1 ) ) ); /* (( Qin + Q15 -15)+1 + ( Qin - 15 + 16))-1 */ -#else - *p1++ = round_fx( L_sub( L_deposit_h( *p4++ ), L_shl( Mult_32_16( *pa--, *p5-- ), 1 ) ) ); /* (( Qin + Q15 -15)+1 + ( Qin - 15 + 16))-1 */ - *p1++ = round_fx( L_sub( L_deposit_h( *p4++ ), L_shl( Mult_32_16( *pa--, *p3 ), 1 ) ) ); /* (( Qin + Q15 -15)+1 + ( Qin - 15 + 16))-1 */ -#endif move16(); p3 -= decimate; /* paout[L/2 + i ] = -ImdctOut[L - 1 - i] * win_int_right[(3*L_FRAME16k/2-1-i/2)-windecay16]+OldauOut[i+L/2]; @@ -450,11 +426,7 @@ void window_ola_fx( temp_len = sub( shr( L, 1 ), n ); FOR( i = 0; i < temp_len; i++ ) { -#ifdef BASOP_NOGLOB *p1++ = round_fx_sat( L_add_sat( L_shl( Mult_32_16( *pa++, *p3 ), 1 ), L_deposit_h( *p4++ ) ) ); /* (( Qin + Q15 -15)+1 + ( Qin - 15 + 16))-1 */ -#else - *p1++ = round_fx( L_add( L_shl( Mult_32_16( *pa++, *p3 ), 1 ), L_deposit_h( *p4++ ) ) ); /* (( Qin + Q15 -15)+1 + ( Qin - 15 + 16))-1 */ -#endif move16(); p3 -= decimate; /*paout[i] = ImdctOut[L/2 + i] * win_right[(2*L-i)*decimate-1-decay-windecay48]+OldauOut[i];*/ @@ -466,11 +438,7 @@ void window_ola_fx( temp_len = sub( shr( L, 1 ), n ); FOR( i = 0; i < temp_len; i++ ) { -#ifdef BASOP_NOGLOB *p1++ = round_fx_sat( L_sub_sat( L_deposit_h( *p4++ ), L_shl_sat( Mult_32_16( *pa--, *p3 ), 1 ) ) ); /* (( Qin + Q15 -15)+1 + ( Qin - 15 + 16))-1 */ -#else - *p1++ = round_fx( L_sub( L_deposit_h( *p4++ ), L_shl( Mult_32_16( *pa--, *p3 ), 1 ) ) ); /* (( Qin + Q15 -15)+1 + ( Qin - 15 + 16))-1 */ -#endif move16(); p3 -= decimate; /* paout[L/2 + i] = -ImdctOut[L - 1 - i] * win_right[(3*L/2-1-i)*decimate+decay-windecay48]+OldauOut[i+L/2]; */ @@ -930,15 +898,9 @@ void core_switching_OLA_fx( temp_len = i_mult2( ( R2_16 >> 2 ), delta ); FOR( i = 0; i < temp_len; i += 2 ) { -#ifdef BASOP_NOGLOB *pt = shl_sat( mult_r_sat( *pt, *pt5 ), 1 ); move16(); /* // Q14* Q15 + shl ==> Q15 */ *pt2 = shl_sat( mult_r_sat( *pt2, *pt4 ), 1 ); -#else - *pt = shl( mult_r( *pt, *pt5 ), 1 ); - move16(); /* // Q14* Q15 + shl ==> Q15 */ - *pt2 = shl( mult_r( *pt2, *pt4 ), 1 ); -#endif move16(); /*/= win[(3*L_FRAME16k/2-1-i/2)*decimate+decay-L_FRAME48k*14/20]; */ pt += 2; pt2 += 2; @@ -954,11 +916,7 @@ void core_switching_OLA_fx( temp_len = i_mult2( ( R2_16 >> 2 ), delta ); FOR( i = 0; i < temp_len; i++ ) { -#ifdef BASOP_NOGLOB *pt = shl_sat( mult_r_sat( *pt, *pt5 ), 1 ); -#else - *pt = shl( mult_r( *pt, *pt5 ), 1 ); -#endif move16(); /* /= win[(3*output_frame/2-1-i)*decimate+decay-L_FRAME48k*14/20]; */ pt++; pt5 -= decimate; @@ -1007,11 +965,7 @@ void core_switching_OLA_fx( temp_len = sub( L, tmp ); FOR( i = 0; i < temp_len; i++ ) { -#ifdef BASOP_NOGLOB *pt = add_sat( add_sat( *pt, *pt2++ ), *pt3++ ); -#else - *pt = add( add( *pt, *pt2++ ), *pt3++ ); -#endif move16(); pt++; } diff --git a/lib_dec/FEC_HQ_core_fx.c b/lib_dec/FEC_HQ_core_fx.c index 01002b56b..716730130 100644 --- a/lib_dec/FEC_HQ_core_fx.c +++ b/lib_dec/FEC_HQ_core_fx.c @@ -78,13 +78,8 @@ static void Regression_Anal_fx( { b_p_fx[0] = L_add( b_p_fx[0], L_shr( values_fx[i], 2 ) ); /*10 */ move32(); -#ifdef BASOP_NOGLOB b_p_fx[1] = L_add( b_p_fx[1], Mult_32_16( values_fx[i], shl_o( sub( num_pgf, i ), 13, &Overflow ) ) ); /*10 */ move32(); -#else - b_p_fx[1] = L_add( b_p_fx[1], Mult_32_16( values_fx[i], shl( sub( num_pgf, i ), 13 ) ) ); /*10 */ - move32(); -#endif } tmp = sub( i_mult( aindex_fx[0], aindex_fx[2] ), i_mult( aindex_fx[1], aindex_fx[1] ) ); @@ -378,11 +373,7 @@ void HQ_FEC_processing_fx( exp2 = norm_l( norm_values_fx[0] ); tmp_fx = div_s( extract_h( L_shl( norm_p_fx[i], exp1 ) ), extract_h( L_shl( norm_values_fx[0], exp2 ) ) ); /*15 + (5 + exp1 - 16) - (12 + exp2 - 16)*/ -#ifdef BASOP_NOGLOB tmp_fx = shl_sat( tmp_fx, add( 6, sub( exp2, exp1 ) ) ); /*14*/ -#else - tmp_fx = shl( tmp_fx, add( 6, sub( exp2, exp1 ) ) ); /*14*/ -#endif if ( GT_16( tmp_fx, 16384 ) ) { tmp_fx = 16384; @@ -391,14 +382,9 @@ void HQ_FEC_processing_fx( FOR( j = 0; j < Num_bands_p[i]; j++ ) { -#ifdef BASOP_NOGLOB hHQ_nbfec->Norm_gain_fx[k] = shl_o( tmp_fx, 1, &Overflow ); move16(); k = add( k, 1 ); -#else - hHQ_nbfec->Norm_gain_fx[k++] = shl( tmp_fx, 1 ); - move16(); -#endif } } ELSE @@ -532,11 +518,7 @@ void ivas_HQ_FEC_Mem_update_fx( L_tmp = L_add( L_tmp, L_shr( normq_fx[k], 3 ) ); /*11*/ k = add( k, 1 ); } -#ifdef BASOP_NOGLOB tmp_fx = shl_o( inv_tbl_fx[Num_bands_p[i]], 1, &Overflow ); /*16*/ -#else - tmp_fx = shl( inv_tbl_fx[Num_bands_p[i]], 1 ); /*16*/ -#endif norm_values_fx[0] = Mult_32_16( L_tmp, tmp_fx ); /*11 + 16 - 15*/ move32(); tmp_energy_fx = L_add( tmp_energy_fx, L_shr( L_tmp, 3 ) ); /*8*/ @@ -656,11 +638,7 @@ void ivas_HQ_FEC_Mem_update_fx( exp2 = norm_l( hHQ_nbfec->ynrm_values_fx[i][0] ); tmp_fx = div_s( extract_h( L_shl( en_high_fx[i], exp1 ) ), extract_h( L_shl( hHQ_nbfec->ynrm_values_fx[i][0], exp2 ) ) ); exp = add( 15, sub( exp1, exp2 ) ); -#ifdef BASOP_NOGLOB *mean_en_high_fx = add_o( *mean_en_high_fx, shr_o( tmp_fx, sub( exp, 5 ), &Overflow ), &Overflow ); -#else - *mean_en_high_fx = add( *mean_en_high_fx, shr( tmp_fx, sub( exp, 5 ) ) ); -#endif move16(); } *mean_en_high_fx = mult( *mean_en_high_fx, inv_tbl_fx[sub( num_Sb, k )] ); @@ -829,11 +807,7 @@ void HQ_FEC_Mem_update_fx( L_tmp = L_add( L_tmp, L_shr( normq_fx[k], 3 ) ); /*11*/ k = add( k, 1 ); } -#ifdef BASOP_NOGLOB tmp_fx = shl_o( inv_tbl_fx[Num_bands_p[i]], 1, &Overflow ); /*16*/ -#else - tmp_fx = shl( inv_tbl_fx[Num_bands_p[i]], 1 ); /*16*/ -#endif norm_values_fx[0] = Mult_32_16( L_tmp, tmp_fx ); /*11 + 16 - 15*/ move32(); tmp_energy_fx = L_add( tmp_energy_fx, L_shr( L_tmp, 3 ) ); /*8*/ @@ -857,12 +831,8 @@ void HQ_FEC_Mem_update_fx( move16(); /*15*/ L_tmp = Mult_32_16( tmp_energy_fx, tmp_fx ); /*8 + 15 - 15*/ -#ifdef BASOP_NOGLOB hHQ_nbfec->energy_MA_Curr_fx[1] = extract_h( L_shl_sat( L_tmp, 16 - 8 ) ); move16(); -#else - hHQ_nbfec->energy_MA_Curr_fx[1] = extract_h( L_shl( L_tmp, 16 - 8 ) ); -#endif /* Moving Average */ hHQ_nbfec->energy_MA_Curr_fx[0] = s_max( 1, add( mult_r( 26214, hHQ_nbfec->energy_MA_Curr_fx[0] ), mult_r( 6554, hHQ_nbfec->energy_MA_Curr_fx[1] ) ) ); move16(); @@ -958,11 +928,7 @@ void HQ_FEC_Mem_update_fx( exp2 = norm_l( hHQ_nbfec->ynrm_values_fx[i][0] ); tmp_fx = div_s( extract_h( L_shl( en_high_fx[i], exp1 ) ), extract_h( L_shl( hHQ_nbfec->ynrm_values_fx[i][0], exp2 ) ) ); exp = add( 15, sub( exp1, exp2 ) ); -#ifdef BASOP_NOGLOB *mean_en_high_fx = add_o( *mean_en_high_fx, shr_o( tmp_fx, sub( exp, 5 ), &Overflow ), &Overflow ); -#else - *mean_en_high_fx = add( *mean_en_high_fx, shr( tmp_fx, sub( exp, 5 ) ) ); -#endif move16(); } *mean_en_high_fx = mult( *mean_en_high_fx, inv_tbl_fx[sub( num_Sb, k )] ); @@ -1049,13 +1015,8 @@ static Word16 find_best_delay_fx( accB_fx = L_deposit_l( 0 ); FOR( i = 0; i < lin; i += delta ) { -#ifdef BASOP_NOGLOB accA_fx = L_add_sat( accA_fx, L_shr( L_mult_sat( mu_o_fx[d1 + i], mu_o_fx[d1 + i] ), 2 ) ); accB_fx = L_add_sat( accB_fx, L_shr( L_mult_sat( mu_o_fx[d1 + i], in_fx[i] ), 2 ) ); -#else - accA_fx = L_add( accA_fx, L_shr( L_mult( mu_o_fx[d1 + i], mu_o_fx[d1 + i] ), 2 ) ); - accB_fx = L_add( accB_fx, L_shr( L_mult( mu_o_fx[d1 + i], in_fx[i] ), 2 ) ); -#endif } Rxy_fx[k] = accB_fx; @@ -1108,11 +1069,7 @@ static Word16 find_best_delay_fx( L_tmp1 = L_shl( min_sq_cross_fx, exp1 ); L_tmp2 = L_shl( min_corr_fx, exp2 ); tmp = div_s( extract_h( L_tmp1 ), extract_h( L_tmp2 ) ); /*15 + exp1 - exp2 */ -#ifdef BASOP_NOGLOB tmp = shl_o( tmp, sub( exp2, add( exp1, 1 ) ), &Overflow ); /*14 */ -#else - tmp = shl( tmp, sub( exp2, add( exp1, 1 ) ) ); /*14 */ -#endif } *false_flag = 0; @@ -1306,11 +1263,7 @@ static Word16 FEC_phase_matching_fx( tmp = shl( tmp, sub( sub( exp2, exp1 ), 1 ) ); /*14*/ FOR( i = N_ZERO_NB; i < L * 2; i++ ) { -#ifdef BASOP_NOGLOB ImdctOutWin_fx[i] = shl_sat( mult( ImdctOutWin_fx[i], tmp ), 1 ); -#else - ImdctOutWin_fx[i] = shl( mult( ImdctOutWin_fx[i], tmp ), 1 ); -#endif move16(); } } @@ -1582,11 +1535,7 @@ static void Repetition_smoothing_nextgood_fx( /*mvr2r(&ImdctOutWin[L], OldauOut, L);*/ FOR( i = 0; i < L; i++ ) { -#ifdef BASOP_NOGLOB auOut_fx[i] = add_sat( ImdctOutWin_fx[N_ZERO_NB + i], OldauOut_fx[i] ); // Q0 -#else - auOut_fx[i] = add( ImdctOutWin_fx[N_ZERO_NB + i], OldauOut_fx[i] ); -#endif move16(); } Copy( &ImdctOutWin_fx[L], OldauOut_fx, L ); @@ -1678,11 +1627,7 @@ static void common_overlapping_fx( FOR( i = 0; i < end1; i++ ) { /*auOut_fx[i] = L_add(ImdctOutWin_fx[i+7*L/20], OldauOut_fx[i+offset1]);*/ -#ifdef BASOP_NOGLOB auOut_fx[i] = add_sat( ImdctOutWin_fx[i + N_ZERO_NB], OldauOut_fx[i + offset1] ); -#else - auOut_fx[i] = add( ImdctOutWin_fx[i + N_ZERO_NB], OldauOut_fx[i + offset1] ); -#endif move16(); } FOR( i = start2; i < end2; i++ ) diff --git a/lib_dec/FEC_HQ_phase_ecu_fx.c b/lib_dec/FEC_HQ_phase_ecu_fx.c index f31f20af5..f23ddeb7d 100644 --- a/lib_dec/FEC_HQ_phase_ecu_fx.c +++ b/lib_dec/FEC_HQ_phase_ecu_fx.c @@ -491,22 +491,14 @@ static void trans_ana_fx( tr_dec[k] = 0; move16(); Mpy_32_16_ss( *pGrPowLeft, THRESH_TR_LIN_BY2_FX, &acc, &lsb ); /* To facilitate fixed-point implementation, divide threshold by 2. */ -#ifdef BASOP_NOGLOB acc = L_or( L_shl_sat( acc, 16 ), L_and( 0xffffL, lsb ) ); /* Equivalent to concatenate acc and lsb, and then down shift by 16 bits. */ -#else - acc = L_or( L_shl( acc, 16 ), L_and( 0xffffL, lsb ) ); /* Equivalent to concatenate acc and lsb, and then down shift by 16 bits. */ -#endif if ( GT_32( *pGrPowRight, acc ) ) /* gr_pow_right > thres_tr_lin*gr_pow_left */ { tr_dec[k] = 1; move16(); } Mpy_32_16_ss( *pGrPowRight, THRESH_TR_LIN_BY2_FX, &acc, &lsb ); -#ifdef BASOP_NOGLOB acc = L_or( L_shl_sat( acc, 16 ), L_and( 0xffffL, lsb ) ); /* Equivalent to concatenate acc and lsb, and then down shift by 16 bits. */ -#else - acc = L_or( L_shl( acc, 16 ), L_and( 0xffffL, lsb ) ); /* Equivalent to concatenate acc and lsb, and then down shift by 16 bits. */ -#endif if ( GT_32( *pGrPowLeft, acc ) ) /* gr_pow_left > thres_tr_lin*gr_pow_right */ { tr_dec[k] = 1; @@ -1275,11 +1267,7 @@ static Word16 imax_fx( /* o: The location, relative to the /* Although the output of ratio() is in Q14, adding the missing factor of 2 (See above) * in the denominator, the output is now considered to be in Q15. */ man = ratio( numer, denom, &expo ); /* The mantissa is considered in Q15 */ -#ifdef BASOP_NOGLOB posi = shr_o( man, expo, &Overflow ); /* in Q15 (Due to saturation, it is automatically bound inside [-1.0,1.0].) */ -#else - posi = shr( man, expo ); /* in Q15 (Due to saturation, it is automatically bound inside [-1.0,1.0].) */ -#endif if ( sign < 0 ) /* Restore the sign. */ { posi = negate( posi ); @@ -1884,11 +1872,7 @@ static void spec_ana_fx( man = mult_r( man, FEC_HQ_ECU_ROOT2 ); /* FEC_HQ_ECU_ROOT2 is sqrt(2) in Q14 */ expoBy2 = sub( expoBy2, 1 ); } -#ifdef BASOP_NOGLOB *pXfp++ = shr_sat( man, expoBy2 ); -#else - *pXfp++ = shr( man, expoBy2 ); -#endif move16(); /* Denormalize the mantissa back to Q0. */ } } @@ -2786,13 +2770,8 @@ static void subst_spec_fx( IF( EQ_16( element_mode, EVS_MONO ) ) #endif { -#ifdef BASOP_NOGLOB tmp = sub_sat( mult_r( re, cos_F ), mult_r( im, sin_F ) ); im = add_sat( mult_r( re, sin_F ), mult_r( im, cos_F ) ); -#else - tmp = sub( mult_r( re, cos_F ), mult_r( im, sin_F ) ); - im = add( mult_r( re, sin_F ), mult_r( im, cos_F ) ); -#endif } #ifdef IVAS_FEC_ECU_TO_COMPLETE ELSE @@ -3322,11 +3301,7 @@ static Word32 mult_32_32_q( const Word32 a, const Word32 b, const Word16 q ) #endif Mpy_32_32_ss( a, b, &hi, &lo ); -#ifdef BASOP_NOGLOB return L_or( L_shl_o( hi, sub( 32 - 1, q ), &Overflow ), L_lshr( (Word32) lo, add( q, 1 ) ) ); -#else - return L_or( L_shl( hi, 32 - q - 1 ), L_lshr( lo, q + 1 ) ); -#endif } static void fir_dwn_fx( @@ -3360,19 +3335,11 @@ static void fir_dwn_fx( FOR( j = 1; j <= i; j++ ) { -#ifdef BASOP_NOGLOB s = L_mac0_sat( s, *ptr_h++, *ptr_x-- ); // Q(h_Q) + Q(x_q) -#else - s = L_mac0( s, *ptr_h++, *ptr_x-- ); -#endif } -#ifdef BASOP_NOGLOB *ptr_y++ = extract_h( L_shl_sat( s, centering ) ); move16(); -#else - *ptr_y++ = extract_h( L_shl( s, centering ) ); -#endif } FOR( i = K; i < L; i += decimation ) { @@ -3383,19 +3350,11 @@ static void fir_dwn_fx( FOR( j = 1; j <= K; j++ ) { -#ifdef BASOP_NOGLOB s = L_mac0_sat( s, *ptr_h++, *ptr_x-- ); // Q(h_Q) + Q(x_q) -#else - s = L_mac0( s, *ptr_h++, *ptr_x-- ); -#endif } -#ifdef BASOP_NOGLOB *ptr_y++ = extract_h( L_shl_sat( s, centering ) ); move16(); -#else - *ptr_y++ = extract_h( L_shl( s, centering ) ); -#endif } tmp = add( L, Kdiv2 ); FOR( i = i; i < tmp; i += decimation ) @@ -3408,19 +3367,11 @@ static void fir_dwn_fx( FOR( j = i - L + 1; j <= K; j++ ) { -#ifdef BASOP_NOGLOB s = L_mac0_sat( s, *ptr_h++, *ptr_x-- ); -#else - s = L_mac0( s, *ptr_h++, *ptr_x-- ); -#endif } -#ifdef BASOP_NOGLOB *ptr_y++ = extract_h( L_shl_sat( s, centering ) ); move16(); -#else - *ptr_y++ = extract_h( L_shl( s, centering ) ); -#endif } return; @@ -3896,20 +3847,11 @@ static void sin_cos_est_fx( Word32 phi, Word16 *cosfreq, Word16 *sinfreq ) tmp = L_shl( Mult_32_16( delta, cosb ), 1 ); /*Q31 */ sinv = L_add( L_deposit_h( sinb ), tmp ); tmp = L_shl( Mult_32_16( delta, sinb ), 1 ); /*Q31 */ -#ifdef BASOP_NOGLOB cosv = L_sub_sat( L_deposit_h( cosb ), tmp ); -#else - cosv = L_sub( L_deposit_h( cosb ), tmp ); -#endif -#ifdef BASOP_NOGLOB *sinfreq = round_fx_sat( sinv ); move16(); *cosfreq = round_fx_sat( cosv ); move16(); -#else - *sinfreq = round_fx( sinv ); - *cosfreq = round_fx( cosv ); -#endif return; } @@ -3963,11 +3905,7 @@ static Word16 abs_iter_fx( Word16 re /*Qx*/, Word16 im /*Qx*/, Word16 N ) i = s_min( sub( i, 1 ), 9 ); tmp = abs_s( re ); /*A = round_fx(L_shr(L_mult(tmp, cor[i]), exp)); //this can be ommited, if we don't need the exact abs value */ -#ifdef BASOP_NOGLOB A = shr_sat( tmp, exp ); -#else - A = shr( tmp, exp ); -#endif return A; } /*-------------------------------------------------------------------------- @@ -4039,13 +3977,8 @@ static void ivas_fec_ecu_dft_fx( { tmp_short = extract_l( L_shr( Tmp, 15 ) ); tmp = extract_l( L_msu( Tmp, tmp_short, 16384 ) ); -#ifdef BASOP_NOGLOB L_tmp = L_mult( sub_sat( target[tmp_short + 1], target[tmp_short] ), tmp ); /*Qin+16 */ Tfr16[i] = add_sat( target[tmp_short], round_fx_sat( L_tmp ) ); -#else - L_tmp = L_mult( sub( target[tmp_short + 1], target[tmp_short] ), tmp ); /*Qin+16 */ - Tfr16[i] = add( target[tmp_short], round_fx( L_tmp ) ); -#endif move16(); /*Qin */ Tmp = L_add( Tmp, fac ); } @@ -4160,13 +4093,8 @@ static void fec_ecu_dft_fx( { tmp_short = extract_l( L_shr( Tmp, 15 ) ); tmp = extract_l( L_msu( Tmp, tmp_short, 16384 ) ); -#ifdef BASOP_NOGLOB L_tmp = L_mult( sub_sat( target[tmp_short + 1], target[tmp_short] ), tmp ); /*Qin+16 */ Tfr16[i] = add_sat( target[tmp_short], round_fx_sat( L_tmp ) ); -#else - L_tmp = L_mult( sub( target[tmp_short + 1], target[tmp_short] ), tmp ); /*Qin+16 */ - Tfr16[i] = add( target[tmp_short], round_fx( L_tmp ) ); -#endif move16(); /*Qin */ Tmp = L_add( Tmp, fac ); } @@ -4235,11 +4163,7 @@ static void singenerator_fx( ptr = xx; -#ifdef BASOP_NOGLOB *ptr = L_add_sat( *ptr, L_C0 ); -#else - *ptr = L_add( *ptr, L_C0 ); -#endif move32(); ptr++; @@ -4250,11 +4174,7 @@ static void singenerator_fx( L_C1 = L_msu( L_C1, S0, sinfreq ); /*Qin+16 */ L_S1 = L_mult( C0, sinfreq ); S1 = mac_r( L_S1, S0, cosfreq ); -#ifdef BASOP_NOGLOB *ptr = L_add_sat( *ptr, L_C1 ); -#else - *ptr = L_add( *ptr, L_C1 ); -#endif move32(); /*Qin+16 */ ptr++; @@ -4263,11 +4183,7 @@ static void singenerator_fx( L_C0 = L_msu( L_C0, S1, sinfreq ); L_S0 = L_mult( C1, sinfreq ); S0 = mac_r( L_S0, S1, cosfreq ); -#ifdef BASOP_NOGLOB *ptr = L_add_sat( *ptr, L_C0 ); -#else - *ptr = L_add( *ptr, L_C0 ); -#endif move32(); ptr++; } @@ -4276,11 +4192,7 @@ static void singenerator_fx( S0 = extract_h( L_S0 ); L_C1 = L_mult( C0, cosfreq ); L_C1 = L_msu( L_C1, S0, sinfreq ); -#ifdef BASOP_NOGLOB *ptr = L_add_sat( *ptr, L_C1 ); -#else - *ptr = L_add( *ptr, L_C1 ); -#endif move32(); ptr++; @@ -4574,11 +4486,7 @@ static void ivas_fec_noise_filling_fx( move16(); FOR( k = 0; k < tmp_fx; k++ ) { -#ifdef BASOP_NOGLOB ( *pt1++ ) = sub_sat( ( *pt2++ ), ( *pt3++ ) ); -#else - ( *pt1++ ) = sub( ( *pt2++ ), ( *pt3++ ) ); -#endif move16(); } @@ -4626,13 +4534,8 @@ static void ivas_fec_noise_filling_fx( FOR( i = 0; i < tmp_fx; i++ ) { L_tmp = L_mult( ( *pt1++ ), ( *pt3++ ) ); /*Qsynth+16 */ -#ifdef BASOP_NOGLOB L_tmp = L_mac_sat( L_tmp, ( *pt2++ ), ( *pt4-- ) ); /*Qsynth+16 */ *pt5 = add_sat( *pt5, round_fx_sat( L_tmp ) ); -#else - L_tmp = L_mac( L_tmp, ( *pt2++ ), ( *pt4-- ) ); /*Qsynth+16 */ - *pt5 = add( *pt5, round_fx( L_tmp ) ); -#endif move16(); /*Qsynth */ pt5++; } @@ -4748,11 +4651,7 @@ static void fec_noise_filling_fx( move16(); FOR( k = 0; k < tmp_fx; k++ ) { -#ifdef BASOP_NOGLOB ( *pt1++ ) = sub_sat( ( *pt2++ ), ( *pt3++ ) ); -#else - ( *pt1++ ) = sub( ( *pt2++ ), ( *pt3++ ) ); -#endif move16(); } @@ -4788,11 +4687,7 @@ static void fec_noise_filling_fx( tmp_fx = div_s( 1, Rnd_N_noise ); /*Q15 */ -#ifdef BASOP_NOGLOB tmp_fx = round_fx_sat( L_shl_sat( L_mult( tmp_fx, 25736 ), 2 ) ); /*Q15 */ -#else - tmp_fx = round_fx( L_shl( L_mult( tmp_fx, 25736 ), 2 ) ); /*Q15 */ -#endif #ifdef IVAS_FEC_ECU_TO_COMPLETE if ( element_mode == EVS_MONO ) { @@ -4816,13 +4711,8 @@ static void fec_noise_filling_fx( FOR( i = 0; i < tmp_fx; i++ ) { L_tmp = L_mult( ( *pt1++ ), ( *pt3++ ) ); /*Qsynth+16 */ -#ifdef BASOP_NOGLOB L_tmp = L_mac_sat( L_tmp, ( *pt2++ ), ( *pt4-- ) ); /*Qsynth+16 */ *pt5 = add_sat( *pt5, round_fx_sat( L_tmp ) ); -#else - L_tmp = L_mac( L_tmp, ( *pt2++ ), ( *pt4-- ) ); /*Qsynth+16 */ - *pt5 = add( *pt5, round_fx( L_tmp ) ); -#endif move16(); /*Qsynth */ pt5++; } @@ -5623,11 +5513,7 @@ static void windowing_ROM_optimized( FOR( i = 0; i < quarterLen; i++ ) { acc = L_deposit_h( FEC_HQ_WIN_A0 ); -#ifdef BASOP_NOGLOB hamm = mac_r_sat( acc, *pSine, FEC_HQ_WIN_A1 ); -#else - hamm = mac_r( acc, *pSine, FEC_HQ_WIN_A1 ); -#endif *pY++ = mult_r( hamm, *pX++ ); move16(); pSine += downSamples; /* Increment address counter */ @@ -5645,11 +5531,7 @@ static void windowing_ROM_optimized( { pSine -= downSamples; /* Decrement address counter */ acc = L_deposit_h( FEC_HQ_WIN_A0 ); // Q31 -#ifdef BASOP_NOGLOB hamm = mac_r_sat( acc, *pSine, FEC_HQ_WIN_A1 ); // Q15 -#else - hamm = mac_r( acc, *pSine, FEC_HQ_WIN_A1 ); -#endif *pY++ = mult_r( hamm, *pX++ ); move16(); } diff --git a/lib_dec/FEC_clas_estim_fx.c b/lib_dec/FEC_clas_estim_fx.c index 4c268186d..9b58084e3 100644 --- a/lib_dec/FEC_clas_estim_fx.c +++ b/lib_dec/FEC_clas_estim_fx.c @@ -285,11 +285,7 @@ void FEC_clas_estim_fx( Corre( &pt1[pos], &pt1[pos - T0], T0, &cor_max[0] ); -#ifdef BASOP_NOGLOB T0 = mult_r_sat( add_sat( pitch[2], pitch[3] ), 256 ); -#else - T0 = mult_r( add( pitch[2], pitch[3] ), 256 ); -#endif pos_limit = sub( L_frame, L_SUBFR ); j = s_min( 1, s_max( 0, sub( pos, pos_limit ) ) ); Ltmp = L_deposit_l( cor_max[0] ); @@ -334,11 +330,7 @@ void FEC_clas_estim_fx( test(); IF( EQ_16( codec_mode, MODE1 ) || !( NE_16( LTP_Gain, -32768 /*-1.f Q15*/ ) && EQ_16( mode, CLASSIFIER_TCX ) ) ) { -#ifdef BASOP_NOGLOB pc = shr( abs_s( sub( add_sat( pitch[3], sub( pitch[2], pitch[1] ) ), pitch[0] ) ), 6 ); -#else - pc = shr( abs_s( sub( add( pitch[3], sub( pitch[2], pitch[1] ) ), pitch[0] ) ), 6 ); -#endif IF( EQ_16( L_frame, L_FRAME16k ) ) { @@ -359,13 +351,8 @@ void FEC_clas_estim_fx( { pt1++; pt2++; -#ifdef BASOP_NOGLOB Ltmp = L_mac0_sat( Ltmp, *pt1, *pt1 ); Ltmp1 = L_mac0_sat( Ltmp1, *pt1, *pt2 ); -#else - Ltmp = L_mac0( Ltmp, *pt1, *pt1 ); - Ltmp1 = L_mac0( Ltmp1, *pt1, *pt2 ); -#endif } tilt = 0; move16(); @@ -383,21 +370,13 @@ void FEC_clas_estim_fx( tmp_x = extract_h( L_shl( Ltmp, exp2 ) ); exp2 = sub( 31 - 1 + 3, exp2 ); BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB tmpS = shr( sub_sat( tmp_x, tmp_y ), 16 ); /* if tmp_x >= tmp_y tmpS = 0, -1 otherwise */ -#else - tmpS = shr( sub( tmp_x, tmp_y ), 16 ); /* if tmp_x >= tmp_y tmpS = 0, -1 otherwise */ -#endif BASOP_SATURATE_WARNING_ON_EVS tmp_y = shl( tmp_y, tmpS ); exp1 = sub( exp1, tmpS ); tilt = div_s( tmp_y, tmp_x ); -#ifdef BASOP_NOGLOB tilt = shl_sat( tilt, sub( exp1, exp2 ) ); /* saturate to 1.0 */ -#else - tilt = shl( tilt, sub( exp1, exp2 ) ); /* saturate to 1.0 */ -#endif tilt = i_mult2( tilt, tmp16 ); } @@ -420,11 +399,7 @@ void FEC_clas_estim_fx( zcn = extract_h( L_shl( L_mac( C_ZC_FX, K_ZC_FX, zc_frame ), 4 ) ); /* Q4 -> Q8*/ BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB tmp16 = sub_sat( LTP_Gain, -32768 /*-1.f Q15*/ ); -#else - tmp16 = sub( LTP_Gain, -32768 /*-1.f Q15*/ ); -#endif BASOP_SATURATE_WARNING_ON_EVS test(); test(); @@ -446,11 +421,7 @@ void FEC_clas_estim_fx( Ltmp = L_mac( Ltmp, pcn, UNS6 ); Ltmp = L_mac( Ltmp, enern, UNS6 ); BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB fmerit1 = round_fx_sat( L_shl_sat( Ltmp, 15 - 8 ) ); /*Q15 can saturate to 1.0 */ -#else - fmerit1 = round_fx( L_shl( Ltmp, 15 - 8 ) ); /*Q15 can saturate to 1.0 */ -#endif BASOP_SATURATE_WARNING_ON_EVS test(); IF( EQ_16( codec_mode, MODE2 ) && narrowBand != 0 ) @@ -938,11 +909,7 @@ static void Corre( /* keep Q15 normalized result */ cor = extract_h( Dot_product12( x, y, l, &cor_exp ) ); -#ifdef BASOP_NOGLOB den = add_sat( extract_h( Dot_product12( y, y, l, &den_exp ) ), 1 ); -#else - den = add( extract_h( Dot_product12( y, y, l, &den_exp ) ), 1 ); -#endif den2 = extract_h( Dot_product12( x, x, l, &den2_exp ) ); /* keep Q31 normalized result */ @@ -953,10 +920,6 @@ static void Corre( tmp = Isqrt_lc( tmp, &tmp_exp ); /* keep Q15 result */ -#ifdef BASOP_NOGLOB gain[0] = shl_sat( mult_r( cor, extract_h( tmp ) ), add( cor_exp, tmp_exp ) ); -#else - gain[0] = shl( mult_r( cor, extract_h( tmp ) ), add( cor_exp, tmp_exp ) ); -#endif move16(); } diff --git a/lib_dec/FEC_fx.c b/lib_dec/FEC_fx.c index c0976e68a..0686996f3 100644 --- a/lib_dec/FEC_fx.c +++ b/lib_dec/FEC_fx.c @@ -126,11 +126,7 @@ void FEC_exc_estim_fx( gainCNG = round_fx( L_shl( L_tmp, sub( exp, 12 ) ) ); /* In Q3 */ } -#ifdef BASOP_NOGLOB tmp1 = shl_o( st_fx->lp_gainc_fx, 1, &Overflow ); -#else - tmp1 = shl( st_fx->lp_gainc_fx, 1 ); -#endif gainCNG = s_min( gainCNG, tmp1 ); set16_fx( exc_dct_in, 0, L_FRAME16k ); @@ -191,15 +187,9 @@ void FEC_exc_estim_fx( { test(); test(); -#ifdef BASOP_NOGLOB IF( ( LT_16( round_fx( L_shl( st_fx->old_pitch_buf_fx[2 * NB_SUBFR - 1], 6 ) ), shl_o( mult( 29491, st_fx->bfi_pitch_fx ), 1, &Overflow ) ) && GT_16( round_fx( L_shl( st_fx->old_pitch_buf_fx[2 * NB_SUBFR - 1], 6 ) ), mult( 19661, st_fx->bfi_pitch_fx ) ) ) || /* last pitch coherent with the past */ GE_16( st_fx->upd_cnt, MAX_UPD_CNT ) ) /* or last update too far in the past */ -#else - IF( ( LT_16( round_fx( L_shl( st_fx->old_pitch_buf_fx[2 * NB_SUBFR - 1], 6 ) ), shl( mult( 29491, st_fx->bfi_pitch_fx ), 1 ) ) && - GT_16( round_fx( L_shl( st_fx->old_pitch_buf_fx[2 * NB_SUBFR - 1], 6 ) ), mult( 19661, st_fx->bfi_pitch_fx ) ) ) || /* last pitch coherent with the past */ - GE_16( st_fx->upd_cnt, MAX_UPD_CNT ) ) /* or last update too far in the past */ -#endif { /* take the pitch value of last subframe of the previous frame */ *tmp_tc = round_fx( L_shl( st_fx->old_pitch_buf_fx[2 * NB_SUBFR - 1], 6 ) ); @@ -210,15 +200,9 @@ void FEC_exc_estim_fx( { test(); test(); -#ifdef BASOP_NOGLOB IF( ( LT_16( round_fx( L_shl( st_fx->old_pitch_buf_fx[2 * NB_SUBFR16k - 1], 6 ) ), shl_o( mult( 29491, st_fx->bfi_pitch_fx ), 1, &Overflow ) ) && GT_16( round_fx( L_shl( st_fx->old_pitch_buf_fx[2 * NB_SUBFR16k - 1], 6 ) ), mult( 19661, st_fx->bfi_pitch_fx ) ) ) || /* last pitch coherent with the past */ GE_16( st_fx->upd_cnt, MAX_UPD_CNT ) ) /* or last update too far in the past */ -#else - IF( ( LT_16( round_fx( L_shl( st_fx->old_pitch_buf_fx[2 * NB_SUBFR16k - 1], 6 ) ), shl( mult( 29491, st_fx->bfi_pitch_fx ), 1 ) ) && - GT_16( round_fx( L_shl( st_fx->old_pitch_buf_fx[2 * NB_SUBFR16k - 1], 6 ) ), mult( 19661, st_fx->bfi_pitch_fx ) ) ) || /* last pitch coherent with the past */ - GE_16( st_fx->upd_cnt, MAX_UPD_CNT ) ) /* or last update too far in the past */ -#endif { /* take the pitch value of last subframe of the previous frame */ *tmp_tc = round_fx( L_shl( st_fx->old_pitch_buf_fx[2 * NB_SUBFR16k - 1], 6 ) ); @@ -312,11 +296,7 @@ void FEC_exc_estim_fx( IF( LE_16( st_fx->nbLostCmpt, 1 ) ) { /* if stable, do not decrease the energy, pitch_gain = 0 */ -#ifdef BASOP_NOGLOB alpha = mac_ro( ( 1L << 16 ) * 2 * _ALPHA_U_FX, st_fx->stab_fac_fx, 32768 - 2 * _ALPHA_U_FX, &Overflow ); /*st_fx->stab_fac_fx in Q15*/ -#else - alpha = mac_r( ( 1L << 16 ) * 2 * _ALPHA_U_FX, st_fx->stab_fac_fx, 32768 - 2 * _ALPHA_U_FX ); /*st_fx->stab_fac_fx in Q15*/ -#endif } ELSE IF( EQ_16( st_fx->nbLostCmpt, 2 ) ) { @@ -365,11 +345,7 @@ void FEC_exc_estim_fx( L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp ); -#ifdef BASOP_NOGLOB gain = extract_h( L_shl_o( L_tmp, exp, &Overflow ) ); -#else - gain = extract_h( L_shl( L_tmp, exp ) ); -#endif gain = s_min( gain, 32113 ); /*0.98 */ gain = s_max( gain, 27853 ); /*0.85 */ @@ -658,11 +634,7 @@ void FEC_exc_estim_fx( /* non-causal ringing of the FIR filter */ /**pt_exc++ *= (gain_inov * gain);*/ L_tmp = L_mult( tmp, *pt_exc ); /* Q_exc+18 * Q-3 -> Q_exc+16 */ -#ifdef BASOP_NOGLOB *pt_exc++ = round_fx_sat( L_shl_sat( L_tmp, exp ) ); -#else - *pt_exc++ = round_fx( L_shl( L_tmp, exp ) ); -#endif move16(); } @@ -671,11 +643,7 @@ void FEC_exc_estim_fx( /* the inner part of the FIR filter */ /* *pt_exc++ *= (gain_inov * gain); */ L_tmp = L_mult( tmp, *pt_exc ); -#ifdef BASOP_NOGLOB *pt_exc++ = round_fx_sat( L_shl_sat( L_tmp, exp ) ); -#else - *pt_exc++ = round_fx( L_shl( L_tmp, exp ) ); -#endif move16(); /* gain -= step; */ L_tmp2 = L_sub( L_tmp2, L_step ); @@ -686,11 +654,7 @@ void FEC_exc_estim_fx( { /* *pt_exc++ *= (gain_inov * gain) */ L_tmp = L_mult( tmp, *pt_exc ); -#ifdef BASOP_NOGLOB *pt_exc++ = round_fx_sat( L_shl_sat( L_tmp, exp ) ); -#else - *pt_exc++ = round_fx( L_shl( L_tmp, exp ) ); -#endif move16(); } } @@ -726,17 +690,9 @@ void FEC_exc_estim_fx( L_tmp = L_mult( hp_filt[0], pt_exc[0] ); FOR( j = 1; j < MODE1_L_FIR_FER; j++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac_sat( L_tmp, hp_filt[j], pt_exc[j] ); -#else - L_tmp = L_mac( L_tmp, hp_filt[j], pt_exc[j] ); -#endif } -#ifdef BASOP_NOGLOB exc2[i] = msu_r_sat( L_tmp, -32768, exc[i] ); -#else - exc2[i] = msu_r( L_tmp, -32768, exc[i] ); -#endif move16(); pt_exc++; } @@ -812,11 +768,7 @@ static void pulseRes_preCalc( Word16 *cond1, Word16 *cond2, Word32 *cond3, Word1 tmp_frame = sub( 32767 /*1.f Q15*/, tmp_frame ); /*Q15*/ BASOP_SATURATE_WARNING_OFF_EVS /*To calc Q15 threshold, overflow may happen - do negation and compare with negated value to check also highest possible value*/ -#ifdef BASOP_NOGLOB tmp_pit = shl_o( negate( tmp_pit ), tmp_pit_e, &Overflow ); -#else - tmp_pit = shl( negate( tmp_pit ), tmp_pit_e ); -#endif BASOP_SATURATE_WARNING_ON_EVS *cond1 = sub( tmp_pit, negate( tmp_frame ) ); move16(); @@ -829,11 +781,7 @@ static void pulseRes_preCalc( Word16 *cond1, Word16 *cond2, Word32 *cond3, Word1 tmp_pit2 = L_mult( Tc, 4915 /*0.15f Q15*/ ); /*Q16*/ BASOP_SATURATE_WARNING_OFF_EVS /*To calc Q15 threshold, overflow may happen - do negation and compare with negated value to check also highest possible value*/ -#ifdef BASOP_NOGLOB tmp_pit2 = L_shl_sat( L_negate( tmp_pit2 ), sub( 15 - 16, tmp_pit_e ) ); -#else - tmp_pit2 = L_shl( L_negate( tmp_pit2 ), sub( 15 - 16, tmp_pit_e ) ); -#endif BASOP_SATURATE_WARNING_ON_EVS *cond3 = L_sub( L_mult0( -1, tmp_pit ), tmp_pit2 ); move32(); diff --git a/lib_dec/FEC_pitch_estim_fx.c b/lib_dec/FEC_pitch_estim_fx.c index 45304a94c..cb56efc74 100644 --- a/lib_dec/FEC_pitch_estim_fx.c +++ b/lib_dec/FEC_pitch_estim_fx.c @@ -59,11 +59,7 @@ void FEC_pitch_estim_fx( tmp3 = shl_sat( tmp2, 1 ); /*Q6 (1.4f * old_pitch_buf[2*NB_SUBFR-1])*/ tmp16k1 = round_fx( L_shl( Mpy_32_16_1( old_pitch_buf[2 * NB_SUBFR16k - 1], 22938 ), 6 ) ); /*Q6 0.7f * old_pitch_buf[2*NB_SUBFR16k-1]*/ -#ifdef BASOP_NOGLOB tmp16k2 = shl_sat( tmp16k1, 1 ); /*Q6 1.4f * old_pitch_buf[2*NB_SUBFR16k-1]*/ -#else - tmp16k2 = shl( tmp16k1, 1 ); /*Q6 1.4f * old_pitch_buf[2*NB_SUBFR16k-1]*/ -#endif test(); test(); diff --git a/lib_dec/FEC_scale_syn_fx.c b/lib_dec/FEC_scale_syn_fx.c index f8f3d8346..d664aa9fb 100644 --- a/lib_dec/FEC_scale_syn_fx.c +++ b/lib_dec/FEC_scale_syn_fx.c @@ -188,11 +188,7 @@ void FEC_scale_syn_fx( { /* gain2 = (float)sqrt( enr_old / enr2 );*/ L_tmp = Sqrt_Ratio32( L_enr_old, 0, L_enr2, 0, &exp2 ); -#ifdef BASOP_NOGLOB gain2 = round_fx_sat( L_shl_sat( L_tmp, sub( exp2, 1 ) ) ); /* in Q14 */ -#else - gain2 = round_fx( L_shl( L_tmp, sub( exp2, 1 ) ) ); /* in Q14 */ -#endif /*if( gain2 > 1.0f )gain2 = 1.0f;*/ gain2 = s_min( gain2, 16384 ); @@ -205,11 +201,7 @@ void FEC_scale_syn_fx( /*gain1 = (float)sqrt( enr_old / enr1 );*/ L_tmp = Sqrt_Ratio32( L_enr_old, 0, L_enr1, 0, &exp2 ); -#ifdef BASOP_NOGLOB gain1 = round_fx_sat( L_shl_sat( L_tmp, sub( exp2, 1 ) ) ); /* in Q14 */ -#else - gain1 = round_fx( L_shl( L_tmp, sub( exp2, 1 ) ) ); /* in Q14 */ -#endif /*if( gain1 > 1.0f )gain1 = 1.0f;*/ gain1 = s_min( gain1, 16384 ); /*Q14*/ @@ -229,11 +221,7 @@ void FEC_scale_syn_fx( /*rr0 = dotp( h1, h1, L_FRAME/2-1 ) + 0.1f;*/ /*rr1 = dotp( h1, h1+1, L_FRAME/2-1 );*/ /*tilt = rr1 / rr0;*/ -#ifdef BASOP_NOGLOB tilt = extract_h( L_shl_sat( get_gain( h1 + 1, h1, L_FRAME / 2 - 1 ), 15 ) ); /*Q15*/ -#else - tilt = extract_h( L_shl( get_gain( h1 + 1, h1, L_FRAME / 2 - 1 ), 15 ) ); -#endif pitch_dist = 0; move16(); L_mean_pitch = L_mult( pitch[0], 8192 /*1.0f in Q13*/ ); /*Q14*/ @@ -259,11 +247,7 @@ void FEC_scale_syn_fx( ( ( prev_bfi ) || ( ( EQ_16( coder_type, GENERIC ) ) && ( EQ_16( LSF_Q_prediction, AUTO_REGRESSIVE ) ) ) ) ) { /*if( enr_q > scaling * enr_old ){enr_q = scaling * enr_old;}*/ -#ifdef BASOP_NOGLOB L_enr_q = L_min( L_enr_q, L_shl_sat( Mult_32_16( L_enr_old, scaling ), 1 ) ); /* scaling in Q14*/ -#else - L_enr_q = L_min( L_enr_q, L_shl( Mult_32_16( L_enr_old, scaling ), 1 ) ); /* scaling in Q14*/ -#endif } ELSE { @@ -279,11 +263,7 @@ void FEC_scale_syn_fx( ener_max = L_max( ener_max, L_enr_old ); /*if( enr_q > scaling * ener_max ){enr_q = scaling * ener_max;}*/ -#ifdef BASOP_NOGLOB L_enr_q = L_min( L_enr_q, L_shl_sat( Mult_32_16( ener_max, scaling ), 1 ) ); /* scaling in Q14*/ -#else - L_enr_q = L_min( L_enr_q, L_shl( Mult_32_16( ener_max, scaling ), 1 ) ); /* scaling in Q14*/ -#endif } } /*gain2 = (float)sqrt( enr_q / enr2 );*/ @@ -320,11 +300,7 @@ void FEC_scale_syn_fx( /*gain1 = (float)sqrt( enr_old / enr1 );*/ L_tmp = Sqrt_Ratio32( L_enr_old, 0, L_enr1, 0, &exp2 ); -#ifdef BASOP_NOGLOB gain1 = round_fx_sat( L_shl_sat( L_tmp, sub( exp2, 1 ) ) ); /* in Q14 */ -#else - gain1 = round_fx( L_shl( L_tmp, sub( exp2, 1 ) ) ); /* in Q14 */ -#endif /*if( gain1 > 1.2f )gain1 = 1.2f;*/ /* prevent clipping */ @@ -358,11 +334,7 @@ void FEC_scale_syn_fx( exc[i] = mac_r( L_mult( exc[i], gain1 ), exc[i], gain1 ); move16(); /*exc2[i] *= gain1;*/ -#ifdef BASOP_NOGLOB exc2[i] = mac_r_sat( L_mult( exc2[i], gain1 ), exc2[i], gain1 ); -#else - exc2[i] = mac_r( L_mult( exc2[i], gain1 ), exc2[i], gain1 ); -#endif move16(); } /* smoothing is done in excitation domain, so redo synthesis */ @@ -390,11 +362,7 @@ void FEC_scale_syn_fx( /*rr0 = dotp( h1, h1, L_FRAME/2-1 ) + 0.1f;*/ /*rr1 = dotp( h1, h1+1, L_FRAME/2-1 );*/ /*tilt = rr1 / rr0;*/ -#ifdef BASOP_NOGLOB tilt = extract_h( L_shl_sat( get_gain( h1 + 1, h1, L_FRAME / 2 - 1 ), 15 ) ); /*Q15*/ -#else - tilt = extract_h( L_shl( get_gain( h1 + 1, h1, L_FRAME / 2 - 1 ), 15 ) ); -#endif test(); test(); test(); @@ -409,21 +377,13 @@ void FEC_scale_syn_fx( ( ( ( clas == UNVOICED_CLAS ) ) || ( EQ_16( clas, INACTIVE_CLAS ) ) ) ) ) /* unvoiced classification */ { /*if( enr_q > scaling * enr_old )enr_q = scaling * enr_old;*/ -#ifdef BASOP_NOGLOB L_enr_q = L_min( L_enr_q, L_shl_sat( Mult_32_16( L_enr_old, scaling ), 1 ) ); /* scaling in Q14*/ -#else - L_enr_q = L_min( L_enr_q, L_shl( Mult_32_16( L_enr_old, scaling ), 1 ) ); /* scaling in Q14*/ -#endif } ELSE IF( GE_16( last_good, VOICED_TRANSITION ) && LT_16( last_good, INACTIVE_CLAS ) && GE_16( clas, VOICED_TRANSITION ) && LT_16( clas, INACTIVE_CLAS ) ) { /* Voiced-voiced recovery */ test(); -#ifdef BASOP_NOGLOB IF( *old_enr_LP != 0 && GT_16( enr_LP, shl_sat( *old_enr_LP, 1 ) ) ) -#else - IF( *old_enr_LP != 0 && GT_16( enr_LP, shl( *old_enr_LP, 1 ) ) ) -#endif { /* enr_q /= enr_LP */ exp = norm_l( L_enr_q ); @@ -508,11 +468,7 @@ void FEC_scale_syn_fx( L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp2 ); -#ifdef BASOP_NOGLOB gain2 = round_fx_sat( L_shl_sat( L_tmp, sub( exp2, 1 ) ) ); /* in Q14 */ -#else - gain2 = round_fx( L_shl( L_tmp, sub( exp2, 1 ) ) ); /* in Q14 */ -#endif /*-----------------------------------------------------------------* * Clipping of the smoothing gain at the frame end *-----------------------------------------------------------------*/ @@ -573,11 +529,7 @@ void FEC_scale_syn_fx( L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp2 ); -#ifdef BASOP_NOGLOB gain1 = round_fx_sat( L_shl_sat( L_tmp, sub( exp2, 1 ) ) ); /* in Q14 */ -#else - gain1 = round_fx( L_shl( L_tmp, sub( exp2, 1 ) ) ); /* in Q14 */ -#endif /* exp2 is always <= 1 */ gain1 = s_min( gain1, 19661 /*1.2F in Q14*/ ); @@ -609,15 +561,9 @@ void FEC_scale_syn_fx( FOR( i = 0; i < L_frame; i++ ) { gain1 = mac_r( L_tmp, gain1, AGC_FX ); /* in Q14 */ -#ifdef BASOP_NOGLOB exc[i] = mac_r_sat( L_mult_sat( exc[i], gain1 ), exc[i], gain1 ); move16(); exc2[i] = mac_r_sat( L_mult_sat( exc2[i], gain1 ), exc2[i], gain1 ); -#else - exc[i] = mac_r( L_mult( exc[i], gain1 ), exc[i], gain1 ); - move16(); - exc2[i] = mac_r( L_mult( exc2[i], gain1 ), exc2[i], gain1 ); -#endif move16(); } @@ -815,11 +761,7 @@ void FEC_scale_syn_ivas_fx( { /* gain2 = (float)sqrt( enr_old / enr2 );*/ L_tmp = Sqrt_Ratio32( L_enr_old, 0, L_enr2, 0, &exp2 ); -#ifdef BASOP_NOGLOB gain2 = round_fx_sat( L_shl_sat( L_tmp, sub( exp2, 1 ) ) ); /* in Q14 */ -#else - gain2 = round_fx( L_shl( L_tmp, sub( exp2, 1 ) ) ); /* in Q14 */ -#endif /*if( gain2 > 1.0f )gain2 = 1.0f;*/ gain2 = s_min( gain2, 16384 /*1.0f in Q14*/ ); /*Q14*/ @@ -832,11 +774,7 @@ void FEC_scale_syn_ivas_fx( /*gain1 = (float)sqrt( enr_old / enr1 );*/ L_tmp = Sqrt_Ratio32( L_enr_old, 0, L_enr1, 0, &exp2 ); -#ifdef BASOP_NOGLOB gain1 = round_fx_sat( L_shl_sat( L_tmp, sub( exp2, 1 ) ) ); /* in Q14 */ -#else - gain1 = round_fx( L_shl( L_tmp, sub( exp2, 1 ) ) ); /* in Q14 */ -#endif /*if( gain1 > 1.0f )gain1 = 1.0f;*/ gain1 = s_min( gain1, 16384 /*1.0f in Q14*/ ); /*Q14*/ @@ -856,11 +794,7 @@ void FEC_scale_syn_ivas_fx( /*rr0 = dotp( h1, h1, L_FRAME/2-1 ) + 0.1f;*/ /*rr1 = dotp( h1, h1+1, L_FRAME/2-1 );*/ /*tilt = rr1 / rr0;*/ -#ifdef BASOP_NOGLOB tilt = extract_h( L_shl_sat( get_gain( h1 + 1, h1, L_FRAME / 2 - 1 ), 15 ) ); /*Q15*/ -#else - tilt = extract_h( L_shl( get_gain( h1 + 1, h1, L_FRAME / 2 - 1 ), 15 ) ); -#endif pitch_dist = 0; move16(); L_mean_pitch = L_mult( pitch[0], 8192 ); /*Q14*/ @@ -886,11 +820,7 @@ void FEC_scale_syn_ivas_fx( ( ( prev_bfi ) || ( ( EQ_16( coder_type, GENERIC ) ) && ( EQ_16( LSF_Q_prediction, AUTO_REGRESSIVE ) ) ) ) ) { /*if( enr_q > scaling * enr_old ){enr_q = scaling * enr_old;}*/ -#ifdef BASOP_NOGLOB L_enr_q = L_min( L_enr_q, L_shl_sat( Mult_32_16( L_enr_old, scaling ), 1 ) ); /* scaling in Q14*/ -#else - L_enr_q = L_min( L_enr_q, L_shl( Mult_32_16( L_enr_old, scaling ), 1 ) ); /* scaling in Q14*/ -#endif } ELSE { @@ -906,11 +836,7 @@ void FEC_scale_syn_ivas_fx( ener_max = L_max( ener_max, L_enr_old ); /*if( enr_q > scaling * ener_max ){enr_q = scaling * ener_max;}*/ -#ifdef BASOP_NOGLOB L_enr_q = L_min( L_enr_q, L_shl_sat( Mult_32_16( ener_max, scaling ), 1 ) ); /* scaling in Q14*/ -#else - L_enr_q = L_min( L_enr_q, L_shl( Mult_32_16( ener_max, scaling ), 1 ) ); /* scaling in Q14*/ -#endif } } /*gain2 = (float)sqrt( enr_q / enr2 );*/ @@ -947,11 +873,7 @@ void FEC_scale_syn_ivas_fx( /*gain1 = (float)sqrt( enr_old / enr1 );*/ L_tmp = Sqrt_Ratio32( L_enr_old, 0, L_enr1, 0, &exp2 ); -#ifdef BASOP_NOGLOB gain1 = round_fx_sat( L_shl_sat( L_tmp, sub( exp2, 1 ) ) ); /* in Q14 */ -#else - gain1 = round_fx( L_shl( L_tmp, sub( exp2, 1 ) ) ); /* in Q14 */ -#endif /*if( gain1 > 1.2f )gain1 = 1.2f;*/ /* prevent clipping */ @@ -985,11 +907,7 @@ void FEC_scale_syn_ivas_fx( exc[i] = mac_r( L_mult( exc[i], gain1 ), exc[i], gain1 ); move16(); /*exc2[i] *= gain1;*/ -#ifdef BASOP_NOGLOB exc2[i] = mac_r_sat( L_mult( exc2[i], gain1 ), exc2[i], gain1 ); -#else - exc2[i] = mac_r( L_mult( exc2[i], gain1 ), exc2[i], gain1 ); -#endif move16(); } /* smoothing is done in excitation domain, so redo synthesis */ @@ -1017,11 +935,7 @@ void FEC_scale_syn_ivas_fx( /*rr0 = dotp( h1, h1, L_FRAME/2-1 ) + 0.1f;*/ /*rr1 = dotp( h1, h1+1, L_FRAME/2-1 );*/ /*tilt = rr1 / rr0;*/ -#ifdef BASOP_NOGLOB tilt = extract_h( L_shl_sat( get_gain( h1 + 1, h1, L_FRAME / 2 - 1 ), 15 ) ); /*Q15*/ -#else - tilt = extract_h( L_shl( get_gain( h1 + 1, h1, L_FRAME / 2 - 1 ), 15 ) ); -#endif test(); test(); test(); @@ -1036,21 +950,13 @@ void FEC_scale_syn_ivas_fx( ( ( ( clas == UNVOICED_CLAS ) ) || ( EQ_16( clas, INACTIVE_CLAS ) ) ) ) ) /* unvoiced classification */ { /*if( enr_q > scaling * enr_old )enr_q = scaling * enr_old;*/ -#ifdef BASOP_NOGLOB L_enr_q = L_min( L_enr_q, L_shl_sat( Mult_32_16( L_enr_old, scaling ), 1 ) ); /* scaling in Q14*/ -#else - L_enr_q = L_min( L_enr_q, L_shl( Mult_32_16( L_enr_old, scaling ), 1 ) ); /* scaling in Q14*/ -#endif } ELSE IF( GE_16( last_good, VOICED_TRANSITION ) && LT_16( last_good, INACTIVE_CLAS ) && GE_16( clas, VOICED_TRANSITION ) && LT_16( clas, INACTIVE_CLAS ) ) { /* Voiced-voiced recovery */ test(); -#ifdef BASOP_NOGLOB IF( *old_enr_LP != 0 && GT_16( enr_LP, shl_sat( *old_enr_LP, 1 ) ) ) -#else - IF( *old_enr_LP != 0 && GT_16( enr_LP, shl( *old_enr_LP, 1 ) ) ) -#endif { /* enr_q /= enr_LP */ exp = norm_l( L_enr_q ); @@ -1135,11 +1041,7 @@ void FEC_scale_syn_ivas_fx( L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp2 ); -#ifdef BASOP_NOGLOB gain2 = round_fx_sat( L_shl_sat( L_tmp, sub( exp2, 1 ) ) ); /* in Q14 */ -#else - gain2 = round_fx( L_shl( L_tmp, sub( exp2, 1 ) ) ); /* in Q14 */ -#endif /*-----------------------------------------------------------------* * Clipping of the smoothing gain at the frame end *-----------------------------------------------------------------*/ @@ -1200,11 +1102,7 @@ void FEC_scale_syn_ivas_fx( L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp2 ); -#ifdef BASOP_NOGLOB gain1 = round_fx_sat( L_shl_sat( L_tmp, sub( exp2, 1 ) ) ); /* in Q14 */ -#else - gain1 = round_fx( L_shl( L_tmp, sub( exp2, 1 ) ) ); /* in Q14 */ -#endif /* exp2 is always <= 1 */ gain1 = s_min( gain1, 19661 /*1.2f in Q14*/ ); /*Q14*/ @@ -1236,15 +1134,9 @@ void FEC_scale_syn_ivas_fx( FOR( i = 0; i < L_frame; i++ ) { gain1 = mac_r( L_tmp, gain1, AGC_FX ); /* in Q14 */ -#ifdef BASOP_NOGLOB exc[i] = mac_r_sat( L_mult_sat( exc[i], gain1 ), exc[i], gain1 ); move16(); exc2[i] = mac_r_sat( L_mult_sat( exc2[i], gain1 ), exc2[i], gain1 ); -#else - exc[i] = mac_r( L_mult( exc[i], gain1 ), exc[i], gain1 ); - move16(); - exc2[i] = mac_r( L_mult( exc2[i], gain1 ), exc2[i], gain1 ); -#endif move16(); } diff --git a/lib_dec/LD_music_post_filter_fx.c b/lib_dec/LD_music_post_filter_fx.c index 042520870..1fa498a0e 100644 --- a/lib_dec/LD_music_post_filter_fx.c +++ b/lib_dec/LD_music_post_filter_fx.c @@ -186,11 +186,7 @@ void LD_music_post_filter_fx( FOR( k = j; k < mfreq_bindiv_LD[i] + j; k++ ) { /*m_ave += lf_E[k];*/ -#ifdef BASOP_NOGLOB Ltmp = L_add_o( lf_E[k], Ltmp, &Overflow ); /*2*Qdct+10*/ -#else - Ltmp = L_add( lf_E[k], Ltmp ); -#endif max_val = L_max( max_val, lf_E[k] ); } Ltmp_max = L_max( Ltmp_max, max_val ); /*2*Qdct+10*/ @@ -367,11 +363,7 @@ void LD_music_post_filter_fx( tmp16 = s_min( max_ovf_2k, hMusicPF->filt_lfE_fx[i] ); /*Q12*/ tmp16 = s_max( min_g_2k, tmp16 ); /*Q12*/ /*DCT_buf[i] *= ftmp;*/ -#ifdef BASOP_NOGLOB dtc_out[i] = round_fx_sat( L_shl_sat( L_mult( dtc_out[i], tmp16 ), 3 ) ); /*Q15*/ -#else - dtc_out[i] = round_fx( L_shl( L_mult( dtc_out[i], tmp16 ), 3 ) ); -#endif move16(); } @@ -380,11 +372,7 @@ void LD_music_post_filter_fx( tmp16 = s_min( max_ovf_4k, hMusicPF->filt_lfE_fx[i] ); /*Q12*/ tmp16 = s_max( min_g_4k, tmp16 ); /*Q12*/ /*DCT_buf[i] *= ftmp;*/ -#ifdef BASOP_NOGLOB dtc_out[i] = round_fx_sat( L_shl_sat( L_mult_sat( dtc_out[i], tmp16 ), 3 ) ); /*Q15*/ -#else - dtc_out[i] = round_fx( L_shl( L_mult( dtc_out[i], tmp16 ), 3 ) ); -#endif move16(); } @@ -397,11 +385,7 @@ void LD_music_post_filter_fx( tmp16 = s_min( max_ovf_6k, hMusicPF->filt_lfE_fx[i] ); /*Q12*/ tmp16 = s_max( min_g_6k, tmp16 ); /*Q12*/ /*DCT_buf[i] *= ftmp;*/ -#ifdef BASOP_NOGLOB dtc_out[i] = round_fx_sat( L_shl_sat( L_mult_sat( dtc_out[i], tmp16 ), 3 ) ); /*Q15*/ -#else - dtc_out[i] = round_fx( L_shl( L_mult( dtc_out[i], tmp16 ), 3 ) ); -#endif move16(); } } @@ -413,11 +397,7 @@ void LD_music_post_filter_fx( { tmp16 = s_min( 4096 /*1.0f in Q12*/, hMusicPF->filt_lfE_fx[i] ); /*Q12*/ /*DCT_buf[i] *= ftmp;*/ -#ifdef BASOP_NOGLOB dtc_out[i] = round_fx_sat( L_shl_sat( L_mult_sat( dtc_out[i], tmp16 ), 3 ) ); /*Q15*/ -#else - dtc_out[i] = round_fx( L_shl( L_mult( dtc_out[i], tmp16 ), 3 ) ); -#endif move16(); } } @@ -543,11 +523,7 @@ static void spectrum_mod_dct_fx( IF( music_flag != 0 ) /* prevent subtraction on clean speech */ { -#ifdef BASOP_NOGLOB IF( LE_32( maxNoise, L_shl_o( 10, scaling, &Overflow ) ) ) -#else - IF( LE_32( maxNoise, L_shl( 10, scaling ) ) ) -#endif { minE = 18432 / 2; /*Q14*/ move16(); @@ -623,21 +599,12 @@ static void spectrum_mod_dct_fx( Ltmp = L_mult( tmpN, m_binE ); /*2*Qdct+e_binE+9*/ e_binE = sub( add( e_tmp, e_binE ), 15 ); -#ifdef BASOP_NOGLOB Ltmp = L_shr_o( Ltmp, e_binE, &Overflow ); /*2*Qdct+9*/ Lgain = L_add_o( Ltmp, Lshift, &Overflow ); /*Saturation can occure here result in Q30*/ -#else - Ltmp = L_shr( Ltmp, e_binE ); - Lgain = L_add( Ltmp, Lshift ); /*Saturation can occure here result in Q30*/ -#endif } Lpt2++; -#ifdef BASOP_NOGLOB gain = round_fx_o( Lgain, &Overflow ); /*gain in Q30-16 = Q14*/ -#else - gain = round_fx( Lgain ); /*gain in Q30-16 = Q14*/ -#endif /*if (gain < minE)gain = minE;*/ gain = s_max( gain, minE ); /*Q14*/ /*if (gain > 1.0f+MAX_GN)gain = 1.0f+MAX_GN;*/ @@ -664,11 +631,7 @@ static void spectrum_mod_dct_fx( Ltmp = L_mult( gain, 32767 /*Q15*/ ); /*Q30*/ *pt_gbin = round_fx( L_mac( Ltmp, alpha, *pt_gbin ) ); /*Q14*/ /**pt++ *= *pt_gbin;*/ -#ifdef BASOP_NOGLOB *pt = round_fx_sat( L_shl_sat( L_mult( *pt, *pt_gbin ), 1 ) ); /*Qdct*/ -#else - *pt = round_fx( L_shl( L_mult( *pt, *pt_gbin ), 1 ) ); -#endif move16(); move16(); pt++; @@ -774,11 +737,7 @@ static void find_enr_dct_fx( { /* energy */ /**ptE = *ptR * *ptR; */ -#ifdef BASOP_NOGLOB Ltmp = L_mult_sat( *ptR, *ptR ); /*2*Qdct+1*/ -#else - Ltmp = L_mult( *ptR, *ptR ); -#endif /* normalization */ /**ptE *= 1.0f / (DCT_L_POST);*/ Ltmp = Mult_32_16( Ltmp, 26214 ); /*26214 = 1.0/640 ->Q15+9 --> 2*Q_dct + 10*/ @@ -787,11 +746,7 @@ static void find_enr_dct_fx( move32(); /*band[i] += *ptE++;*/ -#ifdef BASOP_NOGLOB Ltmp1 = L_add_sat( Ltmp, Ltmp1 ); /*2*Q_dct + 10*/ -#else - Ltmp1 = L_add( Ltmp, Ltmp1 ); -#endif ptE++; ptR++; @@ -812,11 +767,7 @@ static void find_enr_dct_fx( FOR( i = min_band; i <= NB_LIMIT_BAND; i++ ) { /* total channel energy */ -#ifdef BASOP_NOGLOB Ltmp = L_add_sat( band[i], Ltmp ); /* 2*Q_dct + 10*/ -#else - Ltmp = L_add( band[i], Ltmp ); -#endif } *Etot = Ltmp; /* 2*Q_dct + 10*/ @@ -965,11 +916,7 @@ static Word16 norm_lfe( exp3 = sub( exp2, 12 + 16 - 3 ); /* if exp2 < 31, means that tmp >= 1.0 */ /* Need to shl by 3 to take into account the 3 multiplications */ } -#ifdef BASOP_NOGLOB tmp16 = shl_o( tmp16, exp3, &Overflow ); /* Result in Q12 */ -#else - tmp16 = shl( tmp16, exp3 ); /* Result in Q12 */ -#endif return tmp16; } diff --git a/lib_dec/TonalComponentDetection_fx.c b/lib_dec/TonalComponentDetection_fx.c index 569a2bffa..b2f3021b5 100644 --- a/lib_dec/TonalComponentDetection_fx.c +++ b/lib_dec/TonalComponentDetection_fx.c @@ -494,11 +494,7 @@ static void getEnvelope( /* No need for PTR_INIT for powerSpec[i+n2] as we continue from the previous loop */ FOR( i = 0; i < n1; i++ ) { -#ifdef BASOP_NOGLOB sum = L_add_sat( sum, powerSpec[i + n2] ); /*powerSpec_exp*/ -#else - sum = L_add( sum, powerSpec[i + n2] ); -#endif tmp = Mpy_32_16_1( sum /*Q31,powerSpec_exp*/, level /*Q12*/ ); /*Q28,powerSpec_exp*/ envelope[i] /*Q28,powerSpec_exp*/ = Mpy_32_16_1( tmp /*Q28,powerSpec_exp*/, InvIntTable[i + nSecondHalfFilterLength] /*Q15*/ ); move32(); @@ -507,11 +503,7 @@ static void getEnvelope( inv_len = mult_r( level, InvIntTable[nFilterLength] ); /*Q12*/ FOR( i = n1; i < nSamples - n2; i++ ) { -#ifdef BASOP_NOGLOB sum = L_add_sat( sum, L_sub( powerSpec[i + n2], powerSpec[i - n1] ) ); /*powerSpec_exp*/ -#else - sum = L_add( sum, L_sub( powerSpec[i + n2], powerSpec[i - n1] ) ); -#endif envelope[i] = Mpy_32_16_1( sum, inv_len ); /*Q28*/ move32(); } diff --git a/lib_dec/acelp_core_switch_dec_fx.c b/lib_dec/acelp_core_switch_dec_fx.c index 8224a74eb..f36571f4f 100644 --- a/lib_dec/acelp_core_switch_dec_fx.c +++ b/lib_dec/acelp_core_switch_dec_fx.c @@ -332,12 +332,8 @@ ivas_error acelp_core_switch_dec_fx( pt2 = &hb_synth_tmp[tmp]; FOR( i = 0; i < gapsize; i++ ) { -#ifdef BASOP_NOGLOB *pt1++ = round_fx_sat( L_shl_sat( L_mult_sat( ( *pt2++ ), gain ), 2 ) ); move16(); -#else - *pt1++ = round_fx( L_shl( L_mult( ( *pt2++ ), gain ), 2 ) ); -#endif } } ELSE @@ -973,11 +969,7 @@ static void decod_gen_voic_core_switch_fx( IF( st_fx->prev_bfi ) { /*gain_code = min(gain_code, 0.5f*gain_code+0.5f*st->lp_gainc);*/ -#ifdef BASOP_NOGLOB gain_code16 = s_min( gain_code16, mac_r( L_mult( 16384, gain_code16 ), shl_o( 16384 >> 3, st_fx->Q_exc, &Overflow ), st_fx->lp_gainc_fx ) ); /* st_fx->lp_gainc_fx in Q3 >>3 to bring it to Q0 as gain_code16 */ -#else - gain_code16 = s_min( gain_code16, mac_r( L_mult( 16384, gain_code16 ), shl( 16384 >> 3, st_fx->Q_exc ), st_fx->lp_gainc_fx ) ); /* st_fx->lp_gainc_fx in Q3 >>3 to bring it to Q0 as gain_code16 */ -#endif } FOR( i = 0; i < L_SUBFR; i++ ) diff --git a/lib_dec/amr_wb_dec_fx.c b/lib_dec/amr_wb_dec_fx.c index 72ceb6cd3..d45655903 100644 --- a/lib_dec/amr_wb_dec_fx.c +++ b/lib_dec/amr_wb_dec_fx.c @@ -1046,11 +1046,7 @@ ivas_error amr_wb_dec_fx( FOR( i = 0; i < tmps; i++ ) { -#ifdef BASOP_NOGLOB synth_out_fx[( i + delay_comp )] = msu_r_sat( L_mult( synth_out_fx[( i + delay_comp )], alpha ), hHQ_core->old_out_fx[( i + nz )], add( alpha, -32768 ) ); -#else - synth_out_fx[i + delay_comp] = msu_r( L_mult( synth_out_fx[i + delay_comp], alpha ), hHQ_core->old_out_fx[i + nz], add( alpha, -32768 ) ); -#endif move16(); alpha = add( alpha, step ); } diff --git a/lib_dec/arith_coder_dec_fx.c b/lib_dec/arith_coder_dec_fx.c index 68736867d..4a18f64f9 100644 --- a/lib_dec/arith_coder_dec_fx.c +++ b/lib_dec/arith_coder_dec_fx.c @@ -61,11 +61,7 @@ static Word16 tcx_arith_decode_fx( { bp = ari_decode_14bits_sign_fx( prm, bp, target_bits, &s, &as ); -#ifdef BASOP_NOGLOB L_tmp = L_macNs_co( L_tmp, q, k, &Carry, &Overflow ); -#else - L_tmp = L_macNs( L_tmp, q, k ); -#endif Q = L_mult( q, negate( shl( 1, sub( 30, SPEC_EXP_DEC ) ) ) ); IF( EQ_16( s, 0 ) ) diff --git a/lib_dec/bass_psfilter_fx.c b/lib_dec/bass_psfilter_fx.c index 0f290fc8f..7d05704e4 100644 --- a/lib_dec/bass_psfilter_fx.c +++ b/lib_dec/bass_psfilter_fx.c @@ -192,11 +192,7 @@ void bass_psfilter_fx( } tmp = sum16_fx( hBPF->Track_on_hist, L_TRACK_HIST ); -#ifdef BASOP_NOGLOB TrackOnR = round_fx_sat( L_shl_sat( L_mult0( tmp, 3277 ), 16 ) ); /*Q15 */ -#else - TrackOnR = round_fx( L_shl( L_mult0( tmp, 3277 ), 16 ) ); /*Q15 */ -#endif vibratR = sum16_fx( hBPF->vibrato_hist, L_TRACK_HIST ); /*Q0 */ alp_tmp = sub( 32767, TrackOnR ); /*Q15 */ @@ -330,19 +326,11 @@ void bass_psfilter_fx( { Lcorr0 = L_mult0( syn_fx[j], syn2_fx[j] ); /* Q31 */ Lener0 = L_mult0( syn2_fx[j], syn2_fx[j] ); /* Q31 */ -#ifdef BASOP_NOGLOB Lcorr0 = L_mac0_sat( Lcorr0, syn_fx[j + 1], syn2_fx[j + 1] ); /* Q31 */ Lener0 = L_mac0_sat( Lener0, syn2_fx[j + 1], syn2_fx[j + 1] ); /* Q31 */ Lcorr = L_add_sat( Lcorr, L_shr( Lcorr0, 4 ) ); Lener = L_add_sat( Lener, L_shr( Lener0, 4 ) ); -#else - Lcorr0 = L_mac0( Lcorr0, syn_fx[j + 1], syn2_fx[j + 1] ); - Lener0 = L_mac0( Lener0, syn2_fx[j + 1], syn2_fx[j + 1] ); - - Lcorr = L_add( Lcorr, L_shr( Lcorr0, 4 ) ); - Lener = L_add( Lener, L_shr( Lener0, 4 ) ); -#endif /* this loop is not efficient but it provide a respectable precision while avoiding overflow. */ } @@ -354,17 +342,9 @@ void bass_psfilter_fx( Ltmp = L_abs( Lcorr ); exp = norm_l( Ltmp ); -#ifdef BASOP_NOGLOB tmp = round_fx_sat( L_shl_sat( Ltmp, exp ) ); -#else - tmp = round_fx( L_shl( Ltmp, exp ) ); -#endif exp2 = norm_l( Lener ); -#ifdef BASOP_NOGLOB tmp2 = round_fx_sat( L_shl( Lener, exp2 ) ); -#else - tmp2 = round_fx( L_shl( Lener, exp2 ) ); -#endif if ( GT_16( tmp, tmp2 ) ) { exp = sub( exp, 1 ); @@ -381,11 +361,7 @@ void bass_psfilter_fx( FOR( i = 0; i < subfr_len; i++ ) { /* err[i] = syn_fx[i] - gain*syn2_fx[i] */ -#ifdef BASOP_NOGLOB err[i] = msu_r_sat( L_shr_sat( L_mult0( gain, syn2_fx[i] ), exp2 ), syn_fx[i], 16384 ); /* Q15 */ -#else - err[i] = msu_r( L_shr( L_mult0( gain, syn2_fx[i] ), exp2 ), syn_fx[i], 16384 ); -#endif move16(); /* the sign is inverted but it is not important because we calculate energy with 'err[i]' x 'err[i]' @@ -404,28 +380,16 @@ void bass_psfilter_fx( tmp2 = sub( tmp2, 1 + 4 ); /* substract 1 because 'Lener' is divided by two */ tmp2 = add( tmp2, Q_syn2x ); tmp2 = s_max( 0, s_min( 30, tmp2 ) ); -#ifdef BASOP_NOGLOB Lener = L_add_sat( Lener, Pow2( tmp2, exp2 ) ); -#else - Lener = L_add( Lener, Pow2( tmp2, exp2 ) ); -#endif exp2 = norm_l( Lener ); -#ifdef BASOP_NOGLOB tmp2 = round_fx_sat( L_shl( Lener, exp2 ) ); -#else - tmp2 = round_fx( L_shl( Lener, exp2 ) ); -#endif if ( GT_16( tmp, tmp2 ) ) { exp = sub( exp, 1 ); } exp2 = sub( exp, exp2 ); /* exponent num - exponent denom */ /* alpha = corr / ener */ -#ifdef BASOP_NOGLOB alpha = shr_sat( div_s( round_fx_sat( L_shl_sat( Ltmp, exp ) ), tmp2 ), exp2 ); /*Q15 */ -#else - alpha = shr( div_s( round_fx( L_shl( Ltmp, exp ) ), tmp2 ), exp2 ); /*Q15 */ -#endif if ( Lcorr < 0 ) { alpha = sub( 0, alpha ); @@ -471,13 +435,8 @@ void bass_psfilter_fx( FOR( i = 0; i < subfr_len; i++ ) { /*syn2_fx[i] = alpha*(syn_fx[i]-syn2_fx[i]); */ -#ifdef BASOP_NOGLOB tmp = sub_sat( syn_fx[i], syn2_fx[i] ); syn2_fx[i] = mult_sat( alpha, shl_sat( tmp, 1 ) ); -#else - tmp = sub( syn_fx[i], syn2_fx[i] ); - syn2_fx[i] = mult( alpha, shl( tmp, 1 ) ); -#endif move16(); /*Q_syn2 */ } @@ -490,11 +449,7 @@ void bass_psfilter_fx( This sum is divided by 4 */ FOR( i = 0; i < subfr_len; i++ ) { -#ifdef BASOP_NOGLOB Lener = L_mac0_sat( Lener, err[i], err[i] ); /* Q31 */ -#else - Lener = L_mac0( Lener, err[i], err[i] ); -#endif } exp2 = -1 - 2; move16(); @@ -506,11 +461,7 @@ void bass_psfilter_fx( FOR( i = 0; i < shr( subfr_len, 1 ); i++ ) { Lener0 = L_mult0( sigPtr[i], sigPtr[i] ); /* Q31 */ -#ifdef BASOP_NOGLOB Lener = L_add( Lener, L_shr( L_mac0_sat( Lener0, err[i], err[i] ), 5 ) ); -#else - Lener = L_add( Lener, L_shr( L_mac0( Lener0, err[i], err[i] ), 5 ) ); -#endif } exp2 = sub( exp2, 5 ); } @@ -565,19 +516,11 @@ void bass_psfilter_fx( { Lcorr0 = L_mult0( syn_fx[j], syn2_fx[j] ); /* Q31 */ Lener0 = L_mult0( syn2_fx[j], syn2_fx[j] ); /* Q31 */ -#ifdef BASOP_NOGLOB Lcorr0 = L_mac0_sat( Lcorr0, sigPtr[j], sigPtr1[j] ); /* Q31 */ Lener0 = L_mac0_sat( Lener0, sigPtr1[j], sigPtr1[j] ); /* Q31 */ Lcorr = L_add_sat( Lcorr, L_shr( Lcorr0, 4 ) ); Lener = L_add_sat( Lener, L_shr( Lener0, 4 ) ); -#else - Lcorr0 = L_mac0( Lcorr0, sigPtr[j], sigPtr1[j] ); - Lener0 = L_mac0( Lener0, sigPtr1[j], sigPtr1[j] ); - - Lcorr = L_add( Lcorr, L_shr( Lcorr0, 4 ) ); - Lener = L_add( Lener, L_shr( Lener0, 4 ) ); -#endif /* this loop is not efficient but it provide a respectable precision while avoiding overflow. */ } @@ -589,15 +532,9 @@ void bass_psfilter_fx( Ltmp = L_abs( Lcorr ); exp = norm_l( Ltmp ); -#ifdef BASOP_NOGLOB tmp = round_fx_sat( L_shl_sat( Ltmp, exp ) ); exp2 = norm_l( Lener ); tmp2 = round_fx_sat( L_shl_sat( Lener, exp2 ) ); -#else - tmp = round_fx( L_shl( Ltmp, exp ) ); - exp2 = norm_l( Lener ); - tmp2 = round_fx( L_shl( Lener, exp2 ) ); -#endif if ( GT_16( tmp, tmp2 ) ) { exp = sub( exp, 1 ); @@ -633,17 +570,9 @@ void bass_psfilter_fx( tmp2 = sub( tmp2, 1 + 4 ); /* substract 1 because 'Lener' is divided by two */ tmp2 = add( tmp2, Q_syn2x ); tmp2 = s_max( 0, s_min( 30, tmp2 ) ); -#ifdef BASOP_NOGLOB Lener = L_add_sat( Lener, Pow2( tmp2, exp2 ) ); -#else - Lener = L_add( Lener, Pow2( tmp2, exp2 ) ); -#endif exp2 = norm_l( Lener ); -#ifdef BASOP_NOGLOB tmp2 = round_fx_sat( L_shl( Lener, exp2 ) ); -#else - tmp2 = round_fx( L_shl( Lener, exp2 ) ); -#endif if ( GT_16( tmp, tmp2 ) ) { exp = sub( exp, 1 ); @@ -675,11 +604,7 @@ void bass_psfilter_fx( This sum is divided by 4 */ FOR( i = 0; i < subfr_len; i++ ) { -#ifdef BASOP_NOGLOB Lener = L_mac0_sat( Lener, err[i], err[i] ); /* Q31 */ -#else - Lener = L_mac0( Lener, err[i], err[i] ); -#endif } exp2 = -1 - 2; move16(); @@ -691,11 +616,7 @@ void bass_psfilter_fx( FOR( i = 0; i < subfr_len / 2; i++ ) { Lener0 = L_mult0( sigPtr[i], sigPtr[i] ); /* Q31 */ -#ifdef BASOP_NOGLOB Lener = L_add_sat( Lener, L_shr( L_mac0_sat( Lener0, err[i], err[i] ), 5 ) ); -#else - Lener = L_add( Lener, L_shr( L_mac0( Lener0, err[i], err[i] ), 5 ) ); -#endif } exp2 = sub( exp2, 5 ); } @@ -798,15 +719,9 @@ static Word16 Pit_track_fx( /* o : Pitch */ Lcorr0 = L_mult0( *v1++, *v2++ ); /* Q31 */ FOR( i = 1; i < ( ( L_HALFR16k + NBPSF_L_EXTRA ) / 14 ); i++ ) { -#ifdef BASOP_NOGLOB Lener0 = L_mac0_sat( Lener0, *v1, *v1 ); /* Q31 */ Ltmp0 = L_mac0_sat( Ltmp0, *v2, *v2 ); /* Q31 */ Lcorr0 = L_mac0_sat( Lcorr0, *v1++, *v2++ ); /* Q31 */ -#else - Lener0 = L_mac0( Lener0, *v1, *v1 ); - Ltmp0 = L_mac0( Ltmp0, *v2, *v2 ); - Lcorr0 = L_mac0( Lcorr0, *v1++, *v2++ ); -#endif } BASOP_SATURATE_WARNING_ON_EVS test(); @@ -846,11 +761,7 @@ static Word16 Pit_track_fx( /* o : Pitch */ exp1 = norm_l( Lener ); exp2 = norm_l( Ltmp ); /* Multiply the Most Significant 16 bits */ -#ifdef BASOP_NOGLOB Ltmp = L_mult0( round_fx_sat( L_shl_sat( Lener, exp1 ) ), round_fx_sat( L_shl_sat( Ltmp, exp2 ) ) ); /* Q31 */ -#else - Ltmp = L_mult0( round_fx( L_shl( Lener, exp1 ) ), round_fx( L_shl( Ltmp, exp2 ) ) ); -#endif exp1 = add( exp1, exp2 ); /* Correct if Odd # of Shifts */ exp2 = s_and( exp1, 1 ); @@ -868,11 +779,7 @@ static Word16 Pit_track_fx( /* o : Pitch */ exp1 = sub( exp1, exp2 ); Ltmp = Mpy_32_16_1( Lcorr, round_fx( Ltmp ) ); /* Go to Q31 */ -#ifdef BASOP_NOGLOB Ltmp = L_shl_sat( Ltmp, exp1 ); -#else - Ltmp = L_shl( Ltmp, exp1 ); -#endif /* cn = normalized correlation of pitch/2 */ if ( GT_32( Ltmp, 2040109466L ) ) /* 0.95f in Q31 */ { diff --git a/lib_dec/cng_dec_fx.c b/lib_dec/cng_dec_fx.c index 1ca8f8ac3..1f59b093e 100644 --- a/lib_dec/cng_dec_fx.c +++ b/lib_dec/cng_dec_fx.c @@ -524,11 +524,7 @@ void CNG_dec_fx( FOR( i = 0; i < M; i++ ) { dev = abs_s( sub( lsp_tmp[i], lsp_new[i] ) ); /*Q15*/ -#ifdef BASOP_NOGLOB dist = add_o( dist, dev, &Overflow ); /*Q15*/ -#else - dist = add( dist, dev ); /*Q15*/ -#endif if ( GT_16( dev, max_dev ) ) { max_dev = dev; @@ -562,31 +558,19 @@ void CNG_dec_fx( FOR( j = 0; j < m1; j++ ) { /* env[i] += tmp_env[j*NUM_ENV_CNG+i];*/ -#ifdef BASOP_NOGLOB L_tmp = L_add_sat( L_tmp, tmp_env[j * NUM_ENV_CNG + i] ); -#else - L_tmp = L_add( L_tmp, tmp_env[j * NUM_ENV_CNG + i] ); -#endif } /* env[i] /= (float)m1; */ /* env[i] = env[i] - 2*st_fx->lp_ener_fx; */ IF( EQ_16( m1, 1 ) ) { -#ifdef BASOP_NOGLOB L_tmp = L_sub_sat( L_tmp, L_add_sat( st_fx->lp_ener_fx, st_fx->lp_ener_fx ) ); /* Q6 */ -#else - L_tmp = L_sub( L_tmp, L_add( st_fx->lp_ener_fx, st_fx->lp_ener_fx ) ); -#endif } ELSE { tmp1 = div_s( 1, m1 ); L_tmp = Mult_32_16( L_tmp, tmp1 ); /* Q6 */ -#ifdef BASOP_NOGLOB L_tmp = L_sub_sat( L_tmp, L_add_sat( st_fx->lp_ener_fx, st_fx->lp_ener_fx ) ); /* Q6 */ -#else - L_tmp = L_sub( L_tmp, L_add( st_fx->lp_ener_fx, st_fx->lp_ener_fx ) ); -#endif } env[i] = L_tmp; /* Q6 */ move32(); @@ -606,11 +590,7 @@ void CNG_dec_fx( { /* Update hangover memory during CNG */ test(); -#ifdef BASOP_NOGLOB IF( ( *allow_cn_step == 0 ) && LT_32( hTdCngDec->Enew_fx, L_add_sat( st_fx->lp_ener_fx, L_shr( st_fx->lp_ener_fx, 1 ) ) ) ) -#else - IF( *allow_cn_step == 0 && LT_32( hTdCngDec->Enew_fx, L_add( st_fx->lp_ener_fx, L_shr( st_fx->lp_ener_fx, 1 ) ) ) ) -#endif { /* update the pointer to circular buffer of old LSP vectors */ hTdCngDec->ho_hist_ptr++; @@ -634,11 +614,7 @@ void CNG_dec_fx( exp = norm_l( hTdCngDec->Enew_fx ); L_tmp = L_shl( hTdCngDec->Enew_fx, exp ); /*Q(exp+6)*/ L_tmp = Mult_32_16( L_tmp, shl( st_fx->L_frame, 5 ) ); /*Q(exp+6+5-15=exp-4)*/ -#ifdef BASOP_NOGLOB L_tmp = L_shr_sat( L_tmp, sub( exp, 10 ) ); /*Q6*/ -#else - L_tmp = L_shr( L_tmp, sub( exp, 10 ) ); /*Q6*/ -#endif exp = norm_l( L_tmp ); fra = Log2_norm_lc( L_shl( L_tmp, exp ) ); exp = sub( sub( 30, exp ), 6 ); @@ -1219,11 +1195,7 @@ void CNG_dec_ivas_fx( FOR( i = 0; i < M; i++ ) { dev = abs_s( sub( lsp_tmp[i], lsp_new[i] ) ); /*Q15*/ -#ifdef BASOP_NOGLOB dist = add_o( dist, dev, &Overflow ); /*Q15*/ -#else - dist = add( dist, dev ); /*Q15*/ -#endif if ( GT_16( dev, max_dev ) ) { max_dev = dev; @@ -1257,31 +1229,19 @@ void CNG_dec_ivas_fx( FOR( j = 0; j < m1; j++ ) { /* env[i] += tmp_env[j*NUM_ENV_CNG+i];*/ -#ifdef BASOP_NOGLOB L_tmp = L_add_sat( L_tmp, tmp_env[j * NUM_ENV_CNG + i] ); -#else - L_tmp = L_add( L_tmp, tmp_env[j * NUM_ENV_CNG + i] ); -#endif } /* env[i] /= (float)m1; */ /* env[i] = env[i] - 2*st_fx->lp_ener_fx; */ IF( EQ_16( m1, 1 ) ) { -#ifdef BASOP_NOGLOB L_tmp = L_sub_sat( L_tmp, L_add_sat( st_fx->lp_ener_fx, st_fx->lp_ener_fx ) ); /* Q6 */ -#else - L_tmp = L_sub( L_tmp, L_add( st_fx->lp_ener_fx, st_fx->lp_ener_fx ) ); -#endif } ELSE { tmp1 = div_s( 1, m1 ); L_tmp = Mult_32_16( L_tmp, tmp1 ); /* Q6 */ -#ifdef BASOP_NOGLOB L_tmp = L_sub_sat( L_tmp, L_add_sat( st_fx->lp_ener_fx, st_fx->lp_ener_fx ) ); /* Q6 */ -#else - L_tmp = L_sub( L_tmp, L_add( st_fx->lp_ener_fx, st_fx->lp_ener_fx ) ); -#endif } env[i] = L_tmp; /* Q6 */ move32(); @@ -1301,11 +1261,7 @@ void CNG_dec_ivas_fx( { /* Update hangover memory during CNG */ test(); -#ifdef BASOP_NOGLOB IF( ( *allow_cn_step == 0 ) && LT_32( hTdCngDec->Enew_fx, L_add_sat( st_fx->lp_ener_fx, L_shr( st_fx->lp_ener_fx, 1 ) ) ) ) -#else - IF( *allow_cn_step == 0 && LT_32( hTdCngDec->Enew_fx, L_add( st_fx->lp_ener_fx, L_shr( st_fx->lp_ener_fx, 1 ) ) ) ) -#endif { /* update the pointer to circular buffer of old LSP vectors */ hTdCngDec->ho_hist_ptr++; @@ -1329,11 +1285,7 @@ void CNG_dec_ivas_fx( exp = norm_l( hTdCngDec->Enew_fx ); L_tmp = L_shl( hTdCngDec->Enew_fx, exp ); /*Q(exp+6)*/ L_tmp = Mult_32_16( L_tmp, shl( st_fx->L_frame, 5 ) ); /*Q(exp+6+5-15=exp-4)*/ -#ifdef BASOP_NOGLOB L_tmp = L_shr_sat( L_tmp, sub( exp, 10 ) ); /*Q6*/ -#else - L_tmp = L_shr( L_tmp, sub( exp, 10 ) ); /*Q6*/ -#endif exp = norm_l( L_tmp ); fra = Log2_norm_lc( L_shl( L_tmp, exp ) ); exp = sub( sub( 30, exp ), 6 ); @@ -1575,11 +1527,7 @@ static void shb_CNG_decod_fx( interp_fx = s_min( st_fx->shb_dtx_count_fx, 32 ); -#ifdef BASOP_NOGLOB interp_fx = shl_sat( interp_fx, 10 ); /*Q15*/ -#else - interp_fx = shl( interp_fx, 10 ); /*Q15*/ -#endif FOR( i = 0; i < LPC_SHB_ORDER; i++ ) { tmp2 = mult( interp_fx, st_fx->lsp_shb_prev_fx[i] ); /*Q14*/ @@ -1709,11 +1657,7 @@ static void shb_CNG_decod_fx( IF( st_fx->trans_cnt_fx > 0 ) { i = extract_l( L_mult0( st_fx->trans_cnt_fx, 17 ) ); /*Q0 */ -#ifdef BASOP_NOGLOB ener_fx = add_sat( st_fx->shb_cng_ener_fx, mult( sin_table256_fx[i], sub_sat( st_fx->last_shb_ener_fx, st_fx->shb_cng_ener_fx ) ) ); /*Q8 */ -#else - ener_fx = add( st_fx->shb_cng_ener_fx, mult( sin_table256_fx[i], sub( st_fx->last_shb_ener_fx, st_fx->shb_cng_ener_fx ) ) ); /*Q8 */ -#endif st_fx->trans_cnt_fx = sub( st_fx->trans_cnt_fx, 1 ); move16(); } @@ -1728,11 +1672,7 @@ static void shb_CNG_decod_fx( move32(); } fra = L_Extract_lc( L_tmp, &exp ); -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( Pow2( exp, fra ), 5 ); /*Q5 */ -#else - L_tmp = L_shl( Pow2( exp, fra ), 5 ); /*Q5 */ -#endif L_tmp = L_shr( L_tmp, 10 ); if ( !L_tmp ) { @@ -1858,11 +1798,7 @@ static void shb_CNG_decod_ivas_fx( /* SHB spectrum estimation */ interp_fx = s_min( st->hTdCngDec->shb_dtx_count, 32 ); -#ifdef BASOP_NOGLOB interp_fx = shl_sat( interp_fx, 10 ); /*Q15*/ -#else - interp_fx = shl( interp_fx, 10 ); /*Q15*/ -#endif FOR( i = 0; i < LPC_SHB_ORDER; i++ ) { diff --git a/lib_dec/core_switching_dec_fx.c b/lib_dec/core_switching_dec_fx.c index bd7d53bc6..7651c5a89 100644 --- a/lib_dec/core_switching_dec_fx.c +++ b/lib_dec/core_switching_dec_fx.c @@ -221,12 +221,8 @@ void bw_switching_pre_proc_fx( * Calculate tilt of the ACELP core synthesis *----------------------------------------------------------------------*/ -#ifdef BASOP_NOGLOB st_fx->tilt_wb_fx = round_fx_o( L_shl_o( calc_tilt_bwe_fx( old_syn_12k8_16k_fx, -1, st_fx->L_frame ), 3, &Overflow ), &Overflow ); /* Q11 */ move16(); -#else - st_fx->tilt_wb_fx = round_fx( L_shl( calc_tilt_bwe_fx( old_syn_12k8_16k_fx, -1, st_fx->L_frame ), 3 ) ); -#endif /*-------------------------------------------------------------------------------* * Calculate frequency energy of 0~3.2kHz and 3.2~6.4kHz the ACELP core synthesis *-------------------------------------------------------------------------------*/ @@ -236,11 +232,7 @@ void bw_switching_pre_proc_fx( L_tmp = L_deposit_l( 0 ); FOR( i = 0; i < L_FRAME / 2; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac0_o( L_tmp, syn_dct_fx[i], syn_dct_fx[i], &Overflow ); /* (2 * Q_syn2) */ -#else - L_tmp = L_mac0( L_tmp, syn_dct_fx[i], syn_dct_fx[i] ); -#endif } L_tmp = L_shr( L_tmp, 7 ); /* 2 * Q_syn2 */ st_fx->enerLL_fx = Calc_freq_ener_fx( L_tmp, shl( st_fx->Q_syn2, 1 ) ); /* Q_syn2 */ @@ -248,11 +240,7 @@ void bw_switching_pre_proc_fx( L_tmp = L_deposit_l( 0 ); FOR( ; i < L_FRAME; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac0_o( L_tmp, syn_dct_fx[i], syn_dct_fx[i], &Overflow ); -#else - L_tmp = L_mac0( L_tmp, syn_dct_fx[i], syn_dct_fx[i] ); -#endif } L_tmp = L_shr( L_tmp, 7 ); /* 2 * Q_syn2 */ st_fx->enerLH_fx = Calc_freq_ener_fx( L_tmp, shl( st_fx->Q_syn2, 1 ) ); /* Q_syn2 */ @@ -265,11 +253,7 @@ void bw_switching_pre_proc_fx( L_tmp = L_deposit_l( 0 ); FOR( i = 0; i < 32; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac0_o( L_tmp, st_fx->t_audio_q_fx[i], st_fx->t_audio_q_fx[i], &Overflow ); /* 2 * Q_syn2 */ -#else - L_tmp = L_mac0( L_tmp, st_fx->t_audio_q_fx[i], st_fx->t_audio_q_fx[i] ); -#endif } L_tmp = L_shr( L_tmp, 5 ); /* 2 * Q_syn2 */ st_fx->enerLL_fx = Calc_freq_ener_fx( L_tmp, shl( st_fx->Q_syn2, 1 ) ); /* Q_syn2 */ @@ -277,11 +261,7 @@ void bw_switching_pre_proc_fx( L_tmp = L_deposit_l( 0 ); FOR( ; i < 64; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac0_o( L_tmp, st_fx->t_audio_q_fx[i], st_fx->t_audio_q_fx[i], &Overflow ); /* 2 * Q_syn2 */ -#else - L_tmp = L_mac0( L_tmp, st_fx->t_audio_q_fx[i], st_fx->t_audio_q_fx[i] ); -#endif } L_tmp = L_shr( L_tmp, 5 ); /* 2 * Q_syn2 */ st_fx->enerLH_fx = Calc_freq_ener_fx( L_tmp, shl( st_fx->Q_syn2, 1 ) ); /* Q_syn2 */ @@ -292,11 +272,7 @@ void bw_switching_pre_proc_fx( L_tmp = L_deposit_l( 0 ); FOR( i = 0; i < L_FRAME / 2; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac0_o( L_tmp, st_fx->t_audio_q_fx[i], st_fx->t_audio_q_fx[i], &Overflow ); /* 2 * Q_syn2 */ -#else - L_tmp = L_mac0( L_tmp, st_fx->t_audio_q_fx[i], st_fx->t_audio_q_fx[i] ); -#endif } L_tmp = L_shr( L_tmp, 7 ); /* 2 * Q_syn2 */ st_fx->enerLL_fx = Calc_freq_ener_fx( L_tmp, shl( st_fx->Q_syn2, 1 ) ); /* Q_syn2 */ @@ -304,11 +280,7 @@ void bw_switching_pre_proc_fx( L_tmp = L_deposit_l( 0 ); FOR( ; i < L_FRAME; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac0_o( L_tmp, st_fx->t_audio_q_fx[i], st_fx->t_audio_q_fx[i], &Overflow ); /* 2 * Q_syn2 */ -#else - L_tmp = L_mac0( L_tmp, st_fx->t_audio_q_fx[i], st_fx->t_audio_q_fx[i] ); -#endif } L_tmp = L_shr( L_tmp, 7 ); /* 2 * Q_syn2 */ st_fx->enerLH_fx = Calc_freq_ener_fx( L_tmp, shl( st_fx->Q_syn2, 1 ) ); /* Q_syn2 */ @@ -1302,11 +1274,7 @@ ivas_error core_switching_post_dec_fx( FOR( i = 0; i < shift; i++ ) { L_tmp = L_mult( ( *ptmp1 ), tmpF ); /*Qsynth + 16*/ -#ifdef BASOP_NOGLOB *ptmp1 = round_fx_sat( L_mac_sat( L_tmp, add_sat( sub( 24576, tmpF ), 8192 ), ( *ptmp2 ) ) ); /*Qsynth*/ -#else - *ptmp1 = round_fx( L_mac( L_tmp, add( sub( 24576, tmpF ), 8192 ), ( *ptmp2 ) ) ); /*Qsynth*/ -#endif ptmp1++; ptmp2++; tmpF = add( tmpF, tmp ); @@ -1326,11 +1294,7 @@ ivas_error core_switching_post_dec_fx( FOR( i = 0; i < shift; i++ ) { L_tmp = L_mult( ( *ptmp1 ), tmpF ); /*Qsynth + 16*/ -#ifdef BASOP_NOGLOB *ptmp1 = round_fx_sat( L_mac_sat( L_tmp, add_sat( sub( 24576, tmpF ), 8192 ), ( *ptmp2 ) ) ); /*Qsynth*/ -#else - *ptmp1 = round_fx( L_mac( L_tmp, add( sub( 24576, tmpF ), 8192 ), ( *ptmp2 ) ) ); /*Qsynth*/ -#endif move16(); tmpF = add( tmpF, tmp ); ptmp1++; @@ -1754,11 +1718,7 @@ ivas_error core_switching_post_dec_ivas_fx( FOR( i = 0; i < shift; i++ ) { L_tmp = L_mult( ( *ptmp1 ), tmpF ); /*Qsynth + 16*/ -#ifdef BASOP_NOGLOB *ptmp1 = round_fx_sat( L_mac_sat( L_tmp, add_sat( sub( 24576, tmpF ), 8192 ), ( *ptmp2 ) ) ); /*Qsynth*/ -#else - *ptmp1 = round_fx( L_mac( L_tmp, add( sub( 24576, tmpF ), 8192 ), ( *ptmp2 ) ) ); /*Qsynth*/ -#endif ptmp1++; ptmp2++; tmpF = add( tmpF, tmp ); @@ -1778,11 +1738,7 @@ ivas_error core_switching_post_dec_ivas_fx( FOR( i = 0; i < shift; i++ ) { L_tmp = L_mult( ( *ptmp1 ), tmpF ); /*Qsynth + 16*/ -#ifdef BASOP_NOGLOB *ptmp1 = round_fx_sat( L_mac_sat( L_tmp, add_sat( sub( 24576, tmpF ), 8192 ), ( *ptmp2 ) ) ); /*Qsynth*/ -#else - *ptmp1 = round_fx( L_mac( L_tmp, add( sub( 24576, tmpF ), 8192 ), ( *ptmp2 ) ) ); /*Qsynth*/ -#endif move16(); tmpF = add( tmpF, tmp ); ptmp1++; diff --git a/lib_dec/d_gain2p_fx.c b/lib_dec/d_gain2p_fx.c index 3af3affc3..4d1c101c0 100644 --- a/lib_dec/d_gain2p_fx.c +++ b/lib_dec/d_gain2p_fx.c @@ -43,11 +43,7 @@ static Word32 calc_gain_code_fx( Word16 g_code, Word16 gcode0, Word16 exp_gcode0 L_tmp = L_mult( g_code, gcode0 ); /* Q11*Q15 -> Q27 */ exp_gcode0 = add( exp_gcode0, -11 ); -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, exp_gcode0 ); /* Q27 -> Q16 */ -#else - L_tmp = L_shl( L_tmp, exp_gcode0 ); /* Q27 -> Q16 */ -#endif return L_tmp; } @@ -81,11 +77,7 @@ static void Mode2_gain_dec_mless_fx( /**gain_inov = 1.0f / (float)sqrt( ( dot_product( code, code, lcode ) + 0.01f ) / lcode);*/ L_tmp = calc_gain_inov( code, lcode, &L_tmp1, &exp_L_tmp1 ); -#ifdef BASOP_NOGLOB *gain_inov = round_fx_sat( L_shl_sat( L_tmp, 15 - 3 ) ); /* gain_inov in Q12 */ -#else - *gain_inov = round_fx( L_shl( L_tmp, 15 - 3 ) ); /* gain_inov in Q12 */ -#endif move16(); /*-----------------------------------------------------------------* * Select the gains quantization table @@ -203,11 +195,7 @@ static void gain_dec_uv_fx( move16(); *past_gcode = L_tmp; move32(); -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( Mpy_32_16_1( L_tmp, *gain_inov ), 3 ); /* Q16*Q12 -> Q13 -> Q16 */ -#else - L_tmp = L_shl( Mpy_32_16_1( L_tmp, *gain_inov ), 3 ); /* Q16*Q12 -> Q13 -> Q16 */ -#endif *gain_code = L_tmp; move32(); @@ -269,11 +257,7 @@ static void gain_dec_gacelp_uv_fx( /* g_code2 = pred_nrg_frame * norm_code2; */ L_tmp = Mpy_32_16_1( pred_nrg_frame, norm_code2 ); /* 18Q13 */ i = norm_l( L_tmp ); -#ifdef BASOP_NOGLOB g_code2 = round_fx_sat( L_shl_sat( L_tmp, i ) ); -#else - g_code2 = round_fx( L_shl( L_tmp, i ) ); -#endif exp_gcode2 = sub( 18, i ); /*-----------------------------------------------------------------* @@ -313,11 +297,7 @@ static void gain_dec_gacelp_uv_fx( *past_gcode = L_shl( L_tmp1, sub( exp_L_tmp1, 15 ) ); /* Q16 */ move32(); -#ifdef BASOP_NOGLOB *gain_code = L_shl_sat( Mpy_32_16_1( *past_gcode, *gain_inov ), 3 ); -#else - *gain_code = L_shl( Mpy_32_16_1( *past_gcode, *gain_inov ), 3 ); -#endif move32(); diff --git a/lib_dec/dec_ace_fx.c b/lib_dec/dec_ace_fx.c index df518a395..e327d4cfb 100644 --- a/lib_dec/dec_ace_fx.c +++ b/lib_dec/dec_ace_fx.c @@ -508,27 +508,15 @@ void decoder_acelp_fx( Ltmp = Mpy_32_16_1( gain_code2, code2[i] ); Ltmp = L_shl( Ltmp, add( 5, st->Q_exc ) ); Ltmp = L_mac( Ltmp, gain_pit, exc[i + i_subfr] ); -#ifdef BASOP_NOGLOB exc2[( i + i_subfr )] = round_fx_sat( L_shl_sat( Ltmp, 1 ) ); -#else - exc2[i + i_subfr] = round_fx( L_shl( Ltmp, 1 ) ); -#endif move16(); Ltmp2 = Mpy_32_16_1( gain_code, code[i] ); Ltmp2 = L_shl( Ltmp2, add( 5, st->Q_exc ) ); Ltmp = L_add( Ltmp, Ltmp2 ); BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB Ltmp = L_shl_sat( Ltmp, 1 ); /* saturation can occur here */ -#else - Ltmp = L_shl( Ltmp, 1 ); /* saturation can occur here */ -#endif BASOP_SATURATE_WARNING_ON_EVS -#ifdef BASOP_NOGLOB exc[( i + i_subfr )] = round_fx_sat( Ltmp ); -#else - exc[i + i_subfr] = round_fx( Ltmp ); -#endif move16(); } tmp2 = L_SUBFR; @@ -641,12 +629,8 @@ void decoder_acelp_fx( Ltmp = Dot_productSq16HQ( 0, h1, L_SUBFR, &st->last_gain_syn_deemph_e ); st->last_gain_syn_deemph_e = add( st->last_gain_syn_deemph_e, 10 /*scaling of h1[0] and E_UTIL_synthesis * 2*/ ); move16(); -#ifdef BASOP_NOGLOB st->last_gain_syn_deemph = round_fx_sat( Sqrt32( Ltmp, &st->last_gain_syn_deemph_e ) ); // Q(15-last_gain_syn_deemph_e - (16)) move16(); -#else - st->last_gain_syn_deemph = round_fx( Sqrt32( Ltmp, &st->last_gain_syn_deemph_e ) ); -#endif /* Do the classification */ { diff --git a/lib_dec/dec_gen_voic_fx.c b/lib_dec/dec_gen_voic_fx.c index 1cfff9b84..904ccf78f 100644 --- a/lib_dec/dec_gen_voic_fx.c +++ b/lib_dec/dec_gen_voic_fx.c @@ -263,30 +263,17 @@ ivas_error decod_gen_voic_fx( Ltmp1 = L_shl_sat( Ltmp1, tmp1_fx ); /* Q16 + Q_exc */ /* Compute exc2 */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_mult( gain_pit_fx, exc_fx[i + i_subfr_fx] ), 1 ); // Q_exc+Q14+1+1 exc2_fx[i + i_subfr_fx] = round_fx_sat( L_add_sat( L_tmp, Ltmp1 ) ); // Q_exc -#else - L_tmp = L_shl( L_mult( gain_pit_fx, exc_fx[i + i_subfr_fx] ), 1 ); - exc2_fx[i + i_subfr_fx] = round_fx( L_add( L_tmp, Ltmp1 ) ); -#endif move16(); /* gain_pit in Q14 */ L_tmp = L_mult( gain_code16, code_fx[i] ); // Q_exc+Q9+1 -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, 5 ); // Q_exc+Q9+1+5 L_tmp = L_mac_sat( L_tmp, exc_fx[i + i_subfr_fx], gain_pit_fx ); // Q_exc+Q15 +1 L_tmp = L_shl_sat( L_tmp, 1 ); /* saturation can occur here */ exc_fx[i + i_subfr_fx] = round_fx_sat( L_add_sat( L_tmp, Ltmp1 ) ); // Q_exc move16(); -#else - L_tmp = L_shl( L_tmp, 5 ); - L_tmp = L_mac( L_tmp, exc_fx[i + i_subfr_fx], gain_pit_fx ); - L_tmp = L_shl( L_tmp, 1 ); /* saturation can occur here */ - - exc_fx[i + i_subfr_fx] = round_fx( L_add( L_tmp, Ltmp1 ) ); -#endif } } ELSE @@ -349,13 +336,8 @@ ivas_error decod_gen_voic_fx( prev_spch_nrg = L_deposit_l( 1 ); FOR( i = 0; i < rint_bfi_pitch; i++ ) { -#ifdef BASOP_NOGLOB prev_res_nrg = L_mac0_sat( prev_res_nrg, *p_exc, *p_exc ); /* 2*st_fx->prev_Q_exc_fr */ prev_spch_nrg = L_mac0_sat( prev_spch_nrg, *p_syn, *p_syn ); /* 2*st_fx->prev_Q_syn_fr */ -#else - prev_res_nrg = L_mac0( prev_res_nrg, *p_exc, *p_exc ); /* 2*st_fx->prev_Q_exc_fr */ - prev_spch_nrg = L_mac0( prev_spch_nrg, *p_syn, *p_syn ); /* 2*st_fx->prev_Q_syn_fr */ -#endif p_exc++; p_syn++; } @@ -375,13 +357,8 @@ ivas_error decod_gen_voic_fx( curr_spch_nrg = L_deposit_l( 1 ); FOR( i = 0; i < rint_pitch; i++ ) { -#ifdef BASOP_NOGLOB curr_res_nrg = L_mac0_sat( curr_res_nrg, *p_exc, *p_exc ); /* 2*st_fx->Q_exc */ curr_spch_nrg = L_mac0_sat( curr_spch_nrg, *p_syn, *p_syn ); /* 2*st_fx->Q_syn */ -#else - curr_res_nrg = L_mac0( curr_res_nrg, *p_exc, *p_exc ); /* 2*st_fx->Q_exc */ - curr_spch_nrg = L_mac0( curr_spch_nrg, *p_syn, *p_syn ); /* 2*st_fx->Q_syn */ -#endif p_exc++; p_syn++; } @@ -394,11 +371,7 @@ ivas_error decod_gen_voic_fx( expa = sub( 30, add( expa, ( shl( st_fx->prev_Q_exc_fr, 1 ) ) ) ); expb = norm_l( curr_res_nrg ); -#ifdef BASOP_NOGLOB fracb = round_fx_sat( L_shl_sat( curr_res_nrg, expb ) ); /* 2*st_fx->Q_exc +expb+1 -16*/ -#else - fracb = round_fx( L_shl( curr_res_nrg, expb ) ); -#endif expb = sub( 30, add( expb, shl( st_fx->Q_exc, 1 ) ) ); scale = shr( sub( fraca, fracb ), 15 ); @@ -425,11 +398,7 @@ ivas_error decod_gen_voic_fx( expa = sub( 30, add( expa, shl( st_fx->prev_Q_syn_fr, 1 ) ) ); expb = norm_l( curr_spch_nrg ); -#ifdef BASOP_NOGLOB fracb = round_fx_sat( L_shl_sat( curr_spch_nrg, expb ) ); /* 2*st_fx->Q_syn +expb-16 */ -#else - fracb = round_fx( L_shl( curr_spch_nrg, expb ) ); -#endif expb = sub( 30, add( expb, shl( st_fx->Q_syn, 1 ) ) ); scale = shr( sub( fraca, fracb ), 15 ); @@ -452,19 +421,11 @@ ivas_error decod_gen_voic_fx( test(); test(); test(); -#ifdef BASOP_NOGLOB IF( GT_16( shl_ro( enratio, sub( 15, Qenratio ), &Overflow ), 8192 ) && /*compare with 0.25 in Q15*/ LT_16( shl_ro( enratio, sub( 10, Qenratio ), &Overflow ), 15360 ) && /*compare with 15.0 in Q10*/ GT_16( shl_ro( sp_enratio, sub( 15, Qsp_enratio ), &Overflow ), 4915 ) && /*compare with 0.15 in Q15*/ LT_16( st_fx->bfi_pitch_fx, 9600 ) && /*Q6*/ LT_16( pitch_buf_fx[NB_SUBFR16k - 1], 9600 ) ) /*Q6*/ -#else - IF( GT_16( shl_r( enratio, 15 - Qenratio ), 8192 ) && /*compare with 0.25 in Q15*/ - LT_16( shl_r( enratio, 10 - Qenratio ), 15360 ) && /*compare with 15.0 in Q10*/ - GT_16( shl_r( sp_enratio, 15 - Qsp_enratio ), 4915 ) && /*compare with 0.15 in Q15*/ - st_fx->bfi_pitch_fx < 9600 && /*Q6*/ - pitch_buf_fx[sub( NB_SUBFR16k, 1 )] < 9600 ) /*Q6*/ -#endif { IF( NE_32( ( error = DTFS_new_fx( &PREVP ) ), IVAS_ERR_OK ) ) { @@ -794,37 +755,20 @@ ivas_error decod_gen_voic_ivas_fx( Word32 Ltmp1; /* Contribution from AVQ layer */ Ltmp1 = L_mult( gain_preQ_fx, code_preQ_fx[i] ); /* Q2 + Q6 -> Q9*/ -#ifdef BASOP_NOGLOB Ltmp1 = L_shl_sat( Ltmp1, tmp1_fx ); /* Q16 + Q_exc */ -#else - Ltmp1 = L_shl( Ltmp1, tmp1_fx ); /* Q16 + Q_exc */ -#endif /* Compute exc2 */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_mult( gain_pit_fx, exc_fx[i + i_subfr_fx] ), 1 ); exc2_fx[i + i_subfr_fx] = round_fx_sat( L_add_sat( L_tmp, Ltmp1 ) ); // Q_exc -#else - L_tmp = L_shl( L_mult( gain_pit_fx, exc_fx[i + i_subfr_fx] ), 1 ); - exc2_fx[i + i_subfr_fx] = round_fx( L_add( L_tmp, Ltmp1 ) ); -#endif move16(); /* gain_pit in Q14 */ L_tmp = L_mult( gain_code16, code_fx[i] ); // Q_exc+Q9+1 -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, 5 ); // Q_exc+Q9+1+5 L_tmp = L_mac_sat( L_tmp, exc_fx[i + i_subfr_fx], gain_pit_fx ); // Q_exc+16 L_tmp = L_shl_sat( L_tmp, 1 ); /* saturation can occur here */ exc_fx[i + i_subfr_fx] = round_fx_sat( L_add_sat( L_tmp, Ltmp1 ) ); // Q_exc move16(); -#else - L_tmp = L_shl( L_tmp, 5 ); - L_tmp = L_mac( L_tmp, exc_fx[i + i_subfr_fx], gain_pit_fx ); - L_tmp = L_shl( L_tmp, 1 ); /* saturation can occur here */ - - exc_fx[i + i_subfr_fx] = round_fx( L_add( L_tmp, Ltmp1 ) ); -#endif } } ELSE @@ -894,13 +838,8 @@ ivas_error decod_gen_voic_ivas_fx( move32(); FOR( i = 0; i < rint_bfi_pitch; i++ ) { -#ifdef BASOP_NOGLOB prev_res_nrg = L_mac0_sat( prev_res_nrg, *p_exc, *p_exc ); /* 2*st_fx->prev_Q_exc_fr */ prev_spch_nrg = L_mac0_sat( prev_spch_nrg, *p_syn, *p_syn ); /* 2*st_fx->prev_Q_syn_fr */ -#else - prev_res_nrg = L_mac0( prev_res_nrg, *p_exc, *p_exc ); /* 2*st_fx->prev_Q_exc_fr */ - prev_spch_nrg = L_mac0( prev_spch_nrg, *p_syn, *p_syn ); /* 2*st_fx->prev_Q_syn_fr */ -#endif p_exc++; p_syn++; } @@ -986,19 +925,11 @@ ivas_error decod_gen_voic_ivas_fx( test(); test(); test(); -#ifdef BASOP_NOGLOB IF( GT_16( shl_ro( enratio, sub( 15, Qenratio ), &Overflow ), 8192 ) && /*compare with 0.25 in Q15*/ LT_16( shl_ro( enratio, sub( 10, Qenratio ), &Overflow ), 15360 ) && /*compare with 15.0 in Q10*/ GT_16( shl_ro( sp_enratio, sub( 15, Qsp_enratio ), &Overflow ), 4915 ) && /*compare with 0.15 in Q15*/ LT_16( st_fx->bfi_pitch_fx, 9600 ) && /*Q6*/ LT_16( pitch_buf_fx[( NB_SUBFR16k - 1 )], 9600 ) ) /*Q6*/ -#else - IF( GT_16( shl_r( enratio, 15 - Qenratio ), 8192 ) && /*compare with 0.25 in Q15*/ - LT_16( shl_r( enratio, 10 - Qenratio ), 15360 ) && /*compare with 15.0 in Q10*/ - GT_16( shl_r( sp_enratio, 15 - Qsp_enratio ), 4915 ) && /*compare with 0.15 in Q15*/ - st_fx->bfi_pitch_fx < 9600 && /*Q6*/ - pitch_buf_fx[sub( NB_SUBFR16k, 1 )] < 9600 ) /*Q6*/ -#endif { IF( NE_32( ( error = DTFS_new_fx( &PREVP ) ), IVAS_ERR_OK ) ) { diff --git a/lib_dec/dec_higher_acelp_fx.c b/lib_dec/dec_higher_acelp_fx.c index 49789732c..89f6a877e 100644 --- a/lib_dec/dec_higher_acelp_fx.c +++ b/lib_dec/dec_higher_acelp_fx.c @@ -83,13 +83,8 @@ void transf_cdbk_dec_fx( } L_tmp = Mult_32_16( gain_code, gain16 ); /* Q16 * Q12 - 15 -> Q13*/ -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, 5 ); /* Q13 -> Q18*/ *gain_preQ = round_fx_sat( L_tmp ); /* Q2*/ -#else - L_tmp = L_shl( L_tmp, 5 ); /* Q13 -> Q18*/ - *gain_preQ = round_fx( L_tmp ); /* Q2*/ -#endif move16(); } ELSE @@ -154,11 +149,7 @@ void transf_cdbk_dec_fx( #endif FOR( i = 0; i < L_SUBFR; i++ ) { -#ifdef BASOP_NOGLOB code_preQ[i] = shl_o( code_preQ[i], q_Code_preQ, &Overflow ); -#else - code_preQ[i] = shl( code_preQ[i], q_Code_preQ ); -#endif move16(); /* code_preQ in Q6*/ } diff --git a/lib_dec/dec_pit_exc_fx.c b/lib_dec/dec_pit_exc_fx.c index f3bb07aef..b38bf45c1 100644 --- a/lib_dec/dec_pit_exc_fx.c +++ b/lib_dec/dec_pit_exc_fx.c @@ -258,11 +258,7 @@ void dec_pit_exc_fx( gain_pit_fx = st_fx->lp_gainp_fx; move16(); } -#ifdef BASOP_NOGLOB gain_code_fx = L_mult0( s_max( sub( 32767, shl_o( gain_pit_fx, 1, &Overflow ) ), 16384 ), st_fx->lp_gainc_fx ); /* Use gain pitch and past gain code as an indicator to help finding the best scaling value. gain_code_fx used a temp var*/ -#else - gain_code_fx = L_mult0( s_max( sub( 32767, shl( gain_pit_fx, 1 ) ), 16384 ), st_fx->lp_gainc_fx ); /* Use gain pitch and past gain code as an indicator to help finding the best scaling value. gain_code_fx used a temp var*/ -#endif } /*----------------------------------------------------------------------* @@ -284,13 +280,8 @@ void dec_pit_exc_fx( { FOR( i = 0; i < L_subfr_fx; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_mult( gain_pit_fx, exc_fx[i + i_subfr_fx] ), 1 ); /*Q16+Q_exc*/ exc_fx[i + i_subfr_fx] = round_fx_sat( L_tmp ); /*Q_exc*/ -#else - L_tmp = L_shl( L_mult( gain_pit_fx, exc_fx[i + i_subfr_fx] ), 1 ); /*Q16+Q_exc*/ - exc_fx[i + i_subfr_fx] = round_fx( L_tmp ); /*Q_exc*/ -#endif move16(); } } @@ -301,11 +292,7 @@ void dec_pit_exc_fx( FOR( i = 0; i < L_subfr_fx; i++ ) { L_tmp = L_mult( gain_pitx2, exc_fx[i + i_subfr_fx] ); /*Q16+Q_exc*/ -#ifdef BASOP_NOGLOB exc_fx[i + i_subfr_fx] = round_fx_sat( L_tmp ); /*Q_exc*/ -#else - exc_fx[i + i_subfr_fx] = round_fx( L_tmp ); /*Q_exc*/ -#endif move16(); } } @@ -694,11 +681,7 @@ void dec_pit_exc_ivas_fx( gain_pit_fx = st_fx->lp_gainp_fx; move16(); } -#ifdef BASOP_NOGLOB gain_code_fx = L_mult0( s_max( sub( 32767, shl_o( gain_pit_fx, 1, &Overflow ) ), 16384 /*0.5.Q15*/ ), st_fx->lp_gainc_fx ); /* Use gain pitch and past gain code as an indicator to help finding the best scaling value. gain_code_fx used a temp var*/ -#else - gain_code_fx = L_mult0( s_max( sub( 32767, shl( gain_pit_fx, 1 ) ), 16384 ), st_fx->lp_gainc_fx ); /* Use gain pitch and past gain code as an indicator to help finding the best scaling value. gain_code_fx used a temp var*/ -#endif } /*----------------------------------------------------------------------* diff --git a/lib_dec/dec_post_fx.c b/lib_dec/dec_post_fx.c index 27abd7b2d..3f0984b94 100644 --- a/lib_dec/dec_post_fx.c +++ b/lib_dec/dec_post_fx.c @@ -703,11 +703,7 @@ static void modify_pst_param_fx( test(); IF( NE_16( coder_type, INACTIVE ) && LT_16( lp_noise, LP_NOISE_THR_FX ) ) { -#ifdef BASOP_NOGLOB lp_noiseQ12 = shl_o( lp_noise, 4, &Overflow ); /* to go from Q8 to Q12 */ -#else - lp_noiseQ12 = shl( lp_noise, 4 ); /* to go from Q8 to Q12 */ -#endif /* ftmp = lp_noise*BG1_FX + CG1_FX */ tmp = mac_r( CG1_FX * 65536L, lp_noiseQ12, BG1_FX * 8 ); /* x8 to go from Q12 to Q15 */ @@ -846,11 +842,7 @@ static void pst_ltp_fx( FOR( i = 0; i < L_SUBFR; i++ ) { /* nb_sh_sig may be >0, <0 or =0 */ -#ifdef BASOP_NOGLOB ptr_y_up[i] = shl_sat( ptr_y_up[i], nb_sh_sig ); -#else - ptr_y_up[i] = shl( ptr_y_up[i], nb_sh_sig ); -#endif move16(); } } @@ -884,11 +876,7 @@ static void pst_ltp_fx( /* decrease gain in noisy condition */ /* gain_plt += (1.0f-gain_plt) * gain_factor */ /* gain_plt = gain_plt + gain_factor - gain_plt*gain_factor */ -#ifdef BASOP_NOGLOB gain_plt = msu_ro( L_msu( L_deposit_h( gain_plt ), gain_plt, gain_factor ), -32768, gain_factor, &Overflow ); // Q15 -#else - gain_plt = msu_r( L_msu( L_deposit_h( gain_plt ), gain_plt, gain_factor ), -32768, gain_factor ); -#endif /** filtering by H0(z) = harmonic filter **/ filt_plt_fx( ptr_sig_in, ptr_y_up, ptr_sig_pst0, gain_plt ); @@ -944,11 +932,7 @@ static void search_del_fx( L_acc = L_mult( ptr_sig_in[0], ptr_sig_in[0] ); FOR( i = 1; i < L_SUBFR; i++ ) { -#ifdef BASOP_NOGLOB L_acc = L_mac_sat( L_acc, ptr_sig_in[i], ptr_sig_in[i] ); -#else - L_acc = L_mac( L_acc, ptr_sig_in[i], ptr_sig_in[i] ); -#endif } IF( L_acc == 0 ) { @@ -985,20 +969,12 @@ static void search_del_fx( L_acc = L_mult( ptr_sig_in[0], ptr_sig_past[0] ); FOR( n = 1; n < L_SUBFR; n++ ) { -#ifdef BASOP_NOGLOB L_acc = L_mac_sat( L_acc, ptr_sig_in[n], ptr_sig_past[n] ); -#else - L_acc = L_mac( L_acc, ptr_sig_in[n], ptr_sig_past[n] ); -#endif } L_acc = L_max( L_acc, 0 ); -#ifdef BASOP_NOGLOB L_temp = L_sub_sat( L_acc, L_num_int ); -#else - L_temp = L_sub( L_acc, L_num_int ); -#endif if ( L_temp > 0L ) { i_max = (Word16) i; @@ -1032,11 +1008,7 @@ static void search_del_fx( { temp = *ptr_sig_past++; move16(); -#ifdef BASOP_NOGLOB L_acc = L_mac_sat( L_acc, temp, temp ); -#else - L_acc = L_mac( L_acc, temp, temp ); -#endif } IF( L_acc == 0L ) { @@ -1094,30 +1066,18 @@ static void search_del_fx( L_acc = L_mult( ptr_y_up[1], ptr_y_up[1] ); FOR( n = 2; n < L_SUBFR; n++ ) { -#ifdef BASOP_NOGLOB L_acc = L_mac_sat( L_acc, ptr_y_up[n], ptr_y_up[n] ); -#else - L_acc = L_mac( L_acc, ptr_y_up[n], ptr_y_up[n] ); -#endif } L_temp0 = L_acc; /* sets to 'L_acc' in 1 clock (saved for den1) */ move32(); /* den0 */ -#ifdef BASOP_NOGLOB L_acc = L_mac_sat( L_acc, ptr_y_up[0], ptr_y_up[0] ); -#else - L_acc = L_mac( L_acc, ptr_y_up[0], ptr_y_up[0] ); -#endif *ptr_L_den0 = L_acc; move32(); /* den1 */ -#ifdef BASOP_NOGLOB L_acc = L_mac_sat( L_temp0, ptr_y_up[L_SUBFR], ptr_y_up[L_SUBFR] ); -#else - L_acc = L_mac( L_temp0, ptr_y_up[L_SUBFR], ptr_y_up[L_SUBFR] ); -#endif *ptr_L_den1 = L_acc; move32(); @@ -1208,11 +1168,7 @@ static void search_del_fx( L_acc = L_mult( ptr_sig_in[0], ptr_y_up[0] ); FOR( n = 1; n < L_SUBFR; n++ ) { -#ifdef BASOP_NOGLOB L_acc = L_mac_sat( L_acc, ptr_sig_in[n], ptr_y_up[n] ); -#else - L_acc = L_mac( L_acc, ptr_sig_in[n], ptr_y_up[n] ); -#endif } L_acc = L_shr( L_acc, sh_num ); /* sh_num > 0 */ L_acc = L_max( 0, L_acc ); @@ -1245,11 +1201,7 @@ static void search_del_fx( L_acc = L_mult( ptr_sig_in[0], ptr_y_up[0] ); FOR( n = 1; n < L_SUBFR; n++ ) { -#ifdef BASOP_NOGLOB L_acc = L_mac_sat( L_acc, ptr_sig_in[n], ptr_y_up[n] ); -#else - L_acc = L_mac( L_acc, ptr_sig_in[n], ptr_y_up[n] ); -#endif } L_acc = L_shr( L_acc, sh_num ); /* sh_num > 0 */ L_acc = L_max( 0, L_acc ); @@ -1461,11 +1413,7 @@ static void compute_ltp_l_fx( L_acc = L_mult( y_up[0], y_up[0] ); FOR( n = 1; n < L_SUBFR; n++ ) { -#ifdef BASOP_NOGLOB L_acc = L_mac_sat( L_acc, y_up[n], y_up[n] ); -#else - L_acc = L_mac( L_acc, y_up[n], y_up[n] ); -#endif } temp = sub( 16, norm_l( L_acc ) ); temp = s_max( temp, 0 ); @@ -1701,11 +1649,7 @@ void Filt_mu_fx( temp = sub( 1, abs_s( mu ) ); BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB mu2 = add_o( 32767, temp, &Overflow ); /* Q15 (1 - |mu|) */ -#else - mu2 = add( 32767, temp ); /* 2**15 (1 - |mu|) */ -#endif BASOP_SATURATE_WARNING_ON_EVS; ga = div_s( fact, mu2 ); /* Q(sh_fact) / (1 - |mu|) */ @@ -1719,19 +1663,11 @@ void Filt_mu_fx( L_temp = L_mac( L_acc, 16384, *ptrs ); /* sig_in(n) * 2**15 */ L_temp = Madd_32_16( L_fact, L_temp, ga ); -#ifdef BASOP_NOGLOB L_temp = L_shr_sat( L_temp, sh_fact ); /* mult. temp x ga */ -#else - L_temp = L_shr( L_temp, sh_fact ); /* mult. temp x ga */ -#endif BASOP_SATURATE_WARNING_OFF_EVS; /*sig_out[n] = saturate(L_temp); move16();*/ -#ifdef BASOP_NOGLOB sig_out[n] = round_fx_sat( L_temp ); move16(); -#else - sig_out[n] = round_fx( L_temp ); -#endif BASOP_SATURATE_WARNING_ON_EVS; } @@ -1807,11 +1743,7 @@ void Filt_mu_ivas_fx( temp = sub( 1, abs_s( mu ) ); BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB mu2 = add_o( 32767, temp, &Overflow ); /* Q15 (1 - |mu|) */ -#else - mu2 = add( 32767, temp ); /* 2**15 (1 - |mu|) */ -#endif BASOP_SATURATE_WARNING_ON_EVS; ga = div_s( fact, mu2 ); /* Q(sh_fact) / (1 - |mu|) */ @@ -1829,11 +1761,7 @@ void Filt_mu_ivas_fx( BASOP_SATURATE_WARNING_OFF_EVS; /*sig_out[n] = saturate(L_temp); move16();*/ -#ifdef BASOP_NOGLOB sig_out[n] = round_fx_sat( L_temp ); -#else - sig_out[n] = round_fx( L_temp ); -#endif BASOP_SATURATE_WARNING_ON_EVS; } @@ -1917,11 +1845,7 @@ void scale_st_fx( } /* L_gain_in/L_gain_out in Q14 */ /* overflows if L_gain_in > 2 * L_gain_out */ -#ifdef BASOP_NOGLOB g0 = shr_sat( g0, sh_g0 ); /* sh_g0 may be >0, <0, or =0 */ -#else - g0 = shr( g0, sh_g0 ); /* sh_g0 may be >0, <0, or =0 */ -#endif g0 = mult_r( g0, AGC_FAC1_FX ); /* L_gain_in/L_gain_out * AGC_FAC1_FX */ } @@ -1934,13 +1858,8 @@ void scale_st_fx( temp = mult_r( AGC_FAC_FX, gain ); gain = add( temp, g0 ); /* in Q14 */ L_temp = L_mult( gain, sig_out[i] ); -#ifdef BASOP_NOGLOB L_temp = L_shl_sat( L_temp, 1 ); sig_out[i] = round_fx_sat( L_temp ); -#else - L_temp = L_shl( L_temp, 1 ); - sig_out[i] = round_fx( L_temp ); -#endif move16(); } *gain_prec = gain; @@ -1975,15 +1894,9 @@ void blend_subfr2_fx( move16(); FOR( i = 0; i < L_SUBFR / 2; i++ ) { -#ifdef BASOP_NOGLOB sigOut[i] = mac_ro( L_mult_o( fac1, sigIn1[i], &Overflow ), fac2, sigIn2[i], &Overflow ); // Qx fac1 = sub_o( fac1, step, &Overflow ); fac2 = add_o( fac2, step, &Overflow ); -#else - sigOut[i] = mac_r( L_mult( fac1, sigIn1[i] ), fac2, sigIn2[i] ); - fac1 = sub( fac1, step ); - fac2 = add( fac2, step ); -#endif move16(); } diff --git a/lib_dec/dec_tcx_fx.c b/lib_dec/dec_tcx_fx.c index 20f7d297d..269d55c2d 100644 --- a/lib_dec/dec_tcx_fx.c +++ b/lib_dec/dec_tcx_fx.c @@ -434,11 +434,7 @@ void decoder_tcx_fx( gain_tcx_e = add( extract_l( L_shr( tmp32, 25 ) ), 1 ); /* get exponent */ gain_tcx = round_fx( BASOP_Util_InvLog2( L_or( tmp32, (Word32) 0xFE000000 ) ) ); -#ifdef BASOP_NOGLOB tmp1 = mult_r( shl_sat( L_spec, 5 ), 26214 /*128.f/NORM_MDCT_FACTOR Q15*/ ); -#else - tmp1 = mult_r( shl( L_spec, 5 ), 26214 /*128.f/NORM_MDCT_FACTOR Q15*/ ); -#endif s = 15 - 5 - 7; move16(); IF( GE_16( L_spec, 1024 ) ) /*reduce precision for avoiding overflow*/ @@ -553,11 +549,7 @@ void decoder_tcx_fx( st->last_gain_syn_deemph_e = add( st->last_gain_syn_deemph_e, 10 /*scaling of h1[0] and E_UTIL_synthesis * 2*/ ); move16(); tmp32 = Sqrt32( tmp32, &st->last_gain_syn_deemph_e ); -#ifdef BASOP_NOGLOB st->last_gain_syn_deemph = round_fx_o( tmp32, &Overflow ); -#else - st->last_gain_syn_deemph = round_fx( tmp32 ); -#endif move16(); /*for avoiding compiler warnings*/ hTcxDec->gainHelper = 32768 / 2; @@ -575,11 +567,7 @@ void decoder_tcx_fx( /* gainCompensate = st->last_gain_syn_deemph/(float)sqrt(dot_product( h1, h1, L_SUBFR)); */ tmp32 = Dot_productSq16HQ( 0, h1, L_SUBFR, &gainCompensate_e ) /*Q15, gainCompensate_e*/; gainCompensate_e = add( gainCompensate_e, 10 /*scaling of h1[0] and E_UTIL:synthesis*/ ); -#ifdef BASOP_NOGLOB gainCompensate = round_fx_sat( Sqrt32( tmp32, &gainCompensate_e ) ) /*Q15, gainCompensate_e*/; -#else - gainCompensate = round_fx( Sqrt32( tmp32, &gainCompensate_e ) ) /*Q15, gainCompensate_e*/; -#endif BASOP_Util_Divide_MantExp( st->last_gain_syn_deemph, st->last_gain_syn_deemph_e, gainCompensate, @@ -752,11 +740,7 @@ void decoder_tcx_fx( tmp32 = L_deposit_l( 0 ); FOR( i = 0; i < L_spec; i++ ) { -#ifdef BASOP_NOGLOB tmp32 = L_macNs_co( tmp32, abs_s( prm_sqQ[i] ), i, &Carry, &Overflow ); -#else - tmp32 = L_macNs( tmp32, abs_s( prm_sqQ[i] ), i ); -#endif } nf_seed = extract_l( tmp32 ); } @@ -876,11 +860,7 @@ void decoder_tcx_fx( BASOP_Util_Divide_MantExp( extract_h( E_2ndlast ), exp2, extract_h( E_last ), exp1, &tmp1, &tmp2 ); tmp1 = shr( tmp1, 2 ); /*Q13*/ -#ifdef BASOP_NOGLOB tmp1 = shl_sat( tmp1, tmp2 ); -#else - tmp1 = shl( tmp1, tmp2 ); -#endif /* replace higher energy TCX5 frame by lower one to avoid energy fluctuation */ IF( GT_16( tmp1, 16384 /*2 in Q13*/ ) ) { @@ -1345,11 +1325,7 @@ void decoder_tcx_post_fx( Decoder_State *st_fx, FOR( i = 0; i < hTcxDec->L_frameTCX; i++ ) { tmp32 = L_shl( tmp32_1 /*Q28*/, -( 28 - 15 ) ); /*16Q15*/ -#ifdef BASOP_NOGLOB synthFB[i] = round_fx_sat( L_shl_sat( Mpy_32_16_1( tmp32, synthFB[i] ), 16 ) ); -#else - synthFB[i] = round_fx( L_shl( Mpy_32_16_1( tmp32, synthFB[i] ), 16 ) ); -#endif move16(); tmp32_1 = L_sub( tmp32_1, tmp32_2 ); } @@ -1383,11 +1359,7 @@ void decoder_tcx_post_fx( Decoder_State *st_fx, } tmp32 = Mpy_32_16_1( tmp32, getInvFrameLen( hTcxDec->L_frameTCX ) ); tmp2 = norm_l( tmp32 ); -#ifdef BASOP_NOGLOB tmp1 = round_fx_o( L_shl( tmp32, tmp2 ), &Overflow ); -#else - tmp1 = round_fx( L_shl( tmp32, tmp2 ) ); -#endif s = sub( sub( sub( 1, shl( s, 1 ) ), 6 /*table lookup for inverse framelength*/ ), tmp2 ); tmp1 = Sqrt16( tmp1, &s ); move16(); @@ -1480,71 +1452,36 @@ void decoder_tcx_post_fx( Decoder_State *st_fx, &tmp1 ); tmp2 = BASOP_Util_Add_MantExp( hTcxDec->conceal_eof_gain, 15 - 14, negate( tmp1 ), tmp2, &tmp1 ); -#ifdef BASOP_NOGLOB step = L_shl_o( L_mult( tmp1, getInvFrameLen( st_fx->L_frame ) ), sub( tmp2, 6 /*scaling from table lookup*/ + 1 /*go to Q30*/ ), &Overflow ); /*Q30*/ -#else - step = L_shl( L_mult( tmp1, getInvFrameLen( st_fx->L_frame ) ), sub( tmp2, 6 /*scaling from table lookup*/ + 1 /*go to Q30*/ ) ); /*Q30*/ -#endif { Word32 stepFB; UWord32 dmy; conceal_eof_gainFB = L_deposit_h( hTcxDec->conceal_eof_gain ); /*Q30*/ Mpy_32_32_ss( step, L_shl( L_mult0( st_fx->L_frame, getInvFrameLen( hTcxDec->L_frameTCX ) ), 8 ), &stepFB, &dmy ); -#ifdef BASOP_NOGLOB stepFB = L_shl_o( stepFB, 3 - 1, &Overflow ); /*Q30*/ -#else - stepFB = L_shl( stepFB, 3 - 1 ); /*Q30*/ -#endif FOR( i = 0; i < hTcxDec->L_frameTCX; i++ ) { -#ifdef BASOP_NOGLOB synthFB[i] = round_fx_sat( L_shl_sat( Mpy_32_16_1( conceal_eof_gainFB, synthFB[i] ), 1 ) ); -#else - synthFB[i] = round_fx( L_shl( Mpy_32_16_1( conceal_eof_gainFB, synthFB[i] ), 1 ) ); -#endif move16(); -#ifdef BASOP_NOGLOB conceal_eof_gainFB = L_sub_o( conceal_eof_gainFB, stepFB, &Overflow ); -#else - conceal_eof_gainFB = L_sub( conceal_eof_gainFB, stepFB ); -#endif } } conceal_eof_gain32 = L_deposit_h( hTcxDec->conceal_eof_gain ); /*Q30*/ FOR( i = 0; i < st_fx->L_frame; i++ ) { -#ifdef BASOP_NOGLOB xn_buf[i] = round_fx_sat( L_shl_sat( Mpy_32_16_1( conceal_eof_gain32 /*Q30*/, xn_buf[i] ), 1 ) ); -#else - xn_buf[i] = round_fx( L_shl( Mpy_32_16_1( conceal_eof_gain32 /*Q30*/, xn_buf[i] ), 1 ) ); -#endif move16(); -#ifdef BASOP_NOGLOB conceal_eof_gain32 = L_sub_o( conceal_eof_gain32, step, &Overflow ); -#else - conceal_eof_gain32 = L_sub( conceal_eof_gain32, step ); -#endif } -#ifdef BASOP_NOGLOB hTcxDec->conceal_eof_gain = round_fx_o( conceal_eof_gain32, &Overflow ); /*Q14*/ move16(); -#else - hTcxDec->conceal_eof_gain = round_fx( conceal_eof_gain32 ); /*Q14*/ - move16(); -#endif /* run lpc gain compensation not for waveform adjustment */ test(); IF( 0 == st_fx->enablePlcWaveadjust || EQ_16( st_fx->plcInfo.concealment_method, TCX_TONAL ) ) { -#ifdef BASOP_NOGLOB st_fx->plcInfo.recovery_gain = extract_h( L_shl_o( Mpy_32_16_1( conceal_eof_gainFB, st_fx->last_concealed_gain_syn_deemph ), st_fx->last_concealed_gain_syn_deemph_e, &Overflow ) ); /*Q30->Q14*/ -#else - st_fx->plcInfo.recovery_gain = extract_h( L_shl( Mpy_32_16_1( conceal_eof_gainFB, - st_fx->last_concealed_gain_syn_deemph ), - st_fx->last_concealed_gain_syn_deemph_e ) ); /*Q30->Q14*/ -#endif move16(); } ELSE @@ -1553,14 +1490,7 @@ void decoder_tcx_post_fx( Decoder_State *st_fx, move16(); } st_fx->plcInfo.step_concealgain_fx = -#ifdef BASOP_NOGLOB round_fx_sat( L_shl_sat( L_mult0( round_fx_sat( step ), round_fx_sat( L_shl_sat( L_mult0( st_fx->L_frame, getInvFrameLen( hTcxDec->L_frameTCX ) ), 8 ) ) ), 3 ) ); /*Q15*/ -#else - round_fx( L_shl( L_mult0( - round_fx( step ), - round_fx( L_shl( L_mult0( st_fx->L_frame, getInvFrameLen( hTcxDec->L_frameTCX ) ), 8 ) ) ), - 3 ) ); /*Q15*/ -#endif move16(); } @@ -1584,11 +1514,7 @@ void decoder_tcx_post_fx( Decoder_State *st_fx, move32(); Copy32( &st_fx->old_pitch_buf_fx[st_fx->nb_subfr + 2], &st_fx->old_pitch_buf_fx[2], st_fx->nb_subfr ); set32_fx( &st_fx->old_pitch_buf_fx[st_fx->nb_subfr + 2], st_fx->old_fpitch, st_fx->nb_subfr ); -#ifdef BASOP_NOGLOB /*TBV st_fx->old_fpitch seems to have an odd value for this bitstream stv48n1_dtx_sw_164_1280_48kHz.f06.COD at frame 10 */ st_fx->bfi_pitch_fx = shl_sat( round_fx( st_fx->old_fpitch ), 6 ); -#else - st_fx->bfi_pitch_fx = shl( round_fx( st_fx->old_fpitch ), 6 ); -#endif move16(); st_fx->bfi_pitch_frame = st_fx->L_frame; move16(); @@ -1679,11 +1605,7 @@ void decoder_tcx_post_ivas_fx( Decoder_State *st_fx, FOR( i = 0; i < hTcxDec->L_frameTCX; i++ ) { tmp32 = L_shl( tmp32_1 /*Q28*/, -( 28 - 15 ) ); /*16Q15*/ -#ifdef BASOP_NOGLOB synthFB[i] = round_fx_sat( L_shl_sat( Mpy_32_16_1( tmp32, synthFB[i] ), 16 ) ); // Q_syn -#else - synthFB[i] = round_fx( L_shl( Mpy_32_16_1( tmp32, synthFB[i] ), 16 ) ); -#endif move16(); tmp32_1 = L_sub( tmp32_1, tmp32_2 ); } @@ -1716,11 +1638,7 @@ void decoder_tcx_post_ivas_fx( Decoder_State *st_fx, } tmp32 = Mpy_32_16_1( tmp32, getInvFrameLen( hTcxDec->L_frameTCX ) ); tmp2 = norm_l( tmp32 ); -#ifdef BASOP_NOGLOB tmp1 = round_fx_o( L_shl( tmp32, tmp2 ), &Overflow ); -#else - tmp1 = round_fx( L_shl( tmp32, tmp2 ) ); -#endif // s = sub(sub(sub(1, shl(s, 1)), 6/*table lookup for inverse framelength*/), tmp2); s = sub( 25, add( shl( add( Q_syn, s ), 1 ), tmp2 ) ); tmp1 = Sqrt16( tmp1, &s ); @@ -1891,15 +1809,9 @@ void decoder_tcx_post_ivas_fx( Decoder_State *st_fx, test(); IF( 0 == st_fx->enablePlcWaveadjust || EQ_16( st_fx->plcInfo.concealment_method, TCX_TONAL ) ) { -#ifdef BASOP_NOGLOB st_fx->plcInfo.recovery_gain = extract_h( L_shl_o( Mpy_32_16_1( conceal_eof_gainFB, st_fx->last_concealed_gain_syn_deemph ), st_fx->last_concealed_gain_syn_deemph_e, &Overflow ) ); /*Q30->Q14*/ -#else - st_fx->plcInfo.recovery_gain = extract_h( L_shl( Mpy_32_16_1( conceal_eof_gainFB, - st_fx->last_concealed_gain_syn_deemph ), - st_fx->last_concealed_gain_syn_deemph_e ) ); /*Q30->Q14*/ -#endif move16(); } ELSE @@ -1908,14 +1820,7 @@ void decoder_tcx_post_ivas_fx( Decoder_State *st_fx, move16(); } st_fx->plcInfo.step_concealgain_fx = -#ifdef BASOP_NOGLOB round_fx_sat( L_shl_sat( L_mult0( round_fx_sat( L_shr_sat( step, sub( 1, step_e ) ) ), round_fx_sat( L_shl_sat( L_mult0( st_fx->L_frame, getInvFrameLen( hTcxDec->L_frameTCX ) ), 8 ) ) ), 4 ) ); /*Q15*/ -#else - round_fx( L_shl( L_mult0( - round_fx( L_shr( step, sub( 1, step_e ) ), - round_fx( L_shl( L_mult0( st_fx->L_frame, getInvFrameLen( hTcxDec->L_frameTCX ) ), 8 ) ) ), - 4 ) ); /*Q15*/ -#endif move16(); } @@ -1939,11 +1844,7 @@ void decoder_tcx_post_ivas_fx( Decoder_State *st_fx, move32(); Copy32( &st_fx->old_pitch_buf_fx[st_fx->nb_subfr + 2], &st_fx->old_pitch_buf_fx[2], st_fx->nb_subfr ); set32_fx( &st_fx->old_pitch_buf_fx[st_fx->nb_subfr + 2], st_fx->old_fpitch, st_fx->nb_subfr ); -#ifdef BASOP_NOGLOB /*TBV st_fx->old_fpitch seems to have an odd value for this bitstream stv48n1_dtx_sw_164_1280_48kHz.f06.COD at frame 10 */ st_fx->bfi_pitch_fx = shl_sat( round_fx( st_fx->old_fpitch ), 6 ); -#else - st_fx->bfi_pitch_fx = shl( round_fx( st_fx->old_fpitch ), 6 ); -#endif st_fx->bfi_pitch_frame = st_fx->L_frame; move16(); @@ -1980,7 +1881,6 @@ static Word32 CalculateAbsEnergy_fx( /* o : normalized resul move32(); L_c = 0; move32(); -#ifdef BASOP_NOGLOB /* Critical Overflow/Carry */ L_sum = L_macNs_co( L_off, 0, 0, &Carry, &Overflow ); IF( L_sum > 0 ) { @@ -1990,31 +1890,16 @@ static Word32 CalculateAbsEnergy_fx( /* o : normalized resul { L_c = L_msuNs_co( L_c, 0, 0, &Carry, &Overflow ); } -#else - L_sum = L_macNs( L_off, 0, 0 ); - if ( L_sum > 0 ) - L_c = L_macNs( L_c, 0, 0 ); - if ( L_sum < 0 ) - L_c = L_msuNs( L_c, 0, 0 ); -#endif FOR( i = 0; i < lg; i += 2 ) { Carry = 0; move32(); BASOP_SATURATE_WARNING_OFF_EVS /*multiplication of -32768 * -32768 throws an overflow, but is not critical*/ -#ifdef BASOP_NOGLOB /* Critical Overflow/Carry */ L_sum = L_macNs_co( L_sum, x[i], x[i], &Carry, &Overflow ); -#else - L_sum = L_macNs( L_sum, x[i], x[i] ); -#endif BASOP_SATURATE_WARNING_ON_EVS Overflow = 0; /* to avoid useless warning in L_macNs calling L_mult */ move32(); -#ifdef BASOP_NOGLOB /* Critical Overflow/Carry */ L_c = L_macNs_co( L_c, 0, 0, &Carry, &Overflow ); -#else - L_c = L_macNs( L_c, 0, 0 ); -#endif } L_sum = norm_llQ31( L_c, L_sum, exp ); return L_sum; @@ -2371,11 +2256,7 @@ void IMDCT_fx( Word32 *x, Word16 x_e, Word16 *old_syn_overl, Word16 *syn_Overl_T { FOR( i = 0; i < L_frame; i++ ) { -#ifdef BASOP_NOGLOB xn_buf[i] = shr_sat( xn_buf[i], Q ); -#else - xn_buf[i] = shr( xn_buf[i], Q ); -#endif move16(); } } @@ -2467,11 +2348,7 @@ void IMDCT_fx( Word32 *x, Word16 x_e, Word16 *old_syn_overl, Word16 *syn_Overl_T tmp1 = sub( overlap, tcx_mdct_window_min_length ); FOR( i = 0; i < tmp1; i++ ) { -#ifdef BASOP_NOGLOB xn_buf[i + tmp4] = shl_sat( add_sat( xn_buf[i + tmp4], shr_sat( old_out[i + nz], tmp2 ) ), TCX_IMDCT_HEADROOM ); -#else - xn_buf[i + tmp4] = shl( add( xn_buf[i + tmp4], shr( old_out[i + nz], tmp2 ) ), TCX_IMDCT_HEADROOM ); -#endif move16(); } @@ -2480,31 +2357,19 @@ void IMDCT_fx( Word32 *x, Word16 x_e, Word16 *old_syn_overl, Word16 *syn_Overl_T FOR( ; i < tmp1; i++ ) { tmp3 = mult_r( shr( old_out[i + nz], tmp2 ), tcx_mdct_window_minimum[i - overlap + tcx_mdct_window_min_length].v.re ); -#ifdef BASOP_NOGLOB xn_buf[i + tmp4] = shl_sat( add_sat( xn_buf[i + tmp4], tmp3 ), TCX_IMDCT_HEADROOM ); -#else - xn_buf[i + tmp4] = shl( add( xn_buf[i + tmp4], tmp3 ), TCX_IMDCT_HEADROOM ); -#endif move16(); } FOR( ; i < overlap; i++ ) { tmp3 = mult_r( shr( old_out[i + nz], tmp2 ), tcx_mdct_window_minimum[overlap - 1 - i].v.im ); -#ifdef BASOP_NOGLOB xn_buf[i + tmp4] = shl_sat( add_sat( xn_buf[i + tmp4], tmp3 ), TCX_IMDCT_HEADROOM ); -#else - xn_buf[i + tmp4] = shl( add( xn_buf[i + tmp4], tmp3 ), TCX_IMDCT_HEADROOM ); -#endif move16(); } FOR( i = add( i, tmp4 ); i < L_frame; i++ ) { -#ifdef BASOP_NOGLOB xn_buf[i] = shl_sat( xn_buf[i], TCX_IMDCT_HEADROOM ); -#else - xn_buf[i] = shl( xn_buf[i], TCX_IMDCT_HEADROOM ); -#endif move16(); } } @@ -2535,43 +2400,26 @@ void IMDCT_fx( Word32 *x, Word16 x_e, Word16 *old_syn_overl, Word16 *syn_Overl_T tmp3 = shr( tcx_mdct_window_half_length, 1 ); FOR( i = 0; i < tmp1; i++ ) { -#ifdef BASOP_NOGLOB xn_buf[i] = shl_sat( xn_buf[i], TCX_IMDCT_HEADROOM ); -#else - xn_buf[i] = shl( xn_buf[i], TCX_IMDCT_HEADROOM ); -#endif move16(); } FOR( i = 0; i < tmp3; i++ ) { -#ifdef BASOP_NOGLOB tmp2 = add_sat( xn_buf[i + tmp1], mult_r( old_syn_overl[i], tcx_mdct_window_half[i].v.re ) ); xn_buf[i + tmp1] = shl_sat( tmp2, TCX_IMDCT_HEADROOM ); -#else - tmp2 = add( xn_buf[i + tmp1], mult_r( old_syn_overl[i], tcx_mdct_window_half[i].v.re ) ); - xn_buf[i + tmp1] = shl( tmp2, TCX_IMDCT_HEADROOM ); -#endif move16(); } FOR( ; i < tcx_mdct_window_half_length; i++ ) { tmp2 = add( xn_buf[i + tmp1], mult_r( old_syn_overl[i], tcx_mdct_window_half[tcx_mdct_window_half_length - 1 - i].v.im ) ); -#ifdef BASOP_NOGLOB xn_buf[i + tmp1] = shl_sat( tmp2, TCX_IMDCT_HEADROOM ); -#else - xn_buf[i + tmp1] = shl( tmp2, TCX_IMDCT_HEADROOM ); -#endif move16(); } IF( LT_16( add( i, tmp1 ), L_frame ) ) { FOR( i = add( i, tmp1 ); i < L_frame; i++ ) { -#ifdef BASOP_NOGLOB xn_buf[i] = shl_sat( xn_buf[i], TCX_IMDCT_HEADROOM ); -#else - xn_buf[i] = shl( xn_buf[i], TCX_IMDCT_HEADROOM ); -#endif move16(); } } @@ -2581,11 +2429,7 @@ void IMDCT_fx( Word32 *x, Word16 x_e, Word16 *old_syn_overl, Word16 *syn_Overl_T FOR( i = 0; i < overlap; i++ ) { -#ifdef BASOP_NOGLOB xn_buf[i] = shl_sat( add_sat( xn_buf[i], old_syn_overl[i] ), TCX_IMDCT_HEADROOM ); -#else - xn_buf[i] = shl( add( xn_buf[i], old_syn_overl[i] ), TCX_IMDCT_HEADROOM ); -#endif move16(); } @@ -2593,11 +2437,7 @@ void IMDCT_fx( Word32 *x, Word16 x_e, Word16 *old_syn_overl, Word16 *syn_Overl_T { FOR( ; i < L_frame; i++ ) { -#ifdef BASOP_NOGLOB xn_buf[i] = shl_sat( xn_buf[i], TCX_IMDCT_HEADROOM ); -#else - xn_buf[i] = shl( xn_buf[i], TCX_IMDCT_HEADROOM ); -#endif move16(); } } @@ -2607,22 +2447,14 @@ void IMDCT_fx( Word32 *x, Word16 x_e, Word16 *old_syn_overl, Word16 *syn_Overl_T tmp1 = shr( overlap, 1 ); FOR( i = 0; i < tmp1; i++ ) { -#ifdef BASOP_NOGLOB xn_buf[i] = shl_sat( xn_buf[i], TCX_IMDCT_HEADROOM ); -#else - xn_buf[i] = shl( xn_buf[i], TCX_IMDCT_HEADROOM ); -#endif move16(); } tmpP16 = xn_buf + tmp1; FOR( i = 0; i < overlap; i++ ) { -#ifdef BASOP_NOGLOB tmpP16[i] = shl_sat( add( tmpP16[i], old_syn_overl[i] ), TCX_IMDCT_HEADROOM ); -#else - tmpP16[i] = shl( add( tmpP16[i], old_syn_overl[i] ), TCX_IMDCT_HEADROOM ); -#endif move16(); } @@ -2630,11 +2462,7 @@ void IMDCT_fx( Word32 *x, Word16 x_e, Word16 *old_syn_overl, Word16 *syn_Overl_T { FOR( i = add( i, tmp1 ); i < L_frame; i++ ) { -#ifdef BASOP_NOGLOB xn_buf[i] = shl_sat( xn_buf[i], TCX_IMDCT_HEADROOM ); -#else - xn_buf[i] = shl( xn_buf[i], TCX_IMDCT_HEADROOM ); -#endif move16(); } } @@ -2652,11 +2480,7 @@ void IMDCT_fx( Word32 *x, Word16 x_e, Word16 *old_syn_overl, Word16 *syn_Overl_T BASOP_SATURATE_WARNING_OFF_EVS; FOR( i = 0; i < L_frame; i++ ) { -#ifdef BASOP_NOGLOB xn_buf[i] = shl_sat( xn_buf[i], TCX_IMDCT_HEADROOM ); -#else - xn_buf[i] = shl( xn_buf[i], TCX_IMDCT_HEADROOM ); -#endif move16(); } BASOP_SATURATE_WARNING_ON_EVS; @@ -2722,25 +2546,15 @@ void IMDCT_fx( Word32 *x, Word16 x_e, Word16 *old_syn_overl, Word16 *syn_Overl_T tmp3 = shr( tcx_mdct_window_half_length, 1 ); FOR( i = 0; i < tmp3; i++ ) { -#ifdef BASOP_NOGLOB xn_buf[i + tmp1] = mult_r_sat( xn_buf[i + tmp1], tcx_mdct_window_half[i].v.im ); xn_buf[i + tmp1] = add_sat( xn_buf[i + tmp1], mult_r_sat( hTcxDec->syn_OverlFB[i], mult_r_sat( tcx_mdct_window_half[i].v.re, tcx_mdct_window_half[i].v.re ) ) ); -#else - xn_buf[i + tmp1] = mult_r( xn_buf[i + tmp1], tcx_mdct_window_half[i].v.im ); - xn_buf[i + tmp1] = add( xn_buf[i + tmp1], mult_r( hTcxDec->syn_OverlFB[i], mult_r( tcx_mdct_window_half[i].v.re, tcx_mdct_window_half[i].v.re ) ) ); -#endif move16(); move16(); } FOR( ; i < tcx_mdct_window_half_length; i++ ) { -#ifdef BASOP_NOGLOB xn_buf[i + tmp1] = mult_r_sat( xn_buf[i + tmp1], tcx_mdct_window_half[( ( tcx_mdct_window_half_length - 1 ) - i )].v.re ); xn_buf[i + tmp1] = add_sat( xn_buf[i + tmp1], mult_r_sat( hTcxDec->syn_OverlFB[i], mult_r_sat( tcx_mdct_window_half[( ( tcx_mdct_window_half_length - 1 ) - i )].v.im, tcx_mdct_window_half[tcx_mdct_window_half_length - 1 - i].v.im ) ) ); -#else - xn_buf[i + tmp1] = mult_r( xn_buf[i + tmp1], tcx_mdct_window_half[tcx_mdct_window_half_length - 1 - i].v.re ); - xn_buf[i + tmp1] = add( xn_buf[i + tmp1], mult_r( hTcxDec->syn_OverlFB[i], mult_r( tcx_mdct_window_half[tcx_mdct_window_half_length - 1 - i].v.im, tcx_mdct_window_half[tcx_mdct_window_half_length - 1 - i].v.im ) ) ); -#endif move16(); move16(); } @@ -2751,25 +2565,15 @@ void IMDCT_fx( Word32 *x, Word16 x_e, Word16 *old_syn_overl, Word16 *syn_Overl_T tmp3 = shr( tcx_mdct_window_half_length, 1 ); FOR( i = 0; i < tmp3; i++ ) { -#ifdef BASOP_NOGLOB xn_buf[i + tmp1] = mult_r_sat( xn_buf[i + tmp1], tcx_mdct_window_half[i].v.im ); xn_buf[i + tmp1] = add_sat( xn_buf[i + tmp1], mult_r_sat( hTcxDec->syn_Overl[i], mult_r_sat( tcx_mdct_window_half[i].v.re, tcx_mdct_window_half[i].v.re ) ) ); -#else - xn_buf[i + tmp1] = mult_r( xn_buf[i + tmp1], tcx_mdct_window_half[i].v.im ); - xn_buf[i + tmp1] = add( xn_buf[i + tmp1], mult_r( hTcxDec->syn_Overl[i], mult_r( tcx_mdct_window_half[i].v.re, tcx_mdct_window_half[i].v.re ) ) ); -#endif move16(); move16(); } FOR( ; i < tcx_mdct_window_half_length; i++ ) { -#ifdef BASOP_NOGLOB xn_buf[i + tmp1] = mult_r_sat( xn_buf[i + tmp1], tcx_mdct_window_half[tcx_mdct_window_half_length - 1 - i].v.re ); xn_buf[i + tmp1] = add_sat( xn_buf[i + tmp1], mult_r_sat( hTcxDec->syn_Overl[i], mult_r_sat( tcx_mdct_window_half[tcx_mdct_window_half_length - 1 - i].v.im, tcx_mdct_window_half[tcx_mdct_window_half_length - 1 - i].v.im ) ) ); -#else - xn_buf[i + tmp1] = mult_r( xn_buf[i + tmp1], tcx_mdct_window_half[tcx_mdct_window_half_length - 1 - i].v.re ); - xn_buf[i + tmp1] = add( xn_buf[i + tmp1], mult_r( hTcxDec->syn_Overl[i], mult_r( tcx_mdct_window_half[tcx_mdct_window_half_length - 1 - i].v.im, tcx_mdct_window_half[tcx_mdct_window_half_length - 1 - i].v.im ) ) ); -#endif move16(); move16(); } @@ -3203,11 +3007,7 @@ void IMDCT_ivas_fx( { FOR( i = 0; i < sub( overlap, tcx_mdct_window_min_length ); i++ ) { -#ifdef BASOP_NOGLOB xn_buf_fx[( i + ( ( overlap / 2 ) - tcx_offset ) )] = add_sat( xn_buf_fx[( i + ( ( overlap / 2 ) - tcx_offset ) )], old_out_fx[( i + nz )] ); // Q(-2) -#else - xn_buf_fx[( i + ( ( overlap / 2 ) - tcx_offset ) )] = add( xn_buf_fx[( i + ( ( overlap / 2 ) - tcx_offset ) )], old_out_fx[( i + nz )] ); -#endif move16(); } @@ -3220,30 +3020,17 @@ void IMDCT_ivas_fx( // tested FOR( ; i < overlap; i++ ) /* perfectly reconstructing ALDO shortening */ { -#ifdef BASOP_NOGLOB xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )] = add_sat( xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )], old_out_fx[( i + nz )] ); // Q(-2) -#else - xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )] = add( xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )], old_out_fx[( i + nz )] ); // Q(-2) - -#endif move16(); } FOR( i = 0; i < ( tcx_mdct_window_min_length / 2 ); i++ ) { -#ifdef BASOP_NOGLOB xn_buf_fx[( ( ( i + ( overlap / 2 ) ) - tcx_offset ) + overlap )] = add_sat( xn_buf_fx[( ( ( i + ( overlap / 2 ) ) - tcx_offset ) + overlap )], mult_r( old_out_fx[( ( i + nz ) + overlap )], tcx_mdct_window_minimum_fx[i].v.re ) ); // Q(-2) -#else - xn_buf_fx[( ( ( i + ( overlap / 2 ) ) - tcx_offset ) + overlap )] = add( xn_buf_fx[( ( ( i + ( overlap / 2 ) ) - tcx_offset ) + overlap )], mult_r( old_out_fx[( ( i + nz ) + overlap )], tcx_mdct_window_minimum_fx[i].v.re ) ); -#endif move16(); } FOR( ; i < tcx_mdct_window_min_length; i++ ) { -#ifdef BASOP_NOGLOB xn_buf_fx[( ( ( i + ( overlap / 2 ) ) - tcx_offset ) + overlap )] = add_sat( xn_buf_fx[( ( ( i + ( overlap / 2 ) ) - tcx_offset ) + overlap )], mult_r( old_out_fx[( ( i + nz ) + overlap )], tcx_mdct_window_minimum_fx[( tcx_mdct_window_min_length - ( 1 + i ) )].v.im ) ); // Q(-2) -#else - xn_buf_fx[( ( ( i + ( overlap / 2 ) ) - tcx_offset ) + overlap )] = add( xn_buf_fx[( ( ( i + ( overlap / 2 ) ) - tcx_offset ) + overlap )], mult_r( old_out_fx[( ( i + nz ) + overlap )], tcx_mdct_window_minimum_fx[( tcx_mdct_window_min_length - ( 1 + i ) )].v.im ) ); -#endif move16(); } } @@ -3251,20 +3038,12 @@ void IMDCT_ivas_fx( { FOR( ; i < ( overlap - ( tcx_mdct_window_min_length / 2 ) ); i++ ) { -#ifdef BASOP_NOGLOB xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )] = add_sat( xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )], mult_r( old_out_fx[( i + nz )], tcx_mdct_window_minimum_fx[( ( tcx_mdct_window_min_length - overlap ) + i )].v.re ) ); // Q(-2) -#else - xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )] = add( xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )], mult_r( old_out_fx[( i + nz )], tcx_mdct_window_minimum_fx[( ( tcx_mdct_window_min_length - overlap ) + i )].v.re ) ); -#endif move16(); } FOR( ; i < overlap; i++ ) { -#ifdef BASOP_NOGLOB xn_buf_fx[( i + ( ( overlap / 2 ) - tcx_offset ) )] = add_sat( xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )], mult_r( old_out_fx[( i + nz )], tcx_mdct_window_minimum_fx[( overlap - ( 1 + i ) )].v.im ) ); // Q(-2) -#else - xn_buf_fx[( i + ( ( overlap / 2 ) - tcx_offset ) )] = add( xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )], mult_r( old_out_fx[( i + nz )], tcx_mdct_window_minimum_fx[( overlap - ( 1 + i ) )].v.im ) ); -#endif move16(); } } @@ -3277,21 +3056,12 @@ void IMDCT_ivas_fx( { FOR( i = 0; i < ( tcx_mdct_window_half_length / 2 ); i++ ) { -#ifdef BASOP_NOGLOB xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )] = add_sat( xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )], mult_r( old_syn_overl_fx[i], tcx_mdct_window_half_fx[i].v.re ) ); // Q(-2) -#else - xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )] = add( xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )], mult_r( old_syn_overl_fx[i], tcx_mdct_window_half_fx[i].v.re ) ); - -#endif move16(); } FOR( ; i < tcx_mdct_window_half_length; i++ ) { -#ifdef BASOP_NOGLOB xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )] = add_sat( xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )], mult_r( old_syn_overl_fx[i], tcx_mdct_window_half_fx[( tcx_mdct_window_half_length - ( 1 + i ) )].v.im ) ); // Q(-2) -#else - xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )] = add( xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )], mult_r( old_syn_overl_fx[i], tcx_mdct_window_half_fx[( tcx_mdct_window_half_length - ( 1 + i ) )].v.im ) ); -#endif move16(); } } @@ -3307,11 +3077,7 @@ void IMDCT_ivas_fx( { FOR( i = 0; i < overlap; i++ ) { -#ifdef BASOP_NOGLOB xn_buf_fx[( i + ( overlap / 2 ) )] = add_sat( xn_buf_fx[( i + ( overlap / 2 ) )], old_syn_overl_fx[i] ); // Q(-2) -#else - xn_buf_fx[( i + ( overlap / 2 ) )] = add( xn_buf_fx[( i + ( overlap / 2 ) )], old_syn_overl_fx[i] ); -#endif move16(); } } @@ -3387,22 +3153,14 @@ void IMDCT_ivas_fx( FOR( i = 0; i < ( tcx_mdct_window_half_length / 2 ); i++ ) { xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )] = mult_r( xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )], tcx_mdct_window_half_fx[i].v.im ); -#ifdef BASOP_NOGLOB xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )] = add_sat( xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )], mult_r( mult_r( hTcxDec->syn_Overl[i], tcx_mdct_window_half_fx[i].v.re ), tcx_mdct_window_half_fx[i].v.re ) ); // Q(-2) -#else - xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )] = add( xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )], mult_r( mult_r( hTcxDec->syn_Overl[i], tcx_mdct_window_half_fx[i].v.re ), tcx_mdct_window_half_fx[i].v.re ) ); -#endif move16(); move16(); } FOR( ; i < tcx_mdct_window_half_length; i++ ) { xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )] = mult_r( xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )], tcx_mdct_window_half_fx[( tcx_mdct_window_half_length - ( 1 + i ) )].v.re ); -#ifdef BASOP_NOGLOB xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )] = add_sat( xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )], mult_r( mult_r( hTcxDec->syn_Overl[i], tcx_mdct_window_half_fx[( tcx_mdct_window_half_length - ( 1 + i ) )].v.im ), tcx_mdct_window_half_fx[( tcx_mdct_window_half_length - ( 1 + i ) )].v.im ) ); // Q(-2) -#else - xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )] = add( xn_buf_fx[( ( i + ( overlap / 2 ) ) - tcx_offset )], mult_r( mult_r( hTcxDec->syn_Overl[i], tcx_mdct_window_half_fx[( tcx_mdct_window_half_length - ( 1 + i ) )].v.im ), tcx_mdct_window_half_fx[( tcx_mdct_window_half_length - ( 1 + i ) )].v.im ) ); -#endif move16(); move16(); } @@ -4050,11 +3808,7 @@ void decoder_tcx_invQ_fx( FOR( i = 0; i < noiseFillingSize; ++i ) { tmp32 = L_shr( x[i], sub( 31, *x_e ) ); -#ifdef BASOP_NOGLOB *nf_seed = add_o( *nf_seed, (Word16) abs( tmp32 ) * i * 2, &Overflow ); -#else - *nf_seed = add( *nf_seed, (Word16) abs( tmp32 ) * i * 2 ); -#endif move16(); } } @@ -4149,11 +3903,7 @@ void decoder_tcx_invQ_fx( move16(); move16(); -#ifdef BASOP_NOGLOB tmp1 = mult_r( shl_sat( L_spec, 5 ), 26214 /*128.f/NORM_MDCT_FACTOR Q15*/ ); -#else - tmp1 = mult_r( shl( L_spec, 5 ), 26214 /*128.f/NORM_MDCT_FACTOR Q15*/ ); -#endif s = 15 - 5 - 7; move16(); IF( GE_16( L_spec, 1024 ) ) /*reduce precision for avoiding overflow*/ @@ -4297,11 +4047,7 @@ void decoder_tcx_invQ_fx( st->last_gain_syn_deemph_e = add( st->last_gain_syn_deemph_e, 10 /*scaling of h1[0] and E_UTIL_synthesis * 2*/ ); move16(); tmp32 = Sqrt32( tmp32, &st->last_gain_syn_deemph_e ); -#ifdef BASOP_NOGLOB st->last_gain_syn_deemph = round_fx_o( tmp32, &Overflow ); // Q15 -#else - last_gain_syn_deemph_fx = round_fx( tmp32 ); -#endif move16(); } @@ -4594,11 +4340,7 @@ void decoder_tcx_noisefilling_fx( tmp32 = L_deposit_l( 0 ); FOR( i = 0; i < L_spec; i++ ) { -#ifdef BASOP_NOGLOB tmp32 = L_macNs_co( tmp32, abs_s( prm_sqQ[i] ), i, &Carry, &Overflow ); -#else - tmp32 = L_macNs( tmp32, abs_s( prm_sqQ[i] ), i ); -#endif } nf_seed = extract_l( tmp32 ); } @@ -4749,11 +4491,7 @@ void decoder_tcx_noisefilling_fx( tmp1 = BASOP_Util_Divide3232_Scale( W_extract_h( E_2ndlast ), W_extract_h( E_last ), &tmp2 ); tmp2 = add( tmp2, sub( exp2, exp1 ) ); -#ifdef BASOP_NOGLOB tmp1 = shl_sat( tmp1, sub( tmp2, 2 ) ); -#else - tmp1 = shl( tmp1, tmp2 ); -#endif /* replace higher energy TCX5 frame by lower one to avoid energy fluctuation */ IF( st->element_mode > EVS_MONO ) diff --git a/lib_dec/dec_tran_fx.c b/lib_dec/dec_tran_fx.c index d21109dce..284c9db8f 100644 --- a/lib_dec/dec_tran_fx.c +++ b/lib_dec/dec_tran_fx.c @@ -234,21 +234,12 @@ void decod_tran_fx( FOR( i = 0; i < L_SUBFR; i++ ) { L_tmp = L_mult( gain_preQ_fx, code_preQ_fx[i] ); /* Q2 + Q10 -> Q13*/ -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, tmp1_fx ); /* Q16 + Q_exc */ tmp_fx = round_fx_sat( L_tmp ); exc2_fx[i + i_subfr] = add_sat( exc2_fx[i + i_subfr], tmp_fx ); move16(); exc_fx[i + i_subfr] = add_sat( exc_fx[i + i_subfr], tmp_fx ); move16(); -#else - L_tmp = L_shl( L_tmp, tmp1_fx ); /* Q16 + Q_exc */ - tmp_fx = round_fx( L_tmp ); - exc2_fx[i + i_subfr] = add( exc2_fx[i + i_subfr], tmp_fx ); - move16(); - exc_fx[i + i_subfr] = add( exc_fx[i + i_subfr], tmp_fx ); - move16(); -#endif } } diff --git a/lib_dec/dec_uv_fx.c b/lib_dec/dec_uv_fx.c index 352738d5f..ffb49be38 100644 --- a/lib_dec/dec_uv_fx.c +++ b/lib_dec/dec_uv_fx.c @@ -372,11 +372,7 @@ static void gain_dec_gacelp_uv_fx( *past_gcode = L_shl( L_tmp1, sub( exp_L_tmp1, 15 ) ); /* Q16 */ move32(); -#ifdef BASOP_NOGLOB *gain_code = L_shl_sat( Mpy_32_16_1( *past_gcode, *gain_inov ), 3 ); -#else - *gain_code = L_shl( Mpy_32_16_1( *past_gcode, *gain_inov ), 3 ); -#endif move32(); diff --git a/lib_dec/er_dec_acelp_fx.c b/lib_dec/er_dec_acelp_fx.c index f61e782e3..658d35843 100644 --- a/lib_dec/er_dec_acelp_fx.c +++ b/lib_dec/er_dec_acelp_fx.c @@ -202,11 +202,7 @@ void con_acelp_fx( Tc = round_fx( tmp_tc ); /* Q0 */ BASOP_SATURATE_WARNING_OFF_EVS /*if this ever saturates, it doesn't matter*/ -#ifdef BASOP_NOGLOB tmp = sub( shl_sat( abs_s( sub( T0, Tc ) ), 6 ), mult( 19661 /*0.15f Q17*/, shl_sat( Tc, 4 ) ) /*Q6*/ ); -#else - tmp = sub( shl( abs_s( sub( T0, Tc ) ), 6 ), mult( 19661 /*0.15f Q17*/, shl( Tc, 4 ) ) /*Q6*/ ); -#endif BASOP_SATURATE_WARNING_ON_EVS test(); test(); @@ -419,11 +415,7 @@ void con_acelp_fx( FOR( ; i < l; i++ ) { BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB exc[i] = mult_r( exc[i], shl_sat( gain, 1 ) ); /*overflow is first iteration because gain may be 1 after shift*/ /*Qf_exc*/ -#else - exc[i] = mult_r( exc[i], shl( gain, 1 ) ); /*overflow is first iteration because gain may be 1 after shift*/ /*Qf_exc*/ -#endif BASOP_SATURATE_WARNING_ON_EVS move16(); gain = sub( gain, step ); @@ -434,11 +426,7 @@ void con_acelp_fx( FOR( ; i < l; i++ ) { BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB exc[i] = mult_r( exc[i], shl_sat( gain, 1 ) ); /*overflow is first iteration because gain may become 1 due to shift*/ /*Qf_exc*/ -#else - exc[i] = mult_r( exc[i], shl( gain, 1 ) ); /*overflow is first iteration because gain may become 1 due to shift*/ /*Qf_exc*/ -#endif BASOP_SATURATE_WARNING_ON_EVS move16(); gain = sub( gain, step ); @@ -541,24 +529,12 @@ void con_acelp_fx( gain_32 = st->Mode2_lp_gainc; /*15Q16 */ /* start-of-the-frame gain */ move32(); -#ifdef BASOP_NOGLOB ftmp = round_fx_sat( L_shl_sat( gain_32, 1 ) ); /*Q0*/ -#else - ftmp = round_fx( L_shl( gain_32, 1 ) ); /*Q0*/ -#endif BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB tmp_16 = sub( shl_sat( gainCNG, sub( gainCNG_e, 5 /*Q5*/ ) ), ftmp ); /*Q0*/ -#else - tmp_16 = sub( shl( gainCNG, sub( gainCNG_e, 5 /*Q5*/ ) ), ftmp ); -#endif /*in case of overflow:*/ test(); -#ifdef BASOP_NOGLOB if ( ( EQ_16( shl_sat( ftmp, sub( gainCNG_e, 1 ) ), MAXVAL_WORD16 ) ) && EQ_16( gainCNG, MAXVAL_WORD16 ) ) -#else - if ( ( EQ_16( shl( ftmp, sub( gainCNG_e, 1 ) ), MAXVAL_WORD16 ) ) && EQ_16( gainCNG, MAXVAL_WORD16 ) ) -#endif { tmp_16 = 1; move16(); @@ -671,23 +647,14 @@ void con_acelp_fx( /* gain_16 = gain_32 = gain_inov * gain */ gain_32 = Mpy_32_16_1( gain_32, gain_inov ); /* 15Q16 * Q15 * 2^s_gain_inov */ -#ifdef BASOP_NOGLOB gain_32 = L_shl_sat( gain_32, add( 15, s_gain_inov ) ); /* Q31 */ gain_16 = round_fx_sat( gain_32 ); /* Q15 */ -#else - gain_32 = L_shl( gain_32, add( 15, s_gain_inov ) ); /* Q31 */ - gain_16 = round_fx( gain_32 ); /* Q15 */ -#endif /* step_32 = gain_inov * step */ step_32 = Mpy_32_16_1( step_32, gain_inov ); /* 15Q16 * Q15 * 2^s_gain_inov */ step_32 = L_shl( step_32, add( 15, s_gain_inov ) ); /* Q31 */ -#ifdef BASOP_NOGLOB g_e = norm_s( round_fx_sat( L_shl_sat( Mpy_32_16_1( st->Mode2_lp_gainc, gain_inov ), add( 15, s_gain_inov ) ) ) ); /* norm_s for gain*gain_inov at the end of the following loops */ -#else - g_e = norm_s( round_fx( L_shl( Mpy_32_16_1( st->Mode2_lp_gainc, gain_inov ), add( 15, s_gain_inov ) ) ) ); /* norm_s for gain*gain_inov at the end of the following loops */ -#endif g_e = s_min( norm_s( gain_16 ), g_e ); gain_16 = shl( gain_16, g_e ); /*Q15 + g_e*/ gain_32 = L_shl( gain_32, g_e ); /*Q31 + g_e*/ @@ -826,13 +793,8 @@ void con_acelp_fx( /* i_subfr / L_SUBFR */ tmp_16 = shr( i_subfr, Q6 ); g = mult_r( st->last_gain_syn_deemph, gain_lpc[tmp_16] ); /* Q15 - gain_lpc_e[tmp_16] */ -#ifdef BASOP_NOGLOB g_e = add_sat( st->last_gain_syn_deemph_e, gain_lpc_e[tmp_16] ); g = shl_sat( g, g_e ); /* Q15 */ -#else - g_e = add( st->last_gain_syn_deemph_e, gain_lpc_e[tmp_16] ); - g = shl( g, g_e ); -#endif FOR( i = 0; i < L_SUBFR; i++ ) { @@ -917,11 +879,7 @@ void con_acelp_fx( tmp_16 = shr( i_subfr, Q6 ); g = mult_r( st->last_gain_syn_deemph, gain_lpc[tmp_16] ); /* Q15 - gain_lpc_e[tmp_16] */ g_e = add( st->last_gain_syn_deemph_e, gain_lpc_e[tmp_16] ); -#ifdef BASOP_NOGLOB g = shl_sat( g, g_e ); /*Q15*/ -#else - g = shl( g, g_e ); -#endif FOR( i = 0; i < L_SUBFR; i++ ) { /* exc[i_subfr + i] *= st->last_gain_syn_deemph*gain_lpc[j]; */ @@ -990,11 +948,7 @@ void con_acelp_fx( { FOR( i = 0; i < st->L_frame; i++ ) { -#ifdef BASOP_NOGLOB syn[i] = add_sat( syn[i], syn_unv[i] ); /*Qf_syn*/ -#else - syn[i] = add( syn[i], syn_unv[i] ); -#endif move16(); } } @@ -1048,11 +1002,7 @@ void con_acelp_fx( /*updating enr_old parameters*/ frame_ener_fx( st->L_frame, st->last_good, syn, round_fx( tmp_tc ), &( st->enr_old_fx ), 1, 0, 0, 0 ); -#ifdef BASOP_NOGLOB st->enr_old_fx = L_shl_sat( st->enr_old_fx, shl( negate( Qf_syn ), 1 ) ); /*Q0*/ -#else - st->enr_old_fx = L_shl( st->enr_old_fx, shl( negate( Qf_syn ), 1 ) ); -#endif move32(); /* update ACELP synthesis memory */ Copy( mem_syn, st->mem_syn2_fx, M ); /*Qf_syn*/ @@ -1187,11 +1137,7 @@ static void memsynPrecission_fx( Word16 nbLostCmpt, Word16 *mem_syn /*Qx*/, Word { /*saturation doesn't matter*/ BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB tmp = add_sat( tmp, abs_s( mem_syn[i] ) ); -#else - tmp = add( tmp, abs_s( mem_syn[i] ) ); -#endif BASOP_SATURATE_WARNING_ON_EVS } /*if there is energy in scale_syn, then increase precision*/ diff --git a/lib_dec/er_dec_tcx_fx.c b/lib_dec/er_dec_tcx_fx.c index 352c46ad6..0a86aba0d 100644 --- a/lib_dec/er_dec_tcx_fx.c +++ b/lib_dec/er_dec_tcx_fx.c @@ -36,34 +36,18 @@ static void calcGainc_fx( Word16 *exc, Word16 Q_exc, Word32 old_fpitch /*Q16*/, tmp16 = round_fx( old_fpitch ); /*Q0*/ tmp_loop = shl( L_subfr, 1 ); BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB tmp16_2 = round_fx_o( L_shl_o( lp_gainp, 2, &Overflow ), &Overflow ); /*Q31->Q15, no severe saturation, because st->lp_gainp here is [0,1]*/ -#else - tmp16_2 = round_fx( L_shl( lp_gainp, 2 ) ); /*Q31->Q15, no severe saturation, because st->lp_gainp here is [0,1]*/ -#endif BASOP_SATURATE_WARNING_ON_EVS FOR( i = 0; i < tmp_loop; i++ ) { /*st->lp_gainc += ( exc[i-2*L_subfr] - st->Mode2_lp_gainp * exc[i-2*L_subfr-(int)(st->old_fpitch+0.5f)] ) * ( exc[i-2*L_subfr] - st->Mode2_lp_gainp * exc[i-2*L_subfr-(int)(st->old_fpitch+0.5f)] );*/ -#ifdef BASOP_NOGLOB tmp16_3 = sub_o( exc[( i - ( L_subfr * 2 ) )] /*Q1*/, mult_r( tmp16_2 /*Q15*/, exc[( ( i - ( L_subfr * 2 ) ) - tmp16 )] /*Q1*/ ) /*Q1*/, &Overflow ); -#else - tmp16_3 = sub( exc[sub( i, shl( L_subfr, 1 ) )] /*Q1*/, mult_r( tmp16_2 /*Q15*/, exc[sub( sub( i, shl( L_subfr, 1 ) ), tmp16 )] /*Q1*/ ) /*Q1*/ ); -#endif -#ifdef BASOP_NOGLOB L_acc = L_macNs_co( L_acc, tmp16_3, tmp16_3, &Carry, &Overflow ); /*Q3*/ -#else - L_acc = L_macNs( L_acc, tmp16_3, tmp16_3 ); /*Q3*/ -#endif Overflow = 0; move16(); -#ifdef BASOP_NOGLOB L_c = L_macNs_co( L_c, 0, 0, &Carry, &Overflow ); /*Accumulate Carrys Q-1*/ -#else - L_c = L_macNs( L_c, 0, 0 ); /*Accumulate Carrys*/ -#endif Carry = 0; move16(); } @@ -105,18 +89,10 @@ static void calcGainc2_fx( Word16 *exc, Word16 Q_exc, Word16 L_subfr /*Q0*/, Wor FOR( i = 0; i < cnt; i++ ) { /* *gainc += ( exc[i-2*L_subfr] ) * ( exc[i-2*L_subfr]); */ -#ifdef BASOP_NOGLOB /* Critical Carry/Overflow */ L_acc = L_macNs_co( L_acc, exc[( i - ( L_subfr * 2 ) )] /*Q1*/, exc[( i - ( L_subfr * 2 ) )] /*Q1*/, &Carry, &Overflow ); /*Q3*/ -#else - L_acc = L_macNs( L_acc, exc[sub( i, shl( L_subfr, 1 ) )] /*Q1*/, exc[sub( i, shl( L_subfr, 1 ) )] /*Q1*/ ); /*Q3*/ -#endif Overflow = 0; move16(); -#ifdef BASOP_NOGLOB /* Critical Carry/Overflow */ L_c = L_macNs_co( L_c, 0, 0, &Carry, &Overflow ); /* Accumulate Carrys Q-1*/ -#else - L_c = L_macNs( L_c, 0, 0 ); /* Accumulate Carrys */ -#endif Carry = 0; move16(); } @@ -401,7 +377,6 @@ void con_tcx_fx( { FOR( i = 0; i < Tc; i++ ) { -#ifdef BASOP_NOGLOB *pt_exc++ = mac_r_sat( L_mac_sat( L_mac_sat( L_mac_sat( L_mac_sat( L_mac_sat( L_mac_sat( L_mac_sat( L_mac_sat( L_mac_sat( L_mult( 174 /* 0.0053f Q15*/, pt1_exc[-5] ), 0 /* 0.0000f Q15*/, pt1_exc[-4] ), @@ -414,20 +389,6 @@ void con_tcx_fx( -1442 /*-0.0440f Q15*/, pt1_exc[3] ), 0 /* 0.0000f Q15*/, pt1_exc[4] ), 174 /* 0.0053f Q15*/, pt1_exc[5] ); /*Q_exc*/ -#else - *pt_exc++ = mac_r( L_mac( L_mac( L_mac( L_mac( L_mac( L_mac( L_mac( L_mac( L_mac( - L_mult( 174 /* 0.0053f Q15*/, pt1_exc[-5] ), - 0 /* 0.0000f Q15*/, pt1_exc[-4] ), - -1442 /*-0.0440f Q15*/, pt1_exc[-3] ), - 0 /* 0.0000f Q15*/, pt1_exc[-2] ), - 8641 /* 0.2637f Q15*/, pt1_exc[-1] ), - 18022 /* 0.5500f Q15*/, pt1_exc[0] ), - 8641 /* 0.2637f Q15*/, pt1_exc[1] ), - 0 /* 0.0000f Q15*/, pt1_exc[2] ), - -1442 /*-0.0440f Q15*/, pt1_exc[3] ), - 0 /* 0.0000f Q15*/, pt1_exc[4] ), - 174 /* 0.0053f Q15*/, pt1_exc[5] ); -#endif move16(); pt1_exc++; } @@ -436,7 +397,6 @@ void con_tcx_fx( { FOR( i = 0; i < Tc; i++ ) { -#ifdef BASOP_NOGLOB *pt_exc++ = mac_r_sat( L_mac_sat( L_mac_sat( L_mac_sat( L_mac_sat( L_mac_sat( L_mac_sat( L_mac_sat( L_mac_sat( L_mac_sat( L_mult( -174 /*-0.0053f Q15*/, pt1_exc[-5] ), -121 /*-0.0037f Q15*/, pt1_exc[-4] ), @@ -449,20 +409,6 @@ void con_tcx_fx( -459 /*-0.0140f Q15*/, pt1_exc[3] ), -121 /*-0.0037f Q15*/, pt1_exc[4] ), -174 /*-0.0053f Q15*/, pt1_exc[5] ); /*Q_exc*/ -#else - *pt_exc++ = mac_r( L_mac( L_mac( L_mac( L_mac( L_mac( L_mac( L_mac( L_mac( L_mac( - L_mult( -174 /*-0.0053f Q15*/, pt1_exc[-5] ), - -121 /*-0.0037f Q15*/, pt1_exc[-4] ), - -459 /*-0.0140f Q15*/, pt1_exc[-3] ), - 590 /* 0.0180f Q15*/, pt1_exc[-2] ), - 8743 /* 0.2668f Q15*/, pt1_exc[-1] ), - 16355 /* 0.4991f Q15*/, pt1_exc[0] ), - 8743 /* 0.2668f Q15*/, pt1_exc[1] ), - 590 /* 0.0180f Q15*/, pt1_exc[2] ), - -459 /*-0.0140f Q15*/, pt1_exc[3] ), - -121 /*-0.0037f Q15*/, pt1_exc[4] ), - -174 /*-0.0053f Q15*/, pt1_exc[5] ); -#endif move16(); pt1_exc++; } @@ -563,11 +509,7 @@ void con_tcx_fx( } ELSE { -#ifdef BASOP_NOGLOB st->cummulative_damping = shl_sat( mult_r_sat( st->cummulative_damping /*Q15*/, alpha /*Q14*/ ), 1 ) /*Q15*/; -#else - st->cummulative_damping = shl( mult_r( st->cummulative_damping /*Q15*/, alpha /*Q14*/ ), 1 ) /*Q15*/; -#endif move16(); } @@ -595,15 +537,9 @@ void con_tcx_fx( tmp_loop = shr( imult1616( L_frame, 3 ), 1 ); FOR( i = offset; i < tmp_loop; i++ ) { -#ifdef BASOP_NOGLOB exc[i] = mult_r( exc[i], round_fx_sat( gain32 ) ) /*Q1*/; move16(); gain32 = L_sub_sat( gain32, step32 ); /*Q31*/ -#else - exc[i] = mult_r( exc[i], round_fx( gain32 ) ) /*Q1*/; - move16(); - gain32 = L_sub( gain32, step32 ); -#endif } /* update old exc without random part */ @@ -821,11 +757,7 @@ void con_tcx_fx( { gain32 = Mpy_32_16_1( gain32, 22938 /*0.7f Q15*/ ); /*Q16*/ } -#ifdef BASOP_NOGLOB /* Critical Overflow */ L_tmp = L_shl_sat( gain32, 1 ); /*Q16*/ -#else - L_tmp = L_shl( gain32, 1 ); -#endif IF( GT_32( L_shl( L_deposit_h( gainCNG ), sub( gainCNG_e, 31 - 16 ) /*Q16*/ ), L_tmp ) ) { gainCNG_e = sub( 15 + 1, norm_l( L_tmp ) ); @@ -872,11 +804,7 @@ void con_tcx_fx( tmp_e = norm_l( L_tmp ); L_tmp = L_shl( L_tmp, tmp_e ); gain_inov_e = add( sub( gain_inov_e, tmp_e ), 31 - 29 ); /*->Q31*/ -#ifdef BASOP_NOGLOB /* Critical Overflow */ gain_inov = round_fx_sat( L_tmp ); /*Q15,gain_inov_e*/ -#else - gain_inov = round_fx( L_tmp ); /*Q15,gain_inov_e*/ -#endif } st->Mode2_lp_gainp = L_shr( L_deposit_h( alpha /*Q14*/ ) /*Q14+16*/, 1 ); /*Q29*/ @@ -925,13 +853,8 @@ void con_tcx_fx( tmp16 = add( L_frame, shr( L_frame, 1 ) ); FOR( i = 0; i < tmp16; i++ ) { -#ifdef BASOP_NOGLOB exc[i] = add_sat( exc[i], shl_sat( noise[i + ( L_FIR_FER2 / 2 )], add( Q_exc, noise_e ) ) ); /*Q1*/ move16(); -#else - exc[i] = add( exc[i], shl( noise[i + ( L_FIR_FER2 / 2 )], add( Q_exc, noise_e ) ) ); /*Q1*/ - move16(); -#endif } } ELSE @@ -978,11 +901,7 @@ void con_tcx_fx( Copy_Scale_sig( buf, mem_syn, M, exp_scale ); /*Q: tmp16*/ -#ifdef BASOP_NOGLOB tmp_deemph = shl_sat( tmp_deemph, Q_syn ); /*Q_syn*/ -#else - tmp_deemph = shl( tmp_deemph, Q_syn ); -#endif st->Q_syn = Q_syn; move16(); @@ -1080,11 +999,7 @@ void con_tcx_fx( lerp( syn, st->hWIDec->old_syn2_fx, L_EXC_MEM, L_frame ); } -#ifdef BASOP_NOGLOB st->bfi_pitch_fx /*Q6*/ = round_fx_sat( L_shl_sat( pitch_buf[( st->nb_subfr - 1 )] /*15Q16*/, 6 /*Q6*/ ) ); -#else - st->bfi_pitch_fx /*Q6*/ = round_fx( L_shl( pitch_buf[sub( st->nb_subfr, 1 )] /*15Q16*/, 6 /*Q6*/ ) ); -#endif move16(); st->bfi_pitch_frame = st->L_frame; move16(); @@ -1108,21 +1023,13 @@ void con_tcx_fx( FOR( i = 0; i < W2; i++ ) { -#ifdef BASOP_NOGLOB hTcxDec->syn_Overl_TDACFB[i] = add_sat( buf[i], buf[( ( W1 - 1 ) - i )] ); /*hTcxDec->Q_syn_Overl_TDACFB*/ -#else - hTcxDec->syn_Overl_TDACFB[i] = add( buf[i], buf[sub( sub( W1, 1 ), i )] ); -#endif move16(); } FOR( i = 0; i < W2; i++ ) { -#ifdef BASOP_NOGLOB hTcxDec->syn_Overl_TDACFB[( W2 + i )] = add_sat( buf[( W2 + i )], buf[( ( ( W1 - 1 ) - W2 ) - i )] ); /*hTcxDec->Q_syn_Overl_TDACFB*/ -#else - hTcxDec->syn_Overl_TDACFB[add( W2, i )] = add( buf[add( W2, i )], buf[sub( sub( sub( W1, 1 ), W2 ), i )] ); -#endif move16(); } @@ -1547,11 +1454,7 @@ void con_tcx_ivas_fx( } ELSE { -#ifdef BASOP_NOGLOB st->cummulative_damping = shl_sat( mult_r_sat( st->cummulative_damping /*Q15*/, alpha /*Q14*/ ), 1 ) /*Q15*/; -#else - st->cummulative_damping = shl( mult_r( st->cummulative_damping /*Q15*/, alpha /*Q14*/ ), 1 ) /*Q15*/; -#endif move16(); } @@ -1579,15 +1482,9 @@ void con_tcx_ivas_fx( tmp_loop = shr( imult1616( L_frame, 3 ), 1 ); FOR( i = offset; i < tmp_loop; i++ ) { -#ifdef BASOP_NOGLOB exc[i] = mult_r( exc[i], round_fx_sat( gain32 ) ) /*Q1*/; move16(); gain32 = L_sub_sat( gain32, step32 ); /*Q31*/ -#else - exc[i] = mult_r( exc[i], round_fx( gain32 ) ) /*Q1*/; - move16(); - gain32 = L_sub( gain32, step32 ); -#endif } /* update old exc without random part */ @@ -1930,13 +1827,8 @@ void con_tcx_ivas_fx( tmp16 = add( L_frame, shr( L_frame, 1 ) ); FOR( i = 0; i < tmp16; i++ ) { -#ifdef BASOP_NOGLOB exc[i] = add_sat( exc[i], shl_sat( noise[i + ( L_FIR_FER2 / 2 )], add( Q_exc, noise_e ) ) ); /*Q1*/ move16(); -#else - exc[i] = add( exc[i], shl( noise[i + ( L_FIR_FER2 / 2 )], add( Q_exc, noise_e ) ) ); /*Q1*/ - move16(); -#endif } } ELSE @@ -1984,11 +1876,7 @@ void con_tcx_ivas_fx( Copy_Scale_sig( buf, mem_syn, M, exp_scale ); /* Q: tmp16 */ -#ifdef BASOP_NOGLOB tmp_deemph = shl_sat( tmp_deemph, Q_syn ); -#else - tmp_deemph = shl( tmp_deemph, Q_syn ); -#endif st->Q_syn = Q_syn; move16(); @@ -2092,11 +1980,7 @@ void con_tcx_ivas_fx( lerp( syn, st->hWIDec->old_syn2_fx, L_EXC_MEM, L_frame ); } -#ifdef BASOP_NOGLOB st->bfi_pitch_fx /*Q6*/ = round_fx_sat( L_shl_sat( pitch_buf[sub( st->nb_subfr, 1 )] /*15Q16*/, 6 /*Q6*/ ) ); -#else - st->bfi_pitch_fx /*Q6*/ = round_fx( L_shl( pitch_buf[sub( st->nb_subfr, 1 )] /*15Q16*/, 6 /*Q6*/ ) ); -#endif move16(); st->bfi_pitch_frame = st->L_frame; move16(); diff --git a/lib_dec/er_scale_syn_fx.c b/lib_dec/er_scale_syn_fx.c index 6061ac099..d5731f4ab 100644 --- a/lib_dec/er_scale_syn_fx.c +++ b/lib_dec/er_scale_syn_fx.c @@ -97,11 +97,7 @@ Word16 Damping_fact_fx( /* o : damping factor move16(); gain32 = Sqrt32( lp_tmp, &s_gainp ); /*Q31-s_gainp*/ -#ifdef BASOP_NOGLOB gain = round_fx_o( L_shl_o( gain32, s_gainp, &Overflow ), &Overflow ); /* Q15*/ -#else - gain = round_fx( L_shl( gain32, s_gainp ) ); /* Q15*/ -#endif gain = s_min( gain, 32113 /*0.98f Q15*/ ); /*Q15*/ gain = s_max( gain, 27853 /*0.85f Q15*/ ); /*Q15*/ alpha = mult_r( alpha, gain ); /*Q14*/ diff --git a/lib_dec/er_sync_exc_fx.c b/lib_dec/er_sync_exc_fx.c index 19ae2edcc..9ba45e2a4 100644 --- a/lib_dec/er_sync_exc_fx.c +++ b/lib_dec/er_sync_exc_fx.c @@ -53,27 +53,15 @@ static Word16 GetMinimumPosition_fx( FOR( i = 0; i < cnt; i++ ) { tmp16 = shr( x[i], tmp_e ); /*Qx*/ -#ifdef BASOP_NOGLOB energy = L_msu_sat( energy_old, tmp16, tmp16 ); /*2Qx+1*/ -#else - energy = L_msu( energy_old, tmp16, tmp16 ); -#endif tmp16 = shr( x[( i + filterLength )], tmp_e ); /*Qx*/ BASOP_SATURATE_WARNING_OFF_EVS /*Saturation will be handled*/ -#ifdef BASOP_NOGLOB energy = L_mac_sat( energy, tmp16, tmp16 ); /*2Qx+1*/ -#else - energy = L_mac( energy, tmp16, tmp16 ); -#endif BASOP_SATURATE_WARNING_ON_EVS /*if (energy == MAXVAL_WORD32)*/ BASOP_SATURATE_WARNING_OFF_EVS /*saturates if energy < 0*/ -#ifdef BASOP_NOGLOB tmptest = L_sub_o( energy, MAXVAL_WORD32, &Overflow ); /*Q31*/ -#else - tmptest = L_sub( energy, MAXVAL_WORD32 ); -#endif BASOP_SATURATE_WARNING_ON_EVS IF( tmptest == 0 ) { @@ -307,11 +295,7 @@ void PulseResynchronization_fx( tmp3_e = tmp2_e; move16(); tmp32_a = L_negate( tmp32_a ); -#ifdef BASOP_NOGLOB tmp32_a = L_add( L_shl_o( 1, sub( 31, tmp3_e ), &Overflow ), tmp32_a ); /*Q31,tmp3_e*/ /*tmp32_a= 1.0f-pitchStart*freqStart*/ -#else - tmp32_a = L_add( L_shl( 1, sub( 31, tmp3_e ) ), tmp32_a ); /*Q31,tmp3_e*/ /*tmp32_a= 1.0f-pitchStart*freqStart*/ -#endif tmp2_e = norm_s( nFrameLength ); tmp16_a = shl( nFrameLength, tmp2_e ); /*Q0+tmp2_e*/ tmp32_a = Mpy_32_16_1( tmp32_a /*Q31,tmp3_e*/, tmp16_a /*Q0,-tmp2_e*/ ); /*Q16,tmp3_e-tmp2_e*/ /*tmp32_a= nFrameLength*(1.0f-pitchStart*freqStart)*/ @@ -377,11 +361,7 @@ void PulseResynchronization_fx( tmp_e = sub( 15, norm_l( tmp32 ) ); cycleDelta_e = add( cycleDelta_e, tmp_e ); tmp32 = L_shr( tmp32, sub( tmp_e, 15 ) ); /*Q31 frac, cycleDelta_e*/ -#ifdef BASOP_NOGLOB cycleDelta = round_fx_o( tmp32, &Overflow ); /*Q15, cycleDelta_e*/ -#else - cycleDelta = round_fx( tmp32 ); /*Q15, cycleDelta_e*/ -#endif if ( cycleDelta == 0 ) { cycleDelta_e = 0; diff --git a/lib_dec/er_util_fx.c b/lib_dec/er_util_fx.c index 7452e9bf6..8c94ecf98 100644 --- a/lib_dec/er_util_fx.c +++ b/lib_dec/er_util_fx.c @@ -53,11 +53,7 @@ void minimumStatistics_fx( BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB IF( LT_16( shl_o( currentFrameLevel, currentFrameLevel_e, &Overflow ), PLC_MIN_CNG_LEV ) ) -#else - IF( LT_16( shl( currentFrameLevel, currentFrameLevel_e ), PLC_MIN_CNG_LEV ) ) -#endif { BASOP_SATURATE_WARNING_ON_EVS currentFrameLevel = PLC_MIN_CNG_LEV; /*Q15*/ @@ -271,11 +267,7 @@ Word16 getLevelSynDeemph_fx( /*10Q5*/ *Exp = sub( 10, s16 ); /*Set exponent in order to transform returnvalue to Q15*/ move16(); -#ifdef BASOP_NOGLOB return round_fx_sat( levelSynDeemph ); /*Q15*/ -#else - return round_fx( levelSynDeemph ); /*Q15*/ -#endif } /* BASOP version: up to date with rev 7422 */ diff --git a/lib_dec/evs_dec_fx.c b/lib_dec/evs_dec_fx.c index 5e027e652..de6448433 100644 --- a/lib_dec/evs_dec_fx.c +++ b/lib_dec/evs_dec_fx.c @@ -163,20 +163,12 @@ ivas_error evs_dec_fx( /* st_fx->old_out_fx, st_fx->L_frameTCX); */ FOR( i = 0; i < hTcxDec->L_frameTCX; i++ ) { -#ifdef BASOP_NOGLOB hHQ_core->old_out_fx[i] = shl_sat( mult_r( hHQ_core->old_out_fx[i], st_fx->plcInfo.recovery_gain ), 1 ); /*hHQ_core->exp_old_out*/ -#else - hHQ_core->old_out_fx[i] = shl( mult_r( hHQ_core->old_out_fx[i], st_fx->plcInfo.recovery_gain ), 1 ); -#endif move16(); } FOR( i = 0; i < st_fx->L_frame; i++ ) { -#ifdef BASOP_NOGLOB hHQ_core->old_out_LB_fx[i] = shl_sat( mult_r( hHQ_core->old_out_LB_fx[i], st_fx->plcInfo.recovery_gain ), 1 ); /*hHQ_core->exp_old_out*/ -#else - hHQ_core->old_out_LB_fx[i] = shl( mult_r( hHQ_core->old_out_LB_fx[i], st_fx->plcInfo.recovery_gain ), 1 ); -#endif move16(); } /* attenuate PLC buffers, if no aldo window @@ -192,11 +184,7 @@ ivas_error evs_dec_fx( tmp1 = extract_l( L_shr_r( f, s ) ); /*Q14 - s*/ FOR( i = 0; i < st_fx->hTcxCfg->tcx_mdct_window_lengthFB; i++ ) { -#ifdef BASOP_NOGLOB hTcxDec->syn_OverlFB[i] = shl_sat( mult_sat( tmp1, hTcxDec->syn_OverlFB[i] ), add( s, 1 ) ); /*hTcxDec->Q_syn_Overl*/ -#else - hTcxDec->syn_OverlFB[i] = shl( mult( tmp1, hTcxDec->syn_OverlFB[i] ), add( s, 1 ) ); -#endif move16(); } s = norm_l( f ); @@ -204,11 +192,7 @@ ivas_error evs_dec_fx( tmp1 = extract_l( L_shr_r( f, s ) ); /*Q14 - s*/ FOR( i = 0; i < st_fx->hTcxCfg->tcx_mdct_window_length; i++ ) { -#ifdef BASOP_NOGLOB hTcxDec->syn_Overl[i] = shl_sat( mult_sat( tmp1, hTcxDec->syn_Overl[i] ), s ); /*hTcxDec->Q_syn_Overl*/ -#else - hTcxDec->syn_Overl[i] = shl( mult( tmp1, hTcxDec->syn_Overl[i] ), s ); -#endif move16(); } } @@ -504,11 +488,7 @@ ivas_error evs_dec_fx( /*hb_synth[i] *= (i*tmp);*/ hb_synth_fx[i] = mult_r( hb_synth_fx[i], tmp16_2 ); /*hb_synth_fx_exp*/ move16(); -#ifdef BASOP_NOGLOB tmp16_2 = add_o( tmp16_2, tmp16, &Overflow ); -#else - tmp16_2 = add( tmp16_2, tmp16 ); -#endif } } @@ -757,11 +737,7 @@ ivas_error evs_dec_fx( fra = Log2_norm_lc( L_shl( L_tmp, exp ) ); exp = sub( sub( 30, shl( hb_synth_fx_exp, 1 ) ), exp ); L_tmp = Mpy_32_16( exp, fra, LG10 ); -#ifdef BASOP_NOGLOB st_fx->last_shb_ener_fx = round_fx_sat( L_shl_sat( L_tmp, 10 ) ); /*Q8*/ -#else - st_fx->last_shb_ener_fx = round_fx( L_shl( L_tmp, 10 ) ); /*Q8*/ -#endif } } hBWE_TD->prev_hb_synth_fx_exp = hb_synth_fx_exp; @@ -1044,11 +1020,7 @@ ivas_error evs_dec_fx( { FOR( i = 0; i < st_fx->L_frame / 2; i++ ) { -#ifdef BASOP_NOGLOB output_sp[i] = add_sat( output_sp[i], st_fx->hFdCngDec->hFdCngCom->olapBufferSynth2[i + 5 * st_fx->L_frame / 4] ); /*Q0*/ -#else - output_sp[i] = add( output_sp[i], st_fx->hFdCngDec->hFdCngCom->olapBufferSynth2[i + 5 * st_fx->L_frame / 4] ); -#endif move16(); } } @@ -1218,11 +1190,7 @@ ivas_error evs_dec_fx( FOR( i = 0; i < tmps; i++ ) { -#ifdef BASOP_NOGLOB output_sp[i + delay_comp] = msu_r_sat( L_mult_sat( output_sp[i + delay_comp], alpha ), shr( hHQ_core->old_out_fx[i + nz], timeIn_e ), add( alpha, -32768 ) ); /*timeIn_e*/ -#else - output_sp[i + delay_comp] = msu_r( L_mult( output_sp[i + delay_comp], alpha ), shr( hHQ_core->old_out_fx[i + nz], timeIn_e ), add( alpha, -32768 ) ); -#endif move16(); alpha = add( alpha, step ); } @@ -1345,11 +1313,7 @@ ivas_error evs_dec_fx( FOR( i = 0; i < tmps; i++ ) { -#ifdef BASOP_NOGLOB output_sp[i + tmps] = msu_r_sat( L_mult_sat( shr( pcmbufFB[i], timeIn_e ), alpha ), output_sp[i + tmps], add( alpha, -32768 ) ); /*Q0*/ -#else - output_sp[i + tmps] = msu_r( L_mult( shr( pcmbufFB[i], timeIn_e ), alpha ), output_sp[i + tmps], add( alpha, -32768 ) ); -#endif move16(); alpha = add( alpha, step ); } @@ -1387,17 +1351,9 @@ ivas_error evs_dec_fx( FOR( i = delta; i < tmps; i++ ) { -#ifdef BASOP_NOGLOB output_sp[i] = msu_r_sat( L_mult( output_sp[i], alpha ), shr_sat( hTcxDec->FBTCXdelayBuf[i], timeIn_e ), add( alpha, -32768 ) ); /*Q0*/ -#else - output_sp[i] = msu_r( L_mult( output_sp[i], alpha ), shr( hTcxDec->FBTCXdelayBuf[i], timeIn_e ), add( alpha, -32768 ) ); -#endif move16(); -#ifdef BASOP_NOGLOB alpha = add_sat( alpha, step ); -#else - alpha = add( alpha, step ); -#endif } } diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index 2bb2a39ec..ac77e30a7 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -825,11 +825,7 @@ Word16 ApplyFdCng_fx( Carry = 0; move16(); -#ifdef BASOP_NOGLOB L_tmp = L_add_co( L_tmp, *( cngNoiseLevel + j ), &Carry, &Overflow ); /*Q31*/ -#else - L_tmp = L_add_c( L_tmp, *( cngNoiseLevel + j ) ); -#endif Overflow = 0; move16(); @@ -839,11 +835,7 @@ Word16 ApplyFdCng_fx( } IF( *( cngNoiseLevel + j ) >= 0 ) { -#ifdef BASOP_NOGLOB L_c = L_macNs_co( L_c, 0, 0, &Carry, &Overflow ); /*Q-1*/ -#else - L_c = L_macNs( L_c, 0, 0 ); -#endif } } L_tmp = norm_llQ31( L_c, L_tmp, &L_tmp_exp ); /*Q31 - L_tmp_exp*/ @@ -855,11 +847,7 @@ Word16 ApplyFdCng_fx( L_tmp_exp = add( L_tmp_exp, -7 ); /*->Q16, L_tmp_exp */ L_tmp_exp = add( L_tmp_exp, 31 - 16 ); /*->Q31, L_tmp_exp*/ -#ifdef BASOP_NOGLOB st->cngTDLevel = round_fx_sat( Sqrt32( L_tmp, &L_tmp_exp ) ); /*Q15 - L_tmp_exp*/ -#else - st->cngTDLevel = round_fx( Sqrt32( L_tmp, &L_tmp_exp ) ); -#endif st->cngTDLevel_e = L_tmp_exp; move16(); } @@ -885,11 +873,7 @@ Word16 ApplyFdCng_fx( L_tmp_exp = add( *cngNoiseLevel_exp, 16 ); test(); test(); -#ifdef BASOP_NOGLOB IF( EQ_16( concealWholeFrame, 1 ) && EQ_16( st->nbLostCmpt, 1 ) && ( GT_32( L_shl_o( L_tmp, L_tmp_exp, &Overflow ), 21474836 ) /*0.01f Q31*/ ) ) -#else - IF( EQ_16( concealWholeFrame, 1 ) && EQ_16( st->nbLostCmpt, 1 ) && ( L_shl( L_tmp, L_tmp_exp ) > 21474836 /*0.01f Q31*/ ) ) -#endif { /* update isf cng estimate for concealment. Do that during concealment, in order to avoid addition clean channel complexity*/ #ifndef IVAS_CODE_CNG_FIX185_PLC_FADEOUT @@ -991,7 +975,6 @@ Word16 ApplyFdCng_fx( Carry = 0; move16(); -#ifdef BASOP_NOGLOB /* Critical Carry/Overflow */ L_tmp = L_add_co( L_tmp, *( cngNoiseLevel + j ), &Carry, &Overflow ); /*Q31*/ Overflow = 0; move16(); @@ -1004,19 +987,6 @@ Word16 ApplyFdCng_fx( { L_c = L_macNs_co( L_c, 0, 0, &Carry, &Overflow ); /*Q-1*/ } -#else - L_tmp = L_add_c( L_tmp, *( cngNoiseLevel + j ) ); - Overflow = 0; - - if ( *( cngNoiseLevel + j ) < 0 ) - { - L_c = L_msuNs( L_c, 0, 0 ); - } - if ( *( cngNoiseLevel + j ) >= 0 ) - { - L_c = L_macNs( L_c, 0, 0 ); - } -#endif } L_tmp = norm_llQ31( L_c, L_tmp, &L_tmp_exp ); /*Q31 - L_tmp_exp*/ L_tmp_exp = sub( add( L_tmp_exp, *cngNoiseLevel_exp ), 1 ); @@ -1027,12 +997,8 @@ Word16 ApplyFdCng_fx( L_tmp_exp = add( L_tmp_exp, -7 ); /*->Q16, L_tmp_exp */ L_tmp_exp = add( L_tmp_exp, 31 - 16 ); /*->Q31, L_tmp_exp*/ -#ifdef BASOP_NOGLOB /* Critical Carry/Overflow */ st->cngTDLevel = round_fx_o( Sqrt32( L_tmp, &L_tmp_exp ), &Overflow ); /*Q15 - L_tmp_exp*/ move16(); -#else - st->cngTDLevel = round_fx( Sqrt32( L_tmp, &L_tmp_exp ) ); -#endif st->cngTDLevel_e = L_tmp_exp; move16(); #endif @@ -1434,11 +1400,7 @@ Word16 ApplyFdCng_ivas_fx( Carry = 0; move16(); -#ifdef BASOP_NOGLOB L_tmp = L_add_co( L_tmp, *( cngNoiseLevel + j ), &Carry, &Overflow ); /*Q31*/ -#else - L_tmp = L_add_c( L_tmp, *( cngNoiseLevel + j ) ); -#endif Overflow = 0; move16(); @@ -1448,11 +1410,7 @@ Word16 ApplyFdCng_ivas_fx( } IF( *( cngNoiseLevel + j ) >= 0 ) { -#ifdef BASOP_NOGLOB L_c = L_macNs_co( L_c, 0, 0, &Carry, &Overflow ); /*Q-1*/ -#else - L_c = L_macNs( L_c, 0, 0 ); -#endif } } L_tmp = norm_llQ31( L_c, L_tmp, &L_tmp_exp ); /*Q31 - L_tmp_exp*/ @@ -1464,11 +1422,7 @@ Word16 ApplyFdCng_ivas_fx( L_tmp_exp = add( L_tmp_exp, -7 ); /*->Q16, L_tmp_exp */ L_tmp_exp = add( L_tmp_exp, 31 - 16 ); /*->Q31, L_tmp_exp*/ -#ifdef BASOP_NOGLOB st->hTcxDec->conCngLevelBackgroundTrace = round_fx_sat( Sqrt32( L_tmp, &L_tmp_exp ) ); /*Q15 - L_tmp_exp*/ -#else - st->hTcxDec->conCngLevelBackgroundTrace = round_fx( Sqrt32( L_tmp, &L_tmp_exp ) ); -#endif move16(); L_tmp_exp = add( L_tmp_exp, 1 ); st->hTcxDec->conCngLevelBackgroundTrace_e = L_tmp_exp; @@ -1485,11 +1439,7 @@ Word16 ApplyFdCng_ivas_fx( Carry = 0; move16(); -#ifdef BASOP_NOGLOB L_tmp = L_add_co( L_tmp, *( cngNoiseLevel + j ), &Carry, &Overflow ); /*Q31 - L_tmp_exp*/ -#else - L_tmp = L_add_c( L_tmp, *( cngNoiseLevel + j ) ); -#endif Overflow = 0; move16(); @@ -1499,11 +1449,7 @@ Word16 ApplyFdCng_ivas_fx( } IF( *( cngNoiseLevel + j ) >= 0 ) { -#ifdef BASOP_NOGLOB L_c = L_macNs_co( L_c, 0, 0, &Carry, &Overflow ); /*Q-1*/ -#else - L_c = L_macNs( L_c, 0, 0 ); -#endif } } L_tmp = norm_llQ31( L_c, L_tmp, &L_tmp_exp ); /*Q31 - L_tmp_exp*/ @@ -1515,13 +1461,8 @@ Word16 ApplyFdCng_ivas_fx( L_tmp_exp = add( L_tmp_exp, -7 ); /*->Q16, L_tmp_exp */ L_tmp_exp = add( L_tmp_exp, 31 - 16 ); /*->Q31, L_tmp_exp*/ -#ifdef BASOP_NOGLOB st->hTcxDec->conCngLevelBackgroundTrace = round_fx_sat( Sqrt32( L_tmp, &L_tmp_exp ) ); /*Q15 - L_tmp_exp*/ move16(); -#else - st->hTcxDec->conCngLevelBackgroundTrace = round_fx( Sqrt32( L_tmp, &L_tmp_exp ) ); - st->hTcxDec->CngLevelBackgroundTrace_bfi_fx = ( Sqrt32( L_tmp, &L_tmp_exp ) ); -#endif st->hTcxDec->conCngLevelBackgroundTrace_e = L_tmp_exp; move16(); } @@ -1534,11 +1475,7 @@ Word16 ApplyFdCng_ivas_fx( Carry = 0; move16(); -#ifdef BASOP_NOGLOB L_tmp = L_add_co( L_tmp, *( cngNoiseLevel + j ), &Carry, &Overflow ); /*Q31 - L_tmp_exp*/ -#else - L_tmp = L_add_c( L_tmp, *( cngNoiseLevel + j ) ); -#endif Overflow = 0; move16(); @@ -1548,11 +1485,7 @@ Word16 ApplyFdCng_ivas_fx( } IF( *( cngNoiseLevel + j ) >= 0 ) { -#ifdef BASOP_NOGLOB L_c = L_macNs_co( L_c, 0, 0, &Carry, &Overflow ); /*Q-1*/ -#else - L_c = L_macNs( L_c, 0, 0 ); -#endif } } L_tmp = norm_llQ31( L_c, L_tmp, &L_tmp_exp ); /*Q31 - L_tmp_exp*/ @@ -1564,11 +1497,7 @@ Word16 ApplyFdCng_ivas_fx( L_tmp_exp = add( L_tmp_exp, -7 ); /*->Q16, L_tmp_exp */ L_tmp_exp = add( L_tmp_exp, 31 - 16 ); /*->Q31, L_tmp_exp*/ -#ifdef BASOP_NOGLOB st->cngTDLevel = round_fx_sat( Sqrt32( L_tmp, &L_tmp_exp ) ); /*Q15 - L_tmp_exp*/ -#else - st->cngTDLevel = round_fx( Sqrt32( L_tmp, &L_tmp_exp ) ); -#endif move16(); st->cngTDLevel_e = L_tmp_exp; move16(); @@ -1601,11 +1530,7 @@ Word16 ApplyFdCng_ivas_fx( } L_tmp_exp = 0; move16(); -#ifdef BASOP_NOGLOB IF( GT_32( L_shl_o( L_tmp, L_tmp_exp, &Overflow ), 21474836 ) /*0.01f Q31*/ ) -#else - IF( L_shl( L_tmp, L_tmp_exp ) > 21474836 /*0.01f Q31*/ ) -#endif { test(); test(); @@ -1665,7 +1590,6 @@ Word16 ApplyFdCng_ivas_fx( Carry = 0; move16(); -#ifdef BASOP_NOGLOB /* Critical Carry/Overflow */ L_tmp = L_add_co( L_tmp, *( cngNoiseLevel + j ), &Carry, &Overflow ); /*Q31 - L_tmp_exp*/ Overflow = 0; move16(); @@ -1678,19 +1602,6 @@ Word16 ApplyFdCng_ivas_fx( { L_c = L_macNs_co( L_c, 0, 0, &Carry, &Overflow ); /*Q-1*/ } -#else - L_tmp = L_add_c( L_tmp, *( cngNoiseLevel + j ) ); - Overflow = 0; - - if ( *( cngNoiseLevel + j ) < 0 ) - { - L_c = L_msuNs( L_c, 0, 0 ); - } - if ( *( cngNoiseLevel + j ) >= 0 ) - { - L_c = L_macNs( L_c, 0, 0 ); - } -#endif } L_tmp = norm_llQ31( L_c, L_tmp, &L_tmp_exp ); /*Q31 - L_tmp_exp*/ L_tmp_exp = sub( add( L_tmp_exp, *cngNoiseLevel_exp ), 1 ); @@ -1701,11 +1612,7 @@ Word16 ApplyFdCng_ivas_fx( L_tmp_exp = add( L_tmp_exp, -7 ); /*->Q16, L_tmp_exp */ L_tmp_exp = add( L_tmp_exp, 31 - 16 ); /*->Q31, L_tmp_exp*/ -#ifdef BASOP_NOGLOB /* Critical Carry/Overflow */ st->cngTDLevel = round_fx_o( Sqrt32( L_tmp, &L_tmp_exp ), &Overflow ); /*Q15 - L_tmp_exp*/ -#else - st->cngTDLevel = round_fx( Sqrt32( L_tmp, &L_tmp_exp ) ); -#endif move16(); st->cngTDLevel_e = L_tmp_exp; move16(); @@ -3812,11 +3719,7 @@ void generate_comfort_noise_dec_fx( s = sub( 15 - NOISE_HEADROOM, noiseExp ); FOR( i = 0; i < N; i++ ) { -#ifdef BASOP_NOGLOB noise[i] = shr_sat( mult( noise[i], gain16 ), s ); /*Q15 - noiseExp*/ -#else - noise[i] = shr( mult( noise[i], gain16 ), s ); -#endif move16(); } @@ -3825,11 +3728,7 @@ void generate_comfort_noise_dec_fx( s = sub( 15 - NOISE_HEADROOM, ( sub( 15, Q_syn ) ) ); FOR( i = 0; i < lpcorder; i++ ) { -#ifdef BASOP_NOGLOB old_syn_pe_tmp[i] = shr_sat( old_syn_pe[i], s ); /*Q0*/ -#else - old_syn_pe_tmp[i] = shr( old_syn_pe[i], s ); -#endif move16(); } @@ -4359,11 +4258,7 @@ void generate_comfort_noise_dec_ivas_fx( s = sub( 15 - NOISE_HEADROOM, noiseExp ); FOR( i = 0; i < N; i++ ) { -#ifdef BASOP_NOGLOB noise[i] = shr_sat( mult( noise[i], gain16 ), s ); /*Q15 - noiseExp*/ -#else - noise[i] = shr( mult( noise[i], gain16 ), s ); -#endif move16(); } @@ -4372,11 +4267,7 @@ void generate_comfort_noise_dec_ivas_fx( s = sub( 15 - NOISE_HEADROOM, ( sub( 15, Q_syn ) ) ); FOR( i = 0; i < lpcorder; i++ ) { -#ifdef BASOP_NOGLOB old_syn_pe_tmp[i] = shr_sat( old_syn_pe[i], s ); /*Q0*/ -#else - old_syn_pe_tmp[i] = shr( old_syn_pe[i], s ); -#endif move16(); } @@ -4798,11 +4689,7 @@ void generate_masking_noise_fx( { FOR( i = 0; i < hFdCngCom->frameSize; i++ ) { -#ifdef BASOP_NOGLOB timeDomainBuffer[i] = add_sat( timeDomainBuffer[i], shr_r_sat( maskingNoise[i], -Q ) ); /*Q0*/ -#else - timeDomainBuffer[i] = add( timeDomainBuffer[i], shr_r( maskingNoise[i], -Q ) ); -#endif move16(); } } diff --git a/lib_dec/gain_dec_fx.c b/lib_dec/gain_dec_fx.c index 210fae39e..38b933b81 100644 --- a/lib_dec/gain_dec_fx.c +++ b/lib_dec/gain_dec_fx.c @@ -169,11 +169,7 @@ void gain_dec_tc_fx( IF( GT_16( nBits, 3 ) ) { wgain_code = gain_dequant_fx( index, G_CODE_MIN_TC_Q15, G_CODE_MAX_TC_Q0, nBits, &expg ); -#ifdef BASOP_NOGLOB wgain_code = shl_sat( wgain_code, add( expg, 13 ) ); /* wgain_code in Q13*/ -#else - wgain_code = shl( wgain_code, add( expg, 13 ) ); /* wgain_code in Q13*/ -#endif } ELSE /* nBits == 3 */ { @@ -187,11 +183,7 @@ void gain_dec_tc_fx( /* *gain_code *= gcode0;*/ L_tmp = L_mult( wgain_code, gcode0_fx ); /* Q13*Q0 -> Q14 */ -#ifdef BASOP_NOGLOB *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 2 ) ); /*Q16*/ -#else - *gain_code_fx = L_shl( L_tmp, add( exp_gcode0, 2 ) ); -#endif move32(); /**norm_gain_code = *gain_code / *gain_inov;*/ @@ -462,11 +454,7 @@ void gain_dec_mless_fx( /**gain_code *= gcode0;*/ L_tmp = L_mult( gain_code16, gcode0_fx ); /*Q0*Q0 -> Q1*/ -#ifdef BASOP_NOGLOB *gain_code_fx = L_shl_sat( L_tmp, add( add( expg, exp_gcode0 ), 15 ) ); /*Q16*/ -#else - *gain_code_fx = L_shl( L_tmp, add( add( expg, exp_gcode0 ), 15 ) ); -#endif move32(); } ELSE @@ -560,11 +548,7 @@ void gain_dec_mless_fx( /**gain_code = qua_table[index * 2 + 1] * gcode0;*/ L_tmp = L_mult( qua_table_fx[( ( index * 2 ) + 1 )], gcode0_fx ); /* Q9*Q0 -> Q10 */ -#ifdef BASOP_NOGLOB *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /*Q16*/ -#else - *gain_code_fx = L_shl( L_tmp, add( exp_gcode0, 6 ) ); -#endif move32(); } @@ -731,11 +715,7 @@ void gain_dec_lbr_fx( move16(); L_tmp = L_mult( cdbk_fx[( ( index * 2 ) + 1 )], gcode0_fx ); /* Q9*Q0 -> Q10 */ -#ifdef BASOP_NOGLOB *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /* Q10 -> Q16*/ -#else - *gain_code_fx = L_shl( L_tmp, add( exp_gcode0, 6 ) ); -#endif move16(); gc_mem[0] = *gain_code_fx; /*Q16*/ @@ -805,11 +785,7 @@ void gain_dec_lbr_fx( move16(); L_tmp = L_mult( cdbk_fx[( ( index * 2 ) + 1 )], gcode0_fx ); /* Q9*Q0 -> Q10 */ -#ifdef BASOP_NOGLOB *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /*Q16*/ -#else - *gain_code_fx = L_shl( L_tmp, add( exp_gcode0, 6 ) ); -#endif move16(); gc_mem[1] = *gain_code_fx; /*Q16*/ @@ -883,11 +859,7 @@ void gain_dec_lbr_fx( move16(); L_tmp = L_mult( cdbk_fx[( ( index * 2 ) + 1 )], gcode0_fx ); /* Q9*Q0 -> Q10 */ -#ifdef BASOP_NOGLOB *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /* Q10 -> Q16*/ -#else - *gain_code_fx = L_shl( L_tmp, add( exp_gcode0, 6 ) ); /* Q10 -> Q16*/ -#endif move32(); gc_mem[2] = *gain_code_fx; /*Q16*/ move32(); @@ -971,11 +943,7 @@ void gain_dec_lbr_fx( move16(); L_tmp = L_mult( cdbk_fx[( ( index * 2 ) + 1 )], gcode0_fx ); /* Q9*Q0 -> Q10 */ -#ifdef BASOP_NOGLOB *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /*Q16*/ -#else - *gain_code_fx = L_shl( L_tmp, add( exp_gcode0, 6 ) ); -#endif move32(); } @@ -1117,11 +1085,7 @@ void gain_dec_lbr_ivas_fx( move16(); L_tmp = L_mult( cdbk_fx[( ( index * 2 ) + 1 )], gcode0_fx ); /* Q9*Q0 -> Q10 */ -#ifdef BASOP_NOGLOB *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /*Q16*/ -#else - *gain_code_fx = L_shl( L_tmp, add( exp_gcode0, 6 ) ); -#endif move16(); gc_mem[0] = *gain_code_fx; /*Q16*/ @@ -1191,11 +1155,7 @@ void gain_dec_lbr_ivas_fx( move16(); L_tmp = L_mult( cdbk_fx[( ( index * 2 ) + 1 )], gcode0_fx ); /* Q9*Q0 -> Q10 */ -#ifdef BASOP_NOGLOB *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /*Q16*/ -#else - *gain_code_fx = L_shl( L_tmp, add( exp_gcode0, 6 ) ); -#endif move16(); gc_mem[1] = *gain_code_fx; /*Q16*/ @@ -1269,11 +1229,7 @@ void gain_dec_lbr_ivas_fx( move16(); L_tmp = L_mult( cdbk_fx[( ( index * 2 ) + 1 )], gcode0_fx ); /* Q9*Q0 -> Q10 */ -#ifdef BASOP_NOGLOB *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /* Q10 -> Q16*/ -#else - *gain_code_fx = L_shl( L_tmp, add( exp_gcode0, 6 ) ); /* Q10 -> Q16*/ -#endif move32(); gc_mem[2] = *gain_code_fx; /*Q16*/ move32(); @@ -1356,11 +1312,7 @@ void gain_dec_lbr_ivas_fx( move16(); L_tmp = L_mult( cdbk_fx[( ( index * 2 ) + 1 )], gcode0_fx ); /* Q9*Q0 -> Q10 */ -#ifdef BASOP_NOGLOB *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /*Q16*/ -#else - *gain_code_fx = L_shl( L_tmp, add( exp_gcode0, 6 ) ); -#endif move32(); } @@ -1414,11 +1366,7 @@ void lp_gain_updt_fx( { Word16 tmp; -#ifdef BASOP_NOGLOB tmp = extract_h( L_shl_sat( norm_gain_code, 3 ) ); /*(16+3)-16 -> Q3*/ -#else - tmp = extract_h( L_shl( norm_gain_code, 3 ) ); /*(16+3)-16 -> Q3*/ -#endif IF( EQ_16( L_frame, L_FRAME ) ) { IF( EQ_16( i_subfr, 0 ) ) @@ -1446,11 +1394,7 @@ void lp_gain_updt_fx( { *lp_gainp = add( *lp_gainp, mult( 13107, gain_pit ) ); move16(); /*Q14 (0.4 in Q15 = 13107)*/ -#ifdef BASOP_NOGLOB *lp_gainc = mac_r_sat( L_deposit_h( *lp_gainc ), 13107, tmp ); -#else - *lp_gainc = mac_r( L_deposit_h( *lp_gainc ), 13107, tmp ); -#endif move16(); /*Q3*/ } } @@ -1488,11 +1432,7 @@ void lp_gain_updt_fx( { *lp_gainp = add( *lp_gainp, mult( 10923, gain_pit ) ); move16(); /*Q14 (5.0/15.0 in Q15 = 10923)*/ -#ifdef BASOP_NOGLOB *lp_gainc = mac_r_sat( L_deposit_h( *lp_gainc ), 10923, tmp ); -#else - *lp_gainc = mac_r( L_deposit_h( *lp_gainc ), 10923, tmp ); -#endif move16(); /*Q3*/ } } @@ -1538,11 +1478,7 @@ void lp_gain_updt_ivas_fx( { Word16 tmp; -#ifdef BASOP_NOGLOB tmp = extract_h( L_shl_sat( norm_gain_code, 3 ) ); /*(16+3)-16 -> Q3*/ -#else - tmp = extract_h( L_shl( norm_gain_code, 3 ) ); /*(16+3)-16 -> Q3*/ -#endif /* To handle extremely low values */ test(); if ( norm_gain_code != 0 && tmp == 0 ) @@ -1578,11 +1514,7 @@ void lp_gain_updt_ivas_fx( { *lp_gainp = add( *lp_gainp, mult( 13107, gain_pit ) ); move16(); /*Q14 (0.4 in Q15 = 13107)*/ -#ifdef BASOP_NOGLOB *lp_gainc = mac_r_sat( L_deposit_h( *lp_gainc ), 13107, tmp ); -#else - *lp_gainc = mac_r( L_deposit_h( *lp_gainc ), 13107, tmp ); -#endif move16(); /*Q3*/ } } @@ -1620,11 +1552,7 @@ void lp_gain_updt_ivas_fx( { *lp_gainp = add( *lp_gainp, mult( 10923, gain_pit ) ); move16(); /*Q14 (5.0/15.0 in Q15 = 10923)*/ -#ifdef BASOP_NOGLOB *lp_gainc = mac_r_sat( L_deposit_h( *lp_gainc ), 10923, tmp ); -#else - *lp_gainc = mac_r( L_deposit_h( *lp_gainc ), 10923, tmp ); -#endif move16(); /*Q3*/ } } @@ -1691,24 +1619,14 @@ Word32 gain_dec_gaus_fx( /* o : quantized codebook expg = add( expg, 16 - 30 ); /* output of Pow2() will be */ /* Normalized, set result in Q16 */ gain = round_fx( L_gain ); -#ifdef BASOP_NOGLOB L_gain = L_shl_sat( L_gain, expg ); /* In Q16*/ -#else - L_gain = L_shl( L_gain, expg ); /* In Q16*/ -#endif /* *norm_gain_code = gain / *inv_gain_inov;*/ expi = norm_s( inv_gain_inov ); tmp_igi = shl( inv_gain_inov, expi ); L_tmp = div_s( shr( gain, 1 ), tmp_igi ); -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, add( 1, expi ) ); *L_norm_gain_code = L_shl_sat( L_tmp, add( expg, 13 ) ); /* Q16 */ move32(); -#else - L_tmp = L_shl( L_tmp, add( 1, expi ) ); - *L_norm_gain_code = L_shl( L_tmp, add( expg, 13 ) ); /* Q16 */ - move32(); -#endif return L_gain; } @@ -1805,11 +1723,7 @@ void gain_dec_SQ_fx( /**gain_code *= gcode0;*/ L_tmp = L_mult( tmp16, gcode0 ); /* Q0*Q0 -> Q1*/ /**gain_code = L_shl(L_tmp,add(expg,15)); Q16*/ -#ifdef BASOP_NOGLOB *gain_code = L_shl_sat( L_tmp, add( add( expg, exp_gcode0 ), 15 ) ); /*Q16*/ -#else - *gain_code = L_shl( L_tmp, add( add( expg, exp_gcode0 ), 15 ) ); -#endif move32(); /**norm_gain_code = *gain_code / *gain_inov;*/ @@ -1934,11 +1848,7 @@ void gain_dec_amr_wb_fx( /* adjust gain according to energy of code */ L_tmp = Mult_32_16( *gain_code, *gain_inov ); -#ifdef BASOP_NOGLOB *gain_code = L_shl_o( L_tmp, 3, &Overflow ); /* gcode_inov in Q12*/ -#else - *gain_code = L_shl( L_tmp, 3 ); -#endif move32(); /*-----------------------------------------------------------------* diff --git a/lib_dec/gs_dec_amr_wb_fx.c b/lib_dec/gs_dec_amr_wb_fx.c index a4aef88dd..f55eef3db 100644 --- a/lib_dec/gs_dec_amr_wb_fx.c +++ b/lib_dec/gs_dec_amr_wb_fx.c @@ -111,11 +111,7 @@ static void Ener_per_band_fx( IF( L_temp != 0 ) /* avoid executing sqrt of 0 (because a div_s is used to invert and then call inv_sqrt) */ { L_temp2 = Sqrt_Ratio32( L_temp, exp, 1, 0, &i ); -#ifdef BASOP_NOGLOB L_temp2 = L_shr_sat( L_temp2, sub( 15 - ENER_FX_Q_GUARD, i ) ); /* Q16 */ -#else - L_temp2 = L_shr( L_temp2, sub( 15 - ENER_FX_Q_GUARD, i ) ); -#endif } y_gain4_fx[j] = L_temp2; /* Q16 */ move32(); @@ -156,11 +152,7 @@ static void Apply_gain_fx( EndBin = add( CurBin, crit_bins[i_band] ); /* Q0 */ y_gain_exp = norm_l( L_Ener_per_bd_yQ[i_band] ); exp3 = norm_l( L_Ener_per_bd_iQ[i_band] ); /* use 'exp3' as temporary exponent of 'L_Ener_per_bd_iQ[]' */ -#ifdef BASOP_NOGLOB y_gain_fx = round_fx_sat( Div_flt32_flt32( L_shl_sat( L_Ener_per_bd_iQ[i_band], exp3 ), exp3, L_shl_sat( L_Ener_per_bd_yQ[i_band], y_gain_exp ), y_gain_exp, &y_gain_exp ) ); /* y_gain_exp - 31 + Q_out */ -#else - y_gain_fx = round_fx( Div_flt32_flt32( L_shl( L_Ener_per_bd_iQ[i_band], exp3 ), exp3, L_shl( L_Ener_per_bd_yQ[i_band], y_gain_exp ), y_gain_exp, &y_gain_exp ) ); -#endif y_gain_exp = add( sub( y_gain_exp, 31 ), Q_out ); exp3 = sub( y_gain_exp, 16 - 1 ); @@ -204,11 +196,7 @@ static void normalize_spec_fx( temp = Invert16( abs_s( fy_norm_fx[idx] ), &exp ); /* Q15 + exp */ L_temp = L_mult( temp, fac_up_fx ); /* Q15 + exp + Q8 + 1 */ exp = sub( 15, exp ); -#ifdef BASOP_NOGLOB L_temp = L_shl_sat( L_temp, exp ); /* Q24 + Q_out */ -#else - L_temp = L_shl( L_temp, exp ); -#endif FOR( j = 0; j < L_frame; j++ ) { fy_norm_fx[j] = round_fx( Mult_32_16( L_temp, fy_norm_fx[j] ) ); /* Q_out */ @@ -264,11 +252,7 @@ static void gs_dec_amr_wb_fx( move16(); FOR( i = 0; i < CRIT_NOIS_BAND; i++ ) { -#ifdef BASOP_NOGLOB temp = s_max( round_fx_sat( Ener_per_bd_iQ_fx[i] ), temp ); /* Q0 */ -#else - temp = s_max( round_fx( Ener_per_bd_iQ_fx[i] ), temp ); -#endif } test(); @@ -487,11 +471,7 @@ void improv_amr_wb_gs_fx( FOR( i = 0; i < NB_SUBFR; i++ ) { -#ifdef BASOP_NOGLOB enr_LP_new = Enr_1_Az_fx_o( Aq_fx + imult1616( i, ( M + 1 ) ), L_SUBFR, &Overflow ); /* Q3 */ -#else - enr_LP_new = Enr_1_Az_fx( Aq_fx + i * ( M + 1 ), L_SUBFR ); -#endif test(); IF( GT_16( shr( enr_LP_new, 7 ), enr_LP_old ) || Overflow ) { diff --git a/lib_dec/hf_synth_fx.c b/lib_dec/hf_synth_fx.c index e931ae229..2c25612cb 100644 --- a/lib_dec/hf_synth_fx.c +++ b/lib_dec/hf_synth_fx.c @@ -209,11 +209,7 @@ static void hf_synthesis_fx( L_tmp = L_mac( 1L, synth[0], synth[0] ); /* 2*(Q_syn-3)+1 */ FOR( i = 1; i < L_SUBFR; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac_sat( L_tmp, synth[i], synth[i] ); /* 2*(Q_syn-3)+1 */ -#else - L_tmp = L_mac( L_tmp, synth[i], synth[i] ); -#endif } tmp = norm_l( L_tmp ); ener = extract_h( L_shl( L_tmp, tmp ) ); /* ener = r[0] */ @@ -222,11 +218,7 @@ static void hf_synthesis_fx( L_tmp = L_mac( 1L, synth[1], synth[0] ); /* 2*(Q_syn-3)+1 */ FOR( i = 2; i < L_SUBFR; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac_sat( L_tmp, synth[i], synth[i - 1] ); /* 2*(Q_syn-3)+1 */ -#else - L_tmp = L_mac( L_tmp, synth[i], synth[i - 1] ); -#endif } tmp = extract_h( L_shl( L_tmp, tmp ) ); /* tmp = r[1] */ /*tmp in Q = 2*(Q_syn-3)+1 = Q-5 when Q_syn=0 */ @@ -245,21 +237,13 @@ static void hf_synthesis_fx( *-----------------------------------------------------------------*/ /* tmp = 1.0 - fac */ -#ifdef BASOP_NOGLOB tmp = add_o( 1, sub( 32767 /* 1 in Q15 */, tmp ), &Overflow ); -#else - tmp = add( 1, sub( 32767, tmp ) ); -#endif test(); if ( core_brate == FRAME_NO_DATA || EQ_32( core_brate, SID_2k40 ) ) { /* emphasize HF noise in CNG */ /*fac *= 2.0f;*/ -#ifdef BASOP_NOGLOB tmp = add_o( tmp, tmp, &Overflow ); /* Q15 */ -#else - tmp = add( tmp, tmp ); -#endif } tmp = s_max( tmp, 3277 ); /* 0.1 in Q15 */ @@ -380,19 +364,11 @@ static void filt_6k_7k_scale_fx( move32(); FOR( j = 0; j < 31; j++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac_o( L_tmp, x[i + j], fir_6k_7k_fx[j], &Overflow ); /* Q16 */ -#else - L_tmp = L_mac( L_tmp, x[i + j], fir_6k_7k_fx[j] ); -#endif } -#ifdef BASOP_NOGLOB signal[i] = round_fx_o( L_tmp, &Overflow ); /* Q0 */ move16(); -#else - signal[i] = round_fx( L_tmp ); -#endif } Copy( x + lg, mem, L_FIR - 1 ); /* Qx - 2 */ } @@ -630,11 +606,7 @@ void hf_synth_amr_wb_fx( fmerit_w = shr( fmerit_w, 1 ); /* Q14 */ } -#ifdef BASOP_NOGLOB L_tmp = L_mult( fmerit_w, add_sat( 16384, voice_fac ) ); /* Q14 */ -#else - L_tmp = L_mult( fmerit_w, add( 16384, voice_fac ) ); -#endif fmerit_w = extract_l( L_shr( L_tmp, 15 ) ); /*Q14 */ /**fmerit_w_sm = add(mult_r(*fmerit_w_sm, 29491), mult_r(fmerit_w, 3277)); //Q14 */ hAmrwb_IO->fmerit_w_sm_fx = round_fx( L_mac( L_mult( hAmrwb_IO->fmerit_w_sm_fx, 29491 ), fmerit_w, 3277 ) ); /*Q14 */ @@ -775,11 +747,7 @@ void hf_synth_amr_wb_fx( pt4 = &dct_hb[240]; FOR( j = 0; j < fn; j++ ) { -#ifdef BASOP_NOGLOB tmp = add_sat( tmp, shr( *pt4++, 2 ) ); /*qdct-2 */ -#else - tmp = add( tmp, shr( *pt4++, 2 ) ); /*qdct-2 */ -#endif } *pt1 = round_fx( L_shl( L_mult( tmp, tmp1 ), 2 ) ); /*qdct */ move16(); @@ -802,11 +770,7 @@ void hf_synth_amr_wb_fx( pt4 = &dct_hb[fb + 240]; FOR( j = fb; j < fn; j++ ) { -#ifdef BASOP_NOGLOB tmp = add_sat( tmp, shr( *pt4++, 2 ) ); /*qdct-2 */ -#else - tmp = add( tmp, shr( *pt4++, 2 ) ); /*qdct-2 */ -#endif } *pt1 = mult_r( tmp, 8738 ); move16(); /* 8738 = 1/15 in Q17 qdct */ @@ -814,11 +778,7 @@ void hf_synth_amr_wb_fx( move16(); IF( *pt2 > 0 ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac0_sat( L_tmp, shr( *pt2, 1 ), shr( *pt2, 1 ) ); /*2*qdct-2 */ -#else - L_tmp = L_mac0( L_tmp, shr( *pt2, 1 ), shr( *pt2, 1 ) ); -#endif } pt1++; pt2++; @@ -834,11 +794,7 @@ void hf_synth_amr_wb_fx( pt4 = &dct_hb[fb + 240]; FOR( j = fb; j < L_SUBFR16k; j++ ) { -#ifdef BASOP_NOGLOB tmp = add_sat( tmp, shr( *pt4++, 2 ) ); /*qdct-2 */ -#else - tmp = add( tmp, shr( *pt4++, 2 ) ); /*qdct-2 */ -#endif } *pt1 = round_fx( L_shl( L_mult( tmp, tmp1 ), 2 ) ); /*qdct */ move16(); @@ -846,11 +802,7 @@ void hf_synth_amr_wb_fx( move16(); IF( *pt2 > 0 ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac0_sat( L_tmp, shr( *pt2, 1 ), shr( *pt2, 1 ) ); /*2*qdct-2 */ -#else - L_tmp = L_mac0( L_tmp, shr( *pt2, 1 ), shr( *pt2, 1 ) ); /*2*qdct-2 */ -#endif } pt1++; pt2++; @@ -878,15 +830,10 @@ void hf_synth_amr_wb_fx( *pt1 = mult_r( *pt1, g ); /*qdct */ move16(); } -#ifdef BASOP_NOGLOB *pt2 = round_fx_sat( L_shl_sat( L_mult( *pt2, inv_g ), 3 ) ); /*qdct */ move16(); *pt3 = add_sat( *pt1, *pt2 ); move16(); -#else - *pt2 = round_fx( L_shl( L_mult( *pt2, inv_g ), 3 ) ); /*qdct */ - *pt3 = add( *pt1, *pt2 ); -#endif *pt3 = extract_l( L_mult0( *pt3, *pt4 ) ); /*qdct */ move16(); pt1++; @@ -900,11 +847,7 @@ void hf_synth_amr_wb_fx( L_tmp = L_mult( ener, scale ); /*30-q1+q2 */ q2 = sub( q1, q2 ); /*30-q2 */ scale = round_fx( Isqrt( L_shl( L_tmp, sub( q2, 24 ) ) ) ); /*Q12 */ -#ifdef BASOP_NOGLOB scale = round_fx_sat( L_shl_sat( L_mult( scale, gamma ), 4 ) ); /*Q15 */ -#else - scale = round_fx( L_shl( L_mult( scale, gamma ), 4 ) ); /*Q15 */ -#endif } ELSE { @@ -1041,40 +984,24 @@ void hf_synth_amr_wb_fx( shift = norm_l( L_tmp ); L_tmp = L_shl( L_tmp, shift ); /*Q(q3+shift); */ q3 = add( q3, shift ); -#ifdef BASOP_NOGLOB scale = round_fx_sat( L_tmp ); /*Q(q3-16); */ -#else - scale = round_fx( L_tmp ); /*Q(q3-16); */ -#endif q3 = sub( q3, 16 ); scale = div_s( shl( 1, 14 ), scale ); /*Q(29-q3) */ L_tmp = L_mult( scale, ener ); /*Q(29-q3+q1+1) */ shift = norm_l( L_tmp ); L_tmp = L_shl( L_tmp, shift ); /*Q(29-q3+q1+1+shift) */ -#ifdef BASOP_NOGLOB scale = round_fx_sat( L_tmp ); /*Q(29-q3+q1+1+shift-16) */ -#else - scale = round_fx( L_tmp ); /*Q(29-q3+q1+1+shift-16) */ -#endif L_tmp = L_mult( scale, e_subfr2 ); /*Q(29-q3+q1+1+shift-16+q4+1)=Q(15+q1-q3+q4+shift) */ q3 = sub( 15, q3 ); q3 = add( q3, q1 ); q3 = add( q3, shift ); q3 = add( q3, q4 ); -#ifdef BASOP_NOGLOB scale = round_fx_sat( Isqrt( L_shl_sat( L_tmp, sub( 6, q3 ) ) ) ); /*Q12 */ -#else - scale = round_fx( Isqrt( L_shl( L_tmp, sub( 6, q3 ) ) ) ); /*Q12 */ -#endif pt6 += L_SUBFR; FOR( j = 0; j < L_SUBFR16k; j++ ) { -#ifdef BASOP_NOGLOB *pt2 = round_fx_sat( L_shl_sat( L_mult( *pt2, scale ), 2 ) ); /*qhf-1 */ move16(); -#else - *pt2 = round_fx( L_shl( L_mult( *pt2, scale ), 2 ) ); /*qhf-1 */ -#endif pt2++; } } @@ -1144,11 +1071,7 @@ static void hf_synthesis_amr_wb_fx( scale = div_s( shl( 1, 14 ), ener ); /*Q(29-q1) */ L_tmp = L_mult( tmp, scale ); /*30-q1+q2 */ q2 = sub( q1, q2 ); /*30-q2 */ -#ifdef BASOP_NOGLOB scale = round_fx_sat( Isqrt( L_shl_sat( L_tmp, sub( q2, 24 ) ) ) ); /*Q12 */ -#else - scale = round_fx( Isqrt( L_shl( L_tmp, sub( q2, 24 ) ) ) ); /*Q12 */ -#endif pt1 = exc16k; pt2 = exc2385; FOR( i = 0; i < L_SUBFR16k; i++ ) @@ -1180,11 +1103,7 @@ static void hf_synthesis_amr_wb_fx( scale = div_s( shl( 1, 14 ), ener ); /*Q(29-q1) */ L_tmp = L_mult( tmp, scale ); /*30-q1+q2 */ q2 = sub( q1, q2 ); /*30-q2 */ -#ifdef BASOP_NOGLOB scale = round_fx_sat( Isqrt( L_shl_sat( L_tmp, sub( q2, 24 ) ) ) ); /*Q12 */ -#else - scale = round_fx( Isqrt( L_shl( L_tmp, sub( q2, 24 ) ) ) ); /*Q12 */ -#endif flag = negate( s_and( til, -0x8000 ) ); if ( GT_16( scale, 4096 /* 1.0f in Q12 */ ) ) { @@ -1287,9 +1206,7 @@ static Word16 EnhanceClass_fx( Word16 unvoicing_tmp_fx; Word16 tmp, tmp1; Word32 L_tmp; -#ifdef BASOP_NOGLOB Flag Overflow; -#endif /* Decide (*unvoicing_flag) to allow BWE enhancement when qq>pp */ @@ -1327,21 +1244,13 @@ static Word16 EnhanceClass_fx( move16(); } -#ifdef BASOP_NOGLOB if ( GT_16( sub_o( *unvoicing_fx, *unvoicing_sm_fx, &Overflow ), 3277 /* 0.1 in Q15 */ ) ) -#else - if ( GT_16( sub( *unvoicing_fx, *unvoicing_sm_fx ), 3277 ) ) -#endif { *unvoicing_flag = 1; move16(); } -#ifdef BASOP_NOGLOB if ( LT_16( sub_o( *unvoicing_fx, *unvoicing_sm_fx, &Overflow ), 1638 /* 0.05 in Q15 */ ) ) -#else - if ( LT_16( sub( *unvoicing_fx, *unvoicing_sm_fx ), 1638 ) ) -#endif { *unvoicing_flag = 0; move16(); @@ -1437,11 +1346,7 @@ static void envelope_fx( pt3 = exp_tab_q_fx; /* Q14 */ FOR( i = 0; i <= M; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac_sat( L_tmp, *pt2++, *pt3++ ); /* Q27 */ -#else - L_tmp = L_mac( L_tmp, *pt2++, *pt3++ ); -#endif } q2 = norm_l( L_tmp ); L_tmp = L_shl( L_tmp, q2 ); /*Q(27+q2)*/ @@ -1452,11 +1357,7 @@ static void envelope_fx( pt3 = exp_tab_q_fx + 33; /* Q14 */ FOR( i = 0; i <= M; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac_sat( L_tmp, *pt2++, *pt3-- ); /* Q14 */ -#else - L_tmp = L_mac( L_tmp, *pt2++, *pt3-- ); -#endif } q3 = norm_l( L_tmp ); shift = sub( q2, q3 ); @@ -1475,18 +1376,10 @@ static void envelope_fx( L_tmp = L_mult( px, px ); L_tmp = L_mac( L_tmp, py, py ); /*Q(21+2*q1)*/ -#ifdef BASOP_NOGLOB pp = round_fx_sat( Isqrt( L_shr( L_tmp, add( 11, shl( q1, 1 ) ) ) ) ); /*Q10*/ -#else - pp = round_fx( Isqrt( L_shr( L_tmp, add( 11, shl( q1, 1 ) ) ) ) ); /*Q10*/ -#endif L_tmp = L_mult( rx, rx ); L_tmp = L_mac( L_tmp, ry, ry ); /*Q(21+2*q1)*/ -#ifdef BASOP_NOGLOB rr = round_fx_sat( Isqrt( L_shr( L_tmp, add( 11, shl( q2, 1 ) ) ) ) ); /*Q10*/ -#else - rr = round_fx( Isqrt( L_shr( L_tmp, add( 11, shl( q2, 1 ) ) ) ) ); /*Q10*/ -#endif Copy( Aq, As, 3 ); IF( EQ_16( shr( As[2], 1 ), -2048 /* -1.0f in Q11 */ ) ) { @@ -1517,11 +1410,7 @@ static void envelope_fx( L_tmp = L_mult( As[1], tmp ); /*Q(42-q1) */ q1 = sub( q1, 14 ); -#ifdef BASOP_NOGLOB k1 = round_fx_sat( L_shl_sat( L_tmp, q1 ) ); /*Q12 */ -#else - k1 = round_fx( L_shl( L_tmp, q1 ) ); /*Q12 */ -#endif k2 = As[2]; move16(); /*Q12 */ if ( GT_16( k2, 2458 /* 0.6f in Q12 */ ) ) @@ -1599,11 +1488,7 @@ static void envelope_fx( { IF( GT_16( rr, ( hAmrwb_IO->prev_r_fx ) ) ) { -#ifdef BASOP_NOGLOB rr = shr( add_sat( rr, ( hAmrwb_IO->prev_r_fx ) ), 1 ); -#else - rr = shr( add( rr, ( hAmrwb_IO->prev_r_fx ) ), 1 ); -#endif } hAmrwb_IO->prev_r_fx = rr; @@ -1618,11 +1503,7 @@ static void envelope_fx( L_tmp = L_mult( tilt, sub( 26214 /* 1.6f in Q14 */, shr( voice_factor, 1 ) ) ); /*Q28*/ L_tmp = L_max( L_tmp, 268435456 /* 1 in Q28 */ ); L_tmp = Mult_32_16( L_tmp, qq ); /*Q23*/ -#ifdef BASOP_NOGLOB qq = round_fx_sat( L_shl_sat( L_tmp, 3 ) ); /*Q10*/ -#else - qq = round_fx( L_shl( L_tmp, 3 ) ); /*Q10*/ -#endif rr = s_min( rr, qq ); /* Q10 */ rr = s_max( rr, pp ); /* Q10 */ } @@ -1637,11 +1518,7 @@ static void envelope_fx( alpha = round_fx( L_shl( L_tmp, 9 ) ); /*Q14*/ L_tmp = L_mult( alpha, ( hAmrwb_IO->prev_r_fx ) ); /*Q25*/ L_tmp = L_mac( L_tmp, tmp, rr ); /*Q25*/ -#ifdef BASOP_NOGLOB rr = round_fx_sat( L_shl_sat( L_tmp, 1 ) ); /*Q10*/ -#else - rr = round_fx( L_shl( L_tmp, 1 ) ); /*Q10*/ -#endif } hAmrwb_IO->prev_r_fx = rr; @@ -1671,12 +1548,8 @@ static void envelope_fx( tmp = div_s( shl( 1, sub( 14, q1 ) ), pp ); /*Q(29-q1-10) */ L_tmp = L_mult( rr, tmp ); /*Q(30-q1-10+10) */ -#ifdef BASOP_NOGLOB *sub_gain = s_min( 20480 /* 5.0f in Q12 */, round_fx_sat( L_shl_sat( L_tmp, sub( q1, 2 ) ) ) ); /*Q12 */ move16(); -#else - *sub_gain = s_min( 20480, round_fx( L_shl( L_tmp, sub( q1, 2 ) ) ) ); /*Q12 */ -#endif return; } diff --git a/lib_dec/hq_core_dec_fx.c b/lib_dec/hq_core_dec_fx.c index 010dd9106..dabd555a5 100644 --- a/lib_dec/hq_core_dec_fx.c +++ b/lib_dec/hq_core_dec_fx.c @@ -257,11 +257,7 @@ void hq_core_dec_fx( { /*t_audio_q[i] *= ener_match;*/ Mpy_32_16_ss( t_audio_q[i], ener_match, &L_tmp, &lsb ); /*12+13-15=10 */ -#ifdef BASOP_NOGLOB t_audio_q[i] = L_add_sat( L_shl_sat( L_tmp, 2 ), L_shr( lsb, 14 ) ); -#else - t_audio_q[i] = L_add( L_shl( L_tmp, 2 ), lshr( lsb, 14 ) ); -#endif move16(); /* Q12 */ } } @@ -497,13 +493,8 @@ void hq_core_dec_fx( test(); IF( !st_fx->bfi && st_fx->prev_bfi && GE_32( st_fx->last_total_brate, HQ_48k ) && EQ_16( st_fx->last_codec_mode, MODE2 ) && ( EQ_16( st_fx->last_core_bfi, TCX_20_CORE ) || EQ_16( st_fx->last_core_bfi, TCX_10_CORE ) ) && st_fx->plcInfo.concealment_method == TCX_NONTONAL && LT_32( st_fx->plcInfo.nbLostCmpt, 4 ) ) { -#ifdef BASOP_NOGLOB st_fx->plcInfo.recovery_gain = shl_sat( st_fx->plcInfo.recovery_gain, *Q_synth ); /* Q14 + Q_synth */ move16(); -#else - st_fx->plcInfo.recovery_gain = shl( st_fx->plcInfo.recovery_gain, *Q_synth ); - move16(); -#endif IF( st_fx->tonalMDCTconceal.q_lastPcmOut != 0 ) { Scale_sig( st_fx->tonalMDCTconceal.secondLastPcmOut, shr( st_fx->plcInfo.FrameSize, 1 ), negate( st_fx->tonalMDCTconceal.q_lastPcmOut ) ); @@ -859,11 +850,7 @@ void ivas_hq_core_dec_fx( { /*t_audio_q[i] *= ener_match;*/ Mpy_32_16_ss( t_audio_q[i], ener_match, &L_tmp, &lsb ); /*12+13-15=10 */ -#ifdef BASOP_NOGLOB t_audio_q[i] = L_add_sat( L_shl_sat( L_tmp, 2 ), lshr( (Word16) lsb, 14 ) ); -#else - t_audio_q[i] = L_add( L_shl( L_tmp, 2 ), lshr( (Word16) lsb, 14 ) ); -#endif move16(); /* Q12 */ } } @@ -1138,11 +1125,7 @@ void ivas_hq_core_dec_fx( test(); IF( !st_fx->bfi && st_fx->prev_bfi && GE_32( st_fx->last_total_brate, HQ_48k ) && EQ_16( st_fx->last_codec_mode, MODE2 ) && ( EQ_16( st_fx->last_core_bfi, TCX_20_CORE ) || EQ_16( st_fx->last_core_bfi, TCX_10_CORE ) ) && EQ_16( st_fx->plcInfo.concealment_method, TCX_NONTONAL ) && LT_32( st_fx->plcInfo.nbLostCmpt, 4 ) ) { -#ifdef BASOP_NOGLOB st_fx->plcInfo.recovery_gain = shl_sat( st_fx->plcInfo.recovery_gain, *Q_synth ); /* Q15 */ -#else - st_fx->plcInfo.recovery_gain = shl( st_fx->plcInfo.recovery_gain, *Q_synth ); -#endif move16(); IF( st_fx->tonalMDCTconceal.q_lastPcmOut != 0 ) { diff --git a/lib_dec/hq_hr_dec_fx.c b/lib_dec/hq_hr_dec_fx.c index 02d58f7bf..f96b8f597 100644 --- a/lib_dec/hq_hr_dec_fx.c +++ b/lib_dec/hq_hr_dec_fx.c @@ -90,11 +90,7 @@ void hq_pred_hb_bws_fx( L_tmp = L_deposit_l( 0 ); FOR( i = 25; i < SFM_N_HARM; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_add_sat( L_tmp, dicn_fx[ynrm[i]] ); /*Q14*/ -#else - L_tmp = L_add( L_tmp, dicn_fx[ynrm[i]] ); /*Q14*/ -#endif } L_tmp = L_min( 8191, L_shr( L_tmp, 13 ) ); /* Q1 */ st_fx->prev_ener_shb_fx = extract_l( L_tmp ); /*Q1*/ diff --git a/lib_dec/hq_lr_dec_fx.c b/lib_dec/hq_lr_dec_fx.c index cf7aee8f0..ffcdab457 100644 --- a/lib_dec/hq_lr_dec_fx.c +++ b/lib_dec/hq_lr_dec_fx.c @@ -343,12 +343,8 @@ void hq_lr_dec_fx( frac1 = L_Extract_lc( L_tmp, &exp ); /* Extract exponent of L_tmp */ L_tmp = Pow2( 30, frac1 ); exp = sub( exp, 30 ); -#ifdef BASOP_NOGLOB Ep_fx[i] = L_shl_sat( L_tmp, s_max( sub( exp, 6 ), -31 ) ); /* Q -6 */ move32(); -#else - Ep_fx[i] = L_shl( L_tmp, s_max( sub( exp, 6 ), -31 ) ); /* Q -6 */ -#endif } FOR( i = 0; i < bands_fx; i++ ) @@ -428,21 +424,12 @@ void hq_lr_dec_fx( { IF( GE_16( i, lowband ) ) { -#ifdef BASOP_NOGLOB Ep_vari_fx = L_add_sat( Ep_vari_fx, L_abs( L_sub_sat( Ep_tmp_fx[i], Ep_tmp_fx[i - 1] ) ) ); /*Q15 */ Ep_avrg_fx = L_add_sat( Ep_avrg_fx, Ep_tmp_fx[i] ); /*Q15 */ -#else - Ep_vari_fx = L_add( Ep_vari_fx, L_abs( L_sub( Ep_tmp_fx[i], Ep_tmp_fx[i - 1] ) ) ); /*Q15 */ - Ep_avrg_fx = L_add( Ep_avrg_fx, Ep_tmp_fx[i] ); /*Q15 */ -#endif } ELSE { -#ifdef BASOP_NOGLOB Ep_avrgL_fx = L_add_sat( Ep_avrgL_fx, Ep_tmp_fx[i] ); /*Q15 */ -#else - Ep_avrgL_fx = L_add( Ep_avrgL_fx, Ep_tmp_fx[i] ); /*Q15 */ -#endif if ( GT_32( Ep_tmp_fx[i], Ep_peak_fx ) ) { Ep_peak_fx = L_add( Ep_tmp_fx[i], 0 ); /*Q15 */ @@ -515,13 +502,8 @@ void hq_lr_dec_fx( IF( EQ_16( last_bitalloc_max_band[j++], 1 ) ) { L_tmp = Mult_32_16( Ep_tmp_fx[i], sub( bands_fx, lowband ) ); /*Q(13+0-15 = -2) */ -#ifdef BASOP_NOGLOB tmp = Calc_inv( L_shl_sat( L_tmp, 14 ), &exp ); L_tmp = L_shl_sat( Mult_32_16( Ep_avrg_fx, tmp ), sub( 14, exp ) ); /*Q(13+exp-15 +14-exp+2 = 14) */ -#else - tmp = Calc_inv( L_shl( L_tmp, 14 ), &exp ); - L_tmp = L_shl( Mult_32_16( Ep_avrg_fx, tmp ), sub( 14, exp ) ); /*Q(13+exp-15 +14-exp+2 = 14) */ -#endif L_tmp = L_max( L_tmp, 16384 ); /*14 */ tmp = extract_l( L_min( L_tmp, beta_fx ) ); /*14 */ alpha_fx = shl( mult( alpha_fx, tmp ), 1 ); /*14+14-15 +1=14 */ @@ -563,11 +545,7 @@ void hq_lr_dec_fx( { IF( GE_16( i, lowband ) ) { -#ifdef BASOP_NOGLOB Ep_avrg_fx = L_add_sat( Ep_avrg_fx, Ep_tmp_fx[i] ); /*Q15 */ -#else - Ep_avrg_fx = L_add( Ep_avrg_fx, Ep_tmp_fx[i] ); /*Q15 */ -#endif } ELSE { @@ -614,11 +592,7 @@ void hq_lr_dec_fx( } FOR( i = 0; i < bands_fx; i++ ) { -#ifdef BASOP_NOGLOB Ep_tmp_fx[i] = L_shl_sat( Ep_tmp_fx[i], 2 ); /* Q15 */ -#else - Ep_tmp_fx[i] = L_shl( Ep_tmp_fx[i], 2 ); -#endif move32(); } IF( EQ_32( st_fx->core_brate, ACELP_13k20 ) ) @@ -649,30 +623,17 @@ void hq_lr_dec_fx( test(); IF( GE_16( i, lowband ) && add( sub( i, bands_fx ), p2a_bands_fx ) < 0 ) { -#ifdef BASOP_NOGLOB Ep_vari_fx = L_add_sat( Ep_vari_fx, L_abs( L_sub( Ep_tmp_fx[i], Ep_tmp_fx[i - 1] ) ) ); /*Q15 */ Ep_avrg_fx = L_add_sat( Ep_avrg_fx, Ep_tmp_fx[i] ); /*Q15 */ -#else - Ep_vari_fx = L_add( Ep_vari_fx, L_abs( L_sub( Ep_tmp_fx[i], Ep_tmp_fx[i - 1] ) ) ); /*Q15 */ - Ep_avrg_fx = L_add( Ep_avrg_fx, Ep_tmp_fx[i] ); /*Q15 */ -#endif } IF( GE_16( i, highband ) ) { -#ifdef BASOP_NOGLOB enerH_fx = L_add_sat( enerH_fx, L_shl_sat( Ep_fx[i], 2 ) ); /*Q0 */ -#else - enerH_fx = L_add( enerH_fx, L_shl( Ep_fx[i], 2 ) ); /*Q0 */ -#endif } ELSE IF( GE_16( i, lowband ) ) { -#ifdef BASOP_NOGLOB enerL_fx = L_add_sat( enerL_fx, L_shl_sat( Ep_fx[i], 2 ) ); /*Q0 */ -#else - enerL_fx = L_add( enerL_fx, L_shl( Ep_fx[i], 2 ) ); /*Q0 */ -#endif } } @@ -693,11 +654,7 @@ void hq_lr_dec_fx( tmp = sub( bands_fx, p2a_bands_fx ); tmp = sub( tmp, lowband ); /*Q0 */ -#ifdef BASOP_NOGLOB tmp1 = extract_h( L_shl_sat( Ep_avrg_fx, 1 ) ); /*Q0 */ -#else - tmp1 = extract_h( L_shl( Ep_avrg_fx, 1 ) ); /*Q0 */ -#endif IF( tmp1 != 0 ) { exp = norm_s( tmp1 ); @@ -738,11 +695,7 @@ void hq_lr_dec_fx( { tmp = sub( tmp, lowband ); L_tmp = Mult_32_16( Ep_tmp_fx[i], tmp ); /*Q(15+0-15 = 0) */ -#ifdef BASOP_NOGLOB tmp = Calc_inv( L_shl_sat( L_tmp, 16 ), &exp ); -#else - tmp = Calc_inv( L_shl( L_tmp, 16 ), &exp ); -#endif L_tmp = Mult_32_16( Ep_avrg_fx, tmp ); /*Q(15+exp-15 = exp) */ L_tmp = L_shl( L_tmp, sub( 14, exp ) ); /*Q14 */ tmp = extract_l( L_min( L_max( L_tmp, 16384 ), 20480 ) ); /*Q14 */ @@ -753,11 +706,7 @@ void hq_lr_dec_fx( { tmp = sub( tmp, lowband ); -#ifdef BASOP_NOGLOB tmp1 = extract_h( L_shl_sat( Ep_avrg_fx, 1 ) ); /*Q0 */ -#else - tmp1 = extract_h( L_shl( Ep_avrg_fx, 1 ) ); /*Q0 */ -#endif IF( tmp1 != 0 ) { exp = norm_s( tmp1 ); @@ -794,19 +743,11 @@ void hq_lr_dec_fx( { IF( GE_16( i, lowband ) ) { -#ifdef BASOP_NOGLOB Ep_avrg_fx = L_add_sat( Ep_avrg_fx, Ep_tmp_fx[i] ); /*Q15 */ -#else - Ep_avrg_fx = L_add( Ep_avrg_fx, Ep_tmp_fx[i] ); /*Q15 */ -#endif } ELSE { -#ifdef BASOP_NOGLOB Ep_avrgL_fx = L_add_sat( Ep_avrgL_fx, Ep_tmp_fx[i] ); /*Q15 */ -#else - Ep_avrgL_fx = L_add( Ep_avrgL_fx, Ep_tmp_fx[i] ); /*Q15 */ -#endif if ( GT_32( Ep_tmp_fx[i], Ep_peak_fx ) ) { Ep_peak_fx = L_add( Ep_tmp_fx[i], 0 ); /*Q15 */ @@ -831,11 +772,7 @@ void hq_lr_dec_fx( move16(); FOR( i = 0; i < lowband; i++ ) { -#ifdef BASOP_NOGLOB tmp = Calc_inv( L_shl_sat( Ep_avrgL_fx, 1 ), &exp ); -#else - tmp = Calc_inv( L_shl( Ep_avrgL_fx, 1 ), &exp ); -#endif L_tmp = Mult_32_16( Ep_peak_fx, tmp ); /*Q(15+exp-15 = exp) */ L_tmp = Mult_32_16( L_tmp, lowband ); /*Q(exp+0-15 = exp-15) */ L_tmp = L_shl( L_tmp, sub( 28, exp ) ); /*Q14 0.5 */ diff --git a/lib_dec/igf_dec_fx.c b/lib_dec/igf_dec_fx.c index 7dd389164..eb833a883 100644 --- a/lib_dec/igf_dec_fx.c +++ b/lib_dec/igf_dec_fx.c @@ -1570,16 +1570,10 @@ static void IGF_appl( IGF_DEC_PRIVATE_DATA_HANDLE hPrivateData, /**< in { Carry = 0; move16(); -#ifdef BASOP_NOGLOB /* Critical Carry/Overflow*/ L_tmp = L_add_co( L_tmp, energyTmp[tb], &Carry, &Overflow ); // Q31 - dE_e Overflow = 0; move16(); L_c = L_macNs_co( L_c, 0, 0, &Carry, &Overflow ); -#else - L_tmp = L_add_c( L_tmp, energyTmp[tb] ); - Overflow = 0; - L_c = L_macNs( L_c, 0, 0 ); -#endif } L_tmp = norm_llQ31( L_c, L_tmp, &shift ); // Q31 /* float: dE = (float)sqrt(dE / 24.f); basop: */ @@ -1679,13 +1673,8 @@ static void IGF_appl( IGF_DEC_PRIVATE_DATA_HANDLE hPrivateData, /**< in /* Build a threshold and compare with L_tmp. Build negated threshold and compare with negated L_tmp to cover also fullscale L_tmp case */ BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB L_tmp2 = L_shl_sat( L_negate( Mpy_32_16_1( sNlocal, 33 /*0.001f Q15*/ ) ), sub( sNlocal_e, L_tmp_e ) ); L_tmp2 = L_sub_sat( L_tmp2, L_negate( L_tmp ) ); -#else - L_tmp2 = L_shl( L_negate( Mpy_32_16_1( sNlocal, 33 /*0.001f Q15*/ ) ), sub( sNlocal_e, L_tmp_e ) ); - L_tmp2 = L_sub( L_tmp2, L_negate( L_tmp ) ); -#endif BASOP_SATURATE_WARNING_ON_EVS IF( L_tmp2 < 0 ) @@ -1697,13 +1686,8 @@ static void IGF_appl( IGF_DEC_PRIVATE_DATA_HANDLE hPrivateData, /**< in /* calc square root of L_tmp and store result in dN */ L_tmp = Sqrt32( L_tmp, &L_tmp_e ); -#ifdef BASOP_NOGLOB dN[sfb] = round_fx_sat( L_tmp ); move16(); -#else - dN[sfb] = round_fx( L_tmp ); - move16(); -#endif dN_e[sfb] = L_tmp_e; move16(); dN[sfb + 1] = dN[sfb]; @@ -1759,13 +1743,8 @@ static void IGF_appl( IGF_DEC_PRIVATE_DATA_HANDLE hPrivateData, /**< in /* Build a threshold and compare with L_tmp. Build negated threshold and compare with negated L_tmp to cover also fullscale L_tmp case */ BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB L_tmp2 = L_shl_sat( L_negate( Mpy_32_16_1( sNlocal, 33 /*0.001f Q15*/ ) ), sub( sNlocal_e, L_tmp_e ) ); L_tmp2 = L_sub_sat( L_tmp2, L_negate( L_tmp ) ); -#else - L_tmp2 = L_shl( L_negate( Mpy_32_16_1( sNlocal, 33 /*0.001f Q15*/ ) ), sub( sNlocal_e, L_tmp_e ) ); - L_tmp2 = L_sub( L_tmp2, L_negate( L_tmp ) ); -#endif BASOP_SATURATE_WARNING_ON_EVS IF( L_tmp2 < 0 ) @@ -1904,11 +1883,7 @@ static void IGF_appl( IGF_DEC_PRIVATE_DATA_HANDLE hPrivateData, /**< in sum = shl( sum, shift ); /* exponent of sum: sub(15, shift) */ /* divide E by sum */ -#ifdef BASOP_NOGLOB /* Critical Carry/Overflow*/ tmp = div_s( shr( round_fx_o( E, &Overflow ), 1 ), sum ); /* shift E 1 bit to the right in order to make it smaller than sum */ -#else - tmp = div_s( shr( round_fx( E ), 1 ), sum ); /* shift E 1 bit to the right in order to make it smaller than sum */ -#endif tmp_e = sub( add( E_e, 1 ), sub( 15, shift ) ); /* 15Q0 | sum is 15Q0 */ /* multiply the result by the hopsize */ @@ -2041,11 +2016,7 @@ static void IGF_appl( IGF_DEC_PRIVATE_DATA_HANDLE hPrivateData, /**< in /* gain[sfb] = min(gain[sfb], 12.f); */ BASOP_SATURATE_WARNING_OFF_EVS /* threshold, may overflow */ -#ifdef BASOP_NOGLOB tmp = shl_sat( gain[sfb], sub( gain_e[sfb], 15 - 5 ) ); /* 10Q5 | tmp is in 10Q5 */ -#else - tmp = shl( gain[sfb], sub( gain_e[sfb], 15 - 5 ) ); /* 10Q5 | tmp is in 10Q5 */ -#endif BASOP_SATURATE_WARNING_ON_EVS IF( tmp > 384 ) /* 10Q5 | 384 = 12 in 10Q5 */ @@ -2288,15 +2259,9 @@ static void IGF_appl_ivas( IGF_DEC_PRIVATE_DATA_HANDLE hPrivateData, /**< in { Carry = 0; move16(); -#ifdef BASOP_NOGLOB /* Critical Carry/Overflow*/ L_tmp = L_add_co( L_tmp, energyTmp[tb], &Carry, &Overflow ); // Q31 - dE_e Overflow = 0; L_c = L_macNs_co( L_c, 0, 0, &Carry, &Overflow ); -#else - L_tmp = L_add_c( L_tmp, energyTmp[tb] ); - Overflow = 0; - L_c = L_macNs( L_c, 0, 0 ); -#endif } L_tmp = norm_llQ31( L_c, L_tmp, &shift ); // Q31 /* float: dE = (float)sqrt(dE / 24.f); basop: */ @@ -2399,13 +2364,8 @@ static void IGF_appl_ivas( IGF_DEC_PRIVATE_DATA_HANDLE hPrivateData, /**< in /* Build a threshold and compare with L_tmp. Build negated threshold and compare with negated L_tmp to cover also fullscale L_tmp case */ BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB L_tmp2 = L_shl_sat( L_negate( Mpy_32_16_1( sNlocal, 33 /*0.001f Q15*/ ) ), sub( sNlocal_e, L_tmp_e ) ); L_tmp2 = L_sub_sat( L_tmp2, L_negate( L_tmp ) ); -#else - L_tmp2 = L_shl( L_negate( Mpy_32_16_1( sNlocal, 33 /*0.001f Q15*/ ) ), sub( sNlocal_e, L_tmp_e ) ); - L_tmp2 = L_sub( L_tmp2, L_negate( L_tmp ) ); -#endif BASOP_SATURATE_WARNING_ON_EVS IF( L_tmp2 < 0 ) @@ -2610,11 +2570,7 @@ static void IGF_appl_ivas( IGF_DEC_PRIVATE_DATA_HANDLE hPrivateData, /**< in sum = shl( sum, shift ); /* exponent of sum: sub(15, shift) */ /* divide E by sum */ -#ifdef BASOP_NOGLOB /* Critical Carry/Overflow*/ tmp = div_s( shr( round_fx_o( E, &Overflow ), 1 ), sum ); /* shift E 1 bit to the right in order to make it smaller than sum */ -#else - tmp = div_s( shr( round_fx( E ), 1 ), sum ); /* shift E 1 bit to the right in order to make it smaller than sum */ -#endif tmp_e = sub( add( E_e, 1 ), sub( 15, shift ) ); /* 15Q0 | sum is 15Q0 */ /* multiply the result by the hopsize */ @@ -2703,11 +2659,7 @@ static void IGF_appl_ivas( IGF_DEC_PRIVATE_DATA_HANDLE hPrivateData, /**< in /* gain[sfb] = min(gain[sfb], 12.f); */ BASOP_SATURATE_WARNING_OFF_EVS /* threshold, may overflow */ -#ifdef BASOP_NOGLOB tmp = shl_sat( gain[sfb], sub( gain_e[sfb], 15 - 5 ) ); /* 10Q5 | tmp is in 10Q5 */ -#else - tmp = shl( gain[sfb], sub( gain_e[sfb], 15 - 5 ) ); /* 10Q5 | tmp is in 10Q5 */ -#endif BASOP_SATURATE_WARNING_ON_EVS IF( tmp > 384 ) /* 10Q5 | 384 = 12 in 10Q5 */ @@ -3036,11 +2988,7 @@ static void IGF_RefineGrid( H_IGF_GRID hGrid /**< in move16(); tmp = add( tmp, 1 ); delta = sub( hGrid->swb_offset[sfb + 1], hGrid->swb_offset[sfb] ); -#ifdef BASOP_NOGLOB /* TBV for 16 kHz, 9.6kbps dtx condition, hGrid->swb_offset[sfb+1] points to an uninit value */ delta = mac_r( 0x00195000, 29491 /*0.45f Q16*/, shl_o( delta, 5, &Overflow ) ); -#else - delta = mac_r( 0x00195000, 29491 /*0.45f Q16*/, shl( delta, 5 ) ); -#endif a[tmp] = add( hGrid->swb_offset[sfb], shr( delta, 6 ) ); move16(); IF( s_and( a[tmp], 1 ) != 0 ) @@ -3088,11 +3036,7 @@ static void IGF_RefineGrid_ivas_fx( H_IGF_GRID hGrid /**< in/out: | IGF grid han move16(); tmp = add( tmp, 1 ); delta = sub( hGrid->swb_offset[sfb + 1], hGrid->swb_offset[sfb] ); -#ifdef BASOP_NOGLOB /* TBV for 16 kHz, 9.6kbps dtx condition, hGrid->swb_offset[sfb+1] points to an uninit value */ delta = mac_r( 0x00195000, 29491 /*0.45f Q16*/, shl_o( delta, 5, &Overflow ) ); -#else - delta = mac_r( 0x00195000, 29491 /*0.45f Q16*/, shl( delta, 5 ) ); -#endif a[tmp] = add( hGrid->swb_offset[sfb], shr( delta, 6 ) ); move16(); // Rounding off delta values >=t+0.5 to t+1 diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index e7708a747..1225195b7 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -120,9 +120,7 @@ ivas_error ivas_core_dec_fx( Word16 tdm_lsfQ_PCh_fx[M], tdm_lspQ_PCh_fx[M]; Word32 conceal_eof_gain32; -#ifdef BASOP_NOGLOB Flag Overflow; -#endif error = IVAS_ERR_OK; move32(); @@ -1175,11 +1173,7 @@ ivas_error ivas_core_dec_fx( { hb_synth_32_fx[n][i] = Mpy_32_16_1( hb_synth_32_fx[n][i], tmp16_2 ); /* Q11 */ move32(); -#ifdef BASOP_NOGLOB tmp16_2 = add_o( tmp16_2, tmp16, &Overflow ); /* Q15 */ -#else - tmp16_2 = add( tmp16_2, tmp16 ); -#endif } } diff --git a/lib_dec/nelp_dec_fx.c b/lib_dec/nelp_dec_fx.c index 9eb7ab203..c088dd826 100644 --- a/lib_dec/nelp_dec_fx.c +++ b/lib_dec/nelp_dec_fx.c @@ -336,11 +336,7 @@ void nelp_decoder_fx( E3 = L_deposit_l( 1 ); FOR( i = 0; i < L_FRAME; i++ ) { -#ifdef BASOP_NOGLOB E3 = L_mac0_sat( E3, ptr[i], ptr[i] ); /*2*Q_exc */ -#else - E3 = L_mac0( E3, ptr[i], ptr[i] ); /*2*Q_exc */ -#endif } @@ -391,11 +387,7 @@ void nelp_decoder_fx( E2 = L_deposit_l( 1 ); FOR( i = 0; i < L_FRAME; i++ ) { -#ifdef BASOP_NOGLOB E2 = L_mac0_sat( E2, ptr[i], ptr[i] ); /*2*Q_exc */ -#else - E2 = L_mac0( E2, ptr[i], ptr[i] ); /*2*Q_exc */ -#endif } exp_E3 = norm_l( E3 ); @@ -403,11 +395,7 @@ void nelp_decoder_fx( exp_E3 = sub( 30, add( exp_E3, 2 * ( *Q_exc ) ) ); exp_E2 = norm_l( E2 ); -#ifdef BASOP_NOGLOB frac_E2 = round_fx_sat( L_shl_sat( E2, exp_E2 ) ); -#else - frac_E2 = round_fx( L_shl( E2, exp_E2 ) ); -#endif exp_E2 = sub( 30, add( exp_E2, shl( ( *Q_exc ), 1 ) ) ); scale = shr( sub( frac_E3, frac_E2 ), 15 ); diff --git a/lib_dec/pitch_extr_fx.c b/lib_dec/pitch_extr_fx.c index 6f5bcc535..279efc733 100644 --- a/lib_dec/pitch_extr_fx.c +++ b/lib_dec/pitch_extr_fx.c @@ -157,9 +157,7 @@ void pitch_pred_linear_fit( { Word32 t1, t2, t3, t4, t5, t6, t7; Word16 e1, e2, e3, e4, e5, e6, e7; -#ifdef BASOP_NOGLOB Flag Overflow; -#endif t1 = L_mult0( pg[4], pg[3] ); /*Q24*/ /* t1 = pg[4]*pg[3] */ e1 = 7; move16(); @@ -182,11 +180,7 @@ void pitch_pred_linear_fit( t6 = BASOP_Util_Add_Mant32Exp( t3, e3, t4, e4, &e6 ); t7 = BASOP_Util_Add_Mant32Exp( t5, e5, t6, e6, &e7 ); /*Q31,e7*/ sum0_q = norm_l( t7 ); -#ifdef BASOP_NOGLOB sum0 = round_fx_o( L_shl( t7, sum0_q ), &Overflow ); /*Q15,e7-sum0_q*/ -#else - sum0 = round_fx( L_shl( t7, sum0_q ) ); /*Q15,e7-sum0_q*/ -#endif sum0_q = add( 15, sub( sum0_q, e7 ) ); /* sum0 is now Qsum0_q*/ } diff --git a/lib_dec/post_dec_fx.c b/lib_dec/post_dec_fx.c index 8d3e03321..d581f810a 100644 --- a/lib_dec/post_dec_fx.c +++ b/lib_dec/post_dec_fx.c @@ -439,11 +439,7 @@ static void bass_pf_1sf_delay( /* gain = tmp/nrg; */ gain = BASOP_Util_Divide3232_Scale( tmp, nrg, &tmp16 ); BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB gain = shl_sat( gain, tmp16 ); /* Q15 */ -#else - gain = shl( gain, tmp16 ); /* Q15 */ -#endif BASOP_SATURATE_WARNING_ON_EVS; if ( gain < 0 ) @@ -471,20 +467,10 @@ static void bass_pf_1sf_delay( { tmp32 = L_msu0( 0, gain, syn[( i + i_subfr ) - T] ); tmp32 = L_msu0( tmp32, gain, syn[( i + i_subfr ) + T] ); -#ifdef BASOP_NOGLOB tmp16 = mac_r_sat( tmp32, gain, syn[i + i_subfr] ); /* Q0 */ -#else - tmp16 = mac_r( tmp32, gain, syn[i + i_subfr] ); /* Q0 */ -#endif lp_error = Mpy_32_16_1( lp_error, 29491 /*0.9f Q15*/ ); -#ifdef BASOP_NOGLOB lp_error = L_mac_sat( lp_error, tmp16, 0x1000 ); /* Q13 */ tmp16 = round_fx_sat( L_shl_sat( lp_error, s1 ) ); /* Q0+s1-3 */ -#else - lp_error = L_mac( lp_error, tmp16, 0x1000 ); /* Q13 */ - - tmp16 = round_fx( L_shl( lp_error, s1 ) ); /* Q0+s1-3 */ -#endif ener2_64 = W_mac0_16_16( ener2_64, tmp16, tmp16 ); /* Q0+(s1-3)*2 */ } ener2 = W_sat_l( ener2_64 ); @@ -498,7 +484,6 @@ static void bass_pf_1sf_delay( Word64 ener2_64 = W_deposit32_l( ener2 ); FOR( i = lg; i < l_subfr; i++ ) { -#ifdef BASOP_NOGLOB tmp32 = L_mult0( gain, syn[i + i_subfr] ); tmp32 = L_msu0_sat( tmp32, gain, syn[( i + i_subfr ) - T] ); /* Q0 */ tmp16 = round_fx_sat( tmp32 ); @@ -507,16 +492,6 @@ static void bass_pf_1sf_delay( lp_error = L_mac_sat( lp_error, tmp16, 0x1000 ); /* Q13 */ tmp16 = round_fx_sat( L_shl_sat( lp_error, s1 ) ); /* Q0+s1-3 */ -#else - tmp32 = L_mult0( gain, syn[i + i_subfr] ); - tmp32 = L_msu0( tmp32, gain, syn[i + i_subfr - T] ); /* Q0 */ - tmp16 = round_fx( tmp32 ); - - lp_error = Mpy_32_16_1( lp_error, 29491 /*0.9f Q15*/ ); - lp_error = L_mac( lp_error, tmp16, 0x1000 ); /* Q13 */ - - tmp16 = round_fx( L_shl( lp_error, s1 ) ); /* Q0+s1-3 */ -#endif ener2_64 = W_mac0_16_16( ener2_64, tmp16, tmp16 ); /* Q0+(s1-3)*2 */ } ener2 = W_sat_l( ener2_64 ); @@ -554,11 +529,7 @@ static void bass_pf_1sf_delay( tmp32 = L_deposit_l( 1 ); tmp16 = BASOP_Util_Divide3232_Scale( tmp, tmp32, &st ); BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB tmp16 = shl_sat( tmp16, sub( st, 2 ) ); /* Q15 */ -#else - tmp16 = shl( tmp16, sub( st, 2 ) ); /* Q15 */ -#endif if ( GT_16( tmp16, 16384 /*0.5f Q15*/ ) ) { @@ -584,16 +555,10 @@ static void bass_pf_1sf_delay( FOR( i = 0; i < lg; i++ ) { tmp32 = L_msu0( 0, tmp16, syn[( i + i_subfr ) - T] ); -#ifdef BASOP_NOGLOB tmp32 = L_msu0_sat( tmp32, tmp16, syn[( i + i_subfr ) + T] ); tmp32 = L_mac_sat( tmp32, tmp16, syn[i + i_subfr] ); bpf_noise_buf[i + i_subfr] = round_fx_sat( tmp32 ); /* Q0 */ move16(); -#else - tmp32 = L_msu0( tmp32, tmp16, syn[i + i_subfr + T] ); - tmp32 = L_mac( tmp32, tmp16, syn[i + i_subfr] ); - bpf_noise_buf[i + i_subfr] = round_fx( tmp32 ); /* Q0 */ -#endif } } @@ -602,14 +567,9 @@ static void bass_pf_1sf_delay( FOR( i = lg; i < l_subfr; i++ ) { tmp32 = L_mult0( tmp16, syn[i + i_subfr] ); -#ifdef BASOP_NOGLOB tmp32 = L_msu0_sat( tmp32, tmp16, syn[i + i_subfr - T] ); bpf_noise_buf[i + i_subfr] = round_fx_sat( tmp32 ); /* Q0 */ move16(); -#else - tmp32 = L_msu0( tmp32, tmp16, syn[i + i_subfr - T] ); - bpf_noise_buf[i + i_subfr] = round_fx( tmp32 ); /* Q0 */ -#endif } } } @@ -696,13 +656,8 @@ void cldfb_synth_set_bandsToZero( /* use 16-bit precision of real and imag buffers */ realQ1 = extract_l( L_shr( rAnalysis[k][i], sub( 31 + 3 - 15, scaleFactor.lb_scale ) ) ); /*31 - (15 + scaleFactor.lb_scale) + 3 )*/ imagQ1 = extract_l( L_shr( iAnalysis[k][i], sub( 31 + 3 - 15, scaleFactor.lb_scale ) ) ); /* Q(-3), headroom */ -#ifdef BASOP_NOGLOB nrgQ31 = L_mac0_o( nrgQ31, realQ1, realQ1, &Overflow ); nrgQ31 = L_mac0_o( nrgQ31, imagQ1, imagQ1, &Overflow ); /* keep in Q(-6) */ -#else - nrgQ31 = L_mac0( nrgQ31, realQ1, realQ1 ); - nrgQ31 = L_mac0( nrgQ31, imagQ1, imagQ1 ); /* keep in Q(-6) */ -#endif } nrg_band[i] = ( nrgQ31 ); move16(); diff --git a/lib_dec/ppp_dec_fx.c b/lib_dec/ppp_dec_fx.c index 201d2cce6..450c1dfe5 100644 --- a/lib_dec/ppp_dec_fx.c +++ b/lib_dec/ppp_dec_fx.c @@ -114,13 +114,8 @@ static void DTFS_dequant_cw_fx( /* Power Dequantization */ tmp_fx = shl( POWER_IDX_fx, 1 ); /* tmp=2*POWER_IDX */ -#ifdef BASOP_NOGLOB *lastLgainD_fx = add_sat( *lastLgainD_fx, PowerCB_fx[tmp_fx] ); /* Q11 */ *lastHgainD_fx = add_sat( *lastHgainD_fx, PowerCB_fx[tmp_fx + 1] ); /* Q11 */ -#else - *lastLgainD_fx = add( *lastLgainD_fx, PowerCB_fx[tmp_fx] ); /* Q11 */ - *lastHgainD_fx = add( *lastHgainD_fx, PowerCB_fx[tmp_fx + 1] ); /* Q11 */ -#endif move16(); move16(); L_tmp = L_deposit_h( X_fx->lag_fx ); /* Q16 */ @@ -143,11 +138,7 @@ static void DTFS_dequant_cw_fx( frac = L_Extract_lc( L_tmp, &exp1 ); /* Extract exponent */ L_tmp = Pow2( 14, frac ); exp1 = sub( exp1, 14 ); -#ifdef BASOP_NOGLOB L_temp = L_shl_sat( L_tmp, add( exp1, 15 ) ); /* Q15 */ -#else - L_temp = L_shl( L_tmp, add( exp1, 15 ) ); /* Q15 */ -#endif L_tmp2 = L_temp; if ( GE_32( L_temp, 2147483647 ) ) { @@ -173,11 +164,7 @@ static void DTFS_dequant_cw_fx( frac = L_Extract_lc( L_tmp, &exp1 ); /* Extract exponent */ L_tmp = Pow2( 14, frac ); exp1 = sub( exp1, 14 ); -#ifdef BASOP_NOGLOB L_temp = L_shl_sat( L_tmp, exp1 + 15 ); /* Q15 */ -#else - L_temp = L_shl( L_tmp, exp1 + 15 ); /* Q15 */ -#endif L_tmp2 = L_temp; move32(); if ( GE_32( L_temp, 2147483647 ) ) diff --git a/lib_dec/pvq_core_dec_fx.c b/lib_dec/pvq_core_dec_fx.c index 6d3e24dad..93da9c77a 100644 --- a/lib_dec/pvq_core_dec_fx.c +++ b/lib_dec/pvq_core_dec_fx.c @@ -492,11 +492,7 @@ static void densitySymbolIndexDecode_fx( sym_freq = L_deposit_l( 1 ); angle = atan2_fx( SQRT_DIM_fx[opp_sz], SQRT_DIM_fx[near_sz] ); // Q13 -#ifdef BASOP_NOGLOB angle = shl_o( angle, 1, &Overflow ); -#else - angle = shl( angle, 1 ); -#endif angle = mult_r( angle, 20861 ); c = mult_r( density, angle ); density_c = sub( density, c ); diff --git a/lib_dec/pvq_decode_fx.c b/lib_dec/pvq_decode_fx.c index 870ea25a9..649840f55 100644 --- a/lib_dec/pvq_decode_fx.c +++ b/lib_dec/pvq_decode_fx.c @@ -103,14 +103,9 @@ void pvq_decode_fx( Mpy_32_16_ss( L_isqrt, shl( y[i], shift_num ), &L_tmp, &u16_tmp ); /* Q31*Q(0+x) *2*/ Mpy_32_16_ss( L_tmp, neg_gain_norm, &L_tmp, &u16_tmp ); /* Q31*Q(0+x) *Q15 *2*/ -#ifdef BASOP_NOGLOB L_tmp = L_shr_o( L_tmp, shift_tot, &Overflow ); xq[i] = round_fx_o( L_tmp, &Overflow ); /* Q15 , array move */ move16(); -#else - L_tmp = L_shr( L_tmp, shift_tot ); - xq[i] = round_fx( L_tmp ); /* Q15 , array move */ -#endif } } diff --git a/lib_dec/rst_dec_fx.c b/lib_dec/rst_dec_fx.c index 339d82854..c226d8b9a 100644 --- a/lib_dec/rst_dec_fx.c +++ b/lib_dec/rst_dec_fx.c @@ -61,11 +61,7 @@ void CNG_reset_dec_fx( L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp ); -#ifdef BASOP_NOGLOB st_fx->lp_gainc_fx = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 12 ) ) ); /* In Q3 */ -#else - st_fx->lp_gainc_fx = round_fx( L_shl( L_tmp, sub( exp, 12 ) ) ); /* In Q3 */ -#endif move16(); } /* reset the pitch buffer in case of FRAME_NO_DATA or SID frames */ diff --git a/lib_dec/swb_bwe_dec_fx.c b/lib_dec/swb_bwe_dec_fx.c index cd30df7c3..9a181e9d9 100644 --- a/lib_dec/swb_bwe_dec_fx.c +++ b/lib_dec/swb_bwe_dec_fx.c @@ -582,11 +582,7 @@ Word16 wb_bwe_dec_fx( { /* de-quantization */ mode = WB_BWE_gain_deq_fx( st_fx, WB_fenv_fx ); -#ifdef BASOP_NOGLOB st_fx->last_wb_bwe_ener_fx = mult_r( add_sat( WB_fenv_fx[0], WB_fenv_fx[1] ), 16384 ); // this would not saturate if written like : rounf_fx(L_mac(L_mult(WB_fenv_fx[0], 16384), WB_fenv_fx[1], 16384)) -#else - st_fx->last_wb_bwe_ener_fx = mult_r( add( WB_fenv_fx[0], WB_fenv_fx[1] ), 16384 ); -#endif move16(); } ELSE @@ -737,13 +733,9 @@ Word16 swb_bwe_gain_deq_fx( /* o : BWE class /*tmp = indice[1]*DIM_TR2*/ tmp = shl( indice[1], 1 ); -#ifdef BASOP_NOGLOB quant_tmp[1] = add_sat( shr( add_sat( quant_tmp[0], quant_tmp[2] ), 1 ), Env_TR_Cdbk2_fx[tmp] ); /* To prevent an unnecessary saturation, it would be better to write the code as below, but might have an impact on EVS bit exactness */ /* quant_tmp[1] = add( extract_h( L_mac( L_mult( quant_tmp[0], 16384 ), quant_tmp[2], 16384 ) ), Env_TR_Cdbk2_fx[tmp] ); */ -#else - quant_tmp[1] = add( shr( add( quant_tmp[0], quant_tmp[2] ), 1 ), Env_TR_Cdbk2_fx[tmp] ); -#endif move16(); /*Q8 */ quant_tmp[3] = add( quant_tmp[2], Env_TR_Cdbk2_fx[tmp + 1] ); move16(); /*Q8 */ @@ -844,11 +836,7 @@ Word16 swb_bwe_gain_deq_fx( /* o : BWE class FOR( n_band = 0; n_band < 5; n_band++ ) { -#ifdef BASOP_NOGLOB SWB_fenv[n_band * 2 + 1] = add_sat( shr( add_sat( quant_tmp[n_band], quant_tmp[n_band + 1] ), 1 ), quant_tmp2[n_band + 1] ); -#else - SWB_fenv[add( shl( n_band, 1 ), 1 )] = add( shr( add( quant_tmp[n_band], quant_tmp[n_band + 1] ), 1 ), quant_tmp2[n_band + 1] ); -#endif move16(); /*Q8 */ } @@ -867,11 +855,7 @@ Word16 swb_bwe_gain_deq_fx( /* o : BWE class FOR( n_band = 0; n_band < DIM12 - 1; n_band++ ) { -#ifdef BASOP_NOGLOB SWB_fenv[n_band * 2 + 1] = add_sat( shr( add_sat( quant_tmp[n_band], quant_tmp[n_band + 1] ), 1 ), quant_tmp2[n_band] ); -#else - SWB_fenv[add( shl( n_band, 1 ), 1 )] = add( shr( add( quant_tmp[n_band], quant_tmp[n_band + 1] ), 1 ), quant_tmp2[n_band] ); -#endif move16(); /*Q8 */ } @@ -891,11 +875,7 @@ Word16 swb_bwe_gain_deq_fx( /* o : BWE class /* output of Pow2() will be: */ /* 16384 < Pow2() <= 32767 */ exp = sub( exp, 13 ); -#ifdef BASOP_NOGLOB SWB_fenv[n_band] = shl_sat( tmp, add( exp, 1 ) ); -#else - SWB_fenv[n_band] = shl( tmp, add( exp, 1 ) ); -#endif move16(); /*Q1 */ } @@ -1122,11 +1102,7 @@ Word16 swb_bwe_dec_fx( /*o :Q_syn_hb*/ { tmp = div_s( 1, SWB_fenv_fx[7] ); move16(); /*Q14*/ -#ifdef BASOP_NOGLOB ener_adjust_quan_fx = s_min( shr( i_mult_sat( SWB_fenv_fx[13], tmp ), 2 ), 32767 ); /*Q13*/ -#else - ener_adjust_quan_fx = s_min( shr( i_mult( SWB_fenv_fx[13], tmp ), 2 ), 32767 ); -#endif } ELSE { @@ -1198,11 +1174,7 @@ Word16 swb_bwe_dec_fx( /*o :Q_syn_hb*/ L_tmp = L_deposit_l( 0 ); FOR( i = 0; i < l_subfr; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac0_sat( L_tmp, hb_synth_fx[add( tmp, i )], hb_synth_fx[add( tmp, i )] ); /*(2*Q_syn_hb) */ -#else - L_tmp = L_mac0( L_tmp, hb_synth_fx[tmp + i], hb_synth_fx[tmp + i] ); /*(2*Q_syn_hb) */ -#endif } L_tmp = Mult_32_16( L_tmp, div_s( 1, l_subfr ) ); /*(2*Q_syn_hb) */ diff --git a/lib_dec/swb_bwe_dec_hr_fx.c b/lib_dec/swb_bwe_dec_hr_fx.c index b5f8641dc..18867ce40 100644 --- a/lib_dec/swb_bwe_dec_hr_fx.c +++ b/lib_dec/swb_bwe_dec_hr_fx.c @@ -185,13 +185,8 @@ static Word16 TD_Postprocess( /* o : gain in Q15 L_Energy = Sqrt_Ratio32( L_Energy, temp1, L_Energy2, temp2, &temp ); /* Put Back to Q31 (Let it saturate to 0.99999 in fx because we wanted to limit the gain to 1.0 anyways) */ -#ifdef BASOP_NOGLOB L_Energy = L_shl_sat( L_Energy, temp ); temp = round_fx_sat( L_Energy ); -#else - L_Energy = L_shl( L_Energy, temp ); - temp = round_fx( L_Energy ); -#endif test(); IF( EQ_16( last_extl, SWB_BWE ) || EQ_16( last_extl, FB_BWE ) ) @@ -229,15 +224,9 @@ static Word16 TD_Postprocess( /* o : gain in Q15 FOR( i = ind2; i < input_frame; i++ ) { -#ifdef BASOP_NOGLOB hb_synth_fx[i] = mult_r_sat( round_fx_sat( L_Energy ), hb_synth_fx[i] ); move16(); L_Energy = L_add_sat( L_Energy, L_Energy2 ); -#else - hb_synth_fx[i] = mult_r( round_fx( L_Energy ), hb_synth_fx[i] ); - move16(); - L_Energy = L_add( L_Energy, L_Energy2 ); -#endif } } } @@ -489,11 +478,7 @@ Word16 swb_bwe_dec_hr_fx( /* o : Exponent of SHB temp = div_s( 16384, frac ); L_temp = L_deposit_h( temp ); L_temp = Isqrt_lc( L_temp, &exp1 ); -#ifdef BASOP_NOGLOB gain_fx = extract_l( L_shl_sat( L_temp, sub( exp1, 2 ) ) ); /*Q(31-exp + (exp-3)) -> Q13*/ -#else - gain_fx = extract_l( L_shl( L_temp, sub( exp1, 2 ) ) ); /*Q(31-exp + (exp-3)) -> Q13*/ -#endif } env = 512; @@ -626,13 +611,8 @@ Word16 swb_bwe_dec_hr_fx( /* o : Exponent of SHB } /* apply noise-fill */ -#ifdef BASOP_NOGLOB swb_hr_noise_fill_fx( is_transient, NUM_TRANS_START_FREQ_COEF, NUM_TRANS_END_FREQ_COEF, round_fx_sat( L_shl_sat( L_tilt_wb, 3 ) ), /* Q(24+3-16) -> Q11 */ pitch, nq, Nsv, &hBWE_FD_HR->bwe_highrate_seed_fx, t_audio + temp, t_audio_exp ); -#else - swb_hr_noise_fill_fx( is_transient, NUM_TRANS_START_FREQ_COEF, NUM_TRANS_END_FREQ_COEF, round_fx( L_shl( L_tilt_wb, 3 ) ), /* Q(24+3-16) -> Q11 */ - pitch, nq, Nsv, &hBWE_FD_HR->bwe_highrate_seed_fx, t_audio + temp, t_audio_exp ); -#endif /* Go from Q't_audio_exp' on 16 Bits to 'Q_32_BITS' on 32 bits */ temp2 = i_mult2( WIDTH_BAND, Nsv ); ptr16 = &t_audio[temp]; @@ -925,11 +905,7 @@ Word16 swb_bwe_dec_hr_fx( /* o : Exponent of SHB move16(); FOR( i = 0; i < i_mult( Nsv, WIDTH_BAND ); i++ ) { -#ifdef BASOP_NOGLOB t_audio_tmp[i] = shl_sat( x_norm[i], t_audio_exp ); -#else - t_audio_tmp[i] = shl( x_norm[i], t_audio_exp ); -#endif move16(); } @@ -1054,11 +1030,7 @@ Word16 swb_bwe_dec_hr_fx( /* o : Exponent of SHB IF( LT_16( nBits, 200 ) ) { swb_hr_noise_fill_fx( is_transient, NUM_NONTRANS_START_FREQ_COEF, NUM_NONTRANS_END_FREQ_COEF, -#ifdef BASOP_NOGLOB round_fx_sat( L_shl_sat( L_tilt_wb, 3 ) ), /* Q(24+3-16) -> Q11 */ -#else - round_fx( L_shl( L_tilt_wb, 3 ) ), /* Q(24+3-16) -> Q11 */ -#endif pitch, nq, Nsv, &hBWE_FD_HR->bwe_highrate_seed_fx, t_audio + NUM_NONTRANS_START_FREQ_COEF, t_audio_exp ); } @@ -1185,11 +1157,7 @@ Word16 swb_bwe_dec_hr_fx( /* o : Exponent of SHB /* tmpF = max_env / min_env; */ temp = BASOP_Util_Divide1616_Scale( max_env, min_env, &temp2 ); test(); -#ifdef BASOP_NOGLOB IF( EQ_16( st_fx->extl, SWB_BWE_HIGHRATE ) || LT_16( temp, shl_sat( 18022, sub( 15 - 13, temp2 ) ) ) ) /* 2.2 in Q13 == 18022 */ -#else - IF( EQ_16( st_fx->extl, SWB_BWE_HIGHRATE ) || LT_16( temp, shl( 18022, sub( 15 - 13, temp2 ) ) ) ) /* 2.2 in Q13 == 18022 */ -#endif { /* (en_band_flt[3] - j*(en_band_flt[3]/WIDTH_BAND - en_noncoded_flt/WIDTH_BAND)) */ @@ -1281,11 +1249,7 @@ Word16 swb_bwe_dec_hr_fx( /* o : Exponent of SHB FOR( i = 0; i < temp2; i++ ) { L_temp = Mult_32_16( *ptr32, gain_fx ); -#ifdef BASOP_NOGLOB L_temp = L_shl_sat( L_temp, temp ); -#else - L_temp = L_shl( L_temp, temp ); -#endif *ptr32++ = L_temp; move32(); } diff --git a/lib_dec/swb_tbe_dec.c b/lib_dec/swb_tbe_dec.c index 8c2387e53..39e4ddb01 100644 --- a/lib_dec/swb_tbe_dec.c +++ b/lib_dec/swb_tbe_dec.c @@ -996,11 +996,7 @@ void ivas_swb_tbe_dec_fx( { scale_fx = div_s( tmp1, tmp ); /* Q15 - Q(15-exp) + Qi = Qexp+i */ scale_fx = s_max( scale_fx, 0 ); -#ifdef BASOP_NOGLOB tmp = shl_sat( scale_fx, sub( sub( 15, exp ), i ) ); /*Q15*/ -#else - tmp = shl( scale, 15 - exp - i ); /*Q15*/ -#endif } scale_fx = mult_r( hBWE_TD->prev_res_shb_gshape_fx, tmp ); /* Q14 */ test(); @@ -1340,11 +1336,7 @@ void ivas_swb_tbe_dec_fx( FOR( cnt = 0; cnt < L_FRAME32k; cnt++ ) { -#ifdef BASOP_NOGLOB bwe_exc_extended_16[cnt] = round_fx_sat( L_shl_sat( bwe_exc_extended_fx[cnt], sc ) ); -#else - bwe_exc_extended_16[cnt + NL_BUFF_OFFSET] = round_fx( L_shl( bwe_exc_extended[cnt], sc ) ); -#endif move16(); } @@ -1421,22 +1413,12 @@ void ivas_swb_tbe_dec_fx( Copy( shaped_shb_excitationTemp_fx, &shaped_shb_excitation_fx[L_SHB_LAHEAD], L_FRAME16k ); /* Q_bwe_exc */ tmp = sub( shl( Q_bwe_exc, 1 ), 31 + 16 ); -#ifdef BASOP_NOGLOB prev_pow_fx = L_shl_sat( 1407374848l /*0.00001f Q47*/, tmp ); /* 2*(Q_bwe_exc) */ curr_pow_fx = L_shl_sat( 1407374848l /*0.00001f Q47*/, tmp ); /* 2*(Q_bwe_exc) */ -#else - prev_pow_fx = L_shl( 1407374848l /*0.00001f Q47*/, tmp ); /* 2*(Q_bwe_exc) */ - curr_pow_fx = L_shl( 1407374848l /*0.00001f Q47*/, tmp ); /* 2*(Q_bwe_exc) */ -#endif FOR( i = 0; i < L_SHB_LAHEAD + 10; i++ ) { -#ifdef BASOP_NOGLOB prev_pow_fx = L_mac0_sat( prev_pow_fx, shaped_shb_excitation_fx[i], shaped_shb_excitation_fx[i] ); /*2*Q_bwe_exc*/ curr_pow_fx = L_mac0_sat( curr_pow_fx, shaped_shb_excitation_fx[i + L_SHB_LAHEAD + 10], shaped_shb_excitation_fx[i + L_SHB_LAHEAD + 10] ); /* 2*Q_bwe_exc */ -#else - prev_pow_fx = L_mac0( prev_pow_fx, shaped_shb_excitation_fx[i], shaped_shb_excitation_fx[i] ); /*2*Q_bwe_exc*/ - curr_pow_fx = L_mac0( curr_pow_fx, shaped_shb_excitation_fx[i + L_SHB_LAHEAD + 10], shaped_shb_excitation_fx[i + L_SHB_LAHEAD + 10] ); /* 2*Q_bwe_exc */ -#endif } if ( GT_16( voice_factors_fx[0], 24576 /*0.75f Q15*/ ) ) @@ -1464,13 +1446,8 @@ void ivas_swb_tbe_dec_fx( } FOR( ; i < L_SHB_LAHEAD + 10; i++ ) { -#ifdef BASOP_NOGLOB temp_fx = i_mult_sat( sub( i, 19 ), 3277 /*0.1f Q15*/ ); /* Q15 */ L_tmp1 = Mult_32_16( L_shl_sat( 1, sub( 31, exp ) ), temp_fx ); /* Q31-exp */ -#else - temp_fx = i_mult( sub( i, 19 ), 3277 /*0.1f Q15*/ ); /* Q15 */ - L_tmp1 = Mult_32_16( L_shl( 1, sub( 31, exp ) ), temp_fx ); /* Q31-exp */ -#endif temp_fx = sub( 32767 /*1.0f Q15*/, temp_fx ); Lscale = L_add( Mult_32_16( Lscale, temp_fx ), L_tmp1 ); L_tmp = Mult_32_16( Lscale, shaped_shb_excitation_fx[i] ); /* Q_bwe_exc + (31-exp) - 15 */ @@ -1519,22 +1496,12 @@ void ivas_swb_tbe_dec_fx( tmp = div_s( 16384, tmp ); L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp ); -#ifdef BASOP_NOGLOB ener_tmp_fx[i] = L_shl_sat( L_tmp, sub( add( exp, shl( Q_bwe_exc, 1 ) ), 31 ) ); /*2 * Q_bwe_exc: Q31 -exp +exp +2 * Q_bwe_exc -31 */ move32(); L_ener = L_add_sat( L_ener, L_shr( ener_tmp_fx[i], 2 ) ); /* 2*Q_bwe_exc */ -#else - ener_tmp_fx[i] = L_shl( L_tmp, sub( add( exp, shl( Q_bwe_exc, 1 ) ), 31 ) ); /*2 * Q_bwe_exc: Q31 -exp +exp +2 * Q_bwe_exc -31 */ - move32(); - L_ener = L_add( L_ener, L_shr( ener_tmp_fx[i], 2 ) ); /* 2*Q_bwe_exc */ -#endif } } -#ifdef BASOP_NOGLOB /* Saturation fix taken from EVS*/ ener_fx = s_max( 1, round_fx_sat( L_shl_sat( L_ener, sub( 18, shl( Q_bwe_exc, 1 ) ) ) ) ); /* Q2: 2*Q_bwe_exc+18-2*Q_bwe_exc-16 */ -#else - ener_fx = s_max( 1, round_fx( L_shl( L_ener, sub( 18, shl( Q_bwe_exc, 1 ) ) ) ) ); /* Q2: 2*Q_bwe_exc+18-2*Q_bwe_exc-16 */ -#endif /* WB/SWB bandwidth switching */ IF( st->bws_cnt > 0 ) { @@ -1589,21 +1556,13 @@ void ivas_swb_tbe_dec_fx( test(); IF( GT_32( L_tmp, st->enerLH_fx ) ) /*st->Q_syn2*/ { -#ifdef BASOP_NOGLOB st->tilt_wb_fx = extract_h( L_shr_sat( Mult_32_16( st->enerLH_fx, inv_ener ), sub( sub( st->Q_syn2, exp_ener ), 16 ) ) ); /*Q11*/ -#else - st->tilt_wb_fx = extract_h( L_shr( Mult_32_16( st->enerLH_fx, inv_ener ), sub( sub( st->Q_syn2, exp_ener ), 16 ) ) ); /*Q11*/ -#endif move16(); /*st->Q_syn2 -1 + 26- exp_ener -15 -(st->Q_syn2 -exp_ener -16 ) -16 +1 -1 = (11) *0.5*/ } ELSE IF( LT_32( L_tmp, Mult_32_16( st->enerLH_fx, 1638 ) ) && EQ_16( is_fractive, 1 ) ) { -#ifdef BASOP_NOGLOB st->tilt_wb_fx = extract_h( L_shr_sat( Mult_32_16( st->enerLH_fx, inv_ener ), sub( sub( st->Q_syn2, exp_ener ), 15 ) ) ); /*Q11*/ -#else - st->tilt_wb_fx = extract_h( L_shr( Mult_32_16( st->enerLH_fx, inv_ener ), sub( sub( st->Q_syn2, exp_ener ), 15 ) ) ); /*Q11*/ -#endif move16(); /*st->Q_syn2 -1 + 26- exp_ener -15 -(st->Q_syn2 -exp_ener -15 ) -16 = (11) 0.25*/ } @@ -1803,11 +1762,7 @@ void ivas_swb_tbe_dec_fx( L_tmp1 = Mult_32_16( ener_tmp_fx[i], GainShape_tmp_fx[i] ); /* (2*Q_bwe_exc) */ L_tmp2 = Mult_32_16( hBWE_TD->prev_ener_fx, hBWE_TD->prev_GainShape_fx ); /* (2*st->prev_ener_fx_Q) */ tmp = sub( shl( Q_bwe_exc, 1 ), shl( st->prev_ener_fx_Q, 1 ) ); -#ifdef BASOP_NOGLOB L_tmp2 = L_shl_sat( L_tmp2, tmp ); /* new Q = (2*Q_bwe_exc) */ -#else - L_tmp2 = L_shl( L_tmp2, tmp ); /* new Q = (2*Q_bwe_exc) */ -#endif IF( GT_32( L_tmp1, L_tmp2 ) ) { L_tmp = L_tmp2; @@ -1818,11 +1773,7 @@ void ivas_swb_tbe_dec_fx( } expb = norm_l( L_tmp ); -#ifdef BASOP_NOGLOB fracb = round_fx_sat( L_shl_sat( L_tmp, expb ) ); -#else - fracb = round_fx( L_shl( L_tmp, expb ) ); -#endif expb = sub( 30, expb ); /* - (2*Q_bwe_exc_ext); */ expa = norm_l( ener_tmp_fx[i] ); @@ -1963,13 +1914,8 @@ void ivas_swb_tbe_dec_fx( move16(); FOR( i = 0; i < L_FRAME16k; i++ ) { -#ifdef BASOP_NOGLOB shaped_shb_excitation_frac[i] = shl_sat( shaped_shb_excitation_fx[i], n ); /*Q_bwe_exc+n*/ move16(); -#else - shaped_shb_excitation_frac[i] = shl( shaped_shb_excitation_fx[i], n ); /*Q_bwe_exc+n*/ - move16(); -#endif } curr_frame_pow_fx = 0; @@ -2098,11 +2044,7 @@ void ivas_swb_tbe_dec_fx( ( EQ_16( st->prev_coder_type, UNVOICED ) || ( st->last_good == UNVOICED_CLAS ) || GT_16( hBWE_TD->tilt_swb_fec_fx, 10240 ) ) ) { L_tmp = root_a_over_b_fx( hBWE_TD->prev_swb_bwe_frame_pow_fx, curr_frame_pow_exp, curr_frame_pow_fx, curr_frame_pow_exp, &exp ); -#ifdef BASOP_NOGLOB scale_fx = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 3 ) ) ); /*Q12*/ -#else - scale_fx = round_fx( L_shl( L_tmp, sub( exp, 3 ) ) ); /*Q12*/ -#endif L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); @@ -2123,22 +2065,14 @@ void ivas_swb_tbe_dec_fx( L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); -#ifdef BASOP_NOGLOB temp_fx = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 3 ) ) ); /*Q12*/ -#else - temp_fx = round_fx( L_shl( L_tmp, sub( exp, 3 ) ) ); /*Q12*/ -#endif } ELSE IF( LT_32( curr_frame_pow_fx, L_shr( hBWE_TD->prev_swb_bwe_frame_pow_fx, 1 ) ) && ( GT_32( st->enerLL_fx, L_shr( st->prev_enerLL_fx, 1 ) ) || GT_32( st->enerLH_fx, L_shr( st->prev_enerLH_fx, 1 ) ) ) && ( EQ_16( st->prev_coder_type, UNVOICED ) || ( st->last_good == UNVOICED_CLAS ) || GT_16( hBWE_TD->tilt_swb_fec_fx, 10240 ) ) ) { L_tmp = root_a_over_b_fx( hBWE_TD->prev_swb_bwe_frame_pow_fx, curr_frame_pow_exp, curr_frame_pow_fx, curr_frame_pow_exp, &exp ); -#ifdef BASOP_NOGLOB L_tmp = L_min( L_tmp, L_shl_sat( 2, sub( 31, exp ) ) ); /*31 - exp*/ -#else - L_tmp = L_min( L_tmp, L_shl( 2, ( 31 - exp ) ) ); /*31 - exp*/ -#endif scale_fx = round_fx( L_shl( L_tmp, sub( exp, 3 ) ) ); /*Q12*/ L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); @@ -2149,17 +2083,9 @@ void ivas_swb_tbe_dec_fx( FOR( j = 0; j < 8; j++ ) { -#ifdef BASOP_NOGLOB GainShape_fx[2 * j] = shl_sat( mult_r( GainShape_fx[2 * j], scale_fx ), 3 ); -#else - GainShape_fx[2 * j] = shl( mult_r( GainShape_fx[2 * j], scale_fx ), 3 ); -#endif move16(); /* 15 +12 +3-15 =15*/ -#ifdef BASOP_NOGLOB GainShape_fx[add( 2 * j, 1 )] = shl_sat( mult_r( GainShape_fx[add( 2 * j, 1 )], scale_fx ), 3 ); -#else - GainShape_fx[2 * j + 1] = shl( mult_r( GainShape_fx[2 * j + 1], scale_fx ), 3 ); -#endif move16(); FOR( i = 0; i < 40; i++ ) { @@ -2214,11 +2140,7 @@ void ivas_swb_tbe_dec_fx( tmp = div_s( 16384, tmp ); L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp ); -#ifdef BASOP_NOGLOB /* Saturation fix taken from EVS*/ st->prev_ener_shb_fx = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 14 ) ) ); /* Q1 */ -#else - st->prev_ener_shb_fx = round_fx( L_shl( L_tmp, sub( exp, 14 ) ) ); /* Q1 */ -#endif move16(); } @@ -2236,11 +2158,7 @@ void ivas_swb_tbe_dec_fx( tmp = div_s( 16384, tmp ); L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp ); -#ifdef BASOP_NOGLOB /* Saturation fix taken from EVS*/ tmp = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 14 ) ) ); /* Q1 */ -#else - tmp = round_fx( L_shl( L_tmp, sub( exp, 14 ) ) ); /* Q1 */ -#endif } set16_fx( st->prev_SWB_fenv_fx, tmp, SWB_FENV ); /* Q1 */ } diff --git a/lib_dec/swb_tbe_dec_fx.c b/lib_dec/swb_tbe_dec_fx.c index 4a90ba9da..fb78835e0 100644 --- a/lib_dec/swb_tbe_dec_fx.c +++ b/lib_dec/swb_tbe_dec_fx.c @@ -906,11 +906,7 @@ void ivas_wb_tbe_dec_fx( IF( st_fx->element_mode > EVS_MONO ) { tmp = sub( shl( sub( st_fx->prev_Q_bwe_exc, 16 ), 1 ), 31 + 16 ); -#ifdef BASOP_NOGLOB prev_pow = L_shl_sat( 1407374848l /*0.00001f Q47*/, tmp ); /*Q(2*(st_fx->prev_Q_bwe_exc-16))*/ -#else - prev_pow = L_shl( 1407374848l /*0.00001f Q47*/, tmp ); /*Q(2*(st_fx->prev_Q_bwe_exc-16))*/ -#endif } FOR( i = 0; i < L_SHB_LAHEAD / 4; i++ ) { @@ -940,19 +936,11 @@ void ivas_wb_tbe_dec_fx( IF( st_fx->element_mode > EVS_MONO ) { tmp = sub( shl( Q_bwe_exc_ext, 1 ), 31 + 16 ); -#ifdef BASOP_NOGLOB curr_pow = L_shl_sat( 1407374848l /*0.00001f Q47*/, tmp ); /*Q(2*(Q_bwe_exc_ext))*/ -#else - curr_pow = L_shl( 1407374848l /*0.00001f Q47*/, tmp ); /* 2*(Q_bwe_exc_ext) */ -#endif } FOR( i = 0; i < L_SHB_LAHEAD / 4; i++ ) { -#ifdef BASOP_NOGLOB curr_pow = L_mac0_sat( curr_pow, shaped_wb_excitation[i + L_SHB_LAHEAD / 4], shaped_wb_excitation[i + L_SHB_LAHEAD / 4] ); /* Q(2*Q_bwe_exc_ext) */ -#else - curr_pow = L_mac0( curr_pow, shaped_wb_excitation[i + L_SHB_LAHEAD / 4], shaped_wb_excitation[i + L_SHB_LAHEAD / 4] ); /* Q(2*Q_bwe_exc_ext) */ -#endif } if ( GT_16( voice_factors[0], 24576 ) ) @@ -966,11 +954,7 @@ void ivas_wb_tbe_dec_fx( FOR( i = 0; i < L_SHB_LAHEAD / 4 - 1; i++ ) { L_tmp = Mult_32_16( Lscale, shaped_wb_excitation[i] ); /* Q(16-exp+Q_bwe_exc_ext) */ -#ifdef BASOP_NOGLOB shaped_wb_excitation[i] = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /* Q_bwe_exc_ext */ -#else - shaped_wb_excitation[i] = round_fx( L_shl( L_tmp, exp ) ); /* Q_bwe_exc_ext */ -#endif move16(); } Lscale = root_a_fx( Lscale, sub( 31, exp ), &exp ); @@ -1007,26 +991,16 @@ void ivas_wb_tbe_dec_fx( n = norm_s( max ); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { -#ifdef BASOP_NOGLOB shaped_wb_excitation_frac[i] = shl_o( shaped_wb_excitation[i], n, &Overflow ); /*Q14*/ move16(); -#else - shaped_wb_excitation_frac[i] = shl( shaped_wb_excitation[i], n ); /*Q14*/ - move16(); -#endif } n = sub( 14, n ); curr_frame_pow = 1; move32(); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mult_o( shaped_wb_excitation_frac[i], shaped_wb_excitation_frac[i], &Overflow ); /*Q29*/ curr_frame_pow = L_add_o( curr_frame_pow, L_shr( L_tmp, 7 ), &Overflow ); /*Q22*/ -#else - L_tmp = L_mult( shaped_wb_excitation_frac[i], shaped_wb_excitation_frac[i] ); /*Q29*/ - curr_frame_pow = L_add( curr_frame_pow, L_shr( L_tmp, 7 ) ); /*Q22*/ -#endif } } curr_frame_pow_exp = add( n, n ); @@ -1216,19 +1190,11 @@ void ivas_wb_tbe_dec_fx( L_tmp = Mult_32_16( Lacc, 102 ); /* Q22 */ exp = norm_l( L_tmp ); -#ifdef BASOP_NOGLOB tmp = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); -#else - tmp = round_fx( L_shl( L_tmp, exp ) ); -#endif exp = sub( add( exp, 22 ), 30 ); tmp = div_s( 16384, tmp ); L_tmp = Isqrt_lc( L_deposit_h( tmp ), &exp ); /* Q(31-exp) */ -#ifdef BASOP_NOGLOB st_fx->last_wb_bwe_ener_fx = round_fx_sat( L_shl_sat( L_tmp, add( exp, sub( n, 12 ) ) ) ); /* Q3 */ -#else - st_fx->last_wb_bwe_ener_fx = round_fx( L_shl( L_tmp, add( exp, sub( n, 12 ) ) ) ); /* Q3 */ -#endif move16(); } @@ -1256,11 +1222,7 @@ void ivas_wb_tbe_dec_fx( { lsf_wb[i] = f; move16(); /*Q15*/ -#ifdef BASOP_NOGLOB f = add_sat( f, inc ); -#else - f = add( f, inc ); -#endif move16(); } GainFrame = 0; /* Q18 */ @@ -1582,19 +1544,11 @@ void wb_tbe_dec_fx( IF( st_fx->element_mode > EVS_MONO ) { tmp = sub( shl( sub( st_fx->prev_Q_bwe_exc, 16 ), 1 ), 31 + 16 ); -#ifdef BASOP_NOGLOB prev_pow = L_shl_sat( 1407374848l /*0.00001f Q47*/, tmp ); /*Q(2*(st_fx->prev_Q_bwe_exc-16))*/ -#else - prev_pow = L_shl( 1407374848l /*0.00001f Q47*/, tmp ); /*Q(2*(st_fx->prev_Q_bwe_exc-16))*/ -#endif } FOR( i = 0; i < L_SHB_LAHEAD / 4; i++ ) { -#ifdef BASOP_NOGLOB prev_pow = L_mac0_sat( prev_pow, hBWE_TD->state_syn_shbexc_fx[i], hBWE_TD->state_syn_shbexc_fx[i] ); /*Q(2*(st_fx->prev_Q_bwe_exc-16))*/ -#else - prev_pow = L_mac0( prev_pow, hBWE_TD->state_syn_shbexc_fx[i], hBWE_TD->state_syn_shbexc_fx[i] ); /*Q(2*(st_fx->prev_Q_bwe_exc-16))*/ -#endif } rescale_genWB_mem( st_fx, sub( Q_bwe_exc, st_fx->prev_Q_bwe_exc ) ); @@ -1603,11 +1557,7 @@ void wb_tbe_dec_fx( sc = sub( Q_bwe_exc, add( Q_exc, Q_exc ) ); FOR( cnt = 0; cnt < L_FRAME32k; cnt++ ) { -#ifdef BASOP_NOGLOB bwe_exc_extended_16[cnt + NL_BUFF_OFFSET] = round_fx_sat( L_shl_sat( bwe_exc_extended[cnt], sc ) ); -#else - bwe_exc_extended_16[cnt + NL_BUFF_OFFSET] = round_fx( L_shl( bwe_exc_extended[cnt], sc ) ); -#endif } Copy( bwe_exc_extended_16 + L_FRAME32k, hBWE_TD->old_bwe_exc_extended_fx, NL_BUFF_OFFSET ); @@ -1625,19 +1575,11 @@ void wb_tbe_dec_fx( IF( st_fx->element_mode > EVS_MONO ) { tmp = sub( shl( Q_bwe_exc_ext, 1 ), 31 + 16 ); -#ifdef BASOP_NOGLOB curr_pow = L_shl_sat( 1407374848l /*0.00001f Q47*/, tmp ); /*Q(2*(Q_bwe_exc_ext))*/ -#else - curr_pow = L_shl( 1407374848l /*0.00001f Q47*/, tmp ); /* 2*(Q_bwe_exc_ext) */ -#endif } FOR( i = 0; i < L_SHB_LAHEAD / 4; i++ ) { -#ifdef BASOP_NOGLOB curr_pow = L_mac0_sat( curr_pow, shaped_wb_excitation[i + L_SHB_LAHEAD / 4], shaped_wb_excitation[i + L_SHB_LAHEAD / 4] ); /* Q(2*Q_bwe_exc_ext) */ -#else - curr_pow = L_mac0( curr_pow, shaped_wb_excitation[i + L_SHB_LAHEAD / 4], shaped_wb_excitation[i + L_SHB_LAHEAD / 4] ); /* Q(2*Q_bwe_exc_ext) */ -#endif } if ( GT_16( voice_factors[0], 24576 ) ) @@ -1651,11 +1593,7 @@ void wb_tbe_dec_fx( FOR( i = 0; i < L_SHB_LAHEAD / 4 - 1; i++ ) { L_tmp = Mult_32_16( Lscale, shaped_wb_excitation[i] ); /* Q(16-exp+Q_bwe_exc_ext) */ -#ifdef BASOP_NOGLOB shaped_wb_excitation[i] = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /* Q_bwe_exc_ext */ -#else - shaped_wb_excitation[i] = round_fx( L_shl( L_tmp, exp ) ); /* Q_bwe_exc_ext */ -#endif move16(); } Lscale = root_a_fx( Lscale, sub( 31, exp ), &exp ); @@ -1691,26 +1629,16 @@ void wb_tbe_dec_fx( n = norm_s( max ); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { -#ifdef BASOP_NOGLOB shaped_wb_excitation_frac[i] = shl_o( shaped_wb_excitation[i], n, &Overflow ); /*Q14*/ move16(); -#else - shaped_wb_excitation_frac[i] = shl( shaped_wb_excitation[i], n ); /*Q14*/ - move16(); -#endif } n = sub( 14, n ); curr_frame_pow = 1; move32(); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mult_o( shaped_wb_excitation_frac[i], shaped_wb_excitation_frac[i], &Overflow ); /*Q29*/ curr_frame_pow = L_add_o( curr_frame_pow, L_shr( L_tmp, 7 ), &Overflow ); /*Q22*/ -#else - L_tmp = L_mult( shaped_wb_excitation_frac[i], shaped_wb_excitation_frac[i] ); /*Q29*/ - curr_frame_pow = L_add( curr_frame_pow, L_shr( L_tmp, 7 ) ); /*Q22*/ -#endif } } curr_frame_pow_exp = add( n, n ); @@ -1898,19 +1826,11 @@ void wb_tbe_dec_fx( L_tmp = Mult_32_16( Lacc, 102 ); /* Q22 */ exp = norm_l( L_tmp ); -#ifdef BASOP_NOGLOB tmp = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); -#else - tmp = round_fx( L_shl( L_tmp, exp ) ); -#endif exp = sub( add( exp, 22 ), 30 ); tmp = div_s( 16384, tmp ); L_tmp = Isqrt_lc( L_deposit_h( tmp ), &exp ); /* Q(31-exp) */ -#ifdef BASOP_NOGLOB st_fx->last_wb_bwe_ener_fx = round_fx_sat( L_shl_sat( L_tmp, add( exp, sub( n, 12 ) ) ) ); /* Q3 */ -#else - st_fx->last_wb_bwe_ener_fx = round_fx( L_shl( L_tmp, add( exp, n - 12 ) ) ); /* Q3 */ -#endif move16(); } @@ -1938,11 +1858,7 @@ void wb_tbe_dec_fx( { lsf_wb[i] = f; move16(); /*Q15*/ -#ifdef BASOP_NOGLOB f = add_sat( f, inc ); -#else - f = add( f, inc ); -#endif move16(); } GainFrame = 0; /* Q18 */ @@ -2101,11 +2017,7 @@ void swb_tbe_dec_fx( Q_shb = 0; /* high band target Q factor set to zero */ move16(); L_tmp = calc_tilt_bwe_fx( old_syn_12k8_16k, st_fx->Q_syn2, st_fx->L_frame ); -#ifdef BASOP_NOGLOB tilt_swb_fec = round_fx_sat( L_shl_sat( L_tmp, 3 ) ); -#else - tilt_swb_fec = round_fx( L_shl( L_tmp, 3 ) ); -#endif /* i: old_syn_12k8_16k in st_fx->Q_syn2 */ /* o: tilt_swb_fec in Q11 */ test(); @@ -2401,11 +2313,7 @@ void swb_tbe_dec_fx( scale = div_s( tmp1, tmp ); /* Q15 - Q(15-exp) + Qi = Qexp+i */ scale = s_max( scale, 0 ); /*scale = st->prev_res_shb_gshape * min(scale, 1.0f); */ -#ifdef BASOP_NOGLOB tmp = shl_sat( scale, sub( sub( 15, exp ), i ) ); /*Q15*/ -#else - tmp = shl( scale, 15 - exp - i ); /*Q15*/ -#endif } scale = mult_r( hBWE_TD->prev_res_shb_gshape_fx, tmp ); /* Q14 */ @@ -2738,11 +2646,7 @@ void swb_tbe_dec_fx( FOR( cnt = 0; cnt < L_FRAME32k; cnt++ ) { -#ifdef BASOP_NOGLOB bwe_exc_extended_16[cnt + NL_BUFF_OFFSET] = round_fx_sat( L_shl_sat( bwe_exc_extended[cnt], sc ) ); -#else - bwe_exc_extended_16[cnt + NL_BUFF_OFFSET] = round_fx( L_shl( bwe_exc_extended[cnt], sc ) ); -#endif } Copy( bwe_exc_extended_16 + L_FRAME32k, hBWE_TD->old_bwe_exc_extended_fx, NL_BUFF_OFFSET ); @@ -2805,22 +2709,12 @@ void swb_tbe_dec_fx( Copy( shaped_shb_excitationTemp, &shaped_shb_excitation[L_SHB_LAHEAD], L_FRAME16k ); /* Q_bwe_exc */ tmp = sub( shl( Q_bwe_exc, 1 ), 31 + 16 ); -#ifdef BASOP_NOGLOB prev_pow = L_shl_sat( 1407374848l /*0.00001f Q47*/, tmp ); /* 2*(Q_bwe_exc) */ curr_pow = L_shl_sat( 1407374848l /*0.00001f Q47*/, tmp ); /* 2*(Q_bwe_exc) */ -#else - prev_pow = L_shl( 1407374848l /*0.00001f Q47*/, tmp ); /* 2*(Q_bwe_exc) */ - curr_pow = L_shl( 1407374848l /*0.00001f Q47*/, tmp ); /* 2*(Q_bwe_exc) */ -#endif FOR( i = 0; i < L_SHB_LAHEAD + 10; i++ ) { -#ifdef BASOP_NOGLOB prev_pow = L_mac0_sat( prev_pow, shaped_shb_excitation[i], shaped_shb_excitation[i] ); /*2*Q_bwe_exc*/ curr_pow = L_mac0_sat( curr_pow, shaped_shb_excitation[i + L_SHB_LAHEAD + 10], shaped_shb_excitation[i + L_SHB_LAHEAD + 10] ); /* 2*Q_bwe_exc */ -#else - prev_pow = L_mac0( prev_pow, shaped_shb_excitation[i], shaped_shb_excitation[i] ); /*2*Q_bwe_exc*/ - curr_pow = L_mac0( curr_pow, shaped_shb_excitation[i + L_SHB_LAHEAD + 10], shaped_shb_excitation[i + L_SHB_LAHEAD + 10] ); /* 2*Q_bwe_exc */ -#endif } if ( GT_16( voice_factors[0], 24576 /*0.75f Q15*/ ) ) @@ -2848,13 +2742,8 @@ void swb_tbe_dec_fx( } FOR( ; i < L_SHB_LAHEAD + 10; i++ ) { -#ifdef BASOP_NOGLOB temp = i_mult_sat( sub( i, 19 ), 3277 /*0.1f Q15*/ ); /* Q15 */ L_tmp1 = Mult_32_16( L_shl_sat( 1, sub( 31, exp ) ), temp ); /* Q31-exp */ -#else - temp = i_mult( sub( i, 19 ), 3277 /*0.1f Q15*/ ); /* Q15 */ - L_tmp1 = Mult_32_16( L_shl( 1, sub( 31, exp ) ), temp ); /* Q31-exp */ -#endif temp = sub( 32767 /*1.0f Q15*/, temp ); Lscale = L_add( Mult_32_16( Lscale, temp ), L_tmp1 ); L_tmp = Mult_32_16( Lscale, shaped_shb_excitation[i] ); /* Q_bwe_exc + (31-exp) - 15 */ @@ -2894,22 +2783,12 @@ void swb_tbe_dec_fx( tmp = div_s( 16384, tmp ); L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp ); -#ifdef BASOP_NOGLOB ener_tmp[i] = L_shl_sat( L_tmp, sub( add( exp, shl( Q_bwe_exc, 1 ) ), 31 ) ); /*2 * Q_bwe_exc: Q31 -exp +exp +2 * Q_bwe_exc -31 */ move32(); L_ener = L_add_sat( L_ener, L_shr( ener_tmp[i], 2 ) ); /* 2*Q_bwe_exc */ -#else - ener_tmp[i] = L_shl( L_tmp, sub( add( exp, shl( Q_bwe_exc, 1 ) ), 31 ) ); /*2 * Q_bwe_exc: Q31 -exp +exp +2 * Q_bwe_exc -31 */ - move32(); - L_ener = L_add( L_ener, L_shr( ener_tmp[i], 2 ) ); /* 2*Q_bwe_exc */ -#endif } } -#ifdef BASOP_NOGLOB ener = s_max( 1, round_fx_sat( L_shl_sat( L_ener, sub( 19, shl( Q_bwe_exc, 1 ) ) ) ) ); /* Q3: 2*Q_bwe_exc+19-2*Q_bwe_exc-16 */ -#else - ener = s_max( 1, round_fx( L_shl( L_ener, sub( 19, shl( Q_bwe_exc, 1 ) ) ) ) ); /* Q3: 2*Q_bwe_exc+19-2*Q_bwe_exc-16 */ -#endif /* WB/SWB bandwidth switching */ IF( st_fx->bws_cnt > 0 ) { @@ -2972,30 +2851,18 @@ void swb_tbe_dec_fx( test(); IF( GT_32( L_tmp, st_fx->enerLH_fx ) ) /*st_fx->Q_syn2*/ { -#ifdef BASOP_NOGLOB st_fx->tilt_wb_fx = extract_h( L_shr_sat( Mult_32_16( st_fx->enerLH_fx, inv_ener ), sub( sub( st_fx->Q_syn2, exp_ener ), 16 ) ) ); /*Q11*/ -#else - st_fx->tilt_wb_fx = extract_h( L_shr( Mult_32_16( st_fx->enerLH_fx, inv_ener ), sub( sub( st_fx->Q_syn2, exp_ener ), 16 ) ) ); /*Q11*/ -#endif move16(); /*st_fx->Q_syn2 -1 + 26- exp_ener -15 -(st_fx->Q_syn2 -exp_ener -16 ) -16 +1 -1 = (11) *0.5*/ } ELSE IF( LT_32( L_tmp, Mult_32_16( st_fx->enerLH_fx, 1638 ) ) && EQ_16( is_fractive, 1 ) ) { -#ifdef BASOP_NOGLOB st_fx->tilt_wb_fx = extract_h( L_shr_sat( Mult_32_16( st_fx->enerLH_fx, inv_ener ), sub( sub( st_fx->Q_syn2, exp_ener ), 15 ) ) ); /*Q11*/ -#else - st_fx->tilt_wb_fx = extract_h( L_shr( Mult_32_16( st_fx->enerLH_fx, inv_ener ), sub( sub( st_fx->Q_syn2, exp_ener ), 15 ) ) ); /*Q11*/ -#endif move16(); /*st_fx->Q_syn2 -1 + 26- exp_ener -15 -(st_fx->Q_syn2 -exp_ener -15 ) -16 = (11) 0.25*/ } L_tmp = L_mult0( st_fx->prev_ener_shb_fx, inv_ener ); /*Q(1+15+14-3-exp_ener) = 27 -exp_ener*/ -#ifdef BASOP_NOGLOB GainFrame_prevfrm_fx = L_shr_sat( L_tmp, sub( 9, exp_ener ) ); /*27 -exp_ener -(9-exp_ener )= Q18*/ -#else - GainFrame_prevfrm_fx = L_shr( L_tmp, sub( 9, exp_ener ) ); /*27 -exp_ener -(9-exp_ener )= Q18*/ -#endif } ELSE { @@ -3057,11 +2924,7 @@ void swb_tbe_dec_fx( exp_ener = norm_s( ener ); tmp = shl( ener, exp_ener ); /*Q(3+exp)*/ inv_ener = div_s( 16384, tmp ); /*Q(15+14-3-exp)*/ -#ifdef BASOP_NOGLOB prev_ener_ratio_fx = L_shr_sat( L_mult0( st_fx->prev_ener_shb_fx, inv_ener ), sub( 9, exp_ener ) ); /*Q: 1+26-exp-9+exp = 18 */ -#else - prev_ener_ratio_fx = L_shr( L_mult0( st_fx->prev_ener_shb_fx, inv_ener ), sub( 9, exp_ener ) ); /*Q: 1+26-exp-9+exp = 18 */ -#endif } IF( EQ_16( st_fx->nbLostCmpt, 1 ) ) @@ -3193,11 +3056,7 @@ void swb_tbe_dec_fx( L_tmp1 = Mult_32_16( ener_tmp[i], GainShape_tmp[i] ); /* (2*Q_bwe_exc) */ L_tmp2 = Mult_32_16( hBWE_TD->prev_ener_fx, hBWE_TD->prev_GainShape_fx ); /* (2*st_fx->prev_ener_fx_Q) */ tmp = sub( shl( Q_bwe_exc, 1 ), shl( st_fx->prev_ener_fx_Q, 1 ) ); -#ifdef BASOP_NOGLOB L_tmp2 = L_shl_sat( L_tmp2, tmp ); /* new Q = (2*Q_bwe_exc) */ -#else - L_tmp2 = L_shl( L_tmp2, tmp ); /* new Q = (2*Q_bwe_exc) */ -#endif IF( GT_32( L_tmp1, L_tmp2 ) ) { /*GainShape_tmp_fx[i] = 0.5f*(L_tmp2/ener_tmp_fx[i] + GainShape_tmp_fx[i]);*/ @@ -3210,11 +3069,7 @@ void swb_tbe_dec_fx( } expb = norm_l( L_tmp ); -#ifdef BASOP_NOGLOB fracb = round_fx_sat( L_shl_sat( L_tmp, expb ) ); -#else - fracb = round_fx( L_shl( L_tmp, expb ) ); -#endif expb = sub( 30, expb ); /* - (2*Q_bwe_exc_ext); */ expa = norm_l( ener_tmp[i] ); @@ -3299,13 +3154,8 @@ void swb_tbe_dec_fx( move16(); FOR( i = 0; i < L_FRAME16k; i++ ) { -#ifdef BASOP_NOGLOB shaped_shb_excitation_frac[i] = shl_sat( shaped_shb_excitation[i], n ); /*Q_bwe_exc+n*/ move16(); -#else - shaped_shb_excitation_frac[i] = shl( shaped_shb_excitation[i], n ); /*Q_bwe_exc+n*/ - move16(); -#endif } curr_frame_pow = 0; @@ -3436,11 +3286,7 @@ void swb_tbe_dec_fx( ( EQ_16( st_fx->prev_coder_type, UNVOICED ) || ( st_fx->last_good == UNVOICED_CLAS ) || GT_16( hBWE_TD->tilt_swb_fec_fx, 10240 ) ) ) { L_tmp = root_a_over_b_fx( hBWE_TD->prev_swb_bwe_frame_pow_fx, curr_frame_pow_exp, curr_frame_pow, curr_frame_pow_exp, &exp ); -#ifdef BASOP_NOGLOB scale = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 3 ) ) ); /*Q12*/ -#else - scale = round_fx( L_shl( L_tmp, sub( exp, 3 ) ) ); /*Q12*/ -#endif L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); @@ -3461,22 +3307,14 @@ void swb_tbe_dec_fx( L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); -#ifdef BASOP_NOGLOB temp = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 3 ) ) ); /*Q12*/ -#else - temp = round_fx( L_shl( L_tmp, sub( exp, 3 ) ) ); /*Q12*/ -#endif } ELSE IF( LT_32( curr_frame_pow, L_shr( hBWE_TD->prev_swb_bwe_frame_pow_fx, 1 ) ) && ( GT_32( st_fx->enerLL_fx, L_shr( st_fx->prev_enerLL_fx, 1 ) ) || GT_32( st_fx->enerLH_fx, L_shr( st_fx->prev_enerLH_fx, 1 ) ) ) && ( EQ_16( st_fx->prev_coder_type, UNVOICED ) || ( st_fx->last_good == UNVOICED_CLAS ) || GT_16( hBWE_TD->tilt_swb_fec_fx, 10240 ) ) ) { L_tmp = root_a_over_b_fx( hBWE_TD->prev_swb_bwe_frame_pow_fx, curr_frame_pow_exp, curr_frame_pow, curr_frame_pow_exp, &exp ); -#ifdef BASOP_NOGLOB L_tmp = L_min( L_tmp, L_shl_sat( 2, sub( 31, exp ) ) ); /*31 - exp*/ -#else - L_tmp = L_min( L_tmp, L_shl( 2, ( 31 - exp ) ) ); /*31 - exp*/ -#endif scale = round_fx( L_shl( L_tmp, sub( exp, 3 ) ) ); /*Q12*/ L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); @@ -3486,25 +3324,13 @@ void swb_tbe_dec_fx( } FOR( j = 0; j < 8; j++ ) { -#ifdef BASOP_NOGLOB GainShape[2 * j] = shl_sat( mult_r( GainShape[2 * j], scale ), 3 ); -#else - GainShape[2 * j] = shl( mult_r( GainShape[2 * j], scale ), 3 ); -#endif move16(); /* 15 +12 +3-15 =15*/ -#ifdef BASOP_NOGLOB GainShape[add( 2 * j, 1 )] = shl_sat( mult_r( GainShape[add( 2 * j, 1 )], scale ), 3 ); -#else - GainShape[2 * j + 1] = shl( mult_r( GainShape[2 * j + 1], scale ), 3 ); -#endif move16(); FOR( i = 0; i < 40; i++ ) { -#ifdef BASOP_NOGLOB shaped_shb_excitation[add( i, j * 40 )] = shl_sat( mult_r( shaped_shb_excitation[add( i, j * 40 )], scale ), 3 ); -#else - shaped_shb_excitation[add( i, i_mult( j, 40 ) )] = shl( mult_r( shaped_shb_excitation[add( i, i_mult( j, 40 ) )], scale ), 3 ); -#endif move16(); /* Q_bwe_exc +12+3 -15 =Q_bwe_exc*/ } @@ -3561,11 +3387,7 @@ void swb_tbe_dec_fx( tmp = div_s( 16384, tmp ); L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp ); -#ifdef BASOP_NOGLOB st_fx->prev_ener_shb_fx = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 14 ) ) ); /* Q1 */ -#else - st_fx->prev_ener_shb_fx = round_fx( L_shl( L_tmp, sub( exp, 14 ) ) ); /* Q1 */ -#endif move16(); } /* st->prev_SWB_fenv[i] = sqrt(curr_frame_pow/L_FRAME16k); */ @@ -3581,11 +3403,7 @@ void swb_tbe_dec_fx( tmp = div_s( 16384, tmp ); L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp ); -#ifdef BASOP_NOGLOB tmp = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 14 ) ) ); /* Q1 */ -#else - tmp = round_fx( L_shl( L_tmp, sub( exp, 14 ) ) ); /* Q1 */ -#endif } set16_fx( st_fx->prev_SWB_fenv_fx, tmp, SWB_FENV ); /* Q1 */ @@ -4859,11 +4677,7 @@ void fb_tbe_dec_fx( { i = (Word16) get_next_indice_fx( st, 4 ); } -#ifdef BASOP_NOGLOB ratio = shl_sat( 1, i ); -#else - ratio = shl( 1, i ); -#endif } ELSE IF( EQ_16( st->extl, FB_TBE ) && st->bfi ) { @@ -4879,11 +4693,7 @@ void fb_tbe_dec_fx( /* v_add_fx( hb_synth, fb_synth, hb_synth, L_FRAME48k );*/ FOR( i = 0; i < L_FRAME48k; i++ ) { -#ifdef BASOP_NOGLOB hb_synth[i] = add_sat( hb_synth[i], fb_synth[i] ); -#else - hb_synth[i] = add( hb_synth[i], fb_synth[i] ); -#endif move16(); } return; @@ -4925,11 +4735,7 @@ void fb_tbe_dec_ivas_fx( { i = (Word16) get_next_indice_fx( st, 4 ); } -#ifdef BASOP_NOGLOB ratio = shl_sat( 1, i ); -#else - ratio = shl( 1, i ); -#endif } ELSE IF( EQ_16( st->extl, FB_TBE ) && st->bfi ) { diff --git a/lib_dec/syn_outp_fx.c b/lib_dec/syn_outp_fx.c index 0d70524be..133ff17b4 100644 --- a/lib_dec/syn_outp_fx.c +++ b/lib_dec/syn_outp_fx.c @@ -40,11 +40,7 @@ void syn_output_fx( FOR( i = 0; i < output_frame; i++ ) { L_tmp = L_deposit_h( synth[i] ); -#ifdef BASOP_NOGLOB synth_out[i] = round_fx_sat( L_shr_sat( L_tmp, tmp ) ); -#else - synth_out[i] = round_fx( L_shr( L_tmp, tmp ) ); -#endif move16(); } } @@ -86,11 +82,7 @@ void unscale_AGC( max_val = s_max( max_val, abs_s( x[i] ) ); } BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB tmp = shl_o( 30000, Qx, &Overflow ); /* saturation can occur here */ -#else - tmp = shl( 30000, Qx ); /* saturation can occurs here */ -#endif BASOP_SATURATE_WARNING_ON_EVS frame_fac = 0; move16(); diff --git a/lib_dec/tonalMDCTconcealment_fx.c b/lib_dec/tonalMDCTconcealment_fx.c index 15ce08803..f59bdac7e 100644 --- a/lib_dec/tonalMDCTconcealment_fx.c +++ b/lib_dec/tonalMDCTconcealment_fx.c @@ -885,11 +885,7 @@ static void ivas_CalcPowerSpecAndDetectTonalComponents_fx( powerSpectrum_exp = add( powerSpectrum_exp, 3 ); FOR( i = hTonalMDCTConc->nSamplesCore; i < nSamples; i++ ) { -#ifdef BASOP_NOGLOB powerSpectrum[i] = L_shl_sat( Mpy_32_16_1( powerSpectrum[i], invScaleFactors[nBands - 1] ), invScaleFactors_exp[nBands - 1] ); // Q(31 - powerSpectrum_exp) -#else - powerSpectrum[i] = L_shl( Mpy_32_16_1( powerSpectrum[i], invScaleFactors[nBands - 1] ), invScaleFactors_exp[nBands - 1] ); -#endif move32(); } @@ -900,11 +896,7 @@ static void ivas_CalcPowerSpecAndDetectTonalComponents_fx( /* 16 bits are now enough for storing the power spectrum */ FOR( i = 0; i < nSamples; i++ ) { -#ifdef BASOP_NOGLOB hTonalMDCTConc->secondLastPowerSpectrum[i] = round_fx_o( powerSpectrum[i], &Overflow ); // Q31 - powerSpectrum_exp -#else - hTonalMDCTConc->secondLastPowerSpectrum[i] = round_fx( powerSpectrum[i] ); -#endif move32(); } @@ -1031,22 +1023,14 @@ static void CalcPowerSpecAndDetectTonalComponents( #endif FOR( i = hTonalMDCTConc->nSamplesCore; i < nSamples; i++ ) { -#ifdef BASOP_NOGLOB powerSpectrum[i] = L_shl_sat( Mpy_32_16_1( powerSpectrum[i], invScaleFactors[FDNS_NPTS - 1] ), invScaleFactors_exp[FDNS_NPTS - 1] ); // powerSpectrum_exp+ 2*invScaleFactors_exp -15 -#else - powerSpectrum[i] = L_shl( Mpy_32_16_1( powerSpectrum[i], invScaleFactors[FDNS_NPTS - 1] ), invScaleFactors_exp[FDNS_NPTS - 1] ); -#endif move32(); } /* 16 bits are now enough for storing the power spectrum */ FOR( i = 0; i < nSamples; i++ ) { -#ifdef BASOP_NOGLOB hTonalMDCTConc->secondLastPowerSpectrum[i] = round_fx_o( powerSpectrum[i], &Overflow ); // Q31-powerSpectrum_exp -#else - hTonalMDCTConc->secondLastPowerSpectrum[i] = round_fx( powerSpectrum[i] ); -#endif move32(); } @@ -1444,11 +1428,7 @@ void TonalMDCTConceal_InsertNoise_ivas_fx( inv_samples = Inv16( hTonalMDCTConc->lastBlockData.nSamples, &inv_exp ); // Q31-inv_exp tiltFactor = round_fx( BASOP_Util_fPow( L_max( L_tmp, L_deposit_h( tiltCompFactor ) ), 0, L_deposit_h( inv_samples ), inv_exp, &exp ) ); // Q15 - exp BASOP_SATURATE_WARNING_OFF_EVS /*next op may result in 32768*/ -#ifdef BASOP_NOGLOB tiltFactor = shl_sat( tiltFactor, exp ); // Q15 -#else - tiltFactor = shl( tiltFactor, exp ); -#endif BASOP_SATURATE_WARNING_ON_EVS tilt = MAX16B; move16(); @@ -1521,11 +1501,7 @@ void TonalMDCTConceal_InsertNoise_ivas_fx( num = L_shr( num, 1 ); // Q31-exp -1 exp = add( exp, 1 ); } -#ifdef BASOP_NOGLOB tmp = div_l( num, round_fx_sat( den ) ); -#else - tmp = div_l( num, round_fx( den ) ); -#endif tmp = Sqrt16( tmp, &exp ); g = mult_r( g, tmp ); // exponent of g = exp @@ -2056,11 +2032,7 @@ ELSE tmp = round_fx( BASOP_Util_fPow( L_deposit_h( tiltFactor ), 0, L_deposit_h( extract_l( L_add( L_sub( hTonalMDCTConc->pTCI->upperIndex[hTonalMDCTConc->pTCI->numIndexes - 1], hTonalMDCTConc->pTCI->lowerIndex[hTonalMDCTConc->pTCI->numIndexes - 1] ), 1 ) ) ), 15, &exp ) ); BASOP_SATURATE_WARNING_OFF_EVS /*next op may result in 32768*/ -#ifdef BASOP_NOGLOB tmp = shl_sat( tmp, exp ); -#else - tmp = shl( tmp, exp ); -#endif BASOP_SATURATE_WARNING_ON_EVS tilt = mult_r( tilt, tmp ); @@ -2486,11 +2458,7 @@ void TonalMDCTConceal_InsertNoise( inv_samples = Inv16( hTonalMDCTConc->lastBlockData.nSamples, &inv_exp ); tiltFactor = round_fx( BASOP_Util_fPow( L_max( L_tmp, L_deposit_h( tiltCompFactor ) ), 0, L_deposit_h( inv_samples ), inv_exp, &exp ) ); BASOP_SATURATE_WARNING_OFF_EVS /*next op may result in 32768*/ -#ifdef BASOP_NOGLOB tiltFactor = shl_sat( tiltFactor, exp ); // Q15- 2*exp -#else - tiltFactor = shl( tiltFactor, exp ); -#endif BASOP_SATURATE_WARNING_ON_EVS tilt = 32767 /*1.0f Q15*/; @@ -2679,11 +2647,7 @@ void TonalMDCTConceal_InsertNoise( tmp = round_fx( BASOP_Util_fPow( L_deposit_h( tiltFactor ), 0, L_deposit_h( (UWord16) L_add( L_sub( hTonalMDCTConc->pTCI->upperIndex[hTonalMDCTConc->pTCI->numIndexes - 1], hTonalMDCTConc->pTCI->lowerIndex[hTonalMDCTConc->pTCI->numIndexes - 1] ), 1 ) ), 15, &exp ) ); BASOP_SATURATE_WARNING_OFF_EVS /*next op may result in 32768*/ -#ifdef BASOP_NOGLOB tmp = shl_sat( tmp, exp ); // Q15 - 2*exp -#else - tmp = shl( tmp, exp ); -#endif BASOP_SATURATE_WARNING_ON_EVS tilt = mult_r( tilt, tmp ); diff --git a/lib_dec/transition_dec_fx.c b/lib_dec/transition_dec_fx.c index c7c5b5ab8..b82378198 100644 --- a/lib_dec/transition_dec_fx.c +++ b/lib_dec/transition_dec_fx.c @@ -789,11 +789,7 @@ static void tc_dec_fx( j = s_min( L_SUBFR, add( imp_pos, L_IMPULSE2 ) ); FOR( ; i <= j; i++ ) { -#ifdef BASOP_NOGLOB exc[i + i_subfr] = round_fx_o( L_shl_o( L_mult_o( pt_shape[i], gain_trans, &Overflow ), sc, &Overflow ), &Overflow ); /* (Qx * Q14 ) */ -#else - exc[i + i_subfr] = round_fx( L_shl( L_mult( pt_shape[i], gain_trans ), sc ) ); /* (Qx * Q14 ) */ -#endif move16(); } FOR( ; i < L_SUBFR; i++ ) diff --git a/lib_dec/updt_dec_fx.c b/lib_dec/updt_dec_fx.c index a7341ddc9..67621c442 100644 --- a/lib_dec/updt_dec_fx.c +++ b/lib_dec/updt_dec_fx.c @@ -401,11 +401,7 @@ void updt_bw_switching_fx( test(); IF( EQ_32( st_fx->output_Fs, 32000 ) && EQ_16( st_fx->bwidth, SWB ) ) { -#ifdef BASOP_NOGLOB st_fx->tilt_swb_fx = round_fx_sat( L_shl_sat( calc_tilt_bwe_fx( synth, Qpost, L_FRAME32k ), 3 ) ); // Q27 - 16 = Q11 -#else - st_fx->tilt_swb_fx = round_fx( L_shl( calc_tilt_bwe_fx( synth, Qpost, L_FRAME32k ), 3 ) ); -#endif } st_fx->prev_enerLH_fx = st_fx->enerLH_fx; // enerLH_fx_Q @@ -775,11 +771,7 @@ static void ivas_updt_bw_switching_fx( test(); IF( EQ_32( st_fx->output_Fs, 32000 ) && EQ_16( st_fx->bwidth, SWB ) ) { -#ifdef BASOP_NOGLOB st_fx->tilt_swb_fx = ivas_calc_tilt_bwe_fx( synth, Qpost, L_FRAME32k ); -#else - st_fx->tilt_swb_fx = round_fx( L_shl( calc_tilt_bwe_fx( synth, Qpost, L_FRAME32k ), 3 ) ); -#endif } st_fx->prev_enerLH_fx = st_fx->enerLH_fx; // enerLH_fx_Q diff --git a/lib_dec/voiced_dec_fx.c b/lib_dec/voiced_dec_fx.c index d7ec44e92..25029f1cb 100644 --- a/lib_dec/voiced_dec_fx.c +++ b/lib_dec/voiced_dec_fx.c @@ -243,14 +243,9 @@ ivas_error ppp_voiced_decoder_fx( Ltemp = log10_fx( Ltemp ); /* Ltemp=10log10(eng), Q23 */ -#ifdef BASOP_NOGLOB Ltemp = L_add_sat( L_sub_sat( Ltemp, Ltemp_q ), logLag ); /* Ltemp=10*log10(lag*eng), Q23 */ hSC_VBR->lastLgainD_fx = round_fx_sat( L_shl_sat( (Word32) Mpy_32_16( extract_h( Ltemp ), extract_l( Ltemp ), 0x6666 ), 1 ) ); /* Q11 */ move16(); -#else - Ltemp = L_add( L_sub( Ltemp, Ltemp_q ), logLag ); /* Ltemp=10*log10(lag*eng), Q23 */ - hSC_VBR->lastLgainD_fx = round_fx( L_shl( (Word32) Mpy_32_16( extract_h( Ltemp ), extract_l( Ltemp ), 0x6666 ), 1 ) ); /* Q11 */ -#endif /* Process high band */ @@ -258,14 +253,9 @@ ivas_error ppp_voiced_decoder_fx( Ltemp = log10_fx( Ltemp ); // Q23 -#ifdef BASOP_NOGLOB Ltemp = L_add_sat( L_sub_sat( Ltemp, Ltemp_q ), logLag ); /* Ltemp=10*log10(lag*eng), Q23 */ hSC_VBR->lastHgainD_fx = round_fx_sat( L_shl_sat( (Word32) Mpy_32_16( extract_h( Ltemp ), extract_l( Ltemp ), 0x6666 ), 1 ) ); /* Q11 */ move16(); -#else - Ltemp = L_add( L_sub( Ltemp, Ltemp_q ), logLag ); /* Ltemp=10*log10(lag*eng), Q23 */ - hSC_VBR->lastHgainD_fx = round_fx( L_shl( (Word32) Mpy_32_16( extract_h( Ltemp ), extract_l( Ltemp ), 0x6666 ), 1 ) ); /* Q11 */ -#endif /* Need to unify the Q factors of both bands */ @@ -324,13 +314,8 @@ ivas_error ppp_voiced_decoder_fx( /* temp32_fx = (Word32)divide_dp((Word40)819200,(Word40)L_shl((Word32)CURRP_Q_D_FX->lag_fx,6),-23,1);//Q6 */ exp = norm_s( CURRP_Q_D_FX->lag_fx ); tmp = div_s( shl( 1, sub( 14, exp ) ), CURRP_Q_D_FX->lag_fx ); /*29-exp */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_mult0( tmp, 12800 ), sub( exp, 7 ) ); temp32_fx = round_fx_sat( L_tmp ); -#else - L_tmp = L_shl( L_mult0( tmp, 12800 ), sub( exp, 7 ) ); - temp32_fx = round_fx( L_tmp ); -#endif diff = round_fx( L_shl( temp32_fx, 16 - 6 ) ); /*Q0 */ CURRP_Q_D_FX->nH_fx = find_rem( upper_cut_off_freq, diff, &rem_fx ); /*Q0 */ diff --git a/lib_dec/waveadjust_fec_dec_fx.c b/lib_dec/waveadjust_fec_dec_fx.c index 0f7a45eb0..80241a24c 100644 --- a/lib_dec/waveadjust_fec_dec_fx.c +++ b/lib_dec/waveadjust_fec_dec_fx.c @@ -476,13 +476,8 @@ void pitch_modify_x( Word16 *s_LP /*Qx*/, Word16 *voicing /*Q15*/, Word16 *pitch eng1 = L_mult0( eng1_w, eng2_w ); norm = norm_l( eng1 ); -#ifdef BASOP_NOGLOB eng1_w = extract_h( L_shl_sat( eng1, norm ) ); eng2_w = extract_h( L_shl_sat( eng3, norm ) ); -#else - eng1_w = extract_h( L_shl( eng1, norm ) ); - eng2_w = extract_h( L_shl( eng3, norm ) ); -#endif IF( GE_32( eng3, eng1 ) ) { @@ -1246,32 +1241,18 @@ static void add_noise( Word16 *const sbuf, /*Qsbuf*/ IF( !firstFrame ) { -#ifdef BASOP_NOGLOB temp_OUT = sub_sat( noise_seg[0], mult( ( *outx_new_n1 ), 22282 /* 0.68 Q15 */ ) ); sbuf[0] = add_sat( sbuf[0], mult( ( temp_OUT ), *gain ) ); move16(); *gain = mac_r_sat( L_mult_sat( 32439 /* 0.99 Q15 */, *gain ), 328 /* 0.01 Q15 */, *gain_n ); -#else - temp_OUT = sub( noise_seg[0], mult( ( *outx_new_n1 ), 22282 /* 0.68 Q15 */ ) ); - sbuf[0] = add( sbuf[0], mult( ( temp_OUT ), *gain ) ); - move16(); - *gain = mac_r( L_mult( 32439 /* 0.99 Q15 */, *gain ), 328 /* 0.01 Q15 */, *gain_n ); -#endif } FOR( i = 1; i < Len; i++ ) { -#ifdef BASOP_NOGLOB temp_OUT = sub_sat( noise_seg[i], mult( ( noise_seg[i - 1] ), 22282 /* 0.68 Q15 */ ) ); sbuf[i] = add_sat( sbuf[i], mult( ( temp_OUT ), *gain ) ); move16(); *gain = mac_r_sat( L_mult( 32439 /* 0.99 Q15 */, *gain ), 328 /* 0.01 Q15 */, *gain_n ); -#else - temp_OUT = sub( noise_seg[i], mult( ( noise_seg[i - 1] ), 22282 /* 0.68 Q15 */ ) ); - sbuf[i] = add( sbuf[i], mult( ( temp_OUT ), *gain ) ); - move16(); - *gain = mac_r( L_mult( 32439 /* 0.99 Q15 */, *gain ), 328 /* 0.01 Q15 */, *gain_n ); -#endif } *outx_new_n1 = noise_seg[i - 1]; /*q0*/ @@ -1387,11 +1368,7 @@ static Word16 waveform_adj_fix( Word16 *overlapbuf, /*Qoverlapbuf*/ } FOR( i = 0; i < pitch125; i++ ) { -#ifdef BASOP_NOGLOB pitch125_data[i] = round_fx_sat( L_shr_sat( L_add_sat( ( L_mult( p_tmp[i], 20972 ) ), L_mac_sat( L_mult( p_tmp[i - 1], 5898 ), p_tmp[i + 1], 5898 ) ), s16MaxCoefNorm ) ); -#else - pitch125_data[i] = round_fx( L_shr( L_add( ( L_mult( p_tmp[i], 20972 ) ), L_mac( L_mult( p_tmp[i - 1], 5898 ), p_tmp[i + 1], 5898 ) ), s16MaxCoefNorm ) ); -#endif move16(); } } @@ -1553,26 +1530,14 @@ void waveform_adj2_fix( Word16 *overlapbuf, /*Qoverlapbuf*/ ratio = extract_l( L_shr( L_mult( i, ptable ), tablescale ) ); dat = shl( sbuf[i], s16MaxCoefNorm ); temp_OUT = mult( *recovery_gain, sub( 32767, ratio ) ); -#ifdef BASOP_NOGLOB outx_new[i] = round_fx_sat( L_add_sat( L_shr_sat( L_mult( temp_OUT, dat ), sub( s16MaxCoefNorm, 1 ) ), L_shr_sat( L_mult( shl( outx_new[i], s16MaxCoefNorm2 ), ratio ), s16MaxCoefNorm2 ) ) ); -#else - outx_new[i] = round_fx( L_add( L_shr( L_mult( temp_OUT, dat ), sub( s16MaxCoefNorm, 1 ) ), L_shr( L_mult( shl( outx_new[i], s16MaxCoefNorm2 ), ratio ), s16MaxCoefNorm2 ) ) ); -#endif move16(); -#ifdef BASOP_NOGLOB *recovery_gain = sub_sat( *recovery_gain, shr_r( step_concealgain, 1 ) ); /* q14 */ -#else - *recovery_gain = sub( *recovery_gain, shr_r( step_concealgain, 1 ) ); /* q14 */ -#endif } FOR( i = gain_zero_start; i < Framesize; i++ ) { ratio = extract_l( L_shr( L_mult( i, ptable ), tablescale ) ); -#ifdef BASOP_NOGLOB outx_new[i] = round_fx_sat( L_shr_sat( L_mult( shl( outx_new[i], s16MaxCoefNorm2 ), ratio ), s16MaxCoefNorm2 ) ); -#else - outx_new[i] = round_fx( L_shr( L_mult( shl( outx_new[i], s16MaxCoefNorm2 ), ratio ), s16MaxCoefNorm2 ) ); -#endif move16(); } diff --git a/lib_enc/SNR_calc_fx.c b/lib_enc/SNR_calc_fx.c index 1213a6b32..f44530c84 100644 --- a/lib_enc/SNR_calc_fx.c +++ b/lib_enc/SNR_calc_fx.c @@ -325,11 +325,7 @@ void snr_calc( } *tsnr = VAD_Log2( tmp, minscale2 ); move32(); -#ifdef BASOP_NOGLOB *tsnr = L_add_sat( *tsnr, MUL_F( *tsnr, 6226 ) ); /* *tsnr *= 1.2; Q25*/ -#else - *tsnr = L_add( *tsnr, MUL_F( *tsnr, 6226 ) ); /* *tsnr *= 1.2; */ -#endif move32(); } ELSE diff --git a/lib_enc/acelp_core_switch_enc_fx.c b/lib_enc/acelp_core_switch_enc_fx.c index b09f23966..684cc09f2 100644 --- a/lib_enc/acelp_core_switch_enc_fx.c +++ b/lib_enc/acelp_core_switch_enc_fx.c @@ -492,17 +492,10 @@ static void encod_gen_voic_core_switch_fx( { /* code in Q9, gain_pit in Q14 */ L_tmp = L_mult( gcode16, code[i] ); /* Q10 */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, 5 ); /* Q15 */ L_tmp = L_mac_sat( L_tmp, exc[i], gain_pit ); L_tmp = L_shl_sat( L_tmp, 1 ); /* saturation can occur here */ exc[i] = round_fx_sat( L_tmp ); /* Q_exc */ -#else - L_tmp = L_shl( L_tmp, 5 ); - L_tmp = L_mac( L_tmp, exc[i], gain_pit ); - L_tmp = L_shl( L_tmp, 1 ); /* saturation can occur here */ - exc[i] = round_fx( L_tmp ); -#endif } /* write reserved bits */ @@ -519,11 +512,7 @@ static void encod_gen_voic_core_switch_fx( FOR( i = L_SUBFR; i < 2 * L_SUBFR; i++ ) { -#ifdef BASOP_NOGLOB exc[i] = round_fx_sat( L_shl_sat( L_mult_sat( exc[i], gain_pit ), 1 ) ); /* Q_exc */ -#else - exc[i] = round_fx( L_shl( L_mult( exc[i], gain_pit ), 1 ) ); -#endif } return; @@ -712,17 +701,10 @@ static void encod_gen_voic_core_switch_ivas_fx( { /* code in Q9, gain_pit in Q14 */ L_tmp = L_mult( gcode16, code[i] ); /* Q10 */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, 5 ); /* Q15 */ L_tmp = L_mac_sat( L_tmp, exc[i], gain_pit ); L_tmp = L_shl_sat( L_tmp, 1 ); /* saturation can occur here */ exc[i] = round_fx_sat( L_tmp ); /* Q_exc */ -#else - L_tmp = L_shl( L_tmp, 5 ); - L_tmp = L_mac( L_tmp, exc[i], gain_pit ); - L_tmp = L_shl( L_tmp, 1 ); /* saturation can occur here */ - exc[i] = round_fx( L_tmp ); -#endif move16(); } @@ -740,11 +722,7 @@ static void encod_gen_voic_core_switch_ivas_fx( FOR( i = L_SUBFR; i < 2 * L_SUBFR; i++ ) { -#ifdef BASOP_NOGLOB exc[i] = round_fx_sat( L_shl_sat( L_mult_sat( exc[i], gain_pit ), 1 ) ); /* Q_exc */ -#else - exc[i] = round_fx( L_shl( L_mult( exc[i], gain_pit ), 1 ) ); -#endif move16(); } @@ -897,11 +875,7 @@ static void bwe_switch_enc_fx( L_tmp1 = L_mult( tmp, E2_fx ); /*30-q_tmp1+q_tmp2 */ q_tmp2 = sub( q_tmp1, q_tmp2 ); /*30-q_tmp2 */ L_tmp1 = L_shl( L_tmp1, sub( q_tmp2, 24 ) ); -#ifdef BASOP_NOGLOB gain_fx = round_fx_o( Isqrt( L_tmp1 ), &Overflow ); /*Q12 */ -#else - gain_fx = round_fx( Isqrt( L_tmp1 ) ); /*Q12 */ -#endif ind1_fx = usquant_fx( gain_fx, &gain_fx, shr( MINVALUEOFFIRSTGAIN_FX, 1 ), shr( DELTAOFFIRSTGAIN_FX, 4 ), ( 1 << NOOFGAINBITS1 ) ); /* Q0 */ push_indice_fx( hBstr, IND_CORE_SWITCHING_AUDIO_GAIN, ind1_fx, NOOFGAINBITS1 ); @@ -1044,11 +1018,7 @@ static void bwe_switch_enc_ivas_fx( L_tmp1 = L_mult( tmp, E2_fx ); /*30-q_tmp1+q_tmp2 */ q_tmp2 = sub( q_tmp1, q_tmp2 ); /*30-q_tmp2 */ L_tmp1 = L_shl( L_tmp1, sub( q_tmp2, 24 ) ); -#ifdef BASOP_NOGLOB gain_fx = round_fx_o( Isqrt( L_tmp1 ), &Overflow ); /*Q12 */ -#else - gain_fx = round_fx( Isqrt( L_tmp1 ) ); /*Q12 */ -#endif ind1_fx = usquant_fx( gain_fx, &gain_fx, shr( MINVALUEOFFIRSTGAIN_FX, 1 ), shr( DELTAOFFIRSTGAIN_FX, 4 ), ( 1 << NOOFGAINBITS1 ) ); push_indice( hBstr, IND_CORE_SWITCHING_AUDIO_GAIN, ind1_fx, NOOFGAINBITS1 ); @@ -1084,11 +1054,7 @@ static Word16 dotprod_satcont( move16(); FOR( i = 0; i < len; i += delta ) { -#ifdef BASOP_NOGLOB /* Critical Overflow*/ L_tmp = L_mac0_o( L_tmp, tmp_tabx[i], tmp_taby[i], &Overflow ); /*Q(qx+qy-shift) */ -#else /* BASOP_NOGLOB */ - L_tmp = L_mac0( L_tmp, tmp_tabx[i], tmp_taby[i] ); /*Q(qx+qy-shift) */ -#endif } IF( Overflow != 0 ) diff --git a/lib_enc/acelp_enc_util_fx.c b/lib_enc/acelp_enc_util_fx.c index 9992ce6ad..9cff4bfcb 100644 --- a/lib_enc/acelp_enc_util_fx.c +++ b/lib_enc/acelp_enc_util_fx.c @@ -77,7 +77,6 @@ Word16 E_ACELP_toeplitz_mul_fx( L_maxloc = L_shr( L_maxloc, 2 ); /* Do not warn saturation of L_tot, since its for headroom estimation. */ BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB L_tot = L_add_sat( L_tot, L_maxloc ); /* +max/4 */ L_maxloc = L_shr( L_maxloc, 1 ); L_tot = L_add_sat( L_tot, L_maxloc ); /* +max/8 */ @@ -90,20 +89,6 @@ Word16 E_ACELP_toeplitz_mul_fx( { L_tot = L_add_sat( L_tot, L_maxloc ); /* +max/16 */ } -#else - L_tot = L_add( L_tot, L_maxloc ); /* +max/4 */ - L_maxloc = L_shr( L_maxloc, 1 ); - L_tot = L_add( L_tot, L_maxloc ); /* +max/8 */ - if ( highrate ) - { - L_tot = L_add( L_tot, L_maxloc ); /* +max/8 */ - } - L_maxloc = L_shr( L_maxloc, 1 ); - if ( highrate ) - { - L_tot = L_add( L_tot, L_maxloc ); /* +max/16 */ - } -#endif BASOP_SATURATE_WARNING_ON_EVS } @@ -190,11 +175,7 @@ void E_ACELP_conv( L_tmp_64 = W_msu0_16_16( L_tmp_64, cn2[i], h2[k - i] ); /*h2 4Q11*/ } L_tmp = W_sat_l( L_tmp_64 ); /* 4Q11 */ -#ifdef BASOP_NOGLOB cn2[k] = round_fx_o( L_shl_o( L_tmp, 5, &Overflow ), &Overflow ); /* Q0 */ -#else - cn2[k] = round_fx( L_shl( L_tmp, 5 ) ); -#endif } } @@ -220,11 +201,7 @@ void E_ACELP_conv_ivas_fx( L_tmp_64 = W_msu0_16_16( L_tmp_64, cn2[i], h2[k - i] ); /*h2 4Q11*/ } L_tmp = W_sat_l( L_tmp_64 ); /* 4Q11 */ -#ifdef BASOP_NOGLOB cn2[k] = round_fx_o( L_shl_o( L_tmp, 5, &Overflow ), &Overflow ); /* Q0*/ -#else - cn2[k] = round_fx( L_shl( L_tmp, 5 ) ); -#endif move16(); } } diff --git a/lib_enc/amr_wb_enc_fx.c b/lib_enc/amr_wb_enc_fx.c index 69c356b5d..cdb90e5bf 100644 --- a/lib_enc/amr_wb_enc_fx.c +++ b/lib_enc/amr_wb_enc_fx.c @@ -367,11 +367,7 @@ void amr_wb_enc_fx( { lp_bckr = Mean32( hNoiseEst->bckr_fx + 1, 9 ); /* q_bckr */ } -#ifdef BASOP_NOGLOB hp_bckr = L_shr( L_add_sat( hNoiseEst->bckr_fx[st->max_band - 1], hNoiseEst->bckr_fx[st->max_band] ), 1 ); /* q_bckr */ -#else - hp_bckr = L_shr( L_add( hNoiseEst->bckr_fx[st->max_band - 1], hNoiseEst->bckr_fx[st->max_band] ), 1 ); -#endif if ( hp_bckr == 0 ) /* Avoid division by zero. */ { hp_bckr = L_deposit_l( 1 ); diff --git a/lib_enc/analy_sp_fx.c b/lib_enc/analy_sp_fx.c index 594bcfbab..a93bf528d 100644 --- a/lib_enc/analy_sp_fx.c +++ b/lib_enc/analy_sp_fx.c @@ -953,11 +953,7 @@ static void find_enr( /* *ptE *= 4.0 / (L_FFT*L_FFT) */ /* normalization - corresponds to FFT normalization by 2/L_FFT */ BASOP_SATURATE_WARNING_OFF_EVS; /* saturation seems to have no effect (tested by simulation) */ -#ifdef BASOP_NOGLOB *ptE = L_shl_o( Ltmp, diff_scaleM2, &Overflow ); /* Q_new + QSCALE - 2 */ -#else /* BASOP_NOGLOB */ - *ptE = L_shl( Ltmp, diff_scaleM2 ); -#endif /* BASOP_NOGLOB */ move32(); /* scaled by Q_new + QSCALE - 2 */ BASOP_SATURATE_WARNING_ON_EVS; /*band[i] += *ptE++;*/ @@ -983,11 +979,7 @@ static void find_enr( exp_band = sub( exp_band, shift_to_norm ); exp_band = sub( diff_scaleP1, exp_band ); BASOP_SATURATE_WARNING_OFF_EVS; /* saturation seems to have no effect (tested by simulation) */ -#ifdef BASOP_NOGLOB band[i] = L_shl_o( Ltmp1, exp_band, &Overflow ); /* Q15 + exp_band */ -#else /* BASOP_NOGLOB */ - band[i] = L_shl( Ltmp1, exp_band ); -#endif /* BASOP_NOGLOB */ move32(); /* band scaled by Q_new + QSCALE */ BASOP_SATURATE_WARNING_ON_EVS; @@ -1038,11 +1030,7 @@ static void find_enr( /* *ptE *= 4.0 / (L_FFT*L_FFT) */ /* normalization - corresponds to FFT normalization by 2/L_FFT */ BASOP_SATURATE_WARNING_OFF_EVS; /* saturation seems to have no effect (tested by simulation) */ -#ifdef BASOP_NOGLOB *Bin_E = L_shl_o( Ltmp, diff_scaleM2, &Overflow ); /* Q_new + QSCALE */ -#else /* BASOP_NOGLOB */ - *Bin_E = L_shl( Ltmp, diff_scaleM2 ); -#endif /* BASOP_NOGLOB */ move32(); /* scaled by Q_new + QSCALE - 2 */ BASOP_SATURATE_WARNING_ON_EVS; Bin_E++; @@ -1064,11 +1052,7 @@ static void find_enr( exp_band = sub( exp_band, shift_to_norm ); exp_band = sub( diff_scaleP1, exp_band ); BASOP_SATURATE_WARNING_OFF_EVS; /* saturation seems to have no effect (tested by simulation) */ -#ifdef BASOP_NOGLOB band[i] = L_shl_o( Ltmp1, exp_band, &Overflow ); -#else /* BASOP_NOGLOB */ - band[i] = L_shl( Ltmp1, exp_band ); -#endif move32(); /* band scaled by Q_new + QSCALE */ BASOP_SATURATE_WARNING_ON_EVS; @@ -1104,11 +1088,7 @@ static void find_enr( * Find the total energy over the input bandwidth *-----------------------------------------------------------------*/ -#ifdef BASOP_NOGLOB etot = L_add_sat( *LEtot, L_shl_sat( etot, sub( exp_etot, 4 ) ) ); -#else - etot = L_add( *LEtot, L_shl( etot, sub( exp_etot, 4 ) ) ); -#endif *LEtot = etot; move32(); diff --git a/lib_enc/ari_hm_enc_fx.c b/lib_enc/ari_hm_enc_fx.c index 66b53bc6d..a94f45528 100644 --- a/lib_enc/ari_hm_enc_fx.c +++ b/lib_enc/ari_hm_enc_fx.c @@ -459,17 +459,9 @@ Word16 SearchPeriodicityIndex_fx( tmp32 = L_mult0( Score, NumToConsider ); /* -> 16Q15 */ tmp = sub( norm_l( tmp32 ), 1 ); tmp2 = norm_l( AbsTotal ); -#ifdef BASOP_NOGLOB tmp3 = div_s( round_fx_o( L_shl_o( tmp32, tmp, &Overflow ), &Overflow ), round_fx_o( L_shl_o( AbsTotal, tmp2, &Overflow ), &Overflow ) ); *RelativeScore = shr_o( tmp3, add( sub( tmp, tmp2 ), 2 ), &Overflow ); /* -> 2Q13 */ move16(); -#else - tmp3 = div_s( round_fx( L_shl( tmp32, tmp ) ), round_fx( L_shl( AbsTotal, tmp2 ) ) ); - BASOP_SATURATE_WARNING_OFF_EVS - *RelativeScore = shr( tmp3, add( sub( tmp, tmp2 ), 2 ) ); /* -> 2Q13 */ - move16(); - BASOP_SATURATE_WARNING_ON_EVS -#endif } ELSE { diff --git a/lib_enc/arith_coder_enc_fx.c b/lib_enc/arith_coder_enc_fx.c index 40c1c6b7b..b97fd7931 100644 --- a/lib_enc/arith_coder_enc_fx.c +++ b/lib_enc/arith_coder_enc_fx.c @@ -72,11 +72,7 @@ static Word16 tcx_arith_estimate_scale( s1 = norm_l( abs_spectrum[k] ); } -#ifdef BASOP_NOGLOB tmp = mult_r( round_fx_o( L_shl( abs_spectrum[k], s1 ), &Overflow ), envelope[k] ); -#else /* BASOP_NOGLOB */ - tmp = mult_r( round_fx( L_shl( abs_spectrum[k], s1 ) ), envelope[k] ); -#endif /* BASOP_NOGLOB */ L_tmp = L_mult0( tmp, tmp ); tmp = sub( shl( s1, 1 ), 1 ); @@ -93,11 +89,7 @@ static Word16 tcx_arith_estimate_scale( /* scale and accumulate */ BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB accu = L_add_sat( accu, L_shr( L_tmp, sub( tmp, s ) ) ); -#else - accu = L_add( accu, L_shr( L_tmp, sub( tmp, s ) ) ); -#endif BASOP_SATURATE_WARNING_ON_EVS; } s = sub( shl( add( abs_spectrum_e, envelope_e ), 1 ), s ); @@ -387,13 +379,7 @@ static Word16 tcx_arith_rateloop( scale_max = tcx_arith_find_max_scale( abs_spectrum, abs_spectrum_e, L_frame, envelope, envelope_e, exps, deadzone, scale_e ); -#ifdef BASOP_NOGLOB scale = shl_o( scale, sub( tmp, *scale_e ), &Overflow ); -#else - BASOP_SATURATE_WARNING_OFF_EVS; - scale = shl( scale, sub( tmp, *scale_e ) ); - BASOP_SATURATE_WARNING_ON_EVS; -#endif scale = s_min( scale, scale_max ); scale_best = scale; @@ -454,13 +440,7 @@ static Word16 tcx_arith_rateloop( { /* Update estimator temporal compensation factor */ tmp = BASOP_Util_Divide3232_Scale( L_mult0( target_bits, 1 << 9 ), bits, &s ); -#ifdef BASOP_NOGLOB tmp = shl_o( mult_r( *target_bits_fac, tmp ), s, &Overflow ); -#else - BASOP_SATURATE_WARNING_OFF_EVS; - tmp = shl( mult_r( *target_bits_fac, tmp ), s ); - BASOP_SATURATE_WARNING_ON_EVS; -#endif tmp = s_min( tmp, 20480 /*1.25f Q14*/ ); tmp = s_max( tmp, 12288 /*0.75f Q14*/ ); *target_bits_fac = tmp; @@ -490,15 +470,8 @@ static Word16 tcx_arith_rateloop( { /* adjust = 1.25f * target_bits / (float)bits; */ tmp = BASOP_Util_Divide3232_Scale( L_mult0( target_bits, 0x280 ), bits, &s ); -#ifdef BASOP_NOGLOB adjust = shl_o( tmp, sub( s, 1 ), &Overflow ); /* Q14 */ scale = shl_o( mult_r( scale, adjust ), 1, &Overflow ); -#else - BASOP_SATURATE_WARNING_OFF_EVS; /* adjust limited to <= 2.0, scale to <= scale_max */ - adjust = shl( tmp, sub( s, 1 ) ); /* Q14 */ - scale = shl( mult_r( scale, adjust ), 1 ); - BASOP_SATURATE_WARNING_ON_EVS; -#endif scale = s_min( scale, scale_max ); } } @@ -802,11 +775,7 @@ void tcx_arith_encode_envelope_fx( L_tmp2 = L_deposit_l( 0 ); FOR( k = 0; k <= kMax; k++ ) { -#ifdef BASOP_NOGLOB L_tmp2 = L_macNs_co( L_tmp2, q_spectrum[k], k, &Carry, &Overflow ); -#else /* BASOP_NOGLOB */ - L_tmp2 = L_macNs( L_tmp2, q_spectrum[k], k ); -#endif if ( signs[k] != 0 ) L_tmp = L_mult( q_spectrum[k], -( 1 << ( 30 - SPEC_EXP_DEC ) ) ); diff --git a/lib_enc/avq_cod_fx.c b/lib_enc/avq_cod_fx.c index c5a101981..202d60e51 100644 --- a/lib_enc/avq_cod_fx.c +++ b/lib_enc/avq_cod_fx.c @@ -55,11 +55,7 @@ void AVQ_cod_fx( /* o: comfort noise gain factor Lener = L_shl( 4, shl( Q_in, 1 ) ); /* to set ebits >= 0 */ FOR( i = 0; i < 8; i++ ) { -#ifdef BASOP_NOGLOB Lener = L_mac_o( Lener, xri[l * 8 + i], xri[l * 8 + i], &Overflow ); -#else - Lener = L_mac( Lener, xri[l * 8 + i], xri[l * 8 + i] ); -#endif } /* estimated bit consumption when gain=1 */ /* ebits[l] = 5.0 * FAC_LOG2 * (Word16)log10(ener * 0.5) */ @@ -124,11 +120,7 @@ void AVQ_cod_fx( /* o: comfort noise gain factor /* estimated gain (when offset=0, estimated gain=1) */ f_tmp = L_Extract_lc( Ltmp, &e_tmp ); tmp16 = extract_l( Pow2( 14, f_tmp ) ); -#ifdef BASOP_NOGLOB Lgain = L_shl_sat( tmp16, e_tmp ); -#else - Lgain = L_shl( tmp16, e_tmp ); -#endif /* gain_inv = 1.0f / gain */ e_tmp = norm_l( Lgain ); tmp16 = extract_h( L_shl( Lgain, e_tmp ) ); diff --git a/lib_enc/bass_psfilter_enc_fx.c b/lib_enc/bass_psfilter_enc_fx.c index ec6f2d049..a1d672fe0 100644 --- a/lib_enc/bass_psfilter_enc_fx.c +++ b/lib_enc/bass_psfilter_enc_fx.c @@ -129,11 +129,7 @@ Word16 bass_pf_enc_fx( /* gain = tmp/nrg; */ gain = BASOP_Util_Divide3232_Scale( tmp, nrg, &tmp16 ); BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB gain = shl_o( gain, tmp16, &Overflow ); /* Q15 */ -#else /* BASOP_NOGLOB */ - gain = shl( gain, tmp16 ); /* Q15 */ -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS; if ( gain < 0 ) @@ -157,26 +153,14 @@ Word16 bass_pf_enc_fx( FOR( i = 0; i < lg; i++ ) { tmp32 = L_msu0( 0, gain, syn[i + i_subfr - T] ); -#ifdef BASOP_NOGLOB tmp32 = L_msu0_o( tmp32, gain, syn[i + i_subfr + T], &Overflow ); tmp16 = mac_ro( tmp32, gain, syn[i + i_subfr], &Overflow ); /* Q0 */ -#else - tmp32 = L_msu0( tmp32, gain, syn[i + i_subfr + T] ); - tmp16 = mac_r( tmp32, gain, syn[i + i_subfr] ); /* Q0 */ -#endif lp_error = Mpy_32_16_1( lp_error, 29491 /*0.9f Q15*/ ); -#ifdef BASOP_NOGLOB lp_error = L_mac_o( lp_error, tmp16, 0x1000, &Overflow ); /* Q13 */ tmp16 = round_fx_o( L_shl_o( lp_error, s1, &Overflow ), &Overflow ); /* Q0+s1-3 */ ener2 = L_mac0_o( ener2, tmp16, tmp16, &Overflow ); /* Q0+(s1-3)*2 */ -#else - lp_error = L_mac( lp_error, tmp16, 0x1000 ); /* Q13 */ - - tmp16 = round_fx( L_shl( lp_error, s1 ) ); /* Q0+s1-3 */ - ener2 = L_mac0( ener2, tmp16, tmp16 ); /* Q0+(s1-3)*2 */ -#endif } } @@ -185,25 +169,13 @@ Word16 bass_pf_enc_fx( FOR( i = lg; i < l_subfr; i++ ) { tmp32 = L_mult0( gain, syn[i + i_subfr] ); -#ifdef BASOP_NOGLOB tmp32 = L_msu0_o( tmp32, gain, syn[i + i_subfr - T], &Overflow ); /* Q0 */ tmp16 = round_fx_o( tmp32, &Overflow ); -#else - tmp32 = L_msu0( tmp32, gain, syn[i + i_subfr - T] ); /* Q0 */ - tmp16 = round_fx( tmp32 ); -#endif lp_error = Mpy_32_16_1( lp_error, 29491 /*0.9f Q15*/ ); -#ifdef BASOP_NOGLOB lp_error = L_mac_o( lp_error, tmp16, 0x1000, &Overflow ); /* Q13 */ tmp16 = round_fx_o( L_shl_o( lp_error, s1, &Overflow ), &Overflow ); /* Q0+s1-3 */ ener2 = L_mac0_o( ener2, tmp16, tmp16, &Overflow ); /* Q0+(s1-3)*2 */ -#else - lp_error = L_mac( lp_error, tmp16, 0x1000 ); /* Q13 */ - - tmp16 = round_fx( L_shl( lp_error, s1 ) ); /* Q0+s1-3 */ - ener2 = L_mac0( ener2, tmp16, tmp16 ); /* Q0+(s1-3)*2 */ -#endif } } @@ -238,11 +210,7 @@ Word16 bass_pf_enc_fx( tmp32 = L_deposit_l( 1 ); tmp16 = BASOP_Util_Divide3232_Scale( tmp, tmp32, &st ); BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB tmp16 = shl_o( tmp16, sub( st, 2 ), &Overflow ); /* Q15 */ -#else /* BASOP_NOGLOB */ - tmp16 = shl( tmp16, sub( st, 2 ) ); /* Q15 */ -#endif /* BASOP_NOGLOB */ if ( GT_16( tmp16, 16384 /*0.5f Q15*/ ) ) { @@ -268,13 +236,8 @@ Word16 bass_pf_enc_fx( tmp32 = L_mac( tmp32, tmp16, syn[i + i_subfr] ); noise_in[i] = round_fx( L_shl( tmp32, s2 ) ); /* Q0+s2 */ -#ifdef BASOP_NOGLOB error_in[i] = sub_o( orig[i + i_subfr], syn[i + i_subfr], &Overflow ); /*Q0*/ move16(); -#else - error_in[i] = sub( orig[i + i_subfr], syn[i + i_subfr] ); /*Q0*/ - move16(); -#endif } } @@ -287,13 +250,8 @@ Word16 bass_pf_enc_fx( noise_in[i] = round_fx( L_shl( tmp32, s2 ) ); /* Q0+s2 */ move16(); -#ifdef BASOP_NOGLOB error_in[i] = sub_o( orig[i + i_subfr], syn[i + i_subfr], &Overflow ); /*Q0*/ move16(); -#else - error_in[i] = sub( orig[i + i_subfr], syn[i + i_subfr] ); /*Q0*/ - move16(); -#endif } } } @@ -411,13 +369,8 @@ Word16 bass_pf_enc_fx( /* *gain_factor_param = (int)(-2.f*(cross_n_d/nrg_n)+0.5f); */ tmp16 = BASOP_Util_Divide3232_Scale( cross_n_d, nrg_n, &st ); /* Q15-st-s3+s4 */ BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB tmp16 = shl_sat( negate( tmp16 ), add( sub( add( st, s3 ), s4 ), 1 - 14 ) ); /* Q1 */ tmp16 = shr( add_sat( tmp16, 1 ), 1 ); /* Q0 */ -#else - tmp16 = shl( negate( tmp16 ), add( sub( add( st, s3 ), s4 ), 1 - 14 ) ); /* Q1 */ - tmp16 = shr( add( tmp16, 1 ), 1 ); /* Q0 */ -#endif BASOP_SATURATE_WARNING_ON_EVS; *gain_factor_param = tmp16; diff --git a/lib_enc/bw_detect_fx.c b/lib_enc/bw_detect_fx.c index 6d2df38cd..f44452113 100644 --- a/lib_enc/bw_detect_fx.c +++ b/lib_enc/bw_detect_fx.c @@ -133,11 +133,7 @@ void bw_detect_fx( move32(); } L_tmp = BASOP_Util_Log2( cldfb_bin[0] ); /*(log2(660423549*2^(-31))/64)*2^31*/ -#ifdef BASOP_NOGLOB L_tmp = L_add_o( L_tmp, L_shl( L_deposit_l( cldfb_bin_Exp[0] ), 31 - LD_DATA_SCALE ), &Overflow ); /* Q25 */ -#else /* BASOP_NOGLOB */ - L_tmp = L_add( L_tmp, L_shl( L_deposit_l( cldfb_bin_Exp[0] ), 31 - LD_DATA_SCALE ) ); /* Q25 */ -#endif /* BASOP_NOGLOB */ cldfb_bin[0] = Mpy_32_16_1( L_tmp, 9864 /*1.0f/3.3219280948873623478703194294894f Q15*/ ); move32(); /* 1/log2(10) */ /* Q25 */ @@ -306,11 +302,7 @@ void bw_detect_fx( FOR( i = 0; i < BWD_TOTAL_WIDTH; i++ ) { -#ifdef BASOP_NOGLOB spect[i] = round_fx_o( L_shr_o( spect32[i], Q_dct, &Overflow ), &Overflow ); -#else /* BASOP_NOGLOB */ - spect[i] = round_fx( L_shr( spect32[i], Q_dct ) ); -#endif move16(); } Q_dct = -2; @@ -342,11 +334,7 @@ void bw_detect_fx( pt1 = &spect[i_mult2( i, bin_width )]; FOR( j = 0; j < bin_width; j++ ) { -#ifdef BASOP_NOGLOB sum32 = L_mac0_o( sum32, *pt1, *pt1, &Overflow ); -#else - sum32 = L_mac0( sum32, *pt1, *pt1 ); -#endif pt1++; } diff --git a/lib_enc/cng_enc.c b/lib_enc/cng_enc.c index ea957da8c..15dc89516 100644 --- a/lib_enc/cng_enc.c +++ b/lib_enc/cng_enc.c @@ -265,11 +265,7 @@ static Word16 shb_DTX_ivas_fx( shb_ener_fx = L_deposit_l( 0 ); FOR( i = 0; i < L_FRAME16k; i++ ) { -#ifdef BASOP_NOGLOB shb_ener_fx = L_mac_sat( shb_ener_fx, shb_old_speech_fx[i], shb_old_speech_fx[i] ); // ( Q0 + Q0 + Q1 ) --> Q1 due to left shift in L_mac -#else - shb_ener_fx = L_mac( shb_ener_fx, shb_old_speech_fx[i], shb_old_speech_fx[i] ); -#endif } shb_ener_fx = L_add( Mpy_32_16_1( shb_ener_fx, 102 ), 1 ); /* ( 1 / L_FRAME16K ) -> 102 in Q15, shb_ener_fx in Q1 */ @@ -277,11 +273,7 @@ static Word16 shb_DTX_ivas_fx( wb_ener_fx = L_deposit_l( 0 ); FOR( i = 0; i < st->L_frame; i++ ) { -#ifdef BASOP_NOGLOB wb_ener_fx = L_mac_o( wb_ener_fx, syn_12k8_16k_fx[i], syn_12k8_16k_fx[i], &Overflow ); // ( Q0 + Q0 + Q1 ) --> Q1 due to left shift in L_mac -#else - wb_ener_fx = L_mac( wb_ener_fx, syn_12k8_16k[i], syn_12k8_16k[i] ); -#endif } wb_ener_fx = L_add( Mpy_32_16_1( wb_ener_fx, 128 ), 1 ); /* 128 in Q15, wb_ener_fx in Q1 */ @@ -291,11 +283,7 @@ static Word16 shb_DTX_ivas_fx( exp = sub( 30 - 1, exp ); wb_ener_fx = Mpy_32_16( exp, fra, LG10 ); -#ifdef BASOP_NOGLOB log_wb_ener_fx = round_fx_o( L_shl_o( wb_ener_fx, 10, &Overflow ), &Overflow ); /* log_wb_ener_fx in Q8 */ -#else - log_wb_ener_fx = round_fx( L_shl( wb_ener_fx, 10 ) ); /* log_wb_ener_fx in Q8 */ -#endif exp = norm_l( shb_ener_fx ); fra = Log2_norm_lc( L_shl( shb_ener_fx, exp ) ); exp = sub( 30 - 1, exp ); @@ -320,11 +308,7 @@ static Word16 shb_DTX_ivas_fx( } -#ifdef BASOP_NOGLOB log_shb_ener_fx = sub_o( round_fx_o( L_shl_o( shb_ener_fx, 10, &Overflow ), &Overflow ), att_fx, &Overflow ); /* log_shb_ener_fx in Q8 */ -#else - log_shb_ener_fx = sub( round_fx( L_shl( shb_ener_fx, 10 ) ), att_fx ); /* log_shb_ener_fx in Q8 */ -#endif IF( st->hDtxEnc->first_CNG == 0 ) { diff --git a/lib_enc/cng_enc_fx.c b/lib_enc/cng_enc_fx.c index e2c81a8d1..057a07d82 100644 --- a/lib_enc/cng_enc_fx.c +++ b/lib_enc/cng_enc_fx.c @@ -644,11 +644,7 @@ void CNG_enc_fx( FOR( i = 0; i < M; i++ ) { dev = abs_s( sub( lsp_tmp[i], lsp_new[i] ) ); /*Q15 */ -#ifdef BASOP_NOGLOB dist = add_o( dist, dev, &Overflow ); /*Q15 */ -#else - dist = add( dist, dev ); /*Q15 */ -#endif if ( GT_16( dev, max_dev ) ) { max_dev = dev; @@ -682,31 +678,19 @@ void CNG_enc_fx( FOR( j = 0; j < m1; j++ ) { /* env[i] += tmp_env[j*NUM_ENV_CNG+i]; */ -#ifdef BASOP_NOGLOB L_tmp = L_add_sat( L_tmp, tmp_env[j * NUM_ENV_CNG + i] ); -#else - L_tmp = L_add( L_tmp, tmp_env[j * NUM_ENV_CNG + i] ); -#endif } /* env[i] /= (float)m1; */ /* env[i] = env[i] - 2*hTdCngEnc->lp_ener_fx; */ IF( EQ_16( m1, 1 ) ) { -#ifdef BASOP_NOGLOB L_tmp = L_sub_sat( L_tmp, L_add_sat( hTdCngEnc->lp_ener_fx, hTdCngEnc->lp_ener_fx ) ); -#else - L_tmp = L_sub( L_tmp, L_add( hTdCngEnc->lp_ener_fx, hTdCngEnc->lp_ener_fx ) ); -#endif } ELSE { tmp1 = div_s( 1, m1 ); L_tmp = Mult_32_16( L_tmp, tmp1 ); -#ifdef BASOP_NOGLOB L_tmp = L_sub_sat( L_tmp, L_add_sat( hTdCngEnc->lp_ener_fx, hTdCngEnc->lp_ener_fx ) ); -#else - L_tmp = L_sub( L_tmp, L_add( hTdCngEnc->lp_ener_fx, hTdCngEnc->lp_ener_fx ) ); -#endif } env[i] = L_tmp; @@ -796,15 +780,9 @@ void CNG_enc_fx( FOR( i = 0; i < NUM_ENV_CNG; i++ ) { /* env[i] = 2.0f*(*ptR * *ptR + *ptI * *ptI)/L_FFT; */ -#ifdef BASOP_NOGLOB L_tmp = L_mult_o( *ptR, *ptR, &Overflow ); /* 2*Q_new+1 */ L_tmp = L_add_o( L_tmp, L_mult_o( *ptI, *ptI, &Overflow ), &Overflow ); /* 2*Q_new+1 */ L_tmp = L_add_o( L_tmp, L_tmp, &Overflow ); /* 2*Q_new+1 */ -#else /* BASOP_NOGLOB */ - L_tmp = L_mult( *ptR, *ptR ); /* 2*Q_new+1 */ - L_tmp = L_add( L_tmp, L_mult( *ptI, *ptI ) ); /* 2*Q_new+1 */ - L_tmp = L_add( L_tmp, L_tmp ); /* 2*Q_new+1 */ -#endif /* BASOP_NOGLOB */ L_tmp = Mult_32_16( L_tmp, 128 ); /* 2*Q_new+1 */ tmp1 = add( add( Q_new, Q_new ), 1 ); env[i] = L_shr( L_tmp, sub( tmp1, 6 ) ); @@ -834,15 +812,9 @@ void CNG_enc_fx( L_tmp = L_mult0( tmpv, tmpv ); pt_res++; tmpv = shl( *pt_res, scale ); -#ifdef BASOP_NOGLOB L_tmp = L_mac0_sat( L_tmp, tmpv, tmpv ); /* 2*(Q_new+scale) */ pt_res++; L_ener = L_add_sat( L_ener, L_shr( L_tmp, 7 ) ); /* 2*(Q_new+scale)+1, divide by L_frame done here */ -#else - L_tmp = L_mac0( L_tmp, tmpv, tmpv ); /* 2*(Q_new+scale) */ - pt_res++; - L_ener = L_add( L_ener, L_shr( L_tmp, 7 ) ); /* 2*(Q_new+scale)+1, divide by L_frame done here */ -#endif } } ELSE /* L_FRAME16k */ @@ -853,15 +825,9 @@ void CNG_enc_fx( L_tmp = L_mult0( tmpv, tmpv ); pt_res++; tmpv = shl( *pt_res, scale ); -#ifdef BASOP_NOGLOB L_tmp = L_mac0_sat( L_tmp, tmpv, tmpv ); /* 2*(Q_new+scale) */ pt_res++; L_ener = L_add_sat( L_ener, L_shr( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7 ) ); /* 2*(Q_new+scale)+15+1-16+1, divide by L_frame done here */ -#else - L_tmp = L_mac0( L_tmp, tmpv, tmpv ); /* 2*(Q_new+scale) */ - pt_res++; - L_ener = L_add( L_ener, L_shr( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7 ) ); /* 2*(Q_new+scale)+15+1-16+1, divide by L_frame done here */ -#endif } } /* convert log2 of residual signal energy */ @@ -891,11 +857,7 @@ void CNG_enc_fx( L_tmp1 = L_add( env[i], 0 ); FOR( j = 0; j < hDtxEnc->cng_hist_size; j++ ) { -#ifdef BASOP_NOGLOB L_tmp1 = L_add_sat( L_tmp1, hTdCngEnc->cng_res_env_fx[j * NUM_ENV_CNG + i] ); -#else - L_tmp1 = L_add( L_tmp1, hTdCngEnc->cng_res_env_fx[j * NUM_ENV_CNG + i] ); -#endif } L_tmp = L_add( hTdCngEnc->cng_res_env_fx[max_idx1[0] * NUM_ENV_CNG + i], hTdCngEnc->cng_res_env_fx[max_idx1[1] * NUM_ENV_CNG + i] ); L_tmp1 = L_sub( L_tmp1, L_tmp ); @@ -1047,11 +1009,7 @@ void CNG_enc_fx( L_tmp = L_shl( hTdCngEnc->Enew_fx, exp ); /*Q(exp+6) */ L_tmp = Mult_32_16( L_tmp, shl( st_fx->L_frame, 5 ) ); /* Q(exp+6+5-15=exp-4) */ -#ifdef BASOP_NOGLOB L_tmp = L_shr_sat( L_tmp, sub( exp, 10 ) ); /* Q6 */ -#else - L_tmp = L_shr( L_tmp, sub( exp, 10 ) ); /* Q6 */ -#endif exp = norm_l( L_tmp ); fra = Log2_norm_lc( L_shl( L_tmp, exp ) ); @@ -1106,11 +1064,7 @@ void CNG_enc_fx( exp = norm_l( L_tmp ); L_tmp = L_shl( L_tmp, exp ); /*Q(exp+6)*/ tmp1 = extract_h( L_tmp ); /*Q(exp+6-16)=exp-10*/ -#ifdef BASOP_NOGLOB L_tmp = L_mult_o( tmp1, tmp1, &Overflow ); /*Q(2*exp - 19)*/ -#else /* BASOP_NOGLOB */ - L_tmp = L_mult( tmp1, tmp1 ); /*Q(2*exp - 19)*/ -#endif L_tmp = L_shr( L_tmp, sub( add( exp, exp ), 36 ) ); /* Q17 */ d = L_add( d, L_tmp ); } @@ -1901,31 +1855,19 @@ void CNG_enc_ivas_fx( FOR( j = 0; j < m1; j++ ) { /* env[i] += tmp_env[j*NUM_ENV_CNG+i]; */ -#ifdef BASOP_NOGLOB L_tmp = L_add_sat( L_tmp, tmp_env[j * NUM_ENV_CNG + i] ); -#else - L_tmp = L_add( L_tmp, tmp_env[j * NUM_ENV_CNG + i] ); -#endif } /* env[i] /= (float)m1; */ /* env[i] = env[i] - 2*hTdCngEnc->lp_ener_fx; */ IF( EQ_16( m1, 1 ) ) { -#ifdef BASOP_NOGLOB L_tmp = L_sub_sat( L_tmp, L_add_sat( hTdCngEnc->lp_ener_fx, hTdCngEnc->lp_ener_fx ) ); -#else - L_tmp = L_sub( L_tmp, L_add( hTdCngEnc->lp_ener_fx, hTdCngEnc->lp_ener_fx ) ); -#endif } ELSE { tmp1 = div_s( 1, m1 ); L_tmp = Mult_32_16( L_tmp, tmp1 ); -#ifdef BASOP_NOGLOB L_tmp = L_sub_sat( L_tmp, L_add_sat( hTdCngEnc->lp_ener_fx, hTdCngEnc->lp_ener_fx ) ); -#else - L_tmp = L_sub( L_tmp, L_add( hTdCngEnc->lp_ener_fx, hTdCngEnc->lp_ener_fx ) ); -#endif } env[i] = L_tmp; /* Q6*/ @@ -2016,15 +1958,9 @@ void CNG_enc_ivas_fx( FOR( i = 0; i < NUM_ENV_CNG; i++ ) { /* env[i] = 2.0f*(*ptR * *ptR + *ptI * *ptI)/L_FFT; */ -#ifdef BASOP_NOGLOB L_tmp = L_mult_o( *ptR, *ptR, &Overflow ); /* 2*Q_new+1 */ L_tmp = L_add_o( L_tmp, L_mult_o( *ptI, *ptI, &Overflow ), &Overflow ); /* 2*Q_new+1 */ L_tmp = L_add_o( L_tmp, L_tmp, &Overflow ); /* 2*Q_new+1 */ -#else /* BASOP_NOGLOB */ - L_tmp = L_mult( *ptR, *ptR ); /* 2*Q_new+1 */ - L_tmp = L_add( L_tmp, L_mult( *ptI, *ptI ) ); /* 2*Q_new+1 */ - L_tmp = L_add( L_tmp, L_tmp ); /* 2*Q_new+1 */ -#endif /* BASOP_NOGLOB */ L_tmp = Mult_32_16( L_tmp, 128 ); /* 2*Q_new+1 */ tmp1 = add( add( Q_new, Q_new ), 1 ); env[i] = L_shr( L_tmp, sub( tmp1, 6 ) ); @@ -2113,11 +2049,7 @@ void CNG_enc_ivas_fx( L_tmp1 = L_add( env[i], 0 ); FOR( j = 0; j < hDtxEnc->cng_hist_size; j++ ) { -#ifdef BASOP_NOGLOB L_tmp1 = L_add_sat( L_tmp1, hTdCngEnc->cng_res_env_fx[j * NUM_ENV_CNG + i] ); -#else - L_tmp1 = L_add( L_tmp1, hTdCngEnc->cng_res_env_fx[j * NUM_ENV_CNG + i] ); -#endif } L_tmp = L_add( hTdCngEnc->cng_res_env_fx[max_idx1[0] * NUM_ENV_CNG + i], hTdCngEnc->cng_res_env_fx[max_idx1[1] * NUM_ENV_CNG + i] ); L_tmp1 = L_sub( L_tmp1, L_tmp ); @@ -2267,11 +2199,7 @@ void CNG_enc_ivas_fx( L_tmp = L_shl( hTdCngEnc->Enew_fx, exp ); /*Q(exp+6) */ L_tmp = Mult_32_16( L_tmp, shl( st_fx->L_frame, 5 ) ); /* Q(exp+6+5-15=exp-4) */ -#ifdef BASOP_NOGLOB L_tmp = L_shr_sat( L_tmp, sub( exp, 10 ) ); /* Q6 */ -#else - L_tmp = L_shr( L_tmp, sub( exp, 10 ) ); /* Q6 */ -#endif exp = norm_l( L_tmp ); fra = Log2_norm_lc( L_shl( L_tmp, exp ) ); @@ -2327,11 +2255,7 @@ void CNG_enc_ivas_fx( exp = norm_l( L_tmp ); L_tmp = L_shl( L_tmp, exp ); /*Q(exp+6)*/ tmp1 = extract_h( L_tmp ); /*Q(exp+6-16)=exp-10*/ -#ifdef BASOP_NOGLOB L_tmp = L_mult_o( tmp1, tmp1, &Overflow ); /*Q(2*exp - 19)*/ -#else /* BASOP_NOGLOB */ - L_tmp = L_mult( tmp1, tmp1 ); /*Q(2*exp - 19)*/ -#endif L_tmp = L_shr( L_tmp, sub( add( exp, exp ), 36 ) ); /* Q17 */ d = L_add( d, L_tmp ); /* Q17 */ } @@ -2647,11 +2571,7 @@ static Word16 shb_DTX_fx( shb_ener_fx = L_deposit_l( 0 ); FOR( i = 0; i < L_FRAME16k; i++ ) { -#ifdef BASOP_NOGLOB shb_ener_fx = L_mac_sat( shb_ener_fx, shb_old_speech_fx[i], shb_old_speech_fx[i] ); -#else - shb_ener_fx = L_mac( shb_ener_fx, shb_old_speech_fx[i], shb_old_speech_fx[i] ); -#endif } shb_ener_fx = L_add( Mpy_32_16_1( shb_ener_fx, 102 ), 1 ); /* 102 in Q15, shb_ener_fx in Q1 */ @@ -2659,11 +2579,7 @@ static Word16 shb_DTX_fx( wb_ener_fx = L_deposit_l( 0 ); FOR( i = 0; i < st_fx->L_frame; i++ ) { -#ifdef BASOP_NOGLOB wb_ener_fx = L_mac_o( wb_ener_fx, syn_12k8_16k[i], syn_12k8_16k[i], &Overflow ); -#else - wb_ener_fx = L_mac( wb_ener_fx, syn_12k8_16k[i], syn_12k8_16k[i] ); -#endif } wb_ener_fx = L_add( Mpy_32_16_1( wb_ener_fx, 128 ), 1 ); /* 128 in Q15, wb_ener_fx in Q1 */ @@ -2672,11 +2588,7 @@ static Word16 shb_DTX_fx( fra = Log2_norm_lc( L_shl( wb_ener_fx, exp ) ); exp = sub( 30 - 1, exp ); wb_ener_fx = Mpy_32_16( exp, fra, LG10 ); -#ifdef BASOP_NOGLOB log_wb_ener_fx = round_fx_o( L_shl_o( wb_ener_fx, 10, &Overflow ), &Overflow ); /* log_wb_ener_fx in Q8 */ -#else - log_wb_ener_fx = round_fx( L_shl( wb_ener_fx, 10 ) ); /* log_wb_ener_fx in Q8 */ -#endif exp = norm_l( shb_ener_fx ); fra = Log2_norm_lc( L_shl( shb_ener_fx, exp ) ); exp = sub( 30 - 1, exp ); @@ -2695,11 +2607,7 @@ static Word16 shb_DTX_fx( move16(); } -#ifdef BASOP_NOGLOB log_shb_ener_fx = sub_o( round_fx_o( L_shl_o( shb_ener_fx, 10, &Overflow ), &Overflow ), att, &Overflow ); /* log_shb_ener_fx in Q8 */ -#else - log_shb_ener_fx = sub( round_fx( L_shl( shb_ener_fx, 10 ) ), att ); /* log_shb_ener_fx in Q8 */ -#endif IF( hDtxEnc->first_CNG == 0 ) { hTdCngEnc->mov_wb_cng_ener_fx = log_wb_ener_fx; diff --git a/lib_enc/cod2t32_fx.c b/lib_enc/cod2t32_fx.c index cbe006f53..c9bbe5f30 100644 --- a/lib_enc/cod2t32_fx.c +++ b/lib_enc/cod2t32_fx.c @@ -64,19 +64,11 @@ void acelp_2t32_fx( L_cor = L_deposit_h( 1 ); FOR( i = 0; i < NB_POS_FCB_2T; i++ ) { -#ifdef BASOP_NOGLOB L_cor = L_mac_o( L_cor, *ptr_h1, *ptr_h1, &Overflow ); -#else - L_cor = L_mac( L_cor, *ptr_h1, *ptr_h1 ); -#endif ptr_h1++; *p1-- = extract_h( L_cor ); move16(); /*Q9 Q7*/ -#ifdef BASOP_NOGLOB L_cor = L_mac_o( L_cor, *ptr_h1, *ptr_h1, &Overflow ); -#else - L_cor = L_mac( L_cor, *ptr_h1, *ptr_h1 ); -#endif ptr_h1++; *p0-- = extract_h( L_cor ); move16(); /*Q9 Q7*/ @@ -117,31 +109,17 @@ void acelp_2t32_fx( L_cor = L_mult( *ptr_h1++, *ptr_h2++ ); // Q(12+12+1) FOR( i = k; i < NB_POS_FCB_2T - 1; i++ ) { -#ifdef BASOP_NOGLOB *p1 = round_fx_o( L_cor, &Overflow ); // Q(25-16) L_cor = L_mac_o( L_cor, *ptr_h1++, *ptr_h2++, &Overflow ); -#else - *p1 = round_fx( L_cor ); - L_cor = L_mac( L_cor, *ptr_h1++, *ptr_h2++ ); -#endif -#ifdef BASOP_NOGLOB *p0 = round_fx_o( L_cor, &Overflow ); // Q(9) L_cor = L_mac_o( L_cor, *ptr_h1++, *ptr_h2++, &Overflow ); -#else - *p0 = round_fx( L_cor ); - L_cor = L_mac( L_cor, *ptr_h1++, *ptr_h2++ ); -#endif move16(); move16(); p1 -= ( NB_POS_FCB_2T + 1 ); p0 -= ( NB_POS_FCB_2T + 1 ); } -#ifdef BASOP_NOGLOB *p1 = round_fx_o( L_cor, &Overflow ); // Q9 -#else - *p1 = round_fx( L_cor ); -#endif pos -= NB_POS_FCB_2T; move16(); pos2--; @@ -244,17 +222,9 @@ void acelp_2t32_fx( FOR( i1 = 1; i1 < L_SUBFR; i1 += STEP ) { ps2 = add( ps1, dn_p[i1] ); -#ifdef BASOP_NOGLOB alp2 = add_o( alp1, add_o( *p1++, *p2++, &Overflow ), &Overflow ); -#else - alp2 = add( alp1, add( *p1++, *p2++ ) ); -#endif sq = mult( ps2, ps2 ); -#ifdef BASOP_NOGLOB s = L_msu_o( L_mult( alpk, sq ), psk, alp2, &Overflow ); -#else - s = L_msu( L_mult( alpk, sq ), psk, alp2 ); -#endif IF( s > 0 ) { psk = sq; @@ -365,19 +335,11 @@ void acelp_2t32_ivas_fx( L_cor = L_deposit_h( 1 ); FOR( i = 0; i < NB_POS_FCB_2T; i++ ) { -#ifdef BASOP_NOGLOB L_cor = L_mac_o( L_cor, *ptr_h1, *ptr_h1, &Overflow ); -#else - L_cor = L_mac( L_cor, *ptr_h1, *ptr_h1 ); -#endif ptr_h1++; *p1-- = extract_h( L_cor ); move16(); /*Q9 Q7*/ -#ifdef BASOP_NOGLOB L_cor = L_mac_o( L_cor, *ptr_h1, *ptr_h1, &Overflow ); -#else - L_cor = L_mac( L_cor, *ptr_h1, *ptr_h1 ); -#endif ptr_h1++; *p0-- = extract_h( L_cor ); move16(); /*Q9 Q7*/ @@ -418,31 +380,17 @@ void acelp_2t32_ivas_fx( L_cor = L_mult( *ptr_h1++, *ptr_h2++ ); // Q25 FOR( i = k; i < NB_POS_FCB_2T - 1; i++ ) { -#ifdef BASOP_NOGLOB *p1 = round_fx_o( L_cor, &Overflow ); // Q9 L_cor = L_mac_o( L_cor, *ptr_h1++, *ptr_h2++, &Overflow ); -#else - *p1 = round_fx( L_cor ); - L_cor = L_mac( L_cor, *ptr_h1++, *ptr_h2++ ); -#endif -#ifdef BASOP_NOGLOB *p0 = round_fx_o( L_cor, &Overflow ); // Q9 L_cor = L_mac_o( L_cor, *ptr_h1++, *ptr_h2++, &Overflow ); -#else - *p0 = round_fx( L_cor ); - L_cor = L_mac( L_cor, *ptr_h1++, *ptr_h2++ ); -#endif move16(); move16(); p1 -= ( NB_POS_FCB_2T + 1 ); p0 -= ( NB_POS_FCB_2T + 1 ); } -#ifdef BASOP_NOGLOB *p1 = round_fx_o( L_cor, &Overflow ); -#else - *p1 = round_fx( L_cor ); -#endif pos -= NB_POS_FCB_2T; move16(); pos2 = sub( pos2, 1 ); @@ -546,17 +494,9 @@ void acelp_2t32_ivas_fx( FOR( i1 = 1; i1 < L_SUBFR; i1 += STEP ) { ps2 = add( ps1, dn_p[i1] ); -#ifdef BASOP_NOGLOB alp2 = add_o( alp1, add_o( *p1++, *p2++, &Overflow ), &Overflow ); -#else - alp2 = add( alp1, add( *p1++, *p2++ ) ); -#endif sq = mult( ps2, ps2 ); -#ifdef BASOP_NOGLOB s = L_msu_o( L_mult( alpk, sq ), psk, alp2, &Overflow ); -#else - s = L_msu( L_mult( alpk, sq ), psk, alp2 ); -#endif IF( s > 0 ) { psk = sq; diff --git a/lib_enc/cod_ace_fx.c b/lib_enc/cod_ace_fx.c index bea89f511..e701b8e46 100644 --- a/lib_enc/cod_ace_fx.c +++ b/lib_enc/cod_ace_fx.c @@ -354,11 +354,7 @@ Word16 coder_acelp_fx( /* o : SEGSNR for CL decision * hLPDmem->mem_w0 = sub( xn[L_SUBFR - 1], round_fx( L_shl( Ltmp, 1 ) ) ); move16(); BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB hLPDmem->mem_w0 = shr_sat( hLPDmem->mem_w0, shift ); /*Qnew-1*/ -#else - hLPDmem->mem_w0 = shr( hLPDmem->mem_w0, shift ); /*Qnew-1*/ -#endif move16(); BASOP_SATURATE_WARNING_ON_EVS; @@ -397,31 +393,13 @@ Word16 coder_acelp_fx( /* o : SEGSNR for CL decision * Ltmp = Mpy_32_16_1( gain_code2, code2[i] ); Ltmp = L_shl( Ltmp, Q_new_p5 ); Ltmp = L_mac( Ltmp, gain_pit, exc[i + i_subfr] ); -#ifdef BASOP_NOGLOB exc2[i] = round_fx_sat( L_shl_o( Ltmp, 1, &Overflow ) ); -#else - BASOP_SATURATE_WARNING_OFF_EVS - exc2[i] = round_fx( L_shl( Ltmp, 1 ) ); - BASOP_SATURATE_WARNING_ON_EVS -#endif move16(); Ltmp2 = Mpy_32_16_1( gain_code, code[i] ); -#ifdef BASOP_NOGLOB Ltmp2 = L_shl_sat( Ltmp2, Q_new_p5 ); Ltmp = L_add_sat( Ltmp, Ltmp2 ); -#else - Ltmp2 = L_shl( Ltmp2, Q_new_p5 ); - Ltmp = L_add( Ltmp, Ltmp2 ); -#endif -#ifdef BASOP_NOGLOB Ltmp = L_shl_o( Ltmp, 1, &Overflow ); /* saturation can occur here */ exc[i + i_subfr] = round_fx_o( Ltmp, &Overflow ); -#else - BASOP_SATURATE_WARNING_OFF_EVS - Ltmp = L_shl( Ltmp, 1 ); /* saturation can occur here */ - BASOP_SATURATE_WARNING_ON_EVS - exc[i + i_subfr] = round_fx( Ltmp ); -#endif move16(); } #endif diff --git a/lib_enc/cod_tcx_fx.c b/lib_enc/cod_tcx_fx.c index ea0468587..5d7731ec3 100644 --- a/lib_enc/cod_tcx_fx.c +++ b/lib_enc/cod_tcx_fx.c @@ -69,11 +69,7 @@ void HBAutocorrelation_fx( FOR( i = 0; i < len; i += 1 ) { /* Test Addition */ -#ifdef BASOP_NOGLOB /* Critical Overflow, all operations below needs to check for Overflow if we want to ensure bit exactness */ L_mac0_o( L_sum, y[i], y[i], &Overflow ); -#else /* BASOP_NOGLOB */ - L_mac0( L_sum, y[i], y[i] ); -#endif /* BASOP_NOGLOB */ IF( Overflow ) { Overflow = 0; @@ -82,53 +78,29 @@ void HBAutocorrelation_fx( move16(); L_tmp = L_msu0( 0, y[i], y[i] ); L_tmp = L_shr( L_tmp, 1 ); -#ifdef BASOP_NOGLOB /* Only the sub can overflow if the current L_sum is negative and already close to MIN */ L_sum = L_add( L_shr( L_sub_o( L_sum, 1, &Overflow ), 1 ), 1 ); -#else - L_sum = L_add( L_shr( L_sub( L_sum, 1 ), 1 ), 1 ); -#endif -#ifdef BASOP_NOGLOB /* Critical Overflow */ L_sum = L_sub_o( L_sum, L_tmp, &Overflow ); -#else - L_sum = L_sub( L_sum, L_tmp ); -#endif FOR( j = i + 1; j < len; j++ ) { L_tmp = L_msu0( 0, y[j], y[j] ); L_tmp = L_shr( L_tmp, shift ); /* Test Addition */ -#ifdef BASOP_NOGLOB /* Critical Overflow */ L_sub_o( L_sum, L_tmp, &Overflow ); -#else /* BASOP_NOGLOB */ - L_sub( L_sum, L_tmp ); -#endif /* BASOP_NOGLOB */ IF( Overflow ) { Overflow = 0; move32(); shift = add( shift, 1 ); L_tmp = L_shr( L_tmp, 1 ); -#ifdef BASOP_NOGLOB /* Critical Overflow */ L_sum = L_add( L_shr( L_sub_o( L_sum, 1, &Overflow ), 1 ), 1 ); -#else - L_sum = L_add( L_shr( L_sub( L_sum, 1 ), 1 ), 1 ); -#endif } -#ifdef BASOP_NOGLOB /* Critical Overflow */ L_sum = L_sub_o( L_sum, L_tmp, &Overflow ); -#else - L_sum = L_sub( L_sum, L_tmp ); -#endif } BREAK; } /* Perform Addition */ -#ifdef BASOP_NOGLOB /* Critical Overflow */ L_sum = L_mac0_o( L_sum, y[i], y[i], &Overflow ); -#else - L_sum = L_mac0( L_sum, y[i], y[i] ); -#endif } /* scale signal to avoid overflow in autocorrelation */ @@ -2313,11 +2285,7 @@ void QuantizeSpectrum_fx( tmp1 = BASOP_Util_Divide1616_Scale( sqTargetBits, tmp1, &tmp2 ); BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB hTcxEnc->tcx_target_bits_fac = shl_o( mult( hTcxEnc->tcx_target_bits_fac, tmp1 ), tmp2, &Overflow ); -#else /* BASOP_NOGLOB */ - hTcxEnc->tcx_target_bits_fac = shl( mult( hTcxEnc->tcx_target_bits_fac, tmp1 ), tmp2 ); -#endif /* BASOP_NOGLOB */ move16(); BASOP_SATURATE_WARNING_ON_EVS @@ -2437,11 +2405,7 @@ void QuantizeSpectrum_fx( } /* Limit low sqGain for avoiding saturation of the gain quantizer*/ -#ifdef BASOP_NOGLOB tmp1 = mult_r( shl_o( L_spec, 5, &Overflow ), 26214 /*128.f/NORM_MDCT_FACTOR Q15*/ ); -#else - tmp1 = mult_r( shl( L_spec, 5 ), 26214 /*128.f/NORM_MDCT_FACTOR Q15*/ ); -#endif s = 15 - 5 - 7; IF( L_spec >= 1024 ) { @@ -2455,11 +2419,7 @@ void QuantizeSpectrum_fx( IF( tmp2 >= 0 ) { BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB tmp2 = sub_sat( sqGain, shr_sat( tmp1, tmp2 ) ); -#else - tmp2 = sub( sqGain, shr( tmp1, tmp2 ) ); -#endif BASOP_SATURATE_WARNING_ON_EVS; } ELSE @@ -2512,11 +2472,7 @@ void QuantizeSpectrum_fx( spectrum[i] = L_mult( sqQ[i], 1 << ( 30 - SPEC_EXP_DEC ) ); move32(); /* noise filling seed */ -#ifdef BASOP_NOGLOB tmp32 = L_macNs_co( tmp32, abs_s( sqQ[i] ), i, &Carry, &Overflow ); -#else /* BASOP_NOGLOB */ - tmp32 = L_macNs( tmp32, abs_s( sqQ[i] ), i ); -#endif /* BASOP_NOGLOB */ } *spectrum_e = SPEC_EXP_DEC; move16(); @@ -3072,11 +3028,7 @@ void QuantizeSpectrum_fx( /* add part of current sub-window overlapping with previous window */ FOR( i = 0; i < L_ola; i++ ) { -#ifdef BASOP_NOGLOB tmpP16[i] = add_sat( tmpP16[i], win[i] ); -#else - tmpP16[i] = add( tmpP16[i], win[i] ); -#endif move16(); } /* copy new sub-window region not overlapping with previous window */ @@ -3154,11 +3106,7 @@ void QuantizeSpectrum_fx( /* add part of current sub-window overlapping with previous window */ FOR( i = 0; i < L_ola; i++ ) { -#ifdef BASOP_NOGLOB tmpP16[i] = add_sat( tmpP16[i], win[i] ); -#else - tmpP16[i] = add( tmpP16[i], win[i] ); -#endif move16(); } @@ -3284,11 +3232,7 @@ void QuantizeSpectrum_fx( /* scale output */ FOR( i = 0; i < L_frame; i++ ) { -#ifdef BASOP_NOGLOB xn_buf16[i] = shr_o( xn_buf16[i], Q, &Overflow ); -#else /* BASOP_NOGLOB */ - xn_buf16[i] = shr( xn_buf16[i], Q ); -#endif /* BASOP_NOGLOB */ move16(); } @@ -3348,11 +3292,7 @@ void QuantizeSpectrum_fx( tmp1 = sub( overlap, hTcxCfg->tcx_mdct_window_min_length ); FOR( i = 0; i < tmp1; i++ ) { -#ifdef BASOP_NOGLOB xn_buf16[i] = shl_sat( add_sat( xn_buf16[i], shr_sat( hTcxEnc->old_out_fx[i + nz], tmp2 ) ), TCX_IMDCT_HEADROOM ); -#else - xn_buf16[i] = shl( add( xn_buf16[i], shr( hTcxEnc->old_out_fx[i + nz], tmp2 ) ), TCX_IMDCT_HEADROOM ); -#endif move16(); } @@ -3361,31 +3301,19 @@ void QuantizeSpectrum_fx( FOR( ; i < tmp1; i++ ) { tmp3 = mult_r( shr( hTcxEnc->old_out_fx[i + nz], tmp2 ), hTcxCfg->tcx_mdct_window_minimum[i - overlap + hTcxCfg->tcx_mdct_window_min_length].v.re ); -#ifdef BASOP_NOGLOB xn_buf16[i] = shl_sat( add_sat( xn_buf16[i], tmp3 ), TCX_IMDCT_HEADROOM ); -#else - xn_buf16[i] = shl( add( xn_buf16[i], tmp3 ), TCX_IMDCT_HEADROOM ); -#endif move16(); } FOR( ; i < overlap; i++ ) { tmp3 = mult_r( shr( hTcxEnc->old_out_fx[i + nz], tmp2 ), hTcxCfg->tcx_mdct_window_minimum[overlap - 1 - i].v.im ); -#ifdef BASOP_NOGLOB xn_buf16[i] = shl_sat( add_sat( xn_buf16[i], tmp3 ), TCX_IMDCT_HEADROOM ); -#else - xn_buf16[i] = shl( add( xn_buf16[i], tmp3 ), TCX_IMDCT_HEADROOM ); -#endif move16(); } FOR( ; i < L_frame; i++ ) { -#ifdef BASOP_NOGLOB xn_buf16[i] = shl_sat( xn_buf16[i], TCX_IMDCT_HEADROOM ); -#else - xn_buf16[i] = shl( xn_buf16[i], TCX_IMDCT_HEADROOM ); -#endif move16(); } } @@ -3415,11 +3343,7 @@ void QuantizeSpectrum_fx( BASOP_SATURATE_WARNING_OFF_EVS; FOR( i = 0; i < overlap; i++ ) { -#ifdef BASOP_NOGLOB xn_buf16[i] = shl_sat( add( xn_buf16[i], hTcxEnc->Txnq[i] ), TCX_IMDCT_HEADROOM ); -#else - xn_buf16[i] = shl( add( xn_buf16[i], hTcxEnc->Txnq[i] ), TCX_IMDCT_HEADROOM ); -#endif move16(); } @@ -3427,11 +3351,7 @@ void QuantizeSpectrum_fx( { FOR( ; i < L_frame; i++ ) { -#ifdef BASOP_NOGLOB xn_buf16[i] = shl_sat( xn_buf16[i], TCX_IMDCT_HEADROOM ); -#else - xn_buf16[i] = shl( xn_buf16[i], TCX_IMDCT_HEADROOM ); -#endif move16(); } } @@ -3445,11 +3365,7 @@ void QuantizeSpectrum_fx( BASOP_SATURATE_WARNING_OFF_EVS; FOR( i = 0; i < L_frame; i++ ) { -#ifdef BASOP_NOGLOB xn_buf16[i] = shl_o( xn_buf16[i], TCX_IMDCT_HEADROOM, &Overflow ); -#else /* BASOP_NOGLOB */ - xn_buf16[i] = shl( xn_buf16[i], TCX_IMDCT_HEADROOM ); -#endif move16(); } BASOP_SATURATE_WARNING_ON_EVS; @@ -3953,11 +3869,7 @@ void QuantizeTCXSpectrum_fx( tmp1 = BASOP_Util_Divide1616_Scale( sqTargetBits, tmp1, &tmp2 ); BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB hTcxEnc->tcx_target_bits_fac = shl_o( mult( hTcxEnc->tcx_target_bits_fac, tmp1 ), tmp2, &Overflow ); -#else /* BASOP_NOGLOB */ - hTcxEnc->tcx_target_bits_fac = shl( mult( hTcxEnc->tcx_target_bits_fac, tmp1 ), tmp2 ); -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS if ( GT_16( hTcxEnc->tcx_target_bits_fac, 20480 /*1.25 in Q14*/ ) ) @@ -4240,11 +4152,7 @@ void QuantizeTCXSpectrum_fx( spectrum_fx[i] = L_mult( sqQ[i], 1 << ( 30 - SPEC_EXP_DEC ) ); move32(); /* noise filling seed */ -#ifdef BASOP_NOGLOB tmp32 = L_macNs_co( tmp32, abs_s( sqQ[i] ), i, &Carry, &Overflow ); -#else /* BASOP_NOGLOB */ - tmp32 = L_macNs( tmp32, abs_s( sqQ[i] ), i ); -#endif /* BASOP_NOGLOB */ } *spectrum_e = SPEC_EXP_DEC; move16(); @@ -5038,11 +4946,7 @@ void InternalTCXDecoder_fx( /* add part of current sub-window overlapping with previous window */ FOR( i = 0; i < L_ola; i++ ) { -#ifdef BASOP_NOGLOB tmpP16[i] = add_sat( tmpP16[i], win[i] ); -#else - tmpP16[i] = add( tmpP16[i], win[i] ); -#endif move16(); } /* copy new sub-window region not overlapping with previous window */ @@ -5120,11 +5024,7 @@ void InternalTCXDecoder_fx( /* add part of current sub-window overlapping with previous window */ FOR( i = 0; i < L_ola; i++ ) { -#ifdef BASOP_NOGLOB tmpP16[i] = add_sat( tmpP16[i], win[i] ); -#else - tmpP16[i] = add( tmpP16[i], win[i] ); -#endif move16(); } @@ -5250,11 +5150,7 @@ void InternalTCXDecoder_fx( /* scale output */ FOR( i = 0; i < L_frame; i++ ) { -#ifdef BASOP_NOGLOB xn_buf16[i] = shr_o( xn_buf16[i], Q, &Overflow ); -#else /* BASOP_NOGLOB */ - xn_buf16[i] = shr( xn_buf16[i], Q ); -#endif /* BASOP_NOGLOB */ move16(); } @@ -5314,11 +5210,7 @@ void InternalTCXDecoder_fx( tmp1 = sub( overlap, st->hTcxCfg->tcx_mdct_window_min_length ); FOR( i = 0; i < tmp1; i++ ) { -#ifdef BASOP_NOGLOB xn_buf16[i] = shl_sat( add_sat( xn_buf16[i], shr_sat( hTcxEnc->old_out_fx[i + nz], tmp2 ) ), TCX_IMDCT_HEADROOM ); -#else - xn_buf16[i] = shl( add( xn_buf16[i], shr( hTcxEnc->old_out_fx[i + nz], tmp2 ) ), TCX_IMDCT_HEADROOM ); -#endif move16(); } @@ -5327,31 +5219,19 @@ void InternalTCXDecoder_fx( FOR( ; i < tmp1; i++ ) { tmp3 = mult_r( shr( hTcxEnc->old_out_fx[i + nz], tmp2 ), st->hTcxCfg->tcx_mdct_window_minimum[i - overlap + st->hTcxCfg->tcx_mdct_window_min_length].v.re ); -#ifdef BASOP_NOGLOB xn_buf16[i] = shl_sat( add_sat( xn_buf16[i], tmp3 ), TCX_IMDCT_HEADROOM ); -#else - xn_buf16[i] = shl( add( xn_buf16[i], tmp3 ), TCX_IMDCT_HEADROOM ); -#endif move16(); } FOR( ; i < overlap; i++ ) { tmp3 = mult_r( shr( hTcxEnc->old_out_fx[i + nz], tmp2 ), st->hTcxCfg->tcx_mdct_window_minimum[overlap - 1 - i].v.im ); -#ifdef BASOP_NOGLOB xn_buf16[i] = shl_sat( add_sat( xn_buf16[i], tmp3 ), TCX_IMDCT_HEADROOM ); -#else - xn_buf16[i] = shl( add( xn_buf16[i], tmp3 ), TCX_IMDCT_HEADROOM ); -#endif move16(); } FOR( ; i < L_frame; i++ ) { -#ifdef BASOP_NOGLOB xn_buf16[i] = shl_sat( xn_buf16[i], TCX_IMDCT_HEADROOM ); -#else - xn_buf16[i] = shl( xn_buf16[i], TCX_IMDCT_HEADROOM ); -#endif move16(); } } @@ -5381,11 +5261,7 @@ void InternalTCXDecoder_fx( BASOP_SATURATE_WARNING_OFF_EVS; FOR( i = 0; i < overlap; i++ ) { -#ifdef BASOP_NOGLOB xn_buf16[i] = shl_sat( add( xn_buf16[i], hTcxEnc->Txnq[i] ), TCX_IMDCT_HEADROOM ); -#else - xn_buf16[i] = shl( add( xn_buf16[i], hTcxEnc->Txnq[i] ), TCX_IMDCT_HEADROOM ); -#endif move16(); } @@ -5393,11 +5269,7 @@ void InternalTCXDecoder_fx( { FOR( ; i < L_frame; i++ ) { -#ifdef BASOP_NOGLOB xn_buf16[i] = shl_sat( xn_buf16[i], TCX_IMDCT_HEADROOM ); -#else - xn_buf16[i] = shl( xn_buf16[i], TCX_IMDCT_HEADROOM ); -#endif move16(); } } @@ -5411,11 +5283,7 @@ void InternalTCXDecoder_fx( BASOP_SATURATE_WARNING_OFF_EVS; FOR( i = 0; i < L_frame; i++ ) { -#ifdef BASOP_NOGLOB xn_buf16[i] = shl_o( xn_buf16[i], TCX_IMDCT_HEADROOM, &Overflow ); -#else /* BASOP_NOGLOB */ - xn_buf16[i] = shl( xn_buf16[i], TCX_IMDCT_HEADROOM ); -#endif move16(); } BASOP_SATURATE_WARNING_ON_EVS; diff --git a/lib_enc/cod_uv_fx.c b/lib_enc/cod_uv_fx.c index a8e57391a..8eccddc0b 100644 --- a/lib_enc/cod_uv_fx.c +++ b/lib_enc/cod_uv_fx.c @@ -76,21 +76,13 @@ void gauss_L2_fx( } tmp16 = norm_l( tmp32 ); -#ifdef BASOP_NOGLOB g_corr->y1y1 = round_fx_sat( L_shl( tmp32, tmp16 ) ); -#else - g_corr->y1y1 = round_fx( L_shl( tmp32, tmp16 ) ); -#endif g_corr->y1y1_e = sub( 31 - 18, tmp16 ); move16(); move16(); tmp16 = norm_l( tmp32_2 ); -#ifdef BASOP_NOGLOB g_corr->y1y2 = round_fx_sat( L_shl( tmp32_2, tmp16 ) ); -#else - g_corr->y1y2 = round_fx( L_shl( tmp32_2, tmp16 ) ); -#endif g_corr->y1y2_e = sub( 31 - 18, tmp16 ); move16(); move16(); @@ -164,11 +156,7 @@ void gauss_L2_ivas_fx( tmp16 = norm_l( tmp32 ); // To be checked -#ifdef BASOP_NOGLOB g_corr->y1y1 = round_fx_sat( L_shl( tmp32, tmp16 ) ); -#else - g_corr->y1y1 = round_fx( L_shl( tmp32, tmp16 ) ); -#endif #ifdef FIX_ISSUE_1167 g_corr->y1y1_e = sub( 31 - 16, tmp16 ); #else diff --git a/lib_enc/cor_shif_fx.c b/lib_enc/cor_shif_fx.c index 112023505..c0cb658f2 100644 --- a/lib_enc/cor_shif_fx.c +++ b/lib_enc/cor_shif_fx.c @@ -42,11 +42,7 @@ Word16 correlation_shift_fx( /* o : noise dependent e_Noise = sub( e_Noise, 14 ); /* Retreive exponent of wtmp */ Ltmp = Mpy_32_16( 8, 837, wtmp ); /* 2.4492e-4(Q31) * exp(0.1596*totalNoise) */ -#ifdef BASOP_NOGLOB Ltmp = L_shl_sat( Ltmp, add( e_Noise, 15 ) ); /* Result in Q31 */ -#else - Ltmp = L_shl( Ltmp, add( e_Noise, 15 ) ); /* Result in Q31 */ -#endif corr_shift_fx = round_fx( L_sub( Ltmp, 47244640 ) ); /* Represents corr_shift in Q15 */ } corr_shift_fx = s_min( corr_shift_fx, 16384 ); /* limit to 0.5 */ diff --git a/lib_enc/core_enc_init.c b/lib_enc/core_enc_init.c index e09166f8a..bc2d279b8 100644 --- a/lib_enc/core_enc_init.c +++ b/lib_enc/core_enc_init.c @@ -412,13 +412,9 @@ static void init_tcx_ivas_fx( move16(); } -#ifdef BASOP_NOGLOB /*pit = pit_old * (float)st->L_frame/(float)L_frame_old;*/ pit = shl_sat( mult_r( pit_old, div_s( st->L_frame, shl( L_frame_old, 2 ) ) ), 2 ); /* Note : the saturation here that can happens when FS == 32kHz*/ -#else - pit = shl( mult_r( pit_old, div_s( st->L_frame, shl( L_frame_old, 2 ) ) ), 2 ); -#endif /* assert(pit <= st->L_frame);*/ hTcxEnc->tcxltp_pitch_int_past = pit; @@ -822,12 +818,8 @@ static void init_acelp_ivas_fx( Encoder_State *st, Word16 L_frame_old, Word16 sh Copy( hLPDmem->mem_syn2, tmp_buf + 1, M ); deemph_fx( tmp_buf + 1, st->preemph_fac, M, &tmp ); Residu3_fx( Ap, tmp_buf + M, &tmp, 1, 1 ); -#ifdef BASOP_NOGLOB hLPDmem->mem_w0 = sub_sat( shr_sat( st->wspeech_enc[-1], shift ), tmp ); move16(); -#else - hLPDmem->mem_w0 = sub( shr( st->wspeech_enc[-1], shift ), tmp ); -#endif } } ELSE IF( ( NE_16( st->L_frame, L_frame_old ) ) ) diff --git a/lib_enc/core_enc_init_fx.c b/lib_enc/core_enc_init_fx.c index 6638b4c33..9bcbffba6 100644 --- a/lib_enc/core_enc_init_fx.c +++ b/lib_enc/core_enc_init_fx.c @@ -420,13 +420,9 @@ static void init_tcx_fx( move16(); } -#ifdef BASOP_NOGLOB /*pit = pit_old * (float)st->L_frame/(float)L_frame_old;*/ pit = shl_sat( mult_r( pit_old, div_s( st->L_frame, shl( L_frame_old, 2 ) ) ), 2 ); /* Note : the saturation here that can happens when FS == 32kHz*/ -#else - pit = shl( mult_r( pit_old, div_s( st->L_frame, shl( L_frame_old, 2 ) ) ), 2 ); -#endif /* assert(pit <= st->L_frame);*/ hTcxEnc->tcxltp_pitch_int_past = pit; @@ -746,11 +742,7 @@ static void init_acelp_fx( Encoder_State *st, Word16 L_frame_old, const Word16 s Copy( hLPDmem->mem_syn2, tmp_buf + 1, M ); deemph_fx( tmp_buf + 1, st->preemph_fac, M, &tmp ); Residu3_fx( Ap, tmp_buf + M, &tmp, 1, 1 ); -#ifdef BASOP_NOGLOB hLPDmem->mem_w0 = sub_sat( shr_sat( st->wspeech_enc[-1], shift ), tmp ); -#else - hLPDmem->mem_w0 = sub( shr( st->wspeech_enc[-1], shift ), tmp ); -#endif move16(); } } diff --git a/lib_enc/core_enc_ol_fx.c b/lib_enc/core_enc_ol_fx.c index ee347543b..04857c334 100644 --- a/lib_enc/core_enc_ol_fx.c +++ b/lib_enc/core_enc_ol_fx.c @@ -554,11 +554,7 @@ void core_encode_openloop_fx( /*v_sub(lsf_uq_rf, lsf_q_1st_rf, lsf_q_d_rf, M);*/ FOR( i = 0; i < M; i++ ) { -#ifdef BASOP_NOGLOB lsf_q_d_rf[i] = shl_o( mult_r( sub_o( lsf_uq_rf[i], lsf_q_1st_rf[i], &Overflow ), 25600 ), 5, &Overflow ); -#else - lsf_q_d_rf[i] = shl( mult_r( sub( lsf_uq_rf[i], lsf_q_1st_rf[i] ), 25600 ), 5 ); -#endif move16(); /*input value is in Qx2.56, convert to Q6 to match table, quantizer table kept at Q6 to avoid losing precision */ /*Assume this difference data max range can be represented by Q6*/ @@ -777,13 +773,8 @@ static void closest_centroid_rf( tmpL = i_mult2( i, length ); FOR( j = 0; j < length; j++ ) { -#ifdef BASOP_NOGLOB tmp = sub_o( data[j], quantizer[tmpL + j], &Overflow ); L_tmp = L_mult_o( tmp, tmp, &Overflow ); -#else - tmp = sub( data[j], quantizer[tmpL + j] ); - L_tmp = L_mult( tmp, tmp ); -#endif werr_64 = W_mac_32_16( werr_64, L_tmp, weights[j] ); } werr = W_sat_m( werr_64 ); @@ -1114,11 +1105,7 @@ void core_acelp_tcx20_switching_fx( FOR( j = 0; j < L_SUBFR; j++ ) { -#ifdef BASOP_NOGLOB tmp32 = L_mac0_o( tmp32, st->wspeech_enc[i + j], st->wspeech_enc[i + j], &Overflow ); -#else - tmp32 = L_mac0( tmp32, st->wspeech_enc[i + j], st->wspeech_enc[i + j] ); -#endif } tmp32 = L_shr( BASOP_Util_Log2( tmp32 ), 9 ); /* 15Q16 */ tmp32 = L_add( tmp32, L_sub( 0x1F0000, L_shl( L_deposit_h( add( Q_new, sub( shift, 1 ) ) ), 1 ) ) ); /* wspeech_enc scaling */ @@ -1136,11 +1123,7 @@ void core_acelp_tcx20_switching_fx( tcx_snr = L_shl( Mpy_32_16_1( tcx_snr, 0x6054 ), 2 ); /* 0x6054 -> 10/log2(10) (2Q13) */ BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB snr_tcx = round_fx_o( L_shl_o( tcx_snr, 8, &Overflow ), &Overflow ); /* 7Q8 */ -#else /* BASOP_NOGLOB */ - snr_tcx = round_fx( L_shl( tcx_snr, 8 ) ); /* 7Q8 */ -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS /*--------------------------------------------------------------* @@ -1174,19 +1157,11 @@ void core_acelp_tcx20_switching_fx( FOR( j = 0; j < L_SUBFR; j++ ) { -#ifdef BASOP_NOGLOB signal = L_mac0_o( signal, st->wspeech_enc[i + j], st->wspeech_enc[i + j], &Overflow ); tmp16 = round_fx_o( L_shl_o( Mpy_32_16_r( gain, st->wspeech_enc[i + j - T0] ), 15, &Overflow ), &Overflow ); tmp16 = sub_o( st->wspeech_enc[i + j], tmp16, &Overflow ); noise = L_mac0_o( noise, tmp16, tmp16, &Overflow ); -#else - signal = L_mac0( signal, st->wspeech_enc[i + j], st->wspeech_enc[i + j] ); - - tmp16 = round_fx( L_shl( Mpy_32_16_r( gain, st->wspeech_enc[i + j - T0] ), 15 ) ); - tmp16 = sub( st->wspeech_enc[i + j], tmp16 ); - noise = L_mac0( noise, tmp16, tmp16 ); -#endif } /* Assume always 4 sub frames. */ /*assert( (st->L_frame / L_SUBFR) == 4);*/ @@ -1239,16 +1214,8 @@ void core_acelp_tcx20_switching_fx( test(); if ( ( GT_16( snr_acelp, snr_tcx ) ) && ( LT_16( snr_acelp, add( snr_tcx, 512 /*2.0f Q8*/ ) ) ) && -#ifdef BASOP_NOGLOB ( LT_16( add_o( st->prevTempFlatness_fx, currFlatness, &Overflow ), 416 /*3.25f Q7*/ ) || EQ_16( stab_fac, 0x7fff /*1 Q15*/ ) || -#else /* BASOP_NOGLOB */ - ( LT_16( add( st->prevTempFlatness_fx, currFlatness ), 416 /*3.25f Q7*/ ) || EQ_16( stab_fac, 0x7fff ) || -#endif -#ifdef BASOP_NOGLOB ( EQ_32( st->sr_core, INT_FS_12k8 ) && EQ_16( st->sp_aud_decision0, 1 ) && LT_16( add_sat( st->prevTempFlatness_fx, currFlatness ), 2560 /*20.f Q7*/ ) ) ) && -#else - ( EQ_32( st->sr_core, INT_FS_12k8 ) && EQ_16( st->sp_aud_decision0, 1 ) && LT_16( add( st->prevTempFlatness_fx, currFlatness ), 2560 /*20.f Q7*/ ) ) ) && -#endif ( LE_16( st->acelpFramesCount, 6 ) ) ) { dsnr = -512 /*-2.0f Q8*/; @@ -1261,11 +1228,7 @@ void core_acelp_tcx20_switching_fx( test(); if ( ( LT_16( snr_acelp, snr_tcx ) ) && ( GT_16( snr_acelp, sub( snr_tcx, 512 /*2.0f Q8*/ ) ) ) && -#ifdef BASOP_NOGLOB ( GT_16( add_sat( st->prevTempFlatness_fx, currFlatness ), 416 /*3.25f Q7*/ ) ) && -#else - ( GT_16( add( st->prevTempFlatness_fx, currFlatness ), 416 /*3.25f Q7*/ ) ) && -#endif ( GE_16( st->acelpFramesCount, 6 ) ) ) { dsnr = 512 /*2.0f Q8*/; diff --git a/lib_enc/corr_xh_fx.c b/lib_enc/corr_xh_fx.c index 8a1c8c483..51165d141 100644 --- a/lib_enc/corr_xh_fx.c +++ b/lib_enc/corr_xh_fx.c @@ -47,11 +47,7 @@ void corr_xh_fx( L_tmp = L_mac( 1L, x[i], h[0] ); /* 1 -> to avoid null dn[] Qx+15*/ FOR( j = i; j < L_SUBFR - 1; j++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac_o( L_tmp, x[j + 1], h[j + 1 - i], &Overflow ); /*Qx+15*/ -#else - L_tmp = L_mac( L_tmp, x[j + 1], h[j + 1 - i] ); -#endif } y32[i] = L_tmp; /*Qx+15*/ @@ -61,13 +57,8 @@ void corr_xh_fx( } /* tot += 3*max / 8 */ L_maxloc = L_shr( L_maxloc, 2 ); -#ifdef BASOP_NOGLOB L_tot = L_add_o( L_tot, L_maxloc, &Overflow ); /* +max/4 */ L_tot = L_add_o( L_tot, L_shr( L_maxloc, 1 ), &Overflow ); /* +max/8 */ -#else - L_tot = L_add( L_tot, L_maxloc ); /* +max/4 */ - L_tot = L_add( L_tot, L_shr( L_maxloc, 1 ) ); /* +max/8 */ -#endif } /* Find the number of right shifts to do on y32[] so that */ @@ -107,11 +98,7 @@ void corr_hh_ivas_fx( L_tmp = L_mac( 1L, shr( h[i], 3 ), shr( h[0], 3 ) ); /* 1 -> to avoid null dn[] */ // 2*(15 - norm_s(h[0]) -3) - 1 FOR( j = i; j < L_subfr - 1; j++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac_o( L_tmp, shr( h[j + 1], 3 ), shr( h[j + 1 - i], 3 ), &Overflow ); // 2*(15 - norm_s(h[0]) -3) - 1 -#else - L_tmp = L_mac( L_tmp, x[j + 1], h[j + 1 - i] ); -#endif } y32[i] = L_tmp; // 2*(15 - norm_s(h[0]) -3) - 1 @@ -121,13 +108,8 @@ void corr_hh_ivas_fx( } /* tot += 3*max / 8 */ L_maxloc = L_shr( L_maxloc, 2 ); -#ifdef BASOP_NOGLOB L_tot = L_add_o( L_tot, L_maxloc, &Overflow ); /* +max/4 */ L_tot = L_add_o( L_tot, L_shr( L_maxloc, 1 ), &Overflow ); /* +max/8 */ -#else - L_tot = L_add( L_tot, L_maxloc ); /* +max/4 */ - L_tot = L_add( L_tot, L_shr( L_maxloc, 1 ) ); /* +max/8 */ -#endif } /* Find the number of right shifts to do on y32[] so that */ @@ -173,11 +155,7 @@ void corr_xh_ivas_fx( L_tmp = L_mac( 0, x[i], h[0] ); // Qx+(15 - norm_s(h[0])) FOR( j = i; j < L_subfr - 1; j++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac_o( L_tmp, x[j + 1], h[j + 1 - i], &Overflow ); // Qx+(15 - norm_s(h[0])) -#else - L_tmp = L_mac( L_tmp, x[j + 1], h[j + 1 - i] ); -#endif } y32[i] = L_tmp; // Qx+(15 - norm_s(h[0])) @@ -187,13 +165,8 @@ void corr_xh_ivas_fx( } /* tot += 3*max / 8 */ L_maxloc = L_shr( L_maxloc, 2 ); -#ifdef BASOP_NOGLOB L_tot = L_add_o( L_tot, L_maxloc, &Overflow ); /* +max/4 */ L_tot = L_add_o( L_tot, L_shr( L_maxloc, 1 ), &Overflow ); /* +max/8 */ -#else - L_tot = L_add( L_tot, L_maxloc ); /* +max/4 */ - L_tot = L_add( L_tot, L_shr( L_maxloc, 1 ) ); /* +max/8 */ -#endif } /* Find the number of right shifts to do on y32[] so that */ diff --git a/lib_enc/detect_transient_fx.c b/lib_enc/detect_transient_fx.c index c4dbc6fe7..facecb401 100644 --- a/lib_enc/detect_transient_fx.c +++ b/lib_enc/detect_transient_fx.c @@ -69,30 +69,15 @@ static void hp_filter_fx( /*y[0] = 0.4931f * *oldy + 0.7466f*(x[0] - *oldx); */ -#ifdef BASOP_NOGLOB L_tmp = L_mult( sub_o( x[0], *oldx, &Overflow ), 24465 /*0.7466f in Q15*/ ); /*Q_new+16 */ -#else /* BASOP_NOGLOB */ - L_tmp = L_mult( sub( x[0], *oldx ), 24465 ); /*Q_new+16 */ -#endif /* BASOP_NOGLOB */ -#ifdef BASOP_NOGLOB L_tmp = L_mac_sat( L_tmp, *oldy, 16158 /*0.4931f in Q15*/ ); /*Q_new+16 */ y[0] = round_fx_sat( L_tmp ); /*Q_new */ -#else - L_tmp = L_mac( L_tmp, *oldy, 16158 ); /*Q_new+16 */ - y[0] = round_fx( L_tmp ); /*Q_new */ -#endif FOR( i = 1; i < L; i++ ) { /*y[i] = 0.4931f*y[i-1] + 0.7466f*(x[i] - x[i-1]); */ -#ifdef BASOP_NOGLOB L_tmp = L_mult( sub_o( x[i], x[i - 1], &Overflow ), 24465 /*0.7466f in Q15*/ ); /*Q_new+16 */ L_tmp = L_mac_o( L_tmp, y[i - 1], 16158 /*0.4931f in Q15*/, &Overflow ); /*Q_new+16 */ y[i] = round_fx_o( L_tmp, &Overflow ); /*Q_new */ -#else /* BASOP_NOGLOB */ - L_tmp = L_mult( sub( x[i], x[i - 1] ), 24465 ); /*Q_new+16 */ - L_tmp = L_mac( L_tmp, y[i - 1], 16158 ); /*Q_new+16 */ - y[i] = round_fx( L_tmp ); /*Q_new */ -#endif /* BASOP_NOGLOB */ } *oldx = x[L - 1]; @@ -166,11 +151,7 @@ Word16 detect_transient_fx( FOR( i = 0; i < L / 4; i++ ) { /*EnergyLT += out_filt[i] * out_filt[i]; */ -#ifdef BASOP_NOGLOB EnergyLT = L_mac0_o( EnergyLT, out_filt_fx[i], out_filt_fx[i], &Overflow ); /*2Q_new */ -#else - EnergyLT = L_mac0( EnergyLT, out_filt_fx[i], out_filt_fx[i] ); /*2Q_new */ -#endif } } ELSE @@ -189,27 +170,14 @@ Word16 detect_transient_fx( FOR( i = 0; i < L / 4; i++ ) { temp16 = extract_l( L_shr( out_filt_fx[i + blk * ( L / 4 )], 12 ) ); -#ifdef BASOP_NOGLOB Energy_fx = L_add_o( Energy_fx, L_mult0( temp16, temp16 ), &Overflow ); -#else - Energy_fx = L_add( Energy_fx, L_mult0( temp16, temp16 ) ); -#endif temp16 = shr( in_fx[i + blk * ( L / 4 )], Q_new ); /*Q0*/ -#ifdef BASOP_NOGLOB Energy_in_fx[blk + 1] = L_add_o( Energy_in_fx[blk + 1], L_mult0( temp16, temp16 ), &Overflow ); /*Q0*/ -#else - Energy_in_fx[blk + 1] = L_add( Energy_in_fx[blk + 1], L_mult0( temp16, temp16 ) ); -#endif move32(); } -#ifdef BASOP_NOGLOB E_in_fx = L_add_o( E_in_fx, Energy_in_fx[blk + 1], &Overflow ); /*Q0*/ E_out_fx = L_add_o( E_out_fx, Energy_fx, &Overflow ); /*Q0*/ -#else - E_in_fx = L_add( E_in_fx, Energy_in_fx[blk + 1] ); - E_out_fx = L_add( E_out_fx, Energy_fx ); -#endif Thres_fx = 2185; /*1 /15 Q15*/ move16(); @@ -233,29 +201,17 @@ Word16 detect_transient_fx( FOR( i = 0; i < L / 8; i++ ) { /*Energy += out_filt_fx[i + blk*(L/4)] * out_filt_fx[i + blk*(L/4)]; */ -#ifdef BASOP_NOGLOB L_tmp = L_mac0_o( L_tmp, out_filt_fx[i + blk * ( L / 4 )], out_filt_fx[i + blk * ( L / 4 )], &Overflow ); /*2Q_new */ -#else - L_tmp = L_mac0( L_tmp, out_filt_fx[i + blk * ( L / 4 )], out_filt_fx[i + blk * ( L / 4 )] ); /*2Q_new */ -#endif } L_tmp2 = L_deposit_l( 0 ); FOR( ; i < L / 4; i++ ) { /*Energy += out_filt_fx[i + blk*(L/4)] * out_filt_fx[i + blk*(L/4)]; */ -#ifdef BASOP_NOGLOB L_tmp2 = L_mac0_o( L_tmp2, out_filt_fx[i + blk * ( L / 4 )], out_filt_fx[i + blk * ( L / 4 )], &Overflow ); /*2Q_new */ -#else - L_tmp2 = L_mac0( L_tmp2, out_filt_fx[i + blk * ( L / 4 )], out_filt_fx[i + blk * ( L / 4 )] ); /*2Q_new */ -#endif } Overflow = 0; move16(); -#ifdef BASOP_NOGLOB /* Critical Overflow */ Energy = L_add_o( L_tmp, L_tmp2, &Overflow ); /*2Q_new */ -#else - Energy = L_add( L_tmp, L_tmp2 ); -#endif shift = 0; if ( Overflow != 0 ) { @@ -265,11 +221,7 @@ Word16 detect_transient_fx( Overflow = 0; move16(); -#ifdef BASOP_NOGLOB /* shift is >= 0, not overflow possible for shr */ Energy = L_add_o( L_shr( L_tmp, shift ), L_shr( L_tmp2, shift ), &Overflow ); /*2Q_new - shift*/ -#else - Energy = L_add( L_shr( L_tmp, shift ), L_shr( L_tmp2, shift ) ); -#endif test(); IF( EQ_16( st_fx->extl, SWB_BWE ) || EQ_16( st_fx->extl, FB_BWE ) ) { @@ -310,11 +262,7 @@ Word16 detect_transient_fx( } /*EnergyLT = 0.75f*EnergyLT + 0.25f*Energy; */ /*0.75f*EnergyLT in Q0 //0.25f*Energy in Q0 */ -#ifdef BASOP_NOGLOB EnergyLT = L_add_o( Mult_32_16( EnergyLT, 24576 /*0.75f in Q15*/ ), Mult_32_16( Energy, shl( 8192 /*0.25 in Q15*/, shift ) ), &Overflow ); /*2Q_new */ -#else /* BASOP_NOGLOB */ - EnergyLT = L_add( Mult_32_16( EnergyLT, 24576 ), Mult_32_16( Energy, shl( 8192, shift ) ) ); /*2Q_new */ -#endif } } st_fx->EnergyLT_fx = EnergyLT; @@ -342,11 +290,7 @@ Word16 detect_transient_fx( { /*blk++; */ blk = add( blk, 1 ); -#ifdef BASOP_NOGLOB E_low_fx = L_add_sat( E_low_fx, Energy_in_fx[i] ); /*Q0*/ -#else - E_low_fx = L_add( E_low_fx, Energy_in_fx[i] ); -#endif } exp = norm_s( blk ); @@ -362,11 +306,7 @@ Word16 detect_transient_fx( { /*blk++; */ blk = add( blk, 1 ); -#ifdef BASOP_NOGLOB E_high_fx = L_add_sat( E_high_fx, Energy_in_fx[i] ); /*Q0*/ -#else - E_high_fx = L_add( E_high_fx, Energy_in_fx[i] ); -#endif } exp = norm_s( blk ); diff --git a/lib_enc/dtx_fx.c b/lib_enc/dtx_fx.c index a8978c497..fc44b9901 100644 --- a/lib_enc/dtx_fx.c +++ b/lib_enc/dtx_fx.c @@ -452,11 +452,7 @@ void dtx_ivas_fx( speech++; FOR( i = 1; i < L_FRAME / 16; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac0_o( L_tmp, *speech, *speech, &Overflow ); /*2*Q_speech*/ -#else /* BASOP_NOGLOB */ - L_tmp = L_mac0( L_tmp, *speech, *speech ); -#endif /* BASOP_NOGLOB */ speech++; } hDtxEnc->frame_ener_fx = L_add( hDtxEnc->frame_ener_fx, L_shr( L_tmp, Q_speech2 ) ); /* Q(-7) */ @@ -977,11 +973,7 @@ void dtx_fx( speech++; FOR( i = 1; i < L_FRAME / 16; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac0_o( L_tmp, *speech, *speech, &Overflow ); /*2*Q_speech*/ -#else /* BASOP_NOGLOB */ - L_tmp = L_mac0( L_tmp, *speech, *speech ); -#endif /* BASOP_NOGLOB */ speech++; } hDtxEnc->frame_ener_fx = L_add( hDtxEnc->frame_ener_fx, L_shr( L_tmp, Q_speech2 ) ); /*Q(-7) */ @@ -1347,11 +1339,7 @@ void dtx_hangover_control_fx( } exp = norm_l( enr_est ); -#ifdef BASOP_NOGLOB fra = round_fx_sat( L_shl_sat( enr_est, exp ) ); /*Q6+exp-16*/ -#else - fra = round_fx( L_shl( enr_est, exp ) ); -#endif exp2 = norm_s( weights ); fra2 = shl( weights, exp2 ); /*Q15+exp2*/ exp = sub( sub( exp, 16 ), exp2 ); @@ -1461,11 +1449,7 @@ void dtx_hangover_control_fx( move16(); FOR( j = 0; j < m; j++ ) { -#ifdef BASOP_NOGLOB lsp_est[i] = add_o( lsp_est[i], tmp[j * M + i], &Overflow ); /*Q15 */ -#else /* BASOP_NOGLOB */ - lsp_est[i] = add( lsp_est[i], tmp[j * M + i] ); /*Q15 */ -#endif /* BASOP_NOGLOB */ } lsp_est[i] = sub( lsp_est[i], tmp[max_idx[0] * M + i] ); /*Q15 */ @@ -1481,18 +1465,10 @@ void dtx_hangover_control_fx( move16(); FOR( j = 0; j < m; j++ ) { -#ifdef BASOP_NOGLOB lsp_est[i] = add_o( lsp_est[i], tmp[j * M + i], &Overflow ); /*Q15 */ -#else - lsp_est[i] = add( lsp_est[i], tmp[j * M + i] ); /*Q15 */ -#endif } -#ifdef BASOP_NOGLOB lsp_est[i] = sub_o( lsp_est[i], add_o( tmp[max_idx[0] * M + i], tmp[max_idx[1] * M + i], &Overflow ), &Overflow ); /*Q15 */ -#else - lsp_est[i] = sub( lsp_est[i], add( tmp[max_idx[0] * M + i], tmp[max_idx[1] * M + i] ) ); /*Q15 */ -#endif S_tmp = div_s( 1, sub( m, 2 ) ); /*Q15 */ lsp_est[i] = mult_r( lsp_est[i], S_tmp ); /*Q15 */ } @@ -1502,11 +1478,7 @@ void dtx_hangover_control_fx( move16(); FOR( i = 0; i < M; i++ ) { -#ifdef BASOP_NOGLOB Dlsp_n2e = add_o( Dlsp_n2e, abs_s( sub( lsp_new_fx[i], lsp_est[i] ) ), &Overflow ); /*Q15 */ -#else /* BASOP_NOGLOB */ - Dlsp_n2e = add( Dlsp_n2e, abs_s( sub( lsp_new_fx[i], lsp_est[i] ) ) ); /*Q15 */ -#endif /* BASOP_NOGLOB */ lsp_est[i] = add( mult_r( 26214, lsp_est[i] ), mult_r( 6554, lsp_new_fx[i] ) ); /*Q15 */ } @@ -1519,11 +1491,7 @@ void dtx_hangover_control_fx( FOR( i = 0; i < M; i++ ) { S_tmp = abs_s( sub( hDtxEnc->lspCNG_fx[i], lsp_est[i] ) ); /*Q15 */ -#ifdef BASOP_NOGLOB Dlsp = add_o( Dlsp, S_tmp, &Overflow ); /*Q15 */ -#else /* BASOP_NOGLOB */ - Dlsp = add( Dlsp, S_tmp ); /*Q15 */ -#endif IF( GT_16( S_tmp, S_max ) ) { S_max = S_tmp; /*Q15 */ diff --git a/lib_enc/enc_acelp_fx.c b/lib_enc/enc_acelp_fx.c index 52b42fa1d..caeeb178b 100644 --- a/lib_enc/enc_acelp_fx.c +++ b/lib_enc/enc_acelp_fx.c @@ -75,36 +75,20 @@ void E_ACELP_h_vec_corr1_fx( Word16 h[] /*Qx*/, Word16 vec[] /*Qx*/, UWord8 trac p2 = &vec[dn]; /*Qx*/ FOR( j = dn; j < L_SUBFR - 1; j++ ) { -#ifdef BASOP_NOGLOB L_sum = L_mac_o( L_sum, *p1++, *p2++, &Overflow ); /*2*Qx+1*/ -#else - L_sum = L_mac( L_sum, *p1++, *p2++ ); -#endif } -#ifdef BASOP_NOGLOB corr = mac_ro( L_sum, *p1++, *p2++, &Overflow ); /*Q9*/ -#else /* BASOP_NOGLOB */ - corr = mac_r( L_sum, *p1++, *p2++ ); /*Q9*/ -#endif /* BASOP_NOGLOB */ /*cor[dn >> 2] = sign[dn] * s + p0[dn >> 2];*/ j = shr( dn, 2 ); if ( sign[dn] > 0 ) { -#ifdef BASOP_NOGLOB corr = add_o( p0[j], corr, &Overflow ); /*Q9*/ -#else - corr = add( p0[j], corr ); -#endif } if ( sign[dn] < 0 ) { -#ifdef BASOP_NOGLOB corr = sub_o( p0[j], corr, &Overflow ); /*Q9*/ -#else /* BASOP_NOGLOB */ - corr = sub( p0[j], corr ); -#endif /* BASOP_NOGLOB */ } cor[j] = corr; /*Q9*/ @@ -134,35 +118,19 @@ void E_ACELP_h_vec_corr2_fx( Word16 h[] /*Qx*/, Word16 vec[] /*Qx*/, UWord8 trac p2 = &vec[pos]; /*Qx*/ FOR( j = pos; j < L_SUBFR - 1; j++ ) { -#ifdef BASOP_NOGLOB L_sum = L_mac_o( L_sum, *p1++, *p2++, &Overflow ); /* 2*Qx+1 */ -#else - L_sum = L_mac( L_sum, *p1++, *p2++ ); -#endif } -#ifdef BASOP_NOGLOB corr = mac_ro( L_sum, *p1++, *p2++, &Overflow ); /*Q9*/ -#else /* BASOP_NOGLOB */ - corr = mac_r( L_sum, *p1++, *p2++ ); /*Q9*/ -#endif /* BASOP_NOGLOB */ /*cor[i] = s * sign[track] + p0[i];*/ if ( sign[pos] > 0 ) { -#ifdef BASOP_NOGLOB corr = add_o( *p0++, corr, &Overflow ); /*Q9*/ -#else - corr = add( *p0++, corr ); -#endif } if ( sign[pos] < 0 ) { -#ifdef BASOP_NOGLOB corr = sub_o( *p0++, corr, &Overflow ); /*Q9*/ -#else - corr = sub( *p0++, corr ); -#endif } cor[i] = corr; /*Q9*/ move16(); @@ -227,11 +195,7 @@ static void E_ACELP_2pulse_search( Word16 nb_pos_ix /*Q0*/, UWord8 track_x /*Q0* sqk[0] = -1; move16(); x2 = shr( pos_x[0], 2 ); /*Qdn*/ -#ifdef BASOP_NOGLOB if ( mac_ro( L_mac_o( L_mac_o( alp0, cor_x[x2], _1_, &Overflow ), cor_y[0], _1_, &Overflow ), rrixiy[track_x][( x2 * 16 )], _1_, &Overflow ) < 0 ) -#else /* BASOP_NOGLOB */ - if ( mac_r( L_mac( L_mac( alp0, cor_x[x2], _1_ ), cor_y[0], _1_ ), rrixiy[track_x][shl( x2, 4 )], _1_ ) < 0 ) -#endif /* BASOP_NOGLOB */ { sqk[0] = 1; move16(); @@ -251,11 +215,7 @@ static void E_ACELP_2pulse_search( Word16 nb_pos_ix /*Q0*/, UWord8 track_x /*Q0* ps1 = add( ps0, dn[x] ); /*Qdn*/ /*alp1 = alp0 + cor_x[x2];*/ -#ifdef BASOP_NOGLOB alp1 = L_mac_o( alp0, cor_x[x2], _1_, &Overflow ); /*Q22*/ -#else /* BASOP_NOGLOB */ - alp1 = L_mac( alp0, cor_x[x2], _1_ ); /*Q22*/ -#endif /* BASOP_NOGLOB */ p1 = cor_y; /*Qx*/ p2 = &rrixiy[track_x][( x2 * 16 )]; /*Q9*/ @@ -267,13 +227,8 @@ static void E_ACELP_2pulse_search( Word16 nb_pos_ix /*Q0*/, UWord8 track_x /*Q0* move16(); /*alp2 = alp1 + (*p1++) + (*p2++);*/ -#ifdef BASOP_NOGLOB alp2 = L_mac_o( alp1, *p1++, _1_, &Overflow ); /*Qx+12+1*/ alp2_16 = mac_ro( alp2, *p2++, _1_, &Overflow ); /*Q6*/ -#else /* BASOP_NOGLOB */ - alp2 = L_mac( alp1, *p1++, _1_ ); - alp2_16 = mac_r( alp2, *p2++, _1_ ); /*Q6*/ -#endif /* BASOP_NOGLOB */ alpk[1 - ik] = alp2_16; /*Q6*/ move16(); @@ -475,13 +430,8 @@ static void E_ACELP_xh_corr( Word16 *x /*Qx*/, Word16 *y /*Qy*/, Word16 *h /*Q12 L_maxloc = L_shr( L_maxloc, 2 ); /* Do not warn saturation of L_tot, since its for headroom estimation. */ BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB L_tot = L_add_sat( L_tot, L_maxloc ); /* +max/4 */ L_tot = L_add_sat( L_tot, L_shr( L_maxloc, 1 ) ); /* +max/8 */ -#else - L_tot = L_add( L_tot, L_maxloc ); /* +max/4 */ - L_tot = L_add( L_tot, L_shr( L_maxloc, 1 ) ); /* +max/8 */ -#endif BASOP_SATURATE_WARNING_ON_EVS } @@ -581,19 +531,11 @@ Word16 E_ACELP_xy1_corr_fx( Word16 xn[] /*Q15-exp_xn*/, Word16 y1[] /*Q15-exp_xn L_off = L_shr( 10737418l /*0.01f/2.0f Q31*/, s_min( add( exp_xn, exp_xn ), 31 ) ); L_off = L_max( 1, L_off ); /* ensure at least a '1' */ -#ifdef BASOP_NOGLOB /* Compute scalar product t1: */ yy = round_fx_o( Dot_product15_offs( y1, y1, L_subfr, &exp_yy, L_off ), &Overflow ); /*Q15 - exp_yy*/ /* Compute scalar product t0: */ xy = round_fx_o( Dot_product12_offs( xn, y1, L_subfr, &exp_xy, L_off ), &Overflow ); /*Q15 - exp_xy*/ -#else - /* Compute scalar product t1: */ - yy = round_fx( Dot_product15_offs( y1, y1, L_subfr, &exp_yy, L_off ) ); - - /* Compute scalar product t0: */ - xy = round_fx( Dot_product12_offs( xn, y1, L_subfr, &exp_xy, L_off ) ); -#endif /* Compute doubled format out of the exponent */ Q_xn = shl( sub( 15, exp_xn ), 1 ); g_corr->y1y1 = yy; @@ -621,11 +563,7 @@ Word16 E_ACELP_xy1_corr_fx( Word16 xn[] /*Q15-exp_xn*/, Word16 y1[] /*Q15-exp_xn i = add( exp_xy, 1 - 1 ); /* -1 -> gain in Q14 */ i = sub( i, exp_yy ); BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB gain = shl_o( gain, i, &Overflow ); /* saturation can occur here */ -#else /* BASOP_NOGLOB */ - gain = shl( gain, i ); /* saturation can occur here */ -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS /* gain = s_max(0, gain); */ /* see above xy < 0. */ @@ -639,11 +577,7 @@ Word16 E_ACELP_xy1_corr_fx( Word16 xn[] /*Q15-exp_xn*/, Word16 y1[] /*Q15-exp_xn Word16 tmp, exp_tmp, exp_div; /* Compute scalar product */ -#ifdef BASOP_NOGLOB tmp = round_fx_o( Dot_product12_offs( xn, xn, L_subfr, &exp_tmp, 1 ), &Overflow ); /*Q15 - exp_tmp*/ -#else - tmp = round_fx( Dot_product12_offs( xn, xn, L_subfr, &exp_tmp, 1 ) ); -#endif /* gain_p_snr = sqrt(/) */ tmp = BASOP_Util_Divide1616_Scale( tmp, yy, &exp_div ); exp_tmp = add( sub( exp_tmp, exp_yy ), exp_div ); @@ -653,11 +587,7 @@ Word16 E_ACELP_xy1_corr_fx( Word16 xn[] /*Q15-exp_xn*/, Word16 y1[] /*Q15-exp_xn /* Note: shl works as shl or shr. */ exp_tmp = sub( exp_tmp, 1 ); BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB tmp = round_fx_o( L_shl_o( Mpy_32_16_1( 1717986944l /*ACELP_GAINS_CONST Q31*/, tmp ), exp_tmp, &Overflow ), &Overflow ); /*Q14*/ -#else /* BASOP_NOGLOB */ - tmp = round_fx( L_shl( Mpy_32_16_1( 1717986944l /*ACELP_GAINS_CONST Q31*/, tmp ), exp_tmp ) ); -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS gain = s_min( gain, tmp ); /*Q14*/ @@ -774,17 +704,9 @@ void E_ACELP_codebook_target_update_fx( Word16 *x /*Q_xn*/, Word16 *x2 /*Q_xn*/, L_tmp = L_deposit_h( x[i] ); /*Q_xn+16*/ if ( Q15_flag == 0 ) { -#ifdef BASOP_NOGLOB L_tmp = L_msu_o( L_tmp, y[i], gain, &Overflow ); /*Q_xn+15*/ -#else - L_tmp = L_msu( L_tmp, y[i], gain ); -#endif } -#ifdef BASOP_NOGLOB x2[i] = msu_ro( L_tmp, y[i], gain, &Overflow ); /*Q_xn*/ -#else - x2[i] = msu_r( L_tmp, y[i], gain ); -#endif move16(); } } @@ -830,11 +752,7 @@ void E_ACELP_pulsesign( const Word16 cn[] /*Q_xn*/, Word16 dn[] /*Qdn*/, Word16 FOR( i = 1; i < L_subfr; i++ ) { -#ifdef BASOP_NOGLOB Lval = L_mac0_o( Lval, cn[i], cn[i], &Overflow ); /*2*Q_xn*/ -#else /* BASOP_NOGLOB */ - Lval = L_mac0( Lval, cn[i], cn[i] ); -#endif /* BASOP_NOGLOB */ Lcor = L_mac0( Lcor, dn[i], dn[i] ); /*2*Qdn*/ } @@ -851,13 +769,8 @@ void E_ACELP_pulsesign( const Word16 cn[] /*Q_xn*/, Word16 dn[] /*Qdn*/, Word16 if ( i > 0 ) Lcor = L_shr( Lcor, i ); -#ifdef BASOP_NOGLOB k_dn = round_fx_o( Lval, &Overflow ); /*Q15 - e_dn*/ k_cn = round_fx_o( Lcor, &Overflow ); /*Q15 - e_cn*/ -#else /* BASOP_NOGLOB */ - k_dn = round_fx( Lval ); - k_cn = round_fx( Lcor ); -#endif /* BASOP_NOGLOB */ k_cn = mult_r( 0x2000, k_cn ); /* 1 in Q13 */ k_dn = mult_r( alp, k_dn ); /* alp in Q13 */ @@ -877,11 +790,7 @@ void E_ACELP_pulsesign( const Word16 cn[] /*Q_xn*/, Word16 dn[] /*Qdn*/, Word16 /*cor = (s * cn[i]) + (alp * dn[i]); MULT(1);MAC(1);*/ Lcor = L_mult( cn[i], k_cn ); /*Q_xn + Q15 - e_cn + 1*/ Lcor = L_mac( Lcor, dn[i], k_dn ); /*Qdn + Q15 - e_dn + 1*/ -#ifdef BASOP_NOGLOB val = round_fx_o( L_shl_o( Lcor, 4, &Overflow ), &Overflow ); /*shifting by 4 may overflow but improves accuracy Qdn + 4 - e_dn*/ -#else - val = round_fx( L_shl( Lcor, 4 ) ); /*shifting by 4 may overflow but improves accuracy*/ -#endif index = shr( val, 15 ); sign[i] = ptr16[index]; /*Q15*/ @@ -1219,11 +1128,7 @@ void E_ACELP_4tsearch_fx( Word16 dn[] /*Qdn*/, const Word16 cn[] /*Q_xn*/, const BASOP_SATURATE_WARNING_OFF_EVS FOR( i = 0; i < L_SUBFR; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac_o( L_tmp, H[i], H[i], &Overflow ); /*Q25*/ -#else - L_tmp = L_mac( L_tmp, H[i], H[i] ); -#endif } val = extract_h( L_tmp ); /*Q9*/ BASOP_SATURATE_WARNING_ON_EVS @@ -1368,11 +1273,7 @@ void E_ACELP_4tsearch_fx( Word16 dn[] /*Qdn*/, const Word16 cn[] /*Q_xn*/, const L_tmp = L_mult( vec[0], vec[0] ); /*Q25+2*scale*/ FOR( i = 1; i < L_SUBFR; i++ ) -#ifdef BASOP_NOGLOB L_tmp = L_mac_o( L_tmp, vec[i], vec[i], &Overflow ); /*Q25+2*scale*/ -#else - L_tmp = L_mac( L_tmp, vec[i], vec[i] ); -#endif alp = round_fx( L_shr( L_tmp, 3 ) ); /*Q6+2*scale*/ @@ -1429,13 +1330,8 @@ void E_ACELP_4tsearch_fx( Word16 dn[] /*Qdn*/, const Word16 cn[] /*Q_xn*/, const FOR( i = 0; i < L_SUBFR; i++ ) { tmp = add( *p0++, *p1++ ); -#ifdef BASOP_NOGLOB vec[i] = add_o( vec[i], tmp, &Overflow ); /* can saturate here. */ move16(); -#else - vec[i] = add( vec[i], tmp ); /* can saturate here. */ - move16(); -#endif } } st = add( st, 1 ); @@ -1484,11 +1380,7 @@ void E_ACELP_4tsearch_fx( Word16 dn[] /*Qdn*/, const Word16 cn[] /*Q_xn*/, const } FOR( i = 0; i < L_SUBFR; i++ ) { -#ifdef BASOP_NOGLOB y[i] = add_o( y[i], *p0++, &Overflow ); /*Q12+scale*/ -#else - y[i] = add( y[i], *p0++ ); -#endif move16(); } } @@ -1557,11 +1449,7 @@ void E_ACELP_4tsearch_ivas_fx( Word16 dn[] /*Qdn*/, const Word16 cn[] /*Q_xn*/, BASOP_SATURATE_WARNING_OFF_EVS FOR( i = 0; i < L_SUBFR; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac_o( L_tmp, H[i], H[i], &Overflow ); /*Q25*/ -#else - L_tmp = L_mac( L_tmp, H[i], H[i] ); -#endif } val = extract_h( L_tmp ); /*Q9*/ BASOP_SATURATE_WARNING_ON_EVS @@ -1711,11 +1599,7 @@ void E_ACELP_4tsearch_ivas_fx( Word16 dn[] /*Qdn*/, const Word16 cn[] /*Q_xn*/, L_tmp = L_mult( vec[0], vec[0] ); /*Q25+2*scale*/ FOR( i = 1; i < L_SUBFR; i++ ) -#ifdef BASOP_NOGLOB L_tmp = L_mac_o( L_tmp, vec[i], vec[i], &Overflow ); /*Q25+2*scale*/ -#else - L_tmp = L_mac( L_tmp, vec[i], vec[i] ); -#endif alp = round_fx( L_shr( L_tmp, 3 ) ); /*Q6+2*scale*/ @@ -1772,13 +1656,8 @@ void E_ACELP_4tsearch_ivas_fx( Word16 dn[] /*Qdn*/, const Word16 cn[] /*Q_xn*/, FOR( i = 0; i < L_SUBFR; i++ ) { tmp = add( *p0++, *p1++ ); -#ifdef BASOP_NOGLOB vec[i] = add_o( vec[i], tmp, &Overflow ); /* can saturate here. */ move16(); -#else - vec[i] = add( vec[i], tmp ); /* can saturate here. */ - move16(); -#endif } } st = add( st, 1 ); @@ -1827,11 +1706,7 @@ void E_ACELP_4tsearch_ivas_fx( Word16 dn[] /*Qdn*/, const Word16 cn[] /*Q_xn*/, } FOR( i = 0; i < L_SUBFR; i++ ) { -#ifdef BASOP_NOGLOB y[i] = add_o( y[i], *p0++, &Overflow ); /*Q12+scale*/ -#else - y[i] = add( y[i], *p0++ ); -#endif move16(); } } @@ -2502,11 +2377,7 @@ static void E_ACELP_codearithp_fx( const Word16 v[] /*Q9*/, UWord32 *n /*Q0*/, U { Carry = 0; move32(); -#ifdef BASOP_NOGLOB s = L_add_co( s, pulsestostates[pos[k]][t], &Carry, &Overflow ); -#else /* BASOP_NOGLOB */ - s = L_add_c( s, pulsestostates[pos[k]][t] ); -#endif /* BASOP_NOGLOB */ t = add( t, 1 ); if ( sub( t, NPMAXPT ) > 0 ) { @@ -2522,21 +2393,13 @@ static void E_ACELP_codearithp_fx( const Word16 v[] /*Q9*/, UWord32 *n /*Q0*/, U s = L_lshl( s, 1 ); if ( sign < 0 ) { -#ifdef BASOP_NOGLOB s = L_add_co( s, 1, &Carry, &Overflow ); -#else /* BASOP_NOGLOB */ - s = L_add_c( s, 1 ); -#endif /* BASOP_NOGLOB */ } /* Code last pulse */ Carry = 0; move32(); -#ifdef BASOP_NOGLOB s = L_add_co( s, pulsestostates[pos[k]][t], &Carry, &Overflow ); -#else /* BASOP_NOGLOB */ - s = L_add_c( s, pulsestostates[pos[k]][t] ); -#endif t = add( t, 1 ); } diff --git a/lib_enc/enc_acelpx_fx.c b/lib_enc/enc_acelpx_fx.c index 99c9568eb..cf5f393e7 100644 --- a/lib_enc/enc_acelpx_fx.c +++ b/lib_enc/enc_acelpx_fx.c @@ -152,11 +152,7 @@ static void E_ACELP_2pulse_searchx_fx( move16(); /*alp0 = *alp + 2.0f*R[0]; move16();*/ alp0 = L_deposit_h( *alp ); /* Qalp = Q_R*Q_signval */ -#ifdef BASOP_NOGLOB alp0 = L_mac_sat( alp0, R[0], sign_val_2 ); /*Q9+scale+Q15*/ -#else - alp0 = L_mac( alp0, R[0], sign_val_2 ); -#endif /* Ensure that in the loop below s > 0 in the first iteration, the actual values do not matter. */ sqk[0] = -1; @@ -171,11 +167,7 @@ static void E_ACELP_2pulse_searchx_fx( { sgnx = negate( sgnx ); } -#ifdef BASOP_NOGLOB if ( mac_ro( L_mac_o( L_mac_o( alp0, cor[x], sign[x], &Overflow ), cor[track_y], sign[track_y], &Overflow ), R[track_y - x], sgnx, &Overflow ) < 0 ) -#else - if ( mac_r( L_mac( L_mac( alp0, cor[x], sign[x] ), cor[track_y], sign[track_y] ), R[track_y - x], sgnx ) < 0 ) -#endif { sqk[0] = 1; @@ -195,27 +187,15 @@ static void E_ACELP_2pulse_searchx_fx( move16(); /* dn[x] has only nb_pos_ix positions saved */ /*ps1 = ps0 + dn[x]; INDIRECT(1);ADD(1);*/ -#ifdef BASOP_NOGLOB ps1 = add_sat( ps0, dn[x] ); /*Qdn*/ -#else - ps1 = add( ps0, dn[x] ); -#endif /*alp1 = alp0 + 2*sgnx*cor[x]; INDIRECT(1);MULT(1); MAC(1);*/ -#ifdef BASOP_NOGLOB alp1 = L_mac_o( alp0, cor[x], sgnx, &Overflow ); /* Qalp = (Q_R=Q_cor)*Q_signval */ -#else - alp1 = L_mac( alp0, cor[x], sgnx ); /* Qalp = (Q_R=Q_cor)*Q_signval */ -#endif pR = R - x; /*Q9+scale*/ FOR( y = track_y; y < L_SUBFR; y += 4 ) { /*ps2 = ps1 + dn[y]; ADD(1);*/ -#ifdef BASOP_NOGLOB ps2 = add_sat( ps1, dn[y] ); /*Qdn*/ -#else - ps2 = add( ps1, dn[y] ); -#endif /*alp2 = alp1 + 2.0f*sign[y]*(cor[y] + sgnx*pR[y]); MULT(1); MAC(2);*/ /*alp2 = alp1 + 2.0f*sign[y]*cor[y] + 2.0f*sign[y]*sgnx*pR[y]; MULT(1); MAC(2);*/ assert( sign[y] == sign_val_2 || sign[y] == -sign_val_2 ); @@ -224,26 +204,14 @@ static void E_ACELP_2pulse_searchx_fx( assert( sgnx != 0 ); alp2_16 = 0; -#ifdef BASOP_NOGLOB alp2 = L_mac_o( alp1, cor[y], sign[y], &Overflow ); /* Qalp = (Q_R=Q_cor)*Q_signval */ -#else - alp2 = L_mac( alp1, cor[y], sign[y] ); /* Qalp = (Q_R=Q_cor)*Q_signval */ -#endif if ( sgnx > 0 ) { -#ifdef BASOP_NOGLOB alp2_16 = mac_ro( alp2, pR[y], sign[y], &Overflow ); /* Qalp = (Q_R=Q_cor)*Q_signval */ -#else - alp2_16 = mac_r( alp2, pR[y], sign[y] ); /* Qalp = (Q_R=Q_cor)*Q_signval */ -#endif } if ( sgnx < 0 ) { -#ifdef BASOP_NOGLOB alp2_16 = msu_ro( alp2, pR[y], sign[y], &Overflow ); /* Qalp = (Q_R=Q_cor)*Q_signval */ -#else - alp2_16 = msu_r( alp2, pR[y], sign[y] ); /* Qalp = (Q_R=Q_cor)*Q_signval */ -#endif } alpk[1 - ik] = alp2_16; /* Qalp */ move16(); @@ -255,11 +223,7 @@ static void E_ACELP_2pulse_searchx_fx( /*s = (alpk * sq) - (sqk * alp2); MULT(1);MAC(1);*/ -#ifdef BASOP_NOGLOB s = L_msu_o( L_mult( alpk[ik], sq ), sqk[ik], alp2_16, &Overflow ); /* Q_sq = Q_sqk, Q_alpk = Q_alp */ -#else - s = L_msu( L_mult( alpk[ik], sq ), sqk[ik], alp2_16 ); /* Q_sq = Q_sqk, Q_alpk = Q_alp */ -#endif if ( s > 0 ) { ik = sub( 1, ik ); @@ -335,11 +299,7 @@ static void E_ACELP_1pulse_searchx_fx( sqk[0] = -1; ik = 0; move16(); -#ifdef BASOP_NOGLOB if ( mac_ro( alp0, cor[tracks[0]], sign[tracks[0]], &Overflow ) < 0 ) -#else - if ( mac_r( alp0, cor[tracks[0]], sign[tracks[0]] ) < 0 ) -#endif { sqk[0] = 1; move16(); @@ -363,11 +323,7 @@ static void E_ACELP_1pulse_searchx_fx( ps1 = add( ps0, dn[x] ); /* alp1 = alp0 + 2*sign[x]*cor[x]; MAC(1); MULT(1);*/ assert( sign[x] == sign_val_1 << 1 || sign[x] == -( sign_val_1 << 1 ) ); -#ifdef BASOP_NOGLOB alp1 = mac_ro( alp0, cor[x], sign[x], &Overflow ); /* Qalp = (Q_R=Q_cor)*Q_signval */ -#else - alp1 = mac_r( alp0, cor[x], sign[x] ); /* Qalp = (Q_R=Q_cor)*Q_signval */ -#endif alpk[1 - ik] = alp1; /* Qalp */ move16(); @@ -378,11 +334,7 @@ static void E_ACELP_1pulse_searchx_fx( move16(); /*s = (alpk[ik] * sq) - (sqk[ik] * alp1); MULT(1);MAC(1);*/ -#ifdef BASOP_NOGLOB s = L_msu_o( L_mult_o( alpk[ik], sq, &Overflow ), sqk[ik], alp1, &Overflow ); /* Q9+Qalp+1 */ -#else - s = L_msu( L_mult( alpk[ik], sq ), sqk[ik], alp1 ); -#endif if ( s > 0 ) { ik = sub( 1, ik ); diff --git a/lib_enc/enc_amr_wb_fx.c b/lib_enc/enc_amr_wb_fx.c index edc04bc83..06b0881a0 100644 --- a/lib_enc/enc_amr_wb_fx.c +++ b/lib_enc/enc_amr_wb_fx.c @@ -187,24 +187,15 @@ void encod_amr_wb_fx( &gain_inov, &norm_gain_code, g_corr, clip_gain, hAmrwb_IO->past_qua_en_fx ); gp_clip_test_gain_pit_fx( st->element_mode, st->core_brate, gain_pit, st->clip_var_fx ); -#ifdef BASOP_NOGLOB Lgcode = L_shl_o( gain_code, Q_new, &Overflow ); /* scaled gain_code with Qnew -> Q16*/ gcode16 = round_fx_o( Lgcode, &Overflow ); /*Q0*/ -#else /* BASOP_NOGLOB */ - Lgcode = L_shl( gain_code, Q_new ); /* scaled gain_code with Qnew -> Q16*/ - gcode16 = round_fx( Lgcode ); -#endif /* BASOP_NOGLOB */ hLPDmem->tilt_code = Est_tilt2( exc + i_subfr, gain_pit, code, Lgcode, &voice_fac, shift ); /*Q15*/ FOR( i = 0; i < L_SUBFR; i++ ) { -#ifdef BASOP_NOGLOB exc2[i + i_subfr] = round_fx_o( L_shl_o( L_mult( gain_pit, exc[i + i_subfr] ), 1, &Overflow ), &Overflow ); /*Q_new*/ move16(); -#else /* BASOP_NOGLOB */ - exc2[i + i_subfr] = round_fx( L_shl( L_mult( gain_pit, exc[i + i_subfr] ), 1 ) ); -#endif /* BASOP_NOGLOB */ } /*-----------------------------------------------------------------* @@ -217,35 +208,20 @@ void encod_amr_wb_fx( Ltmp = L_negate( Ltmp ); Ltmp = L_mac( Ltmp, xn[L_SUBFR - 1], 16384 /*Q14*/ ); /* Q_new-1+shift+14+1 */ Ltmp = L_msu( Ltmp, y1[L_SUBFR - 1], gain_pit /*Q14*/ ); /* Q_new-1+shift+14+1 */ -#ifdef BASOP_NOGLOB Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); /* Q_new+15 */ hLPDmem->mem_w0 = round_fx_sat( Ltmp ); /*Q_new-1 */ move16(); -#else - Ltmp = L_shl( Ltmp, sub( 1, shift ) ); - hLPDmem->mem_w0 = round_fx( Ltmp ); /*Q_new-1 */ -#endif /*-----------------------------------------------------------------* * Find the total excitation *-----------------------------------------------------------------*/ FOR( i = 0; i < L_SUBFR; i++ ) { L_tmp = L_mult( gcode16, code[i] ); /*Q10*/ -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, 5 ); /*Q15*/ L_tmp = L_mac_sat( L_tmp, exc[i + i_subfr], gain_pit ); /* Q_new+15 */ -#else - L_tmp = L_shl( L_tmp, 5 ); - L_tmp = L_mac( L_tmp, exc[i + i_subfr], gain_pit ); -#endif -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( L_tmp, 1, &Overflow ); /* saturation can occur here Q_new+15*/ exc[i + i_subfr] = round_fx_o( L_tmp, &Overflow ); /*Q_new*/ move16(); -#else /* BASOP_NOGLOB */ - L_tmp = L_shl( L_tmp, 1 ); /* saturation can occur here */ - exc[i + i_subfr] = round_fx( L_tmp ); -#endif } /*-----------------------------------------------------------------* diff --git a/lib_enc/enc_gen_voic_fx.c b/lib_enc/enc_gen_voic_fx.c index 243b9f049..a14003fd2 100644 --- a/lib_enc/enc_gen_voic_fx.c +++ b/lib_enc/enc_gen_voic_fx.c @@ -244,11 +244,7 @@ void encod_gen_voic_fx( } /*st_fx->lowrate_pitchGain = 0.9f * st_fx->lowrate_pitchGain + 0.1f * gain_pit_fx;*/ -#ifdef BASOP_NOGLOB hSpMusClas->lowrate_pitchGain = round_fx_o( L_mac_o( L_mult( 29491, hSpMusClas->lowrate_pitchGain ), 6554, gain_pit_fx, &Overflow ), &Overflow ); /*Q14*Q16(0.1) + Q15 -> Q15*/ -#else - hSpMusClas->lowrate_pitchGain = round_fx( L_mac( L_mult( 29491, hSpMusClas->lowrate_pitchGain ), 6554, gain_pit_fx ) ); /*Q14*Q16(0.1) + Q15 -> Q15*/ -#endif /*-----------------------------------------------------------------* * Transform domain contribution encoding - active frames @@ -299,13 +295,8 @@ void encod_gen_voic_fx( } gp_clip_test_gain_pit_fx( st_fx->element_mode, st_fx->core_brate, gain_pit_fx, st_fx->clip_var_fx ); -#ifdef BASOP_NOGLOB Lgcode = L_shl_o( gain_code_fx, Q_new, &Overflow ); /* scaled gain_code with Qnew -> Q16*/ gcode16 = round_fx_o( Lgcode, &Overflow ); /*Q0*/ -#else - Lgcode = L_shl( gain_code_fx, Q_new ); /* scaled gain_code with Qnew -> Q16*/ - gcode16 = round_fx( Lgcode ); -#endif hLPDmem->tilt_code = Est_tilt2( &exc_fx[i_subfr_fx], gain_pit_fx, code_fx, Lgcode, &voice_fac_fx, shift ); /* Q15 */ move16(); @@ -331,21 +322,15 @@ void encod_gen_voic_fx( Ltmp = L_negate( Ltmp ); Ltmp = L_mac( Ltmp, xn_fx[L_SUBFR - 1], 16384 /*Q14*/ ); /* Q_new-1+shift+14+1 */ Ltmp = L_msu( Ltmp, y1_fx[L_SUBFR - 1], gain_pit_fx /*Q14*/ ); /* Q_new-1+shift+14+1 */ -#ifdef BASOP_NOGLOB Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); /* 15 + Q_new */ hLPDmem->mem_w0 = round_fx_sat( Ltmp ); /*Q_new-1 */ move16(); -#else - Ltmp = L_shl( Ltmp, sub( 1, shift ) ); - hLPDmem->mem_w0 = round_fx( Ltmp ); /*Q_new-1 */ -#endif IF( gain_preQ_fx != 0 ) { tmp1_fx = add( 16 - ( 2 + Q_AVQ_OUT_DEC + 1 ), Q_new ); FOR( i = 0; i < L_SUBFR; i++ ) { -#ifdef BASOP_NOGLOB /* Contribution from AVQ layer */ Ltmp1 = L_mult_o( gain_preQ_fx, code_preQ_fx[i], &Overflow ); /* Q2 + Q6 -> Q9*/ Ltmp1 = L_shl_o( Ltmp1, tmp1_fx, &Overflow ); /* Q16 + Q_exc */ @@ -354,28 +339,13 @@ void encod_gen_voic_fx( Ltmp = L_shl_o( L_mult( gain_pit_fx, exc_fx[i + i_subfr_fx] ), 1, &Overflow ); /* Q16 */ exc2_fx[i + i_subfr_fx] = round_fx_o( L_add_o( Ltmp, Ltmp1, &Overflow ), &Overflow ); /* Q0 */ move16(); -#else - /* Contribution from AVQ layer */ - Ltmp1 = L_mult( gain_preQ_fx, code_preQ_fx[i] ); /* Q2 + Q6 -> Q9*/ - Ltmp1 = L_shl( Ltmp1, tmp1_fx ); /* Q16 + Q_exc */ - - /* Compute exc2 */ - Ltmp = L_shl( L_mult( gain_pit_fx, exc_fx[i + i_subfr_fx] ), 1 ); - exc2_fx[i + i_subfr_fx] = round_fx( L_add( Ltmp, Ltmp1 ) ); -#endif /* code in Q9, gain_pit in Q14 */ Ltmp = L_mult( gcode16, code_fx[i] ); /* Q10 */ Ltmp = L_shl( Ltmp, 5 ); /* Q15 */ Ltmp = L_mac( Ltmp, exc_fx[i + i_subfr_fx], gain_pit_fx ); /* Q15 */ -#ifdef BASOP_NOGLOB Ltmp = L_shl_o( Ltmp, 1, &Overflow ); /* saturation can occur here Q16*/ exc_fx[i + i_subfr_fx] = round_fx_o( L_add_o( Ltmp, Ltmp1, &Overflow ), &Overflow ); /* Q0 */ -#else - Ltmp = L_shl( Ltmp, 1 ); /* saturation can occur here */ - - exc_fx[i + i_subfr_fx] = round_fx( L_add( Ltmp, Ltmp1 ) ); -#endif } } ELSE @@ -388,17 +358,10 @@ void encod_gen_voic_fx( { /* code in Q9, gain_pit in Q14 */ Ltmp = L_mult( gcode16, code_fx[i] ); /* Q10 */ -#ifdef BASOP_NOGLOB Ltmp = L_shl_o( Ltmp, 5, &Overflow ); /* Q15 */ Ltmp = L_mac_o( Ltmp, exc_fx[i + i_subfr_fx], gain_pit_fx, &Overflow ); /* Q15 */ Ltmp = L_shl_o( Ltmp, 1, &Overflow ); /* saturation can occur here Q16*/ exc_fx[i + i_subfr_fx] = round_fx_o( Ltmp, &Overflow ); /* Q0 */ -#else - Ltmp = L_shl( Ltmp, 5 ); - Ltmp = L_mac( Ltmp, exc_fx[i + i_subfr_fx], gain_pit_fx ); - Ltmp = L_shl( Ltmp, 1 ); /* saturation can occur here */ - exc_fx[i + i_subfr_fx] = round_fx( Ltmp ); -#endif } } /*-----------------------------------------------------------------* @@ -635,12 +598,8 @@ void encod_gen_voic_ivas_fx( } /*st_fx->lowrate_pitchGain = 0.9f * st_fx->lowrate_pitchGain + 0.1f * gain_pit_fx;*/ -#ifdef BASOP_NOGLOB hSpMusClas->lowrate_pitchGain = round_fx_o( L_mac_o( L_mult( 29491, hSpMusClas->lowrate_pitchGain ), 6554, gain_pit_fx, &Overflow ), &Overflow ); /* Q14 */ move16(); -#else - hSpMusClas->lowrate_pitchGain = round_fx( L_mac( L_mult( 29491, hSpMusClas->lowrate_pitchGain ), 6554, gain_pit_fx ) ); /*Q14*Q16(0.1) + Q15 -> Q15*/ -#endif /*-----------------------------------------------------------------* * Transform domain contribution encoding - active frames @@ -691,13 +650,8 @@ void encod_gen_voic_ivas_fx( } gp_clip_test_gain_pit_fx( st_fx->element_mode, st_fx->core_brate, gain_pit_fx, st_fx->clip_var_fx ); -#ifdef BASOP_NOGLOB Lgcode = L_shl_o( gain_code_fx, Q_new, &Overflow ); /* scaled gain_code with Qnew -> Q16*/ gcode16 = round_fx_o( Lgcode, &Overflow ); /* Q0 */ -#else - Lgcode = L_shl( gain_code_fx, Q_new ); /* scaled gain_code with Qnew -> Q16*/ - gcode16 = round_fx( Lgcode ); -#endif hLPDmem->tilt_code = est_tilt_ivas_fx( &exc_fx[i_subfr_fx], gain_pit_fx, code_fx, gain_code_fx, &voice_fac_fx, Q_new, L_SUBFR, 0 ); /* Q15 */ move16(); @@ -723,21 +677,15 @@ void encod_gen_voic_ivas_fx( Ltmp = L_negate( Ltmp ); Ltmp = L_mac( Ltmp, xn_fx[L_SUBFR - 1], 16384 /*Q14*/ ); // Q_new-1+15+shift Ltmp = L_msu( Ltmp, y1_fx[L_SUBFR - 1], gain_pit_fx /*Q14*/ ); // Q_new-1+15+shift -#ifdef BASOP_NOGLOB Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); // Q_new+15 hLPDmem->mem_w0 = round_fx_sat( Ltmp ); /*Q_new-1 */ move16(); -#else - Ltmp = L_shl( Ltmp, sub( 1, shift ) ); - hLPDmem->mem_w0 = round_fx( Ltmp ); /*Q_new-1 */ -#endif IF( gain_preQ_fx != 0 ) { tmp1_fx = add( 16 - ( 2 + Q_AVQ_OUT_DEC + 1 ), Q_new ); FOR( i = 0; i < L_SUBFR; i++ ) { -#ifdef BASOP_NOGLOB /* Contribution from AVQ layer */ Ltmp1 = L_mult_o( gain_preQ_fx, code_preQ_fx[i], &Overflow ); /* Q2 + Q6 -> Q9*/ Ltmp1 = L_shl_o( Ltmp1, tmp1_fx, &Overflow ); /* Q16 + Q_exc */ @@ -746,29 +694,14 @@ void encod_gen_voic_ivas_fx( Ltmp = L_shl_o( L_mult( gain_pit_fx, exc_fx[i + i_subfr_fx] ), 1, &Overflow ); /* Q0 */ exc2_fx[i + i_subfr_fx] = round_fx_o( L_add_o( Ltmp, Ltmp1, &Overflow ), &Overflow ); /* Q0 */ move16(); -#else - /* Contribution from AVQ layer */ - Ltmp1 = L_mult( gain_preQ_fx, code_preQ_fx[i] ); /* Q2 + Q6 -> Q9*/ - Ltmp1 = L_shl( Ltmp1, tmp1_fx ); /* Q16 + Q_exc */ - - /* Compute exc2 */ - Ltmp = L_shl( L_mult( gain_pit_fx, exc_fx[i + i_subfr_fx] ), 1 ); - exc2_fx[i + i_subfr_fx] = round_fx( L_add( Ltmp, Ltmp1 ) ); -#endif /* code in Q9, gain_pit in Q14 */ Ltmp = L_mult( gcode16, code_fx[i] ); /* Q10 */ Ltmp = L_shl( Ltmp, 5 ); /* Q15 */ Ltmp = L_mac( Ltmp, exc_fx[i + i_subfr_fx], gain_pit_fx ); /* Q15 */ -#ifdef BASOP_NOGLOB Ltmp = L_shl_o( Ltmp, 1, &Overflow ); /* saturation can occur here Q16*/ exc_fx[i + i_subfr_fx] = round_fx_o( L_add_o( Ltmp, Ltmp1, &Overflow ), &Overflow ); /* Q0 */ move16(); -#else - Ltmp = L_shl( Ltmp, 1 ); /* saturation can occur here */ - - exc_fx[i + i_subfr_fx] = round_fx( L_add( Ltmp, Ltmp1 ) ); -#endif } } ELSE @@ -781,17 +714,10 @@ void encod_gen_voic_ivas_fx( { /* code in Q9, gain_pit in Q14 */ Ltmp = L_mult( gcode16, code_fx[i] ); /* Q10 */ -#ifdef BASOP_NOGLOB Ltmp = L_shl_o( Ltmp, 5, &Overflow ); /* Q15 */ Ltmp = L_mac_o( Ltmp, exc_fx[i + i_subfr_fx], gain_pit_fx, &Overflow ); /* Q15 */ Ltmp = L_shl_o( Ltmp, 1, &Overflow ); /* saturation can occur here Q16*/ exc_fx[i + i_subfr_fx] = round_fx_o( Ltmp, &Overflow ); /* Q0 */ -#else - Ltmp = L_shl( Ltmp, 5 ); - Ltmp = L_mac( Ltmp, exc_fx[i + i_subfr_fx], gain_pit_fx ); - Ltmp = L_shl( Ltmp, 1 ); /* saturation can occur here */ - exc_fx[i + i_subfr_fx] = round_fx( Ltmp ); -#endif } } /*-----------------------------------------------------------------* diff --git a/lib_enc/enc_gen_voic_rf_fx.c b/lib_enc/enc_gen_voic_rf_fx.c index 7d1aac5af..b1c14e286 100644 --- a/lib_enc/enc_gen_voic_rf_fx.c +++ b/lib_enc/enc_gen_voic_rf_fx.c @@ -441,30 +441,15 @@ void coder_acelp_rf_fx( *-----------------------------------------------------------------*/ /* st_fx->_rf_mem_w0 = xn[L_SUBFR-1] - (gain_pit*y1[L_SUBFR-1]) - (gain_code*y2[L_SUBFR-1]); */ Ltmp = Mpy_32_16_1( gain_code, y2[L_SUBFR - 1] ); /* Q10 */ -#ifdef BASOP_NOGLOB Ltmp = L_shl_o( Ltmp, add( 5, Q_xn ), &Overflow ); /* Q15 + Q_xn */ Ltmp = L_mac_o( Ltmp, y1[L_SUBFR - 1], gain_pit, &Overflow ); /* Q15 + Q_xn */ -#else - Ltmp = L_shl( Ltmp, add( 5, Q_xn ) ); - Ltmp = L_mac( Ltmp, y1[L_SUBFR - 1], gain_pit ); -#endif /* Add Gaussian contribution*/ Ltmp2 = Mpy_32_16_1( gain_code2, y22[L_SUBFR - 1] ); /* Q10 */ -#ifdef BASOP_NOGLOB Ltmp2 = L_shl_o( Ltmp2, add( 5, Q_xn ), &Overflow ); /* Q15 + Q_xn */ Ltmp = L_add_o( Ltmp, Ltmp2, &Overflow ); /* Q15 + Q_xn */ hRF->rf_mem_w0 = sub_o( xn[L_SUBFR - 1], round_fx_o( L_shl_o( Ltmp, 1, &Overflow ), &Overflow ), &Overflow ); /* Q_xn */ move16(); hRF->rf_mem_w0 = shr_o( hRF->rf_mem_w0, shift, &Overflow ); /*Qnew-1*/ -#else - Ltmp2 = L_shl( Ltmp2, add( 5, Q_xn ) ); - Ltmp = L_add( Ltmp, Ltmp2 ); - hRF->rf_mem_w0 = sub( xn[L_SUBFR - 1], round_fx( L_shl( Ltmp, 1 ) ) ); - move16(); - BASOP_SATURATE_WARNING_OFF_EVS; - hRF->rf_mem_w0 = shr( hRF->rf_mem_w0, shift ); /*Qnew-1*/ - BASOP_SATURATE_WARNING_ON_EVS; -#endif /*-------------------------------------------------------* @@ -478,33 +463,16 @@ void coder_acelp_rf_fx( { /* code in Q9, gain_pit in Q14; exc Q_new */ Ltmp = Mpy_32_16_1( gain_code2, code2[i] ); /* Q10 */ -#ifdef BASOP_NOGLOB Ltmp = L_shl_o( Ltmp, Q_new_p5, &Overflow ); /* Q15 + Q_new */ Ltmp = L_mac_o( Ltmp, gain_pit, exc_rf[i + i_subfr], &Overflow ); /* Q15 + Q_new */ exc2[i] = round_fx_o( L_shl_o( Ltmp, 1, &Overflow ), &Overflow ); /* Q_new */ move16(); -#else - Ltmp = L_shl( Ltmp, Q_new_p5 ); - Ltmp = L_mac( Ltmp, gain_pit, exc_rf[i + i_subfr] ); - BASOP_SATURATE_WARNING_OFF_EVS - exc2[i] = round_fx( L_shl( Ltmp, 1 ) ); - BASOP_SATURATE_WARNING_ON_EVS -#endif Ltmp2 = Mpy_32_16_1( gain_code_vect[j], code[i] ); /* Q10 */ -#ifdef BASOP_NOGLOB Ltmp2 = L_shl_o( Ltmp2, Q_new_p5, &Overflow ); /* Q15 + Q_new */ Ltmp = L_add_o( Ltmp, Ltmp2, &Overflow ); /* Q15 + Q_new */ Ltmp = L_shl_o( Ltmp, 1, &Overflow ); /* saturation can occur here Q16 + Q_new*/ exc_rf[i + i_subfr] = round_fx_o( Ltmp, &Overflow ); /* Q_new */ move16(); -#else - Ltmp2 = L_shl( Ltmp2, Q_new_p5 ); - Ltmp = L_add( Ltmp, Ltmp2 ); - BASOP_SATURATE_WARNING_OFF_EVS - Ltmp = L_shl( Ltmp, 1 ); /* saturation can occur here */ - BASOP_SATURATE_WARNING_ON_EVS - exc_rf[i + i_subfr] = round_fx( Ltmp ); -#endif } tmp2 = L_SUBFR; move16(); diff --git a/lib_enc/enc_higher_acelp_fx.c b/lib_enc/enc_higher_acelp_fx.c index 3630be38e..8815b39aa 100644 --- a/lib_enc/enc_higher_acelp_fx.c +++ b/lib_enc/enc_higher_acelp_fx.c @@ -86,11 +86,7 @@ void transf_cdbk_enc_fx( *--------------------------------------------------------------*/ IF( EQ_16( st_fx->coder_type, INACTIVE ) ) { -#ifdef BASOP_NOGLOB gcode16 = round_fx_o( L_shl_o( gain_code, Q_new, &Overflow ), &Overflow ); -#else - gcode16 = round_fx( L_shl( gain_code, Q_new ) ); -#endif FOR( i = 0; i < L_SUBFR; i++ ) { /*x_tran[i] = xn[i] - *gain_pit * y1[i] - gain_code * y2[i];*/ @@ -99,14 +95,9 @@ void transf_cdbk_enc_fx( Ltmp = L_negate( Ltmp ); Ltmp = L_mac( Ltmp, xn[i], 16384 ); Ltmp = L_msu( Ltmp, y1[i], *gain_pit ); /* Q_new + 14 + shift */ -#ifdef BASOP_NOGLOB Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); /* Q_new + 15 */ x_tran[i] = round_fx_sat( Ltmp ); /*Q_new-1 */ move16(); -#else - Ltmp = L_shl( Ltmp, sub( 1, shift ) ); - x_tran[i] = round_fx( Ltmp ); /*Q_new-1 */ -#endif } find_cn_fx( x_tran, Ap, p_Aq, x_in ); } @@ -154,15 +145,9 @@ void transf_cdbk_enc_fx( { /*fcorr += fx_tran[i]*(float)ix_norm[i];*/ /*fener += (float)ix_norm[i]*(float)ix_norm[i];*/ -#ifdef BASOP_NOGLOB stmp = shl_sat( x_norm[i], Q_AVQ_OUT ); L_corr = L_mac_sat( L_corr, x_tran[i], stmp ); L_ener = L_mac_sat( L_ener, stmp, stmp ); -#else - stmp = shl( x_norm[i], Q_AVQ_OUT ); - L_corr = L_mac( L_corr, x_tran[i], stmp ); - L_ener = L_mac( L_ener, stmp, stmp ); -#endif } L_ener = L_max( L_ener, 1 ); @@ -183,20 +168,12 @@ void transf_cdbk_enc_fx( } m_corr = div_s( m_corr, m_ener ); /* e_corr - e_ener */ e_corr = sub( e_corr, e_ener ); -#ifdef BASOP_NOGLOB Ltmp = L_shl_sat( m_corr, s_min( add( e_corr, 1 ), 31 ) ); /* Lgain in Q16 */ -#else - Ltmp = L_shl( m_corr, s_min( add( e_corr, 1 ), 31 ) ); /* Lgain in Q16 */ -#endif IF( EQ_16( st_fx->coder_type, INACTIVE ) ) { Ltmp1 = L_max( gain_code, 1 ); e_den = norm_l( Ltmp1 ); -#ifdef BASOP_NOGLOB m_den = extract_h( L_shl_sat( Ltmp1, e_den ) ); -#else - m_den = extract_h( L_shl( Ltmp1, e_den ) ); -#endif /* ensure m_corr < m_den */ test(); IF( m_corr > 0 && m_den > 0 ) @@ -204,11 +181,7 @@ void transf_cdbk_enc_fx( m_corr = div_s( 16384, m_den ); e_corr = sub( 14 + 4, e_den ); Ltmp = L_shr( Mult_32_16( Ltmp, m_corr ), e_corr ); /*Q12*/ -#ifdef BASOP_NOGLOB stmp = round_fx_o( L_shl_o( Ltmp, 16, &Overflow ), &Overflow ); /* Q12 */ -#else - stmp = round_fx( L_shl( Ltmp, 16 ) ); -#endif } ELSE { @@ -228,13 +201,8 @@ void transf_cdbk_enc_fx( index = usquant_fx( stmp, &stmp, G_AVQ_MIN_INACT_Q12, G_AVQ_DELTA_INACT_Q12 >> 1, ( 1 << G_AVQ_BITS ) ); /* Q0 */ } Ltmp = Mult_32_16( gain_code, stmp ); /* Q16 * Q12 - 15 -> Q13*/ -#ifdef BASOP_NOGLOB Ltmp = L_shl_sat( Ltmp, 5 ); /* Q13 -> Q18*/ *gain_preQ = round_fx_sat( Ltmp ); /* Q2*/ -#else - Ltmp = L_shl( Ltmp, 5 ); /* Q13 -> Q18*/ - *gain_preQ = round_fx( Ltmp ); /* Q2*/ -#endif } ELSE { @@ -320,11 +288,7 @@ void transf_cdbk_enc_fx( FOR( i = 0; i < Nsv * WIDTH_BAND; i++ ) { -#ifdef BASOP_NOGLOB x_tran[i] = shl_o( x_norm[i], Q_AVQ_OUT_DEC, &Overflow ); -#else - x_tran[i] = shl( x_norm[i], Q_AVQ_OUT_DEC ); -#endif move16(); } set16_fx( x_tran + Nsv * WIDTH_BAND, 0, sub( L_SUBFR, i_mult2( WIDTH_BAND, Nsv ) ) ); @@ -405,11 +369,7 @@ void transf_cdbk_enc_fx( updt_tar_HR_fx( cn, cn, code_preQ, *gain_preQ, sub( Q_new, add( -15 + 2, Q_AVQ_OUT_DEC ) ), L_SUBFR ); updt_tar_HR_fx( xn, xn, x_tran, *gain_preQ, sub( Q_new, add( -15 + 2, Q_AVQ_OUT_DEC ) ), L_SUBFR ); -#ifdef BASOP_NOGLOB *gain_pit = corr_xy1_fx( xn, y1, g_corr, L_SUBFR, 0, &Overflow ); /* Q14 */ -#else - *gain_pit = corr_xy1_fx( xn, y1, g_corr, L_SUBFR, 0 ); -#endif /* clip gain if necessary to avoid problems at decoder */ test(); if ( EQ_16( clip_gain, 1 ) && GT_16( *gain_pit, 15565 ) ) @@ -492,11 +452,7 @@ void transf_cdbk_enc_ivas_fx( *--------------------------------------------------------------*/ IF( EQ_16( st_fx->coder_type, INACTIVE ) ) { -#ifdef BASOP_NOGLOB gcode16 = round_fx_o( L_shl_o( gain_code, Q_new, &Overflow ), &Overflow ); -#else - gcode16 = round_fx( L_shl( gain_code, Q_new ) ); -#endif FOR( i = 0; i < L_SUBFR; i++ ) { /*x_tran[i] = xn[i] - *gain_pit * y1[i] - gain_code * y2[i];*/ @@ -505,13 +461,8 @@ void transf_cdbk_enc_ivas_fx( Ltmp = L_negate( Ltmp ); Ltmp = L_mac( Ltmp, xn[i], 16384 ); Ltmp = L_msu( Ltmp, y1[i], *gain_pit ); /* Q_new + 14 + shift */ -#ifdef BASOP_NOGLOB Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); /* Q_new + 15 */ x_tran[i] = round_fx_sat( Ltmp ); /*Q_new-1 */ -#else - Ltmp = L_shl( Ltmp, sub( 1, shift ) ); - x_tran[i] = round_fx( Ltmp ); /*Q_new-1 */ -#endif } find_cn_fx( x_tran, Ap, p_Aq, x_in ); } @@ -559,15 +510,9 @@ void transf_cdbk_enc_ivas_fx( { /*fcorr += fx_tran[i]*(float)ix_norm[i];*/ /*fener += (float)ix_norm[i]*(float)ix_norm[i];*/ -#ifdef BASOP_NOGLOB stmp = shl_sat( x_norm[i], Q_AVQ_OUT ); L_corr = L_mac_sat( L_corr, x_tran[i], stmp ); L_ener = L_mac_sat( L_ener, stmp, stmp ); -#else - stmp = shl( x_norm[i], Q_AVQ_OUT ); - L_corr = L_mac( L_corr, x_tran[i], stmp ); - L_ener = L_mac( L_ener, stmp, stmp ); -#endif } L_ener = L_max( L_ener, 1 ); @@ -588,20 +533,12 @@ void transf_cdbk_enc_ivas_fx( } m_corr = div_s( m_corr, m_ener ); /* e_corr - e_ener */ e_corr = sub( e_corr, e_ener ); -#ifdef BASOP_NOGLOB Ltmp = L_shl_sat( m_corr, s_min( add( e_corr, 1 ), 31 ) ); /* Lgain in Q16 */ -#else - Ltmp = L_shl( m_corr, s_min( add( e_corr, 1 ), 31 ) ); /* Lgain in Q16 */ -#endif IF( EQ_16( st_fx->coder_type, INACTIVE ) ) { Ltmp1 = L_max( gain_code, 1 ); e_den = norm_l( Ltmp1 ); -#ifdef BASOP_NOGLOB m_den = extract_h( L_shl_sat( Ltmp1, e_den ) ); -#else - m_den = extract_h( L_shl( Ltmp1, e_den ) ); -#endif /* ensure m_corr < m_den */ test(); IF( m_corr > 0 && m_den > 0 ) @@ -609,11 +546,7 @@ void transf_cdbk_enc_ivas_fx( m_corr = div_s( 16384, m_den ); e_corr = sub( 14 + 4, e_den ); Ltmp = L_shr( Mult_32_16( Ltmp, m_corr ), e_corr ); /*Q12*/ -#ifdef BASOP_NOGLOB stmp = round_fx_o( L_shl_o( Ltmp, 16, &Overflow ), &Overflow ); /* Q12 */ -#else - stmp = round_fx( L_shl( Ltmp, 16 ) ); -#endif } ELSE { @@ -633,14 +566,9 @@ void transf_cdbk_enc_ivas_fx( index = usquant_fx( stmp, &stmp, G_AVQ_MIN_INACT_Q12, G_AVQ_DELTA_INACT_Q12 >> 1, ( 1 << G_AVQ_BITS ) ); /* Q0 */ } Ltmp = Mult_32_16( gain_code, stmp ); /* Q16 * Q12 - 15 -> Q13*/ -#ifdef BASOP_NOGLOB Ltmp = L_shl_sat( Ltmp, 5 ); /* Q13 -> Q18*/ *gain_preQ = round_fx_sat( Ltmp ); /* Q2*/ move16(); -#else - Ltmp = L_shl( Ltmp, 5 ); /* Q13 -> Q18*/ - *gain_preQ = round_fx( Ltmp ); /* Q2*/ -#endif } ELSE { @@ -728,11 +656,7 @@ void transf_cdbk_enc_ivas_fx( FOR( i = 0; i < Nsv * WIDTH_BAND; i++ ) { -#ifdef BASOP_NOGLOB x_tran[i] = shl_o( x_norm[i], Q_AVQ_OUT_DEC, &Overflow ); -#else - x_tran[i] = shl( x_norm[i], Q_AVQ_OUT_DEC ); -#endif move16(); } set16_fx( x_tran + Nsv * WIDTH_BAND, 0, sub( L_SUBFR, i_mult2( WIDTH_BAND, Nsv ) ) ); @@ -821,12 +745,8 @@ void transf_cdbk_enc_ivas_fx( updt_tar_HR_fx( cn, cn, code_preQ, *gain_preQ, sub( Q_new, add( -15 + 2, Q_AVQ_OUT_DEC ) ), L_SUBFR ); updt_tar_HR_fx( xn, xn, x_tran, *gain_preQ, sub( Q_new, add( -15 + 2, Q_AVQ_OUT_DEC ) ), L_SUBFR ); -#ifdef BASOP_NOGLOB *gain_pit = corr_xy1_fx( xn, y1, g_corr, L_SUBFR, 0, &Overflow ); /* Q14 */ move16(); -#else - *gain_pit = corr_xy1_fx( xn, y1, g_corr, L_SUBFR, 0 ); -#endif /* clip gain if necessary to avoid problems at decoder */ test(); if ( EQ_16( clip_gain, 1 ) && GT_16( *gain_pit, 15565 ) ) @@ -908,13 +828,8 @@ Word16 gain_quant_fx( /* o: quantization index Q0*/ /*tmp1 = sub(c_max,c_min); Q14*/ /*tmp2 = sub(c_gain,c_min); Q14*/ -#ifdef BASOP_NOGLOB tmp1 = msu_r_sat( L_deposit_h( c_max /*in Q13 already*/ ), c_min, 16384 ); /*Q13*/ tmp2 = msu_r_sat( L_deposit_h( c_gain /*in Q13 already*/ ), c_min, 16384 ); /*Q13*/ -#else - tmp1 = msu_r( L_deposit_h( c_max /*in Q13 already*/ ), c_min, 16384 ); /*Q13*/ - tmp2 = msu_r( L_deposit_h( c_gain /*in Q13 already*/ ), c_min, 16384 ); /*Q13*/ -#endif IF( tmp1 != 0 ) { exp = norm_s( tmp1 ); diff --git a/lib_enc/enc_nelp_fx.c b/lib_enc/enc_nelp_fx.c index aedb1d2c2..c3eb2ae18 100644 --- a/lib_enc/enc_nelp_fx.c +++ b/lib_enc/enc_nelp_fx.c @@ -145,11 +145,7 @@ void encod_nelp_fx( * Updates: last value of new target is stored in mem_w0 *-----------------------------------------------------------------*/ -#ifdef BASOP_NOGLOB hLPDmem->mem_w0 = sub_sat( shr_sat( xn_fx[L_SUBFR - 1], shift ), shr( exc_fx[L_FRAME - 1], 1 ) ); -#else - hLPDmem->mem_w0 = sub( shr( xn_fx[L_SUBFR - 1], shift ), shr( exc_fx[L_FRAME - 1], 1 ) ); -#endif move16(); /*Q_new-1 */ hLPDmem->tilt_code = 0; move16(); /* purely unvoiced */ @@ -289,11 +285,7 @@ void encod_nelp_ivas_fx( * Updates: last value of new target is stored in mem_w0 *-----------------------------------------------------------------*/ -#ifdef BASOP_NOGLOB hLPDmem->mem_w0 = sub_sat( shr_sat( xn_fx[L_SUBFR - 1], shift ), shr( exc_fx[L_FRAME - 1], 1 ) ); -#else - hLPDmem->mem_w0 = sub( shr( xn_fx[L_SUBFR - 1], shift ), shr( exc_fx[L_FRAME - 1], 1 ) ); -#endif move16(); /*Q_new-1 */ hLPDmem->tilt_code = 0; move16(); /* purely unvoiced */ diff --git a/lib_enc/enc_pit_exc_fx.c b/lib_enc/enc_pit_exc_fx.c index 54674da1e..08e79e543 100644 --- a/lib_enc/enc_pit_exc_fx.c +++ b/lib_enc/enc_pit_exc_fx.c @@ -296,11 +296,7 @@ void enc_pit_exc_fx( } /*st_fx->lowrate_pitchGain = 0.9f * st_fx->lowrate_pitchGain + 0.1f * gain_pit;*/ -#ifdef BASOP_NOGLOB hSpMusClas->lowrate_pitchGain = round_fx_o( L_mac_o( L_mult( 29491, hSpMusClas->lowrate_pitchGain ), 6554, gain_pit, &Overflow ), &Overflow ); /*Q14*Q16(0.1) + Q15 -> Q15*/ -#else - hSpMusClas->lowrate_pitchGain = round_fx( L_mac( L_mult( 29491, hSpMusClas->lowrate_pitchGain ), 6554, gain_pit ) ); /*Q14*Q16(0.1) + Q15 -> Q15*/ -#endif gpit_tmp = gain_pit; move16(); /*Q14*/ @@ -356,13 +352,8 @@ void enc_pit_exc_fx( } gp_clip_test_gain_pit_fx( st_fx->element_mode, st_fx->core_brate, gain_pit, st_fx->clip_var_fx ); -#ifdef BASOP_NOGLOB Lgcode = L_shl_sat( gain_code, Q_new ); /* scaled gain_code with Qnew -> Q16*/ gcode16 = round_fx_sat( Lgcode ); -#else - Lgcode = L_shl( gain_code, Q_new ); /* scaled gain_code with Qnew -> Q16*/ - gcode16 = round_fx( Lgcode ); -#endif IF( use_fcb != 0 ) { hLPDmem->tilt_code = Est_tilt2( &exc[i_subfr], gain_pit, code, Lgcode, &voice_fac, shift ); /* Q15 */ @@ -379,7 +370,6 @@ void enc_pit_exc_fx( IF( use_fcb != 0 ) { Ltmp = L_mult( gcode16, y2[L_subfr - 1] ); /* Q10 + Q_new */ -#ifdef BASOP_NOGLOB Ltmp = L_shl_o( Ltmp, add( 5, shift ), &Overflow ); /* Q15 + Q_new + shift */ Ltmp = L_negate( Ltmp ); Ltmp = L_mac_o( Ltmp, xn[L_subfr - 1], 16384, &Overflow ); /* Q_new + Q15 + shift */ @@ -387,29 +377,14 @@ void enc_pit_exc_fx( Ltmp = L_shl_o( Ltmp, sub( 1, shift ), &Overflow ); /* Q_new + 15 */ hLPDmem->mem_w0 = round_fx_o( Ltmp, &Overflow ); /*Q_new-1 */ move16(); -#else - Ltmp = L_mult( gcode16, y2[L_subfr - 1] ); - Ltmp = L_shl( Ltmp, add( 5, shift ) ); - Ltmp = L_negate( Ltmp ); - Ltmp = L_mac( Ltmp, xn[L_subfr - 1], 16384 ); - Ltmp = L_msu( Ltmp, y1[L_subfr - 1], gain_pit ); - Ltmp = L_shl( Ltmp, sub( 1, shift ) ); - hLPDmem->mem_w0 = round_fx( Ltmp ); /*Q_new-1 */ -#endif } ELSE { Ltmp = L_mult( xn[L_subfr - 1], 16384 ); /* Q_new + 14 -shift */ -#ifdef BASOP_NOGLOB Ltmp = L_msu_sat( Ltmp, y1[L_subfr - 1], gain_pit ); /* Q_new + 14 -shift */ Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); /* Q_new + 15 */ hLPDmem->mem_w0 = round_fx_sat( Ltmp ); /*Q_new-1 */ move16(); -#else - Ltmp = L_msu( Ltmp, y1[L_subfr - 1], gain_pit ); - Ltmp = L_shl( Ltmp, sub( 1, shift ) ); - hLPDmem->mem_w0 = round_fx( Ltmp ); /*Q_new-1 */ -#endif } /*-----------------------------------------------------------------* @@ -422,19 +397,11 @@ void enc_pit_exc_fx( { /* code in Q9, gain_pit in Q14 */ Ltmp = L_mult( gcode16, code[i] ); /* Q10 + Q_new */ -#ifdef BASOP_NOGLOB Ltmp = L_shl_o( Ltmp, 5, &Overflow ); /* Q15 + Q_new */ Ltmp = L_mac_o( Ltmp, exc[i + i_subfr], gain_pit, &Overflow ); /* Q15 + Q_new */ Ltmp = L_shl_o( Ltmp, 1, &Overflow ); /* saturation can occur here Q_new + Q16*/ exc[i + i_subfr] = round_fx_o( Ltmp, &Overflow ); /* Q_new */ move16(); -#else - Ltmp = L_mult( gcode16, code[i] ); - Ltmp = L_shl( Ltmp, 5 ); - Ltmp = L_mac( Ltmp, exc[i + i_subfr], gain_pit ); - Ltmp = L_shl( Ltmp, 1 ); /* saturation can occur here */ - exc[i + i_subfr] = round_fx( Ltmp ); -#endif } } ELSE @@ -443,13 +410,8 @@ void enc_pit_exc_fx( { Ltmp = L_mult( exc[i + i_subfr], gain_pit ); /* Q15 + Q_new */ -#ifdef BASOP_NOGLOB Ltmp = L_shl_sat( Ltmp, 1 ); /* saturation can occur here Q16 + Q_new */ exc[i + i_subfr] = round_fx_sat( Ltmp ); /* Q_new */ -#else - Ltmp = L_shl( Ltmp, 1 ); /* saturation can occur here */ - exc[i + i_subfr] = round_fx( Ltmp ); -#endif } } @@ -561,11 +523,7 @@ void enc_pit_exc_fx( } } -#ifdef BASOP_NOGLOB cum_gpit = shl_o( cum_gpit, 1, &Overflow ); /*Q15*/ -#else /* BASOP_NOGLOB */ - cum_gpit = shl( cum_gpit, 1 ); /*Q15*/ -#endif *gpit = round_fx( L_mac( L_mult( 3277, *gpit ), 29491, cum_gpit ) ); /*Q15*/ } @@ -820,11 +778,7 @@ void enc_pit_exc_ivas_fx( } /*st_fx->lowrate_pitchGain = 0.9f * st_fx->lowrate_pitchGain + 0.1f * gain_pit;*/ -#ifdef BASOP_NOGLOB hSpMusClas->lowrate_pitchGain = round_fx_o( L_mac_o( L_mult( 29491, hSpMusClas->lowrate_pitchGain ), 6554, gain_pit, &Overflow ), &Overflow ); /*Q14*Q16(0.1) + Q15 -> Q15*/ -#else - hSpMusClas->lowrate_pitchGain = round_fx( L_mac( L_mult( 29491, hSpMusClas->lowrate_pitchGain ), 6554, gain_pit ) ); /*Q14*Q16(0.1) + Q15 -> Q15*/ -#endif gpit_tmp = gain_pit; move16(); /*Q14*/ @@ -881,13 +835,8 @@ void enc_pit_exc_ivas_fx( } gp_clip_test_gain_pit_fx( st_fx->element_mode, st_fx->core_brate, gain_pit, st_fx->clip_var_fx ); -#ifdef BASOP_NOGLOB Lgcode = L_shl_sat( gain_code, Q_new ); /* scaled gain_code with Qnew -> Q16*/ gcode16 = round_fx_sat( Lgcode ); -#else - Lgcode = L_shl( gain_code, Q_new ); /* scaled gain_code with Qnew -> Q16*/ - gcode16 = round_fx( Lgcode ); -#endif IF( use_fcb != 0 ) { hLPDmem->tilt_code = est_tilt_ivas_fx( &exc[i_subfr], gain_pit, code, gain_code, &voice_fac, Q_new, L_SUBFR, 0 ); // Q15 @@ -904,35 +853,19 @@ void enc_pit_exc_ivas_fx( IF( use_fcb != 0 ) { Ltmp = L_mult0( gcode16, y2[L_subfr - 1] ); -#ifdef BASOP_NOGLOB Ltmp = L_shl_o( Ltmp, add( 5, shift ), &Overflow ); // Q_new+14+shift Ltmp = L_negate( Ltmp ); Ltmp = L_mac_o( Ltmp, xn[L_subfr - 1], 16384, &Overflow ); // Q_new-1+15+shift Ltmp = L_msu_o( Ltmp, y1[L_subfr - 1], gain_pit, &Overflow ); // Q_new-1+15+shift Ltmp = L_shl_o( Ltmp, sub( 1, shift ), &Overflow ); // Q_new+15 hGSCEnc->mem_w0_tmp_fx = round_fx_o( Ltmp, &Overflow ); /*Q_new-1 */ -#else - Ltmp = L_mult( gcode16, y2[L_subfr - 1] ); - Ltmp = L_shl( Ltmp, add( 5, shift ) ); - Ltmp = L_negate( Ltmp ); - Ltmp = L_mac( Ltmp, xn[L_subfr - 1], 16384 ); - Ltmp = L_msu( Ltmp, y1[L_subfr - 1], gain_pit ); - Ltmp = L_shl( Ltmp, sub( 1, shift ) ); - hGSCEnc->mem_w0_tmp_fx = round_fx( Ltmp ); /*Q_new-1 */ -#endif } ELSE { Ltmp = L_mult( xn[L_subfr - 1], 16384 ); // Q_new-1+15+shift -#ifdef BASOP_NOGLOB Ltmp = L_msu_sat( Ltmp, y1[L_subfr - 1], gain_pit ); // Q_new-1+15+shift Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); // Q_new+15 hGSCEnc->mem_w0_tmp_fx = round_fx_sat( Ltmp ); /*Q_new-1 */ -#else - Ltmp = L_msu( Ltmp, y1[L_subfr - 1], gain_pit ); - Ltmp = L_shl( Ltmp, sub( 1, shift ) ); - hGSCEnc->mem_w0_tmp_fx = round_fx( Ltmp ); /*Q_new-1 */ -#endif } /*-----------------------------------------------------------------* @@ -945,19 +878,11 @@ void enc_pit_exc_ivas_fx( { /* code in Q9, gain_pit in Q14 */ Ltmp = L_mult( gcode16, code[i] ); /* Q10 + Q_new */ -#ifdef BASOP_NOGLOB Ltmp = L_shl_o( Ltmp, 5, &Overflow ); /* Q15 + Q_new */ Ltmp = L_mac_o( Ltmp, exc[i + i_subfr], gain_pit, &Overflow ); /* Q15 + Q_new */ Ltmp = L_shl_o( Ltmp, 1, &Overflow ); /* saturation can occur here Q16 + Q_new */ exc[i + i_subfr] = round_fx_o( Ltmp, &Overflow ); /* Q_new */ move16(); -#else - Ltmp = L_mult( gcode16, code[i] ); - Ltmp = L_shl( Ltmp, 5 ); - Ltmp = L_mac( Ltmp, exc[i + i_subfr], gain_pit ); - Ltmp = L_shl( Ltmp, 1 ); /* saturation can occur here */ - exc[i + i_subfr] = round_fx( Ltmp ); -#endif } } ELSE @@ -966,14 +891,9 @@ void enc_pit_exc_ivas_fx( { Ltmp = L_mult( exc[i + i_subfr], gain_pit ); /* Q15 + Q_new */ -#ifdef BASOP_NOGLOB Ltmp = L_shl_sat( Ltmp, 1 ); /* saturation can occur here Q16 + Q_new */ exc[i + i_subfr] = round_fx_sat( Ltmp ); /* Q_new */ move16(); -#else - Ltmp = L_shl( Ltmp, 1 ); /* saturation can occur here */ - exc[i + i_subfr] = round_fx( Ltmp ); -#endif } } @@ -1085,10 +1005,6 @@ void enc_pit_exc_ivas_fx( } } -#ifdef BASOP_NOGLOB cum_gpit = shl_o( cum_gpit, 1, &Overflow ); /*Q15*/ -#else /* BASOP_NOGLOB */ - cum_gpit = shl( cum_gpit, 1 ); /*Q15*/ -#endif *gpit = round_fx( L_mac( L_mult( 3277, *gpit ), 29491, cum_gpit ) ); /*Q15*/ } diff --git a/lib_enc/enc_tran_fx.c b/lib_enc/enc_tran_fx.c index 255c275e7..731c84d50 100644 --- a/lib_enc/enc_tran_fx.c +++ b/lib_enc/enc_tran_fx.c @@ -229,13 +229,8 @@ Word16 encod_tran_fx( } gp_clip_test_gain_pit_fx( st_fx->element_mode, st_fx->core_brate, gain_pit, st_fx->clip_var_fx ); -#ifdef BASOP_NOGLOB Lgcode = L_shl_o( gain_code, Q_new, &Overflow ); /* scaled gain_code with Qnew -> Q16*/ gcode16 = round_fx_o( Lgcode, &Overflow ); -#else - Lgcode = L_shl( gain_code, Q_new ); /* scaled gain_code with Qnew -> Q16*/ - gcode16 = round_fx( Lgcode ); -#endif hLPDmem->tilt_code = Est_tilt2( &exc_fx[i_subfr], gain_pit, code, Lgcode, &voice_fac, shift ); /* Q15 */ /*-----------------------------------------------------------------* * Update memory of the weighting filter @@ -247,13 +242,8 @@ Word16 encod_tran_fx( L_tmp = L_negate( L_tmp ); L_tmp = L_mac( L_tmp, xn[L_SUBFR - 1], 16384 ); L_tmp = L_msu( L_tmp, y1[L_SUBFR - 1], gain_pit ); -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, sub( 1, shift ) ); /* Q_new + 15 */ hLPDmem->mem_w0 = round_fx_sat( L_tmp ); /*Q_new-1*/ -#else - L_tmp = L_shl( L_tmp, sub( 1, shift ) ); - hLPDmem->mem_w0 = round_fx( L_tmp ); /*Q_new-1*/ -#endif /*-----------------------------------------------------------------* * Construct adaptive part of the excitation * Save the non-enhanced excitation for FEC_exc @@ -269,11 +259,7 @@ Word16 encod_tran_fx( { FOR( i = 0; i < L_SUBFR; i++ ) { -#ifdef BASOP_NOGLOB exc2_fx[i + i_subfr] = round_fx_sat( L_shl_sat( L_mult_sat( gain_pit, exc_fx[i + i_subfr] ), 1 ) ); /* Q_new */ -#else - exc2_fx[i + i_subfr] = round_fx( L_shl( L_mult( gain_pit, exc_fx[i + i_subfr] ), 1 ) ); -#endif } } ELSE @@ -293,17 +279,10 @@ Word16 encod_tran_fx( { /* code in Q9, gain_pit in Q14 */ L_tmp = L_mult( gcode16, code[i] ); /* Q10 + Q_new */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( L_tmp, 5, &Overflow ); /* Q15 + Q_new */ L_tmp = L_mac_o( L_tmp, exc_fx[i + i_subfr], gain_pit, &Overflow ); /* Q15 + Q_new */ L_tmp = L_shl_o( L_tmp, 1, &Overflow ); /* saturation can occur here Q16 + Q_new */ exc_fx[i + i_subfr] = round_fx_o( L_tmp, &Overflow ); /* Q_new */ -#else - L_tmp = L_shl( L_tmp, 5 ); - L_tmp = L_mac( L_tmp, exc_fx[i + i_subfr], gain_pit ); - L_tmp = L_shl( L_tmp, 1 ); /* saturation can occur here */ - exc_fx[i + i_subfr] = round_fx( L_tmp ); -#endif } /*-----------------------------------------------------------------* @@ -316,7 +295,6 @@ Word16 encod_tran_fx( FOR( i = 0; i < L_SUBFR; i++ ) { L_tmp = L_mult( gain_preQ, code_preQ[i] ); /* Q2 + Q10 -> Q13*/ -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( L_tmp, tmp1_fx, &Overflow ); /* Q16 + Q_exc */ tmp_fx = round_fx_o( L_tmp, &Overflow ); @@ -324,15 +302,6 @@ Word16 encod_tran_fx( move16(); exc_fx[i + i_subfr] = add_o( exc_fx[i + i_subfr], tmp_fx, &Overflow ); /* Q_exc */ move16(); -#else - L_tmp = L_shl( L_tmp, tmp1_fx ); /* Q16 + Q_exc */ - tmp_fx = round_fx( L_tmp ); - - exc2_fx[i + i_subfr] = add( exc2_fx[i + i_subfr], tmp_fx ); - move16(); - exc_fx[i + i_subfr] = add( exc_fx[i + i_subfr], tmp_fx ); - move16(); -#endif } } @@ -638,13 +607,8 @@ Word16 encod_tran_ivas_fx( } gp_clip_test_gain_pit_fx( st_fx->element_mode, st_fx->core_brate, gain_pit, st_fx->clip_var_fx ); -#ifdef BASOP_NOGLOB Lgcode = L_shl_o( gain_code, Q_new, &Overflow ); /* scaled gain_code with Qnew -> Q16*/ gcode16 = round_fx_o( Lgcode, &Overflow ); -#else - Lgcode = L_shl( gain_code, Q_new ); /* scaled gain_code with Qnew -> Q16*/ - gcode16 = round_fx( Lgcode ); -#endif hLPDmem->tilt_code = est_tilt_ivas_fx( &exc_fx[i_subfr], gain_pit, code, gain_code, &voice_fac, Q_new, L_SUBFR, 0 ); // Q15 /*-----------------------------------------------------------------* * Update memory of the weighting filter @@ -656,13 +620,8 @@ Word16 encod_tran_ivas_fx( L_tmp = L_negate( L_tmp ); L_tmp = L_mac( L_tmp, xn[L_SUBFR - 1], 16384 ); // Q_new-1+15+shift L_tmp = L_msu( L_tmp, y1[L_SUBFR - 1], gain_pit ); // Q_new-1+15+shift -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, sub( 1, shift ) ); // Q_new+15 hLPDmem->mem_w0 = round_fx_sat( L_tmp ); /*Q_new-1*/ -#else - L_tmp = L_shl( L_tmp, sub( 1, shift ) ); - hLPDmem->mem_w0 = round_fx( L_tmp ); /*Q_new-1*/ -#endif /*-----------------------------------------------------------------* * Construct adaptive part of the excitation * Save the non-enhanced excitation for FEC_exc @@ -678,11 +637,7 @@ Word16 encod_tran_ivas_fx( { FOR( i = 0; i < L_SUBFR; i++ ) { -#ifdef BASOP_NOGLOB exc2_fx[i + i_subfr] = round_fx_sat( L_shl_sat( L_mult_sat( gain_pit, exc_fx[i + i_subfr] ), 1 ) ); /* Q_exc */ -#else - exc2_fx[i + i_subfr] = round_fx( L_shl( L_mult( gain_pit, exc_fx[i + i_subfr] ), 1 ) ); -#endif } } ELSE @@ -702,17 +657,10 @@ Word16 encod_tran_ivas_fx( { /* code in Q9, gain_pit in Q14 */ L_tmp = L_mult( gcode16, code[i] ); /* Q10 + Q_new */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( L_tmp, 5, &Overflow ); /* Q15 + Q_new */ L_tmp = L_mac_o( L_tmp, exc_fx[i + i_subfr], gain_pit, &Overflow ); /* Q15 + Q_new */ L_tmp = L_shl_o( L_tmp, 1, &Overflow ); /* saturation can occur here Q16 + Q_new */ exc_fx[i + i_subfr] = round_fx_o( L_tmp, &Overflow ); /* Q_new */ -#else - L_tmp = L_shl( L_tmp, 5 ); - L_tmp = L_mac( L_tmp, exc_fx[i + i_subfr], gain_pit ); - L_tmp = L_shl( L_tmp, 1 ); /* saturation can occur here */ - exc_fx[i + i_subfr] = round_fx( L_tmp ); -#endif } /*-----------------------------------------------------------------* @@ -725,7 +673,6 @@ Word16 encod_tran_ivas_fx( FOR( i = 0; i < L_SUBFR; i++ ) { L_tmp = L_mult( gain_preQ, code_preQ[i] ); /* Q2 + Q10 -> Q13*/ -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( L_tmp, tmp1_fx, &Overflow ); /* Q16 + Q_exc */ tmp_fx = round_fx_o( L_tmp, &Overflow ); @@ -733,15 +680,6 @@ Word16 encod_tran_ivas_fx( move16(); exc_fx[i + i_subfr] = add_o( exc_fx[i + i_subfr], tmp_fx, &Overflow ); /* Q_exc */ move16(); -#else - L_tmp = L_shl( L_tmp, tmp1_fx ); /* Q16 + Q_exc */ - tmp_fx = round_fx( L_tmp ); - - exc2_fx[i + i_subfr] = add( exc2_fx[i + i_subfr], tmp_fx ); - move16(); - exc_fx[i + i_subfr] = add( exc_fx[i + i_subfr], tmp_fx ); - move16(); -#endif } } diff --git a/lib_enc/enc_uv_fx.c b/lib_enc/enc_uv_fx.c index cd147c6ce..3fedefc0f 100644 --- a/lib_enc/enc_uv_fx.c +++ b/lib_enc/enc_uv_fx.c @@ -185,11 +185,7 @@ void encod_unvoiced_fx( hLPDmem->mem_w0 = sub( xn_fx[L_SUBFR - 1], round_fx( L_shl( Ltmp, 1 ) ) ); /* Q_xn */ move16(); BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB hLPDmem->mem_w0 = shr_sat( hLPDmem->mem_w0, shift ); /*Qnew-1*/ -#else - hLPDmem->mem_w0 = shr( hLPDmem->mem_w0, shift ); /*Qnew-1*/ -#endif BASOP_SATURATE_WARNING_ON_EVS; /*-------------------------------------------------------* @@ -208,15 +204,8 @@ void encod_unvoiced_fx( Ltmp2 = Mpy_32_16_1( gain_code_vect[j], code_fx[i] ); /* Q10 */ Ltmp2 = L_shl( Ltmp2, Q_new_p5 ); /* Q15 + Q_new */ Ltmp = L_add( Ltmp, Ltmp2 ); /* Q15 + Q_new */ -#ifdef BASOP_NOGLOB Ltmp = L_shl_sat( Ltmp, 1 ); /* saturation can occur here Q16 + Q_new */ exc_fx[i + i_subfr] = round_fx_sat( Ltmp ); /* Q_new */ -#else - BASOP_SATURATE_WARNING_OFF_EVS - Ltmp = L_shl( Ltmp, 1 ); /* saturation can occur here */ - BASOP_SATURATE_WARNING_ON_EVS - exc_fx[i + i_subfr] = round_fx( Ltmp ); -#endif } tmp2 = L_SUBFR; move16(); @@ -428,11 +417,7 @@ void encod_unvoiced_ivas_fx( hLPDmem->mem_w0 = sub( xn_fx[L_SUBFR - 1], round_fx( L_shl( Ltmp, 1 ) ) ); // Q_xn move16(); BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB hLPDmem->mem_w0 = shr_sat( hLPDmem->mem_w0, shift ); /*Qnew-1*/ -#else - hLPDmem->mem_w0 = shr( hLPDmem->mem_w0, shift ); /*Qnew-1*/ -#endif move16(); BASOP_SATURATE_WARNING_ON_EVS; @@ -447,27 +432,13 @@ void encod_unvoiced_ivas_fx( { /* code in Q9, gain_pit in Q14; exc Q_new */ Ltmp = Mpy_32_16_1( gain_code2, code2[i] ); /* Q10 */ -#ifdef BASOP_NOGLOB Ltmp = L_shl_sat( Ltmp, Q_new_p5 ); /* Q15 + Q_new */ Ltmp = L_mac_sat( Ltmp, gain_pit_fx, exc_fx[i + i_subfr] ); /* Q15 + Q_new */ -#else - Ltmp = L_shl( Ltmp, Q_new_p5 ); - Ltmp = L_mac( Ltmp, gain_pit_fx, exc_fx[i + i_subfr] ); -#endif Ltmp2 = Mpy_32_16_1( gain_code_vect[j], code_fx[i] ); /* Q10 */ -#ifdef BASOP_NOGLOB Ltmp2 = L_shl_sat( Ltmp2, Q_new_p5 ); /* Q15 + Q_new */ Ltmp = L_add_sat( Ltmp, Ltmp2 ); /* Q15 + Q_new */ Ltmp = L_shl_sat( Ltmp, 1 ); /* saturation can occur here Q16 + Q_new */ exc_fx[i + i_subfr] = round_fx_sat( Ltmp ); /* Q_new */ -#else - BASOP_SATURATE_WARNING_OFF_EVS - Ltmp2 = L_shl( Ltmp2, Q_new_p5 ); - Ltmp = L_add( Ltmp, Ltmp2 ); - Ltmp = L_shl( Ltmp, 1 ); /* saturation can occur here */ - BASOP_SATURATE_WARNING_ON_EVS - exc_fx[i + i_subfr] = round_fx( Ltmp ); -#endif move16(); } tmp2 = L_SUBFR; diff --git a/lib_enc/energy_fx.c b/lib_enc/energy_fx.c index e645395f1..b5f9b632f 100644 --- a/lib_enc/energy_fx.c +++ b/lib_enc/energy_fx.c @@ -61,15 +61,9 @@ void est_energy_fx( FOR( i = 2; i < BandNum; i++ ) { Ltmp32 = L_shr( sb_power[i], shr_tmp ); /* 31 - enerBuffer_exp - shr_tmp */ -#ifdef BASOP_NOGLOB frame_energy2 = L_add_sat( frame_energy2, Ltmp32 ); /* 31 - enerBuffer_exp - shr_tmp */ if ( i > 6 ) HB_Power = L_add_sat( HB_Power, Ltmp32 ); -#else - frame_energy2 = L_add( frame_energy2, Ltmp32 ); - if ( i > 6 ) - HB_Power = L_add( HB_Power, Ltmp32 ); -#endif } frame_energy2 = L_sub( frame_energy2, Ltmp32 ); /* 31 - enerBuffer_exp - shr_tmp */ @@ -131,11 +125,7 @@ void est_energy_fx( tmpspec_amp = L_shl( sb_power[j], s16MaxCoefNorm ); /* sb_power_Q + s16MaxCoefNorm */ s32CopyPower = L_add( s32CopyPower, tmpspec_amp ); } -#ifdef BASOP_NOGLOB frame_sb_energy[i] = L_shr_o( s32CopyPower, s16MaxCoefNorm, &Overflow ); /* sb_power_Q */ -#else /* BASOP_NOGLOB */ - frame_sb_energy[i] = L_shr( s32CopyPower, s16MaxCoefNorm ); -#endif move32(); } diff --git a/lib_enc/ext_sig_ana_fx.c b/lib_enc/ext_sig_ana_fx.c index af9c2dbc4..cc234a93d 100644 --- a/lib_enc/ext_sig_ana_fx.c +++ b/lib_enc/ext_sig_ana_fx.c @@ -318,11 +318,7 @@ void core_signal_analysis_high_bitrate_fx( /* Outter left folding */ FOR( i = 0; i < folding_offset; i++ ) { -#ifdef BASOP_NOGLOB tcx20Win[folding_offset + i] = sub_sat( tcx20Win[folding_offset + i], tcx20Win[folding_offset - 1 - i] ); // Q0 -#else - tcx20Win[folding_offset + i] = sub( tcx20Win[folding_offset + i], tcx20Win[folding_offset - 1 - i] ); -#endif move16(); } #ifdef IVAS_CODE @@ -338,11 +334,7 @@ void core_signal_analysis_high_bitrate_fx( tmp = shr( right_overlap, 1 ); FOR( i = 0; i < tmp; i++ ) { -#ifdef BASOP_NOGLOB tcx20Win[L_subframe + folding_offset - 1 - i] = add_sat( tcx20Win[L_subframe + folding_offset - 1 - i], tcx20Win[L_subframe + folding_offset + i] ); // Q0 -#else - tcx20Win[L_subframe + folding_offset - 1 - i] = add( tcx20Win[L_subframe + folding_offset - 1 - i], tcx20Win[L_subframe + folding_offset + i] ); -#endif move16(); } /* 2xTCX5 */ @@ -980,11 +972,7 @@ void core_signal_analysis_high_bitrate_ivas_fx( /* Outter left folding */ FOR( i = 0; i < folding_offset; i++ ) { -#ifdef BASOP_NOGLOB tcx20Win[folding_offset + i] = sub_sat( tcx20Win[folding_offset + i], tcx20Win[folding_offset - 1 - i] ); // Q0 -#else - tcx20Win[folding_offset + i] = sub( tcx20Win[folding_offset + i], tcx20Win[folding_offset - 1 - i] ); -#endif move16(); } @@ -1000,11 +988,7 @@ void core_signal_analysis_high_bitrate_ivas_fx( L_tmp = L_mult( hTcxEnc->speech_TCX[-1 - i], st->hTcxCfg->tcx_aldo_window_1_FB[left_overlap / 2 + minWindowLen - i] ); // (Q0, Q15) -> Q16 L_tmp = Mpy_32_16_1( L_tmp, st->hTcxCfg->tcx_mdct_window_minimumFB[minWindowLen - i].v.im ); // (Q16, Q15) -> Q16 L_tmp = L_shl( L_tmp, sub( 0, Q16 ) ); // Q0 -#ifdef BASOP_NOGLOB tcx20Win[left_overlap + i] = sub_sat( tcx20Win[left_overlap + i], extract_l( L_tmp ) ); // Q0 -#else - tcx20Win[left_overlap + i] = sub( tcx20Win[left_overlap + i], extract_l( L_tmp ) ); // Q0 -#endif move32(); } FOR( i = tmp - 1; i >= 0; i-- ) /* outer left folding of shortened long ALDO slope */ @@ -1012,11 +996,7 @@ void core_signal_analysis_high_bitrate_ivas_fx( L_tmp = L_mult( hTcxEnc->speech_TCX[-1 - i], st->hTcxCfg->tcx_aldo_window_1_FB[left_overlap / 2 + minWindowLen - i] ); // (Q0, Q15) -> Q16 L_tmp = Mpy_32_16_1( L_tmp, st->hTcxCfg->tcx_mdct_window_minimumFB[i].v.re ); // (Q16, Q15) -> Q16 L_tmp = L_shl( L_tmp, sub( 0, Q16 ) ); // Q0 -#ifdef BASOP_NOGLOB tcx20Win[left_overlap + i] = sub_sat( tcx20Win[left_overlap + i], extract_l( L_tmp ) ); // Q0 -#else - tcx20Win[left_overlap + i] = sub( tcx20Win[left_overlap + i], extract_l( L_tmp ) ); // Q0 -#endif move32(); } } @@ -1025,11 +1005,7 @@ void core_signal_analysis_high_bitrate_ivas_fx( tmp = shr( right_overlap, 1 ); FOR( i = 0; i < tmp; i++ ) { -#ifdef BASOP_NOGLOB tcx20Win[L_subframe + folding_offset - 1 - i] = add_sat( tcx20Win[L_subframe + folding_offset - 1 - i], tcx20Win[L_subframe + folding_offset + i] ); // Q0 -#else - tcx20Win[L_subframe + folding_offset - 1 - i] = add( tcx20Win[L_subframe + folding_offset - 1 - i], tcx20Win[L_subframe + folding_offset + i] ); -#endif move16(); } @@ -1121,11 +1097,7 @@ void core_signal_analysis_high_bitrate_ivas_fx( L_tmp = L_mult( hTcxEnc->speech_TCX[-1 - i], st->hTcxCfg->tcx_aldo_window_1_FB[left_overlap / 2 + minWindowLen - i] ); // (Q0, Q15) -> Q16 L_tmp = Mpy_32_16_1( L_tmp, st->hTcxCfg->tcx_mdct_window_minimumFB[minWindowLen - i].v.im ); // (Q16, Q15) -> Q16 L_tmp = L_shl( L_tmp, sub( 0, Q16 ) ); // Q0 -#ifdef BASOP_NOGLOB tcx20Win[left_overlap + i] = sub_sat( tcx20Win[left_overlap + i], extract_l( L_tmp ) ); // Q0 -#else - tcx20Win[left_overlap + i] = sub( tcx20Win[left_overlap + i], extract_l( L_tmp ) ); // Q0 -#endif move32(); } FOR( i = tmp - 1; i >= 0; i-- ) /* outer left folding of shortened long ALDO slope */ @@ -1133,11 +1105,7 @@ void core_signal_analysis_high_bitrate_ivas_fx( L_tmp = L_mult( hTcxEnc->speech_TCX[-1 - i], st->hTcxCfg->tcx_aldo_window_1_FB[left_overlap / 2 + minWindowLen - i] ); // (Q0, Q15) -> Q16 L_tmp = Mpy_32_16_1( L_tmp, st->hTcxCfg->tcx_mdct_window_minimumFB[i].v.re ); // (Q16, Q15) -> Q16 L_tmp = L_shl( L_tmp, sub( 0, Q16 ) ); // Q0 -#ifdef BASOP_NOGLOB tcx20Win[left_overlap + i] = sub_sat( tcx20Win[left_overlap + i], extract_l( L_tmp ) ); // Q0 -#else - tcx20Win[left_overlap + i] = sub( tcx20Win[left_overlap + i], extract_l( L_tmp ) ); // Q0 -#endif move32(); } } @@ -1203,11 +1171,7 @@ void core_signal_analysis_high_bitrate_ivas_fx( /* Outer left folding */ FOR( i = 0; i < left_overlap / 2; i++ ) { -#ifdef BASOP_NOGLOB mdstWin[left_overlap / 2 + i] = add_sat( mdstWin[left_overlap / 2 + i], mdstWin[left_overlap / 2 - 1 - i] ); // Q0 -#else - mdstWin[left_overlap / 2 + i] = add( mdstWin[left_overlap / 2 + i], mdstWin[left_overlap / 2 - 1 - i] ); -#endif } test(); @@ -1221,11 +1185,7 @@ void core_signal_analysis_high_bitrate_ivas_fx( L_tmp = L_mult( hTcxEnc->speech_TCX[-1 - i], st->hTcxCfg->tcx_aldo_window_1_FB[left_overlap / 2 + minWindowLen - i] ); // (Q0, Q15) -> Q16 L_tmp = Mpy_32_16_1( L_tmp, st->hTcxCfg->tcx_mdct_window_minimumFB[minWindowLen - i].v.im ); // (Q16, Q15) -> Q16 L_tmp = L_shl( L_tmp, sub( 0, Q16 ) ); // Q0 -#ifdef BASOP_NOGLOB mdstWin[left_overlap + i] = add_sat( mdstWin[left_overlap + i], extract_l( L_tmp ) ); // Q0 -#else - mdstWin[left_overlap + i] = add( mdstWin[left_overlap + i], extract_l( L_tmp ) ); // Q0 -#endif move32(); } FOR( i = tmp - 1; i >= 0; i-- ) /* outer left folding of shortened long ALDO slope */ @@ -1233,11 +1193,7 @@ void core_signal_analysis_high_bitrate_ivas_fx( L_tmp = L_mult( hTcxEnc->speech_TCX[-1 - i], st->hTcxCfg->tcx_aldo_window_1_FB[left_overlap / 2 + minWindowLen - i] ); // (Q0, Q15) -> Q16 L_tmp = Mpy_32_16_1( L_tmp, st->hTcxCfg->tcx_mdct_window_minimumFB[i].v.re ); // (Q16, Q15) -> Q16 L_tmp = L_shl( L_tmp, sub( 0, Q16 ) ); // Q0 -#ifdef BASOP_NOGLOB mdstWin[left_overlap + i] = add_sat( mdstWin[left_overlap + i], extract_l( L_tmp ) ); // Q0 -#else - mdstWin[left_overlap + i] = add( mdstWin[left_overlap + i], extract_l( L_tmp ) ); // Q0 -#endif move32(); } } @@ -1245,11 +1201,7 @@ void core_signal_analysis_high_bitrate_ivas_fx( /* Outer right folding */ FOR( i = 0; i < right_overlap / 2; i++ ) { -#ifdef BASOP_NOGLOB mdstWin[L_subframe + left_overlap / 2 - 1 - i] = sub_sat( mdstWin[L_subframe + left_overlap / 2 - 1 - i], mdstWin[L_subframe + left_overlap / 2 + i] ); // Q0 -#else - mdstWin[L_subframe + left_overlap / 2 - 1 - i] = sub( mdstWin[L_subframe + left_overlap / 2 - 1 - i], mdstWin[L_subframe + left_overlap / 2 + i] ); -#endif move16(); } @@ -1320,11 +1272,7 @@ void core_signal_analysis_high_bitrate_ivas_fx( L_tmp = L_mult( hTcxEnc->speech_TCX[-1 - i], st->hTcxCfg->tcx_aldo_window_1_FB[left_overlap / 2 + minWindowLen - i] ); // (Q0, Q15) -> Q16 L_tmp = Mpy_32_16_1( L_tmp, st->hTcxCfg->tcx_mdct_window_minimumFB[minWindowLen - i].v.im ); // (Q16, Q15) -> Q16 L_tmp = L_shl( L_tmp, sub( 0, Q16 ) ); // Q0 -#ifdef BASOP_NOGLOB mdstWin[left_overlap + i] = add_sat( mdstWin[left_overlap + i], extract_l( L_tmp ) ); // Q0 -#else - mdstWin[left_overlap + i] = add( mdstWin[left_overlap + i], extract_l( L_tmp ) ); // Q0 -#endif move32(); } FOR( i = tmp - 1; i >= 0; i-- ) /* outer left folding of shortened long ALDO slope */ @@ -1332,11 +1280,7 @@ void core_signal_analysis_high_bitrate_ivas_fx( L_tmp = L_mult( hTcxEnc->speech_TCX[-1 - i], st->hTcxCfg->tcx_aldo_window_1_FB[left_overlap / 2 + minWindowLen - i] ); // (Q0, Q15) -> Q16 L_tmp = Mpy_32_16_1( L_tmp, st->hTcxCfg->tcx_mdct_window_minimumFB[i].v.re ); // (Q16, Q15) -> Q16 L_tmp = L_shl( L_tmp, sub( 0, Q16 ) ); // Q0 -#ifdef BASOP_NOGLOB mdstWin[left_overlap + i] = add_sat( mdstWin[left_overlap + i], extract_l( L_tmp ) ); // Q0 -#else - mdstWin[left_overlap + i] = add( mdstWin[left_overlap + i], extract_l( L_tmp ) ); // Q0 -#endif move32(); } } diff --git a/lib_enc/fd_cng_enc_fx.c b/lib_enc/fd_cng_enc_fx.c index 8591f2627..d5be64f77 100644 --- a/lib_enc/fd_cng_enc_fx.c +++ b/lib_enc/fd_cng_enc_fx.c @@ -951,11 +951,7 @@ static void msvq_encoder( const Word16 *const cb[], /* i : Codebook (indexed cb tmp = L_add( dist[0][c], L_sub( en, L_shl( t1, 1 ) ) ); BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB t1 = L_sub_sat( tmp, dist[1][p_max] ); -#else - t1 = L_sub( tmp, dist[1][p_max] ); -#endif BASOP_SATURATE_WARNING_ON_EVS IF( t1 <= 0 ) /* IF (L_sub(L_shr(tmp,1), L_shr(dist[1][p_max],1) ) <= 0 ) */ @@ -1638,11 +1634,7 @@ void generate_comfort_noise_enc_fx( Encoder_State *stcod, s = sub( 15 - NOISE_HEADROOM, noiseExp ); FOR( i = 0; i < N; i++ ) { -#ifdef BASOP_NOGLOB noise[i] = shr_sat( mult( noise[i], gain16 ), s ); -#else - noise[i] = shr( mult( noise[i], gain16 ), s ); -#endif move16(); } @@ -1651,11 +1643,7 @@ void generate_comfort_noise_enc_fx( Encoder_State *stcod, s = sub( 15 - NOISE_HEADROOM, ( sub( 15, Q_syn ) ) ); FOR( i = 0; i < lpcorder; i++ ) { -#ifdef BASOP_NOGLOB old_syn_pe_tmp[i] = shr_sat( old_syn_pe[i], s ); -#else - old_syn_pe_tmp[i] = shr( old_syn_pe[i], s ); -#endif move16(); } @@ -2034,11 +2022,7 @@ void generate_comfort_noise_enc_ivas_fx( Encoder_State *stcod, s = sub( 15 - NOISE_HEADROOM, noiseExp ); FOR( i = 0; i < N; i++ ) { -#ifdef BASOP_NOGLOB noise[i] = shr_sat( mult( noise[i], gain16 ), s ); -#else - noise[i] = shr( mult( noise[i], gain16 ), s ); -#endif move16(); } @@ -2047,11 +2031,7 @@ void generate_comfort_noise_enc_ivas_fx( Encoder_State *stcod, s = sub( 15 - NOISE_HEADROOM, ( sub( 15, Q_syn ) ) ); FOR( i = 0; i < lpcorder; i++ ) { -#ifdef BASOP_NOGLOB old_syn_pe_tmp[i] = shr_sat( old_syn_pe[i], s ); -#else - old_syn_pe_tmp[i] = shr( old_syn_pe[i], s ); -#endif move16(); } diff --git a/lib_enc/find_tar_fx.c b/lib_enc/find_tar_fx.c index 0c138308b..c758db8f3 100644 --- a/lib_enc/find_tar_fx.c +++ b/lib_enc/find_tar_fx.c @@ -50,11 +50,7 @@ void find_targets_fx( *-----------------------------------------------------------------------*/ FOR( i = 0; i < M; i++ ) { -#ifdef BASOP_NOGLOB temp[i] = sub_sat( speech[i + i_subfr - M], mem_syn[i] ); /* Q_new - 1 */ -#else - temp[i] = sub( speech[i + i_subfr - M], mem_syn[i] ); -#endif move16(); } Syn_filt_s( 1, p_Aq, M, &res[i_subfr], temp + M, L_subfr, temp, 0 ); /* error in Q_new -1 */ @@ -107,32 +103,16 @@ void find_targets_fx( Ltmp = L_mult( Ap[i], s2 ); /* Q27 */ FOR( j = 1; j <= i; j++ ) { -#ifdef BASOP_NOGLOB /* Critical Overflow , as well as those below*/ Ltmp = L_msu_o( Ltmp, Aqs[j], h1[i - j], &Overflow ); /* Q27 */ -#else - Ltmp = L_msu( Ltmp, Aqs[j], h1[i - j] ); -#endif } -#ifdef BASOP_NOGLOB /* Critical Overflow */ h1[i] = round_fx_o( L_shl_o( Ltmp, s, &Overflow ), &Overflow ); /* Q11 + s */ -#else - h1[i] = round_fx( L_shl( Ltmp, s ) ); -#endif } Ltmp = L_mult( Ap[i], s2 ); /* Q27 */ FOR( j = 1; j <= M; j++ ) { -#ifdef BASOP_NOGLOB /* Critical Overflow */ Ltmp = L_msu_o( Ltmp, Aqs[j], h1[i - j], &Overflow ); /* Q27 */ -#else - Ltmp = L_msu( Ltmp, Aqs[j], h1[i - j] ); -#endif } -#ifdef BASOP_NOGLOB /* Critical Overflow */ h1[M] = round_fx_o( L_shl_o( Ltmp, s, &Overflow ), &Overflow ); /* Q11 + s */ -#else - h1[M] = round_fx( L_shl( Ltmp, s ) ); -#endif // PMT("should we used extended basop here for when the L_subfr > L_SUBFR, to prevent saturation/overflow and the subsequent loop\n") FOR( i = M + 1; i < L_subfr; i++ ) @@ -140,17 +120,9 @@ void find_targets_fx( Ltmp = L_msu( 0, Aqs[1], h1[i - 1] ); /* Q27 */ FOR( j = 2; j <= M; j++ ) { -#ifdef BASOP_NOGLOB /* Critical Overflow */ Ltmp = L_msu_o( Ltmp, Aqs[j], h1[i - j], &Overflow ); /* Q27 */ -#else - Ltmp = L_msu( Ltmp, Aqs[j], h1[i - j] ); -#endif } -#ifdef BASOP_NOGLOB /* Critical Overflow */ h1[i] = round_fx_o( L_shl_o( Ltmp, s, &Overflow ), &Overflow ); /* Q11 + s */ -#else - h1[i] = round_fx( L_shl( Ltmp, s ) ); -#endif } IF( Overflow ) { @@ -162,11 +134,7 @@ void find_targets_fx( { Ltmp = L_msu( Ltmp, Aqs[j], h1[i - j] ); /* Q27 */ } -#ifdef BASOP_NOGLOB h1[i] = round_fx( L_shl_o( Ltmp, s, &Overflow ) ); /* Q11 + s */ -#else - h1[i] = round_fx( L_shl( Ltmp, s ) ); -#endif } Ltmp = L_mult( Ap[i], s2 ); /* Q27 */ FOR( j = 1; j <= M; j++ ) @@ -229,11 +197,7 @@ void find_targets_ivas_fx( *-----------------------------------------------------------------------*/ FOR( i = 0; i < M; i++ ) { -#ifdef BASOP_NOGLOB temp[i] = sub_sat( speech[i + i_subfr - M], mem_syn[i] ); /* Q_new - 1 */ -#else - temp[i] = sub( speech[i + i_subfr - M], mem_syn[i] ); -#endif move16(); } Syn_filt_s( 1, p_Aq, M, &res[i_subfr], temp + M, L_subfr, temp, 0 ); @@ -287,32 +251,16 @@ void find_targets_ivas_fx( Ltmp = L_mult( Ap[i], s2 ); /* Q27 */ FOR( j = 1; j <= i; j++ ) { -#ifdef BASOP_NOGLOB /* Critical Overflow , as well as those below*/ Ltmp = L_msu_o( Ltmp, Aqs[j], h1[i - j], &Overflow ); /* Q27 */ -#else - Ltmp = L_msu( Ltmp, Aqs[j], h1[i - j] ); -#endif } -#ifdef BASOP_NOGLOB /* Critical Overflow */ h1[i] = round_fx_o( L_shl_o( Ltmp, s, &Overflow ), &Overflow ); /* Q11 + s */ -#else - h1[i] = round_fx( L_shl( Ltmp, s ) ); -#endif } Ltmp = L_mult( Ap[i], s2 ); /* Q27 */ FOR( j = 1; j <= M; j++ ) { -#ifdef BASOP_NOGLOB /* Critical Overflow */ Ltmp = L_msu_o( Ltmp, Aqs[j], h1[i - j], &Overflow ); /* Q27 */ -#else - Ltmp = L_msu( Ltmp, Aqs[j], h1[i - j] ); -#endif } -#ifdef BASOP_NOGLOB /* Critical Overflow */ h1[M] = round_fx_o( L_shl_o( Ltmp, s, &Overflow ), &Overflow ); /* Q11 + s */ -#else - h1[M] = round_fx( L_shl( Ltmp, s ) ); -#endif // PMT("should we used extended basop here for when the L_subfr > L_SUBFR, to prevent saturation/overflow and the subsequent loop\n") FOR( i = M + 1; i < L_subfr; i++ ) @@ -320,17 +268,9 @@ void find_targets_ivas_fx( Ltmp = L_msu( 0, Aqs[1], h1[i - 1] ); /* Q27 */ FOR( j = 2; j <= M; j++ ) { -#ifdef BASOP_NOGLOB /* Critical Overflow */ Ltmp = L_msu_o( Ltmp, Aqs[j], h1[i - j], &Overflow ); /* Q27 */ -#else - Ltmp = L_msu( Ltmp, Aqs[j], h1[i - j] ); -#endif } -#ifdef BASOP_NOGLOB /* Critical Overflow */ h1[i] = round_fx_o( L_shl_o( Ltmp, s, &Overflow ), &Overflow ); /* Q11 + s */ -#else - h1[i] = round_fx( L_shl( Ltmp, s ) ); -#endif } IF( Overflow ) { @@ -342,11 +282,7 @@ void find_targets_ivas_fx( { Ltmp = L_msu( Ltmp, Aqs[j], h1[i - j] ); /* Q27 */ } -#ifdef BASOP_NOGLOB h1[i] = round_fx( L_shl_o( Ltmp, s, &Overflow ) ); /* Q11 + s */ -#else - h1[i] = round_fx( L_shl( Ltmp, s ) ); -#endif } Ltmp = L_mult( Ap[i], s2 ); /* Q27 */ FOR( j = 1; j <= M; j++ ) diff --git a/lib_enc/find_tilt.c b/lib_enc/find_tilt.c index 0c07d03a1..d84db41e4 100644 --- a/lib_enc/find_tilt.c +++ b/lib_enc/find_tilt.c @@ -153,24 +153,14 @@ void find_tilt_ivas_fx( { /*lp_bckr *= FACT;*/ /*hp_bckr *= FACT;*/ -#ifdef BASOP_NOGLOB lp_bckr = L_add_sat( L_shl_sat( lp_bckr, 1 ), lp_bckr ); /* Q_new */ hp_bckr = L_add_sat( L_shl_sat( hp_bckr, 1 ), hp_bckr ); /* Q_new */ -#else - lp_bckr = L_add( L_shl( lp_bckr, 1 ), lp_bckr ); - hp_bckr = L_add( L_shl( hp_bckr, 1 ), hp_bckr ); -#endif } /*mean_voi = 0.5f * (voicing[1] + voicing[2]) + corr_shift;*/ Ltmp = L_mult( voicing[1], 16384 /* 0.5 in Q15 */ ); // Q31 Ltmp = L_mac( Ltmp, voicing[2], 16384 /* 0.5 in Q15 */ ); // Q31 -#ifdef BASOP_NOGLOB Ltmp = L_mac_o( Ltmp, corr_shift, 32767 /* 1.0f in Q15 */, &Overflow ); // Q31 mean_voi = round_fx_o( Ltmp, &Overflow ); // Q15 -#else - Ltmp = L_mac( Ltmp, corr_shift, 32767 ); - mean_voi = round_fx( Ltmp ); -#endif /*f0 = INT_FS_FX / pitch[2];*/ e_tmp = norm_s( pitch[2] ); @@ -222,13 +212,8 @@ void find_tilt_ivas_fx( } pt_E++; } -#ifdef BASOP_NOGLOB f1 = add_o( f1, f0, &Overflow ); f2 = add_o( f2, f0, &Overflow ); -#else - f1 = add( f1, f0 ); - f2 = add( f2, f0 ); -#endif } /*lp_E = lp_E / (float)cnt - lp_bckr;*/ e_tmp = sub( W_norm( sum ), 1 ); @@ -290,29 +275,17 @@ void find_tilt_ivas_fx( m_hpE = extract_h( L_shl( hp_E[i], e_hpE ) ); // e_hpE+q_bckr-16 m_tmp = div_s( m_tmp, m_hpE ); // Q15+(e_tmp+q_lp_E)-(e_hpE+q_bckr) e_tmp = sub( add( e_tmp, q_lp_E ), add( e_hpE, q_bckr ) ); -#ifdef BASOP_NOGLOB ee[i] = L_shr_o( m_tmp, add( e_tmp, 15 - 6 ), &Overflow ); /* ee in Q6 */ -#else /* BASOP_NOGLOB */ - ee[i] = L_shr( m_tmp, add( e_tmp, 15 - 6 ) ); /* ee in Q6 */ -#endif move32(); } IF( bwidth == NB ) /* For NB input, compensate for the missing bands */ { -#ifdef BASOP_NOGLOB Ltmp = L_shl_o( ee[i], 3, &Overflow ); /* Q6 */ -#else - Ltmp = L_shl( ee[i], 3 ); -#endif IF( EQ_32( Ltmp, MAX_32 ) ) /* if Overflow: Compute with less precision */ { Ltmp = Mult_32_16( ee[i], 24576 /* 0.75 in Q15 */ ); /* 6/8 Q6*/ -#ifdef BASOP_NOGLOB ee[i] = L_shl_sat( Ltmp, 3 ); /* Q6 */ -#else - ee[i] = L_shl( Ltmp, 3 ); -#endif move32(); /* x8 */ } ELSE diff --git a/lib_enc/find_tilt_fx.c b/lib_enc/find_tilt_fx.c index d63585a39..11467d31b 100644 --- a/lib_enc/find_tilt_fx.c +++ b/lib_enc/find_tilt_fx.c @@ -86,11 +86,7 @@ void find_tilt_fx( /*lp_bckr = mean( pt_bckr, nb_bands );*/ /* estimated noise E in first critical bands, up to 1270 Hz */ lp_bckr = Mean32( pt_bckr, nb_bands ); /*hp_bckr = 0.5f * (bckr[max_band-1] + bckr[max_band]);*/ /* estimated noise E in last 2 critical bands */ -#ifdef BASOP_NOGLOB hp_bckr = L_shr( L_add_sat( bckr[max_band - 1], bckr[max_band] ), 1 ); /* Q_new + QSCALE - 1 */ -#else - hp_bckr = L_shr( L_add( bckr[max_band - 1], bckr[max_band] ), 1 ); -#endif if ( hp_bckr == 0 ) /* Avoid division by zero. */ { hp_bckr = L_deposit_l( 1 ); @@ -98,11 +94,7 @@ void find_tilt_fx( tmp = BASOP_Util_Divide3232_Scale( lp_bckr, hp_bckr, &e_tmp ); #ifdef FIX_ISSUE_1152 -#ifdef BASOP_NOGLOB Ltmp = L_shr_r_sat( L_deposit_h( tmp ), sub( 15, e_tmp ) ); -#else - Ltmp = L_shr_r( L_deposit_h( tmp ), sub( 15, e_tmp ) ); -#endif #else Ltmp = L_shr_r( L_deposit_h( tmp ), sub( 15, e_tmp ) ); #endif @@ -114,24 +106,14 @@ void find_tilt_fx( { /*lp_bckr *= FACT;*/ /*hp_bckr *= FACT;*/ -#ifdef BASOP_NOGLOB lp_bckr = L_add_sat( L_shl_sat( lp_bckr, 1 ), lp_bckr ); /* Q_new + QSCALE */ hp_bckr = L_add_sat( L_shl_sat( hp_bckr, 1 ), hp_bckr ); -#else - lp_bckr = L_add( L_shl( lp_bckr, 1 ), lp_bckr ); - hp_bckr = L_add( L_shl( hp_bckr, 1 ), hp_bckr ); -#endif } /*mean_voi = 0.5f * (voicing[1] + voicing[2]) + corr_shift;*/ Ltmp = L_mult( voicing[1], 16384 /* 0.5 in Q15 */ ); /* Q31 */ Ltmp = L_mac( Ltmp, voicing[2], 16384 /* 0.5 in Q15 */ ); /* Q31 */ -#ifdef BASOP_NOGLOB Ltmp = L_mac_o( Ltmp, corr_shift, 32767, &Overflow ); /* Q31 */ mean_voi = round_fx_o( Ltmp, &Overflow ); /* Q15 */ -#else - Ltmp = L_mac( Ltmp, corr_shift, 32767 ); - mean_voi = round_fx( Ltmp ); -#endif /*f0 = INT_FS_FX / pitch[2];*/ e_tmp = norm_s( pitch[2] ); @@ -177,22 +159,13 @@ void find_tilt_fx( tmp = sub( freq, f2 ); IF( L_mac0( -(Word32) TH_D_FX * TH_D_FX, tmp, tmp ) < 0 ) { -#ifdef BASOP_NOGLOB lp_E = L_add_o( *pt_E, lp_E, &Overflow ); /* Q_new + QSCALE - 2 */ -#else - lp_E = L_add( *pt_E, lp_E ); -#endif m_cnt = add( m_cnt, 1 ); /* Q0 */ } pt_E++; } -#ifdef BASOP_NOGLOB f1 = add_o( f1, f0, &Overflow ); f2 = add_o( f2, f0, &Overflow ); -#else - f1 = add( f1, f0 ); - f2 = add( f2, f0 ); -#endif } /*lp_E = lp_E / (float)cnt - lp_bckr;*/ e_tmp = sub( norm_l( lp_E ), 1 ); @@ -206,11 +179,7 @@ void find_tilt_fx( m_tmp = div_s( m_tmp, m_cnt ); /* exp(e_tmp + e_cnt) */ e_tmp = sub( e_tmp, e_cnt ); -#ifdef BASOP_NOGLOB lp_E = L_sub_o( L_shr_o( m_tmp, sub( e_tmp, 1 ), &Overflow ), lp_bckr, &Overflow ); /* Q_new + QSCALE */ -#else - lp_E = L_sub( L_shr( m_tmp, sub( e_tmp, 1 ) ), lp_bckr ); -#endif pt_E = tmp_E + VOIC_BINS; /* Update for next half-frame */ } @@ -238,11 +207,7 @@ void find_tilt_fx( m_tmp = div_s( m_tmp, m_hpE ); /* exp(e_tmp + e_hpE) */ e_tmp = sub( e_tmp, e_hpE ); -#ifdef BASOP_NOGLOB ee[i] = L_shr_o( m_tmp, add( e_tmp, 15 - 6 ), &Overflow ); /* ee in Q6 */ -#else /* BASOP_NOGLOB */ - ee[i] = L_shr( m_tmp, add( e_tmp, 15 - 6 ) ); /* ee in Q6 */ -#endif } ELSE IF( lp_E == 0 ) { @@ -255,19 +220,11 @@ void find_tilt_fx( IF( EQ_16( bwidth, NB ) ) /* For NB input, compensate for the missing bands */ { -#ifdef BASOP_NOGLOB Ltmp = L_shl_o( ee[i], 3, &Overflow ); -#else - Ltmp = L_shl( ee[i], 3 ); -#endif IF( EQ_32( Ltmp, MAX_32 ) ) /* if Overflow: Compute with less precision */ { Ltmp = Mult_32_16( ee[i], 24576 /* 0.75 in Q15 */ ); /* 6/8 Q6*/ -#ifdef BASOP_NOGLOB ee[i] = L_shl_sat( Ltmp, 3 ); -#else - ee[i] = L_shl( Ltmp, 3 ); -#endif move32(); /* x8 */ } ELSE diff --git a/lib_enc/find_uv.c b/lib_enc/find_uv.c index 4196b9cb6..637488a4c 100644 --- a/lib_enc/find_uv.c +++ b/lib_enc/find_uv.c @@ -104,21 +104,13 @@ static Word16 find_ener_decrease_fx( /* o : maximum } -#ifdef BASOP_NOGLOB minEnr = L_add_sat( minEnr, 100000 ); -#else - minEnr = L_add( minEnr, 100000 ); -#endif exp0 = norm_l( minEnr ); wtmp0 = extract_h( L_shl( minEnr, exp0 ) ); exp1 = sub( norm_l( maxEnr ), 1 ); wtmp1 = extract_h( L_shl( maxEnr, exp1 ) ); wtmp1 = div_s( wtmp1, wtmp0 ); -#ifdef BASOP_NOGLOB dE2 = shr_ro( wtmp1, add( sub( exp1, exp0 ), 15 - 10 ), &Overflow ); /*Q10*/ -#else - dE2 = shr_r( wtmp1, add( sub( exp1, exp0 ), 15 - 10 ) ); /*Q10*/ -#endif return dE2; } @@ -221,11 +213,7 @@ Word16 find_uv_ivas_fx( /* o : coding typ exp1 = sub( norm_l( *pt_enr_ssf1 ), 1 ); wtmp1 = extract_h( L_shl( *pt_enr_ssf1, exp1 ) ); fac = div_s( wtmp1, wtmp0 ); -#ifdef BASOP_NOGLOB fac_32 = L_shr_o( L_deposit_l( fac ), add( sub( exp1, exp0 ), 15 - 13 ), &Overflow ); /* fac32 in Q13*/ -#else /* BASOP_NOGLOB */ - fac_32 = L_shr( L_deposit_l( fac ), add( sub( exp1, exp0 ), 15 - 13 ) ); /* fac32 in Q13*/ -#endif /* BASOP_NOGLOB */ if ( GT_32( fac_32, dE1 ) ) { @@ -269,21 +257,13 @@ Word16 find_uv_ivas_fx( /* o : coding typ *-----------------------------------------------------------------*/ /*mean_ee = 1.0f/3.0f * (st->ee_old + ee[0] + ee[1]); */ /* coefficients take into account the position of the window */ -#ifdef BASOP_NOGLOB mean_ee = L_add_o( L_add_o( st_fx->ee_old_fx, ee[0], &Overflow ), ee[1], &Overflow ); /* Q6 */ -#else /* BASOP_NOGLOB */ - mean_ee = L_add( L_add( st_fx->ee_old_fx, ee[0] ), ee[1] ); -#endif /* BASOP_NOGLOB */ mean_ee = Mult_32_16( mean_ee, 10923 ); /*Q6*/ /* mean_voi3 = 1.0f/3.0f * (voicing[0] + voicing[1] + voicing[2]);*/ Ltmp0 = L_mult( st_fx->voicing_fx[0], 10923 /* 1/3 in Q15 */ ); /* Q31 */ Ltmp0 = L_mac( Ltmp0, st_fx->voicing_fx[1], 10923 /* 1/3 in Q15 */ ); /* Q31 */ -#ifdef BASOP_NOGLOB // -dtx 12650 amrwb\Dtx3.INP mean_voi3 = mac_r_sat( Ltmp0, st_fx->voicing_fx[2], 10923 /* 1/3 in Q15 */ ); /*Q15*/ -#else - mean_voi3 = mac_r( Ltmp0, st_fx->voicing_fx[2], 10923 ); /*Q15*/ -#endif /*-----------------------------------------------------------------* * Total frame energy difference (dE3) *-----------------------------------------------------------------*/ @@ -303,11 +283,7 @@ Word16 find_uv_ivas_fx( /* o : coding typ { dE2_th = 21 << 10; move32(); -#ifdef BASOP_NOGLOB if ( GE_16( add_o( mean_voi3, corr_shift, &Overflow ), 22282 ) ) /*( mean_voi3 + corr_shift ) >= 0.68f*/ -#else - if ( GE_16( add( mean_voi3, corr_shift ), 22282 ) ) /*( mean_voi3 + corr_shift ) >= 0.68f*/ -#endif { nb_cond = 0; move16(); @@ -386,15 +362,9 @@ Word16 find_uv_ivas_fx( /* o : coding typ test(); test(); test(); -#ifdef BASOP_NOGLOB IF( ( EQ_16( st_fx->last_coder_type_raw, UNVOICED ) ) || /* previous frame was unvoiced */ ( ( LT_32( ee[0], ee0_th ) ) && ( GT_32( hp_E[0], E_min_th ) ) && /* energy is concentrated in high frequencies provided that some energy is present in HF */ ( LT_16( add_o( st_fx->voicing_fx[0], corr_shift, &Overflow ), voi_th ) ) ) ) /* normalized correlation is low */ -#else /* BASOP_NOGLOB */ - if ( ( EQ_16( st_fx->last_coder_type_raw, UNVOICED ) ) || /* previous frame was unvoiced */ - ( ( LT_32( ee[0], ee0_th ) ) && ( GT_32( hp_E[0], E_min_th ) ) && /* energy is concentrated in high frequencies provided that some energy is present in HF */ - ( LT_16( add( st_fx->voicing_fx[0], corr_shift ), voi_th ) ) ) ) /* normalized correlation is low */ -#endif /* BASOP_NOGLOB */ { tmp_offset_flag = 0; move16(); @@ -470,7 +440,6 @@ Word16 find_uv_ivas_fx( /* o : coding typ test(); test(); test(); -#ifdef BASOP_NOGLOB IF( ( ( LT_16( add_o( mean_voi3, corr_shift, &Overflow ), add( 22282 /* 0.68 in Q15 */, mean_voi3_offset ) ) ) && /* normalized correlation low */ ( LT_16( add_o( st_fx->voicing_fx[2], corr_shift, &Overflow ), 25887 /* 0.79 in Q15 */ ) ) && /* normalized correlation low on look-ahead - onset detection */ ( LT_32( ee[0], 640 /* 10.0f in Q6 */ ) ) && ( GT_32( hp_E[0], E_min_th ) ) && /* energy concentrated in high frequencies provided that some energy is present in HF... */ @@ -481,18 +450,6 @@ Word16 find_uv_ivas_fx( /* o : coding typ ( LE_32( st_fx->old_dE1_fx, 237568 /* 29.0f in Q13 */ ) ) && /* + one frame hysteresis */ ( st_fx->spike_hyst < 0 ) ) || /* Avoid after sharp energy spikes followed by decay (e.g. castanets) */ flag_low_relE ) /* low relative frame energy (only for SC-VBR) */ -#else - if ( ( ( LT_16( add( mean_voi3, corr_shift ), add( 22282, mean_voi3_offset ) ) ) && /* normalized correlation low */ - ( LT_16( add( st_fx->voicing_fx[2], corr_shift ), 25887 ) ) && /* normalized correlation low on look-ahead - onset detection */ - ( LT_32( ee[0], 640 ) ) && ( GT_32( hp_E[0], E_min_th ) ) && /* energy concentrated in high frequencies provided that some energy is present in HF... */ - ( LT_32( ee[1], ee1_th ) ) && ( GT_32( hp_E[1], E_min_th ) ) && /* ... biased towards look-ahead to detect onsets */ - ( tmp_offset_flag == 0 ) && /* Take care of voiced offsets */ - /*( st_fx->music_hysteresis_fx == 0 ) &&*/ /* ... and in segment after AUDIO frames */ - ( LE_32( dE1, 237568 ) ) && /* Avoid on sharp energy spikes */ - ( LE_32( st_fx->old_dE1_fx, 237568 ) ) && /* + one frame hysteresis */ - ( st_fx->spike_hyst < 0 ) ) || /* Avoid after sharp energy spikes followed by decay (e.g. castanets) */ - flag_low_relE ) /* low relative frame energy (only for SC-VBR) */ -#endif { coder_type = UNVOICED; move16(); @@ -509,7 +466,6 @@ Word16 find_uv_ivas_fx( /* o : coding typ test(); test(); test(); -#ifdef BASOP_NOGLOB if ( ( ( LT_16( add_o( mean_voi3, corr_shift, &Overflow ), add( 22774 /* 0.695f in Q15 */, mean_voi3_offset ) ) ) && /* normalized correlation low */ /*( LT_16( add_o( st_fx->voicing_fx[2], corr_shift, &Overflow ), 25887 ) ) && */ /* normalized correlation low on look-ahead - onset detection */ ( LT_32( ee[0], 397 /* 6.2f in Q6 */ ) ) && ( GT_32( hp_E[0], E_min_th ) ) && /* energy concentrated in high frequencies provided that some energy is present in HF... */ @@ -520,18 +476,6 @@ Word16 find_uv_ivas_fx( /* o : coding typ ( LE_32( st_fx->old_dE1_fx, 245760 /* 30.0f in Q13 */ ) ) && /* + one frame hysteresis */ ( st_fx->spike_hyst < 0 ) ) /* Avoid after sharp energy spikes followed by decay (e.g. castanets) */ || ( flag_low_relE && ( LE_32( st_fx->old_dE1_fx, 245760 /* 30.0f in Q13 */ ) ) ) ) /* low relative frame energy (only for SC-VBR) */ -#else - if ( ( ( LT_16( add( mean_voi3, corr_shift ), add( 22774, mean_voi3_offset ) ) ) && /* normalized correlation low */ - /* ( LT_16( add( st_fx->voicing_fx[2], corr_shift ), 25887 ) ) && */ /* normalized correlation low on look-ahead - onset detection */ - ( LT_32( ee[0], 397 ) ) && ( GT_32( hp_E[0], E_min_th ) ) && /* energy concentrated in high frequencies provided that some energy is present in HF... */ - ( LT_32( ee[1], 397 ) ) && ( GT_32( hp_E[1], E_min_th ) ) && /* ... biased towards look-ahead to detect onsets */ - ( tmp_offset_flag == 0 ) && /* Take care of voiced offsets */ - /*( st_fx->music_hysteresis_fx == 0 ) && */ /* ... and in segment after AUDIO frames */ - ( LE_32( dE1, 245760 ) ) && /* Avoid on sharp energy spikes */ - ( LE_32( st_fx->old_dE1_fx, 245760 ) ) && /* + one frame hysteresis */ - ( st_fx->spike_hyst < 0 ) ) /* Avoid after sharp energy spikes followed by decay (e.g. castanets) */ - || ( flag_low_relE && ( LE_32( st_fx->old_dE1_fx, 245760 ) ) ) ) /* low relative frame energy (only for SC-VBR) */ -#endif { coder_type = UNVOICED; move16(); @@ -691,11 +635,7 @@ Word16 find_uv_ivas_fx( /* o : coding typ test(); if ( ( GT_16( st_fx->spike_hyst, 1 ) ) && ( GT_16( dE3, 5 << 8 ) || /* energy increases */ -#ifdef BASOP_NOGLOB ( GT_16( relE, -3328 /* 13 in Q8 */ ) && ( GT_16( add_sat( mean_voi3, corr_shift ), 22774 /* 0.695 in Q15 */ ) ) ) ) ) /* normalized correlation is high */ -#else - ( GT_16( relE, -3328 ) && ( GT_16( add( mean_voi3, corr_shift ), 22774 ) ) ) ) ) /* normalized correlation is high */ -#endif { st_fx->spike_hyst = -1; move16(); diff --git a/lib_enc/find_uv_fx.c b/lib_enc/find_uv_fx.c index 5cd9db279..13fa4501e 100644 --- a/lib_enc/find_uv_fx.c +++ b/lib_enc/find_uv_fx.c @@ -70,21 +70,13 @@ static Word16 find_ener_decrease_fx( /* o : maximum } -#ifdef BASOP_NOGLOB minEnr = L_add_sat( minEnr, 100000 ); -#else - minEnr = L_add( minEnr, 100000 ); -#endif exp0 = norm_l( minEnr ); wtmp0 = extract_h( L_shl( minEnr, exp0 ) ); exp1 = sub( norm_l( maxEnr ), 1 ); wtmp1 = extract_h( L_shl( maxEnr, exp1 ) ); wtmp1 = div_s( wtmp1, wtmp0 ); -#ifdef BASOP_NOGLOB dE2 = shr_ro( wtmp1, add( sub( exp1, exp0 ), 15 - 10 ), &Overflow ); /*Q10*/ -#else - dE2 = shr_r( wtmp1, add( sub( exp1, exp0 ), 15 - 10 ) ); /*Q10*/ -#endif return dE2; } @@ -197,11 +189,7 @@ Word16 find_uv_fx( /* o : coding type */ exp1 = sub( norm_l( *pt_enr_ssf1 ), 1 ); wtmp1 = extract_h( L_shl( *pt_enr_ssf1, exp1 ) ); fac = div_s( wtmp1, wtmp0 ); -#ifdef BASOP_NOGLOB fac_32 = L_shr_o( L_deposit_l( fac ), add( sub( exp1, exp0 ), 15 - 13 ), &Overflow ); /* fac32 in Q13*/ -#else /* BASOP_NOGLOB */ - fac_32 = L_shr( L_deposit_l( fac ), add( sub( exp1, exp0 ), 15 - 13 ) ); /* fac32 in Q13*/ -#endif /* BASOP_NOGLOB */ if ( GT_32( fac_32, dE1 ) ) { @@ -239,21 +227,13 @@ Word16 find_uv_fx( /* o : coding type */ *-----------------------------------------------------------------*/ /*mean_ee = 1.0f/3.0f * (st->ee_old + ee[0] + ee[1]); */ /* coefficients take into account the position of the window */ -#ifdef BASOP_NOGLOB mean_ee = L_add_o( L_add_o( st_fx->ee_old_fx, ee[0], &Overflow ), ee[1], &Overflow ); /* Q6 */ -#else /* BASOP_NOGLOB */ - mean_ee = L_add( L_add( st_fx->ee_old_fx, ee[0] ), ee[1] ); -#endif /* BASOP_NOGLOB */ mean_ee = Mult_32_16( mean_ee, 10923 /* 1/3 in Q15 */ ); /*Q6*/ /* mean_voi3 = 1.0f/3.0f * (voicing[0] + voicing[1] + voicing[2]);*/ Ltmp0 = L_mult( st_fx->voicing_fx[0], 10923 /* 1/3 in Q15 */ ); /* Q31 */ Ltmp0 = L_mac( Ltmp0, st_fx->voicing_fx[1], 10923 /* 1/3 in Q15 */ ); /* Q31 */ -#ifdef BASOP_NOGLOB // -dtx 12650 amrwb\Dtx3.INP mean_voi3 = mac_r_sat( Ltmp0, st_fx->voicing_fx[2], 10923 /* 1/3 in Q15 */ ); /*Q15*/ -#else - mean_voi3 = mac_r( Ltmp0, st_fx->voicing_fx[2], 10923 ); /*Q15*/ -#endif /*-----------------------------------------------------------------* * Total frame energy difference (dE3) *-----------------------------------------------------------------*/ @@ -273,11 +253,7 @@ Word16 find_uv_fx( /* o : coding type */ { dE2_th = 21 << 10; move32(); -#ifdef BASOP_NOGLOB if ( GE_16( add_o( mean_voi3, corr_shift, &Overflow ), 22282 /* 0.68 in Q15 */ ) ) /*( mean_voi3 + corr_shift ) >= 0.68f*/ -#else - if ( GE_16( add( mean_voi3, corr_shift ), 22282 ) ) /*( mean_voi3 + corr_shift ) >= 0.68f*/ -#endif { nb_cond = 0; move16(); @@ -354,15 +330,9 @@ Word16 find_uv_fx( /* o : coding type */ test(); test(); test(); -#ifdef BASOP_NOGLOB if ( ( EQ_16( st_fx->last_coder_type_raw, UNVOICED ) ) || /* previous frame was unvoiced */ ( ( LT_32( ee[0], ee0_th ) ) && ( GT_32( hp_E[0], L_shl( E_MIN_FX, Q_new ) ) ) && /* energy is concentrated in high frequencies provided that some energy is present in HF */ ( LT_16( add_o( st_fx->voicing_fx[0], corr_shift, &Overflow ), voi_th ) ) ) ) /* normalized correlation is low */ -#else /* BASOP_NOGLOB */ - if ( ( EQ_16( st_fx->last_coder_type_raw, UNVOICED ) ) || /* previous frame was unvoiced */ - ( ( LT_32( ee[0], ee0_th ) ) && ( GT_32( hp_E[0], L_shl( E_MIN_FX, Q_new ) ) ) && /* energy is concentrated in high frequencies provided that some energy is present in HF */ - ( LT_16( add( st_fx->voicing_fx[0], corr_shift ), voi_th ) ) ) ) /* normalized correlation is low */ -#endif /* BASOP_NOGLOB */ { tmp_offset_flag = 0; move16(); @@ -438,7 +408,6 @@ Word16 find_uv_fx( /* o : coding type */ test(); test(); test(); -#ifdef BASOP_NOGLOB if ( ( ( LT_16( add_o( mean_voi3, corr_shift, &Overflow ), add( 22282 /* 0.68 in Q15 */, mean_voi3_offset ) ) ) && /* normalized correlation low */ ( LT_16( add_o( st_fx->voicing_fx[2], corr_shift, &Overflow ), 25887 /* 0.79 in Q15 */ ) ) && /* normalized correlation low on look-ahead - onset detection */ ( LT_32( ee[0], 640 /* 10.0f in Q6 */ ) ) && ( GT_32( hp_E[0], E_min_th ) ) && /* energy concentrated in high frequencies provided that some energy is present in HF... */ @@ -449,18 +418,6 @@ Word16 find_uv_fx( /* o : coding type */ ( LE_32( st_fx->old_dE1_fx, 237568 /* 29.0f in Q13 */ ) ) && /* + one frame hysteresis */ ( st_fx->spike_hyst < 0 ) ) || /* Avoid after sharp energy spikes followed by decay (e.g. castanets) */ flag_low_relE ) /* low relative frame energy (only for SC-VBR) */ -#else - if ( ( ( LT_16( add( mean_voi3, corr_shift ), add( 22282, mean_voi3_offset ) ) ) && /* normalized correlation low */ - ( LT_16( add( st_fx->voicing_fx[2], corr_shift ), 25887 ) ) && /* normalized correlation low on look-ahead - onset detection */ - ( LT_32( ee[0], 640 ) ) && ( GT_32( hp_E[0], E_min_th ) ) && /* energy concentrated in high frequencies provided that some energy is present in HF... */ - ( LT_32( ee[1], ee1_th ) ) && ( GT_32( hp_E[1], E_min_th ) ) && /* ... biased towards look-ahead to detect onsets */ - ( tmp_offset_flag == 0 ) && /* Take care of voiced offsets */ - /*( st_fx->music_hysteresis_fx == 0 ) &&*/ /* ... and in segment after AUDIO frames */ - ( LE_32( dE1, 237568 ) ) && /* Avoid on sharp energy spikes */ - ( LE_32( st_fx->old_dE1_fx, 237568 ) ) && /* + one frame hysteresis */ - ( st_fx->spike_hyst < 0 ) ) || /* Avoid after sharp energy spikes followed by decay (e.g. castanets) */ - flag_low_relE ) /* low relative frame energy (only for SC-VBR) */ -#endif { coder_type = UNVOICED; move16(); @@ -480,7 +437,6 @@ Word16 find_uv_fx( /* o : coding type */ test(); test(); test(); -#ifdef BASOP_NOGLOB if ( ( ( LT_16( add_o( mean_voi3, corr_shift, &Overflow ), add( 22774 /* 0.695f in Q15 */, mean_voi3_offset ) ) ) && /* normalized correlation low */ ( LT_16( add_sat( st_fx->voicing_fx[2], corr_shift ), 25887 /* 0.8 in Q15 */ ) ) && /* normalized correlation low on look-ahead - onset detection */ ( LT_32( ee[0], 397 /* 6.2f in Q6 */ ) ) && ( GT_32( hp_E[0], E_min_th ) ) && /* energy concentrated in high frequencies provided that some energy is present in HF... */ @@ -491,18 +447,6 @@ Word16 find_uv_fx( /* o : coding type */ ( LE_32( st_fx->old_dE1_fx, 245760 /* 30.0f in Q13 */ ) ) && /* + one frame hysteresis */ ( st_fx->spike_hyst < 0 ) ) /* Avoid after sharp energy spikes followed by decay (e.g. castanets) */ || ( flag_low_relE && ( LE_32( st_fx->old_dE1_fx, 245760 /* 30.0f in Q13 */ ) ) ) ) /* low relative frame energy (only for SC-VBR) */ -#else - if ( ( ( LT_16( add( mean_voi3, corr_shift ), add( 22774, mean_voi3_offset ) ) ) && /* normalized correlation low */ - ( LT_16( add( st_fx->voicing_fx[2], corr_shift ), 25887 ) ) && /* normalized correlation low on look-ahead - onset detection */ - ( LT_32( ee[0], 397 ) ) && ( GT_32( hp_E[0], E_min_th ) ) && /* energy concentrated in high frequencies provided that some energy is present in HF... */ - ( LT_32( ee[1], 397 ) ) && ( GT_32( hp_E[1], E_min_th ) ) && /* ... biased towards look-ahead to detect onsets */ - ( tmp_offset_flag == 0 ) && /* Take care of voiced offsets */ - /*( st_fx->music_hysteresis_fx == 0 ) && */ /* ... and in segment after AUDIO frames */ - ( LE_32( dE1, 245760 ) ) && /* Avoid on sharp energy spikes */ - ( LE_32( st_fx->old_dE1_fx, 245760 ) ) && /* + one frame hysteresis */ - ( st_fx->spike_hyst < 0 ) ) /* Avoid after sharp energy spikes followed by decay (e.g. castanets) */ - || ( flag_low_relE && ( LE_32( st_fx->old_dE1_fx, 245760 ) ) ) ) /* low relative frame energy (only for SC-VBR) */ -#endif { coder_type = UNVOICED; move16(); @@ -656,11 +600,7 @@ Word16 find_uv_fx( /* o : coding type */ test(); if ( ( GT_16( st_fx->spike_hyst, 1 ) ) && ( GT_16( dE3, 5 << 8 ) || /* energy increases */ -#ifdef BASOP_NOGLOB ( GT_16( relE, -3328 ) && ( GT_16( add_sat( mean_voi3, corr_shift ), 22774 ) ) ) ) ) /* normalized correlation is high */ -#else - ( GT_16( relE, -3328 ) && ( GT_16( add( mean_voi3, corr_shift ), 22774 ) ) ) ) ) /* normalized correlation is high */ -#endif { st_fx->spike_hyst = -1; move16(); diff --git a/lib_enc/gain_enc_fx.c b/lib_enc/gain_enc_fx.c index 1d330ac49..cd24f2993 100644 --- a/lib_enc/gain_enc_fx.c +++ b/lib_enc/gain_enc_fx.c @@ -96,11 +96,7 @@ void Es_pred_enc_fx( FOR( i = 1; i < L_SUBFR; i++ ) { tmp16 = mult_r( res[i_subfr + i], 8192 /* 1 in Q13 */ ); /* remove 2bits Q_new - 2*/ -#ifdef BASOP_NOGLOB ener_fx = L_mac_o( ener_fx, tmp16, tmp16, &Overflow ); -#else - ener_fx = L_mac( ener_fx, tmp16, tmp16 ); -#endif } /* ener = 10 * (float)log10(ener / (float)L_SUBFR) */ @@ -182,11 +178,7 @@ void Es_pred_enc_fx( FOR( i = 1; i < size; i++ ) { -#ifdef BASOP_NOGLOB tmp16_2 = abs_s( sub_o( mean_ener_code16, qua_table[i], &Overflow ) ); -#else /* BASOP_NOGLOB */ - tmp16_2 = abs_s( sub( mean_ener_code16, qua_table[i] ) ); -#endif /* BASOP_NOGLOB */ IF( LT_16( tmp16_2, tmp16 ) ) { tmp16 = tmp16_2; @@ -397,11 +389,7 @@ void gain_enc_mless_fx( L_div = Mult_32_16( L_frac_num, tmp ); /*Q(30-exp)*/ exp_div = sub( exp_num, exp_den ); -#ifdef BASOP_NOGLOB *gain_pit = round_fx_o( L_shl_o( L_div, add( exp, exp_div ), &Overflow ), &Overflow ); /*Q14*/ -#else - *gain_pit = round_fx( L_shl( L_div, add( exp, exp_div ) ) ); /*Q14*/ -#endif L_tmp1 = L_shr( L_mult( coeff[1], coeff[4] ), 2 ); /*Q31*/ exp1 = add( exp_coeff[1], exp_coeff[4] ); @@ -426,11 +414,7 @@ void gain_enc_mless_fx( L_div = Mult_32_16( L_frac_num, tmp ); /*Q(30-exp)*/ exp_div = sub( exp_num, exp_den ); -#ifdef BASOP_NOGLOB *gain_code = L_shl_o( L_div, sub( add( exp, exp_div ), 14 ), &Overflow ); -#else - *gain_code = L_shl( L_div, sub( add( exp, exp_div ), 14 ) ); -#endif move32(); /*Q16*/ *gain_pit = s_max( G_PITCH_MIN_TC192_Q14, s_min( *gain_pit, G_PITCH_MAX_TC192_Q14 ) ); @@ -460,11 +444,7 @@ void gain_enc_mless_fx( index = gain_quant_fx( gain_code, &gain_code16, LG10_G_CODE_MIN_TC192_Q14, LG10_G_CODE_MAX_TC192_Q13, nBits2, &expg ); push_indice_fx( hBstr, IND_GAIN_CODE, index, nBits2 ); L_tmp = L_mult( gain_code16, gcode0 ); /*Q0*Q0 -> Q1*/ -#ifdef BASOP_NOGLOB *gain_code = L_shl_o( L_tmp, add( add( expg, exp_gcode0 ), 15 ), &Overflow ); /*Q16*/ -#else - *gain_code = L_shl( L_tmp, add( add( expg, exp_gcode0 ), 15 ) ); /*Q16*/ -#endif } ELSE { @@ -745,11 +725,7 @@ void gain_enc_mless_ivas_fx( L_div = Mult_32_16( L_frac_num, tmp ); /*Q(30-exp)*/ exp_div = sub( exp_num, exp_den ); -#ifdef BASOP_NOGLOB *gain_pit = round_fx_o( L_shl_o( L_div, add( exp, exp_div ), &Overflow ), &Overflow ); /*Q14*/ -#else - *gain_pit = round_fx( L_shl( L_div, add( exp, exp_div ) ) ); /*Q14*/ -#endif L_tmp1 = L_shr( L_mult( coeff[1], coeff[4] ), 2 ); /*Q31*/ exp1 = add( exp_coeff[1], exp_coeff[4] ); @@ -774,11 +750,7 @@ void gain_enc_mless_ivas_fx( L_div = Mult_32_16( L_frac_num, tmp ); /*Q(30-exp)*/ exp_div = sub( exp_num, exp_den ); -#ifdef BASOP_NOGLOB *gain_code = L_shl_o( L_div, sub( add( exp, exp_div ), 14 ), &Overflow ); -#else - *gain_code = L_shl( L_div, sub( add( exp, exp_div ), 14 ) ); -#endif move32(); /*Q16*/ *gain_pit = s_max( G_PITCH_MIN_TC192_Q14, s_min( *gain_pit, G_PITCH_MAX_TC192_Q14 ) ); @@ -807,11 +779,7 @@ void gain_enc_mless_ivas_fx( index = gain_quant_fx( gain_code, &gain_code16, LG10_G_CODE_MIN_TC192_Q14, LG10_G_CODE_MAX_TC192_Q13, nBits2, &expg ); push_indice( hBstr, IND_GAIN_CODE, index, nBits2 ); L_tmp = L_mult( gain_code16, gcode0 ); /*Q0*Q0 -> Q1*/ -#ifdef BASOP_NOGLOB *gain_code = L_shl_o( L_tmp, add( add( expg, exp_gcode0 ), 15 ), &Overflow ); /*Q16*/ -#else - *gain_code = L_shl( L_tmp, add( add( expg, exp_gcode0 ), 15 ) ); /*Q16*/ -#endif } ELSE { @@ -1033,11 +1001,7 @@ void gain_enc_SQ_fx( L_tmp1 = L_mult( coeff[0], coeff[2] ); /*Q31*/ exp1 = add( exp_coeff[0], exp_coeff[2] ); -#ifdef BASOP_NOGLOB L_tmp2 = L_mult_o( coeff[4], coeff[4], &Overflow ); /*Q31*/ -#else - L_tmp2 = L_mult( coeff[4], coeff[4] ); /*Q31*/ -#endif exp2 = add( exp_coeff[4], exp_coeff[4] ); IF( GT_16( exp1, exp2 ) ) @@ -1079,20 +1043,12 @@ void gain_enc_SQ_fx( exp_num = exp2; move16(); } -#ifdef BASOP_NOGLOB L_frac_num = L_sub_o( L_tmp2, L_tmp1, &Overflow ); /*Q31*/ -#else /* BASOP_NOGLOB */ - L_frac_num = L_sub( L_tmp2, L_tmp1 ); /*Q31*/ -#endif /* BASOP_NOGLOB */ L_div = Mult_32_16( L_frac_num, tmp ); /*Q(30-exp)*/ exp_div = sub( exp_num, exp_den ); -#ifdef BASOP_NOGLOB *gain_pit = round_fx_o( L_shl_o( L_div, add( exp, exp_div ), &Overflow ), &Overflow ); /*Q14*/ -#else /* BASOP_NOGLOB */ - *gain_pit = round_fx( L_shl( L_div, add( exp, exp_div ) ) ); /*Q14*/ -#endif /* BASOP_NOGLOB */ L_tmp1 = L_mult( coeff[1], coeff[4] ); /*Q31*/ exp1 = add( exp_coeff[1], exp_coeff[4] ); @@ -1112,20 +1068,12 @@ void gain_enc_SQ_fx( exp_num = exp2; move16(); } -#ifdef BASOP_NOGLOB L_frac_num = L_sub_o( L_tmp2, L_tmp1, &Overflow ); /*Q31*/ -#else /* BASOP_NOGLOB */ - L_frac_num = L_sub( L_tmp2, L_tmp1 ); /*Q31*/ -#endif /* BASOP_NOGLOB */ L_div = Mult_32_16( L_frac_num, tmp ); /*Q(30-exp)*/ exp_div = sub( exp_num, exp_den ); -#ifdef BASOP_NOGLOB *gain_code = L_shl_sat( L_div, s_max( -31, sub( add( exp, exp_div ), 14 ) ) ); -#else - *gain_code = L_shl( L_div, s_max( -31, sub( add( exp, exp_div ), 14 ) ) ); -#endif move32(); /*Q16*/ *gain_pit = s_max( G_PITCH_MIN_Q14, s_min( *gain_pit, G_PITCH_MAX_Q14 ) ); @@ -1178,11 +1126,7 @@ void gain_enc_SQ_fx( index = gain_quant_fx( gain_code, &gain_code16, LG10_G_CODE_MIN_Q14, LG10_G_CODE_MAX_Q13, nBits_code, &expg ); push_indice_fx( hBstr, IND_GAIN_CODE, index, nBits_code ); L_tmp = L_mult( gain_code16, gcode0 ); /*Q0*Q0 -> Q1*/ -#ifdef BASOP_NOGLOB *gain_code = L_shl_sat( L_tmp, add( add( expg, exp_gcode0 ), 15 ) ); -#else - *gain_code = L_shl( L_tmp, add( add( expg, exp_gcode0 ), 15 ) ); -#endif move32(); /*Q16*/ /* *norm_gain_code = *gain_code / *gain_inov; */ @@ -1331,11 +1275,7 @@ void gain_enc_SQ_ivas_fx( L_tmp1 = L_mult( coeff[0], coeff[2] ); /*Q31*/ exp1 = add( exp_coeff[0], exp_coeff[2] ); -#ifdef BASOP_NOGLOB L_tmp2 = L_mult_o( coeff[4], coeff[4], &Overflow ); /*Q31*/ -#else - L_tmp2 = L_mult( coeff[4], coeff[4] ); /*Q31*/ -#endif exp2 = add( exp_coeff[4], exp_coeff[4] ); IF( GT_16( exp1, exp2 ) ) @@ -1377,29 +1317,16 @@ void gain_enc_SQ_ivas_fx( exp_num = exp2; move16(); } -#ifdef BASOP_NOGLOB L_frac_num = L_sub_o( L_tmp2, L_tmp1, &Overflow ); /*Q31*/ -#else /* BASOP_NOGLOB */ - L_frac_num = L_sub( L_tmp2, L_tmp1 ); /*Q31*/ -#endif /* BASOP_NOGLOB */ L_div = Mult_32_16( L_frac_num, tmp ); /*Q(30-exp)*/ exp_div = sub( exp_num, exp_den ); -#ifdef BASOP_NOGLOB *gain_pit = round_fx_o( L_shl_o( L_div, add( exp, exp_div ), &Overflow ), &Overflow ); /*Q14*/ move16(); -#else /* BASOP_NOGLOB */ - *gain_pit = round_fx( L_shl( L_div, add( exp, exp_div ) ) ); /*Q14*/ - move16(); -#endif /* BASOP_NOGLOB */ // To be checked -#ifdef BASOP_NOGLOB L_tmp1 = L_mult_o( coeff[1], coeff[4], &Overflow ); /*Q31*/ -#else /* BASOP_NOGLOB */ - L_tmp1 = L_mult( coeff[1], coeff[4] ); /*Q31*/ -#endif /* BASOP_NOGLOB */ exp1 = add( exp_coeff[1], exp_coeff[4] ); L_tmp2 = L_mult( coeff[0], coeff[3] ); /*Q31*/ @@ -1417,20 +1344,12 @@ void gain_enc_SQ_ivas_fx( exp_num = exp2; move16(); } -#ifdef BASOP_NOGLOB L_frac_num = L_sub_o( L_tmp2, L_tmp1, &Overflow ); /*Q31*/ -#else /* BASOP_NOGLOB */ - L_frac_num = L_sub( L_tmp2, L_tmp1 ); /*Q31*/ -#endif /* BASOP_NOGLOB */ L_div = Mult_32_16( L_frac_num, tmp ); /*Q(30-exp)*/ exp_div = sub( exp_num, exp_den ); -#ifdef BASOP_NOGLOB *gain_code = L_shl_sat( L_div, s_max( -31, sub( add( exp, exp_div ), 14 ) ) ); -#else - *gain_code = L_shl( L_div, s_max( -31, sub( add( exp, exp_div ), 14 ) ) ); -#endif move32(); /*Q16*/ *gain_pit = s_max( G_PITCH_MIN_Q14, s_min( *gain_pit, G_PITCH_MAX_Q14 ) ); @@ -1483,11 +1402,7 @@ void gain_enc_SQ_ivas_fx( index = gain_quant_fx( gain_code, &gain_code16, LG10_G_CODE_MIN_Q14, LG10_G_CODE_MAX_Q13, nBits_code, &expg ); push_indice( hBstr, IND_GAIN_CODE, index, nBits_code ); L_tmp = L_mult( gain_code16, gcode0 ); /*Q0*Q0 -> Q1*/ -#ifdef BASOP_NOGLOB *gain_code = L_shl_sat( L_tmp, add( add( expg, exp_gcode0 ), 15 ) ); -#else - *gain_code = L_shl( L_tmp, add( add( expg, exp_gcode0 ), 15 ) ); -#endif move32(); /*Q16*/ /* *norm_gain_code = *gain_code / *gain_inov; */ @@ -1551,11 +1466,7 @@ Word16 gain_enc_gaus_fx( /* o : Return index of quant Ltmp = Pow2( 14, frac_gain ); /* Put 14 as exponent */ exp_gain = sub( exp_gain, 14 ); /* Retreive exponent of wtmp */ -#ifdef BASOP_NOGLOB *gain = L_shl_o( Ltmp, add( 16, exp_gain ), &Overflow ); -#else - *gain = L_shl( Ltmp, add( 16, exp_gain ) ); -#endif move32(); /*Q16*/ return index; @@ -1626,11 +1537,7 @@ void gain_enc_tc_fx( i = sub( exp_num, exp_den ); /* Gain_trans in Q7 */ g_code_fx = i_mult2( g_code_fx, tmp16 ); /* apply sign */ -#ifdef BASOP_NOGLOB *gain_code_fx = L_shr_sat( L_deposit_l( g_code_fx ), i ); -#else - *gain_code_fx = L_shr( L_deposit_l( g_code_fx ), i ); -#endif move32(); /*----------------------------------------------------------------* @@ -1736,11 +1643,7 @@ void gain_enc_tc_fx( move16(); /**gain_code *= gcode0;*/ L_tmp = L_mult( wgain_code, gcode0_fx ); /* Q13*Q0 -> Q14 */ -#ifdef BASOP_NOGLOB *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 2 ) ); -#else - *gain_code_fx = L_shl( L_tmp, add( exp_gcode0, 2 ) ); -#endif move32(); /* Q14 -> Q16 */ push_indice_fx( hBstr, IND_GAIN_CODE, index, nBits ); } @@ -1817,11 +1720,7 @@ void gain_enc_tc_ivas_fx( i = sub( exp_num, exp_den ); /* Gain_trans in Q7 */ g_code_fx = i_mult2( g_code_fx, tmp16 ); /* apply sign */ -#ifdef BASOP_NOGLOB *gain_code_fx = L_shr_sat( L_deposit_l( g_code_fx ), i ); /* Q16 */ -#else - *gain_code_fx = L_shr( L_deposit_l( g_code_fx ), i ); -#endif move32(); /*----------------------------------------------------------------* @@ -1927,11 +1826,7 @@ void gain_enc_tc_ivas_fx( move16(); /**gain_code *= gcode0;*/ L_tmp = L_mult( wgain_code, gcode0_fx ); /* Q13*Q0 -> Q14 */ -#ifdef BASOP_NOGLOB *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 2 ) ); -#else - *gain_code_fx = L_shl( L_tmp, add( exp_gcode0, 2 ) ); -#endif move32(); /* Q14 -> Q16 */ push_indice( hBstr, IND_GAIN_CODE, index, nBits ); } @@ -2071,11 +1966,7 @@ static Word16 Find_Opt_gainQ_fx( L_tmp = L_mac( L_tmp, coeff[3], g_code ); /* 15 - coeff_exp + 13 - 1 */ L_tmp = L_mac( L_tmp, coeff[4], g_pit_cod ); /* 15 - coeff_exp + 13 - 1 */ -#ifdef BASOP_NOGLOB L_tmp1 = L_sub_o( L_tmp, dist_min, &Overflow ); -#else /* BASOP_NOGLOB */ - L_tmp1 = L_sub( L_tmp, dist_min ); -#endif /* BASOP_NOGLOB */ if ( L_tmp1 < 0 ) { index = i; @@ -2093,11 +1984,7 @@ static Word16 Find_Opt_gainQ_fx( move16(); L_tmp = L_mult( g_code, gcode0 ); /* Q9*Q0 -> Q10 */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /* Q10 -> Q16 */ -#else - L_tmp = L_shl( L_tmp, add( exp_gcode0, 6 ) ); /* Q10 -> Q16 */ -#endif *gain_code = L_tmp; /* gain of code in Q16 */ move16(); return index; @@ -3292,11 +3179,7 @@ void gain_enc_amr_wb_fx( L_tmp = L_mac( L_tmp, coeff[3], g_code ); /* 15 - coeff_exp + 13 - 1 */ L_tmp = L_mac( L_tmp, coeff[4], g_pit_cod ); /* 15 - coeff_exp + 13 - 1 */ -#ifdef BASOP_NOGLOB L_tmp1 = L_sub_o( L_tmp, dist_min, &Overflow ); -#else /* BASOP_NOGLOB */ - L_tmp1 = L_sub( L_tmp, dist_min ); -#endif /* BASOP_NOGLOB */ /* splitting the if cost half the complexity of using IF macro */ if ( L_tmp1 < 0 ) { @@ -3319,11 +3202,7 @@ void gain_enc_amr_wb_fx( move16(); L_tmp = L_mult( g_code, gcode0 ); /* Q11*Q0 -> Q12 */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( L_tmp, add( exp_gcode0, 4 ), &Overflow ); /* Q12 -> Q16 */ -#else /* BASOP_NOGLOB */ - L_tmp = L_shl( L_tmp, add( exp_gcode0, 4 ) ); /* Q12 -> Q16 */ -#endif *gain_code = L_tmp; /* gain of code in Q16 */ move16(); diff --git a/lib_enc/gaus_enc_fx.c b/lib_enc/gaus_enc_fx.c index 1f91a5d95..dcedd5415 100644 --- a/lib_enc/gaus_enc_fx.c +++ b/lib_enc/gaus_enc_fx.c @@ -102,11 +102,7 @@ Word16 gaus_encode_fx( /*----------------------------------------------------------------* * Total excitation for Unvoiced coders *----------------------------------------------------------------*/ -#ifdef BASOP_NOGLOB gcode = round_fx_o( L_shl_o( *gain_code, Q_new, &Overflow ), &Overflow ); /* scaled gain_code with Qnew */ -#else /* BASOP_NOGLOB */ - gcode = round_fx( L_shl( *gain_code, Q_new ) ); /* scaled gain_code with Qnew */ -#endif /* BASOP_NOGLOB */ FOR( i = 0; i < L_SUBFR; i++ ) { exc[i + i_subfr] = round_fx( L_shl( L_mult( gcode, code[i] ), 15 - 9 ) ); /* Q_new */ @@ -120,14 +116,9 @@ Word16 gaus_encode_fx( Ltmp = L_shl( Ltmp, add( 5, shift ) ); /* Q_new + 15 + shift */ Ltmp = L_negate( Ltmp ); Ltmp = L_mac( Ltmp, xn[L_SUBFR - 1], 16384 ); /* Q_new + 15 + shift */ -#ifdef BASOP_NOGLOB Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); /* Q_new + 16 */ *mem_w0 = round_fx_sat( Ltmp ); /* Q_new */ move16(); -#else - Ltmp = L_shl( Ltmp, sub( 1, shift ) ); - *mem_w0 = round_fx( Ltmp ); -#endif init_gp_clip_fx( clip_gain ); /* reset pitch clipping parameters */ *gain_pit = 0; @@ -209,11 +200,7 @@ Word16 gaus_encode_ivas_fx( /*----------------------------------------------------------------* * Total excitation for Unvoiced coders *----------------------------------------------------------------*/ -#ifdef BASOP_NOGLOB gcode = round_fx_o( L_shl_o( *gain_code, Q_new, &Overflow ), &Overflow ); /* scaled gain_code with Qnew */ -#else /* BASOP_NOGLOB */ - gcode = round_fx( L_shl( *gain_code, Q_new ) ); /* scaled gain_code with Qnew */ -#endif /* BASOP_NOGLOB */ FOR( i = 0; i < L_SUBFR; i++ ) { exc[i + i_subfr] = round_fx( L_shl( L_mult( gcode, code[i] ), 15 - 9 ) ); /* Q_new */ @@ -227,14 +214,9 @@ Word16 gaus_encode_ivas_fx( Ltmp = L_shl( Ltmp, add( 5, shift ) ); /* Q_new + 15 + shift */ Ltmp = L_negate( Ltmp ); Ltmp = L_mac( Ltmp, xn[L_SUBFR - 1], 16384 ); /* Q_new + 15 + shift */ -#ifdef BASOP_NOGLOB Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); /* Q_new + 16 */ *mem_w0 = round_fx_sat( Ltmp ); /* Q_new */ move16(); -#else - Ltmp = L_shl( Ltmp, sub( 1, shift ) ); - *mem_w0 = round_fx( Ltmp ); -#endif init_gp_clip_fx( clip_gain ); /* reset pitch clipping parameters */ *gain_pit = 0; @@ -327,13 +309,8 @@ void gauss2v_fx( { /* fc0 += xn[i]*xn[i] */ /* fc1 += xn[i]*xn[i-1] */ -#ifdef BASOP_NOGLOB Lc0 = L_mac_sat( Lc0, xn[i], xn[i] ); /* Q25 */ Lc1 = L_mac_sat( Lc1, xn[i], xn[i - 1] ); /* Q25 */ -#else - Lc0 = L_mac( Lc0, xn[i], xn[i] ); - Lc1 = L_mac( Lc1, xn[i], xn[i - 1] ); -#endif } /* fgxx = fc1/fc0 */ exp_num = sub( norm_l( Lc1 ), 1 ); @@ -386,11 +363,7 @@ void gauss2v_fx( exp_den = norm_l( Lden ); Den = extract_h( L_shl( Lden, exp_den ) ); -#ifdef BASOP_NOGLOB delta = shr_o( div_s( Num, Den ), sub( exp_num, exp_den ), &Overflow ); /* Q15 */ -#else /* BASOP_NOGLOB */ - delta = shr( div_s( Num, Den ), sub( exp_num, exp_den ) ); /* Q15 */ -#endif delta = i_mult2( delta, m_sign ); /* Apply sign Q0*/ /* index_delta = (short)(FAC_DELTA * fdelta) */ index_delta = shr( delta, SFAC_DELTA ); @@ -553,13 +526,8 @@ void gauss2v_fx( cor2_norm = norm_l( cor2 ); eneri_norm = norm_l( eneri ); -#ifdef BASOP_NOGLOB cor2_mantissa = round_fx_o( L_shl_o( cor2, cor2_norm, &Overflow ), &Overflow ); eneri_mantissa = round_fx_o( L_shl_o( eneri, eneri_norm, &Overflow ), &Overflow ); -#else - cor2_mantissa = round_fx( L_shl( cor2, cor2_norm ) ); - eneri_mantissa = round_fx( L_shl( eneri, eneri_norm ) ); -#endif difference_norm = sub( add( cor2_norm, enerw_norm ), add( cor2w_norm, eneri_norm ) ); update_best = 0; @@ -710,29 +678,17 @@ void gauss2v_fx( exp_num = sub( norm_s( enerw ), 1 ); exp_den = norm_l( ener1 ); Num = shl( enerw, exp_num ); -#ifdef BASOP_NOGLOB Den = round_fx_sat( L_shl_sat( ener1, exp_den ) ); -#else - Den = round_fx( L_shl( ener1, exp_den ) ); -#endif GainPortion2 = L_deposit_l( 0 ); /* Unexpected division by zero. Eliminate this gain contribution */ IF( Den != 0 ) /* Protection against division by zero */ { div_result = div_s( Num, Den ); /* Q15 */ /* Re-scale to compensate for normalization*/ -#ifdef BASOP_NOGLOB GainPortion2 = L_shr_sat( L_deposit_l( div_result ), sub( exp_num, exp_den ) ); -#else - GainPortion2 = L_shr( L_deposit_l( div_result ), sub( exp_num, exp_den ) ); -#endif } -#ifdef BASOP_NOGLOB ener_sqrt = Isqrt( L_shl_sat( GainPortion2, 1 ) ); /* Make value a Q16 prior to division (align on power of 4) */ -#else - ener_sqrt = Isqrt( L_shl( GainPortion2, 1 ) ); /* Make value a Q16 prior to division (align on power of 4) */ -#endif ener_sqrt = L_shr( ener_sqrt, 8 ); /* Left-shift Q23 result to make a Q15 result */ Portion = Mult_32_16( GainPortion1, 19661 ); /* Performs GainPortion1*.6 */ @@ -740,11 +696,7 @@ void gauss2v_fx( /* Gain must be output in a 32-bit variable as a Q16 */ /* Compensate for Q_new */ -#ifdef BASOP_NOGLOB *gain = L_shl_o( Portion, sub( 13, Q_new ), &Overflow ); /* Q16 */ -#else - *gain = L_shl( Portion, sub( 13, Q_new ) ); -#endif move32(); return; @@ -818,13 +770,8 @@ void gauss2v_ivas_fx( { /* fc0 += xn[i]*xn[i] */ /* fc1 += xn[i]*xn[i-1] */ -#ifdef BASOP_NOGLOB Lc0 = L_mac_sat( Lc0, xn[i], xn[i] ); Lc1 = L_mac_sat( Lc1, xn[i], xn[i - 1] ); -#else - Lc0 = L_mac( Lc0, xn[i], xn[i] ); - Lc1 = L_mac( Lc1, xn[i], xn[i - 1] ); -#endif } /* fgxx = fc1/fc0 */ exp_num = sub( norm_l( Lc1 ), 1 ); @@ -877,11 +824,7 @@ void gauss2v_ivas_fx( exp_den = norm_l( Lden ); Den = extract_h( L_shl( Lden, exp_den ) ); -#ifdef BASOP_NOGLOB delta = shr_o( div_s( Num, Den ), sub( exp_num, exp_den ), &Overflow ); /* Q15 */ -#else /* BASOP_NOGLOB */ - delta = shr( div_s( Num, Den ), sub( exp_num, exp_den ) ); /* Q15 */ -#endif delta = i_mult2( delta, m_sign ); /* Apply sign */ /* index_delta = (short)(FAC_DELTA * fdelta) */ index_delta = shr( delta, SFAC_DELTA ); @@ -1045,13 +988,8 @@ void gauss2v_ivas_fx( cor2_norm = norm_l( cor2 ); eneri_norm = norm_l( eneri ); -#ifdef BASOP_NOGLOB cor2_mantissa = round_fx_o( L_shl_o( cor2, cor2_norm, &Overflow ), &Overflow ); eneri_mantissa = round_fx_o( L_shl_o( eneri, eneri_norm, &Overflow ), &Overflow ); -#else - cor2_mantissa = round_fx( L_shl( cor2, cor2_norm ) ); - eneri_mantissa = round_fx( L_shl( eneri, eneri_norm ) ); -#endif difference_norm = sub( add( cor2_norm, enerw_norm ), add( cor2w_norm, eneri_norm ) ); update_best = 0; @@ -1202,29 +1140,17 @@ void gauss2v_ivas_fx( exp_num = sub( norm_s( enerw ), 1 ); exp_den = norm_l( ener1 ); Num = shl( enerw, exp_num ); -#ifdef BASOP_NOGLOB Den = round_fx_sat( L_shl_sat( ener1, exp_den ) ); -#else - Den = round_fx( L_shl( ener1, exp_den ) ); -#endif GainPortion2 = L_deposit_l( 0 ); /* Unexpected division by zero. Eliminate this gain contribution */ IF( Den != 0 ) /* Protection against division by zero */ { div_result = div_s( Num, Den ); /* Q15 */ /* Re-scale to compensate for normalization*/ -#ifdef BASOP_NOGLOB GainPortion2 = L_shr_sat( L_deposit_l( div_result ), sub( exp_num, exp_den ) ); -#else - GainPortion2 = L_shr( L_deposit_l( div_result ), sub( exp_num, exp_den ) ); -#endif } -#ifdef BASOP_NOGLOB ener_sqrt = Isqrt( L_shl_sat( GainPortion2, 1 ) ); /* Make value a Q16 prior to division (align on power of 4) */ -#else - ener_sqrt = Isqrt( L_shl( GainPortion2, 1 ) ); /* Make value a Q16 prior to division (align on power of 4) */ -#endif ener_sqrt = L_shr( ener_sqrt, 8 ); /* Left-shift Q23 result to make a Q15 result */ Portion = Mult_32_16( GainPortion1, 19661 ); /* Performs GainPortion1*.6 */ @@ -1232,11 +1158,7 @@ void gauss2v_ivas_fx( /* Gain must be output in a 32-bit variable as a Q16 */ /* Compensate for Q_new */ -#ifdef BASOP_NOGLOB *gain = L_shl_o( Portion, sub( 13, Q_new ), &Overflow ); -#else - *gain = L_shl( Portion, sub( 13, Q_new ) ); -#endif move32(); return; diff --git a/lib_enc/gp_clip_fx.c b/lib_enc/gp_clip_fx.c index 4ca86a09c..b4845a1a4 100644 --- a/lib_enc/gp_clip_fx.c +++ b/lib_enc/gp_clip_fx.c @@ -142,18 +142,10 @@ Word16 gp_clip_fx( } } -#ifdef BASOP_NOGLOB ener = L_mac_o( 1L, xn[0], xn[0], &Overflow ); -#else - ener = L_mac( 1L, xn[0], xn[0] ); -#endif FOR( i = 1; i < L_SUBFR; i++ ) { -#ifdef BASOP_NOGLOB ener = L_mac_o( ener, xn[i], xn[i], &Overflow ); -#else /* BASOP_NOGLOB */ - ener = L_mac( ener, xn[i], xn[i] ); -#endif } /* ener = 10.0f*(float)log10(ener) */ @@ -363,11 +355,7 @@ Word16 Mode2_gp_clip_fx( FOR( i = 0; i < L_subfr; i++ ) { -#ifdef BASOP_NOGLOB wener = L_mac0_o( wener, xn[i], xn[i], &Overflow ); -#else - wener = L_mac0( wener, xn[i], xn[i] ); -#endif } /*wener = 10.0f*(float)log10(wener);*/ diff --git a/lib_enc/gs_enc_fx.c b/lib_enc/gs_enc_fx.c index bc2e2a091..357e88410 100644 --- a/lib_enc/gs_enc_fx.c +++ b/lib_enc/gs_enc_fx.c @@ -1328,11 +1328,7 @@ static Word16 edyn_fx( /* o : ratio of max to mean */ { L_tmp = L_mult0( vec[j], vec[j] ); /*2*Qnew*/ ener_max = L_max( ener_max, L_tmp ); -#ifdef BASOP_NOGLOB ener_mean = L_add_o( ener_mean, L_tmp, &Overflow ); -#else /* BASOP_NOGLOB */ - ener_mean = L_add( ener_mean, L_tmp ); -#endif /* BASOP_NOGLOB */ } /*dyn = 10.0f * (ener_max / ener_mean);*/ ener_mean = Mult_32_16( ener_mean, div_s( 1, lvec ) ); /*2*Qnew*/ @@ -1340,11 +1336,7 @@ static Word16 edyn_fx( /* o : ratio of max to mean */ IF( ener_mean > 0 ) { exp1 = norm_l( ener_mean ); -#ifdef BASOP_NOGLOB tmp1 = round_fx_o( L_shl( ener_mean, exp1 ), &Overflow ); -#else /* BASOP_NOGLOB */ - tmp1 = round_fx( L_shl( ener_mean, exp1 ) ); -#endif exp1 = sub( 30, exp1 ); exp2 = norm_l( ener_max ); diff --git a/lib_enc/guided_plc_enc_fx.c b/lib_enc/guided_plc_enc_fx.c index 6470e0a3c..9aa2ecb65 100644 --- a/lib_enc/guided_plc_enc_fx.c +++ b/lib_enc/guided_plc_enc_fx.c @@ -161,11 +161,7 @@ static void coderLookAheadInnovation( ps_e = add( alp_e, ps_e ); BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB max_ps_tmp = L_shl_o( max_ps, sub( max_ps_e, ps_e ), &Overflow ); -#else /* BASOP_NOGLOB */ - max_ps_tmp = L_shl( max_ps, sub( max_ps_e, ps_e ) ); -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS @@ -452,21 +448,13 @@ void updateSpecPowDiffuseIdx_fx( FOR( k = 1; k < 4; k++ ) { -#ifdef BASOP_NOGLOB st->mean_gc[1] = L_add_o( st->mean_gc[1], st->gain_code[k], &Overflow ); -#else /* BASOP_NOGLOB */ - st->mean_gc[1] = L_add( st->mean_gc[1], st->gain_code[k] ); -#endif min_gp = s_min( min_gp, st->bpf_gainT[k] ); } /* Suppress saturation warning in threshold comparison. */ test(); -#ifdef BASOP_NOGLOB if ( LT_32( st->mean_gc[1], L_add_o( st->mean_gc[0], Mpy_32_16_r( st->mean_gc[0], 3211 /*0.098 Q15*/ ), &Overflow ) ) || GT_16( min_gp, 13435 /*0.82 Q14*/ ) ) -#else - if ( LT_32( st->mean_gc[1], L_add( st->mean_gc[0], Mpy_32_16_r( st->mean_gc[0], 3211 /*0.098 Q15*/ ) ) ) || GT_16( min_gp, 13435 /*0.82 Q14*/ ) ) -#endif { move16(); st->glr_idx[0] = 0; diff --git a/lib_enc/hf_cod_amrwb_fx.c b/lib_enc/hf_cod_amrwb_fx.c index 7c2060fa8..7afcc3528 100644 --- a/lib_enc/hf_cod_amrwb_fx.c +++ b/lib_enc/hf_cod_amrwb_fx.c @@ -110,11 +110,7 @@ void hf_cod_fx( scale_fx = div_s( shl( 1, 14 ), ener_exc_fx ); /*Q(29-q1) */ L_tmp = L_mult( ener_hf_fx, scale_fx ); /*30-q1+q2 */ q2 = sub( q1, q2 ); /*30-q2 */ -#ifdef BASOP_NOGLOB scale_fx = round_fx( Isqrt( L_shl_o( L_tmp, sub( q2, 26 ), &Overflow ) ) ); /*Q13 */ -#else /* BASOP_NOGLOB */ - scale_fx = round_fx( Isqrt( L_shl( L_tmp, sub( q2, 26 ) ) ) ); /*Q13 */ -#endif /* BASOP_NOGLOB */ pt1 = HF_fx; @@ -190,11 +186,7 @@ void hf_cod_fx( HF_calc_gain_fx = div_s( shl( 1, 14 ), ener_input_fx ); /*Q(29-q1) */ L_tmp = L_mult( ener_hf_fx, HF_calc_gain_fx ); /*30-q1+q2 */ q2 = sub( q1, q2 ); /*30-q2 */ -#ifdef BASOP_NOGLOB HF_calc_gain_fx = round_fx_o( Isqrt( L_shl_sat( L_tmp, sub( q2, 20 ) ) ), &Overflow ); /*Q10 */ -#else /* BASOP_NOGLOB */ - HF_calc_gain_fx = round_fx( Isqrt( L_shl( L_tmp, sub( q2, 20 ) ) ) ); /*Q10 */ -#endif /* set energy of HF synthesis to energy of original HF: diff --git a/lib_enc/hq_classifier_enc_fx.c b/lib_enc/hq_classifier_enc_fx.c index 0259ef9ff..53ad3dbb2 100644 --- a/lib_enc/hq_classifier_enc_fx.c +++ b/lib_enc/hq_classifier_enc_fx.c @@ -847,13 +847,8 @@ void hvq_classifier_ivas_fx( L_pe = L_add( L_pe, L_tmp ); /*Q12 */ } -#ifdef BASOP_NOGLOB L_nf_mean[i] = L_add_sat( L_nf_mean[i], L_nf ); /*Q12 */ L_pe_mean[i] = L_add_sat( L_pe_mean[i], L_pe ); /*Q12 */ -#else - L_nf_mean[i] = L_add( L_nf_mean[i], L_nf ); - L_pe_mean[i] = L_add( L_pe_mean[i], L_pe ); -#endif move32(); move32(); IF( GT_32( L_d, L_peak ) ) @@ -903,11 +898,7 @@ void hvq_classifier_ivas_fx( sharp[i] = extract_h( L_shl( L_tmp, shift ) ); /* 30-s+s-8-16 -> Q6 */ move16(); /*sharp_dist += (sharp[i]-HVQ_SHARP_THRES); */ -#ifdef BASOP_NOGLOB sharp_dist = add_o( sharp_dist, sub( sharp[i], HVQ_SHARP_THRES_FX ), &Overflow ); /* Q6 */ -#else - sharp_dist = add( sharp_dist, sub( sharp[i], HVQ_SHARP_THRES_FX ) ); -#endif if ( GT_16( sharp[i], HVQ_SHARP_THRES_FX ) ) { num_sharp_bands = add( num_sharp_bands, 1 ); @@ -1290,15 +1281,10 @@ void hvq_classifier_fx( L_pe = L_add( L_pe, L_tmp ); /*Q12 */ } -#ifdef BASOP_NOGLOB L_nf_mean[i] = L_add_sat( L_nf_mean[i], L_nf ); /*Q12 */ L_pe_mean[i] = L_add_sat( L_pe_mean[i], L_pe ); /*Q12 */ move32(); move32(); -#else - L_nf_mean[i] = L_add( L_nf_mean[i], L_nf ); - L_pe_mean[i] = L_add( L_pe_mean[i], L_pe ); -#endif IF( GT_32( L_d, L_peak ) ) { L_peak = L_add( L_d, 0 ); @@ -1348,11 +1334,7 @@ void hvq_classifier_fx( move16(); /*sharp_dist += (sharp[i]-HVQ_SHARP_THRES); */ -#ifdef BASOP_NOGLOB sharp_dist = add_o( sharp_dist, sub( sharp[i], HVQ_SHARP_THRES_FX ), &Overflow ); -#else - sharp_dist = add( sharp_dist, sub( sharp[i], HVQ_SHARP_THRES_FX ) ); -#endif IF( GT_16( sharp[i], HVQ_SHARP_THRES_FX ) ) { num_sharp_bands = add( num_sharp_bands, 1 ); diff --git a/lib_enc/hq_lr_enc_fx.c b/lib_enc/hq_lr_enc_fx.c index 3e70bc42e..7d496f2a1 100644 --- a/lib_enc/hq_lr_enc_fx.c +++ b/lib_enc/hq_lr_enc_fx.c @@ -455,11 +455,7 @@ void hq_lr_enc_fx( frac1 = L_Extract_lc( L_tmp, &exp ); /* Extract exponent of L_tmp */ L_tmp = Pow2( 30, frac1 ); exp = sub( exp, 30 ); -#ifdef BASOP_NOGLOB Ep_fx[i] = L_shl_sat( L_tmp, s_max( sub( exp, 6 ), -31 ) ); /* Q -6 */ -#else - Ep_fx[i] = L_shl( L_tmp, s_max( sub( exp, 6 ), -31 ) ); /* Q -6 */ -#endif } FOR( i = 0; i < bands_fx; i++ ) @@ -528,22 +524,13 @@ void hq_lr_enc_fx( { IF( GE_16( i, lowband ) ) { -#ifdef BASOP_NOGLOB Ep_vari_fx = L_add_sat( Ep_vari_fx, L_abs( L_sub( Ep_tmp_fx[i], Ep_tmp_fx[sub( i, 1 )] ) ) ); /*Q15 */ Ep_avrg_fx = L_add_sat( Ep_avrg_fx, Ep_tmp_fx[i] ); /*Q15 */ move32(); -#else - Ep_vari_fx = L_add( Ep_vari_fx, L_abs( L_sub( Ep_tmp_fx[i], Ep_tmp_fx[sub( i, 1 )] ) ) ); /*Q15 */ - Ep_avrg_fx = L_add( Ep_avrg_fx, Ep_tmp_fx[i] ); /*Q15 */ -#endif } ELSE { -#ifdef BASOP_NOGLOB Ep_avrgL_fx = L_add_sat( Ep_avrgL_fx, Ep_tmp_fx[i] ); /*Q15 */ -#else - Ep_avrgL_fx = L_add( Ep_avrgL_fx, Ep_tmp_fx[i] ); /*Q15 */ -#endif IF( GT_32( Ep_tmp_fx[i], Ep_peak_fx ) ) { Ep_peak_fx = L_add( Ep_tmp_fx[i], 0 ); /*Q15 */ @@ -621,11 +608,7 @@ void hq_lr_enc_fx( move16(); } L_tmp = Mult_32_16( Ep_vari_fx, 3277 ); /*13+15-15=13 */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( Mult_32_16( L_tmp, tmp ), sub( 12, exp ), &Overflow ); /*Q(13+exp-15 +12-exp +4 = 14) */ -#else - L_tmp = L_shl( Mult_32_16( L_tmp, tmp ), sub( 12, exp ) ); /*Q(13+exp-15 +12-exp +4 = 14) */ -#endif tmp2 = extract_h( Ep_avrg_fx ); /*Q13-16=-3 */ IF( tmp2 != 0 ) { @@ -642,11 +625,7 @@ void hq_lr_enc_fx( move16(); } L_tmp2 = Mult_32_16( Ep_vari_fx, 6554 ); /*13+15-15=13 */ -#ifdef BASOP_NOGLOB L_tmp2 = L_shl_o( Mult_32_16( L_tmp2, tmp2 ), sub( 13, exp ), &Overflow ); /*Q(13+exp-15 +13-exp +3 = 14) */ -#else - L_tmp2 = L_shl( Mult_32_16( L_tmp2, tmp2 ), sub( 13, exp ) ); /*Q(13+exp-15 +13-exp +3 = 14) */ -#endif L_tmp = L_min( L_tmp, L_tmp2 ); /*Q14 */ tmp = extract_l( L_min( L_tmp, 13107 ) ); /*Q14 */ alpha_fx = add( 16384, tmp ); @@ -654,11 +633,7 @@ void hq_lr_enc_fx( IF( EQ_16( hHQ_core->last_bitalloc_max_band[j++], 1 ) ) { L_tmp = Mult_32_16( Ep_tmp_fx[i], sub( bands_fx, lowband ) ); /*Q(13+0-15 = -2) */ -#ifdef BASOP_NOGLOB tmp = extract_h( L_shl_sat( L_tmp, 14 ) ); /*Q-4 */ -#else - tmp = extract_h( L_shl( L_tmp, 14 ) ); /*Q-2 */ -#endif IF( tmp != 0 ) { exp = norm_s( tmp ); @@ -673,11 +648,7 @@ void hq_lr_enc_fx( exp = 0; move16(); } -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( Mult_32_16( Ep_avrg_fx, tmp ), sub( 14, exp ), &Overflow ); /*Q(13+exp-15 +14-exp+2 = 14) */ -#else - L_tmp = L_shl( Mult_32_16( Ep_avrg_fx, tmp ), sub( 14, exp ) ); /*Q(13+exp-15 +14-exp+2 = 14) */ -#endif L_tmp = L_max( L_tmp, 16384 ); /*Q14 */ tmp = extract_l( L_min( L_tmp, beta_fx ) ); /*Q14 */ alpha_fx = shl( mult( alpha_fx, tmp ), 1 ); /*14+14-15 +1=Q14 */ @@ -700,11 +671,7 @@ void hq_lr_enc_fx( exp = 0; move16(); } -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( Mult_32_16( Ep_tmp_fx[i], tmp2 ), sub( 19, exp ), &Overflow ); /*Q(13+exp-15 +19-exp +3 = 20) */ -#else - L_tmp = L_shl( Mult_32_16( Ep_tmp_fx[i], tmp2 ), sub( 19, exp ) ); /*Q(13+exp-15 +19-exp +3 = 20) */ -#endif L_tmp = Mult_32_16( L_tmp, shl( sub( bands_fx, lowband ), 9 ) ); /*20 +9 -15 =Q14 */ L_tmp = L_max( L_tmp, 13926 ); /*Q14 */ tmp2 = extract_l( L_min( L_tmp, 16384 ) ); /*Q14 */ @@ -723,19 +690,11 @@ void hq_lr_enc_fx( { IF( GE_16( i, lowband ) ) { -#ifdef BASOP_NOGLOB Ep_avrg_fx = L_add_sat( Ep_avrg_fx, Ep_tmp_fx[i] ); /*Q15 */ -#else - Ep_avrg_fx = L_add( Ep_avrg_fx, Ep_tmp_fx[i] ); /*Q15 */ -#endif } ELSE { -#ifdef BASOP_NOGLOB Ep_avrgL_fx = L_add_sat( Ep_avrgL_fx, L_shr( Ep_tmp_fx[i], 1 ) ); /*Q12 */ -#else - Ep_avrgL_fx = L_add( Ep_avrgL_fx, L_shr( Ep_tmp_fx[i], 1 ) ); /*Q12 */ -#endif IF( GT_32( Ep_tmp_fx[i], Ep_peak_fx ) ) { Ep_peak_fx = L_add( Ep_tmp_fx[i], 0 ); /*Q13 */ @@ -791,12 +750,8 @@ void hq_lr_enc_fx( bit_budget_fx = sub( bit_budget_fx, 2 ); /* bits in high bands to indicate the last 2 subbands is allocated bits or not Q0*/ FOR( i = 0; i < bands_fx; i++ ) { -#ifdef BASOP_NOGLOB Ep_tmp_fx[i] = L_shl_o( Ep_tmp_fx[i], 2, &Overflow ); /* Q15 */ move32(); -#else /* BASOP_NOGLOB */ - Ep_tmp_fx[i] = L_shl( Ep_tmp_fx[i], 2 ); -#endif /* BASOP_NOGLOB */ } IF( EQ_32( st_fx->core_brate, ACELP_13k20 ) ) { @@ -826,33 +781,17 @@ void hq_lr_enc_fx( test(); IF( GE_16( i, lowband ) && add( sub( i, bands_fx ), p2a_bands_fx ) < 0 ) { -#ifdef BASOP_NOGLOB Ep_vari_fx = L_add_sat( Ep_vari_fx, L_abs( L_sub_sat( Ep_tmp_fx[i], Ep_tmp_fx[( i - 1 )] ) ) ); /*Q15 */ -#else - Ep_vari_fx = L_add( Ep_vari_fx, L_abs( L_sub( Ep_tmp_fx[i], Ep_tmp_fx[sub( i, 1 )] ) ) ); /*Q15 */ -#endif -#ifdef BASOP_NOGLOB Ep_avrg_fx = L_add_o( Ep_avrg_fx, Ep_tmp_fx[i], &Overflow ); /*Q15 */ -#else /* BASOP_NOGLOB */ - Ep_avrg_fx = L_add( Ep_avrg_fx, Ep_tmp_fx[i] ); /*Q15 */ -#endif /* BASOP_NOGLOB */ } IF( GE_16( i, highband ) ) { -#ifdef BASOP_NOGLOB enerH_fx = L_add_sat( enerH_fx, L_shl_sat( Ep_fx[i], 2 ) ); /*Q0 */ -#else - enerH_fx = L_add( enerH_fx, L_shl( Ep_fx[i], 2 ) ); /*Q0 */ -#endif } ELSE IF( GE_16( i, lowband ) ) { -#ifdef BASOP_NOGLOB enerL_fx = L_add_sat( enerL_fx, L_shl_sat( Ep_fx[i], 2 ) ); /*Q0 */ -#else - enerL_fx = L_add( enerL_fx, L_shl( Ep_fx[i], 2 ) ); /*Q0 */ -#endif } } @@ -873,11 +812,7 @@ void hq_lr_enc_fx( tmp = sub( bands_fx, p2a_bands_fx ); tmp = sub( tmp, lowband ); /*Q0 */ -#ifdef BASOP_NOGLOB tmp1 = extract_h( L_shl_sat( Ep_avrg_fx, 1 ) ); /*Q0 */ -#else - tmp1 = extract_h( L_shl( Ep_avrg_fx, 1 ) ); /*Q0 */ -#endif IF( tmp1 != 0 ) { exp = norm_s( tmp1 ); @@ -916,11 +851,7 @@ void hq_lr_enc_fx( { tmp = sub( tmp, lowband ); L_tmp = Mult_32_16( Ep_tmp_fx[i], tmp ); /*Q(15+0-15 = 0) */ -#ifdef BASOP_NOGLOB tmp = extract_h( L_shl_o( L_tmp, 16, &Overflow ) ); /*Q0 */ -#else /* BASOP_NOGLOB */ - tmp = extract_h( L_shl( L_tmp, 16 ) ); /*Q0 */ -#endif /* BASOP_NOGLOB */ IF( tmp != 0 ) { exp = norm_s( tmp ); @@ -945,11 +876,7 @@ void hq_lr_enc_fx( { tmp = sub( tmp, lowband ); -#ifdef BASOP_NOGLOB tmp1 = extract_h( L_shl_sat( Ep_avrg_fx, 1 ) ); /*Q0 */ -#else - tmp1 = extract_h( L_shl( Ep_avrg_fx, 1 ) ); /*Q0 */ -#endif IF( tmp1 != 0 ) { exp = norm_s( tmp1 ); @@ -985,19 +912,11 @@ void hq_lr_enc_fx( { IF( GE_16( i, lowband ) ) { -#ifdef BASOP_NOGLOB Ep_avrg_fx = L_add_o( Ep_avrg_fx, Ep_tmp_fx[i], &Overflow ); /*Q15 */ -#else /* BASOP_NOGLOB */ - Ep_avrg_fx = L_add( Ep_avrg_fx, Ep_tmp_fx[i] ); /*Q15 */ -#endif /* BASOP_NOGLOB */ } ELSE { -#ifdef BASOP_NOGLOB Ep_avrgL_fx = L_add_o( Ep_avrgL_fx, Ep_tmp_fx[i], &Overflow ); /*Q15 */ -#else /* BASOP_NOGLOB */ - Ep_avrgL_fx = L_add( Ep_avrgL_fx, Ep_tmp_fx[i] ); /*Q15 */ -#endif IF( GT_32( Ep_tmp_fx[i], Ep_peak_fx ) ) { Ep_peak_fx = L_add( Ep_tmp_fx[i], 0 ); /*Q15 */ @@ -1021,11 +940,7 @@ void hq_lr_enc_fx( move16(); FOR( i = 0; i < lowband; i++ ) { -#ifdef BASOP_NOGLOB tmp = extract_h( L_shl_sat( Ep_avrgL_fx, 1 ) ); /*Q0 */ -#else - tmp = extract_h( L_shl( Ep_avrgL_fx, 1 ) ); /*Q0 */ -#endif IF( tmp != 0 ) { exp = norm_s( tmp ); @@ -1265,10 +1180,8 @@ void hq_lr_enc_ivas_fx( Word32 L_band_energy_tmp[BANDS_MAX]; UWord16 lo; Word16 Q_band_energy; -#ifdef BASOP_NOGLOB Flag Overflow; move32(); -#endif /* BASOP_NOGLOB */ BSTR_ENC_HANDLE hBstr = st->hBstr; HQ_ENC_HANDLE hHQ_core = st->hHQ_core; @@ -1536,11 +1449,7 @@ void hq_lr_enc_ivas_fx( } ELSE { -#ifdef BASOP_NOGLOB Ep_avrgL_fx = L_add_o( Ep_avrgL_fx, Ep_tmp_fx[i], &Overflow ); /*Q15 */ -#else - Ep_avrgL_fx = L_add( Ep_avrgL_fx, Ep_tmp_fx[i] ); /*Q15 */ -#endif IF( L_sub( Ep_tmp_fx[i], Ep_peak_fx ) > 0 ) { Ep_peak_fx = Ep_tmp_fx[i]; /*Q15 */ @@ -1664,17 +1573,10 @@ void hq_lr_enc_ivas_fx( move16(); } Mpy_32_16_ss( Ep_avrg_fx, tmp, &L_tmp, &lo ); -#ifndef BASOP_NOGLOB - L_tmp = L_shl( L_tmp, sub( 14, exp ) ); /*Q(13+exp-15 +14-exp+2 = 14) */ - L_tmp = L_max( L_tmp, 16384 ); /*14 */ - tmp = extract_l( L_min( L_tmp, beta_fx ) ); /*14 */ - alpha_fx = shl( mult( alpha_fx, tmp ), 1 ); /*14+14-15 +1=14 */ -#else /* BASOP_NOGLOB */ L_tmp = L_shl_o( L_tmp, sub( 14, exp ), &Overflow ); /*Q(13+exp-15 +14-exp+2 = 14) */ L_tmp = L_max( L_tmp, 16384 ); /*14 */ tmp = extract_l( L_min( L_tmp, beta_fx ) ); /*14 */ alpha_fx = shl( mult( alpha_fx, tmp ), 1 ); /*14+14-15 +1=14 */ -#endif /* BASOP_NOGLOB */ } ELSE { @@ -1718,11 +1620,7 @@ void hq_lr_enc_ivas_fx( { IF( sub( i, lowband ) >= 0 ) { -#ifdef BASOP_NOGLOB Ep_avrg_fx = L_add_o( Ep_avrg_fx, Ep_tmp_fx[i], &Overflow ); /*Q15 */ -#else - Ep_avrg_fx = L_add( Ep_avrg_fx, Ep_tmp_fx[i] ); /*Q15 */ -#endif } ELSE { @@ -1764,13 +1662,8 @@ void hq_lr_enc_ivas_fx( Mpy_32_16_ss( Ep_peak_fx, tmp, &L_tmp, &lo ); Mpy_32_16_ss( L_tmp, lowband, &L_tmp, &lo ); Mpy_32_16_ss( L_tmp, 18842, &L_tmp, &lo ); -#ifndef BASOP_NOGLOB - L_tmp = L_shl( L_tmp, sub( 27, exp ) ); /*Q14 0.5 */ - tmp2 = extract_l( L_min( L_tmp, 19661 ) ); /*14 */ -#else /* BASOP_NOGLOB */ L_tmp = L_shl_o( L_tmp, sub( 27, exp ), &Overflow ); /*Q14 0.5 */ tmp2 = extract_l( L_min( L_tmp, 19661 ) ); /*14 */ -#endif /* BASOP_NOGLOB */ Mpy_32_16_ss( L_band_energy_tmp[i], tmp2, &L_tmp, &lo ); L_band_energy_tmp[i] = L_shl( L_tmp, 1 ); /*Q_band_energy */ move32(); @@ -1793,12 +1686,8 @@ void hq_lr_enc_ivas_fx( bit_budget = sub( bit_budget, 2 ); /* bits in high bands to indicate the last 2 subbands is allocated bits or not */ FOR( i = 0; i < bands; i++ ) { -#ifndef BASOP_NOGLOB - Ep_tmp_fx[i] = L_shl( Ep_tmp_fx[i], 2 ); -#else /* BASOP_NOGLOB */ Ep_tmp_fx[i] = L_shl_o( Ep_tmp_fx[i], 2, &Overflow ); /* Q15 */ move32(); -#endif /* BASOP_NOGLOB */ } IF( EQ_32( st->core_brate, ACELP_13k20 ) ) { @@ -1833,11 +1722,7 @@ void hq_lr_enc_ivas_fx( IF( sub( i, lowband ) >= 0 && add( sub( i, bands ), p2a_bands ) < 0 ) { Ep_vari_fx = L_add( Ep_vari_fx, L_abs( L_sub( Ep_tmp_fx[i], Ep_tmp_fx[sub( i, 1 )] ) ) ); /*Q15 */ -#ifndef BASOP_NOGLOB - Ep_avrg_fx = L_add( Ep_avrg_fx, Ep_tmp_fx[i] ); /*Q15 */ -#else /* BASOP_NOGLOB */ Ep_avrg_fx = L_add_o( Ep_avrg_fx, Ep_tmp_fx[i], &Overflow ); /*Q15 */ -#endif /* BASOP_NOGLOB */ } IF( sub( i, highband ) >= 0 ) @@ -1870,11 +1755,7 @@ void hq_lr_enc_ivas_fx( tmp = sub( bands, p2a_bands ); tmp = sub( tmp, lowband ); /*Q0 */ -#ifndef BASOP_NOGLOB - tmp1 = extract_h( L_shl( Ep_avrg_fx, 1 ) ); /*Q0 */ -#else tmp1 = extract_h( L_shl_o( Ep_avrg_fx, 1, &Overflow ) ); /*Q0 */ -#endif IF( tmp1 != 0 ) { exp = norm_s( tmp1 ); @@ -1913,11 +1794,7 @@ void hq_lr_enc_ivas_fx( { tmp = sub( tmp, lowband ); Mpy_32_16_ss( Ep_tmp_fx[i], tmp, &L_tmp, &lo ); -#ifndef BASOP_NOGLOB - tmp = extract_h( L_shl( L_tmp, 16 ) ); /*Q0 */ -#else /* BASOP_NOGLOB */ tmp = extract_h( L_shl_o( L_tmp, 16, &Overflow ) ); /*Q0 */ -#endif /* BASOP_NOGLOB */ IF( tmp != 0 ) { exp = norm_s( tmp ); @@ -1942,11 +1819,7 @@ void hq_lr_enc_ivas_fx( { tmp = sub( tmp, lowband ); -#ifndef BASOP_NOGLOB - tmp1 = extract_h( L_shl( Ep_avrg_fx, 1 ) ); /*Q0 */ -#else tmp1 = extract_h( L_shl_o( Ep_avrg_fx, 1, &Overflow ) ); /*Q0 */ -#endif IF( tmp1 != 0 ) { exp = norm_s( tmp1 ); @@ -1985,19 +1858,11 @@ void hq_lr_enc_ivas_fx( { IF( sub( i, lowband ) >= 0 ) { -#ifndef BASOP_NOGLOB - Ep_avrg_fx = L_add( Ep_avrg_fx, Ep_tmp_fx[i] ); /*Q15 */ -#else /* BASOP_NOGLOB */ Ep_avrg_fx = L_add_o( Ep_avrg_fx, Ep_tmp_fx[i], &Overflow ); /*Q15 */ -#endif /* BASOP_NOGLOB */ } ELSE { -#ifndef BASOP_NOGLOB - Ep_avrgL_fx = L_add( Ep_avrgL_fx, Ep_tmp_fx[i] ); /*Q15 */ -#else /* BASOP_NOGLOB */ Ep_avrgL_fx = L_add_o( Ep_avrgL_fx, Ep_tmp_fx[i], &Overflow ); /*Q15 */ -#endif /* BASOP_NOGLOB */ IF( L_sub( Ep_tmp_fx[i], Ep_peak_fx ) > 0 ) { Ep_peak_fx = Ep_tmp_fx[i]; /* Q15 */ @@ -2022,11 +1887,7 @@ void hq_lr_enc_ivas_fx( move16(); FOR( i = 0; i < lowband; i++ ) { -#ifndef BASOP_NOGLOB - tmp = extract_h( L_shl( Ep_avrgL_fx, 1 ) ); /*Q0 */ -#else tmp = extract_h( L_shl_o( Ep_avrgL_fx, 1, &Overflow ) ); /*Q0 */ -#endif IF( tmp != 0 ) { exp = norm_s( tmp ); @@ -3604,11 +3465,7 @@ static Word16 p2a_threshold_quant_fx( /* 10/( log(10)/log(2) ) = 3.01029995663981195211 24660(Q13) */ L_p2a = Mpy_32_16_1( L_tmp, 24660 ); /* 16+13-15 -> Q14 */ -#ifdef BASOP_NOGLOB p2a_fx = round_fx_o( L_shl_o( L_p2a, 13, &Overflow ), &Overflow ); /* 27 -16 -> 11 */ -#else - p2a_fx = round_fx( L_shl( L_p2a, 13 ) ); /* 27 -16 -> 11 */ -#endif } IF( LE_16( p2a_fx, p2a_th_fx ) ) @@ -3727,11 +3584,7 @@ static Word16 p2a_threshold_quant_ivas_fx( /* 10/( log(10)/log(2) ) = 3.01029995663981195211 24660(Q13) */ L_p2a = Mpy_32_16_1( L_tmp, 24660 ); /* 16+13-15 -> Q14 */ -#ifdef BASOP_NOGLOB p2a_fx = round_fx_o( L_shl_o( L_p2a, 13, &Overflow ), &Overflow ); /* 27 -16 -> 11 */ -#else - p2a_fx = round_fx( L_shl( L_p2a, 13 ) ); /* 27 -16 -> 11 */ -#endif } IF( LE_16( p2a_fx, p2a_th_fx ) ) @@ -3871,11 +3724,7 @@ static void mdct_spectrum_fine_gain_enc_fx( exp_normn = norm_l( L_Exy ); exp_normn = sub( exp_normn, 1 ); exp_normd = norm_l( L_Eyy ); -#ifdef BASOP_NOGLOB gamma_fx = div_l( L_shl_o( L_Exy, exp_normn, &Overflow ), round_fx_o( L_shl_o( L_Eyy, exp_normd, &Overflow ), &Overflow ) ); /* Qgamma */ -#else - gamma_fx = div_l( L_shl( L_Exy, exp_normn ), round_fx( L_shl( L_Eyy, exp_normd ) ) ); -#endif Qgamma = add( sub( exp_normn, exp_normd ), 15 ); /* exp_normn - (exp_normd-16) - 1; */ gamma_fx = shl( gamma_fx, sub( 14, Qgamma ) ); /* Qgamma -> Q14 */ @@ -4037,11 +3886,7 @@ static void mdct_spectrum_fine_gain_enc_ivas_fx( exp_normn = norm_l( L_Exy ); exp_normn = sub( exp_normn, 1 ); exp_normd = norm_l( L_Eyy ); -#ifdef BASOP_NOGLOB gamma_fx = div_l( L_shl_o( L_Exy, exp_normn, &Overflow ), round_fx_o( L_shl_o( L_Eyy, exp_normd, &Overflow ), &Overflow ) ); /* Qgamma */ -#else - gamma_fx = div_l( L_shl( L_Exy, exp_normn ), round_fx( L_shl( L_Eyy, exp_normd ) ) ); -#endif Qgamma = add( sub( exp_normn, exp_normd ), 15 ); /* exp_normn - (exp_normd-16) - 1; */ gamma_fx = shl( gamma_fx, sub( 14, Qgamma ) ); /* Qgamma -> Q14 */ diff --git a/lib_enc/hvq_enc_fx.c b/lib_enc/hvq_enc_fx.c index aae437c01..7a9514e07 100644 --- a/lib_enc/hvq_enc_fx.c +++ b/lib_enc/hvq_enc_fx.c @@ -119,11 +119,7 @@ Word16 hvq_enc_ivas_fx( /*o : Consumed bits nf_cnt = add( nf_cnt, 1 ); /* Q0 */ } -#ifdef BASOP_NOGLOB pe_mean = L_add_o( pe_mean, pe, &Overflow ); /* in Q12 and always positive */ -#else - pe_mean = L_add( pe_mean, pe ); /* in Q12 and always positive */ -#endif } IF( pe_mean > 0 ) @@ -151,12 +147,8 @@ Word16 hvq_enc_ivas_fx( /*o : Consumed bits expNfpe3 = extract_l( L_mult0( expNfpe, 3 ) ); /* Cube operation */ /* Number of bits required to adjust to Q15 */ adjust = add( 19 - ( 15 + 16 ), expNfpe3 ); /* +16 is due to the following extract_h(). */ -#ifdef BASOP_NOGLOB noise_level[i] = extract_h( L_shr_o( acc, adjust, &Overflow ) ); /* noise_level[] in Q15 */ move16(); -#else - noise_level[i] = extract_h( L_shr( acc, adjust ) ); /* noise_level[] in Q15 */ -#endif q_noise_level_idx[i] = quant_lc( noise_level[i], &q_noise_level[i] ); move16(); } @@ -186,21 +178,13 @@ Word16 hvq_enc_ivas_fx( /*o : Consumed bits expo3 = extract_l( L_mult0( expo, 3 ) ); /* Cube operation. */ /* Number of bits required to adjust to Q15 */ adjust = add( 22 - ( 15 + 16 ), expo3 ); /* +16 is due to the following extract_h(). */ -#ifdef BASOP_NOGLOB lb_nfpe = extract_h( L_shr_o( acc, adjust, &Overflow ) ); /* noise_level[] in Q15 */ -#else - lb_nfpe = extract_h( L_shr( acc, adjust ) ); /* noise_level[] in Q15 */ -#endif IF( GT_16( lb_nfpe, 16384 ) ) /* in Q15 */ { lb_nfpe = 16384; move16(); } -#ifdef BASOP_NOGLOB Mpy_32_16_ss( nf_gains[i], shl_o( lb_nfpe, 1, &Overflow ), &nf_gains[i], &dontCare ); /* nf_gains[] in Q12 */ -#else - Mpy_32_16_ss( nf_gains[i], shl( lb_nfpe, 1 ), &nf_gains[i], &dontCare ); /* nf_gains[] in Q12 */ -#endif } ELSE { @@ -311,11 +295,7 @@ Word16 hvq_enc_fx( /*o : Consumed bits nf_cnt = add( nf_cnt, 1 ); /* Q0 */ } -#ifdef BASOP_NOGLOB pe_mean = L_add_o( pe_mean, pe, &Overflow ); /* in Q12 and always positive */ -#else - pe_mean = L_add( pe_mean, pe ); /* in Q12 and always positive */ -#endif } IF( pe_mean > 0 ) @@ -343,11 +323,7 @@ Word16 hvq_enc_fx( /*o : Consumed bits expNfpe3 = extract_l( L_mult0( expNfpe, 3 ) ); /* Cube operation */ /* Number of bits required to adjust to Q15 */ adjust = add( 19 - ( 15 + 16 ), expNfpe3 ); /* +16 is due to the following extract_h(). */ -#ifdef BASOP_NOGLOB noise_level[i] = extract_h( L_shr_o( acc, adjust, &Overflow ) ); /* noise_level[] in Q15 */ -#else - noise_level[i] = extract_h( L_shr( acc, adjust ) ); /* noise_level[] in Q15 */ -#endif q_noise_level_idx[i] = quant_lc( noise_level[i], &q_noise_level[i] ); } ELSE @@ -375,21 +351,13 @@ Word16 hvq_enc_fx( /*o : Consumed bits expo3 = extract_l( L_mult0( expo, 3 ) ); /* Cube operation. */ /* Number of bits required to adjust to Q15 */ adjust = add( 22 - ( 15 + 16 ), expo3 ); /* +16 is due to the following extract_h(). */ -#ifdef BASOP_NOGLOB lb_nfpe = extract_h( L_shr_o( acc, adjust, &Overflow ) ); /* noise_level[] in Q15 */ -#else - lb_nfpe = extract_h( L_shr( acc, adjust ) ); /* noise_level[] in Q15 */ -#endif IF( lb_nfpe > 16384 ) /* in Q15 */ { lb_nfpe = 16384; move16(); } -#ifdef BASOP_NOGLOB Mpy_32_16_ss( nf_gains[i], shl_o( lb_nfpe, 1, &Overflow ), &nf_gains[i], &dontCare ); /* nf_gains[] in Q12 */ -#else - Mpy_32_16_ss( nf_gains[i], shl( lb_nfpe, 1 ), &nf_gains[i], &dontCare ); /* nf_gains[] in Q12 */ -#endif } ELSE { diff --git a/lib_enc/igf_enc_fx.c b/lib_enc/igf_enc_fx.c index f0d83e416..e7337cd09 100644 --- a/lib_enc/igf_enc_fx.c +++ b/lib_enc/igf_enc_fx.c @@ -218,23 +218,8 @@ static void IGF_CalculateEnvelope( const IGF_ENC_INSTANCE_HANDLE hInstance, /**< move16(); } -#ifdef BASOP_NOGLOB BASOP_Util_Divide_MantExp( round_fx_o( sfbEnergyTileR[sfb], &Overflow ), sfbEnergyTileR_exp[sfb], width, 15, &gain, &gain_exp ); BASOP_Util_Divide_MantExp( round_fx_o( sfbEnergyC[sfb], &Overflow ), sfbEnergyC_exp[sfb], round_fx_o( sfbEnergyTileC[sfb], &Overflow ), sfbEnergyTileC_exp[sfb], &tmp, &tmp_exp ); -#else - BASOP_Util_Divide_MantExp( round_fx( sfbEnergyTileR[sfb] ), - sfbEnergyTileR_exp[sfb], - width, - 15, - &gain, - &gain_exp ); - BASOP_Util_Divide_MantExp( round_fx( sfbEnergyC[sfb] ), - sfbEnergyC_exp[sfb], - round_fx( sfbEnergyTileC[sfb] ), - sfbEnergyTileC_exp[sfb], - &tmp, - &tmp_exp ); -#endif L_tmp = L_mult( gain, tmp ); gain_exp = add( gain_exp, tmp_exp ); } @@ -249,21 +234,12 @@ static void IGF_CalculateEnvelope( const IGF_ENC_INSTANCE_HANDLE hInstance, /**< zeroNrg = 1; move16(); } -#ifdef BASOP_NOGLOB BASOP_Util_Divide_MantExp( round_fx_sat( sfbEnergyR[sfb] ), sfbEnergyR_exp[sfb], width, 15, &gain, &gain_exp ); -#else - BASOP_Util_Divide_MantExp( round_fx( sfbEnergyR[sfb] ), - sfbEnergyR_exp[sfb], - width, - 15, - &gain, - &gain_exp ); -#endif L_tmp = L_deposit_h( gain ); } @@ -271,11 +247,7 @@ static void IGF_CalculateEnvelope( const IGF_ENC_INSTANCE_HANDLE hInstance, /**< L_tmp = BASOP_Util_Log2( L_tmp ); L_tmp = L_add( L_tmp, L_deposit_h( shl( gain_exp, 15 - 6 ) ) ); shift = norm_l( L_tmp ); -#ifdef BASOP_NOGLOB gain = round_fx_o( L_shl_o( L_tmp, shift, &Overflow ), &Overflow ); -#else - gain = round_fx( L_shl( L_tmp, shift ) ); -#endif gain_exp = sub( 7, shift ); gain_exp = BASOP_Util_Add_MantExp( gain, gain_exp, 32767 /*16 Q11*/, 4, &gain ); gain_exp = BASOP_Util_Add_MantExp( gain, gain_exp, 0x4000, 0, &gain ); @@ -440,17 +412,9 @@ void IGF_ErodeSpectrum( Word16 *highPassEner_exp, /**< ou FOR( i = 0; i < igfBgn; i++ ) { Carry = 0; -#ifdef BASOP_NOGLOB highPassEner = L_add_co( highPassEner, Mpy_32_16_1( pPowerSpectrum[i], shl( i, 4 ) /*Q4*/ ) /*Q20, pPowerSpectrum_exp*/, &Carry, &Overflow ); -#else /* BASOP_NOGLOB */ - highPassEner = L_add_c( highPassEner, Mpy_32_16_1( pPowerSpectrum[i], shl( i, 4 ) /*Q4*/ ) /*Q20, pPowerSpectrum_exp*/ ); -#endif /* BASOP_NOGLOB */ Overflow = 0; -#ifdef BASOP_NOGLOB L_c = L_macNs_co( L_c, 0, 0, &Carry, &Overflow ); -#else /* BASOP_NOGLOB */ - L_c = L_macNs( L_c, 0, 0 ); -#endif /* BASOP_NOGLOB */ } highPassEner = norm_llQ31( L_c, highPassEner, highPassEner_exp ); /*Q20, highPassEner_exp*/ @@ -473,15 +437,8 @@ void IGF_ErodeSpectrum( Word16 *highPassEner_exp, /**< ou /* May overflow - just for threshold comparison */ /* negate because the negated may be 1 larger in abs, */ /* so whenever compared to the negation of a maximum possible pPowerspectrum, it is still larger */ -#ifdef BASOP_NOGLOB highPassEner_Ovfl = L_shl_o( L_negate( highPassEner ), sub( *highPassEner_exp, pPowerSpectrum_exp ), &Overflow ); L_tmp = L_add_o( pPowerSpectrum[i - 1], highPassEner_Ovfl, &Overflow ); -#else - BASOP_SATURATE_WARNING_OFF_EVS - highPassEner_Ovfl = L_shl( L_negate( highPassEner ), sub( *highPassEner_exp, pPowerSpectrum_exp ) ); - L_tmp = L_add( pPowerSpectrum[i - 1], highPassEner_Ovfl ); - BASOP_SATURATE_WARNING_ON_EVS -#endif if ( L_tmp >= 0 ) { @@ -493,11 +450,7 @@ void IGF_ErodeSpectrum( Word16 *highPassEner_exp, /**< ou { /* May overflow - just for threshold comparison */ BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB L_tmp = L_add_sat( pPowerSpectrum[i], highPassEner_Ovfl ); -#else - L_tmp = L_add( pPowerSpectrum[i], highPassEner_Ovfl ); -#endif BASOP_SATURATE_WARNING_ON_EVS; IF( L_tmp < 0 ) @@ -522,11 +475,7 @@ void IGF_ErodeSpectrum( Word16 *highPassEner_exp, /**< ou /* May overflow - just for threshold comparison */ BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB L_tmp = L_add_sat( pPowerSpectrum[i], highPassEner_Ovfl ); -#else - L_tmp = L_add( pPowerSpectrum[i], highPassEner_Ovfl ); -#endif BASOP_SATURATE_WARNING_ON_EVS IF( L_tmp < 0 ) { @@ -633,13 +582,8 @@ Word16 IGF_getCrest( /**< ou /* limit crest factor to a lower bound of 1, may overflow */ BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB tmp = shl_sat( -1, sub( 15, *crest_exp ) ); /* build negative threshold */ tmp = add_sat( crest, tmp ); -#else - tmp = shl( -1, sub( 15, *crest_exp ) ); /* build negative threshold */ - tmp = add( crest, tmp ); -#endif BASOP_SATURATE_WARNING_ON_EVS if ( tmp < 0 ) { @@ -712,18 +656,10 @@ Word16 IGF_getSFM( /**< out: Q15| SFM value num = L_add( num, L_deposit_l( n ) ); /*Q0*/ Carry = 0; -#ifdef BASOP_NOGLOB denom = L_add_co( energy[i], denom, &Carry, &Overflow ); -#else /* BASOP_NOGLOB */ - denom = L_add_c( energy[i], denom ); -#endif /* BASOP_NOGLOB */ Overflow = 0; -#ifdef BASOP_NOGLOB L_c = L_macNs_co( L_c, 0, 0, &Carry, &Overflow ); -#else /* BASOP_NOGLOB */ - L_c = L_macNs( L_c, 0, 0 ); -#endif } denom = norm_llQ31( L_c, denom, &denom_exp ); /*Q31*/ @@ -759,11 +695,7 @@ Word16 IGF_getSFM( /**< out: Q15| SFM value /*Transform to Q15*/ s = norm_l( SFM32 ); -#ifdef BASOP_NOGLOB SFM = round_fx_sat( L_shl_sat( SFM32, s ) ); -#else - SFM = round_fx( L_shl( SFM32, s ) ); -#endif *SFM_exp = sub( *SFM_exp, s ); /**SFM_exp = s_min(*SFM_exp, 0);*/ @@ -875,13 +807,8 @@ static void IGF_Whitening( const IGF_ENC_INSTANCE_HANDLE hInstance, /**< in BASOP_SATURATE_WARNING_OFF_EVS /*SFM = min(2.7f, SFM);*/ /*Overflow possible in shift, intended*/ -#ifdef BASOP_NOGLOB tmp = add_sat( crest, tmp ); SFM = s_min( 22118 /*2.7f Q13*/, extract_h( L_shr_sat( SFM32, 16 - 29 ) /*->Q29*/ ) /*->Q13*/ ); -#else - tmp = add( crest, tmp ); - SFM = s_min( 22118 /*2.7f Q13*/, extract_h( L_shr( SFM32, 16 - 29 ) /*->Q29*/ ) /*->Q13*/ ); -#endif BASOP_SATURATE_WARNING_ON_EVS hPrivateData->prevSFM_FIR[p] = tmp32; /*15Q16*/ diff --git a/lib_enc/lp_exc_e_fx.c b/lib_enc/lp_exc_e_fx.c index a8e9f7437..5afca5136 100644 --- a/lib_enc/lp_exc_e_fx.c +++ b/lib_enc/lp_exc_e_fx.c @@ -354,18 +354,12 @@ static Word16 adpt_enr_fx( /* o : adaptive excitation Overflow = 0; move16(); -#ifdef BASOP_NOGLOB /* Critical Overflow */ Overflow = -#endif conv_fx( exc, h1, y1, L_subfr ); IF( use_prev_sf_pit_gain == 0 ) { -#ifdef BASOP_NOGLOB /* Critical Overflow */ *gain = corr_xy1_fx( xn, y1, g_corr, L_subfr, codec_mode == MODE2, &Overflow ); -#else - *gain = corr_xy1_fx( xn, y1, g_corr, L_subfr, codec_mode == MODE2 ); -#endif move16(); test(); @@ -381,11 +375,7 @@ static Word16 adpt_enr_fx( /* o : adaptive excitation Overflow = 0; conv_fx( exc_tmp, h1, y1, L_subfr ); -#ifdef BASOP_NOGLOB *gain = corr_xy1_fx( xn_tmp, y1, g_corr, L_subfr, codec_mode == MODE2, &Overflow ); -#else - *gain = corr_xy1_fx( xn_tmp, y1, g_corr, L_subfr, codec_mode == MODE2 ); -#endif move16(); } @@ -439,10 +429,8 @@ Word16 corr_xy1_fx( /* o : pitch gain (0..GAIN_PIT_MAX) Word16 g_corr[], /* o : correlations and -2 */ const Word16 L_subfr, /* i : vector length */ const Word16 norm_flag /* i : flag for constraining pitch contribution */ -#ifdef BASOP_NOGLOB , Flag *Overflow_out /* o : propagating the Overflow flag to upper level */ -#endif ) { Word16 i; @@ -462,13 +450,9 @@ Word16 corr_xy1_fx( /* o : pitch gain (0..GAIN_PIT_MAX) Copy( y1_1, y1, L_subfr ); Overflow = 0; move16(); -#ifdef BASOP_NOGLOB /* Critical Overflow */ Ltmp1 = Dot_product12_o( y1, y1, L_subfr, &exp_yy, &Overflow ); *Overflow_out |= Overflow; move16(); -#else - Ltmp1 = Dot_product12( y1, y1, L_subfr, &exp_yy ); -#endif IF( Overflow ) { FOR( i = 0; i < L_subfr; i++ ) @@ -504,13 +488,9 @@ Word16 corr_xy1_fx( /* o : pitch gain (0..GAIN_PIT_MAX) /* Ltmp1 = L_shr(Ltmp1, sub(30, exp_yy));*/ /* Compute scalar product */ -#ifdef BASOP_NOGLOB Ltmp2 = Dot_product12_o( xn, y1, L_subfr, &exp_xy, &Overflow ); *Overflow_out |= Overflow; move16(); -#else - Ltmp2 = Dot_product12( xn, y1, L_subfr, &exp_xy ); -#endif xy = extract_h( Ltmp2 ); /* Ltmp2 = L_shr(Ltmp2, sub(30, exp_xy));*/ @@ -533,13 +513,9 @@ Word16 corr_xy1_fx( /* o : pitch gain (0..GAIN_PIT_MAX) xy = shr( xy, 1 ); /* be sure that xy < yy */ gain = div_s( xy, yy ); i = sub( exp_xy, exp_yy ); -#ifdef BASOP_NOGLOB gain = shl_o( gain, i, &Overflow ); /* saturation can occur here */ *Overflow_out |= Overflow; move16(); -#else /* BASOP_NOGLOB */ - gain = shl( gain, i ); /* saturation can occur here */ -#endif gain = s_max( gain, 0 ); gain = s_min( gain, GAIN_PIT_MAX ); /* 1.2 in Q14 */ @@ -553,9 +529,7 @@ Word16 corr_xy1_fx( /* o : pitch gain (0..GAIN_PIT_MAX) /* Limit the energy of pitch contribution */ IF( norm_flag ) { -#ifdef BASOP_NOGLOB /*that part of code seems never used*/ -#endif /* Compute scalar product */ xx = round_fx( Dot_product12_offs( xn, xn, L_subfr, &exp_xx, 1 ) ); @@ -567,11 +541,7 @@ Word16 corr_xy1_fx( /* o : pitch gain (0..GAIN_PIT_MAX) /* Note: shl works as shl or shr. */ exp_xx = sub( exp_xx, 1 ); BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB gain_p_snr = round_fx_sat( L_shl_sat( Mpy_32_16_1( 1717986944l /*ACELP_GAINS_CONST Q31*/, tmp ), exp_xx ) ); -#else - gain_p_snr = round_fx( L_shl( Mpy_32_16_1( 1717986944l /*ACELP_GAINS_CONST Q31*/, tmp ), exp_xx ) ); -#endif BASOP_SATURATE_WARNING_ON_EVS gain = s_min( gain, gain_p_snr ); diff --git a/lib_enc/lsf_enc_fx.c b/lib_enc/lsf_enc_fx.c index af1dbd1bd..3f3f91392 100644 --- a/lib_enc/lsf_enc_fx.c +++ b/lib_enc/lsf_enc_fx.c @@ -807,11 +807,7 @@ static Word16 qlsf_Mode_Select_fx( { pred_pow2[i] = shl( pred1[i], cs ); move16(); -#ifdef BASOP_NOGLOB En = L_mac_o( En, mult( pred_pow2[i], shl_o( w[i], 2, &Overflow ) ), pred_pow2[i], &Overflow ); /* 2.56*2.56 at Q-4 */ -#else /* BASOP_NOGLOB */ - En = L_mac( En, mult( pred_pow2[i], shl( w[i], 2 ) ), pred_pow2[i] ); /* 2.56*2.56 at Q-4 */ -#endif /* BASOP_NOGLOB */ } cs = shl( cs, 1 ); @@ -2133,11 +2129,7 @@ static void first_VQstages( L_tmp = L_deposit_l( 0 ); FOR( j = 0; j < N; j++ ) { -#ifdef BASOP_NOGLOB L_tmp1 = L_shl_o( L_mult0( u[j], w[j] ), 7, &Overflow ); /*x2.56 + Q8 + Q7 */ -#else /* BASOP_NOGLOB */ - L_tmp1 = L_shl( L_mult0( u[j], w[j] ), 7 ); /*x2.56 + Q8 + Q7 */ -#endif /* BASOP_NOGLOB */ L_tmp1 = Mult_32_16( L_tmp1, u[j] ); /*x2.56 + Q15 + x2.56 -Q15 */ L_tmp = L_add( L_tmp, L_tmp1 ); /*Q0 + x2.56 +x2.56 */ } @@ -2374,25 +2366,13 @@ static Word32 vq_lvq_lsf_enc( Vr_subt( cand[i], lsf, diff, M ); FOR( j = 0; j < M; j++ ) { -#ifdef BASOP_NOGLOB diff[j] = shl_o( diff[j], 4, &Overflow ); -#else /* BASOP_NOGLOB */ - diff[j] = shl( diff[j], 4 ); -#endif /* BASOP_NOGLOB */ move16(); } -#ifdef BASOP_NOGLOB L_tmp = L_mult( mult( diff[0], shl_o( w[0], 1, &Overflow ) ), diff[0] ); /*(2.56+Q5+ Q10 -Q15) + 2.56+ Q5 + Q1 = 2.56 + 2.56 + Q6 */ -#else - L_tmp = L_mult( mult( diff[0], shl( w[0], 1 ) ), diff[0] ); /*(2.56+Q5+ Q10 -Q15) + 2.56+ Q5 + Q1 = 2.56 + 2.56 + Q6 */ -#endif FOR( j = 1; j < M; j++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac( L_tmp, mult( diff[j], shl_o( w[j], 1, &Overflow ) ), diff[j] ); /*(2.56+Q5+ Q10 -Q15) + 2.56+ Q5 + Q1 = 2.56 + 2.56 + Q6 */ -#else - L_tmp = L_mac( L_tmp, mult( diff[j], shl( w[j], 1 ) ), diff[j] ); /*(2.56+Q5+ Q10 -Q15) + 2.56+ Q5 + Q1 = 2.56 + 2.56 + Q6 */ -#endif } e[i] = L_tmp; move32(); @@ -2509,25 +2489,13 @@ static Word32 vq_lvq_lsf_enc_ivas_fx( Vr_subt( cand[i], lsf, diff, M ); FOR( j = 0; j < M; j++ ) { -#ifdef BASOP_NOGLOB diff[j] = shl_o( diff[j], 4, &Overflow ); -#else /* BASOP_NOGLOB */ - diff[j] = shl( diff[j], 4 ); -#endif /* BASOP_NOGLOB */ move16(); } -#ifdef BASOP_NOGLOB L_tmp = L_mult( mult( diff[0], shl_o( w[0], 1, &Overflow ) ), diff[0] ); /*(2.56+Q5+ Q10 -Q15) + 2.56+ Q5 + Q1 = 2.56 + 2.56 + Q6 */ -#else - L_tmp = L_mult( mult( diff[0], shl( w[0], 1 ) ), diff[0] ); /*(2.56+Q5+ Q10 -Q15) + 2.56+ Q5 + Q1 = 2.56 + 2.56 + Q6 */ -#endif FOR( j = 1; j < M; j++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac( L_tmp, mult( diff[j], shl_o( w[j], 1, &Overflow ) ), diff[j] ); /*(2.56+Q5+ Q10 -Q15) + 2.56+ Q5 + Q1 = 2.56 + 2.56 + Q6 */ -#else - L_tmp = L_mac( L_tmp, mult( diff[j], shl( w[j], 1 ) ), diff[j] ); /*(2.56+Q5+ Q10 -Q15) + 2.56+ Q5 + Q1 = 2.56 + 2.56 + Q6 */ -#endif } e[i] = L_tmp; move32(); @@ -3375,11 +3343,7 @@ Word32 qlsf_ARSN_tcvq_Enc_16k_fx( { yy_fx[i] = shl( yy_fx[i], cs ); move16(); -#ifdef BASOP_NOGLOB temp_l = L_mac_o( temp_l, mult( yy_fx[i], shl_o( w_fx[i], 2, &Overflow ) ), yy_fx[i], &Overflow ); -#else /* BASOP_NOGLOB */ - temp_l = L_mac( temp_l, mult( yy_fx[i], shl( w_fx[i], 2 ) ), yy_fx[i] ); -#endif /* BASOP_NOGLOB */ } cs = shl( cs, 1 ); temp_l = L_shr( temp_l, cs ); @@ -3405,11 +3369,7 @@ static void FFT_Mid_Interpol_16k_fx( FOR( i = 0; i < L_FFT / 2; i++ ) { /* Interpolation */ -#ifdef BASOP_NOGLOB Bin_Ener_mid[i] = L_shr( L_add_o( Bin_Ener_old[i], Bin_Ener[i], &Overflow ), 1 ); -#else /* BASOP_NOGLOB */ - Bin_Ener_mid[i] = L_shr( L_add( Bin_Ener_old[i], Bin_Ener[i] ), 1 ); -#endif /* BASOP_NOGLOB */ /* Memory update */ Bin_Ener_old[i] = Bin_Ener[i]; @@ -3603,15 +3563,9 @@ static void lsf_mid_enc_fx( tmp = sub( lsf[j], qlsf[j] ); /* err += wghts[j] * ftemp * ftemp; */ /* tmp is usually very small, we can have some extra precision with very rare saturation */ -#ifdef BASOP_NOGLOB tmp = shl_o( tmp, 4, &Overflow ); tmp = mult_ro( tmp, tmp, &Overflow ); err = L_mac_o( err, tmp, shl_o( wghts[j], 2, &Overflow ), &Overflow ); -#else /* BASOP_NOGLOB */ - tmp = shl( tmp, 4 ); - tmp = mult_r( tmp, tmp ); - err = L_mac( err, tmp, shl( wghts[j], 2 ) ); -#endif } /* err = L_shl(err,Wscale); */ err = Mult_32_16( err, LSF_1_OVER_256SQ ); @@ -3795,15 +3749,9 @@ static void lsf_mid_enc_ivas_fx( tmp = sub( lsf[j], qlsf[j] ); /* err += wghts[j] * ftemp * ftemp; */ /* tmp is usually very small, we can have some extra precision with very rare saturation */ -#ifdef BASOP_NOGLOB tmp = shl_o( tmp, 4, &Overflow ); tmp = mult_ro( tmp, tmp, &Overflow ); err = L_mac_o( err, tmp, shl_o( wghts[j], 2, &Overflow ), &Overflow ); -#else /* BASOP_NOGLOB */ - tmp = shl( tmp, 4 ); - tmp = mult_r( tmp, tmp ); - err = L_mac( err, tmp, shl( wghts[j], 2 ) ); -#endif } /* err = L_shl(err,Wscale); */ err = Mult_32_16( err, LSF_1_OVER_256SQ ); diff --git a/lib_enc/lsf_msvq_ma_enc_fx.c b/lib_enc/lsf_msvq_ma_enc_fx.c index 5e65218e5..d30f2c249 100644 --- a/lib_enc/lsf_msvq_ma_enc_fx.c +++ b/lib_enc/lsf_msvq_ma_enc_fx.c @@ -49,7 +49,6 @@ static Word32 depack_mul_values( Word16 *Tmp, const Word16 *w, const Word16 *cbp FOR( i = 0; i < N; i += 4 ) { depack_4_values( cbp + i_mult( shr( i, 2 ), 3 ), val0, val1, val2, val3 ) -#ifdef BASOP_NOGLOB Tmp[i + 0] = mult_r( shl_sat( w[i + 0], 2 ), val0 ); move16(); en = L_mac_sat( en, val0, Tmp[i + 0] ); @@ -62,20 +61,6 @@ static Word32 depack_mul_values( Word16 *Tmp, const Word16 *w, const Word16 *cbp Tmp[i + 3] = mult_r( shl_sat( w[i + 3], 2 ), val3 ); move16(); en = L_mac_sat( en, val3, Tmp[i + 3] ); -#else - Tmp[i + 0] = mult_r( shl( w[i + 0], 2 ), val0 ); - move16(); - en = L_mac( en, val0, Tmp[i + 0] ); - Tmp[i + 1] = mult_r( shl( w[i + 1], 2 ), val1 ); - move16(); - en = L_mac( en, val1, Tmp[i + 1] ); - Tmp[i + 2] = mult_r( shl( w[i + 2], 2 ), val2 ); - move16(); - en = L_mac( en, val2, Tmp[i + 2] ); - Tmp[i + 3] = mult_r( shl( w[i + 3], 2 ), val3 ); - move16(); - en = L_mac( en, val3, Tmp[i + 3] ); -#endif } return en; @@ -263,11 +248,7 @@ void msvq_enc_fx( move16(); FOR( j = 1; j < N; j++ ) { -#ifdef BASOP_NOGLOB ss2 = L_mac_sat( ss2, mult( u[j], shl_sat( w[j], 2 ) ), u[j] ); -#else - ss2 = L_mac( ss2, mult( u[j], shl( w[j], 2 ) ), u[j] ); -#endif } /* Set up inital error (residual) vectors */ @@ -363,13 +344,8 @@ void msvq_enc_fx( BASOP_SATURATE_WARNING_OFF_EVS /*NOTE: as long as a shorter distance is found, saturation can be accepted.*/ -#ifdef BASOP_NOGLOB tmp = L_add_sat( dist[0][c], L_sub_sat( en, L_shl( t1, 1 ) ) ); t1 = L_sub_sat( tmp, dist[1][p_max] ); -#else - tmp = L_add( dist[0][c], L_sub( en, L_shl( t1, 1 ) ) ); - t1 = L_sub( tmp, dist[1][p_max] ); -#endif BASOP_SATURATE_WARNING_ON_EVS IF( t1 <= 0 ) @@ -497,20 +473,11 @@ void midlsf_enc_fx( tmp = sub( lsf[j], qlsf[j] ); /* err += wghts[j] * ftemp * ftemp; */ /* tmp is usually very small, we can have some extra precision with very rare saturation */ -#ifdef BASOP_NOGLOB tmp = shl_o( tmp, 4, &Overflow ); tmp = mult_ro( tmp, tmp, &Overflow ); -#else /* BASOP_NOGLOB */ - tmp = shl( tmp, 4 ); - tmp = mult_r( tmp, tmp ); -#endif /* BASOP_NOGLOB */ err = L_mac( err, tmp, wghts[j] ); } -#ifdef BASOP_NOGLOB err = L_shl_o( err, 2, &Overflow ); -#else /* BASOP_NOGLOB */ - err = L_shl( err, 2 ); -#endif /* err = L_shl(err,Wscale); */ err = Mult_32_16( err, LSF_1_OVER_256SQ ); diff --git a/lib_enc/ltd_stable_fx.c b/lib_enc/ltd_stable_fx.c index 63ade58a8..a6e3ae1cc 100644 --- a/lib_enc/ltd_stable_fx.c +++ b/lib_enc/ltd_stable_fx.c @@ -199,11 +199,7 @@ void ltd_stable_fx( FOR( i = 0; i < 20; i++ ) { -#ifdef BASOP_NOGLOB tmp_mul = L_mult_sat( tmp16[i], tmp16[i] ); -#else - tmp_mul = L_mult( tmp16[i], tmp16[i] ); -#endif tmp_mul = L_shr( tmp_mul, 5 ); dif32 = L_add( dif32, tmp_mul ); @@ -295,11 +291,7 @@ void ltd_stable_fx( FOR( i = 0; i < 14; i++ ) { tmp = extract_h( tmp32[i] ); -#ifdef BASOP_NOGLOB tmp_mul = L_mult_sat( tmp, tmp ); -#else - tmp_mul = L_mult( tmp, tmp ); -#endif tmp_mul = L_shr( tmp_mul, 4 ); dif32 = L_add( dif32, tmp_mul ); @@ -423,20 +415,12 @@ void ltd_stable_fx( FOR( i = 0; i < 8; i++ ) { tmp = extract_h( tmp32[i] ); -#ifdef BASOP_NOGLOB tmp_mul = L_mult_sat( tmp, tmp ); -#else - tmp_mul = L_mult( tmp, tmp ); -#endif tmp_mul = L_shr( tmp_mul, 3 ); dif32 = L_add( dif32, tmp_mul ); tmp = extract_h( mid_frame_amp32[i] ); -#ifdef BASOP_NOGLOB mid_frame_amp_mul = L_mult_sat( tmp, tmp ); -#else - mid_frame_amp_mul = L_mult( tmp, tmp ); -#endif mid_frame_amp_mul = L_shr( mid_frame_amp_mul, 3 ); apow32 = L_add( apow32, mid_frame_amp_mul ); } diff --git a/lib_enc/mdct_classifier_fx.c b/lib_enc/mdct_classifier_fx.c index 51fe086df..265fce7f2 100644 --- a/lib_enc/mdct_classifier_fx.c +++ b/lib_enc/mdct_classifier_fx.c @@ -433,11 +433,7 @@ Word16 mdct_classifier_fx( /* o: MDCT A/B decision test(); test(); test(); -#ifdef BASOP_NOGLOB IF( GT_32( Mult_32_16( gain3, 27307 ), gain2 ) || ( GE_32( gain3, Mult_32_16( gain2, 26214 ) ) && GT_32( peak_H1, L_shl_o( avrg_H1, 1, &Overflow ) ) ) || ( LT_32( Mult_32_32( L_shl_o( peak_l, exp, &Overflow ), L_shl_o( avrg_h, exp1, &Overflow ) ), Mult_32_32( L_shl_o( L_tmp, exp, &Overflow ), L_shl_o( avrg_l, exp1, &Overflow ) ) ) || GT_32( Mult_32_32( L_shl_o( L_tmp1, exp2, &Overflow ), L_shl_o( avrg_h, exp1, &Overflow ) ), Mult_32_32( L_shl_o( peak_h, exp2, &Overflow ), L_shl_o( avrg_l, exp1, &Overflow ) ) ) ) ) -#else - IF( GT_32( Mult_32_16( gain3, 27307 ), gain2 ) || ( GE_32( gain3, Mult_32_16( gain2, 26214 ) ) && GT_32( peak_H1, L_shl( avrg_H1, 1 ) ) ) || ( LT_32( Mult_32_32( L_shl( peak_l, exp ), L_shl( avrg_h, exp1 ) ), Mult_32_32( L_shl( L_tmp, exp ), L_shl( avrg_l, exp1 ) ) ) || GT_32( Mult_32_32( L_shl( L_tmp1, exp2 ), L_shl( avrg_h, exp1 ) ), Mult_32_32( L_shl( peak_h, exp2 ), L_shl( avrg_l, exp1 ) ) ) ) ) -#endif { condition3 = 1; move16(); @@ -531,11 +527,7 @@ Word16 mdct_classifier_fx( /* o: MDCT A/B decision test(); test(); test(); -#ifdef BASOP_NOGLOB IF( ( EQ_16( hTcxEnc->clas_final_old, HQ_CORE ) || EQ_16( hTcxEnc->clas_final_old, TCX_20_CORE ) ) && ( ( GT_32( hTcxEnc->last_gain1, L_shr( gain1_tmp, 1 ) ) && LT_32( hTcxEnc->last_gain1, L_shl_o( gain1_tmp, 1, &Overflow ) ) ) && ( GT_32( hTcxEnc->last_gain2, L_shr( gain2_tmp, 1 ) ) && LT_32( hTcxEnc->last_gain2, L_shl_o( gain2_tmp, 1, &Overflow ) ) ) ) ) -#else - IF( ( EQ_16( hTcxEnc->clas_final_old, HQ_CORE ) || EQ_16( hTcxEnc->clas_final_old, TCX_20_CORE ) ) && ( ( GT_32( hTcxEnc->last_gain1, L_shr( gain1_tmp, 1 ) ) && LT_32( hTcxEnc->last_gain1, L_shl( gain1_tmp, 1 ) ) ) && ( GT_32( hTcxEnc->last_gain2, L_shr( gain2_tmp, 1 ) ) && LT_32( hTcxEnc->last_gain2, L_shl( gain2_tmp, 1 ) ) ) ) ) -#endif { clas_final = hTcxEnc->clas_final_old; move16(); @@ -972,11 +964,7 @@ Word16 mdct_classifier_ivas_fx( test(); test(); test(); -#ifdef BASOP_NOGLOB IF( GT_32( Mult_32_16( gain3, 27307 ), gain2 ) || ( GE_32( gain3, Mult_32_16( gain2, 26214 ) ) && GT_32( peak_H1, L_shl_o( avrg_H1, 1, &Overflow ) ) ) || ( LT_32( Mult_32_32( L_shl_o( peak_l, exp, &Overflow ), L_shl_o( avrg_h, exp1, &Overflow ) ), Mult_32_32( L_shl_o( L_tmp, exp, &Overflow ), L_shl_o( avrg_l, exp1, &Overflow ) ) ) || GT_32( Mult_32_32( L_shl_o( L_tmp1, exp2, &Overflow ), L_shl_o( avrg_h, exp1, &Overflow ) ), Mult_32_32( L_shl_o( peak_h, exp2, &Overflow ), L_shl_o( avrg_l, exp1, &Overflow ) ) ) ) ) -#else - IF( GT_32( Mult_32_16( gain3, 27307 ), gain2 ) || ( GE_32( gain3, Mult_32_16( gain2, 26214 ) ) && GT_32( peak_H1, L_shl( avrg_H1, 1 ) ) ) || ( LT_32( Mult_32_32( L_shl( peak_l, exp ), L_shl( avrg_h, exp1 ) ), Mult_32_32( L_shl( L_tmp, exp ), L_shl( avrg_l, exp1 ) ) ) || GT_32( Mult_32_32( L_shl( L_tmp1, exp2 ), L_shl( avrg_h, exp1 ) ), Mult_32_32( L_shl( peak_h, exp2 ), L_shl( avrg_l, exp1 ) ) ) ) ) -#endif { condition3 = 1; move16(); @@ -1077,11 +1065,7 @@ Word16 mdct_classifier_ivas_fx( test(); test(); -#ifdef BASOP_NOGLOB IF( ( EQ_16( hTcxEnc->clas_final_old, HQ_CORE ) || EQ_16( hTcxEnc->clas_final_old, TCX_20_CORE ) ) && ( ( GT_32( hTcxEnc->last_gain1, L_shr( gain1_tmp, 1 ) ) && LT_32( hTcxEnc->last_gain1, L_shl_o( gain1_tmp, 1, &Overflow ) ) ) && ( GT_32( hTcxEnc->last_gain2, L_shr( gain2_tmp, 1 ) ) && LT_32( hTcxEnc->last_gain2, L_shl_o( gain2_tmp, 1, &Overflow ) ) ) ) ) -#else - IF( ( EQ_16( hTcxEnc->clas_final_old, HQ_CORE ) || EQ_16( hTcxEnc->clas_final_old, TCX_20_CORE ) ) && ( ( GT_32( hTcxEnc->last_gain1, L_shr( gain1_tmp, 1 ) ) && LT_32( hTcxEnc->last_gain1, L_shl( gain1_tmp, 1 ) ) ) && ( GT_32( hTcxEnc->last_gain2, L_shr( gain2_tmp, 1 ) ) && LT_32( hTcxEnc->last_gain2, L_shl( gain2_tmp, 1 ) ) ) ) ) -#endif { clas_final = hTcxEnc->clas_final_old; move16(); diff --git a/lib_enc/multi_harm_fx.c b/lib_enc/multi_harm_fx.c index 92666570c..641c35979 100644 --- a/lib_enc/multi_harm_fx.c +++ b/lib_enc/multi_harm_fx.c @@ -212,11 +212,7 @@ Word16 multi_harm_fx( /* o : frame multi-harmonicity IF( EQ_16( i, ind_mins[k] ) ) { /* include the last peak point (new minimum) to the corr. sum */ -#ifdef BASOP_NOGLOB Lcory2 = L_mac_o( Lcory2, old_S[i], old_S[i], &Overflow ); -#else /* BASOP_NOGLOB */ - Lcory2 = L_mac( Lcory2, old_S[i], old_S[i] ); -#endif /* BASOP_NOGLOB */ /* calculation of the norm. peak correlation */ test(); @@ -242,11 +238,7 @@ Word16 multi_harm_fx( /* o : frame multi-harmonicity corxy = shl( corxy, cor ); /* cor = corxy * corxy / (corx2 * cory2) */ corxy = div_s( corxy, corx2 ); -#ifdef BASOP_NOGLOB cor = shr_o( corxy, sub( shl( tmp16, 1 ), Expx2 ), &Overflow ); /* Q15 */ -#else /* BASOP_NOGLOB */ - cor = shr( corxy, sub( shl( tmp16, 1 ), Expx2 ) ); /* Q15 */ -#endif /* BASOP_NOGLOB */ } ELSE { @@ -271,15 +263,9 @@ Word16 multi_harm_fx( /* o : frame multi-harmonicity k++; } -#ifdef BASOP_NOGLOB Lcorx2 = L_mac_o( Lcorx2, S[i], S[i], &Overflow ); Lcory2 = L_mac_o( Lcory2, old_S[i], old_S[i], &Overflow ); Lcorxy = L_mac_o( Lcorxy, S[i], old_S[i], &Overflow ); -#else /* BASOP_NOGLOB */ - Lcorx2 = L_mac( Lcorx2, S[i], S[i] ); - Lcory2 = L_mac( Lcory2, old_S[i], old_S[i] ); - Lcorxy = L_mac( Lcorxy, S[i], old_S[i] ); -#endif } Copy( S, old_S, ind_mins[0] ); @@ -562,11 +548,7 @@ Word16 multi_harm_ivas_fx( /* o : frame multi-harmoni IF( EQ_16( i, ind_mins[k] ) ) { /* include the last peak point (new minimum) to the corr. sum */ -#ifdef BASOP_NOGLOB Lcory2 = L_mac_o( Lcory2, old_S[i], old_S[i], &Overflow ); -#else /* BASOP_NOGLOB */ - Lcory2 = L_mac( Lcory2, old_S[i], old_S[i] ); -#endif /* BASOP_NOGLOB */ /* calculation of the norm. peak correlation */ test(); @@ -592,11 +574,7 @@ Word16 multi_harm_ivas_fx( /* o : frame multi-harmoni corxy = shl( corxy, cor ); /* cor = corxy * corxy / (corx2 * cory2) */ corxy = div_s( corxy, corx2 ); -#ifdef BASOP_NOGLOB cor = shr_o( corxy, sub( shl( tmp16, 1 ), Expx2 ), &Overflow ); /* Q15 */ -#else /* BASOP_NOGLOB */ - cor = shr( corxy, sub( shl( tmp16, 1 ), Expx2 ) ); /* Q15 */ -#endif /* BASOP_NOGLOB */ } ELSE { @@ -621,15 +599,9 @@ Word16 multi_harm_ivas_fx( /* o : frame multi-harmoni k++; } -#ifdef BASOP_NOGLOB Lcorx2 = L_mac_o( Lcorx2, S[i], S[i], &Overflow ); Lcory2 = L_mac_o( Lcory2, old_S[i], old_S[i], &Overflow ); Lcorxy = L_mac_o( Lcorxy, S[i], old_S[i], &Overflow ); -#else /* BASOP_NOGLOB */ - Lcorx2 = L_mac( Lcorx2, S[i], S[i] ); - Lcory2 = L_mac( Lcory2, old_S[i], old_S[i] ); - Lcorxy = L_mac( Lcorxy, S[i], old_S[i] ); -#endif } Copy( S, old_S, ind_mins[0] ); diff --git a/lib_enc/nelp_enc_fx.c b/lib_enc/nelp_enc_fx.c index 259987bba..ac099b61f 100644 --- a/lib_enc/nelp_enc_fx.c +++ b/lib_enc/nelp_enc_fx.c @@ -129,13 +129,8 @@ void quantize_uvg_fx( Word16 *G, Word16 *iG1, Word16 *iG2, Word16 *quantG, Word1 move16(); FOR( i = 0; i < UVG1_CBSIZE; i++ ) { -#ifdef BASOP_NOGLOB L16 = shr( sub_sat( G1[0], UVG1CB_fx[i][0] ), 1 ); /* Q12 */ L16_1 = shr( sub_sat( G1[1], UVG1CB_fx[i][1] ), 1 ); /* Q12 */ -#else - L16 = shr( sub( G1[0], UVG1CB_fx[i][0] ), 1 ); /* Q12 */ - L16_1 = shr( sub( G1[1], UVG1CB_fx[i][1] ), 1 ); /* Q12 */ -#endif Lacc = 0; Lacc = L_mac0( Lacc, L16, L16 ); /*Q24 */ Lacc = L_mac0( Lacc, L16_1, L16_1 ); /*Q24 */ @@ -191,25 +186,15 @@ void quantize_uvg_fx( Word16 *G, Word16 *iG1, Word16 *iG2, Word16 *quantG, Word1 { /*mse += SQR(G2[i*5+k]-UVG2CB1[j][k]); */ ind = add( shr( extract_l( L_mult( i, 5 ) ), 1 ), k ); -#ifdef BASOP_NOGLOB temp = sub_sat( G2[ind], UVG2CB1_fx[j][k] ); Lacc = L_mac0_sat( Lacc, temp, temp ); /*Q24 */ -#else - temp = sub( G2[ind], UVG2CB1_fx[j][k] ); - Lacc = L_mac0( Lacc, temp, temp ); /*Q24 */ -#endif } ELSE IF( i == 1 ) { /*mse += SQR(G2[i*5+k]-UVG2CB2[j][k]); */ ind = add( shr( extract_l( L_mult( i, 5 ) ), 1 ), k ); -#ifdef BASOP_NOGLOB temp = sub_sat( G2[ind], UVG2CB2_fx[j][k] ); Lacc = L_mac0_sat( Lacc, temp, temp ); /*Q24 */ -#else - temp = sub( G2[ind], UVG2CB2_fx[j][k] ); - Lacc = L_mac0( Lacc, temp, temp ); /*Q24 */ -#endif } } @@ -403,11 +388,7 @@ void nelp_encoder_fx( E1_fx = L_deposit_l( 0 ); FOR( i = 0; i < L_FRAME; i++ ) { -#ifdef BASOP_NOGLOB E1_fx = L_mac0_o( E1_fx, in_fx[i], in_fx[i], &Overflow ); /*Q(qE1+qE1) */ -#else - E1_fx = L_mac0( E1_fx, in_fx[i], in_fx[i] ); /*Q(qE1+qE1) */ -#endif } qE1 = shl( qE1, 1 ); @@ -423,11 +404,7 @@ void nelp_encoder_fx( EL1_fx = L_deposit_l( 0 ); FOR( i = 0; i < L_FRAME; i++ ) { -#ifdef BASOP_NOGLOB EL1_fx = L_mac0_o( EL1_fx, filtRes_fx[i], filtRes_fx[i], &Overflow ); /*Q(2*qIn) */ -#else - EL1_fx = L_mac0( EL1_fx, filtRes_fx[i], filtRes_fx[i] ); /*Q(2*qIn) */ -#endif } qEL1 = shl( qEL1, 1 ); @@ -443,11 +420,7 @@ void nelp_encoder_fx( EH1_fx = L_deposit_l( 0 ); FOR( i = 0; i < L_FRAME; i++ ) { -#ifdef BASOP_NOGLOB EH1_fx = L_mac0_o( EH1_fx, filtRes_fx[i], filtRes_fx[i], &Overflow ); /*Q(2*qEH1) */ -#else - EH1_fx = L_mac0( EH1_fx, filtRes_fx[i], filtRes_fx[i] ); /*Q(2*qEH1) */ -#endif } qEH1 = 2 * qEH1; move16(); @@ -463,11 +436,7 @@ void nelp_encoder_fx( Ltemp = L_deposit_l( 0 ); FOR( j = (Word16) ( i * lag ); j < (Word16) ( ( i + 1 ) * lag ); j++ ) { -#ifdef BASOP_NOGLOB Ltemp = L_mac0_o( Ltemp, in_fx[j], in_fx[j], &Overflow ); /*Q(2*qGain) */ -#else - Ltemp = L_mac0( Ltemp, in_fx[j], in_fx[j] ); /*Q(2*qGain) */ -#endif } /*Gains[i] = (float) sqrt(Gains[i]/lag); */ @@ -481,28 +450,16 @@ void nelp_encoder_fx( L_tmp = L_deposit_h( tmp1 ); L_tmp = Isqrt_lc( L_tmp, &exp1 ); L_tmp = Mult_32_16( L_tmp, sqrt_inv_lag ); -#ifdef BASOP_NOGLOB Ltemp = L_shl_sat( L_tmp, sub( exp1, 12 ) ); /*Q3 */ -#else - Ltemp = L_shl( L_tmp, sub( exp1, 12 ) ); /*Q3 */ -#endif } -#ifdef BASOP_NOGLOB Gains_fx[i] = round_fx_sat( Ltemp ); -#else - Gains_fx[i] = round_fx( Ltemp ); -#endif } Ltemp = L_deposit_l( 0 ); FOR( j = (Word16) ( i * lag ); j < L_FRAME; j++ ) { -#ifdef BASOP_NOGLOB Ltemp = L_mac0_o( Ltemp, in_fx[j], in_fx[j], &Overflow ); /*Q(2*qGain) */ -#else - Ltemp = L_mac0( Ltemp, in_fx[j], in_fx[j] ); /*Q(2*qGain) */ -#endif } /*Gains[i] = (float) sqrt(Gains[i]/(L_FRAME-(lag*i))); */ @@ -516,18 +473,10 @@ void nelp_encoder_fx( L_tmp = L_deposit_h( tmp1 ); L_tmp = Isqrt_lc( L_tmp, &exp1 ); L_tmp = Mult_32_16( L_tmp, sqrt_inv_lframe_lag ); -#ifdef BASOP_NOGLOB Ltemp = L_shl_sat( L_tmp, sub( exp1, 12 ) ); -#else - Ltemp = L_shl( L_tmp, sub( exp1, 12 ) ); -#endif } -#ifdef BASOP_NOGLOB Gains_fx[i] = round_fx_sat( Ltemp ); -#else - Gains_fx[i] = round_fx( Ltemp ); -#endif IF( EQ_16( reduce_gains, 1 ) ) { FOR( i = 0; i < 10; i++ ) @@ -641,13 +590,8 @@ void nelp_encoder_fx( IF( e_Noise > 0 ) { -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( etmp, e_Noise ); /* Result in Q30 */ L_tmp = L_add_sat( 1, L_tmp ); -#else - L_tmp = L_shl( etmp, e_Noise ); /* Result in Q30 */ - L_tmp = L_add( 1, L_tmp ); -#endif exp1 = norm_l( L_tmp ); @@ -694,11 +638,7 @@ void nelp_encoder_fx( Ltemp1 = Mult_32_16( l_nelp_gain_mem, fdbck_fx ); /*exp1+qGain-15 */ L_tmp = L_add( L_tmp, Ltemp1 ); L_tmp = L_shr_r( L_tmp, ( exp1 - 15 ) ); -#ifdef BASOP_NOGLOB Gains_fx[i] = round_fx_sat( L_shl_sat( L_tmp, 16 ) ); -#else - Gains_fx[i] = round_fx( L_shl( L_tmp, 16 ) ); -#endif move16(); l_nelp_gain_mem = L_tmp; } @@ -765,11 +705,7 @@ void nelp_encoder_fx( E3_fx = L_deposit_l( 0 ); FOR( i = 0; i < L_FRAME; i++ ) { -#ifdef BASOP_NOGLOB E3_fx = L_mac_sat( E3_fx, ptr_fx[i], ptr_fx[i] ); /*Q1 */ -#else - E3_fx = L_mac( E3_fx, ptr_fx[i], ptr_fx[i] ); /*Q1 */ -#endif } qE3 = 2 * qGain + 1; move16(); @@ -831,11 +767,7 @@ void nelp_encoder_fx( { Ltemp = L_mult0( R_fx, ptr_fx[i] ); Ltemp = L_shr_r( Ltemp, exp1 ); -#ifdef BASOP_NOGLOB filtRes_fx[i] = round_fx_sat( L_shl_sat( Ltemp, 16 ) ); -#else - filtRes_fx[i] = round_fx( L_shl( Ltemp, 16 ) ); -#endif } qf1 = qGain; @@ -850,11 +782,7 @@ void nelp_encoder_fx( EL2_fx = L_deposit_l( 0 ); FOR( i = 0; i < L_FRAME; i++ ) { -#ifdef BASOP_NOGLOB EL2_fx = L_mac0_sat( EL2_fx, filtRes_fx[i], filtRes_fx[i] ); /*Q(2*qEL2) */ -#else - EL2_fx = L_mac0( EL2_fx, filtRes_fx[i], filtRes_fx[i] ); /*Q(2*qEL2) */ -#endif } qEL2 = 2 * qEL2; move16(); @@ -863,11 +791,7 @@ void nelp_encoder_fx( { Ltemp = L_mult0( R_fx, ptr_fx[i] ); Ltemp = L_shr_r( Ltemp, exp1 ); -#ifdef BASOP_NOGLOB filtRes_fx[i] = round_fx_sat( L_shl_sat( Ltemp, 16 ) ); -#else - filtRes_fx[i] = round_fx( L_shl( Ltemp, 16 ) ); -#endif } qf = qGain; @@ -882,11 +806,7 @@ void nelp_encoder_fx( EH2_fx = L_deposit_l( 0 ); FOR( i = 0; i < L_FRAME; i++ ) { -#ifdef BASOP_NOGLOB EH2_fx = L_mac0_sat( EH2_fx, filtRes_fx[i], filtRes_fx[i] ); /*Q(2*qEH2) */ -#else - EH2_fx = L_mac0( EH2_fx, filtRes_fx[i], filtRes_fx[i] ); /*Q(2*qEH2) */ -#endif } qEH2 = 2 * qEH2; move16(); @@ -898,11 +818,7 @@ void nelp_encoder_fx( move16(); tmp1 = Log2_norm_lc( L_tmp ); Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q15 format = Q0 format */ -#ifdef BASOP_NOGLOB tmp1 = round_fx_sat( L_shl_sat( Ltemp, 12 ) ); /* Q12 */ -#else - tmp1 = round_fx( L_shl( Ltemp, 12 ) ); /* Q12 */ -#endif RL_fx = L_mult0( tmp1, 10 ); } ELSE @@ -918,11 +834,7 @@ void nelp_encoder_fx( move16(); tmp1 = Log2_norm_lc( L_tmp ); Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q15 format = Q0 format */ -#ifdef BASOP_NOGLOB tmp1 = round_fx_sat( L_shl_sat( Ltemp, 12 ) ); /* Q12 */ -#else - tmp1 = round_fx( L_shl( Ltemp, 12 ) ); /* Q12 */ -#endif RL_fx = L_mult0( tmp1, 10 ); } @@ -934,11 +846,7 @@ void nelp_encoder_fx( move16(); tmp1 = Log2_norm_lc( L_tmp ); Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q13 format = Q0 format */ -#ifdef BASOP_NOGLOB tmp1 = round_fx_sat( L_shl_sat( Ltemp, 12 ) ); /* Q12 */ -#else - tmp1 = round_fx( L_shl( Ltemp, 12 ) ); /* Q12 */ -#endif RH_fx = L_mult0( tmp1, 10 ); } ELSE @@ -954,11 +862,7 @@ void nelp_encoder_fx( move16(); tmp1 = Log2_norm_lc( L_tmp ); Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q13 format = Q0 format */ -#ifdef BASOP_NOGLOB tmp1 = round_fx_sat( L_shl_sat( Ltemp, 12 ) ); /* Q12 */ -#else - tmp1 = round_fx( L_shl( Ltemp, 12 ) ); /* Q12 */ -#endif RH_fx = L_mult0( tmp1, 10 ); } @@ -1227,11 +1131,7 @@ void nelp_encoder_ivas_fx( E1_fx = L_deposit_l( 0 ); FOR( i = 0; i < L_FRAME; i++ ) { -#ifdef BASOP_NOGLOB E1_fx = L_mac0_o( E1_fx, in_fx[i], in_fx[i], &Overflow ); /*Q(qE1+qE1) */ -#else - E1_fx = L_mac0( E1_fx, in_fx[i], in_fx[i] ); /*Q(qE1+qE1) */ -#endif } qE1 = shl( qE1, 1 ); @@ -1246,11 +1146,7 @@ void nelp_encoder_ivas_fx( EL1_fx = L_deposit_l( 0 ); FOR( i = 0; i < L_FRAME; i++ ) { -#ifdef BASOP_NOGLOB EL1_fx = L_mac0_o( EL1_fx, filtRes_fx[i], filtRes_fx[i], &Overflow ); /*Q(2*qIn) */ -#else - EL1_fx = L_mac0( EL1_fx, filtRes_fx[i], filtRes_fx[i] ); /*Q(2*qIn) */ -#endif } qEL1 = shl( qEL1, 1 ); @@ -1266,11 +1162,7 @@ void nelp_encoder_ivas_fx( EH1_fx = L_deposit_l( 0 ); FOR( i = 0; i < L_FRAME; i++ ) { -#ifdef BASOP_NOGLOB EH1_fx = L_mac0_o( EH1_fx, filtRes_fx[i], filtRes_fx[i], &Overflow ); /*Q(2*qEH1) */ -#else - EH1_fx = L_mac0( EH1_fx, filtRes_fx[i], filtRes_fx[i] ); /*Q(2*qEH1) */ -#endif } qEH1 = shl( qEH1, 1 ); move16(); @@ -1286,11 +1178,7 @@ void nelp_encoder_ivas_fx( Ltemp = L_deposit_l( 0 ); FOR( j = (Word16) ( i * lag ); j < (Word16) ( ( i + 1 ) * lag ); j++ ) { -#ifdef BASOP_NOGLOB Ltemp = L_mac0_o( Ltemp, in_fx[j], in_fx[j], &Overflow ); /*Q(2*qGain) */ -#else - Ltemp = L_mac0( Ltemp, in_fx[j], in_fx[j] ); /*Q(2*qGain) */ -#endif } /*Gains[i] = (float) sqrt(Gains[i]/lag); */ @@ -1304,17 +1192,9 @@ void nelp_encoder_ivas_fx( L_tmp = L_deposit_h( tmp1 ); L_tmp = Isqrt_lc( L_tmp, &exp1 ); L_tmp = Mult_32_16( L_tmp, sqrt_inv_lag ); -#ifdef BASOP_NOGLOB Ltemp = L_shl_sat( L_tmp, sub( exp1, 12 ) ); /*Q3 */ -#else - Ltemp = L_shl( L_tmp, sub( exp1, 12 ) ); /*Q3 */ -#endif } -#ifdef BASOP_NOGLOB Gains_fx[i] = round_fx_sat( Ltemp ); -#else - Gains_fx[i] = round_fx( Ltemp ); -#endif move16(); } @@ -1322,11 +1202,7 @@ void nelp_encoder_ivas_fx( Ltemp = L_deposit_l( 0 ); FOR( j = i_mult( i, lag ); j < L_FRAME; j++ ) { -#ifdef BASOP_NOGLOB Ltemp = L_mac0_o( Ltemp, in_fx[j], in_fx[j], &Overflow ); /*Q(2*qGain) */ -#else - Ltemp = L_mac0( Ltemp, in_fx[j], in_fx[j] ); /*Q(2*qGain) */ -#endif } /*Gains[i] = (float) sqrt(Gains[i]/(L_FRAME-(lag*i))); */ @@ -1340,18 +1216,10 @@ void nelp_encoder_ivas_fx( L_tmp = L_deposit_h( tmp1 ); L_tmp = Isqrt_lc( L_tmp, &exp1 ); L_tmp = Mult_32_16( L_tmp, sqrt_inv_lframe_lag ); -#ifdef BASOP_NOGLOB Ltemp = L_shl_sat( L_tmp, sub( exp1, 12 ) ); -#else - Ltemp = L_shl( L_tmp, sub( exp1, 12 ) ); -#endif } -#ifdef BASOP_NOGLOB Gains_fx[i] = round_fx_sat( Ltemp ); -#else - Gains_fx[i] = round_fx( Ltemp ); -#endif move16(); IF( EQ_16( reduce_gains, 1 ) ) @@ -1464,13 +1332,8 @@ void nelp_encoder_ivas_fx( IF( e_Noise > 0 ) { -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( etmp, e_Noise ); /* Result in Q30 */ L_tmp = L_add_sat( 1, L_tmp ); -#else - L_tmp = L_shl( etmp, e_Noise ); /* Result in Q30 */ - L_tmp = L_add( 1, L_tmp ); -#endif exp1 = norm_l( L_tmp ); @@ -1517,11 +1380,7 @@ void nelp_encoder_ivas_fx( Ltemp1 = Mult_32_16( l_nelp_gain_mem, fdbck_fx ); /*exp1+qGain-15 */ L_tmp = L_add( L_tmp, Ltemp1 ); L_tmp = L_shr_r( L_tmp, ( exp1 - 15 ) ); -#ifdef BASOP_NOGLOB Gains_fx[i] = round_fx_sat( L_shl_sat( L_tmp, 16 ) ); -#else - Gains_fx[i] = round_fx( L_shl( L_tmp, 16 ) ); -#endif move16(); l_nelp_gain_mem = L_tmp; } @@ -1593,11 +1452,7 @@ void nelp_encoder_ivas_fx( E3_fx = L_deposit_l( 0 ); FOR( i = 0; i < L_FRAME; i++ ) { -#ifdef BASOP_NOGLOB E3_fx = L_mac_sat( E3_fx, ptr_fx[i], ptr_fx[i] ); /*Q1 */ -#else - E3_fx = L_mac( E3_fx, ptr_fx[i], ptr_fx[i] ); /*Q1 */ -#endif } qE3 = add( shl( qGain, 1 ), 1 ); @@ -1656,11 +1511,7 @@ void nelp_encoder_ivas_fx( { Ltemp = L_mult0( R_fx, ptr_fx[i] ); Ltemp = L_shr_r( Ltemp, exp1 ); -#ifdef BASOP_NOGLOB filtRes_fx[i] = round_fx_sat( L_shl_sat( Ltemp, 16 ) ); -#else - filtRes_fx[i] = round_fx( L_shl( Ltemp, 16 ) ); -#endif move16(); } @@ -1676,11 +1527,7 @@ void nelp_encoder_ivas_fx( EL2_fx = L_deposit_l( 0 ); FOR( i = 0; i < L_FRAME; i++ ) { -#ifdef BASOP_NOGLOB EL2_fx = L_mac0_sat( EL2_fx, filtRes_fx[i], filtRes_fx[i] ); /*Q(2*qEL2) */ -#else - EL2_fx = L_mac0( EL2_fx, filtRes_fx[i], filtRes_fx[i] ); /*Q(2*qEL2) */ -#endif } qEL2 = shl( qEL2, 1 ); @@ -1688,11 +1535,7 @@ void nelp_encoder_ivas_fx( { Ltemp = L_mult0( R_fx, ptr_fx[i] ); Ltemp = L_shr_r( Ltemp, exp1 ); -#ifdef BASOP_NOGLOB filtRes_fx[i] = round_fx_sat( L_shl_sat( Ltemp, 16 ) ); -#else - filtRes_fx[i] = round_fx( L_shl( Ltemp, 16 ) ); -#endif move16(); } @@ -1708,11 +1551,7 @@ void nelp_encoder_ivas_fx( EH2_fx = L_deposit_l( 0 ); FOR( i = 0; i < L_FRAME; i++ ) { -#ifdef BASOP_NOGLOB EH2_fx = L_mac0_sat( EH2_fx, filtRes_fx[i], filtRes_fx[i] ); /*Q(2*qEH2) */ -#else - EH2_fx = L_mac0( EH2_fx, filtRes_fx[i], filtRes_fx[i] ); /*Q(2*qEH2) */ -#endif } qEH2 = shl( qEH2, 1 ); IF( EL2_fx == 0 ) @@ -1722,11 +1561,7 @@ void nelp_encoder_ivas_fx( exp2 = sub( sub( 30, exp2 ), qEL1 ); tmp1 = Log2_norm_lc( L_tmp ); Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q15 format = Q0 format */ -#ifdef BASOP_NOGLOB tmp1 = round_fx_sat( L_shl_sat( Ltemp, 12 ) ); /* Q12 */ -#else - tmp1 = round_fx( L_shl( Ltemp, 12 ) ); /* Q12 */ -#endif RL_fx = L_mult0( tmp1, 10 ); } ELSE @@ -1741,11 +1576,7 @@ void nelp_encoder_ivas_fx( exp2 = sub( 30, add( sub( sub( add( 30, qEL1 ), qEL2 ), exp1 ), exp2 ) ); tmp1 = Log2_norm_lc( L_tmp ); Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q15 format = Q0 format */ -#ifdef BASOP_NOGLOB tmp1 = round_fx_sat( L_shl_sat( Ltemp, 12 ) ); /* Q12 */ -#else - tmp1 = round_fx( L_shl( Ltemp, 12 ) ); /* Q12 */ -#endif RL_fx = L_mult0( tmp1, 10 ); } @@ -1756,11 +1587,7 @@ void nelp_encoder_ivas_fx( exp2 = sub( sub( 30, exp2 ), qEH2 ); tmp1 = Log2_norm_lc( L_tmp ); Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q13 format = Q0 format */ -#ifdef BASOP_NOGLOB tmp1 = round_fx_sat( L_shl_sat( Ltemp, 12 ) ); /* Q12 */ -#else - tmp1 = round_fx( L_shl( Ltemp, 12 ) ); /* Q12 */ -#endif RH_fx = L_mult0( tmp1, 10 ); } ELSE @@ -1775,11 +1602,7 @@ void nelp_encoder_ivas_fx( exp2 = sub( 30, add( 30, add( sub( sub( qEH1, qEH2 ), exp1 ), exp2 ) ) ); tmp1 = Log2_norm_lc( L_tmp ); Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q13 format = Q0 format */ -#ifdef BASOP_NOGLOB tmp1 = round_fx_sat( L_shl_sat( Ltemp, 12 ) ); /* Q12 */ -#else - tmp1 = round_fx( L_shl( Ltemp, 12 ) ); /* Q12 */ -#endif RH_fx = L_mult0( tmp1, 10 ); } diff --git a/lib_enc/nois_est_fx.c b/lib_enc/nois_est_fx.c index baf825e71..83c52a5af 100644 --- a/lib_enc/nois_est_fx.c +++ b/lib_enc/nois_est_fx.c @@ -92,11 +92,7 @@ static Word16 noise_est_ln_q8_fx( Flag Overflow = 0; #endif -#ifdef BASOP_NOGLOB L_tmp = L_add_o( L_enr, L_shl( (Word32) 1L, q_new_plus_q_scale ), &Overflow ); /* +1.0f */ -#else /* BASOP_NOGLOB */ - L_tmp = L_add( L_enr, L_shl( (Word32) 1L, q_new_plus_q_scale ) ); /* +1.0f */ -#endif /* BASOP_NOGLOB */ if ( flag_add1p0 == 0 ) { L_tmp = L_add( L_enr, 0 ); /* +0 , no offset */ @@ -671,11 +667,7 @@ void noise_est_down_fx( totalNoise_temp = L_deposit_l( 0 ); FOR( i = min_band; i <= max_band; i++ ) { -#ifdef BASOP_NOGLOB totalNoise_temp = L_add_o( totalNoise_temp, bckr[i], &Overflow ); /*Q_new+QSCALE*/ -#else - totalNoise_temp = L_add( totalNoise_temp, bckr[i] ); /*Q_new+QSCALE*/ -#endif } totalNoise_temp = L_max( totalNoise_temp, L_shl( e_min, 4 ) ); @@ -699,11 +691,7 @@ void noise_est_down_fx( FOR( i = 0; i < NB_BANDS; i++ ) { -#ifdef BASOP_NOGLOB Ltmp = L_add_o( L_shr_r( *pt1, 1 ), L_shr_r( *pt2, 1 ), &Overflow ); -#else /* BASOP_NOGLOB */ - Ltmp = L_add( L_shr_r( *pt1, 1 ), L_shr_r( *pt2, 1 ) ); -#endif /* BASOP_NOGLOB */ /*Ltmp = L_shr_r(L_add(*pt1,*pt2),1);*/ enr[i] = Ltmp; move32(); /*Q_new+QSCALE*/ @@ -1053,13 +1041,8 @@ void noise_est_fx( Ltmp = L_deposit_h( corr_shift ); Ltmp = L_mac( Ltmp, st_fx->voicing_fx[0], 10923 ); -#ifdef BASOP_NOGLOB Ltmp = L_mac_o( Ltmp, st_fx->voicing_fx[1], 10923, &Overflow ); wtmp = mac_ro( Ltmp, st_fx->voicing_fx[2], 10923, &Overflow ); -#else /* BASOP_NOGLOB */ - Ltmp = L_mac( Ltmp, st_fx->voicing_fx[1], 10923 ); - wtmp = mac_r( Ltmp, st_fx->voicing_fx[2], 10923 ); -#endif /* BASOP_NOGLOB */ tmp_pc = pc; move16(); @@ -1113,11 +1096,7 @@ void noise_est_fx( FOR( i = 10; i <= st_fx->max_band; i++ ) { Lnum = L_max( *pt1, *pt2 ); /* Don't need if anymore */ -#ifdef BASOP_NOGLOB Lsum_den = L_add_o( Lsum_den, Lnum, &Overflow ); -#else /* BASOP_NOGLOB */ - Lsum_den = L_add( Lsum_den, Lnum ); -#endif /* BASOP_NOGLOB */ Ltmpden = L_min( *pt1, *pt2 ); if ( Ltmpden == 0 ) { @@ -1173,11 +1152,7 @@ void noise_est_fx( /* calculation of energy in the rest of bands */ Ltmp2 = sum32_fx( &fr_bands[10], sub( st_fx->max_band, 9 ) ); -#ifdef BASOP_NOGLOB wtmp = shl_o( 1, sub( add( Q_new, QSCALE ), 1 ), &Overflow ); -#else /* BASOP_NOGLOB */ - wtmp = shl( 1, sub( add( Q_new, QSCALE ), 1 ) ); -#endif /* BASOP_NOGLOB */ #ifdef IVAS_CODE IF( ncharX != NULL ) { @@ -1199,11 +1174,7 @@ void noise_est_fx( ExpDen = norm_l( Ltmp ); den = extract_h( L_shl( Ltmp, ExpDen ) ); num = div_s( num, den ); -#ifdef BASOP_NOGLOB noise_chartmp = extract_h( L_shr_o( num, add( sub( ExpNum, ExpDen ), 4 - 16 ), &Overflow ) ); /* Q11 */ -#else /* BASOP_NOGLOB */ - noise_chartmp = extract_h( L_shr( num, add( sub( ExpNum, ExpDen ), 4 - 16 ) ) ); /* Q11 */ -#endif /* BASOP_NOGLOB */ } noise_chartmp = s_min( noise_chartmp, (Word16) 10 << 11 ); /* Q11 */ @@ -1246,11 +1217,7 @@ void noise_est_fx( /* alpha = 0.064f * ftemp + 0.75f; */ Ltmp = Mult_32_16( (Word32) 137438953L, tmp ); /* Q31(.064)+Q8+1-16 --> Q24 */ Ltmp = L_mac( Ltmp, 256, 24576 ); /* Q8+Q15(.75)+1 --> Q24 */ -#ifdef BASOP_NOGLOB alpha = round_fx_o( L_shl_o( Ltmp, 7, &Overflow ), &Overflow ); /*Q24 +7 --> Q31 Q15*/ -#else /* BASOP_NOGLOB */ - alpha = round_fx( L_shl( Ltmp, 7 ) ); /*Q24 +7 --> Q31 Q15*/ -#endif /* BASOP_NOGLOB */ /*if( alpha > 0.999f { alpha = 0.999f;} */ alpha = s_min( alpha, 32735 ); /*.999 in Q15*/ @@ -1286,13 +1253,8 @@ void noise_est_fx( /* tmp_enr = enr[i] + 1.0f; */ tmp_Q = add( Q_new, Q_SCALE ); Ltmp = L_shl( (Word32) 1L, tmp_Q ); /* 1.0 added in the right dynamic domain */ -#ifdef BASOP_NOGLOB L_tmp_enr = L_add_o( enr[i], Ltmp, &Overflow ); /* enr scale dynamic */ L_tmp_ave_enr = L_add_o( hNoiseEst->ave_enr_fx[i], Ltmp, &Overflow ); /* ave__enr scale dynamic */ -#else /* BASOP_NOGLOB */ - L_tmp_enr = L_add( enr[i], Ltmp ); /* enr scale dynamic */ - L_tmp_ave_enr = L_add( hNoiseEst->ave_enr_fx[i], Ltmp ); /* ave__enr scale dynamic */ -#endif /* BASOP_NOGLOB */ IF( LE_32( non_sta, th_sta ) ) /* Just to limit the saturation */ { @@ -1311,11 +1273,7 @@ void noise_est_fx( den = extract_h( L_shl( Lden, ExpDen ) ); num = div_s( num, den ); Ltmp = Mult_32_16( non_sta, num ); -#ifdef BASOP_NOGLOB non_sta = L_shr_o( Ltmp, sub( ExpNum, ExpDen ), &Overflow ); /* Q10 */ -#else /* BASOP_NOGLOB */ - non_sta = L_shr( Ltmp, sub( ExpNum, ExpDen ) ); /* Q10 */ -#endif /* BASOP_NOGLOB */ } /* st->ave_enr[i] = alpha * st->ave_enr[i] + (1-alpha) * enr[i];*/ /* update long-term average */ @@ -1337,11 +1295,7 @@ void noise_est_fx( /* ave_enr2:: calculation of another non-stationarity measure (following attacks) */ Ltmp = L_shl( (Word32) 1L, tmp_Q ); /* 1.0 added in the right dynamic domain */ /*L_tmp_enr = L_add(enr[i] , Ltmp );*/ /* enr scale dynamic , done above */ -#ifdef BASOP_NOGLOB L_tmp_ave_enr2 = L_add_o( hNoiseEst->ave_enr2_fx[i], Ltmp, &Overflow ); /* ave__enr scale dynamic */ -#else - L_tmp_ave_enr2 = L_add( hNoiseEst->ave_enr2_fx[i], Ltmp ); /* ave__enr scale dynamic */ -#endif IF( LE_32( Lnon_sta2, th_sta ) ) /* Just to limit the saturation */ { Lnum = L_max( L_tmp_enr, L_tmp_ave_enr2 ); @@ -1354,11 +1308,7 @@ void noise_est_fx( den = extract_h( L_shl( Lden, ExpDen ) ); num = div_s( num, den ); Ltmp1 = Mult_32_16( Lnon_sta2, num ); -#ifdef BASOP_NOGLOB Lnon_sta2 = L_shr_o( Ltmp1, sub( ExpNum, ExpDen ), &Overflow ); /* Q10 */ -#else /* BASOP_NOGLOB */ - Lnon_sta2 = L_shr( Ltmp1, sub( ExpNum, ExpDen ) ); /* Q10 */ -#endif /* BASOP_NOGLOB */ } /* st_ave_enr2[i] = (float)alpha2 * st_ave_enr2[i] @@ -1380,11 +1330,7 @@ void noise_est_fx( /* log_enr = (float)ln_fx(enr[i]); */ log_enr16 = noise_est_ln_q8_fx( enr[i], 0, tmp_Q ); wtmp = abs_s( sub( log_enr16, hSpMusClas->past_log_enr_fx[i - START_BAND_SPMUS] ) ); -#ifdef BASOP_NOGLOB *non_staX = add_o( *non_staX, wtmp, &Overflow ); -#else /* BASOP_NOGLOB */ - *non_staX = add( *non_staX, wtmp ); -#endif /* BASOP_NOGLOB */ move16(); /* Q8 */ hSpMusClas->past_log_enr_fx[i - START_BAND_SPMUS] = log_enr16; move16(); @@ -1399,11 +1345,7 @@ void noise_est_fx( tmp_floor = LN_E_MIN_PLUS_ONE_FX; move16(); /* non dynamic init constant in Q8 */ tmp_floor = noise_est_ln_q8_fx( hNoiseEst->bckr_fx[i], 1, tmp_Q ); -#ifdef BASOP_NOGLOB non_staB = add_o( non_staB, abs_s( sub( tmp_enr, tmp_floor ) ), &Overflow ); /* Q8 */ -#else /* BASOP_NOGLOB */ - non_staB = add( non_staB, abs_s( sub( tmp_enr, tmp_floor ) ) ); /* Q8 */ -#endif /* BASOP_NOGLOB */ } ELSE /*ini_frame < 100*/ { @@ -1412,11 +1354,7 @@ void noise_est_fx( tmp_floor = LN_E_MIN_PLUS_ONE_FX; move16(); /* non dynamic init constant in Q8 */ tmp_floor = noise_est_ln_q8_fx( E_MIN_FX, 1, tmp_Q ); -#ifdef BASOP_NOGLOB non_staB = add_o( non_staB, abs_s( sub( tmp_enr, tmp_floor ) ), &Overflow ); /* Q8 */ -#else /* BASOP_NOGLOB */ - non_staB = add( non_staB, abs_s( sub( tmp_enr, tmp_floor ) ) ); /* Q8 */ -#endif /* BASOP_NOGLOB */ } } @@ -1523,11 +1461,7 @@ void noise_est_fx( Ltmp = eps_quota_fx( epsP_h[0], epsP_l[0], epsP_h[2], epsP_l[2], 12 ); /* Word32 Q12 */ BASOP_SATURATE_WARNING_OFF_EVS /* may saturate*/ -#ifdef BASOP_NOGLOB epsP_0_2 = round_fx_o( L_shl_o( Ltmp, 16, &Overflow ), &Overflow ); /* Q12+16 -16 -> Q12 , NB saturation in Q12 sets max value to 7,999 */ -#else /* BASOP_NOGLOB */ - epsP_0_2 = round_fx( L_shl( Ltmp, 16 ) ); /* Q12+16 -16 -> Q12 , NB saturation in Q12 sets max value to 7,999 */ -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS epsP_0_2 = s_max( 0, epsP_0_2 ); /* min value is 0 , Q12 */ @@ -1566,13 +1500,8 @@ void noise_est_fx( Ltmp = eps_quota_fx( epsP_h[2], epsP_l[2], epsP_h[16], epsP_l[16], 12 ); /* Word32 Q12 */ BASOP_SATURATE_WARNING_OFF_EVS /* may saturate*/ -#ifdef BASOP_NOGLOB epsP_2_16 = round_fx_o( L_shl_o( Ltmp, 16, &Overflow ), &Overflow ); /* Q12+16 -16 -> Q12 , NB saturation in Q12 sets max value to 7,999 */ -#else /* BASOP_NOGLOB */ - epsP_2_16 = round_fx( L_shl( Ltmp, 16 ) ); /* Q12+16 -16 -> Q12 , - NB saturation in Q12 sets max value to 7,999 */ -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS epsP_2_16 = s_max( 0, epsP_2_16 ); /* min value is 0 , Q12 */ @@ -1694,11 +1623,7 @@ void noise_est_fx( *-----------------------------------------------------------------*/ Ltmp = L_mult( st_fx->voicing_fx[0], 16384 ); Ltmp = L_mac( Ltmp, st_fx->voicing_fx[1], 16384 ); -#ifdef BASOP_NOGLOB cor_tmp = mac_ro( Ltmp, corr_shift, MAX_16, &Overflow ); -#else /* BASOP_NOGLOB */ - cor_tmp = mac_r( Ltmp, corr_shift, MAX_16 ); -#endif LepsP = eps_quota_fx( epsP_h[2], epsP_l[2], epsP_h[16], epsP_l[16], 11 ); /* L_epsP in Q11 */ @@ -2453,13 +2378,8 @@ void noise_est_ivas_fx( Ltmp = L_deposit_h( corr_shift ); Ltmp = L_mac( Ltmp, st_fx->voicing_fx[0], 10923 ); -#ifdef BASOP_NOGLOB Ltmp = L_mac_o( Ltmp, st_fx->voicing_fx[1], 10923, &Overflow ); wtmp = mac_ro( Ltmp, st_fx->voicing_fx[2], 10923, &Overflow ); -#else /* BASOP_NOGLOB */ - Ltmp = L_mac( Ltmp, st_fx->voicing_fx[1], 10923 ); - wtmp = mac_r( Ltmp, st_fx->voicing_fx[2], 10923 ); -#endif /* BASOP_NOGLOB */ tmp_pc = pc; move16(); @@ -2605,11 +2525,7 @@ void noise_est_ivas_fx( { /* ftemp2 /= ftemp */ num = div_s( extract_h( Ltmp2 ), extract_h( Ltmp ) ); // 15+exp2-exp -#ifdef BASOP_NOGLOB noise_chartmp = shl_o( num, sub( sub( exp, exp2 ), 4 ), &Overflow ); // 15+exp2-exp1 -> Q11 -#else - noise_chartmp = shl( num, sub( sub( exp, exp2 ), 4 ) ); // 15+exp2-exp1 -> Q11 -#endif } if ( ncharX != NULL ) @@ -2675,11 +2591,7 @@ void noise_est_ivas_fx( /* alpha = 0.064f * ftemp + 0.75f; */ Ltmp = Madd_32_16( 12582912 /* 0.75 in Q24*/, 137438953, tmp ); // Q24 -#ifdef BASOP_NOGLOB alpha = round_fx_o( L_shl_o( Ltmp, 7, &Overflow ), &Overflow ); /*Q24 +7 --> Q31 Q15*/ -#else /* BASOP_NOGLOB */ - alpha = round_fx( L_shl( Ltmp, 7 ) ); /*Q24 +7 --> Q31 Q15*/ -#endif /* BASOP_NOGLOB */ /*if( alpha > 0.999f { alpha = 0.999f;} */ alpha = s_min( alpha, 32735 ); /*.999 in Q15*/ @@ -2743,11 +2655,7 @@ void noise_est_ivas_fx( num = div_s( num, den ); // 15+ExpNum-ExpDen Ltmp1 = Mult_32_16( non_sta, num ); // 15+ExpNum-ExpDen+10-15 -#ifdef BASOP_NOGLOB non_sta = L_shr_o( Ltmp1, sub( ExpNum, ExpDen ), &Overflow ); /* Q10 */ -#else /* BASOP_NOGLOB */ - non_sta = L_shr( Ltmp1, sub( ExpNum, ExpDen ) ); /* Q10 */ -#endif /* BASOP_NOGLOB */ } /* st->ave_enr[i] = alpha * st->ave_enr[i] + (1-alpha) * enr[i];*/ /* update long-term average */ @@ -2786,11 +2694,7 @@ void noise_est_ivas_fx( num = div_s( num, den ); // 15+ExpNum-ExpDen Ltmp1 = Mult_32_16( Lnon_sta2, num ); // 15+ExpNum-ExpDen+10-15 -#ifdef BASOP_NOGLOB Lnon_sta2 = L_shr_o( Ltmp1, sub( ExpNum, ExpDen ), &Overflow ); /* Q10 */ -#else /* BASOP_NOGLOB */ - Lnon_sta2 = L_shr( Ltmp1, sub( ExpNum, ExpDen ) ); /* Q10 */ -#endif /* BASOP_NOGLOB */ } /* st_ave_enr2[i] = (float)alpha2 * st_ave_enr2[i] + (1.0f - alpha2) * (enr[i]) */ @@ -2815,11 +2719,7 @@ void noise_est_ivas_fx( Ltmp1 = Mpy_32_16_1( Ltmp1, 22713 ); // Q15 log_enr16 = round_fx( L_shl( Ltmp1, 9 ) ); /* Q8 */ wtmp = abs_s( sub( log_enr16, hSpMusClas->past_log_enr_fx[i - START_BAND_SPMUS] ) ); -#ifdef BASOP_NOGLOB *non_staX = add_o( *non_staX, wtmp, &Overflow ); -#else /* BASOP_NOGLOB */ - *non_staX = add( *non_staX, wtmp ); -#endif /* BASOP_NOGLOB */ move16(); /* Q8 */ hSpMusClas->past_log_enr_fx[i - START_BAND_SPMUS] = log_enr16; move16(); @@ -2844,11 +2744,7 @@ void noise_est_ivas_fx( IF( LT_16( ini_frame, 100 ) ) { -#ifdef BASOP_NOGLOB non_staB = add_o( non_staB, abs_s( sub( tmp_enr, LN_E_MIN_PLUS_ONE_FX ) ), &Overflow ); /* Q8 */ -#else /* BASOP_NOGLOB */ - non_staB = add( non_staB, abs_s( sub( tmp_enr, tmp_floor ) ) ); /* Q8 */ -#endif } ELSE /*ini_frame < 100*/ { @@ -2864,11 +2760,7 @@ void noise_est_ivas_fx( Ltmp1 = Mpy_32_16_1( Ltmp1, 22713 ); // Q15 tmp_floor = round_fx( L_shl( Ltmp1, 9 ) ); /* Q8 */ } -#ifdef BASOP_NOGLOB non_staB = add_o( non_staB, abs_s( sub( tmp_enr, tmp_floor ) ), &Overflow ); /* Q8 */ -#else /* BASOP_NOGLOB */ - non_staB = add( non_staB, abs_s( sub( tmp_enr, tmp_floor ) ) ); /* Q8 */ -#endif } } diff --git a/lib_enc/normalizecoefs_fx.c b/lib_enc/normalizecoefs_fx.c index f6f5eedee..61d9c3348 100644 --- a/lib_enc/normalizecoefs_fx.c +++ b/lib_enc/normalizecoefs_fx.c @@ -54,13 +54,7 @@ void normalizecoefs_fx( *pcoefs = Mpy_32_16_1( *pcoefs, INV2POWHALF ); move32(); } -#ifdef BASOP_NOGLOB *pcoefs16++ = round_fx_o( L_shl_o( *pcoefs++, 16 - k, &Overflow ), &Overflow ); /* Q12 */ -#else - BASOP_SATURATE_WARNING_OFF_EVS /* May saturate for strong peaks in a high band, in which case saturation is desirable */ - *pcoefs16++ = round_fx( L_shl( *pcoefs++, 16 - k ) ); /* Q12 */ - BASOP_SATURATE_WARNING_ON_EVS -#endif } } diff --git a/lib_enc/pit_enc_fx.c b/lib_enc/pit_enc_fx.c index c91f34e96..3793ee00d 100644 --- a/lib_enc/pit_enc_fx.c +++ b/lib_enc/pit_enc_fx.c @@ -1572,18 +1572,10 @@ void norm_corr_ivas_fx( conv_fx( &exc[k], h, excf, L_subfr ); /* Compute rounded down 1/sqrt(energy of xn[]) */ -#ifdef BASOP_NOGLOB L_tmp = L_mac_o( 1, xn[0], xn[0], &Overflow ); -#else - L_tmp = L_mac( 1, xn[0], xn[0] ); -#endif FOR( i = 1; i < L_subfr; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac_o( L_tmp, xn[i], xn[i], &Overflow ); -#else /* BASOP_NOGLOB */ - L_tmp = L_mac( L_tmp, xn[i], xn[i] ); -#endif } exp = norm_l( L_tmp ); exp = sub( 30, exp ); @@ -1602,11 +1594,7 @@ void norm_corr_ivas_fx( L_tmp = L_mac( 1, xn[0], excf[0] ); FOR( i = 1; i < L_subfr; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac_o( L_tmp, xn[i], excf[i], &Overflow ); -#else - L_tmp = L_mac( L_tmp, xn[i], excf[i] ); -#endif } exp = norm_l( L_tmp ); L_tmp = L_shl( L_tmp, exp ); @@ -1629,13 +1617,8 @@ void norm_corr_ivas_fx( /* Normalize correlation = correlation * (1/sqrt(energy)) */ L_tmp = L_mult( corr, norm ); -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, add( add( exp_corr, exp_norm ), scale ) ); ncorr[t] = round_fx_sat( L_tmp ); -#else - L_tmp = L_shl( L_tmp, add( add( exp_corr, exp_norm ), scale ) ); - ncorr[t] = round_fx( L_tmp ); -#endif /* update the filtered excitation excf[] for the next iteration */ IF( NE_16( t, t_max ) ) @@ -1645,11 +1628,7 @@ void norm_corr_ivas_fx( { /* saturation can occur in add() */ /*excf[i] = add(mult(exc[k], h[i]), excf[i - 1]); move16(); */ -#ifdef BASOP_NOGLOB excf[i] = round_fx_sat( L_mac_sat( L_mult( excf[i - 1], 32767 ), exc[k], h[i] ) ); -#else - excf[i] = round_fx( L_mac( L_mult( excf[i - 1], 32767 ), exc[k], h[i] ) ); -#endif } excf[0] = mult_r( exc[k], h[0] ); move16(); @@ -1687,18 +1666,10 @@ void norm_corr_fx( conv_fx( &exc[k], h, excf, L_subfr ); /* Compute rounded down 1/sqrt(energy of xn[]) */ -#ifdef BASOP_NOGLOB L_tmp = L_mac_o( 1, xn[0], xn[0], &Overflow ); -#else - L_tmp = L_mac( 1, xn[0], xn[0] ); -#endif FOR( i = 1; i < L_subfr; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac_o( L_tmp, xn[i], xn[i], &Overflow ); -#else /* BASOP_NOGLOB */ - L_tmp = L_mac( L_tmp, xn[i], xn[i] ); -#endif } exp = norm_l( L_tmp ); exp = sub( 30, exp ); @@ -1717,11 +1688,7 @@ void norm_corr_fx( L_tmp = L_mac( 1, xn[0], excf[0] ); FOR( i = 1; i < L_subfr; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac_o( L_tmp, xn[i], excf[i], &Overflow ); -#else - L_tmp = L_mac( L_tmp, xn[i], excf[i] ); -#endif } exp = norm_l( L_tmp ); L_tmp = L_shl( L_tmp, exp ); @@ -1732,11 +1699,7 @@ void norm_corr_fx( L_tmp = L_mac( 1, excf[0], excf[0] ); FOR( i = 1; i < L_subfr; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac_o( L_tmp, excf[i], excf[i], &Overflow ); -#else - L_tmp = L_mac( L_tmp, excf[i], excf[i] ); -#endif } exp = norm_l( L_tmp ); @@ -1748,13 +1711,8 @@ void norm_corr_fx( /* Normalize correlation = correlation * (1/sqrt(energy)) */ L_tmp = L_mult( corr, norm ); -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, add( add( exp_corr, exp_norm ), scale ) ); ncorr[t] = round_fx_sat( L_tmp ); -#else - L_tmp = L_shl( L_tmp, add( add( exp_corr, exp_norm ), scale ) ); - ncorr[t] = round_fx( L_tmp ); -#endif /* update the filtered excitation excf[] for the next iteration */ IF( NE_16( t, t_max ) ) @@ -1764,11 +1722,7 @@ void norm_corr_fx( { /* saturation can occur in add() */ /*excf[i] = add(mult(exc[k], h[i]), excf[i - 1]); move16(); */ -#ifdef BASOP_NOGLOB excf[i] = round_fx_sat( L_mac_sat( L_mult( excf[i - 1], 32767 ), exc[k], h[i] ) ); -#else - excf[i] = round_fx( L_mac( L_mult( excf[i - 1], 32767 ), exc[k], h[i] ) ); -#endif move16(); } excf[0] = mult_r( exc[k], h[0] ); diff --git a/lib_enc/pitch_ol2.c b/lib_enc/pitch_ol2.c index 05b32c716..1ce646476 100644 --- a/lib_enc/pitch_ol2.c +++ b/lib_enc/pitch_ol2.c @@ -96,11 +96,7 @@ void StableHighPitchDetect_ivas_fx( L_tmp = L_mult( voicing[0], 10923 /*1/3 in Q15*/ ); L_tmp = L_mac( L_tmp, voicing[1], 10923 /*1/3 in Q15*/ ); L_tmp = L_mac( L_tmp, voicing[2], 10923 /*1/3 in Q15*/ ); -#ifdef BASOP_NOGLOB voicing_m = round_fx_sat( L_tmp ); -#else - voicing_m = round_fx( L_tmp ); -#endif /**voicing_sm = 0.75f*(*voicing_sm) + 0.25f*voicing;*/ *voicing_sm = round_fx( L_mac( L_mult( *voicing_sm, 24576 /*0.75f Q15*/ ), voicing_m, 8192 /*0.25f Q15*/ ) ); move16(); @@ -149,42 +145,22 @@ void StableHighPitchDetect_ivas_fx( tmp = abs_s( tmp ); tmp = div_s( 16384, tmp ); /*Q(15+exp)*/ BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB diff = L_negate( L_shr_o( Mult_32_16( diff, tmp ), sub( exp + 7, 31 ), &Overflow ) ); -#else /* BASOP_NOGLOB */ - diff = L_negate( L_shr( Mult_32_16( diff, tmp ), sub( exp + 7, 31 ) ) ); -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS -#ifdef BASOP_NOGLOB diff16 = round_fx_o( diff, &Overflow ); -#else /* BASOP_NOGLOB */ - diff16 = round_fx( diff ); -#endif /* BASOP_NOGLOB */ } ELSE { tmp = div_s( 16384, tmp ); /*Q(15+exp)*/ BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB diff = L_shr_o( Mult_32_16( diff, tmp ), sub( exp + 7, 31 ), &Overflow ); -#else /* BASOP_NOGLOB */ - diff = L_shr( Mult_32_16( diff, tmp ), sub( exp + 7, 31 ) ); -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS -#ifdef BASOP_NOGLOB diff16 = round_fx_o( diff, &Overflow ); -#else /* BASOP_NOGLOB */ - diff16 = round_fx( diff ); -#endif /* BASOP_NOGLOB */ } } ELSE { -#ifdef BASOP_NOGLOB diff16 = round_fx_o( L_shl_o( diff, 25, &Overflow ), &Overflow ); -#else - diff16 = round_fx( L_shl( diff, 25 ) ); -#endif } test(); test(); @@ -270,11 +246,7 @@ void StableHighPitchDetect_ivas_fx( L_tmp1 = Isqrt_lc( L_tmp1, &exp ); /*Q(31-exp)*/ cor_max = Mult_32_32( cor_max, L_tmp1 ); exp = add( sub( sub( 31, add( shl( Q_new, 1 ), 1 ) ), sub( 31, exp ) ), 31 ); -#ifdef BASOP_NOGLOB cor_max16 = round_fx_o( L_shl_o( cor_max, exp, &Overflow ), &Overflow ); /*Q15*/ -#else /* BASOP_NOGLOB */ - cor_max16 = round_fx( L_shl( cor_max, exp ) ); /*Q15*/ -#endif /**voicing0_sm = add(mult_r(24576 ,(*voicing0_sm)) , mult_r(8192 , cor_max16));*/ *voicing0_sm = round_fx( L_mac( L_mult( 24576 /*.75f Q15*/, *voicing0_sm ), 8192 /*.25f Q15*/, cor_max16 ) ); move16(); diff --git a/lib_enc/pitch_ol2_fx.c b/lib_enc/pitch_ol2_fx.c index 83ea36b17..5d68216c9 100644 --- a/lib_enc/pitch_ol2_fx.c +++ b/lib_enc/pitch_ol2_fx.c @@ -81,13 +81,8 @@ void pitch_ol2_fx( pt_cor_fx = cor_fx; FOR( t = t_min; t <= t_max; t++ ) { -#ifdef BASOP_NOGLOB t0 = L_shl_o( *pt_cor_32++, exp3, &Overflow ); *pt_cor_fx++ = round_fx_o( t0, &Overflow ); -#else - t0 = L_shl( *pt_cor_32++, exp3 ); - *pt_cor_fx++ = round_fx( t0 ); -#endif move16(); } @@ -171,13 +166,8 @@ void pitch_ol2_fx( R2 = L_mult( wsp_fr_fx[0], wsp_fr_fx[0] ); FOR( j = 1; j < L_SUBFR; j++ ) { -#ifdef BASOP_NOGLOB R1 = L_mac_sat( R1, pt_wsp_fx[j], pt_wsp_fx[j] ); R2 = L_mac_sat( R2, wsp_fr_fx[j], wsp_fr_fx[j] ); -#else - R1 = L_mac( R1, pt_wsp_fx[j], pt_wsp_fx[j] ); - R2 = L_mac( R2, wsp_fr_fx[j], wsp_fr_fx[j] ); -#endif } /* *voicing_fr = cor_max * inv_sqrt(enr_wsp * enr_old) */ @@ -191,11 +181,7 @@ void pitch_ol2_fx( exp_R2 = norm_l( R2 ); R2 = L_shl( R2, exp_R2 ); -#ifdef BASOP_NOGLOB R1 = L_mult_o( round_fx_o( R1, &Overflow ), round_fx_o( R2, &Overflow ), &Overflow ); -#else - R1 = L_mult( round_fx( R1 ), round_fx( R2 ) ); -#endif i = norm_l( R1 ); R1 = L_shl( R1, i ); @@ -205,19 +191,11 @@ void pitch_ol2_fx( R1 = Isqrt_lc( R1, &exp_R1 ); -#ifdef BASOP_NOGLOB R1 = L_mult( R0, round_fx_o( R1, &Overflow ) ); -#else - R1 = L_mult( R0, round_fx( R1 ) ); -#endif exp_R0 = sub( 31, exp_R0 ); exp_R0 = sub( add( exp_R0, exp_R1 ), exp3 ); -#ifdef BASOP_NOGLOB *voicing_fr_fx = round_fx_o( L_shl_o( R1, exp_R0, &Overflow ), &Overflow ); /*Q15*/ -#else /* BASOP_NOGLOB */ - *voicing_fr_fx = round_fx( L_shl( R1, exp_R0 ) ); /*Q15*/ -#endif /* BASOP_NOGLOB */ move16(); } ELSE @@ -266,11 +244,7 @@ void StableHighPitchDetect_fx( L_tmp = L_mult( voicing[0], 10923 /*1/3 in Q15*/ ); L_tmp = L_mac( L_tmp, voicing[1], 10923 /*1/3 in Q15*/ ); L_tmp = L_mac( L_tmp, voicing[2], 10923 /*1/3 in Q15*/ ); -#ifdef BASOP_NOGLOB voicing_m = round_fx_sat( L_tmp ); -#else - voicing_m = round_fx( L_tmp ); -#endif /**voicing_sm = 0.75f*(*voicing_sm) + 0.25f*voicing;*/ *voicing_sm = round_fx( L_mac( L_mult( *voicing_sm, 24576 /*0.75f Q15*/ ), voicing_m, 8192 /*0.25f Q15*/ ) ); move16(); @@ -312,42 +286,22 @@ void StableHighPitchDetect_fx( tmp = abs_s( tmp ); tmp = div_s( 16384, tmp ); /*Q(15+exp)*/ BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB diff = L_negate( L_shr_o( Mult_32_16( diff, tmp ), sub( exp + 7, 31 ), &Overflow ) ); -#else /* BASOP_NOGLOB */ - diff = L_negate( L_shr( Mult_32_16( diff, tmp ), sub( exp + 7, 31 ) ) ); -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS -#ifdef BASOP_NOGLOB diff16 = round_fx_o( diff, &Overflow ); -#else /* BASOP_NOGLOB */ - diff16 = round_fx( diff ); -#endif /* BASOP_NOGLOB */ } ELSE { tmp = div_s( 16384, tmp ); /*Q(15+exp)*/ BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB diff = L_shr_o( Mult_32_16( diff, tmp ), sub( exp + 7, 31 ), &Overflow ); -#else /* BASOP_NOGLOB */ - diff = L_shr( Mult_32_16( diff, tmp ), sub( exp + 7, 31 ) ); -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS -#ifdef BASOP_NOGLOB diff16 = round_fx_o( diff, &Overflow ); -#else /* BASOP_NOGLOB */ - diff16 = round_fx( diff ); -#endif /* BASOP_NOGLOB */ } } ELSE { -#ifdef BASOP_NOGLOB diff16 = round_fx_o( L_shl_o( diff, 25, &Overflow ), &Overflow ); -#else - diff16 = round_fx( L_shl( diff, 25 ) ); -#endif } test(); test(); @@ -424,11 +378,7 @@ void StableHighPitchDetect_fx( L_tmp1 = Isqrt_lc( L_tmp1, &exp ); /*Q(31-exp)*/ cor_max = Mult_32_32( cor_max, L_tmp1 ); exp = 31 - ( shl( Q_new, 1 ) + 1 ) - ( 31 - exp ) + 31; -#ifdef BASOP_NOGLOB cor_max16 = round_fx_o( L_shl_o( cor_max, exp, &Overflow ), &Overflow ); /*Q15*/ -#else /* BASOP_NOGLOB */ - cor_max16 = round_fx( L_shl( cor_max, exp ) ); /*Q15*/ -#endif /**voicing0_sm = add(mult_r(24576 ,(*voicing0_sm)) , mult_r(8192 , cor_max16));*/ *voicing0_sm = round_fx( L_mac( L_mult( 24576 /*.75f Q15*/, *voicing0_sm ), 8192 /*.25f Q15*/, cor_max16 ) ); move16(); diff --git a/lib_enc/pitch_ol_fx.c b/lib_enc/pitch_ol_fx.c index 52cd3ad5d..91181714a 100644 --- a/lib_enc/pitch_ol_fx.c +++ b/lib_enc/pitch_ol_fx.c @@ -737,11 +737,7 @@ void pitch_ol_fx( enr1_exp = 0; move16(); -#ifdef BASOP_NOGLOB enr1 = add_o( extract_h( dotp_fx( pt2, pt2, len[j], &enr1_exp ) ), 1, &Overflow ); -#else - enr1 = add( extract_h( dotp_fx( pt2, pt2, len[j], &enr1_exp ) ), 1 ); -#endif enr2 = L_mult( enr0[j], enr1 ); enr2_exp = norm_l( enr2 ); @@ -755,11 +751,7 @@ void pitch_ol_fx( Ltmp = L_mult0( cor_buf[ind], enr1 ); qCorX = add( sub( 15, enr1_exp ), sub( 14, pt_exp1[ind] ) ); -#ifdef BASOP_NOGLOB corX[i][j] = extract_h( L_shr_o( Ltmp, sub( qCorX, 31 ), &Overflow ) ); -#else /* BASOP_NOGLOB */ - corX[i][j] = extract_h( L_shr( Ltmp, sub( qCorX, 31 ) ) ); -#endif /* BASOP_NOGLOB */ qCorX = 31; move16(); @@ -781,11 +773,7 @@ void pitch_ol_fx( move16(); /* selected moving vector */ enr1_exp = 0; move16(); -#ifdef BASOP_NOGLOB enr1 = add_o( extract_h( dotp_fx( pt4, pt4, len1[j], &enr1_exp ) ), 1, &Overflow ); -#else - enr1 = add( extract_h( dotp_fx( pt4, pt4, len1[j], &enr1_exp ) ), 1 ); -#endif enr2 = L_mult( enr0_1[j], enr1 ); enr2_exp = norm_l( enr2 ); @@ -800,11 +788,7 @@ void pitch_ol_fx( Ltmp = L_mult0( cor_buf[ind1 + len_x], enr1 ); qCorX = add( sub( 15, enr1_exp ), sub( 14, pt_exp3[ind1] ) ); -#ifdef BASOP_NOGLOB corX[i][j + NSECT] = extract_h( L_shr_o( Ltmp, qCorX - 31, &Overflow ) ); -#else /* BASOP_NOGLOB */ - corX[i][j + NSECT] = extract_h( L_shr( Ltmp, qCorX - 31 ) ); -#endif /* BASOP_NOGLOB */ qCorX = 31; move16(); @@ -884,11 +868,7 @@ void pitch_ol_fx( move16(); pitch_tmp[i] = pitchX[i][ind]; move16(); -#ifdef BASOP_NOGLOB cor_tmp[i] = add_o( corX[i][ind], corr_shift, &Overflow ); -#else /* BASOP_NOGLOB */ - cor_tmp[i] = add( corX[i][ind], corr_shift ); -#endif /* BASOP_NOGLOB */ move16(); /* Higher is the neighbour's correlation, higher is the weighting */ @@ -902,11 +882,7 @@ void pitch_ol_fx( move16(); pitch_tmp[i + NHFR] = pitchX[i][ind1]; move16(); -#ifdef BASOP_NOGLOB cor_tmp[i + NHFR] = add_o( corX[i][ind1], corr_shift, &Overflow ); -#else /* BASOP_NOGLOB */ - cor_tmp[i + NHFR] = add( corX[i][ind1], corr_shift ); -#endif move16(); /* Higher is the neighbour's correlation, higher is the weighting */ @@ -1727,11 +1703,7 @@ void pitch_ol_ivas_fx( enr1 = ISqrt32( enr1, &enr1_exp ); /* 1/sqrt(energy) */ /*31-enr2_exp*/ Ltmp = Mpy_32_16_1( enr1, cor_buf[ind] ); -#ifdef BASOP_NOGLOB corX[i][j] = extract_h( L_shl_o( Ltmp, add( enr1_exp, cor_buf_exp[ind] ), &Overflow ) ); // Q15 -#else /* BASOP_NOGLOB */ - corX[i][j] = extract_h( L_shl( Ltmp, add( enr1_exp, cor_buf_exp[ind] ) ) ); -#endif /* BASOP_NOGLOB */ move16(); Ltmp = Mpy_32_16_1( enr1, pt_cor0[ind] ); @@ -1769,11 +1741,7 @@ void pitch_ol_ivas_fx( enr1 = ISqrt32( enr1, &enr1_exp ); /* 1/sqrt(energy) */ /*31-enr1_exp*/ Ltmp = Mpy_32_16_1( enr1, cor_buf[ind1 + len_x] ); -#ifdef BASOP_NOGLOB corX[i][j + NSECT] = extract_h( L_shl_o( Ltmp, add( enr1_exp, cor_buf_exp[ind1 + len_x] ), &Overflow ) ); // Q15 -#else /* BASOP_NOGLOB */ - corX[i][j + NSECT] = extract_h( L_shl( Ltmp, add( enr1_exp, cor_buf_exp_len_x1[ind1] ) ) ); -#endif /* BASOP_NOGLOB */ move16(); Ltmp = Mpy_32_16_1( enr1, pt_cor0[ind1 + ( DELTA_COH - 1 ) + len_x] ); @@ -1850,11 +1818,7 @@ void pitch_ol_ivas_fx( move16(); pitch_tmp[i] = pitchX[i][ind]; move16(); -#ifdef BASOP_NOGLOB cor_tmp[i] = add_o( corX[i][ind], corr_shift, &Overflow ); -#else /* BASOP_NOGLOB */ - cor_tmp[i] = add( corX[i][ind], corr_shift ); -#endif /* BASOP_NOGLOB */ move16(); /* Higher is the neighbour's correlation, higher is the weighting */ @@ -1868,11 +1832,7 @@ void pitch_ol_ivas_fx( move16(); pitch_tmp[i + NHFR] = pitchX[i][ind1]; move16(); -#ifdef BASOP_NOGLOB cor_tmp[i + NHFR] = add_o( corX[i][ind1], corr_shift, &Overflow ); -#else /* BASOP_NOGLOB */ - cor_tmp[i + NHFR] = add( corX[i][ind1], corr_shift ); -#endif move16(); /* Higher is the neighbour's correlation, higher is the weighting */ diff --git a/lib_enc/ppp_enc_fx.c b/lib_enc/ppp_enc_fx.c index 3e5de17fa..b9974e202 100644 --- a/lib_enc/ppp_enc_fx.c +++ b/lib_enc/ppp_enc_fx.c @@ -657,15 +657,9 @@ static Word16 DTFS_alignment_fine_new_fx( DTFS_STRUCTURE X1_fx, DTFS_STRUCTURE X FOR( k = 0; k <= HalfLag; k++ ) { -#ifdef BASOP_NOGLOB corr_fx = L_mac_o( corr_fx, ab1[k], C_fx[temp % ( 4 * X2_fx.lag_fx )], &Overflow ); corr_fx = L_mac_o( corr_fx, ab2[k], S_fx[temp % ( 4 * X2_fx.lag_fx )], &Overflow ); temp = add_o( temp, temp1, &Overflow ); -#else - corr_fx = L_mac( corr_fx, ab1[k], C_fx[temp % ( 4 * X2_fx.lag_fx )] ); - corr_fx = L_mac( corr_fx, ab2[k], S_fx[temp % ( 4 * X2_fx.lag_fx )] ); - temp = add( temp, temp1 ); -#endif } temp = sub( 32767, extract_l( L_shr( L_mult( 82, abs_s( n ) ), 1 ) ) ); /* Q15 */ Qcorr = norm_l( corr_fx ); @@ -675,40 +669,23 @@ static Word16 DTFS_alignment_fine_new_fx( DTFS_STRUCTURE X1_fx, DTFS_STRUCTURE X move16(); } -#ifdef BASOP_NOGLOB temp1 = round_fx_o( (Word32) L_shl_o( corr_fx, Qcorr, &Overflow ), &Overflow ); /* Q(Qcorr-16) */ wcorr_fx = L_mult_o( temp1, temp, &Overflow ); /* Q(Qcorr-16+15+1)=Q(Qcorr) */ -#else - temp1 = round_fx( (Word32) L_shl( corr_fx, Qcorr ) ); /* Q(Qcorr-16) */ - wcorr_fx = L_mult( temp1, temp ); /* Q(Qcorr-16+15+1)=Q(Qcorr) */ -#endif IF( GE_16( Qmaxcorr, Qcorr ) ) { -#ifdef BASOP_NOGLOB diff_corr = L_sub_o( wcorr_fx, L_shl_o( maxcorr_fx, sub( Qcorr, Qmaxcorr ), &Overflow ), &Overflow ); /* Qcorr */ -#else - diff_corr = L_sub( wcorr_fx, L_shl( maxcorr_fx, sub( Qcorr, Qmaxcorr ) ) ); /* Qcorr */ -#endif } ELSE { -#ifdef BASOP_NOGLOB diff_corr = L_sub_o( L_shl_o( wcorr_fx, sub( Qmaxcorr, Qcorr ), &Overflow ), maxcorr_fx, &Overflow ); /* Qmaxcorr */ -#else - diff_corr = L_sub( L_shl( wcorr_fx, sub( Qmaxcorr, Qcorr ) ), maxcorr_fx ); /* Qmaxcorr */ -#endif } if ( diff_corr > 0 ) { fshift_fx = n; move16(); -#ifdef BASOP_NOGLOB maxcorr_fx = (Word32) L_shl_o( corr_fx, Qcorr, &Overflow ); /* Qcorr */ -#else - maxcorr_fx = (Word32) L_shl( corr_fx, Qcorr ); /* Qcorr */ -#endif Qmaxcorr = Qcorr; move16(); } @@ -789,15 +766,9 @@ static void LPCPowSpect_fx( t1 = add( t1, (Word16) L_shr( Ltemp, 16 ) ); /* t1 is interpolated cos(w) */ Ltemp = L_shr( L_mult( LPC[i], t1 ), 1 ); /* Ltemp in Q27 */ -#ifdef BASOP_NOGLOB Re = L_add_o( Re, Ltemp, &Overflow ); /* Re=1-sum(LPC[i]*cos(Lw)); */ Ltemp = L_add_o( Lw, 0x6000, &Overflow ); /* add 0.75, which is 3pi/2 to convert sin to cos */ Ltemp = L_shl_o( Ltemp, 10, &Overflow ); /* Q25 */ -#else - Re = L_add( Re, Ltemp ); /* Re=1-sum(LPC[i]*cos(Lw)); */ - Ltemp = L_add( Lw, 0x6000 ); /* add 0.75, which is 3pi/2 to convert sin to cos */ - Ltemp = L_shl( Ltemp, 10 ); /* Q25 */ -#endif w = extract_h( Ltemp ); /* w is equivalent cos index */ dl = extract_l( Ltemp ); /* dl is 6 bit left-over for interpolation */ w = s_and( w, 511 ); @@ -819,13 +790,8 @@ static void LPCPowSpect_fx( t1 = add( t1, (Word16) L_shr( Ltemp, 16 ) ); /* t1 is interpolated cos(w) */ Ltemp = L_shr( L_mult( LPC[i], t1 ), 1 ); /* Ltemp in Q27 */ -#ifdef BASOP_NOGLOB Im = L_sub_o( Im, Ltemp, &Overflow ); /* Im=sum(LPC[i]*sin(Lw)) */ Lw = L_add_o( Lw, freq[k], &Overflow ); /* Lw=(i+1)*freq[k] */ -#else - Im = L_sub( Im, Ltemp ); /* Im=sum(LPC[i]*sin(Lw)) */ - Lw = L_add( Lw, freq[k] ); /* Lw=(i+1)*freq[k] */ -#endif } /* If necessary, we can block-normalize Re and Im to improve precision */ dh = extract_h( Re ); @@ -840,11 +806,7 @@ static void LPCPowSpect_fx( ELSE Lacc = L_mult0( dh, dl ); -#ifdef BASOP_NOGLOB Lacc = L_add_o( L_shr( Lacc, 15 ), L_shr( L_mult_o( dh, dh, &Overflow ), 1 ), &Overflow ); /* Lacc=Re*Re */ -#else - Lacc = L_add( L_shr( Lacc, 15 ), L_shr( L_mult( dh, dh ), 1 ) ); /* Lacc=Re*Re */ -#endif dh = extract_h( Im ); dl = extract_l( Im ); @@ -875,11 +837,7 @@ static void LPCPowSpect_fx( move16(); } Ltemp = L_deposit_h( tmp ); -#ifdef BASOP_NOGLOB out[k] = round_fx_o( L_shl_o( Ltemp, negate( add( exp, 8 ) ), &Overflow ), &Overflow ); -#else - out[k] = round_fx( L_shl( Ltemp, negate( add( exp, 8 ) ) ) ); -#endif /* out[k] = shl(tmp,-exp-8); in Q7 */ } diff --git a/lib_enc/pre_proc_fx.c b/lib_enc/pre_proc_fx.c index 12b09c9eb..bfca1b5c7 100644 --- a/lib_enc/pre_proc_fx.c +++ b/lib_enc/pre_proc_fx.c @@ -1047,11 +1047,7 @@ void pre_proc_fx( test(); IF( ( ( st->tcxonly == 0 ) || ( EQ_16( st->codec_mode, MODE1 ) ) ) && GT_32( st->input_Fs, 8000 ) ) { -#ifdef BASOP_NOGLOB st->mem_preemph_enc = shl_o( new_inp_16k[sub( L_frame_tmp, 1 )], 1, &Overflow ); -#else /* BASOP_NOGLOB */ - st->mem_preemph_enc = shl( new_inp_16k[sub( L_frame_tmp, 1 )], 1 ); -#endif } test(); diff --git a/lib_enc/prot_fx_enc.h b/lib_enc/prot_fx_enc.h index f4ae3d995..a4beb2f4c 100644 --- a/lib_enc/prot_fx_enc.h +++ b/lib_enc/prot_fx_enc.h @@ -845,10 +845,8 @@ Word16 corr_xy1_fx( /* o : pitch gain (0..GAIN_PIT_MAX) Word16 g_corr[], /* o : correlations and -2 */ const Word16 L_subfr, /* i : vector length */ const Word16 norm_flag /* i : flag for constraining pitch contribution */ -#ifdef BASOP_NOGLOB , Flag *Overflow_out /* o : propagating the Overflow flag to upper level */ -#endif ); Word16 E_ACELP_indexing_fx( const Word16 code[] /*Q9*/, const PulseConfig *config, Word16 num_tracks /*Q0*/, Word16 prm[] /*Q(shift_bits)*/ ); @@ -3781,11 +3779,7 @@ void updt_tar_HR_fx( const Word16 L /* i : subframe size */ ); -#ifdef BASOP_NOGLOB Flag conv_fx( -#else -void conv_fx( -#endif const Word16 x[], /* i : i vector Q_new*/ const Word16 h[], /* i : impulse response (or second i vector) Q(15)*/ Word16 y[], /* o : output vetor (result of convolution) 12 bits*/ diff --git a/lib_enc/pvq_core_enc_fx.c b/lib_enc/pvq_core_enc_fx.c index 3b20e82c3..0c8039a79 100644 --- a/lib_enc/pvq_core_enc_fx.c +++ b/lib_enc/pvq_core_enc_fx.c @@ -328,12 +328,8 @@ void pvq_encode_frame_ivas_fx( } tmp = ratio( xy_corr, yy_corr, &exp ); -#ifdef BASOP_NOGLOB gopt[is] = shl_o( tmp, sub( sub( sub( 14, Q_coefs ), shift ), exp ), &Overflow ); move16(); -#else /* BASOP_NOGLOB */ - gopt[is] = shl( tmp, sub( sub( sub( 14, Q_coefs ), shift ), exp ) ); -#endif if ( gopt[is] == 0 ) { @@ -454,11 +450,7 @@ void pvq_encode_frame_fx( } tmp = ratio( xy_corr, yy_corr, &exp ); -#ifdef BASOP_NOGLOB gopt[is] = shl_o( tmp, sub( sub( sub( 14, Q_coefs ), shift ), exp ), &Overflow ); -#else /* BASOP_NOGLOB */ - gopt[is] = shl( tmp, sub( sub( sub( 14, Q_coefs ), shift ), exp ) ); -#endif if ( gopt[is] == 0 ) { @@ -941,11 +933,7 @@ static void densityIndexSymbolEncode_ivas_fx( IF( s_and( (Word16) 0xFFFE, density ) != 0 ) /* even */ { angle = atan2_fx( SQRT_DIM_fx[r_dim], SQRT_DIM_fx[l_dim] ); -#ifdef BASOP_NOGLOB angle = shl_o( angle, 1, &Overflow ); -#else - angle = shl( angle, 1 ); -#endif angle = mult_r( angle, 20861 ); c = mult_r( density, angle ); @@ -1021,11 +1009,7 @@ static void densityIndexSymbolEncode_fx( IF( s_and( (Word16) 0xFFFE, density ) != 0 ) /* even */ { angle = atan2_fx( SQRT_DIM_fx[r_dim], SQRT_DIM_fx[l_dim] ); -#ifdef BASOP_NOGLOB angle = shl_o( angle, 1, &Overflow ); -#else - angle = shl( angle, 1 ); -#endif angle = mult_r( angle, 20861 ); c = mult_r( density, angle ); diff --git a/lib_enc/pvq_encode_fx.c b/lib_enc/pvq_encode_fx.c index b09d77802..6e6e68d19 100644 --- a/lib_enc/pvq_encode_fx.c +++ b/lib_enc/pvq_encode_fx.c @@ -84,13 +84,8 @@ static Word16 one_pulse_search( FOR( i = 0; i < dim; i++ ) /* FOR 3 ops */ { -#ifdef BASOP_NOGLOB L_tmp_corr = L_shl_o( L_mac_o( *L_xy_ptr, 1, x_abs[i], &Overflow ), corr_up_shift, &Overflow ); /* actual in-loop target value, 2 ops */ corr_tmp = round_fx_o( L_tmp_corr, &Overflow ); /* 1 op */ -#else - L_tmp_corr = L_shl( L_mac( *L_xy_ptr, 1, x_abs[i] ), corr_up_shift ); /* actual in-loop target value, 2 ops */ - corr_tmp = round_fx( L_tmp_corr ); /* 1 op */ -#endif corr_sq_tmp = mult( corr_tmp, corr_tmp ); /* CorrSq, is a 16bit for low compelxity cross multiplication 1 op */ L_tmp_en_lc = L_mac( *L_yy_ptr, 1, y[i] ); /*Q1 result , energy may span up to ~14+1(Q1)+1(sign)=16 bits, 1 op */ @@ -262,11 +257,7 @@ void pvq_encode_ivas_fx( proj_fac = div_l( L_num, den ); /* L_num always has to be less than den<<16 */ shift_delta = sub( shift_num, shift_den ); -#ifdef BASOP_NOGLOB L_proj_fac = L_shl_sat( L_deposit_l( proj_fac ), sub( 9, shift_delta ) ); /* bring to a fixed Q12 */ -#else - L_proj_fac = L_shl( L_deposit_l( proj_fac ), sub( 9, shift_delta ) ); /* bring to a fixed Q12 */ -#endif } pulse_tot = 0; @@ -366,14 +357,9 @@ void pvq_encode_ivas_fx( } Mpy_32_16_ss( L_isqrt, tmp, &L_tmp, &u16_tmp ); /* Q31*Q(0+x) +1 */ Mpy_32_16_ss( L_tmp, neg_gain_norm, &L_tmp, &u16_tmp ); /* Q31*Q(0+x) *Q15 +1 */ -#ifdef BASOP_NOGLOB L_tmp = L_shr_o( L_tmp, shift_tot, &Overflow ); /* Q31+x */ xq[i] = round_fx_o( L_tmp, &Overflow ); /* Q15, array move */ move16(); -#else - L_tmp = L_shr( L_tmp, shift_tot ); /* Q31+x */ - xq[i] = round_fx( L_tmp ); /* Q15, array move */ -#endif L_xq[i] = L_tmp; /* Q31 currently unused */ move32(); } @@ -477,11 +463,7 @@ void pvq_encode_fx( proj_fac = div_l( L_num, den ); /* L_num always has to be less than den<<16 */ shift_delta = sub( shift_num, shift_den ); -#ifdef BASOP_NOGLOB L_proj_fac = L_shl_sat( L_deposit_l( proj_fac ), sub( 9, shift_delta ) ); /* bring to a fixed Q12 */ -#else - L_proj_fac = L_shl( L_deposit_l( proj_fac ), sub( 9, shift_delta ) ); /* bring to a fixed Q12 */ -#endif } pulse_tot = 0; @@ -581,13 +563,8 @@ void pvq_encode_fx( } Mpy_32_16_ss( L_isqrt, tmp, &L_tmp, &u16_tmp ); /* Q31*Q(0+x) +1 */ Mpy_32_16_ss( L_tmp, neg_gain_norm, &L_tmp, &u16_tmp ); /* Q31*Q(0+x) *Q15 +1 */ -#ifdef BASOP_NOGLOB L_tmp = L_shr_o( L_tmp, shift_tot, &Overflow ); /* Q31+x */ xq[i] = round_fx_o( L_tmp, &Overflow ); /* Q15, array move */ -#else - L_tmp = L_shr( L_tmp, shift_tot ); /* Q31+x */ - xq[i] = round_fx( L_tmp ); /* Q15, array move */ -#endif L_xq[i] = L_tmp; /* Q31 currently unused */ } diff --git a/lib_enc/q_gain2p_fx.c b/lib_enc/q_gain2p_fx.c index 14d6d5907..e46b7ecf0 100644 --- a/lib_enc/q_gain2p_fx.c +++ b/lib_enc/q_gain2p_fx.c @@ -163,11 +163,7 @@ static Word16 gain_enc( /* o : quantization pitch index /* gain_inov = 1.0f / sqrt((dot_product(code, code, L_SUBFR) + 0.01) / L_SUBFR) */ L_tmp = calc_gain_inov( code, lcode, &L_tmp1, &exp_L_tmp1 ); move16(); -#ifdef BASOP_NOGLOB *gain_inov = round_fx_o( L_shl_o( L_tmp, 15 - 3, &Overflow ), &Overflow ); /* gain_inov in Q12 */ -#else - *gain_inov = round_fx( L_shl( L_tmp, 15 - 3 ) ); /* gain_inov in Q12 */ -#endif /*----------------------------------------------------------------* * calculate the predicted gain code *----------------------------------------------------------------*/ @@ -377,11 +373,7 @@ static Word16 gain_enc( /* o : quantization pitch index /* Here, we use L_mult0 to compensate the factor 0.5 applied to coeff[1..4] before */ L_tmp = L_add( L_tmp, L_shr( L_mult0( p[2 * i + 0], p[2 * i + 0] ), shr_coeff0 ) ); L_tmp = L_sub( L_tmp, L_shr( L_mult( p[2 * i + 0], coeff1 ), shr_coeff1 ) ); -#ifdef BASOP_NOGLOB L_tmp1 = L_sub_o( L_tmp, dist_min, &Overflow ); -#else /* BASOP_NOGLOB */ - L_tmp1 = L_sub( L_tmp, dist_min ); -#endif BASOP_SATURATE_WARNING_ON_EVS if ( L_tmp1 < 0 ) { @@ -401,21 +393,13 @@ static Word16 gain_enc( /* o : quantization pitch index L_tmp = L_mult( g_code, gcode0 ); /* Q11*Q15 -> Q27 */ exp_gcode0 = add( exp_gcode0, -11 ); -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( L_tmp, exp_gcode0, &Overflow ); /* Q27 -> Q16 */ -#else - L_tmp = L_shl( L_tmp, exp_gcode0 ); /* Q27 -> Q16 */ -#endif *gain_code = L_tmp; move32(); /* Q16/Q12 => Q5 */ L_tmp = L_deposit_h( BASOP_Util_Divide3216_Scale( L_tmp, *gain_inov, &i ) ); -#ifdef BASOP_NOGLOB *past_gcode = L_shl_o( L_tmp, sub( i, 15 - 12 ), &Overflow ); -#else - *past_gcode = L_shl( L_tmp, sub( i, 15 - 12 ) ); -#endif return index; } @@ -499,11 +483,7 @@ Word16 gain_enc_uv_fx( /* o : quantization pitch ind /* g_code2 = pred_nrg_frame * norm_code2; */ L_tmp = Mpy_32_16_1( pred_nrg_frame, norm_code2 ); /* 18Q13 */ i = norm_l( L_tmp ); -#ifdef BASOP_NOGLOB g_code2 = round_fx_sat( L_shl_sat( L_tmp, i ) ); -#else - g_code2 = round_fx( L_shl( L_tmp, i ) ); -#endif exp_gcode2 = sub( 18, i ); } ELSE @@ -586,11 +566,7 @@ Word16 gain_enc_uv_fx( /* o : quantization pitch ind } -#ifdef BASOP_NOGLOB *gain_code = L_shl_sat( Mpy_32_16_1( *past_gcode, *gain_inov ), 3 ); -#else - *gain_code = L_shl( Mpy_32_16_1( *past_gcode, *gain_inov ), 3 ); -#endif move32(); *gain_pit = 0; @@ -608,11 +584,7 @@ Word16 gain_enc_uv_fx( /* o : quantization pitch ind } s1 = norm_l( *gain_code ); -#ifdef BASOP_NOGLOB tmp1 = round_fx_o( L_shl_o( *gain_code, s1, &Overflow ), &Overflow ); -#else - tmp1 = round_fx( L_shl( *gain_code, s1 ) ); -#endif s1 = sub( 15, s1 ); tmp1 = mult_r( mult_r( tmp1, tmp1 ), g_coeff->y2y2 ); @@ -625,11 +597,7 @@ Word16 gain_enc_uv_fx( /* o : quantization pitch ind L_tmp1 = L_add( L_tmp, 0 ); s1 = norm_l( *gain_code ); -#ifdef BASOP_NOGLOB tmp1 = round_fx_o( L_shl_o( *gain_code, s1, &Overflow ), &Overflow ); -#else - tmp1 = round_fx( L_shl( *gain_code, s1 ) ); -#endif s1 = sub( 15, s1 ); c_index2 = 0x7FFF; @@ -640,11 +608,7 @@ Word16 gain_enc_uv_fx( /* o : quantization pitch ind { /* c = c_first - L_tmp1 * (L_tmp1 * g_coeff->y1y1 + 2 * (*gain_code) * g_coeff->y1y2); */ s = norm_l( L_tmp1 ); -#ifdef BASOP_NOGLOB tmp = round_fx_sat( L_shl_sat( L_tmp1, s ) ); -#else - tmp = round_fx( L_shl( L_tmp1, s ) ); -#endif s = sub( 15, s ); c_e = BASOP_Util_Add_MantExp( mult_r( tmp, g_coeff->y1y1 ), add( s, g_coeff->y1y1_e ), diff --git a/lib_enc/qlpc_stoch_fx.c b/lib_enc/qlpc_stoch_fx.c index 5a98fb328..d6f0b504f 100644 --- a/lib_enc/qlpc_stoch_fx.c +++ b/lib_enc/qlpc_stoch_fx.c @@ -441,11 +441,7 @@ void Unified_weighting_fx( L_tmp = L_deposit_l( 0 ); FOR( i = 95; i < 127; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_add_o( L_tmp, Bin_Ener_160_fx[i], &Overflow ); /* Q_ener */ -#else - L_tmp = L_add( L_tmp, Bin_Ener_160_fx[i] ); -#endif } L_tmp = L_shr( L_tmp, 5 ); @@ -526,11 +522,7 @@ void Unified_weighting_fx( } ELSE { -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( L_deposit_l( sub_o( w_fft_fx[i], min_fx, &Overflow ) ), 13, &Overflow ); /* Q21 */ -#else - L_tmp = L_shl( L_deposit_l( sub( w_fft_fx[i], min_fx ) ), 13 ); /* Q21 */ -#endif exp = norm_l( L_tmp ); frac = round_fx( L_shl( L_tmp, exp ) ); exp = sub( add( exp, 21 ), 30 ); diff --git a/lib_enc/scale_enc_fx.c b/lib_enc/scale_enc_fx.c index a7119b41f..76eae22b7 100644 --- a/lib_enc/scale_enc_fx.c +++ b/lib_enc/scale_enc_fx.c @@ -97,12 +97,8 @@ void Preemph_scaled( *---------------------------------------------------------------*/ BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB Overflow = 0; QVal = shl_o( 1, sub( 15, bits ), &Overflow ); -#else /* BASOP_NOGLOB */ - QVal = shl( 1, sub( 15, bits ) ); -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS mu = shr( Preemph_factor, bits ); /* Q15 --> Q(15-bits) */ @@ -111,11 +107,7 @@ void Preemph_scaled( /* get max of new preemphased samples (L_FRAME+L_FILT) */ L_tmp = L_mult( new_speech[0], QVal ); -#ifdef BASOP_NOGLOB L_tmp = L_msu_sat( L_tmp, *mem_preemph, mu ); -#else - L_tmp = L_msu( L_tmp, *mem_preemph, mu ); -#endif L_maxloc = L_abs( L_tmp ); FOR( i = 1; i < Lframe; i++ ) @@ -123,11 +115,7 @@ void Preemph_scaled( /* Equivalent to tmp = max((abs(x[i] - mu*x[i-1]),tmp) * finds the max of preemphasized signal */ L_tmp = L_mult( new_speech[i], QVal ); -#ifdef BASOP_NOGLOB L_tmp = L_msu_o( L_tmp, new_speech[i - 1], mu, &Overflow ); -#else /* BASOP_NOGLOB */ - L_tmp = L_msu( L_tmp, new_speech[i - 1], mu ); -#endif /* BASOP_NOGLOB */ L_tmp = L_abs( L_tmp ); L_maxloc = L_max( L_tmp, L_maxloc ); } @@ -177,29 +165,15 @@ void Preemph_scaled( FOR( i = sub( Lframe, 1 ); i > 0; i-- ) { L_tmp = L_mult( new_speech[i], QVal ); -#ifdef BASOP_NOGLOB L_tmp = L_msu_o( L_tmp, new_speech[i - 1], mu, &Overflow ); -#else /* BASOP_NOGLOB */ - L_tmp = L_msu( L_tmp, new_speech[i - 1], mu ); -#endif /* BASOP_NOGLOB */ L_tmp = L_shl( L_tmp, *Q_new ); -#ifdef BASOP_NOGLOB new_speech[i] = round_fx_sat( L_tmp ); // Q_new -#else - new_speech[i] = round_fx( L_tmp ); -#endif } L_tmp = L_mult( new_speech[0], QVal ); -#ifdef BASOP_NOGLOB L_tmp = L_msu_sat( L_tmp, *mem_preemph, mu ); L_tmp = L_shl_sat( L_tmp, *Q_new ); new_speech[0] = round_fx_sat( L_tmp ); -#else - L_tmp = L_msu( L_tmp, *mem_preemph, mu ); - L_tmp = L_shl( L_tmp, *Q_new ); - new_speech[0] = round_fx( L_tmp ); -#endif *mem_preemph = tmp_fixed; move16(); } @@ -255,21 +229,12 @@ Word32 Scale_mem_pre_proc( /* o : Min energy scaled /* Do scaling and valide minimum energy value */ FOR( i = 0; i < NB_BANDS; i++ ) { -#ifdef BASOP_NOGLOB enrO[i] = L_max( L_shl_o( enrO[i], Q_exp, &Overflow ), e_min_scaled ); bckr[i] = L_max( L_shl_o( bckr[i], Q_exp, &Overflow ), e_min_scaled ); ave_enr[i] = L_max( L_shl_o( ave_enr[i], Q_exp, &Overflow ), e_min_scaled ); ave_enr2[i] = L_max( L_shl_o( ave_enr2[i], Q_exp, &Overflow ), e_min_scaled ); st_fr_bands1[i] = L_max( L_shl_o( st_fr_bands1[i], Q_exp, &Overflow ), e_min_scaled ); st_fr_bands2[i] = L_max( L_shl_o( st_fr_bands2[i], Q_exp, &Overflow ), e_min_scaled ); -#else - enrO[i] = L_max( L_shl( enrO[i], Q_exp ), e_min_scaled ); - bckr[i] = L_max( L_shl( bckr[i], Q_exp ), e_min_scaled ); - ave_enr[i] = L_max( L_shl( ave_enr[i], Q_exp ), e_min_scaled ); - ave_enr2[i] = L_max( L_shl( ave_enr2[i], Q_exp ), e_min_scaled ); - st_fr_bands1[i] = L_max( L_shl( st_fr_bands1[i], Q_exp ), e_min_scaled ); - st_fr_bands2[i] = L_max( L_shl( st_fr_bands2[i], Q_exp ), e_min_scaled ); -#endif move32(); move32(); move32(); diff --git a/lib_enc/set_impulse_fx.c b/lib_enc/set_impulse_fx.c index 90a405d7c..9ad5f4a2c 100644 --- a/lib_enc/set_impulse_fx.c +++ b/lib_enc/set_impulse_fx.c @@ -119,21 +119,12 @@ void set_impulse_fx( /* nominator & DEnominator row <0> */ FOR( i = 0; i < L_SUBFR; i++ ) { -#ifdef BASOP_NOGLOB Lrr = L_mac_o( Lrr, gh_fx[i], gh_fx[i], &Overflow ); // Q27 Ldd = L_mac_o( Ldd, gh_fx[i], xn_fx[i], &Overflow ); // Q27 -#else - Lrr = L_mac( Lrr, gh_fx[i], gh_fx[i] ); - Ldd = L_mac( Ldd, gh_fx[i], xn_fx[i] ); -#endif } rr_fx[start1] = Lrr; move32(); -#ifdef BASOP_NOGLOB dd_fx[start1] = round_fx_o( Ldd, &Overflow ); // Q11 -#else - dd_fx[start1] = round_fx( Ldd ); -#endif rr_fx[start1] = L_max( rr_fx[start1], 1 ); FOR( i = add( start1, 1 ); i < L_IMPULSE2; i++ ) @@ -147,26 +138,15 @@ void set_impulse_fx( gh_fx[j] = mac_r( L_deposit_h( gh_fx[j - 1] ), Glottal_cdbk_fx[m * L_IMPULSE + L_IMPULSE2 - i], h_orig_fx[j] ); // Q13 move16(); -#ifdef BASOP_NOGLOB Lrr = L_mac_o( Lrr, gh_fx[j], gh_fx[j], &Overflow ); // Q27 Ldd = L_mac_o( Ldd, gh_fx[j], xn_fx[j], &Overflow ); // Q27 -#else /* BASOP_NOGLOB */ - Lrr = L_mac( Lrr, gh_fx[j], gh_fx[j] ); - Ldd = L_mac( Ldd, gh_fx[j], xn_fx[j] ); -#endif /* BASOP_NOGLOB */ } gh_fx[0] = mult_r( Glottal_cdbk_fx[m * L_IMPULSE + L_IMPULSE2 - i], h_orig_fx[0] ); // Q13 move16(); -#ifdef BASOP_NOGLOB Lrr = L_mac_o( Lrr, gh_fx[0], gh_fx[0], &Overflow ); // Q27 Ldd = L_mac_o( Ldd, gh_fx[0], xn_fx[0], &Overflow ); // Q27 dd_fx[i] = round_fx_sat( Ldd ); // Q11 -#else /* BASOP_NOGLOB */ - Lrr = L_mac( Lrr, gh_fx[0], gh_fx[0] ); - Ldd = L_mac( Ldd, gh_fx[0], xn_fx[0] ); - dd_fx[i] = round_fx( Ldd ); -#endif rr_fx[i] = L_max( Lrr, 1 ); move32(); /* move rr and dd into rr[i] and dd[i] */ @@ -191,11 +171,7 @@ void set_impulse_fx( FOR( j = 1; j <= L_IMPULSE2; j++ ) { /*rr[L_SUBFR-1] += gh[j]*gh[j];*/ -#ifdef BASOP_NOGLOB Lrr = L_mac_sat( Lrr, gh_fx[j], gh_fx[j] ); // Q27 -#else - Lrr = L_mac( Lrr, gh_fx[j], gh_fx[j] ); -#endif } rr_fx[L_SUBFR - 1] = Lrr; move32(); @@ -203,13 +179,8 @@ void set_impulse_fx( FOR( i = L_SUBFR - 2; i >= start2; i-- ) { /*rr[i] = rr[i+1] + gh[L_SUBFR+L_IMPULSE2-1-i]*gh[L_SUBFR+L_IMPULSE2-1-i];*/ -#ifdef BASOP_NOGLOB rr_fx[i] = L_mac_o( rr_fx[i + 1], gh_fx[L_SUBFR + L_IMPULSE2 - 1 - i], gh_fx[L_SUBFR + L_IMPULSE2 - 1 - i], &Overflow ); // Q27 -#else - rr_fx[i] = L_mac( rr_fx[i + 1], gh_fx[L_SUBFR + L_IMPULSE2 - 1 - i], - gh_fx[L_SUBFR + L_IMPULSE2 - 1 - i] ); -#endif move32(); } /* nominator rows */ @@ -230,11 +201,7 @@ void set_impulse_fx( den = extract_h( L_shl( rr_fx[i], exp_den ) ); num = div_s( num, den ); -#ifdef BASOP_NOGLOB krit_fx = shr_o( num, sub( sub( shl_o( exp_num, 1, &Overflow ), exp_den ), 2 ), &Overflow ); /* Q18 */ -#else - krit_fx = shr( num, sub( sub( shl( exp_num, 1 ), exp_den ), 2 ) ); /* Q18 */ -#endif IF( GT_16( krit_fx, krit_max_fx ) ) { @@ -380,16 +347,8 @@ static void correlate_tc_fx( s = L_deposit_l( 0 ); FOR( j = i; j < L_1; j++ ) { -#ifdef BASOP_NOGLOB s = L_mac_sat( s, x[j], h[j - i] ); /* Qx + 16 */ -#else - s = L_mac( s, x[j], h[j - i] ); -#endif } -#ifdef BASOP_NOGLOB y[i] = round_fx_sat( s ); /* Qx */ -#else - y[i] = round_fx( s ); -#endif } } diff --git a/lib_enc/sig_clas_fx.c b/lib_enc/sig_clas_fx.c index 771210ab3..cf5d31d22 100644 --- a/lib_enc/sig_clas_fx.c +++ b/lib_enc/sig_clas_fx.c @@ -154,11 +154,7 @@ Word16 signal_clas_fx( /* o : classification for current Ltmp = L_mac( Ltmp, relEn, 10923 ); Ltmp = L_mac( Ltmp, pcn, 10923 ); -#ifdef BASOP_NOGLOB fmerit1 = round_fx_o( L_shl_o( Ltmp, 16 - 10 - 1, &Overflow ), &Overflow ); /* fmerit1 ->Q15 */ -#else - fmerit1 = round_fx( L_shl( Ltmp, 16 - 10 - 1 ) ); /* fmerit1 ->Q15 */ -#endif /*-----------------------------------------------------------------* * FEC classification diff --git a/lib_enc/spec_flatness_fx.c b/lib_enc/spec_flatness_fx.c index 2ee10bf06..a4e5f39fc 100644 --- a/lib_enc/spec_flatness_fx.c +++ b/lib_enc/spec_flatness_fx.c @@ -300,10 +300,6 @@ void spec_flatness_fx( SFM_Qtmp = sub( SFM_Qtmp, SPEC_AMP_Q ); SFM_Qtmp = sub( SFM_Qtmp, SFM_Q ); -#ifdef BASOP_NOGLOB sSFM[2] = add_sat( mult( sSFM[2], 0x6ccc ), shr_sat( mult( SFM, 0x1333 ), SFM_Qtmp ) ); -#else - sSFM[2] = add( mult( sSFM[2], 0x6ccc ), shr( mult( SFM, 0x1333 ), SFM_Qtmp ) ); -#endif move16(); } diff --git a/lib_enc/speech_music_classif_fx.c b/lib_enc/speech_music_classif_fx.c index 8ef4e7f43..52f793cf2 100644 --- a/lib_enc/speech_music_classif_fx.c +++ b/lib_enc/speech_music_classif_fx.c @@ -700,11 +700,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis L_tmp = L_mult( st_fx->voicing_fx[0], 10923 ); L_tmp = L_mac( L_tmp, st_fx->voicing_fx[1], 10923 ); L_tmp = L_mac( L_tmp, st_fx->voicing_fx[2], 10923 ); -#ifdef BASOP_NOGLOB *pFV++ = round_fx_sat( L_tmp ); -#else - *pFV++ = round_fx( L_tmp ); -#endif } /* [2,3,4,5,6] LSFs Q15*/ @@ -786,18 +782,10 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis sum_PS = L_deposit_l( 0 ); FOR( i = LOWEST_FBIN; i < HIGHEST_FBIN; i++ ) { -#ifdef BASOP_NOGLOB sum_PS = L_add_o( sum_PS, PS[i], &Overflow ); -#else /* BASOP_NOGLOB */ - sum_PS = L_add( sum_PS, PS[i] ); -#endif /* BASOP_NOGLOB */ } exp1 = norm_l( sum_PS ); -#ifdef BASOP_NOGLOB tmp1 = round_fx_o( L_shl( sum_PS, exp1 ), &Overflow ); -#else /* BASOP_NOGLOB */ - tmp1 = round_fx( L_shl( sum_PS, exp1 ) ); -#endif /* BASOP_NOGLOB */ exp1 = sub( 30, exp1 ); FOR( i = LOWEST_FBIN; i < HIGHEST_FBIN; i++ ) @@ -805,11 +793,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis /*PS_norm[i] = PS[i] / sum_PS;*/ /*dPS[i] = (float)fabs(PS_norm[i] - st->past_PS[i]);*/ exp2 = norm_l( PS[i] ); -#ifdef BASOP_NOGLOB tmp2 = round_fx_o( L_shl( PS[i], exp2 ), &Overflow ); -#else /* BASOP_NOGLOB */ - tmp2 = round_fx( L_shl( PS[i], exp2 ) ); -#endif /* BASOP_NOGLOB */ exp2 = sub( 30, exp2 ); scale = shr( sub( tmp1, tmp2 ), 15 ); @@ -879,11 +863,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis ELSE { exp1 = norm_l( L_add( dPS[i], 336 ) ); -#ifdef BASOP_NOGLOB tmp1 = round_fx_o( L_shl_o( L_add( dPS[i], 336 ), exp1, &Overflow ), &Overflow ); -#else - tmp1 = round_fx( L_shl( L_add( dPS[i], 336 ), exp1 ) ); -#endif exp1 = sub( 30, exp1 ); exp2 = norm_l( mx ); @@ -900,11 +880,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis tmp = div_s( tmp2, tmp1 ); /*Q(15+exp3) */ L_tmp = L_shl( tmp, sub( 1, exp3 ) ); /*Q16 */ #ifdef FIX_ISSUE_1151 -#ifdef BASOP_NOGLOB ps_sta = L_add_sat( ps_sta, L_tmp ); /*Q16 */ -#else - ps_sta = L_add( ps_sta, L_tmp ); /*Q16 */ -#endif #else ps_sta = L_add( ps_sta, L_tmp ); /*Q16 */ #endif @@ -913,11 +889,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis /**pFV++ = (float)log(ps_sta + 1e-5f);*/ #ifdef FIX_ISSUE_1151 -#ifdef BASOP_NOGLOB ps_sta = L_add_sat( ps_sta, 336 ); -#else - ps_sta = L_add( ps_sta, 336 ); -#endif #else ps_sta = L_add( ps_sta, 336 ); #endif @@ -957,11 +929,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis FOR( i = 0; i < N_FEATURES; i++ ) { /**pFV = pSF[0] * *pFV + pSF[1];*/ -#ifdef BASOP_NOGLOB *pFV = round_fx_o( L_shl_o( L_mac( pSF_a[i], *pFV, pSF_m[i] ), ishift[i], &Overflow ), &Overflow ); -#else /* BASOP_NOGLOB */ - *pFV = round_fx( L_shl( L_mac( pSF_a[i], *pFV, pSF_m[i] ), ishift[i] ) ); -#endif /* BASOP_NOGLOB */ pFV++; } @@ -991,11 +959,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis FOR( p = 0; p < N_FEATURES; p++ ) { /* xm[p] = FV[p] - m_speech[k*N_FEATURES+p];*/ -#ifdef BASOP_NOGLOB xm[p] = sub_o( FV[p], m_speech_fx[k * N_FEATURES + p], &Overflow ); -#else /* BASOP_NOGLOB */ - xm[p] = sub( FV[p], m_speech_fx[k * N_FEATURES + p] ); -#endif /* BASOP_NOGLOB */ move16(); /*Q15 */ } @@ -1011,11 +975,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis FOR( p = 0; p < N_FEATURES; p++ ) { /*xm[p] = FV[p] - m_noise[k*N_FEATURES+p];*/ -#ifdef BASOP_NOGLOB xm[p] = sub_o( FV[p], m_noise_fx[k * N_FEATURES + p], &Overflow ); -#else /* BASOP_NOGLOB */ - xm[p] = sub( FV[p], m_noise_fx[k * N_FEATURES + p] ); -#endif /* BASOP_NOGLOB */ move16(); /*Q15 */ } @@ -1030,11 +990,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis FOR( p = 0; p < N_FEATURES; p++ ) { /*xm[p] = FV[p] - m_music[k*N_FEATURES+p];*/ -#ifdef BASOP_NOGLOB xm[p] = sub_o( FV[p], m_music_fx[k * N_FEATURES + p], &Overflow ); -#else /* BASOP_NOGLOB */ - xm[p] = sub( FV[p], m_music_fx[k * N_FEATURES + p] ); -#endif /* BASOP_NOGLOB */ move16(); /*Q15 */ } @@ -1048,11 +1004,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis /* calculate log-probability */ /*log(0.0001)-0.5f * N_FEATURES * LOG_PI2 in Q9 */ -#ifdef BASOP_NOGLOB lps = extract_h( L_shl_o( L_sub( max_s, LOG_PROB_CONST ), 16 - 1, &Overflow ) ); /*Q9 */ -#else /* BASOP_NOGLOB */ - lps = extract_h( L_shl( L_sub( max_s, LOG_PROB_CONST ), 16 - 1 ) ); /*Q9 */ -#endif /* BASOP_NOGLOB */ lps = s_max( lps, -10832 ); lpm = extract_h( L_shl( L_sub( max_m, LOG_PROB_CONST ), 16 - 1 ) ); /*Q9 */ @@ -1060,11 +1012,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis /* lpn = (float)log(pyn) - 0.5f * N_FEATURES * (float)log(2*PI); */ -#ifdef BASOP_NOGLOB lpn = extract_h( L_shl_o( L_sub( max_n, LOG_PROB_CONST ), 16 - 1, &Overflow ) ); /*Q9 */ -#else /* BASOP_NOGLOB */ - lpn = extract_h( L_shl( L_sub( max_n, LOG_PROB_CONST ), 16 - 1 ) ); /*Q9 */ -#endif /* BASOP_NOGLOB */ lpn = s_max( lpn, -10832 ); *high_lpn_flag_ptr = 0; @@ -1551,11 +1499,7 @@ static Word16 attack_det_fx( /* o : attack flag FOR( j = 1; j < ATT_SEG_LEN; j++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac0_o( L_tmp, inp[i * ATT_SEG_LEN + j], inp[i * ATT_SEG_LEN + j], &Overflow ); /*2*Qx */ -#else /* BASOP_NOGLOB */ - L_tmp = L_mac0( L_tmp, inp[i * ATT_SEG_LEN + j], inp[i * ATT_SEG_LEN + j] ); /*2*Qx */ -#endif /* BASOP_NOGLOB */ } finc[i] = L_tmp; @@ -1579,19 +1523,11 @@ static Word16 attack_det_fx( /* o : attack flag exp1 = norm_s( att_3lsub_pos ); tmp = div_s( shl( 1, sub( 14, exp1 ) ), att_3lsub_pos ); /*Q(29-exp1) */ -#ifdef BASOP_NOGLOB L_tmp = L_shr_o( finc[0], Qx, &Overflow ); /*Qx */ -#else /* BASOP_NOGLOB */ - L_tmp = L_shr( finc[0], Qx ); /*Qx */ -#endif /* BASOP_NOGLOB */ FOR( i = 1; i < att_3lsub_pos; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_add_o( L_tmp, L_shr_o( finc[i], Qx, &Overflow ), &Overflow ); /*Qx */ -#else /* BASOP_NOGLOB */ - L_tmp = L_add( L_tmp, L_shr( finc[i], Qx ) ); /*Qx */ -#endif /* BASOP_NOGLOB */ } L_tmp = Mult_32_16( L_tmp, tmp ); /*Q(14-exp1+Qx) */ etmp = L_shl( L_tmp, sub( exp1, 14 ) ); /*Qx */ @@ -1600,18 +1536,10 @@ static Word16 attack_det_fx( /* o : attack flag exp1 = norm_s( tmp1 ); tmp = div_s( shl( 1, sub( 14, exp1 ) ), tmp1 ); /*Q(29-exp1) */ -#ifdef BASOP_NOGLOB L_tmp = L_shr_o( finc[attack], Qx, &Overflow ); /*Qx */ -#else /* BASOP_NOGLOB */ - L_tmp = L_shr( finc[attack], Qx ); /*Qx */ -#endif /* BASOP_NOGLOB */ FOR( i = 1; i < tmp1; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_add_o( L_tmp, L_shr_o( finc[i + attack], Qx, &Overflow ), &Overflow ); /*Qx */ -#else /* BASOP_NOGLOB */ - L_tmp = L_add( L_tmp, L_shr( finc[i + attack], Qx ) ); /*Qx */ -#endif /* BASOP_NOGLOB */ } L_tmp = Mult_32_16( L_tmp, tmp ); /*Q(14-exp1+Qx) */ etmp2 = L_shl( L_tmp, sub( exp1, 14 ) ); /*Qx */ @@ -2735,11 +2663,7 @@ static Word16 attack_det_ivas_fx( /* o : attack flag FOR( j = 1; j < ATT_SEG_LEN; j++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac0_o( L_tmp, inp[i * ATT_SEG_LEN + j], inp[i * ATT_SEG_LEN + j], &Overflow ); /*2*Qx */ -#else /* BASOP_NOGLOB */ - L_tmp = L_mac0( L_tmp, inp[i * ATT_SEG_LEN + j], inp[i * ATT_SEG_LEN + j] ); /*2*Qx */ -#endif /* BASOP_NOGLOB */ } finc[i] = L_tmp; @@ -2762,19 +2686,11 @@ static Word16 attack_det_ivas_fx( /* o : attack flag exp1 = norm_s( att_3lsub_pos ); tmp = div_s( shl( 1, sub( 14, exp1 ) ), att_3lsub_pos ); /*Q(29-exp1) */ -#ifdef BASOP_NOGLOB L_tmp = L_shr_o( finc[0], Qx, &Overflow ); /*Qx */ -#else /* BASOP_NOGLOB */ - L_tmp = L_shr( finc[0], Qx ); /*Qx */ -#endif /* BASOP_NOGLOB */ FOR( i = 1; i < att_3lsub_pos; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_add_o( L_tmp, L_shr_o( finc[i], Qx, &Overflow ), &Overflow ); /*Qx */ -#else /* BASOP_NOGLOB */ - L_tmp = L_add( L_tmp, L_shr( finc[i], Qx ) ); /*Qx */ -#endif /* BASOP_NOGLOB */ } L_tmp = Mult_32_16( L_tmp, tmp ); /*Q(14-exp1+Qx) */ etmp = L_shl( L_tmp, sub( exp1, 14 ) ); /*Qx */ @@ -2783,18 +2699,10 @@ static Word16 attack_det_ivas_fx( /* o : attack flag exp1 = norm_s( tmp1 ); tmp = div_s( shl( 1, sub( 14, exp1 ) ), tmp1 ); /*Q(29-exp1) */ -#ifdef BASOP_NOGLOB L_tmp = L_shr_o( finc[attack], Qx, &Overflow ); /*Qx */ -#else /* BASOP_NOGLOB */ - L_tmp = L_shr( finc[attack], Qx ); /*Qx */ -#endif /* BASOP_NOGLOB */ FOR( i = 1; i < tmp1; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_add_o( L_tmp, L_shr_o( finc[i + attack], Qx, &Overflow ), &Overflow ); /*Qx */ -#else /* BASOP_NOGLOB */ - L_tmp = L_add( L_tmp, L_shr( finc[i + attack], Qx ) ); /*Qx */ -#endif /* BASOP_NOGLOB */ } L_tmp = Mult_32_16( L_tmp, tmp ); /*Q(14-exp1+Qx) */ etmp2 = L_shl( L_tmp, sub( exp1, 14 ) ); /*Qx */ @@ -3702,11 +3610,7 @@ static void flux_fx( { IF( p2v_map[i] != 0 ) { -#ifdef BASOP_NOGLOB L_flux = L_add_sat( L_flux, abs_s( sub_sat( Bin_E[i], old_Bin_E[i] ) ) ); /*Q7 */ -#else - L_flux = L_add( L_flux, abs_s( sub( Bin_E[i], old_Bin_E[i] ) ) ); /*Q7 */ -#endif } if ( p2v_map[i] != 0 ) { @@ -3863,11 +3767,7 @@ static void spec_analysis_fx( test(); IF( GT_16( peak_idx[k], valey_idx[i] ) && LT_16( peak_idx[k], valey_idx[i + 1] ) ) { -#ifdef BASOP_NOGLOB p2v[k] = sub_o( shl_o( peak[k], 1, &Overflow ), add_o( valley[i], valley[i + 1], &Overflow ), &Overflow ); -#else /* BASOP_NOGLOB */ - p2v[k] = sub( shl( peak[k], 1 ), add( valley[i], valley[i + 1] ) ); -#endif /* BASOP_NOGLOB */ k = add( k, 1 ); } } @@ -4139,11 +4039,7 @@ static void music_mixed_classif_improv_fx( expn = sub( sub( 30, expn ), Q_epsP - 4 ); expd = norm_l( ftmp ); -#ifdef BASOP_NOGLOB fracd = round_fx_sat( L_shl( ftmp, expd ) ); -#else - fracd = round_fx( L_shl( ftmp, expd ) ); -#endif expd = sub( sub( 30, expd ), sub( Q_epsP, 4 ) ); scale = shr( sub( fracd, fracn ), 15 ); @@ -4309,11 +4205,7 @@ static void tonal_context_improv_fx( tmp = div_s( fraca, fracb ); exp1 = sub( expa, expb ); -#ifdef BASOP_NOGLOB tonality1 = L_shl_o( tmp, exp1, &Overflow ); -#else /* BASOP_NOGLOB */ - tonality1 = L_shl( tmp, exp1 ); -#endif } ELSE { @@ -4344,11 +4236,7 @@ static void tonal_context_improv_fx( tmp = div_s( fraca, fracb ); exp2 = sub( expa, expb ); -#ifdef BASOP_NOGLOB tonality2 = L_shl_o( tmp, exp2, &Overflow ); -#else - tonality2 = L_shl( tmp, exp2 ); -#endif } ELSE { @@ -4378,11 +4266,7 @@ static void tonal_context_improv_fx( tmp = div_s( fraca, fracb ); exp3 = sub( expa, expb ); -#ifdef BASOP_NOGLOB tonality3 = L_shl_o( tmp, exp3, &Overflow ); -#else - tonality3 = L_shl( tmp, exp3 ); -#endif } ELSE { @@ -4394,11 +4278,7 @@ static void tonal_context_improv_fx( /* voi_mean = 0.33f * (st->voicing_fx[0] + voicing[1] + voicing[2]); */ L_tmp = L_mult( st_fx->voicing_fx[0], 10923 ); L_tmp = L_mac( L_tmp, st_fx->voicing_fx[1], 10923 ); -#ifdef BASOP_NOGLOB // -dtx 12650 amrwb\Dtx3.INP voi_mean = mac_r_sat( L_tmp, st_fx->voicing_fx[2], 10923 ); /* Q15 */ -#else - voi_mean = mac_r( L_tmp, st_fx->voicing_fx[2], 10923 ); /* Q15 */ -#endif test(); IF( EQ_16( hVAD->hangover_cnt, 10 ) && EQ_16( st_fx->vad_flag, 1 ) ) { diff --git a/lib_enc/stat_noise_uv_enc_fx.c b/lib_enc/stat_noise_uv_enc_fx.c index 1045d8efd..b6d507bd9 100644 --- a/lib_enc/stat_noise_uv_enc_fx.c +++ b/lib_enc/stat_noise_uv_enc_fx.c @@ -63,23 +63,11 @@ void stat_noise_uv_enc_fx( *-----------------------------------------------------------------*/ /* epsP[2] is located in LepsP[0] and epsP[16] in LepsP[1] */ expn = sub( norm_l( LepsP[0] ), 1 ); -#ifdef BASOP_NOGLOB num = extract_h( L_shl_o( LepsP[0], expn, &Overflow ) ); /*expn-16*/ -#else - num = extract_h( L_shl( LepsP[0], expn ) ); /*expn-16*/ -#endif expd = norm_l( LepsP[1] ); -#ifdef BASOP_NOGLOB den = extract_h( L_shl_o( LepsP[1], expd, &Overflow ) ); /*expd-16*/ -#else - den = extract_h( L_shl( LepsP[1], expd ) ); /*expd-16*/ -#endif num = div_s( num, den ); /*expn-expd+15*/ -#ifdef BASOP_NOGLOB num = shr_o( num, add( sub( expn, expd ), 5 ), &Overflow ); /*Q10*/ -#else - num = shr( num, add( sub( expn, expd ), 5 ) ); /*Q10*/ -#endif num = sub( num, 1024 ); /*num - 1*/ test(); @@ -148,23 +136,11 @@ void stat_noise_uv_enc_ivas_fx( *-----------------------------------------------------------------*/ /* epsP[2] is located in LepsP[0] and epsP[16] in LepsP[1] */ expn = sub( norm_l( LepsP[0] ), 1 ); -#ifdef BASOP_NOGLOB num = extract_h( L_shl_o( LepsP[0], expn, &Overflow ) ); /*expn-16*/ -#else - num = extract_h( L_shl( LepsP[0], expn ) ); /*expn-16*/ -#endif expd = norm_l( LepsP[1] ); -#ifdef BASOP_NOGLOB den = extract_h( L_shl_o( LepsP[1], expd, &Overflow ) ); /*expd-16*/ -#else - den = extract_h( L_shl( LepsP[1], expd ) ); /*expd-16*/ -#endif num = div_s( num, den ); /*expn-expd+15*/ -#ifdef BASOP_NOGLOB num = shr_o( num, add( sub( expn, expd ), 5 ), &Overflow ); /*Q10*/ -#else - num = shr( num, add( sub( expn, expd ), 5 ) ); /*Q10*/ -#endif num = sub( num, 1024 ); /*num - 1*/ test(); diff --git a/lib_enc/swb_bwe_enc_fx.c b/lib_enc/swb_bwe_enc_fx.c index 155b7298f..fb2bb602a 100644 --- a/lib_enc/swb_bwe_enc_fx.c +++ b/lib_enc/swb_bwe_enc_fx.c @@ -409,11 +409,7 @@ void swb_bwe_enc_ivas_fx( *----------------------------------------------------------------------*/ /* tilt returned in Q24 goto to Q11 */ -#ifdef BASOP_NOGLOB tilt_nb_fx = round_fx_o( L_shl_o( calc_tilt_bwe_fx( old_input_lp_fx, Q_slb_speech, st_fx->L_frame ), 3, &Overflow ), &Overflow ); -#else - tilt_nb_fx = round_fx( L_shl( calc_tilt_bwe_fx( old_input_lp_fx, Q_slb_speech, st_fx->L_frame ), 3 ) ); -#endif /*---------------------------------------------------------------------* * SWB BWE encoding * FB BWE encoding @@ -547,11 +543,7 @@ void swb_bwe_enc_ivas_fx( L_tmp = L_shl( L_tmp, exp1 ); exp = sub( sub( 31, exp1 ), sub( 30, exp ) ); L_tmp = Isqrt_lc( L_tmp, &exp ); /*31-exp */ -#ifdef BASOP_NOGLOB fb_ener_adjust_fx = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); /*Q15 */ -#else - fb_ener_adjust_fx = round_fx( L_shl( L_tmp, exp ) ); /*Q15 */ -#endif } ELSE { @@ -680,11 +672,7 @@ void swb_bwe_enc_fx( *----------------------------------------------------------------------*/ /* tilt returned in Q24 goto to Q11 */ -#ifdef BASOP_NOGLOB tilt_nb_fx = round_fx_o( L_shl_o( calc_tilt_bwe_fx( old_input_lp_fx, Q_slb_speech, st_fx->L_frame ), 3, &Overflow ), &Overflow ); -#else - tilt_nb_fx = round_fx( L_shl( calc_tilt_bwe_fx( old_input_lp_fx, Q_slb_speech, st_fx->L_frame ), 3 ) ); -#endif /*---------------------------------------------------------------------* * SWB BWE encoding * FB BWE encoding @@ -805,11 +793,7 @@ void swb_bwe_enc_fx( L_tmp = L_shl( L_tmp, exp1 ); exp = 31 - exp1 - ( 30 - exp ); L_tmp = Isqrt_lc( L_tmp, &exp ); /*31-exp */ -#ifdef BASOP_NOGLOB fb_ener_adjust_fx = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); /*Q15 */ -#else - fb_ener_adjust_fx = round_fx( L_shl( L_tmp, exp ) ); /*Q15 */ -#endif } ELSE { @@ -869,15 +853,9 @@ static Word16 WB_BWE_fenv_q_fx( /* o: quantized gain i dist = L_deposit_l( 0 ); FOR( j = 0; j < cb_dim; j++ ) { -#ifdef BASOP_NOGLOB tmp = sub_sat( x[j], *pit ); /*Q10 */ L_tmp = L_mult0( tmp, tmp ); /*Q(10+10)->Q20 */ dist = L_add_sat( dist, L_tmp ); -#else - tmp = sub( x[j], *pit ); /*Q10 */ - L_tmp = L_mult0( tmp, tmp ); /*Q(10+10)->Q20 */ - dist = L_add( dist, L_tmp ); -#endif pit++; } @@ -1053,45 +1031,25 @@ static Word16 FD_BWE_class_fx( /* o : FD BWE class { IF( hBWE_FD->prev_global_gain_fx == 0 ) { -#ifdef BASOP_NOGLOB gain_tmp = round_fx_o( L_shl_o( fGain, 30, &Overflow ), &Overflow ); /*Q14 */ -#else - gain_tmp = round_fx( L_shl( fGain, 30 ) ); /*Q14 */ -#endif } ELSE { expn = norm_l( fGain ); -#ifdef BASOP_NOGLOB num = extract_h( L_shl_o( fGain, expn, &Overflow ) ); -#else - num = extract_h( L_shl( fGain, expn ) ); -#endif expn = sub( sub( 30, expn ), shl( Q_shb, 1 ) ); expd = norm_l( hBWE_FD->prev_global_gain_fx ); -#ifdef BASOP_NOGLOB den = extract_h( L_shl_o( hBWE_FD->prev_global_gain_fx, expd, &Overflow ) ); -#else - den = extract_h( L_shl( hBWE_FD->prev_global_gain_fx, expd ) ); -#endif expd = sub( sub( 30, expd ), shl( st_fx->prev_Q_shb, 1 ) ); scale = shr( sub( den, num ), 15 ); -#ifdef BASOP_NOGLOB num = shl_o( num, scale, &Overflow ); -#else - num = shl( num, scale ); -#endif expn = sub( expn, scale ); tmp = div_s( num, den ); expn = sub( expn, expd ); -#ifdef BASOP_NOGLOB gain_tmp = shl_o( tmp, sub( expn, 1 ), &Overflow ); /*Q14 */ -#else - gain_tmp = shl( tmp, sub( expn, 1 ) ); /*Q14 */ -#endif } test(); IF( EQ_16( hBWE_FD->prev_mode, TRANSIENT ) ) @@ -1183,11 +1141,7 @@ static Word16 FD_BWE_class_fx( /* o : FD BWE class expd = norm_s( den ); tmp = div_s( shl( 1, sub( 14, expd ) ), den ); /*Q(29-expd-Q_syn) */ L_tmp = L_mult( tmp, peak ); /*Q(30-expd) */ -#ifdef BASOP_NOGLOB sharp = round_fx_o( L_shl_o( L_tmp, sub( expd, 4 ), &Overflow ), &Overflow ); /*Q10 */ -#else - sharp = round_fx( L_shl( L_tmp, sub( expd, 4 ) ) ); /*Q10 */ -#endif } ELSE { @@ -1196,11 +1150,7 @@ static Word16 FD_BWE_class_fx( /* o : FD BWE class } test(); -#ifdef BASOP_NOGLOB IF( GT_16( sharp, 4608 ) && GT_16( peak, shl_o( 1, add( Q_syn, 3 ), &Overflow ) ) ) -#else - IF( GT_16( sharp, 4608 ) && GT_16( peak, shl( 1, add( Q_syn, 3 ) ) ) ) -#endif { k = add( k, 1 ); move16(); @@ -1343,11 +1293,7 @@ static void freq_weights_fx( { exp = norm_s( tmp ); tmp = div_s( shl( 1, sub( 14, exp ) ), tmp ); /*(21-exp) */ -#ifdef BASOP_NOGLOB tmp = shl_sat( tmp, sub( exp, 6 ) ); /*Q15 */ -#else - tmp = shl( tmp, sub( exp, 6 ) ); /*Q15 */ -#endif } ELSE { @@ -1411,22 +1357,14 @@ static void vqWithCand_w_fx( FOR( i = 0; i < E_ROM_dico_size; i++ ) { -#ifdef BASOP_NOGLOB dist = sub_o( x[0], *p_E_ROM_dico++, &Overflow ); /*Q8 */ -#else - dist = sub( x[0], *p_E_ROM_dico++ ); /*Q8 */ -#endif L_dist = L_mult( dist, w[0] ); /*Q22 */ L_dist = Mult_32_16( L_dist, dist ); /*Q15 */ L_dist = L_shr( L_dist, 10 ); /*Q5 */ FOR( j = 1; j < dim; j++ ) { -#ifdef BASOP_NOGLOB temp1 = sub_o( x[j], *p_E_ROM_dico++, &Overflow ); -#else - temp1 = sub( x[j], *p_E_ROM_dico++ ); -#endif L_tmp = L_mult( temp1, w[j] ); /*Q22 */ L_tmp = Mult_32_16( L_tmp, temp1 ); /*Q15 */ L_dist = L_add( L_dist, L_shr( L_tmp, 10 ) ); /*Q5 */ @@ -1467,13 +1405,8 @@ static void vqWithCand_w_fx( FOR( i = 0; i < E_ROM_dico_size; i++ ) { -#ifdef BASOP_NOGLOB dist = sub_sat( x[0], *p_E_ROM_dico++ ); /*Q8 */ L_dist = L_mult_sat( dist, dist ); /*Q17 */ -#else - dist = sub( x[0], *p_E_ROM_dico++ ); /*Q8 */ - L_dist = L_mult( dist, dist ); /*Q17 */ -#endif L_dist = L_shr( L_dist, 12 ); /*Q5 */ FOR( j = 1; j < dim; j++ ) @@ -1747,21 +1680,13 @@ static void msvq_interpol_fx( /* Extract vector for odd position */ FOR( n_band = 0; n_band < DIM11; n_band++ ) { -#ifdef BASOP_NOGLOB quant_tmp[n_band] = add_o( quant_tmp1[n_band], quant_tmp2[n_band], &Overflow ); -#else - quant_tmp[n_band] = add( quant_tmp1[n_band], quant_tmp2[n_band] ); -#endif move16(); } FOR( n_band = 0; n_band < DIM12 - 1; n_band++ ) { -#ifdef BASOP_NOGLOB tmp = add_o( quant_tmp[n_band], quant_tmp[n_band + 1], &Overflow ); /*Q8 */ -#else - tmp = add( quant_tmp[n_band], quant_tmp[n_band + 1] ); /*Q8 */ -#endif tmp = shr( tmp, 1 ); quant_tmp2[n_band] = sub( env_temp12[n_band], tmp ); move16(); /*Q8 */ @@ -1784,11 +1709,7 @@ static void msvq_interpol_fx( FOR( n_band = 0; n_band < DIM12 - 1; n_band++ ) { -#ifdef BASOP_NOGLOB tmp = add_o( quant_tmp[n_band], quant_tmp[n_band + 1], &Overflow ); -#else - tmp = add( quant_tmp[n_band], quant_tmp[n_band + 1] ); -#endif tmp = shr( tmp, 1 ); quant_select[add( shl( n_band, 1 ), 1 )] = add( tmp, quant_tmp2[n_band] ); move16(); /*Q8 */ @@ -1908,15 +1829,9 @@ static void msvq_interpol_2_fx( move16(); FOR( n_band = 1; n_band < DIM12 - 1; n_band++ ) { -#ifdef BASOP_NOGLOB tmp_q = add_o( quant_tmp[n_band - 1], quant_tmp[n_band], &Overflow ); tmp_q = shr( tmp_q, 1 ); quant_tmp2[n_band] = sub_o( env_temp12[n_band], tmp_q, &Overflow ); -#else - tmp_q = add( quant_tmp[n_band - 1], quant_tmp[n_band] ); - tmp_q = shr( tmp_q, 1 ); - quant_tmp2[n_band] = sub( env_temp12[n_band], tmp_q ); -#endif move16(); } @@ -1937,15 +1852,9 @@ static void msvq_interpol_2_fx( move16(); /*Q8 */ FOR( n_band = 1; n_band < DIM12 - 1; n_band++ ) { -#ifdef BASOP_NOGLOB tmp_q = add_o( quant_tmp[n_band - 1], quant_tmp[n_band], &Overflow ); tmp_q = shr( tmp_q, 1 ); quant_select[sub( shl( n_band, 1 ), 1 )] = add_o( quant_tmp2[n_band], tmp_q, &Overflow ); -#else - tmp_q = add( quant_tmp[n_band - 1], quant_tmp[n_band] ); - tmp_q = shr( tmp_q, 1 ); - quant_select[sub( shl( n_band, 1 ), 1 )] = add( quant_tmp2[n_band], tmp_q ); -#endif } L_dist = L_deposit_l( 0 ); @@ -2054,11 +1963,7 @@ static void calculate_Tonality_fx( l_shift = norm_s( max ); FOR( n_coeff = 0; n_coeff < length; n_coeff++ ) { -#ifdef BASOP_NOGLOB gen_spec[n_coeff] = shl_sat( gen_spec[n_coeff], l_shift ); -#else - gen_spec[n_coeff] = shl( gen_spec[n_coeff], l_shift ); -#endif move16(); IF( gen_spec[n_coeff] == 0 ) { @@ -2119,11 +2024,7 @@ static void calculate_Tonality_fx( L_tmp2 = Mpy_32_16_1( L_log_gm_org, inv_len ); /* Q14 */ L_tmp = L_sub( L_tmp1, L_tmp2 ); -#ifdef BASOP_NOGLOB *SFM_org = round_fx_o( L_shl_o( L_tmp, 14, &Overflow ), &Overflow ); /*Q12 */ -#else - *SFM_org = round_fx( L_shl( L_tmp, 14 ) ); /*Q12 */ -#endif move16(); *SFM_org = s_max( 0, s_min( *SFM_org, 24547 ) ); move16(); /*0.0001 and 5.993 in Q12 */ @@ -2144,11 +2045,7 @@ static void calculate_Tonality_fx( L_tmp2 = Mpy_32_16_1( L_log_gm_gen, inv_len ); /* Q14 */ L_tmp = L_sub( L_tmp1, L_tmp2 ); -#ifdef BASOP_NOGLOB *SFM_gen = round_fx_o( L_shl_o( L_tmp, 14, &Overflow ), &Overflow ); /*Q12 */ -#else - *SFM_gen = round_fx( L_shl( L_tmp, 14 ) ); /*Q12 */ -#endif move16(); *SFM_gen = s_max( 0, s_min( *SFM_gen, 24547 ) ); move16(); /*0.0001 and 5.993 in Q12 */ @@ -2224,11 +2121,7 @@ static void calculate_Tonality_ivas_fx( l_shift = norm_s( max ); FOR( n_coeff = 0; n_coeff < length; n_coeff++ ) { -#ifdef BASOP_NOGLOB gen_spec[n_coeff] = shl_sat( gen_spec[n_coeff], l_shift ); -#else - gen_spec[n_coeff] = shl( gen_spec[n_coeff], l_shift ); -#endif move16(); IF( gen_spec[n_coeff] == 0 ) { @@ -2289,11 +2182,7 @@ static void calculate_Tonality_ivas_fx( L_tmp2 = Mpy_32_16_1( L_log_gm_org, inv_len ); /* Q14 */ L_tmp = L_sub( L_tmp1, L_tmp2 ); -#ifdef BASOP_NOGLOB *SFM_org = round_fx_o( L_shl_o( L_tmp, 14, &Overflow ), &Overflow ); /*Q12 */ -#else - *SFM_org = round_fx( L_shl( L_tmp, 14 ) ); /*Q12 */ -#endif move16(); *SFM_org = s_max( 0, s_min( *SFM_org, 24547 ) ); move16(); /*0.0001 and 5.993 in Q12 */ @@ -2314,11 +2203,7 @@ static void calculate_Tonality_ivas_fx( L_tmp2 = Mpy_32_16_1( L_log_gm_gen, inv_len ); /* Q14 */ L_tmp = L_sub( L_tmp1, L_tmp2 ); -#ifdef BASOP_NOGLOB *SFM_gen = round_fx_o( L_shl_o( L_tmp, 14, &Overflow ), &Overflow ); /*Q12 */ -#else - *SFM_gen = round_fx( L_shl( L_tmp, 14 ) ); /*Q12 */ -#endif move16(); *SFM_gen = s_max( 0, s_min( *SFM_gen, 24547 ) ); move16(); /*0.0001 and 5.993 in Q12 */ @@ -2745,11 +2630,7 @@ static Word16 SWB_BWE_encoding_fx( } /* tilt returned in Q24 go to Q11 */ -#ifdef BASOP_NOGLOB tilt_fx = round_fx_o( L_shl_o( calc_tilt_bwe_fx( insig_fx, 0, L_FRAME32k ), 3, &Overflow ), &Overflow ); -#else - tilt_fx = round_fx( L_shl( calc_tilt_bwe_fx( insig_fx, 0, L_FRAME32k ), 3 ) ); -#endif test(); test(); IF( EQ_16( IsTransient, 1 ) && ( GT_16( tilt_fx, 16384 ) || GT_16( st_fx->clas, 1 ) ) ) @@ -2806,11 +2687,7 @@ static Word16 SWB_BWE_encoding_fx( L_SWB_tenv = L_deposit_l( 0 ); FOR( i = 0; i < L_SUBFR16k; i++ ) { -#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 */ -#endif } tmp = i_mult2( n_band, L ); @@ -2833,11 +2710,7 @@ static Word16 SWB_BWE_encoding_fx( L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp ); /*Q(31-exp) */ -#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 */ -#endif } } @@ -2861,11 +2734,7 @@ static Word16 SWB_BWE_encoding_fx( L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &expn ); /*31-expn */ -#ifdef BASOP_NOGLOB Rat_tenv_fx = round_fx_o( L_shl_o( L_tmp, sub( expn, 1 ), &Overflow ), &Overflow ); /*Q14 */ -#else - Rat_tenv_fx = round_fx( L_shl( L_tmp, sub( expn, 1 ) ) ); /*Q14 */ -#endif } ELSE { @@ -2876,11 +2745,7 @@ static Word16 SWB_BWE_encoding_fx( IF( LT_16( Rat_tenv_fx, 8192 ) ) { L_tmp = L_mult( Rat_tenv_fx, 19661 ); /*Q29 */ -#ifdef BASOP_NOGLOB Rat_tenv_fx = round_fx_o( L_shl_o( L_tmp, 2, &Overflow ), &Overflow ); /*Q15 */ -#else - Rat_tenv_fx = round_fx( L_shl( L_tmp, 2 ) ); /*Q15 */ -#endif } ELSE IF( GT_16( Rat_tenv_fx, 16384 ) ) { @@ -2946,11 +2811,7 @@ static Word16 SWB_BWE_encoding_fx( } /*SWB_tenv_fx[pos] = add(SWB_tenv_fx[pos], mult_r(SWB_tenv_fx[pos], 164)); move16();//Q3 */ -#ifdef BASOP_NOGLOB SWB_tenv_fx[pos] = round_fx_sat( L_mac_sat( L_mult_sat( SWB_tenv_fx[pos], 32767 ), SWB_tenv_fx[pos], 164 ) ); /*Q3 */ -#else - SWB_tenv_fx[pos] = round_fx( L_mac( L_mult( SWB_tenv_fx[pos], 32767 ), SWB_tenv_fx[pos], 164 ) ); /*Q3 */ -#endif IF( LT_32( energy_fx, SWB_tenv_fx[pos] ) ) { @@ -2968,20 +2829,12 @@ static Word16 SWB_BWE_encoding_fx( IF( GT_16( SWB_tenv_fx[n_band - 1], SWB_tenv_fx[n_band] ) ) { /*SWB_tenv_fx[n_band-1] = add(mult_r(SWB_tenv_fx[n_band-1], 16384), mult_r(SWB_tenv_fx[n_band], 16384)); move16();//Q3 */ -#ifdef BASOP_NOGLOB SWB_tenv_fx[n_band - 1] = round_fx_sat( L_mac_sat( L_mult( SWB_tenv_fx[n_band - 1], 16384 ), SWB_tenv_fx[n_band], 16384 ) ); /*Q3 */ -#else - SWB_tenv_fx[n_band - 1] = round_fx( L_mac( L_mult( SWB_tenv_fx[n_band - 1], 16384 ), SWB_tenv_fx[n_band], 16384 ) ); /*Q3 */ -#endif } ELSE { /*SWB_tenv_fx[n_band] = add(mult_r(SWB_tenv_fx[n_band-1], 16384), mult_r(SWB_tenv_fx[n_band], 16384)); move16();//Q3 */ -#ifdef BASOP_NOGLOB SWB_tenv_fx[n_band] = round_fx_sat( L_mac_sat( L_mult( SWB_tenv_fx[n_band - 1], 16384 ), SWB_tenv_fx[n_band], 16384 ) ); /*Q3 */ -#else - SWB_tenv_fx[n_band] = round_fx( L_mac( L_mult( SWB_tenv_fx[n_band - 1], 16384 ), SWB_tenv_fx[n_band], 16384 ) ); /*Q3 */ -#endif } } @@ -3233,11 +3086,7 @@ static Word16 SWB_BWE_encoding_ivas_fx( } /* tilt returned in Q24 go to Q11 */ -#ifdef BASOP_NOGLOB tilt_fx = round_fx_o( L_shl_o( calc_tilt_bwe_fx( insig_fx, 0, L_FRAME32k ), 3, &Overflow ), &Overflow ); -#else - tilt_fx = round_fx( L_shl( calc_tilt_bwe_fx( insig_fx, 0, L_FRAME32k ), 3 ) ); -#endif test(); test(); IF( EQ_16( IsTransient, 1 ) && ( GT_16( tilt_fx, 16384 ) || GT_16( st_fx->clas, 1 ) ) ) @@ -3307,11 +3156,7 @@ static Word16 SWB_BWE_encoding_ivas_fx( L_SWB_tenv = L_deposit_l( 0 ); FOR( i = 0; i < L_SUBFR16k; i++ ) { -#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 */ -#endif } tmp = i_mult2( n_band, L ); @@ -3334,11 +3179,7 @@ static Word16 SWB_BWE_encoding_ivas_fx( L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp ); /*Q(31-exp) */ -#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 */ -#endif move16(); } } @@ -3351,11 +3192,7 @@ static Word16 SWB_BWE_encoding_ivas_fx( 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 @@ -3371,11 +3208,7 @@ static Word16 SWB_BWE_encoding_ivas_fx( L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &expn ); /*31-expn */ -#ifdef BASOP_NOGLOB Rat_tenv_fx = round_fx_o( L_shl_o( L_tmp, sub( expn, 1 ), &Overflow ), &Overflow ); /*Q14 */ -#else - Rat_tenv_fx = round_fx( L_shl( L_tmp, sub( expn, 1 ) ) ); /*Q14 */ -#endif } ELSE { @@ -3386,11 +3219,7 @@ static Word16 SWB_BWE_encoding_ivas_fx( IF( LT_16( Rat_tenv_fx, 8192 ) ) { L_tmp = L_mult( Rat_tenv_fx, 19661 ); /*Q29 */ -#ifdef BASOP_NOGLOB Rat_tenv_fx = round_fx_o( L_shl_o( L_tmp, 2, &Overflow ), &Overflow ); /*Q15 */ -#else - Rat_tenv_fx = round_fx( L_shl( L_tmp, 2 ) ); /*Q15 */ -#endif } ELSE IF( GT_16( Rat_tenv_fx, 16384 ) ) { @@ -3456,11 +3285,7 @@ static Word16 SWB_BWE_encoding_ivas_fx( } /*SWB_tenv_fx[pos] = add(SWB_tenv_fx[pos], mult_r(SWB_tenv_fx[pos], 164)); move16();//Q3 */ -#ifdef BASOP_NOGLOB SWB_tenv_fx[pos] = round_fx_sat( L_mac_sat( L_mult_sat( SWB_tenv_fx[pos], 32767 ), SWB_tenv_fx[pos], 164 ) ); /*Q3 */ -#else - SWB_tenv_fx[pos] = round_fx( L_mac( L_mult( SWB_tenv_fx[pos], 32767 ), SWB_tenv_fx[pos], 164 ) ); /*Q3 */ -#endif move16(); IF( LT_32( energy_fx, SWB_tenv_fx[pos] ) ) @@ -3479,21 +3304,13 @@ static Word16 SWB_BWE_encoding_ivas_fx( IF( GT_16( SWB_tenv_fx[n_band - 1], SWB_tenv_fx[n_band] ) ) { /*SWB_tenv_fx[n_band-1] = add(mult_r(SWB_tenv_fx[n_band-1], 16384), mult_r(SWB_tenv_fx[n_band], 16384)); move16();//Q3 */ -#ifdef BASOP_NOGLOB SWB_tenv_fx[n_band - 1] = round_fx_sat( L_mac_sat( L_mult( SWB_tenv_fx[n_band - 1], 16384 ), SWB_tenv_fx[n_band], 16384 ) ); /*Q3 */ -#else - SWB_tenv_fx[n_band - 1] = round_fx( L_mac( L_mult( SWB_tenv_fx[n_band - 1], 16384 ), SWB_tenv_fx[n_band], 16384 ) ); /*Q3 */ -#endif move16(); } ELSE { /*SWB_tenv_fx[n_band] = add(mult_r(SWB_tenv_fx[n_band-1], 16384), mult_r(SWB_tenv_fx[n_band], 16384)); move16();//Q3 */ -#ifdef BASOP_NOGLOB SWB_tenv_fx[n_band] = round_fx_sat( L_mac_sat( L_mult( SWB_tenv_fx[n_band - 1], 16384 ), SWB_tenv_fx[n_band], 16384 ) ); /*Q3 */ -#else - SWB_tenv_fx[n_band] = round_fx( L_mac( L_mult( SWB_tenv_fx[n_band - 1], 16384 ), SWB_tenv_fx[n_band], 16384 ) ); /*Q3 */ -#endif move16(); } } @@ -3802,13 +3619,8 @@ static void calculate_tonality_fx_32( FOR( n_coeff = 0; n_coeff < length; n_coeff++ ) { -#ifdef BASOP_NOGLOB am_org_fx = L_add_sat( am_org_fx, org_spec_fx[n_coeff] ); am_gen_fx = L_add_sat( am_gen_fx, gen_spec_fx[n_coeff] ); -#else - am_org_fx = L_add( am_org_fx, org_spec_fx[n_coeff] ); - am_gen_fx = L_add( am_gen_fx, gen_spec_fx[n_coeff] ); -#endif IF( org_spec_fx[n_coeff] != 0 ) { exp = norm_l( org_spec_fx[n_coeff] ); @@ -4024,20 +3836,12 @@ static Word16 decision_hq_generic_class_fx_32( exp = norm_l( coefs_fx[i] ); tmp = extract_h( L_shl( coefs_fx[i], exp ) ); /*12 + exp - 16 */ L_tmp = L_mult0( tmp, tmp ); /*2 * exp - 8 */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, sub( 14, shl( exp, 1 ) ) ); /*6 */ -#else - L_tmp = L_shl( L_tmp, sub( 14, shl( exp, 1 ) ) ); /*6 */ -#endif IF( GT_32( L_tmp, p_fx ) ) { p_fx = L_add( L_tmp, 0 ); /*6 */ } -#ifdef BASOP_NOGLOB a_fx = L_add_sat( a_fx, L_tmp ); /*6 */ -#else - a_fx = L_add( a_fx, L_tmp ); /*6 */ -#endif } IF( a_fx > 0 ) @@ -4261,11 +4065,7 @@ void hq_generic_encoding_fx( L_Extract( L_tmp, &exp, &tmp ); /* */ tmp = extract_l( Pow2( 13, tmp ) ); exp = sub( exp, 13 ); -#ifdef BASOP_NOGLOB hq_generic_fenv_fx[n_band] = shl_sat( tmp, add( exp, 1 ) ); /*1 */ -#else - hq_generic_fenv_fx[n_band] = shl( tmp, add( exp, 1 ) ); /*1 */ -#endif } @@ -4538,11 +4338,7 @@ void hq_generic_hf_encoding_fx( L_Extract( L_tmp, &exp, &tmp ); /* */ tmp = extract_l( Pow2( 13, tmp ) ); exp = sub( exp, 13 ); -#ifdef BASOP_NOGLOB hq_generic_fenv_fx[n_band] = shl_sat( tmp, add( exp, 1 ) ); /*1 */ -#else - hq_generic_fenv_fx[n_band] = shl( tmp, add( exp, 1 ) ); /*1 */ -#endif move16(); } diff --git a/lib_enc/swb_bwe_enc_hr_fx.c b/lib_enc/swb_bwe_enc_hr_fx.c index 95d434d6a..bfbaa1d7e 100644 --- a/lib_enc/swb_bwe_enc_hr_fx.c +++ b/lib_enc/swb_bwe_enc_hr_fx.c @@ -346,11 +346,7 @@ void swb_bwe_enc_hr_fx( L_temp = Calc_Energy_Autoscaled( ptr16, t_audio_fx_exp, WIDTH_TRANS_FREQ_COEF, &temp2 ); ptr16 += WIDTH_TRANS_FREQ_COEF; L_temp = Sqrt_Ratio32( L_temp, temp2, WIDTH_TRANS_FREQ_COEF, /*WIDTH_TRANS_FREQ_COEF is in Q0*/ 0, &temp2 ); -#ifdef BASOP_NOGLOB en_band_fx[i] = round_fx_sat( L_shr_sat( L_temp, sub( 15 - 9, temp2 ) ) ); -#else - en_band_fx[i] = round_fx( L_shr( L_temp, sub( 15 - 9, temp2 ) ) ); -#endif } /* Q energy per band */ @@ -547,11 +543,7 @@ void swb_bwe_enc_hr_fx( L_temp = Calc_Energy_Autoscaled( ptr16, t_audio_fx_exp, WIDTH_NONTRANS_FREQ_COEF, &temp2 ); ptr16 += WIDTH_NONTRANS_FREQ_COEF; L_temp = Sqrt_Ratio32( L_temp, temp2, WIDTH_NONTRANS_FREQ_COEF, /*WIDTH_TRANS_FREQ_COEF is in Q0*/ 0, &temp2 ); -#ifdef BASOP_NOGLOB en_band_fx[i] = round_fx_sat( L_shr_sat( L_temp, sub( 15 - 9, temp2 ) ) ); /* Put in Q9 */ -#else - en_band_fx[i] = round_fx( L_shr( L_temp, sub( 15 - 9, temp2 ) ) ); /* Put in Q9 */ -#endif } /* Q energy per band */ @@ -779,13 +771,8 @@ void swb_bwe_enc_hr_fx( FOR( i = 0; i < Nsv2 * WIDTH_BAND; i++ ) { L_tmp = L_mult( temp, t_audio_fx[i] ); -#ifdef BASOP_NOGLOB L_tmp = L_shr_o( L_tmp, temp2, &Overflow ); t_audio_fx[i] = round_fx_o( L_tmp, &Overflow ); -#else - L_tmp = L_shr( L_tmp, temp2 ); - t_audio_fx[i] = round_fx( L_tmp ); -#endif move16(); } diff --git a/lib_enc/swb_bwe_enc_lr_fx.c b/lib_enc/swb_bwe_enc_lr_fx.c index 23137a24a..5f9eaa102 100644 --- a/lib_enc/swb_bwe_enc_lr_fx.c +++ b/lib_enc/swb_bwe_enc_lr_fx.c @@ -148,11 +148,7 @@ static Word16 GetSubbandCorrIndex2_har_fx( /* o : FOR( j = 0; j < fLen; j++ ) { /*energy += *predBuf * *predBuf; */ -#ifdef BASOP_NOGLOB /* Critical Overflow , as well as those below*/ L_energy = L_mac_o( L_energy, *ptr_pbuf, *ptr_pbuf, &Overflow ); /* Q*2-1; */ -#else - L_energy = L_mac( L_energy, *ptr_pbuf, *ptr_pbuf ); /* Q*2-1; */ -#endif ptr_pbuf++; } @@ -165,11 +161,7 @@ static Word16 GetSubbandCorrIndex2_har_fx( /* o : FOR( j = 0; j < nZero_fx; j++ ) { /*corr += inBuf[G_item[j].gainIndex]* predBuf[G_item[j].gainIndex]; */ -#ifdef BASOP_NOGLOB /* Critical Overflow */ L_corr = L_mac_o( L_corr, ibuf_fx[G_item_fx[j].gainIndex_fx], ptr_pbuf[G_item_fx[j].gainIndex_fx], &Overflow ); /* Q*2-1 */ -#else - L_corr = L_mac( L_corr, ibuf_fx[G_item_fx[j].gainIndex_fx], ptr_pbuf[G_item_fx[j].gainIndex_fx] ); /* Q*2-1 */ -#endif } /*corr_sq = corr*corr; */ @@ -178,13 +170,8 @@ static Word16 GetSubbandCorrIndex2_har_fx( /* o : L_corr_sq = L_shl( L_corr, exp_norm ); corr_sq_hi_fx = extract_h( L_corr_sq ); -#ifdef BASOP_NOGLOB /* Critical Overflow */ L_corr_sq = L_mult_o( corr_sq_hi_fx, corr_sq_hi_fx, &Overflow ); /* (((Qhi:Qsh+exp_norm_hi-16)+Qss+1)+exp_norm-16)*2+1 */ L_corr_sq = L_shr_o( L_corr_sq, s_min( shl( exp_norm, 1 ), 31 ), &Overflow ); /* (QCorr-16)*2+1 */ -#else - L_corr_sq = L_mult( corr_sq_hi_fx, corr_sq_hi_fx ); /* (((Qhi:Qsh+exp_norm_hi-16)+Qss+1)+exp_norm-16)*2+1 */ - L_corr_sq = L_shr( L_corr_sq, s_min( shl( exp_norm, 1 ), 31 ) ); /* (QCorr-16)*2+1 */ -#endif IF( Overflow != 0 ) { L_corr_sq = 0x0L; @@ -777,13 +764,8 @@ static void gethar_noisegn_fx( L_temp = L_Comp( exp, frac ); L_temp = Mpy_32_16_1( L_temp, 19728 ); /* log(2)/log(10)=.30102999566398119521 = 19728.3(Q16) Q(0+16+1)=Q17 */ -#ifdef BASOP_NOGLOB L_temp = L_shl_o( L_temp, 13, &Overflow ); /* Q17+13=30 30-16=14 */ g_fx = round_fx_o( L_temp, &Overflow ); -#else - L_temp = L_shl( L_temp, 13 ); /* Q17+13=30 30-16=14 */ - g_fx = round_fx( L_temp ); -#endif } gqlevs_fx = 4; diff --git a/lib_enc/swb_pre_proc_fx.c b/lib_enc/swb_pre_proc_fx.c index 623ad7b6d..7d1ffe9a4 100644 --- a/lib_enc/swb_pre_proc_fx.c +++ b/lib_enc/swb_pre_proc_fx.c @@ -705,13 +705,8 @@ void swb_pre_proc_fx( realQ_neg1 = extract_l( L_shr( realBufferFlipped[ts][nB], 31 - ( 15 + cldfbScale->hb_scale ) + 1 ) ); imagQ_neg1 = extract_l( L_shr( imagBufferFlipped[ts][nB], 31 - ( 15 + cldfbScale->hb_scale ) + 1 ) ); /* Q(-1), headroom needed */ -#ifdef BASOP_NOGLOB CldfbHB_ener = L_mac0_o( CldfbHB_ener, realQ_neg1, realQ_neg1, &Overflow ); CldfbHB_ener = L_mac0_o( CldfbHB_ener, imagQ_neg1, imagQ_neg1, &Overflow ); /* Q(-2) */ -#else - CldfbHB_ener = L_mac0( CldfbHB_ener, realQ_neg1, realQ_neg1 ); - CldfbHB_ener = L_mac0( CldfbHB_ener, imagQ_neg1, imagQ_neg1 ); /* Q(-2) */ -#endif } } @@ -1207,13 +1202,8 @@ void swb_pre_proc_ivas_fx( realQ_neg1 = extract_l( L_shr( realBufferFlipped[ts][nB], 16 ) ); imagQ_neg1 = extract_l( L_shr( imagBufferFlipped[ts][nB], 16 ) ); /* Q(-1), headroom needed */ -#ifdef BASOP_NOGLOB CldfbHB_fx = L_mac0_o( CldfbHB_fx, realQ_neg1, realQ_neg1, &Overflow ); CldfbHB_fx = L_mac0_o( CldfbHB_fx, imagQ_neg1, imagQ_neg1, &Overflow ); /* Q(-2) */ -#else - CldfbHB_fx = L_mac0( CldfbHB_fx, realQ_neg1, realQ_neg1 ); - CldfbHB_fx = L_mac0( CldfbHB_fx, imagQ_neg1, imagQ_neg1 ); /* Q(-2) */ -#endif } } CldfbHB_fx_e = sub( Q31, shl( sub( q_reImBuffer, Q16 ), 1 ) ); diff --git a/lib_enc/swb_tbe_enc_fx.c b/lib_enc/swb_tbe_enc_fx.c index ed029cba2..e48aa12a4 100644 --- a/lib_enc/swb_tbe_enc_fx.c +++ b/lib_enc/swb_tbe_enc_fx.c @@ -996,11 +996,7 @@ void wb_tbe_enc_fx( IF( st_fx->element_mode > EVS_MONO ) { tmp = sub( shl( sub( st_fx->prev_Q_bwe_exc, 16 ), 1 ), 31 + 16 ); -#ifdef BASOP_NOGLOB prev_pow = L_shl_sat( 1407374848l /*0.00001f Q47*/, tmp ); /*Q(2*(st_fx->prev_Q_bwe_exc-16))*/ -#else - prev_pow = L_shl( 1407374848l /*0.00001f Q47*/, tmp ); /*Q(2*(st_fx->prev_Q_bwe_exc-16))*/ -#endif } FOR( i = 0; i < L_SHB_LAHEAD / 4; i++ ) { @@ -1032,11 +1028,7 @@ void wb_tbe_enc_fx( IF( st_fx->element_mode > EVS_MONO ) { tmp = sub( shl( Q_bwe_exc_ext, 1 ), 31 + 16 ); -#ifdef BASOP_NOGLOB curr_pow = L_shl_sat( 1407374848l /*0.00001f Q47*/, tmp ); /*Q(2*(Q_bwe_exc_ext))*/ -#else - curr_pow = L_shl( 1407374848l /*0.00001f Q47*/, tmp ); /* 2*(Q_bwe_exc_ext) */ -#endif } FOR( i = 0; i < L_SHB_LAHEAD / 4; i++ ) { @@ -1054,11 +1046,7 @@ void wb_tbe_enc_fx( FOR( i = 0; i < L_SHB_LAHEAD / 4 - 1; i++ ) { L_tmp = Mult_32_16( Lscale, shaped_wb_excitation[i] ); /* Q(16-exp+Q_bwe_exc_ext) */ -#ifdef BASOP_NOGLOB shaped_wb_excitation[i] = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /* Q_bwe_exc_ext */ -#else - shaped_wb_excitation[i] = round_fx( L_shl( L_tmp, exp ) ); /* Q_bwe_exc_ext */ -#endif } Lscale = root_a_fx( Lscale, 31 - exp, &exp ); @@ -1203,13 +1191,8 @@ void wb_tbe_enc_fx( exp = norm_s( voicingBufAvg_fx ); tmp = div_s( shl( 1, sub( 14, exp ) ), voicingBufAvg_fx ); /* (14-exp) */ L_tmp = L_mult( pitBufAvg_fx, tmp ); /* (21-exp) */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( L_tmp, add( exp, 10 ), &Overflow ); tmp = round_fx_o( L_tmp, &Overflow ); /* Q15 */ -#else /* BASOP_NOGLOB */ - L_tmp = L_shl( L_tmp, add( exp, 10 ) ); - tmp = round_fx( L_tmp ); /* Q15 */ -#endif } tmp = s_max( s_min( tmp, 32767 ), 22938 ); /* Q15 */ @@ -1629,11 +1612,7 @@ void wb_tbe_enc_ivas_fx( IF( st_fx->element_mode > EVS_MONO ) { tmp = sub( Q_prev_pow, 31 + 16 ); -#ifdef BASOP_NOGLOB prev_pow = L_shl_sat( 1407374848l /*0.00001f Q47*/, tmp ); /*Q_prev_pow*/ -#else - prev_pow = L_shl( 1407374848l /*0.00001f Q47*/, tmp ); /*Q_prev_pow*/ -#endif } FOR( i = 0; i < L_SHB_LAHEAD / 4; i++ ) { @@ -1686,11 +1665,7 @@ void wb_tbe_enc_ivas_fx( IF( st_fx->element_mode > EVS_MONO ) { tmp = sub( Q_cur_pow, 31 + 16 ); -#ifdef BASOP_NOGLOB curr_pow = L_shl_sat( 1407374848l /*0.00001f Q47*/, tmp ); /*Q(Q_cur_pow)*/ -#else - curr_pow = L_shl( 1407374848l /*0.00001f Q47*/, tmp ); /* 2*(Q_bwe_exc_ext) */ -#endif } FOR( i = 0; i < L_SHB_LAHEAD / 4; i++ ) { @@ -1707,21 +1682,13 @@ void wb_tbe_enc_ivas_fx( FOR( i = 0; i < L_SHB_LAHEAD / 4 - 1; i++ ) { L_tmp = Mpy_32_16_1( Lscale, shaped_wb_excitation[i] ); /* Q(16-exp+Q_bwe_exc_ext) */ -#ifdef BASOP_NOGLOB shaped_wb_excitation[i] = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /* Q_bwe_exc_ext */ -#else - shaped_wb_excitation[i] = round_fx( L_shl( L_tmp, exp ) ); /* Q_bwe_exc_ext */ -#endif move16(); } Lscale = root_a_fx( Lscale, sub( 31, exp ), &exp ); L_tmp = Mpy_32_16_1( Lscale, shaped_wb_excitation[L_SHB_LAHEAD / 4 - 1] ); /* Q(16-exp+Q_bwe_exc_ext) */ -#ifdef BASOP_NOGLOB shaped_wb_excitation[L_SHB_LAHEAD / 4 - 1] = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /* Q_bwe_exc_ext */ -#else - shaped_wb_excitation[L_SHB_LAHEAD / 4 - 1] = round_fx( L_shl( L_tmp, exp ) ); /* Q_bwe_exc_ext */ -#endif move16(); /* Update WB excitation */ @@ -1876,13 +1843,8 @@ void wb_tbe_enc_ivas_fx( exp = norm_s( voicingBufAvg_fx ); tmp = div_s( shl( 1, sub( 14, exp ) ), voicingBufAvg_fx ); /* (14-exp) */ L_tmp = L_mult( pitBufAvg_fx, tmp ); /* (21-exp) */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_o( L_tmp, add( exp, 10 ), &Overflow ); tmp = round_fx_o( L_tmp, &Overflow ); /* Q15 */ -#else /* BASOP_NOGLOB */ - L_tmp = L_shl( L_tmp, add( exp, 10 ) ); - tmp = round_fx( L_tmp ); /* Q15 */ -#endif } tmp = s_max( s_min( tmp, 32767 ), 22938 ); /* Q15 */ @@ -2336,11 +2298,7 @@ void swb_tbe_enc_fx( FOR( i = L_SHB_LAHEAD; i < L_FRAME16k + L_SHB_LAHEAD; i++ ) { /* shbEner = shbEner + in[i] * in[i] */ -#ifdef BASOP_NOGLOB shb_ener_sf_Q31 = L_mac0_sat( shb_ener_sf_Q31, shb_frame_fx[i], shb_frame_fx[i] ); -#else - shb_ener_sf_Q31 = L_mac0( shb_ener_sf_Q31, shb_frame_fx[i], shb_frame_fx[i] ); -#endif /* o: shb_ener_sf_Q31 in (2*Q_shb) */ } shb_ener_sf_Q31 = Mult_32_16( shb_ener_sf_Q31, 102 /*0.003125f Q15*/ ); @@ -2433,11 +2391,7 @@ void swb_tbe_enc_fx( FOR( cnt = 0; cnt < L_FRAME32k; cnt++ ) { -#ifdef BASOP_NOGLOB bwe_exc_extended_16[cnt + NL_BUFF_OFFSET] = round_fx_sat( L_shl_sat( bwe_exc_extended[cnt], sc ) ); -#else - bwe_exc_extended_16[cnt + NL_BUFF_OFFSET] = round_fx( L_shl( bwe_exc_extended[cnt], sc ) ); -#endif } Copy( bwe_exc_extended_16 + L_FRAME32k, hBWE_TD->old_bwe_exc_extended_fx, NL_BUFF_OFFSET ); @@ -2515,13 +2469,8 @@ void swb_tbe_enc_fx( curr_pow_fx = L_shl( 21475l /*0.00001f Q31*/, tmp ); /* 2*(Q_bwe_exc) */ FOR( i = 0; i < L_SHB_LAHEAD + 10; i++ ) { -#ifdef BASOP_NOGLOB prev_pow_fx = L_mac0_o( prev_pow_fx, shaped_shb_excitation_fx[i], shaped_shb_excitation_fx[i], &Overflow ); /* 2*Q_bwe_exc */ curr_pow_fx = L_mac0_o( curr_pow_fx, shaped_shb_excitation_fx[i + L_SHB_LAHEAD + 10], shaped_shb_excitation_fx[i + L_SHB_LAHEAD + 10], &Overflow ); /* 2*Q_bwe_exc */ -#else - prev_pow_fx = L_mac0( prev_pow_fx, shaped_shb_excitation_fx[i], shaped_shb_excitation_fx[i] ); /* 2*Q_bwe_exc */ - curr_pow_fx = L_mac0( curr_pow_fx, shaped_shb_excitation_fx[i + L_SHB_LAHEAD + 10], shaped_shb_excitation_fx[i + L_SHB_LAHEAD + 10] ); /* 2*Q_bwe_exc */ -#endif } if ( GT_16( voice_factors_fx[0], 24576 /*0.75f Q15*/ ) ) @@ -2538,11 +2487,7 @@ void swb_tbe_enc_fx( FOR( i = 0; i < L_SHB_LAHEAD; i++ ) { L_tmp = Mult_32_16( Lscale, shaped_shb_excitation_fx[i] ); /* Q(16-exp+Q_bwe_exc) */ -#ifdef BASOP_NOGLOB shaped_shb_excitation_fx[i] = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /* Q_bwe_exc */ -#else - shaped_shb_excitation_fx[i] = round_fx( L_shl( L_tmp, exp ) ); /* Q_bwe_exc */ -#endif } IF( exp < 0 ) { @@ -2551,21 +2496,12 @@ void swb_tbe_enc_fx( } FOR( ; i < L_SHB_LAHEAD + 10; i++ ) { -#ifdef BASOP_NOGLOB tmp = i_mult_o( sub( i, 19 ), 3277 /*0.1f Q15*/, &Overflow ); /* Q15 */ L_tmp1 = Mult_32_16( L_shl_o( 1, sub( 31, exp ), &Overflow ), tmp ); /* Q31-exp */ -#else - tmp = i_mult( sub( i, 19 ), 3277 /*0.1f Q15*/ ); /* Q15 */ - L_tmp1 = Mult_32_16( L_shl( 1, sub( 31, exp ) ), tmp ); /* Q31-exp */ -#endif tmp = sub( 32767 /*1.0f Q15*/, tmp ); Lscale = L_add( Mult_32_16( Lscale, tmp ), L_tmp1 ); L_tmp = Mult_32_16( Lscale, shaped_shb_excitation_fx[i] ); /* Q_bwe_exc + (31-exp) - 15 */ -#ifdef BASOP_NOGLOB shaped_shb_excitation_fx[i] = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); /* Q_bwe_exc */ -#else - shaped_shb_excitation_fx[i] = round_fx( L_shl( L_tmp, exp ) ); /* Q_bwe_exc */ -#endif } /* Update SHB excitation */ @@ -2788,11 +2724,7 @@ void swb_tbe_enc_fx( /* sd_uq_q*pitBufAvg */ L_tmp = Mult_32_16( L_tmp, pitBufAvg_fx ); /* Q13 * Q10 + 1 -16 => Q8 */ L_tmp = Mult_32_16( L_tmp, tmp ); /* Q8 + (14 - exp) - 15 => Q7 - exp */ -#ifdef BASOP_NOGLOB tmp = round_fx_o( L_shl_o( L_tmp, 31 - ( 7 - exp ), &Overflow ), &Overflow ); /* Q15 */ -#else - tmp = round_fx( L_shl( L_tmp, 31 - ( 7 - exp ) ) ); /* Q15 */ -#endif } tmp = s_min( tmp, 32767 /*1.0f Q15*/ ); @@ -3347,11 +3279,7 @@ void swb_tbe_enc_ivas_fx( FOR( i = L_SHB_LAHEAD; i < L_FRAME16k + L_SHB_LAHEAD; i++ ) { /* shbEner = shbEner + in[i] * in[i] */ -#ifdef BASOP_NOGLOB shb_ener_sf_Q31 = L_mac0_sat( shb_ener_sf_Q31, shb_frame_fx[i], shb_frame_fx[i] ); -#else - shb_ener_sf_Q31 = L_mac0( shb_ener_sf_Q31, shb_frame_fx[i], shb_frame_fx[i] ); -#endif /* o: shb_ener_sf_Q31 in (2*Q_shb) */ } shb_ener_sf_Q31 = Mult_32_16( shb_ener_sf_Q31, 102 /*0.003125f Q15*/ ); @@ -3686,11 +3614,7 @@ void swb_tbe_enc_ivas_fx( /* rescale the bwe_exc_extended and bring it to 16-bit single precision with dynamic norm */ FOR( cnt = 0; cnt < L_FRAME32k; cnt++ ) { -#ifdef BASOP_NOGLOB bwe_exc_extended_16[cnt] = round_fx_sat( L_shl_sat( bwe_exc_extended[cnt], sc ) ); -#else - bwe_exc_extended_16[cnt] = round_fx( L_shl( bwe_exc_extended[cnt], sc ) ); -#endif move16(); } @@ -3828,11 +3752,7 @@ void swb_tbe_enc_ivas_fx( FOR( i = 0; i < L_SHB_LAHEAD; i++ ) { L_tmp = Mult_32_16( Lscale, shaped_shb_excitation_fx[i] ); /* Q(16-exp+Q_bwe_exc) */ -#ifdef BASOP_NOGLOB shaped_shb_excitation_fx[i] = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); /* Q_bwe_exc */ -#else - shaped_shb_excitation_fx[i] = round_fx( L_shl( L_tmp, exp ) ); /* Q_bwe_exc */ -#endif move16(); } IF( exp < 0 ) @@ -3843,21 +3763,12 @@ void swb_tbe_enc_ivas_fx( } FOR( ; i < L_SHB_LAHEAD + 10; i++ ) { -#ifdef BASOP_NOGLOB tmp = i_mult_o( sub( i, 19 ), 3277 /*0.1f Q15*/, &Overflow ); /* Q15 */ L_tmp1 = Mult_32_16( L_shl_o( 1, sub( 31, exp ), &Overflow ), tmp ); /* Q31-exp */ -#else - tmp = i_mult( sub( i, 19 ), 3277 /*0.1f Q15*/ ); /* Q15 */ - L_tmp1 = Mult_32_16( L_shl( 1, sub( 31, exp ) ), tmp ); /* Q31-exp */ -#endif tmp = sub( 32767 /*1.0f Q15*/, tmp ); Lscale = L_add( Mult_32_16( Lscale, tmp ), L_tmp1 ); L_tmp = Mult_32_16( Lscale, shaped_shb_excitation_fx[i] ); /* Q_bwe_exc + (31-exp) - 15 */ -#ifdef BASOP_NOGLOB shaped_shb_excitation_fx[i] = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); /* Q_bwe_exc */ -#else - shaped_shb_excitation_fx[i] = round_fx( L_shl( L_tmp, exp ) ); /* Q_bwe_exc */ -#endif move16(); } } @@ -4362,11 +4273,7 @@ void swb_tbe_enc_ivas_fx( /* sd_uq_q*pitBufAvg */ L_tmp = Mult_32_16( L_tmp, pitBufAvg_fx ); /* Q13 * Q10 + 1 -16 => Q8 */ L_tmp = Mult_32_16( L_tmp, tmp ); /* Q8 + (14 - exp) - 15 => Q7 - exp */ -#ifdef BASOP_NOGLOB tmp = round_fx_o( L_shl_o( L_tmp, 31 - ( 7 - exp ), &Overflow ), &Overflow ); /* Q15 */ -#else - tmp = round_fx( L_shl( L_tmp, 31 - ( 7 - exp ) ) ); /* Q15 */ -#endif } tmp = s_min( tmp, 32767 /*1.0f Q15*/ ); tmp = s_max( tmp, 19661 /*0.6f Q15*/ ); @@ -4634,48 +4541,27 @@ static void EstimateSHBFrameGain_fx( FOR( i = 0; i < l_shb_lahead; i++ ) { -#ifdef BASOP_NOGLOB sig = mult_ro( oriSHB[i], win_shb[i], &Overflow ); /* Q_oriSHB */ oriNrg = L_mac0_o( oriNrg, sig, sig, &Overflow ); /* 2*Q_orisHB*/ sig = round_fx_o( Mult_32_16( mod_syn[i], win_shb[i] ), &Overflow ); /*Q_synSHB */ synNrg = L_mac0_o( synNrg, sig, sig, &Overflow ); /* 2*Q_synSHB */ -#else - sig = mult_r( oriSHB[i], win_shb[i] ); /* Q_oriSHB */ - oriNrg = L_mac0( oriNrg, sig, sig ); /* 2*Q_orisHB*/ - sig = round_fx( Mult_32_16( mod_syn[i], win_shb[i] ) ); /*Q_synSHB */ - synNrg = L_mac0( synNrg, sig, sig ); /* 2*Q_synSHB */ -#endif } FOR( ; i < l_frame; i++ ) { -#ifdef BASOP_NOGLOB oriNrg = L_mac0_o( oriNrg, oriSHB[i], oriSHB[i], &Overflow ); /* 2*Q_oriSHB */ sig = round_fx_o( mod_syn[i], &Overflow ); /* Q_oriSHB */ synNrg = L_mac0_o( synNrg, sig, sig, &Overflow ); /* 2*Q_oriSHB */ -#else - oriNrg = L_mac0( oriNrg, oriSHB[i], oriSHB[i] ); /* 2*Q_oriSHB */ - sig = round_fx( mod_syn[i] ); /* Q_oriSHB */ - synNrg = L_mac0( synNrg, sig, sig ); /* 2*Q_oriSHB */ -#endif } tmp = add( l_frame, l_shb_lahead ); FOR( ; i < tmp; i++ ) { -#ifdef BASOP_NOGLOB sig = mult_ro( oriSHB[i], win_shb[l_frame + l_shb_lahead - 1 - i], &Overflow ); /* Q_oriSHB */ oriNrg = L_mac0_o( oriNrg, sig, sig, &Overflow ); /* 2*Q_oriSHB */ sig = round_fx_o( Mult_32_16( mod_syn[i], win_shb[l_frame + l_shb_lahead - 1 - i] ), &Overflow ); /* Q_oriSHB */ synNrg = L_mac0_o( synNrg, sig, sig, &Overflow ); /* 2*Q_oriSHB */ -#else - sig = mult_r( oriSHB[i], win_shb[l_frame + l_shb_lahead - 1 - i] ); /* Q_oriSHB */ - oriNrg = L_mac0( oriNrg, sig, sig ); /* 2*Q_oriSHB */ - - sig = round_fx( Mult_32_16( mod_syn[i], win_shb[l_frame + l_shb_lahead - 1 - i] ) ); /* Q_oriSHB */ - synNrg = L_mac0( synNrg, sig, sig ); /* 2*Q_oriSHB */ -#endif } IF( EQ_32( oriNrg, MAX_32 ) ) { @@ -4684,42 +4570,23 @@ static void EstimateSHBFrameGain_fx( move32(); FOR( i = 0; i < l_shb_lahead; i++ ) { -#ifdef BASOP_NOGLOB sig = mult_r( shl_o( oriSHB[i], scaling, &Overflow ), win_shb[i] ); oriNrg = L_mac0_o( oriNrg, sig, sig, &Overflow ); /* 2*Q_oriSHB + 2*scaling */ -#else - sig = mult_r( shl( oriSHB[i], scaling ), win_shb[i] ); - oriNrg = L_mac0( oriNrg, sig, sig ); /* 2*Q_oriSHB + 2*scaling */ -#endif } FOR( ; i < l_frame; i++ ) { -#ifdef BASOP_NOGLOB sig = shl_o( oriSHB[i], scaling, &Overflow ); oriNrg = L_mac0_o( oriNrg, sig, sig, &Overflow ); /* 2*Q_oriSHB + 2*scaling */ -#else - sig = shl( oriSHB[i], scaling ); - oriNrg = L_mac0( oriNrg, sig, sig ); /* 2*Q_oriSHB + 2*scaling */ -#endif } FOR( ; i < tmp; i++ ) { -#ifdef BASOP_NOGLOB sig = mult_r( shl_o( oriSHB[i], scaling, &Overflow ), win_shb[l_frame + l_shb_lahead - 1 - i] ); oriNrg = L_mac0_o( oriNrg, sig, sig, &Overflow ); /* 2*Q_oriSHB + 2*scaling */ -#else - sig = mult_r( shl( oriSHB[i], scaling ), win_shb[l_frame + l_shb_lahead - 1 - i] ); - oriNrg = L_mac0( oriNrg, sig, sig ); /* 2*Q_oriSHB + 2*scaling */ -#endif } } L_tmp = root_a_over_b_fx( oriNrg, 2 * Q_oriSHB, synNrg, 2 * Q_synSHB, &exp_out ); exp_out = sub( exp_out, scaling ); -#ifdef BASOP_NOGLOB frame_gain = L_shl_sat( L_tmp, sub( exp_out, 13 ) ); /* Q18 */ -#else - frame_gain = L_shl( L_tmp, sub( exp_out, 13 ) ); /* Q18 */ -#endif *GainFrame = frame_gain; move32(); @@ -4863,48 +4730,27 @@ static void EstimateSHBFrameGain_ivas_fx( FOR( i = 0; i < l_shb_lahead; i++ ) { -#ifdef BASOP_NOGLOB sig = mult_ro( oriSHB[i], win_shb[i], &Overflow ); /* Q_oriSHB */ oriNrg = L_mac0_o( oriNrg, sig, sig, &Overflow ); /* 2*Q_orisHB*/ sig = round_fx_o( Mult_32_16( mod_syn[i], win_shb[i] ), &Overflow ); /*Q_synSHB */ synNrg = L_mac0_o( synNrg, sig, sig, &Overflow ); /* 2*Q_synSHB - 2*/ -#else - sig = mult_r( oriSHB[i], win_shb[i] ); /* Q_oriSHB */ - oriNrg = L_mac0( oriNrg, sig, sig ); /* 2*Q_orisHB*/ - sig = round_fx( Mult_32_16( mod_syn[i], win_shb[i] ) ); /*Q_synSHB */ - synNrg = L_mac0( synNrg, sig, sig ); /* 2*Q_synSHB */ -#endif } FOR( ; i < l_frame; i++ ) { -#ifdef BASOP_NOGLOB oriNrg = L_mac0_o( oriNrg, oriSHB[i], oriSHB[i], &Overflow ); /* 2*Q_oriSHB */ sig = round_fx_o( mod_syn[i], &Overflow ); /* Q_oriSHB */ synNrg = L_mac0_o( synNrg, sig, sig, &Overflow ); /* 2*Q_oriSHB - 2*/ -#else - oriNrg = L_mac0( oriNrg, oriSHB[i], oriSHB[i] ); /* 2*Q_oriSHB */ - sig = round_fx( mod_syn[i] ); /* Q_oriSHB */ - synNrg = L_mac0( synNrg, sig, sig ); /* 2*Q_oriSHB */ -#endif } tmp = add( l_frame, l_shb_lahead ); FOR( ; i < tmp; i++ ) { -#ifdef BASOP_NOGLOB sig = mult_ro( oriSHB[i], win_shb[l_frame + l_shb_lahead - 1 - i], &Overflow ); /* Q_oriSHB */ oriNrg = L_mac0_o( oriNrg, sig, sig, &Overflow ); /* 2*Q_oriSHB */ sig = round_fx_o( Mult_32_16( mod_syn[i], win_shb[l_frame + l_shb_lahead - 1 - i] ), &Overflow ); /* Q_oriSHB */ synNrg = L_mac0_o( synNrg, sig, sig, &Overflow ); /* 2*Q_oriSHB - 2*/ -#else - sig = mult_r( oriSHB[i], win_shb[l_frame + l_shb_lahead - 1 - i] ); /* Q_oriSHB */ - oriNrg = L_mac0( oriNrg, sig, sig ); /* 2*Q_oriSHB */ - - sig = round_fx( Mult_32_16( mod_syn[i], win_shb[l_frame + l_shb_lahead - 1 - i] ) ); /* Q_oriSHB */ - synNrg = L_mac0( synNrg, sig, sig ); /* 2*Q_oriSHB */ -#endif } IF( EQ_32( oriNrg, MAX_32 ) ) { @@ -4913,42 +4759,23 @@ static void EstimateSHBFrameGain_ivas_fx( move32(); FOR( i = 0; i < l_shb_lahead; i++ ) { -#ifdef BASOP_NOGLOB sig = mult_r( shl_o( oriSHB[i], scaling, &Overflow ), win_shb[i] ); oriNrg = L_mac0_o( oriNrg, sig, sig, &Overflow ); /* 2*Q_oriSHB + 2*scaling */ -#else - sig = mult_r( shl( oriSHB[i], scaling ), win_shb[i] ); - oriNrg = L_mac0( oriNrg, sig, sig ); /* 2*Q_oriSHB + 2*scaling */ -#endif } FOR( ; i < l_frame; i++ ) { -#ifdef BASOP_NOGLOB sig = shl_o( oriSHB[i], scaling, &Overflow ); oriNrg = L_mac0_o( oriNrg, sig, sig, &Overflow ); /* 2*Q_oriSHB + 2*scaling */ -#else - sig = shl( oriSHB[i], scaling ); - oriNrg = L_mac0( oriNrg, sig, sig ); /* 2*Q_oriSHB + 2*scaling */ -#endif } FOR( ; i < tmp; i++ ) { -#ifdef BASOP_NOGLOB sig = mult_r( shl_o( oriSHB[i], scaling, &Overflow ), win_shb[l_frame + l_shb_lahead - 1 - i] ); oriNrg = L_mac0_o( oriNrg, sig, sig, &Overflow ); /* 2*Q_oriSHB + 2*scaling */ -#else - sig = mult_r( shl( oriSHB[i], scaling ), win_shb[l_frame + l_shb_lahead - 1 - i] ); - oriNrg = L_mac0( oriNrg, sig, sig ); /* 2*Q_oriSHB + 2*scaling */ -#endif } } L_tmp = root_a_over_b_fx( oriNrg, shl( Q_oriSHB, 1 ), synNrg, sub( shl( Q_synSHB, 1 ), 2 ), &exp_out ); exp_out = sub( exp_out, scaling ); -#ifdef BASOP_NOGLOB frame_gain = L_shl_sat( L_tmp, sub( exp_out, 13 ) ); /* Q18 */ -#else - frame_gain = L_shl( L_tmp, sub( exp_out, 13 ) ); /* Q18 */ -#endif *GainFrame = frame_gain; move32(); @@ -5101,31 +4928,18 @@ static void EstimateSHBGainShape_fx( FOR( k = 0; k < length / 2; k++ ) { sig = mult_r( oriSHB[j + k], subwin[2 * k + 2] ); /* Q_oriSHB */ -#ifdef BASOP_NOGLOB oriNrg = L_mac0_sat( oriNrg, sig, sig ); /* 2* Q_oriSHB */ sig = mult_r( synSHB[j + k], subwin[2 * k + 2] ); /* Q_synSHB */ synNrg = L_mac0_sat( synNrg, sig, sig ); /* 2* Q_synSHB */ -#else - oriNrg = L_mac0( oriNrg, sig, sig ); /* 2* Q_oriSHB */ - sig = mult_r( synSHB[j + k], subwin[2 * k + 2] ); /* Q_synSHB */ - synNrg = L_mac0( synNrg, sig, sig ); /* 2* Q_synSHB */ -#endif } FOR( k = length / 2; k < length; k++ ) { sig = oriSHB[j + k]; move16(); -#ifdef BASOP_NOGLOB oriNrg = L_mac0_sat( oriNrg, sig, sig ); /* 2* Q_oriSHB */ sig = synSHB[j + k]; move16(); synNrg = L_mac0_sat( synNrg, sig, sig ); /* 2* Q_synSHB */ -#else - oriNrg = L_mac0( oriNrg, sig, sig ); /* 2* Q_oriSHB */ - sig = synSHB[j + k]; - move16(); - synNrg = L_mac0( synNrg, sig, sig ); /* 2* Q_synSHB */ -#endif } } ELSE @@ -5133,17 +4947,9 @@ static void EstimateSHBGainShape_fx( FOR( k = 0; k < length; k++ ) { sig = mult_r( oriSHB[j + k], subwin[k + 1] ); /* Q_oriSHB */ -#ifdef BASOP_NOGLOB oriNrg = L_mac0_sat( oriNrg, sig, sig ); /* 2* Q_oriSHB */ -#else - oriNrg = L_mac0( oriNrg, sig, sig ); /* 2* Q_oriSHB */ -#endif sig = mult_r( synSHB[j + k], subwin[k + 1] ); /* Q_synSHB */ -#ifdef BASOP_NOGLOB synNrg = L_mac0_sat( synNrg, sig, sig ); /* 2* Q_synSHB */ -#else - synNrg = L_mac0( synNrg, sig, sig ); /* 2* Q_synSHB */ -#endif } } IF( EQ_16( i, NUM_SHB_SUBFR / 2 - 1 ) ) @@ -5152,18 +4958,10 @@ static void EstimateSHBGainShape_fx( FOR( ; k < length_tmp; k++ ) { sig = mult_r( oriSHB[j + k], subwin[3 * length - 2 * k - 2] ); /* Q_oriSHB */ -#ifdef BASOP_NOGLOB oriNrg = L_mac0_sat( oriNrg, sig, sig ); /* 2* Q_oriSHB */ -#else - oriNrg = L_mac0( oriNrg, sig, sig ); /* 2* Q_oriSHB */ -#endif sig = mult_r( synSHB[j + k], subwin[3 * length - 2 * k - 2] ); /* Q_synSHB */ -#ifdef BASOP_NOGLOB synNrg = L_mac0_sat( synNrg, sig, sig ); /* 2* Q_synSHB */ -#else - synNrg = L_mac0( synNrg, sig, sig ); /* 2* Q_synSHB */ -#endif } } ELSE @@ -5171,17 +4969,9 @@ static void EstimateSHBGainShape_fx( FOR( ; k < length2; k++ ) { sig = mult_r( oriSHB[j + k], subwin[2 * length - k - 1] ); /* Q_oriSHB */ -#ifdef BASOP_NOGLOB oriNrg = L_mac0_sat( oriNrg, sig, sig ); /* 2* Q_oriSHB */ -#else - oriNrg = L_mac0( oriNrg, sig, sig ); /* 2* Q_oriSHB */ -#endif sig = mult_r( synSHB[j + k], subwin[2 * length - k - 1] ); /* Q_synSHB */ -#ifdef BASOP_NOGLOB synNrg = L_mac0_sat( synNrg, sig, sig ); /* 2* Q_synSHB */ -#else - synNrg = L_mac0( synNrg, sig, sig ); /* 2* Q_synSHB */ -#endif } } @@ -5214,49 +5004,25 @@ static void EstimateSHBGainShape_fx( FOR( k = 0; k < length; k++ ) { sig = mult_r( oriSHB[j + k], subwin[k + 1] ); /* Q_oriSHB */ -#ifdef BASOP_NOGLOB oriNrg = L_mac0_o( oriNrg, sig, sig, &Overflow ); /* 2* Q_oriSHB */ -#else - oriNrg = L_mac0( oriNrg, sig, sig ); /* 2* Q_oriSHB */ -#endif sig = mult_r( synSHB[j + k], subwin[k + 1] ); /* Q_oriSHB */ -#ifdef BASOP_NOGLOB synNrg = L_mac0_o( synNrg, sig, sig, &Overflow ); /* 2* Q_oriSHB */ -#else - synNrg = L_mac0( synNrg, sig, sig ); /* 2* Q_oriSHB */ -#endif } FOR( k = 0; k < ( join_length - length ); k++ ) { sig = mult_r( oriSHB[length + j + k], 32767 ); /* Q_oriSHB */ -#ifdef BASOP_NOGLOB oriNrg = L_mac0_o( oriNrg, sig, sig, &Overflow ); /* 2* Q_oriSHB */ -#else - oriNrg = L_mac0( oriNrg, sig, sig ); /* 2* Q_oriSHB */ -#endif sig = mult_r( synSHB[length + j + k], 32767 ); /* Q_oriSHB */ -#ifdef BASOP_NOGLOB synNrg = L_mac0_o( synNrg, sig, sig, &Overflow ); /* 2* Q_oriSHB */ -#else - synNrg = L_mac0( synNrg, sig, sig ); /* 2* Q_oriSHB */ -#endif } FOR( k = 0; k < length; k++ ) { sig = mult_r( oriSHB[j + join_length + k], subwin[length - k - 1] ); /* Q_oriSHB */ -#ifdef BASOP_NOGLOB oriNrg = L_mac0_o( oriNrg, sig, sig, &Overflow ); /* 2* Q_oriSHB */ -#else - oriNrg = L_mac0( oriNrg, sig, sig ); /* 2* Q_oriSHB */ -#endif sig = mult_r( synSHB[j + join_length + k], subwin[length - k - 1] ); /* Q_oriSHB */ -#ifdef BASOP_NOGLOB synNrg = L_mac0_o( synNrg, sig, sig, &Overflow ); /* 2* Q_oriSHB */ -#else - synNrg = L_mac0( synNrg, sig, sig ); /* 2* Q_oriSHB */ -#endif } /* Only implemented in SWB because the length of samples in SWB frame is longer, more likely to saturate */ scaling = 0; @@ -5275,29 +5041,17 @@ static void EstimateSHBGainShape_fx( FOR( k = 0; k < length; k++ ) { sig = mult_r( oriSHB[j + k], subwin[k + 1] ); -#ifdef BASOP_NOGLOB oriNrg = L_mac0_sat( oriNrg, sig, sig ); /* 2*Q_oriSHB - 2*/ -#else - oriNrg = L_mac0( oriNrg, sig, sig ); /* 2*Q_oriSHB - 2*/ -#endif } FOR( k = 0; k < ( join_length - length ); k++ ) { sig = shr( oriSHB[length + j + k], 1 ); -#ifdef BASOP_NOGLOB oriNrg = L_mac0_sat( oriNrg, sig, sig ); /* 2*Q_oriSHB - 2*/ -#else - oriNrg = L_mac0( oriNrg, sig, sig ); /* 2*Q_oriSHB - 2*/ -#endif } FOR( k = 0; k < length; k++ ) { sig = mult_r( shr( oriSHB[j + join_length + k], 1 ), subwin[length - k - 1] ); /* Q_oriSHB - 1(scaling) */ -#ifdef BASOP_NOGLOB oriNrg = L_mac0_sat( oriNrg, sig, sig ); /* 2*Q_oriSHB - 2 */ -#else - oriNrg = L_mac0( oriNrg, sig, sig ); /* 2*Q_oriSHB - 2 */ -#endif } } L_subgain[i] = root_a_over_b_fx( oriNrg, shl( Q_oriSHB, 1 ), synNrg, shl( Q_synSHB, 1 ), &n ); @@ -5315,13 +5069,8 @@ static void EstimateSHBGainShape_fx( FOR( i = 0; i < num_gains; i++ ) { -#ifdef BASOP_NOGLOB subgain[i] = round_fx_o( L_shl_o( L_subgain[i], sub( norm[i], n_max + 1 ), &Overflow ), &Overflow ); /* Q(14-n_max) */ L_sum_gain = L_mac0_o( L_sum_gain, subgain[i], subgain[i], &Overflow ); /* Q(28-2*n_max) */ -#else - subgain[i] = round_fx( L_shl( L_subgain[i], sub( norm[i], n_max + 1 ) ) ); /* Q(14-n_max) */ - L_sum_gain = L_mac0( L_sum_gain, subgain[i], subgain[i] ); /* Q(28-2*n_max) */ -#endif move16(); } @@ -5334,11 +5083,7 @@ static void EstimateSHBGainShape_fx( FOR( i = 0; i < num_gains; i++ ) { L_tmp = Mpy_32_16_1( normFact, subgain[i] ); /*Q(31-n) * Q(31-norm[i]) */ /* Q(30-n-n_max) */ -#ifdef BASOP_NOGLOB subgain[i] = s_max( round_fx_o( L_shl_o( L_tmp, add( n, n_max + 1 ), &Overflow ), &Overflow ), 3277 /*0.1f Q15*/ ); /* Q15 */ -#else - subgain[i] = s_max( round_fx( L_shl( L_tmp, add( n, n_max + 1 ) ) ), 3277 /*0.1f Q15*/ ); /* Q15 */ -#endif move16(); } @@ -6348,11 +6093,7 @@ static void determine_gain_weights_fx( { exp2 = sub( exp, 2 ); } -#ifdef BASOP_NOGLOB weights[j] = shl_o( tmp, exp2, &Overflow ); -#else - weights[j] = shl( tmp, exp2 ); -#endif move16(); /* Q12 */ } ELSE @@ -6983,11 +6724,7 @@ static void first_VQstages_fx( L_tmp = L_deposit_l( 0 ); FOR( j = 0; j < N; j++ ) { -#ifdef BASOP_NOGLOB L_tmp1 = L_shl_o( L_mult0( u[j], w[j] ), 7, &Overflow ); /*x2.56 + Q8 + Q7 */ -#else /* BASOP_NOGLOB */ - L_tmp1 = L_shl( L_mult0( u[j], w[j] ), 7 ); /*x2.56 + Q8 + Q7 */ -#endif /* BASOP_NOGLOB */ L_tmp1 = Mult_32_16( L_tmp1, u[j] ); /*x2.56 + Q15 + x2.56 -Q15 */ L_tmp = L_add( L_tmp, L_tmp1 ); /*Q0 + x2.56 +x2.56 */ } @@ -7521,11 +7258,7 @@ void fb_tbe_enc_fx( Copy( tmp_vec, input_fhb + Sample_Delay_HP, L_FRAME48k - Sample_Delay_HP ); Copy( tmp_vec + L_FRAME48k - Sample_Delay_HP, hBWE_TD->old_input_fhb_fx, Sample_Delay_HP ); temp2 = sum2_fx_mod( input_fhb, L_FRAME48k / 2 ); /* Q11 */ -#ifdef BASOP_NOGLOB temp2 = L_add_o( temp2, L_shl_o( hBWE_TD->prev_fb_energy_fx, sub( sub( add( exp_temp, exp_temp ), 6 ), hBWE_TD->prev_fb_energy_fx_Q ), &Overflow ), &Overflow ); /* Q11 */ -#else - temp2 = L_add( temp2, L_shl( hBWE_TD->prev_fb_energy_fx, sub( sub( add( exp_temp, exp_temp ), 6 ), hBWE_TD->prev_fb_energy_fx_Q ) ) ); /* Q11 */ -#endif hBWE_TD->prev_fb_energy_fx = sum2_fx_mod( input_fhb + L_FRAME48k / 2, L_FRAME48k / 2 ); /*Q11*/ hBWE_TD->prev_fb_energy_fx_Q = sub( add( exp_temp, exp_temp ), 6 ); fb_exc_energy = sum2_fx_mod( fb_exc, L_FRAME16k ); /* Q(2*Q_fb_exc+1 -7) */ @@ -7552,11 +7285,7 @@ void fb_tbe_enc_fx( tmp = div_s( tmp2, tmp ); L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp ); /*Q(31-exp)*/ -#ifdef BASOP_NOGLOB L_tmp = L_max( L_shr_o( L_tmp, sub( 31, exp ), &Overflow ), 0x1 ); /* Q0 */ -#else - L_tmp = L_max( L_shr( L_tmp, sub( 31, exp ) ), 0x1 ); /* Q0 */ -#endif } ELSE { @@ -7675,11 +7404,7 @@ void fb_tbe_enc_ivas_fx( Copy( tmp_vec, input_fhb + Sample_Delay_HP, sub( L_FRAME48k, Sample_Delay_HP ) ); Copy( tmp_vec + L_FRAME48k - Sample_Delay_HP, hBWE_TD->old_input_fhb_fx, Sample_Delay_HP ); temp2 = sum2_fx_mod( input_fhb, L_FRAME48k / 2 ); /* Q(2*Q_input_fhb-8) */ -#ifdef BASOP_NOGLOB temp2 = L_add_o( temp2, L_shl_o( hBWE_TD->prev_fb_energy_fx, sub( sub( add( exp_temp, exp_temp ), 8 ), hBWE_TD->prev_fb_energy_fx_Q ), &Overflow ), &Overflow ); /* Q(2*(exp_temp)-8) */ -#else - temp2 = L_add( temp2, L_shl( hBWE_TD->prev_fb_energy_fx, sub( sub( add( exp_temp, exp_temp ), 8 ), hBWE_TD->prev_fb_energy_fx_Q ) ) ); /* Q(2*(exp_temp)-8) */ -#endif hBWE_TD->prev_fb_energy_fx = sum2_fx_mod( input_fhb + L_FRAME48k / 2, L_FRAME48k / 2 ); /*Q(2*(Q_input_fhb)-8) */ move32(); hBWE_TD->prev_fb_energy_fx_Q = sub( add( exp_temp, exp_temp ), 8 ); @@ -7708,11 +7433,7 @@ void fb_tbe_enc_ivas_fx( tmp = div_s( tmp2, tmp ); L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp ); /*Q(31-exp)*/ -#ifdef BASOP_NOGLOB L_tmp = L_max( L_shr_o( L_tmp, sub( 31, exp ), &Overflow ), 0x1 ); /* Q0 */ -#else - L_tmp = L_max( L_shr( L_tmp, sub( 31, exp ) ), 0x1 ); /* Q0 */ -#endif } ELSE { diff --git a/lib_enc/tcq_core_enc_fx.c b/lib_enc/tcq_core_enc_fx.c index 21136aa09..399e62db9 100644 --- a/lib_enc/tcq_core_enc_fx.c +++ b/lib_enc/tcq_core_enc_fx.c @@ -477,11 +477,7 @@ ivas_error tcq_core_LR_enc_fx( exp = sub( norm_l( crosscorr_fx ), 1 ); gain_fx = ar_div( L_shl( crosscorr_fx, exp ), selfcorr_fx ); /* 1 + exp */ -#ifdef BASOP_NOGLOB gain_fx = L_shl_sat( gain_fx, sub( 16, 1 + exp ) + 2 ); /* 0.2 * Q16 */ -#else - gain_fx = L_shl( gain_fx, sub( 16, 1 + exp ) + 2 ); /* 0.2 * Q16 */ -#endif lo = L_Extract_lc( gain_fx, &hi ); /* Use optimal gain */ FOR( j = 0; j < sfmsize[k_sort[i]]; j++ ) @@ -965,11 +961,7 @@ ivas_error tcq_core_LR_enc_ivas_fx( exp = sub( norm_l( crosscorr_fx ), 1 ); gain_fx = ar_div( L_shl( crosscorr_fx, exp ), selfcorr_fx ); /* 1 + exp */ -#ifdef BASOP_NOGLOB gain_fx = L_shl_sat( gain_fx, sub( 16, 1 + exp ) + 2 ); /* 0.2 * Q16 */ -#else - gain_fx = L_shl( gain_fx, sub( 16, 1 + exp ) + 2 ); /* 0.2 * Q16 */ -#endif lo = L_Extract_lc( gain_fx, &hi ); /* Use optimal gain */ FOR( j = 0; j < sfmsize[k_sort[i]]; j++ ) diff --git a/lib_enc/tcx_ltp_enc_fx.c b/lib_enc/tcx_ltp_enc_fx.c index 2222e8f74..e1d478e95 100644 --- a/lib_enc/tcx_ltp_enc_fx.c +++ b/lib_enc/tcx_ltp_enc_fx.c @@ -181,13 +181,7 @@ static void tcx_ltp_pitch_search( temp_m = divide1616( extract_h( L_shl( cor_max, s ) ), temp_m ); temp_e = sub( negate( s ), temp_e ); -#ifdef BASOP_NOGLOB *norm_corr = shl_o( temp_m, temp_e, &Overflow ); -#else - BASOP_SATURATE_WARNING_OFF_EVS - *norm_corr = shl( temp_m, temp_e ); - BASOP_SATURATE_WARNING_ON_EVS -#endif IF( GE_16( t1, pitfr1 ) ) { @@ -391,13 +385,7 @@ static void tcx_ltp_pitch_search_ivas_fx( temp_m = divide1616( extract_h( L_shl( cor_max, s ) ), temp_m ); temp_e = sub( negate( s ), temp_e ); -#ifdef BASOP_NOGLOB *norm_corr = shl_o( temp_m, temp_e, &Overflow ); -#else - BASOP_SATURATE_WARNING_OFF_EVS - *norm_corr = shl( temp_m, temp_e ); - BASOP_SATURATE_WARNING_ON_EVS -#endif test(); IF( check_border_case && EQ_16( t1, t0_min ) ) @@ -526,15 +514,9 @@ static void tcx_ltp_find_gain( Word16 *speech, Word16 *pred_speech, Word16 L_fra FOR( i = 0; i < L_frame; i++ ) { -#ifdef BASOP_NOGLOB tmp = shl_sat( pred_speech[i], s2 ); corr = L_mac0_sat( corr, shl( speech[i], s1 ), tmp ); ener = L_mac0_sat( ener, tmp, tmp ); -#else - tmp = shl( pred_speech[i], s2 ); - corr = L_mac0( corr, shl( speech[i], s1 ), tmp ); - ener = L_mac0( ener, tmp, tmp ); -#endif } s1 = sub( 1, add( s1, s2 ) ); @@ -548,26 +530,14 @@ static void tcx_ltp_find_gain( Word16 *speech, Word16 *pred_speech, Word16 L_fra ener = L_shl( ener, tmp ); s2 = sub( s2, tmp ); -#ifdef BASOP_NOGLOB g = divide1616( round_fx_o( corr, &Overflow ), round_fx_o( ener, &Overflow ) ); -#else - g = divide1616( round_fx( corr ), round_fx( ener ) ); -#endif BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB g = shl_o( g, sub( s1, s2 ), &Overflow ); -#else /* BASOP_NOGLOB */ - g = shl( g, sub( s1, s2 ) ); -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS /* Quantize gain */ #ifdef FIX_ISSUE_1150 -#ifdef BASOP_NOGLOB g = shr( sub_o( g, 0x1000, &Overflow ), 13 ); -#else - g = shr( sub( g, 0x1000 ), 13 ); -#endif #else g = shr( sub( g, 0x1000 ), 13 ); #endif @@ -599,15 +569,9 @@ static void tcx_ltp_find_gain_ivas_fx( Word16 *speech /*Qx*/, Word16 *pred_speec FOR( i = 0; i < L_frame; i++ ) { -#ifdef BASOP_NOGLOB tmp = shl_sat( pred_speech[i], s2 ); // Qx + s2 corr = L_mac0_sat( corr, shl( speech[i], s1 ), tmp ); // 2*Qx + s1 + s2 ener = L_mac0_sat( ener, tmp, tmp ); // 2*(Qx+s2) -#else - tmp = shl( pred_speech[i], s2 ); - corr = L_mac0( corr, shl( speech[i], s1 ), tmp ); - ener = L_mac0( ener, tmp, tmp ); -#endif } s1 = sub( 1, add( s1, s2 ) ); @@ -621,17 +585,9 @@ static void tcx_ltp_find_gain_ivas_fx( Word16 *speech /*Qx*/, Word16 *pred_speec ener = L_shl( ener, tmp ); s2 = sub( s2, tmp ); -#ifdef BASOP_NOGLOB g = divide1616( round_fx_o( corr, &Overflow ), round_fx_o( ener, &Overflow ) ); -#else - g = divide1616( round_fx( corr ), round_fx( ener ) ); -#endif BASOP_SATURATE_WARNING_OFF_EVS -#ifdef BASOP_NOGLOB g = shl_o( g, sub( s1, s2 ), &Overflow ); /*Q15*/ -#else /* BASOP_NOGLOB */ - g = shl( g, sub( s1, s2 ) ); -#endif /* BASOP_NOGLOB */ BASOP_SATURATE_WARNING_ON_EVS /* Quantize gain */ @@ -847,18 +803,10 @@ void tcx_ltp_encode_fx( Word16 tcxltp_on, FOR( n = 0; n < L_subfr; n++ ) { -#ifdef BASOP_NOGLOB speech_ltp[n] = sub_o( speech[n], mult_ro( *gain, mult_ro( alpha, pred_speech[n], &Overflow ), &Overflow ), &Overflow ); -#else - speech_ltp[n] = sub( speech[n], mult_r( *gain, mult_r( alpha, pred_speech[n] ) ) ); -#endif move16(); BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB alpha = add_o( alpha, step, &Overflow ); -#else /* BASOP_NOGLOB */ - alpha = add( alpha, step ); -#endif BASOP_SATURATE_WARNING_ON_EVS; } } @@ -881,11 +829,7 @@ void tcx_ltp_encode_fx( Word16 tcxltp_on, FOR( n = 0; n < lpcorder; n++ ) { -#ifdef BASOP_NOGLOB buf_zir[n] = add_sat( sub_sat( speech_ltp[n - lpcorder], speech[n - lpcorder] ), mult_r( *gain, buf_zir[n] ) ); -#else - buf_zir[n] = add( sub( speech_ltp[n - lpcorder], speech[n - lpcorder] ), mult_r( *gain, buf_zir[n] ) ); -#endif move16(); } @@ -913,11 +857,7 @@ void tcx_ltp_encode_fx( Word16 tcxltp_on, FOR( n = 0; n < L_subfr; n++ ) { -#ifdef BASOP_NOGLOB speech_ltp[n] = add_o( sub_o( speech[n], mult_ro( *gain, pred_speech[n], &Overflow ), &Overflow ), zir[n], &Overflow ); -#else - speech_ltp[n] = add( sub( speech[n], mult_r( *gain, pred_speech[n] ) ), zir[n] ); -#endif move16(); } } @@ -935,11 +875,7 @@ void tcx_ltp_encode_fx( Word16 tcxltp_on, { FOR( n = L_subfr; n < L_frame; n++ ) { -#ifdef BASOP_NOGLOB speech_ltp[n] = sub_o( speech[n], mult( *gain, pred_speech[n] ), &Overflow ); -#else - speech_ltp[n] = sub( speech[n], mult( *gain, pred_speech[n] ) ); -#endif move16(); } } diff --git a/lib_enc/tcx_utils_enc_fx.c b/lib_enc/tcx_utils_enc_fx.c index 31c04c1d5..7e464adcd 100644 --- a/lib_enc/tcx_utils_enc_fx.c +++ b/lib_enc/tcx_utils_enc_fx.c @@ -187,20 +187,12 @@ static void detectLowpassFac( const Word32 *powerSpec, Word16 powerSpec_e, Word1 threshold = 256l /*0.1f * 2*NORM_MDCT_FACTOR Q3*/; /* Q3 */ move32(); BASOP_SATURATE_WARNING_OFF_EVS /* Allow saturation, because threshold is being compared to powerSpec[i] below. */ -#ifdef BASOP_NOGLOB threshold = L_shl_o( threshold, sub( 28, powerSpec_e ), &Overflow ); -#else /* BASOP_NOGLOB */ - threshold = L_shl( threshold, sub( 28, powerSpec_e ) ); -#endif /* BASOP_NOGLOB */ IF( rectWin != 0 ) { /* compensate for bad side-lobe attenuation with asymmetric windows */ -#ifdef BASOP_NOGLOB threshold = L_shl_o( threshold, 1, &Overflow ); -#else - threshold = L_shl( threshold, 1 ); -#endif } BASOP_SATURATE_WARNING_ON_EVS @@ -285,18 +277,10 @@ void AnalyzePowerSpectrum_fx( /* power spectrum: MDCT^2 + MDST^2 */ FOR( i = iStart; i < iEnd; i++ ) { -#ifdef BASOP_NOGLOB tmp = round_fx_sat( L_shl_sat( mdctSpectrum[i], s1 ) ); -#else - tmp = round_fx( L_shl( mdctSpectrum[i], s1 ) ); -#endif tmp32 = L_mult0( tmp, tmp ); -#ifdef BASOP_NOGLOB tmp = round_fx_sat( L_shl_sat( powerSpec[i], s2 ) ); -#else - tmp = round_fx( L_shl( powerSpec[i], s2 ) ); -#endif tmp32 = L_mac0( tmp32, tmp, tmp ); powerSpec[i] = tmp32; @@ -1230,13 +1214,8 @@ void tcx_scalar_quantization_fx( FOR( ; i >= 0; i-- ) { offs32 = Mpy_32_16_1( L_abs( x[i] ), gain ); /* multiply */ -#ifdef BASOP_NOGLOB offs32 = L_shl_sat( offs32, s ); /* convert to 15Q16 */ tmp16 = mac_r_sat( offs32, offset, 1 ); /* add offset and truncate */ -#else - offs32 = L_shl( offs32, s ); /* convert to 15Q16 */ - tmp16 = mac_r( offs32, offset, 1 ); /* add offset and truncate */ -#endif IF( x[i] < 0 ) { tmp16 = negate( tmp16 ); /* restore sign */ @@ -1312,13 +1291,8 @@ void tcx_scalar_quantization_ivas_fx( FOR( ; i >= 0; i-- ) { offs32 = Mpy_32_16_1( L_abs( x[i] ), gain ); /* multiply */ -#ifdef BASOP_NOGLOB offs32 = L_shl_sat( offs32, s ); /* convert to 15Q16 */ tmp16 = mac_r_sat( offs32, offset, 1 ); /* add offset and truncate */ -#else - offs32 = L_shl( offs32, s ); /* convert to 15Q16 */ - tmp16 = mac_r( offs32, offset, 1 ); /* add offset and truncate */ -#endif IF( x[i] < 0 ) { tmp16 = negate( tmp16 ); /* restore sign */ @@ -1454,11 +1428,7 @@ Word16 tcx_scalar_quantization_rateloop_fx( /* convert to normalized 16 bit */ tmp = norm_l( tmp32 ); -#ifdef BASOP_NOGLOB sqGain = round_fx_sat( L_shl( tmp32, tmp ) ); -#else - sqGain = round_fx( L_shl( tmp32, tmp ) ); -#endif sqGain_e = sub( sqGain_e, tmp ); /* divide */ @@ -1494,11 +1464,7 @@ Word16 tcx_scalar_quantization_rateloop_fx( /* convert to normalized 16 bit */ tmp = norm_l( tmp32 ); -#ifdef BASOP_NOGLOB sqGain = round_fx_sat( L_shl_sat( tmp32, tmp ) ); -#else - sqGain = round_fx( L_shl( tmp32, tmp ) ); -#endif sqGain_e = sub( sqGain_e, tmp ); /* divide */ @@ -1822,11 +1788,7 @@ Word16 tcx_scalar_quantization_rateloop_ivas_fx( /* convert to normalized 16 bit */ tmp = norm_l( tmp32 ); -#ifdef BASOP_NOGLOB sqGain = round_fx_sat( L_shl( tmp32, tmp ) ); -#else - sqGain = round_fx( L_shl( tmp32, tmp ) ); -#endif sqGain_e = sub( sqGain_e, tmp ); /* divide */ @@ -1862,11 +1824,7 @@ Word16 tcx_scalar_quantization_rateloop_ivas_fx( /* convert to normalized 16 bit */ tmp = norm_l( tmp32 ); -#ifdef BASOP_NOGLOB sqGain = round_fx_sat( L_shl_sat( tmp32, tmp ) ); -#else - sqGain = round_fx( L_shl( tmp32, tmp ) ); -#endif sqGain_e = sub( sqGain_e, tmp ); /* divide */ @@ -2045,11 +2003,7 @@ void QuantizeGain( Word16 n, Word16 *pGain, Word16 *pGain_e, Word16 *pQuantizedG move32(); #endif -#ifdef BASOP_NOGLOB ener = mult_r( shl_o( n, 5, &Overflow ), 26214 /*128.f/NORM_MDCT_FACTOR Q15*/ ); -#else - ener = mult_r( shl( n, 5 ), 26214 /*128.f/NORM_MDCT_FACTOR Q15*/ ); -#endif ener_e = 15 - 5 - 7; move16(); IF( GE_16( n, 1024 ) ) @@ -2218,11 +2172,7 @@ void tcx_noise_factor_fx( att = BASOP_Util_Divide3232_Scale( L_shl( L_min( accu1, accu2 ), 1 ), L_add( accu1, accu2 ), &s ); att = Sqrt16( att, &s ); BASOP_SATURATE_WARNING_OFF_EVS; /* att is always <= 1.0 */ -#ifdef BASOP_NOGLOB att = shl_o( att, s, &Overflow ); -#else - att = shl( att, s ); -#endif BASOP_SATURATE_WARNING_ON_EVS; } ELSE @@ -2425,11 +2375,7 @@ void tcx_noise_factor_fx( tmp1 = BASOP_Util_Divide3232_Scale( Mpy_32_16_1( sqErrorNrg, att ), n, &s ); s = add( add( add( s, x_orig_e ), inv_gain2_e ), 7 - 15 ); BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB tmp1 = shl_o( tmp1, s, &Overflow ); -#else /* BASOP_NOGLOB */ - tmp1 = shl( tmp1, s ); -#endif BASOP_SATURATE_WARNING_ON_EVS; } ELSE @@ -2590,11 +2536,7 @@ void tcx_noise_factor_ivas_fx( att = BASOP_Util_Divide3232_Scale( L_shl( L_min( accu1, accu2 ), 1 ), L_add( accu1, accu2 ), &s ); att = Sqrt16( att, &s ); BASOP_SATURATE_WARNING_OFF_EVS; /* att is always <= 1.0 */ -#ifdef BASOP_NOGLOB att = shl_o( att, s, &Overflow ); -#else - att = shl( att, s ); -#endif BASOP_SATURATE_WARNING_ON_EVS; } ELSE @@ -2798,11 +2740,7 @@ void tcx_noise_factor_ivas_fx( tmp1 = BASOP_Util_Divide3232_Scale( Mpy_32_16_1( sqErrorNrg, att ), n, &s ); s = add( add( add( s, x_orig_e ), inv_gain2_e ), 7 - 15 ); BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB tmp1 = shl_o( tmp1, s, &Overflow ); -#else /* BASOP_NOGLOB */ - tmp1 = shl( tmp1, s ); -#endif BASOP_SATURATE_WARNING_ON_EVS; } ELSE @@ -2861,11 +2799,7 @@ void tcx_encoder_memory_update_fx( Residu3_fx( Ai + ( st->nb_subfr - 1 ) * ( M + 1 ), synth + sub( L_frame_glob, 1 ), &tmp, 1, Q_new + shift - 1 ); LPDmem->mem_w0 = sub( wsig[sub( L_frame_glob, 1 )], tmp ); move16(); -#ifdef BASOP_NOGLOB LPDmem->mem_w0 = shr_sat( LPDmem->mem_w0, shift ); /*Qnew-1*/ -#else - LPDmem->mem_w0 = shr( LPDmem->mem_w0, shift ); /*Qnew-1*/ -#endif move16(); } @@ -3365,11 +3299,7 @@ Word16 tcx_res_Q_gain_fx( } /* bring sqGain to same exponent */ -#ifdef BASOP_NOGLOB sqGain = shr_sat( sqGain, sub( gain_reQ_e, sqGain_e ) ); -#else - sqGain = shr( sqGain, sub( gain_reQ_e, sqGain_e ) ); -#endif FOR( bits = 0; bits < TCX_RES_Q_BITS_GAIN; bits++ ) { IF( LT_16( sqGain, gain_reQ ) ) diff --git a/lib_enc/tfa_enc_fx.c b/lib_enc/tfa_enc_fx.c index af863f5d7..a6a1eaa85 100644 --- a/lib_enc/tfa_enc_fx.c +++ b/lib_enc/tfa_enc_fx.c @@ -30,11 +30,7 @@ void tfaCalcEnv_fx( move32(); FOR( j = 0; j < L_TEC_TFA_SUBFR16k; j++ ) { -#ifdef BASOP_NOGLOB enr[i] = L_mac0_sat( enr[i], shb_speech[k], shb_speech[k] ); -#else - enr[i] = L_mac0( enr[i], shb_speech[k], shb_speech[k] ); -#endif move32(); k = add( k, 1 ); } diff --git a/lib_enc/tns_base_enc_fx.c b/lib_enc/tns_base_enc_fx.c index 093232632..0ac9a6d4c 100644 --- a/lib_enc/tns_base_enc_fx.c +++ b/lib_enc/tns_base_enc_fx.c @@ -124,11 +124,7 @@ Word16 DetectTnsFilt_fx( STnsConfig const *pTnsConfig, /* Check threshold HLM_MIN_NRG */ BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB tmp32 = L_sub( L_shl_o( L_tmp, s_min( 31, sub( shift, 24 - 31 * 2 ) ), &Overflow ), 3277l /*HLM_MIN_NRG Q7*/ ); -#else /* BASOP_NOGLOB */ - tmp32 = L_sub( L_shl( L_tmp, s_min( 31, sub( shift, 24 - 31 * 2 ) ) ), 3277l /*HLM_MIN_NRG Q7*/ ); -#endif BASOP_SATURATE_WARNING_ON_EVS; /* get pre-shift for autocorrelation */ @@ -156,19 +152,11 @@ Word16 DetectTnsFilt_fx( STnsConfig const *pTnsConfig, facs_e[iFilter][iSubdivisions] = shl( sub( tmp, shifts[iFilter][iSubdivisions] ), 1 ); tmp = sub( 1, shl( tmp, 1 ) ); /* exponent of autocorrelation */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, sub( shift, tmp ) ); /* shift L_tmp to that exponent */ /* calc factor (with 2 bits headroom for sum of 3 subdivisions) */ move16(); facs[iFilter][iSubdivisions] = div_s( 0x2000, round_fx_sat( L_tmp ) ); /* L_tmp is >= 0x2000000 */ -#else - L_tmp = L_shl( L_tmp, sub( shift, tmp ) ); /* shift L_tmp to that exponent */ - - /* calc factor (with 2 bits headroom for sum of 3 subdivisions) */ - move16(); - facs[iFilter][iSubdivisions] = div_s( 0x2000, round_fx( L_tmp ) ); /* L_tmp is >= 0x2000000 */ -#endif } } } @@ -255,11 +243,7 @@ Word16 DetectTnsFilt_fx( STnsConfig const *pTnsConfig, L_tmp = L_deposit_l( 0 ); FOR( i = 0; i < n; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac0_sat( L_tmp, tmpbuf[i], tmpbuf[i + lag] ); -#else - L_tmp = L_mac0( L_tmp, tmpbuf[i], tmpbuf[i + lag] ); -#endif } IF( lag != 0 ) @@ -517,11 +501,7 @@ Word16 DetectTnsFilt_ivas_fx( STnsConfig const *pTnsConfig, /* i : TNS Configur /* Check threshold HLM_MIN_NRG */ BASOP_SATURATE_WARNING_OFF_EVS; -#ifdef BASOP_NOGLOB tmp32 = L_sub( L_shl_o( L_tmp, s_min( 31, sub( shift, 24 - 31 * 2 ) ), &Overflow ), 3277l /*HLM_MIN_NRG Q7*/ ); -#else /* BASOP_NOGLOB */ - tmp32 = L_sub( L_shl( L_tmp, s_min( 31, sub( shift, 24 - 31 * 2 ) ) ), 3277l /*HLM_MIN_NRG Q7*/ ); -#endif BASOP_SATURATE_WARNING_ON_EVS; /* get pre-shift for autocorrelation */ @@ -549,19 +529,11 @@ Word16 DetectTnsFilt_ivas_fx( STnsConfig const *pTnsConfig, /* i : TNS Configur facs_e[iFilter][iSubdivisions] = shl( sub( tmp, shifts[iFilter][iSubdivisions] ), 1 ); tmp = sub( 1, shl( tmp, 1 ) ); /* exponent of autocorrelation */ -#ifdef BASOP_NOGLOB L_tmp = L_shl_sat( L_tmp, sub( shift, tmp ) ); /* shift L_tmp to that exponent */ /* calc factor (with 2 bits headroom for sum of 3 subdivisions) */ move16(); facs[iFilter][iSubdivisions] = div_s( 0x2000, round_fx_sat( L_tmp ) ); /* L_tmp is >= 0x2000000 */ -#else - L_tmp = L_shl( L_tmp, sub( shift, tmp ) ); /* shift L_tmp to that exponent */ - - /* calc factor (with 2 bits headroom for sum of 3 subdivisions) */ - move16(); - facs[iFilter][iSubdivisions] = div_s( 0x2000, round_fx( L_tmp ) ); /* L_tmp is >= 0x2000000 */ -#endif } } } @@ -644,11 +616,7 @@ Word16 DetectTnsFilt_ivas_fx( STnsConfig const *pTnsConfig, /* i : TNS Configur L_tmp = L_deposit_l( 0 ); FOR( i = 0; i < n; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac0_sat( L_tmp, tmpbuf[i], tmpbuf[i + lag] ); -#else - L_tmp = L_mac0( L_tmp, tmpbuf[i], tmpbuf[i + lag] ); -#endif } IF( lag != 0 ) diff --git a/lib_enc/transient_detection_fx.c b/lib_enc/transient_detection_fx.c index c72fc317a..09c642e5d 100644 --- a/lib_enc/transient_detection_fx.c +++ b/lib_enc/transient_detection_fx.c @@ -1312,11 +1312,7 @@ static void CalculateSubblockEnergies( Word16 const *input, Word16 nSamplesAvail FOR( k = 0; k < w; k++ ) { tmp = shr( input[k], SUBBLOCK_NRG_E / 2 ); -#ifdef BASOP_NOGLOB accu = L_mac0_sat( accu, tmp, tmp ); -#else - accu = L_mac0( accu, tmp, tmp ); -#endif } move32(); @@ -1333,11 +1329,7 @@ static void CalculateSubblockEnergies( Word16 const *input, Word16 nSamplesAvail FOR( ; k < k2; k++ ) { tmp = shr( input[k], SUBBLOCK_NRG_E / 2 ); -#ifdef BASOP_NOGLOB accu = L_mac0_sat( accu, tmp, tmp ); -#else - accu = L_mac0( accu, tmp, tmp ); -#endif } move32(); pSubblockNrg[w] = accu; @@ -1432,11 +1424,7 @@ static void CalculateSubblockEnergies_ivas_fx( Word16 const *input, Word16 nSamp { tmp = input[k]; // Q0 move16(); -#ifdef BASOP_NOGLOB accu = L_mac0_sat( accu, tmp, tmp ); // Q0 -#else - accu = L_mac0( accu, tmp, tmp ); -#endif } pSubblockNrg[0] = accu; // Q0 @@ -1455,11 +1443,7 @@ static void CalculateSubblockEnergies_ivas_fx( Word16 const *input, Word16 nSamp { tmp = input[k]; // Q0 move16(); -#ifdef BASOP_NOGLOB accu = L_mac0_sat( accu, tmp, tmp ); // Q0 -#else - accu = L_mac0( accu, tmp, tmp ); -#endif } pSubblockNrg[w] = accu; // Q0 move32(); diff --git a/lib_enc/transition_enc_fx.c b/lib_enc/transition_enc_fx.c index bc605c2d9..02372138d 100644 --- a/lib_enc/transition_enc_fx.c +++ b/lib_enc/transition_enc_fx.c @@ -1872,11 +1872,7 @@ static void tc_enc_fx( conv_fx( &exc_fx[i_subfr], h1_fx, yy1_fx, L_SUBFR ); /* gain_pit computation */ -#ifdef BASOP_NOGLOB *gain_pit_fx = corr_xy1_fx( xn_fx, yy1_fx, g_corr_fx, L_SUBFR, 0, &Overflow ); -#else - *gain_pit_fx = corr_xy1_fx( xn_fx, yy1_fx, g_corr_fx, L_SUBFR, 0 ); -#endif move16(); /*--------------------------------------------------------------* * Encode parameters and write indices @@ -2092,11 +2088,7 @@ static void tc_enc_ivas_fx( conv_fx( &exc_fx[i_subfr], h1_fx, yy1_fx, L_SUBFR ); /* gain_pit computation */ -#ifdef BASOP_NOGLOB *gain_pit_fx = corr_xy1_fx( xn_fx, yy1_fx, g_corr_fx, L_SUBFR, 0, &Overflow ); -#else - *gain_pit_fx = corr_xy1_fx( xn_fx, yy1_fx, g_corr_fx, L_SUBFR, 0 ); -#endif move16(); /*--------------------------------------------------------------* * Encode parameters and write indices @@ -2192,19 +2184,11 @@ static void gain_trans_enc_fx( move16(); gscale = 7; move16(); -#ifdef BASOP_NOGLOB gain_trans = extract_h( L_shl_o( gain_trans32, 16, &Overflow ) ); /* Q7 */ -#else /* BASOP_NOGLOB */ - gain_trans = extract_h( L_shl( gain_trans32, 16 ) ); /* Q7 */ -#endif /* BASOP_NOGLOB */ IF( GT_32( L_abs( gain_trans32 ), 29862L ) ) { -#ifdef BASOP_NOGLOB gain_trans = extract_h( L_shl_o( gain_trans32, 16 - 3, &Overflow ) ); /* Q4 */ -#else /* BASOP_NOGLOB */ - gain_trans = extract_h( L_shl( gain_trans32, 16 - 3 ) ); /* Q4 */ -#endif /* BASOP_NOGLOB */ istart = 4; move16(); imax = N_GAIN_TC - 1; @@ -2237,11 +2221,7 @@ static void gain_trans_enc_fx( FOR( i = 0; i < L_SUBFR; i++ ) { /*exc[i] *= (*gain_trans);*/ -#ifdef BASOP_NOGLOB exc[i] = round_fx_o( L_shl_o( L_mult( exc[i], gain_trans ), tmp16, &Overflow ), &Overflow ); -#else - exc[i] = round_fx( L_shl( L_mult( exc[i], gain_trans ), tmp16 ) ); -#endif move16(); } } @@ -2339,18 +2319,10 @@ void tc_classif_enc_fx( len = add( shr( T_op, 1 ), 2 ); position_tmp = emaximum_fx( Q_new, res, len, &temp2 ); -#ifdef BASOP_NOGLOB L_sum = L_mac_sat( 1L, res[0], res[0] ); -#else - L_sum = L_mac( 1L, res[0], res[0] ); -#endif FOR( i = 1; i < len; i++ ) { -#ifdef BASOP_NOGLOB L_sum = L_mac0_o( L_sum, res[i], res[i], &Overflow ); -#else /* BASOP_NOGLOB */ - L_sum = L_mac0( L_sum, res[i], res[i] ); -#endif /* BASOP_NOGLOB */ } aver = L_sum; /*Q = 2*Q_new */ move32(); @@ -2363,13 +2335,8 @@ void tc_classif_enc_fx( L_temp1 = Mult_32_16( temp, 8192 ); /* Q=31-exp */ test(); -#ifdef BASOP_NOGLOB IF( GT_32( temp2, L_shl_o( L_temp2, ( 31 - exp2 ) - ( 31 - exp ), &Overflow ) ) && LT_32( aver, L_shl_o( L_temp1, ( 31 - exp_aver ) - ( 31 - exp ), &Overflow ) ) ) -#else /* BASOP_NOGLOB */ - IF( GT_32( temp2, L_shl( L_temp2, ( 31 - exp2 ) - ( 31 - exp ) ) ) && - LT_32( aver, L_shl( L_temp1, ( 31 - exp_aver ) - ( 31 - exp ) ) ) ) -#endif { *position = position_tmp; move16(); diff --git a/lib_enc/updt_tar_fx.c b/lib_enc/updt_tar_fx.c index 4659acacf..5d364725f 100644 --- a/lib_enc/updt_tar_fx.c +++ b/lib_enc/updt_tar_fx.c @@ -33,15 +33,9 @@ void updt_tar_fx( { /*x2[i] = x[i] - gain*y[i];*/ L_tmp = L_mult( x[i], 16384 ); /* (Qz*Q14) -> (Qz+15) */ -#ifdef BASOP_NOGLOB L_tmp = L_msu_sat( L_tmp, y[i], gain ); x2[i] = extract_h( L_shl_o( L_tmp, 1, &Overflow ) ); move16(); -#else /* BASOP_NOGLOB */ - L_tmp = L_msu( L_tmp, y[i], gain ); - x2[i] = extract_h( L_shl( L_tmp, 1 ) ); - move16(); -#endif } return; } @@ -70,13 +64,8 @@ void updt_tar_HR_fx( { /*x2[i] = x[i] - gain*y[i];*/ L_tmp = L_mult( x[i], 32767 ); /* (Qz*Q15) = (Qz+16) */ -#ifdef BASOP_NOGLOB L_tmp1 = L_shl_o( L_mult_o( y[i], gain, &Overflow ), Qx, &Overflow ); /* ((Qz+2+1)< Q13 */ -#else /* BASOP_NOGLOB */ - tmp = shl( snr, 5 ); /* Q8 -> Q13 */ -#endif /* BASOP_NOGLOB */ IF( LT_16( i, 2 ) ) { -#ifdef BASOP_NOGLOB tmp = add_o( tmp, delta1, &Overflow ); /*Q13 */ -#else /* BASOP_NOGLOB */ - tmp = add( tmp, delta1 ); /*Q13 */ -#endif /* BASOP_NOGLOB */ } ELSE IF( LT_16( i, 7 ) ) { -#ifdef BASOP_NOGLOB tmp = add_o( tmp, delta2, &Overflow ); /*Q13 */ -#else /* BASOP_NOGLOB */ - tmp = add( tmp, delta2 ); /*Q13 */ -#endif /* BASOP_NOGLOB */ } ELSE IF( LT_16( i, 18 ) ) { -#ifdef BASOP_NOGLOB tmp = add_o( tmp, delta3, &Overflow ); /*Q13 */ -#else /* BASOP_NOGLOB */ - tmp = add( tmp, delta3 ); /*Q13 */ -#endif /* BASOP_NOGLOB */ } ELSE { -#ifdef BASOP_NOGLOB tmp = add_o( tmp, delta4, &Overflow ); /*Q13 */ -#else /* BASOP_NOGLOB */ - tmp = add( tmp, delta4 ); /*Q13 */ -#endif /* BASOP_NOGLOB */ } tmp1 = tmp; @@ -1110,11 +1077,7 @@ Word16 wb_vad_fx( sub( 0, 0 ); if ( LT_16( i, 7 ) ) { -#ifdef BASOP_NOGLOB tmp1 = add_o( tmp, 3277, &Overflow ); /*.4 in Q13 ftmp1 = ftmp + 0.4f; */ -#else /* BASOP_NOGLOB */ - tmp1 = add( tmp, 3277 ); /*.4 in Q13 ftmp1 = ftmp + 0.4f; */ -#endif /* BASOP_NOGLOB */ } tmp = s_min( tmp, 16384 ); /* Q13, ftmp = min(ftmp, 2.0f); */ @@ -1160,11 +1123,7 @@ Word16 wb_vad_fx( shift_snr = add( sub( e_num, e_noise ), 15 - 4 ); snr_tmp = div_s( m_num, m_noise_local ); -#ifdef BASOP_NOGLOB L_snr = L_shr_o( snr_tmp, shift_snr, &Overflow ); /* L_snr in Q4 */ -#else /* BASOP_NOGLOB */ - L_snr = L_shr( snr_tmp, shift_snr ); /* L_snr in Q4 */ -#endif /* BASOP_NOGLOB */ } ELSE { @@ -1202,19 +1161,11 @@ Word16 wb_vad_fx( /* accumulate background noise energy in bands [0-2] and in bands [3-19]*/ IF( LT_16( i, 3 ) ) { -#ifdef BASOP_NOGLOB L_accum_ener_L = L_add_o( L_accum_ener_L, hNoiseEst->bckr_fx[i], &Overflow ); /*Q_new+QSCALE */ -#else - L_accum_ener_L = L_add( L_accum_ener_L, hNoiseEst->bckr_fx[i] ); /*Q_new+QSCALE */ -#endif } ELSE { -#ifdef BASOP_NOGLOB L_accum_ener_H = L_add_o( L_accum_ener_H, hNoiseEst->bckr_fx[i], &Overflow ); /*Q_new+QSCALE */ -#else - L_accum_ener_H = L_add( L_accum_ener_H, hNoiseEst->bckr_fx[i] ); /*Q_new+QSCALE */ -#endif } /* Identify the outlier band */ @@ -1308,13 +1259,8 @@ Word16 wb_vad_fx( } } /*st_fx->snr_sum_vad_fx = 0.5f * st->snr_sum_vad + 0.5f * snr_sum_ol;*/ -#ifdef BASOP_NOGLOB hVAD->L_snr_sum_vad_fx = L_shr( L_add_o( hVAD->L_snr_sum_vad_fx, L_snr_sum_ol, &Overflow ), 1 ); /*Q4*/ move32(); -#else /* BASOP_NOGLOB */ - hVAD->L_snr_sum_vad_fx = L_shr( L_add( hVAD->L_snr_sum_vad_fx, L_snr_sum_ol ), 1 ); /*Q4*/ - move32(); -#endif /* BASOP_NOGLOB */ /* snr_sum_ol = 10.0f * (float)log10( snr_sum_ol ); */ snr_sum_ol = vad_snr_log_fx( L_snr_sum_ol, LG10 ); @@ -1437,11 +1383,7 @@ Word16 wb_vad_fx( thr1_ol = thr1; move16(); L_tmp2 = Msub_32_16( (Word32) 614, L_snr_outlier, 20972 ); /* .6*1024= */ /* 0.6 Q26(Q10 in high word) - Q4*Q21+1 */ -#ifdef BASOP_NOGLOB tmp2 = round_fx( L_shl_o( L_tmp2, 14, &Overflow ) ); /* Q10(high word)+ 14 -16 --> Q8*/ -#else /* BASOP_NOGLOB */ - tmp2 = round_fx( L_shl( L_tmp2, 14 ) ); /* Q10(high word)+ 14 -16 --> Q8*/ -#endif IF( L_tmp2 > 0 ) { thr1_ol = add( thr1_ol, tmp2 ); /* Q24 >>16 + Q8 */ @@ -2292,11 +2234,7 @@ Word16 wb_vad_ivas_fx( shift_snr = add( sub( e_num, e_noise ), 15 - 4 ); snr_tmp = div_s( m_num, m_noise_local ); -#ifdef BASOP_NOGLOB L_snr = L_shr_o( snr_tmp, shift_snr, &Overflow ); /* L_snr in Q4 */ -#else /* BASOP_NOGLOB */ - L_snr = L_shr( snr_tmp, shift_snr ); /* L_snr in Q4 */ -#endif /* BASOP_NOGLOB */ } ELSE { @@ -2319,11 +2257,7 @@ Word16 wb_vad_ivas_fx( shift_snr = add( sub( e_num, e_noise ), 15 - 4 ); snr_tmp = div_s( m_num, m_noise_local ); -#ifdef BASOP_NOGLOB L_snr = L_shr_o( snr_tmp, shift_snr, &Overflow ); /* L_snr in Q4 */ -#else /* BASOP_NOGLOB */ - L_snr = L_shr( snr_tmp, shift_snr ); /* L_snr in Q4 */ -#endif /* BASOP_NOGLOB */ } ELSE { @@ -2345,42 +2279,22 @@ Word16 wb_vad_ivas_fx( snr_sumt = add( snr_sumt, shr( snr, 4 ) ); /*Q4 */ -#ifdef BASOP_NOGLOB tmp = shl_o( snr, 5, &Overflow ); /* Q8 -> Q13 */ -#else /* BASOP_NOGLOB */ - tmp = shl( snr, 5 ); /* Q8 -> Q13 */ -#endif /* BASOP_NOGLOB */ IF( LT_16( i, 2 ) ) { -#ifdef BASOP_NOGLOB tmp = add_o( tmp, delta1, &Overflow ); /*Q13 */ -#else /* BASOP_NOGLOB */ - tmp = add( tmp, delta1 ); /*Q13 */ -#endif /* BASOP_NOGLOB */ } ELSE IF( LT_16( i, 7 ) ) { -#ifdef BASOP_NOGLOB tmp = add_o( tmp, delta2, &Overflow ); /*Q13 */ -#else /* BASOP_NOGLOB */ - tmp = add( tmp, delta2 ); /*Q13 */ -#endif /* BASOP_NOGLOB */ } ELSE IF( LT_16( i, 18 ) ) { -#ifdef BASOP_NOGLOB tmp = add_o( tmp, delta3, &Overflow ); /*Q13 */ -#else /* BASOP_NOGLOB */ - tmp = add( tmp, delta3 ); /*Q13 */ -#endif /* BASOP_NOGLOB */ } ELSE { -#ifdef BASOP_NOGLOB tmp = add_o( tmp, delta4, &Overflow ); /*Q13 */ -#else /* BASOP_NOGLOB */ - tmp = add( tmp, delta4 ); /*Q13 */ -#endif /* BASOP_NOGLOB */ } tmp1 = tmp; @@ -2388,11 +2302,7 @@ Word16 wb_vad_ivas_fx( sub( 0, 0 ); IF( i < 7 ) { -#ifdef BASOP_NOGLOB tmp1 = add_o( tmp, 3277, &Overflow ); /*.4 in Q13 ftmp1 = ftmp + 0.4f; */ -#else /* BASOP_NOGLOB */ - tmp1 = add( tmp, 3277 ); /*.4 in Q13 ftmp1 = ftmp + 0.4f; */ -#endif /* BASOP_NOGLOB */ } tmp = s_min( tmp, 16384 ); /* Q13, ftmp = min(ftmp, 2.0f); */ @@ -2451,11 +2361,7 @@ Word16 wb_vad_ivas_fx( shift_snr = add( sub( e_num, e_noise ), 15 - 4 ); snr_tmp = div_s( m_num, m_noise_local ); -#ifdef BASOP_NOGLOB L_snr = L_shr_o( snr_tmp, shift_snr, &Overflow ); /* L_snr in Q4 */ -#else /* BASOP_NOGLOB */ - L_snr = L_shr( snr_tmp, shift_snr ); /* L_snr in Q4 */ -#endif /* BASOP_NOGLOB */ } ELSE { @@ -2483,19 +2389,11 @@ Word16 wb_vad_ivas_fx( /* accumulate background noise energy in bands [0-2] and in bands [3-19]*/ IF( LT_16( i, 3 ) ) { -#ifdef BASOP_NOGLOB L_accum_ener_L = L_add_o( L_accum_ener_L, hNoiseEst->bckr_fx[i], &Overflow ); /* hNoiseEst->q_bckr */ -#else - L_accum_ener_L = L_add( L_accum_ener_L, hNoiseEst->bckr_fx[i] ); /*hNoiseEst->q_bckr */ -#endif } ELSE { -#ifdef BASOP_NOGLOB L_accum_ener_H = L_add_o( L_accum_ener_H, hNoiseEst->bckr_fx[i], &Overflow ); /*hNoiseEst->q_bckr */ -#else - L_accum_ener_H = L_add( L_accum_ener_H, hNoiseEst->bckr_fx[i] ); /*hNoiseEst->q_bckr */ -#endif } /* Identify the outlier band */ @@ -2577,12 +2475,8 @@ Word16 wb_vad_ivas_fx( } } /*st_fx->snr_sum_vad_fx = 0.5f * st->snr_sum_vad + 0.5f * snr_sum_ol;*/ -#ifdef BASOP_NOGLOB hVAD->L_snr_sum_vad_fx = L_shr( L_add_o( hVAD->L_snr_sum_vad_fx, L_snr_sum_ol, &Overflow ), 1 ); /*Q4*/ move32(); -#else /* BASOP_NOGLOB */ - hVAD->L_snr_sum_vad_fx = L_shr( L_add( hVAD->L_snr_sum_vad_fx, L_snr_sum_ol ), 1 ); /*Q4*/ -#endif /* BASOP_NOGLOB */ /* snr_sum_ol = 10.0f * (float)log10( snr_sum_ol ); */ snr_sum_ol = vad_snr_log_fx( L_snr_sum_ol, LG10 ); @@ -2705,11 +2599,7 @@ Word16 wb_vad_ivas_fx( thr1_ol = thr1; move16(); L_tmp2 = Msub_32_16( (Word32) 614, L_snr_outlier, 20972 ); /* .6*1024= */ /* 0.6 Q26(Q10 in high word) - Q4*Q21+1 */ -#ifdef BASOP_NOGLOB tmp2 = round_fx( L_shl_o( L_tmp2, 14, &Overflow ) ); /* Q10(high word)+ 14 -16 --> Q8*/ -#else /* BASOP_NOGLOB */ - tmp2 = round_fx( L_shl( L_tmp2, 14 ) ); /* Q10(high word)+ 14 -16 --> Q8*/ -#endif IF( L_tmp2 > 0 ) { thr1_ol = add( thr1_ol, tmp2 ); /* Q24 >>16 + Q8 */ diff --git a/lib_enc/vad_param_updt_fx.c b/lib_enc/vad_param_updt_fx.c index 092919bff..72c86759f 100644 --- a/lib_enc/vad_param_updt_fx.c +++ b/lib_enc/vad_param_updt_fx.c @@ -165,13 +165,8 @@ void vad_param_updt_fx( L_tmp = L_mult( st_fx->voicing_fx[0], 10923 ); L_tmp = L_mac( L_tmp, st_fx->voicing_fx[1], 10923 ); L_tmp = L_mac( L_tmp, st_fx->voicing_fx[2], 10923 ); /*Q15 */ -#ifdef BASOP_NOGLOB L_tmp = L_mac_o( L_tmp, corr_shift_temp[i], 32767, &Overflow ); /*Q15 */ voice_tmp = round_fx_o( L_tmp, &Overflow ); /*Q15 */ -#else /* BASOP_NOGLOB */ - L_tmp = L_mac( L_tmp, corr_shift_temp[i], 32767 ); /*Q15 */ - voice_tmp = round_fx( L_tmp ); /*Q15 */ -#endif /* abs(pitch[0] - *pitO) + abs(pitch[1] - pitch[0]) + abs(pitch[2] - pitch[1]) */ pitch_tmp = abs_s( sub( st_fx->pitch[0], old_pitch1 ) ); /*Q0 */ diff --git a/lib_enc/vbr_average_rate_fx.c b/lib_enc/vbr_average_rate_fx.c index d99ddc7f2..28371b2d7 100644 --- a/lib_enc/vbr_average_rate_fx.c +++ b/lib_enc/vbr_average_rate_fx.c @@ -258,11 +258,7 @@ void update_average_rate_fx( /* sum the total number of bits (in kbytes) * 10 here */ /*st->sum_of_rates += (hSC_VBR->core_brate / 1000.0f) * 10; */ L_tmp = L_shl( Mult_32_16( core_brate_fx, 20972 ), 7 ); /*Q13*/ -#ifdef BASOP_NOGLOB hSC_VBR->sum_of_rates_fx = L_add_o( hSC_VBR->sum_of_rates_fx, L_tmp, &Overflow ); -#else - hSC_VBR->sum_of_rates_fx = L_add( hSC_VBR->sum_of_rates_fx, L_tmp ); -#endif move32(); return; } diff --git a/lib_enc/vlpc_1st_cod_fx.c b/lib_enc/vlpc_1st_cod_fx.c index 22d6c5a3c..9bfe0d8ae 100644 --- a/lib_enc/vlpc_1st_cod_fx.c +++ b/lib_enc/vlpc_1st_cod_fx.c @@ -52,33 +52,17 @@ static void lsf_weight_fx( FOR( i = 1; i < ( M - 2 ); i += 2 ) /*for (i=1; i<(M-2); i+=2)*/ { inv_di1 = div_s( ISF_ONE, s_max( ISF_ONE, sub( lsfq[i], lsfq[i - 1] ) ) ); /*0Q15*/ /*inv_di1 = 1.0f / (lsfq[i] - lsfq[i-1]);*/ -#ifdef BASOP_NOGLOB w[i - 1] = add_sat( inv_di0, inv_di1 ); -#else - w[i - 1] = add( inv_di0, inv_di1 ); -#endif move16(); /*0Q15*/ /*w[i-1] = inv_di0 + inv_di1;*/ inv_di0 = div_s( ISF_ONE, s_max( ISF_ONE, sub( lsfq[i + 1], lsfq[i] ) ) ); /*0Q15*/ /*inv_di0 = 1.0f / (lsfq[i+1] - lsfq[i]);*/ -#ifdef BASOP_NOGLOB w[i] = add_sat( inv_di1, inv_di0 ); -#else - w[i] = add( inv_di1, inv_di0 ); -#endif move16(); /*0Q15*/ /*w[i] = inv_di1 + inv_di0;*/ } inv_di1 = div_s( ISF_ONE, s_max( ISF_ONE, sub( lsfq[i], lsfq[i - 1] ) ) ); /*inv_di1 = 1.0f / (lsfq[i] - lsfq[i-1]);*/ -#ifdef BASOP_NOGLOB w[i - 1] = add_sat( inv_di0, inv_di1 ); -#else - w[i - 1] = add( inv_di0, inv_di1 ); -#endif move16(); /*w[i-1] = inv_di0 + inv_di1;*/ inv_di0 = div_s( ISF_ONE, s_max( ISF_ONE, sub( FREQ_MAX, lsfq[i] ) ) ); /*inv_di0 = 1.0f / (FREQ_MAX - lsfq[i]);*/ -#ifdef BASOP_NOGLOB w[i] = add_sat( inv_di1, inv_di0 ); -#else - w[i] = add( inv_di1, inv_di0 ); -#endif move16(); /*w[i] = inv_di1 + inv_di0;*/ BASOP_SATURATE_WARNING_ON_EVS diff --git a/lib_enc/vlpc_2st_cod_fx.c b/lib_enc/vlpc_2st_cod_fx.c index bc7cb4b3e..2ea4df5a9 100644 --- a/lib_enc/vlpc_2st_cod_fx.c +++ b/lib_enc/vlpc_2st_cod_fx.c @@ -57,11 +57,7 @@ Word16 vlpc_2st_cod_fx( /* output: number of allocated bits BASOP_SATURATE_WARNING_OFF_EVS /* Allow saturate because we only need to know if the result is smaller than 8.0f */ FOR( i = 1; i < M; i++ ) { -#ifdef BASOP_NOGLOB L_tmp = L_mac_o( L_tmp, x[i], x[i], &Overflow ); /*10Q21*/ -#else /* BASOP_NOGLOB */ - L_tmp = L_mac( L_tmp, x[i], x[i] ); /*10Q21*/ -#endif } BASOP_SATURATE_WARNING_ON_EVS diff --git a/lib_enc/voiced_enc_fx.c b/lib_enc/voiced_enc_fx.c index 4e644b3b0..99fa071d8 100644 --- a/lib_enc/voiced_enc_fx.c +++ b/lib_enc/voiced_enc_fx.c @@ -534,11 +534,7 @@ ivas_error ppp_voiced_encoder_fx( tmp = div_s( fracb, fraca ); exp = sub( expb, expa ); -#ifdef BASOP_NOGLOB sp_enratio_fx = L_shl_sat( tmp, exp ); /* Q15 */ -#else - sp_enratio_fx = L_shl( tmp, exp ); /* Q15 */ -#endif } } ELSE @@ -562,20 +558,12 @@ ivas_error ppp_voiced_encoder_fx( } /* Bump up if big change between the previous and the current CWs */ -#ifdef BASOP_NOGLOB IF( LT_16( shl_o( hSC_VBR->vadsnr_fx, 1, &Overflow ), hSC_VBR->SNR_THLD_fx ) ) /*Q8 */ -#else - IF( LT_16( shl( hSC_VBR->vadsnr_fx, 1 ), hSC_VBR->SNR_THLD_fx ) ) /*Q8 */ -#endif { /*if ( res_enratio > 5.0 && tmp < 0.65 ) */ /* 5 in Q11, 0.65 in Q15 // L_shl(tmp_fx,sub(31,Qtmp)) makes tmp_fx FIXED Q31 */ test(); -#ifdef BASOP_NOGLOB if ( ( GT_32( res_enratio_fx, 10240 ) ) && ( LT_16( extract_h( L_shl_o( tmp_fx, sub( 31, Qtmp ), &Overflow ) ), 21299 ) ) ) -#else - if ( ( GT_32( res_enratio_fx, 10240 ) ) && ( LT_16( extract_h( L_shl( tmp_fx, sub( 31, Qtmp ) ) ), 21299 ) ) ) -#endif { PPP_MODE_E = 'B'; move16(); @@ -586,11 +574,7 @@ ivas_error ppp_voiced_encoder_fx( /* if ( res_enratio > 3.0 && tmp < 1.2 ) */ /*3 in Q11, 1.2 in Q14 // L_shl(tmp_fx,sub(31,Qtmp)) makes tmp_fx FIXED Q14 */ test(); -#ifdef BASOP_NOGLOB if ( ( GT_32( res_enratio_fx, 6144 ) ) && ( LT_16( extract_h( L_shl_o( tmp_fx, sub( 30, Qtmp ), &Overflow ) ), 19661 ) ) ) -#else - if ( ( GT_32( res_enratio_fx, 6144 ) ) && ( LT_16( extract_h( L_shl( tmp_fx, sub( 30, Qtmp ) ) ), 19661 ) ) ) -#endif { PPP_MODE_E = 'B'; move16(); @@ -601,18 +585,10 @@ ivas_error ppp_voiced_encoder_fx( /* Rapid rampdown frame where time resolution is important */ /* Not a suitable PPP frame -> Bump to CELP */ -#ifdef BASOP_NOGLOB IF( LT_16( shl_o( hSC_VBR->vadsnr_fx, 1, &Overflow ), hSC_VBR->SNR_THLD_fx ) ) /*Q8 */ -#else - IF( LT_16( shl( hSC_VBR->vadsnr_fx, 1 ), hSC_VBR->SNR_THLD_fx ) ) /*Q8 */ -#endif { /* if (res_enratio < 0.025) */ -#ifdef BASOP_NOGLOB IF( LT_32( L_shl_o( res_enratio_fx, 4, &Overflow ), 819 ) ) /*0x0333 = 0.025 in Q15, res_enratio_fx in Q15 after shl 4 */ -#else - IF( LT_32( L_shl( res_enratio_fx, 4 ), 819 ) ) /*0x0333 = 0.025 in Q15, res_enratio_fx in Q15 after shl 4 */ -#endif { hSC_VBR->bump_up = 1; move16(); @@ -628,11 +604,7 @@ ivas_error ppp_voiced_encoder_fx( ELSE { /* if ( res_enratio < 0.092f) */ -#ifdef BASOP_NOGLOB if ( LT_32( L_shl_o( res_enratio_fx, 4, &Overflow ), 3015 ) ) /*3015 = 0.092 in Q15, res_enratio_fx in Q15 after shl 4 */ -#else - if ( LT_32( L_shl( res_enratio_fx, 4 ), 3015 ) ) /*3015 = 0.092 in Q15, res_enratio_fx in Q15 after shl 4 */ -#endif { hSC_VBR->bump_up = 1; move16(); @@ -641,11 +613,7 @@ ivas_error ppp_voiced_encoder_fx( /* if (min(res_enratio, sp_enratio) < 0.075 && tmp < -0.5f)) : 2458 = 0.075 in Q15 */ test(); -#ifdef BASOP_NOGLOB if ( LT_32( L_min( L_shl_o( res_enratio_fx, 4, &Overflow ), sp_enratio_fx ), 2458 ) && LT_32( tmp_fx, shl_o( -1, sub( Qtmp, 1 ), &Overflow ) ) ) -#else - if ( LT_32( L_min( L_shl( res_enratio_fx, 4 ), sp_enratio_fx ), 2458 ) && LT_32( tmp_fx, shl( -1, sub( Qtmp, 1 ) ) ) ) -#endif { hSC_VBR->bump_up = 1; move16(); @@ -653,11 +621,7 @@ ivas_error ppp_voiced_encoder_fx( /* Rapid rampup frame where time resolution is important */ /* Not a suitable PPP frame -> Bump to CELP */ -#ifdef BASOP_NOGLOB IF( LT_16( shl_o( hSC_VBR->vadsnr_fx, 1, &Overflow ), hSC_VBR->SNR_THLD_fx ) ) /*Q8 */ -#else - IF( LT_16( shl( hSC_VBR->vadsnr_fx, 1 ), hSC_VBR->SNR_THLD_fx ) ) /*Q8 */ -#endif { IF( GT_32( res_enratio_fx, 29696 ) ) /*14.5 in Q11 */ { @@ -768,11 +732,7 @@ ivas_error ppp_voiced_encoder_fx( Ltemp1 = L_negate( Ltemp1 ); } expa = norm_l( Ltemp2 ); -#ifdef BASOP_NOGLOB fraca = extract_h( L_shl_o( Ltemp2, expa, &Overflow ) ); -#else - fraca = extract_h( L_shl( Ltemp2, expa ) ); -#endif expa = sub( 30, expa ); expb = norm_l( Ltemp1 ); @@ -780,20 +740,12 @@ ivas_error ppp_voiced_encoder_fx( expb = sub( 30, add( expb, Qadj ) ); scale = shr( sub( fraca, fracb ), 15 ); -#ifdef BASOP_NOGLOB fracb = shl_o( fracb, scale, &Overflow ); -#else - fracb = shl( fracb, scale ); -#endif expb = sub( expb, scale ); tmp = div_s( fracb, fraca ); exp = sub( expb, expa ); -#ifdef BASOP_NOGLOB Ltemp_fx = L_shl_o( tmp, add( exp, 14 ), &Overflow ); -#else - Ltemp_fx = L_shl( tmp, add( exp, 14 ) ); -#endif /*-------------------------------------------*/ sp_hb_enratio_fx = L_add( Ltemp_fx, 0 ); /* Q29 */ } @@ -817,19 +769,11 @@ ivas_error ppp_voiced_encoder_fx( move32(); Qadj = sub( hSC_VBR->Q_prev_cw_en_fx, shl( CURRP_NQ_FX->Q, 1 ) ); -#ifdef BASOP_NOGLOB Ltmp_32 = L_shl_o( Ltmp_32, Qadj, &Overflow ); /* shift left required to adjust Q of CURRP_NQ_FX = Q_prev_cw_en_fx */ -#else - Ltmp_32 = L_shl( Ltmp_32, Qadj ); /* shift left required to adjust Q of CURRP_NQ_FX = Q_prev_cw_en_fx */ -#endif /* Ltmp1_32 = 0.8f * st->prev_cw_en */ Ltmp1_32 = Mult_32_16( hSC_VBR->prev_cw_en_fx, 26214 ); /* Q = (Q_prev_cw_en_fx + Q15+1)-Q16 = Q_prev_cw_en_fx */ -#ifdef BASOP_NOGLOB IF( LT_16( shl_o( hSC_VBR->vadsnr_fx, 1, &Overflow ), hSC_VBR->SNR_THLD_fx ) ) /*Q8 */ -#else - IF( LT_16( shl( hSC_VBR->vadsnr_fx, 1 ), hSC_VBR->SNR_THLD_fx ) ) /*Q8 */ -#endif { /* if ( DTFS_getEngy(*CURRP_NQ) > 0.8f * st->prev_cw_en && max(pos_nq, neg_nq) > 3.0f && st->rate_control ) */ /* pos_nq_fx and neg_nq_fx in Q28 ???? */ @@ -930,11 +874,7 @@ ivas_error ppp_voiced_encoder_fx( /* compute energy of impz */ FOR( x_fx = 0; x_fx < 160; x_fx++ ) { -#ifdef BASOP_NOGLOB energy_impz_fx = L_add_o( energy_impz_fx, L_mult0( impzo_fx[x_fx], impzo_fx[x_fx] ), &Overflow ); -#else - energy_impz_fx = L_add( energy_impz_fx, L_mult0( impzo_fx[x_fx], impzo_fx[x_fx] ) ); -#endif } /*energy_impz = (float)(10*log10((float)energy_impz)); */ @@ -948,20 +888,12 @@ ivas_error ppp_voiced_encoder_fx( Ltmp_32 = DTFS_getEngy_fx( CURRP_Q_E_FX ); /*Q = 2*(CURRP_Q_E_FX->Q) */ move32(); Qadj = sub( hSC_VBR->Q_prev_cw_en_fx, shl( CURRP_Q_E_FX->Q, 1 ) ); -#ifdef BASOP_NOGLOB Ltmp_32 = L_shl_o( Ltmp_32, Qadj, &Overflow ); /* shift left required to adjust Q of CURRP_Q_E_FX = Q_prev_cw_en_fx */ -#else - Ltmp_32 = L_shl( Ltmp_32, Qadj ); /* shift left required to adjust Q of CURRP_Q_E_FX = Q_prev_cw_en_fx */ -#endif /* if ((DTFS_getEngy(*CURRP_Q_E) > st->prev_cw_en)&&(max(pos_q,neg_q)>3.5) && energy_impz>15.0 && tmpres>0.7) */ test(); test(); test(); -#ifdef BASOP_NOGLOB IF( ( GT_32( Ltmp_32, hSC_VBR->prev_cw_en_fx ) ) && ( GT_32( L_max( pos_q_fx, neg_q_fx ), 939524096 ) ) && ( GT_32( energy_impz_fx, 30720 ) ) && ( GT_32( Mult_32_16( tmpres_fx, 23265 ), shl_o( 1, sub( Qtmpres, 1 ), &Overflow ) ) ) ) -#else - IF( ( GT_32( Ltmp_32, hSC_VBR->prev_cw_en_fx ) ) && ( GT_32( L_max( pos_q_fx, neg_q_fx ), 939524096 ) ) && ( GT_32( energy_impz_fx, 30720 ) ) && ( GT_32( Mult_32_16( tmpres_fx, 23265 ), shl( 1, sub( Qtmpres, 1 ) ) ) ) ) -#endif { /* if ((pos_q > neg_q) && ((pos_q>3.0*pos_nq0) || ((pos_q > 1.5*pos_nq0) && (neg_q < 1.5*neg_nq0)))) */ test(); @@ -1020,11 +952,7 @@ ivas_error ppp_voiced_encoder_fx( tmp = div_s( fracb, fraca ); /* tmp in Q15 */ exp = sub( expb, expa ); /* ans = tmp*2^(exp) */ -#ifdef BASOP_NOGLOB Ltemp_fx = L_shl_o( tmp, add( exp, 12 ), &Overflow ); /* make tmp Q27 */ -#else - Ltemp_fx = L_shl( tmp, add( exp, 12 ) ); /* make tmp Q27 */ -#endif } test(); IF( GT_32( Ltemp_fx, 6710886 ) && ( !hSC_VBR->rate_control ) ) /* 0.05 in Q27 = 6710886 */ @@ -1060,11 +988,7 @@ ivas_error ppp_voiced_encoder_fx( tmp = div_s( fracb, fraca ); exp = sub( expb, expa ); -#ifdef BASOP_NOGLOB Ltemp_fx = L_shl_o( tmp, add( exp, 14 ), &Overflow ); /* answer in Q29 */ -#else - Ltemp_fx = L_shl( tmp, add( exp, 14 ) ); /* answer in Q29 */ -#endif } /*-------------------------------------------*/ @@ -1132,11 +1056,7 @@ ivas_error ppp_voiced_encoder_fx( exp = sub( 30, add( expa, sub( 31, exp ) ) ); frac = Log2_norm_lc( L_tmp ); L_tmp = Mpy_32_16( exp, frac, 12330 ); /* L_tmp is always Q13 */ -#ifdef BASOP_NOGLOB Ltemp = L_shl_o( L_tmp, 10, &Overflow ); /* Ltemp is always Q23 */ -#else - Ltemp = L_shl( L_tmp, 10 ); /* Ltemp is always Q23 */ -#endif } ELSE { @@ -1150,11 +1070,7 @@ ivas_error ppp_voiced_encoder_fx( move16(); } -#ifdef BASOP_NOGLOB IF( LT_16( shl_o( hSC_VBR->vadsnr_fx, 1, &Overflow ), hSC_VBR->SNR_THLD_fx ) ) /* Q8 */ -#else - IF( LT_16( shl( hSC_VBR->vadsnr_fx, 1 ), hSC_VBR->SNR_THLD_fx ) ) /* Q8 */ -#endif { /* if ((( tmp < 3.05 && max(res_enratio,sp_enratio) > 0.8 ) && (st->rate_control))|| (( tmp < 2.8 && max(res_enratio,sp_enratio) > 0.65 ) && (!st->rate_control))) */ @@ -1335,16 +1251,11 @@ static void synthesis_filter_fx( Word16 b[], Word16 x[], Word16 y[], Word16 buf[ FOR( j = P - 1; j > 0; j-- ) { /* acc = L_sub(acc, L_mult(memory[j], coef[j])); */ -#ifdef BASOP_NOGLOB acc = L_msu_o( acc, buf[j], b[j], &Overflow ); /*Q13 */ -#else - acc = L_msu( acc, buf[j], b[j] ); /*Q13 */ -#endif buf[j] = buf[j - 1]; move16(); } /* acc = L_sub(acc, L_mult(memory[0], coef[0])); */ -#ifdef BASOP_NOGLOB acc = L_msu_o( acc, buf[0], b[0], &Overflow ); acc = L_shl_o( acc, 3, &Overflow ); @@ -1352,15 +1263,6 @@ static void synthesis_filter_fx( Word16 b[], Word16 x[], Word16 y[], Word16 buf[ move16(); buf[0] = round_fx_o( acc, &Overflow ); move16(); -#else - acc = L_msu( acc, buf[0], b[0] ); - acc = L_shl( acc, 3 ); - - *y++ = round_fx( acc ); - move16(); - buf[0] = round_fx( acc ); - move16(); -#endif } } /*==============================================================================*/ @@ -1441,13 +1343,8 @@ static Word32 DTFS_freq_corr_fx( FOR( k = lk; k < hk; k++ ) { -#ifdef BASOP_NOGLOB corr_fx = L_mac0_o( corr_fx, X1_DTFS_fx.a_fx[k], X2_DTFS_fx.a_fx[k], &Overflow ); /* Q(1) */ corr_fx = L_mac0_o( corr_fx, X1_DTFS_fx.b_fx[k], X2_DTFS_fx.b_fx[k], &Overflow ); /* Q(1) */ -#else - corr_fx = L_mac0( corr_fx, X1_DTFS_fx.a_fx[k], X2_DTFS_fx.a_fx[k] ); /* Q(1) */ - corr_fx = L_mac0( corr_fx, X1_DTFS_fx.b_fx[k], X2_DTFS_fx.b_fx[k] ); /* Q(1) */ -#endif } Qr = norm_l( corr_fx ); @@ -1457,11 +1354,7 @@ static Word32 DTFS_freq_corr_fx( move16(); } -#ifdef BASOP_NOGLOB E1_fx = round_fx_o( L_shl_o( corr_fx, Qr, &Overflow ), &Overflow ); /* Q(Qr-16) */ -#else - E1_fx = round_fx( L_shl( corr_fx, Qr ) ); /* Q(Qr-16) */ -#endif Num = L_mult0( E1_fx, E1_fx ); /* Q(2+2*Qr-32+1) */ Q_num = sub( shl( add( add( X1_DTFS_fx.Q, X2_DTFS_fx.Q ), Qr ), 1 ), 32 ); @@ -1475,11 +1368,7 @@ static Word32 DTFS_freq_corr_fx( move16(); } -#ifdef BASOP_NOGLOB E1_fx = round_fx_o( L_shl_o( E_fx, q1, &Overflow ), &Overflow ); /* Q(1+q1-16) */ -#else - E1_fx = round_fx( L_shl( E_fx, q1 ) ); /* Q(1+q1-16) */ -#endif /* PORTING: Handling the functions with variable no. of arguments */ E_fx = DTFS_getEngy_band_fx( X2_DTFS_fx, lband, hband ); /* Q(1) */ q2 = norm_l( E_fx ); @@ -1489,11 +1378,7 @@ static Word32 DTFS_freq_corr_fx( move16(); } -#ifdef BASOP_NOGLOB E2_fx = round_fx_o( L_shl_o( E_fx, q2, &Overflow ), &Overflow ); /* Q(1+q2-16) */ -#else - E2_fx = round_fx( L_shl( E_fx, q2 ) ); /* Q(1+q2-16) */ -#endif Den = L_mult0( E1_fx, E2_fx ); /* Q(2+q1+q2-32+1) */ Q_den = sub( add( shl( add( X2_DTFS_fx.Q, X1_DTFS_fx.Q ), 1 ), add( q1, q2 ) ), 32 ); @@ -1510,29 +1395,17 @@ static Word32 DTFS_freq_corr_fx( { expa = norm_l( Num ); -#ifdef BASOP_NOGLOB fraca = extract_h( L_shl_o( Num, expa, &Overflow ) ); -#else - fraca = extract_h( L_shl( Num, expa ) ); -#endif expa = sub( 30, add( expa, Q_num ) ); expb = norm_l( Den ); -#ifdef BASOP_NOGLOB fracb = round_fx_o( L_shl_o( Den, expb, &Overflow ), &Overflow ); -#else - fracb = round_fx( L_shl( Den, expb ) ); -#endif expb = sub( 30, add( expb, Q_den ) ); scale = shr( sub( fraca, fracb ), 15 ); -#ifdef BASOP_NOGLOB fracb = shl_o( fracb, scale, &Overflow ); -#else - fracb = shl( fracb, scale ); -#endif expb = sub( expb, scale ); tmp = div_s( fracb, fraca ); @@ -1590,11 +1463,7 @@ static Word16 DTFS_alignment_extract_td_fx( Word16 *x1, Word16 *x2, Word16 lag ) corr = L_deposit_l( 0 ); FOR( k = 0; k < lag; k++ ) { -#ifdef BASOP_NOGLOB corr = L_mac_o( corr, x1[k], x2[( k - j + lag ) % lag], &Overflow ); -#else - corr = L_mac( corr, x1[k], x2[( k - j + lag ) % lag] ); -#endif } IF( GT_32( corr, maxcorr ) ) { @@ -1668,13 +1537,8 @@ static Word32 DTFS_getEngy_band_fx( FOR( k = lk; k < hk; k++ ) { -#ifdef BASOP_NOGLOB en_fx = L_mac0_o( en_fx, X_fx.a_fx[k], X_fx.a_fx[k], &Overflow ); /* 2*X1.Q+1 */ en_fx = L_mac0_o( en_fx, X_fx.b_fx[k], X_fx.b_fx[k], &Overflow ); -#else - en_fx = L_mac0( en_fx, X_fx.a_fx[k], X_fx.a_fx[k] ); /* 2*X1.Q+1 */ - en_fx = L_mac0( en_fx, X_fx.b_fx[k], X_fx.b_fx[k] ); -#endif } if ( lband == 0 ) @@ -1686,13 +1550,8 @@ static Word32 DTFS_getEngy_band_fx( test(); IF( ( s_and( X_fx.lag_fx, 1 ) == 0 ) && ( hband == X_fx.upper_cut_off_freq_fx ) ) { -#ifdef BASOP_NOGLOB en_fx = L_mac0_o( en_fx, X_fx.a_fx[k], X_fx.a_fx[k], &Overflow ); en_fx = L_mac0_o( en_fx, X_fx.b_fx[k], X_fx.b_fx[k], &Overflow ); -#else - en_fx = L_mac0( en_fx, X_fx.a_fx[k], X_fx.a_fx[k] ); - en_fx = L_mac0( en_fx, X_fx.b_fx[k], X_fx.b_fx[k] ); -#endif } return en_fx; /* 2*X1.Q */ diff --git a/lib_enc/waveadjust_fec_cod_fx.c b/lib_enc/waveadjust_fec_cod_fx.c index d6c55b0c9..f10a1bd0b 100644 --- a/lib_enc/waveadjust_fec_cod_fx.c +++ b/lib_enc/waveadjust_fec_cod_fx.c @@ -41,11 +41,7 @@ Word32 SFM_Cal_fx( /* sum(log2(magn(i))) */ sumLogMagn = L_add( sumLogMagn, logMagn ); /* Q8 */ -#ifdef BASOP_NOGLOB sumMagn = L_add_sat( sumMagn, magn_abs ); /*Qx*/ -#else - sumMagn = L_add( sumMagn, magn_abs ); /*Qx*/ -#endif } IF( EQ_32( sumMagn, MAX_32 ) ) -- GitLab From d44117a1bd8b147215c397da1cd986af09126383 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 22 Jan 2025 22:14:05 +0100 Subject: [PATCH 2/2] formatting --- lib_com/arith_coder_fx.c | 2 +- lib_com/basop32.h | 32 +++--- lib_com/bitalloc_fx.c | 4 +- lib_com/cng_exc_fx.c | 14 +-- lib_com/deemph.c | 6 +- lib_com/edct_fx.c | 12 +- lib_com/env_adj.c | 4 +- lib_com/fft_fx_evs.c | 14 +-- lib_com/frame_ener.c | 8 +- lib_com/frame_ener_fx.c | 8 +- lib_com/gs_bitallocation_fx.c | 2 +- lib_com/gs_gains_fx.c | 18 +-- lib_com/gs_inact_switching_fx.c | 4 +- lib_com/gs_noisefill_fx.c | 20 ++-- lib_com/hq2_noise_inject_fx.c | 18 +-- lib_com/hq_tools_fx.c | 44 +++---- lib_com/igf_base_fx.c | 2 +- lib_com/low_rate_band_att_fx.c | 10 +- lib_com/lsf_tools_fx.c | 12 +- lib_com/modif_fs_fx.c | 84 +++++++------- lib_com/preemph_fx.c | 4 +- lib_com/pvq_com_fx.c | 2 +- lib_com/stab_est_fx.c | 2 +- lib_com/stat_noise_uv_mod_fx.c | 40 +++---- lib_com/swb_bwe_com_fx.c | 38 +++--- lib_com/swb_bwe_com_lr_fx.c | 166 +++++++++++++-------------- lib_com/swb_tbe_com_fx.c | 134 ++++++++++----------- lib_com/tcq_position_arith_fx.c | 2 +- lib_com/tcx_ltp_fx.c | 8 +- lib_com/tcx_utils_fx.c | 4 +- lib_com/tools_fx.c | 18 +-- lib_com/trans_inv_fx.c | 24 ++-- lib_com/wi_fx.c | 22 ++-- lib_com/window_ola_fx.c | 14 +-- lib_dec/FEC_HQ_core_fx.c | 8 +- lib_dec/FEC_HQ_phase_ecu_fx.c | 20 ++-- lib_dec/FEC_pitch_estim_fx.c | 2 +- lib_dec/LD_music_post_filter_fx.c | 28 ++--- lib_dec/TonalComponentDetection_fx.c | 4 +- lib_dec/bass_psfilter_fx.c | 14 +-- lib_dec/cng_dec_fx.c | 14 +-- lib_dec/core_switching_dec_fx.c | 8 +- lib_dec/dec_gen_voic_fx.c | 6 +- lib_dec/dec_higher_acelp_fx.c | 4 +- lib_dec/dec_pit_exc_fx.c | 2 +- lib_dec/dec_post_fx.c | 2 +- lib_dec/dec_tcx_fx.c | 2 +- lib_dec/dec_tran_fx.c | 2 +- lib_dec/er_dec_acelp_fx.c | 2 +- lib_dec/er_dec_tcx_fx.c | 2 +- lib_dec/er_scale_syn_fx.c | 6 +- lib_dec/er_sync_exc_fx.c | 10 +- lib_dec/fd_cng_dec_fx.c | 2 +- lib_dec/gain_dec_fx.c | 22 ++-- lib_dec/gs_dec_amr_wb_fx.c | 2 +- lib_dec/hf_synth_fx.c | 32 +++--- lib_dec/hq_lr_dec_fx.c | 6 +- lib_dec/igf_dec_fx.c | 8 +- lib_dec/pitch_extr_fx.c | 2 +- lib_dec/ppp_dec_fx.c | 2 +- lib_dec/swb_bwe_dec_fx.c | 2 +- lib_dec/swb_tbe_dec.c | 2 +- lib_dec/swb_tbe_dec_fx.c | 16 +-- lib_dec/tonalMDCTconcealment_fx.c | 4 +- lib_dec/voiced_dec_fx.c | 4 +- lib_enc/acelp_core_switch_enc_fx.c | 6 +- lib_enc/acelp_enc_util_fx.c | 4 +- lib_enc/amr_wb_enc_fx.c | 2 +- lib_enc/analy_sp_fx.c | 6 +- lib_enc/bw_detect_fx.c | 2 +- lib_enc/cng_enc_fx.c | 14 +-- lib_enc/cor_shif_fx.c | 6 +- lib_enc/core_enc_init_fx.c | 2 +- lib_enc/detect_transient_fx.c | 6 +- lib_enc/dtx_fx.c | 6 +- lib_enc/enc_acelp_fx.c | 4 +- lib_enc/enc_acelpx_fx.c | 6 +- lib_enc/enc_amr_wb_fx.c | 10 +- lib_enc/enc_gen_voic_fx.c | 24 ++-- lib_enc/enc_gen_voic_rf_fx.c | 8 +- lib_enc/enc_higher_acelp_fx.c | 16 +-- lib_enc/enc_pit_exc_fx.c | 22 ++-- lib_enc/enc_tran_fx.c | 12 +- lib_enc/enc_uv_fx.c | 16 +-- lib_enc/energy_fx.c | 2 +- lib_enc/ext_sig_ana_fx.c | 16 +-- lib_enc/find_tilt.c | 10 +- lib_enc/find_tilt_fx.c | 10 +- lib_enc/find_uv.c | 4 +- lib_enc/find_uv_fx.c | 4 +- lib_enc/gain_enc_fx.c | 16 +-- lib_enc/gaus_enc_fx.c | 16 +-- lib_enc/hf_cod_amrwb_fx.c | 12 +- lib_enc/hq_lr_enc_fx.c | 64 +++++------ lib_enc/hvq_enc_fx.c | 12 +- lib_enc/nelp_enc_fx.c | 16 +-- lib_enc/nois_est_fx.c | 30 ++--- lib_enc/ppp_enc_fx.c | 14 +-- lib_enc/pvq_encode_fx.c | 12 +- lib_enc/stat_noise_uv_enc_fx.c | 12 +- lib_enc/swb_bwe_enc_fx.c | 26 ++--- lib_enc/swb_bwe_enc_lr_fx.c | 2 +- lib_enc/swb_tbe_enc_fx.c | 62 +++++----- lib_enc/tcq_core_enc_fx.c | 4 +- lib_enc/tcx_utils_enc_fx.c | 8 +- lib_enc/tns_base_enc_fx.c | 4 +- lib_enc/updt_tar_fx.c | 2 +- lib_enc/vad_fx.c | 6 +- lib_enc/vad_param_updt_fx.c | 2 +- lib_enc/voiced_enc_fx.c | 10 +- 110 files changed, 791 insertions(+), 793 deletions(-) diff --git a/lib_com/arith_coder_fx.c b/lib_com/arith_coder_fx.c index a776a38b9..de22a7cf3 100644 --- a/lib_com/arith_coder_fx.c +++ b/lib_com/arith_coder_fx.c @@ -225,7 +225,7 @@ void tcx_arith_scale_envelope( tmp = norm_l( env[k] ); tmp2 = sub( 15, tmp ); tmp = Inv16( round_fx_o( L_shl_o( env[k], tmp, &Overflow ), &Overflow ), &tmp2 ); /* exp(tmp2) */ - ienv[k] = L_shl( L_deposit_h( tmp ), sub( tmp2, 15 ) ); /* Q16 */ + ienv[k] = L_shl( L_deposit_h( tmp ), sub( tmp2, 15 ) ); /* Q16 */ move32(); mean = L_add( mean, ienv[k] ); /* Q16 */ } diff --git a/lib_com/basop32.h b/lib_com/basop32.h index 21efdae56..96fd8d166 100644 --- a/lib_com/basop32.h +++ b/lib_com/basop32.h @@ -138,7 +138,7 @@ Word32 L_macNs( Word32 L_var3, Word16 var1, Word16 var2 ); /* Word32 L_msuNs( Word32 L_var3, Word16 var1, Word16 var2 ); /* Msu without sat, 1 */ Word32 L_add_co( Word32 L_var1, Word32 L_var2, Flag *Carry, Flag *Overflow ); Word32 L_sub_co( Word32 L_var1, Word32 L_var2, Flag *Carry, Flag *Overflow ); -Word32 L_sub_c( Word32 L_var1, Word32 L_var2 ); /* Long sub with c, 2 */ +Word32 L_sub_c( Word32 L_var1, Word32 L_var2 ); /* Long sub with c, 2 */ Word32 DEPR_L_msuNs( Word32 L_var3, Word16 var1, Word16 var2, Flag *Carry ); /* Msu without @@ -154,22 +154,22 @@ Word32 L_shr( Word32 L_var1, Word16 var2 ); /* Word16 shr_r( Word16 var1, Word16 var2 ); /* Shift right with round, 2 */ -Word16 mac_r( Word32 L_var3, Word16 var1, Word16 var2 ); /* Mac with - rounding, 1 */ -Word16 msu_r( Word32 L_var3, Word16 var1, Word16 var2 ); /* Msu with - rounding, 1 */ -Word32 L_deposit_h( Word16 var1 ); /* 16 bit var1 -> MSB, 1 */ -Word32 L_deposit_l( Word16 var1 ); /* 16 bit var1 -> LSB, 1 */ - -Word32 L_shr_r( Word32 L_var1, Word16 var2 ); /* Long shift right with - round, 3 */ -Word32 L_abs( Word32 L_var1 ); /* Long abs, 1 */ -Word32 DEPR_L_sat_co( Word32 L_var1, Flag Overflow, Flag Carry ); /* Long saturation, 4 */ -Word16 norm_s( Word16 var1 ); /* Short norm, 1 */ -Word16 div_s( Word16 var1, Word16 var2 ); /* Short division, 18 */ +Word16 mac_r( Word32 L_var3, Word16 var1, Word16 var2 ); /* Mac with + rounding, 1 */ +Word16 msu_r( Word32 L_var3, Word16 var1, Word16 var2 ); /* Msu with + rounding, 1 */ +Word32 L_deposit_h( Word16 var1 ); /* 16 bit var1 -> MSB, 1 */ +Word32 L_deposit_l( Word16 var1 ); /* 16 bit var1 -> LSB, 1 */ + +Word32 L_shr_r( Word32 L_var1, Word16 var2 ); /* Long shift right with + round, 3 */ +Word32 L_abs( Word32 L_var1 ); /* Long abs, 1 */ +Word32 DEPR_L_sat_co( Word32 L_var1, Flag Overflow, Flag Carry ); /* Long saturation, 4 */ +Word16 norm_s( Word16 var1 ); /* Short norm, 1 */ +Word16 div_s( Word16 var1, Word16 var2 ); /* Short division, 18 */ Word32 div_w( Word32 L_num, Word32 L_den ); -Word16 norm_l( Word32 L_var1 ); /* Long norm, 1 */ -Word32 L_sat( Word32 L_var1 ); /* Long saturation, 4 */ +Word16 norm_l( Word32 L_var1 ); /* Long norm, 1 */ +Word32 L_sat( Word32 L_var1 ); /* Long saturation, 4 */ /* diff --git a/lib_com/bitalloc_fx.c b/lib_com/bitalloc_fx.c index b8ce51bd1..92a8e3928 100644 --- a/lib_com/bitalloc_fx.c +++ b/lib_com/bitalloc_fx.c @@ -376,7 +376,7 @@ Word16 BitAllocF_fx( exp1 = sub( norm_l( L_tmp1 ), 1 ); exp2 = norm_s( n ); tmp = div_s( extract_h( L_shl( L_tmp1, exp1 ) ), shl( n, exp2 ) ); /*15 + 15 + exp1 - 16 - exp2*/ - m_fx = shl_sat( tmp, sub( exp2, exp1 ) ); /*Q14*/ + m_fx = shl_sat( tmp, sub( exp2, exp1 ) ); /*Q14*/ t_fx = L_deposit_l( 0 ); n = 0; move16(); @@ -443,7 +443,7 @@ Word16 BitAllocF_fx( exp1 = sub( norm_l( L_tmp2 ), 1 ); exp2 = norm_s( n ); tmp = div_s( extract_h( L_shl( L_tmp2, exp1 ) ), shl( n, exp2 ) ); /*15 + 15 + exp1 - 16 - exp2*/ - m_fx = shl_o( tmp, sub( exp2, exp1 ), &Overflow ); /*Q14*/ + m_fx = shl_o( tmp, sub( exp2, exp1 ), &Overflow ); /*Q14*/ if ( L_tmp1 < 0 ) { m_fx = negate( m_fx ); diff --git a/lib_com/cng_exc_fx.c b/lib_com/cng_exc_fx.c index d2a7b6c28..3eab0b1f5 100644 --- a/lib_com/cng_exc_fx.c +++ b/lib_com/cng_exc_fx.c @@ -242,7 +242,7 @@ IF( NE_16( Opt_AMR_WB, 1 ) ) exp = norm_l( *Enew ); L_tmp = L_shl( *Enew, exp ); /* Q(exp+6) */ L_tmp = Mult_32_16( L_tmp, shl( L_frame, 5 ) ); /* Q(exp+6+5-15=exp-4) */ - L_tmp = L_shr_sat( L_tmp, sub( exp, 10 ) ); /* Q6 */ + L_tmp = L_shr_sat( L_tmp, sub( exp, 10 ) ); /* Q6 */ exp = norm_l( L_tmp ); fra = Log2_norm_lc( L_shl( L_tmp, exp ) ); exp = sub( sub( 30, exp ), 6 ); @@ -308,9 +308,9 @@ IF( NE_16( Opt_AMR_WB, 1 ) ) FOR( i = 0; i < NUM_ENV_CNG; i++ ) { /* env[i] = 2.0f*(*ptR * *ptR + *ptI * *ptI)/L_FFT; */ - L_tmp = L_mult0( *ptR, *ptR ); /* 2*Q_exc */ + L_tmp = L_mult0( *ptR, *ptR ); /* 2*Q_exc */ L_tmp = L_mac0_sat( L_tmp, *ptI, *ptI ); /* 2*Q_exc */ - L_tmp = L_shr( L_tmp, 1 ); /* 2*Q_exc+6 */ + L_tmp = L_shr( L_tmp, 1 ); /* 2*Q_exc+6 */ tmp = add( Q_exc, Q_exc ); env[i] = L_shr_sat( L_tmp, tmp ); move32(); /* Q6 */ @@ -397,10 +397,10 @@ IF( NE_16( Opt_AMR_WB, 1 ) ) L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp ); /*Q(31-exp)*/ - L_tmp2 = Mult_32_16( L_tmp, *ptR ); /*Q(16-exp)*/ + L_tmp2 = Mult_32_16( L_tmp, *ptR ); /*Q(16-exp)*/ *ptR = extract_h( L_shl_sat( L_tmp2, add( exp, Q_exc ) ) ); /*Q_exc*/ move16(); - L_tmp2 = Mult_32_16( L_tmp, *ptI ); /*Q(16-exp)*/ + L_tmp2 = Mult_32_16( L_tmp, *ptI ); /*Q(16-exp)*/ *ptI = extract_h( L_shl_sat( L_tmp2, add( exp, Q_exc ) ) ); /*Q_exc*/ move16(); ptR++; @@ -977,7 +977,7 @@ void cng_params_upd_fx( L_tmp = L_mult_o( *ptR, *ptR, &Overflow ); /* 2*Q_exc+1 */ L_tmp = L_add_o( L_tmp, L_mult_o( *ptI, *ptI, &Overflow ), &Overflow ); /* 2*Q_exc+1 */ L_tmp = L_add_o( L_tmp, L_tmp, &Overflow ); /* 2*Q_exc+1 */ - L_tmp = Mult_32_16( L_tmp, 128 ); /* 2*Q_exc+1 */ + L_tmp = Mult_32_16( L_tmp, 128 ); /* 2*Q_exc+1 */ tmp = add( add( Q_exc, Q_exc ), 1 ); sp[i] = L_shr( L_tmp, sub( tmp, 6 ) ); move32(); /* Q6 */ @@ -1164,7 +1164,7 @@ void cng_params_upd_ivas_fx( L_tmp = L_mult_o( *ptR, *ptR, &Overflow ); /* 2*Q_exc+1 */ L_tmp = L_add_o( L_tmp, L_mult_o( *ptI, *ptI, &Overflow ), &Overflow ); /* 2*Q_exc+1 */ L_tmp = L_add_o( L_tmp, L_tmp, &Overflow ); /* 2*Q_exc+1 */ - L_tmp = Mult_32_16( L_tmp, 128 ); /* 2*Q_exc+1 */ + L_tmp = Mult_32_16( L_tmp, 128 ); /* 2*Q_exc+1 */ tmp = add( add( Q_exc, Q_exc ), 1 ); sp[i] = L_shr( L_tmp, sub( tmp, 6 ) ); move32(); /* Q6 */ diff --git a/lib_com/deemph.c b/lib_com/deemph.c index 3ea9ba08b..8cddd7580 100644 --- a/lib_com/deemph.c +++ b/lib_com/deemph.c @@ -103,14 +103,14 @@ void deemph_fx( move32(); #endif - L_tmp = L_deposit_h( signal[0] ); /*Qx+16*/ + L_tmp = L_deposit_h( signal[0] ); /*Qx+16*/ L_tmp = L_mac_o( L_tmp, *mem, mu, &Overflow ); /*Qx+16*/ signal[0] = round_fx_o( L_tmp, &Overflow ); /*Qx*/ move16(); FOR( i = 1; i < L; i++ ) { - L_tmp = L_deposit_h( signal[i] ); /*Qx+16*/ + L_tmp = L_deposit_h( signal[i] ); /*Qx+16*/ L_tmp = L_mac_o( L_tmp, signal[i - 1], mu, &Overflow ); /*Qx+16*/ signal[i] = round_fx_o( L_tmp, &Overflow ); /*Qx*/ move16(); @@ -148,7 +148,7 @@ void Deemph2( FOR( i = 1; i < L; i++ ) { - L_tmp = L_mult( x[i], 16384 /*0.5f in Q15*/ ); /*Qx+16*/ + L_tmp = L_mult( x[i], 16384 /*0.5f in Q15*/ ); /*Qx+16*/ x[i] = mac_ro( L_tmp, x[i - 1], mu, &Overflow ); /*Qx-1*/ move16(); } diff --git a/lib_com/edct_fx.c b/lib_com/edct_fx.c index 3cb33b7c5..8d77da13a 100644 --- a/lib_com/edct_fx.c +++ b/lib_com/edct_fx.c @@ -457,11 +457,11 @@ void edct_16fx( { i2 = shl( i, 1 ); - L_tmp = L_mult( x[i2], edct_table[i] ); /*Q(Qx+16) */ + L_tmp = L_mult( x[i2], edct_table[i] ); /*Q(Qx+16) */ Lacc = L_mac_o( L_tmp, *px, *pt, &Overflow ); /*Q(Qx+16) */ re2[i] = round_fx_o( L_shl_o( Lacc, Q_edct, &Overflow ), &Overflow ); /* Q(Qx+Q_edct) */ move16(); - L_tmp = L_mult( *px, edct_table[i] ); /*Q(Qx+16) */ + L_tmp = L_mult( *px, edct_table[i] ); /*Q(Qx+16) */ Lacc = L_msu_o( L_tmp, x[i2], *pt, &Overflow ); /*Q(Qx+16) */ im2[i] = round_fx_o( L_shl_o( Lacc, Q_edct, &Overflow ), &Overflow ); /* Q(Qx+Q_edct) */ move16(); @@ -488,11 +488,11 @@ void edct_16fx( fact = round_fx( L_shl( L_tmp, 2 ) ); /*Q15 */ FOR( i = 0; i < shr( length, 1 ); i++ ) { - tmp = mult_r( im2[i], fact ); /*Q(Qx+Q_edct) */ + tmp = mult_r( im2[i], fact ); /*Q(Qx+Q_edct) */ re[i] = sub_o( re2[i], tmp, &Overflow ); /*Q(Qx+Q_edct) */ move16(); - tmp = mult_r( re2[i], fact ); /*Q(Qx+Q_edct) */ + tmp = mult_r( re2[i], fact ); /*Q(Qx+Q_edct) */ im[i] = add_o( im2[i], tmp, &Overflow ); /*Q(Qx+Q_edct) */ move16(); } @@ -504,14 +504,14 @@ void edct_16fx( { i2 = shl( i, 1 ); - L_tmp = L_mult( re[i], edct_table[i] ); /*Q(Qx+Q_edct+16) */ + L_tmp = L_mult( re[i], edct_table[i] ); /*Q(Qx+Q_edct+16) */ Lacc = L_mac_o( L_tmp, im[i], *pt, &Overflow ); /*Q(Qx+Q_edct+16) */ y[i2] = round_fx_o( L_shr_o( Lacc, Q_edct, &Overflow ), &Overflow ); /* Q(Qx) */ move16(); L_tmp = L_mult( re[i], edct_table[sub( shr( length, 1 ), add( 1, i ) )] ); /*Q(Qx+Q_edct+16) */ Lacc = L_msu( L_tmp, im[i], edct_table[i] ); /*Q(Qx+Q_edct+16) */ - *py = round_fx_o( L_shr_o( Lacc, Q_edct, &Overflow ), &Overflow ); /* Q(Qx) */ + *py = round_fx_o( L_shr_o( Lacc, Q_edct, &Overflow ), &Overflow ); /* Q(Qx) */ move16(); py -= 2; diff --git a/lib_com/env_adj.c b/lib_com/env_adj.c index 8ec13f925..554cf1dbe 100644 --- a/lib_com/env_adj.c +++ b/lib_com/env_adj.c @@ -146,7 +146,7 @@ void env_adj_fx( { /* tmp = min(1, max(0, len-ENV_ADJ_START)*(1.0f/ENV_ADJ_INCL)); */ tmp = round_fx_sat( L_shl_sat( L_mult0( s_max( 0, sub( len, ENV_ADJ_START_FX ) ), ENV_ADJ_INV_INCL_FX ), 16 ) ); /* Q15 (15+16-16) */ - tmp_diff = sub( MAX_16, tmp ); /* Q15 */ + tmp_diff = sub( MAX_16, tmp ); /* Q15 */ FOR( j = start; j < i; j++ ) { /* adj[j] = max(tmp + (1-tmp)*adj[j],env_stab); */ @@ -189,7 +189,7 @@ void env_adj_fx( { /* tmp = min(1, max(0, len-ENV_ADJ_START)*(1.0f/ENV_ADJ_INCL)); */ tmp = round_fx_sat( L_shl_sat( L_mult0( s_max( 0, sub( len, ENV_ADJ_START_FX ) ), ENV_ADJ_INV_INCL_FX ), 16 ) ); /* Q15 (15+16-16) */ - tmp_diff = sub( MAX_16, tmp ); /* Q15 */ + tmp_diff = sub( MAX_16, tmp ); /* Q15 */ move16(); FOR( j = start; j < i; j++ ) { diff --git a/lib_com/fft_fx_evs.c b/lib_com/fft_fx_evs.c index 8b63fab55..b6f2bb2ac 100644 --- a/lib_com/fft_fx_evs.c +++ b/lib_com/fft_fx_evs.c @@ -1134,11 +1134,11 @@ static void fft5_shift4_16fx( /* T2 = KP951056516*Te + KP587785252*Th; */ L_tmp = Mult_32_16( KP951056516_16FX, Te ); // Q(16 +x) L_tmp = Madd_32_16( L_tmp, KP587785252_16FX, Th ); // Q(16 +x) - T2 = round_fx_sat( L_tmp ); // Qx + T2 = round_fx_sat( L_tmp ); // Qx /*T3 = KP951056516*Th - KP587785252*Te; */ L_tmp = Mult_32_16( KP951056516_16FX, Th ); // Q(16 +x) L_tmp = Msub_32_16( L_tmp, KP587785252_16FX, Te ); // Q(16 +x) - T3 = round_fx_sat( L_tmp ); // Qx + T3 = round_fx_sat( L_tmp ); // Qx T6 = sub_sat( T1, shr_sat( T8, 2 ) ); T4 = add_sat( T9, T6 ); T5 = sub_sat( T6, T9 ); @@ -1154,12 +1154,12 @@ static void fft5_shift4_16fx( /* T2 = KP951056516 * Ts + KP587785252 * Tt; */ L_tmp = Mult_32_16( KP951056516_16FX, Ts ); // Q(16 +x) L_tmp = Madd_32_16( L_tmp, KP587785252_16FX, Tt ); // Q(16 +x) - T2 = round_fx_sat( L_tmp ); // Qx + T2 = round_fx_sat( L_tmp ); // Qx /* T3 = KP951056516 * Tt - KP587785252 * Ts; */ L_tmp = Mult_32_16( KP951056516_16FX, Tt ); // Q(16 +x) L_tmp = Msub_32_16( L_tmp, KP587785252_16FX, Ts ); // Q(16 +x) - T3 = round_fx_sat( L_tmp ); // Qx - T6 = sub_sat( To, shr( Tp, 2 ) ); // To - (Tp / 4) + T3 = round_fx_sat( L_tmp ); // Qx + T6 = sub_sat( To, shr( Tp, 2 ) ); // To - (Tp / 4) T4 = add_sat( Tn, T6 ); T5 = sub_sat( T6, Tn ); zIm[i4] = sub_sat( T4, T2 ); @@ -2327,8 +2327,8 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n ) move16(); /* special case: i = 0 */ - acc = L_mult( *RZ0++, 0x4000 /*1.Q14*/ ); // Q15 + Qx - acc = L_mac( acc, *RZ1++, 0x4000 /*1.Q14*/ ); // Q15 + Qx + acc = L_mult( *RZ0++, 0x4000 /*1.Q14*/ ); // Q15 + Qx + acc = L_mac( acc, *RZ1++, 0x4000 /*1.Q14*/ ); // Q15 + Qx *RY++ = mac_r_sat( acc, *RZ2++, 0x4000 /*1.Q14*/ ); // Qx move16(); diff --git a/lib_com/frame_ener.c b/lib_com/frame_ener.c index 5b37a5606..40e1167e5 100644 --- a/lib_com/frame_ener.c +++ b/lib_com/frame_ener.c @@ -318,13 +318,13 @@ Word16 frame_energy_fx( /* o : Frame energy in Q8 exp1 = sub( 15 + exp1, tmp2 ); /*add ld(2^exp1)=exp1 but check format, first*/ - tmp16 = sub( sub( 15, norm_s( exp1 ) ), 5 ); /*factor to shift Ltmp and exp1 with (shr) to avoid overflows when adding*/ - Ltmp = L_shr_o( Ltmp, tmp16, &Overflow ); /*Q25, tmp16*/ - exp2 = shr( exp1, tmp16 ); /*Q0 , tmp16*/ + tmp16 = sub( sub( 15, norm_s( exp1 ) ), 5 ); /*factor to shift Ltmp and exp1 with (shr) to avoid overflows when adding*/ + Ltmp = L_shr_o( Ltmp, tmp16, &Overflow ); /*Q25, tmp16*/ + exp2 = shr( exp1, tmp16 ); /*Q0 , tmp16*/ Ltmp = L_add_o( Ltmp, L_shl( L_deposit_l( exp2 ), 25 ), &Overflow ); /*Q25, tmp16, normalized*/ /*make 10*log10 out of log2*/ - Ltmp = Mpy_32_16_1( Ltmp, LG10 ); /*Q25,tmp16 * Q13 = Q23, tmp16*/ + Ltmp = Mpy_32_16_1( Ltmp, LG10 ); /*Q25,tmp16 * Q13 = Q23, tmp16*/ *frame_ener = extract_h( L_shl_o( Ltmp, add( tmp16, 1 ), &Overflow ) ); /*Q8*/ move16(); enern = sub_o( *frame_ener, lp_speech, &Overflow ); /*Q8*/ diff --git a/lib_com/frame_ener_fx.c b/lib_com/frame_ener_fx.c index 2dd5fed56..f89c1264b 100644 --- a/lib_com/frame_ener_fx.c +++ b/lib_com/frame_ener_fx.c @@ -277,13 +277,13 @@ Word16 frame_energy_fx( /* o : Frame energy in Q8 exp1 = sub( 15 + exp1, tmp2 ); /*add ld(2^exp1)=exp1 but check format, first*/ - tmp16 = sub( sub( 15, norm_s( exp1 ) ), 5 ); /*factor to shift Ltmp and exp1 with (shr) to avoid overflows when adding*/ - Ltmp = L_shr_o( Ltmp, tmp16, &Overflow ); /*Q25, tmp16*/ - exp2 = shr( exp1, tmp16 ); /*Q0 , tmp16*/ + tmp16 = sub( sub( 15, norm_s( exp1 ) ), 5 ); /*factor to shift Ltmp and exp1 with (shr) to avoid overflows when adding*/ + Ltmp = L_shr_o( Ltmp, tmp16, &Overflow ); /*Q25, tmp16*/ + exp2 = shr( exp1, tmp16 ); /*Q0 , tmp16*/ Ltmp = L_add_o( Ltmp, L_shl( L_deposit_l( exp2 ), 25 ), &Overflow ); /*Q25, tmp16, normalized*/ /*make 10*log10 out of log2*/ - Ltmp = Mpy_32_16_1( Ltmp, LG10 ); /*Q25,tmp16 * Q13 = Q23, tmp16*/ + Ltmp = Mpy_32_16_1( Ltmp, LG10 ); /*Q25,tmp16 * Q13 = Q23, tmp16*/ *frame_ener = extract_h( L_shl_o( Ltmp, add( tmp16, 1 ), &Overflow ) ); /*Q8*/ move16(); enern = sub_o( *frame_ener, lp_speech, &Overflow ); /*Q8*/ diff --git a/lib_com/gs_bitallocation_fx.c b/lib_com/gs_bitallocation_fx.c index 5065ab7e0..47d3679a8 100644 --- a/lib_com/gs_bitallocation_fx.c +++ b/lib_com/gs_bitallocation_fx.c @@ -96,7 +96,7 @@ void bands_and_bit_alloc_fx( /* To adapt current energy band to PVQ freq band for sorting*/ ener_vec[0] = add_o( Ener_per_bd_iQ[0], Ener_per_bd_iQ[1], &Overflow ); /*Q12 */ - Copy( Ener_per_bd_iQ_tmp + 1, ener_vec, MBANDS_GN - 1 ); /*Q12 */ + Copy( Ener_per_bd_iQ_tmp + 1, ener_vec, MBANDS_GN - 1 ); /*Q12 */ ener_vec[MBANDS_GN - 1] = ener_vec[MBANDS_GN - 2]; move16(); IF( EQ_16( L_frame, L_FRAME16k ) ) diff --git a/lib_com/gs_gains_fx.c b/lib_com/gs_gains_fx.c index 376f2560f..d6aee58c5 100644 --- a/lib_com/gs_gains_fx.c +++ b/lib_com/gs_gains_fx.c @@ -128,7 +128,7 @@ void Comp_and_apply_gain_fx( FOR( i = StartBin; i < NB_Qbins + StartBin; i++ ) { - L32 = L_mult( exc_diffQ[i], y_gain ); /*Qexc_diff+15 */ + L32 = L_mult( exc_diffQ[i], y_gain ); /*Qexc_diff+15 */ exc_diffQ[i] = round_fx_o( L_shl_o( L32, tmp_exp, &Overflow ), &Overflow ); /*Q_exc */ move16(); } @@ -197,20 +197,20 @@ void Comp_and_apply_gain_ivas_fx( * y_gain = pow(10.0, (Ener_per_bd_iQ[i_band]-Ener_per_bd_yQ[i_band])) * = pow(2, 3.321928*(Ener_per_bd_iQ[i_band]-Ener_per_bd_yQ[i_band])) *-----------------------------------------------------------------*/ - L16 = sub_sat( Ener_per_bd_iQ[i_band], Ener_per_bd_yQ[i_band] ); /*Q12 */ - L32 = L_mult( L16, 27213 ); /* 3.321928 in Q13 -> Q26 */ - L32 = L_shr( L32, 10 ); /* From Q26 to Q16 */ - frac = L_Extract_lc( L32, &exp1 ); /* Extract exponent of gcode0 */ - y_gain = extract_l( Pow2( 14, frac ) ); /* Put 14 as exponent so that */ - /* output of Pow2() will be: */ - /* 16384 < Pow2() <= 32767 */ + L16 = sub_sat( Ener_per_bd_iQ[i_band], Ener_per_bd_yQ[i_band] ); /*Q12 */ + L32 = L_mult( L16, 27213 ); /* 3.321928 in Q13 -> Q26 */ + L32 = L_shr( L32, 10 ); /* From Q26 to Q16 */ + frac = L_Extract_lc( L32, &exp1 ); /* Extract exponent of gcode0 */ + y_gain = extract_l( Pow2( 14, frac ) ); /* Put 14 as exponent so that */ + /* output of Pow2() will be: */ + /* 16384 < Pow2() <= 32767 */ Ener_per_bd_yQ[i_band] = shl_o( y_gain, sub( exp1, 13 ), &Overflow ); /*Q13*/ move16(); /*Q1 */ tmp_exp = add( add( exp1, 1 ), sub( *Q_exc, Qexc_diff ) ); FOR( i = StartBin; i < NB_Qbins + StartBin; i++ ) { - L32 = L_mult( exc_diffQ[i], y_gain ); /*Qexc_diff+15 */ + L32 = L_mult( exc_diffQ[i], y_gain ); /*Qexc_diff+15 */ exc_diffQ[i] = round_fx_o( L32, &Overflow ); /*Q_exc-tmp_exp */ move16(); IF( exc_diffQ[i] ) diff --git a/lib_com/gs_inact_switching_fx.c b/lib_com/gs_inact_switching_fx.c index 89d879974..5dfe6b1d6 100644 --- a/lib_com/gs_inact_switching_fx.c +++ b/lib_com/gs_inact_switching_fx.c @@ -129,7 +129,7 @@ void Inac_swtch_ematch_fx( { FOR( j = 0; j < 8; j++ ) { - L_tmp = L_mult( *pt_exc, ftmp ); /* Q_exc*Q0 -> Q(Q_exc+1) */ + L_tmp = L_mult( *pt_exc, ftmp ); /* Q_exc*Q0 -> Q(Q_exc+1) */ L_tmp = L_shl_sat( L_tmp, add( exp, 15 ) ); /* Q(Q_exc+1) -> Q(16+Q_exc)*/ *pt_exc = round_fx_sat( L_tmp ); move16(); @@ -140,7 +140,7 @@ void Inac_swtch_ematch_fx( { FOR( j = 0; j < 16; j++ ) { - L_tmp = L_mult( *pt_exc, ftmp ); /* Q_exc*Q0 -> Q(Q_exc+1) */ + L_tmp = L_mult( *pt_exc, ftmp ); /* Q_exc*Q0 -> Q(Q_exc+1) */ L_tmp = L_shl_sat( L_tmp, add( exp, 15 ) ); /* Q(Q_exc+1) -> Q(16+Q_exc)*/ *pt_exc = round_fx_sat( L_tmp ); /*Q_exc*/ move16(); diff --git a/lib_com/gs_noisefill_fx.c b/lib_com/gs_noisefill_fx.c index b5b8fe9ba..d2a576dbe 100644 --- a/lib_com/gs_noisefill_fx.c +++ b/lib_com/gs_noisefill_fx.c @@ -470,11 +470,11 @@ static void Decreas_freqPeak_fx( { tmp = abs_s( *src ); exp = norm_s( max_val ); - tmp1 = div_s( shl( 1, sub( 14, exp ) ), max_val ); /*Q(29 - exp - Q_exc) */ - L_tmp = L_mult( tmp, tmp1 ); /*Q(30 - exp) */ + tmp1 = div_s( shl( 1, sub( 14, exp ) ), max_val ); /*Q(29 - exp - Q_exc) */ + L_tmp = L_mult( tmp, tmp1 ); /*Q(30 - exp) */ tmp = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); /*Q14 */ - tmp = sub( 32767, tmp ); /*Q14 */ - L_tmp = L_mult( avrg, tmp ); /*Q_exc +15 */ + tmp = sub( 32767, tmp ); /*Q14 */ + L_tmp = L_mult( avrg, tmp ); /*Q_exc +15 */ tmp = round_fx( L_shl( L_tmp, 1 ) ); tmp1 = negate( tmp ); @@ -999,9 +999,9 @@ void highband_exc_dct_in_fx( FOR( i = sub( L_FRAME, 16 ); i < L_FRAME; i++ ) { /*exc_dct_in[i] *= (0.067f*i-15.f); */ - tmp = mult_r( 17564, shl( i, 6 ) ); /*0.067 in Q18 and i in Q6= Q9 */ - tmp = sub( tmp, 7680 ); /*15 in Q9 = Q9 */ - L_tmp = L_mult( exc_dct_in[i], tmp ); /*Q(Q_exc+10) */ + tmp = mult_r( 17564, shl( i, 6 ) ); /*0.067 in Q18 and i in Q6= Q9 */ + tmp = sub( tmp, 7680 ); /*15 in Q9 = Q9 */ + L_tmp = L_mult( exc_dct_in[i], tmp ); /*Q(Q_exc+10) */ exc_dct_in[i] = round_fx_o( L_shl_o( L_tmp, 6, &Overflow ), &Overflow ); /*Q_exc */ } } @@ -1495,9 +1495,9 @@ void highband_exc_dct_in_ivas_fx( FOR( i = sub( L_FRAME, 16 ); i < L_FRAME; i++ ) { /*exc_dct_in[i] *= (0.067f*i-15.f); */ - tmp = mult_r( 17564, shl( i, 6 ) ); /*0.067 in Q18 and i in Q6= Q9 */ - tmp = sub( tmp, 7680 ); /*15 in Q9 = Q9 */ - L_tmp = L_mult( exc_dct_in[i], tmp ); /*Q(Q_exc+10) */ + tmp = mult_r( 17564, shl( i, 6 ) ); /*0.067 in Q18 and i in Q6= Q9 */ + tmp = sub( tmp, 7680 ); /*15 in Q9 = Q9 */ + L_tmp = L_mult( exc_dct_in[i], tmp ); /*Q(Q_exc+10) */ exc_dct_in[i] = round_fx_o( L_shl_o( L_tmp, 6, &Overflow ), &Overflow ); /*Q_exc */ } } diff --git a/lib_com/hq2_noise_inject_fx.c b/lib_com/hq2_noise_inject_fx.c index 3595efd06..b85aaa027 100644 --- a/lib_com/hq2_noise_inject_fx.c +++ b/lib_com/hq2_noise_inject_fx.c @@ -386,7 +386,7 @@ void hq2_noise_inject_fx( } ELSE IF( count[k - 1] == 0 && tmp4 > 0 ) { - L_tmp = L_mult( env_fx2[k - 1], tmp ); /* Q(1+Q_speech+1 = Q_speech+2) */ + L_tmp = L_mult( env_fx2[k - 1], tmp ); /* Q(1+Q_speech+1 = Q_speech+2) */ fac_fx = extract_h( L_shl_o( L_tmp, sub( 26, Q_speech ), &Overflow ) ); /*Q12 */ } } @@ -436,7 +436,7 @@ void hq2_noise_inject_fx( tmp = sub( Q_env_fx[k], Q_Ep_fx[k] ); tmp = sub( tmp, Q_speech ); tmp = add( tmp, 25 ); - L_tmp = L_shr_sat( L_tmp2, tmp ); /*Q7 */ + L_tmp = L_shr_sat( L_tmp2, tmp ); /*Q7 */ tmp = extract_l( L_min( L_tmp, 192 /* 1.5 in Q7 */ ) ); /* */ fac_fx = extract_h( L_shl( L_mult( fac_fx, tmp ), 8 ) ); /*Q12 */ } @@ -446,7 +446,7 @@ void hq2_noise_inject_fx( L_tmp2 = Mult_32_16( env_fx[k], tmp ); /*Q(Q_env_fx[k]+0-15 = Q_env_fx[k]-15) */ L_tmp2 = Mult_32_16( L_tmp2, 20480 /* 1.25 in Q14 */ ); /*Q(Q_env_fx[k]-15+14-15 = Q_env_fx[k]-16) */ tmp = sub( Q_env_fx[k], 23 ); - L_tmp = L_shr_sat( L_tmp2, tmp ); /*Q7 */ + L_tmp = L_shr_sat( L_tmp2, tmp ); /*Q7 */ tmp = extract_l( ( L_min( L_tmp, 192 /* 1.5 in Q7 */ ) ) ); /* Q7 */ fac_fx = extract_h( L_shl( L_mult( fac_fx, tmp ), 8 ) ); /*Q12 */ } @@ -609,7 +609,7 @@ void hq2_noise_inject_fx( { Q_speech = norm_s( band_width[k] ); tmp = shl_o( band_width[k], Q_speech, &Overflow ); /*Q(Q_speech) */ - tmp = div_s( 16384 /* 0.5 in Q15 */, tmp ); /*Q(15+14-Q_speech) */ + tmp = div_s( 16384 /* 0.5 in Q15 */, tmp ); /*Q(15+14-Q_speech) */ } ELSE { @@ -618,12 +618,12 @@ void hq2_noise_inject_fx( move16(); move16(); } - tmp1 = sub( fac_fx, 4096 /* 1 in Q12 */ ); /*Q12 */ - L_tmp = L_mult( tmp1, j ); /*Q13 */ - L_tmp = Mult_32_16( L_tmp, tmp ); /*Q(13+29-Q_speech-15 = 27-Q_speech) */ + tmp1 = sub( fac_fx, 4096 /* 1 in Q12 */ ); /*Q12 */ + L_tmp = L_mult( tmp1, j ); /*Q13 */ + L_tmp = Mult_32_16( L_tmp, tmp ); /*Q(13+29-Q_speech-15 = 27-Q_speech) */ tmp = extract_h( L_shl_o( L_tmp, add( 1, Q_speech ), &Overflow ) ); /*Q12 */ - tmp = sub( fac_fx, tmp ); /*Q12 */ - L_tmp = Mult_32_16( ni_gain_fx[k], tmp ); /*Q(17+12-15=14) */ + tmp = sub( fac_fx, tmp ); /*Q12 */ + L_tmp = Mult_32_16( ni_gain_fx[k], tmp ); /*Q(17+12-15=14) */ L_y2[i] = L_add( L_y2[i], L_shr( Mult_32_16( L_tmp, rand_fx ), 2 ) ); move32(); /*Q12 */ } diff --git a/lib_com/hq_tools_fx.c b/lib_com/hq_tools_fx.c index eabf20c1f..998f3f048 100644 --- a/lib_com/hq_tools_fx.c +++ b/lib_com/hq_tools_fx.c @@ -84,7 +84,7 @@ void hq_swb_harmonic_calc_norm_envelop_fx( FOR( n_lag = 0; n_lag < n_lag_now; n_lag++ ) { - L_tmp = L_abs( L_SWB_signal[n_lag] ); /*Q12*/ + L_tmp = L_abs( L_SWB_signal[n_lag] ); /*Q12*/ L_envelope[env_index] = L_add_sat( L_envelope[env_index], L_tmp ); /*Q12*/ move32(); } @@ -101,7 +101,7 @@ void hq_swb_harmonic_calc_norm_envelop_fx( move16(); FOR( n_lag = 0; n_lag < n_lag_now; n_lag++ ) { - L_tmp = L_abs( L_SWB_signal[( n_freq + n_lag )] ); /*Q12*/ + L_tmp = L_abs( L_SWB_signal[( n_freq + n_lag )] ); /*Q12*/ L_envelope[env_index] = L_add_sat( L_envelope[env_index], L_tmp ); /*Q12*/ move32(); } @@ -119,7 +119,7 @@ void hq_swb_harmonic_calc_norm_envelop_fx( move32(); FOR( n_lag = 0; n_lag < n_lag_now; n_lag++ ) { - L_tmp = L_abs( L_SWB_signal[( n_freq + n_lag )] ); /*Q12*/ + L_tmp = L_abs( L_SWB_signal[( n_freq + n_lag )] ); /*Q12*/ L_envelope[env_index] = L_add_sat( L_envelope[env_index], L_tmp ); /*Q12*/ move32(); } @@ -548,7 +548,7 @@ void harm_bwe_fine_fx( norm_signal = norm_l( envelope[i] ); enve_lo[i] = L_Extract_lc( L_shl( envelope[i], norm_signal ), &enve_hi[i] ); /*Q12+norm_signal-16*/ L_signal[i] = Div_32( L_signal[i], enve_hi[i], enve_lo[i] ); /*Q31 - norm_signal*/ - SWB_signal[i] = round_fx_sat( L_shl_sat( L_signal[i], norm_signal ) ); /*Q15*/ + SWB_signal[i] = round_fx_sat( L_shl_sat( L_signal[i], norm_signal ) ); /*Q15*/ move16(); move16(); move32(); @@ -558,7 +558,7 @@ void harm_bwe_fine_fx( norm_signal = norm_l( envelope[i] ); enve_lo[i] = L_Extract_lc( L_shl( envelope[i], norm_signal ), &enve_hi[i] ); /*Q12+norm_signal-16*/ L_signal[i] = L_negate( Div_32( L_negate( L_signal[i] ), enve_hi[i], enve_lo[i] ) ); /*Q31 - norm_signal*/ - SWB_signal[i] = round_fx_sat( L_shl_sat( L_signal[i], norm_signal ) ); /*Q15*/ + SWB_signal[i] = round_fx_sat( L_shl_sat( L_signal[i], norm_signal ) ); /*Q15*/ move16(); move16(); move32(); @@ -944,10 +944,10 @@ void ivas_harm_bwe_fx( FOR( sfm = sfm_start[i]; sfm < sfm_end[i]; sfm++ ) { - L_tmp = Mult_32_16( E_L, coeff_fine[sfm] ); /*Q19 19 + 15 +1-16 */ - L_tmp = L_shl_sat( L_tmp, 9 ); /*Q28 */ - tmp = Random( bwe_seed ); /*Q15 */ - L_tmp2 = L_shr( L_mult( beta, tmp ), 3 ); /* Q28 31-3 15+15 +1-3 */ + L_tmp = Mult_32_16( E_L, coeff_fine[sfm] ); /*Q19 19 + 15 +1-16 */ + L_tmp = L_shl_sat( L_tmp, 9 ); /*Q28 */ + tmp = Random( bwe_seed ); /*Q15 */ + L_tmp2 = L_shr( L_mult( beta, tmp ), 3 ); /* Q28 31-3 15+15 +1-3 */ L_tmp = L_add_sat( L_tmp, L_tmp2 ); /*Q28 */ coeff_out[sfm] = L_shl_sat( Mult_32_32( L_tmp, normq ), 1 ); /*Q12 28 +14 +1 -31 */ move32(); @@ -1113,10 +1113,10 @@ void harm_bwe_fx( FOR( sfm = sfm_start[i]; sfm < sfm_end[i]; sfm++ ) { - L_tmp = Mult_32_16( E_L, coeff_fine[sfm] ); /*Q19 19 + 15 +1-16 */ - L_tmp = L_shl_sat( L_tmp, 9 ); /*Q28 */ - tmp = Random( bwe_seed ); /*Q15 */ - L_tmp2 = L_shr( L_mult( beta, tmp ), 3 ); /* Q28 31-3 15+15 +1-3 */ + L_tmp = Mult_32_16( E_L, coeff_fine[sfm] ); /*Q19 19 + 15 +1-16 */ + L_tmp = L_shl_sat( L_tmp, 9 ); /*Q28 */ + tmp = Random( bwe_seed ); /*Q15 */ + L_tmp2 = L_shr( L_mult( beta, tmp ), 3 ); /* Q28 31-3 15+15 +1-3 */ L_tmp = L_add_sat( L_tmp, L_tmp2 ); /*Q28 */ coeff_out[sfm] = L_shl_sat( Mult_32_32( L_tmp, normq ), 1 ); /*Q12 28 +14 +1 -31 */ move32(); @@ -2167,9 +2167,9 @@ void hq_wb_nf_bwe_fx( IF( GT_16( last_sfm, 8 ) && total_bit > 0 ) { exp = norm_s( total_bit ); - tmp = shl( total_bit, exp ); /*Q(exp) */ - tmp = div_s( 16384, tmp ); /*Q(15+14-exp) */ - L_tmp = L_mult( tmp, bitalloc_var_fx ); /*Q(29-exp+1) */ + tmp = shl( total_bit, exp ); /*Q(exp) */ + tmp = div_s( 16384, tmp ); /*Q(15+14-exp) */ + L_tmp = L_mult( tmp, bitalloc_var_fx ); /*Q(29-exp+1) */ bitalloc_var_fx = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /*Q14 */ } ELSE @@ -2194,7 +2194,7 @@ void hq_wb_nf_bwe_fx( move16(); FOR( i = sfm_start[sfm]; i < sfm_end[sfm]; i++ ) { - fabs_coeff_out_fx = L_abs( L_coeff_out[i] ); /*Q12*/ + fabs_coeff_out_fx = L_abs( L_coeff_out[i] ); /*Q12*/ mean_fx = L_add_sat( mean_fx, fabs_coeff_out_fx ); /*Q12 */ if ( GT_32( fabs_coeff_out_fx, peak_fx ) ) { @@ -2206,8 +2206,8 @@ void hq_wb_nf_bwe_fx( IF( mean_fx != 0 ) { exp = norm_l( mean_fx ); - mean_fx = L_shl_sat( mean_fx, exp ); /*Q(exp+12) */ - tmp = round_fx_sat( mean_fx ); /*Q(exp-4) */ + mean_fx = L_shl_sat( mean_fx, exp ); /*Q(exp+12) */ + tmp = round_fx_sat( mean_fx ); /*Q(exp-4) */ tmp = div_s( 16384, tmp ); /*Q(15+14-exp+4 = 33-exp) */ L_tmp = Mult_32_16( peak_fx, tmp ); /*Q(12+33-exp-15 = 30-exp) */ tmp = shl( sfmsize[sfm], 9 ); /*Q9 */ @@ -2246,10 +2246,10 @@ void hq_wb_nf_bwe_fx( tmp = div_s( 1, last_sfm ); /*Q15 */ } - L_tmp = L_mult( 5, sharp_fx ); /*Q15 */ - L_tmp = Mult_32_16( L_tmp, tmp ); /*Q15 */ + L_tmp = L_mult( 5, sharp_fx ); /*Q15 */ + L_tmp = Mult_32_16( L_tmp, tmp ); /*Q15 */ step_fx = round_fx_sat( L_shl_sat( L_tmp, 16 ) ); /*Q15 */ - alfa_fx = 20480; /*Q13 = 2.5 */ + alfa_fx = 20480; /*Q13 = 2.5 */ move16(); /* fill noise for the insaturable subbands */ FOR( sfm = 0; sfm < num_sfm; sfm++ ) diff --git a/lib_com/igf_base_fx.c b/lib_com/igf_base_fx.c index cd34348b0..fbccdb519 100644 --- a/lib_com/igf_base_fx.c +++ b/lib_com/igf_base_fx.c @@ -1187,7 +1187,7 @@ void IGFCommonFuncsMDCTSquareSpec( const Word16 sqrtBgn, /**< in FOR( i = sqrtBgn; i < sqrtEnd; i++ ) { tmp = round_fx_sat( L_shl_sat( mdctSpec[i], s1 ) ); /*(15 - mdctSpec_e)+ S1*/ - mdctSquareSpec[j++] = L_mult0( tmp, tmp ); /*31 - mdctSquareSpec_e*/ + mdctSquareSpec[j++] = L_mult0( tmp, tmp ); /*31 - mdctSquareSpec_e*/ move32(); } } diff --git a/lib_com/low_rate_band_att_fx.c b/lib_com/low_rate_band_att_fx.c index e26cb4652..9958b9d5f 100644 --- a/lib_com/low_rate_band_att_fx.c +++ b/lib_com/low_rate_band_att_fx.c @@ -82,7 +82,7 @@ void ivas_fine_gain_pred_fx( Word16 tmp1, tmp_exp = sub( 15, norm ); tmp1 = Sqrt16( shl( bw, norm ), &tmp_exp ); tmp1 = shr( tmp1, sub( sub( 15, tmp_exp ), Q11 ) ); - Mpy_32_16_ss( L_tmp, tmp1, &L_tmp, &lsb ); /*31-exp+11-15=27-exp */ + Mpy_32_16_ss( L_tmp, tmp1, &L_tmp, &lsb ); /*31-exp+11-15=27-exp */ #endif gp = round_fx_o( L_shl_o( L_tmp, add( 1, exp ), &Overflow ), &Overflow ); /*27-exp+1+exp-16=12 */ @@ -100,7 +100,7 @@ void ivas_fine_gain_pred_fx( exp = add( exp, exp2 ); /*gp *= 1.0f - 0.05f / accuracy; */ - tmp = div_s( 13107, accuracy ); /* 0.05 in Q18 */ + tmp = div_s( 13107, accuracy ); /* 0.05 in Q18 */ tmp = shr_o( tmp, sub( 34, exp ), &Overflow ); /*15+18-exp+16-15=34-exp */ tmp = sub( 32767, tmp ); tmp = s_max( 27554, tmp ); /* Limit attenuation to norm quantizer error, 2^-0.25 in Q15 */ @@ -191,8 +191,8 @@ void fine_gain_pred_fx( exp = norm_l( xx ); L_tmp = L_shl( xx, exp ); /*2*(15-shift)+exp */ exp = sub( 31, add( exp, sub( 30, shl( shift, 1 ) ) ) ); - L_tmp = Isqrt_lc( L_tmp, &exp ); /*31 - exp */ - Mpy_32_16_ss( L_tmp, fine_gain_pred_sqrt_bw[bw_idx], &L_tmp, &lsb ); /*31-exp+11-15=27-exp */ + L_tmp = Isqrt_lc( L_tmp, &exp ); /*31 - exp */ + Mpy_32_16_ss( L_tmp, fine_gain_pred_sqrt_bw[bw_idx], &L_tmp, &lsb ); /*31-exp+11-15=27-exp */ gp = round_fx_o( L_shl_o( L_tmp, add( 1, exp ), &Overflow ), &Overflow ); /*27-exp+1+exp-16=12 */ test(); test(); @@ -208,7 +208,7 @@ void fine_gain_pred_fx( exp = add( exp, exp2 ); /*gp *= 1.0f - 0.05f / accuracy; */ - tmp = div_s( 13107, accuracy ); /* 0.05 in Q18 */ + tmp = div_s( 13107, accuracy ); /* 0.05 in Q18 */ tmp = shr_o( tmp, sub( 34, exp ), &Overflow ); /*15+18-exp+16-15=34-exp */ tmp = sub( 32767, tmp ); tmp = s_max( 27554, tmp ); /* Limit attenuation to norm quantizer error, 2^-0.25 in Q15 */ diff --git a/lib_com/lsf_tools_fx.c b/lib_com/lsf_tools_fx.c index a24f008d9..b99fc4753 100644 --- a/lib_com/lsf_tools_fx.c +++ b/lib_com/lsf_tools_fx.c @@ -1724,9 +1724,9 @@ void a2rc_fx( const Word16 *a, /* i: can be any Q */ FOR( j = 0; j < m / 2; j++ ) { n = sub( sub( m, (Word16) 1 ), j ); - L_tmp1 = L_mult( denom_mant, f_fx[j] ); /* denom*f[j]. Q15*Q12 = Q28 (floating with exp) */ + L_tmp1 = L_mult( denom_mant, f_fx[j] ); /* denom*f[j]. Q15*Q12 = Q28 (floating with exp) */ L_tmp1 = L_mac_o( L_tmp1, tmp, f_fx[n], &Overflow ); /* denom*f[j]+km*denom*f[n] in Q28 (floating with exp) */ - L_tmp2 = L_mult( denom_mant, f_fx[n] ); /* denom*f[n]. Q15*Q12 = Q28 (floating with exp) */ + L_tmp2 = L_mult( denom_mant, f_fx[n] ); /* denom*f[n]. Q15*Q12 = Q28 (floating with exp) */ L_tmp2 = L_mac_o( L_tmp2, tmp, f_fx[j], &Overflow ); /* denom*f[n]+km*denom*f[j] in Q28 (floating with exp) */ L_tmp1 = L_shr_o( L_tmp1, exp, &Overflow ); /* bringing to true Q28 */ L_tmp2 = L_shr_o( L_tmp2, exp, &Overflow ); /* bringing to true Q28 */ @@ -1736,7 +1736,7 @@ void a2rc_fx( const Word16 *a, /* i: can be any Q */ IF( m & 1 ) { - L_tmp1 = L_mult( denom_mant, f_fx[j] ); /* denom*f[j]. Q15*Q12 = Q28 (floating with exp) */ + L_tmp1 = L_mult( denom_mant, f_fx[j] ); /* denom*f[j]. Q15*Q12 = Q28 (floating with exp) */ L_tmp1 = L_mac_o( L_tmp1, tmp, f_fx[j], &Overflow ); /* denom*f[j]+km*denom*f[j] in Q28 (floating with exp) */ L_tmp1 = L_shr_o( L_tmp1, exp, &Overflow ); /* bringing to true Q28 */ f_fx[j] = round_fx_o( L_tmp1, &Overflow ); /* extracting in q_a */ @@ -2241,7 +2241,7 @@ Word16 lsf_stab_fx( /* o : LP filter stability Q15*/ e = sub( 30 - 21 - 1, e ); tmp = round_fx_o( L_shl_o( L_tmp, e, &Overflow ), &Overflow ); /*Q14*/ - tmp = sub( 20480, tmp ); /* 1.25 - tmp in Q14 */ + tmp = sub( 20480, tmp ); /* 1.25 - tmp in Q14 */ tmp = shl_o( tmp, 1, &Overflow ); /* Q14 -> Q15 with saturation */ tmp = s_max( tmp, 0 ); @@ -3832,8 +3832,8 @@ Word16 root_search_fx( Word16 low, L_tmp1 = L_shl( L_tmp, exp1 ); tmp = extract_h( L_tmp1 ); exp1 = sub( 30 - 25, exp1 ); - tmp = div_s( 16384, tmp ); /* 15+exp1 */ - Ltmp = Mult_32_16( *v_low, tmp ); /* 15+exp1+25-15 */ + tmp = div_s( 16384, tmp ); /* 15+exp1 */ + Ltmp = Mult_32_16( *v_low, tmp ); /* 15+exp1+25-15 */ Ltemp = L_shl_o( Ltmp, ( 6 - exp1 ), &Overflow ); /* Q31 */ if ( LT_32( *v_low, vh ) ) { diff --git a/lib_com/modif_fs_fx.c b/lib_com/modif_fs_fx.c index 6dace6f05..6079e5db5 100644 --- a/lib_com/modif_fs_fx.c +++ b/lib_com/modif_fs_fx.c @@ -954,28 +954,28 @@ void Decimate_allpass_steep_fx( FOR( k = 0; k < N / 2; k++ ) { - Lacc = L_deposit_h( mem[0] ); /* Q(16+x) */ + Lacc = L_deposit_h( mem[0] ); /* Q(16+x) */ Lacc = L_mac_o( Lacc, AP1_STEEP_FX[0], in_fx[2 * k], &Overflow ); /* Q(16+x) */ - Lacc1 = L_deposit_h( in_fx[2 * k] ); /* Q16+Qx */ - temp1 = extract_h( Lacc ); /* Qx */ - Lacc1 = L_msu_o( Lacc1, AP1_STEEP_FX[0], temp1, &Overflow ); /* Q16+Qx */ - mem[0] = extract_h( Lacc1 ); /* Qx */ + Lacc1 = L_deposit_h( in_fx[2 * k] ); /* Q16+Qx */ + temp1 = extract_h( Lacc ); /* Qx */ + Lacc1 = L_msu_o( Lacc1, AP1_STEEP_FX[0], temp1, &Overflow ); /* Q16+Qx */ + mem[0] = extract_h( Lacc1 ); /* Qx */ temp[0] = temp1; move16(); move16(); - Lacc1 = L_deposit_h( mem[1] ); /* Q16+Qx */ + Lacc1 = L_deposit_h( mem[1] ); /* Q16+Qx */ Lacc1 = ( L_mac_o( Lacc1, AP1_STEEP_FX[1], temp1, &Overflow ) ); /* Q16+Qx */ - temp2 = extract_h( Lacc1 ); /* Qx */ + temp2 = extract_h( Lacc1 ); /* Qx */ Lacc = L_msu_o( Lacc, AP1_STEEP_FX[1], temp2, &Overflow ); /* Q16+Qx */ - mem[1] = extract_h( Lacc ); /* Qx */ + mem[1] = extract_h( Lacc ); /* Qx */ temp[1] = temp2; move16(); move16(); - Lacc = L_deposit_h( mem[ALLPASSSECTIONS_STEEP - 1] ); /* Q(16+x) */ + Lacc = L_deposit_h( mem[ALLPASSSECTIONS_STEEP - 1] ); /* Q(16+x) */ out_fx[k] = extract_h( L_mac_o( Lacc, AP1_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], temp2, &Overflow ) ); /* Qx format */ move16(); mem[ALLPASSSECTIONS_STEEP - 1] = extract_h( L_msu_o( Lacc1, AP1_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], out_fx[k], &Overflow ) ); /* Qx */ @@ -984,32 +984,32 @@ void Decimate_allpass_steep_fx( /* lower allpass filter chain */ - Lacc = L_deposit_h( mem[ALLPASSSECTIONS_STEEP] ); /* Q(16+x) */ + Lacc = L_deposit_h( mem[ALLPASSSECTIONS_STEEP] ); /* Q(16+x) */ Lacc = L_mac_o( Lacc, AP2_STEEP_FX[0], mem[2 * ALLPASSSECTIONS_STEEP], &Overflow ); /*Q(16+x) */ - Lacc1 = L_deposit_h( mem[2 * ALLPASSSECTIONS_STEEP] ); /* Q(16+x) */ - temp1 = extract_h( Lacc ); /* Qx */ - Lacc1 = L_msu_o( Lacc1, AP2_STEEP_FX[0], temp1, &Overflow ); /* Q(16+x) */ + Lacc1 = L_deposit_h( mem[2 * ALLPASSSECTIONS_STEEP] ); /* Q(16+x) */ + temp1 = extract_h( Lacc ); /* Qx */ + Lacc1 = L_msu_o( Lacc1, AP2_STEEP_FX[0], temp1, &Overflow ); /* Q(16+x) */ mem[ALLPASSSECTIONS_STEEP] = extract_h( Lacc1 ); temp[0] = temp1; move16(); - Lacc1 = L_deposit_h( mem[ALLPASSSECTIONS_STEEP + 1] ); /* Q(16+x) */ + Lacc1 = L_deposit_h( mem[ALLPASSSECTIONS_STEEP + 1] ); /* Q(16+x) */ Lacc1 = L_mac_o( Lacc1, AP2_STEEP_FX[1], temp1, &Overflow ); /* Q(16+x) */ - temp2 = extract_h( Lacc1 ); /* Qx */ + temp2 = extract_h( Lacc1 ); /* Qx */ temp[1] = temp2; move16(); Lacc = L_msu_o( Lacc, AP2_STEEP_FX[1], temp2, &Overflow ); /* Q(16+x) */ - mem[ALLPASSSECTIONS_STEEP + 1] = extract_h( Lacc ); /* Qx */ + mem[ALLPASSSECTIONS_STEEP + 1] = extract_h( Lacc ); /* Qx */ move16(); - Lacc = L_deposit_h( mem[2 * ALLPASSSECTIONS_STEEP - 1] ); /* Q(16+x) */ + Lacc = L_deposit_h( mem[2 * ALLPASSSECTIONS_STEEP - 1] ); /* Q(16+x) */ Lacc = L_mac_o( Lacc, AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], temp2, &Overflow ); /* Q(16+x) temp[ALLPASSSECTIONS_STEEP-1] */ - temp[2] = extract_h( Lacc ); /* temp[2] in Qx */ + temp[2] = extract_h( Lacc ); /* temp[2] in Qx */ move16(); Lacc1 = L_msu_o( Lacc1, AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], temp[2], &Overflow ); /* Q(16+x) */ - mem[2 * ALLPASSSECTIONS_STEEP - 1] = extract_h( Lacc1 ); /* Qx */ + mem[2 * ALLPASSSECTIONS_STEEP - 1] = extract_h( Lacc1 ); /* Qx */ move16(); - sum = mult_r( out_fx[0], 16384 ); /* Qx */ + sum = mult_r( out_fx[0], 16384 ); /* Qx */ out_fx[0] = add_sat( sum, mult_r( temp[ALLPASSSECTIONS_STEEP - 1], 16384 ) ); /* Qx */ move16(); @@ -1018,11 +1018,11 @@ void Decimate_allpass_steep_fx( { - Lacc = L_deposit_h( mem[ALLPASSSECTIONS_STEEP] ); /* Q(16+x) */ + Lacc = L_deposit_h( mem[ALLPASSSECTIONS_STEEP] ); /* Q(16+x) */ Lacc = L_mac_o( Lacc, AP2_STEEP_FX[0], in_fx[2 * k - 1], &Overflow ); /* Q(16+x):temp[0] */ - Lacc1 = L_deposit_h( in_fx[2 * k - 1] ); /* Q(16+x) */ - temp1 = extract_h( Lacc ); /* Qx */ - Lacc1 = L_msu_o( Lacc1, AP2_STEEP_FX[0], temp1, &Overflow ); /* Q(16+x) */ + Lacc1 = L_deposit_h( in_fx[2 * k - 1] ); /* Q(16+x) */ + temp1 = extract_h( Lacc ); /* Qx */ + Lacc1 = L_msu_o( Lacc1, AP2_STEEP_FX[0], temp1, &Overflow ); /* Q(16+x) */ mem[ALLPASSSECTIONS_STEEP] = extract_h( Lacc1 ); /* Qx */ move16(); @@ -1030,20 +1030,20 @@ void Decimate_allpass_steep_fx( move16(); - Lacc1 = L_deposit_h( mem[ALLPASSSECTIONS_STEEP + 1] ); /* Q(16+x) */ + Lacc1 = L_deposit_h( mem[ALLPASSSECTIONS_STEEP + 1] ); /* Q(16+x) */ Lacc1 = L_mac_o( Lacc1, AP2_STEEP_FX[1], temp1, &Overflow ); /* Q(16+x) */ - temp2 = extract_h( Lacc1 ); /* Qx */ + temp2 = extract_h( Lacc1 ); /* Qx */ temp[1] = temp2; move16(); Lacc = L_msu_o( Lacc, AP2_STEEP_FX[1], temp2, &Overflow ); /* Q(16+x) */ - mem[ALLPASSSECTIONS_STEEP + 1] = extract_h( Lacc ); /* Qx */ + mem[ALLPASSSECTIONS_STEEP + 1] = extract_h( Lacc ); /* Qx */ - Lacc = L_deposit_h( mem[2 * ALLPASSSECTIONS_STEEP - 1] ); /* Q(16+x) */ - Lacc = L_mac_o( Lacc, AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], temp[1], &Overflow ); /* Q(16+x) temp[ALLPASSSECTIONS_STEEP-1] */ - temp[2] = extract_h( Lacc ); /*temp[2] in Qx */ + Lacc = L_deposit_h( mem[2 * ALLPASSSECTIONS_STEEP - 1] ); /* Q(16+x) */ + Lacc = L_mac_o( Lacc, AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], temp[1], &Overflow ); /* Q(16+x) temp[ALLPASSSECTIONS_STEEP-1] */ + temp[2] = extract_h( Lacc ); /*temp[2] in Qx */ Lacc1 = L_msu_o( Lacc1, AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], temp[2], &Overflow ); /* Q(16+x) */ - mem[2 * ALLPASSSECTIONS_STEEP - 1] = extract_h( Lacc1 ); /* Qx */ + mem[2 * ALLPASSSECTIONS_STEEP - 1] = extract_h( Lacc1 ); /* Qx */ sum = mult_r( out_fx[k], 16384 ); /* Qx */ @@ -1085,15 +1085,15 @@ void Interpolate_allpass_steep_fx( FOR( k = 0; k < N; k++ ) { - Lacc = L_deposit_h( mem[0] ); /* Q(16+x) */ + Lacc = L_deposit_h( mem[0] ); /* Q(16+x) */ Lacc = L_mac_o( Lacc, AP2_STEEP_FX[0], in_fx[k], &Overflow ); /* Q(16+x):temp[0] */ - Lacc1 = L_deposit_h( in_fx[k] ); /* Q(16+x) */ - temp1 = round_fx_o( Lacc, &Overflow ); /* Qx */ - Lacc1 = L_msu_o( Lacc1, AP2_STEEP_FX[0], temp1, &Overflow ); /* Q(16+x) */ + Lacc1 = L_deposit_h( in_fx[k] ); /* Q(16+x) */ + temp1 = round_fx_o( Lacc, &Overflow ); /* Qx */ + Lacc1 = L_msu_o( Lacc1, AP2_STEEP_FX[0], temp1, &Overflow ); /* Q(16+x) */ mem[0] = round_fx_o( Lacc1, &Overflow ); move16(); - Lacc1 = L_deposit_h( mem[1] ); /* Q(16+x) */ + Lacc1 = L_deposit_h( mem[1] ); /* Q(16+x) */ Lacc1 = ( L_mac_o( Lacc1, AP2_STEEP_FX[1], temp1, &Overflow ) ); /* Q(16+x):temp[1] */ Lacc = L_deposit_h( temp1 ); @@ -1103,7 +1103,7 @@ void Interpolate_allpass_steep_fx( move16(); Lacc1 = L_deposit_h( temp2 ); - Lacc = L_deposit_h( mem[ALLPASSSECTIONS_STEEP - 1] ); /* Q(16+x) */ + Lacc = L_deposit_h( mem[ALLPASSSECTIONS_STEEP - 1] ); /* Q(16+x) */ out_fx[2 * k + 1] = round_fx_o( L_mac_o( Lacc, AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], temp2, &Overflow ), &Overflow ); /* Qx format */ move16(); mem[ALLPASSSECTIONS_STEEP - 1] = round_fx_o( L_msu_o( Lacc1, AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1], out_fx[2 * k + 1], &Overflow ), &Overflow ); /* Qx */ @@ -1114,14 +1114,14 @@ void Interpolate_allpass_steep_fx( FOR( k = 0; k < N; k++ ) { - Lacc = L_deposit_h( mem[ALLPASSSECTIONS_STEEP] ); /* Q(16+x) */ + Lacc = L_deposit_h( mem[ALLPASSSECTIONS_STEEP] ); /* Q(16+x) */ Lacc = L_mac_o( Lacc, AP1_STEEP_FX[0], in_fx[k], &Overflow ); /* Q(16+x):temp[0] */ - Lacc1 = L_deposit_h( in_fx[k] ); /* Q(16+x) */ - temp1 = round_fx_o( Lacc, &Overflow ); /* Qx */ - Lacc1 = L_msu_o( Lacc1, AP1_STEEP_FX[0], temp1, &Overflow ); /* Q(16+x) */ + Lacc1 = L_deposit_h( in_fx[k] ); /* Q(16+x) */ + temp1 = round_fx_o( Lacc, &Overflow ); /* Qx */ + Lacc1 = L_msu_o( Lacc1, AP1_STEEP_FX[0], temp1, &Overflow ); /* Q(16+x) */ mem[ALLPASSSECTIONS_STEEP] = round_fx_o( Lacc1, &Overflow ); - Lacc1 = L_deposit_h( mem[ALLPASSSECTIONS_STEEP + 1] ); /* Q(16+x) */ + Lacc1 = L_deposit_h( mem[ALLPASSSECTIONS_STEEP + 1] ); /* Q(16+x) */ Lacc1 = L_mac_o( Lacc1, AP1_STEEP_FX[1], temp1, &Overflow ); /* Q(16+x):temp[1] */ temp2 = round_fx_o( Lacc1, &Overflow ); /* Qx */ diff --git a/lib_com/preemph_fx.c b/lib_com/preemph_fx.c index 46dc88cdf..0790f6c3f 100644 --- a/lib_com/preemph_fx.c +++ b/lib_com/preemph_fx.c @@ -98,14 +98,14 @@ void E_UTIL_f_preemph2( FOR( i = lg - 1; i > 0; i-- ) { - L_tmp = L_mult( signal[i], 16384 ); /* Qx + 15 */ + L_tmp = L_mult( signal[i], 16384 ); /* Qx + 15 */ L_tmp = L_msu0_o( L_tmp, signal[i - 1], mu, &Overflow ); /* Qx + 15 */ L_tmp = L_shl_o( L_tmp, add( shift, 1 ), &Overflow ); /* Qx + shift + 16 */ signal[i] = round_fx_o( L_tmp, &Overflow ); /* Qx + shift */ move16(); } - L_tmp = L_mult( signal[0], 16384 ); /* Qx + 15 */ + L_tmp = L_mult( signal[0], 16384 ); /* Qx + 15 */ L_tmp = L_msu0_o( L_tmp, *mem, mu, &Overflow ); /* Qx + 15 */ L_tmp = L_shl_o( L_tmp, add( shift, 1 ), &Overflow ); /* Qx + shift + 16 */ signal[0] = round_fx_o( L_tmp, &Overflow ); /* Qx + shift */ diff --git a/lib_com/pvq_com_fx.c b/lib_com/pvq_com_fx.c index 2c9f7bb3c..ed914f2a1 100644 --- a/lib_com/pvq_com_fx.c +++ b/lib_com/pvq_com_fx.c @@ -553,7 +553,7 @@ void fine_gain_quant_ivas_fx( tmp1 = sub( tmp1, exp1 ); L_tmp = L_Comp( tmp1, exp2 ); Mpy_32_16_ss( L_tmp, 24660, &L_tmp, &lsb ); /* 24660 = 20*log10(2) in Q12 */ /*16+12-15=13 */ - gain_db = round_fx_sat( L_shl_o( L_tmp, 17, &Overflow ) ); /* Q14 */ + gain_db = round_fx_sat( L_shl_o( L_tmp, 17, &Overflow ) ); /* Q14 */ idx = squant_fx( gain_db, &gain_dbq, finegain_fx[gbits - 1], gain_cb_size[gbits - 1] ); /* Q0 */ push_indice( hBstr, IND_PVQ_FINE_GAIN, idx, gbits ); diff --git a/lib_com/stab_est_fx.c b/lib_com/stab_est_fx.c index af21bf6fe..15cd254df 100644 --- a/lib_com/stab_est_fx.c +++ b/lib_com/stab_est_fx.c @@ -98,7 +98,7 @@ Word16 stab_est_fx( L_tmp = Mpy_32_16_1( L_tmp, tmp16 ); /* we now have sqrt(L_corr) Q24 (8+16)*/ exp2 = sub( 31 - 15, sub( exp1, exp2 ) ); /* for Q8 (because of -8^2 from Etot)*/ - L_tmp = L_shl( L_tmp, exp2 ); /* Q8 + Q16*/ + L_tmp = L_shl( L_tmp, exp2 ); /* Q8 + Q16*/ dev = extract_h( L_shl_sat( L_tmp, 3 ) ); /* Q(24+3-16) -> Q11 */ /*------------------------------------------------------------------------* diff --git a/lib_com/stat_noise_uv_mod_fx.c b/lib_com/stat_noise_uv_mod_fx.c index 7adc0f05b..67ca21cd2 100644 --- a/lib_com/stat_noise_uv_mod_fx.c +++ b/lib_com/stat_noise_uv_mod_fx.c @@ -160,7 +160,7 @@ void stat_noise_uv_mod_fx( { FOR( i_subfr = 0; i_subfr < L_FRAME; i_subfr += L_SUBFR ) { - exctilt = calc_tilt_fx( &Exc2_local[i_subfr], En_shift, L_SUBFR ); /*Q15 */ + exctilt = calc_tilt_fx( &Exc2_local[i_subfr], En_shift, L_SUBFR ); /*Q15 */ exctilt = mult( shl_o( sub( TILT_COMP_LIM_FX, min_alpha ), 2, &Overflow ), exctilt ); /*Q15 */ PREEMPH_FX( &Exc2_local[i_subfr], exctilt, L_SUBFR, exc_pe ); @@ -245,12 +245,12 @@ void stat_noise_uv_mod_fx( /* L_Ge might be 0 in unvoiced WB */ L_Ge = L_max( L_Ge, 1 ); tmp_shift = norm_l( L_Ge ); - tmp_den = extract_h( L_shl( L_Ge, tmp_shift ) ); /* Q_local+Q_ge+tmp_shift-16 */ - tmp_res = div_s( 1 << 14, tmp_den ); /* 15+14-Q_local-tmp_shift-Q_ge+16 */ - L_tmp_res = Mult_32_16( *ge_sm, tmp_res ); /* Q_stat_noise_ge+45-Q_local-Q_ge-tmp_shift-15 */ - L_tmp_res = Mult_32_16( L_tmp_res, sub( 32767, beta ) ); /*30-Q_local-tmp_shift+15-15 */ + tmp_den = extract_h( L_shl( L_Ge, tmp_shift ) ); /* Q_local+Q_ge+tmp_shift-16 */ + tmp_res = div_s( 1 << 14, tmp_den ); /* 15+14-Q_local-tmp_shift-Q_ge+16 */ + L_tmp_res = Mult_32_16( *ge_sm, tmp_res ); /* Q_stat_noise_ge+45-Q_local-Q_ge-tmp_shift-15 */ + L_tmp_res = Mult_32_16( L_tmp_res, sub( 32767, beta ) ); /*30-Q_local-tmp_shift+15-15 */ L_tmp_res = L_add_sat( L_shl_sat( L_tmp_res, sub( add( Q_local, tmp_shift ), 15 ) ), beta ); /* Q15 */ - tmp_res = extract_h( L_shl_o( L_tmp_res, 15, &Overflow ) ); /* 15+15-16=14 */ + tmp_res = extract_h( L_shl_o( L_tmp_res, 15, &Overflow ) ); /* 15+15-16=14 */ Noimix_fract = extract_l( Mult_32_16( L_tmp_res, Noimix_fract ) ); /*15+15-15 */ @@ -268,11 +268,11 @@ void stat_noise_uv_mod_fx( randval = mult_r( 28378, randval ); /* Q downscaled by 2 bits ends up in Q14 */ /*sqrt(12.0f) in Q13*/ randval = extract_l( L_shl( Mult_32_16( L_Ge, randval ), 1 - *Q_stat_noise_ge ) ); /*Q_local+Q_ge+14-15+1-Q_ge=Q_local */ - L_tmp = L_mult( Exc2_local[i], alpha ); /* Q_local + 16 */ - L_tmp = L_mac( L_tmp, randval, alpha_m1 ); /* Q_local + 16 */ - L_tmp3 = Mult_32_16( L_tmp, Noimix_fract ); /* Q_local+16+15-15 */ + L_tmp = L_mult( Exc2_local[i], alpha ); /* Q_local + 16 */ + L_tmp = L_mac( L_tmp, randval, alpha_m1 ); /* Q_local + 16 */ + L_tmp3 = Mult_32_16( L_tmp, Noimix_fract ); /* Q_local+16+15-15 */ L_tmp = L_add_sat( L_tmp3, L_shl_sat( Mult_32_16( L_tmp, tmp_res ), 1 ) ); /* Q_local+16+14-15+1 */ - Exc2_local[i] = extract_h( L_tmp ); /*Q_local */ + Exc2_local[i] = extract_h( L_tmp ); /*Q_local */ move16(); } *Q_stat_noise = Q_local; /* update for next call, routine can only be called once every frame */ @@ -465,7 +465,7 @@ void stat_noise_uv_mod_ivas_fx( { FOR( i_subfr = 0; i_subfr < L_FRAME; i_subfr += L_SUBFR ) { - exctilt = calc_tilt_fx( &Exc2_local[i_subfr], En_shift, L_SUBFR ); /*Q15 */ + exctilt = calc_tilt_fx( &Exc2_local[i_subfr], En_shift, L_SUBFR ); /*Q15 */ exctilt = mult( shl_o( sub( TILT_COMP_LIM_FX, min_alpha ), 2, &Overflow ), exctilt ); /*Q15 */ PREEMPH_FX( &Exc2_local[i_subfr], exctilt, L_SUBFR, exc_pe ); @@ -550,12 +550,12 @@ void stat_noise_uv_mod_ivas_fx( /* L_Ge might be 0 in unvoiced WB */ L_Ge = L_max( L_Ge, 1 ); tmp_shift = norm_l( L_Ge ); - tmp_den = extract_h( L_shl( L_Ge, tmp_shift ) ); /* Q_local+Q_ge+tmp_shift-16 */ - tmp_res = div_s( 1 << 14, tmp_den ); /* 15+14-Q_local-tmp_shift-Q_ge+16 */ - L_tmp_res = Mult_32_16( *ge_sm, tmp_res ); /* Q_stat_noise_ge+45-Q_local-Q_ge-tmp_shift-15 */ - L_tmp_res = Mult_32_16( L_tmp_res, sub( 32767, beta ) ); /*30-Q_local-tmp_shift+15-15 */ + tmp_den = extract_h( L_shl( L_Ge, tmp_shift ) ); /* Q_local+Q_ge+tmp_shift-16 */ + tmp_res = div_s( 1 << 14, tmp_den ); /* 15+14-Q_local-tmp_shift-Q_ge+16 */ + L_tmp_res = Mult_32_16( *ge_sm, tmp_res ); /* Q_stat_noise_ge+45-Q_local-Q_ge-tmp_shift-15 */ + L_tmp_res = Mult_32_16( L_tmp_res, sub( 32767, beta ) ); /*30-Q_local-tmp_shift+15-15 */ L_tmp_res = L_add_sat( L_shl_sat( L_tmp_res, sub( add( Q_local, tmp_shift ), 15 ) ), beta ); /* Q15 */ - tmp_res = extract_h( L_shl_o( L_tmp_res, 15, &Overflow ) ); /* 15+15-16=14 */ + tmp_res = extract_h( L_shl_o( L_tmp_res, 15, &Overflow ) ); /* 15+15-16=14 */ Noimix_fract = extract_l( Mult_32_16( L_tmp_res, Noimix_fract ) ); /*15+15-15 */ @@ -573,11 +573,11 @@ void stat_noise_uv_mod_ivas_fx( randval = mult_r( 28378, randval ); /* Q downscaled by 2 bits ends up in Q14 */ /*sqrt(12.0f) in Q13*/ randval = extract_l( L_shl( Mult_32_16( L_Ge, randval ), sub( 1, *Q_stat_noise_ge ) ) ); /*Q_local+Q_ge+14-15+1-Q_ge=Q_local */ - L_tmp = L_mult( Exc2_local[i], alpha ); /* Q_local + 16 */ - L_tmp = L_mac( L_tmp, randval, alpha_m1 ); /* Q_local + 16 */ - L_tmp3 = Mult_32_16( L_tmp, Noimix_fract ); /* Q_local+16+15-15 */ + L_tmp = L_mult( Exc2_local[i], alpha ); /* Q_local + 16 */ + L_tmp = L_mac( L_tmp, randval, alpha_m1 ); /* Q_local + 16 */ + L_tmp3 = Mult_32_16( L_tmp, Noimix_fract ); /* Q_local+16+15-15 */ L_tmp = L_add_sat( L_tmp3, L_shl_sat( Mult_32_16( L_tmp, tmp_res ), 1 ) ); /* Q_local+16+14-15+1 */ - Exc2_local[i] = extract_h( L_tmp ); /*Q_local */ + Exc2_local[i] = extract_h( L_tmp ); /*Q_local */ move16(); } *Q_stat_noise = Q_local; /* update for next call, routine can only be called once every frame */ diff --git a/lib_com/swb_bwe_com_fx.c b/lib_com/swb_bwe_com_fx.c index 5ae5dee71..303d453f1 100644 --- a/lib_com/swb_bwe_com_fx.c +++ b/lib_com/swb_bwe_com_fx.c @@ -195,7 +195,7 @@ Word16 WB_BWE_gain_pred_fx( L_tmp = L_deposit_h( tmp ); L_tmp = Isqrt_lc( L_tmp, &exp ); enerL_16 = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 15 ) ) ); /* Q0 */ - enerL_40 = mult_r( 6554 /* 0.2 in Q15 */, enerL_16 ); /*1/40 in Q18 ->Q3 */ + enerL_40 = mult_r( 6554 /* 0.2 in Q15 */, enerL_16 ); /*1/40 in Q18 ->Q3 */ test(); test(); @@ -209,8 +209,8 @@ Word16 WB_BWE_gain_pred_fx( IF( WB_fenv[0] != 0 ) { exp = norm_s( WB_fenv[0] ); - tmp = div_s( shl( 1, sub( 14, exp ) ), WB_fenv[0] ); /*Q(29-exp-3) */ - L_tmp = L_mult( enerL_40, tmp ); /*Q(30-exp) */ + tmp = div_s( shl( 1, sub( 14, exp ) ), WB_fenv[0] ); /*Q(29-exp-3) */ + L_tmp = L_mult( enerL_40, tmp ); /*Q(30-exp) */ tmp = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 2 ) ) ); /*Q12 */ tmp = s_min( tmp, 16384 /*4 in Q12*/ ); L_tmp = L_shr( L_mult0( tmp, WB_fenv[0] ), 12 ); /*Q15 */ @@ -230,8 +230,8 @@ Word16 WB_BWE_gain_pred_fx( tmp1 = extract_l( L_shr( L_tmp, 13 ) ); exp = norm_s( pitch ); - tmp = div_s( shl( 1, sub( 14, exp ) ), pitch ); /*Q(29-exp-5) */ - L_tmp = L_mult0( tmp1, tmp ); /*29-exp-5->24-exp */ + tmp = div_s( shl( 1, sub( 14, exp ) ), pitch ); /*Q(29-exp-5) */ + L_tmp = L_mult0( tmp1, tmp ); /*29-exp-5->24-exp */ tmp = round_fx_sat( L_shl_sat( L_tmp, add( exp, 6 ) ) ); /*14 */ tmp1 = s_max( tmp, 8192 /* 0.5 in Q14 */ ); alfa = s_min( 24576 /* 1.5 in Q14 */, tmp1 ); /*Q14 */ @@ -241,8 +241,8 @@ Word16 WB_BWE_gain_pred_fx( tmp = extract_l( L_tmp ); enerL = L_deposit_l( enerL_16 ); - enerL = L_shl( enerL, 6 ); /*Q6 */ - tmp1 = i_mult_sat( 3, WB_fenv[0] ); /*Q3 */ + enerL = L_shl( enerL, 6 ); /*Q6 */ + tmp1 = i_mult_sat( 3, WB_fenv[0] ); /*Q3 */ L_tmp = L_mult0( tmp1, WB_fenv[0] ); /*Q6 */ test(); @@ -255,8 +255,8 @@ Word16 WB_BWE_gain_pred_fx( enerL_64 = mult_r( 4096, enerL_16 ); /* 1/64 in Q18 ->Q3 */ exp = norm_s( WB_fenv[0] ); - tmp = div_s( shl( 1, sub( 14, exp ) ), WB_fenv[0] ); /*Q(29-exp-3) */ - L_tmp = L_mult( enerL_64, tmp ); /*Q(30-exp) */ + tmp = div_s( shl( 1, sub( 14, exp ) ), WB_fenv[0] ); /*Q(29-exp-3) */ + L_tmp = L_mult( enerL_64, tmp ); /*Q(30-exp) */ tmp = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 2 ) ) ); /*Q12 */ tmp = s_min( tmp, 16384 /*4 in Q12*/ ); L_tmp = L_shr( L_mult0( tmp, WB_fenv[0] ), 12 ); /*Q3 */ @@ -291,7 +291,7 @@ Word16 WB_BWE_gain_pred_fx( tmp = s_min( s_max( tmp1, 16 /* 0.125 in Q7 */ ), 256 /* 1 in Q7 */ ); /*Q7 */ L_tmp = L_shr( L_mult0( WB_fenv[0], tmp ), 7 ); /*Q3 */ /*WB_fenv[0] = saturate(L_tmp); //Q3 */ - WB_fenv[0] = round_fx_sat( L_shl_sat( L_tmp, 16 ) ); /*Q3 */ + WB_fenv[0] = round_fx_sat( L_shl_sat( L_tmp, 16 ) ); /*Q3 */ move16(); } test(); @@ -1552,7 +1552,7 @@ void SWB_BWE_decoding_fx( ELSE IF( LT_16( tmp2, tmp1 ) ) { exp = norm_s( tmp1 ); - tmp = div_s( shl( 1, sub( 14, exp ) ), tmp1 ); /*Q(29-exp) */ + tmp = div_s( shl( 1, sub( 14, exp ) ), tmp1 ); /*Q(29-exp) */ tmp3 = round_fx_sat( L_shl_sat( L_mult( tmp2, tmp ), add( exp, 2 ) ) ); /*Q15 */ WHILE( LT_16( tmp3, 32767 ) ) { @@ -1596,7 +1596,7 @@ void SWB_BWE_decoding_fx( ELSE IF( LT_16( tmp2, tmp1 ) ) { exp = norm_s( tmp1 ); - tmp = div_s( shl( 1, sub( 14, exp ) ), tmp1 ); /*Q(29-exp) */ + tmp = div_s( shl( 1, sub( 14, exp ) ), tmp1 ); /*Q(29-exp) */ tmp3 = round_fx_sat( L_shl_sat( L_mult( tmp2, tmp ), add( exp, 2 ) ) ); /*Q15 */ WHILE( LT_16( tmp3, 32767 ) ) { @@ -1867,7 +1867,7 @@ FOR( n_band = 0; n_band < 12; n_band++ ) { L_tmp1 = Mult_32_16( SWB_signal_32[n_freq], factor ); SWB_signal_32[n_freq] = L_shl_sat( L_tmp1, tmp - 1 ); - move32(); /*15+Qsyn */ + move32(); /*15+Qsyn */ factor = add_sat( factor, factor1 ); /*Q1 */ } } @@ -2269,10 +2269,10 @@ void time_reduce_pre_echo_fx( move16(); FOR( i = 0; i < L; i++ ) { - tmpi = round_fx( L_shl( L_mult( i, inv_L ), add( 1, exp_L ) ) ); /*Q15 */ - L_tmp = L_sub( L_tmp1, Ltmp_ener ); /*Q(30-exp) */ - L_tmp = Mult_32_16( L_tmp, tmpi ); /*Q(30-exp) */ - L_tmp = L_add( Ltmp_ener, L_tmp ); /*Q(30-exp) */ + tmpi = round_fx( L_shl( L_mult( i, inv_L ), add( 1, exp_L ) ) ); /*Q15 */ + L_tmp = L_sub( L_tmp1, Ltmp_ener ); /*Q(30-exp) */ + L_tmp = Mult_32_16( L_tmp, tmpi ); /*Q(30-exp) */ + L_tmp = L_add( Ltmp_ener, L_tmp ); /*Q(30-exp) */ tmp = round_fx_sat( L_shl_sat( Mult_32_16( L_tmp, *pit ), add( 1, exp ) ) ); /*Q0 */ *pit++ = tmp; move16(); @@ -2540,7 +2540,7 @@ void hq_generic_decoding_fx( #endif tmp = div_s( 16384, frac ); /*15 + 14 - (cs+exp-16) */ exp = sub( add( cs, exp ), 30 ); - L_tmp = Isqrt_lc( L_deposit_h( tmp ), &exp ); /*Q31 - exp */ + L_tmp = Isqrt_lc( L_deposit_h( tmp ), &exp ); /*Q31 - exp */ fenvL_fx = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 14 ) ) ); /*Q1 */ } @@ -2842,7 +2842,7 @@ void hq_generic_decoding_fx( exp2 = sub( norm_l( L_tmp2 ), 1 ); tmp1_fx = extract_h( L_shl( L_tmp1, exp1 ) ); tmp2_fx = extract_h( L_shl( L_tmp2, exp2 ) ); - tmp3_fx = div_s( tmp2_fx, tmp1_fx ); /*15 + exp2 + 15 - (exp1 + 15) */ + tmp3_fx = div_s( tmp2_fx, tmp1_fx ); /*15 + exp2 + 15 - (exp1 + 15) */ tmp3_fx = shr_sat( tmp3_fx, add( 5, sub( exp2, exp1 ) ) ); /*10 */ if ( LT_16( tmp3_fx, 307 /* 0.3 in Q10*/ ) ) { diff --git a/lib_com/swb_bwe_com_lr_fx.c b/lib_com/swb_bwe_com_lr_fx.c index e3b2c6d5f..7c2c35551 100644 --- a/lib_com/swb_bwe_com_lr_fx.c +++ b/lib_com/swb_bwe_com_lr_fx.c @@ -3235,107 +3235,105 @@ void noiseinj_hf_fx( move32(); IF( p2a_flags_fx[k] == 0 ) { - FOR( i = band_start_fx[k]; i <= band_end_fx[k]; i++ ) - { - IF( LE_32( L_abs( L_xSynth_har[i - fLenLow_fx] ), L_th_g[k - ( BANDS_fx - NB_SWB_SUBBANDS )] ) ) - { - *p_L_En = L_mac( *p_L_En, xSynth_har_fx[i - fLenLow_fx], xSynth_har_fx[i - fLenLow_fx] ); - move32(); - } - ELSE - { - map_pulse_t_fx[i] = 1; - move16(); - } - } - *p_L_En = L_shl_sat( *p_L_En, sub( QbeL, QE ) ); + FOR( i = band_start_fx[k]; i <= band_end_fx[k]; i++ ){ + IF( LE_32( L_abs( L_xSynth_har[i - fLenLow_fx] ), L_th_g[k - ( BANDS_fx - NB_SWB_SUBBANDS )] ) ){ + *p_L_En = L_mac( *p_L_En, xSynth_har_fx[i - fLenLow_fx], xSynth_har_fx[i - fLenLow_fx] ); move32(); - /**p_L_En = (float)sqrt(*p_En);*/ - sqrt_32n_16_fx( *p_L_En, QbeL, p_sqrt_En_fx, &Qtemp ); - *p_sqrt_En_fx = shl_o( *p_sqrt_En_fx, sub( QsEn, Qtemp ), &Overflow ); /* -> Q2 */ + } + ELSE + { + map_pulse_t_fx[i] = 1; move16(); } - p_L_En++; - p_sqrt_En_fx++; } + *p_L_En = L_shl_sat( *p_L_En, sub( QbeL, QE ) ); + move32(); + /**p_L_En = (float)sqrt(*p_En);*/ + sqrt_32n_16_fx( *p_L_En, QbeL, p_sqrt_En_fx, &Qtemp ); + *p_sqrt_En_fx = shl_o( *p_sqrt_En_fx, sub( QsEn, Qtemp ), &Overflow ); /* -> Q2 */ + move16(); +} +p_L_En++; +p_sqrt_En_fx++; +} - p_sqrt_En_fx = sqrt_En_fx; - p_Enn_sm_sb_fx = Enn_sm_sb_fx; - p_prev_En_sb_fx = prev_En_sb_fx; - FOR( k = BANDS_fx - NB_SWB_SUBBANDS; k < BANDS_fx; k++ ) +p_sqrt_En_fx = sqrt_En_fx; +p_Enn_sm_sb_fx = Enn_sm_sb_fx; +p_prev_En_sb_fx = prev_En_sb_fx; +FOR( k = BANDS_fx - NB_SWB_SUBBANDS; k < BANDS_fx; k++ ) +{ + *p_Enn_sm_sb_fx = prev_En_sb_fx[k - ( BANDS_fx - NB_SWB_SUBBANDS )]; + move16(); /* QsEn */ + IF( p2a_flags_fx[k] == 0 ) { - *p_Enn_sm_sb_fx = prev_En_sb_fx[k - ( BANDS_fx - NB_SWB_SUBBANDS )]; - move16(); /* QsEn */ - IF( p2a_flags_fx[k] == 0 ) + L_temp = Mult_32_16( L_band_energy[k], 26214 ); /* 0.8: 26214(Q15) */ + temp_fx = round_fx( L_shl( L_temp, sub( QsEn, sub( Qbe, 16 ) ) ) ); + IF( LT_16( *p_prev_En_sb_fx, temp_fx ) ) { - L_temp = Mult_32_16( L_band_energy[k], 26214 ); /* 0.8: 26214(Q15) */ - temp_fx = round_fx( L_shl( L_temp, sub( QsEn, sub( Qbe, 16 ) ) ) ); - IF( LT_16( *p_prev_En_sb_fx, temp_fx ) ) - { - /**p_Enn_sm_sb = (0.15f*(*p_En)) + (0.85f*prev_En_sb[k-(BANDS-NB_SWB_SUBBANDS)]);*/ - /* 0.15: 4915.2(Q15) 0.85: 27852.80(Q15) */ - *p_Enn_sm_sb_fx = round_fx( L_mac( L_mult( *p_sqrt_En_fx, 4915 ), *p_prev_En_sb_fx, 27853 ) ); - } - ELSE - { - /**p_Enn_sm_sb = (0.8f*(*p_En)) + (0.2f*prev_En_sb[k-(BANDS-NB_SWB_SUBBANDS)]);*/ - /* 0.8: 26214.4(Q15) 0.2:6553.6(Q15) */ - *p_Enn_sm_sb_fx = round_fx( L_mac( L_mult( *p_sqrt_En_fx, 26214 ), *p_prev_En_sb_fx, 6554 ) ); - } - move16(); + /**p_Enn_sm_sb = (0.15f*(*p_En)) + (0.85f*prev_En_sb[k-(BANDS-NB_SWB_SUBBANDS)]);*/ + /* 0.15: 4915.2(Q15) 0.85: 27852.80(Q15) */ + *p_Enn_sm_sb_fx = round_fx( L_mac( L_mult( *p_sqrt_En_fx, 4915 ), *p_prev_En_sb_fx, 27853 ) ); } - - p_Enn_sm_sb_fx++; - p_sqrt_En_fx++; - p_prev_En_sb_fx++; + ELSE + { + /**p_Enn_sm_sb = (0.8f*(*p_En)) + (0.2f*prev_En_sb[k-(BANDS-NB_SWB_SUBBANDS)]);*/ + /* 0.8: 26214.4(Q15) 0.2:6553.6(Q15) */ + *p_Enn_sm_sb_fx = round_fx( L_mac( L_mult( *p_sqrt_En_fx, 26214 ), *p_prev_En_sb_fx, 6554 ) ); + } + move16(); } - p_sqrt_En_fx = sqrt_En_fx; - p_Enn_sm_sb_fx = Enn_sm_sb_fx; - p_prev_En_sb_fx = prev_En_sb_fx; - map_pulse_fx[fLenLow_fx] = ( map_pulse_t_fx[fLenLow_fx] | map_pulse_t_fx[fLenLow_fx + 1] ); + p_Enn_sm_sb_fx++; + p_sqrt_En_fx++; + p_prev_En_sb_fx++; +} + +p_sqrt_En_fx = sqrt_En_fx; +p_Enn_sm_sb_fx = Enn_sm_sb_fx; +p_prev_En_sb_fx = prev_En_sb_fx; +map_pulse_fx[fLenLow_fx] = ( map_pulse_t_fx[fLenLow_fx] | map_pulse_t_fx[fLenLow_fx + 1] ); +logic16(); +move16(); +FOR( i = fLenLow_fx + 1; i < band_end_fx[BANDS_fx - 1]; i++ ) +{ + map_pulse_fx[i] = ( map_pulse_t_fx[i - 1] | map_pulse_t_fx[i] | map_pulse_t_fx[i + 1] ); logic16(); - move16(); - FOR( i = fLenLow_fx + 1; i < band_end_fx[BANDS_fx - 1]; i++ ) - { - map_pulse_fx[i] = ( map_pulse_t_fx[i - 1] | map_pulse_t_fx[i] | map_pulse_t_fx[i + 1] ); - logic16(); - logic16(); - move16(); - } - map_pulse_fx[i] = ( map_pulse_t_fx[i - 1] | map_pulse_t_fx[i] ); logic16(); move16(); +} +map_pulse_fx[i] = ( map_pulse_t_fx[i - 1] | map_pulse_t_fx[i] ); +logic16(); +move16(); - FOR( k = BANDS_fx - NB_SWB_SUBBANDS; k < BANDS_fx; k++ ) +FOR( k = BANDS_fx - NB_SWB_SUBBANDS; k < BANDS_fx; k++ ) +{ + test(); + IF( p2a_flags_fx[k] == 0 && *p_sqrt_En_fx != 0x0 ) { - test(); - IF( p2a_flags_fx[k] == 0 && *p_sqrt_En_fx != 0x0 ) - { - /*ni_scale = sqrt((*p_Enn_sm_sb)/(*p_En));*/ - /* Div Part */ - exp_normn = norm_s( *p_Enn_sm_sb_fx ); - exp_normn = sub( exp_normn, 1 ); - exp_normd = norm_s( *p_sqrt_En_fx ); - div_fx = div_s( shl( *p_Enn_sm_sb_fx, exp_normn ), shl( *p_sqrt_En_fx, exp_normd ) ); - Qdiv = add( sub( exp_normn, exp_normd ), 15 ); - - /* SQRT Part */ - sqrt_32n_16_fx( L_deposit_h( div_fx ), add( Qdiv, 16 ), &ni_scale_fx, &Qtemp ); - ni_scale_fx = shl_o( ni_scale_fx, sub( 14, Qtemp ), &Overflow ); - ni_scale_fx = s_min( 20408, ni_scale_fx ); /* 1.25=20408.0(Q14) */ - - ni_scale_fx = s_max( 12288, ni_scale_fx ); /* 0.75=12288.0(Q14) */ - - ni_scale_fx = mult_r( ni_scale_fx, 26214 ); /* 0.8=26214.4(Q15) -> Q14 */ - FOR( i = band_start_fx[k]; i <= band_end_fx[k]; i++ ){ - IF( LE_32( L_abs( L_xSynth_har[i - fLenLow_fx] ), L_th_g[k - ( BANDS_fx - NB_SWB_SUBBANDS )] ) ){ - IF( map_pulse_fx[i] == 0 ){ - L_xSynth_har[i - fLenLow_fx] = L_shl( Mult_32_16( L_xSynth_har[i - fLenLow_fx], ni_scale_fx ), 1 ); /* Q12+Q14-15-1 = Q12 */ - move32(); - } + /*ni_scale = sqrt((*p_Enn_sm_sb)/(*p_En));*/ + /* Div Part */ + exp_normn = norm_s( *p_Enn_sm_sb_fx ); + exp_normn = sub( exp_normn, 1 ); + exp_normd = norm_s( *p_sqrt_En_fx ); + div_fx = div_s( shl( *p_Enn_sm_sb_fx, exp_normn ), shl( *p_sqrt_En_fx, exp_normd ) ); + Qdiv = add( sub( exp_normn, exp_normd ), 15 ); + + /* SQRT Part */ + sqrt_32n_16_fx( L_deposit_h( div_fx ), add( Qdiv, 16 ), &ni_scale_fx, &Qtemp ); + ni_scale_fx = shl_o( ni_scale_fx, sub( 14, Qtemp ), &Overflow ); + ni_scale_fx = s_min( 20408, ni_scale_fx ); /* 1.25=20408.0(Q14) */ + + ni_scale_fx = s_max( 12288, ni_scale_fx ); /* 0.75=12288.0(Q14) */ + + ni_scale_fx = mult_r( ni_scale_fx, 26214 ); /* 0.8=26214.4(Q15) -> Q14 */ + FOR( i = band_start_fx[k]; i <= band_end_fx[k]; i++ ){ + IF( LE_32( L_abs( L_xSynth_har[i - fLenLow_fx] ), L_th_g[k - ( BANDS_fx - NB_SWB_SUBBANDS )] ) ){ + IF( map_pulse_fx[i] == 0 ){ + L_xSynth_har[i - fLenLow_fx] = L_shl( Mult_32_16( L_xSynth_har[i - fLenLow_fx], ni_scale_fx ), 1 ); /* Q12+Q14-15-1 = Q12 */ + move32(); } } +} *p_prev_En_sb_fx = *p_Enn_sm_sb_fx; move16(); } diff --git a/lib_com/swb_tbe_com_fx.c b/lib_com/swb_tbe_com_fx.c index 0299e3a9c..c2df1e562 100644 --- a/lib_com/swb_tbe_com_fx.c +++ b/lib_com/swb_tbe_com_fx.c @@ -1082,8 +1082,8 @@ static void scale_st_swb( temp = mult_r( agc_fac_para_fx, gain_fx ); /*15 +14 -15 =14 */ gain_fx = add( temp, g0_fx ); /* in Q14 */ L_temp = L_mult( gain_fx, sig_out_fx[i] ); /*14 + Q_bwe_exc-1 +1 = 14 + Q_bwe_exc */ - L_temp = L_shl_sat( L_temp, 1 ); /*14 + Q_bwe_exc +1 */ - sig_out_fx[i] = round_fx_sat( L_temp ); /*Q_bwe_exc +15 -16 = Q_bwe_exc-1 */ + L_temp = L_shl_sat( L_temp, 1 ); /*14 + Q_bwe_exc +1 */ + sig_out_fx[i] = round_fx_sat( L_temp ); /*Q_bwe_exc +15 -16 = Q_bwe_exc-1 */ move16(); } *gain_prec_fx = gain_fx; @@ -1483,7 +1483,7 @@ void GenShapedWBExcitation_ivas_fx( FOR( i = 0; i < L_FRAME16k / 4; i++ ) { excTmp2_frac[i] = shl_o( excTmp2[i], n1, &Overflow ); // Q_bwe_exc + n1 - move16(); /* Q14 */ + move16(); /* Q14 */ } n1 = sub( sub( 14, n1 ), Q_bwe_exc ); pow1 = 1; @@ -1575,7 +1575,7 @@ void GenShapedWBExcitation_ivas_fx( Ltemp1 = root_a_fx( L_deposit_h( tmp_vfac ), 31, &exp ); temp1 = round_fx_o( L_shl_o( Ltemp1, exp, &Overflow ), &Overflow ); /* Q15 */ - L_tmp = Mult_32_16( pow1, sub( 32767, tmp_vfac ) ); /* Q22*/ + L_tmp = Mult_32_16( pow1, sub( 32767, tmp_vfac ) ); /* Q22*/ Ltemp2 = root_a_over_b_fx( L_tmp, sub( 19, shl( n1, 1 ) ), pow22, sub( 19, shl( n2, 1 ) ), &exp ); temp2 = round_fx_o( L_shl_o( Ltemp2, exp, &Overflow ), &Overflow ); /* Q15 */ FOR( j = 0; j < L_FRAME16k / 16; j++ ) @@ -1824,7 +1824,7 @@ void GenShapedWBExcitation_fx( Ltemp1 = root_a_fx( L_deposit_h( tmp_vfac ), 31, &exp ); temp1 = round_fx_o( L_shl_o( Ltemp1, exp, &Overflow ), &Overflow ); /* Q15 */ - L_tmp = Mpy_32_16_1( pow1, sub( 32767, tmp_vfac ) ); /* Q22*/ + L_tmp = Mpy_32_16_1( pow1, sub( 32767, tmp_vfac ) ); /* Q22*/ Ltemp2 = root_a_over_b_fx( L_tmp, sub( 22, shl( n1, 1 ) ), pow22, sub( 22, shl( n2, 1 ) ), &exp ); temp2 = round_fx_o( L_shl_o( Ltemp2, exp, &Overflow ), &Overflow ); /* Q15 */ FOR( j = 0; j < L_FRAME16k / 16; j++ ) @@ -2668,7 +2668,7 @@ void GenShapedSHBExcitation_fx( { /*exc16kWhtnd[k+j] = temp1 * exc16kWhtnd[k+j] + temp2 * White_exc16k[k+j]; */ L_tmp = L_mult( temp2, White_exc16k[k + j] ); /* 16+(Q_bwe_exc-NOISE_QADJ)*/ - L_tmp = L_shl_sat( L_tmp, NOISE_QADJ ); /* 16+(Q_bwe_exc) */ + L_tmp = L_shl_sat( L_tmp, NOISE_QADJ ); /* 16+(Q_bwe_exc) */ exc16kWhtnd[k + j] = mac_r_sat( L_tmp, temp1, exc16kWhtnd[k + j] ); move16(); /* Q_bwe_exc */ @@ -3718,7 +3718,7 @@ void GenShapedSHBExcitation_ivas_enc_fx( { /*exc16kWhtnd[k+j] = temp1 * exc16kWhtnd[k+j] + temp2 * White_exc16k[k+j]; */ L_tmp = L_mult( temp2, White_exc16k[k + j] ); /* 16+(Q_bwe_exc-NOISE_QADJ)*/ - L_tmp = L_shl_sat( L_tmp, NOISE_QADJ ); /* 16+(Q_bwe_exc) */ + L_tmp = L_shl_sat( L_tmp, NOISE_QADJ ); /* 16+(Q_bwe_exc) */ exc16kWhtnd[k + j] = mac_r_sat( L_tmp, temp1, exc16kWhtnd[k + j] ); move16(); /* Q_bwe_exc */ @@ -4792,7 +4792,7 @@ void GenShapedSHBExcitation_ivas_dec_fx( { /*exc16kWhtnd[k+j] = temp1 * exc16kWhtnd[k+j] + temp2 * White_exc16k[k+j]; */ L_tmp = L_mult( temp2, White_exc16k[k + j] ); /* 16+(Q_bwe_exc-NOISE_QADJ)*/ - L_tmp = L_shl_sat( L_tmp, NOISE_QADJ ); /* 16+(Q_bwe_exc) */ + L_tmp = L_shl_sat( L_tmp, NOISE_QADJ ); /* 16+(Q_bwe_exc) */ exc16kWhtnd[k + j] = mac_r_sat( L_tmp, temp1, exc16kWhtnd[k + j] ); move16(); /* Q_bwe_exc */ @@ -5479,7 +5479,7 @@ void ScaleShapedWB_fx( FOR( i = 0; i < l_shb_lahead; i++ ) { /* mod_syn in (16+Q_bwe_exc), frame_gain in Q18 */ - L_tmp = Mult_32_32( mod_syn[i], frame_gain ); /* L_tmp in (Q_bwe_exc+3) */ + L_tmp = Mult_32_32( mod_syn[i], frame_gain ); /* L_tmp in (Q_bwe_exc+3) */ synSHB[i] = round_fx_sat( L_shl_sat( Mult_32_16( L_tmp, win[i] ), shift ) ); /* Qx */ move16(); synSHB[i] = add_sat( synSHB[i], overlap[i] ); @@ -5490,7 +5490,7 @@ void ScaleShapedWB_fx( FOR( ; i < l_frame; i++ ) { - L_tmp = Mult_32_32( mod_syn[i], frame_gain ); /* L_tmp in (Q_bwe_exc+3) */ + L_tmp = Mult_32_32( mod_syn[i], frame_gain ); /* L_tmp in (Q_bwe_exc+3) */ synSHB[i] = round_fx_sat( L_shl_sat( L_tmp, shift ) ); /* Qx; */ move16(); } @@ -5498,7 +5498,7 @@ void ScaleShapedWB_fx( l_frame_tmp = add( l_frame, l_shb_lahead ); FOR( ; i < l_frame_tmp; i++ ) { - L_tmp = Mult_32_32( mod_syn[i], frame_gain ); /* (Q_bwe_exc+3) */ + L_tmp = Mult_32_32( mod_syn[i], frame_gain ); /* (Q_bwe_exc+3) */ overlap[i - l_frame] = round_fx_sat( L_shl_sat( Mult_32_16( L_tmp, win[l_frame + l_shb_lahead - 1 - i] ), shift ) ); /* Qx */ move16(); } @@ -5530,7 +5530,7 @@ static Word32 non_linearity_scaled_copy( FOR( i = 0; i < j; i++ ) { L_tmp = L_mult_sat( input[i], input[i] ); /* 2*Q_inp+1 */ - L_tmp = Mult_32_32( L_tmp, prev_scale ); /* 2*Q_inp */ + L_tmp = Mult_32_32( L_tmp, prev_scale ); /* 2*Q_inp */ output[i] = L_tmp; move32(); @@ -5540,7 +5540,7 @@ static Word32 non_linearity_scaled_copy( FOR( ; i < length; i++ ) { L_tmp = L_mult_sat( input[i], input[i] ); /* 2*Q_inp+1 */ - L_tmp = Mult_32_32( L_tmp, prev_scale ); /* 2*Q_inp */ + L_tmp = Mult_32_32( L_tmp, prev_scale ); /* 2*Q_inp */ output[i] = L_tmp; move32(); } @@ -5550,7 +5550,7 @@ static Word32 non_linearity_scaled_copy( FOR( i = 0; i < j; i++ ) { L_tmp = L_mult_sat( input[i], input[i] ); /* 2*Q_inp+1 */ - L_tmp = Mult_32_32( L_tmp, prev_scale ); /* 2*Q_inp */ + L_tmp = Mult_32_32( L_tmp, prev_scale ); /* 2*Q_inp */ if ( input[i] < 0 ) { @@ -5872,7 +5872,7 @@ void non_linearity_fx( IF( GT_16( max_val, shl( 1, Q_inp ) ) ) { exp = norm_s( max_val ); - tmp = div_s( shl( 1, sub( 14, exp ) ), max_val ); /* Q(29-exp-Q_inp) */ + tmp = div_s( shl( 1, sub( 14, exp ) ), max_val ); /* Q(29-exp-Q_inp) */ scale = L_shl_o( L_mult( 21955 /* 0.67 in Q15 */, tmp ), add( exp, sub( Q_inp, 14 ) ), &Overflow ); /* Q31 */ } ELSE @@ -6124,7 +6124,7 @@ void non_linearity_ivas_fx( IF( GT_16( max_val, shl( 1, Q_inp ) ) ) { exp = norm_s( max_val ); - tmp = div_s( shl( 1, sub( 14, exp ) ), max_val ); /* Q(29-exp-Q_inp) */ + tmp = div_s( shl( 1, sub( 14, exp ) ), max_val ); /* Q(29-exp-Q_inp) */ scale = L_shl_o( L_mult( 21955, tmp ), add( exp, sub( Q_inp, 14 ) ), &Overflow ); /* Q31 */ } ELSE @@ -6468,43 +6468,43 @@ void elliptic_bpf_48k_generic_fx( move32(); } - L_tmpX = L_shr( L_mult( memory_fx[0][0], full_band_bpf_fx[0][4] ), 3 ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( memory_fx[0][1], full_band_bpf_fx[0][3] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( memory_fx[0][2], full_band_bpf_fx[0][2] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( memory_fx[0][3], full_band_bpf_fx[0][1] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[0], full_band_bpf_fx[0][0] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ + L_tmpX = L_shr( L_mult( memory_fx[0][0], full_band_bpf_fx[0][4] ), 3 ); /*Q_input_fx + 13 + 1 - 3*/ + L_tmpX = L_add( L_shr( L_mult( memory_fx[0][1], full_band_bpf_fx[0][3] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ + L_tmpX = L_add( L_shr( L_mult( memory_fx[0][2], full_band_bpf_fx[0][2] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ + L_tmpX = L_add( L_shr( L_mult( memory_fx[0][3], full_band_bpf_fx[0][1] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ + L_tmpX = L_add( L_shr( L_mult( input_fx[0], full_band_bpf_fx[0][0] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][1], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmp[0] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][0], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ move32(); - L_tmpX = L_shr( L_mult( memory_fx[0][1], full_band_bpf_fx[0][4] ), 3 ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( memory_fx[0][2], full_band_bpf_fx[0][3] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( memory_fx[0][3], full_band_bpf_fx[0][2] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[0], full_band_bpf_fx[0][1] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[1], full_band_bpf_fx[0][0] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ + L_tmpX = L_shr( L_mult( memory_fx[0][1], full_band_bpf_fx[0][4] ), 3 ); /*Q_input_fx + 13 + 1 - 3*/ + L_tmpX = L_add( L_shr( L_mult( memory_fx[0][2], full_band_bpf_fx[0][3] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ + L_tmpX = L_add( L_shr( L_mult( memory_fx[0][3], full_band_bpf_fx[0][2] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ + L_tmpX = L_add( L_shr( L_mult( input_fx[0], full_band_bpf_fx[0][1] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ + L_tmpX = L_add( L_shr( L_mult( input_fx[1], full_band_bpf_fx[0][0] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[0], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmp[1] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][1], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ move32(); - L_tmpX = L_shr( L_mult( memory_fx[0][2], full_band_bpf_fx[0][4] ), 3 ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( memory_fx[0][3], full_band_bpf_fx[0][3] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[0], full_band_bpf_fx[0][2] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[1], full_band_bpf_fx[0][1] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[2], full_band_bpf_fx[0][0] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ + L_tmpX = L_shr( L_mult( memory_fx[0][2], full_band_bpf_fx[0][4] ), 3 ); /*Q_input_fx + 13 + 1 - 3*/ + L_tmpX = L_add( L_shr( L_mult( memory_fx[0][3], full_band_bpf_fx[0][3] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ + L_tmpX = L_add( L_shr( L_mult( input_fx[0], full_band_bpf_fx[0][2] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ + L_tmpX = L_add( L_shr( L_mult( input_fx[1], full_band_bpf_fx[0][1] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ + L_tmpX = L_add( L_shr( L_mult( input_fx[2], full_band_bpf_fx[0][0] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[1], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[0], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmp[2] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ move32(); - L_tmpX = L_shr( L_mult( memory_fx[0][3], full_band_bpf_fx[0][4] ), 3 ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[0], full_band_bpf_fx[0][3] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[1], full_band_bpf_fx[0][2] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[2], full_band_bpf_fx[0][1] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[3], full_band_bpf_fx[0][0] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ + L_tmpX = L_shr( L_mult( memory_fx[0][3], full_band_bpf_fx[0][4] ), 3 ); /*Q_input_fx + 13 + 1 - 3*/ + L_tmpX = L_add( L_shr( L_mult( input_fx[0], full_band_bpf_fx[0][3] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ + L_tmpX = L_add( L_shr( L_mult( input_fx[1], full_band_bpf_fx[0][2] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ + L_tmpX = L_add( L_shr( L_mult( input_fx[2], full_band_bpf_fx[0][1] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ + L_tmpX = L_add( L_shr( L_mult( input_fx[3], full_band_bpf_fx[0][0] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[2], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[1], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[0], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ @@ -6533,44 +6533,44 @@ void elliptic_bpf_48k_generic_fx( move32(); move32(); move32(); - L_tmpX = L_shr( Mult_32_16( memory2_fx[1][0], full_band_bpf_fx[1][4] ), 3 ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][1], full_band_bpf_fx[1][3] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[1][2] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[1][1] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[0], full_band_bpf_fx[1][0] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ + L_tmpX = L_shr( Mult_32_16( memory2_fx[1][0], full_band_bpf_fx[1][4] ), 3 ); /*Q_input_fx + 11 + 13 - 15 -3*/ + L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][1], full_band_bpf_fx[1][3] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ + L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[1][2] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ + L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[1][1] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ + L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[0], full_band_bpf_fx[1][0] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][3], full_band_bpf_fx[4][1] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][2], full_band_bpf_fx[4][2] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][1], full_band_bpf_fx[4][3] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2*/ L_tmp2[0] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][0], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2*/ move32(); L_tmpMax = L_abs( L_tmp2[0] ); - L_tmpX = L_shr( Mult_32_16( memory2_fx[1][1], full_band_bpf_fx[1][4] ), 3 ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[1][3] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[1][2] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[0], full_band_bpf_fx[1][1] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[1], full_band_bpf_fx[1][0] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ + L_tmpX = L_shr( Mult_32_16( memory2_fx[1][1], full_band_bpf_fx[1][4] ), 3 ); /*Q_input_fx + 11 + 13 - 15 -3*/ + L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[1][3] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ + L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[1][2] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ + L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[0], full_band_bpf_fx[1][1] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ + L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[1], full_band_bpf_fx[1][0] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[0], full_band_bpf_fx[4][1] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][3], full_band_bpf_fx[4][2] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][2], full_band_bpf_fx[4][3] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ L_tmp2[1] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][1], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ move32(); L_tmpMax = L_max( L_tmpMax, L_abs( L_tmp2[1] ) ); - L_tmpX = L_shr( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[1][4] ), 3 ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[1][3] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[0], full_band_bpf_fx[1][2] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[1], full_band_bpf_fx[1][1] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[2], full_band_bpf_fx[1][0] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ + L_tmpX = L_shr( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[1][4] ), 3 ); /*Q_input_fx + 11 + 13 - 15 -3*/ + L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[1][3] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ + L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[0], full_band_bpf_fx[1][2] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ + L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[1], full_band_bpf_fx[1][1] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ + L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[2], full_band_bpf_fx[1][0] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[1], full_band_bpf_fx[4][1] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[0], full_band_bpf_fx[4][2] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][3], full_band_bpf_fx[4][3] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ L_tmp2[2] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][2], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ move32(); L_tmpMax = L_max( L_tmpMax, L_abs( L_tmp2[2] ) ); - L_tmpX = L_shr( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[1][4] ), 3 ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[0], full_band_bpf_fx[1][3] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[1], full_band_bpf_fx[1][2] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[2], full_band_bpf_fx[1][1] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[3], full_band_bpf_fx[1][0] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ + L_tmpX = L_shr( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[1][4] ), 3 ); /*Q_input_fx + 11 + 13 - 15 -3*/ + L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[0], full_band_bpf_fx[1][3] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ + L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[1], full_band_bpf_fx[1][2] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ + L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[2], full_band_bpf_fx[1][1] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ + L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[3], full_band_bpf_fx[1][0] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[2], full_band_bpf_fx[4][1] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[1], full_band_bpf_fx[4][2] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[0], full_band_bpf_fx[4][3] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ @@ -7148,15 +7148,15 @@ void prep_tbe_exc_fx( #endif IF( EQ_16( L_frame_fx, L_FRAME ) ) { - interp_code_5over2_fx( code_fx, tmp_code_fx, L_subfr ); /* code: Q9, tmp_code: Q9 */ + interp_code_5over2_fx( code_fx, tmp_code_fx, L_subfr ); /* code: Q9, tmp_code: Q9 */ gain_code16 = round_fx_o( L_shl_o( gain_code_fx, Q_exc, &Overflow ), &Overflow ); /*Q_exc */ FOR( i = 0; i < L_subfr * HIBND_ACB_L_FAC; i++ ) { - L_tmp = L_mult( gain_code16, tmp_code_fx[i] ); /* Q9 + Q_exc + 1*/ + L_tmp = L_mult( gain_code16, tmp_code_fx[i] ); /* Q9 + Q_exc + 1*/ L_tmp = L_shl_sat( L_tmp, 5 ); /* Q9 + Q_exc + Q6*/ L_tmp = L_mac_sat( L_tmp, gain_pit_fx, bwe_exc_fx[i + i_subfr_fx * HIBND_ACB_L_FAC] ); /*Q15+Q_exc */ - L_tmp = L_shl_o( L_tmp, 1, &Overflow ); /*16+Q_exc */ /* saturation can occur here */ - bwe_exc_fx[i + i_subfr_fx * HIBND_ACB_L_FAC] = round_fx_o( L_tmp, &Overflow ); /*Q_exc */ + L_tmp = L_shl_o( L_tmp, 1, &Overflow ); /*16+Q_exc */ /* saturation can occur here */ + bwe_exc_fx[i + i_subfr_fx * HIBND_ACB_L_FAC] = round_fx_o( L_tmp, &Overflow ); /*Q_exc */ move16(); } } @@ -7182,7 +7182,7 @@ void prep_tbe_exc_fx( FOR( i = 0; i < L_subfr; i++ ) { /*code in the encoder is Q9 and there is no <<1 with Mult_32_16 Q16 * Q9 -> Q9 */ - Ltemp1 = Mult_32_16( gain_code_fx, code_fx[i] ); /* Q16 + Q9 + 1 - 16 = Q10 */ + Ltemp1 = Mult_32_16( gain_code_fx, code_fx[i] ); /* Q16 + Q9 + 1 - 16 = Q10 */ Ltemp1 = L_shl_o( Ltemp1, add( Q_exc, 6 ) /*Q_exc+16-19*/, &Overflow ); /*Q_exc+16 */ tmp_code_preInt_fx[i] = round_fx_o( Ltemp1, &Overflow ); /* Q_exc */ move16(); @@ -7192,7 +7192,7 @@ void prep_tbe_exc_fx( interp_code_4over2_fx( tmp_code_preInt_fx, tmp_code_fx, L_subfr ); /* o: tmp_code in Q_exc */ FOR( i = 0; i < L_subfr * 2; i++ ) { - L_tmp = L_mult( gain_pit_fx, bwe_exc_fx[i + i_subfr_fx * 2] ); /*Q14+Q_exc+1 */ + L_tmp = L_mult( gain_pit_fx, bwe_exc_fx[i + i_subfr_fx * 2] ); /*Q14+Q_exc+1 */ tmp = round_fx_o( L_shl_o( L_tmp, 1 /* (Q_exc+16)-(14+Q_exc+1)*/, &Overflow ), &Overflow ); /* tmp in Q_exc */ bwe_exc_fx[i + i_subfr_fx * 2] = add_o( tmp, tmp_code_fx[i], &Overflow ); /*Q_exc */ move16(); @@ -7317,12 +7317,12 @@ void prep_tbe_exc_ivas_fx( #endif IF( EQ_16( L_frame_fx, L_FRAME ) ) { - interp_code_5over2_fx( code_fx, tmp_code_fx, L_subfr ); /* code: Q9, tmp_code: Q9 */ + interp_code_5over2_fx( code_fx, tmp_code_fx, L_subfr ); /* code: Q9, tmp_code: Q9 */ gain_code16 = round_fx_o( L_shl_o( gain_code_fx, Q_exc, &Overflow ), &Overflow ); /*Q_exc */ FOR( i = 0; i < L_subfr * HIBND_ACB_L_FAC; i++ ) { - L_tmp = L_mult( gain_code16, tmp_code_fx[i] ); /* Q9 + Q_exc + 1*/ - L_tmp = L_shl( L_tmp, 5 ); /* Q9 + Q_exc + Q6*/ + L_tmp = L_mult( gain_code16, tmp_code_fx[i] ); /* Q9 + Q_exc + 1*/ + L_tmp = L_shl( L_tmp, 5 ); /* Q9 + Q_exc + Q6*/ L_tmp = L_mac_o( L_tmp, gain_pit_fx, bwe_exc_fx[i + i_subfr_fx * HIBND_ACB_L_FAC], &Overflow ); /*Q15+Q_exc */ L_tmp = L_shl_o( L_tmp, 1, &Overflow ); /*16+Q_exc */ /* saturation can occur here */ bwe_exc_fx[i + i_subfr_fx * HIBND_ACB_L_FAC] = round_fx_o( L_tmp, &Overflow ); /*Q_exc */ @@ -7353,7 +7353,7 @@ void prep_tbe_exc_ivas_fx( FOR( i = 0; i < L_subfr; i++ ) { /*code in the encoder is Q9 and there is no <<1 with Mult_32_16 Q16 * Q9 -> Q9 */ - Ltemp1 = Mult_32_16( gain_code_fx, code_fx[i] ); /* Q16 + Q9 + 1 - 16 = Q10 */ + Ltemp1 = Mult_32_16( gain_code_fx, code_fx[i] ); /* Q16 + Q9 + 1 - 16 = Q10 */ Ltemp1 = L_shl_o( Ltemp1, add( Q_exc, 6 ) /*Q_exc+16-19*/, &Overflow ); /*Q_exc+16 */ tmp_code_preInt_fx[i] = round_fx_o( Ltemp1, &Overflow ); /* Q_exc */ move16(); @@ -7363,7 +7363,7 @@ void prep_tbe_exc_ivas_fx( interp_code_4over2_fx( tmp_code_preInt_fx, tmp_code_fx, L_subfr ); /* o: tmp_code in Q_exc */ FOR( i = 0; i < shl( L_subfr, 1 ); i++ ) { - L_tmp = L_mult( gain_pit_fx, bwe_exc_fx[i + shl( i_subfr_fx, 1 )] ); /*Q14+Q_exc+1 */ + L_tmp = L_mult( gain_pit_fx, bwe_exc_fx[i + shl( i_subfr_fx, 1 )] ); /*Q14+Q_exc+1 */ tmp = round_fx_o( L_shl_o( L_tmp, 1 /* (Q_exc+16)-(14+Q_exc+1)*/, &Overflow ), &Overflow ); /* tmp in Q_exc */ bwe_exc_fx[i + shl( i_subfr_fx, 1 )] = add_o( tmp, tmp_code_fx[i], &Overflow ); /*Q_exc */ move16(); diff --git a/lib_com/tcq_position_arith_fx.c b/lib_com/tcq_position_arith_fx.c index cc885b6c8..8d3f19718 100644 --- a/lib_com/tcq_position_arith_fx.c +++ b/lib_com/tcq_position_arith_fx.c @@ -944,7 +944,7 @@ Word32 GetISCScale_fx( } tmp32 = L_shl_sat( tmp32, sub( 1, SafeExp ) ); /* *2 */ tmp32 = L_sub_sat( L_shl_sat( L_mult0( g_fx, tmp16 ), sub( Qsxy, exp ) ), tmp32 ); /*Qsxy */ - dist_fx[i] = Mult_32_16( tmp32, g_fx ); /*Qsxy + exp - 15 */ + dist_fx[i] = Mult_32_16( tmp32, g_fx ); /*Qsxy + exp - 15 */ move32(); exp_dist[i] = add( sub( Qsxy, 15 ), exp ); move16(); diff --git a/lib_com/tcx_ltp_fx.c b/lib_com/tcx_ltp_fx.c index c10346d70..55228e0b3 100644 --- a/lib_com/tcx_ltp_fx.c +++ b/lib_com/tcx_ltp_fx.c @@ -44,7 +44,7 @@ void tcx_ltp_get_lpc( if ( L_tmp > 0 ) r = L_shr( r, 2 ); - tmp = shl( x[j], s ); /* Qx + s */ + tmp = shl( x[j], s ); /* Qx + s */ r = L_mac0_sat( r, tmp, tmp ); /* Q30 */ } r = L_max( r, L_shl( 100, shl( s, 1 ) ) ); /* Q30 */ @@ -501,7 +501,7 @@ static void tcx_ltp_synth_filter( zir: synth_ltp[j] = synth[j] - gain * s2 + gain * s - zir[j]; fade-in/out: synth_ltp[j] = synth[j] - alpha * gain * s2 + alpha * gain * s; */ i = sub_sat( round_fx_sat( s ), mult_r_sat( round_fx_sat( s2 ), ALPHA ) ); /* Qx */ - k = mult_r( gain, i ); /* Qx */ + k = mult_r( gain, i ); /* Qx */ if ( fade != 0 ) k = mult_r( k, alpha ); /* Qx */ k = add_sat( synth[j], k ); /* Qx */ @@ -615,9 +615,9 @@ static void tcx_ltp_synth_filter32( zir: synth_ltp[j] = synth[j] - gain * s2 + gain * s - zir[j]; fade-in/out: synth_ltp[j] = synth[j] - alpha * gain * s2 + alpha * gain * s; */ L_tmp = L_sub_sat( s, Mpy_32_16_r( s2, ALPHA ) ); /* Qx */ - L_tmp2 = Mpy_32_16_r( L_tmp, gain ); /* Qx */ + L_tmp2 = Mpy_32_16_r( L_tmp, gain ); /* Qx */ IF( fade != 0 ) - L_tmp2 = Mpy_32_16_r( L_tmp2, alpha ); /* Qx */ + L_tmp2 = Mpy_32_16_r( L_tmp2, alpha ); /* Qx */ L_tmp2 = L_add_sat( synth[j], L_tmp2 ); /* Qx */ if ( zir != NULL ) { diff --git a/lib_com/tcx_utils_fx.c b/lib_com/tcx_utils_fx.c index 4c04bf7a8..4e40e4ab2 100644 --- a/lib_com/tcx_utils_fx.c +++ b/lib_com/tcx_utils_fx.c @@ -1439,8 +1439,8 @@ void PsychAdaptLowFreqDeemph( L_tmp = BASOP_Util_Log2( L_tmp ); /* Q25 */ L_tmp = L_shr( L_tmp, 7 ); /* 0.0078125f = 1.f/(1<<7) */ L_tmp = BASOP_Util_InvLog2( L_tmp ); /* Q31 */ - tmp = round_fx_o( L_tmp, &Overflow ); /* Q15 */ - fac = tmp; /* Q15 */ + tmp = round_fx_o( L_tmp, &Overflow ); /* Q15 */ + fac = tmp; /* Q15 */ move16(); /* gradual lowering of lowest 32 bins; DC is lowered by (max_val/tmp)^1/4 */ diff --git a/lib_com/tools_fx.c b/lib_com/tools_fx.c index e84c27081..f6152f265 100644 --- a/lib_com/tools_fx.c +++ b/lib_com/tools_fx.c @@ -279,8 +279,8 @@ Word16 usdequant_fx( /* Qx*/ Word32 L_tmp; /*g = idx * delta + qlow;*/ - L_tmp = L_deposit_l( qlow ); /*Qx */ - L_tmp = L_mac( L_tmp, idx, delta ); /*Qx */ + L_tmp = L_deposit_l( qlow ); /*Qx */ + L_tmp = L_mac( L_tmp, idx, delta ); /*Qx */ g = round_fx_sat( L_shl_sat( L_tmp, 16 ) ); /*Qx */ return ( g ); } @@ -312,7 +312,7 @@ Word16 usquant_fx( /* o: index of the winning codeword */ /* idx = (short)( (x - qlow)/delta + 0.5f); */ exp = norm_s( delta ); - tmp = div_s( shl( 1, sub( 14, exp ) ), delta ); /*Q(29-exp-(Qx-1))->Q(30-exp-Qx) */ + tmp = div_s( shl( 1, sub( 14, exp ) ), delta ); /*Q(29-exp-(Qx-1))->Q(30-exp-Qx) */ L_tmp = L_mult( sub_o( x, qlow, &Overflow ), tmp ); /*Q(31-exp) */ idx = extract_l( L_shr_r( L_add( L_tmp, shl_o( 1, sub( 30, exp ), &Overflow ) ), sub( 31, exp ) ) ); /*Q0 */ @@ -320,8 +320,8 @@ Word16 usquant_fx( /* o: index of the winning codeword */ idx = s_max( idx, 0 ); /* *xq = idx*delta + qlow; */ - L_tmp = L_deposit_l( qlow ); /*Qx */ - L_tmp = L_mac( L_tmp, idx, delta ); /*Qx */ + L_tmp = L_deposit_l( qlow ); /*Qx */ + L_tmp = L_mac( L_tmp, idx, delta ); /*Qx */ *xq = round_fx_o( L_shl_o( L_tmp, 16, &Overflow ), &Overflow ); /*Qx */ return idx; } @@ -1481,7 +1481,7 @@ Word32 var_fx_32( /* o: variance of vector Q v = L_deposit_l( 0 ); FOR( i = 0; i < len; i++ ) { - tmp = sub( x[i], m ); /*Qx */ + tmp = sub( x[i], m ); /*Qx */ v = L_mac0_sat( v, tmp, tmp ); /*(Qx+Qx) */ } L_tmp = Mult_32_16( v, inv_len ); /*Q(14-exp+Qx+Qx) */ @@ -1614,7 +1614,7 @@ Word16 var_fx( /* o: variance of vector Qx*/ tmp = sub_sat( x[i], m ); /*Qx */ v = L_mac0_sat( v, tmp, tmp ); /*(Qx+Qx) */ } - L_tmp = Mult_32_16( v, inv_len ); /*Q(14-exp+Qx+Qx) */ + L_tmp = Mult_32_16( v, inv_len ); /*Q(14-exp+Qx+Qx) */ v_16 = round_fx_sat( L_shl_sat( L_tmp, add( exp, sub( 2, Qx ) ) ) ); /*Qx */ return v_16; @@ -2392,7 +2392,7 @@ void pz_filter_sp_fx( move16(); Ltemp1 = L_add_sat( L_shr_sat( Lacc, s ), 0x08000 ); /* Ltemp1 in Qc+Qa+Qn=Q(Qn) */ - y[i] = extract_h( Ltemp1 ); /* y[i] in Qn */ + y[i] = extract_h( Ltemp1 ); /* y[i] in Qn */ move16(); } } @@ -2802,7 +2802,7 @@ void pz_filter_dp_fx( move16(); Ltemp1 = L_shr_sat( Lacc, s ); /* Ltemp1 in Qc+Qa+Qn=Q(16+Qn) */ - y[i] = extract_h( Ltemp1 ); /* y[i] in Qn */ + y[i] = extract_h( Ltemp1 ); /* y[i] in Qn */ move16(); } } diff --git a/lib_com/trans_inv_fx.c b/lib_com/trans_inv_fx.c index cb50d030a..fbe0f0d6d 100644 --- a/lib_com/trans_inv_fx.c +++ b/lib_com/trans_inv_fx.c @@ -141,12 +141,12 @@ void preecho_sb_fx( FOR( i = 0; i < len3xLp20; i++ ) { *fxptr1++ = negate( extract_h( L_shl_sat( *fx32ptr1--, sub( 15, q_sig32 ) ) ) ); /*Q-1*/ - move16(); /*convert to Word16 Q-1 with saturation (saturation not a problem here) */ + move16(); /*convert to Word16 Q-1 with saturation (saturation not a problem here) */ } FOR( i = 0; i < L_shr( framelength, 1 ); i++ ) { *fxptr1++ = negate( extract_h( L_shl_sat( wtda_audio_fx[i], sub( 15, q_sig32 ) ) ) ); /*Q-1*/ - move16(); /*convert to Word16 Q-1 with saturation (saturation not a problem here) */ + move16(); /*convert to Word16 Q-1 with saturation (saturation not a problem here) */ } qmemp1 = 0; /*already in q-1*/ @@ -184,8 +184,8 @@ void preecho_sb_fx( fxptr4 = rec_sig_fx + 2; /*q_sig16*/ tmp_fxL1 = L_mult( shl_sat( *memfilt_lb_fx, q_sig16 ), 8192 ); /* *memfilt_lb_fx in q0 */ - tmp_fxL1 = L_mac( tmp_fxL1, *fxptr3, 8192 /*Q15*/ ); /*Q16*/ - *fxptr1 = mac_r( tmp_fxL1, *fxptr2, 16384 /*Q15*/ ); /*Q0*/ + tmp_fxL1 = L_mac( tmp_fxL1, *fxptr3, 8192 /*Q15*/ ); /*Q16*/ + *fxptr1 = mac_r( tmp_fxL1, *fxptr2, 16384 /*Q15*/ ); /*Q0*/ move16(); fxptr1++; @@ -219,7 +219,7 @@ void preecho_sb_fx( fxptr2--; *memfilt_lb_fx = shr_sat( *fxptr2, q_sig16 ); /*Q0*/ - move16(); /* *memfilt_lb_fx in q0 */ + move16(); /* *memfilt_lb_fx in q0 */ /* energy of low bands 8 present and 1 future sub-frames */ sptr1 = zcr; /*Q0*/ @@ -346,7 +346,7 @@ void preecho_sb_fx( tmp_fx3 = sub( len3xLp20, 1 ); FOR( i = 1; i < len3xLp20; i++ ) { - tmp_fx1 = shr( *fxptr2, qmemp1 ); /*q-1 to avoisd saturation in energy*/ + tmp_fx1 = shr( *fxptr2, qmemp1 ); /*q-1 to avoisd saturation in energy*/ tmp_fxL1 = L_mac0_sat( tmp_fxL1, tmp_fx1, tmp_fx1 ); /*2*(Q-1)*/ if ( *fxptr2 * *( fxptr2 - 1 ) <= 0 ) { @@ -370,7 +370,7 @@ void preecho_sb_fx( FOR( j = 1; j < tmp_fx3; j++ ) /* tmp_fx3 still contains subframelength*1.2-1 */ { - tmp_fxL1 = L_mult( *fxptr2, -8192 /*Q15*/ ); /*q_sig16+Q16*/ + tmp_fxL1 = L_mult( *fxptr2, -8192 /*Q15*/ ); /*q_sig16+Q16*/ tmp_fxL1 = L_mac_sat( tmp_fxL1, *fxptr4, -8192 ); /*q_sig16+Q16*/ tmp_fx1 = mac_r_sat( tmp_fxL1, *fxptr3, 16384 /*Q15*/ ); /*q_sig16*/ @@ -380,7 +380,7 @@ void preecho_sb_fx( fxptr4++; } - tmp_fxL1 = L_mult( *fxptr2, -8192 /*Q15*/ ); /*q_sig16+Q16*/ + tmp_fxL1 = L_mult( *fxptr2, -8192 /*Q15*/ ); /*q_sig16+Q16*/ tmp_fx1 = mac_r_sat( tmp_fxL1, *fxptr3, 16384 /*Q15*/ ); /*q_sig16*/ es_mdct_hb_fx[NUMSF] = L_mac0_sat( tmp_fxL2, tmp_fx1, tmp_fx1 ); /*2*(q_sig16)*/ move32(); @@ -651,7 +651,7 @@ void preecho_sb_fx( FOR( i = 0; i < subsubframelength; i++ ) { - tmp_fx1 = shr( *ptr_fx, qtmp ); /* q-1, to have same shift as es_mdct_.. */ + tmp_fx1 = shr( *ptr_fx, qtmp ); /* q-1, to have same shift as es_mdct_.. */ tmp_fxL1 = L_mac0_sat( tmp_fxL1, tmp_fx1, tmp_fx1 ); /*2*(Q-1)*/ ptr_fx++; } @@ -661,7 +661,7 @@ void preecho_sb_fx( } sum_plus_es_fx = L_add_sat( sum_plus_es_fx, L_shl_sat( tmp_fxL1, 2 ) ); /*2*(Q-1)*/ - *fx32ptr1 = tmp_fxL1; /*2*(Q-1)*/ + *fx32ptr1 = tmp_fxL1; /*2*(Q-1)*/ fx32ptr1++; Mpy_32_16_ss( sum_plus_es_fx, inv_jp2[j], fx32ptr4, &tmp_u16 ); /* 410 for 1/80*/ if ( LT_32( *fx32ptr4, maxcrit_fx ) ) @@ -931,8 +931,8 @@ void preecho_sb_fx( *mean_prev_fx = mean_prev_fx_loc; /*2*(Q-1)*/ move32(); *mean_prev_hb_fx = L_shr_sat( mean_prev_hb_fx_loc, shl_sat( q_sig16, 1 ) ); /*Q0*/ - move32(); /*save in Q0*/ - *mean_prev_nc_fx = mean_prev_nc_fx_loc; /*2*(Q-1)*/ + move32(); /*save in Q0*/ + *mean_prev_nc_fx = mean_prev_nc_fx_loc; /*2*(Q-1)*/ move32(); } diff --git a/lib_com/wi_fx.c b/lib_com/wi_fx.c index 4872aff04..7df4cb3f0 100644 --- a/lib_com/wi_fx.c +++ b/lib_com/wi_fx.c @@ -765,15 +765,15 @@ void DTFS_to_fs_fx( move16(); exp = norm_s( X_fx->lag_fx ); - tmp = div_s( shl( 1, sub( 14, exp ) ), X_fx->lag_fx ); /* Q29-exp */ + tmp = div_s( shl( 1, sub( 14, exp ) ), X_fx->lag_fx ); /* Q29-exp */ L_tmp1 = L_mult_o( 12800, tmp, &Overflow ); /* Q(30-exp) */ diff_fx = extract_h( L_shl_o( L_tmp1, sub( exp, 14 ), &Overflow ) ); /* Q0 */ exp = norm_s( diff_fx ); - tmp = div_s( shl( 1, sub( 14, exp ) ), diff_fx ); /* Q29-exp */ + tmp = div_s( shl( 1, sub( 14, exp ) ), diff_fx ); /* Q29-exp */ L_tmp1 = L_mult_o( X_fx->upper_cut_off_freq_fx, tmp, &Overflow ); /* Q(30-exp) */ nH_band = extract_h( L_shl_o( L_tmp1, sub( exp, 14 ), &Overflow ) ); /* Q0 */ - nH_4kHz = mult( 10240, ( X_fx->lag_fx ) ); /* 4000/12800 in Q15 */ + nH_4kHz = mult( 10240, ( X_fx->lag_fx ) ); /* 4000/12800 in Q15 */ if ( GE_16( sub( X_fx->upper_cut_off_freq_fx, shr( (Word16) L_mult( diff_fx, nH_band ), 1 ) ), diff_fx ) ) { @@ -1728,9 +1728,9 @@ void DTFS_car2pol_fx( FOR( k = 1; k <= HalfLag_fx; k++ ) { - Lacc_fx = L_mult( X_fx->a_fx[k], X_fx->a_fx[k] ); /* a[k]^2, 2Q+1 */ + Lacc_fx = L_mult( X_fx->a_fx[k], X_fx->a_fx[k] ); /* a[k]^2, 2Q+1 */ Lacc_fx = L_mac_o( Lacc_fx, X_fx->b_fx[k], X_fx->b_fx[k], &Overflow ); /* a[k]^2+b[k]^2, 2Q+1 */ - Lacc_fx = L_shr( Lacc_fx, 3 ); /* Lacc=(a[k]^2+b[k]^2)/4, 2Q */ + Lacc_fx = L_shr( Lacc_fx, 3 ); /* Lacc=(a[k]^2+b[k]^2)/4, 2Q */ IF( Lacc_fx ) { @@ -1930,7 +1930,7 @@ Word32 DTFS_setEngyHarm_fx( { /*L_temp_fx =(Word32)Mpy_32_16(extract_h(factor_fx),extract_l(factor_fx), X_fx->a_fx[k]); move32(); */ /* Q(temp+X1.Q-15) */ L_temp_fx = Mult_32_16( factor_fx, X_fx->a_fx[k] ); /* Q(temp+X1.Q-15) */ - X_fx->a_fx[k] = round_fx_o( L_temp_fx, &Overflow ); /* Q(temp+X1.Q-15-16)=Q(temp+X1.Q-31); */ + X_fx->a_fx[k] = round_fx_o( L_temp_fx, &Overflow ); /* Q(temp+X1.Q-15-16)=Q(temp+X1.Q-31); */ move16(); } @@ -4162,7 +4162,7 @@ Word32 getSpEngyFromResAmp_fx( DTFS_STRUCTURE *X_fx, Word16 lband, Word16 hband, { /* Compute Re */ Lacc = L_mac_o( Lacc, curr_lpc[i], cos_tab[n % M_fx], &Overflow ); /* Q28 */ - n = add( n, k4 ); /* n=4*i*k */ + n = add( n, k4 ); /* n=4*i*k */ } Re = L_shr( Lacc, 1 ); /* Q27 */ @@ -4173,12 +4173,12 @@ Word32 getSpEngyFromResAmp_fx( DTFS_STRUCTURE *X_fx, Word16 lband, Word16 hband, { /* Compute Im */ Lacc = L_msu_o( Lacc, curr_lpc[i], sin_tab[n % M_fx], &Overflow ); /* Q28 */ - n = add( n, k4 ); /* n=4*i*k */ + n = add( n, k4 ); /* n=4*i*k */ } - Im = L_shr( Lacc, 1 ); /* Q27 */ - /* Lacc=L_add(L_mult_ll(Re,Re),(Word32)L_mult_ll(Im,Im)); : Lacc=Re^2+Im^2 in Q23 */ + Im = L_shr( Lacc, 1 ); /* Q27 */ + /* Lacc=L_add(L_mult_ll(Re,Re),(Word32)L_mult_ll(Im,Im)); : Lacc=Re^2+Im^2 in Q23 */ Lacc = L_add_o( Mult_32_32( Re, Re ), Mult_32_32( Im, Im ), &Overflow ); /* Lacc=Re^2+Im^2 in Q23 */ - Ltemp = L_mult0( X_fx->a_fx[k], X_fx->a_fx[k] ); /* 2*a[k]^2 in 2Q */ + Ltemp = L_mult0( X_fx->a_fx[k], X_fx->a_fx[k] ); /* 2*a[k]^2 in 2Q */ /* Ltemp=(Word32)L_sat32_40(divide_dp(Ltemp,Lacc,-19,1)); : Ltemp in Q(2Q-13) */ if ( Lacc < 0 ) diff --git a/lib_com/window_ola_fx.c b/lib_com/window_ola_fx.c index d69d57365..19725735a 100644 --- a/lib_com/window_ola_fx.c +++ b/lib_com/window_ola_fx.c @@ -27,12 +27,12 @@ void sinq_fx( L_tmp = Mult_32_16( L_tmp, 5461 ); /*Q31; division by 6 */ tmp2 = round_fx( L_tmp ); /*Q15 */ x[1] = sub( tmp1, tmp2 ); - move16(); /* sin(x) approximated by (x-x^3/3!); Q15 */ + move16(); /* sin(x) approximated by (x-x^3/3!); Q15 */ tmp1 = add_sat( shl_sat( tmp, 1 ), phi ); /*Q15 */ - L_tmp = L_mult( tmp1, tmp1 ); /*Q31 */ - L_tmp = Mult_32_16( L_tmp, tmp1 ); /*Q31 */ - L_tmp = Mult_32_16( L_tmp, 5461 ); /*Q31; division by 6 */ - tmp2 = round_fx( L_tmp ); /*Q15 */ + L_tmp = L_mult( tmp1, tmp1 ); /*Q31 */ + L_tmp = Mult_32_16( L_tmp, tmp1 ); /*Q31 */ + L_tmp = Mult_32_16( L_tmp, 5461 ); /*Q31; division by 6 */ + tmp2 = round_fx( L_tmp ); /*Q15 */ x[2] = sub( tmp1, tmp2 ); move16(); /* sin(x) approximated by (x-x^3/3!); Q15 */ @@ -58,8 +58,8 @@ void sinq_fx( L_tmp = Mult_32_32( A32, tmp_old ); /*Q30 */ L_tmp = L_sub( L_tmp, L_shr( tmp_old_old, 1 ) ); /*Q30 */ tmp_old_old = L_add( tmp_old, 0 ); /*Q31 */ - tmp_old = L_shl_sat( L_tmp, 1 ); /*Q31 */ - x[i] = round_fx_sat( tmp_old ); /*Q15 */ + tmp_old = L_shl_sat( L_tmp, 1 ); /*Q31 */ + x[i] = round_fx_sat( tmp_old ); /*Q15 */ move16(); } diff --git a/lib_dec/FEC_HQ_core_fx.c b/lib_dec/FEC_HQ_core_fx.c index 716730130..f88927ee5 100644 --- a/lib_dec/FEC_HQ_core_fx.c +++ b/lib_dec/FEC_HQ_core_fx.c @@ -373,7 +373,7 @@ void HQ_FEC_processing_fx( exp2 = norm_l( norm_values_fx[0] ); tmp_fx = div_s( extract_h( L_shl( norm_p_fx[i], exp1 ) ), extract_h( L_shl( norm_values_fx[0], exp2 ) ) ); /*15 + (5 + exp1 - 16) - (12 + exp2 - 16)*/ - tmp_fx = shl_sat( tmp_fx, add( 6, sub( exp2, exp1 ) ) ); /*14*/ + tmp_fx = shl_sat( tmp_fx, add( 6, sub( exp2, exp1 ) ) ); /*14*/ if ( GT_16( tmp_fx, 16384 ) ) { tmp_fx = 16384; @@ -519,7 +519,7 @@ void ivas_HQ_FEC_Mem_update_fx( k = add( k, 1 ); } tmp_fx = shl_o( inv_tbl_fx[Num_bands_p[i]], 1, &Overflow ); /*16*/ - norm_values_fx[0] = Mult_32_16( L_tmp, tmp_fx ); /*11 + 16 - 15*/ + norm_values_fx[0] = Mult_32_16( L_tmp, tmp_fx ); /*11 + 16 - 15*/ move32(); tmp_energy_fx = L_add( tmp_energy_fx, L_shr( L_tmp, 3 ) ); /*8*/ } @@ -808,7 +808,7 @@ void HQ_FEC_Mem_update_fx( k = add( k, 1 ); } tmp_fx = shl_o( inv_tbl_fx[Num_bands_p[i]], 1, &Overflow ); /*16*/ - norm_values_fx[0] = Mult_32_16( L_tmp, tmp_fx ); /*11 + 16 - 15*/ + norm_values_fx[0] = Mult_32_16( L_tmp, tmp_fx ); /*11 + 16 - 15*/ move32(); tmp_energy_fx = L_add( tmp_energy_fx, L_shr( L_tmp, 3 ) ); /*8*/ } @@ -1068,7 +1068,7 @@ static Word16 find_best_delay_fx( exp2 = norm_l( min_corr_fx ); L_tmp1 = L_shl( min_sq_cross_fx, exp1 ); L_tmp2 = L_shl( min_corr_fx, exp2 ); - tmp = div_s( extract_h( L_tmp1 ), extract_h( L_tmp2 ) ); /*15 + exp1 - exp2 */ + tmp = div_s( extract_h( L_tmp1 ), extract_h( L_tmp2 ) ); /*15 + exp1 - exp2 */ tmp = shl_o( tmp, sub( exp2, add( exp1, 1 ) ), &Overflow ); /*14 */ } diff --git a/lib_dec/FEC_HQ_phase_ecu_fx.c b/lib_dec/FEC_HQ_phase_ecu_fx.c index f23ddeb7d..3b3c543bd 100644 --- a/lib_dec/FEC_HQ_phase_ecu_fx.c +++ b/lib_dec/FEC_HQ_phase_ecu_fx.c @@ -491,15 +491,15 @@ static void trans_ana_fx( tr_dec[k] = 0; move16(); Mpy_32_16_ss( *pGrPowLeft, THRESH_TR_LIN_BY2_FX, &acc, &lsb ); /* To facilitate fixed-point implementation, divide threshold by 2. */ - acc = L_or( L_shl_sat( acc, 16 ), L_and( 0xffffL, lsb ) ); /* Equivalent to concatenate acc and lsb, and then down shift by 16 bits. */ - if ( GT_32( *pGrPowRight, acc ) ) /* gr_pow_right > thres_tr_lin*gr_pow_left */ + acc = L_or( L_shl_sat( acc, 16 ), L_and( 0xffffL, lsb ) ); /* Equivalent to concatenate acc and lsb, and then down shift by 16 bits. */ + if ( GT_32( *pGrPowRight, acc ) ) /* gr_pow_right > thres_tr_lin*gr_pow_left */ { tr_dec[k] = 1; move16(); } Mpy_32_16_ss( *pGrPowRight, THRESH_TR_LIN_BY2_FX, &acc, &lsb ); acc = L_or( L_shl_sat( acc, 16 ), L_and( 0xffffL, lsb ) ); /* Equivalent to concatenate acc and lsb, and then down shift by 16 bits. */ - if ( GT_32( *pGrPowLeft, acc ) ) /* gr_pow_left > thres_tr_lin*gr_pow_right */ + if ( GT_32( *pGrPowLeft, acc ) ) /* gr_pow_left > thres_tr_lin*gr_pow_right */ { tr_dec[k] = 1; move16(); @@ -1266,9 +1266,9 @@ static Word16 imax_fx( /* o: The location, relative to the } /* Although the output of ratio() is in Q14, adding the missing factor of 2 (See above) * in the denominator, the output is now considered to be in Q15. */ - man = ratio( numer, denom, &expo ); /* The mantissa is considered in Q15 */ + man = ratio( numer, denom, &expo ); /* The mantissa is considered in Q15 */ posi = shr_o( man, expo, &Overflow ); /* in Q15 (Due to saturation, it is automatically bound inside [-1.0,1.0].) */ - if ( sign < 0 ) /* Restore the sign. */ + if ( sign < 0 ) /* Restore the sign. */ { posi = negate( posi ); } @@ -4533,7 +4533,7 @@ static void ivas_fec_noise_filling_fx( tmp_fx = s_min( Rnd_N_noise, flag ); FOR( i = 0; i < tmp_fx; i++ ) { - L_tmp = L_mult( ( *pt1++ ), ( *pt3++ ) ); /*Qsynth+16 */ + L_tmp = L_mult( ( *pt1++ ), ( *pt3++ ) ); /*Qsynth+16 */ L_tmp = L_mac_sat( L_tmp, ( *pt2++ ), ( *pt4-- ) ); /*Qsynth+16 */ *pt5 = add_sat( *pt5, round_fx_sat( L_tmp ) ); move16(); /*Qsynth */ @@ -4686,7 +4686,7 @@ static void fec_noise_filling_fx( Rnd_N_noise = extract_h( L_mult( N_noise, tmp_fx ) ); /*Q0 */ - tmp_fx = div_s( 1, Rnd_N_noise ); /*Q15 */ + tmp_fx = div_s( 1, Rnd_N_noise ); /*Q15 */ tmp_fx = round_fx_sat( L_shl_sat( L_mult( tmp_fx, 25736 ), 2 ) ); /*Q15 */ #ifdef IVAS_FEC_ECU_TO_COMPLETE if ( element_mode == EVS_MONO ) @@ -4710,7 +4710,7 @@ static void fec_noise_filling_fx( tmp_fx = s_min( Rnd_N_noise, flag ); FOR( i = 0; i < tmp_fx; i++ ) { - L_tmp = L_mult( ( *pt1++ ), ( *pt3++ ) ); /*Qsynth+16 */ + L_tmp = L_mult( ( *pt1++ ), ( *pt3++ ) ); /*Qsynth+16 */ L_tmp = L_mac_sat( L_tmp, ( *pt2++ ), ( *pt4-- ) ); /*Qsynth+16 */ *pt5 = add_sat( *pt5, round_fx_sat( L_tmp ) ); move16(); /*Qsynth */ @@ -5529,8 +5529,8 @@ static void windowing_ROM_optimized( /* 1st half of the right half of the Hamming window. */ FOR( i = 0; i < quarterLen; i++ ) { - pSine -= downSamples; /* Decrement address counter */ - acc = L_deposit_h( FEC_HQ_WIN_A0 ); // Q31 + pSine -= downSamples; /* Decrement address counter */ + acc = L_deposit_h( FEC_HQ_WIN_A0 ); // Q31 hamm = mac_r_sat( acc, *pSine, FEC_HQ_WIN_A1 ); // Q15 *pY++ = mult_r( hamm, *pX++ ); move16(); diff --git a/lib_dec/FEC_pitch_estim_fx.c b/lib_dec/FEC_pitch_estim_fx.c index cb56efc74..b7ad94f89 100644 --- a/lib_dec/FEC_pitch_estim_fx.c +++ b/lib_dec/FEC_pitch_estim_fx.c @@ -59,7 +59,7 @@ void FEC_pitch_estim_fx( tmp3 = shl_sat( tmp2, 1 ); /*Q6 (1.4f * old_pitch_buf[2*NB_SUBFR-1])*/ tmp16k1 = round_fx( L_shl( Mpy_32_16_1( old_pitch_buf[2 * NB_SUBFR16k - 1], 22938 ), 6 ) ); /*Q6 0.7f * old_pitch_buf[2*NB_SUBFR16k-1]*/ - tmp16k2 = shl_sat( tmp16k1, 1 ); /*Q6 1.4f * old_pitch_buf[2*NB_SUBFR16k-1]*/ + tmp16k2 = shl_sat( tmp16k1, 1 ); /*Q6 1.4f * old_pitch_buf[2*NB_SUBFR16k-1]*/ test(); test(); diff --git a/lib_dec/LD_music_post_filter_fx.c b/lib_dec/LD_music_post_filter_fx.c index 1fa498a0e..5b48ab472 100644 --- a/lib_dec/LD_music_post_filter_fx.c +++ b/lib_dec/LD_music_post_filter_fx.c @@ -360,18 +360,18 @@ void LD_music_post_filter_fx( FOR( ; i < BIN_2KHZ; i++ ) { - tmp16 = s_min( max_ovf_2k, hMusicPF->filt_lfE_fx[i] ); /*Q12*/ - tmp16 = s_max( min_g_2k, tmp16 ); /*Q12*/ - /*DCT_buf[i] *= ftmp;*/ + tmp16 = s_min( max_ovf_2k, hMusicPF->filt_lfE_fx[i] ); /*Q12*/ + tmp16 = s_max( min_g_2k, tmp16 ); /*Q12*/ + /*DCT_buf[i] *= ftmp;*/ dtc_out[i] = round_fx_sat( L_shl_sat( L_mult( dtc_out[i], tmp16 ), 3 ) ); /*Q15*/ move16(); } FOR( ; i < BIN_4KHZ; i++ ) { - tmp16 = s_min( max_ovf_4k, hMusicPF->filt_lfE_fx[i] ); /*Q12*/ - tmp16 = s_max( min_g_4k, tmp16 ); /*Q12*/ - /*DCT_buf[i] *= ftmp;*/ + tmp16 = s_min( max_ovf_4k, hMusicPF->filt_lfE_fx[i] ); /*Q12*/ + tmp16 = s_max( min_g_4k, tmp16 ); /*Q12*/ + /*DCT_buf[i] *= ftmp;*/ dtc_out[i] = round_fx_sat( L_shl_sat( L_mult_sat( dtc_out[i], tmp16 ), 3 ) ); /*Q15*/ move16(); } @@ -382,9 +382,9 @@ void LD_music_post_filter_fx( /* Do not modify HF when coded with GSC at LR, because the spectrum is just noise */ FOR( ; i < DCT_L_POST; i++ ) { - tmp16 = s_min( max_ovf_6k, hMusicPF->filt_lfE_fx[i] ); /*Q12*/ - tmp16 = s_max( min_g_6k, tmp16 ); /*Q12*/ - /*DCT_buf[i] *= ftmp;*/ + tmp16 = s_min( max_ovf_6k, hMusicPF->filt_lfE_fx[i] ); /*Q12*/ + tmp16 = s_max( min_g_6k, tmp16 ); /*Q12*/ + /*DCT_buf[i] *= ftmp;*/ dtc_out[i] = round_fx_sat( L_shl_sat( L_mult_sat( dtc_out[i], tmp16 ), 3 ) ); /*Q15*/ move16(); } @@ -395,8 +395,8 @@ void LD_music_post_filter_fx( /* When unsure on content type only slight clean-up allowed, no overshoot allowed */ FOR( ; i < DCT_L_POST; i++ ) { - tmp16 = s_min( 4096 /*1.0f in Q12*/, hMusicPF->filt_lfE_fx[i] ); /*Q12*/ - /*DCT_buf[i] *= ftmp;*/ + tmp16 = s_min( 4096 /*1.0f in Q12*/, hMusicPF->filt_lfE_fx[i] ); /*Q12*/ + /*DCT_buf[i] *= ftmp;*/ dtc_out[i] = round_fx_sat( L_shl_sat( L_mult_sat( dtc_out[i], tmp16 ), 3 ) ); /*Q15*/ move16(); } @@ -628,9 +628,9 @@ static void spectrum_mod_dct_fx( alpha = shl( sub( 16384 /*Q14*/, sqrt_gain ), 1 ); /*Q15*/ /**pt_gbin = gain + alpha * *pt_gbin;*/ - Ltmp = L_mult( gain, 32767 /*Q15*/ ); /*Q30*/ - *pt_gbin = round_fx( L_mac( Ltmp, alpha, *pt_gbin ) ); /*Q14*/ - /**pt++ *= *pt_gbin;*/ + Ltmp = L_mult( gain, 32767 /*Q15*/ ); /*Q30*/ + *pt_gbin = round_fx( L_mac( Ltmp, alpha, *pt_gbin ) ); /*Q14*/ + /**pt++ *= *pt_gbin;*/ *pt = round_fx_sat( L_shl_sat( L_mult( *pt, *pt_gbin ), 1 ) ); /*Qdct*/ move16(); move16(); diff --git a/lib_dec/TonalComponentDetection_fx.c b/lib_dec/TonalComponentDetection_fx.c index b2f3021b5..ca7bec140 100644 --- a/lib_dec/TonalComponentDetection_fx.c +++ b/lib_dec/TonalComponentDetection_fx.c @@ -494,7 +494,7 @@ static void getEnvelope( /* No need for PTR_INIT for powerSpec[i+n2] as we continue from the previous loop */ FOR( i = 0; i < n1; i++ ) { - sum = L_add_sat( sum, powerSpec[i + n2] ); /*powerSpec_exp*/ + sum = L_add_sat( sum, powerSpec[i + n2] ); /*powerSpec_exp*/ tmp = Mpy_32_16_1( sum /*Q31,powerSpec_exp*/, level /*Q12*/ ); /*Q28,powerSpec_exp*/ envelope[i] /*Q28,powerSpec_exp*/ = Mpy_32_16_1( tmp /*Q28,powerSpec_exp*/, InvIntTable[i + nSecondHalfFilterLength] /*Q15*/ ); move32(); @@ -504,7 +504,7 @@ static void getEnvelope( FOR( i = n1; i < nSamples - n2; i++ ) { sum = L_add_sat( sum, L_sub( powerSpec[i + n2], powerSpec[i - n1] ) ); /*powerSpec_exp*/ - envelope[i] = Mpy_32_16_1( sum, inv_len ); /*Q28*/ + envelope[i] = Mpy_32_16_1( sum, inv_len ); /*Q28*/ move32(); } diff --git a/lib_dec/bass_psfilter_fx.c b/lib_dec/bass_psfilter_fx.c index 7d05704e4..42f4ce17f 100644 --- a/lib_dec/bass_psfilter_fx.c +++ b/lib_dec/bass_psfilter_fx.c @@ -193,7 +193,7 @@ void bass_psfilter_fx( tmp = sum16_fx( hBPF->Track_on_hist, L_TRACK_HIST ); TrackOnR = round_fx_sat( L_shl_sat( L_mult0( tmp, 3277 ), 16 ) ); /*Q15 */ - vibratR = sum16_fx( hBPF->vibrato_hist, L_TRACK_HIST ); /*Q0 */ + vibratR = sum16_fx( hBPF->vibrato_hist, L_TRACK_HIST ); /*Q0 */ alp_tmp = sub( 32767, TrackOnR ); /*Q15 */ @@ -324,8 +324,8 @@ void bass_psfilter_fx( because it is a signed sum. */ FOR( j = 0; j < subfr_len; j += 2 ) { - Lcorr0 = L_mult0( syn_fx[j], syn2_fx[j] ); /* Q31 */ - Lener0 = L_mult0( syn2_fx[j], syn2_fx[j] ); /* Q31 */ + Lcorr0 = L_mult0( syn_fx[j], syn2_fx[j] ); /* Q31 */ + Lener0 = L_mult0( syn2_fx[j], syn2_fx[j] ); /* Q31 */ Lcorr0 = L_mac0_sat( Lcorr0, syn_fx[j + 1], syn2_fx[j + 1] ); /* Q31 */ Lener0 = L_mac0_sat( Lener0, syn2_fx[j + 1], syn2_fx[j + 1] ); /* Q31 */ @@ -387,8 +387,8 @@ void bass_psfilter_fx( { exp = sub( exp, 1 ); } - exp2 = sub( exp, exp2 ); /* exponent num - exponent denom */ - /* alpha = corr / ener */ + exp2 = sub( exp, exp2 ); /* exponent num - exponent denom */ + /* alpha = corr / ener */ alpha = shr_sat( div_s( round_fx_sat( L_shl_sat( Ltmp, exp ) ), tmp2 ), exp2 ); /*Q15 */ if ( Lcorr < 0 ) { @@ -514,8 +514,8 @@ void bass_psfilter_fx( sigPtr1 = syn2_fx + 1; FOR( j = 0; j < subfr_len; j += 2 ) { - Lcorr0 = L_mult0( syn_fx[j], syn2_fx[j] ); /* Q31 */ - Lener0 = L_mult0( syn2_fx[j], syn2_fx[j] ); /* Q31 */ + Lcorr0 = L_mult0( syn_fx[j], syn2_fx[j] ); /* Q31 */ + Lener0 = L_mult0( syn2_fx[j], syn2_fx[j] ); /* Q31 */ Lcorr0 = L_mac0_sat( Lcorr0, sigPtr[j], sigPtr1[j] ); /* Q31 */ Lener0 = L_mac0_sat( Lener0, sigPtr1[j], sigPtr1[j] ); /* Q31 */ diff --git a/lib_dec/cng_dec_fx.c b/lib_dec/cng_dec_fx.c index 1f59b093e..3590dae71 100644 --- a/lib_dec/cng_dec_fx.c +++ b/lib_dec/cng_dec_fx.c @@ -524,7 +524,7 @@ void CNG_dec_fx( FOR( i = 0; i < M; i++ ) { dev = abs_s( sub( lsp_tmp[i], lsp_new[i] ) ); /*Q15*/ - dist = add_o( dist, dev, &Overflow ); /*Q15*/ + dist = add_o( dist, dev, &Overflow ); /*Q15*/ if ( GT_16( dev, max_dev ) ) { max_dev = dev; @@ -569,7 +569,7 @@ void CNG_dec_fx( ELSE { tmp1 = div_s( 1, m1 ); - L_tmp = Mult_32_16( L_tmp, tmp1 ); /* Q6 */ + L_tmp = Mult_32_16( L_tmp, tmp1 ); /* Q6 */ L_tmp = L_sub_sat( L_tmp, L_add_sat( st_fx->lp_ener_fx, st_fx->lp_ener_fx ) ); /* Q6 */ } env[i] = L_tmp; /* Q6 */ @@ -614,7 +614,7 @@ void CNG_dec_fx( exp = norm_l( hTdCngDec->Enew_fx ); L_tmp = L_shl( hTdCngDec->Enew_fx, exp ); /*Q(exp+6)*/ L_tmp = Mult_32_16( L_tmp, shl( st_fx->L_frame, 5 ) ); /*Q(exp+6+5-15=exp-4)*/ - L_tmp = L_shr_sat( L_tmp, sub( exp, 10 ) ); /*Q6*/ + L_tmp = L_shr_sat( L_tmp, sub( exp, 10 ) ); /*Q6*/ exp = norm_l( L_tmp ); fra = Log2_norm_lc( L_shl( L_tmp, exp ) ); exp = sub( sub( 30, exp ), 6 ); @@ -1195,7 +1195,7 @@ void CNG_dec_ivas_fx( FOR( i = 0; i < M; i++ ) { dev = abs_s( sub( lsp_tmp[i], lsp_new[i] ) ); /*Q15*/ - dist = add_o( dist, dev, &Overflow ); /*Q15*/ + dist = add_o( dist, dev, &Overflow ); /*Q15*/ if ( GT_16( dev, max_dev ) ) { max_dev = dev; @@ -1240,7 +1240,7 @@ void CNG_dec_ivas_fx( ELSE { tmp1 = div_s( 1, m1 ); - L_tmp = Mult_32_16( L_tmp, tmp1 ); /* Q6 */ + L_tmp = Mult_32_16( L_tmp, tmp1 ); /* Q6 */ L_tmp = L_sub_sat( L_tmp, L_add_sat( st_fx->lp_ener_fx, st_fx->lp_ener_fx ) ); /* Q6 */ } env[i] = L_tmp; /* Q6 */ @@ -1285,7 +1285,7 @@ void CNG_dec_ivas_fx( exp = norm_l( hTdCngDec->Enew_fx ); L_tmp = L_shl( hTdCngDec->Enew_fx, exp ); /*Q(exp+6)*/ L_tmp = Mult_32_16( L_tmp, shl( st_fx->L_frame, 5 ) ); /*Q(exp+6+5-15=exp-4)*/ - L_tmp = L_shr_sat( L_tmp, sub( exp, 10 ) ); /*Q6*/ + L_tmp = L_shr_sat( L_tmp, sub( exp, 10 ) ); /*Q6*/ exp = norm_l( L_tmp ); fra = Log2_norm_lc( L_shl( L_tmp, exp ) ); exp = sub( sub( 30, exp ), 6 ); @@ -1656,7 +1656,7 @@ static void shb_CNG_decod_fx( move16(); /*Q8 */ IF( st_fx->trans_cnt_fx > 0 ) { - i = extract_l( L_mult0( st_fx->trans_cnt_fx, 17 ) ); /*Q0 */ + i = extract_l( L_mult0( st_fx->trans_cnt_fx, 17 ) ); /*Q0 */ ener_fx = add_sat( st_fx->shb_cng_ener_fx, mult( sin_table256_fx[i], sub_sat( st_fx->last_shb_ener_fx, st_fx->shb_cng_ener_fx ) ) ); /*Q8 */ st_fx->trans_cnt_fx = sub( st_fx->trans_cnt_fx, 1 ); move16(); diff --git a/lib_dec/core_switching_dec_fx.c b/lib_dec/core_switching_dec_fx.c index 7651c5a89..17df8b5ca 100644 --- a/lib_dec/core_switching_dec_fx.c +++ b/lib_dec/core_switching_dec_fx.c @@ -1273,7 +1273,7 @@ ivas_error core_switching_post_dec_fx( FOR( i = 0; i < shift; i++ ) { - L_tmp = L_mult( ( *ptmp1 ), tmpF ); /*Qsynth + 16*/ + L_tmp = L_mult( ( *ptmp1 ), tmpF ); /*Qsynth + 16*/ *ptmp1 = round_fx_sat( L_mac_sat( L_tmp, add_sat( sub( 24576, tmpF ), 8192 ), ( *ptmp2 ) ) ); /*Qsynth*/ ptmp1++; ptmp2++; @@ -1293,7 +1293,7 @@ ivas_error core_switching_post_dec_fx( ptmp2 = hHQ_core->fer_samples_fx; FOR( i = 0; i < shift; i++ ) { - L_tmp = L_mult( ( *ptmp1 ), tmpF ); /*Qsynth + 16*/ + L_tmp = L_mult( ( *ptmp1 ), tmpF ); /*Qsynth + 16*/ *ptmp1 = round_fx_sat( L_mac_sat( L_tmp, add_sat( sub( 24576, tmpF ), 8192 ), ( *ptmp2 ) ) ); /*Qsynth*/ move16(); tmpF = add( tmpF, tmp ); @@ -1717,7 +1717,7 @@ ivas_error core_switching_post_dec_ivas_fx( FOR( i = 0; i < shift; i++ ) { - L_tmp = L_mult( ( *ptmp1 ), tmpF ); /*Qsynth + 16*/ + L_tmp = L_mult( ( *ptmp1 ), tmpF ); /*Qsynth + 16*/ *ptmp1 = round_fx_sat( L_mac_sat( L_tmp, add_sat( sub( 24576, tmpF ), 8192 ), ( *ptmp2 ) ) ); /*Qsynth*/ ptmp1++; ptmp2++; @@ -1737,7 +1737,7 @@ ivas_error core_switching_post_dec_ivas_fx( ptmp2 = hHQ_core->fer_samples_fx; FOR( i = 0; i < shift; i++ ) { - L_tmp = L_mult( ( *ptmp1 ), tmpF ); /*Qsynth + 16*/ + L_tmp = L_mult( ( *ptmp1 ), tmpF ); /*Qsynth + 16*/ *ptmp1 = round_fx_sat( L_mac_sat( L_tmp, add_sat( sub( 24576, tmpF ), 8192 ), ( *ptmp2 ) ) ); /*Qsynth*/ move16(); tmpF = add( tmpF, tmp ); diff --git a/lib_dec/dec_gen_voic_fx.c b/lib_dec/dec_gen_voic_fx.c index 904ccf78f..1abd3d58b 100644 --- a/lib_dec/dec_gen_voic_fx.c +++ b/lib_dec/dec_gen_voic_fx.c @@ -267,7 +267,7 @@ ivas_error decod_gen_voic_fx( exc2_fx[i + i_subfr_fx] = round_fx_sat( L_add_sat( L_tmp, Ltmp1 ) ); // Q_exc move16(); /* gain_pit in Q14 */ - L_tmp = L_mult( gain_code16, code_fx[i] ); // Q_exc+Q9+1 + L_tmp = L_mult( gain_code16, code_fx[i] ); // Q_exc+Q9+1 L_tmp = L_shl_sat( L_tmp, 5 ); // Q_exc+Q9+1+5 L_tmp = L_mac_sat( L_tmp, exc_fx[i + i_subfr_fx], gain_pit_fx ); // Q_exc+Q15 +1 L_tmp = L_shl_sat( L_tmp, 1 ); /* saturation can occur here */ @@ -755,14 +755,14 @@ ivas_error decod_gen_voic_ivas_fx( Word32 Ltmp1; /* Contribution from AVQ layer */ Ltmp1 = L_mult( gain_preQ_fx, code_preQ_fx[i] ); /* Q2 + Q6 -> Q9*/ - Ltmp1 = L_shl_sat( Ltmp1, tmp1_fx ); /* Q16 + Q_exc */ + Ltmp1 = L_shl_sat( Ltmp1, tmp1_fx ); /* Q16 + Q_exc */ /* Compute exc2 */ L_tmp = L_shl_sat( L_mult( gain_pit_fx, exc_fx[i + i_subfr_fx] ), 1 ); exc2_fx[i + i_subfr_fx] = round_fx_sat( L_add_sat( L_tmp, Ltmp1 ) ); // Q_exc move16(); /* gain_pit in Q14 */ - L_tmp = L_mult( gain_code16, code_fx[i] ); // Q_exc+Q9+1 + L_tmp = L_mult( gain_code16, code_fx[i] ); // Q_exc+Q9+1 L_tmp = L_shl_sat( L_tmp, 5 ); // Q_exc+Q9+1+5 L_tmp = L_mac_sat( L_tmp, exc_fx[i + i_subfr_fx], gain_pit_fx ); // Q_exc+16 L_tmp = L_shl_sat( L_tmp, 1 ); /* saturation can occur here */ diff --git a/lib_dec/dec_higher_acelp_fx.c b/lib_dec/dec_higher_acelp_fx.c index 89f6a877e..b1cb2b516 100644 --- a/lib_dec/dec_higher_acelp_fx.c +++ b/lib_dec/dec_higher_acelp_fx.c @@ -83,8 +83,8 @@ void transf_cdbk_dec_fx( } L_tmp = Mult_32_16( gain_code, gain16 ); /* Q16 * Q12 - 15 -> Q13*/ - L_tmp = L_shl_sat( L_tmp, 5 ); /* Q13 -> Q18*/ - *gain_preQ = round_fx_sat( L_tmp ); /* Q2*/ + L_tmp = L_shl_sat( L_tmp, 5 ); /* Q13 -> Q18*/ + *gain_preQ = round_fx_sat( L_tmp ); /* Q2*/ move16(); } ELSE diff --git a/lib_dec/dec_pit_exc_fx.c b/lib_dec/dec_pit_exc_fx.c index b38bf45c1..4e18eebce 100644 --- a/lib_dec/dec_pit_exc_fx.c +++ b/lib_dec/dec_pit_exc_fx.c @@ -292,7 +292,7 @@ void dec_pit_exc_fx( FOR( i = 0; i < L_subfr_fx; i++ ) { L_tmp = L_mult( gain_pitx2, exc_fx[i + i_subfr_fx] ); /*Q16+Q_exc*/ - exc_fx[i + i_subfr_fx] = round_fx_sat( L_tmp ); /*Q_exc*/ + exc_fx[i + i_subfr_fx] = round_fx_sat( L_tmp ); /*Q_exc*/ move16(); } } diff --git a/lib_dec/dec_post_fx.c b/lib_dec/dec_post_fx.c index 3f0984b94..a6e06db54 100644 --- a/lib_dec/dec_post_fx.c +++ b/lib_dec/dec_post_fx.c @@ -1845,7 +1845,7 @@ void scale_st_fx( } /* L_gain_in/L_gain_out in Q14 */ /* overflows if L_gain_in > 2 * L_gain_out */ - g0 = shr_sat( g0, sh_g0 ); /* sh_g0 may be >0, <0, or =0 */ + g0 = shr_sat( g0, sh_g0 ); /* sh_g0 may be >0, <0, or =0 */ g0 = mult_r( g0, AGC_FAC1_FX ); /* L_gain_in/L_gain_out * AGC_FAC1_FX */ } diff --git a/lib_dec/dec_tcx_fx.c b/lib_dec/dec_tcx_fx.c index 269d55c2d..a0556437d 100644 --- a/lib_dec/dec_tcx_fx.c +++ b/lib_dec/dec_tcx_fx.c @@ -1604,7 +1604,7 @@ void decoder_tcx_post_ivas_fx( Decoder_State *st_fx, FOR( i = 0; i < hTcxDec->L_frameTCX; i++ ) { - tmp32 = L_shl( tmp32_1 /*Q28*/, -( 28 - 15 ) ); /*16Q15*/ + tmp32 = L_shl( tmp32_1 /*Q28*/, -( 28 - 15 ) ); /*16Q15*/ synthFB[i] = round_fx_sat( L_shl_sat( Mpy_32_16_1( tmp32, synthFB[i] ), 16 ) ); // Q_syn move16(); tmp32_1 = L_sub( tmp32_1, tmp32_2 ); diff --git a/lib_dec/dec_tran_fx.c b/lib_dec/dec_tran_fx.c index 284c9db8f..e886fd337 100644 --- a/lib_dec/dec_tran_fx.c +++ b/lib_dec/dec_tran_fx.c @@ -234,7 +234,7 @@ void decod_tran_fx( FOR( i = 0; i < L_SUBFR; i++ ) { L_tmp = L_mult( gain_preQ_fx, code_preQ_fx[i] ); /* Q2 + Q10 -> Q13*/ - L_tmp = L_shl_sat( L_tmp, tmp1_fx ); /* Q16 + Q_exc */ + L_tmp = L_shl_sat( L_tmp, tmp1_fx ); /* Q16 + Q_exc */ tmp_fx = round_fx_sat( L_tmp ); exc2_fx[i + i_subfr] = add_sat( exc2_fx[i + i_subfr], tmp_fx ); move16(); diff --git a/lib_dec/er_dec_acelp_fx.c b/lib_dec/er_dec_acelp_fx.c index 658d35843..7c3ecaa0a 100644 --- a/lib_dec/er_dec_acelp_fx.c +++ b/lib_dec/er_dec_acelp_fx.c @@ -646,7 +646,7 @@ void con_acelp_fx( /* non-causal ringing of the FIR filter */ /* gain_16 = gain_32 = gain_inov * gain */ - gain_32 = Mpy_32_16_1( gain_32, gain_inov ); /* 15Q16 * Q15 * 2^s_gain_inov */ + gain_32 = Mpy_32_16_1( gain_32, gain_inov ); /* 15Q16 * Q15 * 2^s_gain_inov */ gain_32 = L_shl_sat( gain_32, add( 15, s_gain_inov ) ); /* Q31 */ gain_16 = round_fx_sat( gain_32 ); /* Q15 */ diff --git a/lib_dec/er_dec_tcx_fx.c b/lib_dec/er_dec_tcx_fx.c index 0a86aba0d..8c10e5f81 100644 --- a/lib_dec/er_dec_tcx_fx.c +++ b/lib_dec/er_dec_tcx_fx.c @@ -719,7 +719,7 @@ void con_tcx_fx( #else tmp16 = 32767; move16(); - gainSynthDeemph = getLevelSynDeemph_fx( &( tmp16 ), A_local, M, shr( L_frame, 2 ), st->preemph_fac, 1, &gainSynthDeemph_e ); /*Q5*/ + gainSynthDeemph = getLevelSynDeemph_fx( &( tmp16 ), A_local, M, shr( L_frame, 2 ), st->preemph_fac, 1, &gainSynthDeemph_e ); /*Q5*/ #endif IF( st->tcxonly != 0 ) { diff --git a/lib_dec/er_scale_syn_fx.c b/lib_dec/er_scale_syn_fx.c index d5731f4ab..35ad82648 100644 --- a/lib_dec/er_scale_syn_fx.c +++ b/lib_dec/er_scale_syn_fx.c @@ -98,9 +98,9 @@ Word16 Damping_fact_fx( /* o : damping factor gain32 = Sqrt32( lp_tmp, &s_gainp ); /*Q31-s_gainp*/ gain = round_fx_o( L_shl_o( gain32, s_gainp, &Overflow ), &Overflow ); /* Q15*/ - gain = s_min( gain, 32113 /*0.98f Q15*/ ); /*Q15*/ - gain = s_max( gain, 27853 /*0.85f Q15*/ ); /*Q15*/ - alpha = mult_r( alpha, gain ); /*Q14*/ + gain = s_min( gain, 32113 /*0.98f Q15*/ ); /*Q15*/ + gain = s_max( gain, 27853 /*0.85f Q15*/ ); /*Q15*/ + alpha = mult_r( alpha, gain ); /*Q14*/ } ELSE IF( EQ_16( nbLostCmpt, 2 ) ) { diff --git a/lib_dec/er_sync_exc_fx.c b/lib_dec/er_sync_exc_fx.c index 9ba45e2a4..48be80d43 100644 --- a/lib_dec/er_sync_exc_fx.c +++ b/lib_dec/er_sync_exc_fx.c @@ -52,15 +52,15 @@ static Word16 GetMinimumPosition_fx( move16(); FOR( i = 0; i < cnt; i++ ) { - tmp16 = shr( x[i], tmp_e ); /*Qx*/ + tmp16 = shr( x[i], tmp_e ); /*Qx*/ energy = L_msu_sat( energy_old, tmp16, tmp16 ); /*2Qx+1*/ - tmp16 = shr( x[( i + filterLength )], tmp_e ); /*Qx*/ - BASOP_SATURATE_WARNING_OFF_EVS /*Saturation will be handled*/ + tmp16 = shr( x[( i + filterLength )], tmp_e ); /*Qx*/ + BASOP_SATURATE_WARNING_OFF_EVS /*Saturation will be handled*/ energy = L_mac_sat( energy, tmp16, tmp16 ); /*2Qx+1*/ BASOP_SATURATE_WARNING_ON_EVS /*if (energy == MAXVAL_WORD32)*/ - BASOP_SATURATE_WARNING_OFF_EVS /*saturates if energy < 0*/ + BASOP_SATURATE_WARNING_OFF_EVS /*saturates if energy < 0*/ tmptest = L_sub_o( energy, MAXVAL_WORD32, &Overflow ); /*Q31*/ BASOP_SATURATE_WARNING_ON_EVS IF( tmptest == 0 ) @@ -360,7 +360,7 @@ void PulseResynchronization_fx( fractionalLeft = lshr( extract_l( tmp32_a ), 1 ); /*Q15*/ tmp_e = sub( 15, norm_l( tmp32 ) ); cycleDelta_e = add( cycleDelta_e, tmp_e ); - tmp32 = L_shr( tmp32, sub( tmp_e, 15 ) ); /*Q31 frac, cycleDelta_e*/ + tmp32 = L_shr( tmp32, sub( tmp_e, 15 ) ); /*Q31 frac, cycleDelta_e*/ cycleDelta = round_fx_o( tmp32, &Overflow ); /*Q15, cycleDelta_e*/ if ( cycleDelta == 0 ) { diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index ac77e30a7..c164d9e06 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -997,7 +997,7 @@ Word16 ApplyFdCng_fx( L_tmp_exp = add( L_tmp_exp, -7 ); /*->Q16, L_tmp_exp */ L_tmp_exp = add( L_tmp_exp, 31 - 16 ); /*->Q31, L_tmp_exp*/ - st->cngTDLevel = round_fx_o( Sqrt32( L_tmp, &L_tmp_exp ), &Overflow ); /*Q15 - L_tmp_exp*/ + st->cngTDLevel = round_fx_o( Sqrt32( L_tmp, &L_tmp_exp ), &Overflow ); /*Q15 - L_tmp_exp*/ move16(); st->cngTDLevel_e = L_tmp_exp; move16(); diff --git a/lib_dec/gain_dec_fx.c b/lib_dec/gain_dec_fx.c index 38b933b81..6f490b89f 100644 --- a/lib_dec/gain_dec_fx.c +++ b/lib_dec/gain_dec_fx.c @@ -182,7 +182,7 @@ void gain_dec_tc_fx( *-----------------------------------------------------------------*/ /* *gain_code *= gcode0;*/ - L_tmp = L_mult( wgain_code, gcode0_fx ); /* Q13*Q0 -> Q14 */ + L_tmp = L_mult( wgain_code, gcode0_fx ); /* Q13*Q0 -> Q14 */ *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 2 ) ); /*Q16*/ move32(); @@ -453,7 +453,7 @@ void gain_dec_mless_fx( gain_code16 = gain_dequant_fx( index, G_CODE_MIN_TC192_Q15, G_CODE_MAX_TC192_Q0, shr( add( nBits, 1 ), 1 ), &expg ); /**gain_code *= gcode0;*/ - L_tmp = L_mult( gain_code16, gcode0_fx ); /*Q0*Q0 -> Q1*/ + L_tmp = L_mult( gain_code16, gcode0_fx ); /*Q0*Q0 -> Q1*/ *gain_code_fx = L_shl_sat( L_tmp, add( add( expg, exp_gcode0 ), 15 ) ); /*Q16*/ move32(); } @@ -548,7 +548,7 @@ void gain_dec_mless_fx( /**gain_code = qua_table[index * 2 + 1] * gcode0;*/ L_tmp = L_mult( qua_table_fx[( ( index * 2 ) + 1 )], gcode0_fx ); /* Q9*Q0 -> Q10 */ - *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /*Q16*/ + *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /*Q16*/ move32(); } @@ -715,7 +715,7 @@ void gain_dec_lbr_fx( move16(); L_tmp = L_mult( cdbk_fx[( ( index * 2 ) + 1 )], gcode0_fx ); /* Q9*Q0 -> Q10 */ - *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /* Q10 -> Q16*/ + *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /* Q10 -> Q16*/ move16(); gc_mem[0] = *gain_code_fx; /*Q16*/ @@ -785,7 +785,7 @@ void gain_dec_lbr_fx( move16(); L_tmp = L_mult( cdbk_fx[( ( index * 2 ) + 1 )], gcode0_fx ); /* Q9*Q0 -> Q10 */ - *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /*Q16*/ + *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /*Q16*/ move16(); gc_mem[1] = *gain_code_fx; /*Q16*/ @@ -859,7 +859,7 @@ void gain_dec_lbr_fx( move16(); L_tmp = L_mult( cdbk_fx[( ( index * 2 ) + 1 )], gcode0_fx ); /* Q9*Q0 -> Q10 */ - *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /* Q10 -> Q16*/ + *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /* Q10 -> Q16*/ move32(); gc_mem[2] = *gain_code_fx; /*Q16*/ move32(); @@ -943,7 +943,7 @@ void gain_dec_lbr_fx( move16(); L_tmp = L_mult( cdbk_fx[( ( index * 2 ) + 1 )], gcode0_fx ); /* Q9*Q0 -> Q10 */ - *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /*Q16*/ + *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /*Q16*/ move32(); } @@ -1085,7 +1085,7 @@ void gain_dec_lbr_ivas_fx( move16(); L_tmp = L_mult( cdbk_fx[( ( index * 2 ) + 1 )], gcode0_fx ); /* Q9*Q0 -> Q10 */ - *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /*Q16*/ + *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /*Q16*/ move16(); gc_mem[0] = *gain_code_fx; /*Q16*/ @@ -1155,7 +1155,7 @@ void gain_dec_lbr_ivas_fx( move16(); L_tmp = L_mult( cdbk_fx[( ( index * 2 ) + 1 )], gcode0_fx ); /* Q9*Q0 -> Q10 */ - *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /*Q16*/ + *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /*Q16*/ move16(); gc_mem[1] = *gain_code_fx; /*Q16*/ @@ -1229,7 +1229,7 @@ void gain_dec_lbr_ivas_fx( move16(); L_tmp = L_mult( cdbk_fx[( ( index * 2 ) + 1 )], gcode0_fx ); /* Q9*Q0 -> Q10 */ - *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /* Q10 -> Q16*/ + *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /* Q10 -> Q16*/ move32(); gc_mem[2] = *gain_code_fx; /*Q16*/ move32(); @@ -1312,7 +1312,7 @@ void gain_dec_lbr_ivas_fx( move16(); L_tmp = L_mult( cdbk_fx[( ( index * 2 ) + 1 )], gcode0_fx ); /* Q9*Q0 -> Q10 */ - *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /*Q16*/ + *gain_code_fx = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /*Q16*/ move32(); } diff --git a/lib_dec/gs_dec_amr_wb_fx.c b/lib_dec/gs_dec_amr_wb_fx.c index f55eef3db..65e9eaa87 100644 --- a/lib_dec/gs_dec_amr_wb_fx.c +++ b/lib_dec/gs_dec_amr_wb_fx.c @@ -151,7 +151,7 @@ static void Apply_gain_fx( { EndBin = add( CurBin, crit_bins[i_band] ); /* Q0 */ y_gain_exp = norm_l( L_Ener_per_bd_yQ[i_band] ); - exp3 = norm_l( L_Ener_per_bd_iQ[i_band] ); /* use 'exp3' as temporary exponent of 'L_Ener_per_bd_iQ[]' */ + exp3 = norm_l( L_Ener_per_bd_iQ[i_band] ); /* use 'exp3' as temporary exponent of 'L_Ener_per_bd_iQ[]' */ y_gain_fx = round_fx_sat( Div_flt32_flt32( L_shl_sat( L_Ener_per_bd_iQ[i_band], exp3 ), exp3, L_shl_sat( L_Ener_per_bd_yQ[i_band], y_gain_exp ), y_gain_exp, &y_gain_exp ) ); /* y_gain_exp - 31 + Q_out */ y_gain_exp = add( sub( y_gain_exp, 31 ), Q_out ); exp3 = sub( y_gain_exp, 16 - 1 ); diff --git a/lib_dec/hf_synth_fx.c b/lib_dec/hf_synth_fx.c index 2c25612cb..06bb92c46 100644 --- a/lib_dec/hf_synth_fx.c +++ b/lib_dec/hf_synth_fx.c @@ -607,7 +607,7 @@ void hf_synth_amr_wb_fx( } L_tmp = L_mult( fmerit_w, add_sat( 16384, voice_fac ) ); /* Q14 */ - fmerit_w = extract_l( L_shr( L_tmp, 15 ) ); /*Q14 */ + fmerit_w = extract_l( L_shr( L_tmp, 15 ) ); /*Q14 */ /**fmerit_w_sm = add(mult_r(*fmerit_w_sm, 29491), mult_r(fmerit_w, 3277)); //Q14 */ hAmrwb_IO->fmerit_w_sm_fx = round_fx( L_mac( L_mult( hAmrwb_IO->fmerit_w_sm_fx, 29491 ), fmerit_w, 3277 ) ); /*Q14 */ move16(); @@ -847,7 +847,7 @@ void hf_synth_amr_wb_fx( L_tmp = L_mult( ener, scale ); /*30-q1+q2 */ q2 = sub( q1, q2 ); /*30-q2 */ scale = round_fx( Isqrt( L_shl( L_tmp, sub( q2, 24 ) ) ) ); /*Q12 */ - scale = round_fx_sat( L_shl_sat( L_mult( scale, gamma ), 4 ) ); /*Q15 */ + scale = round_fx_sat( L_shl_sat( L_mult( scale, gamma ), 4 ) ); /*Q15 */ } ELSE { @@ -989,8 +989,8 @@ void hf_synth_amr_wb_fx( scale = div_s( shl( 1, 14 ), scale ); /*Q(29-q3) */ L_tmp = L_mult( scale, ener ); /*Q(29-q3+q1+1) */ shift = norm_l( L_tmp ); - L_tmp = L_shl( L_tmp, shift ); /*Q(29-q3+q1+1+shift) */ - scale = round_fx_sat( L_tmp ); /*Q(29-q3+q1+1+shift-16) */ + L_tmp = L_shl( L_tmp, shift ); /*Q(29-q3+q1+1+shift) */ + scale = round_fx_sat( L_tmp ); /*Q(29-q3+q1+1+shift-16) */ L_tmp = L_mult( scale, e_subfr2 ); /*Q(29-q3+q1+1+shift-16+q4+1)=Q(15+q1-q3+q4+shift) */ q3 = sub( 15, q3 ); q3 = add( q3, q1 ); @@ -1068,9 +1068,9 @@ static void hf_synthesis_amr_wb_fx( ener = extract_h( L_tmp ); /*Q(q1+q3); */ q1 = add( q1, q3 ); - scale = div_s( shl( 1, 14 ), ener ); /*Q(29-q1) */ - L_tmp = L_mult( tmp, scale ); /*30-q1+q2 */ - q2 = sub( q1, q2 ); /*30-q2 */ + scale = div_s( shl( 1, 14 ), ener ); /*Q(29-q1) */ + L_tmp = L_mult( tmp, scale ); /*30-q1+q2 */ + q2 = sub( q1, q2 ); /*30-q2 */ scale = round_fx_sat( Isqrt( L_shl_sat( L_tmp, sub( q2, 24 ) ) ) ); /*Q12 */ pt1 = exc16k; pt2 = exc2385; @@ -1100,9 +1100,9 @@ static void hf_synthesis_amr_wb_fx( ener = extract_h( L_tmp ); /*Q(q1+q3); */ q1 = add( q1, q3 ); - scale = div_s( shl( 1, 14 ), ener ); /*Q(29-q1) */ - L_tmp = L_mult( tmp, scale ); /*30-q1+q2 */ - q2 = sub( q1, q2 ); /*30-q2 */ + scale = div_s( shl( 1, 14 ), ener ); /*Q(29-q1) */ + L_tmp = L_mult( tmp, scale ); /*30-q1+q2 */ + q2 = sub( q1, q2 ); /*30-q2 */ scale = round_fx_sat( Isqrt( L_shl_sat( L_tmp, sub( q2, 24 ) ) ) ); /*Q12 */ flag = negate( s_and( til, -0x8000 ) ); if ( GT_16( scale, 4096 /* 1.0f in Q12 */ ) ) @@ -1375,10 +1375,10 @@ static void envelope_fx( ry = round_fx( L_shr( L_tmp, 1 ) ); /*Q(10+q2)*/ L_tmp = L_mult( px, px ); - L_tmp = L_mac( L_tmp, py, py ); /*Q(21+2*q1)*/ + L_tmp = L_mac( L_tmp, py, py ); /*Q(21+2*q1)*/ pp = round_fx_sat( Isqrt( L_shr( L_tmp, add( 11, shl( q1, 1 ) ) ) ) ); /*Q10*/ L_tmp = L_mult( rx, rx ); - L_tmp = L_mac( L_tmp, ry, ry ); /*Q(21+2*q1)*/ + L_tmp = L_mac( L_tmp, ry, ry ); /*Q(21+2*q1)*/ rr = round_fx_sat( Isqrt( L_shr( L_tmp, add( 11, shl( q2, 1 ) ) ) ) ); /*Q10*/ Copy( Aq, As, 3 ); IF( EQ_16( shr( As[2], 1 ), -2048 /* -1.0f in Q11 */ ) ) @@ -1502,10 +1502,10 @@ static void envelope_fx( rr = round_fx( L_shl( L_tmp, 3 ) ); /*Q10*/ L_tmp = L_mult( tilt, sub( 26214 /* 1.6f in Q14 */, shr( voice_factor, 1 ) ) ); /*Q28*/ L_tmp = L_max( L_tmp, 268435456 /* 1 in Q28 */ ); - L_tmp = Mult_32_16( L_tmp, qq ); /*Q23*/ + L_tmp = Mult_32_16( L_tmp, qq ); /*Q23*/ qq = round_fx_sat( L_shl_sat( L_tmp, 3 ) ); /*Q10*/ - rr = s_min( rr, qq ); /* Q10 */ - rr = s_max( rr, pp ); /* Q10 */ + rr = s_min( rr, qq ); /* Q10 */ + rr = s_max( rr, pp ); /* Q10 */ } ELSE { @@ -1518,7 +1518,7 @@ static void envelope_fx( alpha = round_fx( L_shl( L_tmp, 9 ) ); /*Q14*/ L_tmp = L_mult( alpha, ( hAmrwb_IO->prev_r_fx ) ); /*Q25*/ L_tmp = L_mac( L_tmp, tmp, rr ); /*Q25*/ - rr = round_fx_sat( L_shl_sat( L_tmp, 1 ) ); /*Q10*/ + rr = round_fx_sat( L_shl_sat( L_tmp, 1 ) ); /*Q10*/ } hAmrwb_IO->prev_r_fx = rr; diff --git a/lib_dec/hq_lr_dec_fx.c b/lib_dec/hq_lr_dec_fx.c index ffcdab457..61c1d0938 100644 --- a/lib_dec/hq_lr_dec_fx.c +++ b/lib_dec/hq_lr_dec_fx.c @@ -504,9 +504,9 @@ void hq_lr_dec_fx( L_tmp = Mult_32_16( Ep_tmp_fx[i], sub( bands_fx, lowband ) ); /*Q(13+0-15 = -2) */ tmp = Calc_inv( L_shl_sat( L_tmp, 14 ), &exp ); L_tmp = L_shl_sat( Mult_32_16( Ep_avrg_fx, tmp ), sub( 14, exp ) ); /*Q(13+exp-15 +14-exp+2 = 14) */ - L_tmp = L_max( L_tmp, 16384 ); /*14 */ - tmp = extract_l( L_min( L_tmp, beta_fx ) ); /*14 */ - alpha_fx = shl( mult( alpha_fx, tmp ), 1 ); /*14+14-15 +1=14 */ + L_tmp = L_max( L_tmp, 16384 ); /*14 */ + tmp = extract_l( L_min( L_tmp, beta_fx ) ); /*14 */ + alpha_fx = shl( mult( alpha_fx, tmp ), 1 ); /*14+14-15 +1=14 */ } ELSE { diff --git a/lib_dec/igf_dec_fx.c b/lib_dec/igf_dec_fx.c index eb833a883..c09ca95ef 100644 --- a/lib_dec/igf_dec_fx.c +++ b/lib_dec/igf_dec_fx.c @@ -1884,7 +1884,7 @@ static void IGF_appl( IGF_DEC_PRIVATE_DATA_HANDLE hPrivateData, /**< in /* divide E by sum */ tmp = div_s( shr( round_fx_o( E, &Overflow ), 1 ), sum ); /* shift E 1 bit to the right in order to make it smaller than sum */ - tmp_e = sub( add( E_e, 1 ), sub( 15, shift ) ); /* 15Q0 | sum is 15Q0 */ + tmp_e = sub( add( E_e, 1 ), sub( 15, shift ) ); /* 15Q0 | sum is 15Q0 */ /* multiply the result by the hopsize */ L_tmp = L_mult( tmp, hopsize ); @@ -2015,7 +2015,7 @@ static void IGF_appl( IGF_DEC_PRIVATE_DATA_HANDLE hPrivateData, /**< in move16(); /* gain[sfb] = min(gain[sfb], 12.f); */ - BASOP_SATURATE_WARNING_OFF_EVS /* threshold, may overflow */ + BASOP_SATURATE_WARNING_OFF_EVS /* threshold, may overflow */ tmp = shl_sat( gain[sfb], sub( gain_e[sfb], 15 - 5 ) ); /* 10Q5 | tmp is in 10Q5 */ BASOP_SATURATE_WARNING_ON_EVS @@ -2571,7 +2571,7 @@ static void IGF_appl_ivas( IGF_DEC_PRIVATE_DATA_HANDLE hPrivateData, /**< in /* divide E by sum */ tmp = div_s( shr( round_fx_o( E, &Overflow ), 1 ), sum ); /* shift E 1 bit to the right in order to make it smaller than sum */ - tmp_e = sub( add( E_e, 1 ), sub( 15, shift ) ); /* 15Q0 | sum is 15Q0 */ + tmp_e = sub( add( E_e, 1 ), sub( 15, shift ) ); /* 15Q0 | sum is 15Q0 */ /* multiply the result by the hopsize */ L_tmp = L_mult( tmp, hopsize ); @@ -2658,7 +2658,7 @@ static void IGF_appl_ivas( IGF_DEC_PRIVATE_DATA_HANDLE hPrivateData, /**< in move16(); /* gain[sfb] = min(gain[sfb], 12.f); */ - BASOP_SATURATE_WARNING_OFF_EVS /* threshold, may overflow */ + BASOP_SATURATE_WARNING_OFF_EVS /* threshold, may overflow */ tmp = shl_sat( gain[sfb], sub( gain_e[sfb], 15 - 5 ) ); /* 10Q5 | tmp is in 10Q5 */ BASOP_SATURATE_WARNING_ON_EVS diff --git a/lib_dec/pitch_extr_fx.c b/lib_dec/pitch_extr_fx.c index 279efc733..73e9623f5 100644 --- a/lib_dec/pitch_extr_fx.c +++ b/lib_dec/pitch_extr_fx.c @@ -181,7 +181,7 @@ void pitch_pred_linear_fit( t7 = BASOP_Util_Add_Mant32Exp( t5, e5, t6, e6, &e7 ); /*Q31,e7*/ sum0_q = norm_l( t7 ); sum0 = round_fx_o( L_shl( t7, sum0_q ), &Overflow ); /*Q15,e7-sum0_q*/ - sum0_q = add( 15, sub( sum0_q, e7 ) ); /* sum0 is now Qsum0_q*/ + sum0_q = add( 15, sub( sum0_q, e7 ) ); /* sum0 is now Qsum0_q*/ } pit = 0; diff --git a/lib_dec/ppp_dec_fx.c b/lib_dec/ppp_dec_fx.c index 450c1dfe5..00a333798 100644 --- a/lib_dec/ppp_dec_fx.c +++ b/lib_dec/ppp_dec_fx.c @@ -113,7 +113,7 @@ static void DTFS_dequant_cw_fx( /* Power Dequantization */ - tmp_fx = shl( POWER_IDX_fx, 1 ); /* tmp=2*POWER_IDX */ + tmp_fx = shl( POWER_IDX_fx, 1 ); /* tmp=2*POWER_IDX */ *lastLgainD_fx = add_sat( *lastLgainD_fx, PowerCB_fx[tmp_fx] ); /* Q11 */ *lastHgainD_fx = add_sat( *lastHgainD_fx, PowerCB_fx[tmp_fx + 1] ); /* Q11 */ move16(); diff --git a/lib_dec/swb_bwe_dec_fx.c b/lib_dec/swb_bwe_dec_fx.c index 9a181e9d9..7a6abb790 100644 --- a/lib_dec/swb_bwe_dec_fx.c +++ b/lib_dec/swb_bwe_dec_fx.c @@ -1101,7 +1101,7 @@ Word16 swb_bwe_dec_fx( /*o :Q_syn_hb*/ IF( SWB_fenv_fx[7] != 0 ) { tmp = div_s( 1, SWB_fenv_fx[7] ); - move16(); /*Q14*/ + move16(); /*Q14*/ ener_adjust_quan_fx = s_min( shr( i_mult_sat( SWB_fenv_fx[13], tmp ), 2 ), 32767 ); /*Q13*/ } ELSE diff --git a/lib_dec/swb_tbe_dec.c b/lib_dec/swb_tbe_dec.c index 39e4ddb01..903ceb4ee 100644 --- a/lib_dec/swb_tbe_dec.c +++ b/lib_dec/swb_tbe_dec.c @@ -2073,7 +2073,7 @@ void ivas_swb_tbe_dec_fx( { L_tmp = root_a_over_b_fx( hBWE_TD->prev_swb_bwe_frame_pow_fx, curr_frame_pow_exp, curr_frame_pow_fx, curr_frame_pow_exp, &exp ); L_tmp = L_min( L_tmp, L_shl_sat( 2, sub( 31, exp ) ) ); /*31 - exp*/ - scale_fx = round_fx( L_shl( L_tmp, sub( exp, 3 ) ) ); /*Q12*/ + scale_fx = round_fx( L_shl( L_tmp, sub( exp, 3 ) ) ); /*Q12*/ L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); diff --git a/lib_dec/swb_tbe_dec_fx.c b/lib_dec/swb_tbe_dec_fx.c index fb78835e0..28ac01671 100644 --- a/lib_dec/swb_tbe_dec_fx.c +++ b/lib_dec/swb_tbe_dec_fx.c @@ -953,7 +953,7 @@ void ivas_wb_tbe_dec_fx( FOR( i = 0; i < L_SHB_LAHEAD / 4 - 1; i++ ) { - L_tmp = Mult_32_16( Lscale, shaped_wb_excitation[i] ); /* Q(16-exp+Q_bwe_exc_ext) */ + L_tmp = Mult_32_16( Lscale, shaped_wb_excitation[i] ); /* Q(16-exp+Q_bwe_exc_ext) */ shaped_wb_excitation[i] = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /* Q_bwe_exc_ext */ move16(); } @@ -1193,7 +1193,7 @@ void ivas_wb_tbe_dec_fx( tmp = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); exp = sub( add( exp, 22 ), 30 ); tmp = div_s( 16384, tmp ); - L_tmp = Isqrt_lc( L_deposit_h( tmp ), &exp ); /* Q(31-exp) */ + L_tmp = Isqrt_lc( L_deposit_h( tmp ), &exp ); /* Q(31-exp) */ st_fx->last_wb_bwe_ener_fx = round_fx_sat( L_shl_sat( L_tmp, add( exp, sub( n, 12 ) ) ) ); /* Q3 */ move16(); } @@ -1592,7 +1592,7 @@ void wb_tbe_dec_fx( FOR( i = 0; i < L_SHB_LAHEAD / 4 - 1; i++ ) { - L_tmp = Mult_32_16( Lscale, shaped_wb_excitation[i] ); /* Q(16-exp+Q_bwe_exc_ext) */ + L_tmp = Mult_32_16( Lscale, shaped_wb_excitation[i] ); /* Q(16-exp+Q_bwe_exc_ext) */ shaped_wb_excitation[i] = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /* Q_bwe_exc_ext */ move16(); } @@ -1829,7 +1829,7 @@ void wb_tbe_dec_fx( tmp = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); exp = sub( add( exp, 22 ), 30 ); tmp = div_s( 16384, tmp ); - L_tmp = Isqrt_lc( L_deposit_h( tmp ), &exp ); /* Q(31-exp) */ + L_tmp = Isqrt_lc( L_deposit_h( tmp ), &exp ); /* Q(31-exp) */ st_fx->last_wb_bwe_ener_fx = round_fx_sat( L_shl_sat( L_tmp, add( exp, sub( n, 12 ) ) ) ); /* Q3 */ move16(); } @@ -2861,7 +2861,7 @@ void swb_tbe_dec_fx( move16(); /*st_fx->Q_syn2 -1 + 26- exp_ener -15 -(st_fx->Q_syn2 -exp_ener -15 ) -16 = (11) 0.25*/ } - L_tmp = L_mult0( st_fx->prev_ener_shb_fx, inv_ener ); /*Q(1+15+14-3-exp_ener) = 27 -exp_ener*/ + L_tmp = L_mult0( st_fx->prev_ener_shb_fx, inv_ener ); /*Q(1+15+14-3-exp_ener) = 27 -exp_ener*/ GainFrame_prevfrm_fx = L_shr_sat( L_tmp, sub( 9, exp_ener ) ); /*27 -exp_ener -(9-exp_ener )= Q18*/ } ELSE @@ -2922,8 +2922,8 @@ void swb_tbe_dec_fx( { ener = s_max( 1, ener ); exp_ener = norm_s( ener ); - tmp = shl( ener, exp_ener ); /*Q(3+exp)*/ - inv_ener = div_s( 16384, tmp ); /*Q(15+14-3-exp)*/ + tmp = shl( ener, exp_ener ); /*Q(3+exp)*/ + inv_ener = div_s( 16384, tmp ); /*Q(15+14-3-exp)*/ prev_ener_ratio_fx = L_shr_sat( L_mult0( st_fx->prev_ener_shb_fx, inv_ener ), sub( 9, exp_ener ) ); /*Q: 1+26-exp-9+exp = 18 */ } @@ -3315,7 +3315,7 @@ void swb_tbe_dec_fx( { L_tmp = root_a_over_b_fx( hBWE_TD->prev_swb_bwe_frame_pow_fx, curr_frame_pow_exp, curr_frame_pow, curr_frame_pow_exp, &exp ); L_tmp = L_min( L_tmp, L_shl_sat( 2, sub( 31, exp ) ) ); /*31 - exp*/ - scale = round_fx( L_shl( L_tmp, sub( exp, 3 ) ) ); /*Q12*/ + scale = round_fx( L_shl( L_tmp, sub( exp, 3 ) ) ); /*Q12*/ L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); L_tmp = root_a_fx( L_tmp, sub( 31, exp ), &exp ); diff --git a/lib_dec/tonalMDCTconcealment_fx.c b/lib_dec/tonalMDCTconcealment_fx.c index f59bdac7e..22306cc56 100644 --- a/lib_dec/tonalMDCTconcealment_fx.c +++ b/lib_dec/tonalMDCTconcealment_fx.c @@ -1428,7 +1428,7 @@ void TonalMDCTConceal_InsertNoise_ivas_fx( inv_samples = Inv16( hTonalMDCTConc->lastBlockData.nSamples, &inv_exp ); // Q31-inv_exp tiltFactor = round_fx( BASOP_Util_fPow( L_max( L_tmp, L_deposit_h( tiltCompFactor ) ), 0, L_deposit_h( inv_samples ), inv_exp, &exp ) ); // Q15 - exp BASOP_SATURATE_WARNING_OFF_EVS /*next op may result in 32768*/ - tiltFactor = shl_sat( tiltFactor, exp ); // Q15 + tiltFactor = shl_sat( tiltFactor, exp ); // Q15 BASOP_SATURATE_WARNING_ON_EVS tilt = MAX16B; move16(); @@ -2457,7 +2457,7 @@ void TonalMDCTConceal_InsertNoise( move16(); inv_samples = Inv16( hTonalMDCTConc->lastBlockData.nSamples, &inv_exp ); tiltFactor = round_fx( BASOP_Util_fPow( L_max( L_tmp, L_deposit_h( tiltCompFactor ) ), 0, L_deposit_h( inv_samples ), inv_exp, &exp ) ); - BASOP_SATURATE_WARNING_OFF_EVS /*next op may result in 32768*/ + BASOP_SATURATE_WARNING_OFF_EVS /*next op may result in 32768*/ tiltFactor = shl_sat( tiltFactor, exp ); // Q15- 2*exp BASOP_SATURATE_WARNING_ON_EVS diff --git a/lib_dec/voiced_dec_fx.c b/lib_dec/voiced_dec_fx.c index 25029f1cb..c937a3b2b 100644 --- a/lib_dec/voiced_dec_fx.c +++ b/lib_dec/voiced_dec_fx.c @@ -242,7 +242,7 @@ ivas_error ppp_voiced_decoder_fx( /* Compensate for Q factor of energy to get log10(lag*eng) */ - Ltemp = log10_fx( Ltemp ); /* Ltemp=10log10(eng), Q23 */ + Ltemp = log10_fx( Ltemp ); /* Ltemp=10log10(eng), Q23 */ Ltemp = L_add_sat( L_sub_sat( Ltemp, Ltemp_q ), logLag ); /* Ltemp=10*log10(lag*eng), Q23 */ hSC_VBR->lastLgainD_fx = round_fx_sat( L_shl_sat( (Word32) Mpy_32_16( extract_h( Ltemp ), extract_l( Ltemp ), 0x6666 ), 1 ) ); /* Q11 */ move16(); @@ -252,7 +252,7 @@ ivas_error ppp_voiced_decoder_fx( Ltemp = DTFS_setEngyHarm_fx( 2828, upper_cut_off_freq_of_interest, 2828, upper_cut_off_freq, 1, 0, &Qh, TMPDTFS_FX ); - Ltemp = log10_fx( Ltemp ); // Q23 + Ltemp = log10_fx( Ltemp ); // Q23 Ltemp = L_add_sat( L_sub_sat( Ltemp, Ltemp_q ), logLag ); /* Ltemp=10*log10(lag*eng), Q23 */ hSC_VBR->lastHgainD_fx = round_fx_sat( L_shl_sat( (Word32) Mpy_32_16( extract_h( Ltemp ), extract_l( Ltemp ), 0x6666 ), 1 ) ); /* Q11 */ move16(); diff --git a/lib_enc/acelp_core_switch_enc_fx.c b/lib_enc/acelp_core_switch_enc_fx.c index 684cc09f2..d521d85a2 100644 --- a/lib_enc/acelp_core_switch_enc_fx.c +++ b/lib_enc/acelp_core_switch_enc_fx.c @@ -492,7 +492,7 @@ static void encod_gen_voic_core_switch_fx( { /* code in Q9, gain_pit in Q14 */ L_tmp = L_mult( gcode16, code[i] ); /* Q10 */ - L_tmp = L_shl_sat( L_tmp, 5 ); /* Q15 */ + L_tmp = L_shl_sat( L_tmp, 5 ); /* Q15 */ L_tmp = L_mac_sat( L_tmp, exc[i], gain_pit ); L_tmp = L_shl_sat( L_tmp, 1 ); /* saturation can occur here */ exc[i] = round_fx_sat( L_tmp ); /* Q_exc */ @@ -701,7 +701,7 @@ static void encod_gen_voic_core_switch_ivas_fx( { /* code in Q9, gain_pit in Q14 */ L_tmp = L_mult( gcode16, code[i] ); /* Q10 */ - L_tmp = L_shl_sat( L_tmp, 5 ); /* Q15 */ + L_tmp = L_shl_sat( L_tmp, 5 ); /* Q15 */ L_tmp = L_mac_sat( L_tmp, exc[i], gain_pit ); L_tmp = L_shl_sat( L_tmp, 1 ); /* saturation can occur here */ exc[i] = round_fx_sat( L_tmp ); /* Q_exc */ @@ -875,7 +875,7 @@ static void bwe_switch_enc_fx( L_tmp1 = L_mult( tmp, E2_fx ); /*30-q_tmp1+q_tmp2 */ q_tmp2 = sub( q_tmp1, q_tmp2 ); /*30-q_tmp2 */ L_tmp1 = L_shl( L_tmp1, sub( q_tmp2, 24 ) ); - gain_fx = round_fx_o( Isqrt( L_tmp1 ), &Overflow ); /*Q12 */ + gain_fx = round_fx_o( Isqrt( L_tmp1 ), &Overflow ); /*Q12 */ ind1_fx = usquant_fx( gain_fx, &gain_fx, shr( MINVALUEOFFIRSTGAIN_FX, 1 ), shr( DELTAOFFIRSTGAIN_FX, 4 ), ( 1 << NOOFGAINBITS1 ) ); /* Q0 */ push_indice_fx( hBstr, IND_CORE_SWITCHING_AUDIO_GAIN, ind1_fx, NOOFGAINBITS1 ); diff --git a/lib_enc/acelp_enc_util_fx.c b/lib_enc/acelp_enc_util_fx.c index 9cff4bfcb..181583e91 100644 --- a/lib_enc/acelp_enc_util_fx.c +++ b/lib_enc/acelp_enc_util_fx.c @@ -174,7 +174,7 @@ void E_ACELP_conv( /*cn2[k]-=cn2[i]*h2[k-i];*/ L_tmp_64 = W_msu0_16_16( L_tmp_64, cn2[i], h2[k - i] ); /*h2 4Q11*/ } - L_tmp = W_sat_l( L_tmp_64 ); /* 4Q11 */ + L_tmp = W_sat_l( L_tmp_64 ); /* 4Q11 */ cn2[k] = round_fx_o( L_shl_o( L_tmp, 5, &Overflow ), &Overflow ); /* Q0 */ } } @@ -200,7 +200,7 @@ void E_ACELP_conv_ivas_fx( /*cn2[k]-=cn2[i]*h2[k-i];*/ L_tmp_64 = W_msu0_16_16( L_tmp_64, cn2[i], h2[k - i] ); /*h2 4Q11*/ } - L_tmp = W_sat_l( L_tmp_64 ); /* 4Q11 */ + L_tmp = W_sat_l( L_tmp_64 ); /* 4Q11 */ cn2[k] = round_fx_o( L_shl_o( L_tmp, 5, &Overflow ), &Overflow ); /* Q0*/ move16(); } diff --git a/lib_enc/amr_wb_enc_fx.c b/lib_enc/amr_wb_enc_fx.c index cdb90e5bf..d5bbfab29 100644 --- a/lib_enc/amr_wb_enc_fx.c +++ b/lib_enc/amr_wb_enc_fx.c @@ -368,7 +368,7 @@ void amr_wb_enc_fx( lp_bckr = Mean32( hNoiseEst->bckr_fx + 1, 9 ); /* q_bckr */ } hp_bckr = L_shr( L_add_sat( hNoiseEst->bckr_fx[st->max_band - 1], hNoiseEst->bckr_fx[st->max_band] ), 1 ); /* q_bckr */ - if ( hp_bckr == 0 ) /* Avoid division by zero. */ + if ( hp_bckr == 0 ) /* Avoid division by zero. */ { hp_bckr = L_deposit_l( 1 ); } diff --git a/lib_enc/analy_sp_fx.c b/lib_enc/analy_sp_fx.c index a93bf528d..d31f2ff08 100644 --- a/lib_enc/analy_sp_fx.c +++ b/lib_enc/analy_sp_fx.c @@ -952,7 +952,7 @@ static void find_enr( /* *ptE *= 4.0 / (L_FFT*L_FFT) */ /* normalization - corresponds to FFT normalization by 2/L_FFT */ - BASOP_SATURATE_WARNING_OFF_EVS; /* saturation seems to have no effect (tested by simulation) */ + BASOP_SATURATE_WARNING_OFF_EVS; /* saturation seems to have no effect (tested by simulation) */ *ptE = L_shl_o( Ltmp, diff_scaleM2, &Overflow ); /* Q_new + QSCALE - 2 */ move32(); /* scaled by Q_new + QSCALE - 2 */ BASOP_SATURATE_WARNING_ON_EVS; @@ -978,7 +978,7 @@ static void find_enr( exp_band = sub( exp_band, shift_to_norm ); exp_band = sub( diff_scaleP1, exp_band ); - BASOP_SATURATE_WARNING_OFF_EVS; /* saturation seems to have no effect (tested by simulation) */ + BASOP_SATURATE_WARNING_OFF_EVS; /* saturation seems to have no effect (tested by simulation) */ band[i] = L_shl_o( Ltmp1, exp_band, &Overflow ); /* Q15 + exp_band */ move32(); /* band scaled by Q_new + QSCALE */ BASOP_SATURATE_WARNING_ON_EVS; @@ -1029,7 +1029,7 @@ static void find_enr( /* *ptE *= 4.0 / (L_FFT*L_FFT) */ /* normalization - corresponds to FFT normalization by 2/L_FFT */ - BASOP_SATURATE_WARNING_OFF_EVS; /* saturation seems to have no effect (tested by simulation) */ + BASOP_SATURATE_WARNING_OFF_EVS; /* saturation seems to have no effect (tested by simulation) */ *Bin_E = L_shl_o( Ltmp, diff_scaleM2, &Overflow ); /* Q_new + QSCALE */ move32(); /* scaled by Q_new + QSCALE - 2 */ BASOP_SATURATE_WARNING_ON_EVS; diff --git a/lib_enc/bw_detect_fx.c b/lib_enc/bw_detect_fx.c index f44452113..931b175ff 100644 --- a/lib_enc/bw_detect_fx.c +++ b/lib_enc/bw_detect_fx.c @@ -132,7 +132,7 @@ void bw_detect_fx( cldfb_bin[i] = L_deposit_l( 1 ); move32(); } - L_tmp = BASOP_Util_Log2( cldfb_bin[0] ); /*(log2(660423549*2^(-31))/64)*2^31*/ + L_tmp = BASOP_Util_Log2( cldfb_bin[0] ); /*(log2(660423549*2^(-31))/64)*2^31*/ L_tmp = L_add_o( L_tmp, L_shl( L_deposit_l( cldfb_bin_Exp[0] ), 31 - LD_DATA_SCALE ), &Overflow ); /* Q25 */ cldfb_bin[0] = Mpy_32_16_1( L_tmp, 9864 /*1.0f/3.3219280948873623478703194294894f Q15*/ ); move32(); /* 1/log2(10) */ /* Q25 */ diff --git a/lib_enc/cng_enc_fx.c b/lib_enc/cng_enc_fx.c index 057a07d82..8a2495b40 100644 --- a/lib_enc/cng_enc_fx.c +++ b/lib_enc/cng_enc_fx.c @@ -644,7 +644,7 @@ void CNG_enc_fx( FOR( i = 0; i < M; i++ ) { dev = abs_s( sub( lsp_tmp[i], lsp_new[i] ) ); /*Q15 */ - dist = add_o( dist, dev, &Overflow ); /*Q15 */ + dist = add_o( dist, dev, &Overflow ); /*Q15 */ if ( GT_16( dev, max_dev ) ) { max_dev = dev; @@ -1062,9 +1062,9 @@ void CNG_enc_fx( /* d += (env[j] - CNG_details_codebook_fx[i][j]) * (env[j] - CNG_details_codebook_fx[i][j]);*/ L_tmp = L_sub( env[j], L_deposit_l( CNG_details_codebook_fx[i][j] ) ); /* Q6 */ exp = norm_l( L_tmp ); - L_tmp = L_shl( L_tmp, exp ); /*Q(exp+6)*/ - tmp1 = extract_h( L_tmp ); /*Q(exp+6-16)=exp-10*/ - L_tmp = L_mult_o( tmp1, tmp1, &Overflow ); /*Q(2*exp - 19)*/ + L_tmp = L_shl( L_tmp, exp ); /*Q(exp+6)*/ + tmp1 = extract_h( L_tmp ); /*Q(exp+6-16)=exp-10*/ + L_tmp = L_mult_o( tmp1, tmp1, &Overflow ); /*Q(2*exp - 19)*/ L_tmp = L_shr( L_tmp, sub( add( exp, exp ), 36 ) ); /* Q17 */ d = L_add( d, L_tmp ); } @@ -2253,9 +2253,9 @@ void CNG_enc_ivas_fx( /* d += (env[j] - CNG_details_codebook_fx[i][j]) * (env[j] - CNG_details_codebook_fx[i][j]);*/ L_tmp = L_sub( env[j], L_deposit_l( CNG_details_codebook_fx[i][j] ) ); /* Q6 */ exp = norm_l( L_tmp ); - L_tmp = L_shl( L_tmp, exp ); /*Q(exp+6)*/ - tmp1 = extract_h( L_tmp ); /*Q(exp+6-16)=exp-10*/ - L_tmp = L_mult_o( tmp1, tmp1, &Overflow ); /*Q(2*exp - 19)*/ + L_tmp = L_shl( L_tmp, exp ); /*Q(exp+6)*/ + tmp1 = extract_h( L_tmp ); /*Q(exp+6-16)=exp-10*/ + L_tmp = L_mult_o( tmp1, tmp1, &Overflow ); /*Q(2*exp - 19)*/ L_tmp = L_shr( L_tmp, sub( add( exp, exp ), 36 ) ); /* Q17 */ d = L_add( d, L_tmp ); /* Q17 */ } diff --git a/lib_enc/cor_shif_fx.c b/lib_enc/cor_shif_fx.c index c0cb658f2..28e837f48 100644 --- a/lib_enc/cor_shif_fx.c +++ b/lib_enc/cor_shif_fx.c @@ -40,9 +40,9 @@ Word16 correlation_shift_fx( /* o : noise dependent f_Noise = L_Extract_lc( Ltmp, &e_Noise ); wtmp = extract_l( Pow2( 14, f_Noise ) ); /* Put 14 as exponent */ - e_Noise = sub( e_Noise, 14 ); /* Retreive exponent of wtmp */ - Ltmp = Mpy_32_16( 8, 837, wtmp ); /* 2.4492e-4(Q31) * exp(0.1596*totalNoise) */ - Ltmp = L_shl_sat( Ltmp, add( e_Noise, 15 ) ); /* Result in Q31 */ + e_Noise = sub( e_Noise, 14 ); /* Retreive exponent of wtmp */ + Ltmp = Mpy_32_16( 8, 837, wtmp ); /* 2.4492e-4(Q31) * exp(0.1596*totalNoise) */ + Ltmp = L_shl_sat( Ltmp, add( e_Noise, 15 ) ); /* Result in Q31 */ corr_shift_fx = round_fx( L_sub( Ltmp, 47244640 ) ); /* Represents corr_shift in Q15 */ } corr_shift_fx = s_min( corr_shift_fx, 16384 ); /* limit to 0.5 */ diff --git a/lib_enc/core_enc_init_fx.c b/lib_enc/core_enc_init_fx.c index 9bcbffba6..f6b5b5984 100644 --- a/lib_enc/core_enc_init_fx.c +++ b/lib_enc/core_enc_init_fx.c @@ -422,7 +422,7 @@ static void init_tcx_fx( /*pit = pit_old * (float)st->L_frame/(float)L_frame_old;*/ pit = shl_sat( mult_r( pit_old, div_s( st->L_frame, shl( L_frame_old, 2 ) ) ), 2 ); -/* Note : the saturation here that can happens when FS == 32kHz*/ + /* Note : the saturation here that can happens when FS == 32kHz*/ /* assert(pit <= st->L_frame);*/ hTcxEnc->tcxltp_pitch_int_past = pit; diff --git a/lib_enc/detect_transient_fx.c b/lib_enc/detect_transient_fx.c index facecb401..a3dba9d27 100644 --- a/lib_enc/detect_transient_fx.c +++ b/lib_enc/detect_transient_fx.c @@ -70,8 +70,8 @@ static void hp_filter_fx( /*y[0] = 0.4931f * *oldy + 0.7466f*(x[0] - *oldx); */ L_tmp = L_mult( sub_o( x[0], *oldx, &Overflow ), 24465 /*0.7466f in Q15*/ ); /*Q_new+16 */ - L_tmp = L_mac_sat( L_tmp, *oldy, 16158 /*0.4931f in Q15*/ ); /*Q_new+16 */ - y[0] = round_fx_sat( L_tmp ); /*Q_new */ + L_tmp = L_mac_sat( L_tmp, *oldy, 16158 /*0.4931f in Q15*/ ); /*Q_new+16 */ + y[0] = round_fx_sat( L_tmp ); /*Q_new */ FOR( i = 1; i < L; i++ ) { /*y[i] = 0.4931f*y[i-1] + 0.7466f*(x[i] - x[i-1]); */ @@ -171,7 +171,7 @@ Word16 detect_transient_fx( { temp16 = extract_l( L_shr( out_filt_fx[i + blk * ( L / 4 )], 12 ) ); Energy_fx = L_add_o( Energy_fx, L_mult0( temp16, temp16 ), &Overflow ); - temp16 = shr( in_fx[i + blk * ( L / 4 )], Q_new ); /*Q0*/ + temp16 = shr( in_fx[i + blk * ( L / 4 )], Q_new ); /*Q0*/ Energy_in_fx[blk + 1] = L_add_o( Energy_in_fx[blk + 1], L_mult0( temp16, temp16 ), &Overflow ); /*Q0*/ move32(); } diff --git a/lib_enc/dtx_fx.c b/lib_enc/dtx_fx.c index fc44b9901..fde20ad7a 100644 --- a/lib_enc/dtx_fx.c +++ b/lib_enc/dtx_fx.c @@ -1469,8 +1469,8 @@ void dtx_hangover_control_fx( } lsp_est[i] = sub_o( lsp_est[i], add_o( tmp[max_idx[0] * M + i], tmp[max_idx[1] * M + i], &Overflow ), &Overflow ); /*Q15 */ - S_tmp = div_s( 1, sub( m, 2 ) ); /*Q15 */ - lsp_est[i] = mult_r( lsp_est[i], S_tmp ); /*Q15 */ + S_tmp = div_s( 1, sub( m, 2 ) ); /*Q15 */ + lsp_est[i] = mult_r( lsp_est[i], S_tmp ); /*Q15 */ } } @@ -1491,7 +1491,7 @@ void dtx_hangover_control_fx( FOR( i = 0; i < M; i++ ) { S_tmp = abs_s( sub( hDtxEnc->lspCNG_fx[i], lsp_est[i] ) ); /*Q15 */ - Dlsp = add_o( Dlsp, S_tmp, &Overflow ); /*Q15 */ + Dlsp = add_o( Dlsp, S_tmp, &Overflow ); /*Q15 */ IF( GT_16( S_tmp, S_max ) ) { S_max = S_tmp; /*Q15 */ diff --git a/lib_enc/enc_acelp_fx.c b/lib_enc/enc_acelp_fx.c index caeeb178b..7dd342318 100644 --- a/lib_enc/enc_acelp_fx.c +++ b/lib_enc/enc_acelp_fx.c @@ -788,8 +788,8 @@ void E_ACELP_pulsesign( const Word16 cn[] /*Q_xn*/, Word16 dn[] /*Qdn*/, Word16 FOR( i = 0; i < L_subfr; i++ ) { /*cor = (s * cn[i]) + (alp * dn[i]); MULT(1);MAC(1);*/ - Lcor = L_mult( cn[i], k_cn ); /*Q_xn + Q15 - e_cn + 1*/ - Lcor = L_mac( Lcor, dn[i], k_dn ); /*Qdn + Q15 - e_dn + 1*/ + Lcor = L_mult( cn[i], k_cn ); /*Q_xn + Q15 - e_cn + 1*/ + Lcor = L_mac( Lcor, dn[i], k_dn ); /*Qdn + Q15 - e_dn + 1*/ val = round_fx_o( L_shl_o( Lcor, 4, &Overflow ), &Overflow ); /*shifting by 4 may overflow but improves accuracy Qdn + 4 - e_dn*/ index = shr( val, 15 ); diff --git a/lib_enc/enc_acelpx_fx.c b/lib_enc/enc_acelpx_fx.c index cf5f393e7..f18da2ef2 100644 --- a/lib_enc/enc_acelpx_fx.c +++ b/lib_enc/enc_acelpx_fx.c @@ -151,7 +151,7 @@ static void E_ACELP_2pulse_searchx_fx( ps0 = *ps; /*Qdn*/ move16(); /*alp0 = *alp + 2.0f*R[0]; move16();*/ - alp0 = L_deposit_h( *alp ); /* Qalp = Q_R*Q_signval */ + alp0 = L_deposit_h( *alp ); /* Qalp = Q_R*Q_signval */ alp0 = L_mac_sat( alp0, R[0], sign_val_2 ); /*Q9+scale+Q15*/ /* Ensure that in the loop below s > 0 in the first iteration, the actual values do not matter. */ @@ -190,7 +190,7 @@ static void E_ACELP_2pulse_searchx_fx( ps1 = add_sat( ps0, dn[x] ); /*Qdn*/ /*alp1 = alp0 + 2*sgnx*cor[x]; INDIRECT(1);MULT(1); MAC(1);*/ alp1 = L_mac_o( alp0, cor[x], sgnx, &Overflow ); /* Qalp = (Q_R=Q_cor)*Q_signval */ - pR = R - x; /*Q9+scale*/ + pR = R - x; /*Q9+scale*/ FOR( y = track_y; y < L_SUBFR; y += 4 ) { @@ -324,7 +324,7 @@ static void E_ACELP_1pulse_searchx_fx( /* alp1 = alp0 + 2*sign[x]*cor[x]; MAC(1); MULT(1);*/ assert( sign[x] == sign_val_1 << 1 || sign[x] == -( sign_val_1 << 1 ) ); alp1 = mac_ro( alp0, cor[x], sign[x], &Overflow ); /* Qalp = (Q_R=Q_cor)*Q_signval */ - alpk[1 - ik] = alp1; /* Qalp */ + alpk[1 - ik] = alp1; /* Qalp */ move16(); diff --git a/lib_enc/enc_amr_wb_fx.c b/lib_enc/enc_amr_wb_fx.c index 06b0881a0..08a20bbb9 100644 --- a/lib_enc/enc_amr_wb_fx.c +++ b/lib_enc/enc_amr_wb_fx.c @@ -208,19 +208,19 @@ void encod_amr_wb_fx( Ltmp = L_negate( Ltmp ); Ltmp = L_mac( Ltmp, xn[L_SUBFR - 1], 16384 /*Q14*/ ); /* Q_new-1+shift+14+1 */ Ltmp = L_msu( Ltmp, y1[L_SUBFR - 1], gain_pit /*Q14*/ ); /* Q_new-1+shift+14+1 */ - Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); /* Q_new+15 */ - hLPDmem->mem_w0 = round_fx_sat( Ltmp ); /*Q_new-1 */ + Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); /* Q_new+15 */ + hLPDmem->mem_w0 = round_fx_sat( Ltmp ); /*Q_new-1 */ move16(); /*-----------------------------------------------------------------* * Find the total excitation *-----------------------------------------------------------------*/ FOR( i = 0; i < L_SUBFR; i++ ) { - L_tmp = L_mult( gcode16, code[i] ); /*Q10*/ + L_tmp = L_mult( gcode16, code[i] ); /*Q10*/ L_tmp = L_shl_sat( L_tmp, 5 ); /*Q15*/ L_tmp = L_mac_sat( L_tmp, exc[i + i_subfr], gain_pit ); /* Q_new+15 */ - L_tmp = L_shl_o( L_tmp, 1, &Overflow ); /* saturation can occur here Q_new+15*/ - exc[i + i_subfr] = round_fx_o( L_tmp, &Overflow ); /*Q_new*/ + L_tmp = L_shl_o( L_tmp, 1, &Overflow ); /* saturation can occur here Q_new+15*/ + exc[i + i_subfr] = round_fx_o( L_tmp, &Overflow ); /*Q_new*/ move16(); } diff --git a/lib_enc/enc_gen_voic_fx.c b/lib_enc/enc_gen_voic_fx.c index a14003fd2..6f71b8ba1 100644 --- a/lib_enc/enc_gen_voic_fx.c +++ b/lib_enc/enc_gen_voic_fx.c @@ -322,8 +322,8 @@ void encod_gen_voic_fx( Ltmp = L_negate( Ltmp ); Ltmp = L_mac( Ltmp, xn_fx[L_SUBFR - 1], 16384 /*Q14*/ ); /* Q_new-1+shift+14+1 */ Ltmp = L_msu( Ltmp, y1_fx[L_SUBFR - 1], gain_pit_fx /*Q14*/ ); /* Q_new-1+shift+14+1 */ - Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); /* 15 + Q_new */ - hLPDmem->mem_w0 = round_fx_sat( Ltmp ); /*Q_new-1 */ + Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); /* 15 + Q_new */ + hLPDmem->mem_w0 = round_fx_sat( Ltmp ); /*Q_new-1 */ move16(); IF( gain_preQ_fx != 0 ) { @@ -341,9 +341,9 @@ void encod_gen_voic_fx( move16(); /* code in Q9, gain_pit in Q14 */ - Ltmp = L_mult( gcode16, code_fx[i] ); /* Q10 */ - Ltmp = L_shl( Ltmp, 5 ); /* Q15 */ - Ltmp = L_mac( Ltmp, exc_fx[i + i_subfr_fx], gain_pit_fx ); /* Q15 */ + Ltmp = L_mult( gcode16, code_fx[i] ); /* Q10 */ + Ltmp = L_shl( Ltmp, 5 ); /* Q15 */ + Ltmp = L_mac( Ltmp, exc_fx[i + i_subfr_fx], gain_pit_fx ); /* Q15 */ Ltmp = L_shl_o( Ltmp, 1, &Overflow ); /* saturation can occur here Q16*/ exc_fx[i + i_subfr_fx] = round_fx_o( L_add_o( Ltmp, Ltmp1, &Overflow ), &Overflow ); /* Q0 */ } @@ -357,7 +357,7 @@ void encod_gen_voic_fx( FOR( i = 0; i < L_SUBFR; i++ ) { /* code in Q9, gain_pit in Q14 */ - Ltmp = L_mult( gcode16, code_fx[i] ); /* Q10 */ + Ltmp = L_mult( gcode16, code_fx[i] ); /* Q10 */ Ltmp = L_shl_o( Ltmp, 5, &Overflow ); /* Q15 */ Ltmp = L_mac_o( Ltmp, exc_fx[i + i_subfr_fx], gain_pit_fx, &Overflow ); /* Q15 */ Ltmp = L_shl_o( Ltmp, 1, &Overflow ); /* saturation can occur here Q16*/ @@ -677,8 +677,8 @@ void encod_gen_voic_ivas_fx( Ltmp = L_negate( Ltmp ); Ltmp = L_mac( Ltmp, xn_fx[L_SUBFR - 1], 16384 /*Q14*/ ); // Q_new-1+15+shift Ltmp = L_msu( Ltmp, y1_fx[L_SUBFR - 1], gain_pit_fx /*Q14*/ ); // Q_new-1+15+shift - Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); // Q_new+15 - hLPDmem->mem_w0 = round_fx_sat( Ltmp ); /*Q_new-1 */ + Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); // Q_new+15 + hLPDmem->mem_w0 = round_fx_sat( Ltmp ); /*Q_new-1 */ move16(); IF( gain_preQ_fx != 0 ) { @@ -696,9 +696,9 @@ void encod_gen_voic_ivas_fx( move16(); /* code in Q9, gain_pit in Q14 */ - Ltmp = L_mult( gcode16, code_fx[i] ); /* Q10 */ - Ltmp = L_shl( Ltmp, 5 ); /* Q15 */ - Ltmp = L_mac( Ltmp, exc_fx[i + i_subfr_fx], gain_pit_fx ); /* Q15 */ + Ltmp = L_mult( gcode16, code_fx[i] ); /* Q10 */ + Ltmp = L_shl( Ltmp, 5 ); /* Q15 */ + Ltmp = L_mac( Ltmp, exc_fx[i + i_subfr_fx], gain_pit_fx ); /* Q15 */ Ltmp = L_shl_o( Ltmp, 1, &Overflow ); /* saturation can occur here Q16*/ exc_fx[i + i_subfr_fx] = round_fx_o( L_add_o( Ltmp, Ltmp1, &Overflow ), &Overflow ); /* Q0 */ move16(); @@ -713,7 +713,7 @@ void encod_gen_voic_ivas_fx( FOR( i = 0; i < L_SUBFR; i++ ) { /* code in Q9, gain_pit in Q14 */ - Ltmp = L_mult( gcode16, code_fx[i] ); /* Q10 */ + Ltmp = L_mult( gcode16, code_fx[i] ); /* Q10 */ Ltmp = L_shl_o( Ltmp, 5, &Overflow ); /* Q15 */ Ltmp = L_mac_o( Ltmp, exc_fx[i + i_subfr_fx], gain_pit_fx, &Overflow ); /* Q15 */ Ltmp = L_shl_o( Ltmp, 1, &Overflow ); /* saturation can occur here Q16*/ diff --git a/lib_enc/enc_gen_voic_rf_fx.c b/lib_enc/enc_gen_voic_rf_fx.c index b1c14e286..e9c9d87f7 100644 --- a/lib_enc/enc_gen_voic_rf_fx.c +++ b/lib_enc/enc_gen_voic_rf_fx.c @@ -440,11 +440,11 @@ void coder_acelp_rf_fx( * Update memory of the weighting filter *-----------------------------------------------------------------*/ /* st_fx->_rf_mem_w0 = xn[L_SUBFR-1] - (gain_pit*y1[L_SUBFR-1]) - (gain_code*y2[L_SUBFR-1]); */ - Ltmp = Mpy_32_16_1( gain_code, y2[L_SUBFR - 1] ); /* Q10 */ + Ltmp = Mpy_32_16_1( gain_code, y2[L_SUBFR - 1] ); /* Q10 */ Ltmp = L_shl_o( Ltmp, add( 5, Q_xn ), &Overflow ); /* Q15 + Q_xn */ Ltmp = L_mac_o( Ltmp, y1[L_SUBFR - 1], gain_pit, &Overflow ); /* Q15 + Q_xn */ /* Add Gaussian contribution*/ - Ltmp2 = Mpy_32_16_1( gain_code2, y22[L_SUBFR - 1] ); /* Q10 */ + Ltmp2 = Mpy_32_16_1( gain_code2, y22[L_SUBFR - 1] ); /* Q10 */ Ltmp2 = L_shl_o( Ltmp2, add( 5, Q_xn ), &Overflow ); /* Q15 + Q_xn */ Ltmp = L_add_o( Ltmp, Ltmp2, &Overflow ); /* Q15 + Q_xn */ hRF->rf_mem_w0 = sub_o( xn[L_SUBFR - 1], round_fx_o( L_shl_o( Ltmp, 1, &Overflow ), &Overflow ), &Overflow ); /* Q_xn */ @@ -462,12 +462,12 @@ void coder_acelp_rf_fx( FOR( i = sub( tmp2, shr( L_SUBFR, 1 ) ); i < tmp2; i++ ) { /* code in Q9, gain_pit in Q14; exc Q_new */ - Ltmp = Mpy_32_16_1( gain_code2, code2[i] ); /* Q10 */ + Ltmp = Mpy_32_16_1( gain_code2, code2[i] ); /* Q10 */ Ltmp = L_shl_o( Ltmp, Q_new_p5, &Overflow ); /* Q15 + Q_new */ Ltmp = L_mac_o( Ltmp, gain_pit, exc_rf[i + i_subfr], &Overflow ); /* Q15 + Q_new */ exc2[i] = round_fx_o( L_shl_o( Ltmp, 1, &Overflow ), &Overflow ); /* Q_new */ move16(); - Ltmp2 = Mpy_32_16_1( gain_code_vect[j], code[i] ); /* Q10 */ + Ltmp2 = Mpy_32_16_1( gain_code_vect[j], code[i] ); /* Q10 */ Ltmp2 = L_shl_o( Ltmp2, Q_new_p5, &Overflow ); /* Q15 + Q_new */ Ltmp = L_add_o( Ltmp, Ltmp2, &Overflow ); /* Q15 + Q_new */ Ltmp = L_shl_o( Ltmp, 1, &Overflow ); /* saturation can occur here Q16 + Q_new*/ diff --git a/lib_enc/enc_higher_acelp_fx.c b/lib_enc/enc_higher_acelp_fx.c index 8815b39aa..c4c544469 100644 --- a/lib_enc/enc_higher_acelp_fx.c +++ b/lib_enc/enc_higher_acelp_fx.c @@ -94,7 +94,7 @@ void transf_cdbk_enc_fx( Ltmp = L_shl( Ltmp, add( 5, shift ) ); Ltmp = L_negate( Ltmp ); Ltmp = L_mac( Ltmp, xn[i], 16384 ); - Ltmp = L_msu( Ltmp, y1[i], *gain_pit ); /* Q_new + 14 + shift */ + Ltmp = L_msu( Ltmp, y1[i], *gain_pit ); /* Q_new + 14 + shift */ Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); /* Q_new + 15 */ x_tran[i] = round_fx_sat( Ltmp ); /*Q_new-1 */ move16(); @@ -180,7 +180,7 @@ void transf_cdbk_enc_fx( { m_corr = div_s( 16384, m_den ); e_corr = sub( 14 + 4, e_den ); - Ltmp = L_shr( Mult_32_16( Ltmp, m_corr ), e_corr ); /*Q12*/ + Ltmp = L_shr( Mult_32_16( Ltmp, m_corr ), e_corr ); /*Q12*/ stmp = round_fx_o( L_shl_o( Ltmp, 16, &Overflow ), &Overflow ); /* Q12 */ } ELSE @@ -201,8 +201,8 @@ void transf_cdbk_enc_fx( index = usquant_fx( stmp, &stmp, G_AVQ_MIN_INACT_Q12, G_AVQ_DELTA_INACT_Q12 >> 1, ( 1 << G_AVQ_BITS ) ); /* Q0 */ } Ltmp = Mult_32_16( gain_code, stmp ); /* Q16 * Q12 - 15 -> Q13*/ - Ltmp = L_shl_sat( Ltmp, 5 ); /* Q13 -> Q18*/ - *gain_preQ = round_fx_sat( Ltmp ); /* Q2*/ + Ltmp = L_shl_sat( Ltmp, 5 ); /* Q13 -> Q18*/ + *gain_preQ = round_fx_sat( Ltmp ); /* Q2*/ } ELSE { @@ -460,7 +460,7 @@ void transf_cdbk_enc_ivas_fx( Ltmp = L_shl( Ltmp, add( 5, shift ) ); Ltmp = L_negate( Ltmp ); Ltmp = L_mac( Ltmp, xn[i], 16384 ); - Ltmp = L_msu( Ltmp, y1[i], *gain_pit ); /* Q_new + 14 + shift */ + Ltmp = L_msu( Ltmp, y1[i], *gain_pit ); /* Q_new + 14 + shift */ Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); /* Q_new + 15 */ x_tran[i] = round_fx_sat( Ltmp ); /*Q_new-1 */ } @@ -545,7 +545,7 @@ void transf_cdbk_enc_ivas_fx( { m_corr = div_s( 16384, m_den ); e_corr = sub( 14 + 4, e_den ); - Ltmp = L_shr( Mult_32_16( Ltmp, m_corr ), e_corr ); /*Q12*/ + Ltmp = L_shr( Mult_32_16( Ltmp, m_corr ), e_corr ); /*Q12*/ stmp = round_fx_o( L_shl_o( Ltmp, 16, &Overflow ), &Overflow ); /* Q12 */ } ELSE @@ -566,8 +566,8 @@ void transf_cdbk_enc_ivas_fx( index = usquant_fx( stmp, &stmp, G_AVQ_MIN_INACT_Q12, G_AVQ_DELTA_INACT_Q12 >> 1, ( 1 << G_AVQ_BITS ) ); /* Q0 */ } Ltmp = Mult_32_16( gain_code, stmp ); /* Q16 * Q12 - 15 -> Q13*/ - Ltmp = L_shl_sat( Ltmp, 5 ); /* Q13 -> Q18*/ - *gain_preQ = round_fx_sat( Ltmp ); /* Q2*/ + Ltmp = L_shl_sat( Ltmp, 5 ); /* Q13 -> Q18*/ + *gain_preQ = round_fx_sat( Ltmp ); /* Q2*/ move16(); } ELSE diff --git a/lib_enc/enc_pit_exc_fx.c b/lib_enc/enc_pit_exc_fx.c index 08e79e543..9e3b817b1 100644 --- a/lib_enc/enc_pit_exc_fx.c +++ b/lib_enc/enc_pit_exc_fx.c @@ -369,7 +369,7 @@ void enc_pit_exc_fx( *-----------------------------------------------------------------*/ IF( use_fcb != 0 ) { - Ltmp = L_mult( gcode16, y2[L_subfr - 1] ); /* Q10 + Q_new */ + Ltmp = L_mult( gcode16, y2[L_subfr - 1] ); /* Q10 + Q_new */ Ltmp = L_shl_o( Ltmp, add( 5, shift ), &Overflow ); /* Q15 + Q_new + shift */ Ltmp = L_negate( Ltmp ); Ltmp = L_mac_o( Ltmp, xn[L_subfr - 1], 16384, &Overflow ); /* Q_new + Q15 + shift */ @@ -380,7 +380,7 @@ void enc_pit_exc_fx( } ELSE { - Ltmp = L_mult( xn[L_subfr - 1], 16384 ); /* Q_new + 14 -shift */ + Ltmp = L_mult( xn[L_subfr - 1], 16384 ); /* Q_new + 14 -shift */ Ltmp = L_msu_sat( Ltmp, y1[L_subfr - 1], gain_pit ); /* Q_new + 14 -shift */ Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); /* Q_new + 15 */ hLPDmem->mem_w0 = round_fx_sat( Ltmp ); /*Q_new-1 */ @@ -396,7 +396,7 @@ void enc_pit_exc_fx( FOR( i = 0; i < L_subfr; i++ ) { /* code in Q9, gain_pit in Q14 */ - Ltmp = L_mult( gcode16, code[i] ); /* Q10 + Q_new */ + Ltmp = L_mult( gcode16, code[i] ); /* Q10 + Q_new */ Ltmp = L_shl_o( Ltmp, 5, &Overflow ); /* Q15 + Q_new */ Ltmp = L_mac_o( Ltmp, exc[i + i_subfr], gain_pit, &Overflow ); /* Q15 + Q_new */ Ltmp = L_shl_o( Ltmp, 1, &Overflow ); /* saturation can occur here Q_new + Q16*/ @@ -410,8 +410,8 @@ void enc_pit_exc_fx( { Ltmp = L_mult( exc[i + i_subfr], gain_pit ); /* Q15 + Q_new */ - Ltmp = L_shl_sat( Ltmp, 1 ); /* saturation can occur here Q16 + Q_new */ - exc[i + i_subfr] = round_fx_sat( Ltmp ); /* Q_new */ + Ltmp = L_shl_sat( Ltmp, 1 ); /* saturation can occur here Q16 + Q_new */ + exc[i + i_subfr] = round_fx_sat( Ltmp ); /* Q_new */ } } @@ -523,7 +523,7 @@ void enc_pit_exc_fx( } } - cum_gpit = shl_o( cum_gpit, 1, &Overflow ); /*Q15*/ + cum_gpit = shl_o( cum_gpit, 1, &Overflow ); /*Q15*/ *gpit = round_fx( L_mac( L_mult( 3277, *gpit ), 29491, cum_gpit ) ); /*Q15*/ } @@ -862,7 +862,7 @@ void enc_pit_exc_ivas_fx( } ELSE { - Ltmp = L_mult( xn[L_subfr - 1], 16384 ); // Q_new-1+15+shift + Ltmp = L_mult( xn[L_subfr - 1], 16384 ); // Q_new-1+15+shift Ltmp = L_msu_sat( Ltmp, y1[L_subfr - 1], gain_pit ); // Q_new-1+15+shift Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); // Q_new+15 hGSCEnc->mem_w0_tmp_fx = round_fx_sat( Ltmp ); /*Q_new-1 */ @@ -877,7 +877,7 @@ void enc_pit_exc_ivas_fx( FOR( i = 0; i < L_subfr; i++ ) { /* code in Q9, gain_pit in Q14 */ - Ltmp = L_mult( gcode16, code[i] ); /* Q10 + Q_new */ + Ltmp = L_mult( gcode16, code[i] ); /* Q10 + Q_new */ Ltmp = L_shl_o( Ltmp, 5, &Overflow ); /* Q15 + Q_new */ Ltmp = L_mac_o( Ltmp, exc[i + i_subfr], gain_pit, &Overflow ); /* Q15 + Q_new */ Ltmp = L_shl_o( Ltmp, 1, &Overflow ); /* saturation can occur here Q16 + Q_new */ @@ -891,8 +891,8 @@ void enc_pit_exc_ivas_fx( { Ltmp = L_mult( exc[i + i_subfr], gain_pit ); /* Q15 + Q_new */ - Ltmp = L_shl_sat( Ltmp, 1 ); /* saturation can occur here Q16 + Q_new */ - exc[i + i_subfr] = round_fx_sat( Ltmp ); /* Q_new */ + Ltmp = L_shl_sat( Ltmp, 1 ); /* saturation can occur here Q16 + Q_new */ + exc[i + i_subfr] = round_fx_sat( Ltmp ); /* Q_new */ move16(); } } @@ -1005,6 +1005,6 @@ void enc_pit_exc_ivas_fx( } } - cum_gpit = shl_o( cum_gpit, 1, &Overflow ); /*Q15*/ + cum_gpit = shl_o( cum_gpit, 1, &Overflow ); /*Q15*/ *gpit = round_fx( L_mac( L_mult( 3277, *gpit ), 29491, cum_gpit ) ); /*Q15*/ } diff --git a/lib_enc/enc_tran_fx.c b/lib_enc/enc_tran_fx.c index 731c84d50..b4495d4ff 100644 --- a/lib_enc/enc_tran_fx.c +++ b/lib_enc/enc_tran_fx.c @@ -278,7 +278,7 @@ Word16 encod_tran_fx( FOR( i = 0; i < L_SUBFR; i++ ) { /* code in Q9, gain_pit in Q14 */ - L_tmp = L_mult( gcode16, code[i] ); /* Q10 + Q_new */ + L_tmp = L_mult( gcode16, code[i] ); /* Q10 + Q_new */ L_tmp = L_shl_o( L_tmp, 5, &Overflow ); /* Q15 + Q_new */ L_tmp = L_mac_o( L_tmp, exc_fx[i + i_subfr], gain_pit, &Overflow ); /* Q15 + Q_new */ L_tmp = L_shl_o( L_tmp, 1, &Overflow ); /* saturation can occur here Q16 + Q_new */ @@ -294,7 +294,7 @@ Word16 encod_tran_fx( tmp1_fx = add( 16 - ( 2 + Q_AVQ_OUT_DEC + 1 ), Q_new ); FOR( i = 0; i < L_SUBFR; i++ ) { - L_tmp = L_mult( gain_preQ, code_preQ[i] ); /* Q2 + Q10 -> Q13*/ + L_tmp = L_mult( gain_preQ, code_preQ[i] ); /* Q2 + Q10 -> Q13*/ L_tmp = L_shl_o( L_tmp, tmp1_fx, &Overflow ); /* Q16 + Q_exc */ tmp_fx = round_fx_o( L_tmp, &Overflow ); @@ -620,8 +620,8 @@ Word16 encod_tran_ivas_fx( L_tmp = L_negate( L_tmp ); L_tmp = L_mac( L_tmp, xn[L_SUBFR - 1], 16384 ); // Q_new-1+15+shift L_tmp = L_msu( L_tmp, y1[L_SUBFR - 1], gain_pit ); // Q_new-1+15+shift - L_tmp = L_shl_sat( L_tmp, sub( 1, shift ) ); // Q_new+15 - hLPDmem->mem_w0 = round_fx_sat( L_tmp ); /*Q_new-1*/ + L_tmp = L_shl_sat( L_tmp, sub( 1, shift ) ); // Q_new+15 + hLPDmem->mem_w0 = round_fx_sat( L_tmp ); /*Q_new-1*/ /*-----------------------------------------------------------------* * Construct adaptive part of the excitation * Save the non-enhanced excitation for FEC_exc @@ -656,7 +656,7 @@ Word16 encod_tran_ivas_fx( FOR( i = 0; i < L_SUBFR; i++ ) { /* code in Q9, gain_pit in Q14 */ - L_tmp = L_mult( gcode16, code[i] ); /* Q10 + Q_new */ + L_tmp = L_mult( gcode16, code[i] ); /* Q10 + Q_new */ L_tmp = L_shl_o( L_tmp, 5, &Overflow ); /* Q15 + Q_new */ L_tmp = L_mac_o( L_tmp, exc_fx[i + i_subfr], gain_pit, &Overflow ); /* Q15 + Q_new */ L_tmp = L_shl_o( L_tmp, 1, &Overflow ); /* saturation can occur here Q16 + Q_new */ @@ -672,7 +672,7 @@ Word16 encod_tran_ivas_fx( tmp1_fx = add( 16 - ( 2 + Q_AVQ_OUT_DEC + 1 ), Q_new ); FOR( i = 0; i < L_SUBFR; i++ ) { - L_tmp = L_mult( gain_preQ, code_preQ[i] ); /* Q2 + Q10 -> Q13*/ + L_tmp = L_mult( gain_preQ, code_preQ[i] ); /* Q2 + Q10 -> Q13*/ L_tmp = L_shl_o( L_tmp, tmp1_fx, &Overflow ); /* Q16 + Q_exc */ tmp_fx = round_fx_o( L_tmp, &Overflow ); diff --git a/lib_enc/enc_uv_fx.c b/lib_enc/enc_uv_fx.c index 3fedefc0f..32c397613 100644 --- a/lib_enc/enc_uv_fx.c +++ b/lib_enc/enc_uv_fx.c @@ -204,8 +204,8 @@ void encod_unvoiced_fx( Ltmp2 = Mpy_32_16_1( gain_code_vect[j], code_fx[i] ); /* Q10 */ Ltmp2 = L_shl( Ltmp2, Q_new_p5 ); /* Q15 + Q_new */ Ltmp = L_add( Ltmp, Ltmp2 ); /* Q15 + Q_new */ - Ltmp = L_shl_sat( Ltmp, 1 ); /* saturation can occur here Q16 + Q_new */ - exc_fx[i + i_subfr] = round_fx_sat( Ltmp ); /* Q_new */ + Ltmp = L_shl_sat( Ltmp, 1 ); /* saturation can occur here Q16 + Q_new */ + exc_fx[i + i_subfr] = round_fx_sat( Ltmp ); /* Q_new */ } tmp2 = L_SUBFR; move16(); @@ -431,14 +431,14 @@ void encod_unvoiced_ivas_fx( FOR( i = sub( tmp2, shr( L_SUBFR, 1 ) ); i < tmp2; i++ ) { /* code in Q9, gain_pit in Q14; exc Q_new */ - Ltmp = Mpy_32_16_1( gain_code2, code2[i] ); /* Q10 */ + Ltmp = Mpy_32_16_1( gain_code2, code2[i] ); /* Q10 */ Ltmp = L_shl_sat( Ltmp, Q_new_p5 ); /* Q15 + Q_new */ Ltmp = L_mac_sat( Ltmp, gain_pit_fx, exc_fx[i + i_subfr] ); /* Q15 + Q_new */ - Ltmp2 = Mpy_32_16_1( gain_code_vect[j], code_fx[i] ); /* Q10 */ - Ltmp2 = L_shl_sat( Ltmp2, Q_new_p5 ); /* Q15 + Q_new */ - Ltmp = L_add_sat( Ltmp, Ltmp2 ); /* Q15 + Q_new */ - Ltmp = L_shl_sat( Ltmp, 1 ); /* saturation can occur here Q16 + Q_new */ - exc_fx[i + i_subfr] = round_fx_sat( Ltmp ); /* Q_new */ + Ltmp2 = Mpy_32_16_1( gain_code_vect[j], code_fx[i] ); /* Q10 */ + Ltmp2 = L_shl_sat( Ltmp2, Q_new_p5 ); /* Q15 + Q_new */ + Ltmp = L_add_sat( Ltmp, Ltmp2 ); /* Q15 + Q_new */ + Ltmp = L_shl_sat( Ltmp, 1 ); /* saturation can occur here Q16 + Q_new */ + exc_fx[i + i_subfr] = round_fx_sat( Ltmp ); /* Q_new */ move16(); } tmp2 = L_SUBFR; diff --git a/lib_enc/energy_fx.c b/lib_enc/energy_fx.c index b5f9b632f..2415ed287 100644 --- a/lib_enc/energy_fx.c +++ b/lib_enc/energy_fx.c @@ -60,7 +60,7 @@ void est_energy_fx( HB_Power = L_shr( sb_power[6], shr_tmp ); /* 31 - enerBuffer_exp - shr_tmp */ FOR( i = 2; i < BandNum; i++ ) { - Ltmp32 = L_shr( sb_power[i], shr_tmp ); /* 31 - enerBuffer_exp - shr_tmp */ + Ltmp32 = L_shr( sb_power[i], shr_tmp ); /* 31 - enerBuffer_exp - shr_tmp */ frame_energy2 = L_add_sat( frame_energy2, Ltmp32 ); /* 31 - enerBuffer_exp - shr_tmp */ if ( i > 6 ) HB_Power = L_add_sat( HB_Power, Ltmp32 ); diff --git a/lib_enc/ext_sig_ana_fx.c b/lib_enc/ext_sig_ana_fx.c index cc234a93d..c04f6647a 100644 --- a/lib_enc/ext_sig_ana_fx.c +++ b/lib_enc/ext_sig_ana_fx.c @@ -988,7 +988,7 @@ void core_signal_analysis_high_bitrate_ivas_fx( L_tmp = L_mult( hTcxEnc->speech_TCX[-1 - i], st->hTcxCfg->tcx_aldo_window_1_FB[left_overlap / 2 + minWindowLen - i] ); // (Q0, Q15) -> Q16 L_tmp = Mpy_32_16_1( L_tmp, st->hTcxCfg->tcx_mdct_window_minimumFB[minWindowLen - i].v.im ); // (Q16, Q15) -> Q16 L_tmp = L_shl( L_tmp, sub( 0, Q16 ) ); // Q0 - tcx20Win[left_overlap + i] = sub_sat( tcx20Win[left_overlap + i], extract_l( L_tmp ) ); // Q0 + tcx20Win[left_overlap + i] = sub_sat( tcx20Win[left_overlap + i], extract_l( L_tmp ) ); // Q0 move32(); } FOR( i = tmp - 1; i >= 0; i-- ) /* outer left folding of shortened long ALDO slope */ @@ -996,7 +996,7 @@ void core_signal_analysis_high_bitrate_ivas_fx( L_tmp = L_mult( hTcxEnc->speech_TCX[-1 - i], st->hTcxCfg->tcx_aldo_window_1_FB[left_overlap / 2 + minWindowLen - i] ); // (Q0, Q15) -> Q16 L_tmp = Mpy_32_16_1( L_tmp, st->hTcxCfg->tcx_mdct_window_minimumFB[i].v.re ); // (Q16, Q15) -> Q16 L_tmp = L_shl( L_tmp, sub( 0, Q16 ) ); // Q0 - tcx20Win[left_overlap + i] = sub_sat( tcx20Win[left_overlap + i], extract_l( L_tmp ) ); // Q0 + tcx20Win[left_overlap + i] = sub_sat( tcx20Win[left_overlap + i], extract_l( L_tmp ) ); // Q0 move32(); } } @@ -1097,7 +1097,7 @@ void core_signal_analysis_high_bitrate_ivas_fx( L_tmp = L_mult( hTcxEnc->speech_TCX[-1 - i], st->hTcxCfg->tcx_aldo_window_1_FB[left_overlap / 2 + minWindowLen - i] ); // (Q0, Q15) -> Q16 L_tmp = Mpy_32_16_1( L_tmp, st->hTcxCfg->tcx_mdct_window_minimumFB[minWindowLen - i].v.im ); // (Q16, Q15) -> Q16 L_tmp = L_shl( L_tmp, sub( 0, Q16 ) ); // Q0 - tcx20Win[left_overlap + i] = sub_sat( tcx20Win[left_overlap + i], extract_l( L_tmp ) ); // Q0 + tcx20Win[left_overlap + i] = sub_sat( tcx20Win[left_overlap + i], extract_l( L_tmp ) ); // Q0 move32(); } FOR( i = tmp - 1; i >= 0; i-- ) /* outer left folding of shortened long ALDO slope */ @@ -1105,7 +1105,7 @@ void core_signal_analysis_high_bitrate_ivas_fx( L_tmp = L_mult( hTcxEnc->speech_TCX[-1 - i], st->hTcxCfg->tcx_aldo_window_1_FB[left_overlap / 2 + minWindowLen - i] ); // (Q0, Q15) -> Q16 L_tmp = Mpy_32_16_1( L_tmp, st->hTcxCfg->tcx_mdct_window_minimumFB[i].v.re ); // (Q16, Q15) -> Q16 L_tmp = L_shl( L_tmp, sub( 0, Q16 ) ); // Q0 - tcx20Win[left_overlap + i] = sub_sat( tcx20Win[left_overlap + i], extract_l( L_tmp ) ); // Q0 + tcx20Win[left_overlap + i] = sub_sat( tcx20Win[left_overlap + i], extract_l( L_tmp ) ); // Q0 move32(); } } @@ -1185,7 +1185,7 @@ void core_signal_analysis_high_bitrate_ivas_fx( L_tmp = L_mult( hTcxEnc->speech_TCX[-1 - i], st->hTcxCfg->tcx_aldo_window_1_FB[left_overlap / 2 + minWindowLen - i] ); // (Q0, Q15) -> Q16 L_tmp = Mpy_32_16_1( L_tmp, st->hTcxCfg->tcx_mdct_window_minimumFB[minWindowLen - i].v.im ); // (Q16, Q15) -> Q16 L_tmp = L_shl( L_tmp, sub( 0, Q16 ) ); // Q0 - mdstWin[left_overlap + i] = add_sat( mdstWin[left_overlap + i], extract_l( L_tmp ) ); // Q0 + mdstWin[left_overlap + i] = add_sat( mdstWin[left_overlap + i], extract_l( L_tmp ) ); // Q0 move32(); } FOR( i = tmp - 1; i >= 0; i-- ) /* outer left folding of shortened long ALDO slope */ @@ -1193,7 +1193,7 @@ void core_signal_analysis_high_bitrate_ivas_fx( L_tmp = L_mult( hTcxEnc->speech_TCX[-1 - i], st->hTcxCfg->tcx_aldo_window_1_FB[left_overlap / 2 + minWindowLen - i] ); // (Q0, Q15) -> Q16 L_tmp = Mpy_32_16_1( L_tmp, st->hTcxCfg->tcx_mdct_window_minimumFB[i].v.re ); // (Q16, Q15) -> Q16 L_tmp = L_shl( L_tmp, sub( 0, Q16 ) ); // Q0 - mdstWin[left_overlap + i] = add_sat( mdstWin[left_overlap + i], extract_l( L_tmp ) ); // Q0 + mdstWin[left_overlap + i] = add_sat( mdstWin[left_overlap + i], extract_l( L_tmp ) ); // Q0 move32(); } } @@ -1272,7 +1272,7 @@ void core_signal_analysis_high_bitrate_ivas_fx( L_tmp = L_mult( hTcxEnc->speech_TCX[-1 - i], st->hTcxCfg->tcx_aldo_window_1_FB[left_overlap / 2 + minWindowLen - i] ); // (Q0, Q15) -> Q16 L_tmp = Mpy_32_16_1( L_tmp, st->hTcxCfg->tcx_mdct_window_minimumFB[minWindowLen - i].v.im ); // (Q16, Q15) -> Q16 L_tmp = L_shl( L_tmp, sub( 0, Q16 ) ); // Q0 - mdstWin[left_overlap + i] = add_sat( mdstWin[left_overlap + i], extract_l( L_tmp ) ); // Q0 + mdstWin[left_overlap + i] = add_sat( mdstWin[left_overlap + i], extract_l( L_tmp ) ); // Q0 move32(); } FOR( i = tmp - 1; i >= 0; i-- ) /* outer left folding of shortened long ALDO slope */ @@ -1280,7 +1280,7 @@ void core_signal_analysis_high_bitrate_ivas_fx( L_tmp = L_mult( hTcxEnc->speech_TCX[-1 - i], st->hTcxCfg->tcx_aldo_window_1_FB[left_overlap / 2 + minWindowLen - i] ); // (Q0, Q15) -> Q16 L_tmp = Mpy_32_16_1( L_tmp, st->hTcxCfg->tcx_mdct_window_minimumFB[i].v.re ); // (Q16, Q15) -> Q16 L_tmp = L_shl( L_tmp, sub( 0, Q16 ) ); // Q0 - mdstWin[left_overlap + i] = add_sat( mdstWin[left_overlap + i], extract_l( L_tmp ) ); // Q0 + mdstWin[left_overlap + i] = add_sat( mdstWin[left_overlap + i], extract_l( L_tmp ) ); // Q0 move32(); } } diff --git a/lib_enc/find_tilt.c b/lib_enc/find_tilt.c index d84db41e4..952805169 100644 --- a/lib_enc/find_tilt.c +++ b/lib_enc/find_tilt.c @@ -157,8 +157,8 @@ void find_tilt_ivas_fx( hp_bckr = L_add_sat( L_shl_sat( hp_bckr, 1 ), hp_bckr ); /* Q_new */ } /*mean_voi = 0.5f * (voicing[1] + voicing[2]) + corr_shift;*/ - Ltmp = L_mult( voicing[1], 16384 /* 0.5 in Q15 */ ); // Q31 - Ltmp = L_mac( Ltmp, voicing[2], 16384 /* 0.5 in Q15 */ ); // Q31 + Ltmp = L_mult( voicing[1], 16384 /* 0.5 in Q15 */ ); // Q31 + Ltmp = L_mac( Ltmp, voicing[2], 16384 /* 0.5 in Q15 */ ); // Q31 Ltmp = L_mac_o( Ltmp, corr_shift, 32767 /* 1.0f in Q15 */, &Overflow ); // Q31 mean_voi = round_fx_o( Ltmp, &Overflow ); // Q15 @@ -282,11 +282,11 @@ void find_tilt_ivas_fx( IF( bwidth == NB ) /* For NB input, compensate for the missing bands */ { Ltmp = L_shl_o( ee[i], 3, &Overflow ); /* Q6 */ - IF( EQ_32( Ltmp, MAX_32 ) ) /* if Overflow: Compute with less precision */ + IF( EQ_32( Ltmp, MAX_32 ) ) /* if Overflow: Compute with less precision */ { Ltmp = Mult_32_16( ee[i], 24576 /* 0.75 in Q15 */ ); /* 6/8 Q6*/ - ee[i] = L_shl_sat( Ltmp, 3 ); /* Q6 */ - move32(); /* x8 */ + ee[i] = L_shl_sat( Ltmp, 3 ); /* Q6 */ + move32(); /* x8 */ } ELSE { diff --git a/lib_enc/find_tilt_fx.c b/lib_enc/find_tilt_fx.c index 11467d31b..44ad404e3 100644 --- a/lib_enc/find_tilt_fx.c +++ b/lib_enc/find_tilt_fx.c @@ -85,9 +85,9 @@ void find_tilt_fx( /* bckr + voicing */ /*lp_bckr = mean( pt_bckr, nb_bands );*/ /* estimated noise E in first critical bands, up to 1270 Hz */ lp_bckr = Mean32( pt_bckr, nb_bands ); - /*hp_bckr = 0.5f * (bckr[max_band-1] + bckr[max_band]);*/ /* estimated noise E in last 2 critical bands */ + /*hp_bckr = 0.5f * (bckr[max_band-1] + bckr[max_band]);*/ /* estimated noise E in last 2 critical bands */ hp_bckr = L_shr( L_add_sat( bckr[max_band - 1], bckr[max_band] ), 1 ); /* Q_new + QSCALE - 1 */ - if ( hp_bckr == 0 ) /* Avoid division by zero. */ + if ( hp_bckr == 0 ) /* Avoid division by zero. */ { hp_bckr = L_deposit_l( 1 ); } @@ -112,8 +112,8 @@ void find_tilt_fx( /*mean_voi = 0.5f * (voicing[1] + voicing[2]) + corr_shift;*/ Ltmp = L_mult( voicing[1], 16384 /* 0.5 in Q15 */ ); /* Q31 */ Ltmp = L_mac( Ltmp, voicing[2], 16384 /* 0.5 in Q15 */ ); /* Q31 */ - Ltmp = L_mac_o( Ltmp, corr_shift, 32767, &Overflow ); /* Q31 */ - mean_voi = round_fx_o( Ltmp, &Overflow ); /* Q15 */ + Ltmp = L_mac_o( Ltmp, corr_shift, 32767, &Overflow ); /* Q31 */ + mean_voi = round_fx_o( Ltmp, &Overflow ); /* Q15 */ /*f0 = INT_FS_FX / pitch[2];*/ e_tmp = norm_s( pitch[2] ); @@ -160,7 +160,7 @@ void find_tilt_fx( IF( L_mac0( -(Word32) TH_D_FX * TH_D_FX, tmp, tmp ) < 0 ) { lp_E = L_add_o( *pt_E, lp_E, &Overflow ); /* Q_new + QSCALE - 2 */ - m_cnt = add( m_cnt, 1 ); /* Q0 */ + m_cnt = add( m_cnt, 1 ); /* Q0 */ } pt_E++; } diff --git a/lib_enc/find_uv.c b/lib_enc/find_uv.c index 637488a4c..7798470bc 100644 --- a/lib_enc/find_uv.c +++ b/lib_enc/find_uv.c @@ -256,7 +256,7 @@ Word16 find_uv_ivas_fx( /* o : coding typ * Average voicing (normalized correlation) *-----------------------------------------------------------------*/ - /*mean_ee = 1.0f/3.0f * (st->ee_old + ee[0] + ee[1]); */ /* coefficients take into account the position of the window */ + /*mean_ee = 1.0f/3.0f * (st->ee_old + ee[0] + ee[1]); */ /* coefficients take into account the position of the window */ mean_ee = L_add_o( L_add_o( st_fx->ee_old_fx, ee[0], &Overflow ), ee[1], &Overflow ); /* Q6 */ mean_ee = Mult_32_16( mean_ee, 10923 ); /*Q6*/ @@ -634,7 +634,7 @@ Word16 find_uv_ivas_fx( /* o : coding typ test(); test(); if ( ( GT_16( st_fx->spike_hyst, 1 ) ) && - ( GT_16( dE3, 5 << 8 ) || /* energy increases */ + ( GT_16( dE3, 5 << 8 ) || /* energy increases */ ( GT_16( relE, -3328 /* 13 in Q8 */ ) && ( GT_16( add_sat( mean_voi3, corr_shift ), 22774 /* 0.695 in Q15 */ ) ) ) ) ) /* normalized correlation is high */ { st_fx->spike_hyst = -1; diff --git a/lib_enc/find_uv_fx.c b/lib_enc/find_uv_fx.c index 13fa4501e..3f4c8abc7 100644 --- a/lib_enc/find_uv_fx.c +++ b/lib_enc/find_uv_fx.c @@ -226,7 +226,7 @@ Word16 find_uv_fx( /* o : coding type */ * Average voicing (normalized correlation) *-----------------------------------------------------------------*/ - /*mean_ee = 1.0f/3.0f * (st->ee_old + ee[0] + ee[1]); */ /* coefficients take into account the position of the window */ + /*mean_ee = 1.0f/3.0f * (st->ee_old + ee[0] + ee[1]); */ /* coefficients take into account the position of the window */ mean_ee = L_add_o( L_add_o( st_fx->ee_old_fx, ee[0], &Overflow ), ee[1], &Overflow ); /* Q6 */ mean_ee = Mult_32_16( mean_ee, 10923 /* 1/3 in Q15 */ ); /*Q6*/ @@ -599,7 +599,7 @@ Word16 find_uv_fx( /* o : coding type */ test(); test(); if ( ( GT_16( st_fx->spike_hyst, 1 ) ) && - ( GT_16( dE3, 5 << 8 ) || /* energy increases */ + ( GT_16( dE3, 5 << 8 ) || /* energy increases */ ( GT_16( relE, -3328 ) && ( GT_16( add_sat( mean_voi3, corr_shift ), 22774 ) ) ) ) ) /* normalized correlation is high */ { st_fx->spike_hyst = -1; diff --git a/lib_enc/gain_enc_fx.c b/lib_enc/gain_enc_fx.c index cd24f2993..e0fbcf2c3 100644 --- a/lib_enc/gain_enc_fx.c +++ b/lib_enc/gain_enc_fx.c @@ -443,7 +443,7 @@ void gain_enc_mless_fx( index = gain_quant_fx( gain_code, &gain_code16, LG10_G_CODE_MIN_TC192_Q14, LG10_G_CODE_MAX_TC192_Q13, nBits2, &expg ); push_indice_fx( hBstr, IND_GAIN_CODE, index, nBits2 ); - L_tmp = L_mult( gain_code16, gcode0 ); /*Q0*Q0 -> Q1*/ + L_tmp = L_mult( gain_code16, gcode0 ); /*Q0*Q0 -> Q1*/ *gain_code = L_shl_o( L_tmp, add( add( expg, exp_gcode0 ), 15 ), &Overflow ); /*Q16*/ } ELSE @@ -470,7 +470,7 @@ void gain_enc_mless_fx( #ifdef IVAS_CODE qua_table = gain_qua_mless_6b_stereo; #else - // PMTE() + // PMTE() #endif } move16(); @@ -778,7 +778,7 @@ void gain_enc_mless_ivas_fx( index = gain_quant_fx( gain_code, &gain_code16, LG10_G_CODE_MIN_TC192_Q14, LG10_G_CODE_MAX_TC192_Q13, nBits2, &expg ); push_indice( hBstr, IND_GAIN_CODE, index, nBits2 ); - L_tmp = L_mult( gain_code16, gcode0 ); /*Q0*Q0 -> Q1*/ + L_tmp = L_mult( gain_code16, gcode0 ); /*Q0*Q0 -> Q1*/ *gain_code = L_shl_o( L_tmp, add( add( expg, exp_gcode0 ), 15 ), &Overflow ); /*Q16*/ } ELSE @@ -1718,8 +1718,8 @@ void gain_enc_tc_ivas_fx( *----------------------------------------------------------------*/ g_code_fx = div_s( num, den ); - i = sub( exp_num, exp_den ); /* Gain_trans in Q7 */ - g_code_fx = i_mult2( g_code_fx, tmp16 ); /* apply sign */ + i = sub( exp_num, exp_den ); /* Gain_trans in Q7 */ + g_code_fx = i_mult2( g_code_fx, tmp16 ); /* apply sign */ *gain_code_fx = L_shr_sat( L_deposit_l( g_code_fx ), i ); /* Q16 */ move32(); @@ -1983,9 +1983,9 @@ static Word16 Find_Opt_gainQ_fx( g_code = *p++; /* selected code gain in Q9 */ move16(); - L_tmp = L_mult( g_code, gcode0 ); /* Q9*Q0 -> Q10 */ + L_tmp = L_mult( g_code, gcode0 ); /* Q9*Q0 -> Q10 */ L_tmp = L_shl_sat( L_tmp, add( exp_gcode0, 6 ) ); /* Q10 -> Q16 */ - *gain_code = L_tmp; /* gain of code in Q16 */ + *gain_code = L_tmp; /* gain of code in Q16 */ move16(); return index; } @@ -3201,7 +3201,7 @@ void gain_enc_amr_wb_fx( g_code = *p++; /* selected code gain in Q11 */ move16(); - L_tmp = L_mult( g_code, gcode0 ); /* Q11*Q0 -> Q12 */ + L_tmp = L_mult( g_code, gcode0 ); /* Q11*Q0 -> Q12 */ L_tmp = L_shl_o( L_tmp, add( exp_gcode0, 4 ), &Overflow ); /* Q12 -> Q16 */ *gain_code = L_tmp; /* gain of code in Q16 */ diff --git a/lib_enc/gaus_enc_fx.c b/lib_enc/gaus_enc_fx.c index dcedd5415..a9add7ea8 100644 --- a/lib_enc/gaus_enc_fx.c +++ b/lib_enc/gaus_enc_fx.c @@ -116,8 +116,8 @@ Word16 gaus_encode_fx( Ltmp = L_shl( Ltmp, add( 5, shift ) ); /* Q_new + 15 + shift */ Ltmp = L_negate( Ltmp ); Ltmp = L_mac( Ltmp, xn[L_SUBFR - 1], 16384 ); /* Q_new + 15 + shift */ - Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); /* Q_new + 16 */ - *mem_w0 = round_fx_sat( Ltmp ); /* Q_new */ + Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); /* Q_new + 16 */ + *mem_w0 = round_fx_sat( Ltmp ); /* Q_new */ move16(); init_gp_clip_fx( clip_gain ); /* reset pitch clipping parameters */ @@ -214,8 +214,8 @@ Word16 gaus_encode_ivas_fx( Ltmp = L_shl( Ltmp, add( 5, shift ) ); /* Q_new + 15 + shift */ Ltmp = L_negate( Ltmp ); Ltmp = L_mac( Ltmp, xn[L_SUBFR - 1], 16384 ); /* Q_new + 15 + shift */ - Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); /* Q_new + 16 */ - *mem_w0 = round_fx_sat( Ltmp ); /* Q_new */ + Ltmp = L_shl_sat( Ltmp, sub( 1, shift ) ); /* Q_new + 16 */ + *mem_w0 = round_fx_sat( Ltmp ); /* Q_new */ move16(); init_gp_clip_fx( clip_gain ); /* reset pitch clipping parameters */ @@ -364,7 +364,7 @@ void gauss2v_fx( Den = extract_h( L_shl( Lden, exp_den ) ); delta = shr_o( div_s( Num, Den ), sub( exp_num, exp_den ), &Overflow ); /* Q15 */ - delta = i_mult2( delta, m_sign ); /* Apply sign Q0*/ + delta = i_mult2( delta, m_sign ); /* Apply sign Q0*/ /* index_delta = (short)(FAC_DELTA * fdelta) */ index_delta = shr( delta, SFAC_DELTA ); @@ -689,7 +689,7 @@ void gauss2v_fx( } ener_sqrt = Isqrt( L_shl_sat( GainPortion2, 1 ) ); /* Make value a Q16 prior to division (align on power of 4) */ - ener_sqrt = L_shr( ener_sqrt, 8 ); /* Left-shift Q23 result to make a Q15 result */ + ener_sqrt = L_shr( ener_sqrt, 8 ); /* Left-shift Q23 result to make a Q15 result */ Portion = Mult_32_16( GainPortion1, 19661 ); /* Performs GainPortion1*.6 */ Portion = Madd_32_16( Portion, ener_sqrt, 13107 ); /* Performs ener_sqrt*.4 */ @@ -825,7 +825,7 @@ void gauss2v_ivas_fx( Den = extract_h( L_shl( Lden, exp_den ) ); delta = shr_o( div_s( Num, Den ), sub( exp_num, exp_den ), &Overflow ); /* Q15 */ - delta = i_mult2( delta, m_sign ); /* Apply sign */ + delta = i_mult2( delta, m_sign ); /* Apply sign */ /* index_delta = (short)(FAC_DELTA * fdelta) */ index_delta = shr( delta, SFAC_DELTA ); @@ -1151,7 +1151,7 @@ void gauss2v_ivas_fx( } ener_sqrt = Isqrt( L_shl_sat( GainPortion2, 1 ) ); /* Make value a Q16 prior to division (align on power of 4) */ - ener_sqrt = L_shr( ener_sqrt, 8 ); /* Left-shift Q23 result to make a Q15 result */ + ener_sqrt = L_shr( ener_sqrt, 8 ); /* Left-shift Q23 result to make a Q15 result */ Portion = Mult_32_16( GainPortion1, 19661 ); /* Performs GainPortion1*.6 */ Portion = Madd_32_16( Portion, ener_sqrt, 13107 ); /* Performs ener_sqrt*.4 */ diff --git a/lib_enc/hf_cod_amrwb_fx.c b/lib_enc/hf_cod_amrwb_fx.c index 7afcc3528..e21a8bd67 100644 --- a/lib_enc/hf_cod_amrwb_fx.c +++ b/lib_enc/hf_cod_amrwb_fx.c @@ -107,9 +107,9 @@ void hf_cod_fx( ener_exc_fx = dot_prod_satcontr( exc_fx, exc_fx, Q_exc, Q_exc, &q1, L_SUBFR ); ener_hf_fx = dot_prod_satcontr( HF_fx, HF_fx, -3, -3, &q2, L_SUBFR16k ); - scale_fx = div_s( shl( 1, 14 ), ener_exc_fx ); /*Q(29-q1) */ - L_tmp = L_mult( ener_hf_fx, scale_fx ); /*30-q1+q2 */ - q2 = sub( q1, q2 ); /*30-q2 */ + scale_fx = div_s( shl( 1, 14 ), ener_exc_fx ); /*Q(29-q1) */ + L_tmp = L_mult( ener_hf_fx, scale_fx ); /*30-q1+q2 */ + q2 = sub( q1, q2 ); /*30-q2 */ scale_fx = round_fx( Isqrt( L_shl_o( L_tmp, sub( q2, 26 ), &Overflow ) ) ); /*Q13 */ @@ -183,9 +183,9 @@ void hf_cod_fx( ener_hf_fx = dot_prod_satcontr( HF_syn_fx, HF_syn_fx, 0, 0, &q2, L_SUBFR16k ); ener_input_fx = dot_prod_satcontr( HF_SP_fx, HF_SP_fx, 0, 0, &q1, L_SUBFR16k ); - HF_calc_gain_fx = div_s( shl( 1, 14 ), ener_input_fx ); /*Q(29-q1) */ - L_tmp = L_mult( ener_hf_fx, HF_calc_gain_fx ); /*30-q1+q2 */ - q2 = sub( q1, q2 ); /*30-q2 */ + HF_calc_gain_fx = div_s( shl( 1, 14 ), ener_input_fx ); /*Q(29-q1) */ + L_tmp = L_mult( ener_hf_fx, HF_calc_gain_fx ); /*30-q1+q2 */ + q2 = sub( q1, q2 ); /*30-q2 */ HF_calc_gain_fx = round_fx_o( Isqrt( L_shl_sat( L_tmp, sub( q2, 20 ) ) ), &Overflow ); /*Q10 */ diff --git a/lib_enc/hq_lr_enc_fx.c b/lib_enc/hq_lr_enc_fx.c index 7d496f2a1..424689804 100644 --- a/lib_enc/hq_lr_enc_fx.c +++ b/lib_enc/hq_lr_enc_fx.c @@ -607,9 +607,9 @@ void hq_lr_enc_fx( exp = 0; move16(); } - L_tmp = Mult_32_16( Ep_vari_fx, 3277 ); /*13+15-15=13 */ + L_tmp = Mult_32_16( Ep_vari_fx, 3277 ); /*13+15-15=13 */ L_tmp = L_shl_o( Mult_32_16( L_tmp, tmp ), sub( 12, exp ), &Overflow ); /*Q(13+exp-15 +12-exp +4 = 14) */ - tmp2 = extract_h( Ep_avrg_fx ); /*Q13-16=-3 */ + tmp2 = extract_h( Ep_avrg_fx ); /*Q13-16=-3 */ IF( tmp2 != 0 ) { exp = norm_s( tmp2 ); @@ -624,16 +624,16 @@ void hq_lr_enc_fx( exp = 0; move16(); } - L_tmp2 = Mult_32_16( Ep_vari_fx, 6554 ); /*13+15-15=13 */ + L_tmp2 = Mult_32_16( Ep_vari_fx, 6554 ); /*13+15-15=13 */ L_tmp2 = L_shl_o( Mult_32_16( L_tmp2, tmp2 ), sub( 13, exp ), &Overflow ); /*Q(13+exp-15 +13-exp +3 = 14) */ - L_tmp = L_min( L_tmp, L_tmp2 ); /*Q14 */ - tmp = extract_l( L_min( L_tmp, 13107 ) ); /*Q14 */ + L_tmp = L_min( L_tmp, L_tmp2 ); /*Q14 */ + tmp = extract_l( L_min( L_tmp, 13107 ) ); /*Q14 */ alpha_fx = add( 16384, tmp ); } IF( EQ_16( hHQ_core->last_bitalloc_max_band[j++], 1 ) ) { L_tmp = Mult_32_16( Ep_tmp_fx[i], sub( bands_fx, lowband ) ); /*Q(13+0-15 = -2) */ - tmp = extract_h( L_shl_sat( L_tmp, 14 ) ); /*Q-4 */ + tmp = extract_h( L_shl_sat( L_tmp, 14 ) ); /*Q-4 */ IF( tmp != 0 ) { exp = norm_s( tmp ); @@ -649,9 +649,9 @@ void hq_lr_enc_fx( move16(); } L_tmp = L_shl_o( Mult_32_16( Ep_avrg_fx, tmp ), sub( 14, exp ), &Overflow ); /*Q(13+exp-15 +14-exp+2 = 14) */ - L_tmp = L_max( L_tmp, 16384 ); /*Q14 */ - tmp = extract_l( L_min( L_tmp, beta_fx ) ); /*Q14 */ - alpha_fx = shl( mult( alpha_fx, tmp ), 1 ); /*14+14-15 +1=Q14 */ + L_tmp = L_max( L_tmp, 16384 ); /*Q14 */ + tmp = extract_l( L_min( L_tmp, beta_fx ) ); /*Q14 */ + alpha_fx = shl( mult( alpha_fx, tmp ), 1 ); /*14+14-15 +1=Q14 */ } ELSE { @@ -672,10 +672,10 @@ void hq_lr_enc_fx( move16(); } L_tmp = L_shl_o( Mult_32_16( Ep_tmp_fx[i], tmp2 ), sub( 19, exp ), &Overflow ); /*Q(13+exp-15 +19-exp +3 = 20) */ - L_tmp = Mult_32_16( L_tmp, shl( sub( bands_fx, lowband ), 9 ) ); /*20 +9 -15 =Q14 */ - L_tmp = L_max( L_tmp, 13926 ); /*Q14 */ - tmp2 = extract_l( L_min( L_tmp, 16384 ) ); /*Q14 */ - alpha_fx = shl( mult( alpha_fx, tmp2 ), 1 ); /*14+14-15+1 =Q14 */ + L_tmp = Mult_32_16( L_tmp, shl( sub( bands_fx, lowband ), 9 ) ); /*20 +9 -15 =Q14 */ + L_tmp = L_max( L_tmp, 13926 ); /*Q14 */ + tmp2 = extract_l( L_min( L_tmp, 16384 ) ); /*Q14 */ + alpha_fx = shl( mult( alpha_fx, tmp2 ), 1 ); /*14+14-15+1 =Q14 */ } L_band_energy_tmp[i] = L_shl( Mult_32_16( L_band_energy_tmp[i], alpha_fx ), 1 ); /*Q(Q_band_energy+14-15 +1= Q_band_energy) */ move32(); @@ -782,7 +782,7 @@ void hq_lr_enc_fx( IF( GE_16( i, lowband ) && add( sub( i, bands_fx ), p2a_bands_fx ) < 0 ) { Ep_vari_fx = L_add_sat( Ep_vari_fx, L_abs( L_sub_sat( Ep_tmp_fx[i], Ep_tmp_fx[( i - 1 )] ) ) ); /*Q15 */ - Ep_avrg_fx = L_add_o( Ep_avrg_fx, Ep_tmp_fx[i], &Overflow ); /*Q15 */ + Ep_avrg_fx = L_add_o( Ep_avrg_fx, Ep_tmp_fx[i], &Overflow ); /*Q15 */ } IF( GE_16( i, highband ) ) @@ -850,7 +850,7 @@ void hq_lr_enc_fx( IF( EQ_16( hHQ_core->last_bitalloc_max_band[sub( i, add( tmp, 1 ) )], 1 ) ) { tmp = sub( tmp, lowband ); - L_tmp = Mult_32_16( Ep_tmp_fx[i], tmp ); /*Q(15+0-15 = 0) */ + L_tmp = Mult_32_16( Ep_tmp_fx[i], tmp ); /*Q(15+0-15 = 0) */ tmp = extract_h( L_shl_o( L_tmp, 16, &Overflow ) ); /*Q0 */ IF( tmp != 0 ) { @@ -1573,10 +1573,10 @@ void hq_lr_enc_ivas_fx( move16(); } Mpy_32_16_ss( Ep_avrg_fx, tmp, &L_tmp, &lo ); - L_tmp = L_shl_o( L_tmp, sub( 14, exp ), &Overflow ); /*Q(13+exp-15 +14-exp+2 = 14) */ - L_tmp = L_max( L_tmp, 16384 ); /*14 */ - tmp = extract_l( L_min( L_tmp, beta_fx ) ); /*14 */ - alpha_fx = shl( mult( alpha_fx, tmp ), 1 ); /*14+14-15 +1=14 */ + L_tmp = L_shl_o( L_tmp, sub( 14, exp ), &Overflow ); /*Q(13+exp-15 +14-exp+2 = 14) */ + L_tmp = L_max( L_tmp, 16384 ); /*14 */ + tmp = extract_l( L_min( L_tmp, beta_fx ) ); /*14 */ + alpha_fx = shl( mult( alpha_fx, tmp ), 1 ); /*14+14-15 +1=14 */ } ELSE { @@ -1662,8 +1662,8 @@ void hq_lr_enc_ivas_fx( Mpy_32_16_ss( Ep_peak_fx, tmp, &L_tmp, &lo ); Mpy_32_16_ss( L_tmp, lowband, &L_tmp, &lo ); Mpy_32_16_ss( L_tmp, 18842, &L_tmp, &lo ); - L_tmp = L_shl_o( L_tmp, sub( 27, exp ), &Overflow ); /*Q14 0.5 */ - tmp2 = extract_l( L_min( L_tmp, 19661 ) ); /*14 */ + L_tmp = L_shl_o( L_tmp, sub( 27, exp ), &Overflow ); /*Q14 0.5 */ + tmp2 = extract_l( L_min( L_tmp, 19661 ) ); /*14 */ Mpy_32_16_ss( L_band_energy_tmp[i], tmp2, &L_tmp, &lo ); L_band_energy_tmp[i] = L_shl( L_tmp, 1 ); /*Q_band_energy */ move32(); @@ -1686,7 +1686,7 @@ void hq_lr_enc_ivas_fx( bit_budget = sub( bit_budget, 2 ); /* bits in high bands to indicate the last 2 subbands is allocated bits or not */ FOR( i = 0; i < bands; i++ ) { - Ep_tmp_fx[i] = L_shl_o( Ep_tmp_fx[i], 2, &Overflow ); /* Q15 */ + Ep_tmp_fx[i] = L_shl_o( Ep_tmp_fx[i], 2, &Overflow ); /* Q15 */ move32(); } IF( EQ_32( st->core_brate, ACELP_13k20 ) ) @@ -1722,7 +1722,7 @@ void hq_lr_enc_ivas_fx( IF( sub( i, lowband ) >= 0 && add( sub( i, bands ), p2a_bands ) < 0 ) { Ep_vari_fx = L_add( Ep_vari_fx, L_abs( L_sub( Ep_tmp_fx[i], Ep_tmp_fx[sub( i, 1 )] ) ) ); /*Q15 */ - Ep_avrg_fx = L_add_o( Ep_avrg_fx, Ep_tmp_fx[i], &Overflow ); /*Q15 */ + Ep_avrg_fx = L_add_o( Ep_avrg_fx, Ep_tmp_fx[i], &Overflow ); /*Q15 */ } IF( sub( i, highband ) >= 0 ) @@ -1755,7 +1755,7 @@ void hq_lr_enc_ivas_fx( tmp = sub( bands, p2a_bands ); tmp = sub( tmp, lowband ); /*Q0 */ - tmp1 = extract_h( L_shl_o( Ep_avrg_fx, 1, &Overflow ) ); /*Q0 */ + tmp1 = extract_h( L_shl_o( Ep_avrg_fx, 1, &Overflow ) ); /*Q0 */ IF( tmp1 != 0 ) { exp = norm_s( tmp1 ); @@ -1794,7 +1794,7 @@ void hq_lr_enc_ivas_fx( { tmp = sub( tmp, lowband ); Mpy_32_16_ss( Ep_tmp_fx[i], tmp, &L_tmp, &lo ); - tmp = extract_h( L_shl_o( L_tmp, 16, &Overflow ) ); /*Q0 */ + tmp = extract_h( L_shl_o( L_tmp, 16, &Overflow ) ); /*Q0 */ IF( tmp != 0 ) { exp = norm_s( tmp ); @@ -1819,7 +1819,7 @@ void hq_lr_enc_ivas_fx( { tmp = sub( tmp, lowband ); - tmp1 = extract_h( L_shl_o( Ep_avrg_fx, 1, &Overflow ) ); /*Q0 */ + tmp1 = extract_h( L_shl_o( Ep_avrg_fx, 1, &Overflow ) ); /*Q0 */ IF( tmp1 != 0 ) { exp = norm_s( tmp1 ); @@ -1858,7 +1858,7 @@ void hq_lr_enc_ivas_fx( { IF( sub( i, lowband ) >= 0 ) { - Ep_avrg_fx = L_add_o( Ep_avrg_fx, Ep_tmp_fx[i], &Overflow ); /*Q15 */ + Ep_avrg_fx = L_add_o( Ep_avrg_fx, Ep_tmp_fx[i], &Overflow ); /*Q15 */ } ELSE { @@ -1887,7 +1887,7 @@ void hq_lr_enc_ivas_fx( move16(); FOR( i = 0; i < lowband; i++ ) { - tmp = extract_h( L_shl_o( Ep_avrgL_fx, 1, &Overflow ) ); /*Q0 */ + tmp = extract_h( L_shl_o( Ep_avrgL_fx, 1, &Overflow ) ); /*Q0 */ IF( tmp != 0 ) { exp = norm_s( tmp ); @@ -3725,8 +3725,8 @@ static void mdct_spectrum_fine_gain_enc_fx( exp_normn = sub( exp_normn, 1 ); exp_normd = norm_l( L_Eyy ); gamma_fx = div_l( L_shl_o( L_Exy, exp_normn, &Overflow ), round_fx_o( L_shl_o( L_Eyy, exp_normd, &Overflow ), &Overflow ) ); /* Qgamma */ - Qgamma = add( sub( exp_normn, exp_normd ), 15 ); /* exp_normn - (exp_normd-16) - 1; */ - gamma_fx = shl( gamma_fx, sub( 14, Qgamma ) ); /* Qgamma -> Q14 */ + Qgamma = add( sub( exp_normn, exp_normd ), 15 ); /* exp_normn - (exp_normd-16) - 1; */ + gamma_fx = shl( gamma_fx, sub( 14, Qgamma ) ); /* Qgamma -> Q14 */ dmin_fx = 32767; move16(); @@ -3887,8 +3887,8 @@ static void mdct_spectrum_fine_gain_enc_ivas_fx( exp_normn = sub( exp_normn, 1 ); exp_normd = norm_l( L_Eyy ); gamma_fx = div_l( L_shl_o( L_Exy, exp_normn, &Overflow ), round_fx_o( L_shl_o( L_Eyy, exp_normd, &Overflow ), &Overflow ) ); /* Qgamma */ - Qgamma = add( sub( exp_normn, exp_normd ), 15 ); /* exp_normn - (exp_normd-16) - 1; */ - gamma_fx = shl( gamma_fx, sub( 14, Qgamma ) ); /* Qgamma -> Q14 */ + Qgamma = add( sub( exp_normn, exp_normd ), 15 ); /* exp_normn - (exp_normd-16) - 1; */ + gamma_fx = shl( gamma_fx, sub( 14, Qgamma ) ); /* Qgamma -> Q14 */ dmin_fx = 32767; move16(); diff --git a/lib_enc/hvq_enc_fx.c b/lib_enc/hvq_enc_fx.c index 7a9514e07..5414329e2 100644 --- a/lib_enc/hvq_enc_fx.c +++ b/lib_enc/hvq_enc_fx.c @@ -146,7 +146,7 @@ Word16 hvq_enc_ivas_fx( /*o : Consumed bits acc = L_mult( tmp16, HVQ_NFPE_FACTOR_CUBE_FX ); /* in Q(12+6+1) = Q19 */ expNfpe3 = extract_l( L_mult0( expNfpe, 3 ) ); /* Cube operation */ /* Number of bits required to adjust to Q15 */ - adjust = add( 19 - ( 15 + 16 ), expNfpe3 ); /* +16 is due to the following extract_h(). */ + adjust = add( 19 - ( 15 + 16 ), expNfpe3 ); /* +16 is due to the following extract_h(). */ noise_level[i] = extract_h( L_shr_o( acc, adjust, &Overflow ) ); /* noise_level[] in Q15 */ move16(); q_noise_level_idx[i] = quant_lc( noise_level[i], &q_noise_level[i] ); @@ -177,9 +177,9 @@ Word16 hvq_enc_ivas_fx( /*o : Consumed bits acc = L_mult( tmp16, HVQ_LB_NFPE_FACTOR_CUBE_FX ); /* in Q(12+9+1) = Q22 */ expo3 = extract_l( L_mult0( expo, 3 ) ); /* Cube operation. */ /* Number of bits required to adjust to Q15 */ - adjust = add( 22 - ( 15 + 16 ), expo3 ); /* +16 is due to the following extract_h(). */ + adjust = add( 22 - ( 15 + 16 ), expo3 ); /* +16 is due to the following extract_h(). */ lb_nfpe = extract_h( L_shr_o( acc, adjust, &Overflow ) ); /* noise_level[] in Q15 */ - IF( GT_16( lb_nfpe, 16384 ) ) /* in Q15 */ + IF( GT_16( lb_nfpe, 16384 ) ) /* in Q15 */ { lb_nfpe = 16384; move16(); @@ -322,7 +322,7 @@ Word16 hvq_enc_fx( /*o : Consumed bits acc = L_mult( tmp16, HVQ_NFPE_FACTOR_CUBE_FX ); /* in Q(12+6+1) = Q19 */ expNfpe3 = extract_l( L_mult0( expNfpe, 3 ) ); /* Cube operation */ /* Number of bits required to adjust to Q15 */ - adjust = add( 19 - ( 15 + 16 ), expNfpe3 ); /* +16 is due to the following extract_h(). */ + adjust = add( 19 - ( 15 + 16 ), expNfpe3 ); /* +16 is due to the following extract_h(). */ noise_level[i] = extract_h( L_shr_o( acc, adjust, &Overflow ) ); /* noise_level[] in Q15 */ q_noise_level_idx[i] = quant_lc( noise_level[i], &q_noise_level[i] ); } @@ -350,9 +350,9 @@ Word16 hvq_enc_fx( /*o : Consumed bits acc = L_mult( tmp16, HVQ_LB_NFPE_FACTOR_CUBE_FX ); /* in Q(12+9+1) = Q22 */ expo3 = extract_l( L_mult0( expo, 3 ) ); /* Cube operation. */ /* Number of bits required to adjust to Q15 */ - adjust = add( 22 - ( 15 + 16 ), expo3 ); /* +16 is due to the following extract_h(). */ + adjust = add( 22 - ( 15 + 16 ), expo3 ); /* +16 is due to the following extract_h(). */ lb_nfpe = extract_h( L_shr_o( acc, adjust, &Overflow ) ); /* noise_level[] in Q15 */ - IF( lb_nfpe > 16384 ) /* in Q15 */ + IF( lb_nfpe > 16384 ) /* in Q15 */ { lb_nfpe = 16384; move16(); diff --git a/lib_enc/nelp_enc_fx.c b/lib_enc/nelp_enc_fx.c index ac099b61f..a0f123b20 100644 --- a/lib_enc/nelp_enc_fx.c +++ b/lib_enc/nelp_enc_fx.c @@ -817,7 +817,7 @@ void nelp_encoder_fx( exp2 = 30 - exp2 - qEL1; move16(); tmp1 = Log2_norm_lc( L_tmp ); - Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q15 format = Q0 format */ + Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q15 format = Q0 format */ tmp1 = round_fx_sat( L_shl_sat( Ltemp, 12 ) ); /* Q12 */ RL_fx = L_mult0( tmp1, 10 ); } @@ -833,7 +833,7 @@ void nelp_encoder_fx( exp2 = 30 - ( 30 + qEL1 - qEL2 - exp1 + exp2 ); move16(); tmp1 = Log2_norm_lc( L_tmp ); - Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q15 format = Q0 format */ + Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q15 format = Q0 format */ tmp1 = round_fx_sat( L_shl_sat( Ltemp, 12 ) ); /* Q12 */ RL_fx = L_mult0( tmp1, 10 ); } @@ -845,7 +845,7 @@ void nelp_encoder_fx( exp2 = 30 - exp2 - qEH2; move16(); tmp1 = Log2_norm_lc( L_tmp ); - Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q13 format = Q0 format */ + Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q13 format = Q0 format */ tmp1 = round_fx_sat( L_shl_sat( Ltemp, 12 ) ); /* Q12 */ RH_fx = L_mult0( tmp1, 10 ); } @@ -861,7 +861,7 @@ void nelp_encoder_fx( exp2 = 30 - ( 30 + qEH1 - qEH2 - exp1 + exp2 ); move16(); tmp1 = Log2_norm_lc( L_tmp ); - Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q13 format = Q0 format */ + Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q13 format = Q0 format */ tmp1 = round_fx_sat( L_shl_sat( Ltemp, 12 ) ); /* Q12 */ RH_fx = L_mult0( tmp1, 10 ); } @@ -1560,7 +1560,7 @@ void nelp_encoder_ivas_fx( L_tmp = L_shl( EL1_fx, exp2 ); exp2 = sub( sub( 30, exp2 ), qEL1 ); tmp1 = Log2_norm_lc( L_tmp ); - Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q15 format = Q0 format */ + Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q15 format = Q0 format */ tmp1 = round_fx_sat( L_shl_sat( Ltemp, 12 ) ); /* Q12 */ RL_fx = L_mult0( tmp1, 10 ); } @@ -1575,7 +1575,7 @@ void nelp_encoder_ivas_fx( L_tmp = L_shl( L_tmp, exp2 ); /*15+qEL1-qEL2-exp1+exp2 */ exp2 = sub( 30, add( sub( sub( add( 30, qEL1 ), qEL2 ), exp1 ), exp2 ) ); tmp1 = Log2_norm_lc( L_tmp ); - Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q15 format = Q0 format */ + Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q15 format = Q0 format */ tmp1 = round_fx_sat( L_shl_sat( Ltemp, 12 ) ); /* Q12 */ RL_fx = L_mult0( tmp1, 10 ); } @@ -1586,7 +1586,7 @@ void nelp_encoder_ivas_fx( L_tmp = L_shl( EH2_fx, exp2 ); exp2 = sub( sub( 30, exp2 ), qEH2 ); tmp1 = Log2_norm_lc( L_tmp ); - Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q13 format = Q0 format */ + Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q13 format = Q0 format */ tmp1 = round_fx_sat( L_shl_sat( Ltemp, 12 ) ); /* Q12 */ RH_fx = L_mult0( tmp1, 10 ); } @@ -1601,7 +1601,7 @@ void nelp_encoder_ivas_fx( L_tmp = L_shl( L_tmp, exp2 ); /*15+qEH1-qEH2-exp1+exp2 */ exp2 = sub( 30, add( 30, add( sub( sub( qEH1, qEH2 ), exp1 ), exp2 ) ) ); tmp1 = Log2_norm_lc( L_tmp ); - Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q13 format = Q0 format */ + Ltemp = Mpy_32_16( exp2, tmp1, 9864 ); /*10*log(2) in Q13 format = Q0 format */ tmp1 = round_fx_sat( L_shl_sat( Ltemp, 12 ) ); /* Q12 */ RH_fx = L_mult0( tmp1, 10 ); } diff --git a/lib_enc/nois_est_fx.c b/lib_enc/nois_est_fx.c index 83c52a5af..be86c0574 100644 --- a/lib_enc/nois_est_fx.c +++ b/lib_enc/nois_est_fx.c @@ -1215,8 +1215,8 @@ void noise_est_fx( tmp = s_max( relE, 0 ); /* Q8 */ /* alpha = 0.064f * ftemp + 0.75f; */ - Ltmp = Mult_32_16( (Word32) 137438953L, tmp ); /* Q31(.064)+Q8+1-16 --> Q24 */ - Ltmp = L_mac( Ltmp, 256, 24576 ); /* Q8+Q15(.75)+1 --> Q24 */ + Ltmp = Mult_32_16( (Word32) 137438953L, tmp ); /* Q31(.064)+Q8+1-16 --> Q24 */ + Ltmp = L_mac( Ltmp, 256, 24576 ); /* Q8+Q15(.75)+1 --> Q24 */ alpha = round_fx_o( L_shl_o( Ltmp, 7, &Overflow ), &Overflow ); /*Q24 +7 --> Q31 Q15*/ /*if( alpha > 0.999f { alpha = 0.999f;} */ @@ -1252,7 +1252,7 @@ void noise_est_fx( /* + 1.0f added to reduce sensitivity to non stationarity in low energies */ /* tmp_enr = enr[i] + 1.0f; */ tmp_Q = add( Q_new, Q_SCALE ); - Ltmp = L_shl( (Word32) 1L, tmp_Q ); /* 1.0 added in the right dynamic domain */ + Ltmp = L_shl( (Word32) 1L, tmp_Q ); /* 1.0 added in the right dynamic domain */ L_tmp_enr = L_add_o( enr[i], Ltmp, &Overflow ); /* enr scale dynamic */ L_tmp_ave_enr = L_add_o( hNoiseEst->ave_enr_fx[i], Ltmp, &Overflow ); /* ave__enr scale dynamic */ @@ -1293,10 +1293,10 @@ void noise_est_fx( } */ /* ave_enr2:: calculation of another non-stationarity measure (following attacks) */ - Ltmp = L_shl( (Word32) 1L, tmp_Q ); /* 1.0 added in the right dynamic domain */ - /*L_tmp_enr = L_add(enr[i] , Ltmp );*/ /* enr scale dynamic , done above */ + Ltmp = L_shl( (Word32) 1L, tmp_Q ); /* 1.0 added in the right dynamic domain */ + /*L_tmp_enr = L_add(enr[i] , Ltmp );*/ /* enr scale dynamic , done above */ L_tmp_ave_enr2 = L_add_o( hNoiseEst->ave_enr2_fx[i], Ltmp, &Overflow ); /* ave__enr scale dynamic */ - IF( LE_32( Lnon_sta2, th_sta ) ) /* Just to limit the saturation */ + IF( LE_32( Lnon_sta2, th_sta ) ) /* Just to limit the saturation */ { Lnum = L_max( L_tmp_enr, L_tmp_ave_enr2 ); Lden = L_min( L_tmp_enr, L_tmp_ave_enr2 ); @@ -1459,8 +1459,8 @@ void noise_est_fx( /*epsP_0_2 = max(0 , min(8, epsP[0] / epsP[2])); */ Ltmp = eps_quota_fx( epsP_h[0], epsP_l[0], - epsP_h[2], epsP_l[2], 12 ); /* Word32 Q12 */ - BASOP_SATURATE_WARNING_OFF_EVS /* may saturate*/ + epsP_h[2], epsP_l[2], 12 ); /* Word32 Q12 */ + BASOP_SATURATE_WARNING_OFF_EVS /* may saturate*/ epsP_0_2 = round_fx_o( L_shl_o( Ltmp, 16, &Overflow ), &Overflow ); /* Q12+16 -16 -> Q12 , NB saturation in Q12 sets max value to 7,999 */ BASOP_SATURATE_WARNING_ON_EVS @@ -1498,8 +1498,8 @@ void noise_est_fx( /* epsP_2_16 = max(0 , min(8, epsP[2] / epsP[16])); */ Ltmp = eps_quota_fx( epsP_h[2], epsP_l[2], - epsP_h[16], epsP_l[16], 12 ); /* Word32 Q12 */ - BASOP_SATURATE_WARNING_OFF_EVS /* may saturate*/ + epsP_h[16], epsP_l[16], 12 ); /* Word32 Q12 */ + BASOP_SATURATE_WARNING_OFF_EVS /* may saturate*/ epsP_2_16 = round_fx_o( L_shl_o( Ltmp, 16, &Overflow ), &Overflow ); /* Q12+16 -16 -> Q12 , NB saturation in Q12 sets max value to 7,999 */ BASOP_SATURATE_WARNING_ON_EVS @@ -2524,7 +2524,7 @@ void noise_est_ivas_fx( ELSE { /* ftemp2 /= ftemp */ - num = div_s( extract_h( Ltmp2 ), extract_h( Ltmp ) ); // 15+exp2-exp + num = div_s( extract_h( Ltmp2 ), extract_h( Ltmp ) ); // 15+exp2-exp noise_chartmp = shl_o( num, sub( sub( exp, exp2 ), 4 ), &Overflow ); // 15+exp2-exp1 -> Q11 } @@ -2653,8 +2653,8 @@ void noise_est_ivas_fx( ExpDen = norm_l( Lden ); den = extract_h( L_shl( Lden, ExpDen ) ); // q_enr+ExpDen-16 - num = div_s( num, den ); // 15+ExpNum-ExpDen - Ltmp1 = Mult_32_16( non_sta, num ); // 15+ExpNum-ExpDen+10-15 + num = div_s( num, den ); // 15+ExpNum-ExpDen + Ltmp1 = Mult_32_16( non_sta, num ); // 15+ExpNum-ExpDen+10-15 non_sta = L_shr_o( Ltmp1, sub( ExpNum, ExpDen ), &Overflow ); /* Q10 */ } @@ -2692,8 +2692,8 @@ void noise_est_ivas_fx( ExpDen = norm_l( Lden ); den = extract_h( L_shl( Lden, ExpDen ) ); // q_enr+ExpDen-16 - num = div_s( num, den ); // 15+ExpNum-ExpDen - Ltmp1 = Mult_32_16( Lnon_sta2, num ); // 15+ExpNum-ExpDen+10-15 + num = div_s( num, den ); // 15+ExpNum-ExpDen + Ltmp1 = Mult_32_16( Lnon_sta2, num ); // 15+ExpNum-ExpDen+10-15 Lnon_sta2 = L_shr_o( Ltmp1, sub( ExpNum, ExpDen ), &Overflow ); /* Q10 */ } diff --git a/lib_enc/ppp_enc_fx.c b/lib_enc/ppp_enc_fx.c index b9974e202..bfbe60144 100644 --- a/lib_enc/ppp_enc_fx.c +++ b/lib_enc/ppp_enc_fx.c @@ -766,11 +766,11 @@ static void LPCPowSpect_fx( t1 = add( t1, (Word16) L_shr( Ltemp, 16 ) ); /* t1 is interpolated cos(w) */ Ltemp = L_shr( L_mult( LPC[i], t1 ), 1 ); /* Ltemp in Q27 */ - Re = L_add_o( Re, Ltemp, &Overflow ); /* Re=1-sum(LPC[i]*cos(Lw)); */ - Ltemp = L_add_o( Lw, 0x6000, &Overflow ); /* add 0.75, which is 3pi/2 to convert sin to cos */ - Ltemp = L_shl_o( Ltemp, 10, &Overflow ); /* Q25 */ - w = extract_h( Ltemp ); /* w is equivalent cos index */ - dl = extract_l( Ltemp ); /* dl is 6 bit left-over for interpolation */ + Re = L_add_o( Re, Ltemp, &Overflow ); /* Re=1-sum(LPC[i]*cos(Lw)); */ + Ltemp = L_add_o( Lw, 0x6000, &Overflow ); /* add 0.75, which is 3pi/2 to convert sin to cos */ + Ltemp = L_shl_o( Ltemp, 10, &Overflow ); /* Q25 */ + w = extract_h( Ltemp ); /* w is equivalent cos index */ + dl = extract_l( Ltemp ); /* dl is 6 bit left-over for interpolation */ w = s_and( w, 511 ); t1 = cos_table[w]; /*t2=cos_table[s_and(add(w,1),511)]; */ @@ -790,8 +790,8 @@ static void LPCPowSpect_fx( t1 = add( t1, (Word16) L_shr( Ltemp, 16 ) ); /* t1 is interpolated cos(w) */ Ltemp = L_shr( L_mult( LPC[i], t1 ), 1 ); /* Ltemp in Q27 */ - Im = L_sub_o( Im, Ltemp, &Overflow ); /* Im=sum(LPC[i]*sin(Lw)) */ - Lw = L_add_o( Lw, freq[k], &Overflow ); /* Lw=(i+1)*freq[k] */ + Im = L_sub_o( Im, Ltemp, &Overflow ); /* Im=sum(LPC[i]*sin(Lw)) */ + Lw = L_add_o( Lw, freq[k], &Overflow ); /* Lw=(i+1)*freq[k] */ } /* If necessary, we can block-normalize Re and Im to improve precision */ dh = extract_h( Re ); diff --git a/lib_enc/pvq_encode_fx.c b/lib_enc/pvq_encode_fx.c index 6e6e68d19..3232f33cf 100644 --- a/lib_enc/pvq_encode_fx.c +++ b/lib_enc/pvq_encode_fx.c @@ -86,7 +86,7 @@ static Word16 one_pulse_search( { L_tmp_corr = L_shl_o( L_mac_o( *L_xy_ptr, 1, x_abs[i], &Overflow ), corr_up_shift, &Overflow ); /* actual in-loop target value, 2 ops */ corr_tmp = round_fx_o( L_tmp_corr, &Overflow ); /* 1 op */ - corr_sq_tmp = mult( corr_tmp, corr_tmp ); /* CorrSq, is a 16bit for low compelxity cross multiplication 1 op */ + corr_sq_tmp = mult( corr_tmp, corr_tmp ); /* CorrSq, is a 16bit for low compelxity cross multiplication 1 op */ L_tmp_en_lc = L_mac( *L_yy_ptr, 1, y[i] ); /*Q1 result , energy may span up to ~14+1(Q1)+1(sign)=16 bits, 1 op */ /* extract_l without shift can always be used for this section as energy is guaranteed to stay in the lower word, 1 op */ @@ -357,8 +357,8 @@ void pvq_encode_ivas_fx( } Mpy_32_16_ss( L_isqrt, tmp, &L_tmp, &u16_tmp ); /* Q31*Q(0+x) +1 */ Mpy_32_16_ss( L_tmp, neg_gain_norm, &L_tmp, &u16_tmp ); /* Q31*Q(0+x) *Q15 +1 */ - L_tmp = L_shr_o( L_tmp, shift_tot, &Overflow ); /* Q31+x */ - xq[i] = round_fx_o( L_tmp, &Overflow ); /* Q15, array move */ + L_tmp = L_shr_o( L_tmp, shift_tot, &Overflow ); /* Q31+x */ + xq[i] = round_fx_o( L_tmp, &Overflow ); /* Q15, array move */ move16(); L_xq[i] = L_tmp; /* Q31 currently unused */ move32(); @@ -563,9 +563,9 @@ void pvq_encode_fx( } Mpy_32_16_ss( L_isqrt, tmp, &L_tmp, &u16_tmp ); /* Q31*Q(0+x) +1 */ Mpy_32_16_ss( L_tmp, neg_gain_norm, &L_tmp, &u16_tmp ); /* Q31*Q(0+x) *Q15 +1 */ - L_tmp = L_shr_o( L_tmp, shift_tot, &Overflow ); /* Q31+x */ - xq[i] = round_fx_o( L_tmp, &Overflow ); /* Q15, array move */ - L_xq[i] = L_tmp; /* Q31 currently unused */ + L_tmp = L_shr_o( L_tmp, shift_tot, &Overflow ); /* Q31+x */ + xq[i] = round_fx_o( L_tmp, &Overflow ); /* Q15, array move */ + L_xq[i] = L_tmp; /* Q31 currently unused */ } /* index the found PVQ vector into short codewords */ diff --git a/lib_enc/stat_noise_uv_enc_fx.c b/lib_enc/stat_noise_uv_enc_fx.c index b6d507bd9..c84866ce9 100644 --- a/lib_enc/stat_noise_uv_enc_fx.c +++ b/lib_enc/stat_noise_uv_enc_fx.c @@ -65,10 +65,10 @@ void stat_noise_uv_enc_fx( expn = sub( norm_l( LepsP[0] ), 1 ); num = extract_h( L_shl_o( LepsP[0], expn, &Overflow ) ); /*expn-16*/ expd = norm_l( LepsP[1] ); - den = extract_h( L_shl_o( LepsP[1], expd, &Overflow ) ); /*expd-16*/ - num = div_s( num, den ); /*expn-expd+15*/ + den = extract_h( L_shl_o( LepsP[1], expd, &Overflow ) ); /*expd-16*/ + num = div_s( num, den ); /*expn-expd+15*/ num = shr_o( num, add( sub( expn, expd ), 5 ), &Overflow ); /*Q10*/ - num = sub( num, 1024 ); /*num - 1*/ + num = sub( num, 1024 ); /*num - 1*/ test(); IF( NE_16( st_fx->bwidth, NB ) ) @@ -138,10 +138,10 @@ void stat_noise_uv_enc_ivas_fx( expn = sub( norm_l( LepsP[0] ), 1 ); num = extract_h( L_shl_o( LepsP[0], expn, &Overflow ) ); /*expn-16*/ expd = norm_l( LepsP[1] ); - den = extract_h( L_shl_o( LepsP[1], expd, &Overflow ) ); /*expd-16*/ - num = div_s( num, den ); /*expn-expd+15*/ + den = extract_h( L_shl_o( LepsP[1], expd, &Overflow ) ); /*expd-16*/ + num = div_s( num, den ); /*expn-expd+15*/ num = shr_o( num, add( sub( expn, expd ), 5 ), &Overflow ); /*Q10*/ - num = sub( num, 1024 ); /*num - 1*/ + num = sub( num, 1024 ); /*num - 1*/ test(); IF( NE_16( st_fx->bwidth, NB ) ) diff --git a/lib_enc/swb_bwe_enc_fx.c b/lib_enc/swb_bwe_enc_fx.c index fb2bb602a..88b3b0c53 100644 --- a/lib_enc/swb_bwe_enc_fx.c +++ b/lib_enc/swb_bwe_enc_fx.c @@ -542,7 +542,7 @@ void swb_bwe_enc_ivas_fx( exp1 = norm_l( L_tmp ); L_tmp = L_shl( L_tmp, exp1 ); exp = sub( sub( 31, exp1 ), sub( 30, exp ) ); - L_tmp = Isqrt_lc( L_tmp, &exp ); /*31-exp */ + L_tmp = Isqrt_lc( L_tmp, &exp ); /*31-exp */ fb_ener_adjust_fx = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); /*Q15 */ } ELSE @@ -792,7 +792,7 @@ void swb_bwe_enc_fx( exp1 = norm_l( L_tmp ); L_tmp = L_shl( L_tmp, exp1 ); exp = 31 - exp1 - ( 30 - exp ); - L_tmp = Isqrt_lc( L_tmp, &exp ); /*31-exp */ + L_tmp = Isqrt_lc( L_tmp, &exp ); /*31-exp */ fb_ener_adjust_fx = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); /*Q15 */ } ELSE @@ -1139,8 +1139,8 @@ static Word16 FD_BWE_class_fx( /* o : FD BWE class move16(); } expd = norm_s( den ); - tmp = div_s( shl( 1, sub( 14, expd ) ), den ); /*Q(29-expd-Q_syn) */ - L_tmp = L_mult( tmp, peak ); /*Q(30-expd) */ + tmp = div_s( shl( 1, sub( 14, expd ) ), den ); /*Q(29-expd-Q_syn) */ + L_tmp = L_mult( tmp, peak ); /*Q(30-expd) */ sharp = round_fx_o( L_shl_o( L_tmp, sub( expd, 4 ), &Overflow ), &Overflow ); /*Q10 */ } ELSE @@ -1293,7 +1293,7 @@ static void freq_weights_fx( { exp = norm_s( tmp ); tmp = div_s( shl( 1, sub( 14, exp ) ), tmp ); /*(21-exp) */ - tmp = shl_sat( tmp, sub( exp, 6 ) ); /*Q15 */ + tmp = shl_sat( tmp, sub( exp, 6 ) ); /*Q15 */ } ELSE { @@ -1358,9 +1358,9 @@ static void vqWithCand_w_fx( FOR( i = 0; i < E_ROM_dico_size; i++ ) { dist = sub_o( x[0], *p_E_ROM_dico++, &Overflow ); /*Q8 */ - L_dist = L_mult( dist, w[0] ); /*Q22 */ - L_dist = Mult_32_16( L_dist, dist ); /*Q15 */ - L_dist = L_shr( L_dist, 10 ); /*Q5 */ + L_dist = L_mult( dist, w[0] ); /*Q22 */ + L_dist = Mult_32_16( L_dist, dist ); /*Q15 */ + L_dist = L_shr( L_dist, 10 ); /*Q5 */ FOR( j = 1; j < dim; j++ ) { @@ -1407,7 +1407,7 @@ static void vqWithCand_w_fx( { dist = sub_sat( x[0], *p_E_ROM_dico++ ); /*Q8 */ L_dist = L_mult_sat( dist, dist ); /*Q17 */ - L_dist = L_shr( L_dist, 12 ); /*Q5 */ + L_dist = L_shr( L_dist, 12 ); /*Q5 */ FOR( j = 1; j < dim; j++ ) { @@ -2744,7 +2744,7 @@ static Word16 SWB_BWE_encoding_fx( IF( LT_16( Rat_tenv_fx, 8192 ) ) { - L_tmp = L_mult( Rat_tenv_fx, 19661 ); /*Q29 */ + L_tmp = L_mult( Rat_tenv_fx, 19661 ); /*Q29 */ Rat_tenv_fx = round_fx_o( L_shl_o( L_tmp, 2, &Overflow ), &Overflow ); /*Q15 */ } ELSE IF( GT_16( Rat_tenv_fx, 16384 ) ) @@ -3218,7 +3218,7 @@ static Word16 SWB_BWE_encoding_ivas_fx( IF( LT_16( Rat_tenv_fx, 8192 ) ) { - L_tmp = L_mult( Rat_tenv_fx, 19661 ); /*Q29 */ + L_tmp = L_mult( Rat_tenv_fx, 19661 ); /*Q29 */ Rat_tenv_fx = round_fx_o( L_shl_o( L_tmp, 2, &Overflow ), &Overflow ); /*Q15 */ } ELSE IF( GT_16( Rat_tenv_fx, 16384 ) ) @@ -3834,8 +3834,8 @@ static Word16 decision_hq_generic_class_fx_32( FOR( i = add( swb_bwe_subband[k], hq_generic_offset ); i < tmp2; i++ ) { exp = norm_l( coefs_fx[i] ); - tmp = extract_h( L_shl( coefs_fx[i], exp ) ); /*12 + exp - 16 */ - L_tmp = L_mult0( tmp, tmp ); /*2 * exp - 8 */ + tmp = extract_h( L_shl( coefs_fx[i], exp ) ); /*12 + exp - 16 */ + L_tmp = L_mult0( tmp, tmp ); /*2 * exp - 8 */ L_tmp = L_shl_sat( L_tmp, sub( 14, shl( exp, 1 ) ) ); /*6 */ IF( GT_32( L_tmp, p_fx ) ) { diff --git a/lib_enc/swb_bwe_enc_lr_fx.c b/lib_enc/swb_bwe_enc_lr_fx.c index 5f9eaa102..461202c61 100644 --- a/lib_enc/swb_bwe_enc_lr_fx.c +++ b/lib_enc/swb_bwe_enc_lr_fx.c @@ -763,7 +763,7 @@ static void gethar_noisegn_fx( exp = sub( exp, Qsqrt ); L_temp = L_Comp( exp, frac ); - L_temp = Mpy_32_16_1( L_temp, 19728 ); /* log(2)/log(10)=.30102999566398119521 = 19728.3(Q16) Q(0+16+1)=Q17 */ + L_temp = Mpy_32_16_1( L_temp, 19728 ); /* log(2)/log(10)=.30102999566398119521 = 19728.3(Q16) Q(0+16+1)=Q17 */ L_temp = L_shl_o( L_temp, 13, &Overflow ); /* Q17+13=30 30-16=14 */ g_fx = round_fx_o( L_temp, &Overflow ); } diff --git a/lib_enc/swb_tbe_enc_fx.c b/lib_enc/swb_tbe_enc_fx.c index e48aa12a4..efb622773 100644 --- a/lib_enc/swb_tbe_enc_fx.c +++ b/lib_enc/swb_tbe_enc_fx.c @@ -1045,7 +1045,7 @@ void wb_tbe_enc_fx( FOR( i = 0; i < L_SHB_LAHEAD / 4 - 1; i++ ) { - L_tmp = Mult_32_16( Lscale, shaped_wb_excitation[i] ); /* Q(16-exp+Q_bwe_exc_ext) */ + L_tmp = Mult_32_16( Lscale, shaped_wb_excitation[i] ); /* Q(16-exp+Q_bwe_exc_ext) */ shaped_wb_excitation[i] = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /* Q_bwe_exc_ext */ } @@ -1681,13 +1681,13 @@ void wb_tbe_enc_ivas_fx( FOR( i = 0; i < L_SHB_LAHEAD / 4 - 1; i++ ) { - L_tmp = Mpy_32_16_1( Lscale, shaped_wb_excitation[i] ); /* Q(16-exp+Q_bwe_exc_ext) */ + L_tmp = Mpy_32_16_1( Lscale, shaped_wb_excitation[i] ); /* Q(16-exp+Q_bwe_exc_ext) */ shaped_wb_excitation[i] = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /* Q_bwe_exc_ext */ move16(); } Lscale = root_a_fx( Lscale, sub( 31, exp ), &exp ); - L_tmp = Mpy_32_16_1( Lscale, shaped_wb_excitation[L_SHB_LAHEAD / 4 - 1] ); /* Q(16-exp+Q_bwe_exc_ext) */ + L_tmp = Mpy_32_16_1( Lscale, shaped_wb_excitation[L_SHB_LAHEAD / 4 - 1] ); /* Q(16-exp+Q_bwe_exc_ext) */ shaped_wb_excitation[L_SHB_LAHEAD / 4 - 1] = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /* Q_bwe_exc_ext */ move16(); @@ -2486,7 +2486,7 @@ void swb_tbe_enc_fx( &exp ); FOR( i = 0; i < L_SHB_LAHEAD; i++ ) { - L_tmp = Mult_32_16( Lscale, shaped_shb_excitation_fx[i] ); /* Q(16-exp+Q_bwe_exc) */ + L_tmp = Mult_32_16( Lscale, shaped_shb_excitation_fx[i] ); /* Q(16-exp+Q_bwe_exc) */ shaped_shb_excitation_fx[i] = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /* Q_bwe_exc */ } IF( exp < 0 ) @@ -2500,7 +2500,7 @@ void swb_tbe_enc_fx( L_tmp1 = Mult_32_16( L_shl_o( 1, sub( 31, exp ), &Overflow ), tmp ); /* Q31-exp */ tmp = sub( 32767 /*1.0f Q15*/, tmp ); Lscale = L_add( Mult_32_16( Lscale, tmp ), L_tmp1 ); - L_tmp = Mult_32_16( Lscale, shaped_shb_excitation_fx[i] ); /* Q_bwe_exc + (31-exp) - 15 */ + L_tmp = Mult_32_16( Lscale, shaped_shb_excitation_fx[i] ); /* Q_bwe_exc + (31-exp) - 15 */ shaped_shb_excitation_fx[i] = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); /* Q_bwe_exc */ } @@ -2722,8 +2722,8 @@ void swb_tbe_enc_fx( tmp = div_s( shl( 1, sub( 14, exp ) ), voicingBufAvg_fx ); /* (14-exp) */ /* sd_uq_q*pitBufAvg */ - L_tmp = Mult_32_16( L_tmp, pitBufAvg_fx ); /* Q13 * Q10 + 1 -16 => Q8 */ - L_tmp = Mult_32_16( L_tmp, tmp ); /* Q8 + (14 - exp) - 15 => Q7 - exp */ + L_tmp = Mult_32_16( L_tmp, pitBufAvg_fx ); /* Q13 * Q10 + 1 -16 => Q8 */ + L_tmp = Mult_32_16( L_tmp, tmp ); /* Q8 + (14 - exp) - 15 => Q7 - exp */ tmp = round_fx_o( L_shl_o( L_tmp, 31 - ( 7 - exp ), &Overflow ), &Overflow ); /* Q15 */ } @@ -3751,7 +3751,7 @@ void swb_tbe_enc_ivas_fx( FOR( i = 0; i < L_SHB_LAHEAD; i++ ) { - L_tmp = Mult_32_16( Lscale, shaped_shb_excitation_fx[i] ); /* Q(16-exp+Q_bwe_exc) */ + L_tmp = Mult_32_16( Lscale, shaped_shb_excitation_fx[i] ); /* Q(16-exp+Q_bwe_exc) */ shaped_shb_excitation_fx[i] = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); /* Q_bwe_exc */ move16(); } @@ -3767,7 +3767,7 @@ void swb_tbe_enc_ivas_fx( L_tmp1 = Mult_32_16( L_shl_o( 1, sub( 31, exp ), &Overflow ), tmp ); /* Q31-exp */ tmp = sub( 32767 /*1.0f Q15*/, tmp ); Lscale = L_add( Mult_32_16( Lscale, tmp ), L_tmp1 ); - L_tmp = Mult_32_16( Lscale, shaped_shb_excitation_fx[i] ); /* Q_bwe_exc + (31-exp) - 15 */ + L_tmp = Mult_32_16( Lscale, shaped_shb_excitation_fx[i] ); /* Q_bwe_exc + (31-exp) - 15 */ shaped_shb_excitation_fx[i] = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); /* Q_bwe_exc */ move16(); } @@ -4271,8 +4271,8 @@ void swb_tbe_enc_ivas_fx( tmp = div_s( shl( 1, sub( 14, exp ) ), voicingBufAvg_fx ); /* (14-exp) */ /* sd_uq_q*pitBufAvg */ - L_tmp = Mult_32_16( L_tmp, pitBufAvg_fx ); /* Q13 * Q10 + 1 -16 => Q8 */ - L_tmp = Mult_32_16( L_tmp, tmp ); /* Q8 + (14 - exp) - 15 => Q7 - exp */ + L_tmp = Mult_32_16( L_tmp, pitBufAvg_fx ); /* Q13 * Q10 + 1 -16 => Q8 */ + L_tmp = Mult_32_16( L_tmp, tmp ); /* Q8 + (14 - exp) - 15 => Q7 - exp */ tmp = round_fx_o( L_shl_o( L_tmp, 31 - ( 7 - exp ), &Overflow ), &Overflow ); /* Q15 */ } tmp = s_min( tmp, 32767 /*1.0f Q15*/ ); @@ -4947,9 +4947,9 @@ static void EstimateSHBGainShape_fx( FOR( k = 0; k < length; k++ ) { sig = mult_r( oriSHB[j + k], subwin[k + 1] ); /* Q_oriSHB */ - oriNrg = L_mac0_sat( oriNrg, sig, sig ); /* 2* Q_oriSHB */ + oriNrg = L_mac0_sat( oriNrg, sig, sig ); /* 2* Q_oriSHB */ sig = mult_r( synSHB[j + k], subwin[k + 1] ); /* Q_synSHB */ - synNrg = L_mac0_sat( synNrg, sig, sig ); /* 2* Q_synSHB */ + synNrg = L_mac0_sat( synNrg, sig, sig ); /* 2* Q_synSHB */ } } IF( EQ_16( i, NUM_SHB_SUBFR / 2 - 1 ) ) @@ -4958,10 +4958,10 @@ static void EstimateSHBGainShape_fx( FOR( ; k < length_tmp; k++ ) { sig = mult_r( oriSHB[j + k], subwin[3 * length - 2 * k - 2] ); /* Q_oriSHB */ - oriNrg = L_mac0_sat( oriNrg, sig, sig ); /* 2* Q_oriSHB */ + oriNrg = L_mac0_sat( oriNrg, sig, sig ); /* 2* Q_oriSHB */ sig = mult_r( synSHB[j + k], subwin[3 * length - 2 * k - 2] ); /* Q_synSHB */ - synNrg = L_mac0_sat( synNrg, sig, sig ); /* 2* Q_synSHB */ + synNrg = L_mac0_sat( synNrg, sig, sig ); /* 2* Q_synSHB */ } } ELSE @@ -4969,9 +4969,9 @@ static void EstimateSHBGainShape_fx( FOR( ; k < length2; k++ ) { sig = mult_r( oriSHB[j + k], subwin[2 * length - k - 1] ); /* Q_oriSHB */ - oriNrg = L_mac0_sat( oriNrg, sig, sig ); /* 2* Q_oriSHB */ + oriNrg = L_mac0_sat( oriNrg, sig, sig ); /* 2* Q_oriSHB */ sig = mult_r( synSHB[j + k], subwin[2 * length - k - 1] ); /* Q_synSHB */ - synNrg = L_mac0_sat( synNrg, sig, sig ); /* 2* Q_synSHB */ + synNrg = L_mac0_sat( synNrg, sig, sig ); /* 2* Q_synSHB */ } } @@ -5003,26 +5003,26 @@ static void EstimateSHBGainShape_fx( j = i_mult2( join_length, i ); FOR( k = 0; k < length; k++ ) { - sig = mult_r( oriSHB[j + k], subwin[k + 1] ); /* Q_oriSHB */ + sig = mult_r( oriSHB[j + k], subwin[k + 1] ); /* Q_oriSHB */ oriNrg = L_mac0_o( oriNrg, sig, sig, &Overflow ); /* 2* Q_oriSHB */ - sig = mult_r( synSHB[j + k], subwin[k + 1] ); /* Q_oriSHB */ + sig = mult_r( synSHB[j + k], subwin[k + 1] ); /* Q_oriSHB */ synNrg = L_mac0_o( synNrg, sig, sig, &Overflow ); /* 2* Q_oriSHB */ } FOR( k = 0; k < ( join_length - length ); k++ ) { - sig = mult_r( oriSHB[length + j + k], 32767 ); /* Q_oriSHB */ + sig = mult_r( oriSHB[length + j + k], 32767 ); /* Q_oriSHB */ oriNrg = L_mac0_o( oriNrg, sig, sig, &Overflow ); /* 2* Q_oriSHB */ - sig = mult_r( synSHB[length + j + k], 32767 ); /* Q_oriSHB */ + sig = mult_r( synSHB[length + j + k], 32767 ); /* Q_oriSHB */ synNrg = L_mac0_o( synNrg, sig, sig, &Overflow ); /* 2* Q_oriSHB */ } FOR( k = 0; k < length; k++ ) { sig = mult_r( oriSHB[j + join_length + k], subwin[length - k - 1] ); /* Q_oriSHB */ - oriNrg = L_mac0_o( oriNrg, sig, sig, &Overflow ); /* 2* Q_oriSHB */ + oriNrg = L_mac0_o( oriNrg, sig, sig, &Overflow ); /* 2* Q_oriSHB */ sig = mult_r( synSHB[j + join_length + k], subwin[length - k - 1] ); /* Q_oriSHB */ - synNrg = L_mac0_o( synNrg, sig, sig, &Overflow ); /* 2* Q_oriSHB */ + synNrg = L_mac0_o( synNrg, sig, sig, &Overflow ); /* 2* Q_oriSHB */ } /* Only implemented in SWB because the length of samples in SWB frame is longer, more likely to saturate */ scaling = 0; @@ -5051,7 +5051,7 @@ static void EstimateSHBGainShape_fx( FOR( k = 0; k < length; k++ ) { sig = mult_r( shr( oriSHB[j + join_length + k], 1 ), subwin[length - k - 1] ); /* Q_oriSHB - 1(scaling) */ - oriNrg = L_mac0_sat( oriNrg, sig, sig ); /* 2*Q_oriSHB - 2 */ + oriNrg = L_mac0_sat( oriNrg, sig, sig ); /* 2*Q_oriSHB - 2 */ } } L_subgain[i] = root_a_over_b_fx( oriNrg, shl( Q_oriSHB, 1 ), synNrg, shl( Q_synSHB, 1 ), &n ); @@ -5082,7 +5082,7 @@ static void EstimateSHBGainShape_fx( FOR( i = 0; i < num_gains; i++ ) { - L_tmp = Mpy_32_16_1( normFact, subgain[i] ); /*Q(31-n) * Q(31-norm[i]) */ /* Q(30-n-n_max) */ + L_tmp = Mpy_32_16_1( normFact, subgain[i] ); /*Q(31-n) * Q(31-norm[i]) */ /* Q(30-n-n_max) */ subgain[i] = s_max( round_fx_o( L_shl_o( L_tmp, add( n, n_max + 1 ), &Overflow ), &Overflow ), 3277 /*0.1f Q15*/ ); /* Q15 */ move16(); } @@ -7257,9 +7257,9 @@ void fb_tbe_enc_fx( Copy( hBWE_TD->old_input_fhb_fx, input_fhb, Sample_Delay_HP ); Copy( tmp_vec, input_fhb + Sample_Delay_HP, L_FRAME48k - Sample_Delay_HP ); Copy( tmp_vec + L_FRAME48k - Sample_Delay_HP, hBWE_TD->old_input_fhb_fx, Sample_Delay_HP ); - temp2 = sum2_fx_mod( input_fhb, L_FRAME48k / 2 ); /* Q11 */ + temp2 = sum2_fx_mod( input_fhb, L_FRAME48k / 2 ); /* Q11 */ temp2 = L_add_o( temp2, L_shl_o( hBWE_TD->prev_fb_energy_fx, sub( sub( add( exp_temp, exp_temp ), 6 ), hBWE_TD->prev_fb_energy_fx_Q ), &Overflow ), &Overflow ); /* Q11 */ - hBWE_TD->prev_fb_energy_fx = sum2_fx_mod( input_fhb + L_FRAME48k / 2, L_FRAME48k / 2 ); /*Q11*/ + hBWE_TD->prev_fb_energy_fx = sum2_fx_mod( input_fhb + L_FRAME48k / 2, L_FRAME48k / 2 ); /*Q11*/ hBWE_TD->prev_fb_energy_fx_Q = sub( add( exp_temp, exp_temp ), 6 ); fb_exc_energy = sum2_fx_mod( fb_exc, L_FRAME16k ); /* Q(2*Q_fb_exc+1 -7) */ @@ -7284,7 +7284,7 @@ void fb_tbe_enc_fx( { tmp = div_s( tmp2, tmp ); L_tmp = L_deposit_h( tmp ); - L_tmp = Isqrt_lc( L_tmp, &exp ); /*Q(31-exp)*/ + L_tmp = Isqrt_lc( L_tmp, &exp ); /*Q(31-exp)*/ L_tmp = L_max( L_shr_o( L_tmp, sub( 31, exp ), &Overflow ), 0x1 ); /* Q0 */ } ELSE @@ -7403,9 +7403,9 @@ void fb_tbe_enc_ivas_fx( Copy( hBWE_TD->old_input_fhb_fx, input_fhb, Sample_Delay_HP ); Copy( tmp_vec, input_fhb + Sample_Delay_HP, sub( L_FRAME48k, Sample_Delay_HP ) ); Copy( tmp_vec + L_FRAME48k - Sample_Delay_HP, hBWE_TD->old_input_fhb_fx, Sample_Delay_HP ); - temp2 = sum2_fx_mod( input_fhb, L_FRAME48k / 2 ); /* Q(2*Q_input_fhb-8) */ + temp2 = sum2_fx_mod( input_fhb, L_FRAME48k / 2 ); /* Q(2*Q_input_fhb-8) */ temp2 = L_add_o( temp2, L_shl_o( hBWE_TD->prev_fb_energy_fx, sub( sub( add( exp_temp, exp_temp ), 8 ), hBWE_TD->prev_fb_energy_fx_Q ), &Overflow ), &Overflow ); /* Q(2*(exp_temp)-8) */ - hBWE_TD->prev_fb_energy_fx = sum2_fx_mod( input_fhb + L_FRAME48k / 2, L_FRAME48k / 2 ); /*Q(2*(Q_input_fhb)-8) */ + hBWE_TD->prev_fb_energy_fx = sum2_fx_mod( input_fhb + L_FRAME48k / 2, L_FRAME48k / 2 ); /*Q(2*(Q_input_fhb)-8) */ move32(); hBWE_TD->prev_fb_energy_fx_Q = sub( add( exp_temp, exp_temp ), 8 ); move16(); @@ -7432,7 +7432,7 @@ void fb_tbe_enc_ivas_fx( { tmp = div_s( tmp2, tmp ); L_tmp = L_deposit_h( tmp ); - L_tmp = Isqrt_lc( L_tmp, &exp ); /*Q(31-exp)*/ + L_tmp = Isqrt_lc( L_tmp, &exp ); /*Q(31-exp)*/ L_tmp = L_max( L_shr_o( L_tmp, sub( 31, exp ), &Overflow ), 0x1 ); /* Q0 */ } ELSE diff --git a/lib_enc/tcq_core_enc_fx.c b/lib_enc/tcq_core_enc_fx.c index 399e62db9..fbd9775c4 100644 --- a/lib_enc/tcq_core_enc_fx.c +++ b/lib_enc/tcq_core_enc_fx.c @@ -477,7 +477,7 @@ ivas_error tcq_core_LR_enc_fx( exp = sub( norm_l( crosscorr_fx ), 1 ); gain_fx = ar_div( L_shl( crosscorr_fx, exp ), selfcorr_fx ); /* 1 + exp */ - gain_fx = L_shl_sat( gain_fx, sub( 16, 1 + exp ) + 2 ); /* 0.2 * Q16 */ + gain_fx = L_shl_sat( gain_fx, sub( 16, 1 + exp ) + 2 ); /* 0.2 * Q16 */ lo = L_Extract_lc( gain_fx, &hi ); /* Use optimal gain */ FOR( j = 0; j < sfmsize[k_sort[i]]; j++ ) @@ -961,7 +961,7 @@ ivas_error tcq_core_LR_enc_ivas_fx( exp = sub( norm_l( crosscorr_fx ), 1 ); gain_fx = ar_div( L_shl( crosscorr_fx, exp ), selfcorr_fx ); /* 1 + exp */ - gain_fx = L_shl_sat( gain_fx, sub( 16, 1 + exp ) + 2 ); /* 0.2 * Q16 */ + gain_fx = L_shl_sat( gain_fx, sub( 16, 1 + exp ) + 2 ); /* 0.2 * Q16 */ lo = L_Extract_lc( gain_fx, &hi ); /* Use optimal gain */ FOR( j = 0; j < sfmsize[k_sort[i]]; j++ ) diff --git a/lib_enc/tcx_utils_enc_fx.c b/lib_enc/tcx_utils_enc_fx.c index 7e464adcd..6f75c3787 100644 --- a/lib_enc/tcx_utils_enc_fx.c +++ b/lib_enc/tcx_utils_enc_fx.c @@ -1214,8 +1214,8 @@ void tcx_scalar_quantization_fx( FOR( ; i >= 0; i-- ) { offs32 = Mpy_32_16_1( L_abs( x[i] ), gain ); /* multiply */ - offs32 = L_shl_sat( offs32, s ); /* convert to 15Q16 */ - tmp16 = mac_r_sat( offs32, offset, 1 ); /* add offset and truncate */ + offs32 = L_shl_sat( offs32, s ); /* convert to 15Q16 */ + tmp16 = mac_r_sat( offs32, offset, 1 ); /* add offset and truncate */ IF( x[i] < 0 ) { tmp16 = negate( tmp16 ); /* restore sign */ @@ -1291,8 +1291,8 @@ void tcx_scalar_quantization_ivas_fx( FOR( ; i >= 0; i-- ) { offs32 = Mpy_32_16_1( L_abs( x[i] ), gain ); /* multiply */ - offs32 = L_shl_sat( offs32, s ); /* convert to 15Q16 */ - tmp16 = mac_r_sat( offs32, offset, 1 ); /* add offset and truncate */ + offs32 = L_shl_sat( offs32, s ); /* convert to 15Q16 */ + tmp16 = mac_r_sat( offs32, offset, 1 ); /* add offset and truncate */ IF( x[i] < 0 ) { tmp16 = negate( tmp16 ); /* restore sign */ diff --git a/lib_enc/tns_base_enc_fx.c b/lib_enc/tns_base_enc_fx.c index 0ac9a6d4c..79bb7b914 100644 --- a/lib_enc/tns_base_enc_fx.c +++ b/lib_enc/tns_base_enc_fx.c @@ -151,7 +151,7 @@ Word16 DetectTnsFilt_fx( STnsConfig const *pTnsConfig, move16(); facs_e[iFilter][iSubdivisions] = shl( sub( tmp, shifts[iFilter][iSubdivisions] ), 1 ); - tmp = sub( 1, shl( tmp, 1 ) ); /* exponent of autocorrelation */ + tmp = sub( 1, shl( tmp, 1 ) ); /* exponent of autocorrelation */ L_tmp = L_shl_sat( L_tmp, sub( shift, tmp ) ); /* shift L_tmp to that exponent */ /* calc factor (with 2 bits headroom for sum of 3 subdivisions) */ @@ -528,7 +528,7 @@ Word16 DetectTnsFilt_ivas_fx( STnsConfig const *pTnsConfig, /* i : TNS Configur move16(); facs_e[iFilter][iSubdivisions] = shl( sub( tmp, shifts[iFilter][iSubdivisions] ), 1 ); - tmp = sub( 1, shl( tmp, 1 ) ); /* exponent of autocorrelation */ + tmp = sub( 1, shl( tmp, 1 ) ); /* exponent of autocorrelation */ L_tmp = L_shl_sat( L_tmp, sub( shift, tmp ) ); /* shift L_tmp to that exponent */ /* calc factor (with 2 bits headroom for sum of 3 subdivisions) */ diff --git a/lib_enc/updt_tar_fx.c b/lib_enc/updt_tar_fx.c index 5d364725f..9d6b5d2d6 100644 --- a/lib_enc/updt_tar_fx.c +++ b/lib_enc/updt_tar_fx.c @@ -63,7 +63,7 @@ void updt_tar_HR_fx( FOR( i = 0; i < L; i++ ) { /*x2[i] = x[i] - gain*y[i];*/ - L_tmp = L_mult( x[i], 32767 ); /* (Qz*Q15) = (Qz+16) */ + L_tmp = L_mult( x[i], 32767 ); /* (Qz*Q15) = (Qz+16) */ L_tmp1 = L_shl_o( L_mult_o( y[i], gain, &Overflow ), Qx, &Overflow ); /* ((Qz+2+1)< Q8*/ + tmp2 = round_fx( L_shl_o( L_tmp2, 14, &Overflow ) ); /* Q10(high word)+ 14 -16 --> Q8*/ IF( L_tmp2 > 0 ) { thr1_ol = add( thr1_ol, tmp2 ); /* Q24 >>16 + Q8 */ @@ -2599,7 +2599,7 @@ Word16 wb_vad_ivas_fx( thr1_ol = thr1; move16(); L_tmp2 = Msub_32_16( (Word32) 614, L_snr_outlier, 20972 ); /* .6*1024= */ /* 0.6 Q26(Q10 in high word) - Q4*Q21+1 */ - tmp2 = round_fx( L_shl_o( L_tmp2, 14, &Overflow ) ); /* Q10(high word)+ 14 -16 --> Q8*/ + tmp2 = round_fx( L_shl_o( L_tmp2, 14, &Overflow ) ); /* Q10(high word)+ 14 -16 --> Q8*/ IF( L_tmp2 > 0 ) { thr1_ol = add( thr1_ol, tmp2 ); /* Q24 >>16 + Q8 */ diff --git a/lib_enc/vad_param_updt_fx.c b/lib_enc/vad_param_updt_fx.c index 72c86759f..464903a03 100644 --- a/lib_enc/vad_param_updt_fx.c +++ b/lib_enc/vad_param_updt_fx.c @@ -164,7 +164,7 @@ void vad_param_updt_fx( /* (voicing[0] + voicing[1] + voicing[2]) / 3 + corr_shift */ L_tmp = L_mult( st_fx->voicing_fx[0], 10923 ); L_tmp = L_mac( L_tmp, st_fx->voicing_fx[1], 10923 ); - L_tmp = L_mac( L_tmp, st_fx->voicing_fx[2], 10923 ); /*Q15 */ + L_tmp = L_mac( L_tmp, st_fx->voicing_fx[2], 10923 ); /*Q15 */ L_tmp = L_mac_o( L_tmp, corr_shift_temp[i], 32767, &Overflow ); /*Q15 */ voice_tmp = round_fx_o( L_tmp, &Overflow ); /*Q15 */ diff --git a/lib_enc/voiced_enc_fx.c b/lib_enc/voiced_enc_fx.c index 99fa071d8..b0dba61de 100644 --- a/lib_enc/voiced_enc_fx.c +++ b/lib_enc/voiced_enc_fx.c @@ -950,8 +950,8 @@ ivas_error ppp_voiced_encoder_fx( fracb = shl( fracb, scale ); expb = sub( expb, scale ); - tmp = div_s( fracb, fraca ); /* tmp in Q15 */ - exp = sub( expb, expa ); /* ans = tmp*2^(exp) */ + tmp = div_s( fracb, fraca ); /* tmp in Q15 */ + exp = sub( expb, expa ); /* ans = tmp*2^(exp) */ Ltemp_fx = L_shl_o( tmp, add( exp, 12 ), &Overflow ); /* make tmp Q27 */ } test(); @@ -1055,7 +1055,7 @@ ivas_error ppp_voiced_encoder_fx( L_tmp = L_shl( L_tmp, expa ); exp = sub( 30, add( expa, sub( 31, exp ) ) ); frac = Log2_norm_lc( L_tmp ); - L_tmp = Mpy_32_16( exp, frac, 12330 ); /* L_tmp is always Q13 */ + L_tmp = Mpy_32_16( exp, frac, 12330 ); /* L_tmp is always Q13 */ Ltemp = L_shl_o( L_tmp, 10, &Overflow ); /* Ltemp is always Q23 */ } ELSE @@ -1355,7 +1355,7 @@ static Word32 DTFS_freq_corr_fx( } E1_fx = round_fx_o( L_shl_o( corr_fx, Qr, &Overflow ), &Overflow ); /* Q(Qr-16) */ - Num = L_mult0( E1_fx, E1_fx ); /* Q(2+2*Qr-32+1) */ + Num = L_mult0( E1_fx, E1_fx ); /* Q(2+2*Qr-32+1) */ Q_num = sub( shl( add( add( X1_DTFS_fx.Q, X2_DTFS_fx.Q ), Qr ), 1 ), 32 ); /* PORTING: Handling the functions with variable no. of arguments */ @@ -1379,7 +1379,7 @@ static Word32 DTFS_freq_corr_fx( } E2_fx = round_fx_o( L_shl_o( E_fx, q2, &Overflow ), &Overflow ); /* Q(1+q2-16) */ - Den = L_mult0( E1_fx, E2_fx ); /* Q(2+q1+q2-32+1) */ + Den = L_mult0( E1_fx, E2_fx ); /* Q(2+q1+q2-32+1) */ Q_den = sub( add( shl( add( X2_DTFS_fx.Q, X1_DTFS_fx.Q ), 1 ), add( q1, q2 ) ), 32 ); Num = L_max( Num, 1 ); -- GitLab