From e389d9a001929b0ce055fe8228a45e665089b3f7 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 21:40:48 +0100 Subject: [PATCH 01/27] [cleanup] accept FIX_1999_TEMPORARY_DISABLE_DIST_ATT_CHECK --- lib_com/options.h | 1 - lib_util/render_config_reader.c | 18 ------------------ 2 files changed, 19 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 0ea316a82..ec4f0dca9 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -81,7 +81,6 @@ /*#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() */ diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 2875298ff..318072fe8 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 } -- GitLab From 908ece2b74936d87ef3642c73d595670efe43924 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 21:44:22 +0100 Subject: [PATCH 02/27] [cleanup] accept FIX_2255_ISAR_RENDER_POSES --- lib_com/options.h | 1 - lib_dec/lib_dec_fx.c | 6 ------ 2 files changed, 7 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index ec4f0dca9..b780660ff 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -83,7 +83,6 @@ #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 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 */ diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index fbd748b84..3b8161030 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 ); } -- GitLab From 4ed6739ade02a7a691f60d2eddd01e4ef1e32b70 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 21:45:06 +0100 Subject: [PATCH 03/27] [cleanup] accept FIX_1478_UNINIT_ON_BFI --- lib_com/gs_noisefill_fx.c | 24 ------------------------ lib_com/options.h | 1 - 2 files changed, 25 deletions(-) diff --git a/lib_com/gs_noisefill_fx.c b/lib_com/gs_noisefill_fx.c index 383e2812d..fb11fc327 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/options.h b/lib_com/options.h index b780660ff..44c1f5dfb 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,7 +84,6 @@ #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_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 */ -- GitLab From 6f9c758746205aac6f8d9c21fbfb3e90ccb0493a Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 21:45:44 +0100 Subject: [PATCH 04/27] [cleanup] accept FIX_BASOP_2358_SCALING_OOB --- lib_com/options.h | 1 - lib_rend/ivas_objectRenderer_fx.c | 16 ---------------- 2 files changed, 17 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 44c1f5dfb..34cfbf7f6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,7 +84,6 @@ #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_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ -#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 */ diff --git a/lib_rend/ivas_objectRenderer_fx.c b/lib_rend/ivas_objectRenderer_fx.c index 8ba74dad8..03b0afe82 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 ) -- GitLab From c4390ee250c4452b1e3b041398c22fcfa6146527 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 21:46:24 +0100 Subject: [PATCH 05/27] [cleanup] accept FIX_BASOP_2350_HARM_0B_BWE_2 --- lib_com/options.h | 1 - lib_dec/acelp_core_dec_fx.c | 32 -------------------------------- 2 files changed, 33 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 34cfbf7f6..2d3a3417b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,7 +84,6 @@ #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_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ -#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 */ diff --git a/lib_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index 5dcc848ad..ac9557073 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++ ) @@ -2210,9 +2203,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 +2224,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 +2320,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; } -- GitLab From 252677693b35c1b349db561b3f112c16fd54e67e Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 21:47:21 +0100 Subject: [PATCH 06/27] [cleanup] accept FIX_2364_HARM_MULT_HARM --- lib_com/options.h | 1 - lib_enc/ivas_front_vad_fx.c | 4 - lib_enc/multi_harm_fx.c | 346 ------------------------------------ lib_enc/nois_est_fx.c | 10 -- lib_enc/prot_fx_enc.h | 19 -- 5 files changed, 380 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 2d3a3417b..b515dcb5f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,7 +84,6 @@ #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_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ -#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() */ diff --git a/lib_enc/ivas_front_vad_fx.c b/lib_enc/ivas_front_vad_fx.c index b4447f2a1..50bf740d7 100644 --- a/lib_enc/ivas_front_vad_fx.c +++ b/lib_enc/ivas_front_vad_fx.c @@ -703,11 +703,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/multi_harm_fx.c b/lib_enc/multi_harm_fx.c index 79a2efca6..317404c7e 100644 --- a/lib_enc/multi_harm_fx.c +++ b/lib_enc/multi_harm_fx.c @@ -28,9 +28,7 @@ /* 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 */ @@ -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 67e7fbf35..ff6784c4e 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 49c438515..633aa9692 100644 --- a/lib_enc/prot_fx_enc.h +++ b/lib_enc/prot_fx_enc.h @@ -4107,9 +4107,7 @@ 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 */ @@ -4124,23 +4122,6 @@ Word16 multi_harm_fx( 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 */ -); -#endif void pvq_encode_frame_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ -- GitLab From 118b27dfa58062f298e8d7cdf9139a5b4d1a9857 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 21:49:06 +0100 Subject: [PATCH 07/27] [cleanup] accept FIX_2363_FIND_WSP --- lib_com/options.h | 1 - lib_com/prot_fx.h | 15 ------- lib_enc/find_wsp_fx.c | 58 --------------------------- lib_enc/ivas_core_pre_proc_front_fx.c | 4 -- lib_enc/ivas_core_pre_proc_fx.c | 4 -- lib_enc/ivas_front_vad_fx.c | 4 -- 6 files changed, 86 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index b515dcb5f..3cbb3b60f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,7 +84,6 @@ #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_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ -#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 */ diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index c45c2a749..a4612b652 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -10910,21 +10910,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_enc/find_wsp_fx.c b/lib_enc/find_wsp_fx.c index e2353c455..a16f1a95c 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/ivas_core_pre_proc_front_fx.c b/lib_enc/ivas_core_pre_proc_front_fx.c index 8541b3fd9..6e5a73a96 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 e83973437..5288130e6 100644 --- a/lib_enc/ivas_core_pre_proc_fx.c +++ b/lib_enc/ivas_core_pre_proc_fx.c @@ -1109,11 +1109,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 50bf740d7..e4cac36d2 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 ) { -- GitLab From d9d7191085253e56df4754e7c3db03d8ec63027b Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 21:49:49 +0100 Subject: [PATCH 08/27] [cleanup] accept FIX_2370_UNUSED_BUFFERS_CORE_ENC --- lib_com/options.h | 1 - lib_enc/ivas_core_enc_fx.c | 28 ---------------------------- 2 files changed, 29 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 3cbb3b60f..9fa81cc2e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,7 +84,6 @@ #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_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ -#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() */ diff --git a/lib_enc/ivas_core_enc_fx.c b/lib_enc/ivas_core_enc_fx.c index 2880c054a..806e33979 100644 --- a/lib_enc/ivas_core_enc_fx.c +++ b/lib_enc/ivas_core_enc_fx.c @@ -611,9 +611,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 +625,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 +668,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,7 +680,6 @@ 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; @@ -813,7 +796,6 @@ ivas_error ivas_core_enc_fx( 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 +803,6 @@ ivas_error ivas_core_enc_fx( move16(); } -#endif /*---------------------------------------------------------------------* * SWB DTX/CNG encoding *---------------------------------------------------------------------*/ @@ -886,15 +867,6 @@ ivas_error ivas_core_enc_fx( #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 *---------------------------------------------------------------------*/ -- GitLab From d9f6afcbd5640cc8f0643cc6f1af01d864853371 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 21:50:25 +0100 Subject: [PATCH 09/27] [cleanup] accept FIX_2376_FIX_USAN_PRE_PROC --- lib_com/options.h | 1 - lib_enc/ivas_core_pre_proc_fx.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 9fa81cc2e..d2184237a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,7 +84,6 @@ #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_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ -#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 */ diff --git a/lib_enc/ivas_core_pre_proc_fx.c b/lib_enc/ivas_core_pre_proc_fx.c index 5288130e6..25bd43935 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 ) ); -- GitLab From 0e13672084fc92fad37bd0c20366e82ce1ee2ca1 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 21:51:46 +0100 Subject: [PATCH 10/27] [cleanup] accept FIX_2367_REMOVE_CODE_ICBWE --- lib_com/options.h | 1 - lib_dec/ivas_core_dec_fx.c | 7 ------ lib_dec/ivas_stereo_icbwe_dec_fx.c | 2 -- lib_enc/ivas_core_enc_fx.c | 35 ------------------------------ 4 files changed, 45 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index d2184237a..e48e0acd8 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,7 +84,6 @@ #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_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ -#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 */ diff --git a/lib_dec/ivas_core_dec_fx.c b/lib_dec/ivas_core_dec_fx.c index a7eebafb5..37e09deeb 100644 --- a/lib_dec/ivas_core_dec_fx.c +++ b/lib_dec/ivas_core_dec_fx.c @@ -1179,13 +1179,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_stereo_icbwe_dec_fx.c b/lib_dec/ivas_stereo_icbwe_dec_fx.c index 1c51fc2d1..a6fdf3aad 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_enc/ivas_core_enc_fx.c b/lib_enc/ivas_core_enc_fx.c index 806e33979..313bbf2e4 100644 --- a/lib_enc/ivas_core_enc_fx.c +++ b/lib_enc/ivas_core_enc_fx.c @@ -823,48 +823,13 @@ 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 } /*---------------------------------------------------------------------* -- GitLab From d429b6b4dd83017a2a2bb68a5866364aa80108ec Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 21:52:23 +0100 Subject: [PATCH 11/27] [cleanup] accept REMOVE_SCALING_SHB_SPEECH --- lib_com/ivas_prot_fx.h | 10 ------ lib_com/options.h | 1 - lib_com/prot_fx.h | 6 ---- lib_enc/ivas_core_enc_fx.c | 49 ------------------------------ lib_enc/ivas_stereo_icbwe_enc_fx.c | 12 -------- lib_enc/prot_fx_enc.h | 6 ---- lib_enc/swb_bwe_enc_fx.c | 10 ------ lib_enc/swb_pre_proc_fx.c | 12 -------- 8 files changed, 106 deletions(-) diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index 409bf870f..11891c6ca 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 e48e0acd8..19c921ad9 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,7 +84,6 @@ #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_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC 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() */ diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index a4612b652..02b1654d1 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -10248,13 +10248,7 @@ 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 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*/ diff --git a/lib_enc/ivas_core_enc_fx.c b/lib_enc/ivas_core_enc_fx.c index 313bbf2e4..df8c7c880 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 *-----------------------------------------------------------------*/ @@ -681,9 +666,6 @@ ivas_error ivas_core_enc_fx( Scale_sig( st->input_fx - input_frame, shl( input_frame, 1 ), sub( st->q_inp, q_inp_orig ) ); } -#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] */ @@ -716,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 ); } @@ -732,16 +710,6 @@ 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 ) - { - 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 ); @@ -749,9 +717,6 @@ ivas_error ivas_core_enc_fx( move16(); Scale_sig( st->hBWE_FD->L_old_wtda_swb_fx, L_FRAME48k, shift ); // st->Q_old_wtda } -#ifndef REMOVE_SCALING_SHB_SPEECH - } -#endif /* SWB TBE encoder */ test(); @@ -764,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 ) ) { @@ -783,15 +744,8 @@ 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 @@ -813,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] ); } diff --git a/lib_enc/ivas_stereo_icbwe_enc_fx.c b/lib_enc/ivas_stereo_icbwe_enc_fx.c index 366b93c26..8a1d9f6f0 100644 --- a/lib_enc/ivas_stereo_icbwe_enc_fx.c +++ b/lib_enc/ivas_stereo_icbwe_enc_fx.c @@ -613,20 +613,10 @@ 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 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 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/prot_fx_enc.h b/lib_enc/prot_fx_enc.h index 633aa9692..e2ed6f76d 100644 --- a/lib_enc/prot_fx_enc.h +++ b/lib_enc/prot_fx_enc.h @@ -576,14 +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 ); void swb_CNG_enc_fx( diff --git a/lib_enc/swb_bwe_enc_fx.c b/lib_enc/swb_bwe_enc_fx.c index e07f79777..0ac0c4958 100644 --- a/lib_enc/swb_bwe_enc_fx.c +++ b/lib_enc/swb_bwe_enc_fx.c @@ -271,14 +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 i; @@ -311,18 +305,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 107d85ccd..57454f02c 100644 --- a/lib_enc/swb_pre_proc_fx.c +++ b/lib_enc/swb_pre_proc_fx.c @@ -774,13 +774,7 @@ 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 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 ) -- GitLab From 8c48d0f1d2c789c3c849268e99a682bc6299606a Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 21:53:34 +0100 Subject: [PATCH 12/27] [cleanup] accept FIX_2352_COPY_AQ_IN_TCX --- lib_com/options.h | 1 - lib_dec/ivas_stereo_mdct_core_dec_fx.c | 16 ---------------- 2 files changed, 17 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 19c921ad9..d2acbaa32 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,7 +84,6 @@ #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_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ -#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 */ diff --git a/lib_dec/ivas_stereo_mdct_core_dec_fx.c b/lib_dec/ivas_stereo_mdct_core_dec_fx.c index d61e541e9..403aafa37 100644 --- a/lib_dec/ivas_stereo_mdct_core_dec_fx.c +++ b/lib_dec/ivas_stereo_mdct_core_dec_fx.c @@ -385,31 +385,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 -- GitLab From f1e73e7f2517d65abe23da22f4a6bc91b0b5176a Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 21:54:08 +0100 Subject: [PATCH 13/27] [cleanup] accept FIX_2353_PTR_INIT --- lib_com/options.h | 1 - lib_dec/dec_tcx_fx.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index d2acbaa32..cfe1b94bb 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,7 +84,6 @@ #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_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ -#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 */ diff --git a/lib_dec/dec_tcx_fx.c b/lib_dec/dec_tcx_fx.c index ed170d598..78e95b7a6 100644 --- a/lib_dec/dec_tcx_fx.c +++ b/lib_dec/dec_tcx_fx.c @@ -4025,9 +4025,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 ); -- GitLab From 0c87adf0e6e837d0f372ee012a30c0491068392f Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 21:54:46 +0100 Subject: [PATCH 14/27] [cleanup] accept FIX_2356_GET_CHAN_ENERGIES --- lib_com/options.h | 1 - lib_enc/ivas_mct_enc_mct_fx.c | 12 ------------ 2 files changed, 13 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index cfe1b94bb..1c23c53e0 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,7 +84,6 @@ #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_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ -#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 */ diff --git a/lib_enc/ivas_mct_enc_mct_fx.c b/lib_enc/ivas_mct_enc_mct_fx.c index 84bc74dd9..bb5ecbb68 100644 --- a/lib_enc/ivas_mct_enc_mct_fx.c +++ b/lib_enc/ivas_mct_enc_mct_fx.c @@ -88,33 +88,21 @@ 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 -- GitLab From dd4fad6ae79eb89d9b33dea0ba5fd653b08e6247 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 21:56:40 +0100 Subject: [PATCH 15/27] [cleanup] accept FIX_2355_IGF_EXP_POWERSPEC --- lib_com/options.h | 1 - lib_enc/igf_enc_fx.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 1c23c53e0..576f6bf21 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,7 +84,6 @@ #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_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ -#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 */ diff --git a/lib_enc/igf_enc_fx.c b/lib_enc/igf_enc_fx.c index deed347b3..72a26b248 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 ); -- GitLab From 06f9fd19c1f8bf973ad947b74b0deb2fa8544643 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 21:57:14 +0100 Subject: [PATCH 16/27] [cleanup] accept FIX_2319_CLDFB_INIT_FLAGS --- lib_com/cldfb_evs_fx.c | 2 -- lib_com/options.h | 1 - 2 files changed, 3 deletions(-) diff --git a/lib_com/cldfb_evs_fx.c b/lib_com/cldfb_evs_fx.c index 8e8b6565f..a5f9da62a 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/options.h b/lib_com/options.h index 576f6bf21..8946b083d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,7 +84,6 @@ #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_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ -#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 */ -- GitLab From 121f96ae867fd6a9aa46406bcf6d707eea5d6c5d Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 21:58:00 +0100 Subject: [PATCH 17/27] [cleanup] accept FIX_BASOP_2357_OBJECT_EDIT_MSAN --- lib_com/options.h | 1 - lib_dec/ivas_omasa_dec_fx.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 8946b083d..b3d6c1648 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,7 +84,6 @@ #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_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ -#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 */ diff --git a/lib_dec/ivas_omasa_dec_fx.c b/lib_dec/ivas_omasa_dec_fx.c index 1659d4912..d13e17c1f 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; -- GitLab From 448b4fb26f1df95bd28821a29481f6a262a9c4a4 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 21:59:25 +0100 Subject: [PATCH 18/27] [cleanup] accept FIX_BASOP_2354_MSAN_DIFF_Q_VALUE --- lib_com/options.h | 1 - lib_rend/ivas_dirac_rend_fx.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index b3d6c1648..5ebc06bbc 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,7 +84,6 @@ #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_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ -#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 */ diff --git a/lib_rend/ivas_dirac_rend_fx.c b/lib_rend/ivas_dirac_rend_fx.c index e242c9c08..4ca7b0c14 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 } /*-----------------------------------------------------------------* -- GitLab From 7f89d0d51b1eb9dbb334d2039ed02089049ca778 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 22:00:54 +0100 Subject: [PATCH 19/27] [cleanup] accept FIX_2371_REMOVE_UNUSED_ISAR_FCNS --- lib_com/options.h | 1 - lib_isar/isar_PerceptualModel.c | 204 -------------------------------- lib_isar/isar_PredDecoder.c | 18 --- lib_isar/isar_lcld_encoder.c | 12 -- lib_isar/isar_lcld_prot.h | 30 ----- 5 files changed, 265 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 5ebc06bbc..95568cc9f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,7 +84,6 @@ #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_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ -#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 */ diff --git a/lib_isar/isar_PerceptualModel.c b/lib_isar/isar_PerceptualModel.c index cbc878b7c..b6f0936ab 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,66 +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 /*------------------------------------------------------------------------------------------* @@ -246,119 +155,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 9023009ef..7517239f1 100644 --- a/lib_isar/isar_PredDecoder.c +++ b/lib_isar/isar_PredDecoder.c @@ -359,24 +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( diff --git a/lib_isar/isar_lcld_encoder.c b/lib_isar/isar_lcld_encoder.c index 8f6ed3983..9b33cc653 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 16acd9716..aa9cd5107 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 -- GitLab From 524970e65cb00491a5c0fde044cc157480d0ee5d Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 22:01:36 +0100 Subject: [PATCH 20/27] [cleanup] accept FIX_2384_INIT_DEQUANT_COV --- lib_com/options.h | 1 - lib_dec/ivas_mc_param_dec_fx.c | 14 -------------- 2 files changed, 15 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 95568cc9f..af3e84840 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,7 +84,6 @@ #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_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ -#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() */ diff --git a/lib_dec/ivas_mc_param_dec_fx.c b/lib_dec/ivas_mc_param_dec_fx.c index 70b4b645c..fcfc9f911 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; -- GitLab From e70a649a9ec61523ce37ff5c1e1cd9fdbe3b6e6a Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 22:02:11 +0100 Subject: [PATCH 21/27] [cleanup] accept FIX_2383_INIT_Q_A_ITF --- lib_com/options.h | 1 - lib_dec/dec_tcx_fx.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index af3e84840..d60dba021 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,7 +84,6 @@ #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_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ -#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 */ diff --git a/lib_dec/dec_tcx_fx.c b/lib_dec/dec_tcx_fx.c index 78e95b7a6..8482ef78b 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++ ) { -- GitLab From 0ffa6c6d8a0b25f9ba804729d8290583f5991236 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 22:02:50 +0100 Subject: [PATCH 22/27] [cleanup] accept FIX_2382_COPY_AQ_IN_MCT --- lib_com/options.h | 1 - lib_dec/ivas_mct_dec_fx.c | 13 ------------- lib_dec/ivas_stereo_mdct_core_dec_fx.c | 5 ----- 3 files changed, 19 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index d60dba021..453714b24 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,7 +84,6 @@ #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_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ -#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 */ diff --git a/lib_dec/ivas_mct_dec_fx.c b/lib_dec/ivas_mct_dec_fx.c index b50fb4ae9..62a33352c 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_stereo_mdct_core_dec_fx.c b/lib_dec/ivas_stereo_mdct_core_dec_fx.c index 403aafa37..8a8c7dc30 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++ ) { -- GitLab From 28bfdb968bbf02daac5b43018856785b1cf136c5 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 22:03:19 +0100 Subject: [PATCH 23/27] [cleanup] accept FIX_2391_INIT_HQ_GENERIC_OFFSET --- lib_com/options.h | 1 - lib_dec/hq_hr_dec_fx.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 453714b24..825b692e9 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,7 +84,6 @@ #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_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ -#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 */ diff --git a/lib_dec/hq_hr_dec_fx.c b/lib_dec/hq_hr_dec_fx.c index bcc330d61..30a7d4f4a 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 */ -- GitLab From f5dbeace16f09ced6ff51ea2336843a7f0248cca Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 22:04:07 +0100 Subject: [PATCH 24/27] [cleanup] accept FIX_BASOP_2317_UNINIT_VALUE_IN_STEREO_CNG --- lib_com/options.h | 1 - lib_enc/ivas_stereo_dft_enc_fx.c | 6 ------ 2 files changed, 7 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 825b692e9..13e4ac604 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -94,7 +94,6 @@ #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[] */ diff --git a/lib_enc/ivas_stereo_dft_enc_fx.c b/lib_enc/ivas_stereo_dft_enc_fx.c index d6af9caf0..6aa9673f4 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 ) -- GitLab From 93b190fc60d4cb326032d52cbb7972e77f161425 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 22:04:46 +0100 Subject: [PATCH 25/27] [cleanup] accept FIX_1283_STEREO_DFT_COLLAPSE --- lib_com/options.h | 1 - lib_enc/cod_tcx_fx.c | 8 -------- lib_enc/ivas_sce_enc_fx.c | 2 -- 3 files changed, 11 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 13e4ac604..32913a923 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -95,7 +95,6 @@ #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_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 */ diff --git a/lib_enc/cod_tcx_fx.c b/lib_enc/cod_tcx_fx.c index 922ae177a..d2dd0bf03 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/ivas_sce_enc_fx.c b/lib_enc/ivas_sce_enc_fx.c index 3e62c720e..176354490 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(); -- GitLab From 230c0ae0a05a8f2c7cf49595a863608747101500 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 22:05:56 +0100 Subject: [PATCH 26/27] [cleanup] accept FIX_2379_REMOVE_previoussynth_fx_32 --- lib_com/options.h | 1 - lib_dec/acelp_core_dec_fx.c | 4 ---- lib_dec/core_switching_dec_fx.c | 8 -------- lib_dec/init_dec_fx.c | 3 --- lib_dec/ivas_core_dec_fx.c | 6 ------ lib_dec/stat_dec.h | 3 --- 6 files changed, 25 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 32913a923..37ad8d099 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -95,7 +95,6 @@ #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_2361_OTR /* FhG: Basop issue 2361: Orientation tracking tests for equivalent rotations fail */ -#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_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index ac9557073..033683a0a 100644 --- a/lib_dec/acelp_core_dec_fx.c +++ b/lib_dec/acelp_core_dec_fx.c @@ -2105,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 { diff --git a/lib_dec/core_switching_dec_fx.c b/lib_dec/core_switching_dec_fx.c index 9d36d2c5e..ae891ae53 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/init_dec_fx.c b/lib_dec/init_dec_fx.c index a3e2c48e3..b8a5fe6de 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 37e09deeb..0f9bf2d9b 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 ) ) diff --git a/lib_dec/stat_dec.h b/lib_dec/stat_dec.h index a1646e82e..eafc5dd8a 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*/ -- GitLab From 1ecc558dffb5b13d3453d00f77dbdf45d6a1baba Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Feb 2026 22:08:25 +0100 Subject: [PATCH 27/27] formatting --- lib_com/prot_fx.h | 6 +++--- lib_enc/ivas_core_enc_fx.c | 14 +++++++------- lib_enc/ivas_mct_enc_mct_fx.c | 1 - lib_enc/ivas_stereo_icbwe_enc_fx.c | 6 +++--- lib_enc/multi_harm_fx.c | 24 ++++++++++++------------ lib_enc/prot_fx_enc.h | 29 ++++++++++++++--------------- lib_enc/swb_bwe_enc_fx.c | 5 ++--- lib_enc/swb_pre_proc_fx.c | 6 +++--- lib_isar/isar_PerceptualModel.c | 1 - lib_isar/isar_PredDecoder.c | 1 - 10 files changed, 44 insertions(+), 49 deletions(-) diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 02b1654d1..d914126ab 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -10246,9 +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 */ - Word16 *shb_speech, /* o : SHB target signal (6-14kHz) at 16kHz - Q0*/ + 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*/ diff --git a/lib_enc/ivas_core_enc_fx.c b/lib_enc/ivas_core_enc_fx.c index df8c7c880..79a28b63a 100644 --- a/lib_enc/ivas_core_enc_fx.c +++ b/lib_enc/ivas_core_enc_fx.c @@ -710,13 +710,13 @@ ivas_error ivas_core_enc_fx( } } - 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 - } + 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 + } /* SWB TBE encoder */ test(); diff --git a/lib_enc/ivas_mct_enc_mct_fx.c b/lib_enc/ivas_mct_enc_mct_fx.c index bb5ecbb68..c725950b1 100644 --- a/lib_enc/ivas_mct_enc_mct_fx.c +++ b/lib_enc/ivas_mct_enc_mct_fx.c @@ -102,7 +102,6 @@ void getChannelEnergies_fx( nrg[ch] = BASOP_Util_Add_Mant32Exp( nrg[ch], nrg_e[ch], sum2, sum2_e, &nrg_e[ch] ); move32(); - } nrg[ch] = Sqrt32( nrg[ch], &nrg_e[ch] ); // nrg_e diff --git a/lib_enc/ivas_stereo_icbwe_enc_fx.c b/lib_enc/ivas_stereo_icbwe_enc_fx.c index 8a1d9f6f0..1fbbd777a 100644 --- a/lib_enc/ivas_stereo_icbwe_enc_fx.c +++ b/lib_enc/ivas_stereo_icbwe_enc_fx.c @@ -612,11 +612,11 @@ static void icbwe_dft_stereo_param_fx( *-------------------------------------------------------------------*/ void stereo_icBWE_enc_fx( - CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ + 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*/ - Word16 shb_speech_nonref_e, /* i/o: SHB speech non-ref channel */ - const Word16 *voice_factors_fx16 /* i : voicing factors Q15 */ + 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; diff --git a/lib_enc/multi_harm_fx.c b/lib_enc/multi_harm_fx.c index 317404c7e..6c0ef3f09 100644 --- a/lib_enc/multi_harm_fx.c +++ b/lib_enc/multi_harm_fx.c @@ -29,18 +29,18 @@ /* o : frame multi-harmonicity (1-harmonic, 0-not) */ Word16 multi_harm_fx( const Word16 element_mode, /* i : IVAS element_mode Q0 */ - 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; diff --git a/lib_enc/prot_fx_enc.h b/lib_enc/prot_fx_enc.h index e2ed6f76d..030fee944 100644 --- a/lib_enc/prot_fx_enc.h +++ b/lib_enc/prot_fx_enc.h @@ -576,9 +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 */ - Word16 *shb_speech_fx, /* i : SHB target signal (6-14kHz) at 16kHz Q0 */ - const Word16 Q_slb_speech -); + 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 */ @@ -4102,18 +4101,18 @@ Word32 mslvq_fx( /* o : frame multi-harmonicity (1-harmonic, 0-not) */ Word16 multi_harm_fx( const Word16 element_mode, /* i : IVAS element_mode Q0 */ - 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 */ ); diff --git a/lib_enc/swb_bwe_enc_fx.c b/lib_enc/swb_bwe_enc_fx.c index 0ac0c4958..8dfd67076 100644 --- a/lib_enc/swb_bwe_enc_fx.c +++ b/lib_enc/swb_bwe_enc_fx.c @@ -271,9 +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 */ - Word16 *shb_speech_fx_Q0, /* i : SHB target signal (6-14kHz) at 16kHz Q0 */ - const Word16 Q_slb_speech -) + 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; diff --git a/lib_enc/swb_pre_proc_fx.c b/lib_enc/swb_pre_proc_fx.c index 57454f02c..7b97791ff 100644 --- a/lib_enc/swb_pre_proc_fx.c +++ b/lib_enc/swb_pre_proc_fx.c @@ -772,9 +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 */ - Word16 *shb_speech, /* o : SHB target signal (6-14kHz) at 16kHz - Q0 */ + 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 */ diff --git a/lib_isar/isar_PerceptualModel.c b/lib_isar/isar_PerceptualModel.c index b6f0936ab..3ad12b9a4 100644 --- a/lib_isar/isar_PerceptualModel.c +++ b/lib_isar/isar_PerceptualModel.c @@ -148,7 +148,6 @@ void PerceptualModel_fx( } - /*------------------------------------------------------------------------------------------* * Function PerceptualModelStereo() * diff --git a/lib_isar/isar_PredDecoder.c b/lib_isar/isar_PredDecoder.c index 7517239f1..94d85f2eb 100644 --- a/lib_isar/isar_PredDecoder.c +++ b/lib_isar/isar_PredDecoder.c @@ -360,7 +360,6 @@ Word16 ReadPredictors_fx( } - Word32 AnyDecodingUnresolved( PredictionDecoder *psPredictionDecoder ) { -- GitLab