From 77feee6825c5d67e83e3a8412967fcf8b2704319 Mon Sep 17 00:00:00 2001 From: gerstack Date: Thu, 5 Feb 2026 11:01:27 +0100 Subject: [PATCH 1/5] MR 2797 harmonize InitTnsConfiguration() --- lib_com/options.h | 2 +- lib_com/prot_fx.h | 2 ++ lib_com/tcx_utils_fx.c | 11 ++++++++++- lib_com/tns_base.c | 26 ++++++++++++++++++++++++++ 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 0ea316a82..13cd47ee5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -106,10 +106,10 @@ #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_2388_INITTNSCONFIGURATION /* FhG: issue 2388 : harmonizing InitTnsConfiguration() function */ #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 */ - /* #################### End BE switches ################################## */ /* #################### Start NON-BE switches ############################ */ diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index c45c2a749..625ecc1a3 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -3569,6 +3569,7 @@ Word32 DTFS_getEngy_band_wb_fx( Word16 lband, Word16 hband ); +#ifndef FIX_2388_INITTNSCONFIGURATION void InitTnsConfiguration( const Word16 bwidth, const Word16 frameLength, @@ -3577,6 +3578,7 @@ void InitTnsConfiguration( const Word32 total_brate, const Word16 element_mode, const Word16 is_mct ); +#endif void InitTnsConfiguration_ivas_fx( const Word16 bwidth, diff --git a/lib_com/tcx_utils_fx.c b/lib_com/tcx_utils_fx.c index f73fb5971..c71392b4b 100644 --- a/lib_com/tcx_utils_fx.c +++ b/lib_com/tcx_utils_fx.c @@ -1969,7 +1969,7 @@ void tcx_noise_filling_with_shift( /*--------------------------------------------------------------- - * InitTnsConfigs() + * () *--------------------------------------------------------------*/ @@ -1984,10 +1984,19 @@ void InitTnsConfigs( { IF( GT_32( total_brate, ACELP_32k ) ) { +#ifdef FIX_2388_INITTNSCONFIGURATION + InitTnsConfiguration_ivas_fx( bwidth, shr( L_frame, 1 ), &tnsConfig[0][0], igfStopFreq, total_brate, element_mode, MCT_flag ); +#else InitTnsConfiguration( bwidth, shr( L_frame, 1 ), &tnsConfig[0][0], igfStopFreq, total_brate, element_mode, MCT_flag ); +#endif } +#ifdef FIX_2388_INITTNSCONFIGURATION + InitTnsConfiguration_ivas_fx( bwidth, L_frame, &tnsConfig[1][0], igfStopFreq, total_brate, element_mode, MCT_flag ); + InitTnsConfiguration_ivas_fx( bwidth, add( L_frame, shr( L_frame, 2 ) ), &tnsConfig[1][1], igfStopFreq, total_brate, element_mode, MCT_flag ); +#else InitTnsConfiguration( bwidth, L_frame, &tnsConfig[1][0], igfStopFreq, total_brate, element_mode, MCT_flag ); InitTnsConfiguration( bwidth, add( L_frame, shr( L_frame, 2 ) ), &tnsConfig[1][1], igfStopFreq, total_brate, element_mode, MCT_flag ); +#endif } void InitTnsConfigs_ivas_fx( diff --git a/lib_com/tns_base.c b/lib_com/tns_base.c index 600b2e6fe..babf67cf2 100755 --- a/lib_com/tns_base.c +++ b/lib_com/tns_base.c @@ -72,6 +72,7 @@ static void ITF_GetFilterParameters_fx( Word32 rxx[], const Word16 maxOrder, Wor /* Interface functions */ /********************************/ +#ifndef FIX_2388_INITTNSCONFIGURATION /** Init TNS configuration. * Fills STnsConfig structure with sensible content. * @param nSampleRate Sampling rate of the input. @@ -196,6 +197,7 @@ void InitTnsConfiguration( } return; /*TNS_NO_ERROR;*/ } +#endif /* FIX_2388_INITTNSCONFIGURATION */ void InitTnsConfiguration_ivas_fx( const Word16 bwidth, /*Q0*/ @@ -235,7 +237,11 @@ void InitTnsConfiguration_ivas_fx( IF( LE_32( total_brate, ACELP_32k ) ) { move16(); +#ifdef FIX_2388_INITTNSCONFIGURATION + pTnsConfig->nMaxFilters = (UWord8) ( sizeof( tnsParametersIGF32kHz_LowBR ) / sizeof( tnsParametersIGF32kHz_LowBR[0] ) ); /*Q0*/ +#else pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParametersIGF32kHz_LowBR ), sizeof( tnsParametersIGF32kHz_LowBR[0] ) ); /*Q0*/ +#endif pTnsConfig->pTnsParameters = tnsParametersIGF32kHz_LowBR; } ELSE @@ -243,7 +249,11 @@ void InitTnsConfiguration_ivas_fx( test(); IF( GT_32( nSampleRate, 32000 ) && EQ_32( nSampleRate, L_mult0( 100, frameLength ) ) ) { +#ifdef FIX_2388_INITTNSCONFIGURATION + pTnsConfig->nMaxFilters = (UWord8) ( sizeof( tnsParameters48kHz_grouped ) / sizeof( tnsParameters48kHz_grouped[0] ) ); /*Q0*/ +#else pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParameters48kHz_grouped ), sizeof( tnsParameters48kHz_grouped[0] ) ); /*Q0*/ +#endif move16(); pTnsConfig->pTnsParameters = tnsParameters48kHz_grouped; } @@ -259,7 +269,11 @@ void InitTnsConfiguration_ivas_fx( test(); IF( GT_16( element_mode, IVAS_SCE ) && GE_32( total_brate, L_tmp ) ) { +#ifdef FIX_2388_INITTNSCONFIGURATION + pTnsConfig->nMaxFilters = (UWord8) ( sizeof( tnsParameters32kHz_Stereo ) / sizeof( tnsParameters32kHz_Stereo[0] ) ); /*Q0*/ +#else pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParameters32kHz_Stereo ), sizeof( tnsParameters32kHz_Stereo[0] ) ); /*Q0*/ +#endif move16(); IF( EQ_32( nSampleRate, L_mult0( 100, frameLength ) ) ) /* sub-frame length is <= 10 ms */ { @@ -274,7 +288,11 @@ void InitTnsConfiguration_ivas_fx( { move16(); +#ifdef FIX_2388_INITTNSCONFIGURATION + pTnsConfig->nMaxFilters = (UWord8) ( sizeof( tnsParameters32kHz ) / sizeof( tnsParameters32kHz[0] ) ); /*Q0*/ +#else pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParameters32kHz ), sizeof( tnsParameters32kHz[0] ) ); /*Q0*/ +#endif pTnsConfig->pTnsParameters = tnsParameters32kHz; @@ -289,13 +307,21 @@ void InitTnsConfiguration_ivas_fx( IF( EQ_32( nSampleRate, L_mult0( 100, frameLength ) ) ) /* sub-frame length is <= 10 ms */ { move16(); +#ifdef FIX_2388_INITTNSCONFIGURATION + pTnsConfig->nMaxFilters = (UWord8) ( sizeof( tnsParameters16kHz_grouped ) / sizeof( tnsParameters16kHz_grouped[0] ) ); /*Q0*/ +#else pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParameters16kHz_grouped ), sizeof( tnsParameters16kHz_grouped[0] ) ); /*Q0*/ +#endif pTnsConfig->pTnsParameters = tnsParameters16kHz_grouped; } ELSE { move16(); +#ifdef FIX_2388_INITTNSCONFIGURATION + pTnsConfig->nMaxFilters = (UWord8) ( sizeof( tnsParameters16kHz ) / sizeof( tnsParameters16kHz[0] ) ); /*Q0*/ +#else pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParameters16kHz ), sizeof( tnsParameters16kHz[0] ) ); /*Q0*/ +#endif pTnsConfig->pTnsParameters = tnsParameters16kHz; } } -- GitLab From 3b002cde3940c58b073ed84e5d65da868678232f Mon Sep 17 00:00:00 2001 From: gerstack Date: Thu, 5 Feb 2026 11:18:15 +0100 Subject: [PATCH 2/5] clang format --- lib_com/tns_base.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) mode change 100755 => 100644 lib_com/tns_base.c diff --git a/lib_com/tns_base.c b/lib_com/tns_base.c old mode 100755 new mode 100644 index babf67cf2..c0a7cd4e6 --- a/lib_com/tns_base.c +++ b/lib_com/tns_base.c @@ -240,7 +240,7 @@ void InitTnsConfiguration_ivas_fx( #ifdef FIX_2388_INITTNSCONFIGURATION pTnsConfig->nMaxFilters = (UWord8) ( sizeof( tnsParametersIGF32kHz_LowBR ) / sizeof( tnsParametersIGF32kHz_LowBR[0] ) ); /*Q0*/ #else - pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParametersIGF32kHz_LowBR ), sizeof( tnsParametersIGF32kHz_LowBR[0] ) ); /*Q0*/ + pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParametersIGF32kHz_LowBR ), sizeof( tnsParametersIGF32kHz_LowBR[0] ) ); /*Q0*/ #endif pTnsConfig->pTnsParameters = tnsParametersIGF32kHz_LowBR; } @@ -252,7 +252,7 @@ void InitTnsConfiguration_ivas_fx( #ifdef FIX_2388_INITTNSCONFIGURATION pTnsConfig->nMaxFilters = (UWord8) ( sizeof( tnsParameters48kHz_grouped ) / sizeof( tnsParameters48kHz_grouped[0] ) ); /*Q0*/ #else - pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParameters48kHz_grouped ), sizeof( tnsParameters48kHz_grouped[0] ) ); /*Q0*/ + pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParameters48kHz_grouped ), sizeof( tnsParameters48kHz_grouped[0] ) ); /*Q0*/ #endif move16(); pTnsConfig->pTnsParameters = tnsParameters48kHz_grouped; @@ -272,7 +272,7 @@ void InitTnsConfiguration_ivas_fx( #ifdef FIX_2388_INITTNSCONFIGURATION pTnsConfig->nMaxFilters = (UWord8) ( sizeof( tnsParameters32kHz_Stereo ) / sizeof( tnsParameters32kHz_Stereo[0] ) ); /*Q0*/ #else - pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParameters32kHz_Stereo ), sizeof( tnsParameters32kHz_Stereo[0] ) ); /*Q0*/ + pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParameters32kHz_Stereo ), sizeof( tnsParameters32kHz_Stereo[0] ) ); /*Q0*/ #endif move16(); IF( EQ_32( nSampleRate, L_mult0( 100, frameLength ) ) ) /* sub-frame length is <= 10 ms */ @@ -291,7 +291,7 @@ void InitTnsConfiguration_ivas_fx( #ifdef FIX_2388_INITTNSCONFIGURATION pTnsConfig->nMaxFilters = (UWord8) ( sizeof( tnsParameters32kHz ) / sizeof( tnsParameters32kHz[0] ) ); /*Q0*/ #else - pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParameters32kHz ), sizeof( tnsParameters32kHz[0] ) ); /*Q0*/ + pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParameters32kHz ), sizeof( tnsParameters32kHz[0] ) ); /*Q0*/ #endif pTnsConfig->pTnsParameters = tnsParameters32kHz; @@ -320,7 +320,7 @@ void InitTnsConfiguration_ivas_fx( #ifdef FIX_2388_INITTNSCONFIGURATION pTnsConfig->nMaxFilters = (UWord8) ( sizeof( tnsParameters16kHz ) / sizeof( tnsParameters16kHz[0] ) ); /*Q0*/ #else - pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParameters16kHz ), sizeof( tnsParameters16kHz[0] ) ); /*Q0*/ + pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParameters16kHz ), sizeof( tnsParameters16kHz[0] ) ); /*Q0*/ #endif pTnsConfig->pTnsParameters = tnsParameters16kHz; } -- GitLab From be0e391d4fa2d07fbc9582daf2c901c667b4e4ee Mon Sep 17 00:00:00 2001 From: gerstack Date: Thu, 5 Feb 2026 12:38:51 +0100 Subject: [PATCH 3/5] corrected options.h --- lib_com/options.h | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 0ccece30c..cf9b10a06 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -84,30 +84,10 @@ #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 */ -#define FIX_2363_FIND_WSP /* VA: basop issue 2363 : harmonizing find_wsp function */ -#define FIX_2370_UNUSED_BUFFERS_CORE_ENC /* VA: basop issue 2370: remove temporary input buffers in core-encoder */ -#define FIX_2376_FIX_USAN_PRE_PROC /* VA: basop issue 2376: Resolve "USAN: SEGV in ivas_compute_core_buffers_fx() */ -#define FIX_2367_REMOVE_CODE_ICBWE /* VA: basop issue 2367: Remove IC-BWE obsolete code */ -#define REMOVE_SCALING_SHB_SPEECH /* VA: remove unnecessary scaling and 32-bit buffers from ivas_core_enc_fx() */ -#define FIX_2352_COPY_AQ_IN_TCX /* FhG: basop issue 2352: prevent copying uninitialized values from Aq_fx[][] to Aq_fx_32[][] in TCX */ -#define FIX_2353_PTR_INIT /* FhG: basop issue 2353: initialize prm_sqQ-pointer, to prevent being uninitialized in case of bfi == 1 */ -#define FIX_2356_GET_CHAN_ENERGIES /* FhG: basop issue 2356: correctly initialize exponents in getChannelEnergies_fx() */ -#define FIX_2355_IGF_EXP_POWERSPEC /* FhG: basop issue 2355: make sure exp_pPowerSpectrumParameter_fx is initialized in all cases */ -#define FIX_2319_CLDFB_INIT_FLAGS /* FhG: basop issue 2319: init hs->flags during openCldfb(), to avoid reading of uninitialized memory */ -#define FIX_BASOP_2357_OBJECT_EDIT_MSAN /* Nokia: basop issue 2357: initialize missing exponents in object edit */ -#define FIX_BASOP_2354_MSAN_DIFF_Q_VALUE /* Nokia: Initialize Q value of diffuseness in rendering to Q30 */ -#define FIX_2371_REMOVE_UNUSED_ISAR_FCNS /* Dolby: basop issue 2371: remove unused ISAR-related functions */ -#define FIX_2384_INIT_DEQUANT_COV /* FhG: basop issue 2384: only read initialized values from Cy_buf_e[k] in ivas_param_mc_dequantize_cov_fx() during renormalization */ -#define FIX_2383_INIT_Q_A_ITF /* FhG: Initialize Q_A_itf, to avoid reading of uninitialized memory in case ITF is not triggered */ -#define FIX_2382_COPY_AQ_IN_MCT /* FhG: basop issue 2382: 2nd instance of prevent copying uninitialized values from Aq_fx[][] to Aq_fx_32[][] in TCX */ #define FIX_2388_INITTNSCONFIGURATION /* FhG: issue 2388 : harmonizing InitTnsConfiguration() function */ -#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 */ + /* #################### End BE switches ################################## */ /* #################### Start NON-BE switches ############################ */ -- GitLab From 17ebdc5c026feac54d23b231ca4434ef6e418a59 Mon Sep 17 00:00:00 2001 From: gerstack Date: Thu, 5 Feb 2026 16:03:06 +0100 Subject: [PATCH 4/5] MR 2388, also harmonizing InitTnsConfigs(), using suffix _fx instead of _ivas_fx --- lib_com/core_com_config_fx.c | 9 ++++++++- lib_com/prot_fx.h | 13 ++++++++++++- lib_com/tcx_utils_fx.c | 29 ++++++++++++++++++----------- lib_com/tns_base.c | 7 ++++++- lib_dec/core_dec_init_fx.c | 4 ++++ lib_dec/core_dec_switch_fx.c | 8 ++++++++ lib_enc/core_enc_init_fx.c | 4 ++++ lib_enc/core_enc_switch_fx.c | 8 ++++++++ lib_enc/ivas_tcx_core_enc_fx.c | 4 ++++ 9 files changed, 72 insertions(+), 14 deletions(-) diff --git a/lib_com/core_com_config_fx.c b/lib_com/core_com_config_fx.c index 1afa2f1a9..cb9723487 100644 --- a/lib_com/core_com_config_fx.c +++ b/lib_com/core_com_config_fx.c @@ -997,8 +997,11 @@ void init_tcx_cfg_ivas_fx( IF( hTcxCfg->fIsTNSAllowed ) { +#ifdef FIX_2388_INITTNSCONFIGURATION + InitTnsConfigs_fx( bwidth, hTcxCfg->tcx_coded_lines, hTcxCfg->tnsConfig, infoIGFStopFreq, total_brate, element_mode, MCT_flag ); +#else InitTnsConfigs_ivas_fx( bwidth, hTcxCfg->tcx_coded_lines, hTcxCfg->tnsConfig, infoIGFStopFreq, total_brate, element_mode, MCT_flag ); - +#endif SetAllowTnsOnWhite( hTcxCfg->tnsConfig, (Word8) EQ_16( element_mode, IVAS_CPE_MDCT ) ); } @@ -1253,7 +1256,11 @@ void init_tcx_cfg_fx( IF( hTcxCfg->fIsTNSAllowed ) { +#ifdef FIX_2388_INITTNSCONFIGURATION + InitTnsConfigs_fx( bwidth, hTcxCfg->tcx_coded_lines, hTcxCfg->tnsConfig, infoIGFStopFreq, total_brate, element_mode, MCT_flag ); +#else InitTnsConfigs( bwidth, hTcxCfg->tcx_coded_lines, hTcxCfg->tnsConfig, infoIGFStopFreq, total_brate, element_mode, MCT_flag ); +#endif SetAllowTnsOnWhite( hTcxCfg->tnsConfig, (Word8) EQ_16( element_mode, IVAS_CPE_MDCT ) ); } diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 9ac21c302..78b87b675 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -3580,7 +3580,11 @@ void InitTnsConfiguration( const Word16 is_mct ); #endif +#ifdef FIX_2388_INITTNSCONFIGURATION +void InitTnsConfiguration_fx( +#else void InitTnsConfiguration_ivas_fx( +#endif const Word16 bwidth, const Word16 frameLength, STnsConfig *pTnsConfig, @@ -4225,6 +4229,7 @@ void tcx_noise_filling_with_shift( const Word16 element_mode /* i : IVAS element mode */ ); +#ifndef FIX_2388_INITTNSCONFIGURATION void InitTnsConfigs( const Word16 bwidth, const Word16 L_frame, @@ -4233,8 +4238,14 @@ void InitTnsConfigs( const Word32 total_brate, const Word16 element_mode, const Word16 is_mct ); +#endif -void InitTnsConfigs_ivas_fx( +#ifdef FIX_2388_INITTNSCONFIGURATION +void InitTnsConfigs_fx +#else +void InitTnsConfigs_ivas_fx +#endif +( const Word16 bwidth, const Word16 L_frame, STnsConfig tnsConfig[2][2], diff --git a/lib_com/tcx_utils_fx.c b/lib_com/tcx_utils_fx.c index c71392b4b..02692d7db 100644 --- a/lib_com/tcx_utils_fx.c +++ b/lib_com/tcx_utils_fx.c @@ -1969,10 +1969,11 @@ void tcx_noise_filling_with_shift( /*--------------------------------------------------------------- - * () + * InitTnsConfigs() *--------------------------------------------------------------*/ +#ifndef FIX_2388_INITTNSCONFIGURATION void InitTnsConfigs( const Word16 bwidth, /*Q0*/ const Word16 L_frame, /*Q0*/ @@ -1984,22 +1985,19 @@ void InitTnsConfigs( { IF( GT_32( total_brate, ACELP_32k ) ) { -#ifdef FIX_2388_INITTNSCONFIGURATION - InitTnsConfiguration_ivas_fx( bwidth, shr( L_frame, 1 ), &tnsConfig[0][0], igfStopFreq, total_brate, element_mode, MCT_flag ); -#else InitTnsConfiguration( bwidth, shr( L_frame, 1 ), &tnsConfig[0][0], igfStopFreq, total_brate, element_mode, MCT_flag ); -#endif } -#ifdef FIX_2388_INITTNSCONFIGURATION - InitTnsConfiguration_ivas_fx( bwidth, L_frame, &tnsConfig[1][0], igfStopFreq, total_brate, element_mode, MCT_flag ); - InitTnsConfiguration_ivas_fx( bwidth, add( L_frame, shr( L_frame, 2 ) ), &tnsConfig[1][1], igfStopFreq, total_brate, element_mode, MCT_flag ); -#else InitTnsConfiguration( bwidth, L_frame, &tnsConfig[1][0], igfStopFreq, total_brate, element_mode, MCT_flag ); InitTnsConfiguration( bwidth, add( L_frame, shr( L_frame, 2 ) ), &tnsConfig[1][1], igfStopFreq, total_brate, element_mode, MCT_flag ); -#endif } +#endif -void InitTnsConfigs_ivas_fx( +#ifdef FIX_2388_INITTNSCONFIGURATION +void InitTnsConfigs_fx +#else +void InitTnsConfigs_ivas_fx +#endif +( const Word16 bwidth, /*Q0*/ const Word16 L_frame, /*Q0*/ STnsConfig tnsConfig[2][2], @@ -2010,10 +2008,19 @@ void InitTnsConfigs_ivas_fx( { IF( GT_32( total_brate, ACELP_32k ) ) { +#ifdef FIX_2388_INITTNSCONFIGURATION + InitTnsConfiguration_fx( bwidth, shr( L_frame, 1 ), &tnsConfig[0][0], igfStopFreq, total_brate, element_mode, MCT_flag ); +#else InitTnsConfiguration_ivas_fx( bwidth, shr( L_frame, 1 ), &tnsConfig[0][0], igfStopFreq, total_brate, element_mode, MCT_flag ); +#endif } +#ifdef FIX_2388_INITTNSCONFIGURATION + InitTnsConfiguration_fx( bwidth, L_frame, &tnsConfig[1][0], igfStopFreq, total_brate, element_mode, MCT_flag ); + InitTnsConfiguration_fx( bwidth, add( L_frame, shr( L_frame, 2 ) ), &tnsConfig[1][1], igfStopFreq, total_brate, element_mode, MCT_flag ); +#else InitTnsConfiguration_ivas_fx( bwidth, L_frame, &tnsConfig[1][0], igfStopFreq, total_brate, element_mode, MCT_flag ); InitTnsConfiguration_ivas_fx( bwidth, add( L_frame, shr( L_frame, 2 ) ), &tnsConfig[1][1], igfStopFreq, total_brate, element_mode, MCT_flag ); +#endif } void SetTnsConfig( diff --git a/lib_com/tns_base.c b/lib_com/tns_base.c index c0a7cd4e6..faad70777 100644 --- a/lib_com/tns_base.c +++ b/lib_com/tns_base.c @@ -199,7 +199,12 @@ void InitTnsConfiguration( } #endif /* FIX_2388_INITTNSCONFIGURATION */ -void InitTnsConfiguration_ivas_fx( +#ifdef FIX_2388_INITTNSCONFIGURATION +void InitTnsConfiguration_fx +#else +void InitTnsConfiguration_ivas_fx +#endif /* FIX_2388_INITTNSCONFIGURATION */ +( const Word16 bwidth, /*Q0*/ const Word16 frameLength, /*Q0*/ STnsConfig *pTnsConfig, diff --git a/lib_dec/core_dec_init_fx.c b/lib_dec/core_dec_init_fx.c index 79b75b02f..678d0b3d7 100644 --- a/lib_dec/core_dec_init_fx.c +++ b/lib_dec/core_dec_init_fx.c @@ -240,7 +240,11 @@ void open_decoder_LPD_fx( IF( st->hTcxCfg->fIsTNSAllowed != 0 ) { +#ifdef FIX_2388_INITTNSCONFIGURATION + InitTnsConfigs_fx( st->bwidth, st->hTcxCfg->tcx_coded_lines, st->hTcxCfg->tnsConfig, st->hIGFDec->infoIGFStopFreq, st->total_brate, st->element_mode, 0 /*is_mct*/ ); +#else InitTnsConfigs( st->bwidth, st->hTcxCfg->tcx_coded_lines, st->hTcxCfg->tnsConfig, st->hIGFDec->infoIGFStopFreq, st->total_brate, st->element_mode, 0 /*is_mct*/ ); +#endif } /*Constraint for adaptive BPF, otherwise parameter estimation and post-processing not time aligned*/ if ( st->tcxonly == 0 ) diff --git a/lib_dec/core_dec_switch_fx.c b/lib_dec/core_dec_switch_fx.c index b22a48b43..3a9148b76 100644 --- a/lib_dec/core_dec_switch_fx.c +++ b/lib_dec/core_dec_switch_fx.c @@ -133,7 +133,11 @@ void mode_switch_decoder_LPD_fx( IF( ( st->hTcxCfg->fIsTNSAllowed != 0 ) && st->hIGFDec != NULL ) { +#ifdef FIX_2388_INITTNSCONFIGURATION + InitTnsConfigs_fx( bwidth, st->hTcxCfg->tcx_coded_lines, st->hTcxCfg->tnsConfig, st->hIGFDec->infoIGFStopFreq, total_brate, st->element_mode, 0 /* 0 should be replaced with MCT_flag*/ ); +#else InitTnsConfigs( bwidth, st->hTcxCfg->tcx_coded_lines, st->hTcxCfg->tnsConfig, st->hIGFDec->infoIGFStopFreq, total_brate, st->element_mode, 0 /* 0 should be replaced with MCT_flag*/ ); +#endif } } } @@ -377,7 +381,11 @@ void mode_switch_decoder_LPD_ivas_fx( IF( st->hTcxCfg->fIsTNSAllowed && st->hIGFDec != NULL && st->hTcxCfg != NULL ) { +#ifdef FIX_2388_INITTNSCONFIGURATION + InitTnsConfigs_fx( bwidth, st->hTcxCfg->tcx_coded_lines, st->hTcxCfg->tnsConfig, st->hIGFDec->infoIGFStopFreq, total_brate, st->element_mode, MCT_flag ); +#else InitTnsConfigs( bwidth, st->hTcxCfg->tcx_coded_lines, st->hTcxCfg->tnsConfig, st->hIGFDec->infoIGFStopFreq, total_brate, st->element_mode, MCT_flag ); +#endif SetAllowTnsOnWhite( st->hTcxCfg->tnsConfig, (Word8) EQ_16( st->element_mode, IVAS_CPE_MDCT ) ); } diff --git a/lib_enc/core_enc_init_fx.c b/lib_enc/core_enc_init_fx.c index a8c674170..c944bc5f4 100644 --- a/lib_enc/core_enc_init_fx.c +++ b/lib_enc/core_enc_init_fx.c @@ -361,7 +361,11 @@ static void init_tcx_fx( IF( st->hTcxCfg->fIsTNSAllowed != 0 ) { +#ifdef FIX_2388_INITTNSCONFIGURATION + InitTnsConfigs_fx( st->bwidth, st->hTcxCfg->tcx_coded_lines, st->hTcxCfg->tnsConfig, st->hIGFEnc->infoStopFrequency, st->total_brate, st->element_mode, 0 /*is_mct*/ ); +#else InitTnsConfigs( st->bwidth, st->hTcxCfg->tcx_coded_lines, st->hTcxCfg->tnsConfig, st->hIGFEnc->infoStopFrequency, st->total_brate, st->element_mode, 0 /*is_mct*/ ); +#endif } /* TCX-LTP */ diff --git a/lib_enc/core_enc_switch_fx.c b/lib_enc/core_enc_switch_fx.c index b61609e50..27c429ded 100644 --- a/lib_enc/core_enc_switch_fx.c +++ b/lib_enc/core_enc_switch_fx.c @@ -109,7 +109,11 @@ void core_coder_mode_switch_fx( move16(); IF( st->hTcxCfg->fIsTNSAllowed != 0 ) { +#ifdef FIX_2388_INITTNSCONFIGURATION + InitTnsConfigs_fx( st->bwidth, st->hTcxCfg->tcx_coded_lines, st->hTcxCfg->tnsConfig, st->hIGFEnc->infoStopFrequency, st->total_brate, st->element_mode, MCT_flag ); +#else InitTnsConfigs( st->bwidth, st->hTcxCfg->tcx_coded_lines, st->hTcxCfg->tnsConfig, st->hIGFEnc->infoStopFrequency, st->total_brate, st->element_mode, MCT_flag ); +#endif } st->narrowBand = 0; @@ -333,7 +337,11 @@ void core_coder_mode_switch_ivas_fx( IF( st->hTcxCfg->fIsTNSAllowed ) { +#ifdef FIX_2388_INITTNSCONFIGURATION + InitTnsConfigs_fx( st->bwidth, st->hTcxCfg->tcx_coded_lines, st->hTcxCfg->tnsConfig, st->hIGFEnc->infoStopFrequency, st->total_brate, st->element_mode, MCT_flag ); +#else InitTnsConfigs_ivas_fx( st->bwidth, st->hTcxCfg->tcx_coded_lines, st->hTcxCfg->tnsConfig, st->hIGFEnc->infoStopFrequency, st->total_brate, st->element_mode, MCT_flag ); +#endif SetAllowTnsOnWhite( st->hTcxCfg->tnsConfig, st->element_mode == IVAS_CPE_MDCT ); } diff --git a/lib_enc/ivas_tcx_core_enc_fx.c b/lib_enc/ivas_tcx_core_enc_fx.c index 709e17ef7..db24fbd35 100644 --- a/lib_enc/ivas_tcx_core_enc_fx.c +++ b/lib_enc/ivas_tcx_core_enc_fx.c @@ -134,7 +134,11 @@ void stereo_tcx_init_enc_fx( test(); IF( !prev_IsTNSAllowed && st->hTcxCfg->fIsTNSAllowed && EQ_16( st->element_mode, IVAS_CPE_DFT ) ) /* may happen in unified stereo when switching stereo technologies */ { +#ifdef FIX_2388_INITTNSCONFIGURATION + InitTnsConfigs_fx( st->bwidth, st->hTcxCfg->tcx_coded_lines, st->hTcxCfg->tnsConfig, st->hIGFEnc->infoStopFrequency, total_brate, st->element_mode, 0 ); +#else InitTnsConfigs_ivas_fx( st->bwidth, st->hTcxCfg->tcx_coded_lines, st->hTcxCfg->tnsConfig, st->hIGFEnc->infoStopFrequency, total_brate, st->element_mode, 0 ); +#endif SetAllowTnsOnWhite( st->hTcxCfg->tnsConfig, 0 ); } -- GitLab From e57647faad4058b20be5b26d55ef6b51428afe7a Mon Sep 17 00:00:00 2001 From: gerstack Date: Thu, 5 Feb 2026 16:06:57 +0100 Subject: [PATCH 5/5] clang format --- lib_com/prot_fx.h | 16 ++++++++-------- lib_com/tcx_utils_fx.c | 16 ++++++++-------- lib_com/tns_base.c | 16 ++++++++-------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 62303f3c7..0b3d4278c 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -4245,14 +4245,14 @@ void InitTnsConfigs_fx #else void InitTnsConfigs_ivas_fx #endif -( - const Word16 bwidth, - const Word16 L_frame, - STnsConfig tnsConfig[2][2], - const Word16 igfStopFreq, - const Word32 total_brate, - const Word16 element_mode, - const Word16 is_mct ); + ( + const Word16 bwidth, + const Word16 L_frame, + STnsConfig tnsConfig[2][2], + const Word16 igfStopFreq, + const Word32 total_brate, + const Word16 element_mode, + const Word16 is_mct ); void SetAllowTnsOnWhite( STnsConfig tnsConfig[2][2], diff --git a/lib_com/tcx_utils_fx.c b/lib_com/tcx_utils_fx.c index 02692d7db..44c034a20 100644 --- a/lib_com/tcx_utils_fx.c +++ b/lib_com/tcx_utils_fx.c @@ -1997,14 +1997,14 @@ void InitTnsConfigs_fx #else void InitTnsConfigs_ivas_fx #endif -( - const Word16 bwidth, /*Q0*/ - const Word16 L_frame, /*Q0*/ - STnsConfig tnsConfig[2][2], - const Word16 igfStopFreq, /*Q0*/ - const Word32 total_brate, /*Q0*/ - const Word16 element_mode, /*Q0*/ - const Word16 MCT_flag /*Q0*/ ) + ( + const Word16 bwidth, /*Q0*/ + const Word16 L_frame, /*Q0*/ + STnsConfig tnsConfig[2][2], + const Word16 igfStopFreq, /*Q0*/ + const Word32 total_brate, /*Q0*/ + const Word16 element_mode, /*Q0*/ + const Word16 MCT_flag /*Q0*/ ) { IF( GT_32( total_brate, ACELP_32k ) ) { diff --git a/lib_com/tns_base.c b/lib_com/tns_base.c index faad70777..8c79d885f 100644 --- a/lib_com/tns_base.c +++ b/lib_com/tns_base.c @@ -204,14 +204,14 @@ void InitTnsConfiguration_fx #else void InitTnsConfiguration_ivas_fx #endif /* FIX_2388_INITTNSCONFIGURATION */ -( - const Word16 bwidth, /*Q0*/ - const Word16 frameLength, /*Q0*/ - STnsConfig *pTnsConfig, - const Word16 igfStopFreq, /*Q0*/ - const Word32 total_brate, /*Q0*/ - const Word16 element_mode, /*Q0*/ - const Word16 is_mct /*Q0*/ ) + ( + const Word16 bwidth, /*Q0*/ + const Word16 frameLength, /*Q0*/ + STnsConfig *pTnsConfig, + const Word16 igfStopFreq, /*Q0*/ + const Word32 total_brate, /*Q0*/ + const Word16 element_mode, /*Q0*/ + const Word16 is_mct /*Q0*/ ) { Word16 iFilter = 0; move16(); -- GitLab