From f4dba0c0def66b5557223964538a4f4521d148ca Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Thu, 5 Feb 2026 11:09:25 +0100 Subject: [PATCH 1/8] issue: 2389 further fixing - _fx suffix after function names --- lib_com/prot_fx.h | 4 ++-- lib_dec/dec_prm_fx.c | 6 +++--- lib_dec/tns_base_dec_fx.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index baa38d4cf..6849ae7ae 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -8376,14 +8376,14 @@ void tcx_hm_modify_envelope( Word16 L_frame /* i: number of spectral lines Q0 */ ); #ifdef HARMONIZE_READ_DECODE_TNS -Word16 ReadTnsData( +Word16 ReadTnsData_fx( STnsConfig const *pTnsConfig, Decoder_State *st, Word16 *pnBits, Word16 *stream, Word16 *pnSize ); -Word16 DecodeTnsData( +Word16 DecodeTnsData_fx( STnsConfig const *pTnsConfig, Word16 const *stream, /*Q0*/ Word16 *pnSize, /*Q0*/ diff --git a/lib_dec/dec_prm_fx.c b/lib_dec/dec_prm_fx.c index 853ac4222..99529255b 100644 --- a/lib_dec/dec_prm_fx.c +++ b/lib_dec/dec_prm_fx.c @@ -396,7 +396,7 @@ void getTCXparam_fx( { #ifdef HARMONIZE_READ_DECODE_TNS - (void) ReadTnsData( st->hTcxCfg->pCurrentTnsConfig, st0, &nTnsBits, prm + j, &nTnsParams ); + (void) ReadTnsData_fx( st->hTcxCfg->pCurrentTnsConfig, st0, &nTnsBits, prm + j, &nTnsParams ); #else ReadTnsData_ivas_fx( st->hTcxCfg->pCurrentTnsConfig, st0, &nTnsBits, prm + j, &nTnsParams ); @@ -1358,7 +1358,7 @@ void dec_prm_fx( { SetTnsConfig( st->hTcxCfg, 1, (Word16) EQ_16( st->last_core_from_bs, ACELP_CORE ) ); #ifdef HARMONIZE_READ_DECODE_TNS - (void) ReadTnsData( st->hTcxCfg->pCurrentTnsConfig, st, &nTnsBits, prm + j, &nTnsParams ); + (void) ReadTnsData_fx( st->hTcxCfg->pCurrentTnsConfig, st, &nTnsBits, prm + j, &nTnsParams ); #else ReadTnsData( st->hTcxCfg->pCurrentTnsConfig, st, &nTnsBits, prm + j, &nTnsParams ); #endif // HARMONIZE_READ_DECODE_TNS @@ -1686,7 +1686,7 @@ void dec_prm_fx( test(); SetTnsConfig( st->hTcxCfg, 0, ( st->last_core_from_bs == ACELP_CORE ) && ( k == 0 ) ); #ifdef HARMONIZE_READ_DECODE_TNS - (void) ReadTnsData( st->hTcxCfg->pCurrentTnsConfig, st, &nTnsBits, prm + j, &nTnsParams ); + (void) ReadTnsData_fx( st->hTcxCfg->pCurrentTnsConfig, st, &nTnsBits, prm + j, &nTnsParams ); #else ReadTnsData( st->hTcxCfg->pCurrentTnsConfig, st, &nTnsBits, prm + j, &nTnsParams ); #endif // DEBUG diff --git a/lib_dec/tns_base_dec_fx.c b/lib_dec/tns_base_dec_fx.c index 42fd51df7..f79253ed7 100644 --- a/lib_dec/tns_base_dec_fx.c +++ b/lib_dec/tns_base_dec_fx.c @@ -29,7 +29,7 @@ typedef Word32 ( *TLinearPredictionFilter )( Word16 order, Word16 const parCoeff * * *---------------------------------------------------------------------*/ -Word16 ReadTnsData( +Word16 ReadTnsData_fx( STnsConfig const *pTnsConfig, Decoder_State *st, Word16 *pnBits, /*Q0*/ @@ -83,7 +83,7 @@ Word16 ReadTnsData( * * *---------------------------------------------------------------------*/ -Word16 DecodeTnsData( +Word16 DecodeTnsData_fx( STnsConfig const *pTnsConfig, Word16 const *stream, /*Q0*/ Word16 *pnSize, /*Q0*/ -- GitLab From 757328d4a8be6dd6fce0e7ffaf714eea25263996 Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Thu, 5 Feb 2026 15:31:50 +0100 Subject: [PATCH 2/8] issue: 2389 further fixing function suffixes --- lib_dec/dec_tcx_fx.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/lib_dec/dec_tcx_fx.c b/lib_dec/dec_tcx_fx.c index 534d34275..d3895ff87 100644 --- a/lib_dec/dec_tcx_fx.c +++ b/lib_dec/dec_tcx_fx.c @@ -297,11 +297,18 @@ void decoder_tcx_fx( IF( ( bfi == 0 ) && ( hTcxCfg->fIsTNSAllowed != 0 ) ) { cast16(); +#ifdef HARMONIZE_READ_DECODE_TNS + fUseTns = (Word8)DecodeTnsData_fx(hTcxCfg->pCurrentTnsConfig, + prm_tns, + &tnsSize, + &tnsData); +#else + fUseTns = (Word8)DecodeTnsData(hTcxCfg->pCurrentTnsConfig, + prm_tns, + &tnsSize, + &tnsData); +#endif // HARMONIZE_READ_DECODE_TNS - fUseTns = (Word8) DecodeTnsData( hTcxCfg->pCurrentTnsConfig, - prm_tns, - &tnsSize, - &tnsData ); } ELSE { @@ -4204,7 +4211,12 @@ void decoder_tcx_invQ_fx( test(); IF( !bfi && hTcxCfg->fIsTNSAllowed ) { - *fUseTns = DecodeTnsData( hTcxCfg->pCurrentTnsConfig, prm_tns, &tnsSize, tnsData ); +#ifdef HARMONIZE_READ_DECODE_TNS + * fUseTns = DecodeTnsData_fx(hTcxCfg->pCurrentTnsConfig, prm_tns, &tnsSize, tnsData); +#else + * fUseTns = DecodeTnsData(hTcxCfg->pCurrentTnsConfig, prm_tns, &tnsSize, tnsData); +#endif // HARMONIZE_READ_DECODE_TNS + move16(); } ELSE -- GitLab From c1a1be2d82c72b187907f83f21006fad9de8a149 Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Thu, 5 Feb 2026 16:51:25 +0100 Subject: [PATCH 3/8] issue: 2389 adding Macro and fixing function formatting --- lib_com/options.h | 1 + lib_com/parameter_bitmaping_fx.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 523ba0ab8..aa21bff4c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -100,6 +100,7 @@ #define FIX_BASOP_2361_OTR /* FhG: Basop issue 2361: Orientation tracking tests for equivalent rotations fail */ #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 */ #define FIX_2408_FD_BWE_UPDATE /* VA: basop issue 2408: bug-fix in the FD BWE memory updates in wb_pre_proc_ivas_fx() */ +#define HARMONIZE_READ_DECODE_TNS /* FhG basop 2389: Harm between two pairs of functions. */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_com/parameter_bitmaping_fx.c b/lib_com/parameter_bitmaping_fx.c index 4225879e6..4e41c788b 100644 --- a/lib_com/parameter_bitmaping_fx.c +++ b/lib_com/parameter_bitmaping_fx.c @@ -228,8 +228,15 @@ void SetParameters_fx( IF( s_and( param->pSubParamBitMap != NULL, value > 0 ) ) { pTmp = pParameter; - if ( pSubStruct != NULL ) +#ifdef HARMONIZE_READ_DECODE_TNS + if (pSubStruct != NULL) + { pTmp = pSubStruct; + } +#else + if (pSubStruct != NULL) + pTmp = pSubStruct; +#endif SetParameters( param->pSubParamBitMap, value, pTmp, pStream, pnSize ); } } -- GitLab From fa2aabf1db6d9bdad56e1a0545e2ad1130a1525d Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Thu, 5 Feb 2026 17:12:47 +0100 Subject: [PATCH 4/8] issue: 2389 fixing clang formatting --- lib_com/parameter_bitmaping_fx.c | 4 ++-- lib_com/prot_fx.h | 4 ++-- lib_dec/dec_tcx_fx.c | 21 ++++++++++----------- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/lib_com/parameter_bitmaping_fx.c b/lib_com/parameter_bitmaping_fx.c index 4e41c788b..5a2f8ccfe 100644 --- a/lib_com/parameter_bitmaping_fx.c +++ b/lib_com/parameter_bitmaping_fx.c @@ -229,12 +229,12 @@ void SetParameters_fx( { pTmp = pParameter; #ifdef HARMONIZE_READ_DECODE_TNS - if (pSubStruct != NULL) + if ( pSubStruct != NULL ) { pTmp = pSubStruct; } #else - if (pSubStruct != NULL) + if ( pSubStruct != NULL ) pTmp = pSubStruct; #endif SetParameters( param->pSubParamBitMap, value, pTmp, pStream, pnSize ); diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 272821934..f1ba2bae4 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -7578,8 +7578,8 @@ ivas_error core_switching_post_dec_fx( Word32 *output_fx, /* i/o: LB synth/upsampled LB synth Q11*/ Word32 output_mem_fx32[], /* i : OLA memory from last TCX/HQ frame Qx*/ #else - Word32 *output_fx, /* i/o: LB synth/upsampled LB synth Q4*/ - Word16 output_mem_fx[], /* i : OLA memory from last TCX/HQ frame Qx*/ + Word32 *output_fx, /* i/o: LB synth/upsampled LB synth Q4*/ + Word16 output_mem_fx[], /* i : OLA memory from last TCX/HQ frame Qx*/ #endif const Word16 use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo Q0*/ const Word16 output_frame, /* i : frame length Q0*/ diff --git a/lib_dec/dec_tcx_fx.c b/lib_dec/dec_tcx_fx.c index 04e93740b..0b954c17c 100644 --- a/lib_dec/dec_tcx_fx.c +++ b/lib_dec/dec_tcx_fx.c @@ -298,17 +298,16 @@ void decoder_tcx_fx( { cast16(); #ifdef HARMONIZE_READ_DECODE_TNS - fUseTns = (Word8)DecodeTnsData_fx(hTcxCfg->pCurrentTnsConfig, - prm_tns, - &tnsSize, - &tnsData); + fUseTns = (Word8) DecodeTnsData_fx( hTcxCfg->pCurrentTnsConfig, + prm_tns, + &tnsSize, + &tnsData ); #else - fUseTns = (Word8)DecodeTnsData(hTcxCfg->pCurrentTnsConfig, - prm_tns, - &tnsSize, - &tnsData); + fUseTns = (Word8) DecodeTnsData( hTcxCfg->pCurrentTnsConfig, + prm_tns, + &tnsSize, + &tnsData ); #endif // HARMONIZE_READ_DECODE_TNS - } ELSE { @@ -4208,9 +4207,9 @@ void decoder_tcx_invQ_fx( IF( !bfi && hTcxCfg->fIsTNSAllowed ) { #ifdef HARMONIZE_READ_DECODE_TNS - * fUseTns = DecodeTnsData_fx(hTcxCfg->pCurrentTnsConfig, prm_tns, &tnsSize, tnsData); + *fUseTns = DecodeTnsData_fx( hTcxCfg->pCurrentTnsConfig, prm_tns, &tnsSize, tnsData ); #else - * fUseTns = DecodeTnsData_ivas_fx(hTcxCfg->pCurrentTnsConfig, prm_tns, &tnsSize, tnsData); + *fUseTns = DecodeTnsData_ivas_fx( hTcxCfg->pCurrentTnsConfig, prm_tns, &tnsSize, tnsData ); #endif // HARMONIZE_READ_DECODE_TNS move16(); -- GitLab From bdb27e452525652ae7266cfba2d843c91609ab83 Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Mon, 9 Feb 2026 16:41:33 +0100 Subject: [PATCH 5/8] issue: 2389 removing return value in readTnsData() and void casts on its return values --- lib_com/prot_fx.h | 12 ++++++------ lib_dec/dec_prm_fx.c | 6 +++--- lib_dec/tns_base_dec_fx.c | 13 ++++++------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index b8bbde206..7da6fc25a 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -8389,12 +8389,12 @@ void tcx_hm_modify_envelope( Word16 L_frame /* i: number of spectral lines Q0 */ ); #ifdef HARMONIZE_READ_DECODE_TNS -Word16 ReadTnsData_fx( - STnsConfig const *pTnsConfig, - Decoder_State *st, - Word16 *pnBits, - Word16 *stream, - Word16 *pnSize ); +void ReadTnsData_fx( + STnsConfig const* pTnsConfig, + Decoder_State* st, + Word16* pnBits, + Word16* stream, + Word16* pnSize); Word16 DecodeTnsData_fx( STnsConfig const *pTnsConfig, diff --git a/lib_dec/dec_prm_fx.c b/lib_dec/dec_prm_fx.c index 99529255b..420c20dbf 100644 --- a/lib_dec/dec_prm_fx.c +++ b/lib_dec/dec_prm_fx.c @@ -396,7 +396,7 @@ void getTCXparam_fx( { #ifdef HARMONIZE_READ_DECODE_TNS - (void) ReadTnsData_fx( st->hTcxCfg->pCurrentTnsConfig, st0, &nTnsBits, prm + j, &nTnsParams ); + ReadTnsData_fx( st->hTcxCfg->pCurrentTnsConfig, st0, &nTnsBits, prm + j, &nTnsParams ); #else ReadTnsData_ivas_fx( st->hTcxCfg->pCurrentTnsConfig, st0, &nTnsBits, prm + j, &nTnsParams ); @@ -1358,7 +1358,7 @@ void dec_prm_fx( { SetTnsConfig( st->hTcxCfg, 1, (Word16) EQ_16( st->last_core_from_bs, ACELP_CORE ) ); #ifdef HARMONIZE_READ_DECODE_TNS - (void) ReadTnsData_fx( st->hTcxCfg->pCurrentTnsConfig, st, &nTnsBits, prm + j, &nTnsParams ); + ReadTnsData_fx( st->hTcxCfg->pCurrentTnsConfig, st, &nTnsBits, prm + j, &nTnsParams ); #else ReadTnsData( st->hTcxCfg->pCurrentTnsConfig, st, &nTnsBits, prm + j, &nTnsParams ); #endif // HARMONIZE_READ_DECODE_TNS @@ -1686,7 +1686,7 @@ void dec_prm_fx( test(); SetTnsConfig( st->hTcxCfg, 0, ( st->last_core_from_bs == ACELP_CORE ) && ( k == 0 ) ); #ifdef HARMONIZE_READ_DECODE_TNS - (void) ReadTnsData_fx( st->hTcxCfg->pCurrentTnsConfig, st, &nTnsBits, prm + j, &nTnsParams ); + ReadTnsData_fx( st->hTcxCfg->pCurrentTnsConfig, st, &nTnsBits, prm + j, &nTnsParams ); #else ReadTnsData( st->hTcxCfg->pCurrentTnsConfig, st, &nTnsBits, prm + j, &nTnsParams ); #endif // DEBUG diff --git a/lib_dec/tns_base_dec_fx.c b/lib_dec/tns_base_dec_fx.c index f79253ed7..e0cb97177 100644 --- a/lib_dec/tns_base_dec_fx.c +++ b/lib_dec/tns_base_dec_fx.c @@ -29,12 +29,12 @@ typedef Word32 ( *TLinearPredictionFilter )( Word16 order, Word16 const parCoeff * * *---------------------------------------------------------------------*/ -Word16 ReadTnsData_fx( - STnsConfig const *pTnsConfig, - Decoder_State *st, - Word16 *pnBits, /*Q0*/ - Word16 *stream, /*Q0*/ - Word16 *pnSize /*Q0*/ +void ReadTnsData_fx( + STnsConfig const* pTnsConfig, + Decoder_State* st, + Word16* pnBits, /*Q0*/ + Word16* stream, /*Q0*/ + Word16* pnSize /*Q0*/ ) { Word16 start_bit_pos; @@ -76,7 +76,6 @@ Word16 ReadTnsData_fx( move16(); *pnBits = sub( st->next_bit_pos, start_bit_pos ); - return TNS_NO_ERROR; } /*---------------------------------------------------------------------* * DecodeTnsData() -- GitLab From 11cd2d1b2c3cc5100882584fba9daa8c0cbf4ce7 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 9 Feb 2026 17:23:40 +0100 Subject: [PATCH 6/8] formatting --- lib_com/prot_fx.h | 10 +++++----- lib_dec/tns_base_dec_fx.c | 11 +++++------ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index e4f82bdca..2d5382e60 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -8403,11 +8403,11 @@ void tcx_hm_modify_envelope( ); #ifdef HARMONIZE_READ_DECODE_TNS void ReadTnsData_fx( - STnsConfig const* pTnsConfig, - Decoder_State* st, - Word16* pnBits, - Word16* stream, - Word16* pnSize); + STnsConfig const *pTnsConfig, + Decoder_State *st, + Word16 *pnBits, + Word16 *stream, + Word16 *pnSize ); Word16 DecodeTnsData_fx( STnsConfig const *pTnsConfig, diff --git a/lib_dec/tns_base_dec_fx.c b/lib_dec/tns_base_dec_fx.c index e0cb97177..e603feaaa 100644 --- a/lib_dec/tns_base_dec_fx.c +++ b/lib_dec/tns_base_dec_fx.c @@ -30,11 +30,11 @@ typedef Word32 ( *TLinearPredictionFilter )( Word16 order, Word16 const parCoeff * *---------------------------------------------------------------------*/ void ReadTnsData_fx( - STnsConfig const* pTnsConfig, - Decoder_State* st, - Word16* pnBits, /*Q0*/ - Word16* stream, /*Q0*/ - Word16* pnSize /*Q0*/ + STnsConfig const *pTnsConfig, + Decoder_State *st, + Word16 *pnBits, /*Q0*/ + Word16 *stream, /*Q0*/ + Word16 *pnSize /*Q0*/ ) { Word16 start_bit_pos; @@ -75,7 +75,6 @@ void ReadTnsData_fx( move16(); *pnBits = sub( st->next_bit_pos, start_bit_pos ); - } /*---------------------------------------------------------------------* * DecodeTnsData() -- GitLab From 12622d0224f4d0b862d41ba0ea18d0f45230a62d Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 9 Feb 2026 17:26:34 +0100 Subject: [PATCH 7/8] whitespace --- lib_dec/tns_base_dec_fx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib_dec/tns_base_dec_fx.c b/lib_dec/tns_base_dec_fx.c index e603feaaa..44d18ccb2 100644 --- a/lib_dec/tns_base_dec_fx.c +++ b/lib_dec/tns_base_dec_fx.c @@ -76,6 +76,7 @@ void ReadTnsData_fx( move16(); *pnBits = sub( st->next_bit_pos, start_bit_pos ); } + /*---------------------------------------------------------------------* * DecodeTnsData() * -- GitLab From 9cde610981f951c08b14a8b558b344db4d181110 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 10 Feb 2026 17:57:46 +0100 Subject: [PATCH 8/8] move switch to BE section --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index dfd586cad..1b0440bbc 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -102,6 +102,7 @@ #define HARMONIZE_TBE2 /* VA: basop issue 2399: Remove duplicated code: TBE, step 2 */ #define HARM_FD_BWE /* VA: harmonize core-coder FD BWE function duplications */ #define FIX_2411_Harmonize_TNSANALYSIS_DETECTTNSFILT /* FhG: basop issue 2411: harmonize TNSAnalysis*_fx(), DetectTnsFilt*_fx()*/ +#define HARMONIZE_READ_DECODE_TNS /* FhG basop 2389: Harm between two pairs of functions. */ /* #################### End BE switches ################################## */ @@ -116,7 +117,6 @@ #define FIX_2380_HARM_GSC_GAIN_COMP_FX /* VA: basop issue 2380 & 2381: Fix issue when switching from CNG low energy to active content with high energy */ #define FIX_2406_FIX_GAIN_ON_INACTIVE /* VA: basop issue 2406: gain between 6.4 and 8kHz was too weak during inactive content with Fs=16kHz */ #define FIX_2407_FIX_RESIDU_IVAS /* VA: basop 2407, Implementation issue in residu_ivas + unnecessary complexity */ -#define HARMONIZE_READ_DECODE_TNS /* FhG basop 2389: Harm between two pairs of functions. */ /* ##################### End NON-BE switches ########################### */ -- GitLab