diff --git a/lib_com/cldfb_evs_fx.c b/lib_com/cldfb_evs_fx.c index 8e8b6565fc488ce3ba9ea159c1aacc5e0466877b..a5f9da62a1941472a7aa615ad6b1820304a8f7ce 100644 --- a/lib_com/cldfb_evs_fx.c +++ b/lib_com/cldfb_evs_fx.c @@ -996,10 +996,8 @@ ivas_error openCldfb( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for CLDFB" ); } -#ifdef FIX_2319_CLDFB_INIT_FLAGS hs->flags = 0; move16(); -#endif hs->type = type; move16(); diff --git a/lib_com/gs_noisefill_fx.c b/lib_com/gs_noisefill_fx.c index 383e2812da07529ebd415d4beca50b1c21b0f5a3..fb11fc327bab38a432ed924b2f6e75fe0a84e7ca 100644 --- a/lib_com/gs_noisefill_fx.c +++ b/lib_com/gs_noisefill_fx.c @@ -751,19 +751,11 @@ void highband_exc_dct_in_fx( test(); IF( bfi || LT_32( core_brate, 6000 ) || ( LT_32( core_brate, 8600 ) && EQ_16( coder_type, UNVOICED ) ) ) { -#ifndef FIX_1478_UNINIT_ON_BFI - set16_fx( noisepb, 13107, MBANDS_GN ); /*0.4 in Q15 */ -#else set16_fx( noisepb, 13107, last_bin ); /*0.4 in Q15 */ -#endif } ELSE IF( EQ_16( GSC_IVAS_mode, 3 ) || ( GSC_IVAS_mode > 0 && EQ_16( GSC_noisy_speech, 1 ) ) ) { -#ifndef FIX_1478_UNINIT_ON_BFI - set16_fx( noisepb, 13107 /*0.4f*/, MBANDS_GN16k ); -#else set16_fx( noisepb, 13107 /*0.4f*/, last_bin ); -#endif } ELSE { @@ -780,11 +772,7 @@ void highband_exc_dct_in_fx( test(); IF( GSC_IVAS_mode == 0 && GSC_noisy_speech && !bfi && LE_16( element_mode, IVAS_SCE ) ) { -#ifndef FIX_1478_UNINIT_ON_BFI - set16_fx( noisepb, 3277, MBANDS_GN ); -#else set16_fx( noisepb, 3277, last_bin ); -#endif } test(); IF( LT_32( core_brate, 6000 ) && LE_16( coder_type, UNVOICED ) ) @@ -1150,19 +1138,11 @@ void highband_exc_dct_in_ivas_fx( test(); IF( bfi || LT_32( core_brate, 6000 ) || ( LT_32( core_brate, 8600 ) && EQ_16( coder_type, UNVOICED ) ) ) { -#ifndef FIX_1478_UNINIT_ON_BFI - set16_fx( noisepb, 13107, MBANDS_GN ); /*0.4 in Q15 */ -#else set16_fx( noisepb, 13107, last_bin ); /*0.4 in Q15 */ -#endif } ELSE IF( EQ_16( GSC_IVAS_mode, 3 ) || ( GSC_IVAS_mode > 0 && EQ_16( GSC_noisy_speech, 1 ) ) ) { -#ifndef FIX_1478_UNINIT_ON_BFI - set16_fx( noisepb, 13107 /*0.4f*/, MBANDS_GN16k ); -#else set16_fx( noisepb, 13107 /*0.4f*/, last_bin ); -#endif } ELSE { @@ -1179,11 +1159,7 @@ void highband_exc_dct_in_ivas_fx( IF( GSC_IVAS_mode == 0 && GSC_noisy_speech && !bfi && LE_16( element_mode, IVAS_SCE ) ) { -#ifndef FIX_1478_UNINIT_ON_BFI - set16_fx( noisepb, 3277, MBANDS_GN ); -#else set16_fx( noisepb, 3277, last_bin ); -#endif } test(); diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index 409bf870fdda0de4d459d9e278e103aaf4801aeb..11891c6ca34ddd684bd234e68cc13d555c1951f1 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -1359,20 +1359,10 @@ void stereo_tcx_init_dec_fx( void stereo_icBWE_enc_fx( CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ -#ifdef REMOVE_SCALING_SHB_SPEECH const Word16 shb_speech_ref_fx16[], /* i : SHB speech ref channel Q0*/ Word16 shb_speech_nonref_fx_16[], /* i/o: SHB speech non-ref channel shb_speech_nonref_e*/ -#else - const Word32 shb_speech_ref_fx[], /* i : SHB speech ref channel */ - const Word16 shb_speech_ref_e, /* i : SHB speech ref channel */ - Word32 shb_speech_nonref_fx[], /* i/o: SHB speech non-ref channel */ -#endif Word16 shb_speech_nonref_e, /* i/o: SHB speech non-ref channel */ -#ifdef REMOVE_SCALING_SHB_SPEECH const Word16 *voice_factors_fx /* i : voicing factors Q15 */ -#else - const Word32 *voice_factors_fx /* i : voicing factors Q31 */ -#endif ); void initMdctStereoDecData_fx( diff --git a/lib_com/options.h b/lib_com/options.h index 0ea316a82a8cdacb4562394ba7ad6b5cd236a9bd..37ad8d099e0d78d226d80ee3ab3b497a2285dbee 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -81,32 +81,9 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define FIX_1990_SANITIZER_IN_REVERB_LOAD /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */ -#define FIX_1999_TEMPORARY_DISABLE_DIST_ATT_CHECK /* Eri: Issue 1999: Range check on float values of distance attenuation, while the float values are not propagated to this function. The test is not correct, but configurable distance attenuation is not used in Characterization.*/ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ -#define FIX_2255_ISAR_RENDER_POSES /* VA: issue 2255: fix missing check in isar_render_poses() */ #define FIX_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ -#define FIX_1478_UNINIT_ON_BFI /* VA: Fix issue 1478 where a vector is partly un-initialized during bfi */ -#define FIX_BASOP_2358_SCALING_OOB /* Eri: Basip issue 2358: Clang-18 reports OOB access where scaling is applied to L_FRAME48k instead of output_frame */ -#define FIX_BASOP_2350_HARM_0B_BWE_2 /* VA: basop issue 2350: Simplify calling of hf_synth_fx() */ -#define FIX_2364_HARM_MULT_HARM /* VA: basop issue 2364 : harmonizing multi_harm_fx function */ -#define FIX_2363_FIND_WSP /* VA: basop issue 2363 : harmonizing find_wsp function */ -#define FIX_2370_UNUSED_BUFFERS_CORE_ENC /* VA: basop issue 2370: remove temporary input buffers in core-encoder */ -#define FIX_2376_FIX_USAN_PRE_PROC /* VA: basop issue 2376: Resolve "USAN: SEGV in ivas_compute_core_buffers_fx() */ -#define FIX_2367_REMOVE_CODE_ICBWE /* VA: basop issue 2367: Remove IC-BWE obsolete code */ -#define REMOVE_SCALING_SHB_SPEECH /* VA: remove unnecessary scaling and 32-bit buffers from ivas_core_enc_fx() */ -#define FIX_2352_COPY_AQ_IN_TCX /* FhG: basop issue 2352: prevent copying uninitialized values from Aq_fx[][] to Aq_fx_32[][] in TCX */ -#define FIX_2353_PTR_INIT /* FhG: basop issue 2353: initialize prm_sqQ-pointer, to prevent being uninitialized in case of bfi == 1 */ -#define FIX_2356_GET_CHAN_ENERGIES /* FhG: basop issue 2356: correctly initialize exponents in getChannelEnergies_fx() */ -#define FIX_2355_IGF_EXP_POWERSPEC /* FhG: basop issue 2355: make sure exp_pPowerSpectrumParameter_fx is initialized in all cases */ -#define FIX_2319_CLDFB_INIT_FLAGS /* FhG: basop issue 2319: init hs->flags during openCldfb(), to avoid reading of uninitialized memory */ -#define FIX_BASOP_2357_OBJECT_EDIT_MSAN /* Nokia: basop issue 2357: initialize missing exponents in object edit */ -#define FIX_BASOP_2354_MSAN_DIFF_Q_VALUE /* Nokia: Initialize Q value of diffuseness in rendering to Q30 */ -#define FIX_2371_REMOVE_UNUSED_ISAR_FCNS /* Dolby: basop issue 2371: remove unused ISAR-related functions */ -#define FIX_2384_INIT_DEQUANT_COV /* FhG: basop issue 2384: only read initialized values from Cy_buf_e[k] in ivas_param_mc_dequantize_cov_fx() during renormalization */ -#define FIX_2383_INIT_Q_A_ITF /* FhG: Initialize Q_A_itf, to avoid reading of uninitialized memory in case ITF is not triggered */ -#define FIX_2382_COPY_AQ_IN_MCT /* FhG: basop issue 2382: 2nd instance of prevent copying uninitialized values from Aq_fx[][] to Aq_fx_32[][] in TCX */ -#define FIX_2391_INIT_HQ_GENERIC_OFFSET /* FhG/Eri: basop issue 2391: make sure hq_generic_offset is initialized inside hq_hr_dec_fx() */ #define FIX_2397_COPY_AQ_MDCT_CORE_BFI /* FhG: prevent copying of uninit memory in MDCT stereo core if bfi is set */ #define HARMONIZE_TBE /* VA: harmonize core-coder TBE function duplications */ @@ -117,10 +94,7 @@ #define FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT /* Dolby: Issue 2250: random vector generation in GenShapedSHBExcitation() */ #define FIX_2338_HARM_GSC_GAIN_COMP /* VA: basop issue 2338: harmonization of band gain computation for both EVS and IVAS */ -#define FIX_BASOP_2317_UNINIT_VALUE_IN_STEREO_CNG /* Eri: Basop issue 2317: Uninitialized value read in case of DTX and BW switching */ #define FIX_BASOP_2361_OTR /* FhG: Basop issue 2361: Orientation tracking tests for equivalent rotations fail */ -#define FIX_1283_STEREO_DFT_COLLAPSE /* FhG: float issue 1283: fix for critical issue with DFT stereo core coder */ -#define FIX_2379_REMOVE_previoussynth_fx_32 /* VA: basop issue 2379: remove duplicated buffer st->previoussynth_fx_32[] */ #define FIX_2396_CONSTANT_STRIDE_IN_TC_BUFFER /* FhG/VA: basop issue 2396: keep TC channel pointers in one constant place during decoding and rendering */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index c45c2a7490d98886919391ee55e3dcb80560eff0..d914126abf993113758582808114dfcb9b182f17 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -10246,15 +10246,9 @@ void Copy_Scale_sig32( ); void swb_pre_proc_ivas_fx( - Encoder_State *st, /* i/o: encoder state structure */ - Word16 *new_swb_speech, /* o : original input signal at 32kHz - Q0 */ -#ifndef REMOVE_SCALING_SHB_SPEECH - Word32 *new_swb_speech_fx, /* o : original input signal at 32kHz - Q - q_reImBuffer */ -#endif - Word16 *shb_speech, /* o : SHB target signal (6-14kHz) at 16kHz - Q0*/ -#ifndef REMOVE_SCALING_SHB_SPEECH - Word16 *Q_shb_spch, -#endif + Encoder_State *st, /* i/o: encoder state structure */ + Word16 *new_swb_speech, /* o : original input signal at 32kHz - Q0 */ + Word16 *shb_speech, /* o : SHB target signal (6-14kHz) at 16kHz - Q0*/ Word32 realBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : real buffer Q - q_reImbuffer */ Word32 imagBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : imag buffer Q - q_reImbuffer */ Word16 q_reImBuffer, /* i : scale data of real and imag CLDFB buffers*/ @@ -10910,21 +10904,6 @@ void bands_and_bit_alloc_ivas_fx( const Word16 element_mode, /* i : element mode */ const Word16 GSC_IVAS_mode /* i : GSC IVAS mode */ ); -#ifndef FIX_2363_FIND_WSP -void ivas_find_wsp_fx( - const Word16 L_frame, /* i : length of the frame Q0*/ - const Word16 L_subfr, /* i : length of subframe Q0*/ - const Word16 nb_subfr, /* i : number of subframes Q0*/ - const Word16 *A_fx, /* i : A(z) filter coefficients Q12 */ - Word16 *Aw_fx, /* o : weighted A(z) filter coefficients Q12 */ - const Word16 *speech_fx, /* i : pointer to the denoised speech frame Q_new */ - const Word16 tilt_fact, /* i : tilt factor Q15 */ - Word16 *wsp_fx, /* o : poitnter to the weighted speech frame Q_new */ - Word16 *mem_wsp_fx, /* i/o: W(Z) denominator memory Q_new */ - const Word16 gamma, /* i : weighting factor Q15 */ - const Word16 L_look /* i : look-ahead Q0*/ -); -#endif Word16 RCcontextMapping_encode2_estimate_bandWise_start_fx( Word16 *x, /* Q0 */ diff --git a/lib_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index 5dcc848ade5ef21ec0c3ac49eba9c3fb24e7add3..033683a0a94c9877b0c8d12bcc0ac41a9f3c1cc7 100644 --- a/lib_dec/acelp_core_dec_fx.c +++ b/lib_dec/acelp_core_dec_fx.c @@ -74,9 +74,6 @@ ivas_error acelp_core_dec_fx( const Word16 read_sid_info /* i : read SID info flag */ ) { -#ifndef FIX_BASOP_2350_HARM_0B_BWE_2 - Word32 synth_fx[960], save_hb_synth_fx[960] /*, bwe_exc_extended_fx[L_FRAME32k + NL_BUFF_OFFSET]*/; -#endif 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. */ @@ -1898,9 +1895,7 @@ ivas_error acelp_core_dec_fx( st->stab_fac_fx, &st->stab_fac_smooth_fx, st->coder_type, st->Q_syn, bpf_error_signal_16fx ); } -#ifdef FIX_BASOP_2350_HARM_0B_BWE_2 Word32 synth_fx[L_FRAME48k]; -#endif Word32 syn_tmp_32_fx[L_FRAME16k + L_SUBFR], *syn_32_fx; set32_fx( syn_tmp_32_fx, 0, L_FRAME16k + L_SUBFR ); syn_32_fx = syn_tmp_32_fx + L_SUBFR; @@ -2056,9 +2051,7 @@ ivas_error acelp_core_dec_fx( cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, synth_fx /*tmp buffer for save_hb_synth_fx[] */, -1, sub( Q11, Q_real ), -10, st->cldfbSynHB ); -#ifdef FIX_BASOP_2350_HARM_0B_BWE_2 Copy_Scale_sig_32_16( synth_fx, save_hb_synth_fx16, output_frame, 0 ); // Q0 -#endif /* restore lowband */ FOR( j = 0; j < CLDFB_NO_CHANNELS_MAX; j++ ) @@ -2112,11 +2105,7 @@ ivas_error acelp_core_dec_fx( } /* save synthesis - needed in case of core switching */ -#ifdef FIX_2379_REMOVE_previoussynth_fx_32 Copy_Scale_sig_32_16( synth_fx, st->previoussynth_fx, output_frame, 0 ); // Q0 -#else - Copy32( synth_fx, st->previoussynth_fx_32, output_frame ); // Q0 -#endif } ELSE { @@ -2210,9 +2199,7 @@ ivas_error acelp_core_dec_fx( Copy( psyn_fx, output_fx, st->L_frame ); /*Q_syn*/ } -#ifdef FIX_BASOP_2350_HARM_0B_BWE_2 Copy_Scale_sig_32_16( synth_fx, synth_fx16, output_frame, 0 ); // Q_syn2 -#endif st->Q_syn2 = 0; move16(); } @@ -2233,20 +2220,7 @@ ivas_error acelp_core_dec_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 FIX_BASOP_2350_HARM_0B_BWE_2 hf_synth_fx( st->hBWE_zero, st->element_mode, st->core_brate, output_frame, Aq_fx, exc2_fx, psyn_fx, synth_fx16, st->Q_exc, st->Q_syn2 ); -#else - IF( EQ_16( st->element_mode, EVS_MONO ) ) - { - hf_synth_fx( st->hBWE_zero, EVS_MONO, st->core_brate, output_frame, Aq_fx, exc2_fx, psyn_fx, synth_fx16, st->Q_exc, st->Q_syn2 ); - } - ELSE - { - Copy_Scale_sig_32_16( synth_fx, synth_fx16, output_frame, 0 ); // Q0 - hf_synth_fx( st->hBWE_zero, st->element_mode, st->core_brate, output_frame, Aq_fx, exc2_fx, psyn_fx, synth_fx16, st->Q_exc, st->Q_syn2 ); - Copy_Scale_sig_16_32_DEPREC( synth_fx16, synth_fx, output_frame, 0 ); - } -#endif } ELSE { @@ -2342,16 +2316,6 @@ ivas_error acelp_core_dec_fx( } } -#ifndef FIX_BASOP_2350_HARM_0B_BWE_2 - IF( NE_16( st->element_mode, EVS_MONO ) ) - { - IF( save_hb_synth_fx16 != NULL ) - { - Copy_Scale_sig_32_16( save_hb_synth_fx, save_hb_synth_fx16, output_frame, 0 ); // Q0 - } - Copy_Scale_sig_32_16( synth_fx, synth_fx16, output_frame, 0 ); // Q_syn2 - } -#endif pop_wmops(); return error; } diff --git a/lib_dec/core_switching_dec_fx.c b/lib_dec/core_switching_dec_fx.c index 9d36d2c5e2f4d8f57f27efe347b5676afd9a2859..ae891ae534676f7265334f0a70620214affd4825 100644 --- a/lib_dec/core_switching_dec_fx.c +++ b/lib_dec/core_switching_dec_fx.c @@ -1598,13 +1598,9 @@ ivas_error core_switching_pre_dec_fx( } ELSE { -#ifdef FIX_2379_REMOVE_previoussynth_fx_32 Word32 previoussynth_fx_32[L_FRAME48k]; Copy_Scale_sig_16_32_no_sat( st->previoussynth_fx, previoussynth_fx_32, output_frame, 0 ); fer_energy_fx( output_frame, UNVOICED_CLAS, previoussynth_fx_32, 0, -1, &st->enr_old_fx, 1 ); /*Q0*/ -#else - fer_energy_fx( output_frame, UNVOICED_CLAS, st->previoussynth_fx_32, 0, -1, &st->enr_old_fx, 1 ); /*Q-0*/ -#endif st->lp_gainp_fx = 0; move16(); st->lp_gainc_fx = extract_h( Sqrt32( st->lp_ener_fx, &exp ) ); /*Q=15-exp*/ @@ -1687,13 +1683,9 @@ ivas_error core_switching_pre_dec_fx( set16_fx( st->dm_fx.prev_gain_pit, 0, 6 ); st->last_coder_type = GENERIC; move16(); -#ifdef FIX_2379_REMOVE_previoussynth_fx_32 Word32 previoussynth_fx_32[L_FRAME48k]; Copy_Scale_sig_16_32_no_sat( st->previoussynth_fx, previoussynth_fx_32, output_frame, 0 ); fer_energy_fx( output_frame, UNVOICED_CLAS, previoussynth_fx_32, 0, -1, &st->enr_old_fx, 1 ); /*Q0*/ -#else - fer_energy_fx( output_frame, UNVOICED_CLAS, st->previoussynth_fx_32, 0, -1, &st->enr_old_fx, 1 ); /*Q-0*/ -#endif st->lp_gainp_fx = 0; move16(); diff --git a/lib_dec/dec_tcx_fx.c b/lib_dec/dec_tcx_fx.c index ed170d5982cf679da5651bb1eb9ef3adc4683609..8482ef78b9c4ad53e51af924cd1bfcd8edce0db6 100644 --- a/lib_dec/dec_tcx_fx.c +++ b/lib_dec/dec_tcx_fx.c @@ -1075,10 +1075,8 @@ void decoder_tcx_fx( Word16 predictionGain; /* not counted */ predictionGain = 0; move16(); -#ifdef FIX_2383_INIT_Q_A_ITF Q_A_itf = 15; move16(); -#endif FOR( j = startLine; j < endLine; j++ ) { @@ -4025,9 +4023,7 @@ void decoder_tcx_ivas_fx( move16(); fUseTns = 0; /* flag that is set if TNS data is present */ move16(); -#ifdef FIX_2353_PTR_INIT prm_sqQ = NULL; -#endif set16_fx( xn_buf_fx, 0, L_MDCT_OVLP_MAX + L_FRAME_PLUS + L_MDCT_OVLP_MAX ); diff --git a/lib_dec/hq_hr_dec_fx.c b/lib_dec/hq_hr_dec_fx.c index bcc330d61fdd1c410f020afb213e6f69bbb9379d..30a7d4f4ae9ca4fc66f9917ef120cb2bf155e698 100644 --- a/lib_dec/hq_hr_dec_fx.c +++ b/lib_dec/hq_hr_dec_fx.c @@ -435,10 +435,8 @@ void hq_hr_dec_fx( move16(); HQ_DEC_HANDLE hHQ_core = st_fx->hHQ_core; -#ifdef FIX_2391_INIT_HQ_GENERIC_OFFSET hq_generic_offset = 0; move16(); -#endif move16(); Q_audio = 0; /* to avoid compilation warnings */ diff --git a/lib_dec/init_dec_fx.c b/lib_dec/init_dec_fx.c index a3e2c48e3092886d8f82f7425aa8db9ab0004d3a..b8a5fe6de63c1dd49f8d29605942b44899021687 100644 --- a/lib_dec/init_dec_fx.c +++ b/lib_dec/init_dec_fx.c @@ -436,9 +436,6 @@ ivas_error init_decoder_fx( set16_fx( st_fx->previoussynth_fx, 0, L_FRAME48k ); set32_fx( st_fx->delay_buf_out32_fx, 0, HQ_DELTA_MAX * HQ_DELAY_COMP ); -#ifndef FIX_2379_REMOVE_previoussynth_fx_32 - set32_fx( st_fx->previoussynth_fx_32, 0, L_FRAME48k ); -#endif IF( st_fx->element_mode == EVS_MONO ) { diff --git a/lib_dec/ivas_core_dec_fx.c b/lib_dec/ivas_core_dec_fx.c index a7eebafb52ad074c4d463f449fb59273acbc515a..0f9bf2d9b67d32d97579d7e920da4daa139a7494 100644 --- a/lib_dec/ivas_core_dec_fx.c +++ b/lib_dec/ivas_core_dec_fx.c @@ -446,9 +446,6 @@ ivas_error ivas_core_dec_fx( move16(); move16(); -#ifndef FIX_2379_REMOVE_previoussynth_fx_32 - Copy_Scale_sig_16_32_DEPREC( st->previoussynth_fx, st->previoussynth_fx_32, L_FRAME48k, 0 ); // Q0 -#endif IF( NE_32( ( error = core_switching_pre_dec_fx( st, output_frame, sts[0]->last_core_brate, nchan_out, last_element_mode, last_element_brate, st->Q_syn, &Q_olapBufferSynth, &Q_olapBufferSynth2 ) ), IVAS_ERR_OK ) ) { return error; @@ -558,9 +555,6 @@ ivas_error ivas_core_dec_fx( } } -#ifndef FIX_2379_REMOVE_previoussynth_fx_32 - Copy_Scale_sig_32_16( st->previoussynth_fx_32, st->previoussynth_fx, L_FRAME48k, 0 ); // Q0 -#endif test(); test(); IF( ( EQ_16( st->core, TCX_20_CORE ) || EQ_16( st->core, TCX_10_CORE ) ) && NE_16( st->element_mode, IVAS_CPE_MDCT ) ) @@ -1179,13 +1173,6 @@ ivas_error ivas_core_dec_fx( q = 11; move16(); -#ifndef FIX_2367_REMOVE_CODE_ICBWE - if ( hCPE->hStereoDft != NULL ) - { - hCPE->hStereoDft->td_gain_fx[0] = 1; - move32(); - } -#endif 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 ); test(); test(); diff --git a/lib_dec/ivas_mc_param_dec_fx.c b/lib_dec/ivas_mc_param_dec_fx.c index 70b4b645c47202fa83b0762157ed76515794d22a..fcfc9f911109b5a2429f3d85b3502f0e4a51f832 100644 --- a/lib_dec/ivas_mc_param_dec_fx.c +++ b/lib_dec/ivas_mc_param_dec_fx.c @@ -3142,9 +3142,7 @@ static void ivas_param_mc_dequantize_cov_fx( const PARAM_MC_ILD_MAPPING *h_ild_mapping; Word32 Cy_state_int_fx[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; Word16 Cy_state_int_e[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; -#ifdef FIX_2384_INIT_DEQUANT_COV Word16 nY_norm; -#endif set16_fx( Cp_buf_e, Cproto_e, MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS ); set32_fx( Nrqq_fx, 0, MAX_OUTPUT_CHANNELS ); @@ -3398,38 +3396,26 @@ static void ivas_param_mc_dequantize_cov_fx( Cyp_e += nY_cov; } } -#ifdef FIX_2384_INIT_DEQUANT_COV nY_norm = nY_cov; move16(); -#endif } ELSE { Copy32( Cy_state_int_fx, Cy_state_fx, imult1616( nY_int, nY_int ) ); Copy( Cy_state_int_e, Cy_buf_e, imult1616( nY_int, nY_int ) ); -#ifdef FIX_2384_INIT_DEQUANT_COV nY_norm = nY_int; move16(); -#endif } /*normalize output matrix to a common exponent*/ tmp = 0; -#ifdef FIX_2384_INIT_DEQUANT_COV FOR( k = 0; k < nY_norm * nY_norm; k++ ) -#else - FOR( k = 0; k < nY_int * nY_int; k++ ) -#endif { Cy_state_fx[k] = BASOP_Util_Add_Mant32Exp( Cy_state_fx[k], Cy_buf_e[k], 0, 0, &Cy_buf_e[k] ); move32(); tmp = s_max( tmp, Cy_buf_e[k] ); } -#ifdef FIX_2384_INIT_DEQUANT_COV FOR( k = 0; k < nY_norm * nY_norm; k++ ) -#else - FOR( k = 0; k < nY_int * nY_int; k++ ) -#endif { L_tmp = L_shr( Cy_state_fx[k], sub( tmp, Cy_buf_e[k] ) ); Cy_state_fx[k] = L_tmp; diff --git a/lib_dec/ivas_mct_dec_fx.c b/lib_dec/ivas_mct_dec_fx.c index b50fb4ae9799edacf6e9bfd2077bd24cedccd1bf..62a33352c76c4b1e00f61f8f243ea46c4559dfee 100644 --- a/lib_dec/ivas_mct_dec_fx.c +++ b/lib_dec/ivas_mct_dec_fx.c @@ -214,20 +214,14 @@ ivas_error ivas_mct_dec_fx( } } -#ifndef FIX_2382_COPY_AQ_IN_MCT - Word32 Aq_fx_32[6][2][102]; -#endif /* MCT reconstruction and CoreCoder updates */ FOR( cpe_id = 0; cpe_id < nCPE; cpe_id++ ) { -#ifdef FIX_2382_COPY_AQ_IN_MCT Word32 Aq_fx_32[CPE_CHANNELS][( NB_SUBFR16k + 1 ) * ( M + 1 )]; -#endif hCPE = st_ivas->hCPE[cpe_id]; FOR( n = 0; n < CPE_CHANNELS; n++ ) { -#ifdef FIX_2382_COPY_AQ_IN_MCT #ifdef FIX_2397_COPY_AQ_MDCT_CORE_BFI test(); IF( !st_ivas->bfi && NE_16( hCPE->hCoreCoder[n]->mct_chan_mode, MCT_CHAN_MODE_IGNORE ) ) @@ -247,20 +241,13 @@ ivas_error ivas_mct_dec_fx( Copy_Scale_sig_16_32_DEPREC( Aq_fx[cpe_id][n], Aq_fx_32[n], i_mult( nSubframes, M ), Q16 - Q12 ); // Q16 } -#else - Copy_Scale_sig_16_32_DEPREC( Aq_fx[cpe_id][n], Aq_fx_32[cpe_id][n], 102, Q16 - Q12 ); // Q16 -#endif 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 move16(); move16(); } -#ifdef FIX_2382_COPY_AQ_IN_MCT ivas_mdct_core_tns_ns_fx( hCPE, fUseTns[cpe_id], tnsData[cpe_id], x_fx, Aq_fx_32, 1, 20 ); -#else - ivas_mdct_core_tns_ns_fx( hCPE, fUseTns[cpe_id], tnsData[cpe_id], x_fx, Aq_fx_32[cpe_id], 1, 20 ); -#endif } test(); diff --git a/lib_dec/ivas_omasa_dec_fx.c b/lib_dec/ivas_omasa_dec_fx.c index 1659d4912e8663b43bcfb540f131c9fb1c64c7d9..d13e17c1f33d50104cdd949c4964b90a3672b638 100644 --- a/lib_dec/ivas_omasa_dec_fx.c +++ b/lib_dec/ivas_omasa_dec_fx.c @@ -344,16 +344,12 @@ ivas_error ivas_omasa_data_open_fx( move16(); hMasaIsmData->preprocEneTarget_fx[band_idx] = 0; move32(); -#ifdef FIX_BASOP_2357_OBJECT_EDIT_MSAN hMasaIsmData->preprocEneTarget_e[band_idx] = 0; move16(); -#endif hMasaIsmData->preprocEneRealized_fx[band_idx] = 0; move32(); -#ifdef FIX_BASOP_2357_OBJECT_EDIT_MSAN hMasaIsmData->preprocEneRealized_e[band_idx] = 0; move16(); -#endif } hMasaIsmData->objectsEdited = 0; diff --git a/lib_dec/ivas_stereo_icbwe_dec_fx.c b/lib_dec/ivas_stereo_icbwe_dec_fx.c index 1c51fc2d125f1a021b0e2ee2ca928a71f530f696..a6fdf3aad1e13be4133e3090770ec7363424f8a7 100644 --- a/lib_dec/ivas_stereo_icbwe_dec_fx.c +++ b/lib_dec/ivas_stereo_icbwe_dec_fx.c @@ -156,14 +156,12 @@ void stereo_icBWE_dec_fx( STEREO_ICBWE_DEC_HANDLE hStereoICBWE = hCPE->hStereoICBWE; st = hCPE->hCoreCoder[0]; -#ifdef FIX_2367_REMOVE_CODE_ICBWE if ( hCPE->hStereoDft != NULL ) { hCPE->hStereoDft->td_gain_fx[0] = 1; move32(); } -#endif /*--------------------------------------------------------------------* * skip IC-BWE in case of mono DMX output * * -------------------------------------------------------------------*/ diff --git a/lib_dec/ivas_stereo_mdct_core_dec_fx.c b/lib_dec/ivas_stereo_mdct_core_dec_fx.c index d61e541e906141b3c00db8f462b35ef90029ca38..8a8c7dc305f73f1e2f52c5f3502d228150a02ba6 100644 --- a/lib_dec/ivas_stereo_mdct_core_dec_fx.c +++ b/lib_dec/ivas_stereo_mdct_core_dec_fx.c @@ -298,7 +298,6 @@ void stereo_mdct_core_dec_fx( FOR( ch = 0; ch < nChannels; ch++ ) { -#ifdef FIX_2382_COPY_AQ_IN_MCT nSubframes[ch] = 1; /* Q0 */ move16(); @@ -307,10 +306,6 @@ void stereo_mdct_core_dec_fx( nSubframes[ch] = NB_DIV; move16(); } -#else - nSubframes[ch] = EQ_16( sts[ch]->core, TCX_10_CORE ) ? NB_DIV : 1; /* Q0 */ - move16(); -#endif FOR( k = 0; k < nSubframes[ch]; k++ ) { @@ -385,31 +380,15 @@ void stereo_mdct_core_dec_fx( #ifdef FIX_2397_COPY_AQ_MDCT_CORE_BFI IF( !bfi ) { -#ifdef FIX_2352_COPY_AQ_IN_TCX FOR( ch = 0; ch < nChannels; ch++ ) -#else - FOR( ch = 0; ch < CPE_CHANNELS; ch++ ) -#endif { -#ifdef FIX_2352_COPY_AQ_IN_TCX Copy_Scale_sig_16_32_DEPREC( Aq_fx[ch], Aq_fx_32[ch], i_mult( nSubframes[ch], M ), sub( Q16, Q12 ) ); /* Q16 */ -#else - Copy_Scale_sig_16_32_DEPREC( Aq_fx[ch], Aq_fx_32[ch], ( NB_SUBFR16k + 1 ) * ( M + 1 ), sub( Q16, Q12 ) ); /* Q16 */ -#endif } } #else -#ifdef FIX_2352_COPY_AQ_IN_TCX FOR( ch = 0; ch < nChannels; ch++ ) -#else - FOR( ch = 0; ch < CPE_CHANNELS; ch++ ) -#endif { -#ifdef FIX_2352_COPY_AQ_IN_TCX Copy_Scale_sig_16_32_DEPREC( Aq_fx[ch], Aq_fx_32[ch], nSubframes[ch] * M, sub( Q16, Q12 ) ); /* Q16 */ -#else - Copy_Scale_sig_16_32_DEPREC( Aq_fx[ch], Aq_fx_32[ch], ( NB_SUBFR16k + 1 ) * ( M + 1 ), sub( Q16, Q12 ) ); /* Q16 */ -#endif } #endif diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index fbd748b84eda2ba57872d0af37e58ae1366edf26..3b816103024ec013bde9520af913193201d6ef3b 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -1167,18 +1167,12 @@ static ivas_error isar_render_poses( /* hIvasDec->flushbuffer = (void *) malloc( sizeof( Word16 ) * numPoses * BINAURAL_CHANNELS * hIvasDec->nSamplesFrame / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ); */ /* set16_fx( (Word16 *) hIvasDec->flushbuffer, 0, numPoses * BINAURAL_CHANNELS * hIvasDec->nSamplesFrame / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ); */ Word16 num_samples_flushbuffer; -#ifdef FIX_2255_ISAR_RENDER_POSES num_samples_flushbuffer = mult0( shl( numPoses, 1 ) /* shl() == numPoses * BINAURAL_CHANNELS */, div_l( hIvasDec->nSamplesFrame, IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ) ); -#else - num_samples_flushbuffer = mult0( mult0( numPoses, BINAURAL_CHANNELS ), shl( div_l( hIvasDec->nSamplesFrame, IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ), 1 ) ); -#endif hIvasDec->flushbuffer = (void *) malloc( L_mult0( sizeof( Word16 ), num_samples_flushbuffer ) ); -#ifdef FIX_2255_ISAR_RENDER_POSES if ( hIvasDec->flushbuffer == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate flush buffer" ); } -#endif set16_fx( (Word16 *) hIvasDec->flushbuffer, 0, num_samples_flushbuffer ); } diff --git a/lib_dec/stat_dec.h b/lib_dec/stat_dec.h index a1646e82ebb470b219fcbd964e451b1e5d3f69f2..eafc5dd8a2cae335c68025f2f52f2d68ea8d9667 100644 --- a/lib_dec/stat_dec.h +++ b/lib_dec/stat_dec.h @@ -1258,9 +1258,6 @@ typedef struct Decoder_State Word16 last_L_frame_ori; Word16 previoussynth_fx[L_FRAME48k]; -#ifndef FIX_2379_REMOVE_previoussynth_fx_32 - Word32 previoussynth_fx_32[L_FRAME48k]; -#endif Word16 old_synth_sw_fx[NS2SA( 48000, FRAME_SIZE_NS - ACELP_LOOK_NS - DELAY_BWE_TOTAL_NS )]; Word16 delay_buf_out_fx[HQ_DELTA_MAX * HQ_DELAY_COMP]; /*Q0*/ Word32 delay_buf_out32_fx[HQ_DELTA_MAX * HQ_DELAY_COMP]; /*Q11*/ diff --git a/lib_enc/cod_tcx_fx.c b/lib_enc/cod_tcx_fx.c index 922ae177a6f313b5f11331b8dbf9e42be1537856..d2dd0bf03f841acdada0a5f3f5d395ec07fb083f 100644 --- a/lib_enc/cod_tcx_fx.c +++ b/lib_enc/cod_tcx_fx.c @@ -623,11 +623,7 @@ void ShapeSpectrum_ivas_fx( test(); test(); test(); -#ifndef FIX_1283_STEREO_DFT_COLLAPSE - IF( LE_32( total_brate, ACELP_13k20 ) && EQ_16( st->bwidth, SWB ) ) -#else IF( ( LE_32( total_brate, ACELP_13k20 ) || ( LE_32( st->element_brate, IVAS_16k4 ) && EQ_16( st->element_mode, IVAS_CPE_DFT ) ) ) && EQ_16( st->bwidth, SWB ) ) -#endif { max_low_pre = 0; move32(); @@ -705,11 +701,7 @@ void ShapeSpectrum_ivas_fx( test(); test(); test(); -#ifndef FIX_1283_STEREO_DFT_COLLAPSE - IF( LE_32( total_brate, ACELP_13k20 ) && EQ_16( st->bwidth, SWB ) ) -#else IF( ( LE_32( total_brate, ACELP_13k20 ) || ( LE_32( st->element_brate, IVAS_16k4 ) && EQ_16( st->element_mode, IVAS_CPE_DFT ) ) ) && EQ_16( st->bwidth, SWB ) ) -#endif { Word16 sf_width; Word16 dist_low, dist_high; diff --git a/lib_enc/find_wsp_fx.c b/lib_enc/find_wsp_fx.c index e2353c45513fdada3288c965d678ed9ac089c22a..a16f1a95c1a0f5fc4fe36566d4d8a53b20136797 100644 --- a/lib_enc/find_wsp_fx.c +++ b/lib_enc/find_wsp_fx.c @@ -77,61 +77,3 @@ void find_wsp_fx( deemph_fx( &wsp[L_frame], preemph_fac, lookahead, &wtmp ); } } -#ifndef FIX_2363_FIND_WSP -/*-------------------------------------------------------------------* - * ivas_find_wsp_fx() - * - * Compute weighted speech used in open-loop pitch search - *-------------------------------------------------------------------*/ -void ivas_find_wsp_fx( - const Word16 L_frame, /* i : length of the frame Q0*/ - const Word16 L_subfr, /* i : length of subframe Q0*/ - const Word16 nb_subfr, /* i : number of subframes Q0*/ - const Word16 *A_fx, - /* i : A(z) filter coefficients */ // Q12 - Word16 *Aw_fx, - /* o : weighted A(z) filter coefficients */ // Q12 - const Word16 *speech_fx, - /* i : pointer to the denoised speech frame */ // Q_new - const Word16 tilt_fact, - /* i : tilt factor */ // Q15 - Word16 *wsp_fx, - /* o : poitnter to the weighted speech frame */ // Q_new - Word16 *mem_wsp_fx, - /* i/o: W(Z) denominator memory */ // Q_new - const Word16 gamma, - /* i : weighting factor */ // Q15 - const Word16 L_look /* i : look-ahead Q0*/ -) -{ - Word16 *p_Aw_fx, tmp_fx; - Word16 i_subfr; - - - /*-----------------------------------------------------------------* - * Compute weighted A(z) unquantized for subframes - *-----------------------------------------------------------------*/ - weight_a_subfr_fx( nb_subfr, A_fx, Aw_fx, gamma, M ); - - /*-----------------------------------------------------------------* - * Compute weighted speech for all subframes - *-----------------------------------------------------------------*/ - p_Aw_fx = Aw_fx; - FOR( i_subfr = 0; i_subfr < L_frame; i_subfr += L_subfr ) - { - Residu3_fx( p_Aw_fx, &speech_fx[i_subfr], &wsp_fx[i_subfr], L_subfr, 0 ); - p_Aw_fx += ( M + 1 ); - } - p_Aw_fx -= ( M + 1 ); - - /*-----------------------------------------------------------------* - * Weighted speech computation is extended on look-ahead - *-----------------------------------------------------------------*/ - - deemph_fx( wsp_fx, tilt_fact, L_frame, mem_wsp_fx ); - Residu3_fx( p_Aw_fx, &speech_fx[L_frame], &wsp_fx[L_frame], L_look, 0 ); - tmp_fx = *mem_wsp_fx; - deemph_fx( &wsp_fx[L_frame], tilt_fact, L_look, &tmp_fx ); - return; -} -#endif diff --git a/lib_enc/igf_enc_fx.c b/lib_enc/igf_enc_fx.c index deed347b32a9f41063d9c8a734806a8016cefb5a..72a26b2482533cde5902e0b020ed60d1f0ca799b 100755 --- a/lib_enc/igf_enc_fx.c +++ b/lib_enc/igf_enc_fx.c @@ -4271,10 +4271,8 @@ void IGFEncApplyStereo_fx( { pPowerSpectrumParameter_fx[0] = NULL; pPowerSpectrumParameter_fx[1] = NULL; -#ifdef FIX_2355_IGF_EXP_POWERSPEC exp_pPowerSpectrumParameter_fx[0] = NULL; exp_pPowerSpectrumParameter_fx[1] = NULL; -#endif pPowerSpectrumParameterMsInv_fx[0] = NULL; pPowerSpectrumParameterMsInv_fx[1] = NULL; q_pPowerSpectrumParameterMsInv_fx[0] = NULL; @@ -4297,9 +4295,7 @@ void IGFEncApplyStereo_fx( ELSE { pPowerSpectrumParameter_fx[ch] = NULL; -#ifdef FIX_2355_IGF_EXP_POWERSPEC exp_pPowerSpectrumParameter_fx[ch] = NULL; -#endif } IGF_Whitening_ivas_fx( hIGFEnc[ch], pPowerSpectrumParameter_fx[ch], exp_pPowerSpectrumParameter_fx[ch], igfGridIdx, sts[ch]->hTranDet->transientDetector.bIsAttackPresent, last_core_acelp, ( sts[0]->hTcxEnc->fUseTns[frameno] || sts[1]->hTcxEnc->fUseTns[frameno] ), sp_aud_decision0, element_brate, sts[ch]->element_mode ); diff --git a/lib_enc/ivas_core_enc_fx.c b/lib_enc/ivas_core_enc_fx.c index 2880c054a181ce3141b4ab48ef06ea9c36f7394b..79a28b63a8bdbd2ce74100cca1db72d05bf24a58 100644 --- a/lib_enc/ivas_core_enc_fx.c +++ b/lib_enc/ivas_core_enc_fx.c @@ -87,16 +87,8 @@ ivas_error ivas_core_enc_fx( STEREO_ICBWE_ENC_HANDLE hStereoICBWE; STEREO_TD_ENC_DATA_HANDLE hStereoTD; Word16 voice_factors_fx[CPE_CHANNELS][NB_SUBFR16k]; /* Q15 */ -#ifndef REMOVE_SCALING_SHB_SPEECH - Word32 shb_speech_fx32[L_FRAME16k]; - Word32 *new_swb_speech_fx; -#endif Word16 *inp_fx[CPE_CHANNELS]; Word16 *shb_speech_fx; -#ifndef REMOVE_SCALING_SHB_SPEECH - Word16 Q_shb_spch; - Word32 new_swb_speech_buffer_fx[L_FRAME48k + STEREO_DFT_OVL_MAX]; -#endif Word16 new_inp_resamp16k_fx[CPE_CHANNELS][L_FRAME16k]; /* new input signal @16kHz, non pre-emphasised, used by the WB TBE/BWE */ Word16 *hb_speech_fx; Word32 bwe_exc_extended_fx[CPE_CHANNELS][L_FRAME32k + NL_BUFF_OFFSET]; /* 2 * Q_new */ @@ -114,9 +106,6 @@ ivas_error ivas_core_enc_fx( Word16 max_num_indices_BWE; Word16 i, shift, Q_min; -#ifndef REMOVE_SCALING_SHB_SPEECH - set32_fx( new_swb_speech_buffer_fx, 0, L_FRAME48k + STEREO_DFT_OVL_MAX ); -#endif FOR( i = 0; i < CPE_CHANNELS; i++ ) { set_zero_fx( bwe_exc_extended_fx[i], L_FRAME32k + NL_BUFF_OFFSET ); @@ -129,10 +118,6 @@ ivas_error ivas_core_enc_fx( error = IVAS_ERR_OK; move32(); -#ifndef REMOVE_SCALING_SHB_SPEECH - Q_shb_spch = 0; - move16(); -#endif /*------------------------------------------------------------------* * General initialization *-----------------------------------------------------------------*/ @@ -611,9 +596,6 @@ ivas_error ivas_core_enc_fx( * Postprocessing, BWEs and Updates *---------------------------------------------------------------------*/ -#ifndef FIX_2370_UNUSED_BUFFERS_CORE_ENC - Word16 tmp_input_fx[L_FRAME48k], tmp_old_input_fx[L_FRAME48k], q_inp[2]; -#endif FOR( n = 0; n < n_CoreChannels; n++ ) { st = sts[n]; @@ -628,18 +610,6 @@ ivas_error ivas_core_enc_fx( move16(); } -#ifndef FIX_2370_UNUSED_BUFFERS_CORE_ENC - Copy( st->input_fx - input_frame, tmp_old_input_fx, input_frame ); - Copy( st->input_fx, tmp_input_fx, input_frame ); - q_inp[0] = st->q_old_inp; - q_inp[1] = st->q_inp; - - Scale_sig( st->input_fx - input_frame, shl( input_frame, 1 ), sub( -1, st->q_inp ) ); - st->q_inp = -1; - move16(); - st->q_old_inp = -1; - move16(); -#endif /*---------------------------------------------------------------------* * Postprocessing for ACELP/HQ core switching *---------------------------------------------------------------------*/ @@ -683,7 +653,6 @@ ivas_error ivas_core_enc_fx( * SWB(FB) BWE encoding *---------------------------------------------------------------------*/ -#ifdef FIX_2370_UNUSED_BUFFERS_CORE_ENC Word16 q_inp_orig; q_inp_orig = st->q_inp; move16(); @@ -696,11 +665,7 @@ ivas_error ivas_core_enc_fx( move16(); Scale_sig( st->input_fx - input_frame, shl( input_frame, 1 ), sub( st->q_inp, q_inp_orig ) ); } -#endif -#ifndef REMOVE_SCALING_SHB_SPEECH - new_swb_speech_fx = new_swb_speech_buffer_fx + STEREO_DFT_OVL_MAX; -#endif new_swb_speech_fx_16 = new_swb_speech_buffer_fx_16 + STEREO_DFT_OVL_MAX; set16_fx( new_swb_speech_buffer_fx_16, 0, L_FRAME48k + STEREO_DFT_OVL_MAX ); shb_speech_fx = new_inp_resamp16k_fx[n]; /* reuse existing buffer: shb_speech[L_FRAME16k] */ @@ -733,11 +698,7 @@ ivas_error ivas_core_enc_fx( st->cldfbSynTd->Q_cldfb_state = sub( q_re_im_buf[n], 1 ); } -#ifdef REMOVE_SCALING_SHB_SPEECH swb_pre_proc_ivas_fx( st, new_swb_speech_fx_16, shb_speech_fx, realBuffer_fx[n], imagBuffer_fx[n], q_re_im_buf[n], hCPE ); -#else - swb_pre_proc_ivas_fx( st, new_swb_speech_fx_16, new_swb_speech_fx, shb_speech_fx, &Q_shb_spch, realBuffer_fx[n], imagBuffer_fx[n], q_re_im_buf[n], hCPE ); -#endif st->cldfbSynTd->Q_cldfb_state = sub( q_re_im_buf[n], 1 ); } @@ -749,26 +710,13 @@ ivas_error ivas_core_enc_fx( } } -#ifndef REMOVE_SCALING_SHB_SPEECH - Word16 Q_shb_spch_16 = Q_shb_spch; - move16(); - IF( st->tcxonly == 0 || hStereoICBWE != NULL || st->core == ACELP_CORE ) // temp. fix to keep BE until #1504 (FLP) is solved, then it will become: - // IF( st->tcxonly == 0 ) + IF( st->hBWE_FD ) { - shift = add( getScaleFactor16( shb_speech_fx, L_FRAME16k ), Q16 ); - Copy_Scale_sig_16_32_no_sat( shb_speech_fx, shb_speech_fx32, L_FRAME16k, shift ); // Q_shb_spch - Q_shb_spch = add( Q_shb_spch, shift ); -#endif - IF( st->hBWE_FD ) - { - shift = getScaleFactor16( st->hBWE_FD->L_old_wtda_swb_fx, L_FRAME48k ); - st->Q_old_wtda = add( st->Q_old_wtda, shift ); - move16(); - Scale_sig( st->hBWE_FD->L_old_wtda_swb_fx, L_FRAME48k, shift ); // st->Q_old_wtda - } -#ifndef REMOVE_SCALING_SHB_SPEECH + shift = getScaleFactor16( st->hBWE_FD->L_old_wtda_swb_fx, L_FRAME48k ); + st->Q_old_wtda = add( st->Q_old_wtda, shift ); + move16(); + Scale_sig( st->hBWE_FD->L_old_wtda_swb_fx, L_FRAME48k, shift ); // st->Q_old_wtda } -#endif /* SWB TBE encoder */ test(); @@ -781,11 +729,7 @@ ivas_error ivas_core_enc_fx( Word16 Q_fb_exc; Word16 fb_exc_fx[L_FRAME16k]; -#ifdef REMOVE_SCALING_SHB_SPEECH swb_tbe_enc_ivas_fx( st, hStereoICBWE, shb_speech_fx, bwe_exc_extended_fx[n], voice_factors_fx[n], fb_exc_fx, &Q_fb_exc, Q_new[n], 0, st->voicing_fx, pitch_buf_fx[n] ); -#else - swb_tbe_enc_ivas_fx( st, hStereoICBWE, shb_speech_fx, bwe_exc_extended_fx[n], voice_factors_fx[n], fb_exc_fx, &Q_fb_exc, Q_new[n], Q_shb_spch_16, st->voicing_fx, pitch_buf_fx[n] ); -#endif IF( EQ_16( st->extl, FB_TBE ) ) { @@ -800,20 +744,12 @@ ivas_error ivas_core_enc_fx( } ELSE IF( EQ_16( st->extl, SWB_BWE ) || EQ_16( st->extl, FB_BWE ) ) { -#ifndef REMOVE_SCALING_SHB_SPEECH - Copy_Scale_sig_32_16( shb_speech_fx32, shb_speech_fx, L_FRAME16k, -Q16 ); // Q_shb_spch - 16 -#endif /* SWB(FB) BWE encoder */ -#ifdef REMOVE_SCALING_SHB_SPEECH swb_bwe_enc_ivas_fx( st, last_element_mode, old_inp_12k8_fx[n], old_inp_16k_fx[n], old_syn_12k8_16k_fx[n], new_swb_speech_fx_16, st->q_inp, shb_speech_fx, sub( Q_new[n], 1 ) ); -#else - swb_bwe_enc_ivas_fx( st, last_element_mode, old_inp_12k8_fx[n], old_inp_16k_fx[n], old_syn_12k8_16k_fx[n], new_swb_speech_fx_16, st->q_inp, shb_speech_fx, sub( Q_shb_spch, Q16 ), sub( Q_new[n], 1 ) ); -#endif } Scale_sig( old_syn_12k8_16k_fx[n], L_FRAME16k, sub( Q1, Q_new[n] ) ); // Q0 -#ifdef FIX_2370_UNUSED_BUFFERS_CORE_ENC IF( GE_32( input_Fs, 32000 ) && st->hBWE_TD != NULL ) { Scale_sig( st->input_fx, input_frame, sub( q_inp_orig, st->q_inp ) ); @@ -821,7 +757,6 @@ ivas_error ivas_core_enc_fx( move16(); } -#endif /*---------------------------------------------------------------------* * SWB DTX/CNG encoding *---------------------------------------------------------------------*/ @@ -832,9 +767,6 @@ ivas_error ivas_core_enc_fx( IF( st->hTdCngEnc != NULL && st->Opt_DTX_ON && ( GE_16( input_frame, L_FRAME32k ) || EQ_16( st->element_mode, IVAS_CPE_DFT ) ) ) { /* SHB DTX/CNG encoder */ -#ifndef REMOVE_SCALING_SHB_SPEECH - Copy_Scale_sig_32_16( shb_speech_fx32, shb_speech_fx, L_FRAME16k, negate( Q_shb_spch ) ); // Q0 -#endif swb_CNG_enc_fx( st, shb_speech_fx, old_syn_12k8_16k_fx[n] ); } @@ -842,59 +774,15 @@ ivas_error ivas_core_enc_fx( * Inter-channel BWE encoding *-------------------------------------------------------------------*/ -#ifndef FIX_2367_REMOVE_CODE_ICBWE - Word16 q_new_swb_speech_buffer = getScaleFactor16( new_swb_speech_buffer_fx_16, L_FRAME48k + STEREO_DFT_OVL_MAX ); - Scale_sig( new_swb_speech_buffer_fx_16, L_FRAME48k + STEREO_DFT_OVL_MAX, q_new_swb_speech_buffer ); // st->q_inp+q_new_swb_speech_buffer - q_new_swb_speech_buffer = add( st->q_inp, q_new_swb_speech_buffer ); -#endif test(); test(); IF( n == 0 && GE_32( input_Fs, 32000 ) && hStereoICBWE != NULL ) { -#ifndef FIX_2367_REMOVE_CODE_ICBWE -#ifdef FIX_2367_REMOVE_CODE_ICBWE - Word16 q_new_swb_speech_buffer = st->q_inp; -#endif - Word32 voice_factors_fx32[CPE_CHANNELS][NB_SUBFR16k]; - stereo_icBWE_preproc_fx( hCPE, input_frame, new_swb_speech_buffer_fx_16 /*tmp buffer*/, q_new_swb_speech_buffer ); - - q_new_swb_speech_buffer = add( q_new_swb_speech_buffer, Q16 ); - Copy_Scale_sig_16_32_no_sat( new_swb_speech_buffer_fx_16, new_swb_speech_buffer_fx, L_FRAME48k + STEREO_DFT_OVL_MAX, Q16 ); // q_new_swb_speech_buffer+st->q_inp - 16 - > q_new_swb_speech_buffer+st->q_inp - Copy_Scale_sig_16_32_no_sat( voice_factors_fx[0], voice_factors_fx32[0], NB_SUBFR16k, Q16 ); // Q31 - - stereo_icBWE_enc_fx( hCPE, shb_speech_fx32, sub( Q31, Q_shb_spch ), new_swb_speech_buffer_fx, sub( Q31, q_new_swb_speech_buffer ), voice_factors_fx32[0] ); -#else stereo_icBWE_preproc_fx( hCPE, input_frame, new_swb_speech_buffer_fx_16 /*tmp buffer*/, st->q_inp ); stereo_icBWE_enc_fx( hCPE, shb_speech_fx, new_swb_speech_buffer_fx_16, st->q_inp, voice_factors_fx[0] ); -#endif -#ifndef FIX_2367_REMOVE_CODE_ICBWE - IF( EQ_16( st->element_mode, IVAS_CPE_DFT ) ) - { - test(); - test(); - test(); - IF( ( EQ_16( st->extl, SWB_TBE ) || EQ_16( st->extl, WB_TBE ) || EQ_16( st->extl, FB_TBE ) ) && EQ_16( st->flag_ACELP16k, 1 ) ) - { - } - ELSE - { - hStereoICBWE->prevSpecMapping_fx = 0; - move32(); - } - } -#endif } -#ifndef FIX_2370_UNUSED_BUFFERS_CORE_ENC - Copy( tmp_old_input_fx, st->input_fx - input_frame, input_frame ); - Copy( tmp_input_fx, st->input_fx, input_frame ); - st->q_old_inp = q_inp[0]; - move16(); - st->q_inp = q_inp[1]; - move16(); - -#endif /*---------------------------------------------------------------------* * Common updates *---------------------------------------------------------------------*/ diff --git a/lib_enc/ivas_core_pre_proc_front_fx.c b/lib_enc/ivas_core_pre_proc_front_fx.c index 8541b3fd9f4134151535894ee2319b61a04dfb43..6e5a73a964c4a560d540ecfa5bbc7a961d4b1c1e 100644 --- a/lib_enc/ivas_core_pre_proc_front_fx.c +++ b/lib_enc/ivas_core_pre_proc_front_fx.c @@ -1057,11 +1057,7 @@ void pre_proc_front_ivas_fx( move16(); move16(); -#ifndef FIX_2363_FIND_WSP - ivas_find_wsp_fx( L_FRAME, L_SUBFR, NB_SUBFR, A_fx, Aw_fx, inp_12k8_fx, TILT_FAC_FX, wsp_fx, &st->mem_wsp_fx, GAMMA1, L_LOOK_12k8 ); -#else find_wsp_fx( A_fx, inp_12k8_fx, wsp_fx, &st->mem_wsp_fx, TILT_FAC_FX, L_FRAME, L_LOOK_12k8, L_SUBFR, Aw_fx, GAMMA1, NB_SUBFR ); -#endif Word16 Q_wsp = *Q_new; move16(); diff --git a/lib_enc/ivas_core_pre_proc_fx.c b/lib_enc/ivas_core_pre_proc_fx.c index e83973437cfbbb2478041afa7aa458d0749b5d95..25bd4393552ee68e60214ff120d73db6d546c4c7 100644 --- a/lib_enc/ivas_core_pre_proc_fx.c +++ b/lib_enc/ivas_core_pre_proc_fx.c @@ -707,11 +707,7 @@ void ivas_compute_core_buffers_fx( Word16 i, shift, Q_min; Word16 preemp_len, inp_max; Word16 *preemp_start_idx = NULL; -#ifdef FIX_2376_FIX_USAN_PRE_PROC Word32 sig_out[STEREO_DFT_OVL_16k + L_FRAME16k + L_FILT16k], max_32; -#else - Word32 sig_out[STEREO_DFT_OVL_16k + L_FRAME16k /* = max( L_FRAME16k + STEREO_DFT_OVL_16k, L_FRAME16k + L_FILT16k + lMemRecalc_16k ) */], max_32; -#endif Copy_Scale_sig( st->input_fx - input_frame, input_buf_fx, input_frame, sub( -1, st->q_old_inp ) ); Copy_Scale_sig( st->input_fx, input_buf_fx + input_frame, input_frame, sub( -1, st->q_inp ) ); @@ -1109,11 +1105,7 @@ void ivas_compute_core_buffers_fx( * Compute Weighted Input *---------------------------------------------------------------*/ -#ifndef FIX_2363_FIND_WSP - ivas_find_wsp_fx( L_FRAME16k, L_SUBFR, NB_SUBFR16k, A_fx, Aw_fx, st->speech_enc_pe, PREEMPH_FAC_16k, st->wspeech_enc, &st->mem_wsp_enc, st->gamma, L_LOOK_16k ); -#else find_wsp_fx( A_fx, st->speech_enc_pe, st->wspeech_enc, &st->mem_wsp_enc, PREEMPH_FAC_16k, L_FRAME16k, L_LOOK_16k, L_SUBFR, Aw_fx, st->gamma, NB_SUBFR16k ); -#endif } /*-----------------------------------------------------------------* diff --git a/lib_enc/ivas_front_vad_fx.c b/lib_enc/ivas_front_vad_fx.c index b4447f2a16260b259a7f4fa5664e73dc8ae754f8..e4cac36d27450af839f3a9752f238305199176dc 100644 --- a/lib_enc/ivas_front_vad_fx.c +++ b/lib_enc/ivas_front_vad_fx.c @@ -635,11 +635,7 @@ ivas_error front_vad_spar_fx( st->mem_wsp_q = Q_inp_12k8; move16(); -#ifndef FIX_2363_FIND_WSP - ivas_find_wsp_fx( L_FRAME, L_SUBFR, NB_SUBFR, A_fx, Aw_fx, inp_12k8_fx, TILT_FAC_FX, wsp_fx, &st->mem_wsp_fx, GAMMA1, L_LOOK_12k8 ); -#else find_wsp_fx( A_fx, inp_12k8_fx, wsp_fx, &st->mem_wsp_fx, TILT_FAC_FX, L_FRAME, L_LOOK_12k8, L_SUBFR, Aw_fx, GAMMA1, NB_SUBFR ); -#endif IF( st->vad_flag == 0 ) { @@ -703,11 +699,7 @@ ivas_error front_vad_spar_fx( { cor_strong_limit = &dummy_int; } -#ifndef FIX_2364_HARM_MULT_HARM - loc_harm = multi_harm_fx( st->lgBin_E_fx, hFrontVad->hNoiseEst->old_S_fx, hFrontVad->hNoiseEst->cor_map_fx, &hFrontVad->hNoiseEst->multi_harm_limit_fx, st->total_brate, st->bwidth, cor_strong_limit, &st->hSpMusClas->mean_avr_dyn_fx, &st->hSpMusClas->last_sw_dyn_fx, &cor_map_sum_fx, &dummy_fx, S_map_fx ); /* Q0 */ -#else loc_harm = multi_harm_fx( EVS_MONO, st->lgBin_E_fx, hFrontVad->hNoiseEst->old_S_fx, hFrontVad->hNoiseEst->cor_map_fx, &hFrontVad->hNoiseEst->multi_harm_limit_fx, st->total_brate, st->bwidth, cor_strong_limit, &st->hSpMusClas->mean_avr_dyn_fx, &st->hSpMusClas->last_sw_dyn_fx, &cor_map_sum_fx, &dummy_fx, S_map_fx ); /* Q0 */ -#endif } scale = getScaleFactor32( epsP_fx, M + 1 ); diff --git a/lib_enc/ivas_mct_enc_mct_fx.c b/lib_enc/ivas_mct_enc_mct_fx.c index 84bc74dd98149b30521d9403528b1111879a78bb..c725950b164569cbdddd20e0153cb120f6d760d5 100644 --- a/lib_enc/ivas_mct_enc_mct_fx.c +++ b/lib_enc/ivas_mct_enc_mct_fx.c @@ -88,33 +88,20 @@ void getChannelEnergies_fx( gb = find_guarded_bits_fx( (Word32) L_subframe ); -#ifndef FIX_2356_GET_CHAN_ENERGIES - sum2_e = st->hTcxEnc->spectrum_e[0]; - move16(); -#endif nrg[ch] = 0; move32(); -#ifdef FIX_2356_GET_CHAN_ENERGIES nrg_e[ch] = 0; /* if the mantissa is 0, the exponent gets set to sum2_e inside BASOP_Util_Add_Mant32Exp() */ move16(); -#endif FOR( n = 0; n < nSubframes; n++ ) { -#ifdef FIX_2356_GET_CHAN_ENERGIES sum2_e = st->hTcxEnc->spectrum_e[n]; move16(); -#endif sum2 = sum2_32_exp_fx( st->hTcxEnc->spectrum_fx[n], L_subframe, &sum2_e, gb ); // 31 - sum2_e nrg[ch] = BASOP_Util_Add_Mant32Exp( nrg[ch], nrg_e[ch], sum2, sum2_e, &nrg_e[ch] ); move32(); - -#ifndef FIX_2356_GET_CHAN_ENERGIES - sum2_e = st->hTcxEnc->spectrum_e[0]; - move16(); -#endif } nrg[ch] = Sqrt32( nrg[ch], &nrg_e[ch] ); // nrg_e diff --git a/lib_enc/ivas_sce_enc_fx.c b/lib_enc/ivas_sce_enc_fx.c index 3e62c720eab51e3a7fce1bd9a0da5055c5c06482..17635449055476fe4d1f31472934d2561af8dc6f 100644 --- a/lib_enc/ivas_sce_enc_fx.c +++ b/lib_enc/ivas_sce_enc_fx.c @@ -473,10 +473,8 @@ ivas_error create_sce_enc_fx( } st->total_brate = hSCE->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ -#ifdef FIX_1283_STEREO_DFT_COLLAPSE st->element_brate = -1; move32(); -#endif st->mct_chan_mode = MCT_CHAN_MODE_REGULAR; move32(); move32(); diff --git a/lib_enc/ivas_stereo_dft_enc_fx.c b/lib_enc/ivas_stereo_dft_enc_fx.c index d6af9caf00693ac59a08ae9190ba44f4fab199fe..6aa9673f4ffa4be17f82d8a7855128a91d4806c4 100644 --- a/lib_enc/ivas_stereo_dft_enc_fx.c +++ b/lib_enc/ivas_stereo_dft_enc_fx.c @@ -3953,16 +3953,10 @@ static void stereo_dft_enc_compute_prm_fx( * Compute Side gains *-----------------------------------------------------------------*/ -#ifdef FIX_BASOP_2317_UNINIT_VALUE_IN_STEREO_CNG Copy32( pSideGain, hStereoDft->sidSideGain_fx, STEREO_DFT_BAND_MAX ); /* Copy all sideGain values since BW change may be reverted during CNG */ -#endif FOR( b = 0; b < hStereoDft->nbands; b++ ) { -#ifndef FIX_BASOP_2317_UNINIT_VALUE_IN_STEREO_CNG - hStereoDft->sidSideGain_fx[b] = *( pSideGain + b ); - move32(); -#endif /* Quantization */ IF( flag_quant ) diff --git a/lib_enc/ivas_stereo_icbwe_enc_fx.c b/lib_enc/ivas_stereo_icbwe_enc_fx.c index 366b93c26eb1bcf487247623ee4adcff1537e633..1fbbd777ae53990ae7894a2a1b8d857e0ef8f4ec 100644 --- a/lib_enc/ivas_stereo_icbwe_enc_fx.c +++ b/lib_enc/ivas_stereo_icbwe_enc_fx.c @@ -612,21 +612,11 @@ static void icbwe_dft_stereo_param_fx( *-------------------------------------------------------------------*/ void stereo_icBWE_enc_fx( - CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ -#ifdef REMOVE_SCALING_SHB_SPEECH + CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ const Word16 shb_speech_ref_fx16[], /* i : SHB speech ref channel Q0*/ Word16 shb_speech_nonref_fx_16[], /* i/o: SHB speech non-ref channel shb_speech_nonref_e*/ -#else - const Word32 shb_speech_ref_fx[], /* i : SHB speech ref channel shb_speech_ref_e*/ - const Word16 shb_speech_ref_e, /* i : SHB speech ref channel */ - Word32 shb_speech_nonref_fx[], /* i/o: SHB speech non-ref channel Q31-shb_speech_nonref_e*/ -#endif - Word16 shb_speech_nonref_e, /* i/o: SHB speech non-ref channel */ -#ifdef REMOVE_SCALING_SHB_SPEECH - const Word16 *voice_factors_fx16 /* i : voicing factors Q15 */ -#else - const Word32 *voice_factors_fx /* i : voicing factors Q31 */ -#endif + Word16 shb_speech_nonref_e, /* i/o: SHB speech non-ref channel */ + const Word16 *voice_factors_fx16 /* i : voicing factors Q15 */ ) { Word16 i, j, k, nbSubFr; @@ -650,7 +640,6 @@ void stereo_icBWE_enc_fx( Word32 temp1_fx, temp2_fx; Word16 temp1_e, temp2_e, shb_frame_ref_e, shb_frame_nonref_e, gDes_e, tmp, exp; -#ifdef REMOVE_SCALING_SHB_SPEECH Word32 shb_speech_ref_fx[L_FRAME16k]; Word16 shb_speech_ref_e; Word32 shb_speech_nonref_fx[L_FRAME48k + STEREO_DFT_OVL_MAX]; @@ -663,7 +652,6 @@ void stereo_icBWE_enc_fx( shb_speech_nonref_e = Q15 - shb_speech_nonref_e; Copy_Scale_sig_16_32_no_sat( shb_speech_nonref_fx_16, shb_speech_nonref_fx, L_FRAME48k + STEREO_DFT_OVL_MAX, Q16 ); // q_new_swb_speech_buffer+st->q_inp - 16 - > q_new_swb_speech_buffer+st->q_inp Copy_Scale_sig_16_32_no_sat( voice_factors_fx16, voice_factors_fx, NB_SUBFR16k, Q16 ); // Q31 -#endif /* initialization */ hStereoDft = hCPE->hStereoDft; diff --git a/lib_enc/multi_harm_fx.c b/lib_enc/multi_harm_fx.c index 79a2efca6b57134e49fb0dc2c6259bbb21cfe885..6c0ef3f094856d397141a4ec99d2093c200bb43b 100644 --- a/lib_enc/multi_harm_fx.c +++ b/lib_enc/multi_harm_fx.c @@ -28,21 +28,19 @@ /* o : frame multi-harmonicity (1-harmonic, 0-not) */ Word16 multi_harm_fx( -#ifdef FIX_2364_HARM_MULT_HARM const Word16 element_mode, /* i : IVAS element_mode Q0 */ -#endif - const Word16 Bin_E[], /* i : log-energy spectrum of the current frame Q7 */ - Word16 old_S[], /* i/o: prev. log-energy spectrum w. subtracted floor Q7 */ - Word16 cor_map_LT[], /* i/o: LT correlation map Q15 */ - Word16 *multi_harm_limit, /* i/o: multi harminic threshold Q9 */ - const Word32 total_brate, /* i : total bitrate Q0 */ - const Word16 bwidth, /* i : input signal bandwidth Q0 */ - Word16 *cor_strong_limit, /* i/o: HF correlation indicator Q0 */ - Word16 *st_mean_avr_dyn, /* i/o: long term average dynamic Q7 */ - Word16 *st_last_sw_dyn, /* i/o: last dynamic Q7 */ - Word16 *cor_map_sum, /* i : sum of correlation map Q8 */ - Word16 *sp_floor, /* o: noise floor estimate Q7 */ - Word16 S_map[] /* o : short-term correlation map Q7 */ + const Word16 Bin_E[], /* i : log-energy spectrum of the current frame Q7 */ + Word16 old_S[], /* i/o: prev. log-energy spectrum w. subtracted floor Q7 */ + Word16 cor_map_LT[], /* i/o: LT correlation map Q15 */ + Word16 *multi_harm_limit, /* i/o: multi harminic threshold Q9 */ + const Word32 total_brate, /* i : total bitrate Q0 */ + const Word16 bwidth, /* i : input signal bandwidth Q0 */ + Word16 *cor_strong_limit, /* i/o: HF correlation indicator Q0 */ + Word16 *st_mean_avr_dyn, /* i/o: long term average dynamic Q7 */ + Word16 *st_last_sw_dyn, /* i/o: last dynamic Q7 */ + Word16 *cor_map_sum, /* i : sum of correlation map Q8 */ + Word16 *sp_floor, /* o: noise floor estimate Q7 */ + Word16 S_map[] /* o : short-term correlation map Q7 */ ) { Word16 i, j, k, L, stemp, N_mins, ind_mins[L_FFT / 4], *pt_mins, harm; @@ -51,9 +49,7 @@ Word16 multi_harm_fx( Word32 L_acc; Word32 Lcorx2, Lcory2, Lcorxy, Lcor_map_LT_sum; Word16 mean_dyn; -#ifdef FIX_2364_HARM_MULT_HARM Word32 tmp2_32; -#endif /*------------------------------------------------------------------* * initialization @@ -132,7 +128,6 @@ Word16 multi_harm_fx( step = 0; move16(); -#ifdef FIX_2364_HARM_MULT_HARM IF( element_mode != EVS_MONO ) { FOR( i = ind_mins[0]; i < ind_mins[N_mins]; i++ ) @@ -160,7 +155,6 @@ Word16 multi_harm_fx( } } ELSE -#endif { FOR( i = ind_mins[0]; i < ind_mins[N_mins]; i++ ) { @@ -328,10 +322,8 @@ Word16 multi_harm_fx( Lcor_map_LT_sum = L_deposit_l( 0 ); tmp2 = 0; move16(); -#ifdef FIX_2364_HARM_MULT_HARM tmp2_32 = 0; move32(); -#endif cor_strong = 0; move16(); pt1 = cor_map_LT; // Q15 @@ -339,7 +331,6 @@ Word16 multi_harm_fx( pt2 = cor_map; move16(); -#ifdef FIX_2364_HARM_MULT_HARM IF( element_mode != EVS_MONO ) { FOR( i = 0; i < L; i++ ) @@ -366,7 +357,6 @@ Word16 multi_harm_fx( tmp2 = extract_l( L_shr_sat( tmp2_32, 7 ) ); // q15-> q8 } ELSE -#endif { FOR( i = 0; i < L; i++ ) { @@ -437,339 +427,3 @@ Word16 multi_harm_fx( return harm; } -#ifndef FIX_2364_HARM_MULT_HARM -/* o : frame multi-harmonicity (1-harmonic, 0-not) */ -Word16 multi_harm_ivas_fx( - const Word16 Bin_E[], /* i : log-energy spectrum of the current frame Q7 */ - Word16 old_S[], /* i/o: prev. log-energy spectrum w. subtracted floor Q7 */ - Word16 cor_map_LT[], /* i/o: LT correlation map Q15 */ - Word16 *multi_harm_limit, /* i/o: multi harminic threshold Q9 */ - const Word32 total_brate, /* i : total bitrate Q0 */ - const Word16 bwidth, /* i : input signal bandwidth Q0 */ - Word16 *cor_strong_limit, /* i/o: HF correlation indicator Q0 */ - Word16 *st_mean_avr_dyn, /* i/o: long term average dynamic Q7 */ - Word16 *st_last_sw_dyn, /* i/o: last dynamic Q7 */ - Word16 *cor_map_sum, /* i : sum of correlation map Q8 */ - Word16 *sp_floor, /* o: noise floor estimate Q7 */ - Word16 S_map[] /* o : short-term correlation map Q7 */ -) -{ - Word16 i, j, k, L, stemp, N_mins, ind_mins[L_FFT / 4], *pt_mins, harm; - Word16 S[L_FFT / 2], flor, step, tmp16, tmp2, Expx2, Expy2; - Word32 tmp2_32; - Word16 corx2, cory2, corxy, cor, cor_map[L_FFT / 2], *pt1, *pt2, cor_strong; - Word32 L_acc; - Word32 Lcorx2, Lcory2, Lcorxy, Lcor_map_LT_sum; - Word16 mean_dyn; - - /*------------------------------------------------------------------* - * initialization - *------------------------------------------------------------------*/ - - /* length of the useful part of the spectrum (up to 6.4kHz) */ - L = L_FFT / 2; - move16(); - if ( ( bwidth == NB ) ) - { - /* length of the useful part of the spectrum (up to 3.6kHz) */ - L = 76; - move16(); - } - - Copy( Bin_E, S, L ); - - /*------------------------------------------------------------------* - * searching of spectral maxima and minima - *------------------------------------------------------------------*/ - - pt_mins = ind_mins; - - /* index of the first minimum */ - if ( LT_16( Bin_E[0], Bin_E[1] ) ) - { - *pt_mins++ = 0; - move16(); - } - - FOR( i = 1; i < L - 1; i++ ) - { - /* minimum found */ - test(); - if ( LT_16( Bin_E[i], Bin_E[i - 1] ) && LT_16( Bin_E[i], Bin_E[i + 1] ) ) - { - *pt_mins++ = i; - move16(); - } - } - - /* index of the last minimum */ - IF( LT_16( Bin_E[L - 1], Bin_E[L - 2] ) ) - { - *pt_mins++ = sub( L, 1 ); - move16(); - } - - /* total number of minimas found */ - N_mins = (Word16) ( pt_mins - ind_mins - 1 ); - move16(); - - /*------------------------------------------------------------------* - * calculation of the spectral floor - * subtraction of the spectral floor - *------------------------------------------------------------------*/ - - set16_fx( S, 0, L ); - - IF( N_mins > 0 ) - { - L_acc = L_deposit_l( 0 ); - FOR( i = 0; i < N_mins; ++i ) - { - L_acc = L_mac0( L_acc, Bin_E[ind_mins[i]], 1 ); - } - *sp_floor = extract_l( Mult_32_16( L_acc, div_s( 1, N_mins ) ) ); - move16(); - - set16_fx( S, 0, ind_mins[0] ); - set16_fx( &S[ind_mins[N_mins]], 0, sub( shr( L_FFT, 1 ), ind_mins[N_mins] ) ); - - pt_mins = ind_mins; - flor = 0; - move16(); - step = 0; - move16(); - - FOR( i = ind_mins[0]; i < ind_mins[N_mins]; i++ ) - { - /* we are at the end of the next minimum */ - IF( EQ_16( i, *pt_mins ) ) - { - pt_mins++; - flor = Bin_E[i]; - move16(); /*Q7*/ - - /* calculate the new step */ - /*step = (Bin_E[*pt_mins] - Bin_E[i]) / (*pt_mins-i);*/ - - tmp16 = div_s( 1, sub( *pt_mins, i ) ); // Q15 - step = msu_r( L_mult( Bin_E[*pt_mins], tmp16 ), Bin_E[i], tmp16 ); // Q7 (15+7+1-16) - } - - /* subtract the floor */ - S[i] = s_max( sub_sat( Bin_E[i], flor ), 0 ); - move16(); - - /* update the floor */ - flor = add( flor, step ); /*Q7*/ - } - } - - /* Calculate the maximum dynamic per band */ - /* since we are processing 40 bins we will use 1/40 in Q15 to find the mean */ - /* mean_dyn = mean(&S[L-40], 40);*/ - L_acc = L_deposit_l( 0 ); - FOR( i = L - 40; i < L; i++ ) - { - L_acc = L_mac( L_acc, S[i], 819 /* 1 / 40 in Q15 */ ); - } - mean_dyn = round_fx( L_acc ); /*Q7*/ - - /*mean_dyn = 0.6f * *st_mean_avr_dyn + 0.4f * mean_dyn;*/ - L_acc = L_mult( 13107 /*0.4f*/, mean_dyn ); /*Q23*/ - L_acc = L_mac( L_acc, 19661 /*0.6f*/, *st_mean_avr_dyn ); /*Q23*/ - mean_dyn = round_fx( L_acc ); /*Q7*/ - - test(); - IF( LT_16( mean_dyn, 1229 ) /*9.6f*/ && *cor_strong_limit != 0 ) - { - *cor_strong_limit = 0; - move16(); - *st_last_sw_dyn = mean_dyn; - move16(); - } - ELSE IF( GT_16( sub( mean_dyn, *st_last_sw_dyn ), 576 ) /*4.5f*/ ) - { - *cor_strong_limit = 1; - move16(); - } - test(); - if ( LT_32( total_brate, ACELP_9k60 ) || GT_32( total_brate, ACELP_16k40 ) ) - { - *cor_strong_limit = 1; - move16(); - } - - *st_mean_avr_dyn = mean_dyn; - move16(); - - /*------------------------------------------------------------------* - * calculation of the correlation map - *------------------------------------------------------------------*/ - - set16_fx( cor_map, 0, L ); - IF( N_mins > 0 ) - { - Lcorx2 = L_deposit_l( 0 ); - Lcorxy = L_deposit_l( 0 ); - stemp = ind_mins[0]; - move16(); - Lcory2 = L_mult( old_S[stemp], old_S[stemp] ); - k = 1; - move16(); - - FOR( i = add( stemp, 1 ); i <= ind_mins[N_mins]; i++ ) - { - IF( EQ_16( i, ind_mins[k] ) ) - { - /* include the last peak point (new minimum) to the corr. sum */ - Lcory2 = L_mac_sat( Lcory2, old_S[i], old_S[i] ); - - /* calculation of the norm. peak correlation */ - test(); - IF( Lcorx2 != 0 && Lcory2 != 0 ) - { - /* corxy * corxy*/ - tmp16 = sub( norm_l( Lcorxy ), 1 ); - corxy = extract_h( L_shl( Lcorxy, tmp16 ) ); - corxy = mult_r( corxy, corxy ); - /* (corx2 * cory2) */ - Expx2 = norm_l( Lcorx2 ); - Expy2 = norm_l( Lcory2 ); - corx2 = extract_h( L_shl( Lcorx2, Expx2 ) ); - cory2 = extract_h( L_shl( Lcory2, Expy2 ) ); - corx2 = mult_r( corx2, cory2 ); - Expx2 = add( Expy2, Expx2 ); - /* Validate num < den */ - cor = sub( corx2, corxy ); - cor = shr( cor, 15 ); - /* Add 1 to tmp16 & shr by 2 if corxy > corx2 */ - tmp16 = sub( tmp16, cor ); - corxy = shl( corxy, cor ); - corxy = shl( corxy, cor ); - /* cor = corxy * corxy / (corx2 * cory2) */ - corxy = div_s( corxy, corx2 ); - cor = shr_sat( corxy, sub( shl( tmp16, 1 ), Expx2 ) ); /* Q15 */ - } - ELSE - { - cor = 0; - move16(); - } - - /* save the norm. peak correlation in the correlation map */ - FOR( j = ind_mins[k - 1]; j < ind_mins[k]; j++ ) - { - old_S[j] = S[j]; - move16(); - S[j] = shr( cor, 8 ); - move16(); - cor_map[j] = cor; - move16(); - } - - Lcorx2 = L_deposit_l( 0 ); - Lcory2 = L_deposit_l( 0 ); - Lcorxy = L_deposit_l( 0 ); - - k++; - } - Lcorx2 = L_mac_sat( Lcorx2, S[i], S[i] ); - Lcory2 = L_mac_sat( Lcory2, old_S[i], old_S[i] ); - Lcorxy = L_mac_sat( Lcorxy, S[i], old_S[i] ); - } - - Copy( S, old_S, ind_mins[0] ); - Copy( &S[ind_mins[N_mins]], &old_S[ind_mins[N_mins]], sub( L, ind_mins[N_mins] ) ); - } - ELSE - { - *sp_floor = Bin_E[0]; - move16(); - } - *sp_floor = mult( *sp_floor, 14231 /* 1.0f / logf( 10.0f ) in Q15 */ ); - move16(); /* Convert to log10() */ - - /*------------------------------------------------------------------* - * updating of the long-term correlation map - * summation of the long-term correlation map - *------------------------------------------------------------------*/ - - Lcor_map_LT_sum = L_deposit_l( 0 ); - tmp2_32 = 0; - move16(); - - cor_strong = 0; - move16(); - pt1 = cor_map_LT; - move16(); - pt2 = cor_map; - move16(); - FOR( i = 0; i < L; i++ ) - { - /* tmp2 += S[i]; */ - tmp2_32 = L_add( tmp2_32, cor_map[i] ); /* tmp2_32 in Q15; max value is 128) */ - - /* *pt1 = M_ALPHA_FX * *pt1 + (1-M_ALPHA_FX) * *pt2++ */ - *pt1 = mac_r( L_mult( ONE_MINUS_M_ALPHA, *pt2 ), M_ALPHA_FX, *pt1 ); - move16(); - - /* cor_map_LT_sum += *pt1 */ - Lcor_map_LT_sum = L_add( Lcor_map_LT_sum, *pt1 ); /* cor_map_LT_sum in Q15; max value is 128) */ - - if ( GT_16( *pt1, 31130 ) /*0.95f*/ ) - { - cor_strong = 1; - move16(); - } - - pt1++; - pt2++; - } - tmp2 = extract_l( L_shr_sat( tmp2_32, 7 ) ); // q15-> q8 - - IF( ( bwidth == NB ) ) - { - /* cor_map_LT_sum *= 1.53f; */ - /* tmp2 *= 1.53f; */ - Lcor_map_LT_sum = L_shl( Mult_32_16( Lcor_map_LT_sum, 25068 /* 1.53f in Q14 */ ), 1 ); - tmp2 = round_fx( L_mac( L_mult( tmp2, 32767 ), tmp2, 17367 /* 0.53 in Q15 */ ) ); - } - *cor_map_sum = tmp2; - move16(); - - /* final decision about multi-harmonicity */ - harm = 0; - move16(); - test(); - if ( ( L_msu0( Lcor_map_LT_sum, *multi_harm_limit, 64 ) > 0 ) || ( cor_strong != 0 ) ) - { - harm = 1; - move16(); - } - - /*------------------------------------------------------------------* - * updating of the decision threshold - *------------------------------------------------------------------*/ - - stemp = add( *multi_harm_limit, THR_CORR_STEP_FX ); - if ( GT_32( Lcor_map_LT_sum, THR_CORR_FX ) ) /* Q15 */ - { - /* *multi_harm_limit -= THR_CORR_STEP_FX */ - stemp = sub( *multi_harm_limit, THR_CORR_STEP_FX ); - } - - stemp = s_min( stemp, THR_CORR_MAX_FX ); - *multi_harm_limit = s_max( stemp, THR_CORR_MIN_FX ); - move16(); - - IF( N_mins <= 0 ) - { - set16_fx( old_S, 0, L ); - } - IF( S_map != NULL ) - { - Copy( S, S_map, L ); - } - return harm; -} -#endif diff --git a/lib_enc/nois_est_fx.c b/lib_enc/nois_est_fx.c index 67e7fbf35dddd61109c4a0aab264c4e2831091a4..ff6784c4e17bd0de3ca5515a6fe7d561510f36e1 100644 --- a/lib_enc/nois_est_fx.c +++ b/lib_enc/nois_est_fx.c @@ -1119,14 +1119,9 @@ void noise_est_fx( { i = 0; move16(); -#ifndef FIX_2364_HARM_MULT_HARM - *loc_harm = multi_harm_fx( EspecdB, hNoiseEst->old_S_fx, hNoiseEst->cor_map_fx, &hNoiseEst->multi_harm_limit_fx, st_fx->total_brate, - st_fx->bwidth, ( st_fx->hGSCEnc != NULL ) ? &hGSCEnc->cor_strong_limit : &i, &hSpMusClas->mean_avr_dyn_fx, &hSpMusClas->last_sw_dyn_fx, cor_map_sum, sp_floor, S_map ); -#else test(); *loc_harm = multi_harm_fx( EVS_MONO, EspecdB, hNoiseEst->old_S_fx, hNoiseEst->cor_map_fx, &hNoiseEst->multi_harm_limit_fx, st_fx->total_brate, st_fx->bwidth, ( st_fx->hGSCEnc != NULL ) ? &hGSCEnc->cor_strong_limit : &i, &hSpMusClas->mean_avr_dyn_fx, &hSpMusClas->last_sw_dyn_fx, cor_map_sum, sp_floor, S_map ); -#endif move16(); } @@ -2415,13 +2410,8 @@ void noise_est_ivas_fx( { i = 0; move16(); -#ifndef FIX_2364_HARM_MULT_HARM - *loc_harm = multi_harm_ivas_fx( EspecdB, hNoiseEst->old_S_fx, hNoiseEst->cor_map_fx, &hNoiseEst->multi_harm_limit_fx, st_fx->total_brate, - st_fx->bwidth, ( st_fx->hGSCEnc != NULL ) ? &hGSCEnc->cor_strong_limit : &i, &hSpMusClas->mean_avr_dyn_fx, &hSpMusClas->last_sw_dyn_fx, cor_map_sum, sp_floor, S_map ); -#else *loc_harm = multi_harm_fx( st_fx->element_mode, EspecdB, hNoiseEst->old_S_fx, hNoiseEst->cor_map_fx, &hNoiseEst->multi_harm_limit_fx, st_fx->total_brate, st_fx->bwidth, ( st_fx->hGSCEnc != NULL ) ? &hGSCEnc->cor_strong_limit : &i, &hSpMusClas->mean_avr_dyn_fx, &hSpMusClas->last_sw_dyn_fx, cor_map_sum, sp_floor, S_map ); -#endif move16(); } } diff --git a/lib_enc/prot_fx_enc.h b/lib_enc/prot_fx_enc.h index 49c438515789aae8dc382a315f2a91474c67ab8c..030fee944b8446783400dd425c6d4460e33c66ac 100644 --- a/lib_enc/prot_fx_enc.h +++ b/lib_enc/prot_fx_enc.h @@ -576,15 +576,8 @@ void swb_bwe_enc_ivas_fx( const Word16 *old_syn_12k8_16k_fx, /* i : ACELP core synthesis at 12.8kHz or 16kHz */ const Word16 *new_swb_speech_fx, /* i : original input signal at 32kHz */ const Word16 Q_new_swb_speech, /* i : Q for new_swb_speech_fx */ -#ifdef REMOVE_SCALING_SHB_SPEECH - Word16 *shb_speech_fx, /* i : SHB target signal (6-14kHz) at 16kHz Q0 */ - const Word16 Q_slb_speech -#else - Word16 *shb_speech_fx, /* i : SHB target signal (6-14kHz) at 16kHz */ - Word16 Q_shb_speech, - Word16 Q_slb_speech -#endif -); + Word16 *shb_speech_fx, /* i : SHB target signal (6-14kHz) at 16kHz Q0 */ + const Word16 Q_slb_speech ); void swb_CNG_enc_fx( Encoder_State *st_fx, /* i/o: State structure */ @@ -4107,40 +4100,21 @@ Word32 mslvq_fx( /* o : frame multi-harmonicity (1-harmonic, 0-not) */ Word16 multi_harm_fx( -#ifdef FIX_2364_HARM_MULT_HARM const Word16 element_mode, /* i : IVAS element_mode Q0 */ -#endif - const Word16 Bin_E[], /* i : log-energy spectrum of the current frame Q7 */ - Word16 old_S[], /* i/o: prev. log-energy spectrum w. subtracted floor Q7 */ - Word16 cor_map_LT[], /* i/o: LT correlation map Q15 */ - Word16 *multi_harm_limit, /* i/o: multi harminic threshold Q9 */ - const Word32 total_brate, /* i : total bitrate Q0 */ - const Word16 bwidth, /* i : i signal bandwidth Q0 */ - Word16 *cor_strong_limit, /* i/o: HF correlation indicator Q0 */ - Word16 *st_mean_avr_dyn, /* i/o: long term average dynamic Q7 */ - Word16 *st_last_sw_dyn, /* i/o: last dynamic Q7 */ - Word16 *cor_map_sum, /* i : sum of correlation map Q8 */ - Word16 *sp_floor, /* o: noise floor estimate Q7 */ - Word16 S_map[] /* o : short-term correlation map Q7 */ -); - -#ifndef FIX_2364_HARM_MULT_HARM -/* o : frame multi-harmonicity (1-harmonic, 0-not) */ -Word16 multi_harm_ivas_fx( - const Word16 Bin_E[], /* i : log-energy spectrum of the current frame Q7 */ - Word16 old_S[], /* i/o: prev. log-energy spectrum w. subtracted floor Q7 */ - Word16 cor_map_LT[], /* i/o: LT correlation map Q15 */ - Word16 *multi_harm_limit, /* i/o: multi harminic threshold Q9 */ - const Word32 total_brate, /* i : total bitrate Q0 */ - const Word16 bwidth, /* i : i signal bandwidth Q0 */ - Word16 *cor_strong_limit, /* i/o: HF correlation indicator Q0 */ - Word16 *st_mean_avr_dyn, /* i/o: long term average dynamic Q7 */ - Word16 *st_last_sw_dyn, /* i/o: last dynamic Q7 */ - Word16 *cor_map_sum, /* i : sum of correlation map Q8 */ - Word16 *sp_floor, /* o: noise floor estimate Q7 */ - Word16 S_map[] /* o : short-term correlation map Q7 */ + const Word16 Bin_E[], /* i : log-energy spectrum of the current frame Q7 */ + Word16 old_S[], /* i/o: prev. log-energy spectrum w. subtracted floor Q7 */ + Word16 cor_map_LT[], /* i/o: LT correlation map Q15 */ + Word16 *multi_harm_limit, /* i/o: multi harminic threshold Q9 */ + const Word32 total_brate, /* i : total bitrate Q0 */ + const Word16 bwidth, /* i : i signal bandwidth Q0 */ + Word16 *cor_strong_limit, /* i/o: HF correlation indicator Q0 */ + Word16 *st_mean_avr_dyn, /* i/o: long term average dynamic Q7 */ + Word16 *st_last_sw_dyn, /* i/o: last dynamic Q7 */ + Word16 *cor_map_sum, /* i : sum of correlation map Q8 */ + Word16 *sp_floor, /* o: noise floor estimate Q7 */ + Word16 S_map[] /* o : short-term correlation map Q7 */ ); -#endif + void pvq_encode_frame_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ diff --git a/lib_enc/swb_bwe_enc_fx.c b/lib_enc/swb_bwe_enc_fx.c index e07f797771aa552fd80693a46c09249649d68479..8dfd67076144aedb036372781aa67da3cd9a71b9 100644 --- a/lib_enc/swb_bwe_enc_fx.c +++ b/lib_enc/swb_bwe_enc_fx.c @@ -271,15 +271,8 @@ void swb_bwe_enc_ivas_fx( const Word16 *old_syn_12k8_16k_fx, /* i : ACELP core synthesis at 12.8kHz or 16kHz */ const Word16 *new_swb_speech_fx, /* i : original input signal at 32kHz */ const Word16 Q_new_swb_speech, /* i : Q for new_swb_speech_fx */ -#ifdef REMOVE_SCALING_SHB_SPEECH - Word16 *shb_speech_fx_Q0, /* i : SHB target signal (6-14kHz) at 16kHz Q0 */ - const Word16 Q_slb_speech -#else - Word16 *shb_speech_fx, /* i : SHB target signal (6-14kHz) at 16kHz */ - Word16 Q_shb_speech, - Word16 Q_slb_speech -#endif -) + Word16 *shb_speech_fx_Q0, /* i : SHB target signal (6-14kHz) at 16kHz Q0 */ + const Word16 Q_slb_speech ) { Word16 i; Word16 *new_input_fx; @@ -311,18 +304,14 @@ void swb_bwe_enc_ivas_fx( move16(); Word16 fb_band_begin; Word16 q_new_input_hp; -#ifdef REMOVE_SCALING_SHB_SPEECH Word16 shb_speech_fx[L_FRAME16k]; Word16 Q_shb_speech; -#endif FD_BWE_ENC_HANDLE hBWE_FD = st_fx->hBWE_FD; TD_BWE_ENC_HANDLE hBWE_TD = st_fx->hBWE_TD; -#ifdef REMOVE_SCALING_SHB_SPEECH Q_shb_speech = getScaleFactor16( shb_speech_fx_Q0, L_FRAME16k ); Copy_Scale_sig( shb_speech_fx_Q0, shb_speech_fx, L_FRAME16k, Q_shb_speech ); // Q0 -> Q_shb_spch -#endif /*---------------------------------------------------------------------* * Delay the original input signal to be synchronized with ACELP core synthesis diff --git a/lib_enc/swb_pre_proc_fx.c b/lib_enc/swb_pre_proc_fx.c index 107d85ccd7661b939825158e26446fd5fc2eda3b..7b97791ffa3e675a2eb18c9428a67a6258950f00 100644 --- a/lib_enc/swb_pre_proc_fx.c +++ b/lib_enc/swb_pre_proc_fx.c @@ -772,15 +772,9 @@ void swb_pre_proc_fx( *-------------------------------------------------------------------*/ void swb_pre_proc_ivas_fx( - Encoder_State *st, /* i/o: encoder state structure */ - Word16 *new_swb_speech, /* o : original input signal at 32kHz - st->q_inp */ -#ifndef REMOVE_SCALING_SHB_SPEECH - Word32 *new_swb_speech_fx, /* o : original input signal at 32kHz - Q - q_reImBuffer */ -#endif - Word16 *shb_speech, /* o : SHB target signal (6-14kHz) at 16kHz - Q0 */ -#ifndef REMOVE_SCALING_SHB_SPEECH - Word16 *Q_shb_spch, -#endif + Encoder_State *st, /* i/o: encoder state structure */ + Word16 *new_swb_speech, /* o : original input signal at 32kHz - st->q_inp */ + Word16 *shb_speech, /* o : SHB target signal (6-14kHz) at 16kHz - Q0 */ Word32 realBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : real buffer Q - q_reImbuffer */ Word32 imagBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : imag buffer Q - q_reImbuffer */ Word16 q_reImBuffer, /* i : scale data of real and imag CLDFB buffers */ @@ -1066,12 +1060,10 @@ void swb_pre_proc_ivas_fx( ELSE /* IVAS_CPE_DFT */ { Word16 out_start_ind, out_end_ind; -#ifdef REMOVE_SCALING_SHB_SPEECH Word32 new_swb_speech_buffer_fx[L_FRAME48k + STEREO_DFT_OVL_MAX]; Word32 *new_swb_speech_fx; set32_fx( new_swb_speech_buffer_fx, 0, L_FRAME48k + STEREO_DFT_OVL_MAX ); new_swb_speech_fx = new_swb_speech_buffer_fx + STEREO_DFT_OVL_MAX; -#endif stereo_dft_enc_synthesize_fx( hCPE->hStereoDft, new_swb_speech_fx, &out_start_ind, &out_end_ind, st->idchan, input_Fs, 32000, 0, NULL ); Copy_Scale_sig32_16( new_swb_speech_fx - STEREO_DFT_OVL_MAX, new_swb_speech - STEREO_DFT_OVL_MAX, L_FRAME48k + STEREO_DFT_OVL_MAX, add( st->q_inp, add( q_reImBuffer, 1 ) ) ); // st->q_inp @@ -1282,10 +1274,6 @@ void swb_pre_proc_ivas_fx( cldfbSynthesis_ivas_fx( realBufferFlipped, imagBufferFlipped, shb_speech_fx_32, -1, 0, 0, st->cldfbSynTd ); Copy_Scale_sig_32_16( shb_speech_fx_32, shb_speech, L_FRAME16k, negate( sub( q_reImBuffer, 1 ) ) ); // Q0 -#ifndef REMOVE_SCALING_SHB_SPEECH - *Q_shb_spch = 0; - move16(); -#endif } IF( GE_16( st->element_mode, IVAS_CPE_DFT ) && hCPE->hStereoICBWE != NULL ) diff --git a/lib_isar/isar_PerceptualModel.c b/lib_isar/isar_PerceptualModel.c index cbc878b7c8dc9439af2c3aae0217579474bbe93e..3ad12b9a42e6bb012fe8f9fe073246e53a2c0c6d 100644 --- a/lib_isar/isar_PerceptualModel.c +++ b/lib_isar/isar_PerceptualModel.c @@ -83,37 +83,6 @@ static inline Word16 LogAdd_fx( return iRetVal; } -#ifndef FIX_2371_REMOVE_UNUSED_ISAR_FCNS - -/*------------------------------------------------------------------------------------------* - * Function LogAdd() - * - * - *------------------------------------------------------------------------------------------*/ - -static inline Word32 LogAdd( - const Word32 iVal1, - const Word32 iVal2 ) -{ - Word32 iRetVal; - - if ( iVal1 > iVal2 ) - { - iRetVal = iVal1 - iVal2; - iRetVal = ( iRetVal < ( LOG_ADD_TABLE_LENGTH - 1 ) ) ? iRetVal : ( LOG_ADD_TABLE_LENGTH - 1 ); - iRetVal = iVal1 + c_aiLogAddTable[iRetVal]; - } - else - { - iRetVal = iVal2 - iVal1; - iRetVal = ( iRetVal < ( LOG_ADD_TABLE_LENGTH - 1 ) ) ? iRetVal : ( LOG_ADD_TABLE_LENGTH - 1 ); - iRetVal = iVal2 + c_aiLogAddTable[iRetVal]; - } - - return iRetVal; -} - -#endif /*------------------------------------------------------------------------------------------* * Function PerceptualModel() @@ -178,67 +147,6 @@ void PerceptualModel_fx( return; } -#ifndef FIX_2371_REMOVE_UNUSED_ISAR_FCNS - -/*------------------------------------------------------------------------------------------* - * Function PerceptualModel() - * - * - *------------------------------------------------------------------------------------------*/ - -void PerceptualModel( - const Word32 iMaxQuantBands, - const Word32 *piRMSEnvelope, - Word32 *piExcitation, - Word32 *piSMR ) -{ - Word32 n; - - for ( n = 0; n < iMaxQuantBands; n++ ) - { - Word32 iSLOffset; - - piExcitation[n] = PERCEPTUAL_MODEL_SCALE * piRMSEnvelope[n] + c_aiBandwidthAdjust48[n]; - - /* Calculate sensation level offset */ - iSLOffset = c_aiDefaultTheta48[n] * ( piExcitation[n] - c_aiAbsoluteThresh48[n] ) >> PERCEPTUAL_MODEL_SLGAIN_SHIFT; - // iSLOffset = (iSLOffset > 0) ? iSLOffset : 0; - - /* Offset envelope by sensation level offset */ - piExcitation[n] -= iSLOffset; - - /* Convert to loudness domain (x^0.3) */ - piExcitation[n] = PERCEPTUAL_MODEL_ALPHA_SCALE * piExcitation[n] >> PERCEPTUAL_MODEL_ALPHA_SHIFT; - } - - /* Spread excitation function */ - for ( n = 0; n < iMaxQuantBands; n++ ) - { - Word32 k; - const Word32 *piSpread; - - piSpread = &c_aaiSpreadFunction48[n * MAX_BANDS_48]; - piSMR[n] = piExcitation[n] + piSpread[n]; - for ( k = 0; k < iMaxQuantBands; k++ ) - { - if ( k != n ) - { - piSMR[n] = LogAdd( piSMR[n], piExcitation[k] + piSpread[k] ); - } - } - } - - for ( n = 0; n < iMaxQuantBands; n++ ) - { - piSMR[n] = PERCEPTUAL_MODEL_ALPHA_INV_SCALE * piSMR[n] >> PERCEPTUAL_MODEL_ALPHA_SHIFT; - piSMR[n] = PERCEPTUAL_MODEL_SCALE * piRMSEnvelope[n] + c_aiBandwidthAdjust48[n] - piSMR[n]; - } - - return; -} - -#endif - /*------------------------------------------------------------------------------------------* * Function PerceptualModelStereo() @@ -246,119 +154,6 @@ void PerceptualModel( * *------------------------------------------------------------------------------------------*/ -#ifndef FIX_2371_REMOVE_UNUSED_ISAR_FCNS - -void PerceptualModelStereo( - const Word32 iMaxQuantBands, - const Word32 *piMSFlags, - const Word32 *piRMSEnvelope0, - const Word32 *piRMSEnvelope1, - Word32 *piExcitation0, - Word32 *piExcitation1, - Word32 *piSMR0, - Word32 *piSMR1 ) -{ - Word32 n; - - for ( n = 0; n < iMaxQuantBands; n++ ) - { - Word32 iMaxRMSEnv; - Word32 iSLOffset; - - iMaxRMSEnv = piRMSEnvelope0[n]; - - piExcitation0[n] = PERCEPTUAL_MODEL_SCALE * iMaxRMSEnv + c_aiBandwidthAdjust48[n]; /* piRMSEnvelope0[n] */ - - /* Calculate sensation level offset */ - iSLOffset = c_aiDefaultTheta48[n] * ( piExcitation0[n] - c_aiAbsoluteThresh48[n] ) >> PERCEPTUAL_MODEL_SLGAIN_SHIFT; - // iSLOffset = (iSLOffset > 0) ? iSLOffset : 0; - - /* Offset envelope by sensation level offset */ - piExcitation0[n] -= iSLOffset; - - /* Convert to loudness domain (x^0.3) */ - piExcitation0[n] = PERCEPTUAL_MODEL_ALPHA_SCALE * piExcitation0[n] >> PERCEPTUAL_MODEL_ALPHA_SHIFT; - } - - /* Spread excitation function */ - for ( n = 0; n < iMaxQuantBands; n++ ) - { - Word32 k; - const Word32 *piSpread; - - piSpread = &c_aaiSpreadFunction48[n * MAX_BANDS_48]; - piSMR0[n] = piExcitation0[n] + piSpread[n]; - for ( k = 0; k < iMaxQuantBands; k++ ) - { - if ( k != n ) - { - piSMR0[n] = LogAdd( piSMR0[n], piExcitation0[k] + piSpread[k] ); - } - } - } - - for ( n = 0; n < iMaxQuantBands; n++ ) - { - Word32 iMaxRMSEnv; - Word32 iSLOffset; - - iMaxRMSEnv = piRMSEnvelope1[n]; - - piExcitation1[n] = PERCEPTUAL_MODEL_SCALE * iMaxRMSEnv + c_aiBandwidthAdjust48[n]; /* piRMSEnvelope1[n] */ - - /* Calculate sensation level offset */ - iSLOffset = c_aiDefaultTheta48[n] * ( piExcitation1[n] - c_aiAbsoluteThresh48[n] ) >> PERCEPTUAL_MODEL_SLGAIN_SHIFT; - // iSLOffset = (iSLOffset > 0) ? iSLOffset : 0; - - /* Offset envelope by sensation level offset */ - piExcitation1[n] -= iSLOffset; - - /* Convert to loudness domain (x^0.3) */ - piExcitation1[n] = PERCEPTUAL_MODEL_ALPHA_SCALE * piExcitation1[n] >> PERCEPTUAL_MODEL_ALPHA_SHIFT; - } - - /* Spread excitation function */ - for ( n = 0; n < iMaxQuantBands; n++ ) - { - Word32 k; - const Word32 *piSpread; - - piSpread = &c_aaiSpreadFunction48[n * MAX_BANDS_48]; - piSMR1[n] = piExcitation1[n] + piSpread[n]; - for ( k = 0; k < iMaxQuantBands; k++ ) - { - if ( k != n ) - { - piSMR1[n] = LogAdd( piSMR1[n], piExcitation1[k] + piSpread[k] ); - } - } - } - - for ( n = 0; n < iMaxQuantBands; n++ ) - { - if ( piMSFlags[n] == 1 ) - { - piSMR0[n] = ( piSMR0[n] > piSMR1[n] ) ? piSMR0[n] : piSMR1[n]; - piSMR1[n] = piSMR0[n]; - } - } - - for ( n = 0; n < iMaxQuantBands; n++ ) - { - piSMR0[n] = PERCEPTUAL_MODEL_ALPHA_INV_SCALE * piSMR0[n] >> PERCEPTUAL_MODEL_ALPHA_SHIFT; - piSMR0[n] = PERCEPTUAL_MODEL_SCALE * piRMSEnvelope0[n] + c_aiBandwidthAdjust48[n] - piSMR0[n]; - } - - for ( n = 0; n < iMaxQuantBands; n++ ) - { - piSMR1[n] = PERCEPTUAL_MODEL_ALPHA_INV_SCALE * piSMR1[n] >> PERCEPTUAL_MODEL_ALPHA_SHIFT; - piSMR1[n] = PERCEPTUAL_MODEL_SCALE * piRMSEnvelope1[n] + c_aiBandwidthAdjust48[n] - piSMR1[n]; - } - - return; -} - -#endif void PerceptualModelStereo_fx( const Word32 iMaxQuantBands, diff --git a/lib_isar/isar_PredDecoder.c b/lib_isar/isar_PredDecoder.c index 9023009efb32c18addd79bfaee446d3f4b9eacd6..94d85f2ebe75f543c5ed58064141d7840052ee29 100644 --- a/lib_isar/isar_PredDecoder.c +++ b/lib_isar/isar_PredDecoder.c @@ -359,25 +359,6 @@ Word16 ReadPredictors_fx( return iBitsRead; } -#ifndef FIX_2371_REMOVE_UNUSED_ISAR_FCNS -/* PLC_IMPROVEMENT */ -void SetDecodingPassed( - PredictionDecoder *psPredictionDecoder ) -{ - Word32 n, ch; - - for ( ch = 0; ch < psPredictionDecoder->iChannels; ch++ ) - { - for ( n = 0; n < psPredictionDecoder->iNumSubSets; n++ ) - { - psPredictionDecoder->ppiDecodingFailed[ch][n] = 0; - } - } - - return; -} -#endif - Word32 AnyDecodingUnresolved( PredictionDecoder *psPredictionDecoder ) diff --git a/lib_isar/isar_lcld_encoder.c b/lib_isar/isar_lcld_encoder.c index 8f6ed398315a4e87bd5934513bc0d29971268057..9b33cc6537b7d3fe31df3a4e2ed1232b68b437dc 100644 --- a/lib_isar/isar_lcld_encoder.c +++ b/lib_isar/isar_lcld_encoder.c @@ -772,18 +772,6 @@ Word32 EncodeLCLDFrame( return 0; } -#ifndef FIX_2371_REMOVE_UNUSED_ISAR_FCNS -/*------------------------------------------------------------------------------------------* - * Function GetNumGroups() - * - * - *------------------------------------------------------------------------------------------*/ - -Word32 GetNumGroups( LCLDEncoder *psLCLDEncoder ) -{ - return psLCLDEncoder->piNumGroups[0]; -} -#endif /*------------------------------------------------------------------------------------------* * Local functions diff --git a/lib_isar/isar_lcld_prot.h b/lib_isar/isar_lcld_prot.h index 16acd9716f1f01405091dc0af10e5ed54ff22f1c..aa9cd51071c8f6f45737e9a952c932cb5a601ced 100644 --- a/lib_isar/isar_lcld_prot.h +++ b/lib_isar/isar_lcld_prot.h @@ -65,11 +65,6 @@ Word32 EncodeLCLDFrame( Word16 *q_final ); -#ifndef FIX_2371_REMOVE_UNUSED_ISAR_FCNS -Word32 GetNumGroups( - LCLDEncoder *psLCLDEncoder -); -#endif typedef struct LCLD_DECODER LCLDDecoder; @@ -176,14 +171,6 @@ Word32 CountMSBits( * PereptualModel prototypes *----------------------------------------------------------------------------------*/ -#ifndef FIX_2371_REMOVE_UNUSED_ISAR_FCNS -extern void PerceptualModel( - const Word32 iMaxQuantBands, - const Word32 *piRMSEnvelope, - Word32 *piExcitation, - Word32 *piSMR -); -#endif extern void PerceptualModel_fx( const Word32 iMaxQuantBands, @@ -203,18 +190,6 @@ extern void PerceptualModelStereo_fx( Word32 *piSMR1 ); -#ifndef FIX_2371_REMOVE_UNUSED_ISAR_FCNS -extern void PerceptualModelStereo( - const Word32 iMaxQuantBands, - const Word32 *piMSFlags, - const Word32 *piRMSEnvelope0, - const Word32 *piRMSEnvelope1, - Word32 *piExcitation0, - Word32 *piExcitation1, - Word32 *piSMR0, - Word32 *piSMR1 -); -#endif /*----------------------------------------------------------------------------------* * PredEncoder/PredDecoder prototypes @@ -346,11 +321,6 @@ Word32 **GetDecodingFailedPrevStatus( LCLDDecoder *psLCLDDecoder ); -#ifndef FIX_2371_REMOVE_UNUSED_ISAR_FCNS -void SetDecodingPassed( - PredictionDecoder *psPredictionDecoder -); -#endif void UpdateDecodingUnresolved( PredictionDecoder *psPredictionDecoder diff --git a/lib_rend/ivas_dirac_rend_fx.c b/lib_rend/ivas_dirac_rend_fx.c index e242c9c085ccae575979946a8b7a8b7f579d49fe..4ca7b0c14aa7faae911657acd9c8b0fc6e4cdf20 100644 --- a/lib_rend/ivas_dirac_rend_fx.c +++ b/lib_rend/ivas_dirac_rend_fx.c @@ -253,10 +253,8 @@ ivas_error ivas_spat_hSpatParamRendCom_config_fx( move16(); hSpatParamRendCom->numIsmDirections = 0; move16(); -#ifdef FIX_BASOP_2354_MSAN_DIFF_Q_VALUE hSpatParamRendCom->q_diffuseness_vector = Q30; move16(); -#endif } /*-----------------------------------------------------------------* diff --git a/lib_rend/ivas_objectRenderer_fx.c b/lib_rend/ivas_objectRenderer_fx.c index 8ba74dad89caaecf9beabdd21775217191aae495..03b0afe82aae3f400074c3f108d0b6c938a91e11 100644 --- a/lib_rend/ivas_objectRenderer_fx.c +++ b/lib_rend/ivas_objectRenderer_fx.c @@ -434,17 +434,9 @@ ivas_error ivas_td_binaural_renderer_unwrap_fx( { Word16 i; -#ifdef FIX_BASOP_2358_SCALING_OOB FOR( i = 0; i < num_src; ++i ) -#else - FOR( i = 0; i < MAX_OUTPUT_CHANNELS; ++i ) -#endif { -#ifdef FIX_BASOP_2358_SCALING_OOB scale_sig32( output_fx[i], output_frame, -4 ); // Q11 - 4 = Q7 -#else - scale_sig32( output_fx[i], L_FRAME48k, -4 ); // Q11 - 4 = Q7 -#endif } IF( NE_32( ( error = ivas_reverb_process_fx( hReverb, transport_config, 0, output_fx, p_reverb_signal_fx, subframe_idx ) ), IVAS_ERR_OK ) ) // Q p_reverb_signal_fx = Q output_fx - 2 = 5 @@ -452,17 +444,9 @@ ivas_error ivas_td_binaural_renderer_unwrap_fx( return error; } -#ifdef FIX_BASOP_2358_SCALING_OOB FOR( i = 0; i < num_src; ++i ) -#else - FOR( i = 0; i < MAX_OUTPUT_CHANNELS; ++i ) -#endif { -#ifdef FIX_BASOP_2358_SCALING_OOB scale_sig32( output_fx[i], output_frame, 4 ); // Q7 + 4 = Q11 -#else - scale_sig32( output_fx[i], L_FRAME48k, 4 ); // Q7 + 4 = Q11 -#endif } FOR( i = 0; i < BINAURAL_CHANNELS; ++i ) diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 2875298ff6e746547dec997676c6d5a8010fe466..318072fe8566da06ff6755c612e8f231b09868ed 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -1264,9 +1264,6 @@ ivas_error RenderConfigReader_checkValues( pRoom_acoustics = &hRenderConfig->roomAcoustics; tab_value_err_count = 0; int16_t wall_idx; -#ifndef FIX_1999_TEMPORARY_DISABLE_DIST_ATT_CHECK - int16_t i; -#endif /* Verify the number of frequency bands in the config input data */ if ( ( pRoom_acoustics->nBands > N_BANDS_MAX ) || ( pRoom_acoustics->nBands < N_BANDS_MIN ) ) @@ -1339,21 +1336,6 @@ ivas_error RenderConfigReader_checkValues( pRoom_acoustics->AbsCoeff_fx[wall_idx] = ER_MAX_ABS_COEFF_FX; } } -#ifndef FIX_1999_TEMPORARY_DISABLE_DIST_ATT_CHECK - /* Verify range of distance attenuation parameters: 0.1 <= distAtt[0] <= distAtt[1] */ - /* 0.0 <= distAtt[2] <= 10.0 */ - hRenderConfig->distAtt[0] = max( 0.1f, hRenderConfig->distAtt[0] ); - hRenderConfig->distAtt[1] = max( hRenderConfig->distAtt[0], hRenderConfig->distAtt[1] ); - hRenderConfig->distAtt[2] = max( 0.0f, min( 10.0f, hRenderConfig->distAtt[2] ) ); - - /* Verify range of directivity patterns */ - for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; i++ ) - { - hRenderConfig->directivity[i * 3] = max( 0.0f, min( 360.0f, hRenderConfig->directivity[i * 3] ) ); - hRenderConfig->directivity[i * 3 + 1] = max( 0.0f, min( 360.0f, hRenderConfig->directivity[i * 3 + 1] ) ); - hRenderConfig->directivity[i * 3 + 2] = max( 0.0f, min( 1.0f, hRenderConfig->directivity[i * 3 + 2] ) ); - } -#endif }