From aa60804e8aa20f57e493056d4077763291063d1c Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 17 Jun 2026 09:46:12 +0200 Subject: [PATCH 1/8] [cleanup] accept FIX_BASOP_2620_ICBWE_GSMAPPING_DEAD_CLAMP --- lib_com/options.h | 1 - lib_enc/ivas_stereo_icbwe_enc_fx.c | 24 ------------------------ 2 files changed, 25 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index e506d6b65..377045777 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_2620_ICBWE_GSMAPPING_DEAD_CLAMP /* FhG: remove dead (always-overwritten) gsMapping clamp in ic_bwe_enc_gsMapping_fx; float ref has no clamp */ #define FIX_BASOP_2626_RC_UNI_DEC_READ_BITS_HANG /* FhG: BASOP #2626: rc_uni_dec_read_bits: replace loop counter tmp with UWord64; with UWord32 the division-substitute loop (tmp <= low) never terminates after the bit-error sentinel sets rc_low=0xFFFFFFFF -> decoder hang on corrupted bitstreams */ /* #################### End BE switches ################################## */ diff --git a/lib_enc/ivas_stereo_icbwe_enc_fx.c b/lib_enc/ivas_stereo_icbwe_enc_fx.c index ee31ada4b..113dc64b3 100644 --- a/lib_enc/ivas_stereo_icbwe_enc_fx.c +++ b/lib_enc/ivas_stereo_icbwe_enc_fx.c @@ -373,18 +373,6 @@ static Word16 ic_bwe_enc_gsMapping_fx( /* quantize the IC-BWE GS mapping*/ IF( EQ_16( element_mode, IVAS_CPE_TD ) ) { -#ifndef FIX_BASOP_2620_ICBWE_GSMAPPING_DEAD_CLAMP - IF( LT_32( temp2_fx32, -( 2 << 25 ) ) ) - { - temp2_fx = -( 2 << 12 ); // Q12 - move16(); - } - ELSE IF( GT_32( temp2_fx32, 1 << 25 ) ) - { - temp2_fx = 1 << 12; // Q12 - move16(); - } -#endif temp2_fx = extract_h( L_shl_sat( temp2_fx32, Q3 ) ); // Q12 gsMapping_fx16 = 0; @@ -393,18 +381,6 @@ static Word16 ic_bwe_enc_gsMapping_fx( } ELSE { -#ifndef FIX_BASOP_2620_ICBWE_GSMAPPING_DEAD_CLAMP - IF( LT_32( temp2_fx32, -( 5 << 25 ) ) ) - { - temp2_fx = -( 5 << 12 ); // Q12 - move16(); - } - ELSE IF( GT_32( temp2_fx32, 1 << 25 ) ) - { - temp2_fx = 1 << 12; // Q12 - move16(); - } -#endif temp2_fx = extract_h( L_shl_sat( temp2_fx32, Q3 ) ); // Q12 gsMapping_fx16 = 0; -- GitLab From 0bc8e39c334587dc681b56bf71f965f22f7fe13a Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 17 Jun 2026 09:46:52 +0200 Subject: [PATCH 2/8] [cleanup] accept FIX_BASOP_2626_RC_UNI_DEC_READ_BITS_HANG --- lib_com/options.h | 1 - lib_dec/ivas_range_uni_dec_fx.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 377045777..7688dcb8a 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_2626_RC_UNI_DEC_READ_BITS_HANG /* FhG: BASOP #2626: rc_uni_dec_read_bits: replace loop counter tmp with UWord64; with UWord32 the division-substitute loop (tmp <= low) never terminates after the bit-error sentinel sets rc_low=0xFFFFFFFF -> decoder hang on corrupted bitstreams */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_range_uni_dec_fx.c b/lib_dec/ivas_range_uni_dec_fx.c index aa16565f6..b53b72cef 100644 --- a/lib_dec/ivas_range_uni_dec_fx.c +++ b/lib_dec/ivas_range_uni_dec_fx.c @@ -380,11 +380,7 @@ UWord16 rc_uni_dec_read_bits( UWord32 val; UWord32 low; /* local copy (2 to 6 uses) */ UWord32 range; /* local copy (4 to 7 uses) */ -#ifdef FIX_BASOP_2626_RC_UNI_DEC_READ_BITS_HANG UWord64 tmp; -#else - UWord32 tmp; -#endif low = rc_st_dec->rc_low; /*Q0*/ range = rc_st_dec->rc_range; /*Q0*/ move32(); -- GitLab From af62629614c7ba99813d5018741751b8baddd1a3 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 17 Jun 2026 09:47:31 +0200 Subject: [PATCH 3/8] [cleanup] accept FIX_BASOP_2612_RESET_DECIM_MEM --- lib_com/options.h | 1 - lib_enc/ivas_stereo_switching_enc_fx.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 7688dcb8a..83fca9b32 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -93,7 +93,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_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 */ #define NONBE_FIX2614_LP_CNG_ASSERT /* FhG: */ diff --git a/lib_enc/ivas_stereo_switching_enc_fx.c b/lib_enc/ivas_stereo_switching_enc_fx.c index a56085d0f..57f1c4fac 100644 --- a/lib_enc/ivas_stereo_switching_enc_fx.c +++ b/lib_enc/ivas_stereo_switching_enc_fx.c @@ -853,9 +853,7 @@ void stereo_switching_enc_fx( /* no secondary channel in the previous frame -> memory resets */ set16_fx( sts[1]->old_inp_12k8_fx, 0, L_INP_MEM ); -#ifdef FIX_BASOP_2612_RESET_DECIM_MEM set16_fx( sts[1]->mem_decim16k_fx, 0, 2 * L_FILT_MAX ); -#endif set16_fx( sts[1]->mem_decim_fx, 0, 2 * L_FILT_MAX ); sts[1]->q_mem_decim_fx = Q15; move16(); -- GitLab From 9a3b899d16408924b1f6fa2579697054f4cdf13b Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 17 Jun 2026 09:48:05 +0200 Subject: [PATCH 4/8] [cleanup] accept FIX_BASOP_2621_STEREO_CNG_NOISY_SPEECH_QSHIFT --- lib_com/options.h | 1 - lib_dec/ivas_stereo_cng_dec_fx.c | 8 -------- lib_dec/stat_dec.h | 6 ------ 3 files changed, 15 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 83fca9b32..26261a0cf 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -93,7 +93,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_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 */ #define NONBE_FIX2614_LP_CNG_ASSERT /* FhG: */ #define FIX_FLOAT_1600_OMASA_WRONG_RENDER_PATH /* Nokia: float issue 1600: fix initialization condition of stereo type detection for OMASA */ diff --git a/lib_dec/ivas_stereo_cng_dec_fx.c b/lib_dec/ivas_stereo_cng_dec_fx.c index 19ab714e9..bd7deb033 100644 --- a/lib_dec/ivas_stereo_cng_dec_fx.c +++ b/lib_dec/ivas_stereo_cng_dec_fx.c @@ -775,10 +775,6 @@ static void stereo_dft_generate_comfort_noise_fx( } ELSE IF( ( chan == 0 ) ) { -#ifndef FIX_BASOP_2621_STEREO_CNG_NOISY_SPEECH_QSHIFT - Word16 q_lp_noise = 0; // st->hFdCngDec->q_lp_noise; // to be populated appropriately. - move16(); -#endif Word32 log_lp_noise = L_add( L_shl( lp_noise_e, Q25 ), BASOP_Util_Log2( L_add( lp_noise, DELTA_FX ) ) ); /* Q25 */ // log10(x) is computed as log2(x) * log10(2) // log_lp_noise at this stage is in Q25. where as the structure value is in Q23 @@ -788,11 +784,7 @@ static void stereo_dft_generate_comfort_noise_fx( move32(); st->lp_noise = st->hFdCngDec->lp_noise; /* Q23 */ move32(); -#ifdef FIX_BASOP_2621_STEREO_CNG_NOISY_SPEECH_QSHIFT st->hFdCngDec->hFdCngCom->flag_noisy_speech = extract_l( LT_32( L_sub( st->hFdCngDec->lp_speech, st->hFdCngDec->lp_noise ), 234881024 /* 28.0f in Q23 */ ) ); /* Q0 */ -#else - st->hFdCngDec->hFdCngCom->flag_noisy_speech = extract_l( LT_32( L_shr( L_sub( st->hFdCngDec->lp_speech, st->hFdCngDec->lp_noise ), q_lp_noise ), 28 ) ); /* Q0 */ -#endif move16(); st->hFdCngDec->hFdCngCom->likelihood_noisy_speech = add( mult_r( 32440 /* 0.99 in Q15 */, st->hFdCngDec->hFdCngCom->likelihood_noisy_speech ), mult_r( 328 /* 0.01 in Q15 */, st->hFdCngDec->hFdCngCom->flag_noisy_speech ) ); /* Q15 */ diff --git a/lib_dec/stat_dec.h b/lib_dec/stat_dec.h index 885af0c03..c771907ed 100644 --- a/lib_dec/stat_dec.h +++ b/lib_dec/stat_dec.h @@ -137,14 +137,8 @@ typedef struct Word16 flag_dtx_mode; Word32 lp_speech; /* format: Q9.23 */ -#ifndef FIX_BASOP_2621_STEREO_CNG_NOISY_SPEECH_QSHIFT - Word16 q_lp_speech; -#endif Word32 lp_noise; /* format: Q9.23 */ -#ifndef FIX_BASOP_2621_STEREO_CNG_NOISY_SPEECH_QSHIFT - Word16 q_lp_noise; -#endif Word16 msPeriodogBuf[MSBUFLEN * NPART_SHAPING]; -- GitLab From 2483db0aa3fbc1adf455d57440ae6b100a9ef651 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 17 Jun 2026 09:48:50 +0200 Subject: [PATCH 5/8] [cleanup] accept FIX_ISSUE_2618_PLC_RES_ATT_SCALING --- lib_com/options.h | 1 - lib_dec/ivas_stereo_dft_plc_fx.c | 15 --------------- 2 files changed, 16 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 26261a0cf..4b8d3dc1e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -93,7 +93,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_ISSUE_2618_PLC_RES_ATT_SCALING /* FhG: BASOP #2618: residual PLC burst attenuation, apply divide/Sqrt32 exponent so fac tracks exponent correctly */ #define NONBE_FIX2614_LP_CNG_ASSERT /* FhG: */ #define FIX_FLOAT_1600_OMASA_WRONG_RENDER_PATH /* Nokia: float issue 1600: fix initialization condition of stereo type detection for OMASA */ #define FIX_BASOP_1765_MASA1TC_CNG_MISMATCH /* Nokia: BASOP issue 1765: Improve accuracy of FD CNG noise estimation */ diff --git a/lib_dec/ivas_stereo_dft_plc_fx.c b/lib_dec/ivas_stereo_dft_plc_fx.c index 0ea6c33e5..078687023 100644 --- a/lib_dec/ivas_stereo_dft_plc_fx.c +++ b/lib_dec/ivas_stereo_dft_plc_fx.c @@ -738,37 +738,22 @@ void stereo_dft_res_ecu_burst_att_fx( ) { Word32 fac; -#ifndef FIX_ISSUE_2618_PLC_RES_ATT_SCALING - Word16 q_fac; -#endif Word16 exponent; -#ifndef FIX_ISSUE_2618_PLC_RES_ATT_SCALING - q_fac = 0; - move16(); -#endif exponent = 0; move16(); /* attenuation of residual; follow attenuation of DMX */ IF( hStereoDft->core_hist[0] == ACELP_CORE ) { -#ifdef FIX_ISSUE_2618_PLC_RES_ATT_SCALING fac = L_deposit_h( BASOP_Util_Divide3232_Scale( dmx_nrg, hStereoDft->past_dmx_nrg_fx, &exponent ) ); fac = Sqrt32( fac, &exponent ); fac = Mpy_32_16_1( fac, (Word16) ( 0x0CCD ) ); /* * 0.1f (Q15) */ fac = L_shl_sat( fac, exponent ); /* Q31 */ -#else - fac = Mpy_32_16_1( Sqrt32( L_deposit_h( BASOP_Util_Divide3232_Scale( dmx_nrg, hStereoDft->past_dmx_nrg_fx, &q_fac ) ), &exponent ), (Word16) ( 0x0CCD ) ); /* Q0 */ -#endif } ELSE { -#ifdef FIX_ISSUE_2618_PLC_RES_ATT_SCALING fac = L_sub( MAX_32, L_deposit_h( BASOP_Util_Divide3232_Scale( L_sub( hStereoDft->time_offs, L_ana ), L_add( hStereoDft->time_offs, L_ana ), &exponent ) ) ); /* Q31 */ -#else - fac = L_sub( MAX_32, L_deposit_h( BASOP_Util_Divide3232_Scale( L_sub( hStereoDft->time_offs, L_ana ), L_add( hStereoDft->time_offs, L_ana ), &q_fac ) ) ); /* Q0 */ -#endif } v_multc_fx( pDFT_RES, fac, pDFT_RES, shl( L_res, 1 ) ); -- GitLab From 4435371323280e3165d57278e23e1d0de5af43db Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 17 Jun 2026 09:49:30 +0200 Subject: [PATCH 6/8] [cleanup] accept NONBE_FIX2614_LP_CNG_ASSERT --- lib_com/options.h | 1 - lib_dec/ivas_stereo_cng_dec_fx.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 4b8d3dc1e..ee75ed28b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -93,7 +93,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 NONBE_FIX2614_LP_CNG_ASSERT /* FhG: */ #define FIX_FLOAT_1600_OMASA_WRONG_RENDER_PATH /* Nokia: float issue 1600: fix initialization condition of stereo type detection for OMASA */ #define FIX_BASOP_1765_MASA1TC_CNG_MISMATCH /* Nokia: BASOP issue 1765: Improve accuracy of FD CNG noise estimation */ #define FIX_BASOP_2627_PARAM_MC_ILD_REMAP_EXP /* FhG: BASOP #2627: accumulate 10^(ILD/10) using a dynamic exponent */ diff --git a/lib_dec/ivas_stereo_cng_dec_fx.c b/lib_dec/ivas_stereo_cng_dec_fx.c index bd7deb033..aa1d996ee 100644 --- a/lib_dec/ivas_stereo_cng_dec_fx.c +++ b/lib_dec/ivas_stereo_cng_dec_fx.c @@ -345,9 +345,7 @@ static void stereo_dft_generate_comfort_noise_fx( { q_cngNoiseLevel_upd = s_min( q_cngNoiseLevel_upd, add( e_norm_temp[i], norm_l( cngNoiseLevel_upd[i] ) ) ); } -#ifdef NONBE_FIX2614_LP_CNG_ASSERT q_cngNoiseLevel_upd = s_min( q_cngNoiseLevel_upd, sub( 31, shr( st->hFdCngDec->bandNoiseShape_exp, 1 ) ) ); -#endif FOR( i = 0; i < st->L_frame; i++ ) { cngNoiseLevel_upd[i] = L_shl( cngNoiseLevel_upd[i], sub( q_cngNoiseLevel_upd, e_norm_temp[i] ) ); -- GitLab From f52dbd2a5a63b72464f12df85220ab37cefa17c3 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 17 Jun 2026 09:50:13 +0200 Subject: [PATCH 7/8] [cleanup] accept FIX_BASOP_1765_MASA1TC_CNG_MISMATCH --- lib_com/basop_util.c | 16 ---------------- lib_com/basop_util.h | 4 ---- lib_com/options.h | 1 - lib_com/prot_fx.h | 4 ---- lib_dec/acelp_core_dec_fx.c | 4 ---- lib_dec/amr_wb_dec_fx.c | 4 ---- lib_dec/evs_dec_fx.c | 4 ---- lib_dec/fd_cng_dec_fx.c | 16 ---------------- lib_dec/ivas_stereo_mdct_core_dec_fx.c | 4 ---- lib_dec/ivas_tcx_core_dec_fx.c | 4 ---- 10 files changed, 61 deletions(-) diff --git a/lib_com/basop_util.c b/lib_com/basop_util.c index 3b1a0cf21..6df02f0ca 100644 --- a/lib_com/basop_util.c +++ b/lib_com/basop_util.c @@ -2720,19 +2720,14 @@ Word32 dotWord32_16_Mant32Exp( const Word32 *bufX32, /* i: 32-bit buffer with un const Word16 *bufY16, /* i: 16-bit buffer quite right-aligned */ Word16 bufY16_exp, /* i: exponent of buffer bufY16 */ Word16 len, /* i: buffer len to process */ -#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH Word16 *exp, /* o: result exponent */ const Word16 is_ivas ) /* i: flag indicating IVAS to maintain EVS BE */ -#else - Word16 *exp ) /* o: result exponent */ -#endif { Word32 L_sum; Word16 shift, shift1, i; shift = getScaleFactor32( bufX32, len ); /* current available headroom */ -#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH IF( EQ_16( is_ivas, 1 ) ) { shift = sub( shift, sub( 15, norm_s( len ) ) ); /* reduced required headroom */ @@ -2741,14 +2736,10 @@ Word32 dotWord32_16_Mant32Exp( const Word32 *bufX32, /* i: 32-bit buffer with un { shift = sub( shift, sub( 14, norm_s( len ) ) ); /* reduced required headroom */ } -#else - shift = sub( shift, sub( 14, norm_s( len ) ) ); /* reduced required headroom */ -#endif L_sum = 0; /* Clear accu */ move32(); FOR( i = 0; i < len; i++ ) { -#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH IF( EQ_16( is_ivas, 1 ) ) { L_sum = L_add( L_sum, Mpy_32_16_1( L_shl( bufX32[i], shift ), bufY16[i] ) ); @@ -2757,22 +2748,15 @@ Word32 dotWord32_16_Mant32Exp( const Word32 *bufX32, /* i: 32-bit buffer with un { L_sum = L_mac0( L_sum, round_fx( L_shl( bufX32[i], shift ) ), bufY16[i] ); } -#else - L_sum = L_mac0( L_sum, round_fx( L_shl( bufX32[i], shift ) ), bufY16[i] ); -#endif } shift1 = norm_l( L_sum ); L_sum = L_shl( L_sum, shift1 ); /* return value */ shift = sub( add( bufX32_exp, bufY16_exp ), add( shift, shift1 ) ); -#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH IF( EQ_16( is_ivas, 0 ) ) { shift = add( shift, 1 ); /* compensate for factor of 2 introduced by L_mac0 */ } -#else - shift = add( shift, 1 ); /* compensate for factor of 2 introduced by L_mac0 */ -#endif /* In case of NULL result, we want to have a 0 exponent too */ if ( L_sum == 0 ) shift = 0; diff --git a/lib_com/basop_util.h b/lib_com/basop_util.h index 19b0bb4aa..c0cb9289b 100644 --- a/lib_com/basop_util.h +++ b/lib_com/basop_util.h @@ -864,12 +864,8 @@ Word32 dotWord32_16_Mant32Exp( const Word32 *bufX32, /* i: 32-bit buffer with un const Word16 *bufY16, /* i: 16-bit buffer quite right-aligned */ Word16 bufY16_exp, /* i: exponent of buffer bufY16 */ Word16 len, /* i: buffer len to process */ -#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH Word16 *exp, /* o: result exponent */ const Word16 is_ivas ); /* i: flag indicating IVAS to maintain EVS BE */ -#else - Word16 *exp ); /* o: result exponent */ -#endif /*!********************************************************************** \brief Converts linear factor or energy to Decibel diff --git a/lib_com/options.h b/lib_com/options.h index ee75ed28b..64354c999 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -94,7 +94,6 @@ #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_FLOAT_1600_OMASA_WRONG_RENDER_PATH /* Nokia: float issue 1600: fix initialization condition of stereo type detection for OMASA */ -#define FIX_BASOP_1765_MASA1TC_CNG_MISMATCH /* Nokia: BASOP issue 1765: Improve accuracy of FD CNG noise estimation */ #define FIX_BASOP_2627_PARAM_MC_ILD_REMAP_EXP /* FhG: BASOP #2627: accumulate 10^(ILD/10) using a dynamic exponent */ #define FIX_BASOP_2635_EFAP_ADD_VERTEX_ELE_ROUND /* FhG: BASOP #2635: round |elevation| with anint_fx before the 90deg subtraction in add_vertex_fx */ diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index b7b0edaf7..513f5f588 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -6420,12 +6420,8 @@ void noisy_speech_detection_fx( HANDLE_FD_CNG_DEC hFdCngDec, /* i/o: FD_CNG structure */ const Word16 vad, /* i : VAD flag */ const Word16 *syn, /* i : i time-domain frame */ -#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH const Word16 Q, const Word16 is_ivas ); -#else - const Word16 Q ); -#endif void generate_comfort_noise_dec_fx( Word32 **bufferReal, /* o : matrix to real part of i bands */ diff --git a/lib_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index cdb551e70..860bd3b4a 100644 --- a/lib_dec/acelp_core_dec_fx.c +++ b/lib_dec/acelp_core_dec_fx.c @@ -1549,7 +1549,6 @@ ivas_error acelp_core_dec_fx( IF( st->idchan == 0 && ( st->flag_cna || ( EQ_16( st->cng_type, FD_CNG ) && LE_32( st->total_brate, ACELP_32k ) ) || ( st->cng_type == LP_CNG && LE_32( st->core_brate, SID_2k40 ) ) ) ) { /*Noisy speech detector*/ -#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH IF( NE_16( st->element_mode, EVS_MONO ) ) { noisy_speech_detection_fx( st->hFdCngDec, st->VAD, psyn_fx, st->Q_syn, 1 ); @@ -1558,9 +1557,6 @@ ivas_error acelp_core_dec_fx( { noisy_speech_detection_fx( st->hFdCngDec, st->VAD, psyn_fx, st->Q_syn, 0 ); } -#else - noisy_speech_detection_fx( st->hFdCngDec, st->VAD, psyn_fx, st->Q_syn ); -#endif st->hFdCngDec->hFdCngCom->likelihood_noisy_speech = mult_r( st->hFdCngDec->hFdCngCom->likelihood_noisy_speech, 32440 /*0.99 Q15*/ ); move16(); diff --git a/lib_dec/amr_wb_dec_fx.c b/lib_dec/amr_wb_dec_fx.c index fbe877f58..7a09a045a 100644 --- a/lib_dec/amr_wb_dec_fx.c +++ b/lib_dec/amr_wb_dec_fx.c @@ -798,11 +798,7 @@ ivas_error amr_wb_dec_fx( move16(); /*Noisy speech detector*/ -#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH noisy_speech_detection_fx( st_fx->hFdCngDec, st_fx->VAD, syn_fx, st_fx->Q_syn, 0 ); -#else - noisy_speech_detection_fx( st_fx->hFdCngDec, st_fx->VAD, syn_fx, st_fx->Q_syn ); -#endif st_fx->hFdCngDec->hFdCngCom->likelihood_noisy_speech = mult_r( st_fx->hFdCngDec->hFdCngCom->likelihood_noisy_speech, 32440 /*0.99 Q15*/ ); IF( st_fx->hFdCngDec->hFdCngCom->flag_noisy_speech != 0 ) diff --git a/lib_dec/evs_dec_fx.c b/lib_dec/evs_dec_fx.c index 85fde0949..dcd02af80 100644 --- a/lib_dec/evs_dec_fx.c +++ b/lib_dec/evs_dec_fx.c @@ -940,11 +940,7 @@ ivas_error evs_dec_fx( * -------------------------------------------------------------- */ HANDLE_FD_CNG_DEC hFdCngDec = st_fx->hFdCngDec; -#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH noisy_speech_detection_fx( st_fx->hFdCngDec, st_fx->VAD && EQ_16( st_fx->m_frame_type, ACTIVE_FRAME ), output_sp, 0, 0 ); -#else - noisy_speech_detection_fx( st_fx->hFdCngDec, st_fx->VAD && EQ_16( st_fx->m_frame_type, ACTIVE_FRAME ), output_sp, 0 ); -#endif hFdCngDec->hFdCngCom->likelihood_noisy_speech = mult_r( hFdCngDec->hFdCngCom->likelihood_noisy_speech, 32440 /*0.99 Q15*/ ); /*Q15*/ if ( hFdCngDec->hFdCngCom->flag_noisy_speech != 0 ) diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index 6e9e94807..fbe73cc9c 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -1481,11 +1481,7 @@ void perform_noise_estimation_dec_ivas_fx( FOR( p = 0; p < npart; p++ ) { temp = L_shl( msPeriodog[p], q_shift ); -#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH msNoiseEst[p] = Madd_32_16( Mpy_32_16_r( msNoiseEst[p], add( sub( MAX_16, alpha ), 1 ) ), temp, alpha ); /*Q31 - hFdCngDec->msNoiseEst_exp*/ /* add one to alpha comp to get ONE_IN_Q15 - alpha */ -#else - msNoiseEst[p] = Madd_32_16( Mpy_32_16_r( msNoiseEst[p], sub( MAX_16, alpha ) ), temp, alpha ); /*Q31 - hFdCngDec->msNoiseEst_exp*/ -#endif move32(); } } @@ -1685,11 +1681,7 @@ void perform_noise_estimation_dec_ivas_fx( move16(); } } -#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH *ptr_per = Madd_32_16( ( *ptr_per ), enr, add( sub( MAX_16, alpha ), 1 ) ); /*Q31 - enr_e*/ /* add one to alpha comp to get ONE_IN_Q15 - alpha */ -#else - *ptr_per = Madd_32_16( ( *ptr_per ), enr, sub( MAX_16, alpha ) ); /*Q31 - enr_e*/ -#endif move32(); ptr_per++; } @@ -2101,12 +2093,8 @@ void noisy_speech_detection_fx( HANDLE_FD_CNG_DEC hFdCngDec, /* i/o: FD_CNG structure */ const Word16 vad, /*Q0*/ const Word16 *syn, /* i : input time-domain frame Q*/ -#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH const Word16 Q, const Word16 is_ivas ) -#else - const Word16 Q ) -#endif { Word16 i; Word32 tmp; @@ -2122,11 +2110,7 @@ void noisy_speech_detection_fx( IF( vad == 0 ) { -#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH totalNoise = dotWord32_16_Mant32Exp( hFdCngDec->msNoiseEst, hFdCngDec->msNoiseEst_exp, hFdCngDec->psize_shaping_norm, hFdCngDec->psize_shaping_norm_exp, hFdCngDec->nFFTpart_shaping, &totalNoise_exp, is_ivas ); /*Q31 - totalNoise_exp*/ -#else - totalNoise = dotWord32_16_Mant32Exp( hFdCngDec->msNoiseEst, hFdCngDec->msNoiseEst_exp, hFdCngDec->psize_shaping_norm, hFdCngDec->psize_shaping_norm_exp, hFdCngDec->nFFTpart_shaping, &totalNoise_exp ); /*Q31 - totalNoise_exp*/ -#endif /* - logTotalNoise is scaled by LD_DATA_SCALE+2 diff --git a/lib_dec/ivas_stereo_mdct_core_dec_fx.c b/lib_dec/ivas_stereo_mdct_core_dec_fx.c index d04d30a06..530ddde50 100644 --- a/lib_dec/ivas_stereo_mdct_core_dec_fx.c +++ b/lib_dec/ivas_stereo_mdct_core_dec_fx.c @@ -1023,11 +1023,7 @@ static void run_min_stats_fx( Copy_Scale_sig32_16( x[ch][0], x_fx_16, L_FRAME16k, 0 ); /* exp(x_e) */ test(); -#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH noisy_speech_detection_fx( st->hFdCngDec, save_VAD[ch] && EQ_16( st->m_frame_type, ACTIVE_FRAME ), x_fx_16, sub( Q15, x_e[ch][0] ), 1 ); -#else - noisy_speech_detection_fx( st->hFdCngDec, save_VAD[ch] && EQ_16( st->m_frame_type, ACTIVE_FRAME ), x_fx_16, sub( Q15, x_e[ch][0] ) ); -#endif st->hFdCngDec->hFdCngCom->likelihood_noisy_speech = add( mult_r( 32440 /* 0.99 in Q15 */, st->hFdCngDec->hFdCngCom->likelihood_noisy_speech ), mult_r( st->hFdCngDec->hFdCngCom->flag_noisy_speech, 328 /* 0.01 in Q15 */ ) ); /* Q15 */ move16(); st->lp_noise = st->hFdCngDec->lp_noise; /* Q9.23 */ diff --git a/lib_dec/ivas_tcx_core_dec_fx.c b/lib_dec/ivas_tcx_core_dec_fx.c index e3de33223..f81d46d99 100644 --- a/lib_dec/ivas_tcx_core_dec_fx.c +++ b/lib_dec/ivas_tcx_core_dec_fx.c @@ -833,11 +833,7 @@ void stereo_tcx_core_dec_fx( test(); IF( st->hFdCngDec != NULL && ( EQ_32( st->sr_core, INT_FS_12k8 ) || EQ_32( st->sr_core, INT_FS_16k ) ) && LE_32( st->total_brate, MAX_ACELP_BRATE ) ) { -#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH noisy_speech_detection_fx( st->hFdCngDec, st->VAD && EQ_16( st->m_frame_type, ACTIVE_FRAME ), signal_out_fx, 0, 1 ); -#else - noisy_speech_detection_fx( st->hFdCngDec, st->VAD && EQ_16( st->m_frame_type, ACTIVE_FRAME ), signal_out_fx, 0 ); -#endif st->hFdCngDec->hFdCngCom->likelihood_noisy_speech = add( mult_r( 32440 /* 0.99f in Q15 */, st->hFdCngDec->hFdCngCom->likelihood_noisy_speech ), mult_r( st->hFdCngDec->hFdCngCom->flag_noisy_speech, 328 /* 0.01f in Q15 */ ) ); /* Q15 */ st->lp_noise = st->hFdCngDec->lp_noise; /* Q9.23 */ move16(); -- GitLab From be81a482adcb4b30501b708c1c7c8a0089fd3e0d Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 17 Jun 2026 09:51:58 +0200 Subject: [PATCH 8/8] formatting --- lib_com/basop_util.c | 10 +++++----- lib_com/basop_util.h | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib_com/basop_util.c b/lib_com/basop_util.c index 6df02f0ca..8bc465e03 100644 --- a/lib_com/basop_util.c +++ b/lib_com/basop_util.c @@ -2715,11 +2715,11 @@ void bufferCopyFx( } } -Word32 dotWord32_16_Mant32Exp( const Word32 *bufX32, /* i: 32-bit buffer with unknown headroom */ - Word16 bufX32_exp, /* i: exponent of buffer bufX32 */ - const Word16 *bufY16, /* i: 16-bit buffer quite right-aligned */ - Word16 bufY16_exp, /* i: exponent of buffer bufY16 */ - Word16 len, /* i: buffer len to process */ +Word32 dotWord32_16_Mant32Exp( const Word32 *bufX32, /* i: 32-bit buffer with unknown headroom */ + Word16 bufX32_exp, /* i: exponent of buffer bufX32 */ + const Word16 *bufY16, /* i: 16-bit buffer quite right-aligned */ + Word16 bufY16_exp, /* i: exponent of buffer bufY16 */ + Word16 len, /* i: buffer len to process */ Word16 *exp, /* o: result exponent */ const Word16 is_ivas ) /* i: flag indicating IVAS to maintain EVS BE */ { diff --git a/lib_com/basop_util.h b/lib_com/basop_util.h index c0cb9289b..4e777ef39 100644 --- a/lib_com/basop_util.h +++ b/lib_com/basop_util.h @@ -859,11 +859,11 @@ void bufferCopyFx( \return Word32 result of accumulated multiplications over Word32 array arg1 and Word16 array arg3 and Word16 pointer to exponent of the result */ -Word32 dotWord32_16_Mant32Exp( const Word32 *bufX32, /* i: 32-bit buffer with unknown headroom */ - Word16 bufX32_exp, /* i: exponent of buffer bufX32 */ - const Word16 *bufY16, /* i: 16-bit buffer quite right-aligned */ - Word16 bufY16_exp, /* i: exponent of buffer bufY16 */ - Word16 len, /* i: buffer len to process */ +Word32 dotWord32_16_Mant32Exp( const Word32 *bufX32, /* i: 32-bit buffer with unknown headroom */ + Word16 bufX32_exp, /* i: exponent of buffer bufX32 */ + const Word16 *bufY16, /* i: 16-bit buffer quite right-aligned */ + Word16 bufY16_exp, /* i: exponent of buffer bufY16 */ + Word16 len, /* i: buffer len to process */ Word16 *exp, /* o: result exponent */ const Word16 is_ivas ); /* i: flag indicating IVAS to maintain EVS BE */ -- GitLab