From 9e6a9b23e43baf835c90a13a79b5ba19b69b730a Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Fri, 21 Mar 2025 16:08:21 +0530 Subject: [PATCH 1/2] Cleanup of pre-processor macros in the main branch --- apps/renderer.c | 4 - lib_com/basop32.c | 4 - lib_com/bits_alloc_fx.c | 62 -- lib_com/bitstream_fx.c | 2 - lib_com/cldfb.c | 6 - lib_com/cnst.h | 2 - lib_com/disclaimer.c | 4 - lib_com/edct_fx.c | 2 - lib_com/fft_fx.c | 26 - lib_com/gs_bitallocation_fx.c | 2 - lib_com/gs_inact_switching_fx.c | 9 - lib_com/ivas_dirac_com_fx.c | 68 -- lib_com/ivas_prot_fx.h | 28 - lib_com/ivas_qmetadata_com_fx.c | 68 -- lib_com/ivas_spar_com_fx.c | 18 - lib_com/ivas_tools_fx.c | 221 ------- lib_com/lerp.c | 4 - lib_com/low_rate_band_att_fx.c | 4 - lib_com/lsf_tools_fx.c | 2 - lib_com/mslvq_com_fx.c | 8 - lib_com/options.h | 110 ---- lib_com/prot_fx.h | 15 - lib_com/rom_com.c | 12 - lib_com/swb_bwe_com_fx.c | 16 - lib_com/swb_bwe_com_lr_fx.c | 4 - lib_com/swb_tbe_com_fx.c | 10 - lib_com/tcq_position_arith_fx.c | 8 - lib_com/tcx_mdct_fx.c | 6 - lib_com/tools.c | 45 -- lib_com/tools_fx.c | 59 -- lib_com/trans_direct_fx.c | 2 - lib_com/trans_inv_fx.c | 6 - lib_dec/FEC_HQ_phase_ecu_fx.c | 28 - lib_dec/FEC_fx.c | 8 - lib_dec/TonalComponentDetection_fx.c | 8 - lib_dec/acelp_core_dec_fx.c | 10 - lib_dec/acelp_core_dec_ivas_fx.c | 166 ----- lib_dec/acelp_core_switch_dec_fx.c | 12 - lib_dec/core_switching_dec_fx.c | 27 - lib_dec/dec_gen_voic_fx.c | 4 - lib_dec/dec_tcx_fx.c | 34 - lib_dec/decision_matrix_dec_fx.c | 2 - lib_dec/fd_cng_dec_fx.c | 14 - lib_dec/gs_dec_fx.c | 16 - lib_dec/hq_core_dec_fx.c | 5 - lib_dec/hq_hr_dec_fx.c | 10 - lib_dec/igf_dec_fx.c | 45 -- lib_dec/init_dec_fx.c | 6 - lib_dec/ivas_binRenderer_internal_fx.c | 70 --- lib_dec/ivas_core_dec_fx.c | 75 --- lib_dec/ivas_cpe_dec_fx.c | 8 - lib_dec/ivas_dirac_dec_fx.c | 20 - lib_dec/ivas_dirac_output_synthesis_cov_fx.c | 144 ----- lib_dec/ivas_init_dec.c | 2 - lib_dec/ivas_ism_param_dec_fx.c | 6 - lib_dec/ivas_jbm_dec_fx.c | 97 --- lib_dec/ivas_mc_param_dec_fx.c | 69 -- lib_dec/ivas_mc_paramupmix_dec_fx.c | 14 - lib_dec/ivas_mct_dec_fx.c | 28 - lib_dec/ivas_mct_dec_mct_fx_fx.c | 24 - lib_dec/ivas_mdct_core_dec_fx.c | 33 - lib_dec/ivas_omasa_dec_fx.c | 8 - lib_dec/ivas_osba_dec_fx.c | 12 - lib_dec/ivas_out_setup_conversion_fx.c | 2 - lib_dec/ivas_post_proc_fx.c | 24 - lib_dec/ivas_qmetadata_dec_fx.c | 22 - lib_dec/ivas_sba_dec_fx.c | 22 - lib_dec/ivas_sba_dirac_stereo_dec_fx.c | 20 - lib_dec/ivas_spar_decoder_fx.c | 153 ----- lib_dec/ivas_stat_dec.h | 2 - lib_dec/ivas_stereo_cng_dec.c | 4 - lib_dec/ivas_stereo_dft_dec_fx.c | 42 -- lib_dec/ivas_stereo_ica_dec_fx.c | 5 - lib_dec/ivas_stereo_icbwe_dec_fx.c | 14 - lib_dec/ivas_stereo_mdct_core_dec_fx.c | 5 - lib_dec/ivas_stereo_mdct_stereo_dec_fx.c | 5 - lib_dec/ivas_stereo_switching_dec_fx.c | 10 - lib_dec/ivas_svd_dec_fx.c | 592 ------------------ lib_dec/ivas_tcx_core_dec_fx.c | 18 - lib_dec/ivas_td_low_rate_dec_fx.c | 5 - lib_dec/jbm_pcmdsp_apa.c | 2 - lib_dec/lead_deindexing_fx.c | 4 - lib_dec/lib_dec_fx.c | 82 --- lib_dec/stat_dec.h | 9 - lib_dec/swb_tbe_dec_fx.c | 6 - lib_dec/tonalMDCTconcealment_fx.c | 20 - lib_dec/transition_dec_fx.c | 4 - lib_dec/waveadjust_fec_dec_fx.c | 16 - lib_enc/acelp_core_enc_fx.c | 40 -- lib_enc/acelp_core_switch_enc_fx.c | 8 - lib_enc/bass_psfilter_enc_fx.c | 4 - lib_enc/cng_enc_fx.c | 2 - lib_enc/cod_ace_fx.c | 43 -- lib_enc/cod_tcx_fx.c | 11 - lib_enc/cod_uv_fx.c | 18 - lib_enc/core_enc_init_fx.c | 8 - lib_enc/core_enc_ol_fx.c | 2 - lib_enc/core_enc_reconf_fx.c | 2 - lib_enc/core_enc_switch_fx.c | 4 - lib_enc/core_switching_enc_fx.c | 2 - lib_enc/decision_matrix_enc_fx.c | 2 - lib_enc/dtx_fx.c | 25 - lib_enc/enc_acelp_fx.c | 6 - lib_enc/enc_acelpx_fx.c | 4 - lib_enc/enc_gen_voic_fx.c | 4 - lib_enc/enc_pit_exc_fx.c | 12 - lib_enc/enc_tran_fx.c | 2 - lib_enc/enc_uv_fx.c | 4 - lib_enc/energy_fx.c | 4 - lib_enc/ext_sig_ana_fx.c | 18 - lib_enc/find_tilt_fx.c | 4 - lib_enc/gaus_enc_fx.c | 5 - lib_enc/hq_classifier_enc_fx.c | 4 - lib_enc/hq_core_enc_fx.c | 6 - lib_enc/igf_enc.c | 35 -- lib_enc/init_enc_fx.c | 14 - lib_enc/inov_enc_fx.c | 2 - lib_enc/ivas_core_enc_fx.c | 13 - lib_enc/ivas_core_pre_proc_front_fx.c | 32 - lib_enc/ivas_core_pre_proc_fx.c | 6 - lib_enc/ivas_cpe_enc_fx.c | 44 -- lib_enc/ivas_dirac_enc_fx.c | 66 -- lib_enc/ivas_front_vad_fx.c | 4 - lib_enc/ivas_ism_dtx_enc_fx.c | 4 - lib_enc/ivas_ism_enc_fx.c | 10 - lib_enc/ivas_ism_metadata_enc_fx.c | 6 - lib_enc/ivas_masa_enc_fx.c | 4 - lib_enc/ivas_mc_param_enc_fx.c | 8 - lib_enc/ivas_mc_paramupmix_enc_fx.c | 6 - lib_enc/ivas_mcmasa_enc_fx.c | 4 - lib_enc/ivas_mct_core_enc_fx.c | 11 - lib_enc/ivas_mct_enc_mct_fx.c | 8 - lib_enc/ivas_mdct_core_enc_fx.c | 29 - lib_enc/ivas_omasa_enc_fx.c | 4 - lib_enc/ivas_osba_enc_fx.c | 22 - lib_enc/ivas_qmetadata_enc_fx.c | 17 - lib_enc/ivas_sce_enc_fx.c | 6 - lib_enc/ivas_sns_enc_fx.c | 5 - lib_enc/ivas_stat_enc.h | 12 - lib_enc/ivas_stereo_classifier_fx.c | 4 - lib_enc/ivas_stereo_dft_enc_fx.c | 12 - lib_enc/ivas_stereo_dft_enc_itd_fx.c | 51 -- lib_enc/ivas_stereo_dmx_evs_fx.c | 131 ---- lib_enc/ivas_stereo_ica_enc_fx.c | 22 - lib_enc/ivas_stereo_icbwe_enc_fx.c | 10 - lib_enc/ivas_stereo_mdct_core_enc_fx.c | 10 - lib_enc/ivas_stereo_mdct_igf_enc_fx.c | 2 - lib_enc/ivas_stereo_switching_enc_fx.c | 8 - lib_enc/ivas_stereo_td_analysis_fx.c | 29 - lib_enc/ivas_stereo_td_enc_fx.c | 2 - lib_enc/ivas_tcx_core_enc_fx.c | 20 - lib_enc/ivas_td_low_rate_enc_fx.c | 38 -- lib_enc/lib_enc.c | 4 - lib_enc/nois_est_fx.c | 2 - lib_enc/pit_enc_fx.c | 2 - lib_enc/pre_proc_fx.c | 4 - lib_enc/prot_fx_enc.h | 8 - lib_enc/spec_flatness_fx.c | 4 - lib_enc/speech_music_classif_fx.c | 47 -- lib_enc/stat_enc.h | 5 - lib_enc/swb_bwe_enc_fx.c | 21 - lib_enc/swb_pre_proc_fx.c | 4 - lib_enc/swb_tbe_enc_fx.c | 4 - lib_enc/tcx_ltp_enc_fx.c | 4 - lib_enc/tcx_utils_enc_fx.c | 6 - lib_enc/tns_base_enc_fx.c | 4 - lib_enc/transient_detection_fx.c | 9 - lib_enc/transition_enc_fx.c | 16 - .../ivas_dirac_dec_binaural_functions_fx.c | 426 ------------- lib_rend/ivas_dirac_decorr_dec_fx.c | 115 ---- lib_rend/ivas_dirac_output_synthesis_dec_fx.c | 34 - lib_rend/ivas_dirac_rend_fx.c | 30 - lib_rend/ivas_mcmasa_ana_fx.c | 2 - lib_rend/ivas_objectRenderer_hrFilt_fx.c | 2 - lib_rend/ivas_objectRenderer_sources_fx.c | 2 - lib_rend/ivas_output_init_fx.c | 4 - lib_rend/ivas_prot_rend_fx.h | 2 - lib_rend/ivas_reverb_fx.c | 9 - lib_rend/ivas_rotation_fx.c | 2 - lib_rend/ivas_stat_rend.h | 4 - lib_rend/lib_rend.c | 2 - lib_rend/lib_rend.h | 2 - lib_util/hrtf_file_reader.c | 4 - 183 files changed, 4669 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index ceb1a448e..47548d438 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -699,10 +699,8 @@ int main( lfeRoutingConfigs[i] = NULL; } -#ifdef FIX_DISCLAIMER IVAS_REND_PrintDisclaimer(); -#endif CmdlnArgs args = parseCmdlnArgs( argc, argv ); if ( args.nonDiegeticPan && !( ( args.inConfig.numAudioObjects == 0 && args.inConfig.multiChannelBuses[0].audioConfig == IVAS_AUDIO_CONFIG_MONO ) || @@ -864,7 +862,6 @@ int main( exit( -1 ); } -#ifdef FIX_DISCLAIMER fprintf( stdout, "Input audio file: %s\n", args.inputFilePath ); fprintf( stdout, "Output audio file: %s\n\n", args.outputFilePath ); @@ -907,7 +904,6 @@ int main( exit( -1 ); } -#endif /* === Configure === */ if ( ( error = IVAS_REND_InitConfig( hIvasRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK ) { diff --git a/lib_com/basop32.c b/lib_com/basop32.c index 7fab24660..20dbe663e 100644 --- a/lib_com/basop32.c +++ b/lib_com/basop32.c @@ -2563,10 +2563,8 @@ Word16 shr_ro( Word16 var1, Word16 var2, Flag *Overflow ) { var_out = shr_o( var1, var2, Overflow ); -#ifdef FIX_1049_SHR_RO_COMPLEXITY #ifdef WMOPS multiCounter[currCounter].shr--; -#endif #endif if ( var2 > 0 ) { @@ -2577,13 +2575,11 @@ Word16 shr_ro( Word16 var1, Word16 var2, Flag *Overflow ) } } -#ifdef FIX_1049_SHR_RO_COMPLEXITY #ifdef WMOPS multiCounter[currCounter].shr_r++; #endif BASOP_CHECK(); -#endif return ( var_out ); } diff --git a/lib_com/bits_alloc_fx.c b/lib_com/bits_alloc_fx.c index 88b276126..cb71f0f28 100644 --- a/lib_com/bits_alloc_fx.c +++ b/lib_com/bits_alloc_fx.c @@ -773,9 +773,7 @@ ivas_error config_acelp1( ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ const Word16 signalling_bits, /* i : number of signalling bits */ const Word16 coder_type, /* i : coder type */ -#ifdef NONBE_FIX_GSC_BSTR const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ -#endif const Word16 tc_subfr, /* i : TC subfr ID */ const Word16 tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ Word16 *nBits_es_Pred, /* o : number of bits for Es_pred Q */ @@ -795,9 +793,7 @@ ivas_error config_acelp1( Word16 flag_hardcoded, coder_type_sw, fix_first; Word32 core_brate; #ifdef DEBUGGING -#ifdef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING (void) active_cnt; -#endif #endif ivas_error error; @@ -1078,13 +1074,9 @@ ivas_error config_acelp1( test(); test(); test(); -#ifdef NONBE_FIX_GSC_BSTR IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && coder_type != INACTIVE && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) /* mid bitrates in GC and VC, low+mid bitrates in TC */ || ( coder_type == INACTIVE && !inactive_coder_type_flag ) /* AVQ inactive */ ) -#else - IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && coder_type != INACTIVE && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) || ( coder_type == INACTIVE && GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) ) -#endif { *nBits_es_Pred = Es_pred_bits_tbl[BIT_ALLOC_IDX_fx( core_brate, coder_type, -1, -1 )]; move16(); @@ -1205,11 +1197,7 @@ ivas_error config_acelp1( { test(); test(); -#ifdef NONBE_FIX_GSC_BSTR IF( coder_type == INACTIVE && EQ_16( L_frame, L_FRAME16k ) && inactive_coder_type_flag ) /* GSC Inactive @16kHz */ -#else - IF( coder_type == INACTIVE && EQ_16( L_frame, L_FRAME16k ) && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) /* GSC Inactive @16kHz */ -#endif { acelp_cfg->ltf_mode = FULL_BAND; move16(); @@ -1427,14 +1415,10 @@ ivas_error config_acelp1( acelp_cfg->fixed_cdk_index[3] = -1; move16(); } -#ifdef NONBE_FIX_GSC_BSTR ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) || /* @12.8kHz core except of GSC */ ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( !inactive_coder_type_flag || coder_type != INACTIVE ) ) /* @16kHz core GC, TC, AVQ inactive */ || EQ_16( core, HQ_CORE ) /* ACELP -> HQ switching in EVS */ ) -#else - ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) || ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) || coder_type != INACTIVE ) ) || EQ_16( core, HQ_CORE ) ) -#endif { /* pitch Q & gain Q bit-budget - part 2*/ FOR( i = 0; i < nb_subfr; i++ ) @@ -1498,13 +1482,9 @@ ivas_error config_acelp1( test(); test(); test(); -#ifdef NONBE_FIX_GSC_BSTR IF( flag_hardcoded /* EVS */ || ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) /* high-birate ACELP except IC */ || ( !inactive_coder_type_flag && coder_type == INACTIVE ) /* AVQ inactive */ ) -#else - IF( flag_hardcoded || ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) && coder_type == INACTIVE ) ) -#endif { FOR( i = 0; i < nb_subfr; i++ ) { @@ -1613,12 +1593,8 @@ ivas_error config_acelp1( test(); test(); test(); -#ifdef NONBE_FIX_GSC_BSTR IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) /* high-birate ACELP except IC */ || ( !inactive_coder_type_flag && coder_type == INACTIVE ) /* AVQ inactive */ ) -#else - IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) && coder_type == INACTIVE ) ) -#endif { FOR( i = 0; i < nb_subfr; i++ ) { @@ -1658,13 +1634,9 @@ ivas_error config_acelp1( } } } -#ifdef NONBE_FIX_GSC_BSTR ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) /* LBR secondary channel in TD stereo */ || ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) /* GSC @12.8kHz */ || ( coder_type == INACTIVE && inactive_coder_type_flag ) /* AVQ inactive */ ) -#else - ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) || ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) || ( coder_type == INACTIVE && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) ) -#endif { Word32 Local_BR, Pitch_BR; Word16 Pitch_CT; @@ -1805,12 +1777,8 @@ ivas_error config_acelp1( test(); test(); test(); -#ifdef NONBE_FIX_GSC_BSTR IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && inactive_coder_type_flag ) /* GSC Inactive @16kHz */ || ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* IVAS GSC @16kHz */ -#else - IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) || ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* GSC Inactive @16kHz */ -#endif { acelp_cfg->ubits = 0; move16(); @@ -1930,9 +1898,7 @@ ivas_error config_acelp1_IVAS( ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ const Word16 signaling_bits, /* i : number of signaling bits */ const Word16 coder_type, /* i : coder type */ -#ifdef NONBE_FIX_GSC_BSTR const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ -#endif const Word16 tc_subfr, /* i : TC subfr ID */ const Word16 tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ Word16 *nBits_es_Pred, /* o : number of bits for Es_pred Q */ @@ -2214,12 +2180,8 @@ ivas_error config_acelp1_IVAS( test(); test(); /* gain Q bit-budget - part 1: 'Es_pred' of memory-less gain Q */ -#ifdef NONBE_FIX_GSC_BSTR IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && coder_type != INACTIVE && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) /* mid bitrates in GC and VC, low+mid bitrates in TC */ || ( coder_type == INACTIVE && !inactive_coder_type_flag ) /* AVQ inactive */ ) -#else - IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && ( coder_type != INACTIVE ) && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) || ( ( coder_type == INACTIVE ) && GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) ) -#endif { *nBits_es_Pred = Es_pred_bits_tbl[BIT_ALLOC_IDX( core_brate, coder_type, -1, -1 )]; move16(); @@ -2344,11 +2306,7 @@ ivas_error config_acelp1_IVAS( { test(); test(); -#ifdef NONBE_FIX_GSC_BSTR IF( coder_type == INACTIVE && EQ_16( L_frame, L_FRAME16k ) && inactive_coder_type_flag ) /* GSC Inactive @16kHz */ -#else - IF( coder_type == INACTIVE && EQ_16( L_frame, L_FRAME16k ) && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) /* GSC Inactive @16kHz */ -#endif { acelp_cfg->ltf_mode = FULL_BAND; move16(); @@ -2564,13 +2522,9 @@ ivas_error config_acelp1_IVAS( acelp_cfg->fixed_cdk_index[3] = -1; move16(); } -#ifdef NONBE_FIX_GSC_BSTR ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) /* @12.8kHz core except of GSC */ || ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( !inactive_coder_type_flag || coder_type != INACTIVE ) ) /* @16kHz core GC, TC, AVQ inactive */ || EQ_16( core, HQ_CORE ) /* ACELP -> HQ switching in EVS */ ) -#else - ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) || ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) || coder_type != INACTIVE ) ) || EQ_16( core, HQ_CORE ) ) -#endif { /* pitch Q & gain Q bit-budget - part 2*/ FOR( i = 0; i < nb_subfr; i++ ) @@ -2634,13 +2588,9 @@ ivas_error config_acelp1_IVAS( test(); test(); /* algebraic codebook bit-budget */ -#ifdef NONBE_FIX_GSC_BSTR IF( flag_hardcoded /* EVS */ || ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) /* high-birate ACELP except IC */ || ( !inactive_coder_type_flag && coder_type == INACTIVE ) /* AVQ inactive */ ) -#else - IF( flag_hardcoded || ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) && coder_type == INACTIVE ) ) -#endif { FOR( i = 0; i < nb_subfr; i++ ) { @@ -2741,12 +2691,8 @@ ivas_error config_acelp1_IVAS( test(); test(); /* AVQ codebook */ -#ifdef NONBE_FIX_GSC_BSTR IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) /* high-birate ACELP except IC */ || ( !inactive_coder_type_flag && coder_type == INACTIVE ) /* AVQ inactive */ ) -#else - IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) && coder_type == INACTIVE ) ) -#endif { FOR( i = 0; i < nb_subfr; i++ ) { @@ -2784,13 +2730,9 @@ ivas_error config_acelp1_IVAS( } } } -#ifdef NONBE_FIX_GSC_BSTR ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) /* LBR secondary channel in TD stereo */ || ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) /* GSC @12.8kHz */ || ( coder_type == INACTIVE && inactive_coder_type_flag ) /* AVQ inactive */ ) -#else - ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) || ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) || ( coder_type == INACTIVE && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) ) -#endif { Word32 Local_BR, Pitch_BR; Word16 Pitch_CT; @@ -2931,12 +2873,8 @@ ivas_error config_acelp1_IVAS( test(); test(); test(); -#ifdef NONBE_FIX_GSC_BSTR IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && inactive_coder_type_flag ) /* GSC Inactive @16kHz */ || ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* IVAS GSC @16kHz */ -#else - IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) || ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* GSC Inactive @16kHz */ -#endif { acelp_cfg->ubits = 0; move16(); diff --git a/lib_com/bitstream_fx.c b/lib_com/bitstream_fx.c index 712a6905e..e144c2cc9 100644 --- a/lib_com/bitstream_fx.c +++ b/lib_com/bitstream_fx.c @@ -526,10 +526,8 @@ void reset_indices_enc_fx( { Word16 i; -#ifdef MSAN_FIX hBstr->nb_ind_tot = 0; move16(); -#endif hBstr->nb_bits_tot = 0; move16(); hBstr->next_ind_fx = 0; diff --git a/lib_com/cldfb.c b/lib_com/cldfb.c index 48fe4d9bc..408580169 100644 --- a/lib_com/cldfb.c +++ b/lib_com/cldfb.c @@ -1101,9 +1101,7 @@ void cldfbSynthesis_ivas_fx( Word32 **imagBuffer_fx, /* i : imag values Qx*/ Word32 *timeOut_fx, /* o : output time domain samples Qx - 1*/ const Word16 samplesToProcess, /* i : number of processed samples */ -#ifdef OPT_SBA_AVOID_SPAR_RESCALE const Word16 shift, /* i : scale for state buffer */ -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ HANDLE_CLDFB_FILTER_BANK h_cldfb /* i : filter bank state */ ) { @@ -1269,10 +1267,8 @@ void cldfbSynthesis_ivas_fx( } /* synthesis prototype filter */ -#ifdef OPT_SBA_AVOID_SPAR_RESCALE IF( 0 == shift ) { -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ FOR( i = 0; i < L2; i++ ) { accu0 = Madd_32_16( synthesisBuffer_fx[i], Mpy_32_16_1( new_samples_fx[L2 - 1 - i], p_filter[i] ), p_filter_sf ); // Qx - 1 @@ -1292,7 +1288,6 @@ void cldfbSynthesis_ivas_fx( synthesisBuffer_fx[4 * L2 + i] = accu4; move32(); } -#ifdef OPT_SBA_AVOID_SPAR_RESCALE } ELSE { @@ -1318,7 +1313,6 @@ void cldfbSynthesis_ivas_fx( move32(); } } -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ FOR( i = 0; i < M1; i++ ) { diff --git a/lib_com/cnst.h b/lib_com/cnst.h index 7c93498af..1cc1a8ffe 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -932,9 +932,7 @@ typedef enum #define GAIN_PRED_ORDER 4 /* Gain quantization - prediction order for gain quantizer (only for AMR-WB IO mode) */ #define MEAN_ENER 30 /* Gain quantization - average innovation energy */ -#ifdef NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD #define DTX_THR 5 /* DTX - lp_noise threshold for DTX at higher bitrates */ -#endif #define DTX_HIST_SIZE 8 /* CNG & DTX - number of last signal frames used for CNG averaging */ #define CNG_ISF_FACT 0.9f /* CNG & DTX - CNG spectral envelope smoothing factor */ diff --git a/lib_com/disclaimer.c b/lib_com/disclaimer.c index 1a01c2c32..3b1677365 100644 --- a/lib_com/disclaimer.c +++ b/lib_com/disclaimer.c @@ -44,11 +44,7 @@ int16_t print_disclaimer( FILE *fPtr ) { fprintf( fPtr, "\n==================================================================================================\n" ); -#ifdef FIX_DISCLAIMER fprintf( fPtr, " IVAS Codec BASOP Baseline\n" ); -#else - fprintf( fPtr, " IVAS Codec Baseline\n" ); -#endif fprintf( fPtr, " \n" ); fprintf( fPtr, " Based on EVS Codec (Floating Point) 3GPP TS26.443 Nov 04, 2021,\n" ); fprintf( fPtr, " Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0\n" ); diff --git a/lib_com/edct_fx.c b/lib_com/edct_fx.c index b1e2a7dd9..1b303d285 100644 --- a/lib_com/edct_fx.c +++ b/lib_com/edct_fx.c @@ -395,9 +395,7 @@ void edct_16fx( Word16 Len2, i2; const Word16 *px, *pt; Word16 *py; -#ifdef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING (void) element_mode; -#endif #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow; Overflow = 0; diff --git a/lib_com/fft_fx.c b/lib_com/fft_fx.c index 7b63e9c67..31b11a9ea 100644 --- a/lib_com/fft_fx.c +++ b/lib_com/fft_fx.c @@ -7596,12 +7596,6 @@ Word16 L_norm_arr( const Word32 *arr, Word16 size ) Word16 q = 31; move16(); FOR( Word16 i = 0; i < size; i++ ) -#ifndef FIX_1103_OPT_L_NORM_ARR - IF( arr[i] != 0 ) - { - q = s_min( q, norm_l( arr[i] ) ); - } -#else { Word16 q_tst; @@ -7612,7 +7606,6 @@ Word16 L_norm_arr( const Word32 *arr, Word16 size ) } } -#endif return q; } @@ -7658,24 +7651,6 @@ Word16 W_norm_arr( Word64 *arr, Word16 size ) Word16 get_min_scalefactor( Word32 x, Word32 y ) { -#ifndef FIX_1104_OPT_GETMINSCALEFAC - Word16 scf = Q31; - move16(); - test(); - IF( x == 0 && y == 0 ) - { - return 0; - } - IF( x != 0 ) - { - scf = s_min( scf, norm_l( x ) ); - } - IF( y != 0 ) - { - scf = s_min( scf, norm_l( y ) ); - } - return scf; -#else Word16 scf_y; Word16 scf = Q31; move16(); @@ -7699,7 +7674,6 @@ Word16 get_min_scalefactor( Word32 x, Word32 y ) } return scf; -#endif } diff --git a/lib_com/gs_bitallocation_fx.c b/lib_com/gs_bitallocation_fx.c index 87ba794d4..0ce59482f 100644 --- a/lib_com/gs_bitallocation_fx.c +++ b/lib_com/gs_bitallocation_fx.c @@ -75,10 +75,8 @@ void bands_and_bit_alloc_fx( Word16 SWB_bit_budget; Word32 bits_per_bands[MBANDS_GN_BITALLOC16k]; Word16 w_sum_bit; -#ifdef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING (void) GSC_IVAS_mode; (void) element_mode; -#endif #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif diff --git a/lib_com/gs_inact_switching_fx.c b/lib_com/gs_inact_switching_fx.c index c0feb91f5..421b2a705 100644 --- a/lib_com/gs_inact_switching_fx.c +++ b/lib_com/gs_inact_switching_fx.c @@ -162,13 +162,8 @@ void Inac_switch_ematch_ivas_fx( Word16 dct_exc_tmp[], /* i : GSC excitation in DCT domain */ Word16 lt_ener_per_band[], /* i/o: Long term energy per band Q12 */ const Word16 coder_type, /* i : Coding mode */ -#ifdef NONBE_FIX_GSC_BSTR const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ -#endif const Word16 L_frame, /* i : Frame lenght */ -#ifndef NONBE_FIX_GSC_BSTR - const Word32 total_brate, /* i : total bit rate */ -#endif const Word16 Q_exc, /* i : input and output format of exc2 */ const Word16 bfi, /* i : frame lost indicator */ const Word16 last_core, /* i : Last core used */ @@ -224,11 +219,7 @@ void Inac_switch_ematch_ivas_fx( move16(); } } -#ifdef NONBE_FIX_GSC_BSTR ELSE IF( ( coder_type == INACTIVE ) && inactive_coder_type_flag ) -#else - ELSE IF( ( coder_type == INACTIVE ) && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) -#endif { /* Find spectrum and energy per band for inactive frames */ edct_16fx( exc2, dct_exc_tmp, L_frame, 5, element_mode ); diff --git a/lib_com/ivas_dirac_com_fx.c b/lib_com/ivas_dirac_com_fx.c index 146587791..7d481d181 100644 --- a/lib_com/ivas_dirac_com_fx.c +++ b/lib_com/ivas_dirac_com_fx.c @@ -609,10 +609,8 @@ void computeDirectionVectors_fixed( Word32 *direction_vector_y, /* o: Q30*/ Word32 *direction_vector_z, /* o: Q30*/ Word16 i_e /*Exponent of all the intensity buffers*/ -#ifdef NONBE_IMPROVE_DIRAC_INTENSITY_PREC , Word16 *i_e_band -#endif ) { Word16 i; @@ -631,7 +629,6 @@ void computeDirectionVectors_fixed( scaled_x = L_shl( *intensity_real_x, norm_x ); scaled_y = L_shl( *intensity_real_y, norm_y ); scaled_z = L_shl( *intensity_real_z, norm_z ); -#ifdef NONBE_IMPROVE_DIRAC_INTENSITY_PREC IF( i_e_band != NULL ) { e_x = sub( Q31, add( i_e_band[i - enc_param_start_band], norm_x ) ); @@ -644,12 +641,6 @@ void computeDirectionVectors_fixed( e_y = sub( i_e, norm_y ); e_z = sub( i_e, norm_z ); } -#else - - e_x = sub( i_e, norm_x ); - e_y = sub( i_e, norm_y ); - e_z = sub( i_e, norm_z ); -#endif temp1 = BASOP_Util_Add_Mant32Exp( Mult_32_32( scaled_x, scaled_x ), shl( e_x, 1 ), Mult_32_32( scaled_y, scaled_y ), shl( e_y, 1 ), &exp1 ); intensityNorm = BASOP_Util_Add_Mant32Exp( temp1, exp1, Mult_32_32( scaled_z, scaled_z ), shl( e_z, 1 ), &intensityNorm_e ); @@ -966,17 +957,12 @@ void computeDiffuseness_fixed( q_tmp = add( q_factor_energy[i], min_q_shift1 ); -#ifdef FIX_1072_SPEEDUP_COMPUTEDIFUSENESS Word16 shift_q = sub( q_tmp, q_ene ); Word32 shiftEquiv = L_add( 0, 0 ); Word16 shift_qtotal; if ( shift_q < 0 ) { -#ifdef FIX_USAN_ISSUES shiftEquiv = L_lshl( (Word32) 0x80000000, shift_q ); -#else - shiftEquiv = L_lshl( 0x80000000, shift_q ); -#endif } if ( shift_q >= 0 ) { @@ -990,27 +976,6 @@ void computeDiffuseness_fixed( energy_slow[k] = Madd_32_32_r( tmp, energy_slow[k], shiftEquiv ); move32(); } -#else - Word16 shift_q = sub( q_tmp, q_ene ); - IF( shift_q < 0 ) - { - FOR( k = 0; k < num_freq_bands; k++ ) - { - tmp = L_shl( p_tmp_c[k], min_q_shift1 ); - energy_slow[k] = L_add( L_shl( energy_slow[k], shift_q ), tmp ); - move32(); - } - } - ELSE - { - FOR( k = 0; k < num_freq_bands; k++ ) - { - tmp = L_shl( p_tmp_c[k], min_q_shift1 ); - energy_slow[k] = L_add( energy_slow[k], L_shr( tmp, shift_q ) ); - move32(); - } - } -#endif q_ene = s_min( q_ene, q_tmp ); @@ -1019,14 +984,9 @@ void computeDiffuseness_fixed( q_tmp = add( q_factor_intensity[i], min_q_shift2 ); shift_q = sub( q_tmp, q_intensity ); -#ifdef FIX_1072_SPEEDUP_COMPUTEDIFUSENESS if ( shift_q < 0 ) { -#ifdef FIX_USAN_ISSUES shiftEquiv = L_lshl( (Word32) 0x80000000, shift_q ); -#else - shiftEquiv = L_lshl( 0x80000000, shift_q ); -#endif } if ( shift_q >= 0 ) { @@ -1044,34 +1004,6 @@ void computeDiffuseness_fixed( move32(); } } -#else - IF( shift_q > 0 ) - { - FOR( j = 0; j < DIRAC_NUM_DIMS; ++j ) - { - p_tmp = buffer_intensity[j][i]; - FOR( k = 0; k < num_freq_bands; k++ ) - { - tmp = L_shl( p_tmp[k], min_q_shift2 ); - intensity_slow[j * num_freq_bands + k] = L_add( intensity_slow[j * num_freq_bands + k], L_shr( tmp, shift_q ) ); - move32(); - } - } - } - ELSE - { - FOR( j = 0; j < DIRAC_NUM_DIMS; ++j ) - { - p_tmp = buffer_intensity[j][i]; - FOR( k = 0; k < num_freq_bands; k++ ) - { - tmp = L_shl( p_tmp[k], min_q_shift2 ); - intensity_slow[j * num_freq_bands + k] = L_add( L_shl( intensity_slow[j * num_freq_bands + k], shift_q ), tmp ); - move32(); - } - } - } -#endif q_intensity = s_min( q_intensity, q_tmp ); } diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index ab043fc0f..fab166b6d 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -1309,7 +1309,6 @@ Word16 matrix_diag_product_fx( Word32 *Z, /* o : resulting matrix after the matrix multiplication */ Word16 *Z_e ); -#ifdef OPT_BASOP_ADD_v1 Word16 matrix_diag_product_fx_2( const Word32 *X, /* i : left hand matrix Q31 - X_e*/ const Word16 X_e, @@ -1321,7 +1320,6 @@ Word16 matrix_diag_product_fx_2( const Word16 entriesY, /* i : number of entries in the diagonal Q0*/ Word32 *Z, /* o : resulting matrix after the matrix multiplication Q31 - Z_e*/ Word16 *Z_e ); -#endif /* OPT_BASOP_ADD_v1 */ Word16 matrix_diag_product_fx_1( const Word32 *X, /* i : left hand matrix */ @@ -3238,10 +3236,8 @@ void computeDirectionVectors_fixed( Word32 *direction_vector_y, /*Q30*/ Word32 *direction_vector_z, /*Q30*/ Word16 i_e /*Exponent of all the intensity buffers*/ -#ifdef NONBE_IMPROVE_DIRAC_INTENSITY_PREC , Word16 *i_e_band -#endif ); @@ -3787,10 +3783,6 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx( UWord16 *nSamplesRendered, /* o : number of CLDFB slots rendered */ UWord16 *nSamplesAvailable, /* o : number of CLDFB slots still to render */ Word32 *output_fx[] /* o : rendered time signal */ -#ifndef OPT_SBA_AVOID_SPAR_RESCALE - , - Word16 out_len /*Store the length of values in each channel*/ -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ ); ivas_error ivas_osba_ism_metadata_dec_fx( @@ -4706,21 +4698,11 @@ Word32 dot_product_cholesky_fx( const Word16 N /* i : vector & matrix size */ ); -#ifndef DOT_PROD_CHOLESKY_64BIT -Word32 dot_product_cholesky_fixed( - const Word32 *x, /* i : vector x */ - const Word32 *A, /* i : Cholesky matrix A */ - const Word16 N, /* i : vector & matrix size */ - const Word16 exp_x, - const Word16 exp_A, - Word16 *exp_sum ); -#else Word64 dot_product_cholesky_fixed( const Word32 *x, /* i : vector x */ const Word32 *A, /* i : Cholesky matrix A */ const Word16 N /* i : vector & matrix size */ ); -#endif void v_mult_mat_fx( Word32 *y_fx, /* o : the product x*A */ @@ -5347,20 +5329,12 @@ ivas_error ivas_sba_dec_render_fx( UWord16 *nSamplesRendered, /* o : number of CLDFB slots rendered */ UWord16 *nSamplesAvailableNext, /* o : number of CLDFB slots still to render */ Word32 *output_fx[] /* o : rendered time signal Q11*/ -#ifndef OPT_SBA_AVOID_SPAR_RESCALE - , - Word16 out_len /*Store the length of values in each channel*/ -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ ); void ivas_spar_dec_upmixer_sf_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ Word32 *output_fx[], /* o : output audio channels */ const Word16 nchan_internal /* i : number of internal channels */ -#ifndef OPT_SBA_AVOID_SPAR_RESCALE - , - Word16 out_len -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ ); ivas_error ivas_spar_md_enc_open_fx( @@ -5967,9 +5941,7 @@ ivas_error pre_proc_front_ivas_fx( const Word16 front_vad_dtx_flag, /* i : front-VAD DTX flag to overwrite VAD decision Q0*/ const IVAS_FORMAT ivas_format, /* i : IVAS format */ const Word16 MCT_flag, /* i : hMCT handle allocated (1) or not (0) Q0*/ -#ifdef NONBE_1211_DTX_BR_SWITCHING const Word32 last_ivas_total_brate, /* i : last IVAS total bitrate Q0*/ -#endif const Word32 ivas_total_brate, /* i : IVAS total bitrate - for setting the DTX Q0*/ Word16 *Q_new #ifdef DEBUG_MODE_INFO diff --git a/lib_com/ivas_qmetadata_com_fx.c b/lib_com/ivas_qmetadata_com_fx.c index c9ad84097..ee11f2b02 100644 --- a/lib_com/ivas_qmetadata_com_fx.c +++ b/lib_com/ivas_qmetadata_com_fx.c @@ -152,10 +152,8 @@ ivas_error ivas_qmetadata_allocate_memory_fx( { set32_fx( hQMetaData->q_direction[dir].band_data[j].elevation_fx, 0, MAX_PARAM_SPATIAL_SUBFRAMES ); set32_fx( hQMetaData->q_direction[dir].band_data[j].azimuth_fx, 0, MAX_PARAM_SPATIAL_SUBFRAMES ); -#ifdef MSAN_FIX set32_fx( hQMetaData->q_direction[dir].band_data[j].q_elevation_fx, 0, MAX_PARAM_SPATIAL_SUBFRAMES ); set32_fx( hQMetaData->q_direction[dir].band_data[j].q_azimuth_fx, 0, MAX_PARAM_SPATIAL_SUBFRAMES ); -#endif set32_fx( hQMetaData->q_direction[dir].band_data[j].energy_ratio_fx, 0, MAX_PARAM_SPATIAL_SUBFRAMES ); } } @@ -315,14 +313,8 @@ ivas_error only_reduce_bits_direction_fx( Word16 *bits_dir0; Word16 bits_sph_idx_orig[MASA_MAXIMUM_CODING_SUBBANDS][MAX_PARAM_SPATIAL_SUBFRAMES]; -#ifdef FIX_QMETADATA_PENALTY Word32 penalty[MASA_MAXIMUM_CODING_SUBBANDS]; Word16 tmp; -#else - Word16 penalty[MASA_MAXIMUM_CODING_SUBBANDS]; - Word16 shift, tmp, tmp_e, flag; - Word32 tmp_32; -#endif FOR( j = 0; j < coding_subbands; j++ ) { FOR( k = 0; k < no_subframes; k++ ) @@ -407,7 +399,6 @@ ivas_error only_reduce_bits_direction_fx( } ELSE { -#ifdef FIX_QMETADATA_PENALTY Word16 m, sorted, index1, index2; @@ -457,65 +448,6 @@ ivas_error only_reduce_bits_direction_fx( } -#else - FOR( j = 0; j < coding_subbands; j++ ) - { - penalty[j] = 0; - move16(); - tmp_32 = 0; - move32(); - shift = find_guarded_bits_fx( no_subframes ); - - flag = 1; - move16(); - // This change was done due to loss of precision from BASOP_Util_Divide3232_Scale which was leading to penalty getting calculated wrongly - // and hence ind_order being sorted incorrectly which might cause infinite loop. - FOR( k = 0; k < no_subframes - 1; k++ ) - { - IF( NE_16( bits_sph_idx_orig[j][k], bits_sph_idx_orig[j][k + 1] ) ) - { - flag = 0; - move16(); - } - } - - IF( flag ) - { - tmp = 0; - move16(); - FOR( k = 0; k < no_subframes; k++ ) - { - IF( bits_sph_idx_orig[j][k] > 0 ) - { - tmp = add( tmp, sub( bits_sph_idx_orig[j][k], q_direction->band_data[j].bits_sph_idx[k] ) ); - } - } - - tmp = BASOP_Util_Divide1616_Scale( tmp, bits_sph_idx_orig[j][0], &tmp_e ); - - tmp_32 = L_shl( tmp, tmp_e ); /* Q15 */ - - penalty[j] = extract_l( L_shr( tmp_32, shift ) ); /* Q15 - shift */ - move16(); - // Division by no_subframes for penalty[j] not required - } - ELSE - { - FOR( k = 0; k < no_subframes; k++ ) - { - IF( bits_sph_idx_orig[j][k] > 0 ) - { - tmp = BASOP_Util_Divide3232_Scale( extract_l( L_sub( bits_sph_idx_orig[j][k], q_direction->band_data[j].bits_sph_idx[k] ) ), bits_sph_idx_orig[j][k], &tmp_e ); - tmp_32 = L_add( tmp_32, L_shl( tmp, tmp_e ) ); - } - } - penalty[j] = extract_l( L_shr( tmp_32, shift ) ); /* Q15 - shift */ - move16(); - // Division by no_subframes for penalty[j] not required - } - } - sort_desc_ind_16_fx( penalty, coding_subbands, ind_order ); -#endif } *reduce_bits_out = negate( reduce_bits ); diff --git a/lib_com/ivas_spar_com_fx.c b/lib_com/ivas_spar_com_fx.c index 929eaa2c5..9f6d8b422 100644 --- a/lib_com/ivas_spar_com_fx.c +++ b/lib_com/ivas_spar_com_fx.c @@ -2631,11 +2631,7 @@ static void ivas_calc_p_coeffs_per_band_enc_fx( test(); IF( W_norm( re ) == 0 || W_norm( recon_uu_re[i][j] ) == 0 ) { -#ifdef FIX_ISSUE_1122 recon_uu_re[i][j] = L_shr( recon_uu_re[i][j], 1 ); // q_recon_uu_re[i][j] - 1 -#else - re1[m] = L_shr( re1[m], 1 ); // q_recon_uu_re[i][j]-1 -#endif move32(); q_recon_uu_re[i][j] = sub( q_recon_uu_re[i][j], 1 ); move16(); @@ -3834,11 +3830,7 @@ void ivas_compute_spar_params_fx( } ELSE { -#ifdef FIX_11_1_IVAS_SPAR_DEC_UPMIXER_SF_RND_COEFFS hSparMd->band_coeffs[b + ( i_ts * IVAS_MAX_NUM_BANDS )].pred_re_fx[i] = L_shr_r( hSparMd->band_coeffs[b + ( i_ts * IVAS_MAX_NUM_BANDS )].pred_re_fx[i], sub( tmp, 22 ) ); // q22 -#else - hSparMd->band_coeffs[b + ( i_ts * IVAS_MAX_NUM_BANDS )].pred_re_fx[i] = L_shr( hSparMd->band_coeffs[b + ( i_ts * IVAS_MAX_NUM_BANDS )].pred_re_fx[i], sub( tmp, 22 ) ); // q22 -#endif move32(); } } @@ -3865,7 +3857,6 @@ void ivas_compute_spar_params_fx( Word16 q_tmp = hSparMd->band_coeffs[b + ( i_ts * IVAS_MAX_NUM_BANDS )].q_C_re_fx; IF( NE_16( ndm, 1 ) ) { -#ifdef MSAN_FIX FOR( i = 0; i < ( num_ch - ndm ); i++ ) { FOR( j = 0; j < sub( ndm, 1 ); j++ ) @@ -3874,15 +3865,6 @@ void ivas_compute_spar_params_fx( move32(); } } -#else - for ( i = 0; i < IVAS_SPAR_MAX_CH - IVAS_SPAR_MAX_DMX_CHS; i++ ) - { - for ( j = 0; j < IVAS_SPAR_MAX_DMX_CHS - 1; j++ ) - { - hSparMd->band_coeffs[b + i_ts * IVAS_MAX_NUM_BANDS].C_re_fx[i][j] = L_shr( hSparMd->band_coeffs[b + i_ts * IVAS_MAX_NUM_BANDS].C_re_fx[i][j], sub( q_tmp, 22 ) ); - } - } -#endif hSparMd->band_coeffs[b + ( i_ts * IVAS_MAX_NUM_BANDS )].q_C_re_fx = Q22; move16(); } diff --git a/lib_com/ivas_tools_fx.c b/lib_com/ivas_tools_fx.c index 04d6f7bf5..ca8dec276 100644 --- a/lib_com/ivas_tools_fx.c +++ b/lib_com/ivas_tools_fx.c @@ -306,12 +306,6 @@ void v_add_inc_fx( const Word16 N /* i : Vector length Q0*/ ) { -#ifndef FIX_1107_VADDINC - Word16 i; - Word16 ix1 = 0; - Word16 ix2 = 0; - Word16 iy = 0; -#else Word16 i, ix1, ix2, iy; /* The use of this function is currently always for the interleaved input format, */ @@ -334,7 +328,6 @@ void v_add_inc_fx( ix1 = 0; ix2 = 0; iy = 0; -#endif move16(); move16(); move16(); @@ -604,44 +597,6 @@ void v_sub32_fx( * Therefore, S=A*A' where A is upper triangular matrix of size (m*m+m)/2 (zeros ommitted, column-wise) *---------------------------------------------------------------------*/ -#ifndef DOT_PROD_CHOLESKY_64BIT -/*! r: the dot product x'*A*A'*x */ -Word32 dot_product_cholesky_fixed( - const Word32 *x, /* i : vector x Q31 - exp_x*/ - const Word32 *A, /* i : Cholesky matrix A Q31 - exp_A*/ - const Word16 N, /* i : vector & matrix size Q0*/ - const Word16 exp_x, - const Word16 exp_A, - Word16 *exp_sum ) -{ - Word16 i, j; - Word32 suma, tmp_sum, mul; - const Word32 *pt_x, *pt_A; - Word16 mul_exp, tmp_sum_exp; - mul_exp = add( exp_x, exp_A ); - pt_A = A; - suma = 0; - move32(); - FOR( i = 0; i < N; i++ ) - { - tmp_sum = 0; - move32(); - tmp_sum_exp = 0; - move16(); - pt_x = x; - - FOR( j = 0; j <= i; j++ ) - { - mul = Mpy_32_32( *pt_x++, *pt_A++ ); /*Q31 - (exp_x + exp_A)*/ - tmp_sum = BASOP_Util_Add_Mant32Exp( tmp_sum, tmp_sum_exp, mul, mul_exp, &tmp_sum_exp ); // exp_x+exp_A - } - - suma = BASOP_Util_Add_Mant32Exp( suma, *exp_sum, Mpy_32_32( tmp_sum, tmp_sum ), shl( tmp_sum_exp, 1 ), exp_sum ); /*Q31 - exp_sum*/ - } - - return suma; -} -#else /*! r: the dot product x'*A*A'*x */ Word64 dot_product_cholesky_fixed( const Word32 *x, /* i : vector x Q31 - exp_x*/ @@ -677,7 +632,6 @@ Word64 dot_product_cholesky_fixed( return suma; } -#endif void v_mult_mat_fixed( Word32 *y, /* o : the product x*A Qx - guardbits*/ @@ -978,9 +932,6 @@ Word16 matrix_product_mant_exp_fx( Word16 out_e[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; Word16 *Zp_fx_e = out_e; Word16 row, col; -#ifndef OPT_BASOP_ADD_v1 - Word16 x_idx, y_idx; -#endif /* OPT_BASOP_ADD_v1 */ Word64 temp; Word16 temp_e; Word16 prod_e = add( X_fx_e, Y_fx_e ); @@ -1007,13 +958,7 @@ Word16 matrix_product_mant_exp_fx( FOR( k = 0; k < rowsX; ++k ) { -#ifdef OPT_BASOP_ADD_v1 temp = W_mac_32_32( temp, X_fx[k + i * rowsX], Y_fx[k + j * rowsY] ); // X_fx_e + Y_fx_e -#else /* OPT_BASOP_ADD_v1 */ - x_idx = k + i * rowsX; - y_idx = k + j * rowsY; - temp = W_mac_32_32( temp, X_fx[x_idx], Y_fx[y_idx] ); // X_fx_e + Y_fx_e -#endif /* OPT_BASOP_ADD_v1 */ } /* Maximize accumulated value to 32-bit */ temp_e = W_norm( temp ); @@ -1051,13 +996,7 @@ Word16 matrix_product_mant_exp_fx( move64(); FOR( k = 0; k < colsX; ++k ) { -#ifdef OPT_BASOP_ADD_v1 temp = W_mac_32_32( temp, X_fx[i + k * rowsX], Y_fx[j + k * rowsY] ); // X_fx_e + Y_fx_e -#else /* OPT_BASOP_ADD_v1 */ - x_idx = i + k * rowsX; - y_idx = j + k * rowsY; - temp = W_mac_32_32( temp, X_fx[x_idx], Y_fx[y_idx] ); // X_fx_e + Y_fx_e -#endif /* OPT_BASOP_ADD_v1 */ } /* Maximize accumulated value to 32-bit */ temp_e = W_norm( temp ); @@ -1095,13 +1034,7 @@ Word16 matrix_product_mant_exp_fx( move64(); FOR( k = 0; k < colsX; ++k ) { -#ifdef OPT_BASOP_ADD_v1 temp = W_mac_32_32( temp, X_fx[k + i * rowsX], Y_fx[j + k * rowsY] ); // X_fx_e + Y_fx_e -#else /* OPT_BASOP_ADD_v1 */ - x_idx = k + i * rowsX; - y_idx = j + k * rowsY; - temp = W_mac_32_32( temp, X_fx[x_idx], Y_fx[y_idx] ); // X_fx_e + Y_fx_e -#endif /* OPT_BASOP_ADD_v1 */ } /* Maximize accumulated value to 32-bit */ temp_e = W_norm( temp ); @@ -1140,13 +1073,7 @@ Word16 matrix_product_mant_exp_fx( move64(); FOR( k = 0; k < colsX; ++k ) { -#ifdef OPT_BASOP_ADD_v1 temp = W_mac_32_32( temp, X_fx[i + k * rowsX], Y_fx[k + j * rowsY] ); // X_fx_e + Y_fx_e -#else /* OPT_BASOP_ADD_v1 */ - x_idx = i + k * rowsX; - y_idx = k + j * rowsY; - temp = W_mac_32_32( temp, X_fx[x_idx], Y_fx[y_idx] ); // X_fx_e + Y_fx_e -#endif /* OPT_BASOP_ADD_v1 */ } /* Maximize accumulated value to 32-bit */ temp_e = W_norm( temp ); @@ -1204,9 +1131,6 @@ Word16 matrix_product_fx( ) { Word16 i, j, k; -#ifndef OPT_BASOP_ADD_v1 - Word16 x_idx, y_idx; -#endif /* OPT_BASOP_ADD_v1 */ Word32 *Zp_fx = Z_fx; /* Processing */ @@ -1227,13 +1151,7 @@ Word16 matrix_product_fx( move32(); FOR( k = 0; k < rowsX; ++k ) { -#ifdef OPT_BASOP_ADD_v1 ( *Zp_fx ) = Madd_32_32( *Zp_fx, X_fx[k + i * rowsX], Y_fx[k + j * rowsY] ); /*Qx + Qy - 31*/ -#else /* OPT_BASOP_ADD_v1 */ - x_idx = add( k, imult1616( i, rowsX ) ); /*Q0*/ - y_idx = add( k, imult1616( j, rowsY ) ); /*Q0*/ - ( *Zp_fx ) = L_add( *Zp_fx, Mpy_32_32( X_fx[x_idx], Y_fx[y_idx] ) ); /*Qx + Qy - 31*/ -#endif /* OPT_BASOP_ADD_v1 */ move32(); } Zp_fx++; @@ -1254,13 +1172,7 @@ Word16 matrix_product_fx( move32(); FOR( k = 0; k < colsX; ++k ) { -#ifdef OPT_BASOP_ADD_v1 ( *Zp_fx ) = Madd_32_32( *Zp_fx, X_fx[i + k * rowsX], Y_fx[j + k * rowsY] ); /*Qx + Qy - 31*/ -#else /* OPT_BASOP_ADD_v1 */ - x_idx = add( i, imult1616( k, rowsX ) ); /*Q0*/ - y_idx = add( j, imult1616( k, rowsY ) ); /*Q0*/ - ( *Zp_fx ) = L_add( *Zp_fx, Mpy_32_32( X_fx[x_idx], Y_fx[y_idx] ) ); /*Qx + Qy - 31*/ -#endif /* OPT_BASOP_ADD_v1 */ move32(); } Zp_fx++; @@ -1281,13 +1193,7 @@ Word16 matrix_product_fx( move32(); FOR( k = 0; k < colsX; ++k ) { -#ifdef OPT_BASOP_ADD_v1 ( *Zp_fx ) = Madd_32_32( *Zp_fx, X_fx[k + i * rowsX], Y_fx[j + k * rowsY] ); /*Qx + Qy - 31*/ -#else /* OPT_BASOP_ADD_v1 */ - x_idx = add( k, imult1616( i, rowsX ) ); /*Q0*/ - y_idx = add( j, imult1616( k, rowsY ) ); /*Q0*/ - ( *Zp_fx ) = L_add( *Zp_fx, Mpy_32_32( X_fx[x_idx], Y_fx[y_idx] ) ); /*Qx + Qy - 31*/ -#endif /* OPT_BASOP_ADD_v1 */ move32(); } @@ -1310,13 +1216,7 @@ Word16 matrix_product_fx( move32(); FOR( k = 0; k < colsX; ++k ) { -#ifdef OPT_BASOP_ADD_v1 ( *Zp_fx ) = L_add_sat( *Zp_fx, Mpy_32_32( X_fx[i + k * rowsX], Y_fx[k + j * rowsY] ) ); /*Qx + Qy - 31*/ -#else /* OPT_BASOP_ADD_v1 */ - x_idx = add( i, imult1616( k, rowsX ) ); /*Q0*/ - y_idx = add( k, imult1616( j, rowsY ) ); /*Q0*/ - ( *Zp_fx ) = L_add_sat( *Zp_fx, Mpy_32_32( X_fx[x_idx], Y_fx[y_idx] ) ); /*Qx + Qy - 31*/ -#endif /* OPT_BASOP_ADD_v1 */ // TODO: overflow of Z_fx to be checked move32(); } @@ -1341,9 +1241,6 @@ Word16 matrix_product_q30_fx( ) { Word16 i, j, k; -#ifndef OPT_BASOP_ADD_v1 - Word16 x_idx, y_idx; -#endif /* OPT_BASOP_ADD_v1 */ Word32 *Zp_fx = Z_fx; Word64 W_tmp; @@ -1366,14 +1263,7 @@ Word16 matrix_product_q30_fx( move64(); FOR( k = 0; k < rowsX; ++k ) { -#ifdef OPT_BASOP_ADD_v1 W_tmp = W_add( W_tmp, W_mult0_32_32( X_fx[k + i * rowsX], Y_fx[k + j * rowsY] ) ); // Q56 -#else /* OPT_BASOP_ADD_v1 */ - //( *Zp_fx ) = L_add( *Zp_fx, Mpy_32_32( X_fx[k + i * rowsX], Y_fx[k + j * rowsY] ) ); - x_idx = add( k, imult1616( i, rowsX ) ); /*Q0*/ - y_idx = add( k, imult1616( j, rowsY ) ); /*Q0*/ - W_tmp = W_add( W_tmp, W_mult0_32_32( X_fx[x_idx], Y_fx[y_idx] ) ); // Q56 -#endif /* OPT_BASOP_ADD_v1 */ } W_tmp = W_shl( W_tmp, 6 ); /*Q62*/ ( *Zp_fx ) = W_round64_L( W_tmp ); /*Q30*/ @@ -1397,14 +1287,7 @@ Word16 matrix_product_q30_fx( move64(); FOR( k = 0; k < colsX; ++k ) { -#ifdef OPT_BASOP_ADD_v1 W_tmp = W_add( W_tmp, W_mult0_32_32( X_fx[i + k * rowsX], Y_fx[j + k * rowsY] ) ); // Q56 -#else /* OPT_BASOP_ADD_v1 */ - //( *Zp_fx ) = L_add( *Zp_fx, Mpy_32_32( X_fx[i + k * rowsX], Y_fx[j + k * rowsY] ) ); - x_idx = add( i, imult1616( k, rowsX ) ); /*Q0*/ - y_idx = add( j, imult1616( k, rowsY ) ); /*Q0*/ - W_tmp = W_add( W_tmp, W_mult0_32_32( X_fx[x_idx], Y_fx[y_idx] ) ); // Q56 -#endif /* OPT_BASOP_ADD_v1 */ } W_tmp = W_shl( W_tmp, 6 ); /*Q62*/ ( *Zp_fx ) = W_round64_L( W_tmp ); /*Q30*/ @@ -1428,11 +1311,6 @@ Word16 matrix_product_q30_fx( move64(); FOR( k = 0; k < colsX; ++k ) { -#ifndef OPT_BASOP_ADD_v1 - //( *Zp_fx ) = L_add( *Zp_fx, Mpy_32_32( X_fx[k + i * rowsX], Y_fx[j + k * rowsY] ) ); - x_idx = add( k, imult1616( i, rowsX ) ); /*Q0*/ - y_idx = add( j, imult1616( k, rowsY ) ); /*Q0*/ -#endif /* OPT_BASOP_ADD_v1 */ W_tmp = W_add( W_tmp, W_mult0_32_32( X_fx[k + i * rowsX], Y_fx[j + k * rowsY] ) ); // Q56 } @@ -1459,14 +1337,7 @@ Word16 matrix_product_q30_fx( move64(); FOR( k = 0; k < colsX; ++k ) { -#ifdef OPT_BASOP_ADD_v1 W_tmp = W_add( W_tmp, W_mult0_32_32( X_fx[i + k * rowsX], Y_fx[k + j * rowsY] ) ); // Q56 -#else /* OPT_BASOP_ADD_v1 */ - //( *Zp_fx ) = L_add( *Zp_fx, Mpy_32_32( X_fx[i + k * rowsX], Y_fx[k + j * rowsY] ) ); - x_idx = add( i, imult1616( k, rowsX ) ); /*Q0*/ - y_idx = add( k, imult1616( j, rowsY ) ); /*Q0*/ - W_tmp = W_add( W_tmp, W_mult0_32_32( X_fx[x_idx], Y_fx[y_idx] ) ); // Q56 -#endif /* OPT_BASOP_ADD_v1 */ } W_tmp = W_shl( W_tmp, 6 ); /*Q62*/ ( *Zp_fx ) = W_round64_L( W_tmp ); /*Q30*/ @@ -1499,9 +1370,6 @@ Word16 matrix_product_mant_exp( Word16 *Zp_e = Z_e; Word32 L_tmp; Word16 tmp_e; -#ifndef OPT_BASOP_ADD_v1 - Word16 x_idx, y_idx; -#endif /* OPT_BASOP_ADD_v1 */ /* Processing */ test(); @@ -1523,16 +1391,8 @@ Word16 matrix_product_mant_exp( move16(); FOR( k = 0; k < rowsX; ++k ) { -#ifdef OPT_BASOP_ADD_v1 L_tmp = Mpy_32_32( X_fx[k + i * rowsX], Y_fx[k + j * rowsY] ); /*Q31 - (X_e + Y_e)*/ tmp_e = add( X_e[k + i * rowsX], Y_e[k + j * rowsY] ); -#else /* OPT_BASOP_ADD_v1 */ - x_idx = add( k, imult1616( i, rowsX ) ); /*Q0*/ - y_idx = add( k, imult1616( j, rowsY ) ); /*Q0*/ - //( *Zp ) += X[k + i * rowsX] * Y[k + j * rowsY]; - L_tmp = Mpy_32_32( X_fx[x_idx], Y_fx[y_idx] ); /*Q31 - (X_e + Y_e)*/ - tmp_e = add( X_e[x_idx], Y_e[y_idx] ); -#endif /* OPT_BASOP_ADD_v1 */ ( *Zp ) = BASOP_Util_Add_Mant32Exp( *Zp, *Zp_e, L_tmp, tmp_e, &tmp_e ); move32(); @@ -1560,16 +1420,8 @@ Word16 matrix_product_mant_exp( move16(); FOR( k = 0; k < colsX; ++k ) { -#ifdef OPT_BASOP_ADD_v1 L_tmp = Mpy_32_32( X_fx[i + k * rowsX], Y_fx[j + k * rowsY] ); /*Q31 - (X_e + Y_e)*/ tmp_e = add( X_e[i + k * rowsX], Y_e[j + k * rowsY] ); -#else /* OPT_BASOP_ADD_v1 */ - x_idx = add( i, imult1616( k, rowsX ) ); /*Q0*/ - y_idx = add( j, imult1616( k, rowsY ) ); /*Q0*/ - //( *Zp ) += X_fx[i + k * rowsX] * Y_fx[j + k * rowsY]; - L_tmp = Mpy_32_32( X_fx[x_idx], Y_fx[y_idx] ); /*Q31 - (X_e + Y_e)*/ - tmp_e = add( X_e[x_idx], Y_e[y_idx] ); -#endif /* OPT_BASOP_ADD_v1 */ ( *Zp ) = BASOP_Util_Add_Mant32Exp( *Zp, *Zp_e, L_tmp, tmp_e, &tmp_e ); ( *Zp_e ) = tmp_e; @@ -1596,16 +1448,8 @@ Word16 matrix_product_mant_exp( move16(); FOR( k = 0; k < colsX; ++k ) { -#ifdef OPT_BASOP_ADD_v1 L_tmp = Mpy_32_32( X_fx[k + i * rowsX], Y_fx[j + k * rowsY] ); /*Q31 - (X_e + Y_e)*/ tmp_e = add( X_e[k + i * rowsX], Y_e[j + k * rowsY] ); -#else /* OPT_BASOP_ADD_v1 */ - x_idx = add( k, imult1616( i, rowsX ) ); /*Q0*/ - y_idx = add( j, imult1616( k, rowsY ) ); /*Q0*/ - //( *Zp ) += X_fx[k + i * rowsX] * Y_fx[j + k * rowsY]; - L_tmp = Mpy_32_32( X_fx[x_idx], Y_fx[y_idx] ); /*Q31 - (X_e + Y_e)*/ - tmp_e = add( X_e[x_idx], Y_e[y_idx] ); -#endif /* OPT_BASOP_ADD_v1 */ ( *Zp ) = BASOP_Util_Add_Mant32Exp( *Zp, *Zp_e, L_tmp, tmp_e, &tmp_e ); move32(); @@ -1635,16 +1479,8 @@ Word16 matrix_product_mant_exp( move16(); FOR( k = 0; k < colsX; ++k ) { -#ifdef OPT_BASOP_ADD_v1 L_tmp = Mpy_32_32( X_fx[i + k * rowsX], Y_fx[k + j * rowsY] ); /*Q31 - (X_e + Y_e)*/ tmp_e = add( X_e[i + k * rowsX], Y_e[k + j * rowsY] ); -#else /* OPT_BASOP_ADD_v1 */ - x_idx = add( i, imult1616( k, rowsX ) ); /*Q0*/ - y_idx = add( k, imult1616( j, rowsY ) ); /*Q0*/ - //( *Zp ) += X_fx[i + k * rowsX] * Y_fx[k + j * rowsY]; - L_tmp = Mpy_32_32( X_fx[x_idx], Y_fx[y_idx] ); /*Q31 - (X_e + Y_e)*/ - tmp_e = add( X_e[x_idx], Y_e[y_idx] ); -#endif /* OPT_BASOP_ADD_v1 */ ( *Zp ) = BASOP_Util_Add_Mant32Exp( *Zp, *Zp_e, L_tmp, tmp_e, &tmp_e ); move32(); @@ -1675,9 +1511,6 @@ Word16 matrix_diag_product_fx( { Word16 i, j; Word32 *Zp = Z; -#ifndef OPT_BASOP_ADD_v1 - Word16 tmp; -#endif /* OPT_BASOP_ADD_v1 */ /* Processing */ IF( EQ_16( transpX, 1 ) ) /* We use X transpose */ @@ -1690,12 +1523,7 @@ Word16 matrix_diag_product_fx( { FOR( i = 0; i < colsX; ++i ) { -#ifdef OPT_BASOP_ADD_v1 *( Zp ) = Mpy_32_32( X[j + i * rowsX], Y[j] ); /*Q31 - (X_e + Y_e)*/ -#else /* OPT_BASOP_ADD_v1 */ - tmp = add( j, imult1616( i, rowsX ) ); - *( Zp ) = Mpy_32_32( X[tmp], Y[j] ); /*Q31 - (X_e + Y_e)*/ -#endif /* OPT_BASOP_ADD_v1 */ move32(); Zp++; } @@ -1726,7 +1554,6 @@ Word16 matrix_diag_product_fx( return EXIT_SUCCESS; } -#ifdef OPT_BASOP_ADD_v1 Word16 matrix_diag_product_fx_2( const Word32 *X, /* i : left hand matrix Q31 - X_e*/ const Word16 X_e, @@ -1818,7 +1645,6 @@ Word16 matrix_diag_product_fx_2( return EXIT_SUCCESS; } -#endif /* OPT_BASOP_ADD_v1 */ Word16 matrix_diag_product_fx_1( const Word32 *X, /* i : left hand matrix Q31 - X_e*/ @@ -1835,9 +1661,6 @@ Word16 matrix_diag_product_fx_1( Word16 i, j; Word32 *Zp = Z; Word16 *Z_ep = Z_e; -#ifndef OPT_BASOP_ADD_v1 - Word16 tmp; -#endif /* OPT_BASOP_ADD_v1 */ /* Processing */ IF( EQ_16( transpX, 1 ) ) /* We use X transpose */ @@ -1850,19 +1673,10 @@ Word16 matrix_diag_product_fx_1( { FOR( i = 0; i < colsX; ++i ) { -#ifdef OPT_BASOP_ADD_v1 *( Zp ) = Mpy_32_32( X[j + i * rowsX], Y[j] ); /*Q31 - (X_e + Y_e)*/ -#else /* OPT_BASOP_ADD_v1 */ - tmp = add( j, imult1616( i, rowsX ) ); /*Q0*/ - *( Zp ) = Mpy_32_32( X[tmp], Y[j] ); /*Q31 - (X_e + Y_e)*/ -#endif /* OPT_BASOP_ADD_v1 */ move32(); Zp++; -#ifdef OPT_BASOP_ADD_v1 *( Z_ep ) = add( X_e[j + i * rowsX], Y_e[j] ); -#else /* OPT_BASOP_ADD_v1 */ - *( Z_ep ) = add( X_e[tmp], Y_e[j] ); -#endif /* OPT_BASOP_ADD_v1 */ move16(); Z_ep++; } @@ -1908,9 +1722,6 @@ Word16 diag_matrix_product_fx( { Word16 i, j; Word32 *Zp = Z; -#ifndef OPT_BASOP_ADD_v1 - Word16 tmp; -#endif /* OPT_BASOP_ADD_v1 */ /* Processing */ IF( EQ_16( transpX, 1 ) ) /* We use X transpose */ @@ -1923,12 +1734,7 @@ Word16 diag_matrix_product_fx( { FOR( j = 0; j < entriesY; ++j ) { -#ifdef OPT_BASOP_ADD_v1 *( Zp ) = Mpy_32_32( X[i + j * rowsX], Y[j] ); /*Q31 - (X_e + Y_e)*/ -#else /* OPT_BASOP_ADD_v1 */ - tmp = add( i, imult1616( j, rowsX ) ); /*Q0*/ - *( Zp ) = Mpy_32_32( X[tmp], Y[j] ); /*Q31 - (X_e + Y_e)*/ -#endif /* OPT_BASOP_ADD_v1 */ move32(); Zp++; } @@ -1974,9 +1780,6 @@ Word16 matrix_product_diag_fx( { Word16 j, k; Word32 *Zp = Z; -#ifndef OPT_BASOP_ADD_v1 - Word16 y_idx, x_idx; -#endif /* OPT_BASOP_ADD_v1 */ /* Processing */ test(); @@ -1995,13 +1798,7 @@ Word16 matrix_product_diag_fx( move32(); FOR( k = 0; k < rowsX; ++k ) { -#ifdef OPT_BASOP_ADD_v1 ( *Zp ) = Madd_32_32( ( *Zp ), X[k + j * rowsX], Y[k + j * rowsY] ); /*Q31 - (X_e + Y_e)*/ -#else /* OPT_BASOP_ADD_v1 */ - x_idx = add( k, imult1616( j, rowsX ) ); /*Q0*/ - y_idx = add( k, imult1616( j, rowsY ) ); /*Q0*/ - ( *Zp ) = L_add( ( *Zp ), Mpy_32_32( X[x_idx], Y[y_idx] ) ); /*Q31 - (X_e + Y_e)*/ -#endif /* OPT_BASOP_ADD_v1 */ move32(); } Zp++; @@ -2019,13 +1816,7 @@ Word16 matrix_product_diag_fx( move32(); FOR( k = 0; k < colsX; ++k ) { -#ifdef OPT_BASOP_ADD_v1 ( *Zp ) = Madd_32_32( ( *Zp ), X[j + k * rowsX], Y[j + k * rowsY] ); /*Q31 - (X_e + Y_e)*/ -#else /* OPT_BASOP_ADD_v1 */ - x_idx = add( j, imult1616( k, rowsX ) ); /*Q0*/ - y_idx = add( j, imult1616( k, rowsY ) ); /*Q0*/ - ( *Zp ) = L_add( ( *Zp ), Mpy_32_32( X[x_idx], Y[y_idx] ) ); /*Q31 - (X_e + Y_e)*/ -#endif /* OPT_BASOP_ADD_v1 */ move32(); } Zp++; @@ -2045,13 +1836,7 @@ Word16 matrix_product_diag_fx( move32(); FOR( k = 0; k < colsX; ++k ) { -#ifdef OPT_BASOP_ADD_v1 ( *Zp ) = Madd_32_32( ( *Zp ), X[k + j * rowsX], Y[j + k * rowsY] ); /*Q31 - (X_e + Y_e)*/ -#else /* OPT_BASOP_ADD_v1 */ - x_idx = add( k, imult1616( j, rowsX ) ); /*Q0*/ - y_idx = add( j, imult1616( k, rowsY ) ); /*Q0*/ - ( *Zp ) = L_add( ( *Zp ), Mpy_32_32( X[x_idx], Y[y_idx] ) ); /*Q31 - (X_e + Y_e)*/ -#endif /* OPT_BASOP_ADD_v1 */ move32(); } @@ -2071,13 +1856,7 @@ Word16 matrix_product_diag_fx( move32(); FOR( k = 0; k < colsX; ++k ) { -#ifdef OPT_BASOP_ADD_v1 ( *Zp ) = Madd_32_32( ( *Zp ), X[j + k * rowsX], Y[k + j * rowsY] ); /*Q31 - (X_e + Y_e)*/ -#else /* OPT_BASOP_ADD_v1 */ - x_idx = add( j, imult1616( k, rowsX ) ); /*Q0*/ - y_idx = add( k, imult1616( j, rowsY ) ); /*Q0*/ - ( *Zp ) = L_add( ( *Zp ), Mpy_32_32( X[x_idx], Y[y_idx] ) ); /*Q31 - (X_e + Y_e)*/ -#endif /* OPT_BASOP_ADD_v1 */ move32(); } Zp++; diff --git a/lib_com/lerp.c b/lib_com/lerp.c index 4e306b936..6f148057f 100644 --- a/lib_com/lerp.c +++ b/lib_com/lerp.c @@ -356,10 +356,6 @@ void L_lerp_fx( Word32 *f /*q*/, Word32 *f_out /*q*/, Word16 bufferNewSize /*Q0* f[ind] = L_shr( f[ind], guard_bits ); /*Q(guard_bits)*/ move32(); } -#ifndef MSAN_FIX - FOR( Word16 ind = 0; ind < bufferNewSize; ind++ ) - f_out[ind] = L_shr( f_out[ind], guard_bits ); -#endif } IF( GT_32( L_mult0( 128, bufferNewSize ), L_mult0( bufferOldSize, 507 ) ) ) diff --git a/lib_com/low_rate_band_att_fx.c b/lib_com/low_rate_band_att_fx.c index 9958b9d5f..e51d2807b 100644 --- a/lib_com/low_rate_band_att_fx.c +++ b/lib_com/low_rate_band_att_fx.c @@ -75,15 +75,11 @@ void ivas_fine_gain_pred_fx( 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 */ -#ifndef FIX_ISSUE_987 - Mpy_32_16_ss( L_tmp, ivas_fine_gain_pred_sqrt_bw[bw_idx], &L_tmp, &lsb ); /*31-exp+11-15=27-exp */ -#else Word16 norm = norm_s( bw ); 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 */ -#endif gp = round_fx_o( L_shl_o( L_tmp, add( 1, exp ), &Overflow ), &Overflow ); /*27-exp+1+exp-16=12 */ test(); diff --git a/lib_com/lsf_tools_fx.c b/lib_com/lsf_tools_fx.c index 08e74b9b7..54f0ae3ed 100644 --- a/lib_com/lsf_tools_fx.c +++ b/lib_com/lsf_tools_fx.c @@ -604,7 +604,6 @@ Word16 lpc2lsp_fx( return ( 1 ); } -#ifdef FIX_ISSUE_1165 /*===================================================================*/ /* FUNCTION : lpc2lsp_ivas_fx () */ /*-------------------------------------------------------------------*/ @@ -749,7 +748,6 @@ Word16 lpc2lsp_ivas_fx( return ( 1 ); } -#endif /*===================================================================*/ /* FUNCTION : lsp2lpc_fx () */ diff --git a/lib_com/mslvq_com_fx.c b/lib_com/mslvq_com_fx.c index 10e560433..cf2ad8a8a 100644 --- a/lib_com/mslvq_com_fx.c +++ b/lib_com/mslvq_com_fx.c @@ -461,12 +461,10 @@ static Word16 decode_indexes_ivas_fx( IF( index[i] < 0 ) { set16_fx( x_lvq, 0, 2 * LATTICE_DIM ); -#ifdef MSAN_FIX scales_mslvq[0] = 0; move16(); scales_mslvq[1] = 0; move16(); -#endif index[i] = 0; return 1; } @@ -491,10 +489,8 @@ static Word16 decode_indexes_ivas_fx( FOR( i = 0; i < LATTICE_DIM; i++ ) { x_lvq[i] = 0; -#ifdef MSAN_FIX scales_mslvq[0] = 0; move16(); -#endif } } ELSE @@ -503,12 +499,10 @@ static Word16 decode_indexes_ivas_fx( { /* safety check in case of bit errors */ set16_fx( x_lvq, 0, 2 * LATTICE_DIM ); -#ifdef MSAN_FIX scales_mslvq[0] = 0; move16(); scales_mslvq[1] = 0; move16(); -#endif return 1; } @@ -549,10 +543,8 @@ static Word16 decode_indexes_ivas_fx( x_lvq[i] = 0; move16(); } -#ifdef MSAN_FIX scales_mslvq[1] = 0; move16(); -#endif } ELSE { diff --git a/lib_com/options.h b/lib_com/options.h index ab7efb8fd..76bfee2ae 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -67,116 +67,6 @@ #define BASOP_NOGLOB_DECLARE_LOCAL #endif -#define IVAS_FLOAT_FIXED_CONVERSIONS /* Temporary macro to keep track of intermediate flt to fixed and fixed to flt conversions */ -#define MSAN_FIX -#define FIX_TMP_714 -#define BASOP_NOGLOB_TMP_715 -#define EVS_FUNC_MODIFIED -#define REMOVE_IVAS_UNUSED_PARAMETERS_WARNING /*temporary operation on unused EVS parameters to remove warnings, these parameters will be used in IVAS */ -#define MOD_BIT_ALLOC_ROM_TABLE /* Just to highlight modification in bit allocation table and to ensure these modifications doesn't affect EVS modes*/ -#define SIMPLIFY_CODE_BE // Simplify synthesis loop -#define CR_2109_to_2112_cd0_ce0 /* This is related to the CRs include in the 26.444 package of 21-12. Concerns lead_deindexing and */ -#define FIX_QMETADATA_PENALTY /* Nokia: transform penalty calculation in qmetadata into integer operations */ -#define FIX_1013_CRASH_HQ_CORE_DEC /* Ittiam: Saturation added on the lines of EVS */ -#define NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS /* DLB: adjust prerendering and mixing gain in OSBA encoder. This is fix to float codes*/ -#define NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO /* Eri: issue 1233: Address possible division by zero in hf_spectrum_sparseness() */ -#define FIX_ISSUE_1062_AND_1068_TON_ENE_EST_FX -#define FIX_ISSUE_987 -#define FIX_1054_IF_ELSE_CMPLX /* VA: Fix 1054 incorrect counting of complexity when ELSE-IF sequence is encoutered in two functions */ -#define FIX_1052_COPY_CMPLX_DISCREPANCY /* VA: modify IF-ELSE statements used in Copy*() functions to avoid dependency on x[] and y[] in RAM */ -#define FIX_1049_SHR_RO_COMPLEXITY /* VA: fix for issue 1049: incorrect counting of complexity in the shr_ro() function */ -#define NONBE_IMPROVE_DIRAC_INTENSITY_PREC -#define FIX_1103_OPT_L_NORM_ARR /* FhG: Optimize L_norm_arr(), avoid IF */ -#define FIX_1105_OPT_MINIMUM_SL /* FhG: Optimize minimum_s(), minimum_l(), avoid IF */ -#define FIX_1104_OPT_GETMINSCALEFAC /* FhG: Optimize get_min_scalefactor(), avoid IF */ -#define FIX_1106_SIMPLIFY_SET32FX /* FhG: simplify set32_fx() */ -#define FIX_1107_VADDINC /* FhG: Optimize v_add_inc_fx() for most frequent case */ -#define FIX_1009_OPT_PARAMMC_RENDER /* FhG: Optimize ivas_param_mc_dec_render_fx() */ -#define FIX_1109_OPTIM_MCT_STEREO_IGF_DEC /* FhG: optimize mctStereoIGF_dec_fx() */ -#define FIX_1110_OPTIM_DIRAC_DECORR_PROC /* FhG: optimize ivas_dirac_dec_decorr_process() */ -#define FIX_1127_IMPROVE_SBA_MLD /* Ittiam: Avoid saturation for DiRAC reference power */ -#define FIX_1100_REMOVE_LPC_RESCALING /* VA: Remove the rescaling of LPC coefficient to Q12 as residu and syn-filt are already taking care of it*/ -#define FIX_1133_IMPROVE_MC_MLD /* Ittiam: Correcting wrong updation of exponents in ivas_mc_paramupmix_param_est_enc_fx() */ -#define FIX_ISSUE_1122 /* Ittiam: Fix issue 1122: corrected incorrect scaling of a buffer leading to incorrect metadata bits */ -#define FIX_ISSUE_1125 /* Ittiam: Fix issue 1125: interfering talker flag not triggered on short test vector */ -#define FIX_1132_STACK_CORRUPTION /* Stack corruption issue due of extending index access*/ -#define FIX_ISSUE_1092 /* Ittiam: Fix for Issue 1092: BASOP asserts in stereo fx encoder for selection test inputs*/ -#define FIX_ISSUE_1135 /* Ittiam: Fix for Issue 1135: downmixing difference between float and fixed-point (DFT - stereo) */ -#define FIX_ISSUE_1148 -#define FIX_ISSUE_1147 /* Ittiam: Fix for issue 1147: Added saturation in DetectTnsFilt_fx.*/ -#define FIX_ISSUE_1150 /* Ittiam: Fix for Issue 1150: Assertion error observed in evs_enc_fx (with option stereo_dmx_evs) from tcx_ltp_find_gain function*/ -#define FIX_ISSUE_1151 /* Ittiam: Fix for Issue 1151: Assertion error observed in evs_enc_fx (with option stereo_dmx_evs) from sp_mus_classif_gmm_fx function*/ -#define FIX_ISSUE_1153 /* Ittiam: Fix for Issue 1153: Assertion error observed in stereo_dmx_evs_enc_fx from calc_poc_fx function*/ -#define FIX_ISSUE_1154 /* Ittiam: Fix for Issue 1154: Encoder crash for ParamMC 7.1 at 96kbps in ivas_param_mc_param_est_enc_fx() */ -#define FIX_ISSUE_1157 /* Ittiam: Fix for Issue 1157: Encoder crash for Stereo at 48/64kbps DTX on/off in kernel_switch_trafo_fx() */ -#define FIX_ISSUE_1152 /* Ittiam: Fix for issue 1152: Assertion error observed in evs_enc_fx (with option stereo_dmx_evs) from find_tilt_fx function*/ -#define FIX_ISSUE_1156 /* Ittiam: Fix for Issue 1156: Encoder crash for Stereo at 32kbps in SWB_BWE_encoding_ivas_fx() */ -#define FIX_DISCLAIMER /* VA: Add disclaimer for external renderer + Add info about IVAS reference version (FLP issue 1225) */ -#define FIX_ISSUE_1167 /* Ittiam: Fix for Issue 1167: Encoder crash for OSBA ISM3SBA1 at 13.2 and 16.4 kbps in gauss_L2_ivas_fx() */ -#define FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC /* FhG: Reduce workload of binaural rendering: replace 1./tmp & sqrt by Isqrt32 */ -#define FIX_1113_OPT_DIRAC_BIN_REND /* FhG: Various optimizations to ivas_dirac_dec_binaual_functions.c */ -#define FIX_ISSUE_1187 /* Ittiam: Fix for issue 1187: Assertion error observed in evs_enc_fx (with option stereo_dmx_evs) from bass_pf_enc_fx function*/ -#define FIX_ISSUE_1186 /* Ittiam: Fix for Issue 1186: Energy/scaling issue for ISM-1 at all bitrates */ -#define FIX_ISSUE_1165 /* Ittiam: Fix for issue 1165: Assertion in lpc2lsp_fx for OMASA LTV input */ -#define FIX_ISSUE_1185 /* Ittiam: Fix for issue 1185: Assertion in ivas_dirac_dec_binaural_internal_fx() for crash in decoder in fft30_with_cmplx_data()*/ -#define FIX_ISSUE_1209 /* Ittiam: Fix for issue 1209: Assertion exit in BASOP encoder (stereo_dmx_evs)*/ -#define FIX_ISSUE_1218 /* Ittiam: Fix for issue 1218: Assert in stereo_dft_generate_comfort_noise_fx of BASOP decoder with BASOP MASA DTX bitstream at 32 kbps*/ -#define FIX_ISSUE_1290 /* Ittiam: Fix for issue 1218: Assert in stereo_dft_generate_comfort_noise_fx of BASOP decoder with BASOP MASA DTX bitstream at 32 kbps*/ -#define IVAS_ISSUE_1188_EVS_CRASH /* Ittiam: Fix for issue 1188: Issue due to ASAN */ -#define FIX_ISSUE_1155 /* Ittiam: Fix for issue 1155: Encoder crash for Stereo at 32kbps in PostShortTerm_ivas_enc_fx()*/ -#define FIX_1010_OPT_DIV /* FhG: SVD complexity optimizations (non-be) */ -#define FIX_1010_OPT_SINGLE_RESCALE /* FhG: SVD complexity optimizations (non-be) */ -#define FIX_1010_OPT_GIVENS /* FhG: SVD complexity optimizations (non-be) */ -#define FIX_1010_OPT_GIVENS_INV /* FhG: SVD complexity optimizations (non-be) */ -#define FIX_1010_OPT_NORM_NOSAT /* FhG: SVD complexity optimizations (non-be) */ -#define FIX_1010_OPT_SEC_SINGLE_RESCALE /* FhG: SVD complexity optimizations (non-be) */ -#define FIX_1072_SPEEDUP_matrixTransp2Mul_fx /* FhG: complexity optimization (non-be) */ -#define FIX_1072_REDUCE_DIVS /* FhG: complexity optimization (non-be) */ -#define FIX_ISSUE_1230 /* Ittiam: Fix for issue 1230: Basop Enc audible differences and distortion @16kbps */ -#define NONBE_1211_DTX_BR_SWITCHING /* VA: port float issue 1211: fix crash in MASA DTX bitrate switching */ -#define FIX_1189_GSC_IVAS_OMASA /* VA: Fix for issue 1189: Bitstream desynchornization due to reading/writing of the GSC_IVAS_mode parameter */ -#define NONBE_1273_ISM_METADATA_COUNTER /* VA: BASOP issue 1265, FLP issue 1273: fix counter overflow in ISM metadata encoder */ -#define NONBE_FIX_GSC_BSTR /* VA: issue 1264 FLP (1189 BASOP): Fix bitstream synchronization between encoder and decoder in ACELP GSC in OMASA */ -#define FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF /* FhG: fix for issue 1101: complexity of spar dec upmixer */ /* Note: each compile switch (FIX_1101_...) is independent from the other ones */ -#define FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_USE_MADD_ADD_WEIGHTS /* FhG: Defines 1.0f-weight variables, uses Madd operation instead of L_add_sat */ -#define FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_SPLIT_LOOPS /* FhG: Splits single loop with IF-statements into two low-complex loops */ -#define FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_HQ_CONSTANTS /* FhG: IMPROVE PRECISION: Uses 1/6 and 1/20 in full-precise Q31 constants instead of Q15 */ -#define FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_USE_UNIQUE_SHL /* FhG: Uses unique shift amount in each loop iteration */ -#define FIX_11_1_IVAS_SPAR_DEC_UPMIXER_SF_RND_COEFFS /* FhG ivas_spar_com.c: Zeroes very small negative coeffs via L_shr_r (was L_shr) */ -#define FIX_ISSUE_1237 /* VA: replacement of Copy_Scale_sig_16_32_DEPREC() that are doing 16 bits left shift by Copy_Scale_sig_16_32_no_sat() */ -#define FIX_ISSUE_1237_KEEP_EVS_BE /* VA: Fix to keep EVS bitexactness to 26.444 */ -#define FIX_ISSUE_1214 /* Ittiam: Fix for issue 1214: Energy leakage in IGF tiles for MDCT-stereo @64kbps SWB*/ -#define FIX_881_HILBERT_FILTER /* VA: improve the precision of the Hilbert filter to remove 2kHz unwanted tone */ -#define FIX_ISSUE_1245 /* Ittiam: Fix for issue 1245: Basop Encoder: Audible noise for silent Stereo input DTX on @24.4 kbps, @32 kbps*/ -#define FIX_ISSUE_1291 /* Ittiam: Wrong use of imult1616() in ACELP rescaling */ -#define FIX_920_IGF_INIT_ERROR /* FhG: issue 920: fix bitrate mismatch in initial IGF config to avoid error message in same cases */ -#define FIX_MINOR_SVD_WMOPS_MR1010X /* FhG: Minor WMOPS tuning, bit-exact to previous version, saves about 8.2 WMOPS for MR1010 */ -#define FIX_USAN_ISSUES /* Ittiam: Fix issues reported by USAN */ -#define SVD_WMOPS_OPT /* Ittiam : SVD related optimizations */ -#define NONBE_FIX_1087_OOB_SBA_DTX_RS /* VA: issue 1087: Extend the length of the buffer for MCT decoding to avoid out-of-bound writing in SBA SID bitrate switching decoding */ -#define FIX_ISSUE_1279 /* VA: correction of wrong scaling update */ -#define FIX_ISSUE_1247 -#define NONBE_FIX_1087_OOB_SBA_DTX_RS /* VA: issue 1087: Extend the length of the buffer for MCT decoding to avoid out-of-bound writing in SBA SID bitrate switching decoding */ -#define FIX_1285_DECODER_CRASH -#define FIX_1072_SPEEDUP_gainpanning /* FhG: Minor WMOPS tuning, nonbe */ -#define FIX_1072_SPEEDUP_COMPUTEDIFUSENESS /* FhG: Minor WMOPS tuning, nonbe */ -#define FIX_1320_LOWRATE_ACELP -#define FIX_1297_OVERFLOW /* VA: fixes issue with overflows in pre-processing */ -#define FIX_1298 /* VA: fix possible assert in gaus_enc */ -#define FIX_1300_ICA_SHIFT_QUANT_IMPROV /* VA: Fix to 1300 to improve precision of the lag quantizer */ -#define FIX_1301_CORRECT_TD_CNST /* VA: Fix 1301, correct wrong constant in TD stereo */ -#define NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD /* VA/Eri: FLP issue 1277: Fix Mismatch in DTX high-rate threshold between EVS float and BASOP */ -#define NONBE_FIX_708_OSBA_BR_SWITCHING_CRASH /* FhG: issue 708: fix crash in OSBA BR switching with long test vectors */ //#define OPT_STEREO_32KBPS_V1 /* Optimization made in stereo decoding path for 32kbps decoding */ -#define DOT_PROD_CHOLESKY_64BIT /* FhG: Issue 1323, optimized 64 bit implementation of dot_product_cholesky() */ -#define OPT_BASOP_ADD_v1 /* optimizations to avoid usage of BASOP_Util_Add_MantExp */ -#define FIX_ISSUE_1327 /* Ittiam: Fix for issue 1327: Glitch when stereo is switching from TD to FD*/ -#define NONBE_FIX_1402_WAVEADJUST /* VA: BASOP iisue 1402: fix waveform adjustment decoder PLC */ -#define FIX_ISSUE_1376 /* VA: Fix for issue 1376 (issue with GSC excitation) */ -#define OPT_SBA_AVOID_SPAR_RESCALE /* Optimization made to spar decoder and IGF */ -#define NONBE_FIX_1386_STEREO_DMX_EVS_PHA /* Orange: Fix for stereo DMX / PHA mode : Change the filter taps resolution (Q31->Q30), improve precision for the IR window, for the ILD & IPD smoothing in sub-bands, for the ISD counters and for ICCr. */ -#define FIX_1326_SUBSTITUTE_CMPMANT32EXP /* FhG: Minor WMOPS tuning*/ -#define FIX_1326_SUBSTITUTE_DIV_SQRT_IOSQRT /* FhG: WMOPS tuning */ -#define FIX_1326_SPEEDUP_eig2x2_fx /* FhG: Minor WMOPS tuning*/ #endif diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 70b70859c..71c1590c2 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -881,13 +881,11 @@ Word16 lpc2lsp_fx( Word16 *old_freq, Word16 order ); -#ifdef FIX_ISSUE_1165 Word16 lpc2lsp_ivas_fx( Word32 *a, Word16 *freq, Word16 *old_freq, Word16 order ); -#endif void lsp2lpc_fx( Word16 *a, @@ -4864,9 +4862,7 @@ ivas_error config_acelp1( ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ const Word16 signalling_bits, /* i : number of signalling bits */ const Word16 coder_type, /* i : coder type */ -#ifdef NONBE_FIX_GSC_BSTR const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ -#endif const Word16 tc_subfr, /* i : TC subfr ID */ const Word16 tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ Word16 *nBits_es_Pred, /* o : number of bits for Es_pred Q */ @@ -5854,13 +5850,8 @@ void Inac_switch_ematch_ivas_fx( Word16 dct_exc_tmp[], /* i : GSC excitation in DCT domain */ Word16 lt_ener_per_band[], /* i/o: Long term energy per band Q12 */ const Word16 coder_type, /* i : Coding mode */ -#ifdef NONBE_FIX_GSC_BSTR const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ -#endif const Word16 L_frame, /* i : Frame lenght */ -#ifndef NONBE_FIX_GSC_BSTR - const Word32 core_brate, /* i : Core bit rate */ -#endif const Word16 Q_exc, /* i : input and output format of exc2 */ const Word16 bfi, /* i : frame lost indicator */ const Word16 last_core, /* i : Last core used */ @@ -9753,9 +9744,7 @@ void cldfbSynthesis_ivas_fx( Word32 **imagBuffer_fx, /* i : imag values Qx*/ Word32 *timeOut_fx, /* o : output time domain samples Qx - 1*/ const Word16 samplesToProcess, /* i : number of processed samples */ -#ifdef OPT_SBA_AVOID_SPAR_RESCALE const Word16 shift, /* i : scale for state buffer */ -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ HANDLE_CLDFB_FILTER_BANK h_cldfb /* i : filter bank state */ ); @@ -10995,9 +10984,7 @@ ivas_error config_acelp1_IVAS( ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ const Word16 signaling_bits, /* i : number of signaling bits */ const Word16 coder_type, /* i : coder type */ -#ifdef NONBE_FIX_GSC_BSTR const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ -#endif const Word16 tc_subfr, /* i : TC subfr ID */ const Word16 tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ Word16 *nBits_es_Pred, /* o : number of bits for Es_pred Q */ @@ -11064,9 +11051,7 @@ void calculate_hangover_attenuation_gain_ivas_fx( void init_coder_ace_plus_ivas_fx( Encoder_State *st, /* i : Encoder state */ const Word32 last_total_brate, /* i : last total bitrate */ -#ifdef FIX_920_IGF_INIT_ERROR const Word32 igf_brate, /* i : IGF configuration bitrate */ -#endif const Word16 MCT_flag /* i : hMCT handle allocated (1) or not (0) */ ); diff --git a/lib_com/rom_com.c b/lib_com/rom_com.c index e6f392ff0..551a84feb 100644 --- a/lib_com/rom_com.c +++ b/lib_com/rom_com.c @@ -16790,7 +16790,6 @@ const Word16 GSC_freq_bits[] = 26, 96, 0, 28, 18, 13, 12,10,10, 5, 4, 4, 1, 0, 1, 3, 4, /* ACELP_22k60*/ 26, 96, 0, 28, 18, 13, 12,10,10, 5, 4, 4, 1, 0, 1, 3, 4 /* ACELP_24k40*/ }; // Q0 -#ifdef MOD_BIT_ALLOC_ROM_TABLE const Word32 GSC_freq_bits_fx[] =/*Q18*/ { 5505024, 17563648, -1572864, 6553600, 3932160, 2883584, 2621440, 1310720, 0, 0, 1310720, 1048576, 0, 0, 1048576, 0, 0, /* ACELP_5k00*/ @@ -16823,17 +16822,6 @@ const Word32 GSC_freq_bits_fx_Q18[] =/*Q18*/ 6815744, 25165824, 0, 7340032, 4718592, 3407872, 3145728, 2621440, 2621440, 1310720, 1048576, 1048576, 262144, 0, 262144, 786432, 1048576, 6815744, 25165824, 0, 7340032, 4718592, 3407872, 3145728, 2621440, 2621440, 1310720, 1048576, 1048576, 262144, 0, 262144, 786432, 1048576, }; -#else -const Word32 GSC_freq_bits_fx[] = -{ - 5505024, 17563648, -1572864, 6553600, 3932160, 2883584, 2621440, 1310720, 0, 0, 1310720, 1048576, 0, 0, 1048576, 0, 0, /* ACELP_7k20*/ - 5505024, 19660800, -1048576, 6815744, 4194304, 3145728, 2883584, 2359296, 0, 0, 1048576, 1048576, 262144, 262144, 786432, 0, 0, /* ACELP_8k00*/ - 6815744, 25165824, -1048576, 7340032, 4718592, 3407872, 3145728, 2621440, 2621440, 1310720, 1048576, 1048576, 262144, 0, 262144, 786432, 1048576, /* ACELP_11k60*/ - 6815744, 25165824, -1048576, 7340032, 4718592, 3407872, 3145728, 2621440, 2621440, 1310720, 1048576, 1048576, 262144, 0, 262144, 786432, 1048576, /* ACELP_12k15*/ - 6815744, 25165824, -1048576, 7340032, 4718592, 3407872, 3145728, 2621440, 2621440, 1310720, 1048576, 1048576, 262144, 0, 262144, 786432, 1048576, /* ACELP_12k85*/ - 8126464, 25165824, -1048576, 7340032, 4718592, 3407872, 3145728, 2621440, 2621440, 1310720, 1048576, 1048576, 262144, 0, 262144, 786432, 1048576, /* ACELP_13k20*/ -}; -#endif const Word16 Compl_GSC_freq_bits[] = { 5, 10, 10, 10 /* bitrate > ACELP_16k40 && FS = 16kHz */ diff --git a/lib_com/swb_bwe_com_fx.c b/lib_com/swb_bwe_com_fx.c index eda099cd9..228d43247 100644 --- a/lib_com/swb_bwe_com_fx.c +++ b/lib_com/swb_bwe_com_fx.c @@ -2533,11 +2533,7 @@ void hq_generic_decoding_fx( IF( L_tmp != 0 ) { exp = norm_l( L_tmp ); -#ifdef EVS_FUNC_MODIFIED frac = round_fx_sat( L_shl( L_tmp, exp ) ); /*cs+exp-16 */ -#else - frac = round_fx( L_shl( L_tmp, exp ) ); /*cs+exp-16 */ -#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 */ @@ -2868,11 +2864,7 @@ void hq_generic_decoding_fx( tmp4_fx = mult_r( tmp3_fx, 1638 /* 0.05 in Q15 */ ); WHILE( tmp3_fx > 1024 /* 1 in Q10*/ ) { -#ifdef EVS_FUNC_MODIFIED L_tmp1 = L_shl( Mult_32_16( *pit1_fx, tmp3_fx ), 5 ); /*15 + 5 + 10 -15 */ -#else - L_tmp1 = Mult_32_16( L_shl( *pit1_fx, 5 ), tmp3_fx ); /*15 + 5 + 10 -15 */ -#endif *pit1_fx-- = L_tmp1; move32(); tmp3_fx = sub( tmp3_fx, tmp4_fx ); @@ -3089,11 +3081,7 @@ void hq_generic_decoding_ivas_fx( IF( L_tmp != 0 ) { exp = norm_l( L_tmp ); -#ifdef EVS_FUNC_MODIFIED frac = round_fx_sat( L_shl( L_tmp, exp ) ); /*cs+exp-16 */ -#else - frac = round_fx( L_shl( L_tmp, exp ) ); /*cs+exp-16 */ -#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 */ @@ -3424,11 +3412,7 @@ void hq_generic_decoding_ivas_fx( tmp4_fx = mult_r( tmp3_fx, 1638 /* 0.05 in Q15 */ ); WHILE( tmp3_fx > 1024 /* 1 in Q10*/ ) { -#ifdef EVS_FUNC_MODIFIED L_tmp1 = L_shl( Mult_32_16( *pit1_fx, tmp3_fx ), 5 ); /*15 + 5 + 10 -15 */ -#else - L_tmp1 = Mult_32_16( L_shl( *pit1_fx, 5 ), tmp3_fx ); /*15 + 5 + 10 -15 */ -#endif *pit1_fx-- = L_tmp1; move32(); tmp3_fx = sub( tmp3_fx, tmp4_fx ); diff --git a/lib_com/swb_bwe_com_lr_fx.c b/lib_com/swb_bwe_com_lr_fx.c index d0b8d0100..8fd876f1c 100644 --- a/lib_com/swb_bwe_com_lr_fx.c +++ b/lib_com/swb_bwe_com_lr_fx.c @@ -2366,11 +2366,7 @@ void ton_ene_est_fx( exp_normn = norm_s( peak_fx[k] ); fac_fx = div_s( shl( temp2_fx, exp_normd ), shl( peak_fx[k], exp_normn ) ); -#ifdef FIX_ISSUE_1062_AND_1068_TON_ENE_EST_FX fac_fx = shl_sat( fac_fx, sub( add( Qss, exp_normn ), add( Qtemp2, exp_normd ) ) ); /* Qtemp2+exp_normd-(Qss+exp_normn)+15 -> 15*/ -#else - fac_fx = shl( fac_fx, sub( add( Qss, exp_normn ), add( Qtemp2, exp_normd ) ) ); /* Qtemp2+exp_normd-(Qss+exp_normn)+15 -> 15*/ -#endif } ni_gain_fx[k] = mult_r( avg_pe_fx[k], fac_fx ); /* Qavg_pe[k] */ diff --git a/lib_com/swb_tbe_com_fx.c b/lib_com/swb_tbe_com_fx.c index 04b6ba187..2a2841966 100644 --- a/lib_com/swb_tbe_com_fx.c +++ b/lib_com/swb_tbe_com_fx.c @@ -1036,11 +1036,7 @@ static void filt_mu_fx( FOR( n = 0; n < SubFrameLength; n++ ) { temp = mult_r( mu, ( *ptrs++ ) ); -#ifdef FIX_ISSUE_1155 temp = add_sat( temp, *ptrs ); /*Q12 */ -#else - temp = add( temp, *ptrs ); /*Q12 */ -#endif sig_out[n] = shl_o( mult_r( ga, temp ), 1, &Overflow ); move16(); /*Q12 */ } @@ -5087,7 +5083,6 @@ void GenSHBSynth_fx32( Word32 speech_buf_32k[L_FRAME32k]; Word16 i; -#ifdef FIX_881_HILBERT_FILTER Word16 shift = 0; Word32 maxm32, input_synspeech_temp[L_FRAME16k]; move16(); @@ -5123,9 +5118,6 @@ void GenSHBSynth_fx32( } Interpolate_allpass_steep_fx32( input_synspeech_temp, state_lsyn_filt_shb_local, L_FRAME16k, speech_buf_32k ); -#else - Interpolate_allpass_steep_fx32( input_synspeech, state_lsyn_filt_shb_local, L_FRAME16k, speech_buf_32k ); -#endif IF( EQ_16( L_frame, L_FRAME ) ) { @@ -5148,14 +5140,12 @@ void GenSHBSynth_fx32( } } -#ifdef FIX_881_HILBERT_FILTER IF( maxm32 != 0 ) { Scale_sig32( shb_syn_speech_32k, L_FRAME32k, negate( shift ) ); Scale_sig32( state_lsyn_filt_shb_local, 2 * ALLPASSSECTIONS_STEEP, negate( shift ) ); Scale_sig32( Hilbert_Mem, HILBERT_MEM_SIZE, negate( shift ) ); } -#endif return; } diff --git a/lib_com/tcq_position_arith_fx.c b/lib_com/tcq_position_arith_fx.c index 0466dc133..3abd527ca 100644 --- a/lib_com/tcq_position_arith_fx.c +++ b/lib_com/tcq_position_arith_fx.c @@ -1983,11 +1983,7 @@ Word32 encode_magnitude_tcq_fx( move16(); bits_fx = L_deposit_l( 0 ); -#ifdef IVAS_ISSUE_1188_EVS_CRASH tcq_bits_fx = L_sub( table_logcum_fx[npulses], L_add( table_logcum_fx[nzpos], table_logcum_fx[npulses - ( nzpos - 1 )] ) ); -#else - tcq_bits_fx = L_sub( table_logcum_fx[npulses], L_add( table_logcum_fx[nzpos], table_logcum_fx[npulses - nzpos - 1] ) ); -#endif *est_frame_bits_fx = L_add( *est_frame_bits_fx, tcq_bits_fx ); move32(); @@ -2470,11 +2466,7 @@ void decode_mangitude_tcq_fx( move16(); bits_fx = L_deposit_l( 0 ); -#ifdef IVAS_ISSUE_1188_EVS_CRASH tcq_bits_fx = L_sub( table_logcum_fx[npulses], L_add( table_logcum_fx[nzpos], table_logcum_fx[npulses - ( nzpos - 1 )] ) ); -#else - tcq_bits_fx = L_sub( table_logcum_fx[npulses], L_add( table_logcum_fx[nzpos], table_logcum_fx[npulses - nzpos - 1] ) ); -#endif IF( EQ_16( nzpos, npulses ) ) { diff --git a/lib_com/tcx_mdct_fx.c b/lib_com/tcx_mdct_fx.c index 1fc57871d..b2cee32e6 100644 --- a/lib_com/tcx_mdct_fx.c +++ b/lib_com/tcx_mdct_fx.c @@ -106,9 +106,7 @@ void TCX_MDCT( Word16 i; Word16 factor, neg_factor; Word16 factor_e; -#ifdef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING (void) element_mode; -#endif #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); @@ -164,9 +162,7 @@ void TCX_MDST( Word16 i; Word16 factor, neg_factor; Word16 factor_e; -#ifdef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING (void) element_mode; -#endif #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); @@ -226,9 +222,7 @@ void TCX_MDCT_Inverse( Word16 L2 = l, R2 = r; Word32 tmp_buf[N_MAX + L_MDCT_OVLP_MAX / 2]; Word16 fac_e; -#ifdef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING (void) element_mode; -#endif L2 = shr( l, 1 ); R2 = shr( r, 1 ); diff --git a/lib_com/tools.c b/lib_com/tools.c index e4ccd9955..b1a9f4d13 100644 --- a/lib_com/tools.c +++ b/lib_com/tools.c @@ -628,45 +628,23 @@ Word16 minimum_s( Word16 *min_val /* o : minimum value in the input vector */ ) { -#ifdef FIX_1105_OPT_MINIMUM_SL Word16 i, ind; -#else - Word16 i, ind, tmp; -#endif ind = 0; move16(); -#ifndef FIX_1105_OPT_MINIMUM_SL - tmp = vec[0]; - move16(); -#endif FOR( i = 1; i < lvec; i++ ) { -#ifdef FIX_1105_OPT_MINIMUM_SL if ( LT_16( vec[i], vec[ind] ) ) { ind = i; move16(); } -#else - IF( LT_16( vec[i], tmp ) ) - { - ind = i; - move16(); - tmp = vec[i]; - move16(); - } -#endif } if ( min_val != NULL ) { -#ifdef FIX_1105_OPT_MINIMUM_SL *min_val = vec[ind]; -#else - *min_val = tmp; -#endif move16(); } @@ -687,45 +665,22 @@ Word16 minimum_l( ) { Word16 i, ind; -#ifndef FIX_1105_OPT_MINIMUM_SL - Word32 tmp; -#endif ind = 0; -#ifndef FIX_1105_OPT_MINIMUM_SL - tmp = vec[0]; -#endif move16(); -#ifndef FIX_1105_OPT_MINIMUM_SL - move32(); -#endif FOR( i = 1; i < lvec; i++ ) { -#ifdef FIX_1105_OPT_MINIMUM_SL if ( LT_32( vec[i], vec[ind] ) ) { ind = i; move16(); } -#else - IF( LT_32( vec[i], tmp ) ) - { - ind = i; - tmp = vec[i]; - move16(); - move32(); - } -#endif } if ( min_val != NULL ) { -#ifdef FIX_1105_OPT_MINIMUM_SL *min_val = vec[ind]; -#else - *min_val = tmp; -#endif move32(); } diff --git a/lib_com/tools_fx.c b/lib_com/tools_fx.c index fad2d64a8..d403c583d 100644 --- a/lib_com/tools_fx.c +++ b/lib_com/tools_fx.c @@ -483,16 +483,10 @@ void Copy( move16(); } -#ifdef FIX_1052_COPY_CMPLX_DISCREPANCY /* Location of x and y may differ depending on platform/memory allocation. Since IF and ELSE has different complexity count, the early return is used instead of ELSE to ensure the same complexity number regardless of x and y memory addresses. */ return; -#endif } -#ifndef FIX_1052_COPY_CMPLX_DISCREPANCY - ELSE - { -#endif FOR( i = L - 1; i >= 0; i-- ) { y[i] = x[i]; @@ -500,9 +494,6 @@ void Copy( } return; -#ifndef FIX_1052_COPY_CMPLX_DISCREPANCY - } -#endif } /*-------------------------------------------------------------------* * Copy64: @@ -524,16 +515,10 @@ void Copy64( move64(); } -#ifdef FIX_1052_COPY_CMPLX_DISCREPANCY /* Location of x and y may differ depending on platform/memory allocation. Since IF and ELSE has different complexity count, the early return is used instead of ELSE to ensure the same complexity number regardless of x and y memory addresses. */ return; -#endif } -#ifndef FIX_1052_COPY_CMPLX_DISCREPANCY - ELSE - { -#endif FOR( i = L - 1; i >= 0; i-- ) { y[i] = x[i]; @@ -541,9 +526,6 @@ void Copy64( } return; -#ifndef FIX_1052_COPY_CMPLX_DISCREPANCY - } -#endif } void set64_fx( @@ -580,16 +562,10 @@ void Copy_pword( move16(); } -#ifdef FIX_1052_COPY_CMPLX_DISCREPANCY /* Location of x and y may differ depending on platform/memory allocation. Since IF and ELSE has different complexity count, the early return is used instead of ELSE to ensure the same complexity number regardless of x and y memory addresses. */ return; -#endif } -#ifndef FIX_1052_COPY_CMPLX_DISCREPANCY - ELSE - { -#endif FOR( i = L - 1; i >= 0; i-- ) { y[i].v.im = x[i].v.im; @@ -599,9 +575,6 @@ void Copy_pword( } return; -#ifndef FIX_1052_COPY_CMPLX_DISCREPANCY - } -#endif } /*-------------------------------------------------------------------* * Copy32: @@ -623,23 +596,14 @@ void Copy32( move32(); } -#ifdef FIX_1052_COPY_CMPLX_DISCREPANCY return; -#endif } -#ifndef FIX_1052_COPY_CMPLX_DISCREPANCY - ELSE - { -#endif FOR( i = L - 1; i >= 0; i-- ) { y[i] = x[i]; move32(); } -#ifndef FIX_1052_COPY_CMPLX_DISCREPANCY - } -#endif } void set8_fx( @@ -688,7 +652,6 @@ void set32_fx( const Word16 N /* i : Lenght of the vector */ ) { -#ifdef FIX_1106_SIMPLIFY_SET32FX Word16 i; FOR( i = 0; i < N; i++ ) @@ -696,26 +659,6 @@ void set32_fx( y[i] = a; move32(); } -#else - Word16 i, tmp; - tmp = extract_l( a ); - IF( EQ_32( L_deposit_l( tmp ), a ) ) - { - FOR( i = 0; i < N; i++ ) - { - y[i] = L_deposit_l( tmp ); - move32(); - } - } - ELSE - { - FOR( i = 0; i < N; i++ ) - { - y[i] = a; - move32(); - } - } -#endif return; } @@ -801,7 +744,6 @@ void Copy_Scale_sig_16_32_DEPREC( } return; } -#ifdef FIX_ISSUE_1237 #ifdef DEBUGGING if ( exp0 >= 16 ) { @@ -809,7 +751,6 @@ void Copy_Scale_sig_16_32_DEPREC( } #else assert( exp0 < 16 ); -#endif #endif tmp = shl_o( 1, exp0, &Overflow ); FOR( i = 0; i < lg; i++ ) diff --git a/lib_com/trans_direct_fx.c b/lib_com/trans_direct_fx.c index d4792fb75..6a3cdf108 100644 --- a/lib_com/trans_direct_fx.c +++ b/lib_com/trans_direct_fx.c @@ -40,9 +40,7 @@ void direct_transform_fx( Word16 shift, Qmin = 31; Word32 L_tmp; Word16 Qs[NUM_TIME_SWITCHING_BLOCKS]; -#ifdef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING (void) ( element_mode ); -#endif move16(); segment_length = shr( L, 1 ); diff --git a/lib_com/trans_inv_fx.c b/lib_com/trans_inv_fx.c index 0033e2c9e..0683e266c 100644 --- a/lib_com/trans_inv_fx.c +++ b/lib_com/trans_inv_fx.c @@ -515,11 +515,7 @@ void preecho_sb_fx( tmp_fx1 = norm_l( es_mdct_hb_fx[i] ); tmp_fxL1 = L_shl( es_mdct_hb_fx[i], tmp_fx1 ); tmp_fxL2 = L_shl( mean_prev_hb_fx_loc, tmp_fx1 ); -#ifdef FIX_1013_CRASH_HQ_CORE_DEC tmp_fx1 = round_fx_sat( tmp_fxL1 ); -#else - tmp_fx1 = round_fx( tmp_fxL1 ); -#endif tmp_fx2 = round_fx( tmp_fxL2 ); tmp_fx3 = div_s( tmp_fx2, tmp_fx1 ); min_g_hb_fx[i] = Frac_sqrt( tmp_fx3 ); @@ -996,9 +992,7 @@ void Inverse_Transform( Word16 segment_length_div2, segment_length_div4; Word16 tmp, q_out; Word32 L_temp; -#ifdef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING (void) ( element_mode ); -#endif /* This value is used to right shift all vectors returned by 'iedct_short_fx()' */ /* to bring them to a scaling that is equal to the 1st 'Q' returned by the 1st */ /* call to 'iedct_short_fx()' minus these guard bits. */ diff --git a/lib_dec/FEC_HQ_phase_ecu_fx.c b/lib_dec/FEC_HQ_phase_ecu_fx.c index 34d01d7fe..74f1bfc09 100644 --- a/lib_dec/FEC_HQ_phase_ecu_fx.c +++ b/lib_dec/FEC_HQ_phase_ecu_fx.c @@ -1590,11 +1590,7 @@ static void ivas_spec_ana_fx( test(); IF( n > 0 && *pPlocs == 0 ) /* Very 1st peak position possible to have a peak at 0/DC index position. */ { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( &xfp[*pPlocs], xfp_32, 3, Q15 ); // Q + 15 -#else - Copy_Scale_sig_16_32_DEPREC( &xfp[*pPlocs], xfp_32, 3, Q16 ); // Q + 16 -#endif acc = L_deposit_h( *pPlocs ); // Q16 *pPlocsi++ = L_add( acc, L_shl( imax_pos_fx( xfp_32 ) /* Q15 */, 1 ) ); // Q16 move32(); @@ -1605,11 +1601,7 @@ static void ivas_spec_ana_fx( test(); IF( n > 0 && EQ_16( *pPlocs, 1 ) ) /* Also 2nd peak position uses DC which makes jacobsen unsuitable. */ { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( &xfp[*pPlocs - 1], xfp_32, 3, Q15 ); // Q + 15 -#else - Copy_Scale_sig_16_32_DEPREC( &xfp[*pPlocs - 1], xfp_32, 3, Q16 ); // Q + 16 -#endif acc = L_deposit_h( sub( *pPlocs, 1 ) ); // Q16 *pPlocsi++ = L_add( acc, L_shl( imax_pos_fx( xfp_32 ) /* Q15 */, 1 ) ); // Q16 move32(); @@ -1655,11 +1647,7 @@ static void ivas_spec_ana_fx( IF( EQ_16( currPlocs, ( sub( Lprot2_1, DELTA_CORR_F0_INT ) ) ) ) /* Also 2nd last peak position uses fs/2 which makes jacobsen less suitable. */ { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( &xfp[currPlocs - 1], xfp_32, 3, Q15 ); // Q + 15 -#else - Copy_Scale_sig_16_32_DEPREC( &xfp[currPlocs - 1], xfp_32, 3, Q16 ); // Q + 16 -#endif acc = L_deposit_h( sub( currPlocs, 1 ) ); // Q16 *pPlocsi++ = L_add( acc, L_shl( imax_pos_fx( xfp_32 ) /* Q15 */, 1 ) ); // Q16 move32(); @@ -1673,11 +1661,7 @@ static void ivas_spec_ana_fx( * whould point */ IF( n > 0 ) /* fs/2 which makes special case . */ { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( &xfp[currPlocs - 2], xfp_32, 3, Q15 ); // Q + 15 -#else - Copy_Scale_sig_16_32_DEPREC( &xfp[currPlocs - 2], xfp_32, 3, Q16 ); // Q + 16 -#endif acc = L_deposit_h( sub( currPlocs, 2 ) ); // Q16 *pPlocsi++ = L_add( acc, L_shl( imax_pos_fx( xfp_32 ) /* Q15 */, 1 ) ); // Q16 move32(); @@ -4005,11 +3989,7 @@ static void ivas_fec_ecu_dft_fx( tmp = Exp16Array( *Nfft, Tfr16 ); *exp = add( tmp, add( 2, norm_s( *Nfft ) ) ); move16(); -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( Tfr16, Tfr32, *Nfft, *exp ); /*Qin+exp; */ -#else - Copy_Scale_sig_16_32_DEPREC( Tfr16, Tfr32, *Nfft, *exp ); /*Qin+exp; */ -#endif *exp = s_min( *exp, 15 ); DoRTFTn_fx( Tfr32, Tfi32, *Nfft ); @@ -4125,20 +4105,12 @@ static void fec_ecu_dft_fx( tmp = Exp16Array( *Nfft, Tfr16 ); *exp = add( tmp, add( 2, norm_s( *Nfft ) ) ); move16(); -#ifdef FIX_ISSUE_1237 { -#ifdef FIX_ISSUE_1237_KEEP_EVS_BE Word16 loctmp = *exp; move16(); loctmp = s_min( 15, loctmp ); Copy_Scale_sig_16_32_DEPREC( Tfr16, Tfr32, *Nfft, loctmp ); /*Qin+exp; */ /*Even with limiting loctmp, if Copy_Scale_sig_16_32_no_sat() is used, can lead to 1 difference */ -#else - Copy_Scale_sig_16_32_no_sat( Tfr16, Tfr32, *Nfft, *exp ); /*Qin+exp; */ -#endif } -#else - Copy_Scale_sig_16_32_DEPREC( Tfr16, Tfr32, *Nfft, *exp ); /*Qin+exp; */ -#endif DoRTFTn_fx( Tfr32, Tfi32, *Nfft ); N_LP = shr( *Nfft, 1 ); diff --git a/lib_dec/FEC_fx.c b/lib_dec/FEC_fx.c index 35bb254af..612816efd 100644 --- a/lib_dec/FEC_fx.c +++ b/lib_dec/FEC_fx.c @@ -504,11 +504,7 @@ void FEC_exc_estim_fx( test(); test(); test(); -#ifdef NONBE_FIX_GSC_BSTR IF( EQ_16( st_fx->last_coder_type, AUDIO ) || ( EQ_16( st_fx->last_good, INACTIVE_CLAS ) && st_fx->inactive_coder_type_flag && !st_fx->Opt_AMR_WB ) ) -#else - IF( EQ_16( st_fx->last_coder_type, AUDIO ) || ( EQ_16( st_fx->last_good, INACTIVE_CLAS ) && LE_32( st_fx->total_brate, MAX_GSC_INACTIVE_BRATE ) && !st_fx->Opt_AMR_WB ) ) -#endif { st_fx->GSC_noisy_speech = st_fx->Last_GSC_noisy_speech_flag; move16(); @@ -670,11 +666,7 @@ void FEC_exc_estim_fx( test(); test(); test(); -#ifdef NONBE_FIX_GSC_BSTR IF( EQ_16( st_fx->last_coder_type, AUDIO ) || ( EQ_16( st_fx->last_good, INACTIVE_CLAS ) && st_fx->inactive_coder_type_flag && !st_fx->Opt_AMR_WB ) ) -#else - IF( ( EQ_16( st_fx->last_coder_type, AUDIO ) || EQ_16( st_fx->last_good, INACTIVE_CLAS ) ) && LE_32( st_fx->total_brate, MAX_GSC_INACTIVE_BRATE ) && !st_fx->Opt_AMR_WB ) -#endif { /* For GSC - the excitation is already computed */ Copy( exc, exc2, st_fx->L_frame ); diff --git a/lib_dec/TonalComponentDetection_fx.c b/lib_dec/TonalComponentDetection_fx.c index e50abddd6..e820f1399 100644 --- a/lib_dec/TonalComponentDetection_fx.c +++ b/lib_dec/TonalComponentDetection_fx.c @@ -76,13 +76,11 @@ void ivas_DetectTonalComponents_fx( pScaledMdctSpectrum[i] = L_shl( lastMDCTSpectrum[i], 16 ); /*15-lastMDCTSpectrum_exp+16 -> 31 - lastMDCTSpectrum_exp*/ move32(); } -#ifdef MSAN_FIX FOR( Word16 i = 0; i < FDNS_NPTS; i++ ) { sns_int_scf_fx[i] = L_shl_sat( scaleFactors[i], add( 1, scaleFactors_exp[i] ) ); // Q16 move32(); } -#endif IF( psychParamsCurrent == NULL ) { nBands = FDNS_NPTS; @@ -94,12 +92,6 @@ void ivas_DetectTonalComponents_fx( } ELSE { -#ifndef MSAN_FIX - FOR( Word16 i = 0; i < FDNS_NPTS; i++ ) - { - sns_int_scf_fx[i] = L_shl( scaleFactors[i], add( 1, scaleFactors_exp[i] ) ); // Q16 - } -#endif q_pScaledMdctSpectrum = sub( 31, lastMDCTSpectrum_exp ); sns_shape_spectrum_fx( pScaledMdctSpectrum, &q_pScaledMdctSpectrum, psychParamsCurrent, sns_int_scf_fx, 16, nSamplesCore, NULL ); q_pScaledMdctSpectrum = add( q_pScaledMdctSpectrum, 1 ); diff --git a/lib_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index 0f94a7558..7a3c78644 100644 --- a/lib_dec/acelp_core_dec_fx.c +++ b/lib_dec/acelp_core_dec_fx.c @@ -113,7 +113,6 @@ ivas_error acelp_core_dec_fx( FD_BWE_DEC_HANDLE hBWE_FD; TCX_DEC_HANDLE hTcxDec; ivas_error error; -#ifdef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING (void) ( tdm_lspQ_PCh ); (void) ( tdm_lsfQ_PCh ); (void) ( use_cldfb_for_dft ); @@ -125,7 +124,6 @@ ivas_error acelp_core_dec_fx( (void) ( output ); (void) ( read_sid_info ); (void) hStereoCng; -#endif hMusicPF = st_fx->hMusicPF; hBPF = st_fx->hBPF; hBWE_TD = st_fx->hBWE_TD; @@ -666,21 +664,13 @@ ivas_error acelp_core_dec_fx( move16(); } -#ifdef NONBE_FIX_GSC_BSTR config_acelp1( DEC, st_fx->total_brate, st_fx->core_brate, st_fx->core, st_fx->extl_orig, st_fx->extl_brate_orig, st_fx->L_frame, st_fx->GSC_noisy_speech, &( st_fx->acelp_cfg ), st_fx->next_bit_pos, st_fx->coder_type, st_fx->inactive_coder_type_flag, tc_subfr_tmp, 1, &nb_bits, unbits, st_fx->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st_fx->idchan, st_fx->active_cnt, tdm_Pitch_reuse_flag, st_fx->tdm_LRTD_flag, st_fx->GSC_IVAS_mode ); -#else - config_acelp1( DEC, st_fx->total_brate, st_fx->core_brate, st_fx->core, st_fx->extl_orig, st_fx->extl_brate_orig, st_fx->L_frame, st_fx->GSC_noisy_speech, &( st_fx->acelp_cfg ), st_fx->next_bit_pos, st_fx->coder_type, tc_subfr_tmp, 1, &nb_bits, unbits, st_fx->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st_fx->idchan, st_fx->active_cnt, tdm_Pitch_reuse_flag, st_fx->tdm_LRTD_flag, st_fx->GSC_IVAS_mode ); -#endif test(); test(); IF( EQ_16( st_fx->coder_type, TRANSITION ) && LT_16( tc_subfr_fx, L_SUBFR ) && EQ_16( st_fx->L_frame, L_FRAME ) ) { -#ifdef NONBE_FIX_GSC_BSTR config_acelp1( DEC, st_fx->total_brate, st_fx->core_brate, st_fx->core, st_fx->extl_orig, st_fx->extl_brate_orig, st_fx->L_frame, -1, &( st_fx->acelp_cfg ), st_fx->next_bit_pos, TRANSITION, -1, tc_subfr_fx, 2, &nb_bits, unbits, st_fx->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st_fx->idchan, st_fx->active_cnt, tdm_Pitch_reuse_flag, st_fx->tdm_LRTD_flag, st_fx->GSC_IVAS_mode ); -#else - config_acelp1( DEC, st_fx->total_brate, st_fx->core_brate, st_fx->core, st_fx->extl_orig, st_fx->extl_brate_orig, st_fx->L_frame, -1, &( st_fx->acelp_cfg ), st_fx->next_bit_pos, st_fx->coder_type, tc_subfr_fx, 2, &nb_bits, unbits, st_fx->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st_fx->idchan, st_fx->active_cnt, tdm_Pitch_reuse_flag, st_fx->tdm_LRTD_flag, st_fx->GSC_IVAS_mode ); -#endif } } diff --git a/lib_dec/acelp_core_dec_ivas_fx.c b/lib_dec/acelp_core_dec_ivas_fx.c index 2ca524bb0..5807f2c67 100644 --- a/lib_dec/acelp_core_dec_ivas_fx.c +++ b/lib_dec/acelp_core_dec_ivas_fx.c @@ -83,22 +83,14 @@ ivas_error acelp_core_dec_ivas_fx( Word16 lsf_new_fx[M]; /* LSFs at the end of the frame Qlog2(2.56) */ Word16 lsp_new_fx[M]; /* LSPs at the end of the frame Q15 */ Word16 lsp_mid_fx[M]; /* LSPs in the middle of the frame */ -#ifdef MSAN_FIX Word16 Aq_fx[NB_SUBFR16k * ( M + 1 )]; /* A(q) quantized for the 4 subframes */ -#else - Word16 Aq_fx[NB_SUBFR16k * ( M + 1 )]; /* A(q) quantized for the 4 subframes */ -#endif Word16 old_exc2_fx[L_FRAME16k + L_EXC_MEM], *exc2_fx; /* total excitation buffer */ Word16 mem_tmp_fx[M]; /* temporary synthesis filter memory */ Word32 enr_q_fx; /* E information for FER protection */ Word16 tmp_noise_fx; /* Long term temporary noise energy */ Word16 Es_pred_fx; /* predicted scaled innov. energy Q8 */ Word16 FEC_pitch_fx; /* FEC pitch */ -#ifdef MSAN_FIX Word16 old_bwe_exc_fx[( ( PIT16k_MAX + ( L_FRAME16k + 1 ) + L_SUBFR16k ) * 2 )]; /* excitation buffer */ -#else - Word16 old_bwe_exc_fx[( ( PIT16k_MAX + ( L_FRAME16k + 1 ) + L_SUBFR16k ) * 2 )]; /* excitation buffer */ -#endif Word16 *bwe_exc_fx; /* Excitation for SWB TBE */ Word16 i, j, int_fs; Word16 tc_subfr; @@ -133,13 +125,9 @@ ivas_error acelp_core_dec_ivas_fx( ivas_error error; Word32 bpf_error_signal_fx[L_FRAME16k]; -#ifdef MSAN_FIX set32_fx( bpf_error_signal_fx, 0, L_FRAME16k ); -#endif Word16 bpf_error_signal_16fx[L_FRAME16k]; -#ifdef MSAN_FIX set16_fx( bpf_error_signal_16fx, 0, L_FRAME16k ); -#endif set16_fx( Aq_fx, 0, NB_SUBFR16k * ( M + 1 ) ); set16_fx( old_bwe_exc_fx, 0, ( ( PIT16k_MAX + ( L_FRAME16k + 1 ) + L_SUBFR16k ) * 2 ) ); Word16 tmp; @@ -178,7 +166,6 @@ ivas_error acelp_core_dec_ivas_fx( IF( EQ_32( st->core_brate, SID_2k40 ) ) { FdCng_decodeSID_ivas_fx( st ); -#ifdef FIX_ISSUE_1218 Word16 n1, n2; n1 = L_norm_arr( st->hFdCngDec->hFdCngCom->sidNoiseEst, NPART ); n2 = L_norm_arr( st->hFdCngDec->hFdCngCom->sidNoiseEstLp, NPART ); @@ -188,9 +175,6 @@ ivas_error acelp_core_dec_ivas_fx( scale_sig32( st->hFdCngDec->hFdCngCom->sidNoiseEstLp, NPART, sub( old_NoiseEstExp, common_e ) ); st->hFdCngDec->hFdCngCom->sidNoiseEstExp = common_e; move16(); -#else - rescale_fdCngDec( st->hFdCngDec, sub( old_NoiseEstExp, st->hFdCngDec->hFdCngCom->sidNoiseEstExp ) ); -#endif } FOR( i = 0; i < NPART; i++ ) { @@ -621,11 +605,7 @@ ivas_error acelp_core_dec_ivas_fx( { test(); test(); -#ifdef FIX_1189_GSC_IVAS_OMASA IF( EQ_16( st->coder_type, AUDIO ) || ( EQ_16( st->coder_type, INACTIVE ) && EQ_16( st->inactive_coder_type_flag, 1 ) ) ) -#else - IF( EQ_16( st->coder_type, AUDIO ) || ( st->coder_type == INACTIVE && LE_32( st->total_brate, MAX_GSC_INACTIVE_BRATE ) ) ) -#endif { st->GSC_IVAS_mode = get_next_indice_fx( st, 2 ); move16(); @@ -642,14 +622,6 @@ ivas_error acelp_core_dec_ivas_fx( IF( st->cng_type == LP_CNG ) { CNG_dec_ivas_fx( st, last_element_mode, Aq_fx, lsp_new_fx, lsf_new_fx, &allow_cn_step, sid_bw, q_env_fx ); -#ifndef FIX_1100_REMOVE_LPC_RESCALING - FOR( Word32 nsf = 0; nsf < NB_SUBFR16k; nsf++ ) - { - Scale_sig( Aq_fx + imult3216( nsf, ( M + 1 ) ), M + 1, sub( norm_s( Aq_fx[nsf * ( M + 1 )] ), Q2 ) ); - Aq_fx[nsf * ( M + 1 )] = ONE_IN_Q12; - move16(); - } -#endif Copy( Aq_fx, st->Aq_cng, add( M, 1 ) ); /* comfort noise generation */ @@ -746,11 +718,7 @@ ivas_error acelp_core_dec_ivas_fx( IF( st->hMusicPF && st->hGSCDec ) { Rescale_exc( st->hMusicPF->dct_post_old_exc_fx, exc_fx, bwe_exc_fx, st->hGSCDec->last_exc_dct_in_fx, st->L_frame, -#ifdef FIX_ISSUE_1291 L_FRAME32k, 0, &( st->Q_exc ), st->Q_subfr, NULL, 0, INACTIVE ); -#else - imult1616( st->L_frame, HIBND_ACB_L_FAC ), 0, &( st->Q_exc ), st->Q_subfr, NULL, 0, INACTIVE ); -#endif } IF( st->hPFstat != NULL ) { @@ -781,9 +749,6 @@ ivas_error acelp_core_dec_ivas_fx( /* synthesis at 12.8kHz sampling rate */ -#ifndef FIX_1100_REMOVE_LPC_RESCALING - Aq_fx[0] = ONE_IN_Q12; -#endif move16(); syn_12k8_fx( st->L_frame, Aq_fx, exc2_fx, psyn_fx, st->mem_syn2_fx, 1, st->Q_exc, st->Q_syn ); syn_12k8_fx( st->L_frame, Aq_fx, exc3_fx, syn1_fx, st->mem_syn3_fx, 1, st->Q_exc, st->Q_syn ); @@ -804,11 +769,7 @@ ivas_error acelp_core_dec_ivas_fx( Copy_Scale_sig( syn1_fx, temp_buf_fx, st->L_frame, sub( -1, st->Q_syn ) ); // Q_syn -> Q(-1) IF( st->hBWE_FD != NULL ) { -#ifdef FIX_ISSUE_1290 save_old_syn_fx( st->L_frame, temp_buf_fx, old_syn_12k8_16k_fx, st->hBWE_FD->old_syn_12k8_16k_fx, st->preemph_fac, &st->hBWE_FD->mem_deemph_old_syn_fx ); -#else - save_old_syn_fx( st->L_frame, syn1_fx, old_syn_12k8_16k_fx, st->hBWE_FD->old_syn_12k8_16k_fx, st->preemph_fac, &st->hBWE_FD->mem_deemph_old_syn_fx ); -#endif } } @@ -848,21 +809,13 @@ ivas_error acelp_core_dec_ivas_fx( move16(); } -#ifdef NONBE_FIX_GSC_BSTR config_acelp1_IVAS( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, st->inactive_coder_type_flag, tc_subfr_tmp, 1, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1_IVAS( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, tc_subfr_tmp, 1, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif test(); test(); IF( EQ_16( st->coder_type, TRANSITION ) && LT_16( tc_subfr, L_SUBFR ) && EQ_16( st->L_frame, L_FRAME ) ) { -#ifdef NONBE_FIX_GSC_BSTR config_acelp1_IVAS( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, TRANSITION, -1, tc_subfr, 2, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1_IVAS( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, tc_subfr, 2, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif } } @@ -944,18 +897,6 @@ ivas_error acelp_core_dec_ivas_fx( st->stab_fac_fx = lsf_stab_ivas_fx( lsf_new_fx, st->lsf_old_fx, 0, st->L_frame ); move16(); } -#ifndef FIX_1100_REMOVE_LPC_RESCALING -#ifndef MSAN_FIX - for ( int nsf = 0; nsf < NB_SUBFR16k; nsf++ ) -#else - FOR( Word32 nsf = 0; nsf < st->nb_subfr; nsf++ ) -#endif - { - Scale_sig( Aq_fx + imult3216( nsf, ( M + 1 ) ), M + 1, sub( norm_s( Aq_fx[nsf * ( M + 1 )] ), Q2 ) ); // Q(x-2) - Aq_fx[nsf * ( M + 1 )] = ONE_IN_Q12; - move16(); - } -#endif test(); IF( EQ_16( st->last_core, HQ_CORE ) && st->element_mode > EVS_MONO ) { @@ -1129,11 +1070,7 @@ ivas_error acelp_core_dec_ivas_fx( * Apply energy matching when switching to inactive frames *-----------------------------------------------------------------*/ -#ifdef NONBE_FIX_GSC_BSTR Inac_switch_ematch_ivas_fx( exc2_fx, dct_exc_tmp_fx, st->hGSCDec->lt_ener_per_band_fx, st->coder_type, st->inactive_coder_type_flag, st->L_frame, st->Q_exc, st->bfi, st->last_core, st->last_codec_mode, tdm_low_rate_mode, st->element_mode ); -#else - Inac_switch_ematch_ivas_fx( exc2_fx, dct_exc_tmp_fx, st->hGSCDec->lt_ener_per_band_fx, st->coder_type, st->L_frame, st->total_brate, st->Q_exc, st->bfi, st->last_core, st->last_codec_mode, tdm_low_rate_mode, st->element_mode ); -#endif /*------------------------------------------------------------* * Decode information and modify the excitation signal of stationary unvoiced frames @@ -1291,18 +1228,6 @@ ivas_error acelp_core_dec_ivas_fx( lsf_dec_bfi( MODE1, lsf_new_fx, st->lsf_old_fx, st->lsf_adaptive_mean_fx, NULL, st->mem_MA_fx, st->mem_AR_fx, st->stab_fac_fx, st->last_coder_type, st->L_frame, st->last_good, st->nbLostCmpt, 0, NULL, NULL, NULL, st->hGSCDec->Last_GSC_pit_band_idx, st->Opt_AMR_WB, 0, st->bwidth ); FEC_lsf2lsp_interp( st, st->L_frame, Aq_fx, lsf_new_fx, lsp_new_fx ); -#ifndef FIX_1100_REMOVE_LPC_RESCALING -#ifndef MSAN_FIX - for ( int nsf = 0; nsf < NB_SUBFR16k; nsf++ ) -#else - FOR( Word32 nsf = 0; nsf < st->nb_subfr; nsf++ ) -#endif - { - Scale_sig( Aq_fx + imult3216( nsf, ( M + 1 ) ), M + 1, sub( norm_s( Aq_fx[nsf * ( M + 1 )] ), Q2 ) ); // Qx->Q(x-2) - Aq_fx[nsf * ( M + 1 )] = ONE_IN_Q12; - move16(); - } -#endif IF( EQ_16( st->nelp_mode_dec, 1 ) ) { /* SC-VBR */ @@ -1340,11 +1265,7 @@ ivas_error acelp_core_dec_ivas_fx( } /* Apply energy matching when switching to inactive frames */ -#ifdef NONBE_FIX_GSC_BSTR Inac_switch_ematch_ivas_fx( exc2_fx, dct_exc_tmp_fx, st->hGSCDec->lt_ener_per_band_fx, st->coder_type, st->inactive_coder_type_flag, st->L_frame, st->Q_exc, st->bfi, st->last_core, st->last_codec_mode, tdm_low_rate_mode, st->element_mode ); -#else - Inac_switch_ematch_ivas_fx( exc2_fx, dct_exc_tmp_fx, st->hGSCDec->lt_ener_per_band_fx, st->coder_type, st->L_frame, st->total_brate, st->Q_exc, st->bfi, st->last_core, st->last_codec_mode, tdm_low_rate_mode, st->element_mode ); -#endif /* update past excitation signals for LD music post-filter */ IF( st->hMusicPF != NULL ) @@ -1766,23 +1687,14 @@ ivas_error acelp_core_dec_ivas_fx( pRealSave_fx[i] = realBufferSave_fx[i]; pImagSave_fx[i] = imagBufferSave_fx[i]; } -#ifndef MSAN_FIX - Copy_Scale_sig_16_32_DEPREC( bpf_error_signal_16fx, bpf_error_signal_fx, st->L_frame, -1 ); // Q_syn-1 -#endif IF( st->p_bpf_noise_buf_32 ) { -#ifdef MSAN_FIX Copy_Scale_sig_16_32_DEPREC( bpf_error_signal_16fx, bpf_error_signal_fx, st->L_frame, -1 ); // Q_syn-1 -#endif Copy32( bpf_error_signal_fx, st->p_bpf_noise_buf_32, st->L_frame ); Scale_sig32( st->p_bpf_noise_buf_32, st->L_frame, sub( Q11, sub( st->Q_syn, 1 ) ) ); // Q11 } -#ifdef MSAN_FIX FOR( i = 0; i < st->L_frame; i++ ) -#else - for ( i = 0; i < L_FRAME16k; i++ ) -#endif { syn_32_fx[i] = L_shr( L_deposit_h( psyn_fx[i] ), add( 4, st->Q_syn ) ); // Q12 move32(); @@ -1803,15 +1715,7 @@ ivas_error acelp_core_dec_ivas_fx( q_bpf_error_signal = Q6; move16(); -#ifdef MSAN_FIX -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( bpf_error_signal_16fx, tmp_bpf_error_signal_fx, st->L_frame, sub( q_bpf_error_signal, st->Q_syn ) ); // Q6 -#else - Copy_Scale_sig_16_32_DEPREC( bpf_error_signal_16fx, tmp_bpf_error_signal_fx, st->L_frame, sub( q_bpf_error_signal, st->Q_syn ) ); // Q6 -#endif -#else - Copy_Scale_sig_16_32_DEPREC( bpf_error_signal_16fx, tmp_bpf_error_signal_fx, L_FRAME16k, q_bpf_error_signal - st->Q_syn ); // Q6 -#endif FOR( i = 0; i < CLDFB_NO_COL_MAX; i++ ) { Scale_sig32( realBuffer_fx[i], CLDFB_NO_CHANNELS_MAX, -Q7 ); // Q0 @@ -1910,9 +1814,6 @@ ivas_error acelp_core_dec_ivas_fx( #endif /* OPT_STEREO_32KBPS_V1 */ st->cldfbSynHB->Q_cldfb_state = sub( Q_real, 1 ); move16(); -#ifndef MSAN_FIX - Scale_sig32( save_hb_synth_fx, L_FRAME48k, sub( Q_real, 1 ) ); // Q_real-1 -#endif FOR( j = 0; j < CLDFB_NO_CHANNELS_MAX; j++ ) { @@ -1932,11 +1833,7 @@ ivas_error acelp_core_dec_ivas_fx( } } -#ifdef OPT_SBA_AVOID_SPAR_RESCALE cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, save_hb_synth_fx, -1, 0, st->cldfbSynHB ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, save_hb_synth_fx, -1, st->cldfbSynHB ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ Scale_sig32( save_hb_synth_fx, L_FRAME48k, negate( ( sub( Q_real, 1 ) ) ) ); // Q0 Scale_sig32( st->cldfbSynHB->cldfb_state_fx, st->cldfbSynHB->p_filter_length, sub( Q10, sub( Q_real, 1 ) ) ); // Q10 @@ -1956,11 +1853,7 @@ ivas_error acelp_core_dec_ivas_fx( Scale_sig32( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( sub( Q_real, 1 ), Q10 ) ); // Q_real-1 st->cldfbSynHB->Q_cldfb_state = sub( Q_real, 1 ); move16(); -#ifdef OPT_SBA_AVOID_SPAR_RESCALE cldfbSynthesis_ivas_fx( pRealSave_fx, pImagSave_fx, synth_fx, -1, 0, st->cldfbSyn ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - cldfbSynthesis_ivas_fx( pRealSave_fx, pImagSave_fx, synth_fx, -1, st->cldfbSyn ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ Scale_sig32( synth_fx, L_FRAME48k, negate( sub( Q_real, 1 ) ) ); // Q0 Scale_sig32( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( Q10, sub( Q_real, 1 ) ) ); // Q10 st->cldfbSynHB->Q_cldfb_state = Q10; @@ -2003,20 +1896,9 @@ ivas_error acelp_core_dec_ivas_fx( #endif /* OPT_STEREO_32KBPS_V1 */ st->cldfbSyn->Q_cldfb_state = sub( Q_real, 1 ); move16(); -#ifndef MSAN_FIX - Scale_sig32( synth_fx, L_FRAME48k, Q_real - 1 ); -#endif -#ifdef OPT_SBA_AVOID_SPAR_RESCALE cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, synth_fx, -1, 0, st->cldfbSyn ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, synth_fx, -1, st->cldfbSyn ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ -#ifdef MSAN_FIX scale_sig32( synth_fx, output_frame, negate( sub( Q_real, 1 ) ) ); // Q0 -#else - Scale_sig32( synth_fx, L_FRAME48k, -( Q_real - 1 ) ); -#endif scale_sig32( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( Q10, sub( Q_real, 1 ) ) ); // Q10 st->cldfbSyn->Q_cldfb_state = Q10; move16(); @@ -2030,11 +1912,7 @@ ivas_error acelp_core_dec_ivas_fx( Word16 nSamples = NS2SA_FX2( i_mult( st->L_frame, FRAMES_PER_SEC ), FRAME_SIZE_NS /*DELAY_CLDFB_NS*/ ); /* IVAS-64: optimization is likely possible here (don't resample the whole frame) */ /* analysis of the synthesis at internal sampling rate - needed for DFT stereo -> TD stereo switching */ -#ifndef MSAN_FIX - for ( i = 0; i < L_FRAME16k; i++ ) -#else FOR( i = 0; i < st->L_frame; i++ ) -#endif { syn_32_fx[i] = L_shr( L_deposit_h( psyn_fx[i] ), add( 4, st->Q_syn ) ); move32(); @@ -2057,11 +1935,7 @@ ivas_error acelp_core_dec_ivas_fx( // Get Q-factor q_bpf_error_signal = Q6; move16(); -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( bpf_error_signal_16fx, tmp_bpf_error_signal_fx, L_FRAME16k, sub( q_bpf_error_signal, st->Q_syn ) ); // Q6 -#else - Copy_Scale_sig_16_32_DEPREC( bpf_error_signal_16fx, tmp_bpf_error_signal_fx, L_FRAME16k, sub( q_bpf_error_signal, st->Q_syn ) ); // Q6 -#endif FOR( i = 0; i < CLDFB_NO_COL_MAX; i++ ) { Scale_sig32( realBuffer_fx[i], CLDFB_NO_CHANNELS_MAX, -Q7 ); // Q0 @@ -2116,21 +1990,10 @@ ivas_error acelp_core_dec_ivas_fx( #else /* OPT_STEREO_32KBPS_V1 */ scale_sig32_r( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( sub( Q_real, 1 ), Q10 ) ); //(Q_real - 1) #endif /* OPT_STEREO_32KBPS_V1 */ -#ifndef MSAN_FIX - Scale_sig32( synth_fx, L_FRAME48k, Q_real - 1 ); -#endif -#ifdef OPT_SBA_AVOID_SPAR_RESCALE cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, synth_fx /*dummy*/, NS2SA_FX2( st->output_Fs, FRAME_SIZE_NS /*DELAY_CLDFB_NS*/ ), 0, st->cldfbSyn ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, synth_fx /*dummy*/, NS2SA_FX2( st->output_Fs, FRAME_SIZE_NS /*DELAY_CLDFB_NS*/ ), st->cldfbSyn ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ -#ifdef MSAN_FIX Scale_sig32( synth_fx, output_frame, negate( sub( Q_real, 1 ) ) ); // Q0 -#else - Scale_sig32( synth_fx, L_FRAME48k, -( Q_real - 1 ) ); -#endif Scale_sig32( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( Q10, sub( Q_real, 1 ) ) ); // Q10 st->cldfbSyn->Q_cldfb_state = Q10; move16(); @@ -2146,11 +2009,7 @@ ivas_error acelp_core_dec_ivas_fx( } /* Copy output signal */ -#ifndef MSAN_FIX - Scale_sig( syn_tmp_fx, L_FRAME16k + L_SUBFR, -st->Q_syn ); -#else Scale_sig( syn_tmp_fx, add( st->L_frame, L_SUBFR ), negate( st->Q_syn ) ); // Q0 -#endif IF( st->element_mode > EVS_MONO ) { Copy( psyn_fx, output_fx, st->L_frame ); /*Q_syn*/ @@ -2173,24 +2032,14 @@ ivas_error acelp_core_dec_ivas_fx( IF( ( EQ_16( st->L_frame, L_FRAME ) && ( st->bwidth != NB ) && GE_16( output_frame, L_FRAME16k ) && ( EQ_16( st->extl, -1 ) || EQ_16( st->extl, SWB_CNG ) || ( EQ_16( st->extl, WB_BWE ) && st->extl_brate == 0 && NE_16( st->coder_type, AUDIO ) ) ) ) ) { -#ifdef MSAN_FIX Copy_Scale_sig_32_16( synth_fx, synth_fx16, output_frame, 0 ); // Q0 -#else - Copy_Scale_sig_32_16( synth_fx, synth_fx16, L_FRAME48k, 0 ); -#endif hf_synth_fx( st->hBWE_zero, st->core_brate, output_frame, Aq_fx, exc2_fx, psyn_fx, synth_fx16, st->Q_exc, st->Q_syn2 ); -#ifdef MSAN_FIX Copy_Scale_sig_16_32_DEPREC( synth_fx16, synth_fx, output_frame, 0 ); -#else - Copy_Scale_sig_16_32_DEPREC( synth_fx16, synth_fx, L_FRAME48k, 0 ); -#endif } ELSE { hf_synth_reset_fx( st->hBWE_zero ); -#ifdef MSAN_FIX set16_fx( st->hBWE_zero->mem_hp400_fx, 0, 6 ); -#endif } } @@ -2225,11 +2074,7 @@ ivas_error acelp_core_dec_ivas_fx( test(); IF( !st->ppp_mode_dec && ( st->idchan == 0 || NE_16( st->element_mode, IVAS_CPE_TD ) || ( EQ_16( st->idchan, 1 ) && EQ_16( st->element_mode, IVAS_CPE_TD ) && st->tdm_LRTD_flag ) ) ) { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( st->hBWE_TD->old_bwe_exc_extended_fx, bwe_exc_extended_fx, NL_BUFF_OFFSET, ( sub( shl( st->Q_exc, 1 ), sub( st->prev_Q_bwe_exc, 16 ) ) ) ); // prev_Q_bwe_exc -#else - Copy_Scale_sig_16_32_DEPREC( st->hBWE_TD->old_bwe_exc_extended_fx, bwe_exc_extended_fx, NL_BUFF_OFFSET, ( sub( shl( st->Q_exc, 1 ), sub( st->prev_Q_bwe_exc, 16 ) ) ) ); // prev_Q_bwe_exc -#endif non_linearity_ivas_fx( bwe_exc_fx, bwe_exc_extended_fx + NL_BUFF_OFFSET, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale_fx, st->Q_exc, st->coder_type, voice_factors_fx, st->L_frame ); Copy_Scale_sig_32_16( bwe_exc_extended_fx + L_FRAME32k, st->hBWE_TD->old_bwe_exc_extended_fx, NL_BUFF_OFFSET, negate( sub( shl( st->Q_exc, 1 ), sub( st->prev_Q_bwe_exc, 16 ) ) ) ); // prev_Q_bwe_exc } @@ -2270,18 +2115,7 @@ ivas_error acelp_core_dec_ivas_fx( { Copy_Scale_sig_32_16( save_hb_synth_fx, save_hb_synth_fx16, L_FRAME48k, 0 ); // Q0 } -#ifdef MSAN_FIX Copy_Scale_sig_32_16( synth_fx, synth_fx16, output_frame, 0 ); // Q_syn2 -#else - Copy_Scale_sig_32_16( synth_fx, synth_fx16, L_FRAME48k, 0 ); -#endif -#ifndef FIX_1100_REMOVE_LPC_RESCALING - if ( st->hFdCngDec ) - { - st->hFdCngDec->hFdCngCom->A_cng[0] = ONE_IN_Q12; - move16(); - } -#endif } pop_wmops(); diff --git a/lib_dec/acelp_core_switch_dec_fx.c b/lib_dec/acelp_core_switch_dec_fx.c index 6a1e60b06..9013f2f03 100644 --- a/lib_dec/acelp_core_switch_dec_fx.c +++ b/lib_dec/acelp_core_switch_dec_fx.c @@ -128,11 +128,7 @@ ivas_error acelp_core_switch_dec_fx( * Excitation decoding *----------------------------------------------------------------*/ -#ifdef NONBE_FIX_GSC_BSTR config_acelp1( DEC, st_fx->total_brate, cbrate, st_fx->core, -1, -1, st_fx->last_L_frame, -1, &( st_fx->acelp_cfg ), st_fx->next_bit_pos, GENERIC, st_fx->inactive_coder_type_flag, -1, -1, &decode_bwe /* dummy */, &i, st_fx->element_mode, &i /*dummy*/, 0, 0, st_fx->idchan, st_fx->active_cnt, 0, 0, 0 ); -#else - config_acelp1( DEC, st_fx->total_brate, cbrate, st_fx->core, -1, -1, st_fx->last_L_frame, -1, &( st_fx->acelp_cfg ), st_fx->next_bit_pos, GENERIC, -1, -1, &decode_bwe /* dummy */, &i, st_fx->element_mode, &i /*dummy*/, 0, 0, st_fx->idchan, st_fx->active_cnt, 0, 0, 0 ); -#endif decod_gen_voic_core_switch_fx( st_fx, L_frame_for_cs, 0, Aq, exc, cbrate, &st_fx->Q_exc ); @@ -819,11 +815,7 @@ ivas_error acelp_core_switch_dec_bfi_ivas_fx( *----------------------------------------------------------------*/ /* CLDFB analysis of the synthesis at internal sampling rate */ Qtmp = sub( 11, st_fx->Q_syn ); -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( syn, syn32, L_FRAME16k, Qtmp ); // Q(11) -#else - Copy_Scale_sig_16_32_DEPREC( syn, syn32, L_FRAME16k, Qtmp ); // Q(11) -#endif IF( NE_32( ( error = cldfb_save_memory_ivas_fx( st_fx->cldfbAna ) ), IVAS_ERR_OK ) ) { return error; @@ -845,11 +837,7 @@ ivas_error acelp_core_switch_dec_bfi_ivas_fx( move16(); Copy_Scale_sig_16_32_DEPREC( synth_out, synth32, L_FRAME48k, 5 ); /*11-5-1*/ -#ifdef OPT_SBA_AVOID_SPAR_RESCALE cldfbSynthesis_ivas_fx( realBuffer, imagBuffer, synth32, extract_l( Mpy_32_16_1( st_fx->output_Fs, 328 ) ), 0, st_fx->cldfbSyn ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - cldfbSynthesis_ivas_fx( realBuffer, imagBuffer, synth32, extract_l( Mpy_32_16_1( st_fx->output_Fs, 328 ) ), st_fx->cldfbSyn ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ Scale_sig32( st_fx->cldfbSyn->cldfb_state_fx, st_fx->cldfbSyn->cldfb_state_length, -1 ); // Q_cldfb_state-1 st_fx->cldfbSyn->Q_cldfb_state = sub( st_fx->cldfbSyn->Q_cldfb_state, 1 ); move16(); diff --git a/lib_dec/core_switching_dec_fx.c b/lib_dec/core_switching_dec_fx.c index 1f6b0dd51..05125318f 100644 --- a/lib_dec/core_switching_dec_fx.c +++ b/lib_dec/core_switching_dec_fx.c @@ -898,9 +898,7 @@ ivas_error core_switching_post_dec_fx( HQ_DEC_HANDLE hHQ_core; ivas_error error; -#ifdef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING (void) ( last_element_mode ); -#endif hBWE_TD = st_fx->hBWE_TD; hBWE_FD = st_fx->hBWE_FD; hHQ_core = st_fx->hHQ_core; @@ -2058,11 +2056,7 @@ static void core_switch_lb_upsamp_fx( } /* synthesis of the combined signal */ -#ifdef OPT_SBA_AVOID_SPAR_RESCALE cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, output, i_mult( CLDFB_OVRLP_MIN_SLOTS, st->cldfbSyn->no_channels ), 0, st->cldfbSyn ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, output, i_mult( CLDFB_OVRLP_MIN_SLOTS, st->cldfbSyn->no_channels ), st->cldfbSyn ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ /*rescaling whole buffer to a common Q*/ no_col = st->cldfbSyn->no_col; @@ -2100,13 +2094,8 @@ static void smoothTransitionDtxToTcx_fx( Word16 i, filter_len; Word16 w, step, fade_in; Word32 mem; -#ifdef MSAN_FIX - Word16 smoothing_input_buffer[2 * NS2SA( 48000, DELAY_CLDFB_NS ) + TRANSITION_SMOOTHING_LEN_48k]; - Word16 smoothing_out_buffer[2 * NS2SA( 48000, DELAY_CLDFB_NS ) + TRANSITION_SMOOTHING_LEN_48k]; -#else Word16 smoothing_input_buffer[2 * NS2SA( 48000, DELAY_CLDFB_NS ) + TRANSITION_SMOOTHING_LEN_48k]; Word16 smoothing_out_buffer[2 * NS2SA( 48000, DELAY_CLDFB_NS ) + TRANSITION_SMOOTHING_LEN_48k]; -#endif set16_fx( smoothing_input_buffer, 0, 2 * NS2SA( 48000, DELAY_CLDFB_NS ) + TRANSITION_SMOOTHING_LEN_48k ); set16_fx( smoothing_out_buffer, 0, 2 * NS2SA( 48000, DELAY_CLDFB_NS ) + TRANSITION_SMOOTHING_LEN_48k ); @@ -2241,10 +2230,8 @@ ivas_error core_switching_pre_dec_ivas_fx( test(); IF( st->hBWE_TD != NULL && ( st->last_core != ACELP_CORE ) ) { -#ifdef MSAN_FIX st->hBWE_TD->prev_hb_synth_fx_exp = 31; move16(); -#endif // MSAN_FIX /* reset BWE memories */ set16_fx( st->hBWE_TD->old_bwe_exc_fx, 0, PIT16k_MAX * 2 ); st->hBWE_TD->bwe_non_lin_prev_scale_fx = 0; @@ -2262,9 +2249,7 @@ ivas_error core_switching_pre_dec_ivas_fx( IF( GT_32( st->output_Fs, 16000 ) && st->hBWE_zero != NULL ) { hf_synth_reset_fx( st->hBWE_zero ); -#ifdef MSAN_FIX set16_fx( st->hBWE_zero->mem_hp400_fx, 0, 6 ); -#endif } IF( st->hBWE_FD != NULL ) @@ -2379,11 +2364,7 @@ ivas_error core_switching_pre_dec_ivas_fx( return error; } -#ifdef OPT_SBA_AVOID_SPAR_RESCALE cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, fer_samples_fx, delay_comp, 0, st->cldfbSyn ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, fer_samples_fx, delay_comp, st->cldfbSyn ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ cldfb_restore_memory_ivas_fx( st->cldfbSyn ); Copy_Scale_sig_32_16( syn_Overl_fx, st->hTcxDec->syn_Overl, 320, 15 ); Copy_Scale_sig_32_16( fer_samples_fx, st->hHQ_core->fer_samples_fx, 960, 9 ); @@ -2587,9 +2568,7 @@ ivas_error core_switching_pre_dec_ivas_fx( IF( GT_32( st->output_Fs, 16000 ) && st->hBWE_zero != NULL ) { hf_synth_reset_fx( st->hBWE_zero ); -#ifdef MSAN_FIX set16_fx( st->hBWE_zero->mem_hp400_fx, 0, 6 ); -#endif } IF( st->hBWE_FD != NULL ) @@ -2639,9 +2618,7 @@ ivas_error core_switching_pre_dec_ivas_fx( IF( GT_32( st->output_Fs, 16000 ) && st->hBWE_zero != NULL ) { hf_synth_reset_fx( st->hBWE_zero ); -#ifdef MSAN_FIX set16_fx( st->hBWE_zero->mem_hp400_fx, 0, 6 ); -#endif } IF( st->hBWE_FD != NULL ) @@ -2662,11 +2639,7 @@ ivas_error core_switching_pre_dec_ivas_fx( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for old_synth_lenFB (32 bit) \n" ) ); } -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( st->hTcxDec->old_synthFB_fx, old_synthFB_fx, st->hTcxDec->old_synth_lenFB, sub( Q10, Q_old_synthFB ) ); // Q10 -#else - Copy_Scale_sig_16_32_DEPREC( st->hTcxDec->old_synthFB_fx, old_synthFB_fx, st->hTcxDec->old_synth_lenFB, sub( Q10, Q_old_synthFB ) ); // Q10 -#endif Copy32( old_synthFB_fx + st->hTcxDec->old_synth_lenFB - offset, st->cldfbAna->cldfb_state_fx, offset ); st->cldfbAna->Q_cldfb_state = Q10; move16(); diff --git a/lib_dec/dec_gen_voic_fx.c b/lib_dec/dec_gen_voic_fx.c index bdfac224f..325beb9f3 100644 --- a/lib_dec/dec_gen_voic_fx.c +++ b/lib_dec/dec_gen_voic_fx.c @@ -693,11 +693,7 @@ ivas_error decod_gen_voic_ivas_fx( * Transform domain contribution decoding *-----------------------------------------------------------------*/ test(); -#ifdef NONBE_FIX_GSC_BSTR IF( !st_fx->inactive_coder_type_flag && st_fx->coder_type == INACTIVE ) -#else - IF( GE_32( st_fx->total_brate, MAX_GSC_INACTIVE_BRATE ) && ( st_fx->coder_type == INACTIVE ) ) -#endif { transf_cdbk_dec_fx( st_fx, harm_flag_acelp, i_subfr_fx, Es_pred_fx, gain_code_fx, &gain_preQ_fx, &norm_gain_preQ_fx, code_preQ_fx, unbits ); } diff --git a/lib_dec/dec_tcx_fx.c b/lib_dec/dec_tcx_fx.c index 8ff50f8a5..e2ea02dcc 100644 --- a/lib_dec/dec_tcx_fx.c +++ b/lib_dec/dec_tcx_fx.c @@ -2682,11 +2682,7 @@ void IMDCT_ivas_fx( } move16(); -#ifdef OPT_SBA_AVOID_SPAR_RESCALE set16_fx( win_fx, 0, ( L_FRAME_PLUS + L_MDCT_OVLP_MAX ) >> 1 ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - set16_fx( win_fx, 0, shr( add( L_FRAME_PLUS, L_MDCT_OVLP_MAX ), 1 ) ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ Word16 tcx_offset_tmp = add( tcx_offset, shr( L_ola, 1 ) ); set16_fx( xn_buf_fx, 0, tcx_offset_tmp ); /* zero left end of buffer */ @@ -2865,16 +2861,10 @@ void IMDCT_ivas_fx( q_tmp_fx_32 = q_xn_buf_fx_32; move16(); -#ifdef OPT_SBA_AVOID_SPAR_RESCALE Word16 diff = sub( q_tmp_fx_32, q_win ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ FOR( Word16 ind = 0; ind < L_frame; ind++ ) { -#ifdef OPT_SBA_AVOID_SPAR_RESCALE old_out_fx_32[ind] = L_shl( old_out_fx[ind], diff ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - old_out_fx_32[ind] = L_shl( old_out_fx[ind], sub( q_tmp_fx_32, q_win ) ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ move32(); } @@ -2882,13 +2872,8 @@ void IMDCT_ivas_fx( FOR( Word16 ind = 0; ind < L_frame; ind++ ) { -#ifdef OPT_SBA_AVOID_SPAR_RESCALE old_out_fx[ind] = extract_l( L_shr( old_out_fx_32[ind], diff ) ); xn_buf_fx[ind] = extract_l( L_shr( xn_buf_fx_32[ind], diff ) ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - old_out_fx[ind] = (Word16) L_shr( old_out_fx_32[ind], sub( q_tmp_fx_32, q_win ) ); - xn_buf_fx[ind] = (Word16) L_shr( xn_buf_fx_32[ind], sub( q_tmp_fx_32, q_win ) ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ move16(); move16(); } @@ -2912,39 +2897,24 @@ void IMDCT_ivas_fx( q_tmp_fx_32 = sub( q_xn_buf_fx_32, res_e ); // v_multc_fixed( xn_buf_fx_32 + overlap / 2 + nz, (float) sqrt( (float) L_frame / NORM_MDCT_FACTOR ), tmp_fx_32, L_frame ); -#ifdef OPT_SBA_AVOID_SPAR_RESCALE Word16 q_diff = sub( q_xn_buf_fx_32, q_win ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ FOR( Word16 ind = 0; ind < L_frame; ind++ ) { -#ifdef OPT_SBA_AVOID_SPAR_RESCALE xn_buf_fx[( ind + ( overlap / 2 ) ) + nz] = extract_l( L_shr( xn_buf_fx_32[( ind + ( overlap / 2 ) ) + nz], q_diff ) ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - xn_buf_fx[( ind + ( overlap / 2 ) ) + nz] = (Word16) L_shr( xn_buf_fx_32[( ind + ( overlap / 2 ) ) + nz], sub( q_xn_buf_fx_32, q_win ) ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ move16(); } window_ola_fx( tmp_fx_32, xn_buf_fx, &q_tmp_fx_32, old_out_fx, &q_old_out, L_frame, hTcxCfg->tcx_last_overlap_mode, hTcxCfg->tcx_curr_overlap_mode, 0, 0, NULL ); -#ifdef OPT_SBA_AVOID_SPAR_RESCALE q_diff = sub( q_old_out, q_win ); Word16 diff = sub( q_tmp_fx_32, q_win ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ FOR( Word16 ind = 0; ind < L_frame; ind++ ) { -#ifdef OPT_SBA_AVOID_SPAR_RESCALE old_out_fx[ind] = shr_sat( old_out_fx[ind], q_diff ); move16(); xn_buf_fx[ind] = shr_sat( xn_buf_fx[ind], diff ); move16(); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - old_out_fx[ind] = shr_sat( old_out_fx[ind], sub( q_old_out, q_win ) ); - move16(); - xn_buf_fx[ind] = shr_sat( xn_buf_fx[ind], sub( q_tmp_fx_32, q_win ) ); - move16(); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ } } aldo = 1; @@ -4441,11 +4411,7 @@ void decoder_tcx_noisefilling_fx( /* get the starting location of the subframe in the frame */ IF( EQ_16( st->core, TCX_10_CORE ) ) { -#ifdef NONBE_FIX_1402_WAVEADJUST st->hPlcInfo->subframe_fx = extract_l( L_mult0( frame_cnt, L_frameTCX_glob ) ); -#else - st->hPlcInfo->subframe = extract_l( L_mult0( frame_cnt, L_frameTCX_glob ) ); -#endif move16(); } } diff --git a/lib_dec/decision_matrix_dec_fx.c b/lib_dec/decision_matrix_dec_fx.c index f9833e80a..0bc7794dc 100644 --- a/lib_dec/decision_matrix_dec_fx.c +++ b/lib_dec/decision_matrix_dec_fx.c @@ -713,7 +713,6 @@ void decision_matrix_dec_fx( move16(); } -#ifdef NONBE_FIX_GSC_BSTR /*-----------------------------------------------------------------* * set inactive coder_type flag in ACELP core *-----------------------------------------------------------------*/ @@ -727,6 +726,5 @@ void decision_matrix_dec_fx( move16(); } -#endif return; } diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index c509d5d10..df18d3dba 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -187,9 +187,7 @@ void initFdCngDec_ivas_fx( st->CNG_mode = -1; move16(); Copy( st->lsp_old_fx, st->lspCNG_fx, M ); /*Q15*/ -#ifdef MSAN_FIX hFdCngDec->hFdCngCom->sid_frame_counter = 0; -#endif return; } @@ -1765,12 +1763,8 @@ Word16 ApplyFdCng_ivas_fx( { FOR( ; j <= hFdCngCom->part[k]; j++ ) { -#ifdef FIX_ISSUE_1218 /* NOTE: saturation is added here as part of issue 1218 fix. after rescaling the fdcng noise estimation buffers, due to slight precision loss, values may slightly overflow */ cngNoiseLevel[j] = L_shl_sat( cngNoiseLevel[j], s ); /*Q31 - hFdCngDec->bandNoiseShape_exp + s*/ -#else - cngNoiseLevel[j] = L_shl( cngNoiseLevel[j], s ); /*Q31 - hFdCngDec->bandNoiseShape_exp + s*/ -#endif move32(); } } @@ -5275,11 +5269,7 @@ void generate_stereo_masking_noise_fx( IF( st->idchan == 0 ) { hFdCngCom = st->hFdCngDec->hFdCngCom; -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( hStereoCng->olapBufferSynth22_fx, Ns_fx, shr( hFdCngCom->frameSize, 1 ), sub( Q6, st->Q_syn ) ); /*Q6*/ -#else - Copy_Scale_sig_16_32_DEPREC( hStereoCng->olapBufferSynth22_fx, Ns_fx, shr( hFdCngCom->frameSize, 1 ), sub( Q6, st->Q_syn ) ); /*Q6*/ -#endif Copy32( hFdCngCom->olapBufferSynth2_fx, Np_fx, shr( hFdCngCom->frameSize, 1 ) ); /*st->Q_syn*/ set32_fx( &Np_fx[( hFdCngCom->frameSize / 2 )], 0, shr( hFdCngCom->frameSize, 1 ) ); @@ -5287,11 +5277,7 @@ void generate_stereo_masking_noise_fx( IF( !fadeOut ) { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( hStereoCng->olapBufferSynth22_fx, hStereoCng->olapBufferSynth22_32fx, hFdCngCom->fftlen, sub( Q15, st->Q_syn ) ); /*Q15*/ -#else - Copy_Scale_sig_16_32_DEPREC( hStereoCng->olapBufferSynth22_fx, hStereoCng->olapBufferSynth22_32fx, hFdCngCom->fftlen, sub( Q15, st->Q_syn ) ); /*Q15*/ -#endif generate_masking_noise_ivas_fx( N1_fx, &N1_fx_exp, hFdCngCom, hFdCngCom->frameSize, 0, 1, 0, st->element_mode, hStereoCng, nchan_out ); // N1_fx Q6 /* Generate masking noise for secondary channel */ IF( flag_sec_CNA ) diff --git a/lib_dec/gs_dec_fx.c b/lib_dec/gs_dec_fx.c index 6c63377fd..8f29eb9d1 100644 --- a/lib_dec/gs_dec_fx.c +++ b/lib_dec/gs_dec_fx.c @@ -92,11 +92,7 @@ void decod_audio_fx( } /* set bit-allocation */ -#ifdef NONBE_FIX_GSC_BSTR config_acelp1( DEC, st_fx->total_brate, st_fx->core_brate, st_fx->core, st_fx->extl_orig, st_fx->extl_brate_orig, st_fx->L_frame, st_fx->GSC_noisy_speech, &( st_fx->acelp_cfg ), st_fx->next_bit_pos, st_fx->coder_type, st_fx->inactive_coder_type_flag, -1, 1, &nbits, NULL, st_fx->element_mode, &nbits /*dummy*/, 0, 0, st_fx->idchan, st_fx->active_cnt, 0, st_fx->tdm_LRTD_flag, st_fx->GSC_IVAS_mode ); -#else - config_acelp1( DEC, st_fx->total_brate, st_fx->core_brate, st_fx->core, st_fx->extl_orig, st_fx->extl_brate_orig, st_fx->L_frame, st_fx->GSC_noisy_speech, &( st_fx->acelp_cfg ), st_fx->next_bit_pos, st_fx->coder_type, -1, 1, &nbits, NULL, st_fx->element_mode, &nbits /*dummy*/, 0, 0, st_fx->idchan, st_fx->active_cnt, 0, st_fx->tdm_LRTD_flag, st_fx->GSC_IVAS_mode ); -#endif /*---------------------------------------------------------------* * Decode energy dynamics @@ -522,11 +518,7 @@ void decod_audio_ivas_fx( } /* set bit-allocation */ -#ifdef NONBE_FIX_GSC_BSTR config_acelp1_IVAS( DEC, st_fx->total_brate, st_fx->core_brate, st_fx->core, st_fx->extl_orig, st_fx->extl_brate_orig, st_fx->L_frame, st_fx->GSC_noisy_speech, &( st_fx->acelp_cfg ), st_fx->next_bit_pos, st_fx->coder_type, st_fx->inactive_coder_type_flag, -1, 1, &nbits, NULL, st_fx->element_mode, &nbits /*dummy*/, tdm_lp_reuse_flag, tdm_low_rate_mode, st_fx->idchan, st_fx->active_cnt, tdm_Pitch_reuse_flag, st_fx->tdm_LRTD_flag, st_fx->GSC_IVAS_mode ); -#else - config_acelp1_IVAS( DEC, st_fx->total_brate, st_fx->core_brate, st_fx->core, st_fx->extl_orig, st_fx->extl_brate_orig, st_fx->L_frame, st_fx->GSC_noisy_speech, &( st_fx->acelp_cfg ), st_fx->next_bit_pos, st_fx->coder_type, -1, 1, &nbits, NULL, st_fx->element_mode, &nbits /*dummy*/, tdm_lp_reuse_flag, tdm_low_rate_mode, st_fx->idchan, st_fx->active_cnt, tdm_Pitch_reuse_flag, st_fx->tdm_LRTD_flag, st_fx->GSC_IVAS_mode ); -#endif /*---------------------------------------------------------------* * Decode energy dynamics @@ -1372,14 +1364,10 @@ void gsc_dec_ivas_fx( } pvq_core_dec_fx( st_fx, gsc_sfm_start, gsc_sfm_end, gsc_sfm_size, concat_out, &Q_tmp, bit, nb_subbands, bits_per_bands, NULL, inpulses_fx, imaxpulse_fx, ACELP_CORE ); -#ifdef MSAN_FIX IF( nb_subbands > 0 ) { Scale_sig( concat_out, gsc_sfm_end[nb_subbands - 1], sub( Q_PVQ_OUT, Q_tmp ) ); /* Q_PVQ_OUT */ } -#else - Scale_sig( concat_out, gsc_sfm_end[nb_subbands - 1], sub( Q_PVQ_OUT, Q_tmp ) ); /* Q_PVQ_OUT */ -#endif seed_init = 0; move16(); @@ -1435,11 +1423,7 @@ void gsc_dec_ivas_fx( } if ( concat_out[j] < 0 ) { -#ifdef BASOP_NOGLOB_TMP_715 seed_init = add_sat( seed_init, 3 ); /* Q0 */ -#else - seed_init = add( seed_init, 3 ); -#endif } } diff --git a/lib_dec/hq_core_dec_fx.c b/lib_dec/hq_core_dec_fx.c index 714245514..4d1ef6774 100644 --- a/lib_dec/hq_core_dec_fx.c +++ b/lib_dec/hq_core_dec_fx.c @@ -627,9 +627,7 @@ void ivas_hq_core_dec_fx( set16_fx( gapsynth_fx, 0, L_FRAME48k ); set16_fx( num_bands_p, 0, MAX_SB_NB ); set16_fx( ynrm, 39, NB_SFM ); /* Initialize to the smallest value */ -#ifdef MSAN_FIX set16_fx( wtda_audio_16, 0, 2 * L_FRAME48k ); -#endif mean_en_high_fx = 0; move16(); Q_audio = 12; @@ -951,9 +949,6 @@ void ivas_hq_core_dec_fx( index = tcx_cfg->tcx_last_overlap_mode; /* Q0 */ move16(); -#ifndef MSAN_FIX - Copy_Scale_sig_32_16( wtda_audio, wtda_audio_16, 2 * L_FRAME48k, -13 ); -#endif /* LB synthesis */ E_audio = sub( 31, Q_audio ); diff --git a/lib_dec/hq_hr_dec_fx.c b/lib_dec/hq_hr_dec_fx.c index d72f0ec45..89864bc3b 100644 --- a/lib_dec/hq_hr_dec_fx.c +++ b/lib_dec/hq_hr_dec_fx.c @@ -100,7 +100,6 @@ void hq_pred_hb_bws_fx( } ELSE { -#ifdef EVS_FUNC_MODIFIED st_fx->prev_ener_shb_fx = 0; move16(); L_tmp = L_deposit_l( 0 ); @@ -111,15 +110,6 @@ void hq_pred_hb_bws_fx( L_tmp = Mpy_32_16_1( L_tmp, 2979 ); // Q1 st_fx->prev_ener_shb_fx = extract_l( L_tmp ); /*Q1*/ move16(); -#else - st_fx->prev_ener_shb_fx = 0; - move16(); - FOR( i = 0; i < SWB_FENV - 3; i++ ) - { - st_fx->prev_ener_shb_fx = add( st_fx->prev_ener_shb_fx, SWB_fenv[i] ); /*Q1*/ - } - st_fx->prev_ener_shb_fx = mult( st_fx->prev_ener_shb_fx, 2979 ); /*Q1*/ -#endif } } diff --git a/lib_dec/igf_dec_fx.c b/lib_dec/igf_dec_fx.c index 5bfa7476a..60e649a08 100644 --- a/lib_dec/igf_dec_fx.c +++ b/lib_dec/igf_dec_fx.c @@ -2883,9 +2883,6 @@ static void IGF_getWhiteSpectralData_ivas( Word16 j; Word32 ak; Word16 ak_e; -#ifndef OPT_SBA_AVOID_SPAR_RESCALE - Word16 tmp_16; -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ Word16 tmp_e; Word16 out_e_arr[IGF_START_MX + MAX_IGF_SFB_LEN]; Word16 max_out_e; @@ -2904,23 +2901,18 @@ static void IGF_getWhiteSpectralData_ivas( Word16 guard_bits = add( find_guarded_bits_fx( add( i_mult( 2, level ), 1 ) ), 1 ) / 2; s_l = sub( s_l, guard_bits ); -#ifdef OPT_SBA_AVOID_SPAR_RESCALE Word16 shift = sub( shl( s_l, 1 ), 32 ); Word16 eff_e = sub( shl( sub( in_e, s_l ), 1 ), 15 ); Word16 diff = add( 21, in_e ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ Word16 quo = BASOP_Util_Divide3216_Scale( ONE_IN_Q30, add( shl( level, 1 ), 1 ), &tmp_e ); tmp_e = add( tmp_e, 1 ); ak_e = add( tmp_e, sub( shl( sub( in_e, s_l ), 1 ), 15 ) ); // tmp_e + 2 * (in_e - s_l) - 15 -#ifdef OPT_SBA_AVOID_SPAR_RESCALE ak_e = sub( ak_e, 1 ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ FOR( i = start; i < stop - level; i++ ) { -#ifdef OPT_SBA_AVOID_SPAR_RESCALE Word64 temp = 0; move64(); FOR( j = i - level; j < i + level + 1; j++ ) @@ -2935,30 +2927,11 @@ static void IGF_getWhiteSpectralData_ivas( out_e_arr[i] = sub( diff, n ); move16(); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - ak = 0; - move32(); - move32(); - FOR( j = i - level; j < i + level + 1; j++ ) - { - tmp_16 = extract_h( L_shl( in[j], s_l ) ); // e: in_e - s_l - ak = L_mac( ak, tmp_16, tmp_16 ); // e: 2 * (in_e - s_l) - } - ak = Mult_32_16( ak, quo ); // add( shl( level, 1 ), 1 ), &tmp_e ) ); - - - n = sub( 30, add( norm_l( ak ), sub( 31, ak_e ) ) ); - n = shr( n, 1 ); - - out_e_arr[i] = add( sub( 21, n ), in_e ); - move16(); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ max_out_e = s_max( max_out_e, out_e_arr[i] ); } FOR( ; i < stop; i++ ) { -#ifdef OPT_SBA_AVOID_SPAR_RESCALE Word64 temp = 0; move64(); @@ -2974,24 +2947,6 @@ static void IGF_getWhiteSpectralData_ivas( out_e_arr[i] = sub( diff, n ); move16(); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - ak = 0; - move32(); - - FOR( j = i - level; j < stop; j++ ) - { - tmp_16 = extract_h( L_shl( in[j], s_l ) ); // e: in_e - s_l - ak = L_mac( ak, tmp_16, tmp_16 ); // e: 2 * (in_e - s_l) - } - ak = L_deposit_h( BASOP_Util_Divide3216_Scale( ak, sub( stop, sub( i, level ) ), &tmp_e ) ); - ak_e = add( tmp_e, sub( shl( sub( in_e, s_l ), 1 ), 15 ) ); // tmp_e + 2 * (in_e - s_l) - 15 - - n = sub( 30, add( norm_l( ak ), sub( 31, ak_e ) ) ); - n = shr( n, 1 ); - - out_e_arr[i] = add( sub( 21, n ), in_e ); - move16(); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ max_out_e = s_max( max_out_e, out_e_arr[i] ); } diff --git a/lib_dec/init_dec_fx.c b/lib_dec/init_dec_fx.c index 934433132..b588fdce1 100644 --- a/lib_dec/init_dec_fx.c +++ b/lib_dec/init_dec_fx.c @@ -315,10 +315,8 @@ ivas_error init_decoder_fx( move16(); /*1; Q15*/ st_fx->exc_pe_fx = 0; // Q_stat_noise move16(); -#ifdef MSAN_FIX st_fx->Q_stat_noise = 31; move16(); -#endif // MSAN_FIX /*-----------------------------------------------------------------* * LD music post-filter *-----------------------------------------------------------------*/ @@ -1036,10 +1034,8 @@ ivas_error init_decoder_ivas_fx( move16(); st_fx->exc_pe_fx = 0; move16(); -#ifdef MSAN_FIX st_fx->Q_stat_noise = 31; move16(); -#endif st_fx->prev_coder_type = GENERIC; move16(); @@ -1139,9 +1135,7 @@ ivas_error init_decoder_ivas_fx( } hf_synth_init_fx( st_fx->hBWE_zero ); -#ifdef MSAN_FIX set16_fx( st_fx->hBWE_zero->mem_hp400_fx, 0, 6 ); -#endif } ELSE { diff --git a/lib_dec/ivas_binRenderer_internal_fx.c b/lib_dec/ivas_binRenderer_internal_fx.c index 85fefadbc..f78f14e8e 100644 --- a/lib_dec/ivas_binRenderer_internal_fx.c +++ b/lib_dec/ivas_binRenderer_internal_fx.c @@ -66,17 +66,11 @@ static void ivas_binRenderer_filterModule_fx( { Word16 bandIdx, k, chIdx, tapIdx; Word32 *filterStatesLeftRealPtr_fx, *filterStatesLeftImagPtr_fx; -#ifdef OPT_BASOP_ADD_v1 Word16 Q_filterStates; -#else /* OPT_BASOP_ADD_v1 */ - Word16 *Q_filterStates; -#endif /* OPT_BASOP_ADD_v1 */ const Word32 *filterTapsLeftRealPtr_fx, *filterTapsLeftImagPtr_fx, *filterTapsRightRealPtr_fx, *filterTapsRightImagPtr_fx; Word16 shift_q; -#ifdef OPT_BASOP_ADD_v1 Q_filterStates = hBinRenderer->hBinRenConvModule->Q_filterStatesLeft; move16(); -#endif /* OPT_BASOP_ADD_v1 */ FOR( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) { @@ -84,9 +78,6 @@ static void ivas_binRenderer_filterModule_fx( { filterStatesLeftRealPtr_fx = (Word32 *) &( hBinRenderer->hBinRenConvModule->filterStatesLeftReal_fx[bandIdx][chIdx][0] ); filterStatesLeftImagPtr_fx = (Word32 *) &( hBinRenderer->hBinRenConvModule->filterStatesLeftImag_fx[bandIdx][chIdx][0] ); -#ifndef OPT_BASOP_ADD_v1 - Q_filterStates = (Word16 *) &( hBinRenderer->hBinRenConvModule->Q_filterStatesLeft[bandIdx][chIdx][0] ); -#endif /* OPT_BASOP_ADD_v1 */ filterTapsLeftRealPtr_fx = hBinRenderer->hBinRenConvModule->filterTapsLeftReal_fx[bandIdx][chIdx]; // Q29 filterTapsLeftImagPtr_fx = hBinRenderer->hBinRenConvModule->filterTapsLeftImag_fx[bandIdx][chIdx]; // Q29 @@ -108,13 +99,6 @@ static void ivas_binRenderer_filterModule_fx( filterStatesLeftImagPtr_fx[tapIdx] = filterStatesLeftImagPtr_fx[tapIdx - 1]; move32(); -#ifndef OPT_BASOP_ADD_v1 - shift_q = sub( Q_filterStates[tapIdx], Q_filterStates[tapIdx - 1] ); - outRealLeft_fx = W_shr( outRealLeft_fx, shift_q ); - outImagLeft_fx = W_shr( outImagLeft_fx, shift_q ); - outRealRight_fx = W_shr( outRealRight_fx, shift_q ); - outImagRight_fx = W_shr( outImagRight_fx, shift_q ); -#endif /* OPT_BASOP_ADD_v1 */ outRealLeft_fx = W_mac_32_32( outRealLeft_fx, filterStatesLeftRealPtr_fx[tapIdx], filterTapsLeftRealPtr_fx[tapIdx] ); // Q30 + Q_filterStates outRealLeft_fx = W_mac_32_32( outRealLeft_fx, L_negate( filterStatesLeftImagPtr_fx[tapIdx] ), filterTapsLeftImagPtr_fx[tapIdx] ); // Q30 + Q_filterStates @@ -127,40 +111,24 @@ static void ivas_binRenderer_filterModule_fx( outImagRight_fx = W_mac_32_32( outImagRight_fx, filterStatesLeftRealPtr_fx[tapIdx], filterTapsRightImagPtr_fx[tapIdx] ); // Q30 + Q_filterStates outImagRight_fx = W_mac_32_32( outImagRight_fx, filterStatesLeftImagPtr_fx[tapIdx], filterTapsRightRealPtr_fx[tapIdx] ); // Q30 + Q_filterStates -#ifndef OPT_BASOP_ADD_v1 - Q_filterStates[tapIdx] = Q_filterStates[tapIdx - 1]; - move16(); -#endif /* OPT_BASOP_ADD_v1 */ } -#ifdef OPT_BASOP_ADD_v1 shift_q = add( sub( Q_filterStates, Q_curr ), 1 ); -#else /* OPT_BASOP_ADD_v1 */ - shift_q = add( sub( Q_filterStates[1], Q_curr ), 1 ); -#endif /* OPT_BASOP_ADD_v1 */ -#ifdef OPT_BASOP_ADD_v1 IF( shift_q != 0 ) { -#endif /* OPT_BASOP_ADD_v1 */ outRealLeft_fx = W_shr( outRealLeft_fx, shift_q ); // Q_curr outImagLeft_fx = W_shr( outImagLeft_fx, shift_q ); // Q_curr outRealRight_fx = W_shr( outRealRight_fx, shift_q ); // Q_curr outImagRight_fx = W_shr( outImagRight_fx, shift_q ); // Q_curr -#ifdef OPT_BASOP_ADD_v1 hBinRenderer->hBinRenConvModule->Q_filterStatesLeft = Q_curr; move16(); } -#endif /* OPT_BASOP_ADD_v1 */ filterStatesLeftRealPtr_fx[0] = CLDFB_real[chIdx][k][bandIdx]; move32(); filterStatesLeftImagPtr_fx[0] = CLDFB_imag[chIdx][k][bandIdx]; move32(); -#ifndef OPT_BASOP_ADD_v1 - Q_filterStates[0] = Q_curr; - move16(); -#endif /* OPT_BASOP_ADD_v1 */ /* Left Real and Imag */ @@ -346,12 +314,6 @@ static ivas_error ivas_binRenderer_convModuleOpen( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } -#ifndef OPT_BASOP_ADD_v1 - IF( ( hBinRenConvModule->Q_filterStatesLeft = (Word16 ***) malloc( hBinRenderer->conv_band * sizeof( Word16 ** ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); - } -#endif /* OPT_BASOP_ADD_v1 */ FOR( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) { @@ -365,12 +327,6 @@ static ivas_error ivas_binRenderer_convModuleOpen( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } -#ifndef OPT_BASOP_ADD_v1 - IF( ( hBinRenConvModule->Q_filterStatesLeft[bandIdx] = (Word16 **) malloc( hBinRenderer->nInChannels * sizeof( Word16 * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); - } -#endif /* OPT_BASOP_ADD_v1 */ FOR( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) { @@ -384,12 +340,6 @@ static ivas_error ivas_binRenderer_convModuleOpen( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } -#ifndef OPT_BASOP_ADD_v1 - IF( ( hBinRenConvModule->Q_filterStatesLeft[bandIdx][chIdx] = (Word16 *) malloc( hBinRenConvModule->numTapsArray[bandIdx] * sizeof( Word16 ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); - } -#endif /* OPT_BASOP_ADD_v1 */ } } /* set memories */ @@ -434,12 +384,8 @@ static ivas_error ivas_binRenderer_convModuleOpen( /* set the memories to zero */ set32_fx( hBinRenConvModule->filterStatesLeftReal_fx[bandIdx][chIdx], 0, hBinRenConvModule->numTapsArray[bandIdx] ); set32_fx( hBinRenConvModule->filterStatesLeftImag_fx[bandIdx][chIdx], 0, hBinRenConvModule->numTapsArray[bandIdx] ); -#ifdef OPT_BASOP_ADD_v1 hBinRenConvModule->Q_filterStatesLeft = 31; move16(); -#else /* OPT_BASOP_ADD_v1 */ - set16_fx( hBinRenConvModule->Q_filterStatesLeft[bandIdx][chIdx], 31, hBinRenConvModule->numTapsArray[bandIdx] ); -#endif /* OPT_BASOP_ADD_v1 */ IF( isLoudspeaker ) { hBinRenConvModule->filterTapsLeftReal_fx[bandIdx][chIdx] = hHrtf->leftBRIRReal_fx[bandIdx][tmp]; @@ -453,12 +399,8 @@ static ivas_error ivas_binRenderer_convModuleOpen( /* set the memories to zero */ set32_fx( hBinRenConvModule->filterStatesLeftReal_fx[bandIdx][chIdx], 0, hBinRenConvModule->numTaps ); set32_fx( hBinRenConvModule->filterStatesLeftImag_fx[bandIdx][chIdx], 0, hBinRenConvModule->numTaps ); -#ifdef OPT_BASOP_ADD_v1 hBinRenConvModule->Q_filterStatesLeft = 31; move16(); -#else /* OPT_BASOP_ADD_v1 */ - set16_fx( hBinRenConvModule->Q_filterStatesLeft[bandIdx][chIdx], 31, hBinRenConvModule->numTaps ); -#endif /* OPT_BASOP_ADD_v1 */ IF( isLoudspeaker ) { hBinRenConvModule->filterTapsLeftReal_fx[bandIdx][chIdx] = hHrtf->leftHRIRReal_fx[bandIdx][tmp]; @@ -1323,10 +1265,6 @@ static void ivas_binRenderer_convModuleClose_fx( free( hBinRenConvModule->filterStatesLeftImag_fx[bandIdx][chIdx] ); hBinRenConvModule->filterStatesLeftImag_fx[bandIdx][chIdx] = NULL; -#ifndef OPT_BASOP_ADD_v1 - free( hBinRenConvModule->Q_filterStatesLeft[bandIdx][chIdx] ); - hBinRenConvModule->Q_filterStatesLeft[bandIdx][chIdx] = NULL; -#endif /* OPT_BASOP_ADD_v1 */ } free( hBinRenConvModule->filterStatesLeftReal_fx[bandIdx] ); @@ -1335,10 +1273,6 @@ static void ivas_binRenderer_convModuleClose_fx( free( hBinRenConvModule->filterStatesLeftImag_fx[bandIdx] ); hBinRenConvModule->filterStatesLeftImag_fx[bandIdx] = NULL; -#ifndef OPT_BASOP_ADD_v1 - free( hBinRenConvModule->Q_filterStatesLeft[bandIdx] ); - hBinRenConvModule->Q_filterStatesLeft[bandIdx] = NULL; -#endif /* OPT_BASOP_ADD_v1 */ } free( hBinRenConvModule->filterStatesLeftReal_fx ); @@ -1347,10 +1281,6 @@ static void ivas_binRenderer_convModuleClose_fx( free( hBinRenConvModule->filterStatesLeftImag_fx ); hBinRenConvModule->filterStatesLeftImag_fx = NULL; -#ifndef OPT_BASOP_ADD_v1 - free( hBinRenConvModule->Q_filterStatesLeft ); - hBinRenConvModule->Q_filterStatesLeft = NULL; -#endif /* OPT_BASOP_ADD_v1 */ free( ( *hBinRenderer )->hBinRenConvModule ); ( *hBinRenderer )->hBinRenConvModule = NULL; diff --git a/lib_dec/ivas_core_dec_fx.c b/lib_dec/ivas_core_dec_fx.c index 37c32a8b1..4e654030b 100644 --- a/lib_dec/ivas_core_dec_fx.c +++ b/lib_dec/ivas_core_dec_fx.c @@ -336,11 +336,7 @@ ivas_error ivas_core_dec_fx( Word16 ovl, fade_len; IF( NE_16( sts[0]->L_frame, sts[0]->last_L_frame ) ) { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( sts[0]->hHQ_core->old_out_LB_fx, sts[0]->hHQ_core->old_out_LB_fx32, L_FRAME32k, sub( Q11, sts[0]->hHQ_core->Q_old_wtda_LB ) ); // Q11 -#else - Copy_Scale_sig_16_32_DEPREC( sts[0]->hHQ_core->old_out_LB_fx, sts[0]->hHQ_core->old_out_LB_fx32, L_FRAME32k, sub( Q11, sts[0]->hHQ_core->Q_old_wtda_LB ) ); // Q11 -#endif L_lerp_fx_q11( sts[0]->hHQ_core->old_out_LB_fx32, sts[0]->hHQ_core->old_out_LB_fx32, sts[0]->L_frame, sts[0]->last_L_frame ); Copy_Scale_sig_32_16( sts[0]->hHQ_core->old_out_LB_fx32, sts[0]->hHQ_core->old_out_LB_fx, L_FRAME32k, sub( sts[0]->hHQ_core->Q_old_wtda_LB, Q11 ) ); // Q_old_wtda_LB } @@ -527,11 +523,7 @@ ivas_error ivas_core_dec_fx( return error; } -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( output_16_fx[n], output_32_fx[n], L_FRAME48k, sub( Q11, st->Q_syn2 ) ); // Q_syn2->Q11 -#else - Copy_Scale_sig_16_32_DEPREC( output_16_fx[n], output_32_fx[n], L_FRAME48k, sub( Q11, st->Q_syn2 ) ); // Q_syn2->Q11 -#endif Scale_sig( output_16_fx[n], L_FRAME48k, negate( st->Q_syn2 ) ); // Q0 IF( st->cldfbAna ) { @@ -551,9 +543,6 @@ ivas_error ivas_core_dec_fx( st->cldfbSyn->Q_cldfb_state = Q11; move16(); } -#ifndef FIX_ISSUE_1279 /* the update of prev_Q_syn is already done inside rescale_mem( ) */ - st->prev_Q_syn = st->Q_syn; -#endif move16(); IF( save_hb_synth_32_fx ) @@ -641,11 +630,7 @@ ivas_error ivas_core_dec_fx( ivas_hq_core_dec_fx( st, synth_16_fx[n], &Q_synth, output_frame, NORMAL_HQ_CORE, core_switching_flag[n], output_16_fx[n], &Q_output ); Copy_Scale_sig_16_32_DEPREC( output_16_fx[n], output_32_fx[n], L_FRAME48k, sub( Q11, Q_output ) ); // Q11 -#ifdef MSAN_FIX Scale_sig( synth_16_fx[n], output_frame, negate( Q_synth ) ); // Q0 -#else - Scale_sig( synth_16_fx[n], L_FRAME48k, negate( Q_synth ) ); -#endif Scale_sig( output_16_fx[n], L_FRAME48k, negate( Q_output ) ); // Q0 } @@ -660,11 +645,7 @@ ivas_error ivas_core_dec_fx( td_stereo_param_updt_fx( st->lsp_old_fx, st->lsf_old_fx, st->old_pitch_buf_16_fx + st->nb_subfr, tdm_lspQ_PCh_fx, tdm_lsfQ_PCh_fx, hStereoTD->tdm_Pri_pitch_buf_fx, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( hCPE->hCoreCoder[0]->old_pitch_buf_16_fx, hCPE->hCoreCoder[0]->old_pitch_buf_fx, add( imult1616( 2, NB_SUBFR16k ), 2 ), Q10 ); // Q16 -#else - Copy_Scale_sig_16_32_DEPREC( hCPE->hCoreCoder[0]->old_pitch_buf_16_fx, hCPE->hCoreCoder[0]->old_pitch_buf_fx, add( imult1616( 2, NB_SUBFR16k ), 2 ), Q10 ); // Q16 -#endif } } /* n_channels loop */ @@ -910,19 +891,11 @@ ivas_error ivas_core_dec_fx( /* Memories Re-Scaling */ IF( hBWE_TD != NULL ) { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( hBWE_TD->syn_overlap_fx, hBWE_TD->syn_overlap_fx_32, L_SHB_LAHEAD, sub( Q11, hBWE_TD->prev_Q_bwe_syn2 ) ); // Q11 Copy_Scale_sig_16_32_no_sat( hBWE_TD->old_tbe_synth_fx, hBWE_TD->old_tbe_synth_fx_32, L_SHB_TRANSITION_LENGTH, sub( Q11, hBWE_TD->prev_Qx ) ); // Q11 Copy_Scale_sig_16_32_no_sat( hBWE_TD->state_lsyn_filt_dwn_shb_fx, hBWE_TD->state_lsyn_filt_dwn_shb_fx_32, ALLPASSSECTIONS_STEEP * 2, sub( Q11, hBWE_TD->prev_Qx ) ); // Q11 Copy_Scale_sig_16_32_no_sat( hBWE_TD->state_lsyn_filt_shb_fx, hBWE_TD->state_lsyn_filt_shb_fx_32, ALLPASSSECTIONS_STEEP * 2, sub( Q11, hBWE_TD->prev_Qx ) ); // Q11 Copy_Scale_sig_16_32_no_sat( hBWE_TD->mem_resamp_HB_fx, hBWE_TD->mem_resamp_HB_fx_32, INTERP_3_1_MEM_LEN, sub( Q11, hBWE_TD->prev_Qx ) ); // Q11 -#else - Copy_Scale_sig_16_32_DEPREC( hBWE_TD->syn_overlap_fx, hBWE_TD->syn_overlap_fx_32, L_SHB_LAHEAD, sub( Q11, st->prev_Q_bwe_syn2 ) ); // Q11 - Copy_Scale_sig_16_32_DEPREC( hBWE_TD->old_tbe_synth_fx, hBWE_TD->old_tbe_synth_fx_32, L_SHB_TRANSITION_LENGTH, sub( Q11, st->prev_Qx ) ); // Q11 - Copy_Scale_sig_16_32_DEPREC( hBWE_TD->state_lsyn_filt_dwn_shb_fx, hBWE_TD->state_lsyn_filt_dwn_shb_fx_32, ALLPASSSECTIONS_STEEP * 2, sub( Q11, st->prev_Qx ) ); // Q11 - Copy_Scale_sig_16_32_DEPREC( hBWE_TD->state_lsyn_filt_shb_fx, hBWE_TD->state_lsyn_filt_shb_fx_32, ALLPASSSECTIONS_STEEP * 2, sub( Q11, st->prev_Qx ) ); // Q11 - Copy_Scale_sig_16_32_DEPREC( hBWE_TD->mem_resamp_HB_fx, hBWE_TD->mem_resamp_HB_fx_32, INTERP_3_1_MEM_LEN, sub( Q11, st->prev_Qx ) ); // Q11 -#endif Copy( hBWE_TD->mem_resamp_HB_fx, hBWE_TD->state_32and48k_WB_upsample_fx, ( 2 * ALLPASSSECTIONS_STEEP ) ); } @@ -936,11 +909,7 @@ ivas_error ivas_core_dec_fx( test(); IF( sba_dirac_stereo_flag && NE_16( st->element_mode, IVAS_CPE_MDCT ) && !( EQ_32( st->core_brate, SID_2k40 ) && EQ_16( st->cng_type, FD_CNG ) ) ) { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( synth_16_fx[n], hSCE->save_synth_fx, output_frame, sub( hSCE->q_save_synth_fx, Q_synth ) ); // q_save_synth_fx -#else - Copy_Scale_sig_16_32_DEPREC( synth_16_fx[n], hSCE->save_synth_fx, output_frame, sub( hSCE->q_save_synth_fx, Q_synth ) ); // q_save_synth_fx -#endif } IF( NE_32( ( error = core_switching_post_dec_ivas_fx( st, synth_16_fx[n], output_32_fx[n], p_output_mem_16, use_cldfb_for_dft, output_frame, 0 /*core_switching_flag*/, sba_dirac_stereo_flag, nchan_out, last_element_mode, &Q_synth ) ), IVAS_ERR_OK ) ) @@ -954,11 +923,7 @@ ivas_error ivas_core_dec_fx( test(); IF( sba_dirac_stereo_flag && hSCE && EQ_32( st->core_brate, SID_2k40 ) && EQ_16( st->cng_type, FD_CNG ) ) { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( synth_16_fx[n], hSCE->save_synth_fx, output_frame, sub( hSCE->q_save_synth_fx, Q_synth ) ); // q_save_synth_fx -#else - Copy_Scale_sig_16_32_DEPREC( synth_16_fx[n], hSCE->save_synth_fx, output_frame, sub( hSCE->q_save_synth_fx, Q_synth ) ); // q_save_synth_fx -#endif } /* if we transition from inactive to active coding in MDCT-Stereo DTX and the output format is mono DMX, we need to sync the upsampled buffer between channels here */ @@ -985,11 +950,7 @@ ivas_error ivas_core_dec_fx( } ELSE { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( st->delay_buf_out_fx, st->delay_buf_out32_fx, ( HQ_DELTA_MAX * HQ_DELAY_COMP ), sub( Q11, st->hHQ_core->Q_old_postdec ) ); // Q11 -#else - Copy_Scale_sig_16_32_DEPREC( st->delay_buf_out_fx, st->delay_buf_out32_fx, ( HQ_DELTA_MAX * HQ_DELAY_COMP ), sub( Q11, st->hHQ_core->Q_old_postdec ) ); // Q11 -#endif } Scale_sig32( output_32_fx[n], L_FRAME48k, ( Q11 - Q4 ) ); // Q11 @@ -1003,16 +964,12 @@ ivas_error ivas_core_dec_fx( move16(); } -#ifdef MSAN_FIX IF( Q_synth > 0 ) { Scale_sig( synth_16_fx[n], output_frame, negate( Q_synth ) ); // Q0 Q_synth = 0; move16(); } -#else - Scale_sig( synth_16_fx[n], L_FRAME48k, negate( Q_synth ) ); -#endif /*------------------reset-code-start---------------------*/ @@ -1078,31 +1035,17 @@ ivas_error ivas_core_dec_fx( } /* Memories Re-Scaling */ -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( hb_synth_16_fx[n], hb_synth_32_fx[n], L_FRAME48k, sub( Q11, Q_hb_synth_fx ) ); // Q11 Copy_Scale_sig_16_32_no_sat( output_16_fx[n], output_32_fx[n], L_FRAME48k, sub( Q11, Q_input ) ); // Q11 // Q_input can get value <= -5 Copy_Scale_sig_16_32_no_sat( synth_16_fx[n], synth_32_fx[n], L_FRAME48k, sub( Q11, Q_synth_fx ) ); // Q11 -#else - Copy_Scale_sig_16_32_DEPREC( hb_synth_16_fx[n], hb_synth_32_fx[n], L_FRAME48k, sub( Q11, Q_hb_synth_fx ) ); // Q11 - Copy_Scale_sig_16_32_DEPREC( output_16_fx[n], output_32_fx[n], L_FRAME48k, sub( Q11, Q_input ) ); // Q11 - Copy_Scale_sig_16_32_DEPREC( synth_16_fx[n], synth_32_fx[n], L_FRAME48k, sub( Q11, Q_synth_fx ) ); // Q11 -#endif IF( hBWE_FD != NULL ) { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( hBWE_FD->L_old_wtda_swb_fx, hBWE_FD->L_old_wtda_swb_fx32, L_FRAME48k, sub( Q11, hBWE_FD->old_wtda_swb_fx_exp ) ); // Q11 -#else - Copy_Scale_sig_16_32_DEPREC( hBWE_FD->L_old_wtda_swb_fx, hBWE_FD->L_old_wtda_swb_fx32, L_FRAME48k, sub( Q11, hBWE_FD->old_wtda_swb_fx_exp ) ); // Q11 -#endif } IF( hBWE_TD != NULL ) { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( hBWE_TD->old_tbe_synth_fx, hBWE_TD->old_tbe_synth_fx_32, L_SHB_TRANSITION_LENGTH, sub( Q11, hBWE_TD->prev_Qx ) ); // Q11 -#else - Copy_Scale_sig_16_32_DEPREC( hBWE_TD->old_tbe_synth_fx, hBWE_TD->old_tbe_synth_fx_32, L_SHB_TRANSITION_LENGTH, sub( Q11, hBWE_TD->prev_Qx ) ); // Q11 -#endif } /*---------------------------------------------------------------------* @@ -1205,11 +1148,7 @@ ivas_error ivas_core_dec_fx( q = 2; move16(); Copy_Scale_sig_32_16( hb_synth_32_fx[n], hb_synth_16_fx[n], L_FRAME48k, -( Q11 ) ); // Q0 -#ifdef MSAN_FIX Copy_Scale_sig_32_16( synth_32_fx[n], synth_fxl, output_frame, negate( add( Q11, q ) ) ); // Q0 -#else - Copy_Scale_sig_32_16( synth_32_fx[n], synth_fxl, L_FRAME48k, negate( add( Q11, q ) ) ); -#endif Scale_sig( hBWE_TD->state_lpc_syn_fx, LPC_SHB_ORDER, sub( Q8, hBWE_TD->prev_Q_bwe_syn ) ); // Q8 Copy_Scale_sig_32_16( hBWE_TD->genSHBsynth_state_lsyn_filt_shb_local_fx_32, hBWE_TD->genSHBsynth_state_lsyn_filt_shb_local_fx, ( 2 * ALLPASSSECTIONS_STEEP ), sub( hBWE_TD->prev_Q_bwe_syn2, Q11 ) ); // prev_Q_bew_syn2 @@ -1242,7 +1181,6 @@ ivas_error ivas_core_dec_fx( move32(); } stereo_icBWE_dec_fx( hCPE, hb_synth_32_fx[0], hb_synth_32_fx[1], tmp_buffer_fx /*fb_synth_ref*/, voice_factors_fx[0], output_frame, &q, Q_white_exc ); -#ifdef MSAN_FIX test(); test(); test(); @@ -1254,10 +1192,6 @@ ivas_error ivas_core_dec_fx( Scale_sig32( hb_synth_32_fx[0], output_frame, sub( Q11, q ) ); // Q11 Scale_sig32( hb_synth_32_fx[1], output_frame, sub( Q11, q ) ); // Q11 } -#else - Scale_sig32( hb_synth_32_fx[0], L_FRAME48k, sub( Q11, q ) ); - Scale_sig32( hb_synth_32_fx[1], L_FRAME48k, sub( Q11, q ) ); -#endif } IF( EQ_16( st->element_mode, EVS_MONO ) ) @@ -1286,11 +1220,7 @@ ivas_error ivas_core_dec_fx( } waveform_adj2_fix( st->hPlcInfo, st->hTonalMDCTConc->secondLastPcmOut, synth_16_fx[n] + tmps, tmps, add( st->hPlcInfo->nbLostCmpt, 1 ), st->bfi ); -#ifdef NONBE_FIX_1402_WAVEADJUST st->hPlcInfo->Pitch_fx = 0; -#else - st->hPlcInfo->Pitch = 0; -#endif move16(); } } @@ -1476,13 +1406,8 @@ ivas_error ivas_core_dec_fx( IF( st->hHQ_core != NULL ) { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( st->hHQ_core->old_out_LB_fx, st->hHQ_core->old_out_LB_fx32, L_FRAME32k, sub( Q11, st->hHQ_core->Q_old_wtda_LB ) ); // Q11 Copy_Scale_sig_16_32_no_sat( st->hHQ_core->old_out_fx, st->hHQ_core->old_out_fx32, L_FRAME48k, sub( Q11, st->hHQ_core->Q_old_wtda ) ); // Q11 -#else - Copy_Scale_sig_16_32_DEPREC( st->hHQ_core->old_out_LB_fx, st->hHQ_core->old_out_LB_fx32, L_FRAME32k, sub( Q11, st->hHQ_core->Q_old_wtda_LB ) ); // Q11 - Copy_Scale_sig_16_32_DEPREC( st->hHQ_core->old_out_fx, st->hHQ_core->old_out_fx32, L_FRAME48k, sub( Q11, st->hHQ_core->Q_old_wtda ) ); // Q11 -#endif } IF( NE_16( st->element_mode, IVAS_CPE_DFT ) ) diff --git a/lib_dec/ivas_cpe_dec_fx.c b/lib_dec/ivas_cpe_dec_fx.c index 05fec7736..c10c6beda 100644 --- a/lib_dec/ivas_cpe_dec_fx.c +++ b/lib_dec/ivas_cpe_dec_fx.c @@ -124,22 +124,14 @@ ivas_error ivas_cpe_dec_fx( test(); IF( hCPE->hCoreCoder[ind1] && hCPE->hCoreCoder[ind1]->hHQ_core ) { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( hCPE->hCoreCoder[ind1]->hHQ_core->old_out_fx, hCPE->hCoreCoder[ind1]->hHQ_core->old_out_fx32, L_FRAME48k, sub( Q11, hCPE->hCoreCoder[ind1]->hHQ_core->Q_old_wtda ) ); // Q11 -#else - Copy_Scale_sig_16_32_DEPREC( hCPE->hCoreCoder[ind1]->hHQ_core->old_out_fx, hCPE->hCoreCoder[ind1]->hHQ_core->old_out_fx32, L_FRAME48k, sub( Q11, hCPE->hCoreCoder[ind1]->hHQ_core->Q_old_wtda ) ); // Q11 -#endif } } FOR( Word16 ind1 = 0; ind1 < 2; ind1++ ) { IF( hCPE->hCoreCoder[ind1]->hHQ_core ) { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( hCPE->hCoreCoder[ind1]->hHQ_core->old_out_LB_fx, hCPE->hCoreCoder[ind1]->hHQ_core->old_out_LB_fx32, L_FRAME32k, sub( Q11, hCPE->hCoreCoder[ind1]->hHQ_core->Q_old_wtda_LB ) ); // Q11 -#else - Copy_Scale_sig_16_32_DEPREC( hCPE->hCoreCoder[ind1]->hHQ_core->old_out_LB_fx, hCPE->hCoreCoder[ind1]->hHQ_core->old_out_LB_fx32, L_FRAME32k, sub( Q11, hCPE->hCoreCoder[ind1]->hHQ_core->Q_old_wtda_LB ) ); // Q11 -#endif hCPE->hCoreCoder[ind1]->hHQ_core->q_old_outLB_fx = Q11; move16(); } diff --git a/lib_dec/ivas_dirac_dec_fx.c b/lib_dec/ivas_dirac_dec_fx.c index ae4098f19..b45f54d48 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -2113,11 +2113,7 @@ void ivas_dirac_dec_render_fx( FOR( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { -#ifdef MSAN_FIX ivas_dirac_dec_render_sf_fx( st_ivas, output_f_local_fx, nchan_transport, NULL, NULL ); -#else - ivas_dirac_dec_render_sf_fx( st_ivas, output_f_local, nchan_transport, NULL, NULL ); -#endif // MSAN_FIX n_samples_sf = i_mult( hSpatParamRendCom->subframe_nbslots[subframe_idx], hSpatParamRendCom->slot_size ); @@ -3747,11 +3743,7 @@ void ivas_dirac_dec_render_sf_fx( st_ivas->cldfbSynDec[ch]->Q_cldfb_state = ( Q6 - 1 ); move16(); -#ifdef OPT_SBA_AVOID_SPAR_RESCALE cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, synth_fx, i_mult( hSpatParamRendCom->num_freq_bands, hSpatParamRendCom->subframe_nbslots[subframe_idx] ), 0, st_ivas->cldfbSynDec[ch] ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, synth_fx, i_mult( hSpatParamRendCom->num_freq_bands, hSpatParamRendCom->subframe_nbslots[subframe_idx] ), st_ivas->cldfbSynDec[ch] ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ Word16 no_col = st_ivas->cldfbSynDec[ch]->no_col; move16(); @@ -3854,11 +3846,7 @@ void ivas_dirac_dec_render_sf_fx( ImagBuffer_fx[i] = Cldfb_ImagBuffer_fx[idx_in][i]; move32(); } -#ifdef OPT_SBA_AVOID_SPAR_RESCALE cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, &( output_buf_fx[ch][subframe_start_sample] ), num_samples_subframe, 0, st_ivas->cldfbSynDec[idx_in] ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, &( output_buf_fx[ch][subframe_start_sample] ), num_samples_subframe, st_ivas->cldfbSynDec[idx_in] ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ IF( !st_ivas->hLsSetupCustom->separate_ch_found ) { @@ -3898,11 +3886,7 @@ void ivas_dirac_dec_render_sf_fx( scale_sig32( st_ivas->cldfbSynDec[cldfbSynIdx]->cldfb_state_fx, st_ivas->cldfbSynDec[cldfbSynIdx]->p_filter_length, sub( ( Q6 - 1 ), st_ivas->cldfbSynDec[cldfbSynIdx]->Q_cldfb_state ) ); // Q6-1 st_ivas->cldfbSynDec[cldfbSynIdx]->Q_cldfb_state = ( Q6 - 1 ); move16(); -#ifdef OPT_SBA_AVOID_SPAR_RESCALE cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, p_out, samplesToProcess, 0, st_ivas->cldfbSynDec[cldfbSynIdx] ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, p_out, samplesToProcess, st_ivas->cldfbSynDec[cldfbSynIdx] ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ // Calculating length of output Word16 no_col = st_ivas->cldfbSynDec[cldfbSynIdx]->no_col; @@ -3971,11 +3955,7 @@ void ivas_dirac_dec_render_sf_fx( st_ivas->cldfbSynDec[idx_in]->Q_cldfb_state = ( Q6 - 1 ); move16(); -#ifdef OPT_SBA_AVOID_SPAR_RESCALE cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, p_out, samplesToProcess, 0, st_ivas->cldfbSynDec[idx_in] ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, p_out, samplesToProcess, st_ivas->cldfbSynDec[idx_in] ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ // Scaling output from Q6-1 to Q11 Scale_sig32( p_out, out_len, ( Q11 - ( Q6 - 1 ) ) ); diff --git a/lib_dec/ivas_dirac_output_synthesis_cov_fx.c b/lib_dec/ivas_dirac_output_synthesis_cov_fx.c index b247fd653..114083fad 100644 --- a/lib_dec/ivas_dirac_output_synthesis_cov_fx.c +++ b/lib_dec/ivas_dirac_output_synthesis_cov_fx.c @@ -723,11 +723,7 @@ Word16 computeMixingMatrices_fx( Word32 G_hat_fx[MAX_OUTPUT_CHANNELS]; Word16 G_hat_buff_e[MAX_OUTPUT_CHANNELS]; -#ifdef OPT_BASOP_ADD_v1 Word16 mat_mult_buffer2_e, mat_mult_buffer3_e; -#else /* OPT_BASOP_ADD_v1 */ - Word16 mat_mult_buffer1_e, mat_mult_buffer2_e, mat_mult_buffer3_e; -#endif /* OPT_BASOP_ADD_v1 */ Word32 mat_mult_buffer3_fx[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; @@ -777,9 +773,7 @@ Word16 computeMixingMatrices_fx( mat2svdMat_fx( Cy_fx, svd_in_buffer_fx, lengthCy, lengthCy, 0 ); svd_fx( svd_in_buffer_fx, Cy_fx_e, svd_u_buffer_fx, svd_s_buffer_fx, svd_v_buffer_fx, svd_s_buffer_e, lengthCy, lengthCy ); -#ifdef OPT_BASOP_ADD_v1 Word16 max_e = -32; -#endif /* OPT_BASOP_ADD_v1 */ /* Computing Ky */ FOR( i = 0; i < lengthCy; ++i ) { @@ -792,12 +786,9 @@ Word16 computeMixingMatrices_fx( move32(); Ky_fx_e[i + ( j * lengthCy )] = tmp_e; move16(); -#ifdef OPT_BASOP_ADD_v1 max_e = s_max( max_e, tmp_e ); -#endif /* OPT_BASOP_ADD_v1 */ } } -#ifdef OPT_BASOP_ADD_v1 FOR( i = 0; i < lengthCy * lengthCy; ++i ) { Ky_fx[i] = L_shr( Ky_fx[i], sub( max_e, Ky_fx_e[i] ) ); @@ -805,7 +796,6 @@ Word16 computeMixingMatrices_fx( Ky_fx_e[i] = max_e; move16(); } -#endif /* OPT_BASOP_ADD_v1 */ /*-----------------------------------------------------------------* * Decomposition of Cx @@ -816,9 +806,7 @@ Word16 computeMixingMatrices_fx( mat2svdMat_fx( Cx_fx, svd_in_buffer_fx, lengthCx, lengthCx, 0 ); svd_fx( svd_in_buffer_fx, Cx_fx_e, svd_u_buffer_fx, svd_s_buffer_fx, svd_v_buffer_fx, svd_s_buffer_e, lengthCx, lengthCx ); -#ifdef OPT_BASOP_ADD_v1 max_e = -32; -#endif /* OPT_BASOP_ADD_v1 */ FOR( i = 0; i < lengthCx; ++i ) { FOR( j = 0; j < lengthCx; ++j ) @@ -830,12 +818,9 @@ Word16 computeMixingMatrices_fx( move32(); Kx_fx_e[( i + ( j * lengthCx ) )] = tmp_e; move16(); -#ifdef OPT_BASOP_ADD_v1 max_e = s_max( max_e, tmp_e ); -#endif /* OPT_BASOP_ADD_v1 */ } } -#ifdef OPT_BASOP_ADD_v1 FOR( i = 0; i < lengthCx * lengthCx; ++i ) { Kx_fx[i] = L_shr( Kx_fx[i], sub( max_e, Kx_fx_e[i] ) ); @@ -843,7 +828,6 @@ Word16 computeMixingMatrices_fx( Kx_fx_e[i] = max_e; move16(); } -#endif /* OPT_BASOP_ADD_v1 */ FOR( i = 0; i < lengthCx; ++i ) { @@ -967,49 +951,15 @@ Word16 computeMixingMatrices_fx( /* Computing the input matrix Kx'*Q'*G_hat'*Ky */ -#ifdef OPT_BASOP_ADD_v1 Word16 mat_mult_buffer1_fx_e; -#else /* OPT_BASOP_ADD_v1 */ - Word16 mat_mult_buffer1_fx_e[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; - Word16 Q_e_arr[PARAM_MC_MAX_TRANSPORT_CHANS * MAX_CICP_CHANNELS]; - set16_fx( Q_e_arr, Q_e, PARAM_MC_MAX_TRANSPORT_CHANS * MAX_CICP_CHANNELS ); - - matrix_product_mant_exp( Kx_fx, Kx_fx_e, lengthCx, lengthCx, 1, Q_fx, Q_e_arr, lengthCy, lengthCx, 1, mat_mult_buffer1_fx, mat_mult_buffer1_fx_e ); -#endif /* OPT_BASOP_ADD_v1 */ Word16 mat_mult_buffer2_fx_e[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; -#ifdef OPT_BASOP_ADD_v1 matrix_product_mant_exp_fx( Kx_fx, Kx_fx_e[0], lengthCx, lengthCx, 1, Q_fx, Q_e, lengthCy, lengthCx, 1, mat_mult_buffer1_fx, &mat_mult_buffer1_fx_e ); matrix_diag_product_fx_2( mat_mult_buffer1_fx, mat_mult_buffer1_fx_e, lengthCx, lengthCy, 0, G_hat_fx, G_hat_buff_e, lengthCy, mat_mult_buffer2_fx, mat_mult_buffer2_fx_e ); matrix_product_mant_exp_fx( mat_mult_buffer2_fx, mat_mult_buffer2_fx_e[0], lengthCx, lengthCy, 0, Ky_fx, Ky_fx_e[0], lengthCy, lengthCy, 0, mat_mult_buffer1_fx, &mat_mult_buffer1_fx_e ); -#else /* OPT_BASOP_ADD_v1 */ - matrix_diag_product_fx_1( mat_mult_buffer1_fx, mat_mult_buffer1_fx_e, lengthCx, lengthCy, 0, G_hat_fx, G_hat_buff_e, lengthCy, mat_mult_buffer2_fx, mat_mult_buffer2_fx_e ); - - matrix_product_mant_exp( mat_mult_buffer2_fx, mat_mult_buffer2_fx_e, lengthCx, lengthCy, 0, Ky_fx, Ky_fx_e, lengthCy, lengthCy, 0, mat_mult_buffer1_fx, mat_mult_buffer1_fx_e ); - - exp = mat_mult_buffer1_fx_e[0]; - move16(); - FOR( i = 1; i < lengthCy * lengthCx; i++ ) - { - if ( LT_16( exp, mat_mult_buffer1_fx_e[i] ) ) - { - exp = mat_mult_buffer1_fx_e[i]; - move16(); - } - } - - FOR( i = 0; i < lengthCy * lengthCx; i++ ) - { - mat_mult_buffer1_fx[i] = L_shr( mat_mult_buffer1_fx[i], sub( exp, mat_mult_buffer1_fx_e[i] ) ); // Q(31-exp) - move32(); - } - - mat_mult_buffer1_e = exp; - move16(); -#endif /* OPT_BASOP_ADD_v1 */ IF( LT_16( lengthCx, lengthCy ) ) { @@ -1018,11 +968,7 @@ Word16 computeMixingMatrices_fx( move16(); nC = lengthCx; move16(); -#ifdef OPT_BASOP_ADD_v1 svd_fx( svd_in_buffer_fx, mat_mult_buffer1_fx_e, svd_v_buffer_fx, svd_s_buffer_fx, svd_u_buffer_fx, svd_s_buffer_e, nL, nC ); -#else /* OPT_BASOP_ADD_v1 */ - svd_fx( svd_in_buffer_fx, mat_mult_buffer1_e, svd_v_buffer_fx, svd_s_buffer_fx, svd_u_buffer_fx, svd_s_buffer_e, nL, nC ); -#endif /* OPT_BASOP_ADD_v1 */ } ELSE { @@ -1031,11 +977,7 @@ Word16 computeMixingMatrices_fx( move16(); nC = lengthCy; move16(); -#ifdef OPT_BASOP_ADD_v1 svd_fx( svd_in_buffer_fx, mat_mult_buffer1_fx_e, svd_u_buffer_fx, svd_s_buffer_fx, svd_v_buffer_fx, svd_s_buffer_e, nL, nC ); -#else /* OPT_BASOP_ADD_v1 */ - svd_fx( svd_in_buffer_fx, mat_mult_buffer1_e, svd_u_buffer_fx, svd_s_buffer_fx, svd_v_buffer_fx, svd_s_buffer_e, nL, nC ); -#endif /* OPT_BASOP_ADD_v1 */ } /* Actually Processing P */ @@ -1046,46 +988,25 @@ Word16 computeMixingMatrices_fx( svdMat2mat_fx( svd_v_buffer_fx, mat_mult_buffer1_fx, lengthCy, lengthCx ); svdMat2mat_fx( svd_u_buffer_fx, mat_mult_buffer2_fx, lengthCx, lengthCx ); -#ifdef OPT_BASOP_ADD_v1 mat_mult_buffer1_fx_e = 0; -#else /* OPT_BASOP_ADD_v1 */ - mat_mult_buffer1_e = 0; -#endif /* OPT_BASOP_ADD_v1 */ move16(); mat_mult_buffer2_e = 0; move16(); -#ifdef OPT_BASOP_ADD_v1 matrix_product_mant_exp_fx( mat_mult_buffer1_fx, mat_mult_buffer1_fx_e, lengthCy, lengthCx, 0, mat_mult_buffer2_fx, mat_mult_buffer2_e, lengthCx, lengthCx, 1, mat_mult_buffer3_fx, &mat_mult_buffer3_e ); -#else /* OPT_BASOP_ADD_v1 */ - matrix_product_mant_exp_fx( mat_mult_buffer1_fx, mat_mult_buffer1_e, lengthCy, lengthCx, 0, - mat_mult_buffer2_fx, mat_mult_buffer2_e, lengthCx, lengthCx, 1, - mat_mult_buffer3_fx, &mat_mult_buffer3_e ); -#endif /* OPT_BASOP_ADD_v1 */ /************************ Formulate M **********************/ -#ifdef OPT_BASOP_ADD_v1 matrix_product_mant_exp_fx( Ky_fx, Ky_fx_e[0], lengthCy, lengthCy, 0, mat_mult_buffer3_fx, mat_mult_buffer3_e, lengthCy, lengthCx, 0, mat_mult_buffer1_fx, &mat_mult_buffer1_fx_e ); -#else /* OPT_BASOP_ADD_v1 */ - Word16 mat_mult_buffer3_fx_e[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; - set16_fx( mat_mult_buffer3_fx_e, mat_mult_buffer3_e, MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS ); - - matrix_product_mant_exp( Ky_fx, Ky_fx_e, lengthCy, lengthCy, 0, mat_mult_buffer3_fx, mat_mult_buffer3_fx_e, lengthCy, lengthCx, 0, mat_mult_buffer1_fx, mat_mult_buffer1_fx_e ); -#endif /* OPT_BASOP_ADD_v1 */ Word16 mixing_matrix_fx_e[MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; -#ifdef OPT_BASOP_ADD_v1 Word16 mat_mult_buffer1_fx_e1[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; set16_fx( mat_mult_buffer1_fx_e1, mat_mult_buffer1_fx_e, MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS ); matrix_product_mant_exp( mat_mult_buffer1_fx, mat_mult_buffer1_fx_e1, lengthCy, lengthCx, 0, Kx_reg_inv_fx, Kx_reg_inv_e, lengthCx, lengthCx, 0, mixing_matrix_fx, mixing_matrix_fx_e ); -#else /* OPT_BASOP_ADD_v1 */ - matrix_product_mant_exp( mat_mult_buffer1_fx, mat_mult_buffer1_fx_e, lengthCy, lengthCx, 0, Kx_reg_inv_fx, Kx_reg_inv_e, lengthCx, lengthCx, 0, mixing_matrix_fx, mixing_matrix_fx_e ); -#endif /* OPT_BASOP_ADD_v1 */ /*-----------------------------------------------------------------* * Formulate Cr @@ -1096,15 +1017,9 @@ Word16 computeMixingMatrices_fx( Word16 Cx_e_arr[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; set16_fx( Cx_e_arr, Cx_fx_e, PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS ); -#ifdef OPT_BASOP_ADD_v1 matrix_product_mant_exp( mixing_matrix_fx, mixing_matrix_fx_e, lengthCy, lengthCx, 0, Cx_fx, Cx_e_arr, lengthCx, lengthCx, 0, mat_mult_buffer1_fx, mat_mult_buffer1_fx_e1 ); matrix_product_mant_exp( mat_mult_buffer1_fx, mat_mult_buffer1_fx_e1, lengthCy, lengthCx, 0, mixing_matrix_fx, mixing_matrix_fx_e, lengthCy, lengthCx, 1, mat_mult_buffer2_fx, mat_mult_buffer2_fx_e ); -#else /* OPT_BASOP_ADD_v1 */ - matrix_product_mant_exp( mixing_matrix_fx, mixing_matrix_fx_e, lengthCy, lengthCx, 0, Cx_fx, Cx_e_arr, lengthCx, lengthCx, 0, mat_mult_buffer1_fx, mat_mult_buffer1_fx_e ); - - matrix_product_mant_exp( mat_mult_buffer1_fx, mat_mult_buffer1_fx_e, lengthCy, lengthCx, 0, mixing_matrix_fx, mixing_matrix_fx_e, lengthCy, lengthCx, 1, mat_mult_buffer2_fx, mat_mult_buffer2_fx_e ); -#endif /* OPT_BASOP_ADD_v1 */ exp = mixing_matrix_fx_e[0]; move16(); @@ -1143,11 +1058,7 @@ Word16 computeMixingMatrices_fx( } /* Avoid Meaningless negative main diagonal elements */ -#ifdef OPT_BASOP_ADD_v1 IF( Cr_fx[i + ( i * lengthCy )] < 0 ) -#else /* OPT_BASOP_ADD_v1 */ - IF( BASOP_Util_Cmp_Mant32Exp( Cr_fx[i + ( i * lengthCy )], exp, 0, 0 ) < 0 ) -#endif /* OPT_BASOP_ADD_v1 */ { Cr_fx[i + ( i * lengthCy )] = 0; move32(); @@ -1209,11 +1120,7 @@ Word16 computeMixingMatrices_fx( { /* Avoid correction for very small energies, main diagonal elements of Cy_tilde_p may be negative */ -#ifdef OPT_BASOP_ADD_v1 IF( Cy_tilde_p_fx[i + ( i * lengthCy )] < 0 ) -#else /* OPT_BASOP_ADD_v1 */ - IF( BASOP_Util_Cmp_Mant32Exp( Cy_tilde_p_fx[i + ( i * lengthCy )], mat_mult_buffer2_e, 0, 0 ) < 0 ) -#endif /* OPT_BASOP_ADD_v1 */ { adj_fx_p[i] = 1073741824; // 1.0f in Q30 move32(); @@ -1232,12 +1139,8 @@ Word16 computeMixingMatrices_fx( move16(); } -#ifdef OPT_BASOP_ADD_v1 Word32 temp = W_shl_sat_l( W_deposit32_l( 4 ), sub( 31, adj_e[i] ) ); IF( GT_32( adj_fx_p[i], temp ) ) -#else /* OPT_BASOP_ADD_v1 */ - IF( BASOP_Util_Cmp_Mant32Exp( adj_fx_p[i], adj_e[i], 1073741824, 3 ) > 0 ) -#endif /* OPT_BASOP_ADD_v1 */ { adj_fx_p[i] = 1073741824; // 1.0f in Q30 move32(); @@ -1322,11 +1225,7 @@ Word16 computeMixingMatricesResidual_fx( Word16 mixing_matrix_e = 0, mat_mult_buffer1_e, adj_e, mat_mult_buffer3_e, mat_mult_buffer2_e; move16(); -#ifdef MSAN_FIX Word32 svd_s_buffer_fx[MAX_OUTPUT_CHANNELS] = { 0 }; -#else - Word32 svd_s_buffer_fx[MAX_OUTPUT_CHANNELS]; -#endif Word16 svd_s_buffer_e[MAX_OUTPUT_CHANNELS]; Word32 L_tmp; Word16 tmp_e; @@ -1370,9 +1269,7 @@ Word16 computeMixingMatricesResidual_fx( svd_fx( svd_in_buffer_fx, Cy_fx_e, svd_u_buffer_fx, svd_s_buffer_fx, svd_v_buffer_fx, svd_s_buffer_e, lengthCy, lengthCy ); /* Computing Ky */ -#ifdef OPT_BASOP_ADD_v1 Word16 max_e = -32; -#endif /* OPT_BASOP_ADD_v1 */ FOR( i = 0; i < lengthCy; ++i ) { FOR( j = 0; j < lengthCy; ++j ) @@ -1384,13 +1281,10 @@ Word16 computeMixingMatricesResidual_fx( move32(); Ky_fx_e[i + j * lengthCy] = tmp_e; move16(); -#ifdef OPT_BASOP_ADD_v1 max_e = s_max( max_e, tmp_e ); -#endif /* OPT_BASOP_ADD_v1 */ } } -#ifdef OPT_BASOP_ADD_v1 FOR( i = 0; i < lengthCy * lengthCy; ++i ) { Ky_fx[i] = L_shr( Ky_fx[i], sub( max_e, Ky_fx_e[i] ) ); @@ -1398,7 +1292,6 @@ Word16 computeMixingMatricesResidual_fx( Ky_fx_e[i] = max_e; move16(); } -#endif /* OPT_BASOP_ADD_v1 */ /*-----------------------------------------------------------------* * Decomposition of Cx @@ -1410,9 +1303,7 @@ Word16 computeMixingMatricesResidual_fx( * square root of the diagonal of Cx */ /* Computing Kx */ -#ifdef OPT_BASOP_ADD_v1 max_e = -32; -#endif /* OPT_BASOP_ADD_v1 */ FOR( i = 0; i < lengthCx; ++i ) { exp = Cx_e; @@ -1421,12 +1312,9 @@ Word16 computeMixingMatricesResidual_fx( move32(); Kx_fx_e[i] = exp; move16(); -#ifdef OPT_BASOP_ADD_v1 max_e = s_max( max_e, exp ); -#endif /* OPT_BASOP_ADD_v1 */ } -#ifdef OPT_BASOP_ADD_v1 FOR( i = 0; i < lengthCx; ++i ) { Kx_fx[i] = L_shr( Kx_fx[i], sub( max_e, Kx_fx_e[i] ) ); @@ -1434,7 +1322,6 @@ Word16 computeMixingMatricesResidual_fx( Kx_fx_e[i] = max_e; move16(); } -#endif /* OPT_BASOP_ADD_v1 */ /*-----------------------------------------------------------------* * Regularization of Sx @@ -1442,25 +1329,13 @@ Word16 computeMixingMatricesResidual_fx( limit_fx = Kx_fx[0]; move32(); -#ifndef OPT_BASOP_ADD_v1 - limit_e = Kx_fx_e[0]; - move16(); -#endif /* OPT_BASOP_ADD_v1 */ FOR( i = 1; i < lengthCx; i++ ) { -#ifdef OPT_BASOP_ADD_v1 IF( GT_32( Kx_fx[i], limit_fx ) ) -#else /* OPT_BASOP_ADD_v1 */ - IF( BASOP_Util_Cmp_Mant32Exp( Kx_fx[i], Kx_fx_e[i], limit_fx, limit_e ) > 0 ) -#endif /* OPT_BASOP_ADD_v1 */ { limit_fx = Kx_fx[i]; move32(); -#ifndef OPT_BASOP_ADD_v1 - limit_e = Kx_fx_e[i]; - move16(); -#endif /* OPT_BASOP_ADD_v1 */ } } @@ -1468,11 +1343,7 @@ Word16 computeMixingMatricesResidual_fx( L_tmp = L_add( L_tmp, EPSILLON_FX ); limit_fx = L_tmp; move16(); -#ifdef OPT_BASOP_ADD_v1 limit_e = add( Kx_fx_e[0], reg_Sx_e ); -#else /* OPT_BASOP_ADD_v1 */ - limit_e = add( limit_e, reg_Sx_e ); -#endif /* OPT_BASOP_ADD_v1 */ FOR( i = 0; i < lengthCx; ++i ) { @@ -1622,15 +1493,8 @@ Word16 computeMixingMatricesResidual_fx( *-----------------------------------------------------------------*/ -#ifdef OPT_BASOP_ADD_v1 matrix_product_mant_exp_fx( Ky_fx, Ky_fx_e[0], lengthCy, lengthCy, 0, mat_mult_buffer3_fx, mat_mult_buffer3_e, lengthCy, lengthCx, 0, mat_mult_buffer1_fx, mat_mult_buffer1_buff_e ); set16_fx( mat_mult_buffer1_buff_e, mat_mult_buffer1_buff_e[0], MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS ); -#else /* OPT_BASOP_ADD_v1 */ - Word16 mat_mult_buffer3_fx_e[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; - set16_fx( mat_mult_buffer3_fx_e, mat_mult_buffer3_e, MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS ); - - matrix_product_mant_exp( Ky_fx, Ky_fx_e, lengthCy, lengthCy, 0, mat_mult_buffer3_fx, mat_mult_buffer3_fx_e, lengthCy, lengthCx, 0, mat_mult_buffer1_fx, mat_mult_buffer1_buff_e ); -#endif /* OPT_BASOP_ADD_v1 */ Word16 mixing_matrix_fx_e[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS]; @@ -1715,12 +1579,8 @@ Word16 computeMixingMatricesResidual_fx( move32(); adj_buff_e[i] = scale; move16(); -#ifdef OPT_BASOP_ADD_v1 Word32 temp = W_shl_sat_l( W_deposit32_l( 4 ), sub( 31, scale ) ); IF( GT_32( adj_fx_p[i], temp ) ) // 1073741824 -> 1.0f in Q30 -#else /* OPT_BASOP_ADD_v1 */ - IF( BASOP_Util_Cmp_Mant32Exp( adj_fx_p[i], scale, 1073741824, 3 ) > 0 ) // 1073741824 -> 1.0f in Q30 -#endif /* OPT_BASOP_ADD_v1 */ { adj_fx_p[i] = 1073741824; // 1.0f in Q30 move32(); @@ -2115,12 +1975,8 @@ Word16 computeMixingMatricesISM_fx( } } -#ifdef OPT_BASOP_ADD_v1 Word32 temp = W_shl_sat_l( W_deposit32_l( 4 ), sub( 31, temp_e[i] ) ); IF( GT_32( adj_fx[i], temp ) ) -#else /* OPT_BASOP_ADD_v1 */ - IF( BASOP_Util_Cmp_Mant32Exp( adj_fx[i], temp_e[i], MAX_32, 2 ) > 0 ) -#endif /* OPT_BASOP_ADD_v1 */ { adj_fx[i] = MAX_32; move32(); diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 292721723..4770d2193 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1266,9 +1266,7 @@ ivas_error ivas_init_decoder_fx( { return error; } -#ifdef MSAN_FIX set16_fx( st_ivas->hSpar->hFbMixer->cldfb_cross_fade_fx, 0, CLDFB_NO_COL_MAX ); -#endif test(); IF( EQ_32( st_ivas->renderer_type, RENDERER_SBA_LINEAR_DEC ) && st_ivas->hOutSetup.is_loudspeaker_setup ) { diff --git a/lib_dec/ivas_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index c818af237..7686a5e8a 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -511,9 +511,7 @@ static ivas_error ivas_param_ism_rendering_init_fx( { set32_fx( hParamIsmRendering->mixing_matrix_lin_old_fx[bin_idx], 0, PARAM_ISM_MAX_CHAN * PARAM_ISM_MAX_DMX ); } -#ifdef MSAN_FIX set16_fx( hParamIsmRendering->exp_mixing_matrix_lin_old_fx, 0, CLDFB_NO_CHANNELS_MAX ); -#endif /* memory allocation for proto matrix and interpolator */ IF( ( hParamIsmRendering->proto_matrix_fx = (Word16 *) malloc( hOutSetup.nchan_out_woLFE * nchan_transport * sizeof( Word16 ) ) ) == NULL ) @@ -1535,11 +1533,7 @@ static void ivas_ism_param_dec_render_sf_fx( Scale_sig32( st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->p_filter_length, sub( sub( Q_real, 1 ), Q11 ) ); // Q_real-1 st_ivas->cldfbSynDec[ch]->Q_cldfb_state = sub( Q_real, 1 ); move16(); -#ifdef OPT_SBA_AVOID_SPAR_RESCALE cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, output_f_fx[ch], i_mult( hSpatParamRendCom->num_freq_bands, hSpatParamRendCom->subframe_nbslots[subframe_idx] ), 0, st_ivas->cldfbSynDec[ch] ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, output_f_fx[ch], i_mult( hSpatParamRendCom->num_freq_bands, hSpatParamRendCom->subframe_nbslots[subframe_idx] ), st_ivas->cldfbSynDec[ch] ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ Scale_sig32( st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->p_filter_length, sub( Q11, sub( Q_real, 1 ) ) ); // Q11 st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q11; move16(); diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 1918ce3f3..93e8bb4eb 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -129,10 +129,8 @@ ivas_error ivas_jbm_dec_tc_fx( set_zero_fx( st_ivas->p_output_fx[n], L_FRAME48k ); st_ivas->hTcBuffer->tc_fx[n] = st_ivas->p_output_fx[n]; } -#ifdef MSAN_FIX st_ivas->hTcBuffer->no_channels = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); move16(); -#endif } Word16 ch; @@ -434,19 +432,13 @@ ivas_error ivas_jbm_dec_tc_fx( } IF( hCPE->hCoreCoder[0] != NULL ) { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( hCPE->hCoreCoder[0]->hHQ_core->old_out_LB_fx, hCPE->hCoreCoder[0]->hHQ_core->old_out_LB_fx32, L_FRAME32k, q - hCPE->hCoreCoder[0]->hHQ_core->Q_old_wtda_LB ); // q Copy_Scale_sig_16_32_no_sat( hCPE->hCoreCoder[0]->hHQ_core->old_out_fx, hCPE->hCoreCoder[0]->hHQ_core->old_out_fx32, L_FRAME48k, q - hCPE->hCoreCoder[0]->hHQ_core->Q_old_wtda ); // q -#else - Copy_Scale_sig_16_32_DEPREC( hCPE->hCoreCoder[0]->hHQ_core->old_out_LB_fx, hCPE->hCoreCoder[0]->hHQ_core->old_out_LB_fx32, L_FRAME32k, q - hCPE->hCoreCoder[0]->hHQ_core->Q_old_wtda_LB ); // q - Copy_Scale_sig_16_32_DEPREC( hCPE->hCoreCoder[0]->hHQ_core->old_out_fx, hCPE->hCoreCoder[0]->hHQ_core->old_out_fx32, L_FRAME48k, q - hCPE->hCoreCoder[0]->hHQ_core->Q_old_wtda ); // q -#endif hCPE->hCoreCoder[0]->hHQ_core->q_old_outLB_fx = q; move16(); } IF( hCPE->hStereoDft != NULL ) { -#ifdef MSAN_FIX IF( LE_16( st_ivas->nchan_transport, 1 ) ) { st = hCPE->hCoreCoder[0]; @@ -494,9 +486,6 @@ ivas_error ivas_jbm_dec_tc_fx( } } } -#else - scale_sig32( hCPE->hStereoDft->buff_LBTCX_mem_fx, NS2SA( 16000, STEREO_DFT32MS_OVL_NS ), sub( hCPE->hStereoDft->q_dft, Q11 ) ); -#endif scale_sig32( hCPE->hStereoDft->ap_delay_mem_fx, NS2SA_FX2( 16000, DELAY_BWE_TOTAL_NS ), sub( hCPE->hStereoDft->q_dft, hCPE->hStereoDft->q_ap_fade_mem_fx ) ); // q_dft hCPE->hStereoDft->q_ap_fade_mem_fx = hCPE->hStereoDft->q_dft; move16(); @@ -517,14 +506,10 @@ ivas_error ivas_jbm_dec_tc_fx( hCPE->q_output_mem_fx[ii] = hCPE->hStereoDft->q_dft; move16(); } -#ifdef MSAN_FIX FOR( ii = 0; ii < CPE_CHANNELS; ii++ ) { Scale_sig32( &hCPE->prev_synth_fx[ii][0], NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, IVAS_DEC_DELAY_NS - STEREO_DFT32MS_OVL_NS ), sub( hCPE->q_prev_synth_fx, Q11 ) ); // q_prev_synth_fx } -#else - Scale_sig32( &hCPE->prev_synth_fx[0][0], sizeof( hCPE->prev_synth_fx ) / sizeof( hCPE->prev_synth_fx[0][0] ), hCPE->q_prev_synth_fx - 11 ); -#endif ivas_sba_dirac_stereo_dec_fx( st_ivas, p_output_fx, output_frame, st_ivas->ivas_format == MC_FORMAT ); @@ -532,14 +517,10 @@ ivas_error ivas_jbm_dec_tc_fx( { Scale_sig32( p_output_fx[i], L_FRAME48k, negate( s ) ); } -#ifdef MSAN_FIX FOR( ii = 0; ii < CPE_CHANNELS; ii++ ) { Scale_sig32( &hCPE->prev_synth_fx[ii][0], NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, IVAS_DEC_DELAY_NS - STEREO_DFT32MS_OVL_NS ), sub( Q11, hCPE->q_prev_synth_fx ) ); // Q11 } -#else - Scale_sig32( &hCPE->prev_synth_fx[0][0], sizeof( hCPE->prev_synth_fx ) / sizeof( hCPE->prev_synth_fx[0][0] ), 11 - hCPE->q_prev_synth_fx ); -#endif scale_sig32( hCPE->input_mem_BPF_fx[0], STEREO_DFT32MS_OVL_16k, sub( Q11, hCPE->hStereoDft->q_dft ) ); FOR( i = 0; i < CPE_CHANNELS; ++i ) @@ -555,7 +536,6 @@ ivas_error ivas_jbm_dec_tc_fx( } IF( hCPE->hStereoDft != NULL ) { -#ifdef MSAN_FIX IF( LE_16( st_ivas->nchan_transport, 1 ) ) { st = hCPE->hCoreCoder[0]; @@ -603,9 +583,6 @@ ivas_error ivas_jbm_dec_tc_fx( } } } -#else - scale_sig32( hCPE->hStereoDft->buff_LBTCX_mem_fx, NS2SA( 16000, STEREO_DFT32MS_OVL_NS ), sub( Q11, hCPE->hStereoDft->q_dft ) ); // Q11 -#endif scale_sig32( hCPE->hStereoDft->ap_delay_mem_fx, NS2SA_FX2( 16000, DELAY_BWE_TOTAL_NS ), sub( Q11, hCPE->hStereoDft->q_ap_fade_mem_fx ) ); // Q11 hCPE->hStereoDft->q_ap_fade_mem_fx = Q11; test(); @@ -971,13 +948,8 @@ ivas_error ivas_jbm_dec_tc_fx( } IF( hCPE->hCoreCoder[0] != NULL ) { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( hCPE->hCoreCoder[0]->hHQ_core->old_out_LB_fx, hCPE->hCoreCoder[0]->hHQ_core->old_out_LB_fx32, L_FRAME32k, sub( q, hCPE->hCoreCoder[0]->hHQ_core->Q_old_wtda_LB ) ); // q Copy_Scale_sig_16_32_no_sat( hCPE->hCoreCoder[0]->hHQ_core->old_out_fx, hCPE->hCoreCoder[0]->hHQ_core->old_out_fx32, L_FRAME48k, sub( q, hCPE->hCoreCoder[0]->hHQ_core->Q_old_wtda ) ); // q -#else - Copy_Scale_sig_16_32_DEPREC( hCPE->hCoreCoder[0]->hHQ_core->old_out_LB_fx, hCPE->hCoreCoder[0]->hHQ_core->old_out_LB_fx32, L_FRAME32k, sub( q, hCPE->hCoreCoder[0]->hHQ_core->Q_old_wtda_LB ) ); // q - Copy_Scale_sig_16_32_DEPREC( hCPE->hCoreCoder[0]->hHQ_core->old_out_fx, hCPE->hCoreCoder[0]->hHQ_core->old_out_fx32, L_FRAME48k, sub( q, hCPE->hCoreCoder[0]->hHQ_core->Q_old_wtda ) ); // q -#endif hCPE->hCoreCoder[0]->hHQ_core->q_old_outLB_fx = q; move16(); } @@ -1004,24 +976,16 @@ ivas_error ivas_jbm_dec_tc_fx( hCPE->q_output_mem_fx[ii] = hCPE->hStereoDft->q_dft; move16(); } -#ifdef MSAN_FIX FOR( i = 0; i < CPE_CHANNELS; i++ ) Scale_sig32( hCPE->prev_synth_fx[i], NS2SA_FX2( output_Fs, IVAS_DEC_DELAY_NS - STEREO_DFT32MS_OVL_NS ), sub( hCPE->q_prev_synth_fx, Q11 ) ); // q_prev_synth_fx -#else - Scale_sig32( &hCPE->prev_synth_fx[0][0], sizeof( hCPE->prev_synth_fx ) / sizeof( hCPE->prev_synth_fx[0][0] ), hCPE->q_prev_synth_fx - 11 ); -#endif ivas_sba_dirac_stereo_dec_fx( st_ivas, &p_output_fx[sba_ch_idx], output_frame, 0 ); FOR( i = 0; i < 2; i++ ) { Scale_sig32( p_output_fx[sba_ch_idx + i], L_FRAME48k, negate( s ) ); } -#ifdef MSAN_FIX FOR( i = 0; i < CPE_CHANNELS; i++ ) Scale_sig32( hCPE->prev_synth_fx[i], NS2SA_FX2( output_Fs, IVAS_DEC_DELAY_NS - STEREO_DFT32MS_OVL_NS ), sub( 11, hCPE->q_prev_synth_fx ) ); // Q11 -#else - Scale_sig32( &hCPE->prev_synth_fx[0][0], sizeof( hCPE->prev_synth_fx ) / sizeof( hCPE->prev_synth_fx[0][0] ), 11 - hCPE->q_prev_synth_fx ); -#endif scale_sig32( hCPE->input_mem_BPF_fx[0], STEREO_DFT32MS_OVL_16k, sub( Q11, hCPE->hStereoDft->q_dft ) ); // Q11 FOR( i = 0; i < CPE_CHANNELS; ++i ) @@ -1420,13 +1384,8 @@ ivas_error ivas_jbm_dec_tc_fx( IF( hCPE->hCoreCoder[0] != NULL ) { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( hCPE->hCoreCoder[0]->hHQ_core->old_out_LB_fx, hCPE->hCoreCoder[0]->hHQ_core->old_out_LB_fx32, L_FRAME32k, q - hCPE->hCoreCoder[0]->hHQ_core->Q_old_wtda_LB ); // q Copy_Scale_sig_16_32_no_sat( hCPE->hCoreCoder[0]->hHQ_core->old_out_fx, hCPE->hCoreCoder[0]->hHQ_core->old_out_fx32, L_FRAME48k, q - hCPE->hCoreCoder[0]->hHQ_core->Q_old_wtda ); // q -#else - Copy_Scale_sig_16_32_DEPREC( hCPE->hCoreCoder[0]->hHQ_core->old_out_LB_fx, hCPE->hCoreCoder[0]->hHQ_core->old_out_LB_fx32, L_FRAME32k, q - hCPE->hCoreCoder[0]->hHQ_core->Q_old_wtda_LB ); // q - Copy_Scale_sig_16_32_DEPREC( hCPE->hCoreCoder[0]->hHQ_core->old_out_fx, hCPE->hCoreCoder[0]->hHQ_core->old_out_fx32, L_FRAME48k, q - hCPE->hCoreCoder[0]->hHQ_core->Q_old_wtda ); // q -#endif hCPE->hCoreCoder[0]->hHQ_core->q_old_outLB_fx = q; move16(); } @@ -1458,23 +1417,15 @@ ivas_error ivas_jbm_dec_tc_fx( hCPE->q_output_mem_fx[ii] = hCPE->hStereoDft->q_dft; move16(); } -#ifdef MSAN_FIX FOR( i = 0; i < CPE_CHANNELS; i++ ) Scale_sig32( hCPE->prev_synth_fx[i], NS2SA_FX2( output_Fs, IVAS_DEC_DELAY_NS - STEREO_DFT32MS_OVL_NS ), sub( hCPE->q_prev_synth_fx, Q11 ) ); // q_prev_synth_fx -#else - Scale_sig32( &hCPE->prev_synth_fx[0][0], sizeof( hCPE->prev_synth_fx ) / sizeof( hCPE->prev_synth_fx[0][0] ), hCPE->q_prev_synth_fx - 11 ); -#endif ivas_sba_dirac_stereo_dec_fx( st_ivas, p_output_fx, output_frame, 1 ); FOR( i = 0; i < 2; i++ ) { Scale_sig32( p_output_fx[i], L_FRAME48k, negate( s ) ); } -#ifdef MSAN_FIX FOR( i = 0; i < CPE_CHANNELS; i++ ) Scale_sig32( hCPE->prev_synth_fx[i], NS2SA_FX2( output_Fs, IVAS_DEC_DELAY_NS - STEREO_DFT32MS_OVL_NS ), sub( Q11, hCPE->q_prev_synth_fx ) ); // Q11 -#else - Scale_sig32( &hCPE->prev_synth_fx[0][0], sizeof( hCPE->prev_synth_fx ) / sizeof( hCPE->prev_synth_fx[0][0] ), 11 - hCPE->q_prev_synth_fx ); -#endif // MSAN_FIX scale_sig32( hCPE->input_mem_BPF_fx[0], STEREO_DFT32MS_OVL_16k, sub( Q11, hCPE->hStereoDft->q_dft ) ); FOR( i = 0; i < CPE_CHANNELS; ++i ) @@ -1916,10 +1867,8 @@ ivas_error ivas_jbm_dec_render_fx( } } -#ifdef MSAN_FIX st_ivas->hTcBuffer->no_channels = st_ivas->hTcBuffer->nchan_buffer_full; move16(); -#endif // MSAN_FIX /*----------------------------------------------------------------* * Update combined orientation access index *----------------------------------------------------------------*/ @@ -2014,7 +1963,6 @@ ivas_error ivas_jbm_dec_render_fx( ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_SBA_LINEAR_ENC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) ) { /* Convert to Ambisonics; used also for ISM->HOA3->binaural rendering */ -#ifdef MSAN_FIX FOR( i = 0; i < st_ivas->nchan_transport; i++ ) { FOR( j = 0; j < 16; j++ ) @@ -2025,16 +1973,6 @@ ivas_error ivas_jbm_dec_render_fx( move32(); } } -#else - FOR( i = 0; i < 15; i++ ) - { - FOR( j = 0; j < 16; j++ ) - { - st_ivas->hIsmRendererData->gains_fx[i][j] = L_shr( st_ivas->hIsmRendererData->gains_fx[i][j], 1 ); // Q30 -> Q29 - st_ivas->hIsmRendererData->prev_gains_fx[i][j] = L_shr( st_ivas->hIsmRendererData->prev_gains_fx[i][j], 1 ); // Q30 -> Q29 - } - } -#endif ivas_ism2sba_sf_fx( st_ivas->hTcBuffer->tc_fx, p_output_fx, st_ivas->hIsmRendererData, st_ivas->nchan_transport, *nSamplesRendered, st_ivas->hTcBuffer->n_samples_rendered, st_ivas->hIntSetup.ambisonics_order ); Word16 sba_num_chans = imult1616( add( st_ivas->hIntSetup.ambisonics_order, 1 ), add( st_ivas->hIntSetup.ambisonics_order, 1 ) ); FOR( j = 0; j < sba_num_chans; j++ ) @@ -2043,7 +1981,6 @@ ivas_error ivas_jbm_dec_render_fx( } -#ifdef MSAN_FIX FOR( i = 0; i < st_ivas->nchan_transport; i++ ) { FOR( j = 0; j < 16; j++ ) @@ -2054,16 +1991,6 @@ ivas_error ivas_jbm_dec_render_fx( move32(); } } -#else - FOR( i = 0; i < 15; i++ ) - { - FOR( j = 0; j < 16; j++ ) - { - st_ivas->hIsmRendererData->gains_fx[i][j] = L_shl( st_ivas->hIsmRendererData->gains_fx[i][j], 1 ); // Q29 -> Q30 - st_ivas->hIsmRendererData->prev_gains_fx[i][j] = L_shl( st_ivas->hIsmRendererData->prev_gains_fx[i][j], 1 ); // Q29 -> Q30 - } - } -#endif } /* Binaural rendering */ @@ -2136,11 +2063,7 @@ ivas_error ivas_jbm_dec_render_fx( } ELSE { -#ifdef OPT_SBA_AVOID_SPAR_RESCALE IF( NE_32( ( error = ivas_sba_dec_render_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output_fx ) ), IVAS_ERR_OK ) ) -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - IF( NE_32( ( error = ivas_sba_dec_render_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output_fx, 960 ) ), IVAS_ERR_OK ) ) -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ { return error; } @@ -2188,11 +2111,7 @@ ivas_error ivas_jbm_dec_render_fx( hSpar->hMdDec->Q_mixer_mat = 30; move16(); -#ifdef OPT_SBA_AVOID_SPAR_RESCALE IF( NE_32( ( error = ivas_osba_dirac_td_binaural_jbm_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output_fx ) ), IVAS_ERR_OK ) ) -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - IF( NE_32( ( error = ivas_osba_dirac_td_binaural_jbm_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output_fx, 960 ) ), IVAS_ERR_OK ) ) -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ { return error; } @@ -2230,11 +2149,7 @@ ivas_error ivas_jbm_dec_render_fx( } ELSE IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) /*EXT output = individual objects + HOA3*/ { -#ifdef OPT_SBA_AVOID_SPAR_RESCALE IF( NE_32( ( error = ivas_sba_dec_render_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, &p_output_fx[st_ivas->nchan_ism] ) ), IVAS_ERR_OK ) ) -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - IF( NE_32( ( error = ivas_sba_dec_render_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, &p_output_fx[st_ivas->nchan_ism], 960 ) ), IVAS_ERR_OK ) ) -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ { return error; } @@ -2246,11 +2161,7 @@ ivas_error ivas_jbm_dec_render_fx( } ELSE { -#ifdef OPT_SBA_AVOID_SPAR_RESCALE IF( NE_32( ( error = ivas_sba_dec_render_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output_fx ) ), IVAS_ERR_OK ) ) -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - IF( NE_32( ( error = ivas_sba_dec_render_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output_fx, 960 ) ), IVAS_ERR_OK ) ) -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ { return error; } @@ -2262,11 +2173,7 @@ ivas_error ivas_jbm_dec_render_fx( } ELSE { -#ifdef OPT_SBA_AVOID_SPAR_RESCALE IF( NE_32( ( error = ivas_sba_dec_render_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output_fx ) ), IVAS_ERR_OK ) ) -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - IF( NE_32( ( error = ivas_sba_dec_render_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output_fx, 960 ) ), IVAS_ERR_OK ) ) -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ { return error; } @@ -2868,11 +2775,7 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( set16_fx( st_ivas->hSpatParamRendCom->render_to_md_map, last_dirac_md_idx, n_slots_still_available ); /* render the last subframe */ -#ifdef OPT_SBA_AVOID_SPAR_RESCALE IF( NE_32( ( error = ivas_osba_dirac_td_binaural_jbm_fx( st_ivas, (UWord16) hTcBuffer->n_samples_granularity, nSamplesRendered, &nSamplesAvailableNext, p_output_fx ) ), IVAS_ERR_OK ) ) -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - IF( NE_32( ( error = ivas_osba_dirac_td_binaural_jbm_fx( st_ivas, (UWord16) hTcBuffer->n_samples_granularity, nSamplesRendered, &nSamplesAvailableNext, p_output_fx, L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES ) ), IVAS_ERR_OK ) ) -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ { return error; } diff --git a/lib_dec/ivas_mc_param_dec_fx.c b/lib_dec/ivas_mc_param_dec_fx.c index b2a8bd30b..4c0e7fcc6 100644 --- a/lib_dec/ivas_mc_param_dec_fx.c +++ b/lib_dec/ivas_mc_param_dec_fx.c @@ -1862,9 +1862,6 @@ void ivas_param_mc_dec_render_fx( /* format converter */ Word16 channel_active[MAX_OUTPUT_CHANNELS]; UWord16 nband_synth; -#ifndef MSAN_FIX - UWord16 nchan_out_init, nbands_to_zero; -#endif UWord32 output_Fs; Word16 tmp_q = 0; move16(); @@ -1878,10 +1875,6 @@ void ivas_param_mc_dec_render_fx( nchan_transport = st_ivas->nchan_transport; move16(); nchan_out_transport = add( st_ivas->hTransSetup.nchan_out_woLFE, st_ivas->hTransSetup.num_lfe ); -#ifndef MSAN_FIX - nchan_out_init = nchan_out_transport; - move16(); -#endif output_Fs = st_ivas->hDecoderConfig->output_Fs; move32(); @@ -1891,12 +1884,6 @@ void ivas_param_mc_dec_render_fx( { nchan_out_cldfb = BINAURAL_CHANNELS; set16_fx( channel_active, 1, nchan_out_cldfb ); -#ifndef MSAN_FIX - IF( st_ivas->hCombinedOrientationData ) - { - nchan_out_init = MAX_INTERN_CHANNELS; - } -#endif nchan_out_cov = add( st_ivas->hTransSetup.nchan_out_woLFE, st_ivas->hTransSetup.num_lfe ); } ELSE IF( EQ_16( hParamMC->synthesis_conf, PARAM_MC_SYNTH_LS_CONV_CLDFB ) ) @@ -1924,21 +1911,12 @@ void ivas_param_mc_dec_render_fx( /* set everything to zero that will not be decoded */ nband_synth = hParamMC->band_grouping[hParamMC->num_param_bands_synth]; move16(); -#ifdef MSAN_FIX FOR( ch = 0; ch < MAX_OUTPUT_CHANNELS; ch++ ) -#else - FOR( ch = 0; ch < nchan_out_init; ch++ ) -#endif { FOR( slot_idx = 0; slot_idx < JBM_CLDFB_SLOTS_IN_SUBFRAME; slot_idx++ ) { -#ifdef MSAN_FIX set32_fx( &( Cldfb_RealBuffer_fx[ch][slot_idx][0] ), 0, CLDFB_NO_CHANNELS_MAX ); set32_fx( &( Cldfb_ImagBuffer_fx[ch][slot_idx][0] ), 0, CLDFB_NO_CHANNELS_MAX ); -#else - set32_fx( &( Cldfb_RealBuffer_fx[ch][slot_idx][nband_synth] ), 0, nbands_to_zero ); - set32_fx( &( Cldfb_ImagBuffer_fx[ch][slot_idx][nband_synth] ), 0, nbands_to_zero ); -#endif } } @@ -1973,31 +1951,8 @@ void ivas_param_mc_dec_render_fx( slot_idx_start_cldfb_synth = 0; move16(); -#ifndef FIX_1009_OPT_PARAMMC_RENDER - Flag is_zero = 1; - move32(); -#endif FOR( j = 0; j < st_ivas->hParamMC->hMetadataPMC->nbands_coded; j++ ) { -#ifndef FIX_1009_OPT_PARAMMC_RENDER - is_zero = 1; - move16(); - FOR( i = 0; i < hParamMC->h_output_synthesis_cov_state.mixing_matrix_len; i++ ) - { - IF( hParamMC->h_output_synthesis_cov_state.mixing_matrix_fx[j][i] != 0 ) - { - is_zero = 0; - move16(); - } - } - IF( is_zero ) - { - hParamMC->h_output_synthesis_cov_state.mixing_matrix_exp[j] = 0; - move16(); - } - is_zero = 1; - move16(); -#else Flag is_zero = is_zero_arr( hParamMC->h_output_synthesis_cov_state.mixing_matrix_fx[j], hParamMC->h_output_synthesis_cov_state.mixing_matrix_len ); { if ( is_zero != 0 ) @@ -2006,23 +1961,10 @@ void ivas_param_mc_dec_render_fx( move16(); } } -#endif IF( LT_16( st_ivas->hParamMC->band_grouping[j], st_ivas->hParamMC->h_output_synthesis_params.max_band_decorr ) ) { -#ifndef FIX_1009_OPT_PARAMMC_RENDER - FOR( i = 0; i < hParamMC->h_output_synthesis_cov_state.mixing_matrix_res_len; i++ ) - { - IF( NE_32( hParamMC->h_output_synthesis_cov_state.mixing_matrix_res_fx[j][i], 0 ) ) - { - is_zero = 0; - move16(); - } - } - IF( is_zero ) -#else is_zero = is_zero_arr( hParamMC->h_output_synthesis_cov_state.mixing_matrix_res_fx[j], hParamMC->h_output_synthesis_cov_state.mixing_matrix_res_len ); if ( is_zero != 0 ) -#endif { hParamMC->h_output_synthesis_cov_state.mixing_matrix_res_exp[j] = 0; move16(); @@ -2247,13 +2189,8 @@ void ivas_param_mc_dec_render_fx( Word16 len = add( imult1616( slot_idx_start_cldfb_synth, hParamMC->num_freq_bands ), imult1616( hParamMC->num_freq_bands, hParamMC->subframe_nbslots[subframe_idx] ) ); scale_sig32( output_f_fx[ch], len, 5 - 11 ); -#ifdef OPT_SBA_AVOID_SPAR_RESCALE cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, &( output_f_fx[ch][slot_idx_start_cldfb_synth * hParamMC->num_freq_bands] ), imult1616( hParamMC->num_freq_bands, hParamMC->subframe_nbslots[subframe_idx] ), 0, st_ivas->cldfbSynDec[ch] ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, &( output_f_fx[ch][slot_idx_start_cldfb_synth * hParamMC->num_freq_bands] ), - imult1616( hParamMC->num_freq_bands, hParamMC->subframe_nbslots[subframe_idx] ), st_ivas->cldfbSynDec[ch] ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ scale_sig32( output_f_fx[ch], len, 11 - 5 ); // Q11 } @@ -2742,9 +2679,7 @@ static void ivas_param_mc_get_mixing_matrices_fx( set_zero_fx( mat_mult_buffer1_fx, MAX_CICP_CHANNELS * MAX_CICP_CHANNELS ); set_zero_fx( proto_matrix_noLFE_fx, PARAM_MC_MAX_TRANSPORT_CHANS * MAX_CICP_CHANNELS ); set_zero_fx( mixing_matrix_local_fx, MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS ); -#ifdef MSAN_FIX set_zero_fx( mixing_matrix_res_local_fx, MAX_CICP_CHANNELS * MAX_CICP_CHANNELS ); -#endif Word16 proto_matrix_noLFE_e = 0; move16(); @@ -2941,11 +2876,7 @@ static void ivas_param_mc_get_mixing_matrices_fx( FOR( ch_idx1 = 0; ch_idx1 < nY_band; ch_idx1++ ) { -#ifdef OPT_BASOP_ADD_v1 if ( Cproto_diag_fx[ch_idx1] < 0 ) -#else /* OPT_BASOP_ADD_v1 */ - if ( BASOP_Util_Cmp_Mant32Exp( Cproto_diag_fx[ch_idx1], Cproto_diag_e, 0, 0 ) < 0 ) -#endif /* OPT_BASOP_ADD_v1 */ { Cproto_diag_fx[ch_idx1] = 0; move16(); diff --git a/lib_dec/ivas_mc_paramupmix_dec_fx.c b/lib_dec/ivas_mc_paramupmix_dec_fx.c index f4d6cb535..40f9f46e2 100644 --- a/lib_dec/ivas_mc_paramupmix_dec_fx.c +++ b/lib_dec/ivas_mc_paramupmix_dec_fx.c @@ -716,13 +716,8 @@ static void ivas_mc_paramupmix_dec_sf( Word16 noparamupmix_delay, n_samples_rendered; MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix; Word16 subframeIdx, idx_in, maxBand; -#ifdef MSAN_FIX Word32 Cldfb_RealBuffer_subfr_fx[MAX_INTERN_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX] = { 0 }; Word32 Cldfb_ImagBuffer_subfr_fx[MAX_INTERN_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX] = { 0 }; -#else - Word32 Cldfb_RealBuffer_subfr_fx[MAX_INTERN_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - Word32 Cldfb_ImagBuffer_subfr_fx[MAX_INTERN_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; -#endif // MSAN_FIX Word32 Cldfb_RealBuffer_Binaural_fx[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; Word32 Cldfb_ImagBuffer_Binaural_fx[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; @@ -874,11 +869,7 @@ static void ivas_mc_paramupmix_dec_sf( scale_sig32( st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->cldfb_size, Q5 - Q11 ); // Q11 -> Q5 st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q5; move16(); -#ifdef OPT_SBA_AVOID_SPAR_RESCALE cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, &( output_fx[ch][0] ), imult1616( maxBand, st_ivas->hTcBuffer->subframe_nbslots[subframeIdx] ), 0, st_ivas->cldfbSynDec[ch] ); // output_fx returned in Q5 -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, &( output_fx[ch][0] ), imult1616( maxBand, st_ivas->hTcBuffer->subframe_nbslots[subframeIdx] ), st_ivas->cldfbSynDec[ch] ); // output_fx returned in Q5 -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ scale_sig32( st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->cldfb_size, Q11 - Q5 ); // Q5 -> Q11 st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q11; move16(); @@ -913,13 +904,8 @@ static void ivas_mc_paramupmix_dec_sf( ptr_re_fx[0] = Cldfb_RealBuffer_fx[ch][slot_idx]; // Q6 ptr_im_fx[0] = Cldfb_ImagBuffer_fx[ch][slot_idx]; // Q6 -#ifdef OPT_SBA_AVOID_SPAR_RESCALE cldfbSynthesis_ivas_fx( ptr_re_fx, ptr_im_fx, &( pPcm_temp_fx[ch][L_mult0( hMCParamUpmix->num_freq_bands, slot_idx )] ), hMCParamUpmix->num_freq_bands, 0, st_ivas->cldfbSynDec[ch] ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - cldfbSynthesis_ivas_fx( ptr_re_fx, ptr_im_fx, &( pPcm_temp_fx[ch][L_mult0( hMCParamUpmix->num_freq_bands, slot_idx )] ), - hMCParamUpmix->num_freq_bands, st_ivas->cldfbSynDec[ch] ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ } scale_sig32( st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->cldfb_size, sub( Q11, st_ivas->cldfbSynDec[ch]->Q_cldfb_state ) ); // Q6 -> Q11 st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q11; diff --git a/lib_dec/ivas_mct_dec_fx.c b/lib_dec/ivas_mct_dec_fx.c index 4eb0ad686..7e1597749 100644 --- a/lib_dec/ivas_mct_dec_fx.c +++ b/lib_dec/ivas_mct_dec_fx.c @@ -84,10 +84,8 @@ ivas_error ivas_mct_dec_fx( set16_fx( x_len[0], 0, NB_DIV ); set16_fx( x_len[1], 0, NB_DIV ); Decoder_State **sts; -#ifdef NONBE_FIX_1087_OOB_SBA_DTX_RS Word32 *p_output_orig_fx[2]; Word32 synth_32_fx[CPE_CHANNELS][L_FRAME_PLUS]; -#endif Word16 synth_fx[CPE_CHANNELS][L_FRAME_PLUS]; //(Q_synth) Word32 ivas_total_brate; ivas_error error; @@ -164,7 +162,6 @@ ivas_error ivas_mct_dec_fx( /* MCT side bits decoder */ ivas_mct_side_bits_fx( hMCT, st_ivas->hCPE, nCPE, st_ivas->hCPE[0]->hCoreCoder[0], st_ivas->bfi, st_ivas->hCPE[0]->hCoreCoder[0]->bit_stream, ivas_total_brate, nb_bits_metadata ); -#ifdef NONBE_FIX_1087_OOB_SBA_DTX_RS /* in case of switching from an SID frame (with ACELP core) to MCT, buffer of L_FRAME_PLUS samples is needed -> use synth[] as a temporary buffer */ IF( st_ivas->hCPE[0]->hCoreCoder[0]->last_core == ACELP_CORE ) { @@ -174,7 +171,6 @@ ivas_error ivas_mct_dec_fx( output_fx[n] = synth_32_fx[n]; } } -#endif FOR( cpe_id = 0; cpe_id < nCPE; cpe_id++ ) { @@ -348,13 +344,8 @@ ivas_error ivas_mct_dec_fx( x_fx[n][0] = output_fx[n + ( cpe_id * CPE_CHANNELS )]; // Q11 x_fx[n][1] = output_fx[n + ( cpe_id * CPE_CHANNELS )] + ( L_FRAME48k / 2 ); // Q11 } -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( hCPE->hCoreCoder[0]->old_Aq_12_8_fx, hCPE->hCoreCoder[0]->old_Aq_12_8_fx_32, add( M, 1 ), sub( 28, sub( 15, norm_s( sub( hCPE->hCoreCoder[0]->old_Aq_12_8_fx[0], 1 ) ) ) ) ); Copy_Scale_sig_16_32_no_sat( hCPE->hCoreCoder[1]->old_Aq_12_8_fx, hCPE->hCoreCoder[1]->old_Aq_12_8_fx_32, add( M, 1 ), sub( 28, sub( 15, norm_s( sub( hCPE->hCoreCoder[1]->old_Aq_12_8_fx[0], 1 ) ) ) ) ); -#else - Copy_Scale_sig_16_32_DEPREC( hCPE->hCoreCoder[0]->old_Aq_12_8_fx, hCPE->hCoreCoder[0]->old_Aq_12_8_fx_32, add( M, 1 ), sub( 28, norm_s( sub( hCPE->hCoreCoder[0]->old_Aq_12_8_fx[0], 1 ) ) ) ); - Copy_Scale_sig_16_32_DEPREC( hCPE->hCoreCoder[1]->old_Aq_12_8_fx, hCPE->hCoreCoder[1]->old_Aq_12_8_fx_32, add( M, 1 ), sub( 28, norm_s( sub( hCPE->hCoreCoder[1]->old_Aq_12_8_fx[0], 1 ) ) ) ); -#endif ivas_mdct_core_reconstruct_fx( hCPE, x_fx, synth_fx, fUseTns[cpe_id], 1, q_output, e_sig ); Word16 hdrm, sh; @@ -385,7 +376,6 @@ ivas_error ivas_mct_dec_fx( } } -#ifdef NONBE_FIX_1087_OOB_SBA_DTX_RS /* set pointers back */ test(); IF( cpe_id == 0 && st_ivas->hCPE[0]->hCoreCoder[0]->last_core == ACELP_CORE ) @@ -396,7 +386,6 @@ ivas_error ivas_mct_dec_fx( } } -#endif /*----------------------------------------------------------------* * CoreCoder Post-processing and updates @@ -409,19 +398,10 @@ ivas_error ivas_mct_dec_fx( test(); IF( ( st_ivas->sba_dirac_stereo_flag != 0 ) && ( NE_16( st_ivas->ivas_format, SBA_ISM_FORMAT ) || GE_16( cpe_id, sub( nCPE, 2 ) ) ) ) { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( synth_fx[n], synth_fx_32[n], L_FRAME48k, sub( Q11, ( sub( 15, e_sig[n] ) ) ) ); // Q11 Copy_Scale_sig_16_32_no_sat( hCPE->hCoreCoder[n]->hHQ_core->old_out_fx, hCPE->hCoreCoder[n]->hHQ_core->old_out_fx32, output_frame, sub( Q11, hCPE->hCoreCoder[n]->hHQ_core->Q_old_wtda ) ); -#else - Copy_Scale_sig_16_32_DEPREC( synth_fx[n], synth_fx_32[n], L_FRAME48k, sub( Q11, ( sub( 15, e_sig[n] ) ) ) ); // Q11 - Copy_Scale_sig_16_32_DEPREC( hCPE->hCoreCoder[n]->hHQ_core->old_out_fx, hCPE->hCoreCoder[n]->hHQ_core->old_out_fx32, output_frame, sub( Q11, hCPE->hCoreCoder[n]->hHQ_core->Q_old_wtda ) ); -#endif ivas_post_proc_fx( NULL, hCPE, n, synth_fx_32[n], NULL, output_frame, 1, Q11 ); -#ifdef MSAN_FIX Copy_Scale_sig_32_16( synth_fx_32[n], synth_fx[n], output_frame, sub( sub( 15, e_sig[n] ), Q11 ) ); // Q0 -#else - Copy_Scale_sig_32_16( synth_fx_32[n], synth_fx[n], L_FRAME48k, 0 - Q11 ); -#endif } /* Postprocessing for ACELP/MDCT core switching and synchronization */ @@ -452,11 +432,7 @@ ivas_error ivas_mct_dec_fx( { return error; } -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( synth_fx[n], output_fx[( cpe_id * CPE_CHANNELS ) + n], output_frame, sub( Q11, Q_synth ) ); // Q11 -#else - Copy_Scale_sig_16_32_DEPREC( synth_fx[n], output_fx[( cpe_id * CPE_CHANNELS ) + n], output_frame, sub( Q11, Q_synth ) ); // Q11 -#endif /* Save synthesis for HQ FEC */ Word32 output_fx_[L_FRAME48k]; Copy32( output_fx[( cpe_id * CPE_CHANNELS ) + n], output_fx_, L_FRAME48k ); // Q11 @@ -476,11 +452,7 @@ ivas_error ivas_mct_dec_fx( { IF( hCPE->hCoreCoder[n] ) { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( hCPE->hCoreCoder[n]->delay_buf_out_fx, hCPE->hCoreCoder[n]->delay_buf_out32_fx, HQ_DELTA_MAX * HQ_DELAY_COMP, Q11 ); // Q0 -> Q11 -#else - Copy_Scale_sig_16_32_DEPREC( hCPE->hCoreCoder[n]->delay_buf_out_fx, hCPE->hCoreCoder[n]->delay_buf_out32_fx, HQ_DELTA_MAX * HQ_DELAY_COMP, Q11 ); // Q0 -> Q11 -#endif } } diff --git a/lib_dec/ivas_mct_dec_mct_fx_fx.c b/lib_dec/ivas_mct_dec_mct_fx_fx.c index c275820fb..0f20c1ec0 100644 --- a/lib_dec/ivas_mct_dec_mct_fx_fx.c +++ b/lib_dec/ivas_mct_dec_mct_fx_fx.c @@ -313,17 +313,6 @@ void mctStereoIGF_dec_fx( test(); IF( NE_16( hMCT->hBlockData[b]->hStereoMdct->IGFStereoMode[k], SMDCT_DUAL_MONO ) || NE_16( hMCT->hBlockData[b]->hStereoMdct->mdct_stereo_mode[k], SMDCT_DUAL_MONO ) ) { -#ifndef FIX_1109_OPTIM_MCT_STEREO_IGF_DEC - tmp = BASOP_Util_Divide1616_Scale( sts[0]->hTcxCfg->tcx_coded_lines, nSubframes, &tmp_e ); - L_spec[0] = shr( tmp, add( 15, negate( tmp_e ) ) ); - move16(); - - tmp = BASOP_Util_Divide1616_Scale( sts[0]->L_frame, nSubframes, &tmp_e ); - L_frame_nSubframe = shr( tmp, add( 15, negate( tmp_e ) ) ); - - tmp = BASOP_Util_Divide1616_Scale( sts[0]->hTcxDec->L_frameTCX, nSubframes, &tmp_e ); - L_frameTCX_nSubframe = shr( tmp, add( 15, negate( tmp_e ) ) ); -#else Word16 shr_div, shr_k; assert( nSubframes == 1 || nSubframes == 2 ); @@ -334,7 +323,6 @@ void mctStereoIGF_dec_fx( move16(); L_frame_nSubframe = shr( sts[0]->L_frame, shr_div ); L_frameTCX_nSubframe = shr( sts[0]->hTcxDec->L_frameTCX, shr_div ); -#endif init_tcx_info_fx( sts[0], L_frame_nSubframe, L_frameTCX_nSubframe, k, bfi, &tcx_offset[0], &tcx_offsetFB[0], &L_frame[0], &L_frameTCX[0], &left_rect[0], &L_spec[0] ); @@ -344,28 +332,16 @@ void mctStereoIGF_dec_fx( decoder_tcx_IGF_stereo_fx( sts, hMCT->hBlockData[b]->hStereoMdct, hMCT->hBlockData[b]->mask, p_x, p_x_e, p_x_len, L_frame[0], left_rect[0], k, bfi, 1 /* MCT_flag */ ); // Shifting output with variable exponent back to Q12 -#ifdef FIX_1109_OPTIM_MCT_STEREO_IGF_DEC shr_k = sub( 31 - Q12, p_x_e[0][k] ); -#endif FOR( Word16 i = 0; i < p_x_len[0][k]; i++ ) { -#ifndef FIX_1109_OPTIM_MCT_STEREO_IGF_DEC - p_x[0][k][i] = L_shr( p_x[0][k][i], sub( 31 - Q12, p_x_e[0][k] ) ); -#else p_x[0][k][i] = L_shr( p_x[0][k][i], shr_k ); -#endif move32(); } -#ifdef FIX_1109_OPTIM_MCT_STEREO_IGF_DEC shr_k = sub( 31 - Q12, p_x_e[1][k] ); -#endif FOR( Word16 i = 0; i < p_x_len[1][k]; i++ ) { -#ifndef FIX_1109_OPTIM_MCT_STEREO_IGF_DEC - p_x[1][k][i] = L_shr( p_x[1][k][i], sub( 31 - Q12, p_x_e[1][k] ) ); -#else p_x[1][k][i] = L_shr( p_x[1][k][i], shr_k ); -#endif move32(); } } diff --git a/lib_dec/ivas_mdct_core_dec_fx.c b/lib_dec/ivas_mdct_core_dec_fx.c index 1899c8bea..71839557a 100644 --- a/lib_dec/ivas_mdct_core_dec_fx.c +++ b/lib_dec/ivas_mdct_core_dec_fx.c @@ -684,10 +684,8 @@ void ivas_mdct_core_invQ_fx( { spectralData_tmp[k] = malloc( N_MAX * sizeof( Word32 ) ); } -#ifdef MSAN_FIX set32_fx( spectralData_tmp[0], 0, L_FRAME_MAX ); set32_fx( spectralData_tmp[1], 0, L_FRAME_MAX ); -#endif // MSAN_FIX push_wmops( "mdct_core_invQ" ); sts = hCPE->hCoreCoder; @@ -728,18 +726,8 @@ void ivas_mdct_core_invQ_fx( common_exp = s_max( sts[0]->hTonalMDCTConc->lastBlockData.spectralData_exp, sts[1]->hTonalMDCTConc->lastBlockData.spectralData_exp ); -#ifdef MSAN_FIX -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( sts[0]->hTonalMDCTConc->lastBlockData.spectralData, spectralData_tmp[0], L_frameTCX[0], sub( 15, sub( common_exp, sts[0]->hTonalMDCTConc->lastBlockData.spectralData_exp ) ) ); // 30 - spectral_exp1 Copy_Scale_sig_16_32_no_sat( sts[1]->hTonalMDCTConc->lastBlockData.spectralData, spectralData_tmp[1], L_frameTCX[1], sub( 15, sub( common_exp, sts[1]->hTonalMDCTConc->lastBlockData.spectralData_exp ) ) ); // 30 - spectral_exp2 -#else - Copy_Scale_sig_16_32_DEPREC( sts[0]->hTonalMDCTConc->lastBlockData.spectralData, spectralData_tmp[0], L_frameTCX[0], sub( 15, sub( common_exp, sts[0]->hTonalMDCTConc->lastBlockData.spectralData_exp ) ) ); // 30 - spectral_exp1 - Copy_Scale_sig_16_32_DEPREC( sts[1]->hTonalMDCTConc->lastBlockData.spectralData, spectralData_tmp[1], L_frameTCX[1], sub( 15, sub( common_exp, sts[1]->hTonalMDCTConc->lastBlockData.spectralData_exp ) ) ); // 30 - spectral_exp2 -#endif -#else - Copy_Scale_sig_16_32_DEPREC( sts[0]->hTonalMDCTConc->lastBlockData.spectralData, spectralData_tmp[0], L_FRAME_MAX, 15 - ( common_exp - sts[0]->hTonalMDCTConc->lastBlockData.spectralData_exp ) ); // 30 - spectral_exp1 - Copy_Scale_sig_16_32_DEPREC( sts[1]->hTonalMDCTConc->lastBlockData.spectralData, spectralData_tmp[1], L_FRAME_MAX, 15 - ( common_exp - sts[1]->hTonalMDCTConc->lastBlockData.spectralData_exp ) ); // 30 - spectral_exp2 -#endif // MSAN_FIX sts[0]->hTonalMDCTConc->lastBlockData.spectralData_exp = sts[1]->hTonalMDCTConc->lastBlockData.spectralData_exp = common_exp; move16(); @@ -751,13 +739,8 @@ void ivas_mdct_core_invQ_fx( /* both input in same Q */ stereo_decoder_tcx_fx( hCPE->hStereoMdct, ms_mask, x_0[1], &spectralData_tmp[0], &spectralData_tmp[1], &hCPE->hStereoMdct->mdct_stereo_mode[0], sts[0]->core, sts[1]->core, sts[0]->igf, L_frameTCX[0], L_frameTCX[1], 0, sts[0]->last_core, sts[1]->last_core, 1, &q_r, &q_l ); -#ifdef MSAN_FIX Copy_Scale_sig_32_16( spectralData_tmp[0], sts[0]->hTonalMDCTConc->lastBlockData.spectralData, L_frameTCX[0], -15 ); // q_l - 15 Copy_Scale_sig_32_16( spectralData_tmp[1], sts[1]->hTonalMDCTConc->lastBlockData.spectralData, L_frameTCX[1], -15 ); // q_r - 15 -#else - Copy_Scale_sig_32_16( spectralData_tmp[0], sts[0]->hTonalMDCTConc->lastBlockData.spectralData, L_FRAME_MAX, -15 ); - Copy_Scale_sig_32_16( spectralData_tmp[1], sts[1]->hTonalMDCTConc->lastBlockData.spectralData, L_FRAME_MAX, -15 ); -#endif sts[0]->hTonalMDCTConc->lastBlockData.spectralData_exp = sub( 30, q_l ); sts[1]->hTonalMDCTConc->lastBlockData.spectralData_exp = sub( 30, q_r ); move16(); @@ -1193,13 +1176,8 @@ void ivas_mdct_core_reconstruct_fx( Scale_sig( st->hTcxDec->syn_OverlFB, L_FRAME_MAX / 2, sub( q_win, st->Q_syn ) ); // Q(st->Q_syn) -> q_win Scale_sig( st->hHQ_core->old_out_LB_fx, L_FRAME32k, sub( q_win, st->hHQ_core->Q_old_wtda_LB ) ); // Q(st->hHQ_core->Q_old_wtda_LB) -> q_win Scale_sig( st->hHQ_core->old_out_fx, L_FRAME48k, sub( q_win, st->hHQ_core->Q_old_wtda ) ); // Q(st->hHQ_core->Q_old_wtda) -> q_win -#ifdef MSAN_FIX Scale_sig( synth_buf_fx, add( add( st->hTcxDec->old_synth_len, L_FRAME_PLUS ), M ), sub( q_win, q_syn ) ); // q_syn -> q_win Scale_sig( synth_bufFB_fx, add( add( st->hTcxDec->old_synth_lenFB, L_FRAME_PLUS ), M ), sub( q_win, q_syn ) ); // q_syn -> q_win -#else - Scale_sig( synth_buf_fx, 3136, sub( q_win, q_syn ) ); - Scale_sig( synth_bufFB_fx, 3136, sub( q_win, q_syn ) ); -#endif Scale_sig( st->syn, M + 1, sub( q_win, st->Q_syn ) ); // st->Q_syn -> q_win FOR( k = 0; k < nSubframes[ch]; k++ ) { @@ -1263,13 +1241,8 @@ void ivas_mdct_core_reconstruct_fx( move16(); Scale_sig( st->hTcxDec->old_syn_Overl, L_FRAME32k / 2, sub( sub( -1, st->Q_syn ), st->hTcxDec->Q_old_syn_Overl ) ); // q_win -> Q(-1 - st->Q_syn) st->hTcxDec->Q_old_syn_Overl = sub( -1, st->Q_syn ); -#ifdef MSAN_FIX Scale_sig( synth_buf_fx, add( add( st->hTcxDec->old_synth_len, L_FRAME_PLUS ), M ), sub( q_syn, q_win ) ); // q_win -> q_syn Scale_sig( synth_bufFB_fx, add( add( st->hTcxDec->old_synth_lenFB, L_FRAME_PLUS ), M ), sub( q_syn, q_win ) ); // q_win -> q_syn -#else - Scale_sig( synth_buf_fx, 3136, sub( q_syn, q_win ) ); - Scale_sig( synth_bufFB_fx, 3136, sub( q_syn, q_win ) ); -#endif Scale_sig( st->syn, M + 1, add( st->Q_syn, 2 ) ); Scale_sig( st->hTcxDec->syn_OverlFB, L_FRAME_MAX / 2, sub( st->Q_syn, q_win ) ); // q_win -> st->Q_syn Scale_sig( st->hTcxDec->syn_Overl, L_FRAME32k / 2, sub( st->Q_syn, q_win ) ); // q_win -> st->Q_syn @@ -1400,11 +1373,7 @@ void ivas_mdct_core_reconstruct_fx( move16(); st->last_coder_type = st->coder_type; move16(); -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( x_fx_16, x_fx[ch][0], st->L_frame, sub( q_x, q_syn ) ); // q_syn -> Q_x -#else - Copy_Scale_sig_16_32_DEPREC( x_fx_16, x_fx[ch][0], st->L_frame, sub( q_x, q_syn ) ); // q_syn -> Q_x -#endif } IF( GT_16( e_sig[0], e_sig[1] ) ) @@ -1508,9 +1477,7 @@ void ivas_mdct_core_tns_ns_fx( move16(); set32_fx( xn_buf_fx, 0, L_MDCT_OVLP_MAX + L_FRAME_PLUS + L_MDCT_OVLP_MAX ); -#ifdef MSAN_FIX set32_fx( sns_int_scf_fx, 0, FDNS_NPTS ); -#endif /* TNS, ITF, IMDCT and updates */ diff --git a/lib_dec/ivas_omasa_dec_fx.c b/lib_dec/ivas_omasa_dec_fx.c index adee0fc91..8f7da758d 100644 --- a/lib_dec/ivas_omasa_dec_fx.c +++ b/lib_dec/ivas_omasa_dec_fx.c @@ -713,22 +713,14 @@ void ivas_omasa_dirac_rend_jbm_fx( ivas_dirac_dec_render_fx( st_ivas, nchan_transport, nSamplesAsked, nSamplesRendered, nSamplesAvailable, output_f ); -#ifdef MSAN_FIX FOR( Word16 ind1 = 0; ind1 < MAX_NUM_OBJECTS; ind1++ ) -#else - FOR( Word16 ind1 = 0; ind1 < MAX_CICP_CHANNELS - 1; ind1++ ) -#endif // MSAN_FIX { scale_sig32( st_ivas->hIsmRendererData->prev_gains_fx[ind1], MAX_OUTPUT_CHANNELS, -1 ); // Q30 -> Q29 } ivas_omasa_separate_object_render_jbm_fx( st_ivas, *nSamplesRendered, data_separated_objects, output_f, subframes_rendered, slots_rendered ); -#ifdef MSAN_FIX FOR( Word16 ind1 = 0; ind1 < MAX_NUM_OBJECTS; ind1++ ) -#else - FOR( Word16 ind1 = 0; ind1 < MAX_CICP_CHANNELS - 1; ind1++ ) -#endif // MSAN_FIX { scale_sig32( st_ivas->hIsmRendererData->prev_gains_fx[ind1], MAX_OUTPUT_CHANNELS, 1 ); // Q29 -> Q30 } diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index 493301743..80413b21a 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -130,10 +130,6 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx( UWord16 *nSamplesRendered, /* o : number of CLDFB slots rendered */ UWord16 *nSamplesAvailable, /* o : number of CLDFB slots still to render */ Word32 *output_fx[] /* o : rendered time signal Q11*/ -#ifndef OPT_SBA_AVOID_SPAR_RESCALE - , - Word16 out_len /*Store the length of values in each channel*/ -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ ) { Word16 n; @@ -150,11 +146,7 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx( channel_offset = st_ivas->nchan_ism; move16(); -#ifdef OPT_SBA_AVOID_SPAR_RESCALE IF( NE_32( ( error = ivas_sba_dec_render_fx( st_ivas, nSamplesAsked, nSamplesRendered, nSamplesAvailable, &output_fx[channel_offset] ) ), IVAS_ERR_OK ) ) -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - IF( NE_32( ( error = ivas_sba_dec_render_fx( st_ivas, nSamplesAsked, nSamplesRendered, nSamplesAvailable, &output_fx[channel_offset], out_len ) ), IVAS_ERR_OK ) ) -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ { return error; } @@ -240,11 +232,7 @@ ivas_error ivas_osba_render_sf_fx( v_shr( p_output[n], Q11 - Q11, output_ism[n], nSamplesAsked ); // Q11 } -#ifdef OPT_SBA_AVOID_SPAR_RESCALE IF( NE_32( ( error = ivas_sba_dec_render_fx( st_ivas, nSamplesAsked, nSamplesRendered, nSamplesAvailableNext, p_output ) ), IVAS_ERR_OK ) ) -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - IF( NE_32( ( error = ivas_sba_dec_render_fx( st_ivas, nSamplesAsked, nSamplesRendered, nSamplesAvailableNext, p_output, 960 ) ), IVAS_ERR_OK ) ) -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ { return error; } diff --git a/lib_dec/ivas_out_setup_conversion_fx.c b/lib_dec/ivas_out_setup_conversion_fx.c index 756eed60e..fc69d3919 100644 --- a/lib_dec/ivas_out_setup_conversion_fx.c +++ b/lib_dec/ivas_out_setup_conversion_fx.c @@ -479,12 +479,10 @@ ivas_error ivas_ls_setup_conversion_open_fx( set32_fx( hLsSetUpConversion->targetEnergyPrev_fx[0], 0, MAX_SFB + 2 ); set32_fx( hLsSetUpConversion->dmxEnergyPrev_fx[0], 0, MAX_SFB + 2 ); -#ifdef MSAN_FIX hLsSetUpConversion->te_prev_exp[0] = 0; hLsSetUpConversion->dmx_prev_exp[0] = 0; move16(); move16(); -#endif } /* Initialize the DMX conversion matrix */ diff --git a/lib_dec/ivas_post_proc_fx.c b/lib_dec/ivas_post_proc_fx.c index 03fe4063a..c0e69b916 100644 --- a/lib_dec/ivas_post_proc_fx.c +++ b/lib_dec/ivas_post_proc_fx.c @@ -243,12 +243,6 @@ void stereo_dft_dec_core_switching_fx( move16(); } -#ifndef MSAN_FIX - IF( st->p_bpf_noise_buf_32 ) - { - Scale_sig32( st->p_bpf_noise_buf_32, L_FRAME16k, sub( *q, Q11 ) ); - } -#endif test(); test(); @@ -273,9 +267,7 @@ void stereo_dft_dec_core_switching_fx( test(); IF( st->p_bpf_noise_buf_32 && NE_16( st->core, HQ_CORE ) ) { -#ifdef MSAN_FIX Scale_sig32( st->p_bpf_noise_buf_32, st->L_frame, sub( *q, Q11 ) ); /*q*/ -#endif stereo_dft_dec_analyze_fx( hCPE, st->p_bpf_noise_buf_32, DFT_fx, 0, st->L_frame, output_frame, DFT_STEREO_DEC_ANA_BPF, 2, 0, q, q_DFT ); } /* st->p_bpf_noise_buf not updated FOR HQ core -> skip analysis and set input memory to zero */ @@ -294,11 +286,7 @@ void stereo_dft_dec_core_switching_fx( { Word16 mem_len = NS2SA_FX2( L_mult0( L_frameTCX, FRAMES_PER_SEC ), STEREO_DFT32MS_OVL_NS ); /*Q0*/ move16(); -#ifdef MSAN_FIX Word32 mem_len_inv = mem_len_inv_tbl[( mem_len / 25 ) - 1]; -#else - Word32 mem_len_inv = mem_len_inv_tbl[( mem_len / 25 )]; -#endif move32(); Word16 qmem_len = norm_l( mem_len ); Word32 mem_len_fx = L_shl( mem_len, qmem_len ); @@ -441,9 +429,7 @@ void stereo_dft_dec_core_switching_fx( /* BPF */ IF( st->p_bpf_noise_buf_32 ) { -#ifdef MSAN_FIX Scale_sig32( st->p_bpf_noise_buf_32, st->L_frame, sub( *q, Q11 ) ); /*q*/ -#endif stereo_dft_dec_analyze_fx( hCPE, st->p_bpf_noise_buf_32, DFT_fx, 0, st->L_frame, output_frame, DFT_STEREO_DEC_ANA_BPF, 0, 0, q, q_DFT ); } } @@ -472,9 +458,7 @@ void stereo_dft_dec_core_switching_fx( /* BPF */ IF( st->p_bpf_noise_buf_32 ) { -#ifdef MSAN_FIX Scale_sig32( st->p_bpf_noise_buf_32, st->L_frame, sub( *q, Q11 ) ); /*q*/ -#endif stereo_dft_dec_analyze_fx( hCPE, st->p_bpf_noise_buf_32, DFT_fx, 0, st->L_frame, output_frame, DFT_STEREO_DEC_ANA_BPF, 0, 0, q, q_DFT ); } @@ -549,9 +533,7 @@ void stereo_dft_dec_core_switching_fx( /* BPF */ IF( st->p_bpf_noise_buf_32 ) { -#ifdef MSAN_FIX Scale_sig32( st->p_bpf_noise_buf_32, st->L_frame, sub( *q, Q11 ) ); /*q*/ -#endif stereo_dft_dec_analyze_fx( hCPE, st->p_bpf_noise_buf_32, DFT_fx, 0, st->L_frame, output_frame, DFT_STEREO_DEC_ANA_BPF, 0, 0, q, q_DFT ); } @@ -723,12 +705,6 @@ void stereo_dft_dec_core_switching_fx( } } -#ifndef MSAN_FIX - IF( st->p_bpf_noise_buf_32 ) - { - Scale_sig32( st->p_bpf_noise_buf_32, L_FRAME16k, negate( sub( *q, Q11 ) ) ); - } -#endif return; } diff --git a/lib_dec/ivas_qmetadata_dec_fx.c b/lib_dec/ivas_qmetadata_dec_fx.c index c78c51c52..6e36c7765 100644 --- a/lib_dec/ivas_qmetadata_dec_fx.c +++ b/lib_dec/ivas_qmetadata_dec_fx.c @@ -1113,7 +1113,6 @@ Word16 ivas_qmetadata_dec_decode_hr_384_512( } } -#ifdef MSAN_FIX FOR( b = 0; b < hQMetaData->q_direction[0].cfg.nbands; b++ ) { FOR( m = 0; m < hQMetaData->q_direction[0].cfg.nblocks; m++ ) @@ -1122,19 +1121,8 @@ Word16 ivas_qmetadata_dec_decode_hr_384_512( move32(); } } -#else - FOR( b = 0; b < MASA_MAXIMUM_CODING_SUBBANDS; b++ ) - { - FOR( m = 0; m < MAX_PARAM_SPATIAL_SUBFRAMES; m++ ) - { - hQMetaData->q_direction[0].band_data[b].energy_ratio_fx[m] = W_round64_L( W_nrg_ratio[0][b][m] ); - move32(); - } - } -#endif // MSAN_FIX IF( EQ_32( hQMetaData->no_directions, 2 ) ) { -#ifdef MSAN_FIX FOR( b = 0; b < hQMetaData->q_direction[0].cfg.nbands; b++ ) { FOR( m = 0; m < hQMetaData->q_direction[0].cfg.nblocks; m++ ) @@ -1143,16 +1131,6 @@ Word16 ivas_qmetadata_dec_decode_hr_384_512( move32(); } } -#else - FOR( b = 0; b < MASA_MAXIMUM_CODING_SUBBANDS; b++ ) - { - FOR( m = 0; m < MAX_PARAM_SPATIAL_SUBFRAMES; m++ ) - { - hQMetaData->q_direction[1].band_data[b].energy_ratio_fx[m] = W_round64_L( W_nrg_ratio[1][b][m] ); - move32(); - } - } -#endif // MSAN_FIX } /* Store status information for renderer use */ hQMetaData->ec_flag = 0; diff --git a/lib_dec/ivas_sba_dec_fx.c b/lib_dec/ivas_sba_dec_fx.c index f89e9601f..c8c3d80a5 100644 --- a/lib_dec/ivas_sba_dec_fx.c +++ b/lib_dec/ivas_sba_dec_fx.c @@ -349,12 +349,8 @@ ivas_error ivas_sba_dec_reconfigure_fx( test(); test(); test(); -#ifdef NONBE_FIX_708_OSBA_BR_SWITCHING_CRASH test(); IF( hSpar->hPCA == NULL && EQ_32( st_ivas->hDecoderConfig->ivas_total_brate, PCA_BRATE ) && EQ_16( st_ivas->sba_order, 1 ) && ( EQ_32( st_ivas->ivas_format, SBA_FORMAT ) || EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) ) -#else - IF( hSpar->hPCA == NULL && EQ_32( st_ivas->hDecoderConfig->ivas_total_brate, PCA_BRATE ) && EQ_16( st_ivas->sba_order, 1 ) && EQ_32( st_ivas->ivas_format, SBA_FORMAT ) ) -#endif { IF( ( hSpar->hPCA = (PCA_DEC_STATE *) malloc( sizeof( PCA_DEC_STATE ) ) ) == NULL ) { @@ -874,10 +870,6 @@ ivas_error ivas_sba_dec_render_fx( UWord16 *nSamplesRendered, /* o : number of CLDFB slots rendered Q0*/ UWord16 *nSamplesAvailableNext, /* o : number of CLDFB slots still to render Q0*/ Word32 *output_fx[] /* o : rendered time signal Q11*/ -#ifndef OPT_SBA_AVOID_SPAR_RESCALE - , - Word16 out_len /*Store the length of values in each channel*/ -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ ) { Word16 slots_to_render, first_sf, last_sf, subframe_idx; @@ -886,15 +878,8 @@ ivas_error ivas_sba_dec_render_fx( SPAR_DEC_HANDLE hSpar; SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; Word32 *output_f_local_fx[MAX_OUTPUT_CHANNELS]; -#ifndef OPT_SBA_AVOID_SPAR_RESCALE - Word16 output_f_local_len; -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ ivas_error error; -#ifndef OPT_SBA_AVOID_SPAR_RESCALE - output_f_local_len = out_len; - move16(); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ hSpar = st_ivas->hSpar; hSpatParamRendCom = st_ivas->hSpatParamRendCom; nchan_internal = ivas_sba_get_nchan_metadata_fx( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); @@ -926,18 +911,11 @@ ivas_error ivas_sba_dec_render_fx( { Word16 n_samples_sf = imult1616( slot_size, hSpar->subframe_nbslots[subframe_idx] ); /*Q0*/ -#ifdef OPT_SBA_AVOID_SPAR_RESCALE ivas_spar_dec_upmixer_sf_fx( st_ivas, output_f_local_fx, nchan_internal ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - ivas_spar_dec_upmixer_sf_fx( st_ivas, output_f_local_fx, nchan_internal, output_f_local_len ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ FOR( ch = 0; ch < nchan_out; ch++ ) { output_f_local_fx[ch] = output_f_local_fx[ch] + n_samples_sf; /*Q11*/ } -#ifndef OPT_SBA_AVOID_SPAR_RESCALE - output_f_local_len = sub( output_f_local_len, n_samples_sf ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); } diff --git a/lib_dec/ivas_sba_dirac_stereo_dec_fx.c b/lib_dec/ivas_sba_dirac_stereo_dec_fx.c index 0c7544682..50db27aa5 100644 --- a/lib_dec/ivas_sba_dirac_stereo_dec_fx.c +++ b/lib_dec/ivas_sba_dirac_stereo_dec_fx.c @@ -725,12 +725,10 @@ static void ivas_sba_dirac_stereo_compute_td_stefi_nrgs( ELSE { set32_fx( hStereoDft->hb_stefi_sig_fx + hStereoDft->hb_stefi_delay, 0, output_frame ); -#ifdef MSAN_FIX hStereoDft->hb_nrg_subr_fx[0] = 0; move32(); hStereoDft->hb_nrg_subr_fx[1] = 0; move32(); -#endif // MSAN_FIX } hStereoDft->hb_nrg_subr_fx[0] = hStereoDft->hb_nrg_subr_fx[0]; // imult3216(hStereoDft->hb_nrg_subr_fx[0] , shr(hStereoDft->NFFT, 1)); /*hStereoDft->q_hb_nrg_subr*/ move32(); @@ -1240,12 +1238,10 @@ void ivas_sba_dirac_stereo_dec_fx( CPE_DEC_HANDLE hCPE; STEREO_DFT_DEC_DATA_HANDLE hStereoDft; -#ifdef MSAN_FIX FOR( Word16 i = 0; i < CPE_CHANNELS; i++ ) { set32_fx( DFT[i], 0, STEREO_DFT_BUF_MAX ); } -#endif hSCE = st_ivas->hSCE[0]; hCPE = st_ivas->hCPE[0]; @@ -1257,18 +1253,10 @@ void ivas_sba_dirac_stereo_dec_fx( q_dft[1] = hCPE->hStereoDft->q_dft; move16(); -#ifdef MSAN_FIX Scale_sig32( hCPE->prev_hb_synth_fx[0], NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, IVAS_DEC_DELAY_NS - DELAY_BWE_TOTAL_NS ), negate( sub( Q11, hCPE->hStereoDft->q_dft ) ) ); /*hSCE->q_prev_hb_synth_fx + hCPE->hStereoDft->q_dft - Q11*/ -#else - Scale_sig32( hCPE->prev_hb_synth_fx[0], NS2SA_FX2( 48000, IVAS_DEC_DELAY_NS - DELAY_BWE_TOTAL_NS ), -( Q11 - hCPE->hStereoDft->q_dft ) ); -#endif IF( hSCE != NULL ) { -#ifdef MSAN_FIX Scale_sig32( hSCE->prev_hb_synth_fx, NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, IVAS_DEC_DELAY_NS - DELAY_BWE_TOTAL_NS ), negate( sub( Q11, hCPE->hStereoDft->q_dft ) ) ); /*hSCE->q_prev_hb_synth_fx + hCPE->hStereoDft->q_dft - Q11*/ -#else - Scale_sig32( hSCE->prev_hb_synth_fx, NS2SA_FX2( 48000, IVAS_DEC_DELAY_NS - DELAY_BWE_TOTAL_NS ), -( Q11 - hCPE->hStereoDft->q_dft ) ); -#endif // MSAN_FIX hSCE->q_prev_hb_synth_fx = hCPE->hStereoDft->q_dft; move16(); } @@ -1398,18 +1386,10 @@ void ivas_sba_dirac_stereo_dec_fx( set32_fx( output[ch], 0, output_frame ); } -#ifdef MSAN_FIX Scale_sig32( hCPE->prev_hb_synth_fx[0], NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, IVAS_DEC_DELAY_NS - DELAY_BWE_TOTAL_NS ), sub( Q11, hCPE->hStereoDft->q_dft ) ); /*hSCE->q_prev_hb_synth_fx + Q11 - hCPE->hStereoDft->q_dft*/ -#else - Scale_sig32( hCPE->prev_hb_synth_fx[0], NS2SA_FX2( 48000, IVAS_DEC_DELAY_NS - DELAY_BWE_TOTAL_NS ), ( Q11 - hCPE->hStereoDft->q_dft ) ); -#endif IF( hSCE != NULL ) { -#ifdef MSAN_FIX Scale_sig32( hSCE->prev_hb_synth_fx, NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, IVAS_DEC_DELAY_NS - DELAY_BWE_TOTAL_NS ), sub( Q11, hCPE->hStereoDft->q_dft ) ); /*hSCE->q_prev_hb_synth_fx + Q11 - hCPE->hStereoDft->q_dft*/ -#else - Scale_sig32( hSCE->prev_hb_synth_fx, NS2SA_FX2( 48000, IVAS_DEC_DELAY_NS - DELAY_BWE_TOTAL_NS ), ( Q11 - hCPE->hStereoDft->q_dft ) ); -#endif // MSAN_FIX hSCE->q_prev_hb_synth_fx = Q11; move16(); } diff --git a/lib_dec/ivas_spar_decoder_fx.c b/lib_dec/ivas_spar_decoder_fx.c index 461b18fbc..c3e2ad096 100644 --- a/lib_dec/ivas_spar_decoder_fx.c +++ b/lib_dec/ivas_spar_decoder_fx.c @@ -787,11 +787,7 @@ void ivas_spar_get_cldfb_gains_fx( cldfbAnalysis_ts_fx_fixed_q( ts_inout_fx, ts_re_fx, ts_im_fx, num_cldfb_bands, cldfbAnaDec0, &q_cldfb ); cldfb_reset_memory_fx( cldfbSynDec0 ); -#ifdef OPT_SBA_AVOID_SPAR_RESCALE cldfbSynthesis_ivas_fx( pp_ts_re_fx, pp_ts_im_fx, ts_inout_fx, num_cldfb_bands, 0, cldfbSynDec0 ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - cldfbSynthesis_ivas_fx( pp_ts_re_fx, pp_ts_im_fx, ts_inout_fx, num_cldfb_bands, cldfbSynDec0 ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ FOR( sample = 0; sample < stride; sample++ ) { T_fx[( ( slot * stride ) + sample )][slot] = ts_inout_fx[sample]; /*Q21*/ @@ -1161,10 +1157,8 @@ void ivas_spar_get_parameters_fx( split_band = SPAR_DIRAC_SPLIT_START_BAND; move16(); -#ifdef FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_USE_MADD_ADD_WEIGHTS Word16 add_weight_fx = sub( MAX_WORD16, weight_fx ); Word16 add_weight_20ms_fx = sub( MAX_WORD16, weight_20ms_fx ); -#endif FOR( spar_band = 0; spar_band < num_spar_bands; spar_band++ ) { FOR( out_ch = 0; out_ch < num_ch_out; out_ch++ ) @@ -1179,13 +1173,8 @@ void ivas_spar_get_parameters_fx( { IF( GT_16( hSpar->i_subframe, 3 ) ) { -#ifndef FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_USE_MADD_ADD_WEIGHTS - par_mat_fx[out_ch][in_ch][spar_band] = L_add_sat( Mpy_32_16_1( hSpar->hMdDec->mixer_mat_prev_fx[ts0][out_ch][in_ch][spar_band], sub( MAX_WORD16, weight_fx ) ), - Mpy_32_16_1( hSpar->hMdDec->mixer_mat_prev_fx[ts1][out_ch][in_ch][spar_band], weight_fx ) ); /*hSpar->hMdDec->Q_mixer_mat*/ -#else par_mat_fx[out_ch][in_ch][spar_band] = Madd_32_16( Mpy_32_16_1( hSpar->hMdDec->mixer_mat_prev_fx[ts1][out_ch][in_ch][spar_band], weight_fx ), hSpar->hMdDec->mixer_mat_prev_fx[ts0][out_ch][in_ch][spar_band], add_weight_fx ); -#endif move32(); } ELSE @@ -1202,12 +1191,8 @@ void ivas_spar_get_parameters_fx( /* 20ms Transport channel reconstruction with matching encoder/decoder processing */ Word16 prev_idx = SPAR_DIRAC_SPLIT_START_BAND < IVAS_MAX_NUM_BANDS ? 1 : 0; /* if SPAR_DIRAC_SPLIT_START_BAND == IVAS_MAX_NUM_BANDS, then the sub-frame mixer_mat delay line is not active */ move16(); -#ifndef FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_USE_MADD_ADD_WEIGHTS - par_mat_fx[out_ch][in_ch][spar_band] = L_add_sat( Mpy_32_16_1( hSpar->hMdDec->mixer_mat_prev_fx[prev_idx][out_ch][in_ch][spar_band], sub( MAX_WORD16, weight_20ms_fx ) ), Mpy_32_16_1( hSpar->hMdDec->mixer_mat_fx[out_ch][in_ch][spar_band], weight_20ms_fx ) ); /*hSpar->hMdDec->Q_mixer_mat*/ -#else par_mat_fx[out_ch][in_ch][spar_band] = Madd_32_16( Mpy_32_16_1( hSpar->hMdDec->mixer_mat_prev_fx[prev_idx][out_ch][in_ch][spar_band], add_weight_20ms_fx ), hSpar->hMdDec->mixer_mat_fx[out_ch][in_ch][spar_band], weight_20ms_fx ); /*hSpar->hMdDec->Q_mixer_mat*/ -#endif move32(); } } @@ -1367,17 +1352,10 @@ static void ivas_spar_calc_smooth_facs_fx( smooth_long_avg_fx[b] = L_add( smooth_long_avg_fx[b], smooth_buf_fx[b][i] ); // Q0 move32(); } -#ifndef FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_HQ_CONSTANTS - smooth_short_avg_fx[b] = Mpy_32_16_1( smooth_short_avg_fx[b], 5461 /*(1/6 in Q15)*/ ); // Q0 - move32(); - smooth_long_avg_fx[b] = Mpy_32_16_1( smooth_long_avg_fx[b], 1639 /*(1/20 in Q15)*/ ); // Q0 - move32(); -#else smooth_short_avg_fx[b] = Mpy_32_32( smooth_short_avg_fx[b], 357913941 /*(1/6 in Q31)*/ ); // Q0 move32(); smooth_long_avg_fx[b] = Mpy_32_32( smooth_long_avg_fx[b], 107374182 /*(1/20 in Q31)*/ ); // Q0 move32(); -#endif /* calculate smoothing factor based on energy averages */ /* reduce factor for higher short-term energy */ @@ -1689,10 +1667,6 @@ void ivas_spar_dec_upmixer_sf_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ Word32 *output_fx[], /* o : output audio channels Q11*/ const Word16 nchan_internal /* i : number of internal channels Q0*/ -#ifndef OPT_SBA_AVOID_SPAR_RESCALE - , - Word16 out_len -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ ) { Word16 cldfb_band, num_cldfb_bands, numch_in, numch_out; @@ -1793,9 +1767,7 @@ void ivas_spar_dec_upmixer_sf_fx( * Prepare CLDFB buffers *---------------------------------------------------------------------*/ -#ifdef MSAN_FIX set_zero_fx( &Pcm_tmp_fx[0][0], ( MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS ) * L_FRAME48k ); -#endif // MSAN_FIX /* set-up pointers */ IF( NE_32( hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_FOA ) ) { @@ -1871,9 +1843,7 @@ void ivas_spar_dec_upmixer_sf_fx( ivas_spar_calc_smooth_facs_fx( cldfb_in_ts_re_fx[0], cldfb_in_ts_im_fx[0], q_cldfb, num_spar_bands, hSpar->subframe_nbslots[hSpar->subframes_rendered], hSpar->subframes_rendered == 0, &hSpar->hFbMixer->pFb->fb_bin_to_band, hSpar->hMdDec->smooth_fac_fx, hSpar->hMdDec->smooth_buf_fx ); } -#ifdef FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_USE_UNIQUE_SHL Word16 sh_l = sub( 31, q1 ); -#endif FOR( ts = 0; ts < hSpar->subframe_nbslots[hSpar->subframes_rendered]; ts++ ) { md_idx = hSpar->render_to_md_map[( ts + slot_idx_start )]; /*Q0*/ @@ -1889,18 +1859,12 @@ void ivas_spar_dec_upmixer_sf_fx( { FOR( spar_band = 0; spar_band < num_spar_bands; spar_band++ ) { -#ifdef OPT_SBA_AVOID_SPAR_RESCALE Word16 diff = sub( 32767, hSpar->hMdDec->smooth_fac_fx[spar_band] ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ FOR( out_ch = 0; out_ch < numch_out; out_ch++ ) { FOR( in_ch = 0; in_ch < numch_in; in_ch++ ) { -#ifdef OPT_SBA_AVOID_SPAR_RESCALE mixer_mat_fx[out_ch][in_ch][spar_band] = Madd_32_16( Mpy_32_16_1( mixer_mat_fx[out_ch][in_ch][spar_band], diff ), hSpar->hMdDec->mixer_mat_prev2_fx[out_ch][in_ch][spar_band], hSpar->hMdDec->smooth_fac_fx[spar_band] ); /*q1*/ -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - mixer_mat_fx[out_ch][in_ch][spar_band] = Madd_32_16( Mpy_32_16_1( mixer_mat_fx[out_ch][in_ch][spar_band], sub( 32767, hSpar->hMdDec->smooth_fac_fx[spar_band] ) ), hSpar->hMdDec->mixer_mat_prev2_fx[out_ch][in_ch][spar_band], hSpar->hMdDec->smooth_fac_fx[spar_band] ); /*q1*/ -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ move32(); hSpar->hMdDec->mixer_mat_prev2_fx[out_ch][in_ch][spar_band] = mixer_mat_fx[out_ch][in_ch][spar_band]; /*q1*/ move32(); @@ -1908,68 +1872,6 @@ void ivas_spar_dec_upmixer_sf_fx( } } } -#ifndef FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_SPLIT_LOOPS - FOR( cldfb_band = 0; cldfb_band < num_cldfb_bands; cldfb_band++ ) - { - Word32 out_re_fx[IVAS_SPAR_MAX_CH]; - Word32 out_im_fx[IVAS_SPAR_MAX_CH]; - Word32 cldfb_par_fx; /*q1*/ - ivas_fb_bin_to_band_data_t *bin2band = &hSpar->hFbMixer->pFb->fb_bin_to_band; - - FOR( out_ch = 0; out_ch < numch_out; out_ch++ ) - { - out_re_fx[out_ch] = 0; - move32(); - out_im_fx[out_ch] = 0; - move32(); - FOR( in_ch = 0; in_ch < numch_in; in_ch++ ) - { - IF( b_skip_mat[out_ch][in_ch] == 0 ) - { - IF( LT_16( cldfb_band, CLDFB_PAR_WEIGHT_START_BAND ) ) /* tuning parameter, depends on how much SPAR Filters overlap for the CLDFB bands */ - { - spar_band = bin2band->p_cldfb_map_to_spar_band[cldfb_band]; /*Q0*/ - move16(); - cldfb_par_fx = mixer_mat_fx[out_ch][in_ch][spar_band]; /*q1*/ - move32(); - } - ELSE - { - Word64 acc = 0; - move64(); - FOR( spar_band = bin2band->p_spar_start_bands[cldfb_band]; spar_band < num_spar_bands; spar_band++ ) - { - /* accumulate contributions from all SPAR bands */ - acc = W_mac_32_32( acc, mixer_mat_fx[out_ch][in_ch][spar_band], bin2band->pp_cldfb_weights_per_spar_band_fx[cldfb_band][spar_band] ); // q1+ Q23 - } - cldfb_par_fx = W_shl_sat_l( acc, -23 ); // q1 - } - - out_re_fx[out_ch] = Madd_32_32( out_re_fx[out_ch], cldfb_in_ts_re_fx[in_ch][ts][cldfb_band], cldfb_par_fx ); /*q1-25*/ - move32(); - out_im_fx[out_ch] = Madd_32_32( out_im_fx[out_ch], cldfb_in_ts_im_fx[in_ch][ts][cldfb_band], cldfb_par_fx ); /*q1-25*/ - move32(); - } - } - } - - /*update CLDFB data with the parameter-modified data*/ - FOR( out_ch = 0; out_ch < numch_out; out_ch++ ) - { -#ifndef FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_USE_UNIQUE_SHL - cldfb_in_ts_re_fx[out_ch][ts][cldfb_band] = L_shl( out_re_fx[out_ch], sub( 31, q1 ) ); /*Q=6*/ - move32(); - cldfb_in_ts_im_fx[out_ch][ts][cldfb_band] = L_shl( out_im_fx[out_ch], sub( 31, q1 ) ); /*Q=6*/ - move32(); -#else - cldfb_in_ts_re_fx[out_ch][ts][cldfb_band] = L_shl( out_re_fx[out_ch], sh_l ); /*Q=6*/ - move32(); - cldfb_in_ts_im_fx[out_ch][ts][cldfb_band] = L_shl( out_im_fx[out_ch], sh_l ); /*Q=6*/ - move32(); -#endif - } - } -#else /* FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_SPLIT_LOOPS */ /* Note: This version splits the cldfb band loop into 2 loops, removing some inner-loop IF_statements */ Word16 min_cldf_band = s_min( CLDFB_PAR_WEIGHT_START_BAND, num_cldfb_bands ); Word32 out_re_fx[IVAS_SPAR_MAX_CH]; @@ -2004,17 +1906,10 @@ void ivas_spar_dec_upmixer_sf_fx( /*update CLDFB data with the parameter-modified data*/ FOR( out_ch = 0; out_ch < numch_out; out_ch++ ) { -#ifndef FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_USE_UNIQUE_SHL - cldfb_in_ts_re_fx[out_ch][ts][cldfb_band] = L_shl( out_re_fx[out_ch], sub( 31, q1 ) ); /*Q=6*/ - move32(); - cldfb_in_ts_im_fx[out_ch][ts][cldfb_band] = L_shl( out_im_fx[out_ch], sub( 31, q1 ) ); /*Q=6*/ - move32(); -#else cldfb_in_ts_re_fx[out_ch][ts][cldfb_band] = L_shl( out_re_fx[out_ch], sh_l ); /*Q=6*/ move32(); cldfb_in_ts_im_fx[out_ch][ts][cldfb_band] = L_shl( out_im_fx[out_ch], sh_l ); /*Q=6*/ move32(); -#endif } } @@ -2052,20 +1947,12 @@ void ivas_spar_dec_upmixer_sf_fx( /*update CLDFB data with the parameter-modified data*/ FOR( out_ch = 0; out_ch < numch_out; out_ch++ ) { -#ifndef FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_USE_UNIQUE_SHL - cldfb_in_ts_re_fx[out_ch][ts][cldfb_band] = L_shl( out_re_fx[out_ch], sub( 31, q1 ) ); /*Q=6*/ - move32(); - cldfb_in_ts_im_fx[out_ch][ts][cldfb_band] = L_shl( out_im_fx[out_ch], sub( 31, q1 ) ); /*Q=6*/ - move32(); -#else cldfb_in_ts_re_fx[out_ch][ts][cldfb_band] = L_shl( out_re_fx[out_ch], sh_l ); /*Q=6*/ move32(); cldfb_in_ts_im_fx[out_ch][ts][cldfb_band] = L_shl( out_im_fx[out_ch], sh_l ); /*Q=6*/ move32(); -#endif } } -#endif /* FIX_1101_IVAS_SPAR_DEC_UPMIXER_SF_SPLIT_LOOPS */ test(); IF( ( EQ_16( ( add( add( slot_idx_start, ts ), 1 ) ), hSpar->num_slots ) ) || ( NE_16( ( shr( md_idx, 2 ) /* md_idx / JBM_CLDFB_SLOTS_IN_SUBFRAME */ ), ( hSpar->render_to_md_map[( ( slot_idx_start + ts ) + 1 )] / JBM_CLDFB_SLOTS_IN_SUBFRAME /*It's value is 4*/ ) ) ) ) { @@ -2080,12 +1967,6 @@ void ivas_spar_dec_upmixer_sf_fx( } IF( LT_16( split_band, IVAS_MAX_NUM_BANDS ) ) { -#ifndef OPT_SBA_AVOID_SPAR_RESCALE - Copy32( hSpar->hMdDec->mixer_mat_prev_fx[1][0][0], hSpar->hMdDec->mixer_mat_prev_fx[0][0][0], IVAS_MAX_FB_MIXER_OUT_CH * IVAS_MAX_SPAR_FB_MIXER_IN_CH * IVAS_MAX_NUM_BANDS ); /*hSpar->hMdDec->Q_mixer_mat*/ - Copy32( hSpar->hMdDec->mixer_mat_prev_fx[2][0][0], hSpar->hMdDec->mixer_mat_prev_fx[1][0][0], IVAS_MAX_FB_MIXER_OUT_CH * IVAS_MAX_SPAR_FB_MIXER_IN_CH * IVAS_MAX_NUM_BANDS ); /*hSpar->hMdDec->Q_mixer_mat*/ - Copy32( hSpar->hMdDec->mixer_mat_prev_fx[3][0][0], hSpar->hMdDec->mixer_mat_prev_fx[2][0][0], IVAS_MAX_FB_MIXER_OUT_CH * IVAS_MAX_SPAR_FB_MIXER_IN_CH * IVAS_MAX_NUM_BANDS ); /*hSpar->hMdDec->Q_mixer_mat*/ - Copy32( hSpar->hMdDec->mixer_mat_prev_fx[4][0][0], hSpar->hMdDec->mixer_mat_prev_fx[3][0][0], IVAS_MAX_FB_MIXER_OUT_CH * IVAS_MAX_SPAR_FB_MIXER_IN_CH * IVAS_MAX_NUM_BANDS ); /*hSpar->hMdDec->Q_mixer_mat*/ -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ FOR( out_ch = 0; out_ch < numch_out; out_ch++ ) { @@ -2093,7 +1974,6 @@ void ivas_spar_dec_upmixer_sf_fx( { FOR( b = 0; b < num_spar_bands; b++ ) { -#ifdef OPT_SBA_AVOID_SPAR_RESCALE hSpar->hMdDec->mixer_mat_prev_fx[0][out_ch][in_ch][b] = hSpar->hMdDec->mixer_mat_prev_fx[1][out_ch][in_ch][b]; hSpar->hMdDec->mixer_mat_prev_fx[1][out_ch][in_ch][b] = hSpar->hMdDec->mixer_mat_prev_fx[2][out_ch][in_ch][b]; hSpar->hMdDec->mixer_mat_prev_fx[2][out_ch][in_ch][b] = hSpar->hMdDec->mixer_mat_prev_fx[3][out_ch][in_ch][b]; @@ -2102,7 +1982,6 @@ void ivas_spar_dec_upmixer_sf_fx( move32(); move32(); move32(); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ hSpar->hMdDec->mixer_mat_prev_fx[4][out_ch][in_ch][b] = hSpar->hMdDec->mixer_mat_fx[out_ch][in_ch][( b + ( md_sf * IVAS_MAX_NUM_BANDS ) )]; /*hSpar->hMdDec->Q_mixer_mat*/ move32(); @@ -2156,26 +2035,10 @@ void ivas_spar_dec_upmixer_sf_fx( IF( ( EQ_32( hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_FOA ) || !( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ) && !( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) && EQ_32( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) && EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) ) { -#ifndef OPT_SBA_AVOID_SPAR_RESCALE - Scale_sig32( st_ivas->cldfbSynDec[idx_in]->cldfb_state_fx, st_ivas->cldfbSynDec[idx_in]->p_filter_length, -6 ); /*st_ivas->cldfbSynDec[idx_in]->Q_cldfb_state-6*/ - st_ivas->cldfbSynDec[idx_in]->Q_cldfb_state = sub( st_ivas->cldfbSynDec[idx_in]->Q_cldfb_state, 6 ); - move16(); - Scale_sig32( output_fx[ch], out_len, -6 ); /*Q5*/ -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ FOR( ts = 0; ts < hSpar->subframe_nbslots[hSpar->subframes_rendered]; ts++ ) { -#ifdef OPT_SBA_AVOID_SPAR_RESCALE cldfbSynthesis_ivas_fx( &cldfb_in_ts_re_fx[idx_in][ts], &cldfb_in_ts_im_fx[idx_in][ts], &output_fx[ch][i_mult( ts, num_cldfb_bands )], num_cldfb_bands, 6, st_ivas->cldfbSynDec[idx_in] ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - cldfbSynthesis_ivas_fx( &cldfb_in_ts_re_fx[idx_in][ts], &cldfb_in_ts_im_fx[idx_in][ts], &output_fx[ch][i_mult( ts, num_cldfb_bands )], num_cldfb_bands, st_ivas->cldfbSynDec[idx_in] ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ } -#ifndef OPT_SBA_AVOID_SPAR_RESCALE - Scale_sig32( output_fx[ch], out_len, 6 ); /*Q11*/ - Scale_sig32( st_ivas->cldfbSynDec[idx_in]->cldfb_state_fx, st_ivas->cldfbSynDec[idx_in]->p_filter_length, 6 ); /*st_ivas->cldfbSynDec[idx_in]->Q_cldfb_state+6*/ - st_ivas->cldfbSynDec[idx_in]->Q_cldfb_state = add( st_ivas->cldfbSynDec[idx_in]->Q_cldfb_state, 6 ); - move16(); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ } idx_in = add( idx_in, 1 ); @@ -2187,26 +2050,10 @@ void ivas_spar_dec_upmixer_sf_fx( /* CLDFB to time synthesis (overwrite mixer output) */ FOR( out_ch = 0; out_ch < numch_out_dirac; out_ch++ ) { -#ifndef OPT_SBA_AVOID_SPAR_RESCALE - Scale_sig32( st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx, st_ivas->cldfbSynDec[out_ch]->p_filter_length, -6 ); /*st_ivas->cldfbSynDec[out_ch]->Q_cldfb_state-6*/ - st_ivas->cldfbSynDec[out_ch]->Q_cldfb_state = sub( st_ivas->cldfbSynDec[out_ch]->Q_cldfb_state, 6 ); - move16(); - Scale_sig32( output_fx[out_ch], out_len, -6 ); /*Q5*/ -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ FOR( ts = 0; ts < hSpar->subframe_nbslots[hSpar->subframes_rendered]; ts++ ) { -#ifdef OPT_SBA_AVOID_SPAR_RESCALE cldfbSynthesis_ivas_fx( &cldfb_in_ts_re_fx[out_ch][ts], &cldfb_in_ts_im_fx[out_ch][ts], &output_fx[out_ch][i_mult( ts, num_cldfb_bands )], num_cldfb_bands, 6, st_ivas->cldfbSynDec[out_ch] ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - cldfbSynthesis_ivas_fx( &cldfb_in_ts_re_fx[out_ch][ts], &cldfb_in_ts_im_fx[out_ch][ts], &output_fx[out_ch][i_mult( ts, num_cldfb_bands )], num_cldfb_bands, st_ivas->cldfbSynDec[out_ch] ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ } -#ifndef OPT_SBA_AVOID_SPAR_RESCALE - Scale_sig32( output_fx[out_ch], out_len, 6 ); /*Q11*/ - Scale_sig32( st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx, st_ivas->cldfbSynDec[out_ch]->p_filter_length, 6 ); /*st_ivas->cldfbSynDec[out_ch]->Q_cldfb_state+6*/ - st_ivas->cldfbSynDec[out_ch]->Q_cldfb_state = add( st_ivas->cldfbSynDec[out_ch]->Q_cldfb_state, 6 ); - move16(); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ } } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 5704f4f60..429a99ca4 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -961,9 +961,7 @@ typedef struct decoder_tc_buffer_structure Word32 *tc_buffer_fx; /* the buffer itself */ Word16 tc_buff_len; /*stores memory length of tc buffer*/ Word32 *tc_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; /* pointers into the buffer to the beginning of each tc Q11 for ivas */ // VE2SB: TBV -#ifdef MSAN_FIX Word16 no_channels; /*Stores no of channels in tc_fx with values*/ -#endif Word16 q_tc_fx; TC_BUFFER_MODE tc_buffer_mode; /* mode of the buffer (no buffering, render buffering, out buffering) */ Word16 nchan_transport_jbm; /* number of TCs after TC decoding */ diff --git a/lib_dec/ivas_stereo_cng_dec.c b/lib_dec/ivas_stereo_cng_dec.c index 223860db0..478f96dc1 100644 --- a/lib_dec/ivas_stereo_cng_dec.c +++ b/lib_dec/ivas_stereo_cng_dec.c @@ -683,12 +683,8 @@ static void stereo_dft_generate_comfort_noise_fx( factor = L_min( L_add( L_shl( hStereoDft->scale_fx, sub( 16, q_div ) ), W_extract_l( W_mult0_32_32( Mpy_32_16_1( L_sub( factor, L_shl( hStereoDft->scale_fx, sub( 16, q_div ) ) ), ONE_BY_MAX_K ), hStereoCng->xfade_frame_counter ) ) ), factor ); /* q_div */ FOR( ; j <= hFdCngCom->part[k]; j++ ) { -#ifdef FIX_ISSUE_1218 /* NOTE: saturation is added here as part of issue 1218 fix. After rescaling the fdcng noise estimation buffers, due to slight precision loss, values may slightly overflow */ hFdCngCom->cngNoiseLevel[j] = L_shl_sat( Mpy_32_32( st->hFdCngDec->bandNoiseShape[j], factor ), q_div ); /* exp(st->hFdCngDec->bandNoiseShape_exp) */ -#else - hFdCngCom->cngNoiseLevel[j] = L_shl( Mpy_32_32( st->hFdCngDec->bandNoiseShape[j], factor ), q_div ); /* exp(st->hFdCngDec->bandNoiseShape_exp) */ -#endif move32(); } } diff --git a/lib_dec/ivas_stereo_dft_dec_fx.c b/lib_dec/ivas_stereo_dft_dec_fx.c index 9c1b488cb..324f2b7f3 100644 --- a/lib_dec/ivas_stereo_dft_dec_fx.c +++ b/lib_dec/ivas_stereo_dft_dec_fx.c @@ -96,9 +96,7 @@ void stereo_dft_dec_reset_fx( { Word16 i; Word16 j, b; -#ifdef MSAN_FIX set_zero_fx( hStereoDft->buff_LBTCX_mem_fx, NS2SA( 16000, STEREO_DFT32MS_OVL_NS ) ); -#endif /*Configuration*/ set16_fx( hStereoDft->prm_res, hStereoDft->hConfig->prm_res, STEREO_DFT_DEC_DFT_NB ); @@ -122,25 +120,13 @@ void stereo_dft_dec_reset_fx( set16_fx( hStereoDft->res_pred_index_previous, 0, STEREO_DFT_BAND_MAX ); -#ifdef MSAN_FIX FOR( i = 0; i < STEREO_DFT_BAND_MAX * 2; i++ ) { hStereoDft->res_gains_ind_fx[0][i] = 1006632960; /* 15.0f in Q26 */ move32(); } -#else - FOR( i = 0; i < STEREO_DFT_BAND_MAX; i++ ) - { - hStereoDft->res_gains_ind_fx[0][i] = 1006632960; /* 15.0f in Q26 */ - move32(); - } -#endif -#ifdef MSAN_FIX set32_fx( hStereoDft->res_gains_ind_fx[1], 0, STEREO_DFT_BAND_MAX * 2 ); -#else - set32_fx( hStereoDft->res_gains_ind_fx[1], 0, STEREO_DFT_BAND_MAX ); -#endif /*residual coding*/ set16_fx( hStereoDft->res_cod_mode, hStereoDft->hConfig->res_cod_mode, STEREO_DFT_DEC_DFT_NB ); @@ -260,7 +246,6 @@ void stereo_dft_dec_reset_fx( move32(); hStereoDft->frame_sid_nodata = 0; move16(); -#ifdef MSAN_FIX FOR( b = 0; b < 2 * IVAS_MAX_NUM_BANDS; b++ ) { FOR( i = 0; i < 2; i++ ) @@ -272,19 +257,6 @@ void stereo_dft_dec_reset_fx( } } } -#else - FOR( b = 0; b < hStereoDft->nbands; b++ ) - { - FOR( i = 0; i < 2; i++ ) - { - FOR( j = 0; j < 4; j++ ) - { - hStereoDft->mixer_mat_smooth_fx[i][j][b] = 0; - move32(); - } - } - } -#endif hStereoDft->first_frame = 1; move16(); hStereoDft->g_L_prev_fx = 0; @@ -429,9 +401,7 @@ ivas_error stereo_dft_dec_create_fx( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TCX-LTP handle\n" ) ); } -#ifdef MSAN_FIX set_zero_fx( hStereoDft_loc->hb_nrg_subr_fx, STEREO_DFT_NBDIV ); /*Setting hb_nrg_subr_fx to zero*/ -#endif // MSAN_FIX hStereoDft_loc->hConfig->force_mono_transmission = 0; move16(); @@ -1436,11 +1406,7 @@ void stereo_dft_dec_res_fx( move32(); } } -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( out_16, output, L_FRAME8k, sub( 15, sub( q_shift, 1 ) ) ); /* Q15 */ -#else - Copy_Scale_sig_16_32_DEPREC( out_16, output, L_FRAME8k, 16 ); /* Q16 */ -#endif IF( res_bpf_flag ) { v_sub_32( output, bpf_error_signal_8k, output, L_FRAME8k ); @@ -1451,20 +1417,12 @@ void stereo_dft_dec_res_fx( set16_fx( hCPE->hStereoDft->hBpf->pst_old_syn_fx, 0, STEREO_DFT_NBPSF_PIT_MAX_8k ); hCPE->hStereoDft->hBpf->pst_mem_deemp_err_fx = 0; move16(); -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( out_16, output, L_FRAME8k, sub( 15, sub( q_shift, 1 ) ) ); /* Q15 */ -#else - Copy_Scale_sig_16_32_DEPREC( out_16, output, L_FRAME8k, 16 ); /* Q16 */ -#endif } ELSE { /* This step is needed to ensure output is properly populated with scaled values in all cases*/ -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( out_16, output, L_FRAME8k, sub( 15, sub( q_shift, 1 ) ) ); /* Q15 */ -#else - Copy_Scale_sig_16_32_DEPREC( out_16, output, L_FRAME8k, 16 ); /* Q16 */ -#endif } return; diff --git a/lib_dec/ivas_stereo_ica_dec_fx.c b/lib_dec/ivas_stereo_ica_dec_fx.c index 694aad0b4..73cf9ccd0 100644 --- a/lib_dec/ivas_stereo_ica_dec_fx.c +++ b/lib_dec/ivas_stereo_ica_dec_fx.c @@ -59,13 +59,8 @@ void stereo_tca_dec_fx( ) { /* Buffers, input Left and right channels @ input_Fs*/ -#ifdef MSAN_FIX Word32 bufChanL_fx[L_DEC_MEM_LEN_ICA + L_FRAME48k] = { 0 }; Word32 bufChanR_fx[L_DEC_MEM_LEN_ICA + L_FRAME48k] = { 0 }; -#else - Word32 bufChanL_fx[L_DEC_MEM_LEN_ICA + L_FRAME48k]; - Word32 bufChanR_fx[L_DEC_MEM_LEN_ICA + L_FRAME48k]; -#endif Word32 *ptrChanL_fx, *ptrChanR_fx; Word32 *target_fx; Word16 target_idx, prevNCShift, currentNCShift, l_shift_adapt; diff --git a/lib_dec/ivas_stereo_icbwe_dec_fx.c b/lib_dec/ivas_stereo_icbwe_dec_fx.c index 04aeccbb5..1c2ecffaf 100644 --- a/lib_dec/ivas_stereo_icbwe_dec_fx.c +++ b/lib_dec/ivas_stereo_icbwe_dec_fx.c @@ -234,12 +234,10 @@ void stereo_icBWE_dec_fx( ELSE { set32_fx( hCPE->hStereoDft->hb_stefi_sig_fx + hCPE->hStereoDft->hb_stefi_delay, 0, output_frame ); -#ifdef MSAN_FIX hCPE->hStereoDft->hb_nrg_subr_fx[0] = 0; move32(); hCPE->hStereoDft->hb_nrg_subr_fx[1] = 0; move32(); -#endif // MSAN_FIX } hCPE->hStereoDft->hb_nrg_subr_fx[0] = ( Mpy_32_16_1( hCPE->hStereoDft->hb_nrg_subr_fx[0], shl( shr( hCPE->hStereoDft->NFFT, 1 ), 6 ) ) ); // 2 * (Qsynth + SynthRef_shift) - 40 // 2 * (Qx + SynthRef_shift) - 31 - 15 move32(); @@ -719,11 +717,7 @@ void stereo_icBWE_dec_fx( { IF( LE_16( ratio_L_fx, 29490 /* 0.9 in Q15*/ ) ) { -#ifdef FIX_TMP_714 tmp = mult_r( ratio_L_fx, ratio_L_fx ); // Q15 -#else - tmp = mult_r( sub( 32767, ratio_L_fx ), sub( 32767, ratio_L_fx ) ); // Q15 -#endif tmp = mult_r( tmp, gsMapping_fx ); // Q14 tmp = mult_r( tmp, gsMapping_fx ); // Q13 IF( LT_16( tmp, 4096 /* 0.5 in Q13*/ ) ) @@ -819,11 +813,7 @@ void stereo_icBWE_dec_fx( hStereoICBWE->prev_Q_fsout = tmp; move16(); } -#ifndef MSAN_FIX - Scale_sig32( synth_fx, L_FRAME48k, sub( *Q_syn, add( 1, tmp ) ) ); -#else Scale_sig32( synth_fx, output_frame, sub( *Q_syn, add( 1, tmp ) ) ); /* Qsyn - 1 */ -#endif *Q_syn = sub( *Q_syn, 1 ); @@ -886,11 +876,7 @@ void stereo_icBWE_dec_fx( { IF( LE_16( ratio_L_fx, 29490 /* 0.9 in Q15*/ ) ) { -#ifdef FIX_TMP_714 tmp = mult_r( ratio_L_fx, ratio_L_fx ); // Q15 -#else - tmp = mult_r( sub( 32767, ratio_L_fx ), sub( 32767, ratio_L_fx ) ); // Q15 -#endif tmp = mult_r( tmp, gsMapping_fx ); // Q14 tmp = mult_r( tmp, gsMapping_fx ); // Q13 IF( LT_16( tmp, 4096 /* 0.5 in Q13*/ ) ) diff --git a/lib_dec/ivas_stereo_mdct_core_dec_fx.c b/lib_dec/ivas_stereo_mdct_core_dec_fx.c index a6b350d33..cd7e92f71 100644 --- a/lib_dec/ivas_stereo_mdct_core_dec_fx.c +++ b/lib_dec/ivas_stereo_mdct_core_dec_fx.c @@ -540,13 +540,8 @@ void stereo_mdct_core_dec_fx( move16(); } } -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( hCPE->hCoreCoder[0]->old_Aq_12_8_fx, hCPE->hCoreCoder[0]->old_Aq_12_8_fx_32, M + 1, sub( 28, sub( 15, norm_s( sub( hCPE->hCoreCoder[0]->old_Aq_12_8_fx[0], 1 ) ) ) ) ); /* Q28 */ Copy_Scale_sig_16_32_no_sat( hCPE->hCoreCoder[1]->old_Aq_12_8_fx, hCPE->hCoreCoder[1]->old_Aq_12_8_fx_32, M + 1, sub( 28, sub( 15, norm_s( sub( hCPE->hCoreCoder[1]->old_Aq_12_8_fx[0], 1 ) ) ) ) ); /* Q28 */ -#else - Copy_Scale_sig_16_32_DEPREC( hCPE->hCoreCoder[0]->old_Aq_12_8_fx, hCPE->hCoreCoder[0]->old_Aq_12_8_fx_32, M + 1, ( 28 - norm_s( hCPE->hCoreCoder[0]->old_Aq_12_8_fx[0] - 1 ) ) ); /* Q28 */ - Copy_Scale_sig_16_32_DEPREC( hCPE->hCoreCoder[1]->old_Aq_12_8_fx, hCPE->hCoreCoder[1]->old_Aq_12_8_fx_32, M + 1, ( 28 - norm_s( hCPE->hCoreCoder[1]->old_Aq_12_8_fx[0] - 1 ) ) ); /* Q28 */ -#endif ivas_mdct_core_reconstruct_fx( hCPE, x_fx, signal_outFB_tmp_fx, fUseTns, 0, Q11, e_sigFB ); Copy32( signal_out_tmp_fx[0], signal_out_fx[0], L_FRAME48k ); /* Q11 */ diff --git a/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c b/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c index 5b1378a89..5248839f5 100644 --- a/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c +++ b/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c @@ -904,13 +904,8 @@ void updateBuffersForDmxMdctStereo_fx( move16(); sts[0]->hTcxLtpDec->exp_tcxltp_mem_out = add( sts[0]->hTcxLtpDec->exp_tcxltp_mem_out, 1 ); move16(); -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( &sts[0]->hTcxLtpDec->tcxltp_mem_in[0], &sts[0]->hTcxLtpDec->tcxltp_mem_in_32[0], TCXLTP_MAX_DELAY, sub( 11, sub( 15, sts[0]->hTcxLtpDec->exp_tcxltp_mem_in ) ) ); // Q11 Copy_Scale_sig_16_32_no_sat( &sts[0]->hTcxLtpDec->tcxltp_mem_out[0], &sts[0]->hTcxLtpDec->tcxltp_mem_out_32[0], TCXLTP_MAX_DELAY, sub( 11, sub( 15, sts[0]->hTcxLtpDec->exp_tcxltp_mem_out ) ) ); // Q11 -#else - Copy_Scale_sig_16_32_DEPREC( &sts[0]->hTcxLtpDec->tcxltp_mem_in[0], &sts[0]->hTcxLtpDec->tcxltp_mem_in_32[0], TCXLTP_MAX_DELAY, sub( 11, sub( 15, sts[0]->hTcxLtpDec->exp_tcxltp_mem_in ) ) ); // Q11 - Copy_Scale_sig_16_32_DEPREC( &sts[0]->hTcxLtpDec->tcxltp_mem_out[0], &sts[0]->hTcxLtpDec->tcxltp_mem_out_32[0], TCXLTP_MAX_DELAY, sub( 11, sub( 15, sts[0]->hTcxLtpDec->exp_tcxltp_mem_out ) ) ); // Q11 -#endif } return; diff --git a/lib_dec/ivas_stereo_switching_dec_fx.c b/lib_dec/ivas_stereo_switching_dec_fx.c index 6c2ad055c..1a6ea257b 100644 --- a/lib_dec/ivas_stereo_switching_dec_fx.c +++ b/lib_dec/ivas_stereo_switching_dec_fx.c @@ -197,9 +197,7 @@ static ivas_error allocate_CoreCoder_fx( } hf_synth_init_fx( st->hBWE_zero ); -#ifdef MSAN_FIX set16_fx( st->hBWE_zero->mem_hp400_fx, 0, 6 ); -#endif } IF( st->cldfbAna == NULL ) @@ -2153,21 +2151,13 @@ void stereo_td2dft_update_fx( /* update buffers used for fading when switching to DFT Stereo */ v_add_fx( sts[0]->hHQ_core->old_out_LB_fx32 + nsLB, sts[1]->hHQ_core->old_out_LB_fx32 + nsLB, hCPE->old_outLB_mdct_fx, old_outLB_len ); L_lerp_fx_q11( hCPE->old_outLB_mdct_fx, hCPE->old_outLB_mdct_fx, STEREO_MDCT2DFT_FADE_LEN_48k, old_outLB_len ); -#ifndef MSAN_FIX - for ( i = 0; i < STEREO_MDCT2DFT_FADE_LEN_48k; i++ ) -#else FOR( i = 0; i < old_outLB_len; i++ ) -#endif { hCPE->old_outLB_mdct_fx[i] = L_shr( hCPE->old_outLB_mdct_fx[i], 1 ); /* Q11 */ move32(); } v_add_fx( sts[0]->hHQ_core->old_out_fx32 + ns, sts[1]->hHQ_core->old_out_fx32 + ns, hCPE->old_out_mdct_fx, old_out_len ); /* exp(exp_old_out) */ -#ifndef MSAN_FIX - for ( int i = 0; i < STEREO_MDCT2DFT_FADE_LEN_48k; i++ ) -#else FOR( i = 0; i < old_out_len; i++ ) -#endif { hCPE->old_out_mdct_fx[i] = L_shr( hCPE->old_out_mdct_fx[i], 1 ); /* q_old_out_mdct */ move32(); diff --git a/lib_dec/ivas_svd_dec_fx.c b/lib_dec/ivas_svd_dec_fx.c index 1467687d8..dd9859504 100644 --- a/lib_dec/ivas_svd_dec_fx.c +++ b/lib_dec/ivas_svd_dec_fx.c @@ -70,11 +70,7 @@ static void biDiagonalReductionLeft_fx( Word32 singularVectors[][MAX_OUTPUT_CHANNELS], /* exp(singularVectors_e) */ Word32 singularValues[MAX_OUTPUT_CHANNELS], /* exp(singularValues_e) */ Word32 secDiag[MAX_OUTPUT_CHANNELS], /* exp(secDiag_e) */ -#ifndef FIX_1010_OPT_SINGLE_RESCALE - Word16 *singularVectors_e, -#else Word16 singularVectors2_e[][MAX_OUTPUT_CHANNELS], -#endif Word16 singularValues_e[MAX_OUTPUT_CHANNELS], Word16 *secDiag_e, const Word16 nChannelsL, /* Q0 */ @@ -88,11 +84,7 @@ static void biDiagonalReductionLeft_fx( static void biDiagonalReductionRight_fx( Word32 singularVectors[][MAX_OUTPUT_CHANNELS], /* exp(singularVectors_e) */ Word32 secDiag[MAX_OUTPUT_CHANNELS], /* exp(secDiag_e) */ -#ifndef FIX_1010_OPT_SINGLE_RESCALE - Word16 *singularVectors_e, -#else Word16 singularVectors2_e[][MAX_OUTPUT_CHANNELS], -#endif Word16 *secDiag_e, const Word16 nChannelsL, /* Q0 */ const Word16 nChannelsC, /* Q0 */ @@ -105,11 +97,7 @@ static void biDiagonalReductionRight_fx( static void singularVectorsAccumulationLeft_fx( Word32 singularVectors_Left[][MAX_OUTPUT_CHANNELS], /* exp(singularVectors_e) as Input, Q31 as output */ Word32 singularValues[MAX_OUTPUT_CHANNELS], /* exp(singularValues_e) */ -#ifndef FIX_1010_OPT_SINGLE_RESCALE - Word16 singularVectors_e, -#else Word16 singularVectors_Left_e[][MAX_OUTPUT_CHANNELS], -#endif Word16 singularValues_e[MAX_OUTPUT_CHANNELS], const Word16 nChannelsL, /* Q0 */ const Word16 nChannelsC /* Q0 */ @@ -119,16 +107,8 @@ static void singularVectorsAccumulationRight_fx( Word32 singularVectors_Left[][MAX_OUTPUT_CHANNELS], /* singularVectors_e */ Word32 singularVectors_Right[][MAX_OUTPUT_CHANNELS], /* singularVectors_e */ Word32 secDiag[MAX_OUTPUT_CHANNELS], /* exp(secDiag_e) */ -#ifndef FIX_1010_OPT_SINGLE_RESCALE - Word16 singularVectors_e, -#else Word16 singularVectors_Left_e[][MAX_OUTPUT_CHANNELS], -#endif -#ifndef FIX_1010_OPT_SEC_SINGLE_RESCALE - Word16 secDiag_e, -#else Word16 *secDiag_e, -#endif const Word16 nChannelsC /* Q0 */ ); @@ -168,7 +148,6 @@ static void ApplyRotation_fx( const Word16 nChannels /* Q0 */ ); -#ifdef FIX_1010_OPT_GIVENS_INV static void GivensRotation2_fx( const Word32 x, /* exp(x_e) */ const Word16 x_e, @@ -178,7 +157,6 @@ static void GivensRotation2_fx( Word32 *resultInv, Word16 *out_e, Word16 *outInv_e ); -#endif static Word32 GivensRotation_fx( const Word32 x, /* exp(x_e) */ @@ -306,11 +284,7 @@ Word16 svd_fx( Word16 lengthSingularValues; Word16 errorMessage, condition; Word32 secDiag_fx[MAX_OUTPUT_CHANNELS]; -#ifndef FIX_1010_OPT_SEC_SINGLE_RESCALE - Word16 secDiag_fx_e = 0; -#else Word16 secDiag_fx_e[MAX_OUTPUT_CHANNELS]; -#endif move16(); Word32 eps_x_fx = 0, temp_fx; move16(); @@ -320,10 +294,6 @@ Word16 svd_fx( push_wmops( "svd_fx" ); -#ifndef FIX_1010_OPT_SINGLE_RESCALE - set32_fx( secDiag_fx, 0, MAX_OUTPUT_CHANNELS ); - set16_fx( singularValues_fx_e, 0, MAX_OUTPUT_CHANNELS ); -#endif /* Collecting Values */ FOR( iCh = 0; iCh < nChannelsL; iCh++ ) @@ -336,22 +306,14 @@ Word16 svd_fx( } /* Householder reduction */ -#ifndef FIX_1010_OPT_SEC_SINGLE_RESCALE - HouseholderReduction_fx( singularVectors_Left_fx, singularValues_fx, singularVectors_Right_fx, secDiag_fx, InputMatrix_e, singularValues_fx_e, &secDiag_fx_e, nChannelsL, nChannelsC, &eps_x_fx, &eps_x_fx_e ); -#else HouseholderReduction_fx( singularVectors_Left_fx, singularValues_fx, singularVectors_Right_fx, secDiag_fx, InputMatrix_e, singularValues_fx_e, secDiag_fx_e, nChannelsL, nChannelsC, &eps_x_fx, &eps_x_fx_e ); -#endif /* Set extremely small values to zero if needed */ // flushToZeroArray(singularValues, max_length); // flushToZeroMat(singularVectors_Left, nChannelsL, nChannelsL); // flushToZeroMat(singularVectors_Right, nChannelsC, nChannelsC); /* BidagonalDiagonalisation */ -#ifndef FIX_1010_OPT_SEC_SINGLE_RESCALE - errorMessage = BidagonalDiagonalisation_fx( singularVectors_Left_fx, singularValues_fx, singularVectors_Right_fx, secDiag_fx, singularValues_fx_e, &secDiag_fx_e, nChannelsL, nChannelsC, eps_x_fx, eps_x_fx_e ); /* Q0 */ -#else errorMessage = BidagonalDiagonalisation_fx( singularVectors_Left_fx, singularValues_fx, singularVectors_Right_fx, secDiag_fx, singularValues_fx_e, secDiag_fx_e, nChannelsL, nChannelsC, eps_x_fx, eps_x_fx_e ); /* Q0 */ -#endif /* Sort the singular values descending order */ lengthSingularValues = s_min( nChannelsL, nChannelsC ); /* Q0 */ @@ -423,11 +385,7 @@ static Word16 BidagonalDiagonalisation_fx( Word32 singularVectors_Right_fx[][MAX_OUTPUT_CHANNELS], /* i/o: right singular vectors (V) singularValues_fx_e*/ Word32 secDiag_fx[MAX_OUTPUT_CHANNELS], /* i/o: secDiag_fx_e*/ Word16 singularValues_fx_e[MAX_OUTPUT_CHANNELS], /* i/o: singular values vector (S) */ -#ifndef FIX_1010_OPT_SEC_SINGLE_RESCALE - Word16 *secDiag_fx_e, /* i/o: */ -#else Word16 *secDiag_new_e, /* i/o: */ -#endif const Word16 nChannelsL, /* i : number of rows in the matrix to be decomposed Q0*/ const Word16 nChannelsC, /* i : number of columns in the matrix to be decomposed Q0*/ const Word32 eps_x, /* i : eps_x_e*/ @@ -441,9 +399,7 @@ static Word16 BidagonalDiagonalisation_fx( move16(); move16(); Word16 temp_exp; -#ifdef FIX_1010_OPT_NORM_NOSAT Word16 temp_exp2; -#endif Word32 g = 0; move16(); Word16 g_e = 0; @@ -451,14 +407,8 @@ static Word16 BidagonalDiagonalisation_fx( Word16 convergence, iteration, found_split; Word16 error = 0; move16(); -#ifdef FIX_1010_OPT_GIVENS_INV Word32 temp; -#endif Word16 singularValues_new_e[MAX_OUTPUT_CHANNELS]; -#ifndef FIX_1010_OPT_SEC_SINGLE_RESCALE - Word16 secDiag_new_e[MAX_OUTPUT_CHANNELS]; - set16_fx( secDiag_new_e, *secDiag_fx_e, MAX_OUTPUT_CHANNELS ); -#endif Copy( singularValues_fx_e, singularValues_new_e, MAX_OUTPUT_CHANNELS ); FOR( iCh = nChannelsC - 1; iCh >= 0; iCh-- ) /* nChannelsC */ @@ -527,46 +477,17 @@ static Word16 BidagonalDiagonalisation_fx( c = singularValues_fx[kCh]; /* exp(singularValues_new_e) */ c_e = singularValues_new_e[kCh]; -#ifdef FIX_1010_OPT_GIVENS_INV GivensRotation2_fx( g, g_e, singularValues_fx[kCh], singularValues_new_e[kCh], &singularValues_fx[kCh], &temp, &singularValues_new_e[kCh], &temp_exp ); /* exp(singularValues_new_e) */ c = Mpy_32_32( c, temp ); c_e = add( c_e, temp_exp ); -#else - singularValues_fx[kCh] = GivensRotation_fx( g, g_e, singularValues_fx[kCh], singularValues_new_e[kCh], &singularValues_new_e[kCh] ); /* exp(singularValues_new_e) */ - c = BASOP_Util_Divide3232_Scale_cadence( c, maxWithSign_fx( singularValues_fx[kCh] ), &temp_exp ); /* exp(temp_exp + (c_e - singularValues_new_e)) */ - c_e = add( temp_exp, sub( c_e, singularValues_new_e[kCh] ) ); -#endif -#ifndef FIX_1010_OPT_NORM_NOSAT - IF( c_e > 0 ) - { - c = L_shl_sat( c, c_e ); // Q31 - c_e = 0; - move16(); - } -#else temp_exp2 = norm_l( c ); c = L_shl( c, temp_exp2 ); c_e = sub( c_e, temp_exp2 ); -#endif -#ifdef FIX_1010_OPT_GIVENS_INV s = Mpy_32_32( -g, temp ); s_e = add( g_e, temp_exp ); -#else - s = BASOP_Util_Divide3232_Scale_cadence( -g, maxWithSign_fx( singularValues_fx[kCh] ), &temp_exp ); /* exp(temp_exp + (g_e - singularValues_new_e))*/ - s_e = add( temp_exp, sub( g_e, singularValues_new_e[kCh] ) ); -#endif -#ifndef FIX_1010_OPT_NORM_NOSAT - IF( s_e > 0 ) - { - s = L_shl_sat( s, s_e ); // Q31 - s_e = 0; - move16(); - } -#else temp_exp2 = norm_l( s ); s = L_shl( s, temp_exp2 ); s_e = sub( s_e, temp_exp2 ); -#endif ApplyRotation_fx( singularVectors_Left_fx, c, c_e, s, s_e, 0, x11_e, 0, x12_e, &f1, &f1_e, &f2, &f2_e, kCh, split, nChannelsL ); /* nChannelsL */ } } @@ -617,24 +538,6 @@ static Word16 BidagonalDiagonalisation_fx( // rescaling block Copy( singularValues_new_e, singularValues_fx_e, MAX_OUTPUT_CHANNELS ); -#ifndef FIX_1010_OPT_SEC_SINGLE_RESCALE - Word16 max_exp = -31; - move16(); - FOR( iCh = 0; iCh < nChannelsC; iCh++ ) - { - if ( secDiag_fx[iCh] ) - { - max_exp = s_max( max_exp, secDiag_new_e[iCh] ); - } - } - *secDiag_fx_e = max_exp; - move16(); - FOR( iCh = 0; iCh < nChannelsC; iCh++ ) - { - secDiag_fx[iCh] = L_shr_r( secDiag_fx[iCh], sub( *secDiag_fx_e, secDiag_new_e[iCh] ) ); /* exp(secDiag_fx_e) */ - move32(); - } -#endif return ( error ); } @@ -658,13 +561,9 @@ static void ApplyQRTransform_fx( const Word16 nChannelsC /* i : number of columns in the matrix to be decomposed Q0*/ ) { -#ifdef FIX_1010_OPT_GIVENS_INV Word32 temp; Word16 temp_e; -#endif -#ifdef FIX_1010_OPT_NORM_NOSAT Word16 temp_norm_e; -#endif Word16 ch, split; Word32 d = 0, g = 0, r = 0, x_ii = 0, x_split = 0, x_kk = 0, mu = 0, aux = 0; move32(); @@ -767,47 +666,17 @@ static void ApplyQRTransform_fx( g = Mpy_32_32( c, secDiag[ch + 1] ); /* exp(c_e + secDiag_e) */ g_e = add( c_e, secDiag_e[ch + 1] ); -#ifdef FIX_1010_OPT_GIVENS_INV GivensRotation2_fx( d, d_e, r, r_e, &secDiag[ch], &temp, &secDiag_e[ch], &temp_e ); /* exp(secDiag_e) */ c = Mpy_32_32( d, temp ); c_e = add( temp_e, d_e ); -#else - secDiag[ch] = GivensRotation_fx( d, d_e, r, r_e, &secDiag_e[ch] ); /* exp(secDiag_e) */ - move32(); - c = BASOP_Util_Divide3232_Scale_cadence( d, maxWithSign_fx( secDiag[ch] ), &c_e ); /* exp(c_e + (d_e + secDiag_e)) */ - c_e = add( c_e, sub( d_e, secDiag_e[ch] ) ); -#endif -#ifndef FIX_1010_OPT_NORM_NOSAT - IF( c_e > 0 ) - { - c = L_shl_sat( c, c_e ); // Q31 - c_e = 0; - move16(); - } -#else temp_norm_e = norm_l( c ); c = L_shl( c, temp_norm_e ); c_e = sub( c_e, temp_norm_e ); -#endif -#ifdef FIX_1010_OPT_GIVENS_INV s = Mpy_32_32( r, temp ); s_e = add( r_e, temp_e ); -#else - s = BASOP_Util_Divide3232_Scale_cadence( r, maxWithSign_fx( secDiag[ch] ), &s_e ); /* exp(s_e + (r_e - sec_Diag_e))*/ - s_e = add( s_e, sub( r_e, secDiag_e[ch] ) ); -#endif -#ifndef FIX_1010_OPT_NORM_NOSAT - IF( s_e > 0 ) - { - s = L_shl_sat( s, s_e ); // Q31 - s_e = 0; - move16(); - } -#else temp_norm_e = norm_l( s ); s = L_shl( s, temp_norm_e ); s_e = sub( s_e, temp_norm_e ); -#endif r = Mpy_32_32( s, singularValues[ch + 1] ); /* exp(r_e + secDiag_e) */ r_e = add( s_e, singularValues_e[ch + 1] ); x_split = Mpy_32_32( c, singularValues[ch + 1] ); /* exp(c_e + secDiag_e) */ @@ -821,48 +690,21 @@ static void ApplyQRTransform_fx( // ApplyRotation(singularVectors_Right, c, s, x_ii, aux, &d, &g, ch + 1, ch, nChannelsC); ApplyRotation_fx( singularVectors_Right, c, c_e, s, s_e, x_ii, x_ii_e, aux, aux_e, &d, &d_e, &g, &g_e, ch + 1, ch, nChannelsC ); -#ifdef FIX_1010_OPT_GIVENS_INV GivensRotation2_fx( d, d_e, r, r_e, &singularValues[ch], &aux, &singularValues_e[ch], &aux_e ); /* exp(singularValues_e) */ -#else - singularValues[ch] = GivensRotation_fx( d, d_e, r, r_e, &singularValues_e[ch] ); /* exp(singularValues_e) */ - move32(); -#endif IF( singularValues[ch] != 0 ) { -#ifndef FIX_1010_OPT_GIVENS_INV - aux = BASOP_Util_Divide3232_Scale_cadence( ONE_IN_Q30, singularValues[ch], &aux_e ); /* exp(aux_e + (1 - singularValues_e)) */ - aux_e = add( aux_e, sub( 1, singularValues_e[ch] ) ); -#endif c = Mpy_32_32( d, aux ); /* exp(d_e + aux_e) */ c_e = add( d_e, aux_e ); -#ifndef FIX_1010_OPT_NORM_NOSAT - IF( c_e > 0 ) - { - c = L_shl_sat( c, c_e ); // Q31 - c_e = 0; - move16(); - } -#else temp_norm_e = norm_l( c ); c = L_shl( c, temp_norm_e ); c_e = sub( c_e, temp_norm_e ); -#endif s = Mpy_32_32( r, aux ); /* exp(r_e + aux_e) */ s_e = add( r_e, aux_e ); -#ifndef FIX_1010_OPT_NORM_NOSAT - IF( s_e > 0 ) - { - s = L_shl_sat( s, s_e ); // Q31 - s_e = 0; - move16(); - } -#else temp_norm_e = norm_l( s ); s = L_shl( s, temp_norm_e ); s_e = sub( s_e, temp_norm_e ); -#endif } // ApplyRotation(singularVectors_Left, c, s, g, x_split, &d, &x_ii, ch + 1, ch, nChannelsL); @@ -915,7 +757,6 @@ static void ApplyRotation_fx( *g = BASOP_Util_Add_Mant32Exp( Mpy_32_32( c, x12 ), add( c_e, x12_e ), Mpy_32_32( L_negate( s ), x11 ), add( s_e, x11_e ), g_e ); /* exp(g_e) */ move32(); -#ifdef SVD_WMOPS_OPT Word16 c_q = sub( 31, c_e ); Word16 s_q = sub( 31, s_e ); Word32 op1, op2; @@ -957,42 +798,6 @@ static void ApplyRotation_fx( singularVector[ch][currentIndex1] = W_sat_l( temp ); // Q(singularVector) move32(); } -#else -#ifndef FIX_MINOR_SVD_WMOPS_MR1010X - FOR( ch = 0; ch < nChannels; ch++ ) - { - x11 = singularVector[ch][currentIndex2]; - move32(); - x12 = singularVector[ch][currentIndex1]; - move32(); - singularVector[ch][currentIndex2] = BASOP_Util_Add_Mant32Exp( Mpy_32_32( c, x11 ), c_e, Mpy_32_32( s, x12 ), s_e, &temp_exp ); /* exp(temp_exp) */ - move32(); - singularVector[ch][currentIndex2] = L_shl_sat( singularVector[ch][currentIndex2], temp_exp ); /* exp(temp_exp) */ - move32(); - singularVector[ch][currentIndex1] = BASOP_Util_Add_Mant32Exp( Mpy_32_32( c, x12 ), c_e, Mpy_32_32( L_negate( s ), x11 ), s_e, &temp_exp ); /* exp(temp_exp) */ - move32(); - singularVector[ch][currentIndex1] = L_shl_sat( singularVector[ch][currentIndex1], temp_exp ); /* exp(temp_exp) */ - move32(); - } -#else - Word32 s_neg = L_negate( s ); - Word32 temp; - FOR( ch = 0; ch < nChannels; ch++ ) - { - x11 = singularVector[ch][currentIndex2]; - move32(); - x12 = singularVector[ch][currentIndex1]; - move32(); - temp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( c, x11 ), c_e, Mpy_32_32( s, x12 ), s_e, &temp_exp ); /* exp(temp_exp) */ - singularVector[ch][currentIndex2] = L_shl_sat( temp, temp_exp ); /* exp(temp_exp) */ - move32(); - temp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( c, x12 ), c_e, Mpy_32_32( s_neg, x11 ), s_e, &temp_exp ); /* exp(temp_exp) */ - singularVector[ch][currentIndex1] = L_shl_sat( temp, temp_exp ); /* exp(temp_exp) */ - move32(); - } - -#endif -#endif return; } @@ -1024,7 +829,6 @@ static void HouseholderReduction_fx( Word16 sig_x_fx_e = 0; move16(); -#ifdef FIX_1010_OPT_SINGLE_RESCALE Word16 iCh, jCh; Word16 singularVectors_Left_fx_e[MAX_OUTPUT_CHANNELS][MAX_OUTPUT_CHANNELS]; FOR( jCh = 0; jCh < nChannelsL; jCh++ ) @@ -1035,25 +839,15 @@ static void HouseholderReduction_fx( move16(); } } -#endif /* Bidiagonal Reduction for every channel */ FOR( nCh = 0; nCh < nChannelsC; nCh++ ) /* nChannelsC */ { -#ifndef FIX_1010_OPT_SINGLE_RESCALE - biDiagonalReductionLeft_fx( singularVectors_Left_fx, singularValues_fx, secDiag_fx, &singularVectors_Left_e, singularValues_fx_e, secDiag_fx_e, nChannelsL, nChannelsC, nCh, &sig_x_fx, &sig_x_fx_e, &g_fx ); - biDiagonalReductionRight_fx( singularVectors_Left_fx, secDiag_fx, &singularVectors_Left_e, secDiag_fx_e, nChannelsL, nChannelsC, nCh, &sig_x_fx, &sig_x_fx_e, &g_fx ); -#else biDiagonalReductionLeft_fx( singularVectors_Left_fx, singularValues_fx, secDiag_fx, singularVectors_Left_fx_e, singularValues_fx_e, secDiag_fx_e, nChannelsL, nChannelsC, nCh, &sig_x_fx, &sig_x_fx_e, &g_fx ); biDiagonalReductionRight_fx( singularVectors_Left_fx, secDiag_fx, singularVectors_Left_fx_e, secDiag_fx_e, nChannelsL, nChannelsC, nCh, &sig_x_fx, &sig_x_fx_e, &g_fx ); -#endif Word16 L_temp_e; -#ifndef FIX_1010_OPT_SEC_SINGLE_RESCALE - Word32 L_temp = BASOP_Util_Add_Mant32Exp( L_abs( singularValues_fx[nCh] ), singularValues_fx_e[nCh], L_abs( secDiag_fx[nCh] ), *secDiag_fx_e, &L_temp_e ); /* exp(L_temp_e) */ -#else Word32 L_temp = BASOP_Util_Add_Mant32Exp( L_abs( singularValues_fx[nCh] ), singularValues_fx_e[nCh], L_abs( secDiag_fx[nCh] ), secDiag_fx_e[nCh], &L_temp_e ); /* exp(L_temp_e) */ -#endif IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( L_temp, L_temp_e, *eps_x_fx, *eps_x_fx_e ), 1 ) ) { *eps_x_fx = L_temp; /* exp(L_temp_e) */ @@ -1064,19 +858,10 @@ static void HouseholderReduction_fx( } /* SingularVecotr Accumulation */ -#ifndef FIX_1010_OPT_SINGLE_RESCALE - singularVectorsAccumulationRight_fx( singularVectors_Left_fx, singularVectors_Right_fx, secDiag_fx, singularVectors_Left_e, *secDiag_fx_e, nChannelsC ); - singularVectorsAccumulationLeft_fx( singularVectors_Left_fx, singularValues_fx, singularVectors_Left_e, singularValues_fx_e, nChannelsL, nChannelsC ); -#else -#ifndef FIX_1010_OPT_SEC_SINGLE_RESCALE - singularVectorsAccumulationRight_fx( singularVectors_Left_fx, singularVectors_Right_fx, secDiag_fx, singularVectors_Left_fx_e, *secDiag_fx_e, nChannelsC ); -#else singularVectorsAccumulationRight_fx( singularVectors_Left_fx, singularVectors_Right_fx, secDiag_fx, singularVectors_Left_fx_e, secDiag_fx_e, nChannelsC ); -#endif singularVectorsAccumulationLeft_fx( singularVectors_Left_fx, singularValues_fx, singularVectors_Left_fx_e, singularValues_fx_e, nChannelsL, nChannelsC ); -#endif return; } @@ -1091,11 +876,7 @@ static void biDiagonalReductionLeft_fx( Word32 singularVectors[][MAX_OUTPUT_CHANNELS], /* exp(singularVectors_e) */ Word32 singularValues[MAX_OUTPUT_CHANNELS], /* exp(singularValues_e) */ Word32 secDiag[MAX_OUTPUT_CHANNELS], /* exp(secDiag_e) */ -#ifndef FIX_1010_OPT_SINGLE_RESCALE - Word16 *singularVectors_e, -#else Word16 singularVectors2_e[][MAX_OUTPUT_CHANNELS], -#endif Word16 singularValues_e[MAX_OUTPUT_CHANNELS], Word16 *secDiag_e, const Word16 nChannelsL, /* Q0 */ @@ -1111,39 +892,11 @@ static void biDiagonalReductionLeft_fx( Word16 norm_x_e, f_e, r_e; Word32 L_temp; Word16 L_temp_e; -#ifndef FIX_1010_OPT_SINGLE_RESCALE - Word16 sing_exp[MAX_OUTPUT_CHANNELS]; - Word16 sing_exp2[MAX_OUTPUT_CHANNELS][MAX_OUTPUT_CHANNELS] = { 0 }; - FOR( jCh = 0; jCh < MAX_OUTPUT_CHANNELS; jCh++ ) - { - set16_fx( sing_exp2[jCh], *singularVectors_e, MAX_OUTPUT_CHANNELS ); - } -#endif secDiag[currChannel] = Mpy_32_32( *sig_x, *g ); /* exp(sig_x_e) */ move32(); -#ifndef FIX_1010_OPT_SEC_SINGLE_RESCALE - // rescaling block - IF( GT_16( *sig_x_e, *secDiag_e ) ) - { - FOR( Word16 i = 0; i < MAX_OUTPUT_CHANNELS; i++ ){ - IF( NE_16( i, currChannel ) ){ - secDiag[i] = L_shl( secDiag[i], sub( *secDiag_e, *sig_x_e ) ); /* sig_x_e */ - move32(); - } -} -*secDiag_e = *sig_x_e; -move16(); -} -ELSE IF( LT_16( *sig_x_e, *secDiag_e ) ) -{ - secDiag[currChannel] = L_shr_r( secDiag[currChannel], sub( *secDiag_e, *sig_x_e ) ); /* exp(secDiag_e) */ - move32(); -} -#else secDiag_e[currChannel] = *sig_x_e; move16(); -#endif /* Setting values to 0 */ ( *sig_x ) = 0; @@ -1158,54 +911,26 @@ IF( LT_16( currChannel, nChannelsL ) ) /* i <= m */ FOR( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ { -#ifndef FIX_1010_OPT_SINGLE_RESCALE - ( *sig_x ) = BASOP_Util_Add_Mant32Exp( *sig_x, *sig_x_e, L_abs( singularVectors[jCh][currChannel] ), *singularVectors_e, sig_x_e ); /* exp(sig_x_e) */ -#else ( *sig_x ) = BASOP_Util_Add_Mant32Exp( *sig_x, *sig_x_e, L_abs( singularVectors[jCh][currChannel] ), singularVectors2_e[jCh][currChannel], sig_x_e ); /* exp(sig_x_e) */ -#endif } IF( ( *sig_x ) ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */ { -#ifdef FIX_1010_OPT_DIV Word16 invVal_e; Word32 invVal; invVal = BASOP_Util_Divide3232_Scale_cadence( MAXVAL_WORD32, maxWithSign_fx( *sig_x ), &invVal_e ); -#endif norm_x = 0; move32(); norm_x_e = 0; move16(); FOR( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ { -#ifndef FIX_1010_OPT_DIV -#ifndef FIX_1010_OPT_SINGLE_RESCALE - singularVectors[jCh][currChannel] = BASOP_Util_Divide3232_Scale_cadence( singularVectors[jCh][currChannel], maxWithSign_fx( *sig_x ), &sing_exp[jCh] ); /* exp(sing_exp + (singularVectors_e - sig_x_e) */ - move32(); - sing_exp[jCh] = add( sing_exp[jCh], sub( *singularVectors_e, *sig_x_e ) ); - move16(); - norm_x = BASOP_Util_Add_Mant32Exp( norm_x, norm_x_e, Mpy_32_32( singularVectors[jCh][currChannel], singularVectors[jCh][currChannel] ), shl( sing_exp[jCh], 1 ), &norm_x_e ); /* exp(norm_x_e) */ -#else - singularVectors[jCh][currChannel] = BASOP_Util_Divide3232_Scale_cadence( singularVectors[jCh][currChannel], maxWithSign_fx( *sig_x ), &L_temp_e ); /* exp(sing_exp + (singularVectors_e - sig_x_e) */ - move32(); - singularVectors2_e[jCh][currChannel] = add( L_temp_e, sub( singularVectors2_e[jCh][currChannel], *sig_x_e ) ); - move16(); - norm_x = BASOP_Util_Add_Mant32Exp( norm_x, norm_x_e, Mpy_32_32( singularVectors[jCh][currChannel], singularVectors[jCh][currChannel] ), shl( singularVectors2_e[jCh][currChannel], 1 ), &norm_x_e ); /* exp(norm_x_e) */ -#endif -#else Word16 temp_e = norm_l( singularVectors[jCh][currChannel] ); singularVectors[jCh][currChannel] = Mpy_32_32( L_shl( singularVectors[jCh][currChannel], temp_e ), invVal ); /* exp(sing_exp + (singularVectors_e - sig_x_e) */ move32(); -#ifndef FIX_1010_OPT_SINGLE_RESCALE - sing_exp[jCh] = sub( add( invVal_e, sub( *singularVectors_e, *sig_x_e ) ), temp_e ); - move16(); - norm_x = BASOP_Util_Add_Mant32Exp( norm_x, norm_x_e, Mpy_32_32( singularVectors[jCh][currChannel], singularVectors[jCh][currChannel] ), shl( sing_exp[jCh], 1 ), &norm_x_e ); /* exp(norm_x_e) */ -#else singularVectors2_e[jCh][currChannel] = sub( add( invVal_e, sub( singularVectors2_e[jCh][currChannel], *sig_x_e ) ), temp_e ); move16(); norm_x = BASOP_Util_Add_Mant32Exp( norm_x, norm_x_e, Mpy_32_32( singularVectors[jCh][currChannel], singularVectors[jCh][currChannel] ), shl( singularVectors2_e[jCh][currChannel], 1 ), &norm_x_e ); /* exp(norm_x_e) */ -#endif -#endif } IF( GT_16( norm_x_e, 0 ) ) { @@ -1219,38 +944,18 @@ IF( LT_16( currChannel, nChannelsL ) ) /* i <= m */ L_temp = Sqrt32( norm_x, &L_temp_e ); L_temp = L_shl_r( L_temp, L_temp_e ); // Q31 //( *g ) = L_negate( GE_32( singularVectors[currChannel][idx], 0 ) ? L_temp : L_negate( L_temp ) ); -#ifndef FIX_MINOR_SVD_WMOPS_MR1010X - IF( singularVectors[currChannel][idx] >= 0 ) - { - ( *g ) = L_negate( L_temp ); - move32(); - } - ELSE - { - ( *g ) = L_negate( L_negate( L_temp ) ); - move32(); - } -#else if ( singularVectors[currChannel][idx] >= 0 ) { L_temp = L_negate( L_temp ); } ( *g ) = L_temp; move32(); -#endif -#ifndef FIX_1010_OPT_SINGLE_RESCALE - r = BASOP_Util_Add_Mant32Exp( Mpy_32_32( ( *g ), singularVectors[currChannel][idx] ), sing_exp[currChannel], -norm_x, norm_x_e, &r_e ); /* exp(r_e) */ - singularVectors[currChannel][idx] = BASOP_Util_Add_Mant32Exp( singularVectors[currChannel][idx], sing_exp[currChannel], -( *g ), 0, &sing_exp[currChannel] ); /* sing_exp */ -#else r = BASOP_Util_Add_Mant32Exp( Mpy_32_32( ( *g ), singularVectors[currChannel][idx] ), singularVectors2_e[currChannel][idx], -norm_x, norm_x_e, &r_e ); /* exp(r_e) */ singularVectors[currChannel][idx] = BASOP_Util_Add_Mant32Exp( singularVectors[currChannel][idx], singularVectors2_e[currChannel][idx], -( *g ), 0, &singularVectors2_e[currChannel][idx] ); /* sing_exp */ -#endif move32(); -#ifdef FIX_1010_OPT_DIV invVal = BASOP_Util_Divide3232_Scale_cadence( MAXVAL_WORD32, maxWithSign_fx( r ), &invVal_e ); -#endif FOR( iCh = currChannel + 1; iCh < nChannelsC; iCh++ ) /* nChannelsC */ { @@ -1260,28 +965,15 @@ IF( LT_16( currChannel, nChannelsL ) ) /* i <= m */ move16(); FOR( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ { -#ifndef FIX_1010_OPT_SINGLE_RESCALE - norm_x = BASOP_Util_Add_Mant32Exp( norm_x, norm_x_e, Mpy_32_32( singularVectors[jCh][currChannel], singularVectors[jCh][iCh] ), add( sing_exp[jCh], *singularVectors_e ), &norm_x_e ); /* exp(norm_x_e) */ -#else norm_x = BASOP_Util_Add_Mant32Exp( norm_x, norm_x_e, Mpy_32_32( singularVectors[jCh][currChannel], singularVectors[jCh][iCh] ), add( singularVectors2_e[jCh][currChannel], singularVectors2_e[jCh][iCh] ), &norm_x_e ); /* exp(norm_x_e) */ -#endif } -#ifndef FIX_1010_OPT_DIV - f = BASOP_Util_Divide3232_Scale_cadence( norm_x, maxWithSign_fx( r ), &f_e ); /* f_e + (norm_x_e - r_e) */ - f_e = add( f_e, sub( norm_x_e, r_e ) ); -#else f = Mpy_32_32( norm_x, invVal ); /* invVal_e + (norm_x_e - r_e) */ f_e = add( invVal_e, sub( norm_x_e, r_e ) ); -#endif FOR( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ { -#ifndef FIX_1010_OPT_SINGLE_RESCALE - singularVectors[jCh][iCh] = BASOP_Util_Add_Mant32Exp( singularVectors[jCh][iCh], *singularVectors_e, Mpy_32_32( f, singularVectors[jCh][currChannel] ), add( f_e, sing_exp[jCh] ), &sing_exp2[jCh][iCh] ); /* exp( sing_exp2) */ -#else singularVectors[jCh][iCh] = BASOP_Util_Add_Mant32Exp( singularVectors[jCh][iCh], singularVectors2_e[jCh][iCh], Mpy_32_32( f, singularVectors[jCh][currChannel] ), add( f_e, singularVectors2_e[jCh][currChannel] ), &singularVectors2_e[jCh][iCh] ); -#endif move32(); } } @@ -1291,37 +983,10 @@ IF( LT_16( currChannel, nChannelsL ) ) /* i <= m */ { singularVectors[jCh][currChannel] = Mpy_32_32( singularVectors[jCh][currChannel], ( *sig_x ) ); /* sing_exp + sig_x_e */ move32(); -#ifndef FIX_1010_OPT_SINGLE_RESCALE - sing_exp2[jCh][currChannel] = add( sing_exp[jCh], *sig_x_e ); -#else singularVectors2_e[jCh][currChannel] = add( singularVectors2_e[jCh][currChannel], *sig_x_e ); -#endif move16(); } -#ifndef FIX_1010_OPT_SINGLE_RESCALE - // rescaling block - Word16 exp_max = *singularVectors_e; - move16(); - FOR( iCh = 0; iCh < nChannelsC; iCh++ ) - { - FOR( jCh = 0; jCh < nChannelsL; jCh++ ) - { - exp_max = s_max( exp_max, sing_exp2[jCh][iCh] ); - } - } - - FOR( iCh = 0; iCh < nChannelsC; iCh++ ) - { - FOR( jCh = 0; jCh < nChannelsL; jCh++ ) - { - singularVectors[jCh][iCh] = L_shr_r( singularVectors[jCh][iCh], sub( exp_max, sing_exp2[jCh][iCh] ) ); /* exp(exp_max) */ - move32(); - } - } - *singularVectors_e = exp_max; - move16(); -#endif } // rescaling block @@ -1343,16 +1008,8 @@ return; static void biDiagonalReductionRight_fx( Word32 singularVectors[][MAX_OUTPUT_CHANNELS], /* exp(singularVectors_e) */ Word32 secDiag[MAX_OUTPUT_CHANNELS], /* exp(secDiag_exp[]) */ -#ifndef FIX_1010_OPT_SINGLE_RESCALE - Word16 *singularVectors_e, -#else Word16 singularVectors2_e[][MAX_OUTPUT_CHANNELS], -#endif -#ifndef FIX_1010_OPT_SEC_SINGLE_RESCALE - Word16 *secDiag_e, -#else Word16 *secDiag_exp, -#endif const Word16 nChannelsL, /* Q0 */ const Word16 nChannelsC, /* Q0 */ const Word16 currChannel, /* Q0 */ @@ -1364,22 +1021,8 @@ static void biDiagonalReductionRight_fx( Word16 iCh, jCh, idx; Word32 norm_x, r; Word16 norm_x_e, r_e; -#ifndef FIX_1010_OPT_SEC_SINGLE_RESCALE - Word16 secDiag_exp[MAX_OUTPUT_CHANNELS]; -#endif Word32 L_temp; Word16 L_temp_e; -#ifndef FIX_1010_OPT_SINGLE_RESCALE - Word16 sing_exp[MAX_OUTPUT_CHANNELS]; - Word16 sing_exp2[MAX_OUTPUT_CHANNELS][MAX_OUTPUT_CHANNELS] = { 0 }; - FOR( jCh = 0; jCh < MAX_OUTPUT_CHANNELS; jCh++ ) - { - set16_fx( sing_exp2[jCh], *singularVectors_e, MAX_OUTPUT_CHANNELS ); - } -#endif -#ifndef FIX_1010_OPT_SEC_SINGLE_RESCALE - set16_fx( secDiag_exp, *secDiag_e, MAX_OUTPUT_CHANNELS ); -#endif /* Setting values to 0 */ ( *sig_x ) = 0; @@ -1393,11 +1036,7 @@ static void biDiagonalReductionRight_fx( FOR( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ { -#ifndef FIX_1010_OPT_SINGLE_RESCALE - ( *sig_x ) = BASOP_Util_Add_Mant32Exp( *sig_x, *sig_x_e, L_abs( singularVectors[currChannel][jCh] ), *singularVectors_e, sig_x_e ); /* exp(sig_x_e) */ -#else ( *sig_x ) = BASOP_Util_Add_Mant32Exp( *sig_x, *sig_x_e, L_abs( singularVectors[currChannel][jCh] ), singularVectors2_e[currChannel][jCh], sig_x_e ); /* exp(sig_x_e) */ -#endif } IF( ( *sig_x ) ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */ @@ -1407,41 +1046,17 @@ static void biDiagonalReductionRight_fx( norm_x_e = 0; move16(); -#ifdef FIX_1010_OPT_DIV Word16 invVal_e, temp_e; Word32 invVal; invVal = BASOP_Util_Divide3232_Scale_cadence( MAXVAL_WORD32, maxWithSign_fx( *sig_x ), &invVal_e ); -#endif FOR( jCh = idx; jCh < nChannelsC; jCh++ ) /*nChannelsC */ { -#ifndef FIX_1010_OPT_DIV -#ifndef FIX_1010_OPT_SINGLE_RESCALE - singularVectors[currChannel][jCh] = BASOP_Util_Divide3232_Scale_cadence( singularVectors[currChannel][jCh], maxWithSign_fx( *sig_x ), &sing_exp[jCh] ); /* exp(sing_exp + (singularVectors_e - sig_x_e)) */ - move32(); - sing_exp[jCh] = add( sing_exp[jCh], sub( *singularVectors_e, *sig_x_e ) ); - move16(); - norm_x = BASOP_Util_Add_Mant32Exp( norm_x, norm_x_e, Mpy_32_32( singularVectors[currChannel][jCh], singularVectors[currChannel][jCh] ), shl( sing_exp[jCh], 1 ), &norm_x_e ); /* exp(norm_x_e) */ -#else - singularVectors[currChannel][jCh] = BASOP_Util_Divide3232_Scale_cadence( singularVectors[currChannel][jCh], maxWithSign_fx( *sig_x ), &L_temp_e ); /* exp(sing_exp + (singularVectors_e - sig_x_e)) */ - move32(); - singularVectors2_e[currChannel][jCh] = add( L_temp_e, sub( singularVectors2_e[currChannel][jCh], *sig_x_e ) ); - move16(); - norm_x = BASOP_Util_Add_Mant32Exp( norm_x, norm_x_e, Mpy_32_32( singularVectors[currChannel][jCh], singularVectors[currChannel][jCh] ), shl( singularVectors2_e[currChannel][jCh], 1 ), &norm_x_e ); /* exp(norm_x_e) */ -#endif -#else temp_e = norm_l( singularVectors[currChannel][jCh] ); singularVectors[currChannel][jCh] = Mpy_32_32( L_shl( singularVectors[currChannel][jCh], temp_e ), invVal ); /* exp(sing_exp + (singularVectors_e - sig_x_e) */ move32(); -#ifndef FIX_1010_OPT_SINGLE_RESCALE - sing_exp[jCh] = add( sub( invVal_e, temp_e ), sub( *singularVectors_e, *sig_x_e ) ); - move16(); - norm_x = BASOP_Util_Add_Mant32Exp( norm_x, norm_x_e, Mpy_32_32( singularVectors[currChannel][jCh], singularVectors[currChannel][jCh] ), shl( sing_exp[jCh], 1 ), &norm_x_e ); /* exp(norm_x_e) */ -#else singularVectors2_e[currChannel][jCh] = add( sub( invVal_e, temp_e ), sub( singularVectors2_e[currChannel][jCh], *sig_x_e ) ); move16(); norm_x = BASOP_Util_Add_Mant32Exp( norm_x, norm_x_e, Mpy_32_32( singularVectors[currChannel][jCh], singularVectors[currChannel][jCh] ), shl( singularVectors2_e[currChannel][jCh], 1 ), &norm_x_e ); /* exp(norm_x_e) */ -#endif -#endif } IF( GT_16( norm_x_e, 0 ) ) { @@ -1465,44 +1080,19 @@ static void biDiagonalReductionRight_fx( move32(); } -#ifndef FIX_1010_OPT_SINGLE_RESCALE - r = BASOP_Util_Add_Mant32Exp( Mpy_32_32( ( *g ), singularVectors[currChannel][idx] ), sing_exp[idx], -norm_x, norm_x_e, &r_e ); /* exp(r_e) */ - singularVectors[currChannel][idx] = BASOP_Util_Add_Mant32Exp( singularVectors[currChannel][idx], sing_exp[idx], -( *g ), 0, &sing_exp[idx] ); /* exp(sing_exp) */ -#else r = BASOP_Util_Add_Mant32Exp( Mpy_32_32( ( *g ), singularVectors[currChannel][idx] ), singularVectors2_e[currChannel][idx], -norm_x, norm_x_e, &r_e ); /* exp(r_e) */ singularVectors[currChannel][idx] = BASOP_Util_Add_Mant32Exp( singularVectors[currChannel][idx], singularVectors2_e[currChannel][idx], -( *g ), 0, &singularVectors2_e[currChannel][idx] ); /* exp(sing_exp) */ -#endif move32(); -#ifdef FIX_1010_OPT_DIV invVal = BASOP_Util_Divide3232_Scale_cadence( MAXVAL_WORD32, maxWithSign_fx( r ), &invVal_e ); -#endif FOR( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ { -#ifndef FIX_1010_OPT_DIV -#ifndef FIX_1010_OPT_SINGLE_RESCALE - secDiag[jCh] = BASOP_Util_Divide3232_Scale_cadence( singularVectors[currChannel][jCh], maxWithSign_fx( r ), &secDiag_exp[jCh] ); /* exp(secDiag_exp + (sing_exp - r_e) */ - move32(); - secDiag_exp[jCh] = add( secDiag_exp[jCh], sub( sing_exp[jCh], r_e ) ); - move32(); -#else - secDiag[jCh] = BASOP_Util_Divide3232_Scale_cadence( singularVectors[currChannel][jCh], maxWithSign_fx( r ), &secDiag_exp[jCh] ); /* exp(secDiag_exp + (sing_exp - r_e) */ - move32(); - secDiag_exp[jCh] = add( secDiag_exp[jCh], sub( singularVectors2_e[currChannel][jCh], r_e ) ); - move32(); -#endif -#else temp_e = norm_l( singularVectors[currChannel][jCh] ); secDiag[jCh] = Mpy_32_32( L_shl( singularVectors[currChannel][jCh], temp_e ), invVal ); /* exp(sing_exp + (singularVectors_e - sig_x_e) */ move32(); -#ifndef FIX_1010_OPT_SINGLE_RESCALE - secDiag_exp[jCh] = add( sub( invVal_e, temp_e ), sub( sing_exp[jCh], r_e ) ); -#else secDiag_exp[jCh] = add( sub( invVal_e, temp_e ), sub( singularVectors2_e[currChannel][jCh], r_e ) ); -#endif move16(); -#endif } FOR( iCh = currChannel + 1; iCh < nChannelsL; iCh++ ) /* nChannelsL */ @@ -1513,20 +1103,12 @@ static void biDiagonalReductionRight_fx( move16(); FOR( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ { -#ifndef FIX_1010_OPT_SINGLE_RESCALE - norm_x = BASOP_Util_Add_Mant32Exp( norm_x, norm_x_e, Mpy_32_32( singularVectors[iCh][jCh], singularVectors[currChannel][jCh] ), add( *singularVectors_e, sing_exp[jCh] ), &norm_x_e ); /* exp(norm_x_e) */ -#else norm_x = BASOP_Util_Add_Mant32Exp( norm_x, norm_x_e, Mpy_32_32( singularVectors[iCh][jCh], singularVectors[currChannel][jCh] ), add( singularVectors2_e[iCh][jCh], singularVectors2_e[currChannel][jCh] ), &norm_x_e ); /* exp(norm_x_e) */ -#endif } FOR( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ { -#ifndef FIX_1010_OPT_SINGLE_RESCALE - singularVectors[iCh][jCh] = BASOP_Util_Add_Mant32Exp( singularVectors[iCh][jCh], *singularVectors_e, Mpy_32_32( norm_x, secDiag[jCh] ), add( norm_x_e, secDiag_exp[jCh] ), &sing_exp2[iCh][jCh] ); /* exp(sing_exp2) */ -#else singularVectors[iCh][jCh] = BASOP_Util_Add_Mant32Exp( singularVectors[iCh][jCh], singularVectors2_e[iCh][jCh], Mpy_32_32( norm_x, secDiag[jCh] ), add( norm_x_e, secDiag_exp[jCh] ), &singularVectors2_e[iCh][jCh] ); /* exp(sing_exp2) */ -#endif move32(); } } @@ -1535,54 +1117,12 @@ static void biDiagonalReductionRight_fx( { singularVectors[currChannel][jCh] = Mpy_32_32( singularVectors[currChannel][jCh], ( *sig_x ) ); /* exp(sing_exp + sig_x_e) */ move32(); -#ifndef FIX_1010_OPT_SINGLE_RESCALE - sing_exp2[currChannel][jCh] = add( sing_exp[jCh], *sig_x_e ); -#else singularVectors2_e[currChannel][jCh] = add( singularVectors2_e[currChannel][jCh], *sig_x_e ); -#endif move16(); } -#ifndef FIX_1010_OPT_SEC_SINGLE_RESCALE - /*rescaling block*/ - Word16 exp_max = *secDiag_e; - move16(); - FOR( jCh = 0; jCh < nChannelsC; jCh++ ) - { - exp_max = s_max( exp_max, secDiag_exp[jCh] ); - } - FOR( jCh = 0; jCh < nChannelsC; jCh++ ) - { - secDiag[jCh] = L_shr_r( secDiag[jCh], sub( exp_max, secDiag_exp[jCh] ) ); /* exp(exp_max) */ - move32(); - } - *secDiag_e = exp_max; - move16(); -#endif - -#ifndef FIX_1010_OPT_SINGLE_RESCALE - exp_max = *singularVectors_e; - move16(); - FOR( iCh = 0; iCh < nChannelsL; iCh++ ) - { - FOR( jCh = 0; jCh < nChannelsC; jCh++ ) - { - exp_max = s_max( exp_max, sing_exp2[iCh][jCh] ); - } - } - FOR( iCh = 0; iCh < nChannelsL; iCh++ ) - { - FOR( jCh = 0; jCh < nChannelsC; jCh++ ) - { - singularVectors[iCh][jCh] = L_shr_r( singularVectors[iCh][jCh], sub( exp_max, sing_exp2[iCh][jCh] ) ); /* exp(exp_max) */ - move32(); - } - } - *singularVectors_e = exp_max; - move16(); -#endif } } @@ -1598,11 +1138,7 @@ static void biDiagonalReductionRight_fx( static void singularVectorsAccumulationLeft_fx( Word32 singularVectors_Left[][MAX_OUTPUT_CHANNELS], /* input exp(singularVectors_Left_e), output Q31 */ Word32 singularValues[MAX_OUTPUT_CHANNELS], /* exp(singularValues_e) */ -#ifndef FIX_1010_OPT_SINGLE_RESCALE - Word16 singularVectors_e, -#else Word16 singularVectors_Left_e[][MAX_OUTPUT_CHANNELS], -#endif Word16 singularValues_e[MAX_OUTPUT_CHANNELS], const Word16 nChannelsL, /* Q0 */ const Word16 nChannelsC /* Q0 */ @@ -1612,13 +1148,6 @@ static void singularVectorsAccumulationLeft_fx( Word16 nChannels; Word32 norm_y, t_jj, t_ii; Word16 norm_y_e, t_jj_e, t_ii_e, temp_exp; -#ifndef FIX_1010_OPT_SINGLE_RESCALE - Word16 sing_exp2[MAX_OUTPUT_CHANNELS][MAX_OUTPUT_CHANNELS] = { 0 }; - FOR( nCh = 0; nCh < MAX_OUTPUT_CHANNELS; nCh++ ) - { - set16_fx( sing_exp2[nCh], singularVectors_e, MAX_OUTPUT_CHANNELS ); - } -#endif /* Processing */ nChannels = s_min( nChannelsL, nChannelsC ); /* min(nChannelsL,ChannelsC) Q0*/ @@ -1638,13 +1167,8 @@ static void singularVectorsAccumulationLeft_fx( IF( t_ii ) /*if (fabsf(t_ii) > EPSILON *fabsf(t_ii)) {*/ { -#ifdef FIX_1010_OPT_DIV t_ii = BASOP_Util_Divide3232_Scale_cadence( MAXVAL_WORD32, maxWithSign_fx( t_ii ), &temp_exp ); t_ii_e = sub( temp_exp, t_ii_e ); -#else - t_ii = BASOP_Util_Divide3232_Scale_cadence( ONE_IN_Q30, maxWithSign_fx( t_ii ), &temp_exp ); /* exp(1 + (temp_exp + tii_e)) */ - t_ii_e = add( 1, sub( temp_exp, t_ii_e ) ); -#endif Word16 tempe; Word32 temp = BASOP_Util_Divide3232_Scale_cadence( t_ii, maxWithSign_fx( singularVectors_Left[nCh][nCh] ), &tempe ); tempe = add( tempe, sub( t_ii_e, singularVectors_Left_e[nCh][nCh] ) ); @@ -1659,13 +1183,9 @@ static void singularVectorsAccumulationLeft_fx( move16(); FOR( k = nCh + 1; k < nChannelsL; k++ ) /* nChannelsL */ { -#ifndef FIX_1010_OPT_SINGLE_RESCALE - norm_y = BASOP_Util_Add_Mant32Exp( norm_y, norm_y_e, Mpy_32_32( singularVectors_Left[k][nCh], singularVectors_Left[k][iCh] ), add( sing_exp2[k][nCh], sing_exp2[k][iCh] ), &norm_y_e ); /* exp(norm_y_e) */ -#else prod[k] = W_mult0_32_32( singularVectors_Left[k][nCh], singularVectors_Left[k][iCh] ); prod_e[k] = add( singularVectors_Left_e[k][nCh], singularVectors_Left_e[k][iCh] ); max_e = s_max( max_e, prod_e[k] ); -#endif } FOR( k = nCh + 1; k < nChannelsL; k++ ) /* nChannelsL */ @@ -1678,18 +1198,10 @@ static void singularVectorsAccumulationLeft_fx( norm_y = W_extract_h( acc ); norm_y_e = add( sub( max_e, acc_e ), 1 ); t_jj = Mpy_32_32( temp, norm_y ); -#ifndef FIX_1010_OPT_SINGLE_RESCALE - t_jj_e = add( temp_exp, sub( add( t_ii_e, norm_y_e ), sing_exp2[nCh][nCh] ) ); -#else t_jj_e = add( tempe, norm_y_e ); -#endif FOR( k = nCh; k < nChannelsL; k++ ) /* nChannelsL */ { -#ifndef FIX_1010_OPT_SINGLE_RESCALE - singularVectors_Left[k][iCh] = BASOP_Util_Add_Mant32Exp( singularVectors_Left[k][iCh], sing_exp2[k][iCh], Mpy_32_32( t_jj, singularVectors_Left[k][nCh] ), add( t_jj_e, sing_exp2[k][nCh] ), &sing_exp2[k][iCh] ); /* exp(sing_exp2) */ -#else singularVectors_Left[k][iCh] = BASOP_Util_Add_Mant32Exp( singularVectors_Left[k][iCh], singularVectors_Left_e[k][iCh], Mpy_32_32( t_jj, singularVectors_Left[k][nCh] ), add( t_jj_e, singularVectors_Left_e[k][nCh] ), &singularVectors_Left_e[k][iCh] ); /* exp(sing_exp2) */ -#endif move32(); } } @@ -1698,11 +1210,7 @@ static void singularVectorsAccumulationLeft_fx( { singularVectors_Left[iCh][nCh] = Mpy_32_32( singularVectors_Left[iCh][nCh], t_ii ); /* exp(sing_exp2 + t_ii_e) */ move32(); -#ifndef FIX_1010_OPT_SINGLE_RESCALE - sing_exp2[iCh][nCh] = add( sing_exp2[iCh][nCh], t_ii_e ); -#else singularVectors_Left_e[iCh][nCh] = add( singularVectors_Left_e[iCh][nCh], t_ii_e ); -#endif move16(); } } @@ -1714,11 +1222,7 @@ static void singularVectorsAccumulationLeft_fx( move32(); } } -#ifndef FIX_1010_OPT_SINGLE_RESCALE - singularVectors_Left[nCh][nCh] = BASOP_Util_Add_Mant32Exp( singularVectors_Left[nCh][nCh], sing_exp2[nCh][nCh], ONE_IN_Q30, 1, &sing_exp2[nCh][nCh] ); /* exp(sing_exp2) */ -#else singularVectors_Left[nCh][nCh] = BASOP_Util_Add_Mant32Exp( singularVectors_Left[nCh][nCh], singularVectors_Left_e[nCh][nCh], ONE_IN_Q30, 1, &singularVectors_Left_e[nCh][nCh] ); /* exp(sing_exp2) */ -#endif move32(); } // fclose(fp); @@ -1726,11 +1230,7 @@ static void singularVectorsAccumulationLeft_fx( { FOR( iCh = 0; iCh < nChannelsC; iCh++ ) { -#ifndef FIX_1010_OPT_SINGLE_RESCALE - singularVectors_Left[nCh][iCh] = L_shl_sat( singularVectors_Left[nCh][iCh], sing_exp2[nCh][iCh] ); /* Q31 */ -#else singularVectors_Left[nCh][iCh] = L_shl_sat( singularVectors_Left[nCh][iCh], singularVectors_Left_e[nCh][iCh] ); /* Q31 */ -#endif move32(); } } @@ -1748,16 +1248,8 @@ static void singularVectorsAccumulationRight_fx( Word32 singularVectors_Left[][MAX_OUTPUT_CHANNELS], /* exp(singularVectors_Left_e) */ Word32 singularVectors_Right[][MAX_OUTPUT_CHANNELS], /* input exp(singularVectors_Left_e), output Q31 */ Word32 secDiag[MAX_OUTPUT_CHANNELS], /* exp(secDiag_e) */ -#ifndef FIX_1010_OPT_SINGLE_RESCALE - Word16 singularVectors_e, -#else Word16 singularVectors_Left_e[][MAX_OUTPUT_CHANNELS], -#endif -#ifndef FIX_1010_OPT_SEC_SINGLE_RESCALE - Word16 secDiag_e, -#else Word16 *secDiag_e, -#endif const Word16 nChannelsC /* Q0 */ ) { @@ -1783,22 +1275,11 @@ static void singularVectorsAccumulationRight_fx( FOR( iCh = nCh + 1; iCh < nChannelsC; iCh++ ) /* nChannelsC*/ { -#ifdef FIX_1010_OPT_DIV ratio_float = L_deposit_h( BASOP_Util_Divide3232_Scale( singularVectors_Left[nCh][iCh], maxWithSign_fx( singularVectors_Left[nCh][nCh + 1] ), &temp_exp1 ) ); /* exp(temp_exp1) */ singularVectors_Right[iCh][nCh] = L_deposit_h( BASOP_Util_Divide3232_Scale( ratio_float, maxWithSign_fx( t_ii ), &sing_right_exp[iCh][nCh] ) ); /* exp(sing_right_exp + (temp_exp1 - secDiag_e) */ -#else - ratio_float = BASOP_Util_Divide3232_Scale_cadence( singularVectors_Left[nCh][iCh], maxWithSign_fx( singularVectors_Left[nCh][nCh + 1] ), &temp_exp1 ); /* exp(temp_exp1) */ - singularVectors_Right[iCh][nCh] = BASOP_Util_Divide3232_Scale_cadence( ratio_float, maxWithSign_fx( t_ii ), &sing_right_exp[iCh][nCh] ); /* exp(sing_right_exp + (temp_exp1 - secDiag_e) */ -#endif -#ifdef FIX_1010_OPT_SINGLE_RESCALE temp_exp1 = add( temp_exp1, sub( singularVectors_Left_e[nCh][iCh], singularVectors_Left_e[nCh][nCh + 1] ) ); -#endif move32(); -#ifndef FIX_1010_OPT_SEC_SINGLE_RESCALE - sing_right_exp[iCh][nCh] = add( sing_right_exp[iCh][nCh], sub( temp_exp1, secDiag_e ) ); -#else sing_right_exp[iCh][nCh] = add( sing_right_exp[iCh][nCh], sub( temp_exp1, secDiag_e[nCh + 1] ) ); -#endif move16(); // singularVectors_Right[iCh][nCh] = L_shl_sat( singularVectors_Right[iCh][nCh], temp_exp2 ); } @@ -1812,11 +1293,7 @@ static void singularVectorsAccumulationRight_fx( FOR( k = nCh + 1; k < nChannelsC; k++ ) /* nChannelsC */ { -#ifndef FIX_1010_OPT_SINGLE_RESCALE - norm_y = BASOP_Util_Add_Mant32Exp( norm_y, norm_y_e, Mpy_32_32( singularVectors_Left[nCh][k], singularVectors_Right[k][iCh] ), add( singularVectors_e, sing_right_exp[k][iCh] ), &norm_y_e ); /* exp(norm_y_e) */ -#else norm_y = BASOP_Util_Add_Mant32Exp( norm_y, norm_y_e, Mpy_32_32( singularVectors_Left[nCh][k], singularVectors_Right[k][iCh] ), add( singularVectors_Left_e[nCh][k], sing_right_exp[k][iCh] ), &norm_y_e ); /* exp(norm_y_e) */ -#endif } FOR( k = nCh + 1; k < nChannelsC; k++ ) /* nChannelsC */ @@ -1853,7 +1330,6 @@ static void singularVectorsAccumulationRight_fx( *-------------------------------------------------------------------------*/ -#ifdef FIX_1010_OPT_GIVENS_INV static void GivensRotation2_fx( const Word32 x, /* exp(x_e) */ const Word16 x_e, @@ -1875,7 +1351,6 @@ static void GivensRotation2_fx( *resultInv = ISqrt32( r, outInv_e ); move32(); } -#endif static Word32 GivensRotation_fx( const Word32 x, /* exp(x_e) */ @@ -1884,62 +1359,10 @@ static Word32 GivensRotation_fx( const Word16 z_e, Word16 *out_e ) { -#ifdef FIX_1010_OPT_GIVENS Word32 r; -#else - Word32 x_abs, z_abs; - Word32 cotan, tan, r; - Word16 temp_exp; - Word32 L_temp; -#endif -#ifdef FIX_1010_OPT_GIVENS r = BASOP_Util_Add_Mant32Exp( Mpy_32_32( z, z ), shl( z_e, 1 ), Mpy_32_32( x, x ), shl( x_e, 1 ), out_e ); r = Sqrt32( r, out_e ); -#else - x_abs = L_abs( x ); - z_abs = L_abs( z ); - test(); - IF( LE_32( x_abs, Mpy_32_32( CONVERGENCE_FACTOR_FX, x_abs ) ) && LE_32( z_abs, Mpy_32_32( CONVERGENCE_FACTOR_FX, z_abs ) ) ) - { - r = 0; - move32(); - } - ELSE IF( BASOP_Util_Cmp_Mant32Exp( x_abs, x_e, z_abs, z_e ) >= 0 ) - { - IF( LE_32( x_abs, SVD_MINIMUM_VALUE_FX ) ) - { - r = 0; - move32(); - } - ELSE - { - cotan = BASOP_Util_Divide3232_Scale_cadence( z_abs, x_abs, &temp_exp ); /* exp(temp_exp + (z_e - x_e) */ - temp_exp = add( temp_exp, sub( z_e, x_e ) ); - L_temp = BASOP_Util_Add_Mant32Exp( ONE_IN_Q30, 1, Mpy_32_32( cotan, cotan ), 2 * temp_exp, &temp_exp ); /* exp(temp_exp) */ - L_temp = Sqrt32( L_temp, &temp_exp ); - r = Mpy_32_32( x_abs, L_temp ); /* exp(x_e + temp_exp) */ - *out_e = add( x_e, temp_exp ); - } - } - ELSE - { - IF( LE_32( z_abs, SVD_MINIMUM_VALUE_FX ) ) - { - r = 0; - move32(); - } - ELSE - { - tan = BASOP_Util_Divide3232_Scale_cadence( x_abs, z_abs, &temp_exp ); /* exp(temp_exp + (x_e - z_e) */ - temp_exp = add( temp_exp, sub( x_e, z_e ) ); - L_temp = BASOP_Util_Add_Mant32Exp( ONE_IN_Q30, 1, Mpy_32_32( tan, tan ), shl( temp_exp, 1 ), &temp_exp ); /* exp(temp_exp) */ - L_temp = Sqrt32( L_temp, &temp_exp ); - r = Mpy_32_32( z_abs, L_temp ); /* exp(z_e + temp_exp) */ - *out_e = add( z_e, temp_exp ); - } - } -#endif return ( r ); } @@ -1953,20 +1376,6 @@ static Word32 maxWithSign_fx( const Word32 a /* Qx */ ) { -#ifndef FIX_MINOR_SVD_WMOPS_MR1010X - IF( GT_32( L_abs( a ), SVD_MINIMUM_VALUE_FX ) ) - { - return a; - } - ELSE IF( a < 0 ) - { - return -SVD_MINIMUM_VALUE_FX; - } - ELSE - { - return SVD_MINIMUM_VALUE_FX; - } -#else Word32 result; IF( a >= 0 ) { @@ -1977,7 +1386,6 @@ static Word32 maxWithSign_fx( result = L_min( a, -SVD_MINIMUM_VALUE_FX ); } return result; -#endif } /*------------------------------------------------------------------------- diff --git a/lib_dec/ivas_tcx_core_dec_fx.c b/lib_dec/ivas_tcx_core_dec_fx.c index c187c351c..aa5a379e8 100644 --- a/lib_dec/ivas_tcx_core_dec_fx.c +++ b/lib_dec/ivas_tcx_core_dec_fx.c @@ -644,21 +644,13 @@ void stereo_tcx_core_dec_fx( test(); test(); test(); -#ifdef NONBE_FIX_1402_WAVEADJUST IF( ( bfi || st->prev_bfi ) && st->hPlcInfo->Pitch_fx && EQ_16( st->hPlcInfo->concealment_method, TCX_NONTONAL ) ) -#else - IF( ( bfi || st->prev_bfi ) && st->hPlcInfo->Pitch && EQ_16( st->hPlcInfo->concealment_method, TCX_NONTONAL ) ) -#endif { lerp( synthFB_fx, synth_fx, st->L_frame, hTcxDec->L_frameTCX ); if ( !bfi && st->prev_bfi ) { -#ifdef NONBE_FIX_1402_WAVEADJUST st->hPlcInfo->Pitch_fx = 0; -#else - st->hPlcInfo->Pitch = 0; -#endif move16(); } } @@ -816,21 +808,11 @@ void stereo_tcx_core_dec_fx( move16(); /* Postfiltering */ -#ifndef MSAN_FIX - IF( st->p_bpf_noise_buf_32 ) - { - Copy_Scale_sig_32_16( st->p_bpf_noise_buf_32, st->p_bpf_noise_buf, st->L_frame, negate( Q11 ) ); - } -#endif post_decoder( st, synth_buf_fx, pit_gain_fx, pitch, signal_out_fx, st->p_bpf_noise_buf ); test(); -#ifdef MSAN_FIX IF( st->p_bpf_noise_buf_32 && st->tcxonly == 0 ) -#else - IF( st->p_bpf_noise_buf_32 ) -#endif // MSAN_FIX { Copy_Scale_sig_16_32_no_sat( st->p_bpf_noise_buf, st->p_bpf_noise_buf_32, st->L_frame, Q11 ); /* q_p_bpf + Q11 */ } diff --git a/lib_dec/ivas_td_low_rate_dec_fx.c b/lib_dec/ivas_td_low_rate_dec_fx.c index 98c1a6a79..3191a8b4a 100644 --- a/lib_dec/ivas_td_low_rate_dec_fx.c +++ b/lib_dec/ivas_td_low_rate_dec_fx.c @@ -137,7 +137,6 @@ void tdm_low_rate_dec_fx( edct_16fx( exc_wo_nf_fx, exc_wo_nf_fx, L_FRAME, find_guarded_bits_fx( L_FRAME ), IVAS_CPE_TD ); -#ifdef FIX_USAN_ISSUES IF( bwe_exc != NULL ) { Rescale_exc( st->hMusicPF->dct_post_old_exc_fx, &exc[0], &bwe_exc[0], st->hGSCDec->last_exc_dct_in_fx, @@ -148,10 +147,6 @@ void tdm_low_rate_dec_fx( Rescale_exc( st->hMusicPF->dct_post_old_exc_fx, &exc[0], NULL, st->hGSCDec->last_exc_dct_in_fx, L_FRAME, L_FRAME * HIBND_ACB_L_FAC, L_shl( st->lp_gainc_fx, 13 /* Q3 -> Q16*/ ), &( st->Q_exc ), st->Q_subfr, NULL, 0, st->coder_type ); } -#else - Rescale_exc( st->hMusicPF->dct_post_old_exc_fx, &exc[0], &bwe_exc[0], st->hGSCDec->last_exc_dct_in_fx, - L_FRAME, L_FRAME * HIBND_ACB_L_FAC, L_shl( st->lp_gainc_fx, 13 /* Q3 -> Q16*/ ), &( st->Q_exc ), st->Q_subfr, NULL, 0, st->coder_type ); -#endif /*----------------------------------------------------------------------* * Remove potential pre-echo in case an onset has been detected *----------------------------------------------------------------------*/ diff --git a/lib_dec/jbm_pcmdsp_apa.c b/lib_dec/jbm_pcmdsp_apa.c index fc793dff0..e2528e619 100644 --- a/lib_dec/jbm_pcmdsp_apa.c +++ b/lib_dec/jbm_pcmdsp_apa.c @@ -270,9 +270,7 @@ UWord8 apa_reconfigure( free( ps->buf_out_fx ); ps->buf_out_fx = (Word16 *) malloc( sizeof( Word16 ) * ps->buf_out_capacity ); -#ifdef MSAN_FIX memset( ps->buf_out_fx, 0, ( sizeof( Word16 ) * ps->buf_out_capacity ) ); -#endif ps->Q_buf_out = Q15; move16(); IF( !ps->buf_out_fx ) diff --git a/lib_dec/lead_deindexing_fx.c b/lib_dec/lead_deindexing_fx.c index 786e0c276..ecc5f6fe0 100644 --- a/lib_dec/lead_deindexing_fx.c +++ b/lib_dec/lead_deindexing_fx.c @@ -192,7 +192,6 @@ void re8_decode_base_index_fx( m1 = sub( k1, 1 ); m2 = 8; move16(); -#ifdef CR_2109_to_2112_cd0_ce0 l = 1; move16(); FOR( i = 0; i < 8; i++ ) @@ -206,9 +205,6 @@ void re8_decode_base_index_fx( test(); /* if the signs are constrained and all components are non-zero */ IF( EQ_16( k1, 7 ) && ( l > 0 ) ) -#else - IF( k1 == 7 ) -#endif { m2 = 7; move16(); diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 413585447..77deb9e7d 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -44,9 +44,6 @@ #include "jbm_pcmdsp_fifo.h" #include #include -#ifndef FIX_DISCLAIMER -#include -#endif #include "wmc_auto.h" #define INV_1000_Q31 2147484 /*1/1000 IN Q31*/ @@ -3061,85 +3058,6 @@ const char *IVAS_DEC_GetErrorMessage( return ivas_error_to_string( error ); } -#ifndef FIX_DISCLAIMER -/*---------------------------------------------------------------------* - * get_channel_config() - * - * Gets a str related to input config - *---------------------------------------------------------------------*/ - -static ivas_error get_channel_config( - AUDIO_CONFIG config, - Word8 *str ) -{ - IF( EQ_16( (Word16) config, IVAS_AUDIO_CONFIG_MONO ) ) - { - strcpy( (char *) str, "Mono" ); - } - ELSE IF( EQ_16( (Word16) config, IVAS_AUDIO_CONFIG_STEREO ) ) - { - strcpy( (char *) str, "Stereo" ); - } - ELSE IF( EQ_16( (Word16) config, IVAS_AUDIO_CONFIG_5_1 ) ) - { - strcpy( (char *) str, "Multichannel 5.1 (CICP6)" ); - } - ELSE IF( EQ_16( (Word16) config, IVAS_AUDIO_CONFIG_7_1 ) ) - { - strcpy( (char *) str, "Multichannel 7.1 (CICP12)" ); - } - ELSE IF( EQ_16( (Word16) config, IVAS_AUDIO_CONFIG_5_1_2 ) ) - { - strcpy( (char *) str, "Multichannel 5.1+2 (CICP14)" ); - } - ELSE IF( EQ_16( (Word16) config, IVAS_AUDIO_CONFIG_5_1_4 ) ) - { - strcpy( (char *) str, "Multichannel 5.1+4 (CICP16)" ); - } - ELSE IF( EQ_16( (Word16) config, IVAS_AUDIO_CONFIG_7_1_4 ) ) - { - strcpy( (char *) str, "Multichannel 7.1+4 (CICP19)" ); - } - ELSE IF( EQ_16( (Word16) config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) - { - strcpy( (char *) str, "Multichannel (custom loudspeaker layout)" ); - } - ELSE IF( EQ_16( (Word16) config, IVAS_AUDIO_CONFIG_FOA ) ) - { - strcpy( (char *) str, "Ambisonics: First Order (FOA)" ); - } - ELSE IF( EQ_16( (Word16) config, IVAS_AUDIO_CONFIG_HOA2 ) ) - { - strcpy( (char *) str, "Ambisonics: Second Order (HOA2)" ); - } - ELSE IF( EQ_16( (Word16) config, IVAS_AUDIO_CONFIG_HOA3 ) ) - { - strcpy( (char *) str, "Ambisonics: Third Order (HOA3)" ); - } - ELSE IF( EQ_16( (Word16) config, IVAS_AUDIO_CONFIG_BINAURAL ) ) - { - strcpy( (char *) str, "Binaural: no room" ); - } - ELSE IF( EQ_16( (Word16) config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) - { - strcpy( (char *) str, "Binaural: room with impulse responses" ); - } - ELSE IF( EQ_16( (Word16) config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) - { - strcpy( (char *) str, "Binaural: room with reverb" ); - } - ELSE IF( EQ_16( (Word16) config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - strcpy( (char *) str, "External renderer" ); - } - ELSE - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Error: Incorrect Input/Output Configuration" ); - } - - return IVAS_ERR_OK; -} -#endif /*---------------------------------------------------------------------* * printConfigInfo_dec( ) diff --git a/lib_dec/stat_dec.h b/lib_dec/stat_dec.h index 712ead8f4..fcd5142a4 100644 --- a/lib_dec/stat_dec.h +++ b/lib_dec/stat_dec.h @@ -161,13 +161,7 @@ typedef struct { Word16 L_frameTCX; -#ifndef NONBE_FIX_1402_WAVEADJUST - Word16 Pitch; -#endif Word16 Pitch_fx; -#ifndef NONBE_FIX_1402_WAVEADJUST - Word16 T_bfi; -#endif Word8 T_bfi_fx; Word16 Transient[MAX_POST_LEN]; @@ -187,9 +181,6 @@ typedef struct Word16 step_concealgain_fx; Word16 concealment_method; -#ifndef NONBE_FIX_1402_WAVEADJUST - Word16 subframe; -#endif Word16 subframe_fx; Word16 nbLostCmpt; Word16 seed; diff --git a/lib_dec/swb_tbe_dec_fx.c b/lib_dec/swb_tbe_dec_fx.c index 492c927b6..1b51a29fb 100644 --- a/lib_dec/swb_tbe_dec_fx.c +++ b/lib_dec/swb_tbe_dec_fx.c @@ -6070,12 +6070,6 @@ void ivas_swb_tbe_dec_fx( tmp = i_mult( j, ( LPC_SHB_ORDER + 1 ) ); /* convert LSPs to LP coefficients */ E_LPC_f_lsp_a_conversion( lsp_temp_fx, lpc_shb_sf_fx + tmp, LPC_SHB_ORDER ); -#ifndef FIX_1100_REMOVE_LPC_RESCALING - /* Bring the LPCs to Q12 */ - Copy_Scale_sig( lpc_shb_sf_fx + tmp, lpc_shb_sf_fx + tmp, LPC_SHB_ORDER + 1, sub( norm_s( lpc_shb_sf_fx[tmp] ), 2 ) ); - lpc_shb_sf_fx[i_mult( j, ( LPC_SHB_ORDER + 1 ) )] = ONE_IN_Q12; // recheck this - move16(); -#endif } } diff --git a/lib_dec/tonalMDCTconcealment_fx.c b/lib_dec/tonalMDCTconcealment_fx.c index 650e8572b..e74df3a96 100644 --- a/lib_dec/tonalMDCTconcealment_fx.c +++ b/lib_dec/tonalMDCTconcealment_fx.c @@ -146,28 +146,20 @@ ivas_error TonalMDCTConceal_Init_ivas_fx( hTonalMDCTConc->tcx_cfg = hTcxCfg; hTonalMDCTConc->lastBlockData.spectralData = hTonalMDCTConc->spectralDataBuffers[0]; -#ifdef MSAN_FIX set16_fx( hTonalMDCTConc->lastBlockData.spectralData, 0, L_FRAME_MAX ); -#endif move16(); hTonalMDCTConc->secondLastBlockData.spectralData = hTonalMDCTConc->spectralDataBuffers[1]; -#ifdef MSAN_FIX set16_fx( hTonalMDCTConc->secondLastBlockData.spectralData, 0, L_FRAME_MAX ); -#endif move16(); hTonalMDCTConc->secondLastPowerSpectrum = hTonalMDCTConc->secondLastBlockData.spectralData; move16(); hTonalMDCTConc->secondLastPowerSpectrum_exp = hTonalMDCTConc->secondLastBlockData.spectralData_exp; move16(); hTonalMDCTConc->lastBlockData.scaleFactors = hTonalMDCTConc->scaleFactorsBuffers[0]; -#ifdef MSAN_FIX set16_fx( hTonalMDCTConc->lastBlockData.scaleFactors, 0, FDNS_NPTS ); -#endif move16(); hTonalMDCTConc->secondLastBlockData.scaleFactors = hTonalMDCTConc->scaleFactorsBuffers[1]; -#ifdef MSAN_FIX set16_fx( hTonalMDCTConc->secondLastBlockData.scaleFactors, 0, FDNS_NPTS ); -#endif move16(); hTonalMDCTConc->lastBlockData.scaleFactors_exp = hTonalMDCTConc->scaleFactorsBuffers_exp[0]; move16(); @@ -234,9 +226,7 @@ ivas_error TonalMDCTConceal_Init_ivas_fx( move16(); /* just the second half of the second last pcm output is needed */ -#ifdef MSAN_FIX set16_fx( hTonalMDCTConc->timeDataBuffer, 0, ( 3 * L_FRAME_MAX ) / 2 ); -#endif hTonalMDCTConc->secondLastPcmOut = &hTonalMDCTConc->timeDataBuffer[( 3 * L_FRAME_MAX ) / 2 - ( 3 * min( L_FRAME_MAX, nSamples ) / 2 )]; hTonalMDCTConc->lastPcmOut = &hTonalMDCTConc->timeDataBuffer[( 3 * L_FRAME_MAX ) / 2 - min( L_FRAME_MAX, nSamples )]; /* If the second last frame was lost, we reuse saved TonalComponentsInfo and don't update pcm buffers */ @@ -1226,9 +1216,7 @@ void TonalMDCTConceal_Detect_ivas_fx( Word16 element_mode ) { Word32 secondLastMDST[L_FRAME_MAX]; -#ifdef MSAN_FIX set32_fx( secondLastMDST, 0, L_FRAME_MAX ); -#endif Word32 secondLastMDCT[L_FRAME_MAX]; Word16 secondLastMDCT_exp; Word32 *powerSpectrum = secondLastMDST; @@ -1236,9 +1224,7 @@ void TonalMDCTConceal_Detect_ivas_fx( Word16 nSamples; // Word16 nBands; Word32 sns_int_scf_fx[FDNS_NPTS]; -#ifdef MSAN_FIX set32_fx( sns_int_scf_fx, 0, FDNS_NPTS ); -#endif nSamples = hTonalMDCTConc->nSamples; move16(); @@ -1302,11 +1288,7 @@ void TonalMDCTConceal_Detect_ivas_fx( { /* If the second last frame was also lost, it is expected that pastTimeSignal could hold a bit different signal (e.g. including fade-out) from the one stored in TonalMDCTConceal_SaveTimeSignal. */ /* That is why we reuse the already stored information about the concealed spectrum in the second last frame */ -#ifdef MSAN_FIX Word16 temp_power_spectrum_q = 0; -#else - Word16 power_spectrum_q; -#endif nSamples = hTonalMDCTConc->nNonZeroSamples; move16(); Copy_Scale_sig_16_32_DEPREC( hTonalMDCTConc->secondLastPowerSpectrum, powerSpectrum, nSamples, Q15 ); @@ -3511,9 +3493,7 @@ void TonalMdctConceal_whiten_noise_shape_ivas_fx( psychParams = st->hTonalMDCTConc->psychParams; hFdCngCom = st->hFdCngDec->hFdCngCom; -#ifdef MSAN_FIX set32_fx( whitenend_noise_shape, 0, L_FRAME16k ); -#endif IF( EQ_32( whitening_mode, ON_FIRST_LOST_FRAME ) ) { diff --git a/lib_dec/transition_dec_fx.c b/lib_dec/transition_dec_fx.c index b82378198..b9ad17fcf 100644 --- a/lib_dec/transition_dec_fx.c +++ b/lib_dec/transition_dec_fx.c @@ -56,9 +56,7 @@ void transition_dec_fx( Word16 i, offset, temp, tmp; Word16 limit_flag; Word16 i_subfridx; -#ifdef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING (void) ( Opt_AMR_WB ); -#endif i_subfridx = i_subfr / L_SUBFR; /*i_subfr / L_SUBFR*/ /* Set limit_flag to 0 for restrained limits, and 1 for extended limits */ @@ -830,9 +828,7 @@ Word16 tc_classif_fx( /*o: Q0*/ ) { Word16 tc_subfr, indice; -#ifdef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING (void) ( L_frame ); -#endif IF( EQ_16( st_fx->L_frame, L_FRAME ) ) { IF( get_next_indice_fx( st_fx, 1 ) ) diff --git a/lib_dec/waveadjust_fec_dec_fx.c b/lib_dec/waveadjust_fec_dec_fx.c index f993caa8d..75a514cc2 100644 --- a/lib_dec/waveadjust_fec_dec_fx.c +++ b/lib_dec/waveadjust_fec_dec_fx.c @@ -848,16 +848,8 @@ void concealment_init_ivas_fx( hPlcInfo->L_frameTCX = L_frameTCX; move16(); -#ifndef NONBE_FIX_1402_WAVEADJUST - hPlcInfo->Pitch = 0; - move16(); -#endif hPlcInfo->Pitch_fx = 0; move16(); -#ifndef NONBE_FIX_1402_WAVEADJUST - hPlcInfo->T_bfi = 0; - move16(); -#endif hPlcInfo->T_bfi_fx = 0; move16(); hPlcInfo->outx_new_n1_fx = 0; @@ -876,10 +868,6 @@ void concealment_init_ivas_fx( move16(); hPlcInfo->concealment_method = TCX_NONTONAL; move16(); -#ifndef NONBE_FIX_1402_WAVEADJUST - hPlcInfo->subframe = 0; - move16(); -#endif hPlcInfo->subframe_fx = 0; move16(); hPlcInfo->nbLostCmpt = (Word16) L_deposit_l( 0 ); @@ -1326,11 +1314,7 @@ static Word16 waveform_adj_fix( test(); test(); test(); -#ifdef NONBE_FIX_1402_WAVEADJUST IF( hPlcInfo->T_bfi_fx && ( LE_16( pitch, Framesizediv2 ) ) && ( GT_16( Framesize, 256 ) ) && ( EQ_16( core, 1 ) ) ) -#else - IF( hPlcInfo->T_bfi && ( LE_16( pitch, Framesizediv2 ) ) && ( GT_16( Framesize, 256 ) ) && ( EQ_16( core, 1 ) ) ) -#endif { Word16 i1 = 0, i2 = 0; Word16 pos1, pos2, pos3; diff --git a/lib_enc/acelp_core_enc_fx.c b/lib_enc/acelp_core_enc_fx.c index d2d5ac4e6..a93690738 100644 --- a/lib_enc/acelp_core_enc_fx.c +++ b/lib_enc/acelp_core_enc_fx.c @@ -395,11 +395,7 @@ ivas_error acelp_core_enc_fx( IF( !nelp_mode && !ppp_mode ) { config_acelp1( ENC, st_fx->total_brate, st_fx->core_brate, st_fx->core, st_fx->extl, st_fx->extl_brate, -#ifdef NONBE_FIX_GSC_BSTR st_fx->L_frame, st_fx->GSC_noisy_speech, &( st_fx->acelp_cfg ), hBstr->nb_bits_tot, st_fx->coder_type, st_fx->inactive_coder_type_flag, -#else - st_fx->L_frame, st_fx->GSC_noisy_speech, &( st_fx->acelp_cfg ), hBstr->nb_bits_tot, st_fx->coder_type, -#endif tc_subfr_fx, 0, &nb_bits, unbits_fx, st_fx->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st_fx->idchan, st_fx->active_fr_cnt_fx, tdm_Pitch_reuse_flag, st_fx->tdm_LRTD_flag, st_fx->GSC_IVAS_mode ); } @@ -465,11 +461,7 @@ ivas_error acelp_core_enc_fx( tc_classif_enc_fx( Q_new, st_fx->L_frame, &tc_subfr_fx, &position, attack_flag, st_fx->pitch[0], res_fx ); config_acelp1( ENC, st_fx->total_brate, st_fx->core_brate, st_fx->core, st_fx->extl, st_fx->extl_brate, st_fx->L_frame, -#ifdef NONBE_FIX_GSC_BSTR -1, &( st_fx->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, tc_subfr_fx, 1, NULL, unbits_fx, st_fx->element_mode, &uc_two_stage_flag, -#else - -1, &( st_fx->acelp_cfg ), hBstr->nb_bits_tot, st_fx->coder_type, tc_subfr_fx, 1, NULL, unbits_fx, st_fx->element_mode, &uc_two_stage_flag, -#endif tdm_lp_reuse_flag, tdm_low_rate_mode, st_fx->idchan, st_fx->active_fr_cnt_fx, tdm_Pitch_reuse_flag, st_fx->tdm_LRTD_flag, st_fx->GSC_IVAS_mode ); } @@ -522,11 +514,7 @@ ivas_error acelp_core_enc_fx( /* Configure ACELP bit allocation */ config_acelp1( ENC, st_fx->total_brate, st_fx->core_brate, st_fx->core, st_fx->extl, st_fx->extl_brate, st_fx->L_frame, -#ifdef NONBE_FIX_GSC_BSTR -1, &( st_fx->acelp_cfg ), hBstr->nb_bits_tot, st_fx->coder_type, st_fx->inactive_coder_type_flag, tc_subfr_fx, 0, &nb_bits, unbits_fx, 0, &uc_two_stage_flag, 0, 0, -#else - -1, &( st_fx->acelp_cfg ), hBstr->nb_bits_tot, st_fx->coder_type, tc_subfr_fx, 0, &nb_bits, unbits_fx, 0, &uc_two_stage_flag, 0, 0, -#endif st_fx->idchan, st_fx->active_fr_cnt_fx, tdm_Pitch_reuse_flag, st_fx->tdm_LRTD_flag, st_fx->GSC_IVAS_mode ); /* redo LSF quantization */ @@ -772,21 +760,17 @@ ivas_error acelp_core_enc_ivas_fx( Word32 Bin_E_fx[L_FFT], Bin_E_old_fx[L_FFT / 2]; Word16 clip_var_fx, mem_w0_bck_fx, streaklimit_fx; -#ifdef MSAN_FIX set16_fx( old_bwe_exc_fx, 0, ( PIT16k_MAX + ( L_FRAME16k + 1 ) + L_SUBFR16k ) * 2 ); set16_fx( old_exc_fx, 0, L_EXC ); set16_fx( Aq, 0, NB_SUBFR16k * ( M + 1 ) ); set16_fx( syn_fx, 0, L_FRAME16k ); -#endif Word16 tilt_code_bck_fx; Word32 gc_threshold_bck_fx; Word16 clip_var_bck_fx[6]; Word32 q_env_fx[NUM_ENV_CNG]; -#ifdef MSAN_FIX set32_fx( q_env_fx, 0, NUM_ENV_CNG ); set16_fx( exc2_fx, 0, L_FRAME16k ); -#endif Word16 exc3_fx[L_FRAME16k]; Word16 syn1_fx[L_FRAME16k]; Word16 *tdm_Pri_pitch_buf_fx; @@ -1189,11 +1173,7 @@ ivas_error acelp_core_enc_ivas_fx( test(); IF( !nelp_mode && !ppp_mode ) { -#ifdef NONBE_FIX_GSC_BSTR config_acelp1_IVAS( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 0, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1_IVAS( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, tc_subfr, 0, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif } /*-----------------------------------------------------------------* @@ -1330,11 +1310,7 @@ ivas_error acelp_core_enc_ivas_fx( { tc_classif_enc_fx( Q_new, st->L_frame, &tc_subfr, &position, attack_flag, st->pitch[0], res_fx ); -#ifdef NONBE_FIX_GSC_BSTR config_acelp1_IVAS( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, tc_subfr, 1, NULL, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1_IVAS( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, tc_subfr, 1, NULL, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif } /*---------------------------------------------------------------* @@ -1393,11 +1369,7 @@ ivas_error acelp_core_enc_ivas_fx( lsf_syn_mem_restore_ivas_fx( st, tilt_code_bck_fx, gc_threshold_bck_fx, clip_var_bck_fx, next_force_sf_bck, lsp_new, lsp_mid, clip_var_fx, mem_AR_fx, mem_MA_fx, lsp_new_bck_fx, lsp_mid_bck_fx, Bin_E_fx, Bin_E_old_fx, mem_syn_bck_fx, mem_w0_bck_fx, streaklimit_fx, pstreaklen ); /* Configure ACELP bit allocation */ -#ifdef NONBE_FIX_GSC_BSTR config_acelp1_IVAS( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 0, &nb_bits, unbits, 0, &uc_two_stage_flag, 0, 0, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1_IVAS( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, tc_subfr, 0, &nb_bits, unbits, 0, &uc_two_stage_flag, 0, 0, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif /* redo LSF quantization */ lsf_enc_ivas_fx( st, lsf_new_fx, lsp_new, lsp_mid, Aq, tdm_low_rate_mode, 0, NULL, Q_new ); @@ -1459,11 +1431,7 @@ ivas_error acelp_core_enc_ivas_fx( IF( st->element_mode > EVS_MONO && st->hTcxEnc != NULL ) { Copy( syn1_fx + shr( st->L_frame, 1 ), st->hTcxEnc->Txnq, shr( st->L_frame, 1 ) ); // st->Q_syn -#ifdef MSAN_FIX Scale_sig( st->hTcxEnc->Txnq + shr( st->L_frame, 1 ), sub( L_FRAME32k / 2 + 64, shr( st->L_frame, 1 ) ), sub( st->Q_syn, st->hTcxEnc->q_Txnq ) ); // st->Q_syn -#else - Scale_sig( st->hTcxEnc->Txnq + shr( st->L_frame, 1 ), sub( L_FRAME32k / 2 + 64, shr( st->L_frame, 2 ) ), sub( st->Q_syn, st->hTcxEnc->q_Txnq ) ); -#endif st->hTcxEnc->q_Txnq = st->Q_syn; move16(); } @@ -1488,11 +1456,7 @@ ivas_error acelp_core_enc_ivas_fx( *-----------------------------------------------------------------*/ Scale_sig( syn_fx, L_FRAME, sub( s_min( st->Q_syn, Q_new ), st->Q_syn ) ); // min( st->Q_syn, Q_new ) -#ifdef MSAN_FIX Scale_sig( res_fx, st->L_frame, sub( s_min( st->Q_syn, Q_new ), Q_new ) ); // min( st->Q_syn, Q_new ) -#else - Scale_sig( res_fx, L_FRAME16k, sub( s_min( st->Q_syn, Q_new ), Q_new ) ); -#endif FEC_encode_ivas_fx( hBstr, st->acelp_cfg, syn_fx, st->coder_type, st->clas, pitch_buf, res_fx, &st->Last_pulse_pos, st->L_frame, st->total_brate, s_min( st->Q_syn, Q_new ) ); IF( st->hBWE_TD != NULL ) { @@ -1557,11 +1521,7 @@ ivas_error acelp_core_enc_ivas_fx( IF( !st->Opt_SC_VBR && ( st->idchan == 0 || NE_16( st->element_mode, IVAS_CPE_TD ) || ( EQ_16( st->idchan, 1 ) && EQ_16( st->element_mode, IVAS_CPE_TD ) && st->tdm_LRTD_flag ) ) ) { /* Apply a non linearity to the SHB excitation */ -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( st->hBWE_TD->old_bwe_exc_extended_fx, bwe_exc_extended_fx, NL_BUFF_OFFSET, ( sub( shl( Q_new, 1 ), sub( st->prev_Q_bwe_exc, 16 ) ) ) ); // prev_Q_bwe_exc -#else - Copy_Scale_sig_16_32_DEPREC( st->hBWE_TD->old_bwe_exc_extended_fx, bwe_exc_extended_fx, NL_BUFF_OFFSET, ( sub( shl( Q_new, 1 ), sub( st->prev_Q_bwe_exc, 16 ) ) ) ); // prev_Q_bwe_exc -#endif non_linearity_ivas_fx( bwe_exc_fx, bwe_exc_extended_fx + NL_BUFF_OFFSET, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale_fx, Q_new, st->coder_type, voice_factors_fx, st->L_frame ); Copy_Scale_sig_32_16( bwe_exc_extended_fx + L_FRAME32k, st->hBWE_TD->old_bwe_exc_extended_fx, NL_BUFF_OFFSET, negate( sub( shl( Q_new, 1 ), sub( st->prev_Q_bwe_exc, 16 ) ) ) ); // prev_Q_bwe_exc } diff --git a/lib_enc/acelp_core_switch_enc_fx.c b/lib_enc/acelp_core_switch_enc_fx.c index d88e1523e..f9058b9b9 100644 --- a/lib_enc/acelp_core_switch_enc_fx.c +++ b/lib_enc/acelp_core_switch_enc_fx.c @@ -149,11 +149,7 @@ void acelp_core_switch_enc_fx( *----------------------------------------------------------------*/ config_acelp1( ENC, st_fx->total_brate, cbrate, st_fx->core, -1, -1, st_fx->last_L_frame, -1, &( st_fx->acelp_cfg ), hBstr->nb_bits_tot, -#ifdef NONBE_FIX_GSC_BSTR GENERIC, st_fx->inactive_coder_type_flag, -1, -1, &j, &i, st_fx->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st_fx->idchan, st_fx->active_fr_cnt_fx, 0 /*tdm_Pitch_reuse_flag*/, 0, 0 /*GSC_IVAS_mode*/ ); -#else - GENERIC, -1, -1, &j, &i, st_fx->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st_fx->idchan, st_fx->active_fr_cnt_fx, 0 /*tdm_Pitch_reuse_flag*/, 0, 0 /*GSC_IVAS_mode*/ ); -#endif encod_gen_voic_core_switch_fx( st_fx, st_fx->last_L_frame, inp, Aq, A, T_op, exc, cbrate, shift, Q_new ); @@ -264,11 +260,7 @@ void acelp_core_switch_enc_ivas_fx( *----------------------------------------------------------------*/ config_acelp1_IVAS( ENC, st_fx->total_brate, cbrate, st_fx->core, -1, -1, st_fx->last_L_frame, -1, &( st_fx->acelp_cfg ), hBstr->nb_bits_tot, -#ifdef NONBE_FIX_GSC_BSTR GENERIC, st_fx->inactive_coder_type_flag, -1, -1, &j, &i, st_fx->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st_fx->idchan, st_fx->active_fr_cnt_fx, 0 /*tdm_Pitch_reuse_flag*/, 0, 0 /*GSC_IVAS_mode*/ ); -#else - GENERIC, -1, -1, &j, &i, st_fx->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st_fx->idchan, st_fx->active_fr_cnt_fx, 0 /*tdm_Pitch_reuse_flag*/, 0, 0 /*GSC_IVAS_mode*/ ); -#endif encod_gen_voic_core_switch_ivas_fx( st_fx, st_fx->last_L_frame, inp, Aq, A, T_op, exc, cbrate, shift, Q_new ); diff --git a/lib_enc/bass_psfilter_enc_fx.c b/lib_enc/bass_psfilter_enc_fx.c index a1d672fe0..a241101ba 100644 --- a/lib_enc/bass_psfilter_enc_fx.c +++ b/lib_enc/bass_psfilter_enc_fx.c @@ -269,11 +269,7 @@ Word16 bass_pf_enc_fx( st = sub( s2, s2_old ); FOR( i = 0; i < tmp16; i++ ) { -#ifdef FIX_ISSUE_1187 noise_buf[i] = shl_sat( mem_bpf->noise_buf[i], st ); -#else - noise_buf[i] = shl( mem_bpf->noise_buf[i], st ); -#endif move16(); } Copy( noise_buf + l_subfr, mem_bpf->noise_buf, tmp16 ); diff --git a/lib_enc/cng_enc_fx.c b/lib_enc/cng_enc_fx.c index 6c99a4306..e2b29ba59 100644 --- a/lib_enc/cng_enc_fx.c +++ b/lib_enc/cng_enc_fx.c @@ -2011,14 +2011,12 @@ void CNG_enc_ivas_fx( /* convert log2 of residual signal energy */ /*enr = (float)log10( enr + 0.1f ) / (float)log10( 2.0f ); */ -#ifdef FIX_ISSUE_1245 IF( L_ener == 0 ) { enr = -850; /*log(0.1) base 2 in Q8*/ move16(); } ELSE -#endif { hi = norm_l( L_ener ); lo = Log2_norm_lc( L_shl( L_ener, hi ) ); diff --git a/lib_enc/cod_ace_fx.c b/lib_enc/cod_ace_fx.c index e701b8e46..d3725dcba 100644 --- a/lib_enc/cod_ace_fx.c +++ b/lib_enc/cod_ace_fx.c @@ -37,14 +37,8 @@ Word16 coder_acelp_fx( /* o : SEGSNR for CL decision * Word16 *bwe_exc /* o : excitation for SWB TBE Qx */ ) { -#ifndef SIMPLIFY_CODE_BE - Word16 i, j, i_subfr, j_subfr; - Word16 tmp, tmp2, Es_pred; - Word32 gain_code_vect[2]; -#else Word16 i, i_subfr, j_subfr; Word16 tmp, Es_pred; -#endif Word16 T0, T0_min, T0_min_frac, T0_max, T0_max_frac, T0_res; Word16 T0_frac; Word16 gain_pit, voice_fac; @@ -103,11 +97,7 @@ Word16 coder_acelp_fx( /* o : SEGSNR for CL decision * /* Configure ACELP */ -#ifndef MSAN_FIX - hLPDmem->nbits = BITS_ALLOC_config_acelp( target_bits, st->coder_type, acelp_cfg, st->narrowBand, st->nb_subfr ); -#else BITS_ALLOC_config_acelp( target_bits, st->coder_type, acelp_cfg, st->narrowBand, st->nb_subfr ); -#endif /* Init Framing parameters */ move16(); @@ -324,12 +314,6 @@ Word16 coder_acelp_fx( /* o : SEGSNR for CL decision * gp_clip_test_gain_pit_fx( st->element_mode, st->core_brate, gain_pit, st->clip_var_fx ); -#ifndef SIMPLIFY_CODE_BE - gain_code_vect[0] = gain_code; - move32(); - gain_code_vect[1] = gain_code; - move32(); -#endif /*----------------------------------------------------------* * - voice factor (for pitch enhancement) * *----------------------------------------------------------*/ @@ -361,32 +345,6 @@ Word16 coder_acelp_fx( /* o : SEGSNR for CL decision * /*-------------------------------------------------------* * - Find the total excitation. * *-------------------------------------------------------*/ -#ifndef SIMPLIFY_CODE_BE - tmp2 = shr( L_SUBFR, 1 ); - FOR( j = 0; j < 2; j++ ) - { - 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] ); - Ltmp = L_shl( Ltmp, Q_new_p5 ); - Ltmp = L_mac( Ltmp, gain_pit, exc[i + i_subfr] ); - BASOP_SATURATE_WARNING_OFF_EVS - exc2[i] = round_fx( L_shl( Ltmp, 1 ) ); - BASOP_SATURATE_WARNING_ON_EVS - - Ltmp2 = Mpy_32_16_1( gain_code_vect[j], code[i] ); - 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[i + i_subfr] = round_fx( Ltmp ); - } - tmp2 = L_SUBFR; - move16(); - } -#else FOR( i = 0; i < L_SUBFR; i++ ) { /* code in Q9, gain_pit in Q14; exc Q_new */ @@ -402,7 +360,6 @@ Word16 coder_acelp_fx( /* o : SEGSNR for CL decision * exc[i + i_subfr] = round_fx_o( Ltmp, &Overflow ); move16(); } -#endif /*-----------------------------------------------------------------* * Prepare TBE excitation *-----------------------------------------------------------------*/ diff --git a/lib_enc/cod_tcx_fx.c b/lib_enc/cod_tcx_fx.c index e6fc25e36..54f57b287 100644 --- a/lib_enc/cod_tcx_fx.c +++ b/lib_enc/cod_tcx_fx.c @@ -14,11 +14,9 @@ #include "stl.h" // #include "basop_mpy.h" #include "prot_fx_enc.h" -#ifdef IVAS_FLOAT_FIXED_CONVERSIONS #include #include "ivas_prot_fx.h" #include "ivas_rom_com_fx.h" -#endif #ifdef DEBUGGING #include "debug.h" #endif @@ -1717,9 +1715,7 @@ void EstimateStereoTCXNoiseLevel_fx( Word16 *fac_ns_q; Word32 total_brate; -#ifdef MSAN_FIX set32_fx( combined_q_spectrum, 0, N_MAX ); -#endif FOR( ch = 0; ch < CPE_CHANNELS; ch++ ) { @@ -4365,9 +4361,6 @@ void coder_tcx_fx( Word16 winMDST[N_MAX + L_MDCT_OVLP_MAX]; Word16 *pWinMDST; Word16 left_overlap_mode, right_overlap_mode; -#ifndef MSAN_FIX - LPD_state_HANDLE hLPDmem = st->hLPDmem; -#endif TCX_ENC_HANDLE hTcxEnc = st->hTcxEnc; left_overlap = right_overlap = -1; @@ -4533,10 +4526,6 @@ void coder_tcx_fx( st, hm_cfg ); -#ifndef MSAN_FIX - hLPDmem->nbits = add( hLPDmem->nbits, add( tnsBits, ltpBits ) ); - move16(); -#endif } diff --git a/lib_enc/cod_uv_fx.c b/lib_enc/cod_uv_fx.c index 8eccddc0b..8b1e8a144 100644 --- a/lib_enc/cod_uv_fx.c +++ b/lib_enc/cod_uv_fx.c @@ -135,7 +135,6 @@ void gauss_L2_ivas_fx( *gain = L_deposit_l( 0 ); move32(); /*Update correlations for gains coding */ -#ifdef FIX_ISSUE_1167 tmp32 = L_shr( 21474836l /*0.01f Q31*/, 31 - 16 ); /* Q16 */ tmp32_2 = L_shr( 21474836l /*0.01f Q31*/, 31 - 16 ); /* Q16 */ FOR( i = 0; i < L_SUBFR; i++ ) @@ -144,34 +143,17 @@ void gauss_L2_ivas_fx( tmp32 = L_mac0( tmp32, tmp16, tmp16 ); /* Q16 */ tmp32_2 = L_mac0( tmp32_2, tmp16, shr( y2[i], 1 ) ); /* Q16 */ } -#else - tmp32 = L_shr( 21474836l /*0.01f Q31*/, 31 - 18 ); /* Q18 */ - tmp32_2 = L_shr( 21474836l /*0.01f Q31*/, 31 - 18 ); /* Q18 */ - FOR( i = 0; i < L_SUBFR; i++ ) - { - tmp32 = L_mac0( tmp32, y11[i], y11[i] ); /* Q18 */ - tmp32_2 = L_mac0( tmp32_2, y11[i], y2[i] ); /* Q18 */ - } -#endif tmp16 = norm_l( tmp32 ); // To be checked g_corr->y1y1 = round_fx_sat( L_shl( tmp32, tmp16 ) ); -#ifdef FIX_ISSUE_1167 g_corr->y1y1_e = sub( 31 - 16, tmp16 ); -#else - g_corr->y1y1_e = sub( 31 - 18, tmp16 ); -#endif move16(); move16(); tmp16 = norm_l( tmp32_2 ); g_corr->y1y2 = round_fx_sat( L_shl( tmp32_2, tmp16 ) ); -#ifdef FIX_ISSUE_1167 g_corr->y1y2_e = sub( 31 - 16, tmp16 ); -#else - g_corr->y1y2_e = sub( 31 - 18, tmp16 ); -#endif move16(); move16(); } diff --git a/lib_enc/core_enc_init_fx.c b/lib_enc/core_enc_init_fx.c index bfe17fcd2..405b3ac2b 100644 --- a/lib_enc/core_enc_init_fx.c +++ b/lib_enc/core_enc_init_fx.c @@ -299,11 +299,9 @@ static void init_tcx_fx( Word16 i; Word16 fscaleFB; TCX_ENC_HANDLE hTcxEnc = st->hTcxEnc; -#ifdef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING (void) MCT_flag; (void) total_brate; (void) last_total_brate; -#endif // PMT("init_tcx_fx needs an entire review to adapt to IVAS") fscaleFB = div_l( L_shl( st->input_Fs, LD_FSCALE_DENOM + 1 ), 12800 ); @@ -945,9 +943,7 @@ static void init_modes_fx( void init_coder_ace_plus_ivas_fx( Encoder_State *st, /* i : Encoder state */ const Word32 last_total_brate, /* i : last total bitrate */ -#ifdef FIX_920_IGF_INIT_ERROR const Word32 igf_brate, /* i : IGF configuration bitrate */ -#endif const Word16 MCT_flag /* i : hMCT handle allocated (1) or not (0) */ ) { @@ -1080,11 +1076,7 @@ void init_coder_ace_plus_ivas_fx( test(); IF( st->igf && st->hIGFEnc != NULL ) { -#ifdef FIX_920_IGF_INIT_ERROR IGFEncSetMode_ivas_fx( st->hIGFEnc, igf_brate, st->bwidth, st->element_mode, st->rf_mode ); -#else - IGFEncSetMode_ivas_fx( st->hIGFEnc, st->total_brate, st->bwidth, st->element_mode, st->rf_mode ); -#endif } ELSE IF( st->hIGFEnc != NULL ) { diff --git a/lib_enc/core_enc_ol_fx.c b/lib_enc/core_enc_ol_fx.c index 04857c334..18f48e904 100644 --- a/lib_enc/core_enc_ol_fx.c +++ b/lib_enc/core_enc_ol_fx.c @@ -80,10 +80,8 @@ void core_encode_openloop_fx( Word16 w_rf[M + 1], lsf_uq_rf[M + 1]; Word16 lsf_q_1st_rf[M + 1], lsf_q_d_rf[M + 1], lsf_q_rf[M + 1]; Word16 lsp_old_q_rf[M + 1], lsf_old_q_rf[M + 1]; -#ifdef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING (void) vad_hover_flag; (void) vad_flag_dtx; -#endif #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); diff --git a/lib_enc/core_enc_reconf_fx.c b/lib_enc/core_enc_reconf_fx.c index 1ba496b0e..9e7380aaa 100644 --- a/lib_enc/core_enc_reconf_fx.c +++ b/lib_enc/core_enc_reconf_fx.c @@ -24,9 +24,7 @@ void core_coder_reconfig_fx( { Word16 i, bwidth, index; TCX_ENC_HANDLE hTcxEnc = st->hTcxEnc; -#ifdef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING (void) last_total_brate; -#endif /*Configuration of ACELP*/ BITS_ALLOC_init_config_acelp( st->total_brate, st->narrowBand, st->nb_subfr, &( st->acelp_cfg ) ); diff --git a/lib_enc/core_enc_switch_fx.c b/lib_enc/core_enc_switch_fx.c index f3b4aea6b..2f21f1015 100644 --- a/lib_enc/core_enc_switch_fx.c +++ b/lib_enc/core_enc_switch_fx.c @@ -408,11 +408,7 @@ void core_coder_mode_switch_ivas_fx( Scale_sig( st->old_inp_12k8_fx, L_INP_MEM, shift ); st->exp_old_inp_12k8 = sub( st->exp_old_inp_12k8, shift ); move16(); -#ifdef FIX_920_IGF_INIT_ERROR init_coder_ace_plus_ivas_fx( st, last_total_brate, st->total_brate, MCT_flag ); -#else - init_coder_ace_plus_ivas_fx( st, last_total_brate, MCT_flag ); -#endif if ( st->hLPDmem != NULL ) { st->hLPDmem->q_lpd_old_exc = st->prev_Q_new; diff --git a/lib_enc/core_switching_enc_fx.c b/lib_enc/core_switching_enc_fx.c index dc3062298..5290509cd 100644 --- a/lib_enc/core_switching_enc_fx.c +++ b/lib_enc/core_switching_enc_fx.c @@ -997,10 +997,8 @@ void core_switching_pre_enc_ivas_fx( tmp = sub( L_LOOK_16k + L_SUBFR16k, Sample_Delay_HP ); Copy( &hBWE_TD->old_speech_shb_fx[tmp], hBWE_FD->new_input_hp_fx, Sample_Delay_HP ); -#ifdef FIX_ISSUE_1230 hBWE_FD->Q_new_input_hp = 0; move16(); -#endif IF( NE_16( st_fx->last_extl, WB_BWE ) ) { diff --git a/lib_enc/decision_matrix_enc_fx.c b/lib_enc/decision_matrix_enc_fx.c index 3624cf374..c95bc9d5b 100644 --- a/lib_enc/decision_matrix_enc_fx.c +++ b/lib_enc/decision_matrix_enc_fx.c @@ -386,7 +386,6 @@ void decision_matrix_enc_fx( move16(); } -#ifdef NONBE_FIX_GSC_BSTR /*-----------------------------------------------------------------* * set inactive coder_type flag in ACELP core *-----------------------------------------------------------------*/ @@ -400,7 +399,6 @@ void decision_matrix_enc_fx( move16(); } -#endif return; } diff --git a/lib_enc/dtx_fx.c b/lib_enc/dtx_fx.c index 154b43c12..44be8dcc6 100644 --- a/lib_enc/dtx_fx.c +++ b/lib_enc/dtx_fx.c @@ -29,9 +29,6 @@ #define CNG_TYPE_HO 20 /* hangover for switching between CNG types */ -#ifndef NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD -#define DTX_THR 5 /* LP_NOISE level */ -#endif #define MAX_BRATE_DTX_EVS ACELP_24k40 /* maximum bitrate to which the default DTX is applied in EVS; otherwise DTX is applied only in silence */ #define MAX_BRATE_DTX_IVAS IVAS_80k /* maximum bitrate to which the default DTX is applied in IVAS; otherwise DTX is applied only in silence */ @@ -64,9 +61,7 @@ static void update_SID_cnt_fx( DTX_ENC_HANDLE hDtxEnc, const Word32 core_brate, /*==================================================================================*/ void dtx_ivas_fx( Encoder_State *st_fx, /* i/o: encoder state structure */ -#ifdef NONBE_1211_DTX_BR_SWITCHING const Word32 last_ivas_total_brate, /* i : last IVAS total bitrate Q0*/ -#endif const Word32 ivas_total_brate, /* i : IVAS total bitrate Q0*/ const Word16 vad, /* i : vad flag for DTX Q0*/ const Word16 speech[], /* i : Pointer to the speech frame Q_speech*/ @@ -83,21 +78,15 @@ void dtx_ivas_fx( Flag Overflow = 0; move32(); #endif -#ifdef NONBE_1211_DTX_BR_SWITCHING Word32 total_brate_ref; total_brate_ref = st_fx->total_brate; move32(); -#endif IF( st_fx->dtx_sce_sba != 0 ) { last_br_cng_flag = 1; last_br_flag = 1; -#ifndef NONBE_1211_DTX_BR_SWITCHING - br_dtx_flag = 1; - move16(); -#endif move16(); move16(); } @@ -112,15 +101,9 @@ void dtx_ivas_fx( test(); test(); -#ifdef NONBE_1211_DTX_BR_SWITCHING last_br_flag = ( st_fx->element_mode == EVS_MONO && LE_32( st_fx->last_total_brate, MAX_BRATE_DTX_EVS ) ) || ( st_fx->element_mode != EVS_MONO && LE_32( last_ivas_total_brate, MAX_BRATE_DTX_IVAS ) ) || LT_16( st_fx->lp_noise_fx, DTX_THR * 256 ); -#else - last_br_flag = LE_32( st_fx->last_total_brate, MAX_BRATE_DTX_EVS ) || LT_16( st_fx->lp_noise_fx, DTX_THR * 256 ) || ( EQ_16( st_fx->element_mode, IVAS_SCE ) && LE_32( st_fx->last_total_brate, MAX_BRATE_DTX_IVAS ) ); - br_dtx_flag = 0; - move16(); -#endif } /* Initialization */ @@ -217,10 +200,8 @@ void dtx_ivas_fx( * Select SID or FRAME_NO_DATA frame if DTX is enabled *------------------------------------------------------------------------*/ -#ifdef NONBE_1211_DTX_BR_SWITCHING br_dtx_flag = 1; move16(); -#endif IF( st_fx->dtx_sce_sba == 0 ) { @@ -230,11 +211,7 @@ void dtx_ivas_fx( test(); br_dtx_flag = ( ( st_fx->element_mode == EVS_MONO ) && LE_32( st_fx->total_brate, MAX_BRATE_DTX_EVS ) ) || ( ( st_fx->element_mode != EVS_MONO ) && LE_32( ivas_total_brate, MAX_BRATE_DTX_IVAS ) ) || -#ifdef NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD LT_16( st_fx->lp_noise_fx, DTX_THR * 256 ); -#else - LT_16( st_fx->lp_noise_fx, 3840 /*15 in Q8*/ ); -#endif } test(); test(); @@ -352,13 +329,11 @@ void dtx_ivas_fx( reset_indices_enc_fx( st_fx->hBstr, st_fx->hBstr->nb_ind_tot ); } } -#ifdef NONBE_1211_DTX_BR_SWITCHING ELSE IF( st_fx->element_mode != EVS_MONO ) { st_fx->total_brate = total_brate_ref; move32(); } -#endif /*------------------------------------------------------------------------* * Reset counters when in active frame (not in SID or FRAME_NO_DATA frame) diff --git a/lib_enc/enc_acelp_fx.c b/lib_enc/enc_acelp_fx.c index a509a7cd7..4317bdbb3 100644 --- a/lib_enc/enc_acelp_fx.c +++ b/lib_enc/enc_acelp_fx.c @@ -1387,7 +1387,6 @@ void E_ACELP_4tsearch_fx( Word16 dn[] /*Qdn*/, const Word16 cn[] /*Q_xn*/, const return; } -#ifdef FIX_ISSUE_1165 void E_ACELP_4tsearch_ivas_fx( Word16 dn[] /*Qdn*/, const Word16 cn[] /*Q_xn*/, const Word16 H[] /*Q12*/, Word16 code[] /*Q9*/, const PulseConfig *config, Word16 ind[] /*Q0*/, Word16 y[] /*Qy*/ ) { Word16 sign[L_SUBFR], vec[L_SUBFR]; @@ -1712,7 +1711,6 @@ void E_ACELP_4tsearch_ivas_fx( Word16 dn[] /*Qdn*/, const Word16 cn[] /*Q_xn*/, } return; } -#endif /* * E_ACELP_4t_fx @@ -1869,11 +1867,7 @@ void E_ACELP_4t_ivas_fx( } ELSE { -#ifdef FIX_ISSUE_1165 E_ACELP_4tsearch_ivas_fx( dn, cn, H, code, &config, ind, y ); -#else - E_ACELP_4tsearch_fx( dn, cn, H, code, &config, ind, y ); -#endif } E_ACELP_indexing_fx( code, &config, NB_TRACK_FCB_4T, _index ); return; diff --git a/lib_enc/enc_acelpx_fx.c b/lib_enc/enc_acelpx_fx.c index f18da2ef2..9612696ed 100644 --- a/lib_enc/enc_acelpx_fx.c +++ b/lib_enc/enc_acelpx_fx.c @@ -781,11 +781,7 @@ void E_ACELP_4tsearchx_ivas_fx( alp = shr( alp, 1 ); Scale_sig( cor, L_SUBFR, -1 ); /*Q8*/ Scale_sig( R_buf, 2 * L_SUBFR - 1, -1 ); /*Q8+scale*/ -#ifndef MSAN_FIX - Scale_sig( dn, 2 * L_SUBFR, -1 ); -#else Scale_sig( dn, L_SUBFR, -1 ); /*Qdn-1*/ -#endif } diff --git a/lib_enc/enc_gen_voic_fx.c b/lib_enc/enc_gen_voic_fx.c index 06c49a8d3..62f740fb2 100644 --- a/lib_enc/enc_gen_voic_fx.c +++ b/lib_enc/enc_gen_voic_fx.c @@ -656,11 +656,7 @@ void encod_gen_voic_ivas_fx( *-----------------------------------------------------------------*/ test(); -#ifdef NONBE_FIX_GSC_BSTR IF( !st_fx->inactive_coder_type_flag && EQ_16( st_fx->coder_type, INACTIVE ) ) -#else - IF( GE_32( st_fx->total_brate, MAX_GSC_INACTIVE_BRATE ) && EQ_16( st_fx->coder_type, INACTIVE ) ) -#endif { transf_cdbk_enc_ivas_fx( st_fx, 0, i_subfr_fx, cn_fx, exc_fx, p_Aq_fx, p_Aw_fx, h1_fx, xn_fx, xn2_fx, y1_fx, y2_fx, Es_pred_fx, &gain_pit_fx, gain_code_fx, g_corr_fx, clip_gain_fx, &gain_preQ_fx, code_preQ_fx, unbits_fx, Q_new, shift ); diff --git a/lib_enc/enc_pit_exc_fx.c b/lib_enc/enc_pit_exc_fx.c index 7e5734e70..7af329a1c 100644 --- a/lib_enc/enc_pit_exc_fx.c +++ b/lib_enc/enc_pit_exc_fx.c @@ -578,9 +578,6 @@ void enc_pit_exc_ivas_fx( Word16 use_fcb; Word32 gc_mem[NB_SUBFR - 1]; /* gain_code from previous subframes */ Word16 gp_mem[NB_SUBFR - 1]; /* gain_pitch from previous subframes*/ -#ifndef FIX_ISSUE_1376 - Word16 h1_q15[PIT_EXC_L_SUBFR + ( M + 1 )]; -#endif Word16 q_h1; BSTR_ENC_HANDLE hBstr = st_fx->hBstr; GSC_ENC_HANDLE hGSCEnc = st_fx->hGSCEnc; @@ -602,9 +599,7 @@ void enc_pit_exc_ivas_fx( move16(); Pitch_CT = GENERIC; move16(); -#ifdef MSAN_FIX set16_fx( cn1, 0, PIT_EXC_L_SUBFR ); -#endif test(); test(); IF( st_fx->GSC_IVAS_mode > 0 && ( st_fx->GSC_noisy_speech || GT_32( st_fx->core_brate, GSC_H_RATE_STG ) ) ) @@ -773,15 +768,8 @@ void enc_pit_exc_ivas_fx( * Codebook target computation * (No LP filtering of the adaptive excitation) *-----------------------------------------------------------------*/ -#ifndef FIX_ISSUE_1376 - Copy_Scale_sig( h1, h1_q15, L_subfr, 1 ); // Q14 -> Q15 - - lp_select = lp_filt_exc_enc_ivas_fx( MODE1, AUDIO, i_subfr, exc, h1_q15, - xn, y1, xn2, L_subfr, st_fx->L_frame, g_corr, clip_gain, &gain_pit, &lp_flag ); /* Q0 */ -#else lp_select = lp_filt_exc_enc_ivas_fx( MODE1, AUDIO, i_subfr, exc, h1, xn, y1, xn2, L_subfr, st_fx->L_frame, g_corr, clip_gain, &gain_pit, &lp_flag ); /* Q0 */ -#endif IF( EQ_16( lp_flag, NORMAL_OPERATION ) ) { push_indice( hBstr, IND_LP_FILT_SELECT, lp_select, 1 ); diff --git a/lib_enc/enc_tran_fx.c b/lib_enc/enc_tran_fx.c index 5b9f67503..4cda393d5 100644 --- a/lib_enc/enc_tran_fx.c +++ b/lib_enc/enc_tran_fx.c @@ -478,9 +478,7 @@ Word16 encod_tran_ivas_fx( L_frame_fx = st_fx->L_frame; move16(); -#ifdef MSAN_FIX set16_fx( h1, 0, L_SUBFR + ( M + 1 ) ); -#endif /*------------------------------------------------------------------* * Initializations diff --git a/lib_enc/enc_uv_fx.c b/lib_enc/enc_uv_fx.c index b0c67abf5..8a77b9e2b 100644 --- a/lib_enc/enc_uv_fx.c +++ b/lib_enc/enc_uv_fx.c @@ -453,14 +453,10 @@ void encod_unvoiced_ivas_fx( voice_factors_fx[i_subfr / L_SUBFR] = 0; move16(); -#ifdef FIX_ISSUE_1148 if ( st_fx->hBWE_TD != NULL ) { interp_code_5over2_fx( &exc_fx[i_subfr], &bwe_exc_fx[i_subfr * HIBND_ACB_L_FAC], L_SUBFR ); } -#else - interp_code_5over2_fx( &exc_fx[i_subfr], &bwe_exc_fx[i_subfr * HIBND_ACB_L_FAC], L_SUBFR ); -#endif /*-----------------------------------------------------------------* * Synthesize speech to update mem_syn[]. diff --git a/lib_enc/energy_fx.c b/lib_enc/energy_fx.c index 7dc96a4e3..0168e52b1 100644 --- a/lib_enc/energy_fx.c +++ b/lib_enc/energy_fx.c @@ -451,11 +451,7 @@ void background_update_fx( tmp = L_shr( 2147 /* 0.000001 Q31 */, sub( 31, scale_sb_energy ) ); /* scale_sb_energy */ FOR( i = 0; i < SNR_sb_num; i++ ) { -#ifdef FIX_ISSUE_1209 sb_bg_energy[i] = L_add_sat( MUL_F( sb_bg_energy[i], 32112 /* 0.98 Q15 */ ), tmp ); /* scale_sb_energy */ -#else - sb_bg_energy[i] = L_add( MUL_F( sb_bg_energy[i], 32112 /* 0.98 Q15 */ ), tmp ); /* scale_sb_energy */ -#endif move32(); } } diff --git a/lib_enc/ext_sig_ana_fx.c b/lib_enc/ext_sig_ana_fx.c index f546c3ef8..087d892e3 100644 --- a/lib_enc/ext_sig_ana_fx.c +++ b/lib_enc/ext_sig_ana_fx.c @@ -967,10 +967,8 @@ void core_signal_analysis_high_bitrate_ivas_fx( Q_win_temp[frameno] = *q_win; move16(); -#ifdef MSAN_FIX Scale_sig32( windowed_samples + frameno * L_FRAME_MAX + 2, win_len[frameno], *q_win ); // q_win -#endif IF( EQ_16( frameno, 1 ) ) { Scale_sig32( windowed_samples + 2, win_len[0], sub( *q_win, Q_win_temp[0] ) ); // q_win @@ -1384,27 +1382,11 @@ void core_signal_analysis_high_bitrate_ivas_fx( IF( st->igf ) { Word16 q_spectrum = sub( Q31, hTcxEnc->spectrum_e[frameno] ); -#ifndef MSAN_FIX - ProcessIGF_ivas_fx( st, hTcxEnc->spectrum_fx[frameno], hTcxEnc->spectrum_fx[frameno], &q_spectrum, powerSpec, powerSpec_e, transform_type[frameno] == TCX_20, frameno, 0, vad_hover_flag ); -#else ProcessIGF_ivas_fx( st, N_MAX + L_MDCT_OVLP_MAX, hTcxEnc->spectrum_fx[frameno], hTcxEnc->spectrum_fx[frameno], &q_spectrum, powerSpec, powerSpec_e, transform_type[frameno] == TCX_20, frameno, 0, vad_hover_flag ); -#endif } } } -#ifndef MSAN_FIX - IF( windowed_samples != NULL ) - { - FOR( frameno = 0; frameno < nSubframes; frameno++ ) - { - IF( !( ( EQ_16( transform_type[frameno], TCX_20 ) ) && ( NE_16( st->hTcxCfg->tcx_last_overlap_mode, TRANSITION_OVERLAP ) ) ) ) - { - Scale_sig32( windowed_samples + frameno * L_FRAME_MAX + 2, win_len, *q_win ); - } - } - } -#endif IF( NE_16( st->element_mode, IVAS_CPE_MDCT ) ) { diff --git a/lib_enc/find_tilt_fx.c b/lib_enc/find_tilt_fx.c index ea71b09bc..ed8ff425e 100644 --- a/lib_enc/find_tilt_fx.c +++ b/lib_enc/find_tilt_fx.c @@ -93,11 +93,7 @@ void find_tilt_fx( } tmp = BASOP_Util_Divide3232_Scale( lp_bckr, hp_bckr, &e_tmp ); -#ifdef FIX_ISSUE_1152 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 *bckr_tilt_lt = L_add( Mpy_32_16_r( *bckr_tilt_lt, 29491 ), Mpy_32_16_r( Ltmp, 3277 ) ); /* Q16 */ diff --git a/lib_enc/gaus_enc_fx.c b/lib_enc/gaus_enc_fx.c index f943b104d..edddc6a88 100644 --- a/lib_enc/gaus_enc_fx.c +++ b/lib_enc/gaus_enc_fx.c @@ -979,13 +979,8 @@ void gauss2v_ivas_fx( /* eneri = round_fx(ener[i]) + round_fx(ener[j]) + 2*round_fx(dotprod) */ /* Use ScalingShift to stay aligned with ener[] */ eneri = L_shl( dotprod, 1 ); /* One left shift added for factor of 2 */ -#ifndef FIX_1298 - eneri = L_add( ener[i], eneri ); - eneri = L_add( ener[j], eneri ); /* Q31 */ -#else eneri = L_add_sat( ener[i], eneri ); eneri = L_add_sat( ener[j], eneri ); /* Q31 */ -#endif lo1 = L_Extract_lc( cor32, &hi1 ); cor2 = Sad_32( 0, hi1, lo1 ); /* Square + Add */ diff --git a/lib_enc/hq_classifier_enc_fx.c b/lib_enc/hq_classifier_enc_fx.c index 944cb2649..2b53082f7 100644 --- a/lib_enc/hq_classifier_enc_fx.c +++ b/lib_enc/hq_classifier_enc_fx.c @@ -83,7 +83,6 @@ static Word16 hf_spectrum_sparseness_fx( crest_mod_fx = 0; move32(); maximum_l( A_fx, L_SPEC_HB, &Amax_fx ); -#ifdef NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO IF( Amax_fx == 0 ) { /* For all-zero input the crest is 1.0 */ @@ -94,7 +93,6 @@ static Word16 hf_spectrum_sparseness_fx( } ELSE { -#endif thr_fx = Mpy_32_32( Amax_fx, PEAK_THRESHOLD_FX ); /* Q12 */ movmean_fx = 0; /* avoid uninitialized warning */ move32(); @@ -160,9 +158,7 @@ static Word16 hf_spectrum_sparseness_fx( move32(); st->hHQ_core->crest_mod_lp_q = sub( Q12, inv_rms32_e ); move16(); -#ifdef NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO } -#endif *crest_lp_fx = L_add( Mpy_32_32( HQ_CREST_FAC_SM_FX, ( *crest_lp_fx ) ), Mpy_32_32( ONE_IN_Q31 - HQ_CREST_FAC_SM_FX, crest_fx ) ); /* Q(st->hHQ_core->crest_lp_q) */ move32(); *crest_mod_lp_fx = L_add( Mpy_32_32( HQ_CREST_FAC_SM_FX, ( *crest_mod_lp_fx ) ), Mpy_32_32( L_sub( ONE_IN_Q31, HQ_CREST_FAC_SM_FX ), crest_mod_fx ) ); /* Q(st->hHQ_core->crest_mod_lp_q) */ diff --git a/lib_enc/hq_core_enc_fx.c b/lib_enc/hq_core_enc_fx.c index f22218d13..6bc466e3d 100644 --- a/lib_enc/hq_core_enc_fx.c +++ b/lib_enc/hq_core_enc_fx.c @@ -374,7 +374,6 @@ void HQ_core_enc_init_fx( hHQ_core->last_max_pos_pulse = 0; move16(); -#ifdef MSAN_FIX hHQ_core->crest_lp_fx = HQ_CREST_THRESHOLD_FX; /* Q28 */ move32(); hHQ_core->crest_lp_q = Q28; @@ -383,7 +382,6 @@ void HQ_core_enc_init_fx( move32(); hHQ_core->crest_mod_lp_q = Q29; move16(); -#endif return; } @@ -482,11 +480,7 @@ void hq_core_enc_ivas_fx( Q_audio = sub( Q16, q ); TCX_MDCT( wtda_audio_fx16, t_audio_fx, &Q_audio, left_overlap, sub( L_spec, shr( add( left_overlap, right_overlap ), 1 ) ), right_overlap, st->element_mode ); Q_audio = sub( Q31, Q_audio ); -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( wtda_audio_fx16, wtda_audio_fx32, 2 * L_FRAME48k, sub( Q_audio, q ) ); /* Q_audio */ -#else - Copy_Scale_sig_16_32_DEPREC( wtda_audio_fx16, wtda_audio_fx32, 2 * L_FRAME48k, sub( Q_audio, q ) ); /* Q_audio */ -#endif inner_frame = inner_frame_tbl[st->bwidth]; /* Q0 */ L_spec = l_spec_ext_tbl[st->bwidth]; /* Q0 */ is_transient = 0; diff --git a/lib_enc/igf_enc.c b/lib_enc/igf_enc.c index fc7c32fdb..d5f071784 100644 --- a/lib_enc/igf_enc.c +++ b/lib_enc/igf_enc.c @@ -716,13 +716,8 @@ static void IGF_CalculateEnvelope_ivas_fx( Word32 mean_y_fx_tmp = 0; move32(); mean_xy_fx = mean_x2_fx = 0; -#ifdef FIX_ISSUE_1214 mean_x_e = 15; mean_xy_e = mean_y_e = mean_x2_e = 31; -#else - mean_x_e = mean_y_e = 15; - mean_xy_e = mean_x2_e = 31; -#endif move16(); move16(); move16(); @@ -738,21 +733,12 @@ static void IGF_CalculateEnvelope_ivas_fx( mean_x_fx = add( mean_x_fx, x ); /*Q0*/ mean_x2_fx = L_add( mean_x2_fx, L_mult0( x, x ) ); /*Q0*/ -#ifdef FIX_ISSUE_1214 /*y = 20.f * log10f( max( 1.f, powerSpectrum[i] ) );*/ IF( LE_64( W_deposit32_l( pPowerSpectrum_fx[sb] ), W_shl( 1, ( sub( 31, e_ps[sb] ) ) ) ) ) { y = 0; move16(); } -#else - - /*y = 20 * (int16_t) log10f( max( 1e-018f, pPowerSpectrum[sb] ) );*/ - IF( LT_32( pPowerSpectrum_fx[sb], 1 ) ) - { - y = imult1616( 20, ( -18 /* log10f(1e-018f) */ ) ); - } -#endif ELSE { y = imult1616( 20, extract_l( L_shr( Mult_32_16( ( L_add( BASOP_Util_Log2( pPowerSpectrum_fx[sb] ), L_shl( e_ps[sb], Q25 ) ) ), INV_Log2_10_Q15 ), Q25 ) ) ); /*Q0*/ @@ -1258,21 +1244,12 @@ static void IGF_CalculateStereoEnvelope_fx( move16(); } } -#ifdef FIX_ISSUE_1214 tmp_tb_fx = shr_sat( tmp_tb_fx, sub( 2, tmp_tb_e ) ); /* Since we're limiting max value to 2.7f we can saturate to Q13 */ tmp_sb_fx = shr_sat( tmp_sb_fx, sub( 2, tmp_sb_e ) ); /* Since we're limiting max value to 2.7f we can saturate to Q13 */ hPrivateData->SFM_tb_fx[sfb] = add_sat( tmp_tb_fx, add_sat( shr( hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb], sub( 2, hPrivateData->prevSFB_FIR_TB_e[sfb] ) ), shr( hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb], sub( 3, hPrivateData->prevSFB_IIR_TB_e[sfb] ) ) ) ); /* Since we're limiting max value to 2.7f we can saturate to Q13 */ hPrivateData->SFM_tb_fx[sfb] = s_min( 22118 /*2.7f Q13*/, hPrivateData->SFM_tb_fx[sfb] ); /* resultant exponent stored in hPrivateData->sfb_sb_e[sfb]*/ hPrivateData->SFM_sb_fx[sfb] = add_sat( tmp_sb_fx, add_sat( shr( hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb], sub( 2, hPrivateData->prevSFB_FIR_SB_e[sfb] ) ), shr( hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb], sub( 3, hPrivateData->prevSFB_IIR_SB_e[sfb] ) ) ) ); /* Since we're limiting max value to 2.7f we can saturate to Q13 */ hPrivateData->SFM_sb_fx[sfb] = s_min( 22118 /*2.7f Q13*/, hPrivateData->SFM_sb_fx[sfb] ); /*resultant exponent stores in hPrivateData->sfb_tb_e[sfb]*/ -#else - tmp_tb_fx = shl_sat( tmp_tb_fx, sub( 2, tmp_tb_e ) ); /* Since we're limiting max value to 2.7f we can saturate to Q13 */ - tmp_sb_fx = shl_sat( tmp_sb_fx, sub( 2, tmp_sb_e ) ); /* Since we're limiting max value to 2.7f we can saturate to Q13 */ - hPrivateData->SFM_tb_fx[sfb] = add_sat( tmp_tb_fx, add_sat( shr( hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb], sub( 2, tmp_tb_e ) ), shr( hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb], sub( 3, tmp_tb_e ) ) ) ); /* Since we're limiting max value to 2.7f we can saturate to Q13 */ - hPrivateData->SFM_tb_fx[sfb] = s_min( 22118 /*2.7f Q13*/, hPrivateData->SFM_tb_fx[sfb] ); /* resultant exponent stored in hPrivateData->sfb_sb_e[sfb]*/ - hPrivateData->SFM_sb_fx[sfb] = add_sat( tmp_sb_fx, add_sat( shr( hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb], sub( 2, tmp_sb_e ) ), shr( hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb], sub( 3, tmp_sb_e ) ) ) ); /* Since we're limiting max value to 2.7f we can saturate to Q13 */ - hPrivateData->SFM_sb_fx[sfb] = s_min( 22118 /*2.7f Q13*/, hPrivateData->SFM_sb_fx[sfb] ); /*resultant exponent stores in hPrivateData->sfb_tb_e[sfb]*/ -#endif move16(); move16(); move16(); @@ -2541,9 +2518,7 @@ void IGFEncResetTCX10BitCounter_ivas_fx( void IGFEncApplyMono_ivas_fx( Encoder_State *st, /* i : Encoder state */ -#ifdef MSAN_FIX Word16 powerSpectrum_len, /* i: length of pPowerSpectrum_fx buffer */ -#endif const Word16 igfGridIdx, /* i : IGF grid index */ Word32 *pMDCTSpectrum_fx, /* i/o: MDCT spectrum */ Word16 e_mdct, /* i : exponent of pMDCTspectrum */ @@ -2563,9 +2538,7 @@ void IGFEncApplyMono_ivas_fx( Word32 common_pPowerSpectrum_fx[N_MAX + L_MDCT_OVLP_MAX]; -#ifdef MSAN_FIX set32_fx( common_pPowerSpectrum_fx, 0, N_MAX + L_MDCT_OVLP_MAX ); -#endif Word16 common_pPowerSpectrum_exp = MIN16B; move16(); @@ -2624,20 +2597,12 @@ void IGFEncApplyMono_ivas_fx( IF( pPowerSpectrumParameter_fx ) { -#ifndef MSAN_FIX - FOR( Word16 i = 0; i < N_MAX + L_MDCT_OVLP_MAX; i++ ) -#else FOR( Word16 i = 0; i < powerSpectrum_len; i++ ) -#endif { common_pPowerSpectrum_exp = s_max( common_pPowerSpectrum_exp, pPowerSpectrumParameter_exp[i] ); } -#ifndef MSAN_FIX - FOR( Word16 i = 0; i < N_MAX + L_MDCT_OVLP_MAX; i++ ) -#else FOR( Word16 i = 0; i < powerSpectrum_len; i++ ) -#endif { common_pPowerSpectrum_fx[i] = L_shl( pPowerSpectrumParameter_fx[i], sub( pPowerSpectrumParameter_exp[i], common_pPowerSpectrum_exp ) ); move16(); diff --git a/lib_enc/init_enc_fx.c b/lib_enc/init_enc_fx.c index ebfd9c4a2..1d695659c 100644 --- a/lib_enc/init_enc_fx.c +++ b/lib_enc/init_enc_fx.c @@ -1398,11 +1398,7 @@ ivas_error init_encoder_ivas_fx( st->exp_buf_wspeech_enc = 0; move16(); /* initializations */ -#ifndef MSAN_FIX - set32_fx( st->Bin_E_old_fx, 0, shr( L_FFT, 2 ) ); -#else set32_fx( st->Bin_E_old_fx, 0, L_FFT / 2 ); -#endif st->q_Bin_E_old = Q31; move16(); set16_fx( st->mem_decim_fx, 0, shl( L_FILT_MAX, 1 ) ); @@ -1821,10 +1817,8 @@ ivas_error init_encoder_ivas_fx( } fd_bwe_enc_init_fx( st->hBWE_FD ); -#ifdef MSAN_FIX st->Q_old_wtda = 0; move16(); -#endif } ELSE { @@ -2069,7 +2063,6 @@ ivas_error init_encoder_ivas_fx( set16_fx( st->totalNoise_increase_hist_fx, 0, TOTALNOISE_HIST_SIZE ); st->totalNoise_increase_len = 0; move16(); -#ifdef IVAS_FLOAT_FIXED_CONVERSIONS TCX_ENC_HANDLE hTcxEnc = st->hTcxEnc; IF( hTcxEnc != NULL ) { @@ -2080,10 +2073,8 @@ ivas_error init_encoder_ivas_fx( move32(); st->currEnergyHF_e_fx = 0; move16(); -#ifdef MSAN_FIX st->prevEnergyHF_fx = 0; move32(); -#endif /* Initialize TCX */ @@ -2097,12 +2088,7 @@ ivas_error init_encoder_ivas_fx( st->exp_old_inp_12k8 = sub( st->exp_old_inp_12k8, shift ); move16(); /* Initialize ACELP */ -#endif -#ifdef FIX_920_IGF_INIT_ERROR init_coder_ace_plus_ivas_fx( st, st->last_total_brate, igf_brate, 0 ); -#else - init_coder_ace_plus_ivas_fx( st, st->last_total_brate, 0 ); -#endif IF( st->hLPDmem != NULL ) { diff --git a/lib_enc/inov_enc_fx.c b/lib_enc/inov_enc_fx.c index 46bec5f4d..e47b14559 100644 --- a/lib_enc/inov_enc_fx.c +++ b/lib_enc/inov_enc_fx.c @@ -89,9 +89,7 @@ Word16 inov_encode_fx( Word16 Rw[L_SUBFR]; Word16 acelpautoc; BSTR_ENC_HANDLE hBstr = st_fx->hBstr; -#ifdef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING (void) last_L_frame; -#endif stack_pulses = 0; move16(); diff --git a/lib_enc/ivas_core_enc_fx.c b/lib_enc/ivas_core_enc_fx.c index cacbcabd3..1e7a13d45 100644 --- a/lib_enc/ivas_core_enc_fx.c +++ b/lib_enc/ivas_core_enc_fx.c @@ -118,14 +118,12 @@ ivas_error ivas_core_enc_fx( set32_fx( new_swb_speech_buffer_fx, 0, L_FRAME48k + STEREO_DFT_OVL_MAX ); set16_fx( new_swb_speech_buffer_fx_16, 0, L_FRAME48k + STEREO_DFT_OVL_MAX ); -#ifdef MSAN_FIX FOR( i = 0; i < CPE_CHANNELS; i++ ) { set_zero_fx( bwe_exc_extended_fx[i], L_FRAME32k + NL_BUFF_OFFSET ); set16_fx( old_syn_12k8_16k_fx[i], 0, L_FRAME16k ); } set16_fx( shb_speech_fx, 0, L_FRAME16k ); -#endif push_wmops( "ivas_core_enc" ); @@ -215,7 +213,6 @@ ivas_error ivas_core_enc_fx( /*---------------------------------------------------------------------* * Pre-processing, incl. Decision matrix *---------------------------------------------------------------------*/ -#ifdef MSAN_FIX IF( st->cldfbAnaEnc ) { Word16 tmp_shift = L_norm_arr( enerBuffer_fx[n], st->cldfbAnaEnc->no_channels ); @@ -227,16 +224,6 @@ ivas_error ivas_core_enc_fx( move16(); } } -#else - Word16 tmp_shift = getScaleFactor32( enerBuffer_fx[n], CLDFB_NO_CHANNELS_MAX ); - tmp_shift = sub( tmp_shift, 5 ); - IF( tmp_shift < 0 ) - { - scale_sig32( enerBuffer_fx[n], CLDFB_NO_CHANNELS_MAX, tmp_shift ); - enerBuffer_fx_exp[n] = sub( enerBuffer_fx_exp[n], tmp_shift ); - move16(); - } -#endif Scale_sig( fft_buff_fx[n], ( 2 * L_FFT ), -1 ); // To create 1 headroom for addition of magnitude square spectrum // fft_buff_fx_exp = add(fft_buff_fx_exp,1); diff --git a/lib_enc/ivas_core_pre_proc_front_fx.c b/lib_enc/ivas_core_pre_proc_front_fx.c index 45098926e..bf7c36eef 100644 --- a/lib_enc/ivas_core_pre_proc_front_fx.c +++ b/lib_enc/ivas_core_pre_proc_front_fx.c @@ -131,9 +131,7 @@ ivas_error pre_proc_front_ivas_fx( const Word16 front_vad_dtx_flag, /* i : front-VAD DTX flag to overwrite VAD decision Q0*/ const IVAS_FORMAT ivas_format, /* i : IVAS format */ const Word16 MCT_flag, /* i : hMCT handle allocated (1) or not (0) Q0*/ -#ifdef NONBE_1211_DTX_BR_SWITCHING const Word32 last_ivas_total_brate, /* i : last IVAS total bitrate Q0*/ -#endif const Word32 ivas_total_brate, /* i : IVAS total bitrate - for setting the DTX Q0*/ Word16 *Q_new #ifdef DEBUG_MODE_INFO @@ -212,10 +210,6 @@ ivas_error pre_proc_front_ivas_fx( Word16 new_inp_out_size; Word16 Q_new_inp; Word16 mem_decim_size; -#ifndef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING - Word16 Q_new; - Word16 corr_shift_fx; -#endif Word16 dummy_fx; Word16 ncharX_fx; @@ -259,13 +253,8 @@ ivas_error pre_proc_front_ivas_fx( IF( hSCE != NULL ) { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( hSCE->hCoreCoder[n]->input_fx, hSCE->hCoreCoder[n]->input32_fx, input_frame, sub( Q11, hSCE->hCoreCoder[n]->q_inp ) ); /* Q11 */ Copy_Scale_sig_16_32_no_sat( hSCE->hCoreCoder[n]->input_fx - input_frame, hSCE->hCoreCoder[n]->input32_fx - input_frame, input_frame, sub( Q11, hSCE->hCoreCoder[n]->q_old_inp ) ); /* Q11 */ -#else - Copy_Scale_sig_16_32_DEPREC( hSCE->hCoreCoder[n]->input_fx, hSCE->hCoreCoder[n]->input32_fx, input_frame, sub( Q11, hSCE->hCoreCoder[n]->q_inp ) ); /* Q11 */ - Copy_Scale_sig_16_32_DEPREC( hSCE->hCoreCoder[n]->input_fx - input_frame, hSCE->hCoreCoder[n]->input32_fx - input_frame, input_frame, sub( Q11, hSCE->hCoreCoder[n]->q_old_inp ) ); /* Q11 */ -#endif hSCE->hCoreCoder[n]->q_inp32 = Q11; move16(); Scale_sig( hSCE->hCoreCoder[n]->input_fx, input_frame, sub( -1, hSCE->hCoreCoder[n]->q_inp ) ); /* Q(-1) */ @@ -282,13 +271,8 @@ ivas_error pre_proc_front_ivas_fx( } ELSE { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( hCPE->hCoreCoder[n]->input_fx, hCPE->hCoreCoder[n]->input32_fx, input_frame, sub( Q11, hCPE->hCoreCoder[n]->q_inp ) ); /* Q11 */ Copy_Scale_sig_16_32_no_sat( hCPE->hCoreCoder[n]->input_fx - input_frame, hCPE->hCoreCoder[n]->input32_fx - input_frame, input_frame, sub( Q11, hCPE->hCoreCoder[n]->q_old_inp ) ); /* Q11 */ -#else - Copy_Scale_sig_16_32_DEPREC( hCPE->hCoreCoder[n]->input_fx, hCPE->hCoreCoder[n]->input32_fx, input_frame, sub( Q11, hCPE->hCoreCoder[n]->q_inp ) ); /* Q11 */ - Copy_Scale_sig_16_32_DEPREC( hCPE->hCoreCoder[n]->input_fx - input_frame, hCPE->hCoreCoder[n]->input32_fx - input_frame, input_frame, sub( Q11, hCPE->hCoreCoder[n]->q_old_inp ) ); /* Q11 */ -#endif hCPE->hCoreCoder[n]->q_inp32 = Q11; move16(); Scale_sig( hCPE->hCoreCoder[n]->input_fx, input_frame, sub( -1, hCPE->hCoreCoder[n]->q_inp ) ); /* Q(-1) */ @@ -316,13 +300,11 @@ ivas_error pre_proc_front_ivas_fx( } #endif -#ifdef MSAN_FIX FOR( Word16 k = 0; k < CLDFB_NO_COL_MAX; k++ ) { set32_fx( realBuffer_fx[k], 0, CLDFB_NO_CHANNELS_MAX ); set32_fx( imagBuffer_fx[k], 0, CLDFB_NO_CHANNELS_MAX ); } -#endif Word16 sf_energySum[CLDFB_NO_CHANNELS_MAX]; Word16 Q_to_be_looked_into = -1; @@ -365,9 +347,6 @@ ivas_error pre_proc_front_ivas_fx( IF( hSCE != NULL ) { st = hSCE->hCoreCoder[n]; -#ifndef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING - signal_in = hSCE->hCoreCoder[n]->input; -#endif signal_in_fx = hSCE->hCoreCoder[n]->input_fx; /* hSCE->hCoreCoder[n]->q_inp */ signal32_in_fx = hSCE->hCoreCoder[n]->input32_fx; /* hSCE->hCoreCoder[n]->q_inp32 */ element_mode = IVAS_SCE; @@ -381,9 +360,6 @@ ivas_error pre_proc_front_ivas_fx( ELSE /* CPE */ { st = hCPE->hCoreCoder[n]; -#ifndef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING - signal_in = hCPE->hCoreCoder[n]->input; -#endif signal_in_fx = hCPE->hCoreCoder[n]->input_fx; /* hSCE->hCoreCoder[n]->q_inp */ signal32_in_fx = hCPE->hCoreCoder[n]->input32_fx; /* hSCE->hCoreCoder[n]->q_inp32 */ element_mode = hCPE->element_mode; @@ -1092,11 +1068,7 @@ ivas_error pre_proc_front_ivas_fx( move16(); } -#ifdef NONBE_1211_DTX_BR_SWITCHING dtx_ivas_fx( st, last_ivas_total_brate, ivas_total_brate, *vad_flag_dtx, inp_12k8_fx, *Q_new ); -#else - dtx_ivas_fx( st, ivas_total_brate, *vad_flag_dtx, inp_12k8_fx, *Q_new ); -#endif test(); test(); @@ -1464,11 +1436,7 @@ ivas_error pre_proc_front_ivas_fx( st->coder_type = find_uv_ivas_fx( st, pitch_fr_fx, voicing_fr_fx, inp_12k8_fx, ee_fx, &dE1X_fx, corr_shift_fx, *relE_fx, Etot_fx, hp_E_fx, &flag_spitch, last_core_orig, hStereoClassif, *Q_new /*q_inp_12k8*/, fr_bands_fx_q ); // Q0 -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( st->lgBin_E_fx, st->Bin_E_fx, L_FFT / 2, sub( st->q_Bin_E, Q7 ) ); -#else - Copy_Scale_sig_16_32_DEPREC( st->lgBin_E_fx, st->Bin_E_fx, L_FFT / 2, sub( st->q_Bin_E, Q7 ) ); -#endif #ifdef DEBUG_FORCE_DIR if ( st->force_dir[0] != '\0' ) diff --git a/lib_enc/ivas_core_pre_proc_fx.c b/lib_enc/ivas_core_pre_proc_fx.c index 8d00e608c..ca53a227a 100644 --- a/lib_enc/ivas_core_pre_proc_fx.c +++ b/lib_enc/ivas_core_pre_proc_fx.c @@ -282,11 +282,7 @@ ivas_error pre_proc_ivas_fx( } ELSE IF( GT_32( st->total_brate, MAX_GSC_INACTIVE_BRATE ) && ( ( st->vad_flag == 0 && GE_16( st->bwidth, SWB ) && GE_16( st->max_bwidth, SWB ) ) || ( st->localVAD == 0 && ( LE_16( st->bwidth, WB ) || LE_16( st->max_bwidth, WB ) ) ) ) ) { -#ifdef NONBE_FIX_GSC_BSTR /* inactive frames will be coded by AVQ technology (exceptionally it can be later rewritten to GSC technology in ivas_combined_format_brate_sanity()) */ -#else - /* inactive frames will be coded by AVQ technology */ -#endif st->coder_type = INACTIVE; move16(); } @@ -734,9 +730,7 @@ ivas_error ivas_compute_core_buffers_fx( Word16 *preemp_start_idx = NULL; Word32 sig_out[960], max_32; /*Word16 Q_exp, Q_wsp_exp*/; -#ifdef MSAN_FIX set16_fx( new_inp_resamp16k_fx, 0, L_FRAME16k ); -#endif set16_fx( epsP_h, 0, M + 1 ); set16_fx( epsP_l, 0, M + 1 ); signal_in_fx = st->input_fx; /* st->q_inp */ diff --git a/lib_enc/ivas_cpe_enc_fx.c b/lib_enc/ivas_cpe_enc_fx.c index ea70a33d3..6108b138c 100644 --- a/lib_enc/ivas_cpe_enc_fx.c +++ b/lib_enc/ivas_cpe_enc_fx.c @@ -78,9 +78,7 @@ ivas_error ivas_cpe_enc_fx( Word16 Q_new[CPE_CHANNELS] = { 0 }; Word16 fft_buff_fx[CPE_CHANNELS][2 * L_FFT]; /* FFT buffer */ Word16 fft_buff_fx_q[CPE_CHANNELS]; /* FFT buffer */ -#ifdef MSAN_FIX set16_fx( fft_buff_fx_q, 0, CPE_CHANNELS ); -#endif Word16 fft_buff_fx_final_q = MAX_16; move16(); Word32 ener_fx[CPE_CHANNELS]; /* residual energy from Levinson-Durbin Q6 */ @@ -176,7 +174,6 @@ ivas_error ivas_cpe_enc_fx( set16_fx( voicing_fr_fx[0], 0, NB_SUBFR ); set16_fx( voicing_fr_fx[1], 0, NB_SUBFR ); -#ifdef MSAN_FIX FOR( Word16 i = 0; i < CPE_CHANNELS; i++ ) { set16_zero_fx( fft_buff_fx[i], 2 * L_FFT ); @@ -185,7 +182,6 @@ ivas_error ivas_cpe_enc_fx( set16_zero_fx( old_inp_12k8_16fx[i], L_INP_12k8 ); set_zero_fx( old_inp_12k8_fx[i], L_INP_12k8 ); } -#endif /*------------------------------------------------------------------* * CPE initialization - core coder *-----------------------------------------------------------------*/ @@ -288,9 +284,7 @@ ivas_error ivas_cpe_enc_fx( move16(); Word16 front_create_flag = 0; move16(); -#ifdef MSAN_FIX set32_fx( band_energies_LR_fx, 0, 2 * NB_BANDS ); -#endif IF( hCPE->hFrontVad[0] != NULL && NE_16( hCPE->element_mode, IVAS_CPE_MDCT ) ) { @@ -375,13 +369,8 @@ ivas_error ivas_cpe_enc_fx( /*----------------------------------------------------------------* * Set TD stereo parameters *----------------------------------------------------------------*/ -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( sts[1]->input_fx, sts[1]->input32_fx, input_frame, sub( Q11, sts[1]->q_inp ) ); /* Q11 */ Copy_Scale_sig_16_32_no_sat( sts[0]->input_fx, sts[0]->input32_fx, input_frame, sub( Q11, sts[0]->q_inp ) ); /* Q11 */ -#else - Copy_Scale_sig_16_32_DEPREC( sts[1]->input_fx, sts[1]->input32_fx, input_frame, sub( Q11, sts[1]->q_inp ) ); /* Q11 */ - Copy_Scale_sig_16_32_DEPREC( sts[0]->input_fx, sts[0]->input32_fx, input_frame, sub( Q11, sts[0]->q_inp ) ); /* Q11 */ -#endif Word16 shift = getScaleFactor32( sts[1]->input32_fx, input_frame ); scale_sig32( sts[1]->input32_fx, input_frame, shift ); /* Q11 + shift */ sts[1]->q_inp32 = add( Q11, shift ); @@ -408,7 +397,6 @@ ivas_error ivas_cpe_enc_fx( /*----------------------------------------------------------------* * Resets/updates in case of stereo switching *----------------------------------------------------------------*/ -#ifdef FIX_ISSUE_1247 shift = norm_arr( sts[1]->old_input_signal_fx, input_frame ); Scale_sig( sts[1]->old_input_signal_fx, input_frame, shift ); /* sts[1]->q_old_inp + shift */ sts[1]->q_old_inp = add( sts[1]->q_old_inp, shift ); @@ -426,25 +414,6 @@ ivas_error ivas_cpe_enc_fx( Scale_sig( sts[0]->input_fx, input_frame, shift ); /* sts[1]->q_inp, shift */ sts[0]->q_inp = add( sts[0]->q_inp, shift ); move16(); -#else - shift = getScaleFactor16( sts[1]->old_input_signal_fx, input_frame ); - Scale_sig( sts[1]->old_input_signal_fx, input_frame, shift ); /* sts[1]->q_old_inp + shift */ - sts[1]->q_old_inp = add( sts[1]->q_old_inp, shift ); - move16(); - shift = getScaleFactor16( sts[1]->input_fx, input_frame ); - Scale_sig( sts[1]->input_fx, input_frame, shift ); /* sts[1]->q_inp + shift */ - sts[1]->q_inp = add( sts[1]->q_inp, shift ); - move16(); - - shift = getScaleFactor16( sts[0]->old_input_signal_fx, input_frame ); - Scale_sig( sts[0]->old_input_signal_fx, input_frame, shift ); /* sts[1]->q_old_inp + shift */ - sts[0]->q_old_inp = add( sts[0]->q_old_inp, shift ); - move16(); - shift = getScaleFactor16( sts[0]->input_fx, input_frame ); - Scale_sig( sts[0]->input_fx, input_frame, shift ); /* sts[1]->q_inp, shift */ - sts[0]->q_inp = add( sts[0]->q_inp, shift ); - move16(); -#endif Word16 q_inp = s_min( s_min( sts[0]->q_inp, sts[0]->q_old_inp ), s_min( sts[1]->q_inp, sts[1]->q_old_inp ) ); @@ -682,9 +651,6 @@ ivas_error ivas_cpe_enc_fx( // printf("\n%f %f ", hCPE->hStereoClassif->is_speech, hCPE->hCoreCoder[0]->hSpMusClas->past_dlp[0]); IF( EQ_16( hCPE->element_mode, IVAS_CPE_DFT ) ) { -#ifndef MSAN_FIX - hCPE->hStereoClassif->xtalk_score_fx = floatToFixed( hCPE->hStereoClassif->xtalk_score, 31 ); -#endif // !MSAN_FIX /*flt2fix: dft_synthesize*/ test(); if ( EQ_16( hCPE->element_mode, IVAS_CPE_DFT ) && hCPE->hStereoDft->res_cod_mode[STEREO_DFT_OFFSET] ) @@ -866,7 +832,6 @@ ivas_error ivas_cpe_enc_fx( move16(); stereo_dft_enc_synthesize_fx( hCPE->hStereoDft, sts[0]->input32_fx, &out_start_ind, &out_end_ind, 0, input_Fs, input_Fs, 0, NULL ); -#ifdef FIX_ISSUE_1135 // Normalise the input buffer from Q15 Word16 input_norm, q_inp32, common_q, fir_delay_len; input_norm = L_norm_arr( sts[0]->input32_fx + out_start_ind, sub( out_end_ind, out_start_ind ) ); @@ -887,9 +852,6 @@ ivas_error ivas_cpe_enc_fx( move16(); sts[0]->q_old_inp = common_q; move16(); -#else - Copy_Scale_sig32_16( sts[0]->input32_fx + out_start_ind, sts[0]->input_fx + out_start_ind, sub( out_end_ind, out_start_ind ), sub( add( Q16, sts[0]->q_inp ), Q15 ) ); // Q15 -#endif /* iDFT & resampling to 12.8kHz internal sampling rate */ stereo_dft_enc_synthesize_fx( hCPE->hStereoDft, old_inp_12k8_fx[0] + L_INP_MEM, &out_12k8_start_ind[0], &out_12k8_end_ind[0], 0, input_Fs, INT_FS_12k8, 0, NULL ); @@ -956,11 +918,7 @@ ivas_error ivas_cpe_enc_fx( &ener_fx[n], &relE_fx[n], A_fx[n], Aw_fx[n], epsP_fx[n], &epsP_fx_q[n], lsp_new_fx[n], lsp_mid_fx[n], &vad_hover_flag[n], &attack_flag[n], realBuffer_fx[n], imagBuffer_fx[n], &q_re_im_buf[n], old_wsp_fx[n], &q_old_wsp, pitch_fr_fx[n], voicing_fr_fx[n], &loc_harm[n], &cor_map_sum_fx[n], &vad_flag_dtx[n], enerBuffer_fx[n], &enerBuffer_fx_exp[n], fft_buff_fx[n], &fft_buff_fx_q[n], A_fx[0], lsp_new_fx[0], currFlatness_fx[n], tdm_ratio_idx, fr_bands_fx, q_fr_bands, Etot_LR_fx, lf_E_fx, q_lf_E[n], localVAD_HE_SAD, -#ifdef NONBE_1211_DTX_BR_SWITCHING band_energies_LR_fx, q_band_energies_LR, 0, front_vad_flag, 0, 0, ivas_format, st_ivas->hMCT != NULL, st_ivas->hEncoderConfig->last_ivas_total_brate, ivas_total_brate, &Q_new[n] -#else - band_energies_LR_fx, q_band_energies_LR, 0, front_vad_flag, 0, 0, ivas_format, st_ivas->hMCT != NULL, ivas_total_brate, &Q_new[n] -#endif #ifdef DEBUG_MODE_INFO , ( st_ivas->nSCE + ( cpe_id * CPE_CHANNELS ) + n ) @@ -1418,9 +1376,7 @@ ivas_error create_cpe_enc_fx( hCPE->input_mem_fx[n] = NULL; } } -#ifdef MSAN_FIX set16_fx( hCPE->q_input_mem, Q15, CPE_CHANNELS ); -#endif /*-----------------------------------------------------------------* * stereo classifier: allocate and initialize diff --git a/lib_enc/ivas_dirac_enc_fx.c b/lib_enc/ivas_dirac_enc_fx.c index db5ee872b..59447c022 100644 --- a/lib_enc/ivas_dirac_enc_fx.c +++ b/lib_enc/ivas_dirac_enc_fx.c @@ -52,11 +52,9 @@ static void computeIntensityVector_enc_fx( const Word16 enc_param_start_band, /* i : first band to process */ const Word16 num_frequency_bands, Word32 intensity_real[DIRAC_NUM_DIMS][DIRAC_MAX_NBANDS] -#ifdef NONBE_IMPROVE_DIRAC_INTENSITY_PREC , Word16 q_cldfb, Word16 q_intensity_real[DIRAC_MAX_NBANDS] -#endif ); /*------------------------------------------------------------------------- @@ -761,7 +759,6 @@ void computeReferencePower_enc_fx_dirac( *dirac_mono_flag = ivas_dirac_get_mono_flag_fx( band_grouping, Cldfb_RealBuffer, Cldfb_ImagBuffer, e_Cldfb, nchan_ana, mono_frame_count ); /* Q0 */ move16(); } -#ifdef FIX_1127_IMPROVE_SBA_MLD Word16 gb = 0; move16(); FOR( i = 0; i < num_freq_bands; i++ ) @@ -774,7 +771,6 @@ void computeReferencePower_enc_fx_dirac( } e_reference_W = sub( 31, sub( add( shl( sub( 31, e_Cldfb ), 1 ), 1 ), gb ) ); e_reference_temp = e_reference_W; -#endif move16(); FOR( i = 0; i < num_freq_bands; i++ ) { @@ -791,14 +787,8 @@ void computeReferencePower_enc_fx_dirac( FOR( j = brange[0]; j < brange[1]; j++ ) { -#ifdef FIX_1127_IMPROVE_SBA_MLD reference_power_W[i] = W_add( reference_power_W[i], W_shr( W_mult_32_32( Cldfb_RealBuffer[0][j], Cldfb_RealBuffer[0][j] ), gb ) ); /* exp(2 * e_Cldfb) */ reference_power_W[i] = W_add( reference_power_W[i], W_shr( W_mult_32_32( Cldfb_ImagBuffer[0][j], Cldfb_ImagBuffer[0][j] ), gb ) ); /* exp(2 * e_Cldfb) */ -#else - reference_power_W[i] = W_mac_32_32( reference_power_W[i], Cldfb_RealBuffer[0][j], Cldfb_RealBuffer[0][j] ); - reference_power_W[i] = W_mac_32_32( reference_power_W[i], Cldfb_ImagBuffer[0][j], Cldfb_ImagBuffer[0][j] ); - e_reference_W = imult1616( (Word16) 2, e_Cldfb ); -#endif move64(); move64(); } @@ -810,14 +800,8 @@ void computeReferencePower_enc_fx_dirac( /* abs()^2 */ FOR( j = brange[0]; j < brange[1]; j++ ) { -#ifdef FIX_1127_IMPROVE_SBA_MLD reference_power_temp[i] = W_add( reference_power_temp[i], W_shr( W_mult_32_32( Cldfb_RealBuffer[ch_idx][j], Cldfb_RealBuffer[ch_idx][j] ), gb ) ); /* exp(2 * e_Cldfb) */ reference_power_temp[i] = W_add( reference_power_temp[i], W_shr( W_mult_32_32( Cldfb_ImagBuffer[ch_idx][j], Cldfb_ImagBuffer[ch_idx][j] ), gb ) ); /* exp(2 * e_Cldfb) */ -#else - reference_power_temp[i] = W_mac_32_32( reference_power_temp[i], Cldfb_RealBuffer[ch_idx][j], Cldfb_RealBuffer[ch_idx][j] ); - reference_power_temp[i] = W_mac_32_32( reference_power_temp[i], Cldfb_ImagBuffer[ch_idx][j], Cldfb_ImagBuffer[ch_idx][j] ); - e_reference_temp = imult1616( (Word16) 2, e_Cldfb ); -#endif move64(); move64(); } @@ -974,11 +958,7 @@ void ivas_dirac_param_est_enc_fx( Word32 *p_Cldfb_ImagBuffer_fx[DIRAC_MAX_ANA_CHANS]; Word16 cldfb_q; Word32 intensity_real_fx[DIRAC_NUM_DIMS][DIRAC_MAX_NBANDS]; -#ifdef NONBE_IMPROVE_DIRAC_INTENSITY_PREC Word16 intensity_real_q[DIRAC_MAX_NBANDS]; -#else - Word16 intensity_real_q; -#endif Word32 direction_vector_fx[DIRAC_NUM_DIMS][DIRAC_MAX_NBANDS]; Word16 direction_vector_q; Word32 diffuseness_vector_fx[DIRAC_MAX_NBANDS]; @@ -1008,10 +988,6 @@ void ivas_dirac_param_est_enc_fx( cldfb_q = 0; move16(); -#ifndef NONBE_IMPROVE_DIRAC_INTENSITY_PREC - intensity_real_q = 0; - move16(); -#endif direction_vector_q = 0; move16(); @@ -1148,15 +1124,10 @@ void ivas_dirac_param_est_enc_fx( hDirAC->hConfig->enc_param_start_band, num_freq_bands, intensity_real_fx -#ifdef NONBE_IMPROVE_DIRAC_INTENSITY_PREC , cldfb_q, intensity_real_q -#endif ); -#ifndef NONBE_IMPROVE_DIRAC_INTENSITY_PREC - intensity_real_q = sub( shl( cldfb_q, 1 ), 31 ); // 2 * Q_Cldfb + 1 - 32; -#endif IF( !hodirac_flag ) { computeDirectionVectors_fixed( @@ -1168,13 +1139,8 @@ void ivas_dirac_param_est_enc_fx( direction_vector_fx[0], direction_vector_fx[1], direction_vector_fx[2] -#ifdef NONBE_IMPROVE_DIRAC_INTENSITY_PREC , 31, intensity_real_q -#else - , - sub( 31, intensity_real_q ) -#endif ); direction_vector_q = Q30; @@ -1190,11 +1156,7 @@ void ivas_dirac_param_est_enc_fx( { /* only real part needed */ Copy32( intensity_real_fx[i], &( hDirAC->buffer_intensity_real_fx[i][index - 1][0] ), num_freq_bands ); /* intensity_real_q */ -#ifdef NONBE_IMPROVE_DIRAC_INTENSITY_PREC Copy( intensity_real_q, &hDirAC->buffer_intensity_real_q[i][index - 1][0], num_freq_bands ); -#else - set16_fx( &hDirAC->buffer_intensity_real_q[i][index - 1][0], intensity_real_q, num_freq_bands ); -#endif } Copy32( reference_power_fx[ts], &( hDirAC->buffer_energy_fx[( index - 1 ) * num_freq_bands] ), num_freq_bands ); /* exp(reference_power_exp) */ FOR( i = 0; i < num_freq_bands; i++ ) @@ -1406,12 +1368,7 @@ void ivas_dirac_param_est_enc_fx( Scale_sig32( dir_v_fx, 3, -1 ); ivas_qmetadata_direction_vector_to_azimuth_elevation_fx( dir_v_fx, -#ifdef NONBE_IMPROVE_DIRAC_INTENSITY_PREC Q29, -#else - - Q30, -#endif &q_direction->band_data[band_m_idx].azimuth_fx[block_m_idx], &q_direction->band_data[band_m_idx].elevation_fx[block_m_idx] ); } @@ -1506,11 +1463,9 @@ static void computeIntensityVector_enc_fx( const Word16 enc_param_start_band, /* i : first band to process Q0*/ const Word16 num_frequency_bands, /* Q0 */ Word32 intensity_real[DIRAC_NUM_DIMS][DIRAC_MAX_NBANDS] /* q_intensity_real */ -#ifdef NONBE_IMPROVE_DIRAC_INTENSITY_PREC , Word16 q_cldfb, Word16 q_intensity_real[DIRAC_MAX_NBANDS] -#endif ) { /* Reminder @@ -1520,20 +1475,16 @@ static void computeIntensityVector_enc_fx( Word16 i, j; Word32 real, img; Word16 brange[2]; -#ifdef NONBE_IMPROVE_DIRAC_INTENSITY_PREC Word16 shift_value = sub( shl( q_cldfb, 1 ), 31 ); -#endif FOR( i = 0; i < num_frequency_bands; i++ ) { brange[0] = hDirAC->band_grouping[i + enc_param_start_band]; /* Q0 */ move16(); brange[1] = hDirAC->band_grouping[i + enc_param_start_band + 1]; /* Q0 */ move16(); -#ifdef NONBE_IMPROVE_DIRAC_INTENSITY_PREC Word16 num_bins = sub( brange[1], brange[0] ); Word16 gb = find_guarded_bits_fx( num_bins ); Word16 norm; -#endif intensity_real[0][i] = 0; move32(); intensity_real[1][i] = 0; @@ -1552,7 +1503,6 @@ static void computeIntensityVector_enc_fx( move32(); img = Cldfb_ImagBuffer[0][j]; move32(); -#ifdef NONBE_IMPROVE_DIRAC_INTENSITY_PREC Word64 t1, t2, t3; t1 = W_mac_32_32( W_mult_32_32( Cldfb_RealBuffer[3][j], real ), Cldfb_ImagBuffer[3][j], img ); /* 2 * q_cldfb + 1 */ t2 = W_mac_32_32( W_mult_32_32( Cldfb_RealBuffer[1][j], real ), Cldfb_ImagBuffer[1][j], img ); /* 2 * q_cldfb + 1 */ @@ -1564,14 +1514,7 @@ static void computeIntensityVector_enc_fx( tmp_1 = W_add( tmp_1, t1 ); /* 2 * q_cldfb + 1 */ tmp_2 = W_add( tmp_2, t2 ); /* 2 * q_cldfb + 1 */ tmp_3 = W_add( tmp_3, t3 ); /* 2 * q_cldfb + 1 */ -#else - /* Intensity is XYZ order, audio is WYZX order. */ - tmp_1 = W_add( tmp_1, W_add( W_mult_32_32( Cldfb_RealBuffer[3][j], real ), W_mult_32_32( Cldfb_ImagBuffer[3][j], img ) ) ); - tmp_2 = W_add( tmp_2, W_add( W_mult_32_32( Cldfb_RealBuffer[1][j], real ), W_mult_32_32( Cldfb_ImagBuffer[1][j], img ) ) ); - tmp_3 = W_add( tmp_3, W_add( W_mult_32_32( Cldfb_RealBuffer[2][j], real ), W_mult_32_32( Cldfb_ImagBuffer[2][j], img ) ) ); -#endif } -#ifdef NONBE_IMPROVE_DIRAC_INTENSITY_PREC norm = 63; move16(); IF( tmp_1 != 0 ) @@ -1593,15 +1536,6 @@ static void computeIntensityVector_enc_fx( intensity_real[2][i] = W_extract_h( W_shl( tmp_3, norm ) ); // shift_value - (gb - norm) q_intensity_real[i] = sub( shift_value, sub( gb, norm ) ); move16(); -#else - - intensity_real[0][i] = W_extract_h( tmp_1 ); // output Q= 2* input_q + 1 - 32 - move32(); - intensity_real[1][i] = W_extract_h( tmp_2 ); // output Q= 2* input_q + 1 - 32 - move32(); - intensity_real[2][i] = W_extract_h( tmp_3 ); // output Q= 2* input_q + 1 - 32 - move32(); -#endif } return; diff --git a/lib_enc/ivas_front_vad_fx.c b/lib_enc/ivas_front_vad_fx.c index b37e61829..a53e40ee6 100644 --- a/lib_enc/ivas_front_vad_fx.c +++ b/lib_enc/ivas_front_vad_fx.c @@ -621,11 +621,7 @@ ivas_error front_vad_spar_fx( corr_shift_fx = correlation_shift_fx( hFrontVad->hNoiseEst->totalNoise_fx ); /* Q15 */ -#ifdef NONBE_1211_DTX_BR_SWITCHING dtx_ivas_fx( st, hEncoderConfig->last_ivas_total_brate, hEncoderConfig->ivas_total_brate, vad_flag_dtx[0], inp_12k8_fx, Q_inp_12k8 ); -#else - dtx_ivas_fx( st, hEncoderConfig->ivas_total_brate, vad_flag_dtx[0], inp_12k8_fx, Q_inp_12k8 ); -#endif /* linear prediction analysis */ alw_pitch_lag_12k8[0] = st->old_pitch_la; /* Q0 */ diff --git a/lib_enc/ivas_ism_dtx_enc_fx.c b/lib_enc/ivas_ism_dtx_enc_fx.c index 6aba283be..b06acfbac 100644 --- a/lib_enc/ivas_ism_dtx_enc_fx.c +++ b/lib_enc/ivas_ism_dtx_enc_fx.c @@ -174,11 +174,7 @@ Word16 ivas_ism_dtx_enc_fx( ( EQ_16( nchan_ism, 2 ) && LE_32( ivas_total_brate, IVAS_48k ) ) || ( EQ_16( nchan_ism, 3 ) && LE_32( ivas_total_brate, IVAS_80k ) ) || ( EQ_16( nchan_ism, 4 ) && LE_32( ivas_total_brate, IVAS_96k ) ) || -#ifdef NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD LT_16( lp_noise_max_fx, ( DTX_THR << 8 ) ) ) ) -#else - LT_16( lp_noise_max_fx, ( 15 << 8 ) ) ) ) -#endif { dtx_flag = 0; move16(); diff --git a/lib_enc/ivas_ism_enc_fx.c b/lib_enc/ivas_ism_enc_fx.c index c2f77c159..7f9962098 100644 --- a/lib_enc/ivas_ism_enc_fx.c +++ b/lib_enc/ivas_ism_enc_fx.c @@ -116,12 +116,10 @@ ivas_error ivas_ism_enc_fx( error = IVAS_ERR_OK; move32(); -#ifdef MSAN_FIX FOR( i = 0; i < MAX_NUM_OBJECTS; i++ ) { set16_zero_fx( old_inp_12k8_fx[i][0], L_INP_12k8 ); } -#endif set16_fx( q_re_im_buf, 0, MAX_NUM_OBJECTS ); @@ -247,11 +245,7 @@ ivas_error ivas_ism_enc_fx( error = pre_proc_front_ivas_fx( hSCE, NULL, hSCE->element_brate, nb_bits_metadata[sce_id], input_frame, 0, old_inp_12k8_fx[sce_id][0], old_inp_16k_fx[sce_id][0], &ener_fx[sce_id][0], &relE_fx[sce_id][0], A_fx[sce_id][0], Aw_fx[sce_id][0], epsP_fx[sce_id][0], &epsP_fx_q[sce_id][0], lsp_new_fx[sce_id][0], lsp_mid_fx[sce_id][0], &vad_hover_flag[sce_id][0], &attack_flag[sce_id][0], realBuffer_fx[sce_id][0], imagBuffer_fx[sce_id][0], &q_re_im_buf[sce_id], old_wsp_fx[sce_id][0], &q_old_wsp, pitch_fr_fx[sce_id][0], voicing_fr_fx[sce_id][0], &loc_harm[sce_id][0], &cor_map_sum_fx[sce_id][0], &vad_flag_dtx[sce_id][0], enerBuffer_fx[sce_id][0], &enerBuffer_fx_exp[sce_id][0], -#ifdef NONBE_1211_DTX_BR_SWITCHING fft_buff_fx[sce_id][0], &fft_buff_fx_q[sce_id][0], A_fx[sce_id][0], lsp_new_fx[sce_id][0], currFlatness_fx[0], 0, fr_bands_fx, q_fr_bands, Etot_LR_fx, lf_E_fx, 31, localVAD_HE_SAD, NULL, 31, 0, 0, 0, 0, ISM_FORMAT, 0, st_ivas->hEncoderConfig->last_ivas_total_brate, st_ivas->hEncoderConfig->ivas_total_brate, &Q_new[sce_id][0] -#else - fft_buff_fx[sce_id][0], &fft_buff_fx_q[sce_id][0], A_fx[sce_id][0], lsp_new_fx[sce_id][0], currFlatness_fx[0], 0, fr_bands_fx, q_fr_bands, Etot_LR_fx, lf_E_fx, 31, localVAD_HE_SAD, NULL, 31, 0, 0, 0, 0, ISM_FORMAT, 0, st_ivas->hEncoderConfig->ivas_total_brate, &Q_new[sce_id][0] -#endif #ifdef DEBUG_MODE_INFO , st->id_element @@ -286,11 +280,7 @@ ivas_error ivas_ism_enc_fx( test(); IF( st_ivas->hSCE[j] && st_ivas->hSCE[j]->hCoreCoder[0] ) { -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( st_ivas->hSCE[j]->hCoreCoder[0]->input_fx, st_ivas->hSCE[j]->hCoreCoder[0]->input32_fx, input_frame, sub( Q11, st_ivas->hSCE[j]->hCoreCoder[0]->q_inp ) ); /* Q11 */ -#else - Copy_Scale_sig_16_32_DEPREC( st_ivas->hSCE[j]->hCoreCoder[0]->input_fx, st_ivas->hSCE[j]->hCoreCoder[0]->input32_fx, input_frame, sub( Q11, st_ivas->hSCE[j]->hCoreCoder[0]->q_inp ) ); /* Q11 */ -#endif st_ivas->hSCE[j]->hCoreCoder[0]->q_inp32 = Q11; move16(); } diff --git a/lib_enc/ivas_ism_metadata_enc_fx.c b/lib_enc/ivas_ism_metadata_enc_fx.c index 8e6e0c93f..1efbb2123 100644 --- a/lib_enc/ivas_ism_metadata_enc_fx.c +++ b/lib_enc/ivas_ism_metadata_enc_fx.c @@ -314,10 +314,8 @@ ivas_error ivas_ism_metadata_enc_fx( } ELSE IF( EQ_16( hIsmMeta[ch]->ism_md_fec_cnt_enc, ISM_MD_FEC_CNT_MAX ) ) { -#ifdef NONBE_1273_ISM_METADATA_COUNTER hIsmMeta[ch]->ism_md_fec_cnt_enc = 0; move16(); -#endif lowrate_metadata_flag[ch] = 1; move16(); hIsmMeta[ch]->position_angle.angle1_diff_cnt = ISM_FEC_MAX; @@ -650,10 +648,8 @@ ivas_error ivas_ism_metadata_enc_fx( { hIsmMeta[ch]->ism_md_fec_cnt_enc = add( hIsmMeta[ch]->ism_md_fec_cnt_enc, 1 ); move16(); -#ifdef NONBE_1273_ISM_METADATA_COUNTER hIsmMeta[ch]->ism_md_fec_cnt_enc = s_min( hIsmMeta[ch]->ism_md_fec_cnt_enc, ISM_MD_FEC_CNT_MAX ); move16(); -#endif } ELSE { @@ -821,10 +817,8 @@ ivas_error ivas_ism_metadata_enc_fx( { hIsmMeta[ch]->ism_md_fec_cnt_enc = add( hIsmMeta[ch]->ism_md_fec_cnt_enc, 1 ); move16(); -#ifdef NONBE_1273_ISM_METADATA_COUNTER hIsmMeta[ch]->ism_md_fec_cnt_enc = s_min( hIsmMeta[ch]->ism_md_fec_cnt_enc, ISM_MD_FEC_CNT_MAX ); move16(); -#endif } ELSE { diff --git a/lib_enc/ivas_masa_enc_fx.c b/lib_enc/ivas_masa_enc_fx.c index da1f836df..080a62a9d 100644 --- a/lib_enc/ivas_masa_enc_fx.c +++ b/lib_enc/ivas_masa_enc_fx.c @@ -987,11 +987,7 @@ ivas_error ivas_masa_enc_config_fx( /* Setup importance weights for two-direction band selection. */ IF( EQ_16( hMasa->config.numberOfDirections, 2 ) ) { -#ifdef MSAN_FIX set32_fx( hMasa->data.importanceWeight_fx, ONE_IN_Q30 /*1.0f Q30*/, MASA_FREQUENCY_BANDS ); -#else - set32_fx( hMasa->data.importanceWeight_fx, ONE_IN_Q30 /*1.0f Q30*/, hMasa->config.numCodingBands ); -#endif IF( EQ_16( hMasa->config.numCodingBands, 5 ) ) diff --git a/lib_enc/ivas_mc_param_enc_fx.c b/lib_enc/ivas_mc_param_enc_fx.c index 17fefec7e..039bbdf98 100644 --- a/lib_enc/ivas_mc_param_enc_fx.c +++ b/lib_enc/ivas_mc_param_enc_fx.c @@ -1010,11 +1010,7 @@ static void ivas_param_mc_param_est_enc_fx( Cx_sum_e[cur_param_band][ref_channel_idx][ref_channel_idx], &ref_ener_e ); } L_tmp = Mpy_32_16_1( ref_ener_fx, hParamMC->hMetadataPMC.ild_factors_fx[k] ); -#ifdef FIX_ISSUE_1154 L_tmp = L_deposit_h( BASOP_Util_Divide3232_Scale( Nrg_fx[h_ild_mapping->ild_index[k]], L_add( L_tmp, EPSILLON_FX ), &tmp_e ) ); -#else - L_tmp = L_deposit_h( BASOP_Util_Divide3232_Scale( Nrg_fx[h_ild_mapping->ild_index[k]], L_tmp, &tmp_e ) ); -#endif tmp_e = add( sub( Nrg_e[h_ild_mapping->ild_index[k]], ref_ener_e ), tmp_e ); @@ -1392,11 +1388,7 @@ static void ivas_param_mc_quantize_ilds_fx( ref_ener_fx = BASOP_Util_Add_Mant32Exp( ref_ener_fx, ref_ener_e, Cx_fx[ref_channel_idx][ref_channel_idx], Cx_e[ref_channel_idx][ref_channel_idx], &ref_ener_e ); } ref_ener_fx = Mpy_32_16_1( ref_ener_fx, hParamMC->hMetadataPMC.ild_factors_fx[k] ); -#ifdef FIX_ISSUE_1154 L_tmp = L_deposit_h( BASOP_Util_Divide3232_Scale( Nrg_fx[h_ild_mapping->ild_index[k]], L_add( ref_ener_fx, EPSILLON_FX ), &tmp_e ) ); -#else - L_tmp = L_deposit_h( BASOP_Util_Divide3232_Scale( Nrg_fx[h_ild_mapping->ild_index[k]], ref_ener_fx, &tmp_e ) ); -#endif tmp_e = add( sub( Nrg_e[h_ild_mapping->ild_index[k]], ref_ener_e ), tmp_e ); /*10 in Q21 = 1342177280*/ ILD_fx[k] = Mpy_32_32( 1342177280, BASOP_Util_Log10( L_tmp, tmp_e ) ); // Q21 diff --git a/lib_enc/ivas_mc_paramupmix_enc_fx.c b/lib_enc/ivas_mc_paramupmix_enc_fx.c index fd5cb6217..cad29b146 100644 --- a/lib_enc/ivas_mc_paramupmix_enc_fx.c +++ b/lib_enc/ivas_mc_paramupmix_enc_fx.c @@ -1040,12 +1040,6 @@ static ivas_error ivas_mc_paramupmix_param_est_enc_fx( IF( LT_16( maxbands, IVAS_MAX_NUM_BANDS ) ) { -#ifndef FIX_1133_IMPROVE_MC_MLD - *exp_alphas = 0; - move16(); - *exp_betas = 0; - move16(); -#endif FOR( b = 0; b < MC_PARAMUPMIX_COMBINATIONS; b++ ) { FOR( bnd = maxbands; bnd < IVAS_MAX_NUM_BANDS; bnd++ ) diff --git a/lib_enc/ivas_mcmasa_enc_fx.c b/lib_enc/ivas_mcmasa_enc_fx.c index 22f21dceb..0071b67ea 100644 --- a/lib_enc/ivas_mcmasa_enc_fx.c +++ b/lib_enc/ivas_mcmasa_enc_fx.c @@ -940,13 +940,11 @@ void ivas_mcmasa_param_est_enc_fx( Word16 surroundingCoherence_e[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; Word16 numAnalysisChannels; -#ifdef MSAN_FIX FOR( i = 0; i < MCMASA_MAX_ANA_CHANS; i++ ) { set_zero_fx( Chnl_RealBuffer_fx[i], DIRAC_NO_FB_BANDS_MAX ); set_zero_fx( Chnl_ImagBuffer_fx[i], DIRAC_NO_FB_BANDS_MAX ); } -#endif num_freq_bins = idiv1616( input_frame, MDFT_NO_COL_MAX ); num_freq_bands = hMcMasa->nbands; @@ -1181,10 +1179,8 @@ void ivas_mcmasa_param_est_enc_fx( direction_vector_fx[0], direction_vector_fx[1], direction_vector_fx[2], c_e -#ifdef NONBE_IMPROVE_DIRAC_INTENSITY_PREC , NULL -#endif ); /* Power and intensity estimation for diffuseness */ diff --git a/lib_enc/ivas_mct_core_enc_fx.c b/lib_enc/ivas_mct_core_enc_fx.c index 71515571d..548a56717 100644 --- a/lib_enc/ivas_mct_core_enc_fx.c +++ b/lib_enc/ivas_mct_core_enc_fx.c @@ -270,7 +270,6 @@ void ivas_mct_core_enc_fx( nCPE = add( nCPE, 1 ); } -#ifdef MSAN_FIX FOR( ch = 0; ch < MCT_MAX_CHANNELS; ch++ ) { set32_fx( powerSpecMsInv_long_fx[ch], 0, L_FRAME48k ); @@ -278,7 +277,6 @@ void ivas_mct_core_enc_fx( move16(); set16_fx( exp_powerSpec[ch], 0, N_MAX + L_MDCT_OVLP_MAX ); } -#endif // MSAN_FIX FOR( ch = 0; ch < nChannels; ch++ ) { set32_fx( inv_spectrum_long_fx[ch], 0, L_FRAME48k ); @@ -334,7 +332,6 @@ void ivas_mct_core_enc_fx( IF( switch_bw ) { -#ifdef FIX_USAN_ISSUES IF( sts[ch_core]->hIGFEnc == NULL ) { initMdctStereoEncData_fx( hMCT->hBlockData[ch]->hStereoMdct, ivas_format, sts[ch_core]->element_mode, sts[ch_core]->element_brate, sts[ch_core]->bwidth, @@ -345,10 +342,6 @@ void ivas_mct_core_enc_fx( initMdctStereoEncData_fx( hMCT->hBlockData[ch]->hStereoMdct, ivas_format, sts[ch_core]->element_mode, sts[ch_core]->element_brate, sts[ch_core]->bwidth, sts[ch_core]->igf, sts[ch_core]->hIGFEnc->igfData.igfInfo.grid, 0 ); } -#else - initMdctStereoEncData_fx( hMCT->hBlockData[ch]->hStereoMdct, ivas_format, sts[ch_core]->element_mode, sts[ch_core]->element_brate, sts[ch_core]->bwidth, - sts[ch_core]->igf, sts[ch_core]->hIGFEnc->igfData.igfInfo.grid, 0 ); -#endif } IF( sts[ch_core]->igf ) @@ -653,11 +646,7 @@ void ivas_mct_core_enc_fx( q_spectrum = sub( 31, st->hTcxEnc->spectrum_e[n] ); set16_fx( exp_powerSpec[ch], sub( Q31, q_powSpec[ch] ), N_MAX + L_MDCT_OVLP_MAX ); -#ifndef MSAN_FIX - ProcessIGF_ivas_fx( st, st->hTcxEnc->spectrum_fx[n], orig_spectrum_fx[ch][n], &q_spectrum, &powerSpec_fx[ch][n * L_subframeTCX], &exp_powerSpec[ch][n * L_subframeTCX], st->core == TCX_20_CORE, n, sp_aud_decision0[ch], 0 ); -#else ProcessIGF_ivas_fx( st, L_FRAME48k, st->hTcxEnc->spectrum_fx[n], orig_spectrum_fx[ch][n], &q_spectrum, &powerSpec_fx[ch][n * L_subframeTCX], &exp_powerSpec[ch][n * L_subframeTCX], st->core == TCX_20_CORE, n, sp_aud_decision0[ch], 0 ); -#endif st->hIGFEnc->spec_be_igf_e = sub( 31, q_origSpec ); st->hTcxEnc->spectrum_e[n] = sub( 31, q_spectrum ); diff --git a/lib_enc/ivas_mct_enc_mct_fx.c b/lib_enc/ivas_mct_enc_mct_fx.c index a8ba9a320..78bf976d1 100644 --- a/lib_enc/ivas_mct_enc_mct_fx.c +++ b/lib_enc/ivas_mct_enc_mct_fx.c @@ -1116,11 +1116,7 @@ void mctStereoIGF_enc_fx( q_spectrum = sub( 31, st->hTcxEnc->spectrum_e[n] ); set16_fx( exp_powerSpec[p_ch[ch]], sub( Q31, q_powerSpec[p_ch[ch]] ), N_MAX + L_MDCT_OVLP_MAX ); -#ifndef MSAN_FIX - ProcessIGF_ivas_fx( st, st->hTcxEnc->spectrum_fx[n], orig_spectrum_fx[p_ch[ch]][n], &q_spectrum, &powerSpec_fx[p_ch[ch]][n * L_subframeTCX], &exp_powerSpec[p_ch[ch]][n * L_subframeTCX], st->core == TCX_20_CORE, n, sp_aud_decision0[ch], 0 ); -#else ProcessIGF_ivas_fx( st, L_FRAME48k, st->hTcxEnc->spectrum_fx[n], orig_spectrum_fx[p_ch[ch]][n], &q_spectrum, &powerSpec_fx[p_ch[ch]][n * L_subframeTCX], &exp_powerSpec[p_ch[ch]][n * L_subframeTCX], st->core == TCX_20_CORE, n, sp_aud_decision0[ch], 0 ); -#endif st->hTcxEnc->spectrum_e[n] = sub( 31, q_spectrum ); move16(); @@ -1161,11 +1157,7 @@ void mctStereoIGF_enc_fx( q_spectrum = sub( 31, st->hTcxEnc->spectrum_e[n] ); set16_fx( exp_powerSpec[ch], sub( Q31, q_powerSpec[ch] ), N_MAX + L_MDCT_OVLP_MAX ); -#ifndef MSAN_FIX - ProcessIGF_ivas_fx( st, st->hTcxEnc->spectrum_fx[n], orig_spectrum_fx[ch][n], &q_spectrum, &powerSpec_fx[ch][n * L_subframeTCX], &exp_powerSpec[ch][n * L_subframeTCX], st->core == TCX_20_CORE, n, sp_aud_decision0[ch], 0 ); -#else ProcessIGF_ivas_fx( st, L_FRAME48k, st->hTcxEnc->spectrum_fx[n], orig_spectrum_fx[ch][n], &q_spectrum, &powerSpec_fx[ch][n * L_subframeTCX], &exp_powerSpec[ch][n * L_subframeTCX], st->core == TCX_20_CORE, n, sp_aud_decision0[ch], 0 ); -#endif st->hTcxEnc->spectrum_e[n] = sub( 31, q_spectrum ); move16(); diff --git a/lib_enc/ivas_mdct_core_enc_fx.c b/lib_enc/ivas_mdct_core_enc_fx.c index 9f674473e..4b5b3fcbe 100644 --- a/lib_enc/ivas_mdct_core_enc_fx.c +++ b/lib_enc/ivas_mdct_core_enc_fx.c @@ -429,17 +429,9 @@ static void kernel_switch_update_transforms_fx( Word32 factor; n = extract_l( Mpy_32_32( s, 603979776 /* N_ZERO_MDCT_NS / FRAME_SIZE_NS in Q31 */ ) ); -#ifdef MSAN_FIX Scale_sig( &tcxTimeSignal[n - s], add( sub( shl( s, 1 ), n ), 1 ), -Q1 ); // Q0 -> Q-1 -#else - Scale_sig( &tcxTimeSignal[n - s], shl( s, 1 ), -Q1 ); // Q0 -> Q-1 -#endif wtda_ext_fx( tcxTimeSignal, windowedTimeSignal_16, extract_l( windowedTimeSignal[0] ), extract_l( windowedTimeSignal[1] ), s, kernelType ); // Q-2 -#ifdef MSAN_FIX Scale_sig( &tcxTimeSignal[n - s], add( sub( shl( s, 1 ), n ), 1 ), Q1 ); // Q-1 -> Q0 -#else - Scale_sig( &tcxTimeSignal[n - s], shl( s, 1 ), Q1 ); // Q-1 -> Q0 -#endif Copy_Scale_sig_16_32_no_sat( windowedTimeSignal_16 /* Q(-2) */, windowedTimeSignal, s, Q16 ); // Q14 scale_sig32( windowedTimeSignal, s, -Q8 /* guard bits */ ); // Q6 edxt_fx( windowedTimeSignal, sigR, s, kernelType, FALSE ); @@ -545,11 +537,7 @@ static void kernel_switch_update_transforms_fx( Copy_Scale_sig_32_16( windowedTimeSignal + 2, windowedTimeSignal_16 + 2, add( s, shr( add( leftOverlap, rightOverlap ), 1 ) ), -Q16 ); // *q_windowedTimeSignal - Q16 WindowSignal( hTcxCfg, shr( leftOverlap, 1 ), RECTANGULAR_OVERLAP, MIN_OVERLAP, &leftOverlap, &rightOverlap, windowedTimeSignal_16 + 2, &s, tcx5Win, 0, 1 ); // *q_windowedTimeSignal - Q16 Copy_Scale_sig_16_32_no_sat( tcx5Win, tcx5Win_32, add( s, shr( add( leftOverlap, rightOverlap ), 1 ) ), Q16 ); // *q_windowedTimeSignal -#ifdef FIX_ISSUE_1157 q_shift = -Q8; -#else - q_shift = -Q7; -#endif move16(); scale_sig32( tcx5Win_32, add( s /* L_subfr. */, shr( add( leftOverlap, rightOverlap ), 1 ) ), q_shift ); // *q_windowedTimeSignal + q_shift kernel_switch_trafo_fx( tcx5Win_32, sigR, leftOverlap, sub( s /* L_subfr. */, shr( add( leftOverlap, rightOverlap ), 1 ) ), rightOverlap, kernelType ); // *q_windowedTimeSignal + q_shift @@ -579,11 +567,7 @@ static void kernel_switch_update_transforms_fx( ELSE /* tcxTransType != TCX_5 */ { Word16 q_shift, q_com, q_temp; -#ifdef FIX_ISSUE_1157 q_shift = -Q8; -#else - q_shift = -Q7; -#endif move16(); scale_sig32( windowedTimeSignal + 2, add( s /* L_subfr. */, shr( add( leftOverlap, rightOverlap ), 1 ) ), q_shift ); // *q_windowedTimeSignal + q_shift kernel_switch_trafo_fx( windowedTimeSignal + 2, sigR, leftOverlap, sub( s /* L_subfr. */, shr( add( leftOverlap, rightOverlap ), 1 ) ), rightOverlap, kernelType ); // *q_windowedTimeSignal + q_shift @@ -912,13 +896,8 @@ static UWord16 enc_ste_pre_mdct( absMagnR_fx = Sqrt32( L_add( Mpy_32_32( sigR1_fx[s], sigR1_fx[s] ), Mpy_32_32( sigI1_fx[s], sigI1_fx[s] ) ), &absMagnR_e ); corr_fx = L_add( corr_fx, L_add( Mpy_32_32( sigR0_fx[s], sigR1_fx[s] ), Mpy_32_32( sigI0_fx[s], sigI1_fx[s] ) ) ); // q_com*2 - 31 -#ifdef FIX_ISSUE_1092 sumL_fx = L_add( sumL_fx, L_add( L_shr( sigR0_fx[s], 1 ), L_shr( sigI0_fx[s], 1 ) ) ); // q_com -1 sumR_fx = L_add( sumR_fx, L_add( L_shr( sigR1_fx[s], 1 ), L_shr( sigI1_fx[s], 1 ) ) ); // q_com - 1 -#else - sumL_fx = L_add( sumL_fx, L_add( sigR0_fx[s], sigI0_fx[s] ) ); // q_com - sumR_fx = L_add( sumR_fx, L_add( sigR1_fx[s], sigI1_fx[s] ) ); // q_com -#endif sumMagnL_fx = BASOP_Util_Add_Mant32Exp( sumMagnL_fx, sumMagnL_e, absMagnL_fx, absMagnL_e, &sumMagnL_e ); sumMagnR_fx = BASOP_Util_Add_Mant32Exp( sumMagnR_fx, sumMagnR_e, absMagnR_fx, absMagnR_e, &sumMagnR_e ); sumPrdLR_fx = BASOP_Util_Add_Mant32Exp( sumPrdLR_fx, sumPrdLR_e, Mpy_32_32( absMagnL_fx, absMagnR_fx ), add( absMagnL_e, absMagnR_e ), &sumPrdLR_e ); @@ -930,11 +909,7 @@ static UWord16 enc_ste_pre_mdct( temp1 = L_shl( preproLen, x1 ); corr_fx = Mpy_32_32( corr_fx, temp1 ); x1 = sub( 62, add( shl( *q_com, 1 ), x1 ) ); -#ifdef FIX_ISSUE_1092 corr_fx = BASOP_Util_Add_Mant32Exp( corr_fx, x1, Mpy_32_32( sumL_fx, sumR_fx ), sub( 62, shl( sub( *q_com, 1 ), 1 ) ), &x1 ); -#else - corr_fx = BASOP_Util_Add_Mant32Exp( corr_fx, x1, Mpy_32_32( sumL_fx, sumR_fx ), sub( 62, shl( *q_com, 1 ) ), &x1 ); -#endif IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( corr_fx, x1, -maxSqrValue_fx, 52 ), -1 ) ) { @@ -1181,7 +1156,6 @@ void ivas_mdct_core_whitening_enc_fx( push_wmops( "mdct_core_whitening" ); -#ifdef MSAN_FIX FOR( ch = 0; ch < CPE_CHANNELS; ch++ ) { FOR( i = 0; i < NB_DIV; i++ ) @@ -1195,7 +1169,6 @@ void ivas_mdct_core_whitening_enc_fx( set16_fx( orig_spectrum_e[ch], 0, NB_DIV ); } set16_fx( q_windowedSignal, Q31, CPE_CHANNELS ); -#endif q_com = Q31; q_min = 0; move16(); @@ -1235,9 +1208,7 @@ void ivas_mdct_core_whitening_enc_fx( orig_spectrum[ch][1] = orig_spectrum_long[ch] + N_TCX10_MAX; mdst_spectrum_fx[ch][0] = mdst_spectrum_long_fx[ch]; mdst_spectrum_fx[ch][1] = mdst_spectrum_long_fx[ch] + N_TCX10_MAX; -#ifdef MSAN_FIX set32_fx( temp_buffer, 0, 15 * L_FRAME48k / 8 ); -#endif } windowedSignal_fx[0] = orig_spectrum_long[0]; /* NOTE temporarily available */ diff --git a/lib_enc/ivas_omasa_enc_fx.c b/lib_enc/ivas_omasa_enc_fx.c index d31e6d53d..1433c988f 100644 --- a/lib_enc/ivas_omasa_enc_fx.c +++ b/lib_enc/ivas_omasa_enc_fx.c @@ -1050,10 +1050,8 @@ static void ivas_omasa_param_est_enc_fx( move16(); /* Need to initialize renormalization_factors, and variables to be normalized */ -#ifdef MSAN_FIX set_zero_fx( &Foa_RealBuffer_fx[0][0], FOA_CHANNELS * CLDFB_NO_CHANNELS_MAX ); set_zero_fx( &Foa_ImagBuffer_fx[0][0], FOA_CHANNELS * CLDFB_NO_CHANNELS_MAX ); -#endif set_zero_fx( renormalization_factor_diff_fx, hOMasa->nbands ); set_zero_fx( diffuseness_m_fx, hOMasa->nbands ); @@ -1202,10 +1200,8 @@ static void ivas_omasa_param_est_enc_fx( intensity_real_e = sub( add( 62, guard_bits ), shl( q, 1 ) ); computeDirectionVectors_fixed( intensity_real_fx[0], intensity_real_fx[1], intensity_real_fx[2], 0, num_freq_bands, direction_vector_fx[0], direction_vector_fx[1], direction_vector_fx[2], intensity_real_e -#ifdef NONBE_IMPROVE_DIRAC_INTENSITY_PREC , NULL -#endif ); /* Power estimation for diffuseness */ diff --git a/lib_enc/ivas_osba_enc_fx.c b/lib_enc/ivas_osba_enc_fx.c index 0ca93e1a1..dbff29d68 100644 --- a/lib_enc/ivas_osba_enc_fx.c +++ b/lib_enc/ivas_osba_enc_fx.c @@ -77,11 +77,7 @@ static void ivas_merge_sba_transports_fx( { FOR( j = 0; j < input_frame; j++ ) { -#ifdef NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS data_out_f[i][j] = L_shr( L_add( L_shr( data_in_f1[i][j], 1 ), L_shr( data_in_f2[i][j], sub( Q_f2, sub( Q_f1, 1 ) ) ) ), Q1 ); -#else - data_out_f[i][j] = L_add( L_shr( data_in_f1[i][j], 1 ), L_shr( data_in_f2[i][j], sub( Q_f2, sub( Q_f1, 1 ) ) ) ); -#endif move32(); } } @@ -479,9 +475,6 @@ static void ivas_osba_render_ism_to_sba_fx( Word16 azimuth_fx, elevation_fx; Word32 gains_fx[MAX_INPUT_CHANNELS]; Word32 g1_fx, g2_fx; -#ifndef NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS - Word32 output_gain_fx; -#endif Word16 nchan_sba; nchan_sba = imult1616( add( sba_analysis_order, 1 ), add( sba_analysis_order, 1 ) ); @@ -524,21 +517,6 @@ static void ivas_osba_render_ism_to_sba_fx( } *Q_data = sub( *Q_data, 2 ); -#ifndef NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS - /* Gain with loudness-matching gains */ - // output_gain = 0.7499f; - output_gain_fx = 1610397988; // 0.7499f in Q31 - move32(); - FOR( j = 0; j < nchan_sba; j++ ) - { - FOR( k = 0; k < input_frame; k++ ) - { - // data_out_f[j][k] *= output_gain; - data_out_fx[j][k] = Mpy_32_32( data_out_fx[j][k], output_gain_fx ); - move32(); - } - } -#endif return; } diff --git a/lib_enc/ivas_qmetadata_enc_fx.c b/lib_enc/ivas_qmetadata_enc_fx.c index 7de54c482..10380f422 100644 --- a/lib_enc/ivas_qmetadata_enc_fx.c +++ b/lib_enc/ivas_qmetadata_enc_fx.c @@ -2500,11 +2500,7 @@ static Word16 ivas_qmetadata_entropy_encode_dir_fx( } ELSE { -#ifdef FIX_USAN_ISSUES avg_elevation_index = (UWord16) L_add( avg_elevation_index_initial, ivas_qmetadata_dereorder_generic_fx( avg_elevation_offset ) ); -#else - avg_elevation_index = u_extract_l( UL_addNsD( avg_elevation_index_initial, ivas_qmetadata_dereorder_generic_fx( avg_elevation_offset ) ) ); -#endif } // avg_elevation_index = (uint16_t) ( ( avg_elevation_index + avg_elevation_alphabet ) % avg_elevation_alphabet ); avg_elevation_index = u_extract_l( UL_addNsD( avg_elevation_index, avg_elevation_alphabet ) % avg_elevation_alphabet ); @@ -2639,13 +2635,8 @@ static Word16 ivas_qmetadata_entropy_encode_dir_fx( FOR( avg_azimuth_offset = 0; avg_azimuth_offset < q_direction->cfg.search_effort; avg_azimuth_offset++ ) { set_zero_fx( avg_direction_vector, 3 ); -#ifdef FIX_USAN_ISSUES avg_azimuth_index = (UWord16) L_add( avg_azimuth_index_initial, ivas_qmetadata_dereorder_generic_fx( avg_azimuth_offset ) ); avg_azimuth_index = (UWord16) ( L_add( avg_azimuth_index, avg_azimuth_alphabet ) % avg_azimuth_alphabet ); -#else - avg_azimuth_index = (UWord16) add( avg_azimuth_index_initial, ivas_qmetadata_dereorder_generic_fx( avg_azimuth_offset ) ); - avg_azimuth_index = (UWord16) ( add( avg_azimuth_index, avg_azimuth_alphabet ) % avg_azimuth_alphabet ); -#endif all_zero_dist_azimuth_indexes = 1; move16(); azimuth_bits_ec = ivas_qmetadata_encode_quasi_uniform_length_fx( ivas_qmetadata_reorder_generic_fx( sub( avg_azimuth_index, shr( avg_azimuth_alphabet, 1 ) ) ), avg_azimuth_alphabet ); @@ -5452,11 +5443,7 @@ static Word16 encode_surround_coherence_hr_fx( } ELSE { -#ifdef FIX_USAN_ISSUES no_idx16 = add( shr( nbits_fr, 4 ), 1 ); -#else - no_idx16 = shr_r( nbits_fr, 4 ); -#endif } /* write combined index */ @@ -5478,11 +5465,7 @@ static Word16 encode_surround_coherence_hr_fx( } ELSE { -#ifdef FIX_USAN_ISSUES no_idx16 = add( shr( nbits_fr1, 4 ), 1 ); -#else - no_idx16 = shr_r( nbits_fr1, 4 ); -#endif } assert( no_idx16 <= 4 ); diff --git a/lib_enc/ivas_sce_enc_fx.c b/lib_enc/ivas_sce_enc_fx.c index 3a0f19c50..b2e0e9c69 100644 --- a/lib_enc/ivas_sce_enc_fx.c +++ b/lib_enc/ivas_sce_enc_fx.c @@ -120,9 +120,7 @@ ivas_error ivas_sce_enc_fx( * Initialization - general *-----------------------------------------------------------------*/ -#ifdef MSAN_FIX set16_zero_fx( old_inp_12k8_fx[0], L_INP_12k8 ); -#endif Copy32( data_fx, st->input32_fx, input_frame ); // Q(q_data_fx) q_input = sub( add( L_norm_arr( st->input32_fx, input_frame ), q_data_fx ), 16 ); @@ -253,11 +251,7 @@ ivas_error ivas_sce_enc_fx( &ener_fx[0], &relE_fx[0], A_fx[0], Aw_fx[0], epsP_fx[0], &epsP_fx_q[0], lsp_new_fx[0], lsp_mid_fx[0], &vad_hover_flag[0], &attack_flag[0], realBuffer_fx[0], imagBuffer_fx[0], &q_re_im_buf, old_wsp_fx[0], &q_old_wsp, pitch_fr_fx[0], voicing_fr_fx[0], &loc_harm[0], &cor_map_sum_fx[0], &vad_flag_dtx[0], enerBuffer_fx[0], &enerBuffer_fx_exp[0], fft_buff_fx[0], &fft_buff_fx_q[0], A_fx[0], lsp_new_fx[0], currFlatness_fx[0], 0, fr_bands_fx, q_fr_bands, Etot_LR_fx, lf_E_fx, 31, localVAD_HE_SAD, NULL, 31, flag_16k_smc, -#ifdef NONBE_1211_DTX_BR_SWITCHING st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->force_front_vad : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_dtx_flag : 0, ivas_format, 0, st_ivas->hEncoderConfig->last_ivas_total_brate, st_ivas->hEncoderConfig->ivas_total_brate, &Q_new[0] -#else - st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->force_front_vad : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_dtx_flag : 0, ivas_format, 0, st_ivas->hEncoderConfig->ivas_total_brate, &Q_new[0] -#endif #ifdef DEBUG_MODE_INFO , st->id_element diff --git a/lib_enc/ivas_sns_enc_fx.c b/lib_enc/ivas_sns_enc_fx.c index 22cd98cad..b7de878a1 100644 --- a/lib_enc/ivas_sns_enc_fx.c +++ b/lib_enc/ivas_sns_enc_fx.c @@ -817,15 +817,10 @@ Word16 quantize_sns_fx( FOR( ch = 0; ch < CPE_CHANNELS; ch++ ) { -#ifdef MSAN_FIX FOR( k = 0; k < nSubframes; k++ ) { scale_sig32( snsQ_out_fx[ch][k], M, sub( sns_e_tmp[ch][k], sns_e ) ); // Q(31-sns_e_tmp[ch][k]) } -#else - scale_sig32( snsQ_out_fx[ch][0], M, sub( sns_e_tmp[ch][0], *sns_e ) ); - scale_sig32( snsQ_out_fx[ch][1], M, sub( sns_e_tmp[ch][1], *sns_e ) ); -#endif } /* get back to L/F representation */ test(); diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index ef278d188..4a6543026 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -88,12 +88,8 @@ typedef struct stereo_itd_data_struct Word16 prev_sum_nrg_L_lb_fx_e; Word32 prev_xcorr_lb_fx[STEREO_DFT_XCORR_LB_MAX]; Word16 prev_xcorr_lb_fx_e; -#ifdef FIX_ISSUE_1092 Word32 E_band_n_fx[STEREO_DFT_ITD_VAD_BAND_NUM]; /*E_band_n_exp*/ Word16 E_band_n_exp[STEREO_DFT_ITD_VAD_BAND_NUM]; -#else - Word32 E_band_n_fx[STEREO_DFT_ITD_VAD_BAND_NUM]; /*Q0*/ -#endif Word32 xcorr_smooth_fx[STEREO_DFT_N_32k_ENC]; Word16 xcorr_smooth_fx_e[STEREO_DFT_N_32k_ENC]; Word32 lp_phat_peak_fx; /* low-pass GCC PHAT peak value */ // Q31 @@ -1183,11 +1179,7 @@ typedef struct stereo_dmx_evs_correlation_filter_structure { Word16 init_frmCntr; -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA Word32 isd_rate_s_fx; // Q31 -#else - Word16 isd_rate_s_fx; // Q15 -#endif Word32 iccr_s_fx; // Q31 Word32 ipd_ff_fx[STEREO_DMX_EVS_NB_SUBBAND_MAX]; // Q31 Word32 Pr_fx[STEREO_DMX_EVS_NB_SUBBAND_MAX]; // Q31 @@ -1228,11 +1220,7 @@ typedef struct stereo_dmx_evs_enc_data_structure STEREO_DMX_EVS_POC_HANDLE hPOC; STEREO_DMX_EVS_PHA_HANDLE hPHA; -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA Word16 itd_fx; // Q0 -#else - Word32 itd_fx; // Q16 -#endif Word32 pre_dmx_energy_fx[1]; Word16 pre_dmx_energy_fx_e[1]; diff --git a/lib_enc/ivas_stereo_classifier_fx.c b/lib_enc/ivas_stereo_classifier_fx.c index 3e148a5ae..3e69a0ca6 100644 --- a/lib_enc/ivas_stereo_classifier_fx.c +++ b/lib_enc/ivas_stereo_classifier_fx.c @@ -1697,11 +1697,7 @@ static void edge_detect_fx( } } -#ifndef FIX_1297_OVERFLOW - *edge_str = extract_l( L_shr( edge_min, 10 ) ); // Q15 -#else *edge_str = extract_h( L_shl_sat( edge_min, 16 - 10 ) ); // Q15 -#endif move16(); *edge_type = et; // Q0 move16(); diff --git a/lib_enc/ivas_stereo_dft_enc_fx.c b/lib_enc/ivas_stereo_dft_enc_fx.c index 3eb6c0e82..cebbc2619 100644 --- a/lib_enc/ivas_stereo_dft_enc_fx.c +++ b/lib_enc/ivas_stereo_dft_enc_fx.c @@ -593,10 +593,8 @@ void stereo_dft_enc_reset_fx( move16(); hStereoDft->dmx_res_all_prev_fx = 1; move32(); -#ifdef MSAN_FIX hStereoDft->dmx_res_all_prev_fx_e = 31; move16(); -#endif hStereoDft->last_res_cod_mode_modify_flag = 0; move16(); hStereoDft->res_cod_sw_flag = 0; @@ -750,9 +748,7 @@ void stereo_enc_itd_init_fx( hItd->prev_xcorr_lb_fx_e = 0; move16(); set32_fx( hItd->E_band_n_fx, ITD_VAD_E_BAND_N_INIT, STEREO_DFT_ITD_VAD_BAND_NUM ); -#ifdef FIX_ISSUE_1092 set16_fx( hItd->E_band_n_exp, Q31, STEREO_DFT_ITD_VAD_BAND_NUM ); -#endif hItd->vad_frm_cnt = 0; move16(); hItd->pre_vad = 0; @@ -1102,11 +1098,7 @@ void stereo_dft_enc_analyze_fx( { FOR( n = 0; n < n_channels; n++ ) { -#ifdef MSAN_FIX Scale_sig( hStereoDft->input_mem_itd_fx[n], dft_ovl, sub( sts[n]->q_inp, hStereoDft->q_input_mem_itd[n] ) ); // Q(sts[n]->q_inp) -#else - Scale_sig( hStereoDft->input_mem_itd_fx[n], STEREO_DFT_OVL_MAX, sts[n]->q_inp - hStereoDft->q_input_mem_itd[n] ); -#endif // MSAN_FIX hStereoDft->q_input_mem_itd[n] = sts[n]->q_inp; move16(); Copy( hStereoDft->input_mem_itd_fx[n], input_mem[n], dft_ovl ); @@ -1657,11 +1649,7 @@ void stereo_dft_enc_process_fx( pDFT_L_fx = hStereoDft->DFT_fx[0]; pDFT_R_fx = hStereoDft->DFT_fx[1]; -#ifdef MSAN_FIX FOR( i = 0; i < hStereoDft->NFFT; i++ ) -#else - FOR( i = 0; i < STEREO_DFT_N_MAX_ENC; i++ ) -#endif // MSAN_FIX { tmp_e = norm_l( hStereoDft->DFT_fx[0][i] ); pDFT_L_fx[i] = L_shl( hStereoDft->DFT_fx[0][i], tmp_e ); diff --git a/lib_enc/ivas_stereo_dft_enc_itd_fx.c b/lib_enc/ivas_stereo_dft_enc_itd_fx.c index af10f7dea..b7429e2e7 100644 --- a/lib_enc/ivas_stereo_dft_enc_itd_fx.c +++ b/lib_enc/ivas_stereo_dft_enc_itd_fx.c @@ -203,12 +203,8 @@ static void stereo_dft_quantize_itd_fx( *-------------------------------------------------------------------------*/ static Word32 itd_vad_ms_snr_calc_fx( -#ifdef FIX_ISSUE_1092 Word32 E_band_n[STEREO_DFT_ITD_VAD_BAND_NUM], // E_band_n_exp Word16 E_band_n_exp[STEREO_DFT_ITD_VAD_BAND_NUM], -#else - Word32 E_band_n[STEREO_DFT_ITD_VAD_BAND_NUM], // Q0 -#endif Word32 *Spd, // Q(31-Spd_e) Word16 *Spd_e, Word32 *E_band, // Q(31-E_band_e) @@ -251,11 +247,7 @@ static Word32 itd_vad_ms_snr_calc_fx( // snr[i] = E_band[i] / E_band_n[i]; snr[i] = BASOP_Util_Divide3232_Scale_cadence( E_band[i], E_band_n[i], &snr_e[i] ); move32(); -#ifdef FIX_ISSUE_1092 snr_e[i] = add( snr_e[i], sub( E_band_e[i], E_band_n_exp[i] ) ); -#else - snr_e[i] = add( snr_e[i], sub( E_band_e[i], 31 ) ); -#endif move16(); // if ( snr[i] < 1 ) IF( BASOP_Util_Cmp_Mant32Exp( snr[i], snr_e[i], 1, 31 ) < 0 ) @@ -291,12 +283,8 @@ static Word32 itd_vad_ms_snr_calc_fx( * *-------------------------------------------------------------------------*/ static void itd_vad_background_update_fx( -#ifdef FIX_ISSUE_1092 Word32 E_band_n[STEREO_DFT_ITD_VAD_BAND_NUM], // E_band_n_exp Word16 E_band_n_exp[STEREO_DFT_ITD_VAD_BAND_NUM], -#else - Word32 E_band_n[STEREO_DFT_ITD_VAD_BAND_NUM], // Q0 -#endif Word16 *vad_frm_cnt, const Word32 ms_snr, // Q(31-ms_snr_e) const Word16 ms_snr_e, @@ -338,19 +326,10 @@ static void itd_vad_background_update_fx( Word16 q_temp = norm_l( *vad_frm_cnt ); L_temp = L_shl( *vad_frm_cnt, q_temp ); L_temp_e = sub( 31, q_temp ); -#ifdef FIX_ISSUE_1092 L_temp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( E_band_n[i], L_temp ), add( E_band_n_exp[i], L_temp_e ), E_band[i], E_band_e[i], &L_temp_e ); -#else - L_temp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( E_band_n[i], L_temp ), add( 31, L_temp_e ), E_band[i], E_band_e[i], &L_temp_e ); -#endif E_band_n[i] = BASOP_Util_Divide3232_Scale_cadence( L_temp, L_add( *vad_frm_cnt, 1 ), &E_band_n_e_tmp ); move32(); -#ifdef FIX_ISSUE_1092 E_band_n_exp[i] = add( E_band_n_e_tmp, sub( L_temp_e, 31 ) ); -#else - E_band_n_e_tmp = add( E_band_n_e_tmp, sub( L_temp_e, 31 ) ); - E_band_n[i] = L_shr_r( E_band_n[i], sub( 31, E_band_n_e_tmp ) ); // Q31 -#endif move16(); } } @@ -362,7 +341,6 @@ static void itd_vad_background_update_fx( FOR( i = 0; i < STEREO_DFT_ITD_VAD_BAND_NUM; i++ ) { // E_band_n[i] = 0.96f * E_band_n[i] + 0.04f * E_band[i]; -#ifdef FIX_ISSUE_1092 E_band_n[i] = BASOP_Util_Add_Mant32Exp( Mpy_32_32( 2061584302 /*0.96 in Q31*/, E_band_n[i] ), E_band_n_exp[i], Mpy_32_32( 85899346 /*0.04 in Q31*/, E_band[i] ), E_band_e[i], &E_band_n_e_tmp ); move32(); E_band_n_exp[i] = E_band_n_e_tmp; @@ -375,20 +353,6 @@ static void itd_vad_background_update_fx( E_band_n_exp[i] = 0; move16(); } -#else - E_band_n[i] = BASOP_Util_Add_Mant32Exp( Mpy_32_32( 2061584302, E_band_n[i] ), 31, Mpy_32_32( 85899346, E_band[i] ), E_band_e[i], &E_band_n_e_tmp ); - move32(); - // if ( E_band_n[i] < 1.0f ) - IF( BASOP_Util_Cmp_Mant32Exp( E_band_n[i], E_band_n_e_tmp, MAX_32, 0 ) < 0 ) - { - E_band_n[i] = MAX_32; - move32(); - E_band_n_e_tmp = 0; - move16(); - } - E_band_n[i] = L_shr_r( E_band_n[i], sub( 31, E_band_n_e_tmp ) ); // Q31 - move32(); -#endif } } } @@ -402,12 +366,8 @@ static void itd_vad_background_update_fx( *-------------------------------------------------------------------------*/ static Word16 stereo_dft_enc_itd_vad_fx( -#ifdef FIX_ISSUE_1092 Word32 E_band_n[STEREO_DFT_ITD_VAD_BAND_NUM], // E_band_n_exp Word16 E_band_n_exp[STEREO_DFT_ITD_VAD_BAND_NUM], -#else - Word32 E_band_n[STEREO_DFT_ITD_VAD_BAND_NUM], // Q0 -#endif Word16 *vad_frm_cnt, Word32 *Spd_L, // Q(31-Spd_L_e) Word16 *Spd_L_e, @@ -434,17 +394,10 @@ static Word16 stereo_dft_enc_itd_vad_fx( Spd_e[i] = sub( Spd_e[i], 1 ); move16(); } -#ifdef FIX_ISSUE_1092 *mssnr = itd_vad_ms_snr_calc_fx( E_band_n, E_band_n_exp, Spd, Spd_e, E_band, E_band_e, mssnr_e ); move32(); itd_vad_background_update_fx( E_band_n, E_band_n_exp, vad_frm_cnt, *mssnr, *mssnr_e, E_band, E_band_e ); -#else - *mssnr = itd_vad_ms_snr_calc_fx( E_band_n, Spd, Spd_e, E_band, E_band_e, mssnr_e ); - move32(); - - itd_vad_background_update_fx( E_band_n, vad_frm_cnt, *mssnr, *mssnr_e, E_band, E_band_e ); -#endif // if ( *mssnr < ITD_VAD_THRSHOLD ) IF( BASOP_Util_Cmp_Mant32Exp( *mssnr, *mssnr_e, ITD_VAD_THRSHOLD_Q31, 0 ) < 0 ) { @@ -1476,11 +1429,7 @@ void stereo_dft_enc_compute_itd_fx( } // L_temp = sum2_32_fx( &Spd_L[1], 11, &L_temp_e ); sum_nrg_L_lb = BASOP_Util_Add_Mant32Exp( sum_nrg_L_lb, sum_nrg_L_lb_e, L_temp, L_temp_e, &sum_nrg_L_lb_e ); -#ifdef FIX_ISSUE_1092 vad_flag_itd = stereo_dft_enc_itd_vad_fx( hItd->E_band_n_fx, hItd->E_band_n_exp, &( hItd->vad_frm_cnt ), Spd_L, Spd_L_e, Spd_R, Spd_R_e, &mssnr, &mssnr_e ); -#else - vad_flag_itd = stereo_dft_enc_itd_vad_fx( hItd->E_band_n_fx, &( hItd->vad_frm_cnt ), Spd_L, Spd_L_e, Spd_R, Spd_R_e, &mssnr, &mssnr_e ); -#endif vad_flag_itd = vad_flag_itd && vad_flag_dtx[0]; // if ( sum_nrg_L < EPSILON ) diff --git a/lib_enc/ivas_stereo_dmx_evs_fx.c b/lib_enc/ivas_stereo_dmx_evs_fx.c index 933270c33..2ed17e25a 100644 --- a/lib_enc/ivas_stereo_dmx_evs_fx.c +++ b/lib_enc/ivas_stereo_dmx_evs_fx.c @@ -68,17 +68,11 @@ #define STEREO_DMX_EVS_ISD_THRES_L_Q31 1932735283 #define STEREO_DMX_EVS_ISD_DIST_THRES_IPD_Q15 ONE_IN_Q14 -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA #define STEREO_DMX_EVS_ISD_FORGETTING_Q31 2040109465 #define STEREO_DMX_EVS_ISD_1MFORGETTING_Q15 1638 #define STEREO_DMX_EVS_ISD_DIST_HYST_L_Q31 773094113 #define STEREO_DMX_EVS_ISD_DIST_HYST_H_Q31 923417968 #define STEREO_DMX_EVS_ISD_INVTHRES_H 1270700383 -#else -#define STEREO_DMX_EVS_ISD_FORGETTING_Q15 31129 -#define STEREO_DMX_EVS_ISD_DIST_HYST_L_Q15 11796 -#define STEREO_DMX_EVS_ISD_DIST_HYST_H_Q15 14090 -#endif #define STEREO_DMX_EVS_ICCR_FORGETTING_Q31 1503238554 #define STEREO_DMX_EVS_ICCR_HYST_L_Q31 1610612736 @@ -161,11 +155,7 @@ static ivas_error estimate_itd_fx( STEREO_DMX_EVS_PHA_HANDLE hPHA, /* i/o: correlation filter structure */ const Word32 srcL[], /* i : Lch input signal Q16 */ const Word32 srcR[], /* i : Rch input signal Q16 */ -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA Word16 itd[], /* o : estimated itd Q0 */ -#else - Word32 itd[], /* o : estimated itd Q16 */ -#endif const Word16 input_frame /* i : input frame length per channel */ ); static void adapt_gain_fx( @@ -208,11 +198,7 @@ static void create_M_signal_fx( ); static Word32 find_poc_peak_fx( STEREO_DMX_EVS_POC_HANDLE hPOC, /* i/o: phase only correlation structure */ -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA Word16 itd_fx[], /* o : estimated itd */ -#else - Word32 itd_fx[], /* o : estimated itd */ -#endif const Word16 input_frame, /* i : input frame length per channel */ const Word32 ratio_fixed /* i : adapting ratio */ ); @@ -621,20 +607,12 @@ static void calc_poc_fx( Dr = L_add( specLr[i], specRr[i] ); // spec_e Di = L_add( specLi[i], specRi[i] ); // spec_e // if ( ( Nr * Nr + Ni * Ni ) > STEREO_DMX_EVS_ISD_THRES_H * ( Dr * Dr + Di * Di ) ) -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA IF( GT_32( Mpy_32_32_r( L_add( Mpy_32_32_r( Nr, Nr ), Mpy_32_32_r( Ni, Ni ) ), STEREO_DMX_EVS_ISD_INVTHRES_H ), L_add( Mpy_32_32_r( Dr, Dr ), Mpy_32_32_r( Di, Di ) ) ) ) -#else - IF( GT_32( Mpy_32_32_r( L_add( Mpy_32_32_r( Nr, Nr ), Mpy_32_32_r( Ni, Ni ) ), 1270700383 /*1/STEREO_DMX_EVS_ISD_THRES_H in Q31*/ ), L_add( Mpy_32_32_r( Dr, Dr ), Mpy_32_32_r( Di, Di ) ) ) ) -#endif { isd_cnt_h = add( isd_cnt_h, 1 ); } -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA W_tmp = W_add( W_mult0_32_32( Mpy_32_32_r( Dr, STEREO_DMX_EVS_ISD_THRES_L_Q31 ), Dr ), W_mult0_32_32( Mpy_32_32_r( Di, STEREO_DMX_EVS_ISD_THRES_L_Q31 ), Di ) ); // Q62 IF( LT_64( W_add( W_mult0_32_32( Nr, Nr ), W_mult0_32_32( Ni, Ni ) ), W_tmp ) ) // Q62 -#else - IF( LT_32( L_add( Mpy_32_32_r( Nr, Nr ), Mpy_32_32_r( Ni, Ni ) ), Mpy_32_32_r( STEREO_DMX_EVS_ISD_THRES_L_Q31, L_add( Mpy_32_32_r( Dr, Dr ), Mpy_32_32_r( Di, Di ) ) ) ) ) -#endif { isd_cnt_l = add( isd_cnt_l, 1 ); } @@ -643,19 +621,10 @@ static void calc_poc_fx( isd_rate = BASOP_Util_Divide1616_Scale( isd_cnt_h, freq_8k, &isd_rate_e ); // Saturation to handle values close to 1.0f isd_rate = shl_sat( isd_rate, isd_rate_e ); // Q15 -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA hPHA->isd_rate_s_fx = L_add( Mpy_32_32_r( STEREO_DMX_EVS_ISD_FORGETTING_Q31, hPHA->isd_rate_s_fx ), L_mult( STEREO_DMX_EVS_ISD_1MFORGETTING_Q15, isd_rate ) ); move32(); -#else - hPHA->isd_rate_s_fx = add( mult_r( STEREO_DMX_EVS_ISD_FORGETTING_Q15, hPHA->isd_rate_s_fx ), mult_r( MAX_16 - STEREO_DMX_EVS_ISD_FORGETTING_Q15, isd_rate ) ); - move16(); -#endif -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA IF( GT_32( hPHA->isd_rate_s_fx, STEREO_DMX_EVS_ISD_DIST_HYST_H_Q31 ) ) -#else - IF( GT_16( hPHA->isd_rate_s_fx, STEREO_DMX_EVS_ISD_DIST_HYST_H_Q15 ) ) -#endif { IF( NE_32( hPHA->curr_pha, STEREO_DMX_EVS_PHA_IPD ) ) { @@ -680,11 +649,7 @@ static void calc_poc_fx( hPHA->prev_pha = STEREO_DMX_EVS_PHA_IPD; move32(); } -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA ELSE IF( LT_32( hPHA->isd_rate_s_fx, STEREO_DMX_EVS_ISD_DIST_HYST_L_Q31 ) ) -#else - ELSE IF( LT_16( hPHA->isd_rate_s_fx, STEREO_DMX_EVS_ISD_DIST_HYST_L_Q15 ) ) -#endif { IF( NE_32( hPHA->curr_pha, STEREO_DMX_EVS_PHA_IPD2 ) ) { @@ -752,7 +717,6 @@ static void calc_poc_fx( /* Energy */ -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA // Left W_tmp = W_add( W_mult0_32_32( specLr[i], specLr[i] ), W_mult0_32_32( specLi[i], specLi[i] ) ); // Q(62-(2*specL_e)) -> Q(63 - ((2*specL_e) +1)) @@ -773,12 +737,6 @@ static void calc_poc_fx( } tEr[n] = BASOP_Util_Add_Mant32Exp( tEr[n], tEr_e[n], W_round64_L( W_tmp ), sub( shl( spec_e, 1 ), sub( L_tmp_e, 1 ) ), &tEr_e[n] ); move32(); -#else - tEl[n] = BASOP_Util_Add_Mant32Exp( tEl[n], tEl_e[n], L_add( Mpy_32_32_r( specLr[i], specLr[i] ), Mpy_32_32_r( specLi[i], specLi[i] ) ), shl( spec_e, 1 ), &tEl_e[n] ); - move32(); - tEr[n] = BASOP_Util_Add_Mant32Exp( tEr[n], tEr_e[n], L_add( Mpy_32_32_r( specRr[i], specRr[i] ), Mpy_32_32_r( specRi[i], specRi[i] ) ), shl( spec_e, 1 ), &tEr_e[n] ); - move32(); -#endif /* IPD */ // IPDr = L_add(Mpy_32_32_r(specLr[i], specRr[i]), Mpy_32_32_r(specLi[i], specRi[i])); //2*spec_e @@ -809,7 +767,6 @@ static void calc_poc_fx( tIPDr = L_sub( Mpy_32_32_r( specRr[i], IPDr ), Mpy_32_32_r( specRi[i], IPDi ) ); // spec_e tIPDi = L_add( Mpy_32_32_r( specRr[i], IPDi ), Mpy_32_32_r( specRi[i], IPDr ) ); // spec_e -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA Nr = BASOP_Util_Add_Mant32Exp( Nr, Nr_e, L_add( Mpy_32_32_r( specLr[i], tIPDr ), Mpy_32_32_r( specLi[i], tIPDi ) ), 0, &Nr_e ); Ni = BASOP_Util_Add_Mant32Exp( Ni, Ni_e, L_sub( Mpy_32_32_r( specLi[i], tIPDr ), Mpy_32_32_r( specLr[i], tIPDi ) ), 0, &Ni_e ); @@ -831,13 +788,6 @@ static void calc_poc_fx( W_tmp = W_shl( W_tmp, L_tmp_e ); } eneR = BASOP_Util_Add_Mant32Exp( eneR, eneR_e, W_round64_L( W_tmp ), sub( 1, L_tmp_e ), &eneR_e ); -#else - Nr = BASOP_Util_Add_Mant32Exp( Nr, Nr_e, L_add( Mpy_32_32_r( specLr[i], tIPDr ), Mpy_32_32_r( specLi[i], tIPDi ) ), shl( spec_e, 1 ), &Nr_e ); - Ni = BASOP_Util_Add_Mant32Exp( Ni, Ni_e, L_sub( Mpy_32_32_r( specLi[i], tIPDr ), Mpy_32_32_r( specLr[i], tIPDi ) ), shl( spec_e, 1 ), &Ni_e ); - - eneL = BASOP_Util_Add_Mant32Exp( eneL, eneL_e, L_add( Mpy_32_32_r( specLr[i], specLr[i] ), Mpy_32_32_r( specLi[i], specLi[i] ) ), shl( spec_e, 1 ), &eneL_e ); - eneR = BASOP_Util_Add_Mant32Exp( eneR, eneR_e, L_add( Mpy_32_32_r( specRr[i], specRr[i] ), Mpy_32_32_r( specRi[i], specRi[i] ) ), shl( spec_e, 1 ), &eneR_e ); -#endif } // Pn = (float) inv_sqrt( ( tPr * tPr + tPi * tPi ) + EPSILON ); @@ -857,19 +807,9 @@ static void calc_poc_fx( move32(); // Pn = (float) inv_sqrt( ( Pr[n] * Pr[n] + Pi[n] * Pi[n] ) + EPSILON ); -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA Pn = L_add( L_shr( Mpy_32_32_r( Pr[n], Pr[n] ), 1 ), L_shr( Mpy_32_32_r( Pi[n], Pi[n] ), 1 ) ); Pn = BASOP_Util_Add_Mant32Exp( Pn, 1, EPSILON_FX_M, EPSILON_FX_E, &Pn_e ); Pn = Isqrt_lc( Pn, &Pn_e ); -#else - L_tmp = L_add( L_shr( Mpy_32_32_r( Pr[n], Pr[n] ), 1 ), L_shr( Mpy_32_32_r( Pi[n], Pi[n] ), 1 ) ); - L_tmp_e = 1; - move16(); - L_tmp = BASOP_Util_Add_Mant32Exp( L_tmp, L_tmp_e, EPSILON_FX_M, EPSILON_FX_E, &L_tmp_e ); - Pn_e = L_tmp_e; - move16(); - Pn = ISqrt32( L_tmp, &Pn_e ); -#endif Pr[n] = L_shl_sat( Mpy_32_32_r( Pr[n], Pn ), Pn_e ); // Q31 move32(); @@ -1076,17 +1016,7 @@ static void calc_poc_fx( FOR( i = 0; i < hPHA->pha_len; i++ ) { // hPHA->p_curr_taps[n][i] *= hPHA->win[i]; -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA - hPHA->p_curr_taps_fx[n][i] = Mpy_32_16_1( hPHA->p_curr_taps_fx[n][i], hPHA->win_fx[i] ); // Q30 -#else - -#ifdef FIX_ISSUE_1153 hPHA->p_curr_taps_fx[n][i] = Mpy_32_16_1( hPHA->p_curr_taps_fx[n][i], hPHA->win_fx[i] ); // Q30 -#else - hPHA->p_curr_taps_fx[n][i] = L_shl( Mpy_32_16_1( hPHA->p_curr_taps_fx[n][i], hPHA->win_fx[i] ), 1 ); // Q31 -#endif - -#endif // NONBE_FIX_1386_STEREO_DMX_EVS_PHA move32(); } @@ -1094,39 +1024,16 @@ static void calc_poc_fx( move32(); energy_e = 0; move16(); -#ifndef NONBE_FIX_1386_STEREO_DMX_EVS_PHA -#ifdef FIX_ISSUE_1153 - Word16 shift = L_norm_arr( hPHA->p_curr_taps_fx[n], hPHA->pha_len ); - IF( shift ) - { - scale_sig32( hPHA->p_curr_taps_fx[n], hPHA->pha_len, 1 ); - shift = 1; - move16(); - } -#endif -#endif // NONBE_FIX_1386_STEREO_DMX_EVS_PHA FOR( i = 0; i < hPHA->pha_len; i++ ) { -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA - energy = BASOP_Util_Add_Mant32Exp( energy, energy_e, Mpy_32_32_r( hPHA->p_curr_taps_fx[n][i], hPHA->p_curr_taps_fx[n][i] ), 0, &energy_e ); -#else -#ifdef FIX_ISSUE_1153 - energy = BASOP_Util_Add_Mant32Exp( energy, energy_e, Mpy_32_32_r( hPHA->p_curr_taps_fx[n][i], hPHA->p_curr_taps_fx[n][i] ), shl( sub( 1, shift ), 1 ), &energy_e ); -#else energy = BASOP_Util_Add_Mant32Exp( energy, energy_e, Mpy_32_32_r( hPHA->p_curr_taps_fx[n][i], hPHA->p_curr_taps_fx[n][i] ), 0, &energy_e ); -#endif -#endif // NONBE_FIX_1386_STEREO_DMX_EVS_PHA } // energy = (float) inv_sqrt( energy + EPSILON ); energy = BASOP_Util_Add_Mant32Exp( energy, energy_e, EPSILON_FX_M, EPSILON_FX_E, &energy_e ); energy = ISqrt32( energy, &energy_e ); FOR( i = 0; i < hPHA->pha_len; i++ ) { -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA hPHA->p_curr_taps_fx[n][i] = L_shl_r( Mpy_32_32_r( hPHA->p_curr_taps_fx[n][i], energy ), sub( energy_e, 1 ) ); // Q30 -#else - hPHA->p_curr_taps_fx[n][i] = L_shl_r( Mpy_32_32_r( hPHA->p_curr_taps_fx[n][i], energy ), energy_e ); // Q31 -#endif move32(); } } @@ -1229,11 +1136,7 @@ static void calc_poc_fx( *-------------------------------------------------------------------*/ static Word32 find_poc_peak_fx( STEREO_DMX_EVS_POC_HANDLE hPOC, /* i/o: phase only correlation structure */ -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA Word16 itd_fx[], /* o : estimated itd Q0 */ -#else - Word32 itd_fx[], /* o : estimated itd Q16 */ -#endif const Word16 input_frame, /* i : input frame length per channel */ const Word32 ratio_fixed /* i : adapting ratio Q31 */ ) @@ -1545,11 +1448,7 @@ static ivas_error estimate_itd_fx( STEREO_DMX_EVS_PHA_HANDLE hPHA, /* i/o: correlation filter structure */ const Word32 srcL[], /* i : Lch input signal Q16 */ const Word32 srcR[], /* i : Rch input signal Q16 */ -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA Word16 itd[], /* o : estimated itd Q0 */ -#else - Word32 itd[], /* o : estimated itd Q16 */ -#endif const Word16 input_frame /* i : input frame length per channel */ ) { @@ -2090,9 +1989,7 @@ void stereo_dmx_evs_enc_fx( // ftmp += p_data_mem[n - m] * p_prev_taps[m]; fx_tmp = L_add( fx_tmp, Mpy_32_32( p_data_mem[n - m], p_prev_taps[m] ) ); // Q25 } -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA fx_tmp = L_shl( fx_tmp, 1 ); // Q26 -#endif mem_prev[n] = L_add( mem_prev[n], Mpy_32_32( fx_tmp, INV_SQRT_2_Q31 ) ); move32(); } @@ -2117,9 +2014,7 @@ void stereo_dmx_evs_enc_fx( // ftmp += p_data_mem[n - m] * p_curr_taps[m]; fx_tmp = L_add( fx_tmp, Mpy_32_32( p_data_mem[n - m], p_curr_taps[m] ) ); // Q25 } -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA fx_tmp = L_shl( fx_tmp, 1 ); // Q26 -#endif // dmx_pha_data[n] += ftmp * INV_SQRT_2; dmx_pha_data[n] = L_add( dmx_pha_data[n], Mpy_32_32( fx_tmp, INV_SQRT_2_Q31 ) ); // Q26 move32(); @@ -2149,11 +2044,7 @@ void stereo_dmx_evs_enc_fx( curr_prc = hStereoDmxEVS->hPHA->curr_prc; move32(); // if ( abs( (int16_t) hStereoDmxEVS->itd ) > hStereoDmxEVS->hPHA->prc_thres ) -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA IF( GT_16( abs_s( hStereoDmxEVS->itd_fx ), hStereoDmxEVS->hPHA->prc_thres ) ) -#else - IF( GT_16( abs_s( round_fx( hStereoDmxEVS->itd_fx ) ), hStereoDmxEVS->hPHA->prc_thres ) ) -#endif { IF( NE_32( hStereoDmxEVS->hPHA->curr_prc, STEREO_DMX_EVS_PRC_POC ) ) { @@ -2276,15 +2167,9 @@ ivas_error stereo_dmx_evs_init_encoder_fx( STEREO_DMX_EVS_ENC_HANDLE hStereoDmxEVS; Word16 n, input_frame; -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA Word16 m, len, pha_len, fad_len, fad_len2, rfft_ipd_coef_step, n0, input_frame_pha; Word32 *fad_g, fad_r, *ipd_ff; Word16 *win; -#else - Word16 m, len, pha_len, fad_len, fad_len2, trans_len /*, itrh*/, rfft_ipd_coef_step, n0, input_frame_pha; - Word32 *fad_g, fad_r /*, a_min, a_max, a_step*/, *ipd_ff; - Word16 *win, tmp_r; -#endif const Word16 *p_ipd_w; Word16 tmp_e; @@ -2516,7 +2401,6 @@ ivas_error stereo_dmx_evs_init_encoder_fx( fad_len = hStereoDmxEVS->hPHA->fad_len; move16(); -#ifdef NONBE_FIX_1386_STEREO_DMX_EVS_PHA set16_fx( hStereoDmxEVS->hPHA->win_fx, 29491 /*1.8f in Q14*/, pha_len ); hStereoDmxEVS->hPHA->win_fx[0] = ONE_IN_Q14; move16(); @@ -2532,21 +2416,6 @@ ivas_error stereo_dmx_evs_init_encoder_fx( hStereoDmxEVS->hPHA->win_fx[sub( pha_len, 1 )] = 2816; /*0.1718f in Q14*/ move16(); } -#else - trans_len = idiv1616( pha_len, 20 ); - set16_fx( hStereoDmxEVS->hPHA->win_fx, 29491 /*1.8f in Q15*/, sub( pha_len, trans_len ) ); - hStereoDmxEVS->hPHA->win_fx[0] = ONE_IN_Q14; - move16(); - // tmp_r = 1.0f / ( ( trans_len * 2 ) + 1 ); - tmp_r = div_s( 1, add( shl( trans_len, 1 ), 1 ) ); - win = &( hStereoDmxEVS->hPHA->win_fx[pha_len - trans_len] ); - FOR( n = 0; n < trans_len; n++ ) - { - // win[n] = ( 0.5f * ( 1.0f + cosf( ( PI2 * ( n + 1 ) ) * tmp_r ) ) ) * 1.8f; - win[n] = mult_r( add( ONE_IN_Q14, getCosWord16R2( imult1616( add( n, 1 ), tmp_r ) ) ), 29491 /*1.8/2 in Q15*/ ); - move16(); - } -#endif fad_g = hStereoDmxEVS->hPHA->fad_g_fx; // fad_r = 1.0f / (float) ( fad_len + 1 ); diff --git a/lib_enc/ivas_stereo_ica_enc_fx.c b/lib_enc/ivas_stereo_ica_enc_fx.c index 057798706..8410f7546 100644 --- a/lib_enc/ivas_stereo_ica_enc_fx.c +++ b/lib_enc/ivas_stereo_ica_enc_fx.c @@ -1094,11 +1094,7 @@ static void corrStatsEst_fx( hStereoTCA->delay_0_mem_fx[MAX_DELAYREGLEN - 1] = BASOP_Util_Add_Mant32Exp( Mpy_32_32( hStereoTCA->delay_0_mem_fx[MAX_DELAYREGLEN - 1], 429496730 /* 0.2 in Q31*/ ), hStereoTCA->delay_0_mem_exp, L_mult0( 26214 /* 0.8 in Q15*/, corrLagStats[0] ), Q16, &temp ); /* Q31-temp */ move32(); -#ifdef FIX_USAN_ISSUES Word32 inpp = L_abs( BASOP_Util_Add_Mant32Exp( reg_prv_corr_fx, reg_prv_corr_exp, L_negate( hStereoTCA->delay_0_mem_fx[0] ), hStereoTCA->delay_0_mem_exp, &exp ) ); /* Q31-exp */ -#else - Word32 inpp = L_abs( BASOP_Util_Add_Mant32Exp( reg_prv_corr_fx, reg_prv_corr_exp, -hStereoTCA->delay_0_mem_fx[0], hStereoTCA->delay_0_mem_exp, &exp ) ); /* Q31-exp */ -#endif inpp = L_shl_sat( inpp, sub( exp, 5 ) ); /* Q26 */ IF( GT_32( inpp, 1677721600 ) ) // 25 in Q26 { @@ -1968,22 +1964,8 @@ void stereo_tca_enc_fx( Word16 temp_exp, tempF_16fx; Word16 scalar_value = BASOP_Util_Divide1616_Scale( currentNCShift, dsFactor, &temp_exp ); /* Q15-temp_exp */ -#ifndef FIX_1300_ICA_SHIFT_QUANT_IMPROV - IF( temp_exp < 0 ) - { - scalar_value = shl( scalar_value, sub( temp_exp, Q3 ) ); // Q12 - hStereoTCA->indx_ica_NCShift = usquant_fx( scalar_value, &tempF_16fx, 0, ONE_IN_Q11, ( 1 << STEREO_BITS_TCA_CORRSTATS ) ); /* Q0 */ - move16(); - } - ELSE - { - hStereoTCA->indx_ica_NCShift = usquant_fx( scalar_value, &tempF_16fx, 0, shl( 1, sub( 14, temp_exp ) ), ( 1 << STEREO_BITS_TCA_CORRSTATS ) ); /* Q0 */ - move16(); - } -#else scalar_value = shl_sat( scalar_value, sub( temp_exp, 5 ) ); /*Q10*/ hStereoTCA->indx_ica_NCShift = usquant_fx( scalar_value, &tempF_16fx, 0, 512 /* 0.5 in Q10 */, ( 1 << STEREO_BITS_TCA_CORRSTATS ) ); /* Q0 */ -#endif tempF_fx = tempF_16fx; move32(); @@ -2263,7 +2245,6 @@ static void unclr_calc_corr_features_fx( side_i = BASOP_Util_Add_Mant32Exp( L_shr( buf1[i], 1 ), sub( 31, q_com ), L_negate( L_shr( buf2[i], 1 ) ), sub( 31, q_com ), &exp ); /* Q31-exp */ ener_side = BASOP_Util_Add_Mant32Exp( ener_side, ener_side_exp, Mpy_32_32( side_i, side_i ), shl( exp, 1 ), &ener_side_exp ); /* Q31-ener_side_exp */ -#ifdef FIX_ISSUE_1125 Word16 n1, n2, prod_i_exp; Word32 x, y, prod_i; n1 = norm_l( buf1[i] ); @@ -2273,9 +2254,6 @@ static void unclr_calc_corr_features_fx( prod_i = Mpy_32_32( x, y ); // q: q_com * 2 + n1 + n2 - 31 prod_i_exp = sub( 62, add( shl( q_com, 1 ), add( n1, n2 ) ) ); sum_prod = BASOP_Util_Add_Mant32Exp( sum_prod, sum_prod_exp, prod_i, prod_i_exp, &sum_prod_exp ); /* Q31-sum_prod_exp */ -#else - sum_prod = BASOP_Util_Add_Mant32Exp( sum_prod, sum_prod_exp, Mpy_32_32( buf1[i], buf2[i] ), sub( 62, shl( q_com, 1 ) ), &sum_prod_exp ); /* Q31-sum_prod_exp */ -#endif } /* average energy of L and R channels */ diff --git a/lib_enc/ivas_stereo_icbwe_enc_fx.c b/lib_enc/ivas_stereo_icbwe_enc_fx.c index ad038f0fa..25e2366dd 100644 --- a/lib_enc/ivas_stereo_icbwe_enc_fx.c +++ b/lib_enc/ivas_stereo_icbwe_enc_fx.c @@ -809,11 +809,7 @@ void stereo_icBWE_enc_ivas_fx( Copy_Scale_sig( hStereoICBWE->mem_shb_speech_ref_fx, hStereoICBWE->mem_shb_speech_ref_fx, L_LOOK_16k, negate( sub( max_e, hStereoICBWE->mem_shb_speech_ref_e ) ) ); // mem_shb_speech_ref_e set32_fx( shb_frame_ref_fx, 0, L_LOOK_16k + L_FRAME16k ); -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( hStereoICBWE->mem_shb_speech_ref_fx, shb_frame_ref_fx, L_LOOK_16k, add( negate( sub( max_e, hStereoICBWE->mem_shb_speech_ref_e ) ), Q16 ) ); // mem_shb_speech_ref_e -#else - Copy_Scale_sig_16_32_DEPREC( hStereoICBWE->mem_shb_speech_ref_fx, shb_frame_ref_fx, L_LOOK_16k, add( negate( sub( max_e, hStereoICBWE->mem_shb_speech_ref_e ) ), Q16 ) ); // mem_shb_speech_ref_e -#endif hStereoICBWE->mem_shb_speech_ref_e = max_e; shb_frame_ref_e = max_e; move16(); @@ -827,11 +823,7 @@ void stereo_icBWE_enc_ivas_fx( max_e = s_max( hStereoICBWE->mem_shb_speech_nonref_e, shb_speech_nonref_e ); Copy_Scale_sig( hStereoICBWE->mem_shb_speech_nonref_fx, hStereoICBWE->mem_shb_speech_nonref_fx, L_LOOK_16k, negate( sub( max_e, hStereoICBWE->mem_shb_speech_nonref_e ) ) ); // mem_shb_speech_ref_e -#ifdef FIX_ISSUE_1237 Copy_Scale_sig_16_32_no_sat( hStereoICBWE->mem_shb_speech_nonref_fx, shb_frame_nonref_fx, L_LOOK_16k, add( negate( sub( max_e, hStereoICBWE->mem_shb_speech_nonref_e ) ), Q16 ) ); // mem_shb_speech_ref_e -#else - Copy_Scale_sig_16_32_DEPREC( hStereoICBWE->mem_shb_speech_nonref_fx, shb_frame_nonref_fx, L_LOOK_16k, add( negate( sub( max_e, hStereoICBWE->mem_shb_speech_nonref_e ) ), Q16 ) ); // mem_shb_speech_ref_e -#endif hStereoICBWE->mem_shb_speech_nonref_e = max_e; shb_frame_nonref_e = max_e; move16(); @@ -1233,9 +1225,7 @@ void stereo_icBWE_preproc_fx( Word32 gD_fx; Word32 input_Fs; -#ifdef MSAN_FIX set16_fx( temp_inp_fx, 0, L_FRAME48k ); -#endif /* initialization */ hStereoTCA = hCPE->hStereoTCA; /* Stereo TCA encoder handle */ diff --git a/lib_enc/ivas_stereo_mdct_core_enc_fx.c b/lib_enc/ivas_stereo_mdct_core_enc_fx.c index b68578542..4255980ad 100644 --- a/lib_enc/ivas_stereo_mdct_core_enc_fx.c +++ b/lib_enc/ivas_stereo_mdct_core_enc_fx.c @@ -178,10 +178,8 @@ void stereo_mdct_core_enc_fx( FOR( ch = 0; ch < CPE_CHANNELS; ch++ ) { -#ifdef MSAN_FIX set32_fx( mdst_spectrum_long_fx[ch], 0, N_MAX ); set32_fx( orig_spectrum_long_fx[ch], 0, N_MAX ); -#endif p_mdst_spectrum_long_fx[ch] = mdst_spectrum_long_fx[ch]; p_orig_spectrum_long_fx[ch] = orig_spectrum_long_fx[ch]; orig_spectrum_fx[ch][0] = orig_spectrum_long_fx[ch]; @@ -674,11 +672,7 @@ void stereo_mdct_core_enc_fx( q_spectrum = sub( Q31, st->hTcxEnc->spectrum_e[n] ); Scale_sig32( orig_spectrum_fx[ch][n], st->hIGFEnc->infoStopLine, sub( q_spectrum, sub( Q31, p_orig_spectrum_e[ch] ) ) ); /* q_spectrum */ -#ifndef MSAN_FIX - ProcessIGF_ivas_fx( st, st->hTcxEnc->spectrum_fx[n], orig_spectrum_fx[ch][n], &q_spectrum, &powerSpec_fx[ch][n * L_subframeTCX], &exp_powerSpec[ch][n * L_subframeTCX], st->core == TCX_20_CORE, n, hCPE->hCoreCoder[0]->sp_aud_decision0, 0 ); -#else ProcessIGF_ivas_fx( st, N_MAX, st->hTcxEnc->spectrum_fx[n], orig_spectrum_fx[ch][n], &q_spectrum, &powerSpec_fx[ch][n * L_subframeTCX], &exp_powerSpec[ch][n * L_subframeTCX], st->core == TCX_20_CORE, n, hCPE->hCoreCoder[0]->sp_aud_decision0, 0 ); -#endif } } } @@ -719,11 +713,7 @@ void stereo_mdct_core_enc_fx( Scale_sig32( orig_spectrum_fx[ch][n], st->hIGFEnc->infoStopLine, sub( q_spectrum, sub( Q31, p_orig_spectrum_e[ch] ) ) ); /* q_spectrum */ -#ifndef MSAN_FIX - ProcessIGF_ivas_fx( st, st->hTcxEnc->spectrum_fx[n], orig_spectrum_fx[ch][n], &q_spectrum, &powerSpec_fx[ch][n * L_subframeTCX], &exp_powerSpec[ch][n * L_subframeTCX], st->core == TCX_20_CORE, n, hCPE->hCoreCoder[0]->sp_aud_decision0, 0 ); -#else ProcessIGF_ivas_fx( st, N_MAX, st->hTcxEnc->spectrum_fx[n], orig_spectrum_fx[ch][n], &q_spectrum, &powerSpec_fx[ch][n * L_subframeTCX], &exp_powerSpec[ch][n * L_subframeTCX], st->core == TCX_20_CORE, n, hCPE->hCoreCoder[0]->sp_aud_decision0, 0 ); -#endif } } } diff --git a/lib_enc/ivas_stereo_mdct_igf_enc_fx.c b/lib_enc/ivas_stereo_mdct_igf_enc_fx.c index 851df60d5..6c3588cab 100644 --- a/lib_enc/ivas_stereo_mdct_igf_enc_fx.c +++ b/lib_enc/ivas_stereo_mdct_igf_enc_fx.c @@ -166,12 +166,10 @@ static void IGF_MsStereoDecision_fx( Word16 pc_target_e, pc_src_e; Word16 tmp1, tmp1_e, tmp2, tmp2_e; -#ifdef MSAN_FIX pc_target_e = 0; pc_src_e = 0; move16(); move16(); -#endif // MSAN_FIX Word16 coh_src = calcCoh_fx( &specL_fx[strt_cpy], &specR_fx[strt_cpy], q_spec, width, &cc_src_fx, &cc_src_e, &pc_src_fx, &pc_src_e ); Word16 coh_target = calcCoh_fx( &specL_fx[hGrid->swb_offset[sfb]], &specR_fx[hGrid->swb_offset[sfb]], q_spec, width, &cc_target_fx, &cc_target_e, &pc_target_fx, &pc_target_e ); diff --git a/lib_enc/ivas_stereo_switching_enc_fx.c b/lib_enc/ivas_stereo_switching_enc_fx.c index 0a526561a..5f1208ba7 100644 --- a/lib_enc/ivas_stereo_switching_enc_fx.c +++ b/lib_enc/ivas_stereo_switching_enc_fx.c @@ -239,16 +239,12 @@ ivas_error stereo_memory_enc_fx( test(); IF( hCPE->hStereoTCA != NULL && EQ_16( hCPE->last_element_mode, IVAS_CPE_DFT ) ) { -#ifdef FIX_1132_STACK_CORRUPTION Word16 tmp = extract_h( L_abs( hCPE->hStereoDft->hItd->itd_fx[1] ) ); if ( hCPE->hStereoDft->hItd->itd_fx[1] < 0 ) { tmp = negate( tmp ); } set16_fx( hCPE->hStereoTCA->prevCorrLagStats, tmp, 3 ); -#else - set16_fx( hCPE->hStereoTCA->prevCorrLagStats, extract_h( hCPE->hStereoDft->hItd->itd_fx[1] ), 3 ); -#endif IF( hCPE->hStereoDft->hItd->itd_fx[1] >= 0 ) { hCPE->hStereoTCA->prevRefChanIndx = L_CH_INDX; @@ -448,10 +444,8 @@ ivas_error stereo_memory_enc_fx( } fd_bwe_enc_init_fx( st->hBWE_FD ); -#ifdef MSAN_FIX st->Q_old_wtda = 0; move16(); -#endif } /* allocate stereo CNG structure */ @@ -679,10 +673,8 @@ void stereo_switching_enc_fx( FOR( n = 0; n < CPE_CHANNELS; n++ ) { Copy( sts[n]->input_fx + input_frame - dft_ovl, hCPE->input_mem_fx[n], dft_ovl ); /* sts[n]->q_inp */ -#ifdef FIX_ISSUE_1327 hCPE->q_input_mem[n] = sts[n]->q_inp; move16(); -#endif } } diff --git a/lib_enc/ivas_stereo_td_analysis_fx.c b/lib_enc/ivas_stereo_td_analysis_fx.c index 44c08efa8..f9b6b0bf3 100644 --- a/lib_enc/ivas_stereo_td_analysis_fx.c +++ b/lib_enc/ivas_stereo_td_analysis_fx.c @@ -72,13 +72,8 @@ #define RATIO_MAX 1.5f /* Maximum correlation ratio */ #define RATIO_MAX_FX_Q30 ( 1610612736 ) /* 1.5f in Q30 */ /* Maximum correlation ratio */ -#ifdef FIX_1301_CORRECT_TD_CNST #define RATIO_MAX_FX_Q24 ( 25165824 ) /* 1.5f in Q24 */ /* Maximum correlation ratio */ #define RATIO_MAX_FX_Q23 ( 12582912 ) /* 1.5f in Q23 */ /* Maximum correlation ratio */ -#else -#define RATIO_MAX_FX_Q24 ( 2516582 ) /* 1.5f in Q24 */ /* Maximum correlation ratio */ -#define RATIO_MAX_FX_Q23 ( 1258291 ) /* 1.5f in Q23 */ /* Maximum correlation ratio */ -#endif #define LIMIT_ADAP_FAC_FX_Q16 ( 9830 ) /* 0.15f in Q16 */ #define MIN_ADAP_FAC_FX_Q16 ( 6554 ) /*0.1f in Q16*/ #define M_ADAP_FX_Q31 ( 1932735 ) /* 0.0009f in Q31 */ @@ -260,11 +255,7 @@ Word16 stereo_tdm_ener_analysis_fx( rms_thd_fx = L_shr( rms_thd_fx, 2 ); /*Q16*/ /*rms_thd_fx *= 0.25f*/ test(); test(); -#ifdef FIX_1301_CORRECT_TD_CNST IF( LE_32( hStereoTD->tdm_lt_rms_L_fx, 4915200 /* 75 in Q16*/ ) || LE_32( hStereoTD->tdm_lt_rms_R_fx, 4915200 /* 75 in Q16*/ ) /*|| sts[0]->last_coder_type == TRANSITION */ ) -#else - IF( LE_32( hStereoTD->tdm_lt_rms_L_fx, 4915200 /* 75 in Q16*/ ) || LE_32( hStereoTD->tdm_lt_rms_R_fx, 75 /* 75 in Q16*/ ) /*|| sts[0]->last_coder_type == TRANSITION */ ) -#endif { rms_thd_fx = L_shr( rms_thd_fx, 5 ); /* Q16*/ /*rms_thd_fx *= 0.03125f*/ } @@ -338,10 +329,8 @@ Word16 stereo_tdm_ener_analysis_fx( move16(); } -#ifdef FIX_1301_CORRECT_TD_CNST rms_L_fx = L_shl( rms_L_fx, sub( Q16, q_rms_L ) ); /* All the following energy comparison are done in Q16 */ rms_R_fx = L_shl( rms_R_fx, sub( Q16, q_rms_R ) ); -#endif test(); IF( EQ_16( hStereoTD->prev_fr_LRTD_TD_dec, 1 ) && side_can_change == 0 ) { @@ -440,11 +429,7 @@ Word16 stereo_tdm_ener_analysis_fx( ELSE { /*ratio_L = ( 1.0f - cosf( EVS_PI * ratio_L / 2.0f ) ) / 2.0f;*/ -#ifdef FIX_1301_CORRECT_TD_CNST ratio_L_fx = L_deposit_h( sub_sat( ONE_IN_Q14, getCosWord16( extract_l( Mpy_32_32( 1647099 /* EVS_PI/2 in Q20 */, ratio_L_fx ) ) ) ) ); // Q31 (Q14 + Q1(division by 2.0f) + Q16) -#else - ratio_L_fx = L_deposit_h( sub( ONE_IN_Q14, getCosWord16( extract_l( Mpy_32_32( 1647099 /* EVS_PI/2 in Q20 */, ratio_L_fx ) ) ) ) ); // Q31 (Q14 + Q1(division by 2.0f) + Q16) -#endif } test(); @@ -650,22 +635,14 @@ Word16 stereo_tdm_ener_analysis_fx( move16(); } -#ifdef FIX_ISSUE_1125 ratio_L_fx = tdm_ratio_tabl_fx_Q30[idx]; // Q30 -#else - ratio_L_fx = tdm_ratio_tabl_fx[idx]; // Q31 -#endif move32(); test(); IF( EQ_16( hStereoTD->tdm_SM_modi_flag, 1 ) && hStereoTD->tdm_LRTD_flag == 0 ) { idx = shr( add( hStereoTD->tdm_last_ratio_idx, add( LRTD_STEREO_MID_IS_PRIM, 1 ) ), 1 ); -#ifdef FIX_ISSUE_1125 ratio_L_fx = tdm_ratio_tabl_fx_Q30[idx]; // Q30 -#else - ratio_L_fx = tdm_ratio_tabl_fx[idx]; // Q31 -#endif move32(); } @@ -756,10 +733,8 @@ Word16 stereo_tdm_ener_analysis_fx( hCPE->hStereoClassif->ratio_L_fx = ratio_L_fx; /* 31 - ratio_L_e */ move32(); -#ifdef FIX_ISSUE_1125 hCPE->hStereoClassif->ratio_L_e = 1; move16(); -#endif return idx; } @@ -1073,11 +1048,7 @@ static void NOOP_decision_fx( } ELSE { -#ifdef FIX_1301_CORRECT_TD_CNST if ( LT_32( sts[0]->ee_old_fx, 320000 /* 5000.f in Q6 */ ) && LT_32( sts[1]->ee_old_fx, 320000 /* 5000.f in Q6 */ ) ) -#else - if ( LT_32( sts[0]->ee_old_fx, 160000 /* 5000.f in Q6 */ ) && LT_32( sts[1]->ee_old_fx, 160000 /* 5000.f in Q6 */ ) ) -#endif { tdm_NOOP_switch_flag = 1; move16(); diff --git a/lib_enc/ivas_stereo_td_enc_fx.c b/lib_enc/ivas_stereo_td_enc_fx.c index 378068827..8f1d2d9c9 100644 --- a/lib_enc/ivas_stereo_td_enc_fx.c +++ b/lib_enc/ivas_stereo_td_enc_fx.c @@ -336,10 +336,8 @@ ivas_error stereo_set_tdm_fx( } fd_bwe_enc_init_fx( st->hBWE_FD ); -#ifdef MSAN_FIX st->Q_old_wtda = 0; move16(); -#endif } } diff --git a/lib_enc/ivas_tcx_core_enc_fx.c b/lib_enc/ivas_tcx_core_enc_fx.c index eabfe87b4..159012ac2 100644 --- a/lib_enc/ivas_tcx_core_enc_fx.c +++ b/lib_enc/ivas_tcx_core_enc_fx.c @@ -789,7 +789,6 @@ Word16 ivas_acelp_tcx20_switching_fx( L_frame = L_FRAME; move16(); } -#ifdef MSAN_FIX set16_fx( window_fx, 0, L_LOOK_16k ); set16_fx( xn_buf_fx, 0, L_MDCT_OVLP_MAX + L_FRAME_PLUS + L_MDCT_OVLP_MAX ); FOR( i = 0; i < L_LOOK_16k; i++ ) @@ -799,7 +798,6 @@ Word16 ivas_acelp_tcx20_switching_fx( window_p_fx[i].v.im = 0; move16(); } -#endif L_frame_tmp = L_frame; move16(); @@ -854,7 +852,6 @@ Word16 ivas_acelp_tcx20_switching_fx( overlap = st->hTcxCfg->tcx_mdct_window_delay; move16(); -#ifdef MSAN_FIX FOR( i = 0; i < st->hTcxCfg->tcx_mdct_window_length / 2; i++ ) { window_fx[st->hTcxCfg->tcx_mdct_window_length - 1 - i] = st->hTcxCfg->tcx_mdct_window[i].v.re; // Q15 @@ -862,15 +859,6 @@ Word16 ivas_acelp_tcx20_switching_fx( window_fx[i] = st->hTcxCfg->tcx_mdct_window[i].v.im; // Q15 move16(); } -#else - FOR( i = 0; i < L_LOOK_16k / 2; i++ ) - { - window_fx[L_LOOK_16k / 2 - 1 - i] = st->hTcxCfg->tcx_mdct_window[i].v.re; // Q15 - move16(); - window_fx[i] = st->hTcxCfg->tcx_mdct_window[i].v.im; // Q15 - move16(); - } -#endif } ELSE { @@ -1047,12 +1035,8 @@ Word16 ivas_acelp_tcx20_switching_fx( IF( LE_32( offset, 0xAA153 ) ) /* 0xAA153 -> 32.f * log2(10)/10 */ { -#ifdef FIX_USAN_ISSUES offset = (Word32) 0xFFD57AB5; /* 0xFFD57AB5 -> -128.f * log2(10)/10; */ move32(); -#else - offset = L_add( 0xFFD57AB5, 0 ); /* 0xFFD57AB5 -> -128.f * log2(10)/10; */ -#endif } offset_tcx = offset; move32(); @@ -1155,11 +1139,7 @@ Word16 ivas_acelp_tcx20_switching_fx( { *pt_ener_sfr = -668739840; /* 0xFFEC1185 -> log2(1e-6) in 6Q25 */ move32(); -#ifdef FIX_USAN_ISSUES tmp32 = (Word32) 0xFFEC1185; /* 0xFFEC1185 -> log2(1e-6) in 15Q16 */ -#else - tmp32 = 0xFFEC1185; /* 0xFFEC1185 -> log2(1e-6) in 15Q16 */ -#endif move32(); } ELSE diff --git a/lib_enc/ivas_td_low_rate_enc_fx.c b/lib_enc/ivas_td_low_rate_enc_fx.c index c959ef758..63cbb30e9 100644 --- a/lib_enc/ivas_td_low_rate_enc_fx.c +++ b/lib_enc/ivas_td_low_rate_enc_fx.c @@ -221,13 +221,9 @@ void encod_gen_2sbfr( LPD_state_HANDLE hLPDmem = st->hLPDmem; -#ifdef FIX_1320_LOWRATE_ACELP Word16 gcode16; Word32 Lgcode, Ltmp; -#endif -#ifdef MSAN_FIX set16_fx( cn, 0, 2 * L_SUBFR ); /* Target vector in residual domain */ -#endif /*------------------------------------------------------------------* * Initializations @@ -268,11 +264,7 @@ void encod_gen_2sbfr( Copy( &res[i_subfr], &exc[i_subfr], 2 * L_SUBFR ); // Q_new -#ifndef FIX_1320_LOWRATE_ACELP - find_targets_fx( speech, hLPDmem->mem_syn, i_subfr, &hLPDmem->mem_w0, p_Aq, res, 2 * L_SUBFR, p_Aw, st->preemph_fac, xn, cn, h1 ); -#else find_targets_ivas_fx( speech, hLPDmem->mem_syn, i_subfr, &hLPDmem->mem_w0, p_Aq, res, 2 * L_SUBFR, p_Aw, st->preemph_fac, xn, cn, h1 ); -#endif q_h1 = sub( 14, norm_s( h1[0] ) ); Copy_Scale_sig( h1, h2, 2 * L_SUBFR, sub( 11, q_h1 ) ); @@ -298,21 +290,13 @@ void encod_gen_2sbfr( * Gain clipping test to avoid unstable synthesis on frame erasure *-----------------------------------------------------------------*/ -#ifndef FIX_1320_LOWRATE_ACELP - clip_gain = gp_clip_fx( st->element_mode, st->core_brate, st->voicing_fx, i_subfr, coder_type, xn, st->clip_var_fx, Q_new ); // Q0 -#else clip_gain = gp_clip_fx( st->element_mode, st->core_brate, st->voicing_fx, i_subfr, coder_type, xn, st->clip_var_fx, sub( Q_new, 1 ) ); // Q0 -#endif /*-----------------------------------------------------------------* * LP filtering of the adaptive excitation, codebook target computation *-----------------------------------------------------------------*/ Scale_sig( h1, 2 * L_SUBFR, add( 1, shift ) ); /* set h1[] in Q14 with scaling for convolution */ -#ifndef FIX_1320_LOWRATE_ACELP - lp_filt_exc_enc_fx( MODE1, coder_type, i_subfr, exc, h1, xn, y1, xn2, 2 * L_SUBFR, L_frame, g_corr, clip_gain, &gain_pit, &st->acelp_cfg.ltf_mode ); -#else lp_filt_exc_enc_ivas_fx( MODE1, coder_type, i_subfr, exc, h1, xn, y1, xn2, 2 * L_SUBFR, L_frame, g_corr, clip_gain, &gain_pit, &st->acelp_cfg.ltf_mode ); -#endif /* update long-term pitch gain for speech/music classifier */ st->hSpMusClas->lowrate_pitchGain = add( mult( 29491, st->hSpMusClas->lowrate_pitchGain ), mult( 3277 /*Q15*/, gain_pit ) ); // Q14 move16(); @@ -345,22 +329,15 @@ void encod_gen_2sbfr( gp_clip_test_gain_pit_fx( st->element_mode, st->core_brate, gain_pit, st->clip_var_fx ); -#ifndef FIX_1320_LOWRATE_ACELP - hLPDmem->tilt_code = est_tilt_ivas_fx( exc + i_subfr, gain_pit, code, gain_code, &voice_fac, Q_new, 2 * L_SUBFR, 0 ); -#else Lgcode = L_shl_sat( gain_code, Q_new ); /* scaled gain_code with Qnew -> Q16*/ gcode16 = round_fx_sat( Lgcode ); /*Q0*/ hLPDmem->tilt_code = est_tilt_ivas_fx( exc + i_subfr, gain_pit, code, Lgcode, &voice_fac, Q_new, 2 * L_SUBFR, 0 ); /* Q15 */ -#endif move16(); /*-----------------------------------------------------------------* * Update memory of the weighting filter *-----------------------------------------------------------------*/ -#ifndef FIX_1320_LOWRATE_ACELP - hLPDmem->mem_w0 = sub( sub( xn[2 * L_SUBFR - 1], mult_r( gain_pit, y1[2 * L_SUBFR - 1] ) ), mult_r( extract_h( gain_code ), y2[2 * L_SUBFR - 1] ) ); -#else Ltmp = L_mult0( gcode16, y2[2 * L_SUBFR - 1] ); /*Q10*/ Ltmp = L_shl( Ltmp, add( 5, shift ) ); /*Q15+shift*/ Ltmp = L_negate( Ltmp ); @@ -368,7 +345,6 @@ void encod_gen_2sbfr( Ltmp = L_msu( Ltmp, y1[2 * L_SUBFR - 1], gain_pit /*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 */ -#endif move16(); /*-----------------------------------------------------------------* @@ -376,15 +352,6 @@ void encod_gen_2sbfr( * Save the non-enhanced excitation for FEC_exc *-----------------------------------------------------------------*/ -#ifndef FIX_1320_LOWRATE_ACELP - FOR( i = 0; i < 2 * L_SUBFR; i++ ) - { - exc2[i + i_subfr] = mult( gain_pit, exc[i + i_subfr] ); - move16(); - exc[i + i_subfr] = add( exc2[i + i_subfr], mult( extract_h( gain_code ), code[i] ) ); - move16(); - } -#else FOR( i = 0; i < 2 * L_SUBFR; i++ ) { /* code in Q9, gain_pit in Q14 */ @@ -397,7 +364,6 @@ void encod_gen_2sbfr( move16(); move16(); } -#endif /*-----------------------------------------------------------------* * Prepare TBE excitation *-----------------------------------------------------------------*/ @@ -411,11 +377,7 @@ void encod_gen_2sbfr( * Synthesize speech to update mem_syn_flt[]. * Update A(z) filters *-----------------------------------------------------------------*/ -#ifndef FIX_1320_LOWRATE_ACELP - E_UTIL_synthesis( 0, p_Aq, &exc[i_subfr], &syn[i_subfr], 2 * L_SUBFR, hLPDmem->mem_syn, 1, M ); -#else Syn_filt_s( 1, p_Aq, M, &exc[i_subfr], &syn[i_subfr], 2 * L_SUBFR, hLPDmem->mem_syn, 1 ); -#endif p_Aw += 2 * ( M + 1 ); p_Aq += 2 * ( M + 1 ); diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 09e3efc84..877fc2045 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -1166,11 +1166,7 @@ static ivas_error configureEncoder( test(); test(); test(); -#ifdef NONBE_FIX_708_OSBA_BR_SWITCHING_CRASH IF( hEncoderConfig->Opt_PCA_ON && !( ( EQ_16( hEncoderConfig->ivas_format, SBA_FORMAT ) || EQ_16( hEncoderConfig->ivas_format, SBA_ISM_FORMAT ) ) && EQ_32( hEncoderConfig->ivas_total_brate, PCA_BRATE ) && EQ_16( hEncoderConfig->sba_order, SBA_FOA_ORDER ) ) ) -#else - if ( hEncoderConfig->Opt_PCA_ON && !( hEncoderConfig->ivas_format == SBA_FORMAT && hEncoderConfig->ivas_total_brate == PCA_BRATE && hEncoderConfig->sba_order == SBA_FOA_ORDER ) ) -#endif { return IVAS_ERROR( IVAS_ERR_NOT_SUPPORTED_OPTION, "PCA supported at SBA FOA 256 kbps only." ); } diff --git a/lib_enc/nois_est_fx.c b/lib_enc/nois_est_fx.c index 0851e4c17..e59ef07d9 100644 --- a/lib_enc/nois_est_fx.c +++ b/lib_enc/nois_est_fx.c @@ -923,9 +923,7 @@ void noise_est_fx( NOISE_EST_HANDLE hNoiseEst; SP_MUS_CLAS_HANDLE hSpMusClas; hSpMusClas = st_fx->hSpMusClas; -#ifdef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING (void) ( ncharX ); -#endif /* Check if LR-VAD */ { diff --git a/lib_enc/pit_enc_fx.c b/lib_enc/pit_enc_fx.c index bcf7d33bb..b19fb7e56 100644 --- a/lib_enc/pit_enc_fx.c +++ b/lib_enc/pit_enc_fx.c @@ -80,9 +80,7 @@ Word16 pit_encode_fx( /* o : Fractional pitc Word16 pit_flag, delta, mult_Top, nBits; Word16 L_sufr_sft; Word16 T_op[2]; /* values for two half-frames */ -#ifdef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING (void) tdm_Pitch_reuse_flag; -#endif L_sufr_sft = 6; move16(); diff --git a/lib_enc/pre_proc_fx.c b/lib_enc/pre_proc_fx.c index 6844945c0..efecb33ed 100644 --- a/lib_enc/pre_proc_fx.c +++ b/lib_enc/pre_proc_fx.c @@ -1104,11 +1104,7 @@ void pre_proc_fx( test(); test(); test(); -#ifndef CR_2109_to_2112_cd0_ce0 - IF( ( ( ( st->tcxonly == 0 ) || !( st->core_brate != FRAME_NO_DATA || NE_32( st->core_brate, SID_2k40 ) ) ) && EQ_16( st->L_frame, L_FRAME16k ) && EQ_16( st->codec_mode, MODE2 ) ) || ( EQ_16( st->L_frame, L_FRAME16k ) && EQ_16( st->codec_mode, MODE1 ) ) ) -#else IF( ( ( ( st->tcxonly == 0 ) || !( st->core_brate != FRAME_NO_DATA && NE_32( st->core_brate, SID_2k40 ) ) ) && EQ_16( st->L_frame, L_FRAME16k ) && EQ_16( st->codec_mode, MODE2 ) ) || ( EQ_16( st->L_frame, L_FRAME16k ) && EQ_16( st->codec_mode, MODE1 ) ) ) -#endif { /* update signal buffers */ Copy( new_inp_resamp16k, st->buf_speech_enc + L_FRAME16k, L_FRAME16k ); diff --git a/lib_enc/prot_fx_enc.h b/lib_enc/prot_fx_enc.h index 042b5af90..f80373787 100644 --- a/lib_enc/prot_fx_enc.h +++ b/lib_enc/prot_fx_enc.h @@ -178,9 +178,7 @@ void dtx_fx( void dtx_ivas_fx( Encoder_State *st_fx, /* i/o: encoder state structure */ -#ifdef NONBE_1211_DTX_BR_SWITCHING const Word32 last_ivas_total_brate, /* i : last IVAS total bitrate Q0*/ -#endif const Word32 ivas_total_brate, /* i : IVAS total bitrate Q0*/ const Word16 vad, /* i : vad flag for DTX Q0*/ const Word16 speech[], /* i : Pointer to the speech frame Q_speech*/ @@ -1235,9 +1233,7 @@ void AVQ_cod_lpc_fx( void ProcessIGF_ivas_fx( Encoder_State *st, /* i : Encoder state */ -#ifdef MSAN_FIX Word16 powerSpec_len, /* i : length of pPowerSpectrum buffer */ -#endif Word32 *pMDCTSpectrum, /* i : MDCT spectrum */ const Word32 *pITFMDCTSpectrum, /* i : MDCT spectrum fir ITF */ Word16 *q_spectrum, /* i/o: Q of spectrum */ @@ -1553,9 +1549,7 @@ void Mode2_pit_encode_fx( Word16 pit_res_max ); void E_ACELP_4tsearch_fx( Word16 dn[] /*Qdn*/, const Word16 cn[] /*Q_xn*/, const Word16 H[] /*Q12*/, Word16 code[] /*Q9*/, const PulseConfig *config, Word16 ind[] /*Q0*/, Word16 y[] /*Qy*/ ); -#ifdef FIX_ISSUE_1165 void E_ACELP_4tsearch_ivas_fx( Word16 dn[] /*Qdn*/, const Word16 cn[] /*Q_xn*/, const Word16 H[] /*Q12*/, Word16 code[] /*Q9*/, const PulseConfig *config, Word16 ind[] /*Q0*/, Word16 y[] /*Qy*/ ); -#endif void E_ACELP_4t_fx( Word16 dn[], /* Qdn */ @@ -3074,9 +3068,7 @@ void IGFEncApplyMono_fx( const IGF_ENC_INSTANCE_HANDLE hInstance, /**< in: | ); void IGFEncApplyMono_ivas_fx( Encoder_State *st, /* i : Encoder state */ -#ifdef MSAN_FIX Word16 powerSpectrum_len, /* i: length of pPowerSpectrum_fx*/ -#endif const Word16 igfGridIdx, /* i : IGF grid index */ Word32 *pMDCTSpectrum_fx, /* i/o: MDCT spectrum */ Word16 e_mdct, /* i : exponent of pMDCTspectrum */ diff --git a/lib_enc/spec_flatness_fx.c b/lib_enc/spec_flatness_fx.c index c2451886d..d7bd9a6e9 100644 --- a/lib_enc/spec_flatness_fx.c +++ b/lib_enc/spec_flatness_fx.c @@ -221,11 +221,7 @@ void spec_flatness_fx( SFM_Qtmp = sub( SFM_Qtmp, SPEC_AMP_Q ); SFM_Qtmp = sub( SFM_Qtmp, SFM_Q ); -#ifdef FIX_ISSUE_1209 sSFM[1] = add_sat( mult( sSFM[1], 0x6ccc ), shr( mult( SFM, 0x1333 ), SFM_Qtmp ) ); -#else - sSFM[1] = add( mult( sSFM[1], 0x6ccc ), shr( mult( SFM, 0x1333 ), SFM_Qtmp ) ); -#endif move16(); /*sSFM3*/ diff --git a/lib_enc/speech_music_classif_fx.c b/lib_enc/speech_music_classif_fx.c index e04f5172b..ff9e2d936 100644 --- a/lib_enc/speech_music_classif_fx.c +++ b/lib_enc/speech_music_classif_fx.c @@ -890,20 +890,12 @@ 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 ps_sta = L_add_sat( ps_sta, L_tmp ); /*Q16 */ -#else - ps_sta = L_add( ps_sta, L_tmp ); /*Q16 */ -#endif } } /**pFV++ = (float)log(ps_sta + 1e-5f);*/ -#ifdef FIX_ISSUE_1151 ps_sta = L_add_sat( ps_sta, 336 ); -#else - ps_sta = L_add( ps_sta, 336 ); -#endif e_tmp = norm_l( ps_sta ); f_tmp = Log2_norm_lc( L_shl( ps_sta, e_tmp ) ); e_tmp = sub( 30 - 16, e_tmp ); @@ -1617,16 +1609,8 @@ Word16 ivas_smc_gmm_fx( Word16 flag_odv; Word32 lps_fx, lpm_fx, lpn_fx; Word32 ps_fx[N_SMC_MIXTURES], pm_fx[N_SMC_MIXTURES], pn_fx[N_SMC_MIXTURES]; -#ifndef DOT_PROD_CHOLESKY_64BIT - Word32 lprob_fx; - Word16 lprob_exp = 0; -#else Word64 wprob_fx; -#endif Word32 fvm_fx[N_PCA_COEF]; -#ifndef DOT_PROD_CHOLESKY_64BIT - Word16 fvm_exp = 0; -#endif Word32 sum_PS_fx, ps_diff_fx, ps_sta_fx; Word32 dlp_fx, wrelE_fx, wdrop_fx, wght_fx; Word32 wrise_fx; @@ -2213,38 +2197,16 @@ Word16 ivas_smc_gmm_fx( FOR( m = 0; m < N_SMC_MIXTURES; m++ ) { v_sub32_fx( FV_fx, &means_speech_fx[m * N_PCA_COEF], fvm_fx, N_PCA_COEF ); -#ifndef DOT_PROD_CHOLESKY_64BIT - fvm_exp = sub( 31, Qfact_FV ); - lprob_exp = 0; - move16(); - lprob_fx = dot_product_cholesky_fixed( fvm_fx, &prec_chol_speech_fx[m * ( N_PCA_COEF * N_PCA_COEF + N_PCA_COEF ) / 2], N_PCA_COEF, fvm_exp, 31 - 28, &lprob_exp ); - ps_fx[m] = L_sub( L_sub( L_add( log_weights_speech_compute[m], log_det_chol_speech_fx[m] ), L_shl( lprob_fx, sub( Q18 - 1, sub( Q31, lprob_exp ) ) ) ), HALF_N_PCA_COEF_LOG_P12_Q18 ); // Q18 -#else wprob_fx = dot_product_cholesky_fixed( fvm_fx, &prec_chol_speech_fx[m * ( N_PCA_COEF * N_PCA_COEF + N_PCA_COEF ) / 2], N_PCA_COEF ); // Q10 ps_fx[m] = L_sub( L_sub( L_add( log_weights_speech_compute[m], log_det_chol_speech_fx[m] ), W_extract_l( W_shr( wprob_fx, Q10 ) ) ), HALF_N_PCA_COEF_LOG_P12_Q18 ); // Q18 -#endif move32(); v_sub32_fx( FV_fx, &means_music_fx[m * N_PCA_COEF], fvm_fx, N_PCA_COEF ); -#ifndef DOT_PROD_CHOLESKY_64BIT - lprob_exp = 0; - move16(); - lprob_fx = dot_product_cholesky_fixed( fvm_fx, &prec_chol_music_fx[m * ( N_PCA_COEF * N_PCA_COEF + N_PCA_COEF ) / 2], N_PCA_COEF, fvm_exp, 31 - 28, &lprob_exp ); - pm_fx[m] = L_sub( L_sub( L_add( log_weights_music_compute[m], log_det_chol_music_fx[m] ), L_shl( lprob_fx, sub( Q18 - 1, sub( Q31, lprob_exp ) ) ) ), HALF_N_PCA_COEF_LOG_P12_Q18 ); // Q18 -#else wprob_fx = dot_product_cholesky_fixed( fvm_fx, &prec_chol_music_fx[m * ( N_PCA_COEF * N_PCA_COEF + N_PCA_COEF ) / 2], N_PCA_COEF ); // Q10 pm_fx[m] = L_sub( L_sub( L_add( log_weights_music_compute[m], log_det_chol_music_fx[m] ), W_extract_l( W_shr( wprob_fx, Q10 ) ) ), HALF_N_PCA_COEF_LOG_P12_Q18 ); // Q18 -#endif move32(); v_sub32_fx( FV_fx, &means_noise_fx[m * N_PCA_COEF], fvm_fx, N_PCA_COEF ); -#ifndef DOT_PROD_CHOLESKY_64BIT - lprob_exp = 0; - move16(); - lprob_fx = dot_product_cholesky_fixed( fvm_fx, &prec_chol_noise_fx[m * ( N_PCA_COEF * N_PCA_COEF + N_PCA_COEF ) / 2], N_PCA_COEF, fvm_exp, 31 - 28, &lprob_exp ); - pn_fx[m] = L_sub( L_sub( L_add( log_weights_noise_compute[m], log_det_chol_noise_fx[m] ), L_shl( lprob_fx, sub( Q18 - 1, sub( Q31, lprob_exp ) ) ) ), HALF_N_PCA_COEF_LOG_P12_Q18 ); // Q18 -#else wprob_fx = dot_product_cholesky_fixed( fvm_fx, &prec_chol_noise_fx[m * ( N_PCA_COEF * N_PCA_COEF + N_PCA_COEF ) / 2], N_PCA_COEF ); // Q10 pn_fx[m] = L_sub( L_sub( L_add( log_weights_noise_compute[m], log_det_chol_noise_fx[m] ), W_extract_l( W_shr( wprob_fx, Q10 ) ) ), HALF_N_PCA_COEF_LOG_P12_Q18 ); // Q18 -#endif move32(); } @@ -2258,21 +2220,12 @@ Word16 ivas_smc_gmm_fx( *high_lpn_flag = 1; move32(); } -#ifndef FIX_1297_OVERFLOW - hSpMusClas->lpm_fx = extract_l( L_shr( lpm_fx, 11 ) ); // Q7 - move16(); - hSpMusClas->lps_fx = extract_l( L_shr( lps_fx, 11 ) ); // Q7 - move16(); - hSpMusClas->lpn_fx = extract_l( L_shr( lpn_fx, 11 ) ); // Q7 - move16(); -#else hSpMusClas->lpm_fx = extract_h( L_shl_sat( lpm_fx, 16 - 11 ) ); // Q7 move16(); hSpMusClas->lps_fx = extract_h( L_shl_sat( lps_fx, 16 - 11 ) ); // Q7 move16(); hSpMusClas->lpn_fx = extract_h( L_shl_sat( lpn_fx, 16 - 11 ) ); // Q7 move16(); -#endif /* determine HQ Generic speech class */ IF( st->hHQ_core != NULL ) { diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index 7ca996af5..64ab13ea2 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -701,9 +701,6 @@ typedef struct sp_mus_clas_structure typedef struct lpd_state_structure { -#ifndef MSAN_FIX - Word16 nbits; /* number of bits used by ACELP or TCX */ -#endif /* signal memory */ Word16 syn[1 + M]; /* Synthesis memory (non-pe) */ @@ -1012,9 +1009,7 @@ typedef struct td_bwe_enc_structure typedef struct fd_bwe_enc_structure { Word16 new_input_hp_fx[NS2SA( 16000, ACELP_LOOK_NS + DELAY_FD_BWE_ENC_NS + DELAY_FIR_RESAMPL_NS - DELAY_CLDFB_NS )]; // Q_new_input_hp -#ifdef FIX_ISSUE_1230 Word16 Q_new_input_hp; -#endif Word16 old_input_fx[NS2SA( 48000, DELAY_FD_BWE_ENC_NS + DELAY_FIR_RESAMPL_NS )]; // q0 Word16 old_input_wb_fx[NS2SA( 16000, DELAY_FD_BWE_ENC_NS )]; /* Q(-1) */ Word16 old_input_lp_fx[NS2SA( 16000, ACELP_LOOK_NS + DELAY_FD_BWE_ENC_NS )]; // st->hBWE_FD->prev_Q_input_lp diff --git a/lib_enc/swb_bwe_enc_fx.c b/lib_enc/swb_bwe_enc_fx.c index e0d846458..26c8382ca 100644 --- a/lib_enc/swb_bwe_enc_fx.c +++ b/lib_enc/swb_bwe_enc_fx.c @@ -307,9 +307,7 @@ void swb_bwe_enc_ivas_fx( move32(); #endif Word16 fb_band_begin; -#ifdef FIX_ISSUE_1230 Word16 q_new_input_hp; -#endif FD_BWE_ENC_HANDLE hBWE_FD = st_fx->hBWE_FD; TD_BWE_ENC_HANDLE hBWE_TD = st_fx->hBWE_TD; @@ -385,7 +383,6 @@ void swb_bwe_enc_ivas_fx( Copy( old_input_16k_fx + L_INP_MEM + L_FRAME16k - Sample_Delay_LP, hBWE_FD->old_input_lp_fx, Sample_Delay_LP ); } -#ifdef FIX_ISSUE_1230 q_new_input_hp = s_min( Q_shb_speech, hBWE_FD->Q_new_input_hp ); IF( LT_16( Q_shb_speech, hBWE_FD->Q_new_input_hp ) ) { @@ -400,10 +397,6 @@ void swb_bwe_enc_ivas_fx( hBWE_FD->Q_new_input_hp = Q_shb_speech; move16(); -#else - Copy( hBWE_FD->new_input_hp_fx, new_input_hp_fx, Sample_Delay_HP ); - Copy( shb_speech_fx, &new_input_hp_fx[Sample_Delay_HP], L_FRAME16k - Sample_Delay_HP ); -#endif Copy( shb_speech_fx + L_FRAME16k - Sample_Delay_HP, hBWE_FD->new_input_hp_fx, Sample_Delay_HP ); new_input_fx = old_input_fx + Sample_Delay_SWB_BWE; Copy( hBWE_FD->old_input_fx, old_input_fx, Sample_Delay_SWB_BWE ); @@ -513,11 +506,7 @@ void swb_bwe_enc_ivas_fx( { Q_shb = sub( Q_synth_hf, 4 ); } -#ifdef FIX_ISSUE_1230 Copy_Scale_sig( new_input_hp_fx, new_input_hp_fx, L_FRAME16k, sub( Q_shb, q_new_input_hp ) ); -#else - Copy_Scale_sig( new_input_hp_fx, new_input_hp_fx, L_FRAME16k, sub( Q_shb, Q_shb_speech ) ); -#endif /* FB BWE encoding */ IF( EQ_16( st_fx->extl, FB_BWE ) ) @@ -3229,11 +3218,7 @@ static Word16 SWB_BWE_encoding_ivas_fx( expn = sub( sub( 30, expn ), sub( shl( Q_insig_lp, 1 ), 7 ) ); expd = norm_l( WB_tenv_syn_fx ); -#ifdef FIX_ISSUE_1156 den = round_fx_o( L_shl( WB_tenv_syn_fx, expd ), &Overflow ); -#else - den = round_fx( L_shl( WB_tenv_syn_fx, expd ) ); -#endif expd = sub( sub( 30, expd ), sub( shl( Q_insig_lp, 1 ), 7 ) ); scale = shr( sub( den, num ), 15 ); @@ -4145,17 +4130,11 @@ void fd_bwe_enc_init_fx( ) { set16_fx( hBWE_FD->new_input_hp_fx, 0, NS2SA( 16000, ACELP_LOOK_NS + DELAY_FD_BWE_ENC_12k8_NS + DELAY_FIR_RESAMPL_NS - DELAY_CLDFB_NS ) ); -#ifdef FIX_ISSUE_1230 hBWE_FD->Q_new_input_hp = 0; move16(); -#endif set16_fx( hBWE_FD->old_input_fx, 0, NS2SA( 48000, DELAY_FD_BWE_ENC_12k8_NS + DELAY_FIR_RESAMPL_NS ) ); set16_fx( hBWE_FD->old_input_wb_fx, 0, NS2SA( 16000, DELAY_FD_BWE_ENC_12k8_NS ) ); -#ifndef MSAN_FIX - set16_fx( hBWE_FD->old_input_lp_fx, 0, NS2SA( 16000, ACELP_LOOK_NS + DELAY_SWB_TBE_16k_NS ) ); -#else set16_fx( hBWE_FD->old_input_lp_fx, 0, NS2SA( 16000, ACELP_LOOK_NS + DELAY_FD_BWE_ENC_NS ) ); -#endif set16_fx( hBWE_FD->old_syn_12k8_16k_fx, 0, NS2SA( 16000, DELAY_FD_BWE_ENC_NS ) ); hBWE_FD->prev_mode = NORMAL; move16(); diff --git a/lib_enc/swb_pre_proc_fx.c b/lib_enc/swb_pre_proc_fx.c index b73b0f992..c49c32e03 100644 --- a/lib_enc/swb_pre_proc_fx.c +++ b/lib_enc/swb_pre_proc_fx.c @@ -1263,11 +1263,7 @@ void swb_pre_proc_ivas_fx( thr = icbwe_thr_TDM_fx; regV = icbwe_regressionValuesTDM_fx; -#ifdef OPT_SBA_AVOID_SPAR_RESCALE cldfbSynthesis_ivas_fx( realBufferFlipped, imagBufferFlipped, shb_speech_fx_32, -1, 0, st->cldfbSynTd ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - cldfbSynthesis_ivas_fx( realBufferFlipped, imagBufferFlipped, shb_speech_fx_32, -1, st->cldfbSynTd ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ Copy_Scale_sig_32_16( shb_speech_fx_32, shb_speech, L_FRAME16k, negate( sub( q_reImBuffer, 1 ) ) ); *Q_shb_spch = 0; move16(); diff --git a/lib_enc/swb_tbe_enc_fx.c b/lib_enc/swb_tbe_enc_fx.c index 9b4f15dc5..2b8f487bd 100644 --- a/lib_enc/swb_tbe_enc_fx.c +++ b/lib_enc/swb_tbe_enc_fx.c @@ -1391,11 +1391,7 @@ void wb_tbe_enc_ivas_fx( move32(); } -#ifdef FIX_ISSUE_1165 lpc2lsp_ivas_fx( &lpc_wb_32_fx[1], lsp_wb_temp_fx, st_fx->prev_lsp_wb_temp_fx, LPC_SHB_ORDER_WB ); -#else - lpc2lsp_fx( &lpc_wb_32_fx[1], lsp_wb_temp_fx, st_fx->prev_lsp_wb_temp_fx, LPC_SHB_ORDER_WB ); -#endif FOR( i = 0; i < LPC_SHB_ORDER_WB; i++ ) { diff --git a/lib_enc/tcx_ltp_enc_fx.c b/lib_enc/tcx_ltp_enc_fx.c index 19afa8243..25a3bdee7 100644 --- a/lib_enc/tcx_ltp_enc_fx.c +++ b/lib_enc/tcx_ltp_enc_fx.c @@ -536,11 +536,7 @@ static void tcx_ltp_find_gain( Word16 *speech, Word16 *pred_speech, Word16 L_fra BASOP_SATURATE_WARNING_ON_EVS /* Quantize gain */ -#ifdef FIX_ISSUE_1150 g = shr( sub_o( g, 0x1000, &Overflow ), 13 ); -#else - g = shr( sub( g, 0x1000 ), 13 ); -#endif g = s_max( g, -1 ); *gain_index = g; diff --git a/lib_enc/tcx_utils_enc_fx.c b/lib_enc/tcx_utils_enc_fx.c index ce7f0e6a6..c84843384 100644 --- a/lib_enc/tcx_utils_enc_fx.c +++ b/lib_enc/tcx_utils_enc_fx.c @@ -3785,9 +3785,7 @@ void attenuateNbSpectrum_fx( Word16 L_frame, Word32 *spectrum ) *---------------------------------------------------------------------*/ void ProcessIGF_ivas_fx( Encoder_State *st, /* i : Encoder state */ -#ifdef MSAN_FIX Word16 powerSpec_len, /* i : length of pPowerSpectrum buffer */ -#endif Word32 *pMDCTSpectrum, /* i : MDCT spectrum (*q_spectrum) */ const Word32 *pITFMDCTSpectrum, /* i : MDCT spectrum fir ITF */ Word16 *q_spectrum, /* i/o: Q of spectrum */ @@ -3834,11 +3832,7 @@ void ProcessIGF_ivas_fx( IGFSaveSpectrumForITF_ivas_fx( hIGFEnc, igfGridIdx, pITFMDCTSpectrum, sub( Q31, *q_spectrum ) ); -#ifndef MSAN_FIX - IGFEncApplyMono_ivas_fx( st, igfGridIdx, pMDCTSpectrum, sub( Q31, *q_spectrum ), pPowerSpectrum, exp_powerSpec, isTCX20, st->hTcxEnc->fUseTns[frameno], sp_aud_decision0, vad_hover_flag ); -#else IGFEncApplyMono_ivas_fx( st, powerSpec_len, igfGridIdx, pMDCTSpectrum, sub( Q31, *q_spectrum ), pPowerSpectrum, exp_powerSpec, isTCX20, st->hTcxEnc->fUseTns[frameno], sp_aud_decision0, vad_hover_flag ); -#endif curr_order = 0; move16(); diff --git a/lib_enc/tns_base_enc_fx.c b/lib_enc/tns_base_enc_fx.c index cf6e5dd64..05b35813a 100644 --- a/lib_enc/tns_base_enc_fx.c +++ b/lib_enc/tns_base_enc_fx.c @@ -229,11 +229,7 @@ Word16 DetectTnsFilt_fx( STnsConfig const *pTnsConfig, assert( n < (Word16) ( sizeof( tmpbuf ) / sizeof( Word16 ) ) ); FOR( i = 0; i < n; i++ ) { -#ifdef FIX_ISSUE_1147 tmpbuf[i] = round_fx_sat( L_shl( pSpectrum[iStartLine + i], shift ) ); -#else - tmpbuf[i] = round_fx( L_shl( pSpectrum[iStartLine + i], shift ) ); -#endif move16(); } diff --git a/lib_enc/transient_detection_fx.c b/lib_enc/transient_detection_fx.c index 44bd8cc3c..92f01b5dd 100644 --- a/lib_enc/transient_detection_fx.c +++ b/lib_enc/transient_detection_fx.c @@ -678,18 +678,13 @@ void RunTransientDetection_ivas_fx( IF( GT_16( sub( q_input, pSubblockEnergies->q_firState ), shift ) ) { Scale_sig( input_fx, length, add( sub( pSubblockEnergies->q_firState, q_input ), shift ) ); // q_firState + shift -#ifdef FIX_ISSUE_1186 q_input = add( pSubblockEnergies->q_firState, shift ); // q_firState + shift -#endif pSubblockEnergies->firState1 = shl( pSubblockEnergies->firState1, shift ); // q_firState + shift move16(); pSubblockEnergies->firState2 = shl( pSubblockEnergies->firState2, shift ); // q_firState + shift move16(); pSubblockEnergies->q_firState = add( pSubblockEnergies->q_firState, shift ); // q_firState + shift move16(); -#ifndef FIX_ISSUE_1186 - q_input = add( pSubblockEnergies->q_firState, shift ); // q_firState + shift -#endif } ELSE { @@ -715,11 +710,7 @@ void RunTransientDetection_ivas_fx( } /* Update subblock energies. */ -#ifdef MSAN_FIX Scale_sig( filteredInput_fx, length, sub( 0, q_input ) ); // q0 -#else - Scale_sig( filteredInput_fx, L_FRAME_MAX, 8 ); -#endif UpdateSubblockEnergies_ivas_fx( filteredInput_fx, length, pSubblockEnergies ); /* Run transient detectors. */ diff --git a/lib_enc/transition_enc_fx.c b/lib_enc/transition_enc_fx.c index 9911d766a..7fe813d12 100644 --- a/lib_enc/transition_enc_fx.c +++ b/lib_enc/transition_enc_fx.c @@ -213,11 +213,7 @@ void transition_enc_fx( { /* this is called only to compute unused bits */ config_acelp1( ENC, st_fx->total_brate, st_fx->core_brate, st_fx->core, st_fx->extl, st_fx->extl_brate, -#ifdef NONBE_FIX_GSC_BSTR L_FRAME, -1, &( st_fx->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, TC_0_0, 3, NULL, unbits_ACELP, -#else - L_FRAME, -1, &( st_fx->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, TC_0_0, 3, NULL, unbits_ACELP, -#endif st_fx->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st_fx->idchan, st_fx->active_fr_cnt_fx, 0 /*tdm_Pitch_reuse_flag*/, st_fx->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); } @@ -329,11 +325,7 @@ void transition_enc_fx( IF( LE_16( sub( i_subfr, *tc_subfr ), L_SUBFR ) ) { config_acelp1( ENC, st_fx->total_brate, st_fx->core_brate, st_fx->core, st_fx->extl, st_fx->extl_brate, -#ifdef NONBE_FIX_GSC_BSTR st_fx->L_frame, -1, &( st_fx->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, *tc_subfr, 2, NULL, -#else - st_fx->L_frame, -1, &( st_fx->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, *tc_subfr, 2, NULL, -#endif unbits_ACELP, st_fx->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st_fx->idchan, st_fx->active_fr_cnt_fx, 0 /*tdm_Pitch_reuse_flag*/, st_fx->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); } /*-----------------------------------------------------------------* @@ -1042,11 +1034,7 @@ void transition_enc_ivas_fx( { /* this is called only to compute unused bits */ config_acelp1( ENC, st_fx->total_brate, st_fx->core_brate, st_fx->core, st_fx->extl, st_fx->extl_brate, -#ifdef NONBE_FIX_GSC_BSTR L_FRAME, -1, &( st_fx->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, TC_0_0, 3, NULL, unbits_ACELP, -#else - L_FRAME, -1, &( st_fx->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, TC_0_0, 3, NULL, unbits_ACELP, -#endif st_fx->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st_fx->idchan, st_fx->active_fr_cnt_fx, 0 /*tdm_Pitch_reuse_flag*/, st_fx->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); } @@ -1158,11 +1146,7 @@ void transition_enc_ivas_fx( IF( LE_16( sub( i_subfr, *tc_subfr ), L_SUBFR ) ) { config_acelp1( ENC, st_fx->total_brate, st_fx->core_brate, st_fx->core, st_fx->extl, st_fx->extl_brate, -#ifdef NONBE_FIX_GSC_BSTR st_fx->L_frame, -1, &( st_fx->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, *tc_subfr, 2, NULL, -#else - st_fx->L_frame, -1, &( st_fx->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, *tc_subfr, 2, NULL, -#endif unbits_ACELP, st_fx->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st_fx->idchan, st_fx->active_fr_cnt_fx, 0 /*tdm_Pitch_reuse_flag*/, st_fx->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); } /*-----------------------------------------------------------------* diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index be86281ef..fb3a89350 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -72,10 +72,8 @@ Word16 slot_fx[4] = { 32767, 16384, 10922, 8192 }; #define INV_TAN30_FX 28377 // Q14 #define EPSILON_MANT 1180591621 /* 1e-12 = 0.5497558*(2^-39) in Q70 */ #define EPSILON_EXP ( -39 ) -#ifdef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC #define ONE_DIV_EPSILON_MANT 1953125000 /* 1e+12 = 0.9094947*(2^40) */ #define ONE_DIV_EPSILON_EXP ( 40 ) -#endif #define ADAPT_HTPROTO_ROT_LIM_1 0.8f #define MAX_GAIN_CACHE_SIZE ( ( MASA_MAXIMUM_DIRECTIONS * 3 ) + MAX_NUM_OBJECTS ) /* == different calls to get gains */ @@ -135,10 +133,8 @@ static void matrixTransp2Mul_fx( Word32 Bre[BINAURAL_CHANNELS][BINAURAL_CHANNELS] /*q_B*/, Word32 Bim[BINAURAL_CHANNELS][BINAURAL_CHANNELS] /*q_B*/, Word16 *q_B, -#ifdef FIX_1072_SPEEDUP_matrixTransp2Mul_fx Word32 Ascale, Word32 Bscale, -#endif Word32 outRe[BINAURAL_CHANNELS][BINAURAL_CHANNELS] /*q_out*/, Word32 outIm[BINAURAL_CHANNELS][BINAURAL_CHANNELS] /*q_out*/, Word16 *q_out ); @@ -813,12 +809,9 @@ static void ivas_dirac_dec_binaural_internal_fx( IF( hDiracDecBin->useTdDecorr ) { -#ifdef FIX_ISSUE_1185 Word32 tmp_arr[60]; -#endif FOR( ch = BINAURAL_CHANNELS; ch < ( 2 * BINAURAL_CHANNELS ); ch++ ) { -#ifdef FIX_ISSUE_1185 q_cldfb[ch][slot] = sub( q_input, 1 ); move16(); @@ -836,15 +829,6 @@ static void ivas_dirac_dec_binaural_internal_fx( scale_sig32( st_ivas->cldfbAnaDec[ch]->cldfb_state_fx, sub( st_ivas->cldfbAnaDec[ch]->p_filter_length, st_ivas->cldfbAnaDec[ch]->no_channels ), sub( q_input, st_ivas->cldfbAnaDec[ch]->Q_cldfb_state ) ); st_ivas->cldfbAnaDec[ch]->Q_cldfb_state = q_input; move16(); -#else - q_cldfb[ch][slot] = q_input; - move16(); - cldfbAnalysis_ts_fx_fixed_q( - &( st_ivas->hTcBuffer->tc_fx[ch][nBins * slot + offsetSamples] ), - Cldfb_RealBuffer_in_fx[ch][slot], - Cldfb_ImagBuffer_in_fx[ch][slot], - nBins, st_ivas->cldfbAnaDec[ch], &q_cldfb[ch][slot] ); -#endif /*FIX_ISSUE_1185*/ test(); test(); @@ -886,10 +870,8 @@ static void ivas_dirac_dec_binaural_internal_fx( { scale_sig32( Cldfb_RealBuffer_in_fx[cha][slot], 60, sub( q_inp, q_cldfb[cha][slot] ) ); // Q6 scale_sig32( Cldfb_ImagBuffer_in_fx[cha][slot], 60, sub( q_inp, q_cldfb[cha][slot] ) ); // Q6 -#ifdef FIX_ISSUE_1185 q_cldfb[cha][slot] = 6; move16(); -#endif } } @@ -1983,10 +1965,8 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( matrixMul_fx( Mre_fx, Mim_fx, &q_M, CxRe_fx, CxIm_fx, &q_Cx, tmpMtxRe_fx, tmpMtxIm_fx, &q_tmp ); matrixTransp2Mul_fx( tmpMtxRe_fx, tmpMtxIm_fx, &q_tmp, Mre_fx, Mim_fx, &q_M, -#ifdef FIX_1072_SPEEDUP_matrixTransp2Mul_fx 1 /*int Ascale*/, 0 /*int Bscale*/, -#endif resultMtxRe_fx, resultMtxIm_fx, &q_res ); /* When below the frequency limit where decorrelation is applied, we inject the decorrelated @@ -2151,23 +2131,12 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( tmp1 = BASOP_Util_Add_Mant32Exp( tmp2, sub( 31, q_tmp2 ), missingOutputEne_fx, sub( 31, q_missingOutputEne ), &exp1 ); -#ifdef FIX_1326_SUBSTITUTE_DIV_SQRT_IOSQRT { tmp2 = BASOP_Util_Add_Mant32Exp( tmp2, sub( 31, q_tmp2 ), EPSILON_MANT, EPSILON_EXP, &exp2 ); tmp2 = ISqrt32( tmp2, &exp2 ); gain_fx = Mpy_32_32( tmp2, Sqrt32( tmp1, &exp1 ) ); q_gain = sub( 31, add( exp2, exp1 ) ); } -#else - { - Word16 exp_temp; - tmp2 = BASOP_Util_Add_Mant32Exp( tmp2, sub( 31, q_tmp2 ), EPSILON_MANT, EPSILON_EXP, &exp_temp ); - tmp2 = BASOP_Util_Divide3232_Scale_cadence( tmp1, tmp2, &exp ); - exp2 = add( exp, sub( exp1, exp_temp ) ); - } - gain_fx = Sqrt32( tmp2, &exp2 ); - q_gain = sub( 31, exp2 ); -#endif // 1073741824 = 4 in Q28 @@ -2610,11 +2579,7 @@ static void ivas_dirac_dec_binaural_process_output_fx( outSlotRePr_fx = &( outSlotRe_fx[0] ); outSlotImPr_fx = &( outSlotIm_fx[0] ); -#ifdef OPT_SBA_AVOID_SPAR_RESCALE cldfbSynthesis_ivas_fx( &outSlotRePr_fx, &outSlotImPr_fx, &( output_fx[chA][nBins * slot + offsetSamples] ), nBins, 0, cldfbSynDec[chA] ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - cldfbSynthesis_ivas_fx( &outSlotRePr_fx, &outSlotImPr_fx, &( output_fx[chA][nBins * slot + offsetSamples] ), nBins, cldfbSynDec[chA] ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ cldfbSynDec[chA]->Q_cldfb_state = sub( q_result, 1 ); move16(); } @@ -3260,7 +3225,6 @@ static void eig2x2_fx( /* Numeric case, when input is practically zeros */ // IF( D_fx[0] < EPSILON_FX ) -#ifdef FIX_1326_SUBSTITUTE_CMPMANT32EXP IF( LT_32( L_shl_sat( D_fx[0], sub( sub( 31, *q_D ), EPSILON_EXP ) ), EPSILON_MANT ) ) { Ure_fx[0][0] = ONE_IN_Q31; @@ -3272,19 +3236,6 @@ static void eig2x2_fx( return; } -#else - IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( D_fx[0], *q_D, EPSILON_MANT, EPSILON_EXP ), -1 ) ) - { - Ure_fx[0][0] = ONE_IN_Q31; - move32(); - Ure_fx[1][1] = ONE_IN_Q31; - move32(); - *q_U = Q31; - move16(); - - return; - } -#endif /* Numeric case, when input is near an identity matrix with a gain */ tmp1 = Mpy_32_32( 2147484, add_fx ); // 2147484 = 1e-3f in Q31 @@ -3493,7 +3444,6 @@ static void eig2x2_fx( move16(); } } -#ifdef FIX_1326_SPEEDUP_eig2x2_fx if ( q_U_1 != 0 ) { *q_U = q_U_1; @@ -3505,17 +3455,6 @@ static void eig2x2_fx( *q_U = q_U_2; move16(); } -#else - IF( q_U_1 != 0 ) - { - *q_U = q_U_1; - } - ELSE - { - *q_U = q_U_2; - } - move16(); -#endif return; } @@ -3570,11 +3509,6 @@ static void matrixMul_fx( Word16 chA, chB; Word16 min_q_shift1, min_q_shift2; Word16 size = i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ); -#ifndef FIX_1113_OPT_DIRAC_BIN_REND -#ifndef IVAS_ENH64_CADENCE_CHANGES - Word32 tmp1, tmp2; -#endif -#endif min_q_shift1 = sub( s_min( L_norm_arr( Are_fx[0], size ), L_norm_arr( Aim_fx[0], size ) ), 1 ); min_q_shift2 = sub( s_min( L_norm_arr( Bre_fx[0], size ), L_norm_arr( Bim_fx[0], size ) ), 1 ); @@ -3603,7 +3537,6 @@ static void matrixMul_fx( outIm_fx[chA][chB] = L_add( outIm_fx[chA][chB], W_extract_h( W_mac_32_32( W_mult_32_32( Are_fx[chA][0], Bim_fx[0][chB] ), Are_fx[chA][1], Bim_fx[1][chB] ) ) ); move32(); #else -#ifdef FIX_1113_OPT_DIRAC_BIN_REND outRe_fx[chA][chB] = Msub_32_32( Msub_32_32( Madd_32_32( Mpy_32_32( Are_fx[chA][0], Bre_fx[0][chB] ), Are_fx[chA][1], Bre_fx[1][chB] ), Aim_fx[chA][0], Bim_fx[0][chB] ), @@ -3614,106 +3547,6 @@ static void matrixMul_fx( Are_fx[chA][0], Bim_fx[0][chB] ), Are_fx[chA][1], Bim_fx[1][chB] ); move32(); -#else - test(); - test(); - test(); - IF( ( Are_fx[chA][0] >= 0 && Bre_fx[0][chB] >= 0 ) || ( Are_fx[chA][0] < 0 && Bre_fx[0][chB] < 0 ) ) - { - tmp1 = Mpy_32_32( Are_fx[chA][0], Bre_fx[0][chB] ); - } - ELSE - { - tmp1 = L_negate( Mpy_32_32( L_abs( Are_fx[chA][0] ), L_abs( Bre_fx[0][chB] ) ) ); - } - test(); - test(); - test(); - IF( ( Are_fx[chA][1] >= 0 && Bre_fx[1][chB] >= 0 ) || ( Are_fx[chA][1] < 0 && Bre_fx[1][chB] < 0 ) ) - { - tmp2 = Mpy_32_32( Are_fx[chA][1], Bre_fx[1][chB] ); - } - ELSE - { - tmp2 = L_negate( Mpy_32_32( L_abs( Are_fx[chA][1] ), L_abs( Bre_fx[1][chB] ) ) ); - } - outRe_fx[chA][chB] = L_add( tmp1, tmp2 ); - move32(); - - test(); - test(); - test(); - IF( ( Aim_fx[chA][0] >= 0 && Bim_fx[0][chB] >= 0 ) || ( Aim_fx[chA][0] < 0 && Bim_fx[0][chB] < 0 ) ) - { - tmp1 = Mpy_32_32( Aim_fx[chA][0], Bim_fx[0][chB] ); - } - ELSE - { - tmp1 = L_negate( Mpy_32_32( L_abs( Aim_fx[chA][0] ), L_abs( Bim_fx[0][chB] ) ) ); - } - test(); - test(); - test(); - IF( ( Aim_fx[chA][1] >= 0 && Bim_fx[1][chB] >= 0 ) || ( Aim_fx[chA][1] < 0 && Bim_fx[1][chB] < 0 ) ) - { - tmp2 = Mpy_32_32( Aim_fx[chA][1], Bim_fx[1][chB] ); - } - ELSE - { - tmp2 = L_negate( Mpy_32_32( L_abs( Aim_fx[chA][1] ), L_abs( Bim_fx[1][chB] ) ) ); - } - outRe_fx[chA][chB] = L_sub( outRe_fx[chA][chB], L_add( tmp1, tmp2 ) ); - move32(); - test(); - test(); - test(); - IF( ( Aim_fx[chA][0] >= 0 && Bre_fx[0][chB] >= 0 ) || ( Aim_fx[chA][0] < 0 && Bre_fx[0][chB] < 0 ) ) - { - tmp1 = Mpy_32_32( Aim_fx[chA][0], Bre_fx[0][chB] ); - } - ELSE - { - tmp1 = L_negate( Mpy_32_32( L_abs( Aim_fx[chA][0] ), L_abs( Bre_fx[0][chB] ) ) ); - } - test(); - test(); - test(); - IF( ( Aim_fx[chA][1] >= 0 && Bre_fx[1][chB] >= 0 ) || ( Aim_fx[chA][1] < 0 && Bre_fx[1][chB] < 0 ) ) - { - tmp2 = Mpy_32_32( Aim_fx[chA][1], Bre_fx[1][chB] ); - } - ELSE - { - tmp2 = L_negate( Mpy_32_32( L_abs( Aim_fx[chA][1] ), L_abs( Bre_fx[1][chB] ) ) ); - } - outIm_fx[chA][chB] = L_add( tmp1, tmp2 ); - move32(); - - test(); - test(); - test(); - IF( ( Are_fx[chA][0] >= 0 && Bim_fx[0][chB] >= 0 ) || ( Are_fx[chA][0] < 0 && Bim_fx[0][chB] < 0 ) ) - { - tmp1 = Mpy_32_32( Are_fx[chA][0], Bim_fx[0][chB] ); - } - ELSE - { - tmp1 = L_negate( Mpy_32_32( L_abs( Are_fx[chA][0] ), L_abs( Bim_fx[0][chB] ) ) ); - } - test(); - test(); - test(); - IF( ( Are_fx[chA][1] >= 0 && Bim_fx[1][chB] >= 0 ) || ( Are_fx[chA][1] < 0 && Bim_fx[1][chB] < 0 ) ) - { - tmp2 = Mpy_32_32( Are_fx[chA][1], Bim_fx[1][chB] ); - } - ELSE - { - tmp2 = L_negate( Mpy_32_32( L_abs( Are_fx[chA][1] ), L_abs( Bim_fx[1][chB] ) ) ); - } - outIm_fx[chA][chB] = L_add( outIm_fx[chA][chB], L_add( tmp1, tmp2 ) ); - move32(); -#endif #endif /* #ifdef IVAS_ENH64_CADENCE_CHANGES */ } } @@ -3742,15 +3575,11 @@ static void matrixTransp1Mul_fx( { Word16 chA, chB; Word16 size = i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ); -#ifndef FIX_1113_OPT_DIRAC_BIN_REND - Word32 tmp1, tmp2; -#endif FOR( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) { FOR( chB = 0; chB < BINAURAL_CHANNELS; chB++ ) { -#ifdef FIX_1113_OPT_DIRAC_BIN_REND outRe_fx[chA][chB] = Madd_32_32( Madd_32_32( Madd_32_32( Mpy_32_32( Are_fx[0][chA], Bre_fx[0][chB] ), Are_fx[1][chA], Bre_fx[1][chB] ), Aim_fx[0][chA], Bim_fx[0][chB] ), @@ -3761,74 +3590,6 @@ static void matrixTransp1Mul_fx( Aim_fx[0][chA], Bre_fx[0][chB] ), Aim_fx[1][chA], Bre_fx[1][chB] ); move32(); -#else - test(); - test(); - test(); - IF( ( ( ( Are_fx[0][chA] >= 0 ) && ( Bre_fx[0][chB] >= 0 ) ) || ( ( Are_fx[0][chA] < 0 ) && ( Bre_fx[0][chB] < 0 ) ) ) ) - tmp1 = Mpy_32_32( Are_fx[0][chA], Bre_fx[0][chB] ); - ELSE - tmp1 = L_negate( Mpy_32_32( L_abs( Are_fx[0][chA] ), L_abs( Bre_fx[0][chB] ) ) ); - test(); - test(); - test(); - IF( ( ( ( Are_fx[1][chA] >= 0 ) && ( Bre_fx[1][chB] >= 0 ) ) || ( ( Are_fx[1][chA] < 0 ) && ( Bre_fx[1][chB] < 0 ) ) ) ) - tmp2 = Mpy_32_32( Are_fx[1][chA], Bre_fx[1][chB] ); - ELSE - tmp2 = L_negate( Mpy_32_32( L_abs( Are_fx[1][chA] ), L_abs( Bre_fx[1][chB] ) ) ); - outRe_fx[chA][chB] = L_add( tmp1, tmp2 ); - move32(); - test(); - test(); - test(); - IF( ( ( ( L_negate( Aim_fx[0][chA] ) >= 0 ) && ( Bim_fx[0][chB] >= 0 ) ) || ( ( L_negate( Aim_fx[0][chA] ) < 0 ) && ( Bim_fx[0][chB] < 0 ) ) ) ) - tmp1 = Mpy_32_32( -Aim_fx[0][chA], Bim_fx[0][chB] ); - ELSE - tmp1 = L_negate( Mpy_32_32( L_abs( -Aim_fx[0][chA] ), L_abs( Bim_fx[0][chB] ) ) ); - test(); - test(); - test(); - IF( ( ( ( Aim_fx[1][chA] >= 0 ) && ( Bim_fx[1][chB] >= 0 ) ) || ( ( Aim_fx[1][chA] < 0 ) && ( Bim_fx[1][chB] < 0 ) ) ) ) - tmp2 = Mpy_32_32( Aim_fx[1][chA], Bim_fx[1][chB] ); - ELSE - tmp2 = L_negate( Mpy_32_32( L_abs( Aim_fx[1][chA] ), L_abs( Bim_fx[1][chB] ) ) ); - outRe_fx[chA][chB] = L_sub( outRe_fx[chA][chB], L_sub( tmp1, tmp2 ) ); - move32(); - - test(); - test(); - test(); - IF( ( ( ( L_negate( Aim_fx[0][chA] ) >= 0 ) && ( Bre_fx[0][chB] >= 0 ) ) || ( ( L_negate( Aim_fx[0][chA] ) < 0 ) && ( Bre_fx[0][chB] < 0 ) ) ) ) - tmp1 = Mpy_32_32( -Aim_fx[0][chA], Bre_fx[0][chB] ); - ELSE - tmp1 = L_negate( Mpy_32_32( L_abs( -Aim_fx[0][chA] ), L_abs( Bre_fx[0][chB] ) ) ); - test(); - test(); - test(); - IF( ( ( ( Aim_fx[1][chA] >= 0 ) && ( Bre_fx[1][chB] >= 0 ) ) || ( ( Aim_fx[1][chA] < 0 ) && ( Bre_fx[1][chB] < 0 ) ) ) ) - tmp2 = Mpy_32_32( Aim_fx[1][chA], Bre_fx[1][chB] ); - ELSE - tmp2 = L_negate( Mpy_32_32( L_abs( Aim_fx[1][chA] ), L_abs( Bre_fx[1][chB] ) ) ); - outIm_fx[chA][chB] = L_sub( tmp1, tmp2 ); - move32(); - - test(); - test(); - test(); - IF( ( ( ( Are_fx[0][chA] >= 0 ) && ( Bim_fx[0][chB] >= 0 ) ) || ( ( Are_fx[0][chA] < 0 ) && ( Bim_fx[0][chB] < 0 ) ) ) ) - tmp1 = Mpy_32_32( Are_fx[0][chA], Bim_fx[0][chB] ); - ELSE - tmp1 = L_negate( Mpy_32_32( L_abs( Are_fx[0][chA] ), L_abs( Bim_fx[0][chB] ) ) ); - test(); - test(); - test(); - IF( ( ( ( Are_fx[1][chA] >= 0 ) && ( Bim_fx[1][chB] >= 0 ) ) || ( ( Are_fx[1][chA] < 0 ) && ( Bim_fx[1][chB] < 0 ) ) ) ) - tmp2 = Mpy_32_32( Are_fx[1][chA], Bim_fx[1][chB] ); - ELSE - tmp2 = L_negate( Mpy_32_32( L_abs( Are_fx[1][chA] ), L_abs( Bim_fx[1][chB] ) ) ); - outIm_fx[chA][chB] = L_add( outIm_fx[chA][chB], L_add( tmp1, tmp2 ) ); - move32(); -#endif } } *q_out = sub( add( q_A, q_B ), 31 ); @@ -3850,10 +3611,8 @@ static void matrixTransp2Mul_fx( Word32 Bre_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], /*q_B*/ Word32 Bim_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], /*q_B*/ Word16 *q_B, -#ifdef FIX_1072_SPEEDUP_matrixTransp2Mul_fx Word32 Ascale, Word32 Bscale, -#endif Word32 outRe_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], /*q_out*/ Word32 outIm_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], /*q_out*/ Word16 *q_out ) @@ -3861,15 +3620,8 @@ static void matrixTransp2Mul_fx( Word16 chA, chB; Word16 min_q_shift; Word16 size = i_mult( BINAURAL_CHANNELS, BINAURAL_CHANNELS ); -#ifndef FIX_1113_OPT_DIRAC_BIN_REND -#ifndef IVAS_ENH64_CADENCE_CHANGES - Word32 tmp1, tmp2; -#endif -#endif -#ifdef FIX_1072_SPEEDUP_matrixTransp2Mul_fx IF( Ascale == 1 ) -#endif { min_q_shift = sub( s_min( L_norm_arr( Are_fx[0], size ), L_norm_arr( Aim_fx[0], size ) ), 1 ); scale_sig32( Are_fx[0], size, min_q_shift ); @@ -3878,9 +3630,7 @@ static void matrixTransp2Mul_fx( move16(); } -#ifdef FIX_1072_SPEEDUP_matrixTransp2Mul_fx IF( Bscale == 1 ) -#endif { min_q_shift = sub( s_min( L_norm_arr( Bre_fx[0], size ), L_norm_arr( Bim_fx[0], size ) ), 1 ); scale_sig32( Bre_fx[0], size, min_q_shift ); @@ -3903,7 +3653,6 @@ static void matrixTransp2Mul_fx( outIm_fx[chA][chB] = L_add( outIm_fx[chA][chB], W_extract_h( W_mac_32_32( W_mult_32_32( Are_fx[chA][0], L_negate( Bim_fx[chB][0] ) ), Are_fx[chA][1], L_negate( Bim_fx[chB][1] ) ) ) ); move32(); #else -#ifdef FIX_1113_OPT_DIRAC_BIN_REND outRe_fx[chA][chB] = Madd_32_32( Madd_32_32( Madd_32_32( Mpy_32_32( Are_fx[chA][0], Bre_fx[chB][0] ), Are_fx[chA][1], Bre_fx[chB][1] ), Aim_fx[chA][0], Bim_fx[chB][0] ), @@ -3914,75 +3663,6 @@ static void matrixTransp2Mul_fx( Are_fx[chA][0], Bim_fx[chB][0] ), Are_fx[chA][1], Bim_fx[chB][1] ); move32(); -#else - test(); - test(); - test(); - IF( ( Are_fx[chA][0] >= 0 && Bre_fx[chB][0] >= 0 ) || ( Are_fx[chA][0] < 0 && Bre_fx[chB][0] < 0 ) ) - tmp1 = Mpy_32_32( Are_fx[chA][0], Bre_fx[chB][0] ); - ELSE - tmp1 = L_negate( Mpy_32_32( L_abs( Are_fx[chA][0] ), L_abs( Bre_fx[chB][0] ) ) ); - test(); - test(); - test(); - IF( ( Are_fx[chA][1] >= 0 && Bre_fx[chB][1] >= 0 ) || ( Are_fx[chA][1] < 0 && Bre_fx[chB][1] < 0 ) ) - tmp2 = Mpy_32_32( Are_fx[chA][1], Bre_fx[chB][1] ); - ELSE - tmp2 = L_negate( Mpy_32_32( L_abs( Are_fx[chA][1] ), L_abs( Bre_fx[chB][1] ) ) ); - outRe_fx[chA][chB] = L_add( tmp1, tmp2 ); - move32(); - - test(); - test(); - test(); - IF( ( Aim_fx[chA][0] >= 0 && L_negate( Bim_fx[chB][0] ) >= 0 ) || ( Aim_fx[chA][0] < 0 && L_negate( Bim_fx[chB][0] ) < 0 ) ) - tmp1 = Mpy_32_32( Aim_fx[chA][0], -Bim_fx[chB][0] ); - ELSE - tmp1 = L_negate( Mpy_32_32( L_abs( Aim_fx[chA][0] ), L_abs( -Bim_fx[chB][0] ) ) ); - test(); - test(); - test(); - IF( ( Aim_fx[chA][1] >= 0 && L_negate( Bim_fx[chB][1] ) >= 0 ) || ( Aim_fx[chA][1] < 0 && L_negate( Bim_fx[chB][1] ) < 0 ) ) - tmp2 = Mpy_32_32( Aim_fx[chA][1], -Bim_fx[chB][1] ); - ELSE - tmp2 = L_negate( Mpy_32_32( L_abs( Aim_fx[chA][1] ), L_abs( -Bim_fx[chB][1] ) ) ); - outRe_fx[chA][chB] = L_sub( outRe_fx[chA][chB], L_add( tmp1, tmp2 ) ); - move32(); - - test(); - test(); - test(); - IF( ( Aim_fx[chA][0] >= 0 && Bre_fx[chB][0] >= 0 ) || ( Aim_fx[chA][0] < 0 && Bre_fx[chB][0] < 0 ) ) - tmp1 = Mpy_32_32( Aim_fx[chA][0], Bre_fx[chB][0] ); - ELSE - tmp1 = L_negate( Mpy_32_32( L_abs( Aim_fx[chA][0] ), L_abs( Bre_fx[chB][0] ) ) ); - test(); - test(); - test(); - IF( ( Aim_fx[chA][1] >= 0 && Bre_fx[chB][1] >= 0 ) || ( Aim_fx[chA][1] < 0 && Bre_fx[chB][1] < 0 ) ) - tmp2 = Mpy_32_32( Aim_fx[chA][1], Bre_fx[chB][1] ); - ELSE - tmp2 = L_negate( Mpy_32_32( L_abs( Aim_fx[chA][1] ), L_abs( Bre_fx[chB][1] ) ) ); - outIm_fx[chA][chB] = L_add( tmp1, tmp2 ); - move32(); - - test(); - test(); - test(); - IF( ( Are_fx[chA][0] >= 0 && L_negate( Bim_fx[chB][0] ) >= 0 ) || ( Are_fx[chA][0] < 0 && L_negate( Bim_fx[chB][0] ) < 0 ) ) - tmp1 = Mpy_32_32( Are_fx[chA][0], -Bim_fx[chB][0] ); - ELSE - tmp1 = L_negate( Mpy_32_32( L_abs( Are_fx[chA][0] ), L_abs( -Bim_fx[chB][0] ) ) ); - test(); - test(); - test(); - IF( ( Are_fx[chA][1] >= 0 && L_negate( Bim_fx[chB][1] ) >= 0 ) || ( Are_fx[chA][1] < 0 && L_negate( Bim_fx[chB][1] ) < 0 ) ) - tmp2 = Mpy_32_32( Are_fx[chA][1], -Bim_fx[chB][1] ); - ELSE - tmp2 = L_negate( Mpy_32_32( L_abs( Are_fx[chA][1] ), L_abs( -Bim_fx[chB][1] ) ) ); - outIm_fx[chA][chB] = L_add( outIm_fx[chA][chB], L_add( tmp1, tmp2 ) ); - move32(); -#endif #endif /* #ifdef IVAS_ENH64_CADENCE_CHANGES */ } } @@ -4057,15 +3737,6 @@ static void chol2x2_fx( } ELSE { -#ifndef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC - outRe[1][0] = BASOP_Util_Divide3232_Scale_cadence( c_re, outRe[0][0], &exp ); - move32(); - q_re2 = add( sub( 31, exp ), sub( q_c, q_re1 ) ); - - outIm[1][0] = BASOP_Util_Divide3232_Scale_cadence( c_im, outRe[0][0], &exp ); - move32(); - q_im = add( sub( 31, exp ), sub( q_c, q_re1 ) ); -#else Word32 denom; Word16 den_exp; Word32 my_outRe, my_outIm; @@ -4091,7 +3762,6 @@ static void chol2x2_fx( outIm[1][0] = Mpy_32_32( denom, my_outIm ); move32(); q_im = sub( q_im, den_exp ); -#endif } if ( outRe[1][0] == 0 ) { @@ -4110,16 +3780,11 @@ static void chol2x2_fx( // 4611686 = Q62 IF( e1 == 0 ) { -#ifndef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC - temp = BASOP_Util_Divide3232_Scale_cadence( temp, 4611686, &exp ); - q_tmp = add( sub( 31, exp ), sub( q_tmp, 62 ) ); -#else Word16 norm = norm_l( temp ); temp = L_shl( temp, norm ); q_tmp = add( q_tmp, norm ); temp = Mpy_32_32( temp, ONE_DIV_EPSILON_MANT ); q_tmp = sub( q_tmp, ONE_DIV_EPSILON_EXP ); -#endif } ELSE { @@ -4168,16 +3833,6 @@ static void chol2x2_fx( // 4611686 = Q62 IF( outRe[1][1] == 0 ) { -#if !defined( FIX_1072_REDUCE_DIVS ) - outRe[0][1] = BASOP_Util_Divide3232_Scale_cadence( c_re, 4611686, &exp ); - move32(); - q_re2 = add( sub( 31, exp ), sub( q_c, 62 ) ); - - outIm[0][1] = BASOP_Util_Divide3232_Scale_cadence( -c_im, 4611686, &exp ); - move32(); - q_im = add( sub( 31, exp ), sub( q_c, 62 ) ); - -#else // outRe[0][1] = BASOP_Util_Divide3232_Scale_cadence( c_re, 4611686, &exp ); Word32 tmp1 = 1953125005; /* 1/4611686 Q62 */ exp = 9; @@ -4190,19 +3845,9 @@ static void chol2x2_fx( outIm[0][1] = Mpy_32_32( tmp1, -c_im ); move32(); q_im = add( sub( 31, exp ), sub( q_c, 62 ) ); -#endif } ELSE { -#if !defined( FIX_1072_REDUCE_DIVS ) - outRe[0][1] = BASOP_Util_Divide3232_Scale_cadence( c_re, outRe[1][1], &exp ); - move32(); - q_re2 = add( sub( 31, exp ), sub( q_c, q_re1 ) ); - - outIm[0][1] = BASOP_Util_Divide3232_Scale_cadence( -c_im, outRe[1][1], &exp ); - move32(); - q_im = add( sub( 31, exp ), sub( q_c, q_re1 ) ); -#else { // outRe[0][1] = BASOP_Util_Divide3232_Scale_cadence( c_re, outRe[1][1], &exp ); Word32 tmp1 = BASOP_Util_Divide3232_Scale_cadence( 0x7FFFFFFF, outRe[1][1], &exp ); @@ -4215,7 +3860,6 @@ static void chol2x2_fx( move32(); q_im = add( sub( 31, exp ), sub( q_c, q_re1 ) ); } -#endif } if ( outRe[0][1] == 0 ) { @@ -4380,15 +4024,10 @@ static void formulate2x2MixingMatrix_fx( // 4611686 = Q62 IF( maxEne_fx == 0 ) { -#ifdef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC maxEneDiv_fx = ONE_DIV_EPSILON_MANT; move32(); q_maxEneDiv = 31 - ONE_DIV_EPSILON_EXP; move16(); -#else - maxEneDiv_fx = BASOP_Util_Divide3232_Scale_cadence( ONE_IN_Q30, 4611686, &exp ); // 4611686 = 1e-12f in Q62 - q_maxEneDiv = add( sub( 31, exp ), sub( Q30, 62 ) ); -#endif } ELSE { @@ -4448,7 +4087,6 @@ static void formulate2x2MixingMatrix_fx( IF( temp == 0 ) { -#ifdef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC IF( E_out1 == 0 ) { Ghat_fx[0] = 0; @@ -4462,10 +4100,6 @@ static void formulate2x2MixingMatrix_fx( exp = sub( exp, sub( q_eout, 62 ) ); Ghat_fx[0] = Sqrt32( temp, &exp ); // Q = 31 - exp } -#else - temp = BASOP_Util_Divide3232_Scale_cadence( E_out1, 4611686, &exp ); // 4611686 = Q62 - exp = sub( exp, sub( q_eout, 62 ) ); -#endif } ELSE { @@ -4473,20 +4107,14 @@ static void formulate2x2MixingMatrix_fx( temp = BASOP_Util_Divide3232_Scale_cadence( E_out1, temp, &exp ); exp = sub( exp, sub( q_eout, sub( 31, exp_temp ) ) ); -#ifdef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC Ghat_fx[0] = Sqrt32( temp, &exp ); // Q = 31 - exp -#endif } -#ifndef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC - Ghat_fx[0] = Sqrt32( temp, &exp ); // Q = 31 - exp -#endif move32(); temp = Mpy_32_32( E_in1, 2147484 ); // 2147484 = 0.001f in Q31 temp = L_max( temp, E_in2 ); // q_ein IF( temp == 0 ) { -#ifdef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC IF( E_out2 == 0 ) { /* We can set hard-coded results */ Ghat_fx[1] = 0; @@ -4499,10 +4127,6 @@ static void formulate2x2MixingMatrix_fx( exp1 = sub( exp1, sub( q_eout, 62 ) ); Ghat_fx[1] = Sqrt32( temp, &exp1 ); // Q = 31 - exp1 } -#else - temp = BASOP_Util_Divide3232_Scale_cadence( E_out2, 4611686, &exp1 ); // 4611686 = Q62 - exp1 = sub( exp1, sub( q_eout, 62 ) ); -#endif } ELSE { @@ -4510,13 +4134,8 @@ static void formulate2x2MixingMatrix_fx( temp = BASOP_Util_Divide3232_Scale_cadence( E_out2, temp, &exp1 ); exp1 = sub( exp1, sub( q_eout, sub( 31, exp_temp ) ) ); -#ifdef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC Ghat_fx[1] = Sqrt32( temp, &exp1 ); // Q = 31 - exp1 -#endif } -#ifndef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC - Ghat_fx[1] = Sqrt32( temp, &exp1 ); // Q = 31 - exp1 -#endif move32(); q_Ghat = sub( 31, s_max( exp, exp1 ) ); @@ -4565,15 +4184,10 @@ static void formulate2x2MixingMatrix_fx( IF( D_fx[0] == 0 ) { -#ifndef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC - temp = BASOP_Util_Divide3232_Scale_cadence( ONE_IN_Q30, 4611686, &exp ); // 4611686 = 1e-12 in Q62 - exp = sub( exp, sub( Q30, 62 ) ); -#else temp = ONE_DIV_EPSILON_MANT; /* Result of 1.0/eps with full precision */ move32(); exp = ONE_DIV_EPSILON_EXP; move16(); -#endif } ELSE { @@ -4583,7 +4197,6 @@ static void formulate2x2MixingMatrix_fx( div_fx[0] = Sqrt32( temp, &exp ); // Q = 31 - exp move32(); -#ifdef FIX_1326_SUBSTITUTE_DIV_SQRT_IOSQRT // Sqrt(1) div_fx[1] = L_add( 0, 2047986068 ); // Q = 31 - exp1 exp1 = add( 0, 20 ); @@ -4594,25 +4207,6 @@ static void formulate2x2MixingMatrix_fx( div_fx[1] = ISqrt32( D_fx[1], &exp1 ); move32(); } -#else - IF( D_fx[1] == 0 ) - { -#ifndef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC - temp = BASOP_Util_Divide3232_Scale_cadence( ONE_IN_Q30, 4611686, &exp1 ); // 4611686 = 1e-12 in Q62 - exp1 = sub( exp1, sub( Q30, 62 ) ); -#else - temp = ONE_DIV_EPSILON_MANT; /* Result of 1.0/eps with full precision */ - exp1 = ONE_DIV_EPSILON_EXP; -#endif - } - ELSE - { - temp = BASOP_Util_Divide3232_Scale_cadence( ONE_IN_Q30, D_fx[1], &exp1 ); - exp1 = sub( exp1, sub( Q30, q_D ) ); - } - div_fx[1] = Sqrt32( temp, &exp1 ); // Q = 31 - exp1 - move32(); -#endif q_div = sub( 31, s_max( exp, exp1 ) ); div_fx[0] = L_shr( div_fx[0], sub( sub( 31, exp ), q_div ) ); // q_div @@ -4704,10 +4298,8 @@ static void formulate2x2MixingMatrix_fx( } matrixTransp2Mul_fx( tmpRe_fx, tmpIm_fx, &q_temp, Ure_fx, Uim_fx, &q_U, -#ifdef FIX_1072_SPEEDUP_matrixTransp2Mul_fx 1 /*int Ascale*/, 0 /*int Bscale*/, -#endif Pre_fx, Pim_fx, &q_P ); /* Nearest orthonormal matrix P to matrix A formulated */ /* These are the final formulas of the JAES publication M = Ky P Kx^(-1) */ @@ -4718,7 +4310,6 @@ static void formulate2x2MixingMatrix_fx( { IF( Sx_fx[chB] == 0 ) { -#ifdef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC Pre_fx[chA][chB] = Mpy_32_32( Pre_fx[chA][chB], ONE_DIV_EPSILON_MANT ); // q_Pre[chA][chB] = add(sub(31, q_P), 31 - ONE_DIV_EPSILON_EXP); q_Pre[chA][chB] = sub( 62 - ONE_DIV_EPSILON_EXP, q_P ); @@ -4727,26 +4318,12 @@ static void formulate2x2MixingMatrix_fx( Pim_fx[chA][chB] = Mpy_32_32( Pim_fx[chA][chB], ONE_DIV_EPSILON_MANT ); // q_Pim[chA][chB] = add(sub(31, q_P), 31 - ONE_DIV_EPSILON_EXP); q_Pim[chA][chB] = sub( 62 - ONE_DIV_EPSILON_EXP, q_P ); -#else - Pre_fx[chA][chB] = BASOP_Util_Divide3232_Scale_cadence( Pre_fx[chA][chB], 4611686, &exp ); // 4611686 = 1e-12 in Q62 - q_Pre[chA][chB] = add( sub( q_P, 62 ), sub( 31, exp ) ); - Pim_fx[chA][chB] = BASOP_Util_Divide3232_Scale_cadence( Pim_fx[chA][chB], 4611686, &exp ); // 4611686 = 1e-12 in Q62 - q_Pim[chA][chB] = add( sub( q_P, 62 ), sub( 31, exp ) ); -#endif } ELSE { -#ifdef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC Word16 Pre_shift, Pim_shift; -#endif temp = BASOP_Util_Add_Mant32Exp( Sx_fx[chB], sub( 31, q_Sx ), EPSILON_MANT, EPSILON_EXP, &exp_temp ); -#ifndef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC - Pre_fx[chA][chB] = BASOP_Util_Divide3232_Scale_cadence( Pre_fx[chA][chB], temp, &exp ); - q_Pre[chA][chB] = add( sub( q_P, sub( 31, exp_temp ) ), sub( 31, exp ) ); - Pim_fx[chA][chB] = BASOP_Util_Divide3232_Scale_cadence( Pim_fx[chA][chB], temp, &exp ); - q_Pim[chA][chB] = add( sub( q_P, sub( 31, exp_temp ) ), sub( 31, exp ) ); -#else temp = BASOP_Util_Divide3232_Scale_cadence( ONE_IN_Q30, temp, &exp ); Pre_shift = norm_l( Pre_fx[chA][chB] ); Pim_shift = norm_l( Pim_fx[chA][chB] ); @@ -4755,7 +4332,6 @@ static void formulate2x2MixingMatrix_fx( q_temp = add( sub( sub( q_P, exp ), sub( 31, Q30 ) ), exp_temp ); q_Pre[chA][chB] = add( q_temp, Pre_shift ); q_Pim[chA][chB] = add( q_temp, Pim_shift ); -#endif } if ( Pre_fx[chA][chB] == 0 ) { @@ -4858,10 +4434,8 @@ static void formulate2x2MixingMatrix_fx( matrixMul_fx( KyRe_fx, KyIm_fx, &q_ky, Pre_fx, Pim_fx, &q_P, tmpRe_fx, tmpIm_fx, &q_temp ); matrixTransp2Mul_fx( tmpRe_fx, tmpIm_fx, &q_temp, Uxre_fx, Uxim_fx, &q_Ux, -#ifdef FIX_1072_SPEEDUP_matrixTransp2Mul_fx 1 /*int Ascale*/, 0 /*int Bscale*/, -#endif Mre_fx, Mim_fx, q_M ); return; } diff --git a/lib_rend/ivas_dirac_decorr_dec_fx.c b/lib_rend/ivas_dirac_decorr_dec_fx.c index 1ffe0da74..1afac99c4 100644 --- a/lib_rend/ivas_dirac_decorr_dec_fx.c +++ b/lib_rend/ivas_dirac_decorr_dec_fx.c @@ -55,12 +55,10 @@ #define DIRAC_DUCK_ALPHA_FX 1717986944 /* Q31 */ #define ONE_M_DIRAC_DUCK_ALPHA 429496736 /* Q31 */ -#ifdef FIX_1110_OPTIM_DIRAC_DECORR_PROC /* Maximal useful q-format, represents range of 2^-126 (float min) */ #define MAX_Q_FX 157 -#endif /*------------------------------------------------------------------------- * Local function prototypes *------------------------------------------------------------------------*/ @@ -590,18 +588,6 @@ void ivas_dirac_dec_decorr_process_fx( Word16 decorr_buff_tot_len = imult1616( imult1616( shl( decorr_buffer_len, 1 ), max_band_decorr ), num_channels ); guarded_bits = 0; -#ifndef FIX_1110_OPTIM_DIRAC_DECORR_PROC - FOR( Word16 i = 0; i < decorr_buff_tot_len; i++ ) - { - IF( h_freq_domain_decorr_ap_state->decorr_buffer_fx[i] != 0 ) - { - guarded_bits = s_max( find_guarded_bits_fx( 2 ), 3 ); - } - } - q_shift = sub( getScaleFactor32( h_freq_domain_decorr_ap_state->decorr_buffer_fx, decorr_buff_tot_len ), guarded_bits ); - Scale_sig32( h_freq_domain_decorr_ap_state->decorr_buffer_fx, decorr_buff_tot_len, q_shift ); - q_decorr_buf = add( q_decorr_buf, q_shift ); -#else Flag is_zero = is_zero_arr( h_freq_domain_decorr_ap_state->decorr_buffer_fx, decorr_buff_tot_len ); if ( is_zero == 0 ) { @@ -617,7 +603,6 @@ void ivas_dirac_dec_decorr_process_fx( q_decorr_buf = add( q_decorr_buf, q_shift ); } } -#endif q_shift = getScaleFactor32( aux_buffer_fx, imult1616( imult1616( 2, num_protos_dir ), max_band_decorr_temp ) ); Word16 buf_len = shl( imult1616( num_protos_dir, max_band_decorr_temp ), 1 ); @@ -681,15 +666,8 @@ void ivas_dirac_dec_decorr_process_fx( /* MA part of filter impulse response */ FOR( l = 0; l < filter_length; l++ ) { -#ifndef FIX_1110_OPTIM_DIRAC_DECORR_PROC - frame_ma_fx[2 * l] = Mpy_32_16_1( input_real_fx, filter_coeff_num_real_fx[l] ); // Q_qux -3 = q_deorr - // frame_ma_fx[2 * l] = L_shr(frame_ma_fx[2 * l],3); // scaling to q_decorr_buf - frame_ma_fx[add( shl( l, 1 ), 1 )] = Mpy_32_16_1( input_imag_fx, filter_coeff_num_real_fx[l] ); // Q_qux - 3 = q_deorr - // frame_ma_fx[2 * l + 1] = L_shr(frame_ma_fx[2 * l + 1], 3); // scaling to q_decorr_buf -#else frame_ma_fx[2 * l] = Mpy_32_16_1( input_real_fx, filter_coeff_num_real_fx[l] ); // Q_qux -3 = q_deorr frame_ma_fx[2 * l + 1] = Mpy_32_16_1( input_imag_fx, filter_coeff_num_real_fx[l] ); // Q_qux - 3 = q_deorr -#endif move32(); move32(); } @@ -705,32 +683,14 @@ void ivas_dirac_dec_decorr_process_fx( filter_frame_real_fx = decorr_buffer_ptr_fx[0]; // q_decorr filter_frame_imag_fx = decorr_buffer_ptr_fx[1]; // q_decorr -#ifndef FIX_1110_OPTIM_DIRAC_DECORR_PROC - decorr_buffer_ptr_fx += shl( decorr_buffer_step, 1 ); -#else Word16 decorr_buffer_step2x = shl( decorr_buffer_step, 1 ); decorr_buffer_ptr_fx += decorr_buffer_step2x; move16(); -#endif FOR( l = 1; l < filter_length; l++ ) { // q adjustment needed// -#ifndef FIX_1110_OPTIM_DIRAC_DECORR_PROC - decorr_buffer_ptr_fx[0] = L_add( decorr_buffer_ptr_fx[0], frame_ma_fx[2 * l] ); // q_decorr - Word32 temp_1 = Mpy_32_16_1( filter_frame_real_fx, filter_coeff_den_real_fx[l] ); // q_decorr - 3 - temp_1 = L_shl( temp_1, 3 ); // q_decorr - decorr_buffer_ptr_fx[0] = L_sub( decorr_buffer_ptr_fx[0], temp_1 ); // q_deocor - decorr_buffer_ptr_fx[1] = L_add( decorr_buffer_ptr_fx[1], frame_ma_fx[add( shl( l, 1 ), 1 )] ); // q_decorr - Word32 temp_2 = Mpy_32_16_1( filter_frame_imag_fx, filter_coeff_den_real_fx[l] ); // q_decorr - 3 - temp_2 = L_shl( temp_2, 3 ); // q_decorr - decorr_buffer_ptr_fx[1] = L_sub( decorr_buffer_ptr_fx[1], temp_2 ); // q_decorr - decorr_buffer_ptr_fx += imult1616( 2, decorr_buffer_step ); - move32(); - move32(); - move32(); -#else Word32 temp_1 = Mpy_32_16_1( filter_frame_real_fx, filter_coeff_den_real_fx[l] ); // q_decorr - 3 temp_1 = L_shl( temp_1, 3 ); // q_decorr decorr_buffer_ptr_fx[0] = L_sub( L_add( decorr_buffer_ptr_fx[0], frame_ma_fx[2 * l] ), temp_1 ); // q_deocor @@ -743,7 +703,6 @@ void ivas_dirac_dec_decorr_process_fx( decorr_buffer_ptr_fx += decorr_buffer_step2x; move16(); -#endif } } } @@ -764,7 +723,6 @@ void ivas_dirac_dec_decorr_process_fx( e_direct_energy_smooth = sub( 31, h_freq_domain_decorr_ap_state->q_direct_energy_smooth ); // scaling to get max precision for aux_buffer values// -#ifdef MSAN_FIX q_shift = Q31; move16(); offset = shl( max_band_decorr, 1 ); @@ -777,10 +735,6 @@ void ivas_dirac_dec_decorr_process_fx( { scale_sig32( &frame_dec_fx[2 * ch_idx * num_freq_bands], offset, q_shift ); } -#else - q_shift = L_norm_arr( frame_dec_fx, ( 2 * max_band_decorr + incr_aux ) * num_channels ); - Scale_sig32( frame_dec_fx, ( 2 * max_band_decorr + incr_aux ) * num_channels, q_shift ); -#endif q_frame_f = add( q_frame_f, q_shift ); @@ -802,24 +756,8 @@ void ivas_dirac_dec_decorr_process_fx( q_direct_energy = q_aux_buffer; move16(); -#ifdef FIX_1110_OPTIM_DIRAC_DECORR_PROC /* Attention: this loop reports norm=0, whenever any data is 0. */ /* Therefore, useful left-shifts are skipped, accuracy is lost. */ -#endif -#ifndef FIX_1110_OPTIM_DIRAC_DECORR_PROC - /* calculate the power of the decorrelated signal */ - FOR( ch_idx = 0; ch_idx < num_channels; ++ch_idx ) - { - offset1 = shl( imult1616( ch_idx, num_freq_bands ), 1 ); - offset2 = shl( imult1616( ch_idx, max_band_decorr ), 1 ); - FOR( Word16 i = 0; i < 2 * max_band_decorr; i++ ) - { - aux_64[add( offset2, i )] = W_mult0_32_32( frame_dec_fx[add( offset1, i )], frame_dec_fx[add( offset1, i )] ); - move64(); - norm = s_min( norm, W_norm( aux_64[add( offset2, i )] ) ); - } - } -#else /* calculate the power of the decorrelated signal */ Word64 *m64_aux = aux_64; move32(); @@ -849,7 +787,6 @@ void ivas_dirac_dec_decorr_process_fx( move32(); } norm = W_norm( min64 ); -#endif norm = sub( norm, 1 /*find_guarded_bits_fx( 2 )*/ ); FOR( Word16 i = 0; i < 2 * num_channels * max_band_decorr; i++ ) { @@ -866,34 +803,6 @@ void ivas_dirac_dec_decorr_process_fx( /* smooth energies */ -#ifndef FIX_1110_OPTIM_DIRAC_DECORR_PROC - v_multc_fixed( aux_buffer_fx, ONE_M_DIRAC_DUCK_ALPHA, aux_buffer_fx, imult1616( num_channels, max_band_decorr ) ); // q_aux_buffer - - v_multc_fixed( h_freq_domain_decorr_ap_state->reverb_energy_smooth_fx, DIRAC_DUCK_ALPHA_FX, h_freq_domain_decorr_ap_state->reverb_energy_smooth_fx, imult1616( num_channels, max_band_decorr ) ); // same-q - - v_add_fixed_me( aux_buffer_fx, sub( 31, q_aux_buffer ), h_freq_domain_decorr_ap_state->reverb_energy_smooth_fx, e_reverb_energy_smooth, h_freq_domain_decorr_ap_state->reverb_energy_smooth_fx, &e_reverb_energy_smooth, imult1616( num_channels, max_band_decorr ), 0 ); - h_freq_domain_decorr_ap_state->q_reverb_energy_smooth = sub( 31, e_reverb_energy_smooth ); - - v_multc_fixed( direct_energy_fx, ONE_M_DIRAC_DUCK_ALPHA, direct_energy_fx, imult1616( num_protos_dir, max_band_decorr ) ); // same q - - v_multc_fixed( h_freq_domain_decorr_ap_state->direct_energy_smooth_fx, DIRAC_DUCK_ALPHA_FX, h_freq_domain_decorr_ap_state->direct_energy_smooth_fx, imult1616( num_protos_dir, max_band_decorr ) ); // same q - - v_add_fixed_me( direct_energy_fx, sub( 31, q_direct_energy ), h_freq_domain_decorr_ap_state->direct_energy_smooth_fx, e_direct_energy_smooth, h_freq_domain_decorr_ap_state->direct_energy_smooth_fx, &e_direct_energy_smooth, imult1616( num_protos_dir, max_band_decorr ), 0 ); - h_freq_domain_decorr_ap_state->q_direct_energy_smooth = sub( 31, e_direct_energy_smooth ); - move16(); - - // scaling energy buffers for better precision for higher values// - q_shift = L_norm_arr( h_freq_domain_decorr_ap_state->direct_energy_smooth_fx, imult1616( num_protos_dir, max_band_decorr ) ); - Scale_sig32( h_freq_domain_decorr_ap_state->direct_energy_smooth_fx, imult1616( num_protos_dir, max_band_decorr ), q_shift ); - h_freq_domain_decorr_ap_state->q_direct_energy_smooth = add( h_freq_domain_decorr_ap_state->q_direct_energy_smooth, q_shift ); - move16(); - - - q_shift = L_norm_arr( h_freq_domain_decorr_ap_state->reverb_energy_smooth_fx, imult1616( num_channels, max_band_decorr ) ); - Scale_sig32( h_freq_domain_decorr_ap_state->reverb_energy_smooth_fx, imult1616( num_channels, max_band_decorr ), q_shift ); - h_freq_domain_decorr_ap_state->q_reverb_energy_smooth = add( h_freq_domain_decorr_ap_state->q_reverb_energy_smooth, q_shift ); - move16(); -#else Word16 len = imult1616( num_channels, max_band_decorr ); Word16 aux_e = sub( 31, q_aux_buffer ); Word16 max_e = s_max( aux_e, e_reverb_energy_smooth ); @@ -950,13 +859,11 @@ void ivas_dirac_dec_decorr_process_fx( } h_freq_domain_decorr_ap_state->q_reverb_energy_smooth = s_min( MAX_Q_FX, h_freq_domain_decorr_ap_state->q_reverb_energy_smooth ); h_freq_domain_decorr_ap_state->q_direct_energy_smooth = s_min( MAX_Q_FX, h_freq_domain_decorr_ap_state->q_direct_energy_smooth ); -#endif e_reverb_energy_smooth = sub( 31, h_freq_domain_decorr_ap_state->q_reverb_energy_smooth ); e_direct_energy_smooth = sub( 31, h_freq_domain_decorr_ap_state->q_direct_energy_smooth ); // this step is b/c we are left shifting frame_dec_fx at the end of below for loop/ -#ifdef MSAN_FIX q_shift = Q31; move16(); FOR( ch_idx = 0; ch_idx < num_channels; ++ch_idx ) @@ -969,10 +876,6 @@ void ivas_dirac_dec_decorr_process_fx( { Scale_sig32( &frame_dec_fx[shl( imult1616( ch_idx, num_freq_bands ), 1 )], shl( max_band_decorr, 1 ), q_shift ); } -#else - q_shift = sub( L_norm_arr( frame_dec_fx, ( 2 * max_band_decorr + incr_aux ) * num_channels ), 2 ); - Scale_sig32( frame_dec_fx, ( 2 * max_band_decorr + incr_aux ) * num_channels, q_shift ); -#endif q_frame_f = add( q_frame_f, q_shift ); FOR( ch_idx = 0; ch_idx < num_channels; ch_idx++ ) @@ -1006,13 +909,8 @@ void ivas_dirac_dec_decorr_process_fx( duck_gain = shl( duck_gain, sub( e_duck_gain, 1 ) ); // Q14 -#ifndef FIX_1110_OPTIM_DIRAC_DECORR_PROC - frame_dec_fx_ptr[2 * band_idx] = L_shl( Mpy_32_16_1( frame_dec_fx_ptr[2 * band_idx], duck_gain ), 1 ); // q_frame_f - frame_dec_fx_ptr[add( shl( band_idx, 1 ), 1 )] = L_shl( Mpy_32_16_1( frame_dec_fx_ptr[add( shl( band_idx, 1 ), 1 )], duck_gain ), 1 ); // q_frame_f -#else frame_dec_fx_ptr[2 * band_idx] = L_shl( Mpy_32_16_1( frame_dec_fx_ptr[2 * band_idx], duck_gain ), 1 ); // q_frame_f frame_dec_fx_ptr[2 * band_idx + 1] = L_shl( Mpy_32_16_1( frame_dec_fx_ptr[2 * band_idx + 1], duck_gain ), 1 ); // q_frame_f -#endif move32(); move32(); } @@ -1029,13 +927,8 @@ void ivas_dirac_dec_decorr_process_fx( } */ duck_gain = shl_sat( duck_gain, sub( e_duck_gain, 1 ) ); // Q14 -#ifndef FIX_1110_OPTIM_DIRAC_DECORR_PROC - frame_dec_fx_ptr[2 * band_idx] = L_shl( Mpy_32_16_1( frame_dec_fx_ptr[2 * band_idx], duck_gain ), 2 ); // q_frame_dec - frame_dec_fx_ptr[add( shl( band_idx, 1 ), 1 )] = L_shl( Mpy_32_16_1( frame_dec_fx_ptr[add( shl( band_idx, 1 ), 1 )], duck_gain ), 2 ); // q_frame_dec -#else frame_dec_fx_ptr[2 * band_idx] = L_shl( Mpy_32_16_1( frame_dec_fx_ptr[2 * band_idx], duck_gain ), 1 ); // q_frame_dec frame_dec_fx_ptr[2 * band_idx + 1] = L_shl( Mpy_32_16_1( frame_dec_fx_ptr[2 * band_idx + 1], duck_gain ), 1 ); // q_frame_dec -#endif move32(); move32(); } @@ -1061,27 +954,19 @@ void ivas_dirac_dec_decorr_process_fx( q_shift = sf; move16(); // scaling it to sf -#ifdef MSAN_FIX FOR( ch_idx = 0; ch_idx < num_channels; ++ch_idx ) { scale_sig32( &frame_dec_fx[2 * ch_idx * num_freq_bands], shl( max_band_decorr, 1 ), q_shift ); } -#else - Scale_sig32( frame_dec_fx, ( 2 * max_band_decorr + incr_aux ) * num_channels, q_shift ); // scaling it to input q -#endif q_frame_f = add( q_frame_f, sf ); } ELSE IF( q_shift < 0 ) { // scaling it to input q -#ifdef MSAN_FIX FOR( ch_idx = 0; ch_idx < num_channels; ++ch_idx ) { scale_sig32( &frame_dec_fx[2 * ch_idx * num_freq_bands], shl( max_band_decorr, 1 ), q_shift ); } -#else - Scale_sig32( frame_dec_fx, ( 2 * max_band_decorr + incr_aux ) * num_channels, q_shift ); // scaling it to input q -#endif q_frame_f = q_input_frame; q_if_local = 0; move16(); diff --git a/lib_rend/ivas_dirac_output_synthesis_dec_fx.c b/lib_rend/ivas_dirac_output_synthesis_dec_fx.c index 1b4ee91b2..87cdb6699 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec_fx.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec_fx.c @@ -1079,7 +1079,6 @@ void ivas_dirac_dec_output_synthesis_process_slot_fx( Word16 temp_q = sub( add( h_dirac_output_synthesis_state->direct_power_factor_q, h_dirac_output_synthesis_state->direct_responses_q ), 31 ); IF( LT_16( temp_q, h_dirac_output_synthesis_state->q_cy_cross_dir_smooth ) ) { -#ifdef FIX_1072_SPEEDUP_gainpanning /*is there any difference in any bitstream?*/ Word16 temp_q1 = sub( temp_q, h_dirac_output_synthesis_state->q_cy_cross_dir_smooth ); FOR( Word16 kk = 0; kk < tmp16; kk++ ) { @@ -1088,17 +1087,7 @@ void ivas_dirac_dec_output_synthesis_process_slot_fx( } h_dirac_output_synthesis_state->q_cy_cross_dir_smooth = temp_q; move16(); -#else - FOR( Word16 kk = 0; kk < tmp16; kk++ ) - { - h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[kk] = L_shl( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[kk], sub( temp_q, h_dirac_output_synthesis_state->q_cy_cross_dir_smooth ) ); /*h_dirac_output_synthesis_state->q_cy_cross_dir_smooth ->temp_q*/ - move32(); - } - h_dirac_output_synthesis_state->q_cy_cross_dir_smooth = temp_q; - move16(); -#endif } -#ifdef FIX_1072_SPEEDUP_gainpanning Word16 temp_q1 = sub( h_dirac_output_synthesis_state->q_cy_cross_dir_smooth, temp_q ); FOR( ch_idx = s_min( 4, nchan_transport ); ch_idx < num_channels_dir; ch_idx++ ) { @@ -1108,11 +1097,7 @@ void ivas_dirac_dec_output_synthesis_process_slot_fx( Word32 aux; IF( temp_q1 < 0 ) { -#ifdef FIX_USAN_ISSUES Word32 temp_q1_equiv = L_lshl( (Word32) 0x80000000, temp_q1 ); -#else - Word32 temp_q1_equiv = L_lshl( 0x80000000, temp_q1 ); -#endif FOR( i = 0; i < num_freq_bands; i++ ) { aux = Mpy_32_32( h_dirac_output_synthesis_state->direct_power_factor_fx[i], h_dirac_output_synthesis_state->direct_responses_fx[ch_idx * num_freq_bands + i] ); @@ -1142,25 +1127,6 @@ void ivas_dirac_dec_output_synthesis_process_slot_fx( } } -#else - FOR( ch_idx = s_min( 4, nchan_transport ); ch_idx < num_channels_dir; ch_idx++ ) - { - v_mult_fixed( h_dirac_output_synthesis_state->direct_power_factor_fx, - &h_dirac_output_synthesis_state->direct_responses_fx[ch_idx * num_freq_bands], - aux_buf, - num_freq_bands ); /*temp_q*/ - - IF( NE_16( temp_q, h_dirac_output_synthesis_state->q_cy_cross_dir_smooth ) ) - { - Scale_sig32( aux_buf, num_freq_bands, sub( h_dirac_output_synthesis_state->q_cy_cross_dir_smooth, temp_q ) ); /*temp_q->(h_dirac_output_synthesis_state->q_cy_cross_dir_smooth)*/ - } - - v_add_fixed( aux_buf, - &h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands], - &h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands], - num_freq_bands, 0 ); /*Q(h_dirac_output_synthesis_state->q_cy_cross_dir_smooth)*/ - } -#endif /*Diffuse gain*/ FOR( ch_idx = s_min( 4, nchan_transport ); ch_idx < num_channels_diff; ch_idx++ ) diff --git a/lib_rend/ivas_dirac_rend_fx.c b/lib_rend/ivas_dirac_rend_fx.c index 4e0d3ab71..59c93ae55 100644 --- a/lib_rend/ivas_dirac_rend_fx.c +++ b/lib_rend/ivas_dirac_rend_fx.c @@ -778,9 +778,7 @@ ivas_error ivas_dirac_alloc_mem_fx( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); } -#ifdef MSAN_FIX set_zero_fx( hDirAC_mem->frame_dec_f_fx, 2 * num_outputs_diff * num_freq_bands ); -#endif hDirAC_mem->frame_dec_f_len = imult1616( imult1616( 2, num_outputs_diff ), num_freq_bands ); } } @@ -813,12 +811,7 @@ ivas_error ivas_dirac_alloc_mem_fx( } hDirACRend->h_output_synthesis_psd_state.cy_cross_dir_smooth_len = size_ho; move16(); -#ifdef MSAN_FIX set_zero_fx( hDirAC_mem->cy_cross_dir_smooth_fx, size_ho ); -#else - set_zero_fx( hDirAC_mem->cy_cross_dir_smooth_fx, size ); - hDirACRend->h_output_synthesis_psd_state.cy_cross_dir_smooth_len = size_ho; -#endif IF( NE_32( hDirACRend->synthesisConf, DIRAC_SYNTHESIS_GAIN_SHD ) ) { @@ -870,9 +863,7 @@ ivas_error ivas_dirac_alloc_mem_fx( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); } hDirACRend->h_output_synthesis_psd_state.proto_direct_buffer_f_len = imult1616( imult1616( 2 * MAX_PARAM_SPATIAL_SUBFRAMES, num_protos_dir ), num_freq_bands ); -#ifdef MSAN_FIX set_zero_fx( hDirAC_mem->proto_direct_buffer_f_fx, hDirACRend->h_output_synthesis_psd_state.proto_direct_buffer_f_len ); -#endif move16(); hDirACRend->h_output_synthesis_psd_state.proto_direct_buffer_f_q = Q31; move16(); @@ -896,9 +887,7 @@ ivas_error ivas_dirac_alloc_mem_fx( } hDirAC_mem->proto_diffuse_buffer_f_len = imult1616( imult1616( 2 * MAX_PARAM_SPATIAL_SUBFRAMES, num_outputs_diff ), num_freq_bands ); } -#ifdef MSAN_FIX set_zero_fx( hDirAC_mem->proto_diffuse_buffer_f_fx, hDirAC_mem->proto_diffuse_buffer_f_len ); -#endif } } hDirACRend->h_output_synthesis_psd_state.proto_direct_buffer_f_fx = hDirAC_mem->proto_direct_buffer_f_fx; @@ -961,9 +950,7 @@ ivas_error ivas_dirac_alloc_mem_fx( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); } -#ifdef MSAN_FIX set_zero_fx( hDirAC_mem->onset_filter_fx, imult1616( num_outputs_diff, num_freq_bands ) ); -#endif } } } @@ -985,9 +972,7 @@ ivas_error ivas_dirac_alloc_mem_fx( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); } -#ifdef MSAN_FIX set_zero_fx( hDirAC_mem->onset_filter_fx, imult1616( 2, num_freq_bands ) ); -#endif } } @@ -1725,11 +1710,7 @@ void protoSignalComputation2_fx( q_shift = s_min( L_norm_arr( RealBuffer_fx[l][0], num_freq_bands ), L_norm_arr( ImagBuffer_fx[l][0], num_freq_bands ) ); min_q_shift = s_min( min_q_shift, q_shift ); -#ifdef MSAN_FIX q_shift = s_min( L_norm_arr( RealBuffer_fx[l][0], s_min( num_freq_bands, MASA_SUM_FREQ_RANGE_BINS ) ), L_norm_arr( ImagBuffer_fx[l][0], s_min( num_freq_bands, MASA_SUM_FREQ_RANGE_BINS ) ) ); -#else - q_shift = s_min( L_norm_arr( RealBuffer_fx[l][0], MASA_SUM_FREQ_RANGE_BINS ), L_norm_arr( ImagBuffer_fx[l][0], MASA_SUM_FREQ_RANGE_BINS ) ); -#endif // MSAN_FIX temp_q_shift = s_min( temp_q_shift, q_shift ); } @@ -2775,13 +2756,8 @@ void ivas_dirac_dec_compute_diffuse_proto_fx( Word16 new_diff_e = s_max( diff_e, old_diff_e ); Scale_sig32( h_dirac_output_synthesis_state->proto_diffuse_buffer_f_fx, diffuse_start, sub( old_diff_e, new_diff_e ) ); // 31-new_diff_e -#ifdef MSAN_FIX Scale_sig32( h_dirac_output_synthesis_state->proto_diffuse_buffer_f_fx + diffuse_start, i_mult( shl( num_freq_bands_diff, 1 ), hDirACRend->hOutSetup.nchan_out_woLFE ), sub( diff_e, new_diff_e ) ); // 31-new_diff_e -#else - Scale_sig32( h_dirac_output_synthesis_state->proto_diffuse_buffer_f_fx + diffuse_start, - sub( h_dirac_output_synthesis_state->proto_diffuse_buffer_f_len, diffuse_start ), sub( diff_e, new_diff_e ) ); -#endif h_dirac_output_synthesis_state->proto_diffuse_buffer_f_q = sub( 31, new_diff_e ); move16(); @@ -2972,10 +2948,8 @@ void ivas_masa_init_stereotype_detection_fx( move16(); stereo_type_detect->target_power_y_smooth_fx = 0; move32(); -#ifdef MSAN_FIX stereo_type_detect->q_target_power_y_smooth = 31; move16(); -#endif stereo_type_detect->lr_total_bb_ratio_db_fx = 0; move32(); @@ -4215,11 +4189,7 @@ static void ivas_masa_ext_dirac_render_sf_fx( ImagBuffer_fx[i] = Cldfb_ImagBuffer_fx[idx_in][i]; // q_cldfb } Word16 out_size = imult1616( hSpatParamRendCom->num_freq_bands, hSpatParamRendCom->subframe_nbslots[subframe_idx] ); -#ifdef OPT_SBA_AVOID_SPAR_RESCALE cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, &( output_f_fx[ch][index_slot * hSpatParamRendCom->num_freq_bands] ), out_size, 0, hMasaExtRend->cldfbSynRend[idx_in] ); -#else /* OPT_SBA_AVOID_SPAR_RESCALE */ - cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, &( output_f_fx[ch][index_slot * hSpatParamRendCom->num_freq_bands] ), out_size, hMasaExtRend->cldfbSynRend[idx_in] ); -#endif /* OPT_SBA_AVOID_SPAR_RESCALE */ scale_sig32( &( output_f_fx[ch][index_slot * hSpatParamRendCom->num_freq_bands] ), out_size, sub( 11, q_out ) ); // q11 idx_in++; } diff --git a/lib_rend/ivas_mcmasa_ana_fx.c b/lib_rend/ivas_mcmasa_ana_fx.c index f3b4d1755..d5df77045 100644 --- a/lib_rend/ivas_mcmasa_ana_fx.c +++ b/lib_rend/ivas_mcmasa_ana_fx.c @@ -754,10 +754,8 @@ void ivas_mcmasa_param_est_ana_fx( computeIntensityVector_ana_fx( hMcMasa->band_grouping, Foa_RealBuffer_fx, Foa_ImagBuffer_fx, num_freq_bands, intensity_real_fx ); /* Q intensity_real_fx = 2*inp_q-31, e = 31 - 2*inp_q + 31 = 62 - 2*inp_q = 2*(31-inp_q)=2*c_e */ computeDirectionVectors_fixed( intensity_real_fx[0], intensity_real_fx[1], intensity_real_fx[2], 0, num_freq_bands, direction_vector_fx[0], direction_vector_fx[1], direction_vector_fx[2], shl( c_e, 1 ) -#ifdef NONBE_IMPROVE_DIRAC_INTENSITY_PREC , NULL -#endif ); /* Q direction_vector_fx = Q30*/ /* Power and intensity estimation for diffuseness */ diff --git a/lib_rend/ivas_objectRenderer_hrFilt_fx.c b/lib_rend/ivas_objectRenderer_hrFilt_fx.c index 01e35efe1..30bf8f00a 100644 --- a/lib_rend/ivas_objectRenderer_hrFilt_fx.c +++ b/lib_rend/ivas_objectRenderer_hrFilt_fx.c @@ -393,9 +393,7 @@ static void GenerateITD_fx( Word16 num_az_idx, num_ev_idx; Word16 BM_idx[HRTF_MODEL_BSPLINE_NUM_COEFFS_SQ]; Word16 itdMod_e; -#ifdef MSAN_FIX set16_fx( AzIdx, 0, HRTF_MODEL_BSPLINE_NUM_COEFFS ); -#endif // MSAN_FIX /* Wrap the requested azimuth to the range of the BSplines */ azim_fx = L_add( azim_fx, model->azimKSeq_fx[0] ); diff --git a/lib_rend/ivas_objectRenderer_sources_fx.c b/lib_rend/ivas_objectRenderer_sources_fx.c index 5787ded3f..7e35b80b2 100644 --- a/lib_rend/ivas_objectRenderer_sources_fx.c +++ b/lib_rend/ivas_objectRenderer_sources_fx.c @@ -573,10 +573,8 @@ static void TDREND_SRC_SPATIAL_Init_fx( TDREND_SPATIAL_VecInit_fx( SrcSpatial_p->Front_p_fx + nC * 3, 0, 0, ONE_IN_Q30 ); /*Assuming Q30*/ } -#ifdef MSAN_FIX SrcSpatial_p->q_Pos_p = Q31; move16(); -#endif /* Source directional attenuation */ SrcSpatial_p->DirAttenEnabled = FALSE; // Q0 diff --git a/lib_rend/ivas_output_init_fx.c b/lib_rend/ivas_output_init_fx.c index 8beb5a0ec..3b01f62ca 100644 --- a/lib_rend/ivas_output_init_fx.c +++ b/lib_rend/ivas_output_init_fx.c @@ -1,9 +1,7 @@ #include "ivas_prot_fx.h" #include "ivas_prot_rend_fx.h" -#ifdef FIX_DISCLAIMER #include -#endif Word16 ivas_get_nchan_buffers_dec_ivas_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ @@ -161,7 +159,6 @@ Word16 ivas_get_nchan_buffers_dec_ivas_fx( return nchan_out_buff; } -#ifdef FIX_DISCLAIMER /*---------------------------------------------------------------------* * get_channel_config() * @@ -272,4 +269,3 @@ ivas_error get_channel_config( return IVAS_ERR_OK; } -#endif diff --git a/lib_rend/ivas_prot_rend_fx.h b/lib_rend/ivas_prot_rend_fx.h index 04afce118..695e05fdf 100644 --- a/lib_rend/ivas_prot_rend_fx.h +++ b/lib_rend/ivas_prot_rend_fx.h @@ -81,12 +81,10 @@ Word16 ivas_get_nchan_buffers_dec_ivas_fx( const Word32 ivas_total_brate /* i : total IVAS bitrate */ ); -#ifdef FIX_DISCLAIMER ivas_error get_channel_config( const AUDIO_CONFIG config, /* i : audio configuration */ Word8 *str /* o : string with the configuration name */ ); -#endif /*----------------------------------------------------------------------------------* diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index 870f8795d..9b149940c 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -1529,9 +1529,7 @@ ivas_error ivas_reverb_open_fx( params.pDsr_fx = params.pRt60_fx + nr_fc_fft_filter; params.pFc_fx = &pState->fft_filter_color_0.fft_spectrum_fx[0]; params.pHrtf_inter_aural_coherence_fx = &pState->fft_filter_color_1.fft_spectrum_fx[0]; -#ifdef MSAN_FIX set32_fx( pState->fft_filter_color_1.fft_spectrum_fx, 0, RV_FILTER_MAX_FFT_SIZE ); -#endif /* Note: these temp buffers can only be used before the final step of the FFT filter design : */ /* before calls to ivas_reverb_calc_correl_filters(...) or to ivas_reverb_calc_color_filters(...) */ @@ -1647,18 +1645,11 @@ ivas_error ivas_reverb_open_fx( IF( pState->do_corr_filter ) { /* Computing correlation filters on the basis of target IA coherence */ -#ifdef MSAN_FIX FOR( i = 0; i < shl( sub( nr_fc_fft_filter, 1 ), 1 ); i++ ) { pTime_window_fx[i] = L_shr( pTime_window_fx[i], 1 ); /*Scaling signal down to 30*/ move32(); } -#else - FOR( i = 0; i < RV_FILTER_MAX_FFT_SIZE; i++ ) - { - pTime_window_fx[i] = L_shr( pTime_window_fx[i], 1 ); /*Scaling signal down to 30*/ - } -#endif // MSAN_FIX Word32 *pHrtf_inter_aural_coherence_const = (Word32 *) malloc( nr_fc_fft_filter * sizeof( Word32 ) ); FOR( i = 0; i < nr_fc_fft_filter; i++ ) diff --git a/lib_rend/ivas_rotation_fx.c b/lib_rend/ivas_rotation_fx.c index aebb80a54..e6f8f2653 100644 --- a/lib_rend/ivas_rotation_fx.c +++ b/lib_rend/ivas_rotation_fx.c @@ -2271,12 +2271,10 @@ void SHrotmatgen_fx( Word16 R_lm1[HEADROT_SHMAT_DIM][HEADROT_SHMAT_DIM]; -#ifdef MSAN_FIX FOR( i = 0; i < HEADROT_SHMAT_DIM; i++ ) { set16_fx( R_lm1[i], 0, HEADROT_SHMAT_DIM ); } -#endif Word16 R_l[HEADROT_SHMAT_DIM][HEADROT_SHMAT_DIM]; Word32 result; SHrotmat[0][0] = ONE_IN_Q14; diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 386644ab1..a8f32514d 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -666,11 +666,7 @@ typedef struct ivas_binaural_rendering_conv_module_struct_fx Word32 ***filterStatesLeftReal_fx; Word32 ***filterStatesLeftImag_fx; -#ifdef OPT_BASOP_ADD_v1 Word16 Q_filterStatesLeft; -#else /* OPT_BASOP_ADD_v1 */ - Word16 ***Q_filterStatesLeft; -#endif /* OPT_BASOP_ADD_v1 */ Word16 numTapsArray[BINAURAL_CONVBANDS]; Word16 numTaps; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 3ea159d7f..84e771106 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -8481,7 +8481,6 @@ static void intermidiate_ext_dirac_render( } } -#ifdef FIX_DISCLAIMER static ivas_error printConfigInfo_rend( IVAS_REND_HANDLE hIvasRend /* i : IVAS renderer handle */ ) @@ -8574,4 +8573,3 @@ void IVAS_REND_PrintDisclaimer( void ) return; } -#endif diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 0a489600a..e837daa4f 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -324,7 +324,6 @@ void IVAS_REND_Close( ); -#ifdef FIX_DISCLAIMER /* Disclaimer and info printing */ void IVAS_REND_PrintInputConfig( @@ -338,7 +337,6 @@ ivas_error IVAS_REND_PrintConfig( void IVAS_REND_PrintDisclaimer( void ); -#endif /* clang-format on */ diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index e667dcfe5..c2e3d8a2a 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -1201,11 +1201,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( { memcpy( f_tmp_ntaps_sba, hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); -#ifdef MSAN_FIX floatToFixed_arrL( f_tmp_ntaps_sba, ( *hHRTF )->rightHRIRImag_HOA3_fx[i][j], Q29, BINAURAL_NTAPS_SBA ); -#else - floatToFixed_arrL( f_tmp_ntaps_sba, ( *hHRTF )->rightHRIRReal_HOA3_fx[i][j], Q29, BINAURAL_NTAPS_SBA ); -#endif } } } -- GitLab From 88209e93b149fd65a8921985e32feab918a34692 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Fri, 21 Mar 2025 16:13:40 +0530 Subject: [PATCH 2/2] Clang formatting --- lib_com/bits_alloc_fx.c | 96 ++++++------ lib_com/cldfb.c | 8 +- lib_com/gs_inact_switching_fx.c | 22 +-- lib_com/ivas_dirac_com_fx.c | 3 +- lib_com/ivas_prot_fx.h | 3 +- lib_com/ivas_qmetadata_com_fx.c | 2 - lib_com/prot_fx.h | 130 ++++++++-------- lib_com/swb_bwe_com_fx.c | 4 +- lib_com/tools_fx.c | 50 +++--- lib_dec/FEC_HQ_phase_ecu_fx.c | 8 +- lib_dec/acelp_core_dec_ivas_fx.c | 38 ++--- lib_dec/fd_cng_dec_fx.c | 4 +- lib_dec/ivas_binRenderer_internal_fx.c | 3 - lib_dec/ivas_core_dec_fx.c | 10 +- lib_dec/ivas_mdct_core_dec_fx.c | 10 +- lib_dec/ivas_spar_decoder_fx.c | 2 +- lib_dec/ivas_stat_dec.h | 2 +- lib_dec/ivas_stereo_icbwe_dec_fx.c | 10 +- lib_dec/ivas_svd_dec_fx.c | 145 +++++++++--------- lib_enc/acelp_core_enc_fx.c | 2 +- lib_enc/cod_tcx_fx.c | 1 - lib_enc/core_enc_init_fx.c | 4 +- lib_enc/dtx_fx.c | 10 +- lib_enc/enc_acelpx_fx.c | 2 +- lib_enc/hq_core_enc_fx.c | 4 +- lib_enc/igf_enc.c | 4 +- lib_enc/ivas_core_pre_proc_front_fx.c | 14 +- lib_enc/ivas_dirac_enc_fx.c | 21 +-- lib_enc/ivas_mcmasa_enc_fx.c | 6 +- lib_enc/ivas_mdct_core_enc_fx.c | 12 +- lib_enc/ivas_omasa_enc_fx.c | 6 +- lib_enc/ivas_stat_enc.h | 2 +- lib_enc/ivas_stereo_dmx_evs_fx.c | 20 +-- lib_enc/ivas_stereo_ica_enc_fx.c | 8 +- lib_enc/ivas_stereo_icbwe_enc_fx.c | 2 +- lib_enc/ivas_stereo_td_analysis_fx.c | 14 +- lib_enc/ivas_td_low_rate_enc_fx.c | 4 +- lib_enc/prot_fx_enc.h | 18 +-- lib_enc/speech_music_classif_fx.c | 12 +- lib_enc/tcx_utils_enc_fx.c | 4 +- lib_enc/transient_detection_fx.c | 4 +- .../ivas_dirac_dec_binaural_functions_fx.c | 6 +- lib_rend/ivas_mcmasa_ana_fx.c | 6 +- 43 files changed, 355 insertions(+), 381 deletions(-) diff --git a/lib_com/bits_alloc_fx.c b/lib_com/bits_alloc_fx.c index cb71f0f28..8162a98d3 100644 --- a/lib_com/bits_alloc_fx.c +++ b/lib_com/bits_alloc_fx.c @@ -762,31 +762,31 @@ static ivas_error acelp_FCB_allocator_ivas( *--------------------------------------------------------------------*/ ivas_error config_acelp1( - const Word16 enc_dec, /* i : encoder/decoder flag */ - const Word32 total_brate, /* i : total bitrate */ - const Word32 core_brate_inp, /* i : core bitrate */ - const Word16 core, /* i : core */ - const Word16 extl, /* i : extension layer */ - const Word32 extl_brate, /* i : extension layer bitrate */ - const Word16 L_frame, /* i : frame length at internal Fs */ - const Word16 GSC_noisy_speech, /* i : GSC on SWB noisy speech flag */ - ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ - const Word16 signalling_bits, /* i : number of signalling bits */ - const Word16 coder_type, /* i : coder type */ + const Word16 enc_dec, /* i : encoder/decoder flag */ + const Word32 total_brate, /* i : total bitrate */ + const Word32 core_brate_inp, /* i : core bitrate */ + const Word16 core, /* i : core */ + const Word16 extl, /* i : extension layer */ + const Word32 extl_brate, /* i : extension layer bitrate */ + const Word16 L_frame, /* i : frame length at internal Fs */ + const Word16 GSC_noisy_speech, /* i : GSC on SWB noisy speech flag */ + ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ + const Word16 signalling_bits, /* i : number of signalling bits */ + const Word16 coder_type, /* i : coder type */ const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ - const Word16 tc_subfr, /* i : TC subfr ID */ - const Word16 tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ - Word16 *nBits_es_Pred, /* o : number of bits for Es_pred Q */ - Word16 *unbits, /* o : number of unused bits */ - const Word16 element_mode, /* i : element mode */ - Word16 *uc_two_stage_flag, /* o : flag undicating two-stage UC */ - const Word16 tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ - const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ - const Word16 idchan, /* i : stereo channel ID */ - const Word16 active_cnt, /* i : Active frame counter */ - const Word16 tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ - const Word16 tdm_LRTD_flag, /* i : LRTD stereo mode flag */ - const Word16 GSC_IVAS_mode /* i : GSC IVAS mode */ + const Word16 tc_subfr, /* i : TC subfr ID */ + const Word16 tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ + Word16 *nBits_es_Pred, /* o : number of bits for Es_pred Q */ + Word16 *unbits, /* o : number of unused bits */ + const Word16 element_mode, /* i : element mode */ + Word16 *uc_two_stage_flag, /* o : flag undicating two-stage UC */ + const Word16 tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ + const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ + const Word16 idchan, /* i : stereo channel ID */ + const Word16 active_cnt, /* i : Active frame counter */ + const Word16 tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ + const Word16 tdm_LRTD_flag, /* i : LRTD stereo mode flag */ + const Word16 GSC_IVAS_mode /* i : GSC IVAS mode */ ) { Word16 i, bits, nb_subfr; @@ -1887,31 +1887,31 @@ ivas_error config_acelp1( *--------------------------------------------------------------------*/ ivas_error config_acelp1_IVAS( - const Word16 enc_dec, /* i : encoder/decoder flag */ - const Word32 total_brate, /* i : total bitrate */ - const Word32 core_brate_inp, /* i : core bitrate */ - const Word16 core, /* i : core */ - const Word16 extl, /* i : extension layer */ - const Word32 extl_brate, /* i : extension layer bitrate */ - const Word16 L_frame, /* i : frame length at internal Fs */ - const Word16 GSC_noisy_speech, /* i : GSC on SWB noisy speech flag */ - ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ - const Word16 signaling_bits, /* i : number of signaling bits */ - const Word16 coder_type, /* i : coder type */ + const Word16 enc_dec, /* i : encoder/decoder flag */ + const Word32 total_brate, /* i : total bitrate */ + const Word32 core_brate_inp, /* i : core bitrate */ + const Word16 core, /* i : core */ + const Word16 extl, /* i : extension layer */ + const Word32 extl_brate, /* i : extension layer bitrate */ + const Word16 L_frame, /* i : frame length at internal Fs */ + const Word16 GSC_noisy_speech, /* i : GSC on SWB noisy speech flag */ + ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ + const Word16 signaling_bits, /* i : number of signaling bits */ + const Word16 coder_type, /* i : coder type */ const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ - const Word16 tc_subfr, /* i : TC subfr ID */ - const Word16 tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ - Word16 *nBits_es_Pred, /* o : number of bits for Es_pred Q */ - Word16 *unbits, /* o : number of unused bits */ - const Word16 element_mode, /* i : element mode */ - Word16 *uc_two_stage_flag, /* o : flag undicating two-stage UC */ - const Word16 tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ - const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ - const Word16 idchan, /* i : stereo channel ID */ - const Word16 active_cnt, /* i : Active frame counter */ - const Word16 tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ - const Word16 tdm_LRTD_flag, /* i : LRTD stereo mode flag */ - const Word16 GSC_IVAS_mode /* i : GSC IVAS mode */ + const Word16 tc_subfr, /* i : TC subfr ID */ + const Word16 tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ + Word16 *nBits_es_Pred, /* o : number of bits for Es_pred Q */ + Word16 *unbits, /* o : number of unused bits */ + const Word16 element_mode, /* i : element mode */ + Word16 *uc_two_stage_flag, /* o : flag undicating two-stage UC */ + const Word16 tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ + const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ + const Word16 idchan, /* i : stereo channel ID */ + const Word16 active_cnt, /* i : Active frame counter */ + const Word16 tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ + const Word16 tdm_LRTD_flag, /* i : LRTD stereo mode flag */ + const Word16 GSC_IVAS_mode /* i : GSC IVAS mode */ ) { Word16 i, bits, nb_subfr; diff --git a/lib_com/cldfb.c b/lib_com/cldfb.c index 408580169..845ec1f11 100644 --- a/lib_com/cldfb.c +++ b/lib_com/cldfb.c @@ -1097,10 +1097,10 @@ void cldfbAnalysis_ts_fx_fixed_q( * Conduct inverse multple overlap cmplex low delay MDCT *--------------------------------------------------------------------*/ void cldfbSynthesis_ivas_fx( - Word32 **realBuffer_fx, /* i : real values Qx*/ - Word32 **imagBuffer_fx, /* i : imag values Qx*/ - Word32 *timeOut_fx, /* o : output time domain samples Qx - 1*/ - const Word16 samplesToProcess, /* i : number of processed samples */ + Word32 **realBuffer_fx, /* i : real values Qx*/ + Word32 **imagBuffer_fx, /* i : imag values Qx*/ + Word32 *timeOut_fx, /* o : output time domain samples Qx - 1*/ + const Word16 samplesToProcess, /* i : number of processed samples */ const Word16 shift, /* i : scale for state buffer */ HANDLE_CLDFB_FILTER_BANK h_cldfb /* i : filter bank state */ ) diff --git a/lib_com/gs_inact_switching_fx.c b/lib_com/gs_inact_switching_fx.c index 421b2a705..54fef9e37 100644 --- a/lib_com/gs_inact_switching_fx.c +++ b/lib_com/gs_inact_switching_fx.c @@ -158,18 +158,18 @@ void Inac_swtch_ematch_fx( void Inac_switch_ematch_ivas_fx( - Word16 exc2[], /* i/o: CELP/GSC excitation buffer Q_exc*/ - Word16 dct_exc_tmp[], /* i : GSC excitation in DCT domain */ - Word16 lt_ener_per_band[], /* i/o: Long term energy per band Q12 */ - const Word16 coder_type, /* i : Coding mode */ + Word16 exc2[], /* i/o: CELP/GSC excitation buffer Q_exc*/ + Word16 dct_exc_tmp[], /* i : GSC excitation in DCT domain */ + Word16 lt_ener_per_band[], /* i/o: Long term energy per band Q12 */ + const Word16 coder_type, /* i : Coding mode */ const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ - const Word16 L_frame, /* i : Frame lenght */ - const Word16 Q_exc, /* i : input and output format of exc2 */ - const Word16 bfi, /* i : frame lost indicator */ - const Word16 last_core, /* i : Last core used */ - const Word16 last_codec_mode, /* i : Last codec mode */ - const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag*/ - const Word16 element_mode /* i : element mode */ + const Word16 L_frame, /* i : Frame lenght */ + const Word16 Q_exc, /* i : input and output format of exc2 */ + const Word16 bfi, /* i : frame lost indicator */ + const Word16 last_core, /* i : Last core used */ + const Word16 last_codec_mode, /* i : Last codec mode */ + const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag*/ + const Word16 element_mode /* i : element mode */ ) { Word16 Ener_per_bd[MBANDS_GN16k]; diff --git a/lib_com/ivas_dirac_com_fx.c b/lib_com/ivas_dirac_com_fx.c index 7d481d181..b16b94f1d 100644 --- a/lib_com/ivas_dirac_com_fx.c +++ b/lib_com/ivas_dirac_com_fx.c @@ -610,8 +610,7 @@ void computeDirectionVectors_fixed( Word32 *direction_vector_z, /* o: Q30*/ Word16 i_e /*Exponent of all the intensity buffers*/ , - Word16 *i_e_band -) + Word16 *i_e_band ) { Word16 i; Word32 intensityNorm; diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index fab166b6d..246f4d297 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -3237,8 +3237,7 @@ void computeDirectionVectors_fixed( Word32 *direction_vector_z, /*Q30*/ Word16 i_e /*Exponent of all the intensity buffers*/ , - Word16 *i_e_band -); + Word16 *i_e_band ); UWord8 ivas_masa_surrcoh_signicant_fx( diff --git a/lib_com/ivas_qmetadata_com_fx.c b/lib_com/ivas_qmetadata_com_fx.c index ee11f2b02..a5fbf9e83 100644 --- a/lib_com/ivas_qmetadata_com_fx.c +++ b/lib_com/ivas_qmetadata_com_fx.c @@ -446,8 +446,6 @@ ivas_error only_reduce_bits_direction_fx( } } } - - } *reduce_bits_out = negate( reduce_bits ); diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 71c1590c2..d7ed9a140 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -4851,31 +4851,31 @@ Word16 BITS_ALLOC_config_acelp( const Word16 nb_subfr ); ivas_error config_acelp1( - const Word16 enc_dec, /* i : encoder/decoder flag */ - const Word32 total_brate, /* i : total bitrate */ - const Word32 core_brate_inp, /* i : core bitrate */ - const Word16 core, /* i : core */ - const Word16 extl, /* i : extension layer */ - const Word32 extl_brate, /* i : extension layer bitrate */ - const Word16 L_frame, /* i : frame length at internal Fs */ - const Word16 GSC_noisy_speech, /* i : GSC on SWB noisy speech flag */ - ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ - const Word16 signalling_bits, /* i : number of signalling bits */ - const Word16 coder_type, /* i : coder type */ + const Word16 enc_dec, /* i : encoder/decoder flag */ + const Word32 total_brate, /* i : total bitrate */ + const Word32 core_brate_inp, /* i : core bitrate */ + const Word16 core, /* i : core */ + const Word16 extl, /* i : extension layer */ + const Word32 extl_brate, /* i : extension layer bitrate */ + const Word16 L_frame, /* i : frame length at internal Fs */ + const Word16 GSC_noisy_speech, /* i : GSC on SWB noisy speech flag */ + ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ + const Word16 signalling_bits, /* i : number of signalling bits */ + const Word16 coder_type, /* i : coder type */ const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ - const Word16 tc_subfr, /* i : TC subfr ID */ - const Word16 tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ - Word16 *nBits_es_Pred, /* o : number of bits for Es_pred Q */ - Word16 *unbits, /* o : number of unused bits */ - const Word16 element_mode, /* i : element mode */ - Word16 *uc_two_stage_flag, /* o : flag undicating two-stage UC */ - const Word16 tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ - const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ - const Word16 idchan, /* i : stereo channel ID */ - const Word16 active_cnt, /* i : Active frame counter */ - const Word16 tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ - const Word16 tdm_LRTD_flag, /* i : LRTD stereo mode flag */ - const Word16 GSC_IVAS_mode /* i : GSC IVAS mode */ + const Word16 tc_subfr, /* i : TC subfr ID */ + const Word16 tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ + Word16 *nBits_es_Pred, /* o : number of bits for Es_pred Q */ + Word16 *unbits, /* o : number of unused bits */ + const Word16 element_mode, /* i : element mode */ + Word16 *uc_two_stage_flag, /* o : flag undicating two-stage UC */ + const Word16 tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ + const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ + const Word16 idchan, /* i : stereo channel ID */ + const Word16 active_cnt, /* i : Active frame counter */ + const Word16 tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ + const Word16 tdm_LRTD_flag, /* i : LRTD stereo mode flag */ + const Word16 GSC_IVAS_mode /* i : GSC IVAS mode */ ); Word16 set_ACELP_flag( @@ -5846,18 +5846,18 @@ void Inac_swtch_ematch_fx( ); void Inac_switch_ematch_ivas_fx( - Word16 exc2[], /* i/o: CELP/GSC excitation buffer Q_exc*/ - Word16 dct_exc_tmp[], /* i : GSC excitation in DCT domain */ - Word16 lt_ener_per_band[], /* i/o: Long term energy per band Q12 */ - const Word16 coder_type, /* i : Coding mode */ + Word16 exc2[], /* i/o: CELP/GSC excitation buffer Q_exc*/ + Word16 dct_exc_tmp[], /* i : GSC excitation in DCT domain */ + Word16 lt_ener_per_band[], /* i/o: Long term energy per band Q12 */ + const Word16 coder_type, /* i : Coding mode */ const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ - const Word16 L_frame, /* i : Frame lenght */ - const Word16 Q_exc, /* i : input and output format of exc2 */ - const Word16 bfi, /* i : frame lost indicator */ - const Word16 last_core, /* i : Last core used */ - const Word16 last_codec_mode, /* i : Last codec mode */ - const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag*/ - const Word16 element_mode /* i : element mode */ + const Word16 L_frame, /* i : Frame lenght */ + const Word16 Q_exc, /* i : input and output format of exc2 */ + const Word16 bfi, /* i : frame lost indicator */ + const Word16 last_core, /* i : Last core used */ + const Word16 last_codec_mode, /* i : Last codec mode */ + const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag*/ + const Word16 element_mode /* i : element mode */ ); // igf_base_fx.c @@ -9740,10 +9740,10 @@ void cldfbAnalysis_ivas_fx( ); void cldfbSynthesis_ivas_fx( - Word32 **realBuffer_fx, /* i : real values Qx*/ - Word32 **imagBuffer_fx, /* i : imag values Qx*/ - Word32 *timeOut_fx, /* o : output time domain samples Qx - 1*/ - const Word16 samplesToProcess, /* i : number of processed samples */ + Word32 **realBuffer_fx, /* i : real values Qx*/ + Word32 **imagBuffer_fx, /* i : imag values Qx*/ + Word32 *timeOut_fx, /* o : output time domain samples Qx - 1*/ + const Word16 samplesToProcess, /* i : number of processed samples */ const Word16 shift, /* i : scale for state buffer */ HANDLE_CLDFB_FILTER_BANK h_cldfb /* i : filter bank state */ ); @@ -10973,31 +10973,31 @@ void lsf_syn_mem_backup_ivas_fx( Word16 *pstreaklen ); ivas_error config_acelp1_IVAS( - const Word16 enc_dec, /* i : encoder/decoder flag */ - const Word32 total_brate, /* i : total bitrate */ - const Word32 core_brate_inp, /* i : core bitrate */ - const Word16 core, /* i : core */ - const Word16 extl, /* i : extension layer */ - const Word32 extl_brate, /* i : extension layer bitrate */ - const Word16 L_frame, /* i : frame length at internal Fs */ - const Word16 GSC_noisy_speech, /* i : GSC on SWB noisy speech flag */ - ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ - const Word16 signaling_bits, /* i : number of signaling bits */ - const Word16 coder_type, /* i : coder type */ + const Word16 enc_dec, /* i : encoder/decoder flag */ + const Word32 total_brate, /* i : total bitrate */ + const Word32 core_brate_inp, /* i : core bitrate */ + const Word16 core, /* i : core */ + const Word16 extl, /* i : extension layer */ + const Word32 extl_brate, /* i : extension layer bitrate */ + const Word16 L_frame, /* i : frame length at internal Fs */ + const Word16 GSC_noisy_speech, /* i : GSC on SWB noisy speech flag */ + ACELP_config *acelp_cfg, /* i : ACELP bit-allocation */ + const Word16 signaling_bits, /* i : number of signaling bits */ + const Word16 coder_type, /* i : coder type */ const Word16 inactive_coder_type_flag, /* i : AVQ (0) or GSC (1) IC flag */ - const Word16 tc_subfr, /* i : TC subfr ID */ - const Word16 tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ - Word16 *nBits_es_Pred, /* o : number of bits for Es_pred Q */ - Word16 *unbits, /* o : number of unused bits */ - const Word16 element_mode, /* i : element mode */ - Word16 *uc_two_stage_flag, /* o : flag undicating two-stage UC */ - const Word16 tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ - const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ - const Word16 idchan, /* i : stereo channel ID */ - const Word16 active_cnt, /* i : Active frame counter */ - const Word16 tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ - const Word16 tdm_LRTD_flag, /* i : LRTD stereo mode flag */ - const Word16 GSC_IVAS_mode /* i : GSC IVAS mode */ + const Word16 tc_subfr, /* i : TC subfr ID */ + const Word16 tc_call, /* i : TC call number (0,1,2,3,5(DEC)) */ + Word16 *nBits_es_Pred, /* o : number of bits for Es_pred Q */ + Word16 *unbits, /* o : number of unused bits */ + const Word16 element_mode, /* i : element mode */ + Word16 *uc_two_stage_flag, /* o : flag undicating two-stage UC */ + const Word16 tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ + const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ + const Word16 idchan, /* i : stereo channel ID */ + const Word16 active_cnt, /* i : Active frame counter */ + const Word16 tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ + const Word16 tdm_LRTD_flag, /* i : LRTD stereo mode flag */ + const Word16 GSC_IVAS_mode /* i : GSC IVAS mode */ ); ivas_error push_next_indice( @@ -11051,8 +11051,8 @@ void calculate_hangover_attenuation_gain_ivas_fx( void init_coder_ace_plus_ivas_fx( Encoder_State *st, /* i : Encoder state */ const Word32 last_total_brate, /* i : last total bitrate */ - const Word32 igf_brate, /* i : IGF configuration bitrate */ - const Word16 MCT_flag /* i : hMCT handle allocated (1) or not (0) */ + const Word32 igf_brate, /* i : IGF configuration bitrate */ + const Word16 MCT_flag /* i : hMCT handle allocated (1) or not (0) */ ); void core_coder_reconfig_ivas_fx( diff --git a/lib_com/swb_bwe_com_fx.c b/lib_com/swb_bwe_com_fx.c index 228d43247..11da78c46 100644 --- a/lib_com/swb_bwe_com_fx.c +++ b/lib_com/swb_bwe_com_fx.c @@ -2534,7 +2534,7 @@ void hq_generic_decoding_fx( { exp = norm_l( L_tmp ); frac = round_fx_sat( L_shl( L_tmp, exp ) ); /*cs+exp-16 */ - tmp = div_s( 16384, frac ); /*15 + 14 - (cs+exp-16) */ + 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 */ fenvL_fx = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 14 ) ) ); /*Q1 */ @@ -3082,7 +3082,7 @@ void hq_generic_decoding_ivas_fx( { exp = norm_l( L_tmp ); frac = round_fx_sat( L_shl( L_tmp, exp ) ); /*cs+exp-16 */ - tmp = div_s( 16384, frac ); /*15 + 14 - (cs+exp-16) */ + 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 */ fenvL_fx = round_fx_sat( L_shl_sat( L_tmp, sub( exp, 14 ) ) ); /*Q1 */ diff --git a/lib_com/tools_fx.c b/lib_com/tools_fx.c index d403c583d..5219d076c 100644 --- a/lib_com/tools_fx.c +++ b/lib_com/tools_fx.c @@ -487,13 +487,13 @@ void Copy( return; } - FOR( i = L - 1; i >= 0; i-- ) - { - y[i] = x[i]; - move16(); - } + FOR( i = L - 1; i >= 0; i-- ) + { + y[i] = x[i]; + move16(); + } - return; + return; } /*-------------------------------------------------------------------* * Copy64: @@ -519,13 +519,13 @@ void Copy64( return; } - FOR( i = L - 1; i >= 0; i-- ) - { - y[i] = x[i]; - move64(); - } + FOR( i = L - 1; i >= 0; i-- ) + { + y[i] = x[i]; + move64(); + } - return; + return; } void set64_fx( @@ -566,15 +566,15 @@ void Copy_pword( return; } - FOR( i = L - 1; i >= 0; i-- ) - { - y[i].v.im = x[i].v.im; - y[i].v.re = x[i].v.re; - move16(); - move16(); - } + FOR( i = L - 1; i >= 0; i-- ) + { + y[i].v.im = x[i].v.im; + y[i].v.re = x[i].v.re; + move16(); + move16(); + } - return; + return; } /*-------------------------------------------------------------------* * Copy32: @@ -599,11 +599,11 @@ void Copy32( return; } - FOR( i = L - 1; i >= 0; i-- ) - { - y[i] = x[i]; - move32(); - } + FOR( i = L - 1; i >= 0; i-- ) + { + y[i] = x[i]; + move32(); + } } void set8_fx( diff --git a/lib_dec/FEC_HQ_phase_ecu_fx.c b/lib_dec/FEC_HQ_phase_ecu_fx.c index 74f1bfc09..b8c16474e 100644 --- a/lib_dec/FEC_HQ_phase_ecu_fx.c +++ b/lib_dec/FEC_HQ_phase_ecu_fx.c @@ -1590,7 +1590,7 @@ static void ivas_spec_ana_fx( test(); IF( n > 0 && *pPlocs == 0 ) /* Very 1st peak position possible to have a peak at 0/DC index position. */ { - Copy_Scale_sig_16_32_no_sat( &xfp[*pPlocs], xfp_32, 3, Q15 ); // Q + 15 + Copy_Scale_sig_16_32_no_sat( &xfp[*pPlocs], xfp_32, 3, Q15 ); // Q + 15 acc = L_deposit_h( *pPlocs ); // Q16 *pPlocsi++ = L_add( acc, L_shl( imax_pos_fx( xfp_32 ) /* Q15 */, 1 ) ); // Q16 move32(); @@ -1601,7 +1601,7 @@ static void ivas_spec_ana_fx( test(); IF( n > 0 && EQ_16( *pPlocs, 1 ) ) /* Also 2nd peak position uses DC which makes jacobsen unsuitable. */ { - Copy_Scale_sig_16_32_no_sat( &xfp[*pPlocs - 1], xfp_32, 3, Q15 ); // Q + 15 + Copy_Scale_sig_16_32_no_sat( &xfp[*pPlocs - 1], xfp_32, 3, Q15 ); // Q + 15 acc = L_deposit_h( sub( *pPlocs, 1 ) ); // Q16 *pPlocsi++ = L_add( acc, L_shl( imax_pos_fx( xfp_32 ) /* Q15 */, 1 ) ); // Q16 move32(); @@ -1647,7 +1647,7 @@ static void ivas_spec_ana_fx( IF( EQ_16( currPlocs, ( sub( Lprot2_1, DELTA_CORR_F0_INT ) ) ) ) /* Also 2nd last peak position uses fs/2 which makes jacobsen less suitable. */ { - Copy_Scale_sig_16_32_no_sat( &xfp[currPlocs - 1], xfp_32, 3, Q15 ); // Q + 15 + Copy_Scale_sig_16_32_no_sat( &xfp[currPlocs - 1], xfp_32, 3, Q15 ); // Q + 15 acc = L_deposit_h( sub( currPlocs, 1 ) ); // Q16 *pPlocsi++ = L_add( acc, L_shl( imax_pos_fx( xfp_32 ) /* Q15 */, 1 ) ); // Q16 move32(); @@ -1661,7 +1661,7 @@ static void ivas_spec_ana_fx( * whould point */ IF( n > 0 ) /* fs/2 which makes special case . */ { - Copy_Scale_sig_16_32_no_sat( &xfp[currPlocs - 2], xfp_32, 3, Q15 ); // Q + 15 + Copy_Scale_sig_16_32_no_sat( &xfp[currPlocs - 2], xfp_32, 3, Q15 ); // Q + 15 acc = L_deposit_h( sub( currPlocs, 2 ) ); // Q16 *pPlocsi++ = L_add( acc, L_shl( imax_pos_fx( xfp_32 ) /* Q15 */, 1 ) ); // Q16 move32(); diff --git a/lib_dec/acelp_core_dec_ivas_fx.c b/lib_dec/acelp_core_dec_ivas_fx.c index 5807f2c67..ea82f09de 100644 --- a/lib_dec/acelp_core_dec_ivas_fx.c +++ b/lib_dec/acelp_core_dec_ivas_fx.c @@ -77,21 +77,21 @@ ivas_error acelp_core_dec_ivas_fx( { Word32 synth_fx[960], save_hb_synth_fx[960] /*, bwe_exc_extended_fx[L_FRAME32k + NL_BUFF_OFFSET]*/; - Word16 old_exc_fx[L_EXC_DEC], *exc_fx; /* excitation signal buffer */ - Word16 syn_tmp_fx[L_FRAME16k + L_SUBFR], *psyn_fx; /* synthesis signal buffer */ - Word16 output_frame; /* frame length at output sampling freq. */ - Word16 lsf_new_fx[M]; /* LSFs at the end of the frame Qlog2(2.56) */ - Word16 lsp_new_fx[M]; /* LSPs at the end of the frame Q15 */ - Word16 lsp_mid_fx[M]; /* LSPs in the middle of the frame */ - Word16 Aq_fx[NB_SUBFR16k * ( M + 1 )]; /* A(q) quantized for the 4 subframes */ - Word16 old_exc2_fx[L_FRAME16k + L_EXC_MEM], *exc2_fx; /* total excitation buffer */ - Word16 mem_tmp_fx[M]; /* temporary synthesis filter memory */ - Word32 enr_q_fx; /* E information for FER protection */ - Word16 tmp_noise_fx; /* Long term temporary noise energy */ - Word16 Es_pred_fx; /* predicted scaled innov. energy Q8 */ - Word16 FEC_pitch_fx; /* FEC pitch */ + Word16 old_exc_fx[L_EXC_DEC], *exc_fx; /* excitation signal buffer */ + Word16 syn_tmp_fx[L_FRAME16k + L_SUBFR], *psyn_fx; /* synthesis signal buffer */ + Word16 output_frame; /* frame length at output sampling freq. */ + Word16 lsf_new_fx[M]; /* LSFs at the end of the frame Qlog2(2.56) */ + Word16 lsp_new_fx[M]; /* LSPs at the end of the frame Q15 */ + Word16 lsp_mid_fx[M]; /* LSPs in the middle of the frame */ + Word16 Aq_fx[NB_SUBFR16k * ( M + 1 )]; /* A(q) quantized for the 4 subframes */ + Word16 old_exc2_fx[L_FRAME16k + L_EXC_MEM], *exc2_fx; /* total excitation buffer */ + Word16 mem_tmp_fx[M]; /* temporary synthesis filter memory */ + Word32 enr_q_fx; /* E information for FER protection */ + Word16 tmp_noise_fx; /* Long term temporary noise energy */ + Word16 Es_pred_fx; /* predicted scaled innov. energy Q8 */ + Word16 FEC_pitch_fx; /* FEC pitch */ Word16 old_bwe_exc_fx[( ( PIT16k_MAX + ( L_FRAME16k + 1 ) + L_SUBFR16k ) * 2 )]; /* excitation buffer */ - Word16 *bwe_exc_fx; /* Excitation for SWB TBE */ + Word16 *bwe_exc_fx; /* Excitation for SWB TBE */ Word16 i, j, int_fs; Word16 tc_subfr; Word16 allow_cn_step; @@ -1810,7 +1810,7 @@ ivas_error acelp_core_dec_ivas_fx( #ifdef OPT_STEREO_32KBPS_V1 scale_sig32( st->cldfbSynHB->cldfb_state_fx, st->cldfbSynHB->p_filter_length, sub( Q_real, Q11 ) ); // Q10 - > (Q_real-1) #else /* OPT_STEREO_32KBPS_V1 */ - scale_sig32_r( st->cldfbSynHB->cldfb_state_fx, st->cldfbSynHB->p_filter_length, sub( sub( Q_real, 1 ), Q10 ) ); // (Q_real-1) + scale_sig32_r( st->cldfbSynHB->cldfb_state_fx, st->cldfbSynHB->p_filter_length, sub( sub( Q_real, 1 ), Q10 ) ); // (Q_real-1) #endif /* OPT_STEREO_32KBPS_V1 */ st->cldfbSynHB->Q_cldfb_state = sub( Q_real, 1 ); move16(); @@ -1892,13 +1892,13 @@ ivas_error acelp_core_dec_ivas_fx( #ifdef OPT_STEREO_32KBPS_V1 scale_sig32( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( Q_real, Q11 ) ); // Q10 - > (Q_real-1) #else /* OPT_STEREO_32KBPS_V1 */ - scale_sig32_r( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( sub( Q_real, 1 ), Q10 ) ); //(Q_real - 1) + scale_sig32_r( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( sub( Q_real, 1 ), Q10 ) ); //(Q_real - 1) #endif /* OPT_STEREO_32KBPS_V1 */ st->cldfbSyn->Q_cldfb_state = sub( Q_real, 1 ); move16(); cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, synth_fx, -1, 0, st->cldfbSyn ); - scale_sig32( synth_fx, output_frame, negate( sub( Q_real, 1 ) ) ); // Q0 + scale_sig32( synth_fx, output_frame, negate( sub( Q_real, 1 ) ) ); // Q0 scale_sig32( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( Q10, sub( Q_real, 1 ) ) ); // Q10 st->cldfbSyn->Q_cldfb_state = Q10; move16(); @@ -1988,12 +1988,12 @@ ivas_error acelp_core_dec_ivas_fx( #ifdef OPT_STEREO_32KBPS_V1 scale_sig32( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( Q_real, Q11 ) ); // Q10 - > (Q_real-1) #else /* OPT_STEREO_32KBPS_V1 */ - scale_sig32_r( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( sub( Q_real, 1 ), Q10 ) ); //(Q_real - 1) + scale_sig32_r( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( sub( Q_real, 1 ), Q10 ) ); //(Q_real - 1) #endif /* OPT_STEREO_32KBPS_V1 */ cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, synth_fx /*dummy*/, NS2SA_FX2( st->output_Fs, FRAME_SIZE_NS /*DELAY_CLDFB_NS*/ ), 0, st->cldfbSyn ); - Scale_sig32( synth_fx, output_frame, negate( sub( Q_real, 1 ) ) ); // Q0 + Scale_sig32( synth_fx, output_frame, negate( sub( Q_real, 1 ) ) ); // Q0 Scale_sig32( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( Q10, sub( Q_real, 1 ) ) ); // Q10 st->cldfbSyn->Q_cldfb_state = Q10; move16(); diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index df18d3dba..c1289b8a3 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -5270,7 +5270,7 @@ void generate_stereo_masking_noise_fx( { hFdCngCom = st->hFdCngDec->hFdCngCom; Copy_Scale_sig_16_32_no_sat( hStereoCng->olapBufferSynth22_fx, Ns_fx, shr( hFdCngCom->frameSize, 1 ), sub( Q6, st->Q_syn ) ); /*Q6*/ - Copy32( hFdCngCom->olapBufferSynth2_fx, Np_fx, shr( hFdCngCom->frameSize, 1 ) ); /*st->Q_syn*/ + Copy32( hFdCngCom->olapBufferSynth2_fx, Np_fx, shr( hFdCngCom->frameSize, 1 ) ); /*st->Q_syn*/ set32_fx( &Np_fx[( hFdCngCom->frameSize / 2 )], 0, shr( hFdCngCom->frameSize, 1 ) ); set32_fx( &Ns_fx[( hFdCngCom->frameSize / 2 )], 0, shr( hFdCngCom->frameSize, 1 ) ); @@ -5278,7 +5278,7 @@ void generate_stereo_masking_noise_fx( IF( !fadeOut ) { Copy_Scale_sig_16_32_no_sat( hStereoCng->olapBufferSynth22_fx, hStereoCng->olapBufferSynth22_32fx, hFdCngCom->fftlen, sub( Q15, st->Q_syn ) ); /*Q15*/ - generate_masking_noise_ivas_fx( N1_fx, &N1_fx_exp, hFdCngCom, hFdCngCom->frameSize, 0, 1, 0, st->element_mode, hStereoCng, nchan_out ); // N1_fx Q6 + generate_masking_noise_ivas_fx( N1_fx, &N1_fx_exp, hFdCngCom, hFdCngCom->frameSize, 0, 1, 0, st->element_mode, hStereoCng, nchan_out ); // N1_fx Q6 /* Generate masking noise for secondary channel */ IF( flag_sec_CNA ) { diff --git a/lib_dec/ivas_binRenderer_internal_fx.c b/lib_dec/ivas_binRenderer_internal_fx.c index f78f14e8e..c05b8beb2 100644 --- a/lib_dec/ivas_binRenderer_internal_fx.c +++ b/lib_dec/ivas_binRenderer_internal_fx.c @@ -339,7 +339,6 @@ static ivas_error ivas_binRenderer_convModuleOpen( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } - } } /* set memories */ @@ -1264,7 +1263,6 @@ static void ivas_binRenderer_convModuleClose_fx( free( hBinRenConvModule->filterStatesLeftImag_fx[bandIdx][chIdx] ); hBinRenConvModule->filterStatesLeftImag_fx[bandIdx][chIdx] = NULL; - } free( hBinRenConvModule->filterStatesLeftReal_fx[bandIdx] ); @@ -1272,7 +1270,6 @@ static void ivas_binRenderer_convModuleClose_fx( free( hBinRenConvModule->filterStatesLeftImag_fx[bandIdx] ); hBinRenConvModule->filterStatesLeftImag_fx[bandIdx] = NULL; - } free( hBinRenConvModule->filterStatesLeftReal_fx ); diff --git a/lib_dec/ivas_core_dec_fx.c b/lib_dec/ivas_core_dec_fx.c index 4e654030b..588640d0a 100644 --- a/lib_dec/ivas_core_dec_fx.c +++ b/lib_dec/ivas_core_dec_fx.c @@ -524,7 +524,7 @@ ivas_error ivas_core_dec_fx( } Copy_Scale_sig_16_32_no_sat( output_16_fx[n], output_32_fx[n], L_FRAME48k, sub( Q11, st->Q_syn2 ) ); // Q_syn2->Q11 - Scale_sig( output_16_fx[n], L_FRAME48k, negate( st->Q_syn2 ) ); // Q0 + Scale_sig( output_16_fx[n], L_FRAME48k, negate( st->Q_syn2 ) ); // Q0 IF( st->cldfbAna ) { scale_sig32( st->cldfbAna->cldfb_state_fx, st->cldfbAna->cldfb_size, Q10 - Q11 ); /* 9 * (Word16)(st->L_frame * FRAMES_PER_SEC * INV_CLDFB_BANDWIDTH + 0.5f) , Q10 */ @@ -630,8 +630,8 @@ ivas_error ivas_core_dec_fx( ivas_hq_core_dec_fx( st, synth_16_fx[n], &Q_synth, output_frame, NORMAL_HQ_CORE, core_switching_flag[n], output_16_fx[n], &Q_output ); Copy_Scale_sig_16_32_DEPREC( output_16_fx[n], output_32_fx[n], L_FRAME48k, sub( Q11, Q_output ) ); // Q11 - Scale_sig( synth_16_fx[n], output_frame, negate( Q_synth ) ); // Q0 - Scale_sig( output_16_fx[n], L_FRAME48k, negate( Q_output ) ); // Q0 + Scale_sig( synth_16_fx[n], output_frame, negate( Q_synth ) ); // Q0 + Scale_sig( output_16_fx[n], L_FRAME48k, negate( Q_output ) ); // Q0 } /*---------------------------------------------------------------------* @@ -1147,8 +1147,8 @@ ivas_error ivas_core_dec_fx( q = 2; move16(); - Copy_Scale_sig_32_16( hb_synth_32_fx[n], hb_synth_16_fx[n], L_FRAME48k, -( Q11 ) ); // Q0 - Copy_Scale_sig_32_16( synth_32_fx[n], synth_fxl, output_frame, negate( add( Q11, q ) ) ); // Q0 + Copy_Scale_sig_32_16( hb_synth_32_fx[n], hb_synth_16_fx[n], L_FRAME48k, -( Q11 ) ); // Q0 + Copy_Scale_sig_32_16( synth_32_fx[n], synth_fxl, output_frame, negate( add( Q11, q ) ) ); // Q0 Scale_sig( hBWE_TD->state_lpc_syn_fx, LPC_SHB_ORDER, sub( Q8, hBWE_TD->prev_Q_bwe_syn ) ); // Q8 Copy_Scale_sig_32_16( hBWE_TD->genSHBsynth_state_lsyn_filt_shb_local_fx_32, hBWE_TD->genSHBsynth_state_lsyn_filt_shb_local_fx, ( 2 * ALLPASSSECTIONS_STEEP ), sub( hBWE_TD->prev_Q_bwe_syn2, Q11 ) ); // prev_Q_bew_syn2 diff --git a/lib_dec/ivas_mdct_core_dec_fx.c b/lib_dec/ivas_mdct_core_dec_fx.c index 71839557a..7d5f7d737 100644 --- a/lib_dec/ivas_mdct_core_dec_fx.c +++ b/lib_dec/ivas_mdct_core_dec_fx.c @@ -1172,13 +1172,13 @@ void ivas_mdct_core_reconstruct_fx( Scale_sig( st->hTcxDec->syn_Overl_TDAC, L_FRAME32k / 2, sub( q_win, st->hTcxDec->Q_syn_Overl_TDAC ) ); // st->hTcxDec->Q_syn_Overl_TDAC -> q_win Scale_sig( st->hTcxDec->old_syn_Overl, L_FRAME32k / 2, sub( q_win, st->hTcxDec->Q_old_syn_Overl ) ); // Q(-1 - st->Q_syn) -> q_win st->hTcxDec->Q_old_syn_Overl = q_win; - Scale_sig( st->hTcxDec->syn_Overl, L_FRAME32k / 2, sub( q_win, st->Q_syn ) ); // Q(st->Q_syn) -> q_win - Scale_sig( st->hTcxDec->syn_OverlFB, L_FRAME_MAX / 2, sub( q_win, st->Q_syn ) ); // Q(st->Q_syn) -> q_win - Scale_sig( st->hHQ_core->old_out_LB_fx, L_FRAME32k, sub( q_win, st->hHQ_core->Q_old_wtda_LB ) ); // Q(st->hHQ_core->Q_old_wtda_LB) -> q_win - Scale_sig( st->hHQ_core->old_out_fx, L_FRAME48k, sub( q_win, st->hHQ_core->Q_old_wtda ) ); // Q(st->hHQ_core->Q_old_wtda) -> q_win + Scale_sig( st->hTcxDec->syn_Overl, L_FRAME32k / 2, sub( q_win, st->Q_syn ) ); // Q(st->Q_syn) -> q_win + Scale_sig( st->hTcxDec->syn_OverlFB, L_FRAME_MAX / 2, sub( q_win, st->Q_syn ) ); // Q(st->Q_syn) -> q_win + Scale_sig( st->hHQ_core->old_out_LB_fx, L_FRAME32k, sub( q_win, st->hHQ_core->Q_old_wtda_LB ) ); // Q(st->hHQ_core->Q_old_wtda_LB) -> q_win + Scale_sig( st->hHQ_core->old_out_fx, L_FRAME48k, sub( q_win, st->hHQ_core->Q_old_wtda ) ); // Q(st->hHQ_core->Q_old_wtda) -> q_win Scale_sig( synth_buf_fx, add( add( st->hTcxDec->old_synth_len, L_FRAME_PLUS ), M ), sub( q_win, q_syn ) ); // q_syn -> q_win Scale_sig( synth_bufFB_fx, add( add( st->hTcxDec->old_synth_lenFB, L_FRAME_PLUS ), M ), sub( q_win, q_syn ) ); // q_syn -> q_win - Scale_sig( st->syn, M + 1, sub( q_win, st->Q_syn ) ); // st->Q_syn -> q_win + Scale_sig( st->syn, M + 1, sub( q_win, st->Q_syn ) ); // st->Q_syn -> q_win FOR( k = 0; k < nSubframes[ch]; k++ ) { init_tcx_info_fx( st, L_frame_global[ch], L_frame_globalTCX[ch], k, bfi, &tcx_offset[ch], diff --git a/lib_dec/ivas_spar_decoder_fx.c b/lib_dec/ivas_spar_decoder_fx.c index c3e2ad096..a7b66ff87 100644 --- a/lib_dec/ivas_spar_decoder_fx.c +++ b/lib_dec/ivas_spar_decoder_fx.c @@ -1352,7 +1352,7 @@ static void ivas_spar_calc_smooth_facs_fx( smooth_long_avg_fx[b] = L_add( smooth_long_avg_fx[b], smooth_buf_fx[b][i] ); // Q0 move32(); } - smooth_short_avg_fx[b] = Mpy_32_32( smooth_short_avg_fx[b], 357913941 /*(1/6 in Q31)*/ ); // Q0 + smooth_short_avg_fx[b] = Mpy_32_32( smooth_short_avg_fx[b], 357913941 /*(1/6 in Q31)*/ ); // Q0 move32(); smooth_long_avg_fx[b] = Mpy_32_32( smooth_long_avg_fx[b], 107374182 /*(1/20 in Q31)*/ ); // Q0 move32(); diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 429a99ca4..891be05be 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -961,7 +961,7 @@ typedef struct decoder_tc_buffer_structure Word32 *tc_buffer_fx; /* the buffer itself */ Word16 tc_buff_len; /*stores memory length of tc buffer*/ Word32 *tc_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; /* pointers into the buffer to the beginning of each tc Q11 for ivas */ // VE2SB: TBV - Word16 no_channels; /*Stores no of channels in tc_fx with values*/ + Word16 no_channels; /*Stores no of channels in tc_fx with values*/ Word16 q_tc_fx; TC_BUFFER_MODE tc_buffer_mode; /* mode of the buffer (no buffering, render buffering, out buffering) */ Word16 nchan_transport_jbm; /* number of TCs after TC decoding */ diff --git a/lib_dec/ivas_stereo_icbwe_dec_fx.c b/lib_dec/ivas_stereo_icbwe_dec_fx.c index 1c2ecffaf..c9f7cac92 100644 --- a/lib_dec/ivas_stereo_icbwe_dec_fx.c +++ b/lib_dec/ivas_stereo_icbwe_dec_fx.c @@ -718,8 +718,8 @@ void stereo_icBWE_dec_fx( IF( LE_16( ratio_L_fx, 29490 /* 0.9 in Q15*/ ) ) { tmp = mult_r( ratio_L_fx, ratio_L_fx ); // Q15 - tmp = mult_r( tmp, gsMapping_fx ); // Q14 - tmp = mult_r( tmp, gsMapping_fx ); // Q13 + tmp = mult_r( tmp, gsMapping_fx ); // Q14 + tmp = mult_r( tmp, gsMapping_fx ); // Q13 IF( LT_16( tmp, 4096 /* 0.5 in Q13*/ ) ) { temp1_fx = 0; @@ -813,7 +813,7 @@ void stereo_icBWE_dec_fx( hStereoICBWE->prev_Q_fsout = tmp; move16(); } - Scale_sig32( synth_fx, output_frame, sub( *Q_syn, add( 1, tmp ) ) ); /* Qsyn - 1 */ + Scale_sig32( synth_fx, output_frame, sub( *Q_syn, add( 1, tmp ) ) ); /* Qsyn - 1 */ *Q_syn = sub( *Q_syn, 1 ); @@ -877,8 +877,8 @@ void stereo_icBWE_dec_fx( IF( LE_16( ratio_L_fx, 29490 /* 0.9 in Q15*/ ) ) { tmp = mult_r( ratio_L_fx, ratio_L_fx ); // Q15 - tmp = mult_r( tmp, gsMapping_fx ); // Q14 - tmp = mult_r( tmp, gsMapping_fx ); // Q13 + tmp = mult_r( tmp, gsMapping_fx ); // Q14 + tmp = mult_r( tmp, gsMapping_fx ); // Q13 IF( LT_16( tmp, 4096 /* 0.5 in Q13*/ ) ) { temp1_fx = 0; diff --git a/lib_dec/ivas_svd_dec_fx.c b/lib_dec/ivas_svd_dec_fx.c index dd9859504..8a9224ffa 100644 --- a/lib_dec/ivas_svd_dec_fx.c +++ b/lib_dec/ivas_svd_dec_fx.c @@ -294,7 +294,6 @@ Word16 svd_fx( push_wmops( "svd_fx" ); - /* Collecting Values */ FOR( iCh = 0; iCh < nChannelsL; iCh++ ) { @@ -385,11 +384,11 @@ static Word16 BidagonalDiagonalisation_fx( Word32 singularVectors_Right_fx[][MAX_OUTPUT_CHANNELS], /* i/o: right singular vectors (V) singularValues_fx_e*/ Word32 secDiag_fx[MAX_OUTPUT_CHANNELS], /* i/o: secDiag_fx_e*/ Word16 singularValues_fx_e[MAX_OUTPUT_CHANNELS], /* i/o: singular values vector (S) */ - Word16 *secDiag_new_e, /* i/o: */ - const Word16 nChannelsL, /* i : number of rows in the matrix to be decomposed Q0*/ - const Word16 nChannelsC, /* i : number of columns in the matrix to be decomposed Q0*/ - const Word32 eps_x, /* i : eps_x_e*/ - const Word16 eps_x_e /* i : */ + Word16 *secDiag_new_e, /* i/o: */ + const Word16 nChannelsL, /* i : number of rows in the matrix to be decomposed Q0*/ + const Word16 nChannelsC, /* i : number of columns in the matrix to be decomposed Q0*/ + const Word32 eps_x, /* i : eps_x_e*/ + const Word16 eps_x_e /* i : */ ) { Word16 kCh, nCh, iCh, jCh, split; @@ -898,52 +897,52 @@ static void biDiagonalReductionLeft_fx( secDiag_e[currChannel] = *sig_x_e; move16(); -/* Setting values to 0 */ -( *sig_x ) = 0; -move32(); -( *g ) = 0; -move32(); - -IF( LT_16( currChannel, nChannelsL ) ) /* i <= m */ -{ - idx = currChannel; - move16(); - - FOR( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ - { - ( *sig_x ) = BASOP_Util_Add_Mant32Exp( *sig_x, *sig_x_e, L_abs( singularVectors[jCh][currChannel] ), singularVectors2_e[jCh][currChannel], sig_x_e ); /* exp(sig_x_e) */ - } + /* Setting values to 0 */ + ( *sig_x ) = 0; + move32(); + ( *g ) = 0; + move32(); - IF( ( *sig_x ) ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */ + IF( LT_16( currChannel, nChannelsL ) ) /* i <= m */ { - Word16 invVal_e; - Word32 invVal; - invVal = BASOP_Util_Divide3232_Scale_cadence( MAXVAL_WORD32, maxWithSign_fx( *sig_x ), &invVal_e ); - norm_x = 0; - move32(); - norm_x_e = 0; + idx = currChannel; move16(); + FOR( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ { + ( *sig_x ) = BASOP_Util_Add_Mant32Exp( *sig_x, *sig_x_e, L_abs( singularVectors[jCh][currChannel] ), singularVectors2_e[jCh][currChannel], sig_x_e ); /* exp(sig_x_e) */ + } + + IF( ( *sig_x ) ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */ + { + Word16 invVal_e; + Word32 invVal; + invVal = BASOP_Util_Divide3232_Scale_cadence( MAXVAL_WORD32, maxWithSign_fx( *sig_x ), &invVal_e ); + norm_x = 0; + move32(); + norm_x_e = 0; + move16(); + FOR( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ + { Word16 temp_e = norm_l( singularVectors[jCh][currChannel] ); singularVectors[jCh][currChannel] = Mpy_32_32( L_shl( singularVectors[jCh][currChannel], temp_e ), invVal ); /* exp(sing_exp + (singularVectors_e - sig_x_e) */ move32(); singularVectors2_e[jCh][currChannel] = sub( add( invVal_e, sub( singularVectors2_e[jCh][currChannel], *sig_x_e ) ), temp_e ); move16(); norm_x = BASOP_Util_Add_Mant32Exp( norm_x, norm_x_e, Mpy_32_32( singularVectors[jCh][currChannel], singularVectors[jCh][currChannel] ), shl( singularVectors2_e[jCh][currChannel], 1 ), &norm_x_e ); /* exp(norm_x_e) */ - } - IF( GT_16( norm_x_e, 0 ) ) - { - norm_x = MAX_32; - move32(); - norm_x_e = 0; + } + IF( GT_16( norm_x_e, 0 ) ) + { + norm_x = MAX_32; + move32(); + norm_x_e = 0; + move16(); + } + L_temp_e = norm_x_e; move16(); - } - L_temp_e = norm_x_e; - move16(); - L_temp = Sqrt32( norm_x, &L_temp_e ); - L_temp = L_shl_r( L_temp, L_temp_e ); // Q31 - //( *g ) = L_negate( GE_32( singularVectors[currChannel][idx], 0 ) ? L_temp : L_negate( L_temp ) ); + L_temp = Sqrt32( norm_x, &L_temp_e ); + L_temp = L_shl_r( L_temp, L_temp_e ); // Q31 + //( *g ) = L_negate( GE_32( singularVectors[currChannel][idx], 0 ) ? L_temp : L_negate( L_temp ) ); if ( singularVectors[currChannel][idx] >= 0 ) { L_temp = L_negate( L_temp ); @@ -951,52 +950,51 @@ IF( LT_16( currChannel, nChannelsL ) ) /* i <= m */ ( *g ) = L_temp; move32(); - r = BASOP_Util_Add_Mant32Exp( Mpy_32_32( ( *g ), singularVectors[currChannel][idx] ), singularVectors2_e[currChannel][idx], -norm_x, norm_x_e, &r_e ); /* exp(r_e) */ - singularVectors[currChannel][idx] = BASOP_Util_Add_Mant32Exp( singularVectors[currChannel][idx], singularVectors2_e[currChannel][idx], -( *g ), 0, &singularVectors2_e[currChannel][idx] ); /* sing_exp */ - move32(); + r = BASOP_Util_Add_Mant32Exp( Mpy_32_32( ( *g ), singularVectors[currChannel][idx] ), singularVectors2_e[currChannel][idx], -norm_x, norm_x_e, &r_e ); /* exp(r_e) */ + singularVectors[currChannel][idx] = BASOP_Util_Add_Mant32Exp( singularVectors[currChannel][idx], singularVectors2_e[currChannel][idx], -( *g ), 0, &singularVectors2_e[currChannel][idx] ); /* sing_exp */ + move32(); - invVal = BASOP_Util_Divide3232_Scale_cadence( MAXVAL_WORD32, maxWithSign_fx( r ), &invVal_e ); + invVal = BASOP_Util_Divide3232_Scale_cadence( MAXVAL_WORD32, maxWithSign_fx( r ), &invVal_e ); - FOR( iCh = currChannel + 1; iCh < nChannelsC; iCh++ ) /* nChannelsC */ - { - norm_x = 0; - move32(); - norm_x_e = 0; - move16(); - FOR( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ + FOR( iCh = currChannel + 1; iCh < nChannelsC; iCh++ ) /* nChannelsC */ { + norm_x = 0; + move32(); + norm_x_e = 0; + move16(); + FOR( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ + { norm_x = BASOP_Util_Add_Mant32Exp( norm_x, norm_x_e, Mpy_32_32( singularVectors[jCh][currChannel], singularVectors[jCh][iCh] ), add( singularVectors2_e[jCh][currChannel], singularVectors2_e[jCh][iCh] ), &norm_x_e ); /* exp(norm_x_e) */ - } + } - f = Mpy_32_32( norm_x, invVal ); /* invVal_e + (norm_x_e - r_e) */ + f = Mpy_32_32( norm_x, invVal ); /* invVal_e + (norm_x_e - r_e) */ f_e = add( invVal_e, sub( norm_x_e, r_e ) ); - FOR( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ - { + FOR( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ + { singularVectors[jCh][iCh] = BASOP_Util_Add_Mant32Exp( singularVectors[jCh][iCh], singularVectors2_e[jCh][iCh], Mpy_32_32( f, singularVectors[jCh][currChannel] ), add( f_e, singularVectors2_e[jCh][currChannel] ), &singularVectors2_e[jCh][iCh] ); - move32(); + move32(); + } } - } - FOR( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ - { - singularVectors[jCh][currChannel] = Mpy_32_32( singularVectors[jCh][currChannel], ( *sig_x ) ); /* sing_exp + sig_x_e */ - move32(); + FOR( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ + { + singularVectors[jCh][currChannel] = Mpy_32_32( singularVectors[jCh][currChannel], ( *sig_x ) ); /* sing_exp + sig_x_e */ + move32(); singularVectors2_e[jCh][currChannel] = add( singularVectors2_e[jCh][currChannel], *sig_x_e ); - move16(); + move16(); + } } + // rescaling block + singularValues[currChannel] = Mpy_32_32( ( *sig_x ), ( *g ) ); /* sig_x_e */ + move32(); + singularValues_e[currChannel] = *sig_x_e; + move16(); } - // rescaling block - singularValues[currChannel] = Mpy_32_32( ( *sig_x ), ( *g ) ); /* sig_x_e */ - move32(); - singularValues_e[currChannel] = *sig_x_e; - move16(); -} - -return; + return; } /*------------------------------------------------------------------------- @@ -1108,7 +1106,7 @@ static void biDiagonalReductionRight_fx( FOR( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ { - singularVectors[iCh][jCh] = BASOP_Util_Add_Mant32Exp( singularVectors[iCh][jCh], singularVectors2_e[iCh][jCh], Mpy_32_32( norm_x, secDiag[jCh] ), add( norm_x_e, secDiag_exp[jCh] ), &singularVectors2_e[iCh][jCh] ); /* exp(sing_exp2) */ + singularVectors[iCh][jCh] = BASOP_Util_Add_Mant32Exp( singularVectors[iCh][jCh], singularVectors2_e[iCh][jCh], Mpy_32_32( norm_x, secDiag[jCh] ), add( norm_x_e, secDiag_exp[jCh] ), &singularVectors2_e[iCh][jCh] ); /* exp(sing_exp2) */ move32(); } } @@ -1120,9 +1118,6 @@ static void biDiagonalReductionRight_fx( singularVectors2_e[currChannel][jCh] = add( singularVectors2_e[currChannel][jCh], *sig_x_e ); move16(); } - - - } } @@ -1230,7 +1225,7 @@ static void singularVectorsAccumulationLeft_fx( { FOR( iCh = 0; iCh < nChannelsC; iCh++ ) { - singularVectors_Left[nCh][iCh] = L_shl_sat( singularVectors_Left[nCh][iCh], singularVectors_Left_e[nCh][iCh] ); /* Q31 */ + singularVectors_Left[nCh][iCh] = L_shl_sat( singularVectors_Left[nCh][iCh], singularVectors_Left_e[nCh][iCh] ); /* Q31 */ move32(); } } diff --git a/lib_enc/acelp_core_enc_fx.c b/lib_enc/acelp_core_enc_fx.c index a93690738..f9f941dbd 100644 --- a/lib_enc/acelp_core_enc_fx.c +++ b/lib_enc/acelp_core_enc_fx.c @@ -1430,7 +1430,7 @@ ivas_error acelp_core_enc_ivas_fx( test(); IF( st->element_mode > EVS_MONO && st->hTcxEnc != NULL ) { - Copy( syn1_fx + shr( st->L_frame, 1 ), st->hTcxEnc->Txnq, shr( st->L_frame, 1 ) ); // st->Q_syn + Copy( syn1_fx + shr( st->L_frame, 1 ), st->hTcxEnc->Txnq, shr( st->L_frame, 1 ) ); // st->Q_syn Scale_sig( st->hTcxEnc->Txnq + shr( st->L_frame, 1 ), sub( L_FRAME32k / 2 + 64, shr( st->L_frame, 1 ) ), sub( st->Q_syn, st->hTcxEnc->q_Txnq ) ); // st->Q_syn st->hTcxEnc->q_Txnq = st->Q_syn; move16(); diff --git a/lib_enc/cod_tcx_fx.c b/lib_enc/cod_tcx_fx.c index 54f57b287..bb35cf037 100644 --- a/lib_enc/cod_tcx_fx.c +++ b/lib_enc/cod_tcx_fx.c @@ -4525,7 +4525,6 @@ void coder_tcx_fx( n, st, hm_cfg ); - } diff --git a/lib_enc/core_enc_init_fx.c b/lib_enc/core_enc_init_fx.c index 405b3ac2b..14dbd5962 100644 --- a/lib_enc/core_enc_init_fx.c +++ b/lib_enc/core_enc_init_fx.c @@ -943,8 +943,8 @@ static void init_modes_fx( void init_coder_ace_plus_ivas_fx( Encoder_State *st, /* i : Encoder state */ const Word32 last_total_brate, /* i : last total bitrate */ - const Word32 igf_brate, /* i : IGF configuration bitrate */ - const Word16 MCT_flag /* i : hMCT handle allocated (1) or not (0) */ + const Word32 igf_brate, /* i : IGF configuration bitrate */ + const Word16 MCT_flag /* i : hMCT handle allocated (1) or not (0) */ ) { TCX_ENC_HANDLE hTcxEnc = st->hTcxEnc; diff --git a/lib_enc/dtx_fx.c b/lib_enc/dtx_fx.c index 44be8dcc6..9a66572ab 100644 --- a/lib_enc/dtx_fx.c +++ b/lib_enc/dtx_fx.c @@ -60,12 +60,12 @@ static void update_SID_cnt_fx( DTX_ENC_HANDLE hDtxEnc, const Word32 core_brate, /* _ None */ /*==================================================================================*/ void dtx_ivas_fx( - Encoder_State *st_fx, /* i/o: encoder state structure */ + Encoder_State *st_fx, /* i/o: encoder state structure */ const Word32 last_ivas_total_brate, /* i : last IVAS total bitrate Q0*/ - const Word32 ivas_total_brate, /* i : IVAS total bitrate Q0*/ - const Word16 vad, /* i : vad flag for DTX Q0*/ - const Word16 speech[], /* i : Pointer to the speech frame Q_speech*/ - Word16 Q_speech /* i : Q factor for speech */ + const Word32 ivas_total_brate, /* i : IVAS total bitrate Q0*/ + const Word16 vad, /* i : vad flag for DTX Q0*/ + const Word16 speech[], /* i : Pointer to the speech frame Q_speech*/ + Word16 Q_speech /* i : Q factor for speech */ ) { Word16 alpha, i, j, Q_speech2; diff --git a/lib_enc/enc_acelpx_fx.c b/lib_enc/enc_acelpx_fx.c index 9612696ed..240f9859c 100644 --- a/lib_enc/enc_acelpx_fx.c +++ b/lib_enc/enc_acelpx_fx.c @@ -781,7 +781,7 @@ void E_ACELP_4tsearchx_ivas_fx( alp = shr( alp, 1 ); Scale_sig( cor, L_SUBFR, -1 ); /*Q8*/ Scale_sig( R_buf, 2 * L_SUBFR - 1, -1 ); /*Q8+scale*/ - Scale_sig( dn, L_SUBFR, -1 ); /*Qdn-1*/ + Scale_sig( dn, L_SUBFR, -1 ); /*Qdn-1*/ } diff --git a/lib_enc/hq_core_enc_fx.c b/lib_enc/hq_core_enc_fx.c index 6bc466e3d..ff19cfebc 100644 --- a/lib_enc/hq_core_enc_fx.c +++ b/lib_enc/hq_core_enc_fx.c @@ -481,8 +481,8 @@ void hq_core_enc_ivas_fx( TCX_MDCT( wtda_audio_fx16, t_audio_fx, &Q_audio, left_overlap, sub( L_spec, shr( add( left_overlap, right_overlap ), 1 ) ), right_overlap, st->element_mode ); Q_audio = sub( Q31, Q_audio ); Copy_Scale_sig_16_32_no_sat( wtda_audio_fx16, wtda_audio_fx32, 2 * L_FRAME48k, sub( Q_audio, q ) ); /* Q_audio */ - inner_frame = inner_frame_tbl[st->bwidth]; /* Q0 */ - L_spec = l_spec_ext_tbl[st->bwidth]; /* Q0 */ + inner_frame = inner_frame_tbl[st->bwidth]; /* Q0 */ + L_spec = l_spec_ext_tbl[st->bwidth]; /* Q0 */ is_transient = 0; move16(); move16(); diff --git a/lib_enc/igf_enc.c b/lib_enc/igf_enc.c index d5f071784..2680bd9f6 100644 --- a/lib_enc/igf_enc.c +++ b/lib_enc/igf_enc.c @@ -2517,8 +2517,8 @@ void IGFEncResetTCX10BitCounter_ivas_fx( *-------------------------------------------------------------------*/ void IGFEncApplyMono_ivas_fx( - Encoder_State *st, /* i : Encoder state */ - Word16 powerSpectrum_len, /* i: length of pPowerSpectrum_fx buffer */ + Encoder_State *st, /* i : Encoder state */ + Word16 powerSpectrum_len, /* i: length of pPowerSpectrum_fx buffer */ const Word16 igfGridIdx, /* i : IGF grid index */ Word32 *pMDCTSpectrum_fx, /* i/o: MDCT spectrum */ Word16 e_mdct, /* i : exponent of pMDCTspectrum */ diff --git a/lib_enc/ivas_core_pre_proc_front_fx.c b/lib_enc/ivas_core_pre_proc_front_fx.c index bf7c36eef..96c1b168f 100644 --- a/lib_enc/ivas_core_pre_proc_front_fx.c +++ b/lib_enc/ivas_core_pre_proc_front_fx.c @@ -125,14 +125,14 @@ ivas_error pre_proc_front_ivas_fx( const Word16 localVAD_HE_SAD_LR[], /* i : HE-SAD flag without hangover, LR channels Q0*/ Word32 band_energies_LR_fx[2 * NB_BANDS], /* o : energy in critical bands without minimum noise floor E_MIN (band_energies_LR_fx_q)*/ Word16 band_energies_LR_fx_q, - const Word16 flag_16k_smc, /* i : flag to indicate if the OL SMC is run at 16 kHz Q0*/ - const Word16 front_vad_flag, /* i : front-VAD flag to overwrite VAD decision Q0*/ - const Word16 force_front_vad, /* i : flag to force VAD decision Q0*/ - const Word16 front_vad_dtx_flag, /* i : front-VAD DTX flag to overwrite VAD decision Q0*/ - const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const Word16 MCT_flag, /* i : hMCT handle allocated (1) or not (0) Q0*/ + const Word16 flag_16k_smc, /* i : flag to indicate if the OL SMC is run at 16 kHz Q0*/ + const Word16 front_vad_flag, /* i : front-VAD flag to overwrite VAD decision Q0*/ + const Word16 force_front_vad, /* i : flag to force VAD decision Q0*/ + const Word16 front_vad_dtx_flag, /* i : front-VAD DTX flag to overwrite VAD decision Q0*/ + const IVAS_FORMAT ivas_format, /* i : IVAS format */ + const Word16 MCT_flag, /* i : hMCT handle allocated (1) or not (0) Q0*/ const Word32 last_ivas_total_brate, /* i : last IVAS total bitrate Q0*/ - const Word32 ivas_total_brate, /* i : IVAS total bitrate - for setting the DTX Q0*/ + const Word32 ivas_total_brate, /* i : IVAS total bitrate - for setting the DTX Q0*/ Word16 *Q_new #ifdef DEBUG_MODE_INFO , diff --git a/lib_enc/ivas_dirac_enc_fx.c b/lib_enc/ivas_dirac_enc_fx.c index 59447c022..615a6f4b6 100644 --- a/lib_enc/ivas_dirac_enc_fx.c +++ b/lib_enc/ivas_dirac_enc_fx.c @@ -51,11 +51,9 @@ static void computeIntensityVector_enc_fx( Word32 Cldfb_ImagBuffer[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], const Word16 enc_param_start_band, /* i : first band to process */ const Word16 num_frequency_bands, - Word32 intensity_real[DIRAC_NUM_DIMS][DIRAC_MAX_NBANDS] - , + Word32 intensity_real[DIRAC_NUM_DIMS][DIRAC_MAX_NBANDS], Word16 q_cldfb, - Word16 q_intensity_real[DIRAC_MAX_NBANDS] -); + Word16 q_intensity_real[DIRAC_MAX_NBANDS] ); /*------------------------------------------------------------------------- * ivas_dirac_enc_open() @@ -1123,11 +1121,9 @@ void ivas_dirac_param_est_enc_fx( Cldfb_ImagBuffer_fx, hDirAC->hConfig->enc_param_start_band, num_freq_bands, - intensity_real_fx - , + intensity_real_fx, cldfb_q, - intensity_real_q - ); + intensity_real_q ); IF( !hodirac_flag ) { computeDirectionVectors_fixed( @@ -1138,10 +1134,8 @@ void ivas_dirac_param_est_enc_fx( num_freq_bands, direction_vector_fx[0], direction_vector_fx[1], - direction_vector_fx[2] - , - 31, intensity_real_q - ); + direction_vector_fx[2], + 31, intensity_real_q ); direction_vector_q = Q30; move16(); @@ -1465,8 +1459,7 @@ static void computeIntensityVector_enc_fx( Word32 intensity_real[DIRAC_NUM_DIMS][DIRAC_MAX_NBANDS] /* q_intensity_real */ , Word16 q_cldfb, - Word16 q_intensity_real[DIRAC_MAX_NBANDS] -) + Word16 q_intensity_real[DIRAC_MAX_NBANDS] ) { /* Reminder * X = a + ib; Y = c + id diff --git a/lib_enc/ivas_mcmasa_enc_fx.c b/lib_enc/ivas_mcmasa_enc_fx.c index 0071b67ea..7a5718e99 100644 --- a/lib_enc/ivas_mcmasa_enc_fx.c +++ b/lib_enc/ivas_mcmasa_enc_fx.c @@ -1178,10 +1178,8 @@ void ivas_mcmasa_param_est_enc_fx( num_freq_bands, direction_vector_fx[0], direction_vector_fx[1], - direction_vector_fx[2], c_e - , - NULL - ); + direction_vector_fx[2], c_e, + NULL ); /* Power and intensity estimation for diffuseness */ computeIntensityVector_enc_fx( diff --git a/lib_enc/ivas_mdct_core_enc_fx.c b/lib_enc/ivas_mdct_core_enc_fx.c index 4b5b3fcbe..f7da231a3 100644 --- a/lib_enc/ivas_mdct_core_enc_fx.c +++ b/lib_enc/ivas_mdct_core_enc_fx.c @@ -429,11 +429,11 @@ static void kernel_switch_update_transforms_fx( Word32 factor; n = extract_l( Mpy_32_32( s, 603979776 /* N_ZERO_MDCT_NS / FRAME_SIZE_NS in Q31 */ ) ); - Scale_sig( &tcxTimeSignal[n - s], add( sub( shl( s, 1 ), n ), 1 ), -Q1 ); // Q0 -> Q-1 + Scale_sig( &tcxTimeSignal[n - s], add( sub( shl( s, 1 ), n ), 1 ), -Q1 ); // Q0 -> Q-1 wtda_ext_fx( tcxTimeSignal, windowedTimeSignal_16, extract_l( windowedTimeSignal[0] ), extract_l( windowedTimeSignal[1] ), s, kernelType ); // Q-2 - Scale_sig( &tcxTimeSignal[n - s], add( sub( shl( s, 1 ), n ), 1 ), Q1 ); // Q-1 -> Q0 - Copy_Scale_sig_16_32_no_sat( windowedTimeSignal_16 /* Q(-2) */, windowedTimeSignal, s, Q16 ); // Q14 - scale_sig32( windowedTimeSignal, s, -Q8 /* guard bits */ ); // Q6 + Scale_sig( &tcxTimeSignal[n - s], add( sub( shl( s, 1 ), n ), 1 ), Q1 ); // Q-1 -> Q0 + Copy_Scale_sig_16_32_no_sat( windowedTimeSignal_16 /* Q(-2) */, windowedTimeSignal, s, Q16 ); // Q14 + scale_sig32( windowedTimeSignal, s, -Q8 /* guard bits */ ); // Q6 edxt_fx( windowedTimeSignal, sigR, s, kernelType, FALSE ); tmp = BASOP_Util_Divide1616_Scale( NORM_MDCT_FACTOR, s, &exp_tmp ); @@ -896,8 +896,8 @@ static UWord16 enc_ste_pre_mdct( absMagnR_fx = Sqrt32( L_add( Mpy_32_32( sigR1_fx[s], sigR1_fx[s] ), Mpy_32_32( sigI1_fx[s], sigI1_fx[s] ) ), &absMagnR_e ); corr_fx = L_add( corr_fx, L_add( Mpy_32_32( sigR0_fx[s], sigR1_fx[s] ), Mpy_32_32( sigI0_fx[s], sigI1_fx[s] ) ) ); // q_com*2 - 31 - sumL_fx = L_add( sumL_fx, L_add( L_shr( sigR0_fx[s], 1 ), L_shr( sigI0_fx[s], 1 ) ) ); // q_com -1 - sumR_fx = L_add( sumR_fx, L_add( L_shr( sigR1_fx[s], 1 ), L_shr( sigI1_fx[s], 1 ) ) ); // q_com - 1 + sumL_fx = L_add( sumL_fx, L_add( L_shr( sigR0_fx[s], 1 ), L_shr( sigI0_fx[s], 1 ) ) ); // q_com -1 + sumR_fx = L_add( sumR_fx, L_add( L_shr( sigR1_fx[s], 1 ), L_shr( sigI1_fx[s], 1 ) ) ); // q_com - 1 sumMagnL_fx = BASOP_Util_Add_Mant32Exp( sumMagnL_fx, sumMagnL_e, absMagnL_fx, absMagnL_e, &sumMagnL_e ); sumMagnR_fx = BASOP_Util_Add_Mant32Exp( sumMagnR_fx, sumMagnR_e, absMagnR_fx, absMagnR_e, &sumMagnR_e ); sumPrdLR_fx = BASOP_Util_Add_Mant32Exp( sumPrdLR_fx, sumPrdLR_e, Mpy_32_32( absMagnL_fx, absMagnR_fx ), add( absMagnL_e, absMagnR_e ), &sumPrdLR_e ); diff --git a/lib_enc/ivas_omasa_enc_fx.c b/lib_enc/ivas_omasa_enc_fx.c index 1433c988f..f1187bc6c 100644 --- a/lib_enc/ivas_omasa_enc_fx.c +++ b/lib_enc/ivas_omasa_enc_fx.c @@ -1199,10 +1199,8 @@ static void ivas_omasa_param_est_enc_fx( computeIntensityVector_enc_fx( hOMasa->band_grouping, Foa_RealBuffer_fx, Foa_ImagBuffer_fx, num_freq_bands, intensity_real_fx, guard_bits ); intensity_real_e = sub( add( 62, guard_bits ), shl( q, 1 ) ); - computeDirectionVectors_fixed( intensity_real_fx[0], intensity_real_fx[1], intensity_real_fx[2], 0, num_freq_bands, direction_vector_fx[0], direction_vector_fx[1], direction_vector_fx[2], intensity_real_e - , - NULL - ); + computeDirectionVectors_fixed( intensity_real_fx[0], intensity_real_fx[1], intensity_real_fx[2], 0, num_freq_bands, direction_vector_fx[0], direction_vector_fx[1], direction_vector_fx[2], intensity_real_e, + NULL ); /* Power estimation for diffuseness */ diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index 4a6543026..f421fd034 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -1179,7 +1179,7 @@ typedef struct stereo_dmx_evs_correlation_filter_structure { Word16 init_frmCntr; - Word32 isd_rate_s_fx; // Q31 + Word32 isd_rate_s_fx; // Q31 Word32 iccr_s_fx; // Q31 Word32 ipd_ff_fx[STEREO_DMX_EVS_NB_SUBBAND_MAX]; // Q31 Word32 Pr_fx[STEREO_DMX_EVS_NB_SUBBAND_MAX]; // Q31 diff --git a/lib_enc/ivas_stereo_dmx_evs_fx.c b/lib_enc/ivas_stereo_dmx_evs_fx.c index 2ed17e25a..625ff8ee9 100644 --- a/lib_enc/ivas_stereo_dmx_evs_fx.c +++ b/lib_enc/ivas_stereo_dmx_evs_fx.c @@ -155,8 +155,8 @@ static ivas_error estimate_itd_fx( STEREO_DMX_EVS_PHA_HANDLE hPHA, /* i/o: correlation filter structure */ const Word32 srcL[], /* i : Lch input signal Q16 */ const Word32 srcR[], /* i : Rch input signal Q16 */ - Word16 itd[], /* o : estimated itd Q0 */ - const Word16 input_frame /* i : input frame length per channel */ + Word16 itd[], /* o : estimated itd Q0 */ + const Word16 input_frame /* i : input frame length per channel */ ); static void adapt_gain_fx( const Word32 src_fx[], /* i : input signal Q16 */ @@ -198,9 +198,9 @@ static void create_M_signal_fx( ); static Word32 find_poc_peak_fx( STEREO_DMX_EVS_POC_HANDLE hPOC, /* i/o: phase only correlation structure */ - Word16 itd_fx[], /* o : estimated itd */ - const Word16 input_frame, /* i : input frame length per channel */ - const Word32 ratio_fixed /* i : adapting ratio */ + Word16 itd_fx[], /* o : estimated itd */ + const Word16 input_frame, /* i : input frame length per channel */ + const Word32 ratio_fixed /* i : adapting ratio */ ); /*-------------------------------------------------------------------* * estimate_itd_wnd_fft() @@ -1136,9 +1136,9 @@ static void calc_poc_fx( *-------------------------------------------------------------------*/ static Word32 find_poc_peak_fx( STEREO_DMX_EVS_POC_HANDLE hPOC, /* i/o: phase only correlation structure */ - Word16 itd_fx[], /* o : estimated itd Q0 */ - const Word16 input_frame, /* i : input frame length per channel */ - const Word32 ratio_fixed /* i : adapting ratio Q31 */ + Word16 itd_fx[], /* o : estimated itd Q0 */ + const Word16 input_frame, /* i : input frame length per channel */ + const Word32 ratio_fixed /* i : adapting ratio Q31 */ ) { Word16 itd_cand[CPE_CHANNELS], i, n, cnt[CPE_CHANNELS], Lh, peak_range, *on, *itdLR, prev_off[CPE_CHANNELS], eps_fx; @@ -1448,8 +1448,8 @@ static ivas_error estimate_itd_fx( STEREO_DMX_EVS_PHA_HANDLE hPHA, /* i/o: correlation filter structure */ const Word32 srcL[], /* i : Lch input signal Q16 */ const Word32 srcR[], /* i : Rch input signal Q16 */ - Word16 itd[], /* o : estimated itd Q0 */ - const Word16 input_frame /* i : input frame length per channel */ + Word16 itd[], /* o : estimated itd Q0 */ + const Word16 input_frame /* i : input frame length per channel */ ) { Word32 specLr[L_FRAME48k / 2 + 1], specLi[L_FRAME48k / 2 + 1], specRr[L_FRAME48k / 2 + 1], specRi[L_FRAME48k / 2 + 1]; diff --git a/lib_enc/ivas_stereo_ica_enc_fx.c b/lib_enc/ivas_stereo_ica_enc_fx.c index 8410f7546..78ea50d7e 100644 --- a/lib_enc/ivas_stereo_ica_enc_fx.c +++ b/lib_enc/ivas_stereo_ica_enc_fx.c @@ -1095,8 +1095,8 @@ static void corrStatsEst_fx( hStereoTCA->delay_0_mem_fx[MAX_DELAYREGLEN - 1] = BASOP_Util_Add_Mant32Exp( Mpy_32_32( hStereoTCA->delay_0_mem_fx[MAX_DELAYREGLEN - 1], 429496730 /* 0.2 in Q31*/ ), hStereoTCA->delay_0_mem_exp, L_mult0( 26214 /* 0.8 in Q15*/, corrLagStats[0] ), Q16, &temp ); /* Q31-temp */ move32(); Word32 inpp = L_abs( BASOP_Util_Add_Mant32Exp( reg_prv_corr_fx, reg_prv_corr_exp, L_negate( hStereoTCA->delay_0_mem_fx[0] ), hStereoTCA->delay_0_mem_exp, &exp ) ); /* Q31-exp */ - inpp = L_shl_sat( inpp, sub( exp, 5 ) ); /* Q26 */ - IF( GT_32( inpp, 1677721600 ) ) // 25 in Q26 + inpp = L_shl_sat( inpp, sub( exp, 5 ) ); /* Q26 */ + IF( GT_32( inpp, 1677721600 ) ) // 25 in Q26 { set32_fx( &( hStereoTCA->delay_0_mem_fx[0] ), hStereoTCA->delay_0_mem_fx[MAX_DELAYREGLEN - 1], MAX_DELAYREGLEN - 1 ); hStereoTCA->delay_0_mem_exp = temp; @@ -1964,8 +1964,8 @@ void stereo_tca_enc_fx( Word16 temp_exp, tempF_16fx; Word16 scalar_value = BASOP_Util_Divide1616_Scale( currentNCShift, dsFactor, &temp_exp ); /* Q15-temp_exp */ - scalar_value = shl_sat( scalar_value, sub( temp_exp, 5 ) ); /*Q10*/ - hStereoTCA->indx_ica_NCShift = usquant_fx( scalar_value, &tempF_16fx, 0, 512 /* 0.5 in Q10 */, ( 1 << STEREO_BITS_TCA_CORRSTATS ) ); /* Q0 */ + scalar_value = shl_sat( scalar_value, sub( temp_exp, 5 ) ); /*Q10*/ + hStereoTCA->indx_ica_NCShift = usquant_fx( scalar_value, &tempF_16fx, 0, 512 /* 0.5 in Q10 */, ( 1 << STEREO_BITS_TCA_CORRSTATS ) ); /* Q0 */ tempF_fx = tempF_16fx; move32(); diff --git a/lib_enc/ivas_stereo_icbwe_enc_fx.c b/lib_enc/ivas_stereo_icbwe_enc_fx.c index 25e2366dd..02d20543b 100644 --- a/lib_enc/ivas_stereo_icbwe_enc_fx.c +++ b/lib_enc/ivas_stereo_icbwe_enc_fx.c @@ -822,7 +822,7 @@ void stereo_icBWE_enc_ivas_fx( set32_fx( shb_frame_nonref_fx, 0, L_LOOK_16k + L_FRAME16k ); max_e = s_max( hStereoICBWE->mem_shb_speech_nonref_e, shb_speech_nonref_e ); - Copy_Scale_sig( hStereoICBWE->mem_shb_speech_nonref_fx, hStereoICBWE->mem_shb_speech_nonref_fx, L_LOOK_16k, negate( sub( max_e, hStereoICBWE->mem_shb_speech_nonref_e ) ) ); // mem_shb_speech_ref_e + Copy_Scale_sig( hStereoICBWE->mem_shb_speech_nonref_fx, hStereoICBWE->mem_shb_speech_nonref_fx, L_LOOK_16k, negate( sub( max_e, hStereoICBWE->mem_shb_speech_nonref_e ) ) ); // mem_shb_speech_ref_e Copy_Scale_sig_16_32_no_sat( hStereoICBWE->mem_shb_speech_nonref_fx, shb_frame_nonref_fx, L_LOOK_16k, add( negate( sub( max_e, hStereoICBWE->mem_shb_speech_nonref_e ) ), Q16 ) ); // mem_shb_speech_ref_e hStereoICBWE->mem_shb_speech_nonref_e = max_e; shb_frame_nonref_e = max_e; diff --git a/lib_enc/ivas_stereo_td_analysis_fx.c b/lib_enc/ivas_stereo_td_analysis_fx.c index f9b6b0bf3..6ffd05c0c 100644 --- a/lib_enc/ivas_stereo_td_analysis_fx.c +++ b/lib_enc/ivas_stereo_td_analysis_fx.c @@ -71,13 +71,13 @@ #define RATIO_MAX 1.5f /* Maximum correlation ratio */ -#define RATIO_MAX_FX_Q30 ( 1610612736 ) /* 1.5f in Q30 */ /* Maximum correlation ratio */ -#define RATIO_MAX_FX_Q24 ( 25165824 ) /* 1.5f in Q24 */ /* Maximum correlation ratio */ -#define RATIO_MAX_FX_Q23 ( 12582912 ) /* 1.5f in Q23 */ /* Maximum correlation ratio */ -#define LIMIT_ADAP_FAC_FX_Q16 ( 9830 ) /* 0.15f in Q16 */ -#define MIN_ADAP_FAC_FX_Q16 ( 6554 ) /*0.1f in Q16*/ -#define M_ADAP_FX_Q31 ( 1932735 ) /* 0.0009f in Q31 */ -#define B_ADAP_FX_Q16 ( 10486 ) /* 0.16f in Q16 */ +#define RATIO_MAX_FX_Q30 ( 1610612736 ) /* 1.5f in Q30 */ /* Maximum correlation ratio */ +#define RATIO_MAX_FX_Q24 ( 25165824 ) /* 1.5f in Q24 */ /* Maximum correlation ratio */ +#define RATIO_MAX_FX_Q23 ( 12582912 ) /* 1.5f in Q23 */ /* Maximum correlation ratio */ +#define LIMIT_ADAP_FAC_FX_Q16 ( 9830 ) /* 0.15f in Q16 */ +#define MIN_ADAP_FAC_FX_Q16 ( 6554 ) /*0.1f in Q16*/ +#define M_ADAP_FX_Q31 ( 1932735 ) /* 0.0009f in Q31 */ +#define B_ADAP_FX_Q16 ( 10486 ) /* 0.16f in Q16 */ #define PC_LIMIT 64 #define RATIO_PG_HR 0.94f diff --git a/lib_enc/ivas_td_low_rate_enc_fx.c b/lib_enc/ivas_td_low_rate_enc_fx.c index 63cbb30e9..bdc39e797 100644 --- a/lib_enc/ivas_td_low_rate_enc_fx.c +++ b/lib_enc/ivas_td_low_rate_enc_fx.c @@ -338,8 +338,8 @@ void encod_gen_2sbfr( * Update memory of the weighting filter *-----------------------------------------------------------------*/ - Ltmp = L_mult0( gcode16, y2[2 * L_SUBFR - 1] ); /*Q10*/ - Ltmp = L_shl( Ltmp, add( 5, shift ) ); /*Q15+shift*/ + Ltmp = L_mult0( gcode16, y2[2 * L_SUBFR - 1] ); /*Q10*/ + Ltmp = L_shl( Ltmp, add( 5, shift ) ); /*Q15+shift*/ Ltmp = L_negate( Ltmp ); Ltmp = L_mac( Ltmp, xn[2 * L_SUBFR - 1], 16384 /*Q14*/ ); /* Q_new-1+shift+14+1 */ Ltmp = L_msu( Ltmp, y1[2 * L_SUBFR - 1], gain_pit /*Q14*/ ); /* Q_new-1+shift+14+1 */ diff --git a/lib_enc/prot_fx_enc.h b/lib_enc/prot_fx_enc.h index f80373787..3f7f17fe7 100644 --- a/lib_enc/prot_fx_enc.h +++ b/lib_enc/prot_fx_enc.h @@ -177,12 +177,12 @@ void dtx_fx( ); void dtx_ivas_fx( - Encoder_State *st_fx, /* i/o: encoder state structure */ + Encoder_State *st_fx, /* i/o: encoder state structure */ const Word32 last_ivas_total_brate, /* i : last IVAS total bitrate Q0*/ - const Word32 ivas_total_brate, /* i : IVAS total bitrate Q0*/ - const Word16 vad, /* i : vad flag for DTX Q0*/ - const Word16 speech[], /* i : Pointer to the speech frame Q_speech*/ - Word16 Q_speech /* i : Q factor for speech */ + const Word32 ivas_total_brate, /* i : IVAS total bitrate Q0*/ + const Word16 vad, /* i : vad flag for DTX Q0*/ + const Word16 speech[], /* i : Pointer to the speech frame Q_speech*/ + Word16 Q_speech /* i : Q factor for speech */ ); Word16 dtx_hangover_addition_fx( @@ -1232,8 +1232,8 @@ void AVQ_cod_lpc_fx( ); void ProcessIGF_ivas_fx( - Encoder_State *st, /* i : Encoder state */ - Word16 powerSpec_len, /* i : length of pPowerSpectrum buffer */ + Encoder_State *st, /* i : Encoder state */ + Word16 powerSpec_len, /* i : length of pPowerSpectrum buffer */ Word32 *pMDCTSpectrum, /* i : MDCT spectrum */ const Word32 *pITFMDCTSpectrum, /* i : MDCT spectrum fir ITF */ Word16 *q_spectrum, /* i/o: Q of spectrum */ @@ -3067,8 +3067,8 @@ void IGFEncApplyMono_fx( const IGF_ENC_INSTANCE_HANDLE hInstance, /**< in: | Word16 last_core_acelp /**< in: Q0 | indictaor if last frame was acelp coded */ ); -void IGFEncApplyMono_ivas_fx( Encoder_State *st, /* i : Encoder state */ - Word16 powerSpectrum_len, /* i: length of pPowerSpectrum_fx*/ +void IGFEncApplyMono_ivas_fx( Encoder_State *st, /* i : Encoder state */ + Word16 powerSpectrum_len, /* i: length of pPowerSpectrum_fx*/ const Word16 igfGridIdx, /* i : IGF grid index */ Word32 *pMDCTSpectrum_fx, /* i/o: MDCT spectrum */ Word16 e_mdct, /* i : exponent of pMDCTspectrum */ diff --git a/lib_enc/speech_music_classif_fx.c b/lib_enc/speech_music_classif_fx.c index ff9e2d936..b9f47136f 100644 --- a/lib_enc/speech_music_classif_fx.c +++ b/lib_enc/speech_music_classif_fx.c @@ -890,7 +890,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 */ - ps_sta = L_add_sat( ps_sta, L_tmp ); /*Q16 */ + ps_sta = L_add_sat( ps_sta, L_tmp ); /*Q16 */ } } @@ -2201,12 +2201,12 @@ Word16 ivas_smc_gmm_fx( ps_fx[m] = L_sub( L_sub( L_add( log_weights_speech_compute[m], log_det_chol_speech_fx[m] ), W_extract_l( W_shr( wprob_fx, Q10 ) ) ), HALF_N_PCA_COEF_LOG_P12_Q18 ); // Q18 move32(); v_sub32_fx( FV_fx, &means_music_fx[m * N_PCA_COEF], fvm_fx, N_PCA_COEF ); - wprob_fx = dot_product_cholesky_fixed( fvm_fx, &prec_chol_music_fx[m * ( N_PCA_COEF * N_PCA_COEF + N_PCA_COEF ) / 2], N_PCA_COEF ); // Q10 - pm_fx[m] = L_sub( L_sub( L_add( log_weights_music_compute[m], log_det_chol_music_fx[m] ), W_extract_l( W_shr( wprob_fx, Q10 ) ) ), HALF_N_PCA_COEF_LOG_P12_Q18 ); // Q18 + wprob_fx = dot_product_cholesky_fixed( fvm_fx, &prec_chol_music_fx[m * ( N_PCA_COEF * N_PCA_COEF + N_PCA_COEF ) / 2], N_PCA_COEF ); // Q10 + pm_fx[m] = L_sub( L_sub( L_add( log_weights_music_compute[m], log_det_chol_music_fx[m] ), W_extract_l( W_shr( wprob_fx, Q10 ) ) ), HALF_N_PCA_COEF_LOG_P12_Q18 ); // Q18 move32(); v_sub32_fx( FV_fx, &means_noise_fx[m * N_PCA_COEF], fvm_fx, N_PCA_COEF ); - wprob_fx = dot_product_cholesky_fixed( fvm_fx, &prec_chol_noise_fx[m * ( N_PCA_COEF * N_PCA_COEF + N_PCA_COEF ) / 2], N_PCA_COEF ); // Q10 - pn_fx[m] = L_sub( L_sub( L_add( log_weights_noise_compute[m], log_det_chol_noise_fx[m] ), W_extract_l( W_shr( wprob_fx, Q10 ) ) ), HALF_N_PCA_COEF_LOG_P12_Q18 ); // Q18 + wprob_fx = dot_product_cholesky_fixed( fvm_fx, &prec_chol_noise_fx[m * ( N_PCA_COEF * N_PCA_COEF + N_PCA_COEF ) / 2], N_PCA_COEF ); // Q10 + pn_fx[m] = L_sub( L_sub( L_add( log_weights_noise_compute[m], log_det_chol_noise_fx[m] ), W_extract_l( W_shr( wprob_fx, Q10 ) ) ), HALF_N_PCA_COEF_LOG_P12_Q18 ); // Q18 move32(); } @@ -2220,7 +2220,7 @@ Word16 ivas_smc_gmm_fx( *high_lpn_flag = 1; move32(); } - hSpMusClas->lpm_fx = extract_h( L_shl_sat( lpm_fx, 16 - 11 ) ); // Q7 + hSpMusClas->lpm_fx = extract_h( L_shl_sat( lpm_fx, 16 - 11 ) ); // Q7 move16(); hSpMusClas->lps_fx = extract_h( L_shl_sat( lps_fx, 16 - 11 ) ); // Q7 move16(); diff --git a/lib_enc/tcx_utils_enc_fx.c b/lib_enc/tcx_utils_enc_fx.c index c84843384..e0a944981 100644 --- a/lib_enc/tcx_utils_enc_fx.c +++ b/lib_enc/tcx_utils_enc_fx.c @@ -3784,8 +3784,8 @@ void attenuateNbSpectrum_fx( Word16 L_frame, Word32 *spectrum ) * *---------------------------------------------------------------------*/ void ProcessIGF_ivas_fx( - Encoder_State *st, /* i : Encoder state */ - Word16 powerSpec_len, /* i : length of pPowerSpectrum buffer */ + Encoder_State *st, /* i : Encoder state */ + Word16 powerSpec_len, /* i : length of pPowerSpectrum buffer */ Word32 *pMDCTSpectrum, /* i : MDCT spectrum (*q_spectrum) */ const Word32 *pITFMDCTSpectrum, /* i : MDCT spectrum fir ITF */ Word16 *q_spectrum, /* i/o: Q of spectrum */ diff --git a/lib_enc/transient_detection_fx.c b/lib_enc/transient_detection_fx.c index 92f01b5dd..60d661db4 100644 --- a/lib_enc/transient_detection_fx.c +++ b/lib_enc/transient_detection_fx.c @@ -678,8 +678,8 @@ void RunTransientDetection_ivas_fx( IF( GT_16( sub( q_input, pSubblockEnergies->q_firState ), shift ) ) { Scale_sig( input_fx, length, add( sub( pSubblockEnergies->q_firState, q_input ), shift ) ); // q_firState + shift - q_input = add( pSubblockEnergies->q_firState, shift ); // q_firState + shift - pSubblockEnergies->firState1 = shl( pSubblockEnergies->firState1, shift ); // q_firState + shift + q_input = add( pSubblockEnergies->q_firState, shift ); // q_firState + shift + pSubblockEnergies->firState1 = shl( pSubblockEnergies->firState1, shift ); // q_firState + shift move16(); pSubblockEnergies->firState2 = shl( pSubblockEnergies->firState2, shift ); // q_firState + shift move16(); diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index fb3a89350..2376babcd 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -72,9 +72,9 @@ Word16 slot_fx[4] = { 32767, 16384, 10922, 8192 }; #define INV_TAN30_FX 28377 // Q14 #define EPSILON_MANT 1180591621 /* 1e-12 = 0.5497558*(2^-39) in Q70 */ #define EPSILON_EXP ( -39 ) -#define ONE_DIV_EPSILON_MANT 1953125000 /* 1e+12 = 0.9094947*(2^40) */ -#define ONE_DIV_EPSILON_EXP ( 40 ) -#define ADAPT_HTPROTO_ROT_LIM_1 0.8f +#define ONE_DIV_EPSILON_MANT 1953125000 /* 1e+12 = 0.9094947*(2^40) */ +#define ONE_DIV_EPSILON_EXP ( 40 ) +#define ADAPT_HTPROTO_ROT_LIM_1 0.8f #define MAX_GAIN_CACHE_SIZE ( ( MASA_MAXIMUM_DIRECTIONS * 3 ) + MAX_NUM_OBJECTS ) /* == different calls to get gains */ diff --git a/lib_rend/ivas_mcmasa_ana_fx.c b/lib_rend/ivas_mcmasa_ana_fx.c index d5df77045..cfdd43116 100644 --- a/lib_rend/ivas_mcmasa_ana_fx.c +++ b/lib_rend/ivas_mcmasa_ana_fx.c @@ -753,10 +753,8 @@ void ivas_mcmasa_param_est_ana_fx( /* Direction estimation */ computeIntensityVector_ana_fx( hMcMasa->band_grouping, Foa_RealBuffer_fx, Foa_ImagBuffer_fx, num_freq_bands, intensity_real_fx ); /* Q intensity_real_fx = 2*inp_q-31, e = 31 - 2*inp_q + 31 = 62 - 2*inp_q = 2*(31-inp_q)=2*c_e */ - computeDirectionVectors_fixed( intensity_real_fx[0], intensity_real_fx[1], intensity_real_fx[2], 0, num_freq_bands, direction_vector_fx[0], direction_vector_fx[1], direction_vector_fx[2], shl( c_e, 1 ) - , - NULL - ); /* Q direction_vector_fx = Q30*/ + computeDirectionVectors_fixed( intensity_real_fx[0], intensity_real_fx[1], intensity_real_fx[2], 0, num_freq_bands, direction_vector_fx[0], direction_vector_fx[1], direction_vector_fx[2], shl( c_e, 1 ), + NULL ); /* Q direction_vector_fx = Q30*/ /* Power and intensity estimation for diffuseness */ computeIntensityVector_ana_fx( hMcMasa->band_grouping, FoaEven_RealBuffer_fx, FoaEven_ImagBuffer_fx, num_freq_bands, intensity_even_real_fx ); /*2*inp_q-31*/ -- GitLab