From 74ac86852638fb0dbd1ee4d201fa5998319d8334 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 9 Jun 2026 21:59:50 +0200 Subject: [PATCH 1/7] [cleanup] accept FIX_ISSUE_2616_BOUNDARY_CONDITION --- lib_com/options.h | 1 - lib_dec/ivas_stereo_dft_dec_fx.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 721482a70..5b262c2e4 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -86,7 +86,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_ISSUE_2616_BOUNDARY_CONDITION /* FhG: basop issue 2616: Inconsistent boundary conditions in function stereo_dft_dequantize_res_gains*/ #define FIX_ISSUE_2613_WRONG_COMP_MACRO /* FhG: basop issue 2613: Inconsistent comparison macros in function tdm_SCh_LSF_intra_pred_fx*/ #define FIX_ISSUE_2611_WRONG_COMMENT /* FhG: basop issue 2611: Wrong Q value comment in fucntion stereo_dft_sg_recovery_fx()*/ #define FIX_BASOP_2550_TCX_ENC_MEM_UPDATE /* FhG: fix condition in tcx_encoder_memory_update_*_fx(), bring inline with float */ diff --git a/lib_dec/ivas_stereo_dft_dec_fx.c b/lib_dec/ivas_stereo_dft_dec_fx.c index cd6c74e13..bf2a85a53 100644 --- a/lib_dec/ivas_stereo_dft_dec_fx.c +++ b/lib_dec/ivas_stereo_dft_dec_fx.c @@ -445,11 +445,7 @@ static void stereo_dft_dequantize_res_gains_fx( move16(); ind2[i] = check_bounds_s_fx( ind2[i], 0, 7 ); /* Q0 */ move16(); -#ifndef FIX_ISSUE_2616_BOUNDARY_CONDITION - IF( LE_16( ind1[i], 15 ) ) -#else IF( LT_16( ind1[i], 15 ) ) -#endif // !FIX_ISSUE_2616_BOUNDARY_CONDITION { tmp = sub( 15, ind1[i] ); } @@ -460,11 +456,7 @@ static void stereo_dft_dequantize_res_gains_fx( // index = add( shl( LE_16( ind1[i], 15 ) ? sub( 15, ind1[i] ) : sub( ind1[i], 15 ), 3 ), ind2[i] ); index = add( shl( tmp, 3 ), ind2[i] ); // gout[i] = LE_16( ind1[i], 15 ) ? L_negate( dft_res_gains_q_fx[index][0] ) : dft_res_gains_q_fx[index][0]; -#ifndef FIX_ISSUE_2616_BOUNDARY_CONDITION - IF( LE_16( ind1[i], 15 ) ) -#else IF( LT_16( ind1[i], 15 ) ) -#endif // !FIX_ISSUE_2616_BOUNDARY_CONDITION { gout[i] = L_negate( dft_res_gains_q_fx[index][0] ); /* Q31 */ move16(); -- GitLab From 117e20a2e159765071f1a353c0eb34b08de227fd Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 9 Jun 2026 22:00:47 +0200 Subject: [PATCH 2/7] [cleanup] accept FIX_ISSUE_2613_WRONG_COMP_MACRO --- lib_com/ivas_stereo_td_bit_alloc_fx.c | 4 ---- lib_com/options.h | 1 - 2 files changed, 5 deletions(-) diff --git a/lib_com/ivas_stereo_td_bit_alloc_fx.c b/lib_com/ivas_stereo_td_bit_alloc_fx.c index 74f039d0a..ae0c0408b 100644 --- a/lib_com/ivas_stereo_td_bit_alloc_fx.c +++ b/lib_com/ivas_stereo_td_bit_alloc_fx.c @@ -716,11 +716,7 @@ void tdm_SCh_LSF_intra_pred_fx( fixed_beta = 30801; // 0.94f in Q15 move16(); } -#ifndef FIX_ISSUE_2613_WRONG_COMP_MACRO - ELSE IF( element_brate <= IVAS_24k4 ) -#else ELSE IF( LE_32( element_brate, IVAS_24k4 ) ) -#endif // !FIX_ISSUE_2613_WRONG_COMP_MACRO { fixed_beta = 29818; // 0.91f in Q15 move16(); diff --git a/lib_com/options.h b/lib_com/options.h index 5b262c2e4..f3ecb6a80 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -86,7 +86,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_ISSUE_2613_WRONG_COMP_MACRO /* FhG: basop issue 2613: Inconsistent comparison macros in function tdm_SCh_LSF_intra_pred_fx*/ #define FIX_ISSUE_2611_WRONG_COMMENT /* FhG: basop issue 2611: Wrong Q value comment in fucntion stereo_dft_sg_recovery_fx()*/ #define FIX_BASOP_2550_TCX_ENC_MEM_UPDATE /* FhG: fix condition in tcx_encoder_memory_update_*_fx(), bring inline with float */ #define FIX_BASOP_2620_ICBWE_GSMAPPING_DEAD_CLAMP /* FhG: remove dead (always-overwritten) gsMapping clamp in ic_bwe_enc_gsMapping_fx; float ref has no clamp */ -- GitLab From 7055f528f77c0e73e0e5ab9b77496a72f7f7336d Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 9 Jun 2026 22:05:28 +0200 Subject: [PATCH 3/7] [cleanup] accept FIX_ISSUE_2611_WRONG_COMMENT --- lib_com/options.h | 1 - lib_dec/ivas_stereo_dft_plc_fx.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index f3ecb6a80..452aef584 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -86,7 +86,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_ISSUE_2611_WRONG_COMMENT /* FhG: basop issue 2611: Wrong Q value comment in fucntion stereo_dft_sg_recovery_fx()*/ #define FIX_BASOP_2550_TCX_ENC_MEM_UPDATE /* FhG: fix condition in tcx_encoder_memory_update_*_fx(), bring inline with float */ #define FIX_BASOP_2620_ICBWE_GSMAPPING_DEAD_CLAMP /* FhG: remove dead (always-overwritten) gsMapping clamp in ic_bwe_enc_gsMapping_fx; float ref has no clamp */ diff --git a/lib_dec/ivas_stereo_dft_plc_fx.c b/lib_dec/ivas_stereo_dft_plc_fx.c index 5d7c0a1b0..0ea6c33e5 100644 --- a/lib_dec/ivas_stereo_dft_plc_fx.c +++ b/lib_dec/ivas_stereo_dft_plc_fx.c @@ -859,11 +859,7 @@ Word16 stereo_dft_sg_recovery_fx( test(); IF( LT_32( sg_m, (Word32) 0x4CCCCCCD ) && GT_32( sg_m, (Word32) ( 0xB3333333 ) ) ) { -#ifndef FIX_ISSUE_2611_WRONG_COMMENT - hStereoDft->sg_mean_fx = 0; /* Q13 */ -#else hStereoDft->sg_mean_fx = 0; /* Q31 */ -#endif // !FIX_ISSUE_2611_WRONG_COMMENT move32(); } ELSE -- GitLab From b77b1568e49b40286ddf4a48cc7b7d16b480f6dd Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 9 Jun 2026 22:06:15 +0200 Subject: [PATCH 4/7] [cleanup] accept FIX_BASOP_2550_TCX_ENC_MEM_UPDATE --- lib_com/options.h | 1 - lib_enc/tcx_utils_enc_fx.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 452aef584..02d11a35c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -86,7 +86,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_BASOP_2550_TCX_ENC_MEM_UPDATE /* FhG: fix condition in tcx_encoder_memory_update_*_fx(), bring inline with float */ #define FIX_BASOP_2620_ICBWE_GSMAPPING_DEAD_CLAMP /* FhG: remove dead (always-overwritten) gsMapping clamp in ic_bwe_enc_gsMapping_fx; float ref has no clamp */ /* #################### End BE switches ################################## */ diff --git a/lib_enc/tcx_utils_enc_fx.c b/lib_enc/tcx_utils_enc_fx.c index 4300ecc12..6b1bb5c4f 100644 --- a/lib_enc/tcx_utils_enc_fx.c +++ b/lib_enc/tcx_utils_enc_fx.c @@ -2406,11 +2406,7 @@ void tcx_encoder_memory_update_fx( Copy( synth + sub( L_frame_glob, L_SYN_MEM ), LPDmem->mem_syn_r, L_SYN_MEM ); test(); -#ifdef FIX_BASOP_2550_TCX_ENC_MEM_UPDATE IF( st->tcxonly == 0 || EQ_16( L_frame_glob, L_FRAME16k ) ) -#else - IF( st->tcxonly == 0 || LE_16( L_frame_glob, L_FRAME16k ) ) -#endif { /* Update excitation */ IF( LT_16( L_frame_glob, L_EXC_MEM ) ) @@ -2478,11 +2474,7 @@ void tcx_encoder_memory_update_ivas_fx( move16(); test(); -#ifdef FIX_BASOP_2550_TCX_ENC_MEM_UPDATE IF( st->tcxonly == 0 || EQ_16( L_frame_glob, L_FRAME16k ) ) -#else - IF( st->tcxonly == 0 || LE_16( L_frame_glob, L_FRAME16k ) ) -#endif { /* Update excitation */ IF( LT_16( L_frame_glob, L_EXC_MEM ) ) -- GitLab From c5866e1ff021775aa510b69b63302f8f78dd128d Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 9 Jun 2026 22:07:09 +0200 Subject: [PATCH 5/7] [cleanup] accept FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI --- lib_com/options.h | 1 - lib_rend/ivas_dirac_output_synthesis_dec_fx.c | 63 ------------------- lib_rend/ivas_dirac_rend_fx.c | 61 ------------------ lib_rend/lib_rend_fx.c | 16 ----- 4 files changed, 141 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 02d11a35c..7856500e0 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -94,7 +94,6 @@ /* any switch which is non-be wrt. TS 26.251 V3.0 */ #define FIX_1576_LCLD_CRASH_DIFFERENT_CODEC_ISAR_FRAME_SIZE /* Dolby: float issue 1576: fix for crash in LCLD mode when codec frame size is less than isar frame size */ -#define FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI /* Nokia: BASOP issue 2442: Increase accuracy of computations and add additional gain clamp for low energy decorrelated signal rendering. */ #define FIX_FMSW_DEC_EXT /* float issue 1566: fix EXT output in format switching */ #define FIX_BASOP_2612_RESET_DECIM_MEM /* FhG: BASOP #2612: reset (zero) the 16k resampler memory of the secondary channel on DFT->TD stereo switch (otherwise -> fx overshoot) */ #define FIX_BASOP_2621_STEREO_CNG_NOISY_SPEECH_QSHIFT /* FhG: BASOP #2621: stereo_dft_generate_comfort_noise_fx flag_noisy_speech: compare (lp_speech-lp_noise) Q23 diff against 28.0 in Q23 (was vs integer 28 with q_lp_noise=0) */ diff --git a/lib_rend/ivas_dirac_output_synthesis_dec_fx.c b/lib_rend/ivas_dirac_output_synthesis_dec_fx.c index 23e8b5ea7..27a95190f 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec_fx.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec_fx.c @@ -56,10 +56,8 @@ #define POINT_3679_Q31 790059234 /*.3679 q31*/ #define POINT_1175_Q31 252329329 /*.1175 q31*/ -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI #define DIRAC_SMALL_DIFF_POW_LIM 65536 #define DIRAC_SMALL_DIFF_POW_MAX_GAIN 2 -#endif /*------------------------------------------------------------------------- * Local function prototypes @@ -1880,10 +1878,8 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( Word16 exp = 0, exp1, tmp, q_com, q_tmp, min_exp; Word32 tmp32; move16(); -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI Word32 L_tmp_cross; Word16 q_tmp_cross; -#endif Word64 Cldfb_RealBuffer64_fx[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; Word64 Cldfb_ImagBuffer64_fx[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; @@ -2010,7 +2006,6 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( masa_stereo_type_detect->target_power_y_smooth_fx = L_shl( masa_stereo_type_detect->target_power_y_smooth_fx, sub( q_com, masa_stereo_type_detect->q_target_power_y_smooth ) ); move32(); -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI W_temp = W_add( W_mult0_32_32( a, target_power_y ), W_mult0_32_32( b, masa_stereo_type_detect->target_power_y_smooth_fx ) ); // Q31 + q_com IF( W_temp ) @@ -2028,14 +2023,6 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( masa_stereo_type_detect->q_target_power_y_smooth = Q31; move16(); } -#else - masa_stereo_type_detect->target_power_y_smooth_fx = - L_add( Mpy_32_32( a, target_power_y ), - Mpy_32_32( b, masa_stereo_type_detect->target_power_y_smooth_fx ) ); //(Q31, q_com) -> q_com - move32(); - masa_stereo_type_detect->q_target_power_y_smooth = q_com; - move16(); -#endif IF( NE_16( masa_stereo_type_detect->q_subtract_power_y, masa_stereo_type_detect->q_subtract_power_y_smooth ) ) { @@ -2075,11 +2062,7 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( { subtract_target_ratio = L_sub( BASOP_Util_Log2( masa_stereo_type_detect->subtract_power_y_smooth_fx ), BASOP_Util_Log2( masa_stereo_type_detect->target_power_y_smooth_fx ) ); // Q25 -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI exp = sub( masa_stereo_type_detect->q_subtract_power_y_smooth, masa_stereo_type_detect->q_target_power_y_smooth ); -#else - exp = sub( masa_stereo_type_detect->q_subtract_power_y_smooth, q_com ); -#endif L_tmp = Mpy_32_32( L_sub( subtract_target_ratio, L_shl( exp, 25 ) ), LOG10_2_Q31 ); // Q25 } ELSE @@ -2305,7 +2288,6 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( Word32 cmp = W_shl_sat_l( DIRAC_GAIN_LIMIT_Q26, sub( h_dirac_output_synthesis_state->gains_dir_prev_q, 26 ) ); Word32 cmp2 = W_extract_h( W_shl( W_mult_32_32( DIRAC_GAIN_LIMIT_Q26, L_shl( 1, h_dirac_output_synthesis_state->gains_diff_prev_q ) ), Q5 ) ); -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI Word32 diff_gain_limit = L_shl( DIRAC_SMALL_DIFF_POW_MAX_GAIN, h_dirac_output_synthesis_state->gains_diff_prev_q ); Word32 power_diff_small_lim; IF( GT_16( h_dirac_output_synthesis_state->proto_power_diff_smooth_q, norm_l( DIRAC_SMALL_DIFF_POW_LIM ) ) ) @@ -2321,7 +2303,6 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( power_diff_small_lim = L_shl( DIRAC_SMALL_DIFF_POW_LIM, h_dirac_output_synthesis_state->proto_power_diff_smooth_q ); } -#endif FOR( k = 0; k < nchan_out_woLFE; k++ ) { @@ -2404,7 +2385,6 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( *( p_gains_diff ) = cmp2; /*h_dirac_output_synthesis_state->gains_diff_prev_q*/ move32(); } -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI test(); IF( LT_32( *( p_power_diff_smooth_prev - 1 ), power_diff_small_lim ) && GT_32( *( p_gains_diff ), diff_gain_limit ) ) /* proto_power_diff_smooth_q and gains_diff_prev_q */ @@ -2413,7 +2393,6 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( move32(); } -#endif p_gains_diff++; } @@ -2431,16 +2410,11 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx( *( p_cy_auto_dir_smooth_prev++ ) = L_shr_r( L_tmp, q_tmp ); // q_cy_auto_dir_smooth_prev_local move32(); -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI W_temp = W_mac_32_32( W_mult_32_32( g1, ( *( p_cy_cross_dir_smooth ) ) ), g2, ( *( p_cy_cross_dir_smooth_prev ) ) ); q_tmp_cross = W_norm( W_temp ); L_tmp_cross = W_extract_h( W_shl( W_temp, q_tmp_cross ) ); *( p_cy_cross_dir_smooth_prev ) = L_shr_r( L_tmp_cross, q_tmp_cross ); // q_cy_cross_dir_smooth_prev -#else - *( p_cy_cross_dir_smooth_prev ) = Madd_32_32( Mpy_32_32( g1, ( *( p_cy_cross_dir_smooth ) ) ), - g2, ( *( p_cy_cross_dir_smooth_prev ) ) ); // (Q31, q_cy_cross_dir_smooth_prev) -> q_cy_cross_dir_smooth_prev -#endif move32(); test(); if ( *( p_cy_cross_dir_smooth_prev ) == 0 && ( *( p_cy_cross_dir_smooth ) != 0 ) ) @@ -2895,13 +2869,8 @@ void ivas_dirac_dec_compute_directional_responses_fx( Word16 max_exp = MIN16B; move16(); -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI maximum_fx( exp_arr, num_channels_dir, &max_exp ); FOR( l = 0; l < num_channels_dir; l++ ) -#else - maximum_fx( exp_arr, MAX_OUTPUT_CHANNELS, &max_exp ); - FOR( l = 0; l < MAX_OUTPUT_CHANNELS; l++ ) -#endif { direct_response_hoa_fx[l] = L_shr( direct_response_hoa_fx[l], sub( max_exp, exp_arr[l] ) ); /*Q(31-exp_arr[l])->Q(31-max_exp)*/ move32(); @@ -3039,13 +3008,8 @@ void ivas_dirac_dec_compute_directional_responses_fx( } Word16 max_exp = MIN_16; move16(); -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI maximum_fx( exp_arr, num_channels_dir, &max_exp ); FOR( l = 0; l < num_channels_dir; l++ ) -#else - maximum_fx( exp_arr, MAX_OUTPUT_CHANNELS, &max_exp ); - FOR( l = 0; l < MAX_OUTPUT_CHANNELS; l++ ) -#endif { direct_response_hoa_fx[l] = L_shr( direct_response_hoa_fx[l], sub( max_exp, exp_arr[l] ) ); /*q(31-exp_arr[l])->q(31-max_exp)*/ move32(); @@ -3057,11 +3021,7 @@ void ivas_dirac_dec_compute_directional_responses_fx( Q_direct_response_hoa = sub( Q31, exp_direct_response_hoa ); -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI Scale_sig32( direct_response_hoa_fx, num_channels_dir, sub( Q29, Q_direct_response_hoa ) ); /*Q_direct_response_hoa->q29*/ -#else - Scale_sig32( direct_response_hoa_fx, MAX_OUTPUT_CHANNELS, sub( Q29, Q_direct_response_hoa ) ); /*Q_direct_response_hoa->q29*/ -#endif direct_response_q = Q29; move16(); @@ -3161,14 +3121,8 @@ void ivas_dirac_dec_compute_directional_responses_fx( move16(); } -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI maximum_fx( exp_table, num_channels_dir, &exp_max ); FOR( i = 0; i < num_channels_dir; i++ ) -#else - maximum_fx( exp_table, MAX_OUTPUT_CHANNELS, &exp_max ); - - FOR( i = 0; i < MAX_OUTPUT_CHANNELS; i++ ) -#endif { direct_response_ls_fx[i] = L_shr( direct_response_ls_fx[i], sub( exp_max, exp_table[i] ) ); /*(q(31-exp_table[i])->q(31-exp_max))*/ move32(); @@ -3335,13 +3289,8 @@ void ivas_dirac_dec_compute_directional_responses_fx( max_exp = MIN16B; /*Q0*/ move16(); -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI maximum_fx( exp_arr, num_channels_dir, &max_exp ); FOR( l = 0; l < num_channels_dir; l++ ) -#else - maximum_fx( exp_arr, MAX_OUTPUT_CHANNELS, &max_exp ); - FOR( l = 0; l < MAX_OUTPUT_CHANNELS; l++ ) -#endif { direct_response_ls_fx[l] = L_shr( direct_response_ls_fx[l], sub( max_exp, exp_arr[l] ) ); /*Q(31-exp_arr[l])->Q(31-max_exp)*/ move32(); @@ -3355,11 +3304,7 @@ void ivas_dirac_dec_compute_directional_responses_fx( normalizePanningGains_fx( direct_response_ls_fx, &Q_direct_response_ls, num_channels_dir ); exp_direct_response_ls = sub( 31, Q_direct_response_ls ); -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI Scale_sig32( direct_response_ls_fx, num_channels_dir, sub( Q29, Q_direct_response_ls ) ); /*Q_direct_response_ls->Q29*/ -#else - Scale_sig32( direct_response_ls_fx, MAX_OUTPUT_CHANNELS, sub( Q29, Q_direct_response_ls ) ); /*Q_direct_response_ls->Q29*/ -#endif direct_response_q = Q29; move16(); @@ -4086,19 +4031,11 @@ static void spreadCoherencePanningHoa_fx( } Word16 max_val = MIN_16; move16(); -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI FOR( i = 0; i < num_channels_dir; i++ ) -#else - FOR( i = 0; i < 16; i++ ) -#endif { max_val = s_max( max_val, exp_arr[i] ); } -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI FOR( i = 0; i < num_channels_dir; i++ ) -#else - FOR( i = 0; i < 16; i++ ) -#endif { direct_response_fx[i] = L_shr( direct_response_fx[i], sub( max_val, exp_arr[i] ) ); // Q(31-exp_arr[i])->q(31-max_val) move32(); diff --git a/lib_rend/ivas_dirac_rend_fx.c b/lib_rend/ivas_dirac_rend_fx.c index 84274cb9d..d6ad29d8f 100644 --- a/lib_rend/ivas_dirac_rend_fx.c +++ b/lib_rend/ivas_dirac_rend_fx.c @@ -2559,7 +2559,6 @@ void protoSignalComputation2_fx( } } -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI stereo_type_detect->left_bb_power_fx = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, left_bb_power_fx ), sub( 31, q_Left_Right_power ), Mpy_32_32( b_fx, stereo_type_detect->left_bb_power_fx ), sub( 31, stereo_type_detect->q_left_bb_power ), &stereo_type_detect->q_left_bb_power ); move32(); stereo_type_detect->q_left_bb_power = sub( 31, stereo_type_detect->q_left_bb_power ); @@ -2574,49 +2573,6 @@ void protoSignalComputation2_fx( move32(); stereo_type_detect->q_total_bb_power = sub( 31, stereo_type_detect->q_total_bb_power ); move16(); -#else - temp = Mpy_32_32( a_fx, left_bb_power_fx ); // q_Left_Right_power - IF( LT_16( q_Left_Right_power, stereo_type_detect->q_left_bb_power ) ) - { - stereo_type_detect->left_bb_power_fx = L_add( temp, L_shr( Mpy_32_32( b_fx, stereo_type_detect->left_bb_power_fx ), sub( stereo_type_detect->q_left_bb_power, q_Left_Right_power ) ) ); // q_Left_Right_power - move32(); - stereo_type_detect->q_left_bb_power = q_Left_Right_power; - move16(); - } - ELSE - { - stereo_type_detect->left_bb_power_fx = Madd_32_32( L_shr( temp, sub( q_Left_Right_power, stereo_type_detect->q_left_bb_power ) ), b_fx, stereo_type_detect->left_bb_power_fx ); // stereo_type_detect->q_left_bb_power - move32(); - } - - temp = Mpy_32_32( a_fx, right_bb_power_fx ); // q_Left_Right_power - IF( LT_16( q_Left_Right_power, stereo_type_detect->q_right_bb_power ) ) - { - stereo_type_detect->right_bb_power_fx = L_add( temp, L_shr( Mpy_32_32( b_fx, stereo_type_detect->right_bb_power_fx ), sub( stereo_type_detect->q_right_bb_power, q_Left_Right_power ) ) ); // q_Left_Right_power - move32(); - stereo_type_detect->q_right_bb_power = q_Left_Right_power; - move16(); - } - ELSE - { - stereo_type_detect->right_bb_power_fx = Madd_32_32( L_shr( temp, sub( q_Left_Right_power, stereo_type_detect->q_right_bb_power ) ), b_fx, stereo_type_detect->right_bb_power_fx ); // stereo_type_detect->q_right_bb_power - move32(); - } - - temp = Mpy_32_32( a_fx, total_bb_power_fx ); // q_Left_Right_power - IF( LT_16( q_Left_Right_power, stereo_type_detect->q_total_bb_power ) ) - { - stereo_type_detect->total_bb_power_fx = L_add( temp, L_shr( Mpy_32_32( b_fx, stereo_type_detect->total_bb_power_fx ), sub( stereo_type_detect->q_total_bb_power, q_Left_Right_power ) ) ); // q_Left_Right_power - move32(); - stereo_type_detect->q_total_bb_power = q_Left_Right_power; - move16(); - } - ELSE - { - stereo_type_detect->total_bb_power_fx = Madd_32_32( L_shr( temp, sub( q_Left_Right_power, stereo_type_detect->q_total_bb_power ) ), b_fx, stereo_type_detect->total_bb_power_fx ); // stereo_type_detect->q_total_bb_power - move32(); - } -#endif IF( LT_16( stereo_type_detect->q_left_bb_power, stereo_type_detect->q_right_bb_power ) ) { @@ -2670,7 +2626,6 @@ void protoSignalComputation2_fx( q_lr_hi_power = stereo_type_detect->q_right_hi_power; } q_lr_hi_power = sub( q_lr_hi_power, 1 ); /* = (q_lr_hi_power * 2) */ -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI /* We need to use accurately EPSILON from float (1e-15) in correct Q format as it can * dominate the division in high bands when total_hi_power is low or zero. This leads to * decision differences between BASOP and float. Close enough value is 2^-50 which is @@ -2697,14 +2652,9 @@ void protoSignalComputation2_fx( temp = BASOP_Util_Divide3232_Scale_newton( lr_hi_power_fx, denom_fx, &exp ); exp = sub( 31, add( sub( 31, exp ), sub( q_lr_hi_power, q_denom ) ) ); exp = s_min( exp, 0 ); /* 2*min(l,r) <= l+r so we can clamp ratio <= 1 */ -#else - temp = BASOP_Util_Divide3232_Scale_newton( lr_hi_power_fx, L_add( stereo_type_detect->total_hi_power_fx, EPSILON_FX ), &exp ); // Q=31-(exp+ stereo_type_detect->q_total_hi_power-q_lr_hi_power) - exp = sub( 31, add( sub( 31, exp ), sub( q_lr_hi_power, stereo_type_detect->q_total_hi_power ) ) ); -#endif temp = BASOP_Util_Log2( temp ); // q25 IF( NE_32( temp, MIN_32 ) ) { -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI IF( LT_16( exp, -63 ) ) { temp = MIN_32; @@ -2714,9 +2664,6 @@ void protoSignalComputation2_fx( { temp = Mpy_32_32( L_add( L_shl( exp, Q25 ), temp ), LOG10_2_Q31 ); // Q25 } -#else - temp = Mpy_32_32( L_add( L_shl( exp, Q25 ), temp ), LOG10_2_Q31 ); // Q25 -#endif } // 20480 = 10 in Q11 lr_total_hi_ratio_fx = Mpy_32_16_1( temp, 20480 ); // Q21 @@ -2863,11 +2810,7 @@ void protoSignalComputation2_fx( IF( GT_16( min_q_shift[0], min_q_shift[1] ) ) { -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI FOR( l = 0; l < i_mult( 3, num_freq_bands ); l += num_freq_bands ) /* Note: There are always 3 decorrelator prototypes in this function */ -#else - FOR( l = 0; l < i_mult( num_proto, num_freq_bands ); l += num_freq_bands ) -#endif { Scale_sig32( proto_frame_f_fx + shl( l, 1 ), shl( s_min( CLDFB_NO_CHANNELS_HALF, num_freq_bands ), 1 ), sub( min_q_shift[1], min_q_shift[0] ) ); } @@ -2876,11 +2819,7 @@ void protoSignalComputation2_fx( } ELSE { -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI FOR( l = 0; l < i_mult( 3, num_freq_bands ); l += num_freq_bands ) /* Note: There are always 3 decorrelator prototypes in this function */ -#else - FOR( l = 0; l < i_mult( num_proto, num_freq_bands ); l += num_freq_bands ) -#endif { Scale_sig32( proto_frame_f_fx + shl( add( l, CLDFB_NO_CHANNELS_HALF ), 1 ), shl( s_max( 0, sub( num_freq_bands, CLDFB_NO_CHANNELS_HALF ) ), 1 ), sub( min_q_shift[0], min_q_shift[1] ) ); } diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index d8c2eec79..2eba6449a 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -8979,7 +8979,6 @@ static void copyMasaMetadataToDiracRenderer_fx( { FOR( bin = MASA_band_grouping_24[band]; bin < MASA_band_grouping_24[band + 1] && bin < maxBin; bin++ ) { -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI IF( meta->directional_meta[0].azimuth_fx[sf][band] < 0 ) { hSpatParamRendCom->azimuth[meta_write_index][bin] = negate( extract_l( L_shr( L_negate( meta->directional_meta[0].azimuth_fx[sf][band] ), Q22 ) ) ); /* Q22 - Q22 = Q0 */ @@ -8988,11 +8987,7 @@ static void copyMasaMetadataToDiracRenderer_fx( { hSpatParamRendCom->azimuth[meta_write_index][bin] = extract_l( L_shr( meta->directional_meta[0].azimuth_fx[sf][band], Q22 ) ); } -#else - hSpatParamRendCom->azimuth[meta_write_index][bin] = extract_l( L_shr( meta->directional_meta[0].azimuth_fx[sf][band], Q22 ) ); /* Q22 - Q22 = Q0 */ -#endif move16(); -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI IF( meta->directional_meta[0].elevation_fx[sf][band] < 0 ) { hSpatParamRendCom->elevation[meta_write_index][bin] = negate( extract_l( L_shr( L_negate( meta->directional_meta[0].elevation_fx[sf][band] ), Q22 ) ) ); /* Q22 - Q22 = Q0 */ @@ -9001,9 +8996,6 @@ static void copyMasaMetadataToDiracRenderer_fx( { hSpatParamRendCom->elevation[meta_write_index][bin] = extract_l( L_shr( meta->directional_meta[0].elevation_fx[sf][band], Q22 ) ); } -#else - hSpatParamRendCom->elevation[meta_write_index][bin] = extract_l( L_shr( meta->directional_meta[0].elevation_fx[sf][band], Q22 ) ); /* Q22 - Q22 = Q0 */ -#endif move16(); hSpatParamRendCom->energy_ratio1_fx[meta_write_index][bin] = meta->directional_meta[0].energy_ratio_fx[sf][band]; move32(); @@ -9016,7 +9008,6 @@ static void copyMasaMetadataToDiracRenderer_fx( IF( EQ_16( hSpatParamRendCom->numSimultaneousDirections, 2 ) ) { -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI IF( meta->directional_meta[1].azimuth_fx[sf][band] < 0 ) { hSpatParamRendCom->azimuth2[meta_write_index][bin] = negate( extract_l( L_shr( L_negate( meta->directional_meta[1].azimuth_fx[sf][band] ), Q22 ) ) ); /* Q22 - Q22 = Q0 */ @@ -9025,11 +9016,7 @@ static void copyMasaMetadataToDiracRenderer_fx( { hSpatParamRendCom->azimuth2[meta_write_index][bin] = extract_l( L_shr( meta->directional_meta[1].azimuth_fx[sf][band], Q22 ) ); } -#else - hSpatParamRendCom->azimuth2[meta_write_index][bin] = extract_l( L_shr( meta->directional_meta[1].azimuth_fx[sf][band], Q22 ) ); /* Q22 - Q22 = Q0 */ -#endif move16(); -#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI IF( meta->directional_meta[1].elevation_fx[sf][band] < 0 ) { hSpatParamRendCom->elevation2[meta_write_index][bin] = negate( extract_l( L_shr( L_negate( meta->directional_meta[1].elevation_fx[sf][band] ), Q22 ) ) ); /* Q22 - Q22 = Q0 */ @@ -9038,9 +9025,6 @@ static void copyMasaMetadataToDiracRenderer_fx( { hSpatParamRendCom->elevation2[meta_write_index][bin] = extract_l( L_shr( meta->directional_meta[1].elevation_fx[sf][band], Q22 ) ); } -#else - hSpatParamRendCom->elevation2[meta_write_index][bin] = extract_l( L_shr( meta->directional_meta[1].elevation_fx[sf][band], Q22 ) ); /* Q22 - Q22 = Q0 */ -#endif move16(); hSpatParamRendCom->energy_ratio2_fx[meta_write_index][bin] = meta->directional_meta[1].energy_ratio_fx[sf][band]; move32(); -- GitLab From 0c6111592a65f6e6c9bc579b974a670af276f322 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 9 Jun 2026 22:08:08 +0200 Subject: [PATCH 6/7] [cleanup] accept FIX_FMSW_DEC_EXT --- apps/decoder.c | 16 ---------------- lib_com/options.h | 1 - 2 files changed, 17 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 3180647b1..6b43b12d1 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -163,9 +163,7 @@ static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE *phIvasDec, int16_t *pcmBuf ); static ivas_error load_hrtf_from_file( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const IVAS_AUDIO_CONFIG OutputConfig, const int32_t output_Fs ); static void do_object_editing_fx( IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader ); -#ifdef FIX_FMSW_DEC_EXT static ivas_error updateOnFormatSwitching( IVAS_DEC_HANDLE hIvasDec, IVAS_DEC_BS_FORMAT *pBsFormat, const char *outputWavFilename, MasaFileWriter **ppMasaWriter, IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS], int16_t *pNumOutChannels, uint16_t *pNumObj, const bool delayCompensationEnabled ); -#endif /*------------------------------------------------------------------------------------------* @@ -2027,11 +2025,7 @@ static ivas_error decodeG192( int16_t isSplitRend, isSplitCoded; IVAS_RENDER_CONFIG_DATA renderConfig; RenderConfigReader *renderConfigReader = NULL; -#ifdef FIX_FMSW_DEC_EXT bool restartNeeded = false; -#else - bool restartNeeded; -#endif #ifdef VARIABLE_SPEED_DECODING if ( arg.tsmEnabled ) @@ -2418,7 +2412,6 @@ static ivas_error decodeG192( } } -#ifdef FIX_FMSW_DEC_EXT /* Output writing update in case of format switching and EXTERNAL output */ if ( restartNeeded && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) { @@ -2428,7 +2421,6 @@ static ivas_error decodeG192( goto cleanup; } } -#endif /* Write current frame */ if ( decodedGoodFrame ) @@ -2823,11 +2815,7 @@ static ivas_error decodeVoIP( int16_t i; IVAS_DEC_HANDLE hIvasDec = *phIvasDec; -#ifdef FIX_FMSW_DEC_EXT bool restartNeeded = false; -#else - bool restartNeeded; -#endif IVAS_RTP ivasRtp = { 0 }; IVAS_RTP srRtp = { 0 }; IVAS_RTP_SR_INFO srInfo = { true, false, 0, 20, IVAS_SR_TRANSPORT_LCLD }; @@ -3314,7 +3302,6 @@ static ivas_error decodeVoIP( } } -#ifdef FIX_FMSW_DEC_EXT /* Output writing update in case of format switching and EXTERNAL output */ if ( restartNeeded && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) { @@ -3324,7 +3311,6 @@ static ivas_error decodeVoIP( goto cleanup; } } -#endif /* Write current frame */ if ( !srRtp.hPack && decodedGoodFrame ) @@ -3934,7 +3920,6 @@ static ivas_error load_hrtf_from_file( return IVAS_ERR_OK; } -#ifdef FIX_FMSW_DEC_EXT /*---------------------------------------------------------------------* * updateOnFormatSwitching() @@ -4008,6 +3993,5 @@ static ivas_error updateOnFormatSwitching( return IVAS_ERR_OK; } -#endif #undef WMC_TOOL_SKIP diff --git a/lib_com/options.h b/lib_com/options.h index 7856500e0..f37a0c7a8 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -94,7 +94,6 @@ /* any switch which is non-be wrt. TS 26.251 V3.0 */ #define FIX_1576_LCLD_CRASH_DIFFERENT_CODEC_ISAR_FRAME_SIZE /* Dolby: float issue 1576: fix for crash in LCLD mode when codec frame size is less than isar frame size */ -#define FIX_FMSW_DEC_EXT /* float issue 1566: fix EXT output in format switching */ #define FIX_BASOP_2612_RESET_DECIM_MEM /* FhG: BASOP #2612: reset (zero) the 16k resampler memory of the secondary channel on DFT->TD stereo switch (otherwise -> fx overshoot) */ #define FIX_BASOP_2621_STEREO_CNG_NOISY_SPEECH_QSHIFT /* FhG: BASOP #2621: stereo_dft_generate_comfort_noise_fx flag_noisy_speech: compare (lp_speech-lp_noise) Q23 diff against 28.0 in Q23 (was vs integer 28 with q_lp_noise=0) */ #define FIX_ISSUE_2618_PLC_RES_ATT_SCALING /* FhG: BASOP #2618: residual PLC burst attenuation, apply divide/Sqrt32 exponent so fac tracks exponent correctly */ -- GitLab From 72b0909fd487421afda837a967032754ec4d5d9b Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 9 Jun 2026 22:09:39 +0200 Subject: [PATCH 7/7] formatting --- lib_rend/ivas_dirac_rend_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_dirac_rend_fx.c b/lib_rend/ivas_dirac_rend_fx.c index d6ad29d8f..994e61c4b 100644 --- a/lib_rend/ivas_dirac_rend_fx.c +++ b/lib_rend/ivas_dirac_rend_fx.c @@ -2651,7 +2651,7 @@ void protoSignalComputation2_fx( temp = BASOP_Util_Divide3232_Scale_newton( lr_hi_power_fx, denom_fx, &exp ); exp = sub( 31, add( sub( 31, exp ), sub( q_lr_hi_power, q_denom ) ) ); - exp = s_min( exp, 0 ); /* 2*min(l,r) <= l+r so we can clamp ratio <= 1 */ + exp = s_min( exp, 0 ); /* 2*min(l,r) <= l+r so we can clamp ratio <= 1 */ temp = BASOP_Util_Log2( temp ); // q25 IF( NE_32( temp, MIN_32 ) ) { -- GitLab