From 825e43fb55ded001399e9c1d3563de900a323aeb Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Thu, 12 Mar 2026 15:28:49 +0100 Subject: [PATCH 01/22] issue: 2557 Adding necessary switch --- lib_com/options.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib_com/options.h b/lib_com/options.h index 0457cfa56..86418d26e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -97,6 +97,7 @@ #define FIX_FLOAT_1536_INIT_NO_PARAM_LPC /* FhG: make sure no_param_lpc is initialized in core_encode_twodiv() */ #define FIX_BASOP_2871_INIT_Q_SYN_FACTOR /* FhG: make sure, st_fx->Q_syn_factor gets initialized during decoder startup */ #define FIX_BASOP_2470_POWER_SPEC_E_INIT /* FhG: make sure powerSpec_e is always initialized in core_signal_analysis_high_bitrate_fx() */ +#define FIX_BASOP_2457_HARM_GEN /* FhG: harmonization of function generate_comfort_noise_dec_hf_ivas_fx()*/ /* #################### End BE switches ################################## */ -- GitLab From 7173b60919c844ba9c85604fee1d3b3723d52bfc Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Thu, 12 Mar 2026 16:20:55 +0100 Subject: [PATCH 02/22] issue: 2557 wrapping in Switch --- lib_dec/fd_cng_dec_fx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index d1e11efab..1c67f1e60 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -3507,6 +3507,9 @@ void generate_comfort_noise_dec_hf_ivas_fx( Word32 **bufferReal, /* o : matrix to real part of input bands bufferScale*/ Word32 **bufferImag, /* o : matrix to imaginary part of input bands bufferScale*/ Word16 *bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ +#ifdef FIX_BASOP_2457_HARM_GEN + Decoder_State *st, +#endif // FIX_BASOP_2457_HARM_GEN HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ const Word16 cng_coh_flag /* i : CNG Flag for coherence handling Q0*/ ) @@ -3522,6 +3525,9 @@ void generate_comfort_noise_dec_hf_ivas_fx( Word32 *ptr_level; Word32 *cngNoiseLevel; Word32 tmp1, tmp2; +#ifdef FIX_BASOP_2457_HARM_GEN + HANDLE_FD_CNG_COM hFdCngCom = st->hFdCngDec->hFdCngCom; +#endif // FIX_BASOP_2457_HARM_GEN cngNoiseLevel = hFdCngCom->cngNoiseLevel + sub( hFdCngCom->stopFFTbin, hFdCngCom->startBand ); /*Q31 - hFdCngCom->cngNoiseLevelExp*/ cngNoiseLevelExp = hFdCngCom->cngNoiseLevelExp; -- GitLab From 2a64f9759248cfca83c7a3a7d8803436e3d87648 Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Thu, 12 Mar 2026 16:48:39 +0100 Subject: [PATCH 03/22] issue: 2557 Further attempts at making ivas function harmonized --- lib_dec/fd_cng_dec_fx.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index 1c67f1e60..d50d70337 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -3572,8 +3572,17 @@ void generate_comfort_noise_dec_hf_ivas_fx( cngNoiseLevelExp = add( cngNoiseLevelExp, sn ); move16(); } - +#ifndef FIX_BASOP_2457_HARM_GEN randGaussExp = CNG_RAND_GAUSS_SHIFT + 1; +#else + IF(EQ_16(st->element_mode , EVS_MONO )) { + randGaussExp = CNG_RAND_GAUSS_SHIFT; + } + ELSE{ + randGaussExp = CNG_RAND_GAUSS_SHIFT + 1; + } +#endif // !FIX_BASOP_2457_HARM_GEN + move16(); /* @@ -3588,12 +3597,30 @@ void generate_comfort_noise_dec_hf_ivas_fx( FOR( j = hFdCngCom->numCoreBands; j < hFdCngCom->regularStopBand; j++ ) { +#ifdef FIX_BASOP_2457_HARM_GEN + IF(EQ_16(st->element_mode, EVS_MONO)) { + /* scaleCLDFB: CLDFBinvScalingFactor_EXP + 1 */ + s = 0; + move16(); + sqrtNoiseLevel = Sqrt32(L_shr(Mpy_32_16_1(*ptr_level, scaleCLDFB), sn), &s); /*Q31 - s*/ + } +#endif // FIX_BASOP_2457_HARM_GEN FOR( i = 0; i < hFdCngCom->numSlots; i++ ) { +#ifndef FIX_BASOP_2457_HARM_GEN /* scaleCLDFB: CLDFBinvScalingFactor_EXP + 1 */ s = 0; move16(); - sqrtNoiseLevel = Sqrt32( L_shr( Mpy_32_16_1( *ptr_level, scaleCLDFB ), sn ), &s ); /*Q31 - s*/ + sqrtNoiseLevel = Sqrt32(L_shr(Mpy_32_16_1(*ptr_level, scaleCLDFB), sn), &s); /*Q31 - s*/ +#else + IF(NE_16(st->element_mode, EVS_MONO)) { + /* scaleCLDFB: CLDFBinvScalingFactor_EXP + 1 */ + s = 0; + move16(); + sqrtNoiseLevel = Sqrt32(L_shr(Mpy_32_16_1(*ptr_level, scaleCLDFB), sn), &s); /*Q31 - s*/ + } +#endif // FIX_BASOP_2457_HARM_GEN + IF( cng_coh_flag ) { -- GitLab From e12cf9f7a79dd414e12dc858ca8c1343a2c0fb78 Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Thu, 12 Mar 2026 19:06:55 +0100 Subject: [PATCH 04/22] issue: 2457 Further attempts in harmonization, changing function instances. --- lib_dec/acelp_core_dec_fx.c | 9 ++++++++- lib_dec/fd_cng_dec_fx.c | 33 ++++++++++++++++++++++----------- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/lib_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index 760c12224..8f275884e 100644 --- a/lib_dec/acelp_core_dec_fx.c +++ b/lib_dec/acelp_core_dec_fx.c @@ -1838,8 +1838,15 @@ ivas_error acelp_core_dec_fx( test(); IF( ( ( st->core_brate == FRAME_NO_DATA ) || EQ_32( st->core_brate, SID_2k40 ) ) && ( EQ_16( st->cng_type, FD_CNG ) ) && ( LT_16( st->hFdCngDec->hFdCngCom->numCoreBands, st->cldfbSyn->no_channels ) ) ) { - generate_comfort_noise_dec_hf_fx( realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st ); +#ifndef FIX_BASOP_2457_HARM_GEN + generate_comfort_noise_dec_hf_fx(realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st); +#else + generate_comfort_noise_dec_hf_ivas_fx(realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st, , 0); + +#endif // !FIX_BASOP_2457_HARM_GEN + + st->cldfbSyn->bandsToZero = 0; move16(); IF( LT_16( st->hFdCngDec->hFdCngCom->regularStopBand, st->cldfbSyn->no_channels ) ) diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index d50d70337..57cf2959b 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -3510,7 +3510,9 @@ void generate_comfort_noise_dec_hf_ivas_fx( #ifdef FIX_BASOP_2457_HARM_GEN Decoder_State *st, #endif // FIX_BASOP_2457_HARM_GEN +#ifndef FIX_BASOP_2457_HARM_GEN HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ +#endif const Word16 cng_coh_flag /* i : CNG Flag for coherence handling Q0*/ ) { @@ -3527,6 +3529,7 @@ void generate_comfort_noise_dec_hf_ivas_fx( Word32 tmp1, tmp2; #ifdef FIX_BASOP_2457_HARM_GEN HANDLE_FD_CNG_COM hFdCngCom = st->hFdCngDec->hFdCngCom; + Word32 Random_gauss; #endif // FIX_BASOP_2457_HARM_GEN cngNoiseLevel = hFdCngCom->cngNoiseLevel + sub( hFdCngCom->stopFFTbin, hFdCngCom->startBand ); /*Q31 - hFdCngCom->cngNoiseLevelExp*/ @@ -3598,12 +3601,10 @@ void generate_comfort_noise_dec_hf_ivas_fx( FOR( j = hFdCngCom->numCoreBands; j < hFdCngCom->regularStopBand; j++ ) { #ifdef FIX_BASOP_2457_HARM_GEN - IF(EQ_16(st->element_mode, EVS_MONO)) { /* scaleCLDFB: CLDFBinvScalingFactor_EXP + 1 */ s = 0; move16(); sqrtNoiseLevel = Sqrt32(L_shr(Mpy_32_16_1(*ptr_level, scaleCLDFB), sn), &s); /*Q31 - s*/ - } #endif // FIX_BASOP_2457_HARM_GEN FOR( i = 0; i < hFdCngCom->numSlots; i++ ) { @@ -3612,13 +3613,6 @@ void generate_comfort_noise_dec_hf_ivas_fx( s = 0; move16(); sqrtNoiseLevel = Sqrt32(L_shr(Mpy_32_16_1(*ptr_level, scaleCLDFB), sn), &s); /*Q31 - s*/ -#else - IF(NE_16(st->element_mode, EVS_MONO)) { - /* scaleCLDFB: CLDFBinvScalingFactor_EXP + 1 */ - s = 0; - move16(); - sqrtNoiseLevel = Sqrt32(L_shr(Mpy_32_16_1(*ptr_level, scaleCLDFB), sn), &s); /*Q31 - s*/ - } #endif // FIX_BASOP_2457_HARM_GEN @@ -3642,13 +3636,30 @@ void generate_comfort_noise_dec_hf_ivas_fx( } ELSE { +#ifndef FIX_BASOP_2457_HARM_GEN /* Real part in CLDFB band */ - bufferReal[i][j] = L_shl( Mpy_32_32( L_shr( rand_gauss( seed ), 1 ), sqrtNoiseLevel ), s ); /*bufferScale*/ + bufferReal[i][j] = L_shl(Mpy_32_32(L_shr(rand_gauss(seed), 1), sqrtNoiseLevel), s); /*bufferScale*/ + move32(); + + /* Imaginary part in CLDFB band */ + bufferImag[i][j] = L_shl(Mpy_32_32(L_shr(rand_gauss(seed), 1), sqrtNoiseLevel), s); /*bufferScale*/ + move32(); +#else + IF(EQ_16(st->element_mode, EVS_MONO)) { + Random_gauss = rand_gauss(seed); + } + ELSE{ + Random_gauss = L_shr(rand_gauss(seed), 1); + } + /* Real part in CLDFB band */ + bufferReal[i][j] = L_shl(Mpy_32_32(Random_gauss, sqrtNoiseLevel), s); /*bufferScale*/ move32(); /* Imaginary part in CLDFB band */ - bufferImag[i][j] = L_shl( Mpy_32_32( L_shr( rand_gauss( seed ), 1 ), sqrtNoiseLevel ), s ); /*bufferScale*/ + bufferImag[i][j] = L_shl(Mpy_32_32(Random_gauss, sqrtNoiseLevel), s); /*bufferScale*/ move32(); +#endif // !FIX_BASOP_2457_HARM_GEN + } } ptr_level = ptr_level + 1; /*Q31 - hFdCngCom->cngNoiseLevelExp*/ -- GitLab From c94b70e8597dfa77ee007e8e32ca62620f248f35 Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Thu, 12 Mar 2026 19:18:49 +0100 Subject: [PATCH 05/22] issue: 2457 Clang formatting patch --- lib_dec/acelp_core_dec_fx.c | 6 ++--- lib_dec/fd_cng_dec_fx.c | 49 ++++++++++++++++++++----------------- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/lib_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index 8f275884e..035be263c 100644 --- a/lib_dec/acelp_core_dec_fx.c +++ b/lib_dec/acelp_core_dec_fx.c @@ -1839,14 +1839,14 @@ ivas_error acelp_core_dec_fx( IF( ( ( st->core_brate == FRAME_NO_DATA ) || EQ_32( st->core_brate, SID_2k40 ) ) && ( EQ_16( st->cng_type, FD_CNG ) ) && ( LT_16( st->hFdCngDec->hFdCngCom->numCoreBands, st->cldfbSyn->no_channels ) ) ) { #ifndef FIX_BASOP_2457_HARM_GEN - generate_comfort_noise_dec_hf_fx(realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st); + generate_comfort_noise_dec_hf_fx( realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st ); #else - generate_comfort_noise_dec_hf_ivas_fx(realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st, , 0); + generate_comfort_noise_dec_hf_ivas_fx( realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st, , 0 ); #endif // !FIX_BASOP_2457_HARM_GEN - + st->cldfbSyn->bandsToZero = 0; move16(); IF( LT_16( st->hFdCngDec->hFdCngCom->regularStopBand, st->cldfbSyn->no_channels ) ) diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index 57cf2959b..646e5b3ca 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -3504,16 +3504,16 @@ void generate_comfort_noise_dec_hf_fx( } void generate_comfort_noise_dec_hf_ivas_fx( - Word32 **bufferReal, /* o : matrix to real part of input bands bufferScale*/ - Word32 **bufferImag, /* o : matrix to imaginary part of input bands bufferScale*/ - Word16 *bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ + Word32 **bufferReal, /* o : matrix to real part of input bands bufferScale*/ + Word32 **bufferImag, /* o : matrix to imaginary part of input bands bufferScale*/ + Word16 *bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ #ifdef FIX_BASOP_2457_HARM_GEN Decoder_State *st, #endif // FIX_BASOP_2457_HARM_GEN #ifndef FIX_BASOP_2457_HARM_GEN HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ #endif - const Word16 cng_coh_flag /* i : CNG Flag for coherence handling Q0*/ + const Word16 cng_coh_flag /* i : CNG Flag for coherence handling Q0*/ ) { Word16 i, j, s, sc, sn; @@ -3578,10 +3578,12 @@ void generate_comfort_noise_dec_hf_ivas_fx( #ifndef FIX_BASOP_2457_HARM_GEN randGaussExp = CNG_RAND_GAUSS_SHIFT + 1; #else - IF(EQ_16(st->element_mode , EVS_MONO )) { + IF( EQ_16( st->element_mode, EVS_MONO ) ) + { randGaussExp = CNG_RAND_GAUSS_SHIFT; } - ELSE{ + ELSE + { randGaussExp = CNG_RAND_GAUSS_SHIFT + 1; } #endif // !FIX_BASOP_2457_HARM_GEN @@ -3601,19 +3603,19 @@ void generate_comfort_noise_dec_hf_ivas_fx( FOR( j = hFdCngCom->numCoreBands; j < hFdCngCom->regularStopBand; j++ ) { #ifdef FIX_BASOP_2457_HARM_GEN - /* scaleCLDFB: CLDFBinvScalingFactor_EXP + 1 */ - s = 0; - move16(); - sqrtNoiseLevel = Sqrt32(L_shr(Mpy_32_16_1(*ptr_level, scaleCLDFB), sn), &s); /*Q31 - s*/ -#endif // FIX_BASOP_2457_HARM_GEN + /* scaleCLDFB: CLDFBinvScalingFactor_EXP + 1 */ + s = 0; + move16(); + sqrtNoiseLevel = Sqrt32( L_shr( Mpy_32_16_1( *ptr_level, scaleCLDFB ), sn ), &s ); /*Q31 - s*/ +#endif // FIX_BASOP_2457_HARM_GEN FOR( i = 0; i < hFdCngCom->numSlots; i++ ) { #ifndef FIX_BASOP_2457_HARM_GEN /* scaleCLDFB: CLDFBinvScalingFactor_EXP + 1 */ s = 0; move16(); - sqrtNoiseLevel = Sqrt32(L_shr(Mpy_32_16_1(*ptr_level, scaleCLDFB), sn), &s); /*Q31 - s*/ -#endif // FIX_BASOP_2457_HARM_GEN + sqrtNoiseLevel = Sqrt32( L_shr( Mpy_32_16_1( *ptr_level, scaleCLDFB ), sn ), &s ); /*Q31 - s*/ +#endif // FIX_BASOP_2457_HARM_GEN IF( cng_coh_flag ) @@ -3638,28 +3640,29 @@ void generate_comfort_noise_dec_hf_ivas_fx( { #ifndef FIX_BASOP_2457_HARM_GEN /* Real part in CLDFB band */ - bufferReal[i][j] = L_shl(Mpy_32_32(L_shr(rand_gauss(seed), 1), sqrtNoiseLevel), s); /*bufferScale*/ + bufferReal[i][j] = L_shl( Mpy_32_32( L_shr( rand_gauss( seed ), 1 ), sqrtNoiseLevel ), s ); /*bufferScale*/ move32(); /* Imaginary part in CLDFB band */ - bufferImag[i][j] = L_shl(Mpy_32_32(L_shr(rand_gauss(seed), 1), sqrtNoiseLevel), s); /*bufferScale*/ + bufferImag[i][j] = L_shl( Mpy_32_32( L_shr( rand_gauss( seed ), 1 ), sqrtNoiseLevel ), s ); /*bufferScale*/ move32(); #else - IF(EQ_16(st->element_mode, EVS_MONO)) { - Random_gauss = rand_gauss(seed); + IF( EQ_16( st->element_mode, EVS_MONO ) ) + { + Random_gauss = rand_gauss( seed ); } - ELSE{ - Random_gauss = L_shr(rand_gauss(seed), 1); + ELSE + { + Random_gauss = L_shr( rand_gauss( seed ), 1 ); } - /* Real part in CLDFB band */ - bufferReal[i][j] = L_shl(Mpy_32_32(Random_gauss, sqrtNoiseLevel), s); /*bufferScale*/ + /* Real part in CLDFB band */ + bufferReal[i][j] = L_shl( Mpy_32_32( Random_gauss, sqrtNoiseLevel ), s ); /*bufferScale*/ move32(); /* Imaginary part in CLDFB band */ - bufferImag[i][j] = L_shl(Mpy_32_32(Random_gauss, sqrtNoiseLevel), s); /*bufferScale*/ + bufferImag[i][j] = L_shl( Mpy_32_32( Random_gauss, sqrtNoiseLevel ), s ); /*bufferScale*/ move32(); #endif // !FIX_BASOP_2457_HARM_GEN - } } ptr_level = ptr_level + 1; /*Q31 - hFdCngCom->cngNoiseLevelExp*/ -- GitLab From 92efdf94ffa5d8aa62b07d5c5d37c2bdbe325d1a Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Thu, 12 Mar 2026 19:22:37 +0100 Subject: [PATCH 06/22] issue: 2457 Changing Function declaration according to definition --- lib_com/prot_fx.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 152a3612a..29ebe7404 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -6910,11 +6910,16 @@ void generate_comfort_noise_dec_hf_fx( Decoder_State *stdec ); void generate_comfort_noise_dec_hf_ivas_fx( - Word32 **bufferReal, /* o : matrix to real part of input bands */ - Word32 **bufferImag, /* o : matrix to imaginary part of input bands */ - Word16 *bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ + Word32** bufferReal, /* o : matrix to real part of input bands */ + Word32** bufferImag, /* o : matrix to imaginary part of input bands */ + Word16* bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ +#ifdef FIX_BASOP_2457_HARM_GEN + Decoder_State* st, +#endif // FIX_BASOP_2457_HARM_GEN +#ifndef FIX_BASOP_2457_HARM_GEN HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ - const Word16 cng_coh_flag /* i : CNG Flag for coherence handling */ +#endif + const Word16 cng_coh_flag /* i : CNG Flag for coherence handling Q0*/ ); /* Generate the comfort noise based on the target noise level */ -- GitLab From a23a8faeb952419649773a56cf93c7015b7e7916 Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Thu, 12 Mar 2026 19:24:29 +0100 Subject: [PATCH 07/22] issue: 2457 Clang formatting patch --- lib_com/prot_fx.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 29ebe7404..706488d32 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -6910,11 +6910,11 @@ void generate_comfort_noise_dec_hf_fx( Decoder_State *stdec ); void generate_comfort_noise_dec_hf_ivas_fx( - Word32** bufferReal, /* o : matrix to real part of input bands */ - Word32** bufferImag, /* o : matrix to imaginary part of input bands */ - Word16* bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ + Word32 **bufferReal, /* o : matrix to real part of input bands */ + Word32 **bufferImag, /* o : matrix to imaginary part of input bands */ + Word16 *bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ #ifdef FIX_BASOP_2457_HARM_GEN - Decoder_State* st, + Decoder_State *st, #endif // FIX_BASOP_2457_HARM_GEN #ifndef FIX_BASOP_2457_HARM_GEN HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ -- GitLab From 4fbb5d06de77125ffb77ce9c181dd3b6cb341e16 Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Thu, 12 Mar 2026 19:28:42 +0100 Subject: [PATCH 08/22] issue: 2457 Removing extra unused input argument for one function instance --- lib_dec/acelp_core_dec_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index 035be263c..83f1f4b39 100644 --- a/lib_dec/acelp_core_dec_fx.c +++ b/lib_dec/acelp_core_dec_fx.c @@ -1842,7 +1842,7 @@ ivas_error acelp_core_dec_fx( generate_comfort_noise_dec_hf_fx( realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st ); #else - generate_comfort_noise_dec_hf_ivas_fx( realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st, , 0 ); + generate_comfort_noise_dec_hf_ivas_fx( realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st, 0 ); #endif // !FIX_BASOP_2457_HARM_GEN -- GitLab From 74063031da0b90f4b299c30a08208aaf3a5a9077 Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Fri, 13 Mar 2026 10:42:37 +0100 Subject: [PATCH 09/22] issue: 2457 Changing one argument in one instance according to changes in function signature. --- lib_dec/acelp_core_dec_fx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index 83f1f4b39..45f2e8a2a 100644 --- a/lib_dec/acelp_core_dec_fx.c +++ b/lib_dec/acelp_core_dec_fx.c @@ -2010,8 +2010,13 @@ ivas_error acelp_core_dec_fx( { Word16 tmpBufferScale = 0; move16(); - generate_comfort_noise_dec_hf_ivas_fx( realBuffer_fx, imagBuffer_fx, /*realBuffer, imagBuffer,*/ &tmpBufferScale, st->hFdCngDec->hFdCngCom, st->cng_ism_flag ); +#ifndef FIX_BASOP_2457_HARM_GEN + generate_comfort_noise_dec_hf_ivas_fx(realBuffer_fx, imagBuffer_fx, /*realBuffer, imagBuffer,*/ &tmpBufferScale, st->hFdCngDec->hFdCngCom, st->cng_ism_flag); +#else + generate_comfort_noise_dec_hf_ivas_fx(realBuffer_fx, imagBuffer_fx, /*realBuffer, imagBuffer,*/ &tmpBufferScale, st, st->cng_ism_flag); +#endif // !FIX_BASOP_2457_HARM_GEN + FOR( i = 0; i < st->hFdCngDec->hFdCngCom->numSlots; i++ ) { Scale_sig32( realBuffer_fx[i] + st->hFdCngDec->hFdCngCom->numCoreBands, sub( st->hFdCngDec->hFdCngCom->regularStopBand, st->hFdCngDec->hFdCngCom->numCoreBands ), sub( add( tmpBufferScale, 15 ), Q31 ) ); // Q0 -- GitLab From e17074d052c7d0d089bac4e602f002169b9cc08c Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Fri, 13 Mar 2026 10:46:17 +0100 Subject: [PATCH 10/22] issue: 2457 Clang formatting patch --- lib_dec/acelp_core_dec_fx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index 45f2e8a2a..2cc2a373d 100644 --- a/lib_dec/acelp_core_dec_fx.c +++ b/lib_dec/acelp_core_dec_fx.c @@ -2011,12 +2011,12 @@ ivas_error acelp_core_dec_fx( Word16 tmpBufferScale = 0; move16(); #ifndef FIX_BASOP_2457_HARM_GEN - generate_comfort_noise_dec_hf_ivas_fx(realBuffer_fx, imagBuffer_fx, /*realBuffer, imagBuffer,*/ &tmpBufferScale, st->hFdCngDec->hFdCngCom, st->cng_ism_flag); + generate_comfort_noise_dec_hf_ivas_fx( realBuffer_fx, imagBuffer_fx, /*realBuffer, imagBuffer,*/ &tmpBufferScale, st->hFdCngDec->hFdCngCom, st->cng_ism_flag ); #else - generate_comfort_noise_dec_hf_ivas_fx(realBuffer_fx, imagBuffer_fx, /*realBuffer, imagBuffer,*/ &tmpBufferScale, st, st->cng_ism_flag); + generate_comfort_noise_dec_hf_ivas_fx( realBuffer_fx, imagBuffer_fx, /*realBuffer, imagBuffer,*/ &tmpBufferScale, st, st->cng_ism_flag ); #endif // !FIX_BASOP_2457_HARM_GEN - + FOR( i = 0; i < st->hFdCngDec->hFdCngCom->numSlots; i++ ) { Scale_sig32( realBuffer_fx[i] + st->hFdCngDec->hFdCngCom->numCoreBands, sub( st->hFdCngDec->hFdCngCom->regularStopBand, st->hFdCngDec->hFdCngCom->numCoreBands ), sub( add( tmpBufferScale, 15 ), Q31 ) ); // Q0 -- GitLab From 1d1dff0abad6d1a9fa3177cd418de64985339541 Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Fri, 13 Mar 2026 15:12:36 +0100 Subject: [PATCH 11/22] issue: 2457 Fixing Problem with random numbers that were mistakenly unified whereas they shouldn't --- lib_dec/fd_cng_dec_fx.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index 646e5b3ca..1f3cee3c5 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -3649,19 +3649,26 @@ void generate_comfort_noise_dec_hf_ivas_fx( #else IF( EQ_16( st->element_mode, EVS_MONO ) ) { - Random_gauss = rand_gauss( seed ); + /* Real part in CLDFB band */ + bufferReal[i][j] = L_shl(Mpy_32_32(rand_gauss(seed), sqrtNoiseLevel), s); /*bufferScale*/ + move32(); + /*fprintf(pFile,"%13.10f\n",WORD322FL_SCALE(bufferReal[i][j],sc));*/ + + /* Imaginary part in CLDFB band */ + bufferImag[i][j] = L_shl(Mpy_32_32(rand_gauss(seed), sqrtNoiseLevel), s); /*bufferScale*/ + move32(); + /*fprintf(pFile,"%13.10f\n",WORD322FL_SCALE(bufferImag[i][j],sc));*/ } ELSE { - Random_gauss = L_shr( rand_gauss( seed ), 1 ); - } - /* Real part in CLDFB band */ - bufferReal[i][j] = L_shl( Mpy_32_32( Random_gauss, sqrtNoiseLevel ), s ); /*bufferScale*/ - move32(); + /* Real part in CLDFB band */ + bufferReal[i][j] = L_shl(Mpy_32_32(L_shr(rand_gauss(seed), 1), sqrtNoiseLevel), s); /*bufferScale*/ + move32(); - /* Imaginary part in CLDFB band */ - bufferImag[i][j] = L_shl( Mpy_32_32( Random_gauss, sqrtNoiseLevel ), s ); /*bufferScale*/ - move32(); + /* Imaginary part in CLDFB band */ + bufferImag[i][j] = L_shl(Mpy_32_32(L_shr(rand_gauss(seed), 1), sqrtNoiseLevel), s); /*bufferScale*/ + move32(); + } #endif // !FIX_BASOP_2457_HARM_GEN } } -- GitLab From 0af11dde7cf98a4a51356cf9e0f322be0e0aeb9f Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Fri, 13 Mar 2026 15:20:13 +0100 Subject: [PATCH 12/22] issue: 2457 Clang formatting patch --- lib_dec/fd_cng_dec_fx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index 1f3cee3c5..444611e8d 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -3650,23 +3650,23 @@ void generate_comfort_noise_dec_hf_ivas_fx( IF( EQ_16( st->element_mode, EVS_MONO ) ) { /* Real part in CLDFB band */ - bufferReal[i][j] = L_shl(Mpy_32_32(rand_gauss(seed), sqrtNoiseLevel), s); /*bufferScale*/ + bufferReal[i][j] = L_shl( Mpy_32_32( rand_gauss( seed ), sqrtNoiseLevel ), s ); /*bufferScale*/ move32(); /*fprintf(pFile,"%13.10f\n",WORD322FL_SCALE(bufferReal[i][j],sc));*/ /* Imaginary part in CLDFB band */ - bufferImag[i][j] = L_shl(Mpy_32_32(rand_gauss(seed), sqrtNoiseLevel), s); /*bufferScale*/ + bufferImag[i][j] = L_shl( Mpy_32_32( rand_gauss( seed ), sqrtNoiseLevel ), s ); /*bufferScale*/ move32(); /*fprintf(pFile,"%13.10f\n",WORD322FL_SCALE(bufferImag[i][j],sc));*/ } ELSE { /* Real part in CLDFB band */ - bufferReal[i][j] = L_shl(Mpy_32_32(L_shr(rand_gauss(seed), 1), sqrtNoiseLevel), s); /*bufferScale*/ + bufferReal[i][j] = L_shl( Mpy_32_32( L_shr( rand_gauss( seed ), 1 ), sqrtNoiseLevel ), s ); /*bufferScale*/ move32(); /* Imaginary part in CLDFB band */ - bufferImag[i][j] = L_shl(Mpy_32_32(L_shr(rand_gauss(seed), 1), sqrtNoiseLevel), s); /*bufferScale*/ + bufferImag[i][j] = L_shl( Mpy_32_32( L_shr( rand_gauss( seed ), 1 ), sqrtNoiseLevel ), s ); /*bufferScale*/ move32(); } #endif // !FIX_BASOP_2457_HARM_GEN -- GitLab From 6a03103d88aedb92aaaa58293111548689a0b61c Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Fri, 13 Mar 2026 15:23:12 +0100 Subject: [PATCH 13/22] issue: 2457 Removing redundant variable definition --- lib_dec/fd_cng_dec_fx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index 444611e8d..6254b2dcf 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -3529,7 +3529,6 @@ void generate_comfort_noise_dec_hf_ivas_fx( Word32 tmp1, tmp2; #ifdef FIX_BASOP_2457_HARM_GEN HANDLE_FD_CNG_COM hFdCngCom = st->hFdCngDec->hFdCngCom; - Word32 Random_gauss; #endif // FIX_BASOP_2457_HARM_GEN cngNoiseLevel = hFdCngCom->cngNoiseLevel + sub( hFdCngCom->stopFFTbin, hFdCngCom->startBand ); /*Q31 - hFdCngCom->cngNoiseLevelExp*/ -- GitLab From fee16fab722434953ee6f1ffad1b5ac0b28ca48b Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Fri, 13 Mar 2026 16:28:27 +0100 Subject: [PATCH 14/22] issue: 2457 Removing legacy function and renaming the Ivas function to fx(), Renaming instances. --- lib_com/prot_fx.h | 2 ++ lib_dec/acelp_core_dec_fx.c | 4 ++-- lib_dec/fd_cng_dec_fx.c | 7 +++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 5e63ec303..f2daa777e 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -6911,11 +6911,13 @@ void generate_comfort_noise_dec_ivas_fx( const Word16 nchan_out /* i : number of output channels */ ); +#ifndef FIX_BASOP_2457_HARM_GEN void generate_comfort_noise_dec_hf_fx( Word32 **bufferReal, /* o : matrix to real part of i bands */ Word32 **bufferImag, /* o : matrix to imaginary part of i bands */ Word16 *bufferScale, /* o : pointer to scalefactor for real and imaginary part of i bands */ Decoder_State *stdec ); +#endif void generate_comfort_noise_dec_hf_ivas_fx( Word32 **bufferReal, /* o : matrix to real part of input bands */ diff --git a/lib_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index 2cc2a373d..baac31d34 100644 --- a/lib_dec/acelp_core_dec_fx.c +++ b/lib_dec/acelp_core_dec_fx.c @@ -1842,7 +1842,7 @@ ivas_error acelp_core_dec_fx( generate_comfort_noise_dec_hf_fx( realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st ); #else - generate_comfort_noise_dec_hf_ivas_fx( realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st, 0 ); + generate_comfort_noise_dec_hf_fx( realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st, 0 ); #endif // !FIX_BASOP_2457_HARM_GEN @@ -2013,7 +2013,7 @@ ivas_error acelp_core_dec_fx( #ifndef FIX_BASOP_2457_HARM_GEN generate_comfort_noise_dec_hf_ivas_fx( realBuffer_fx, imagBuffer_fx, /*realBuffer, imagBuffer,*/ &tmpBufferScale, st->hFdCngDec->hFdCngCom, st->cng_ism_flag ); #else - generate_comfort_noise_dec_hf_ivas_fx( realBuffer_fx, imagBuffer_fx, /*realBuffer, imagBuffer,*/ &tmpBufferScale, st, st->cng_ism_flag ); + generate_comfort_noise_dec_hf_fx( realBuffer_fx, imagBuffer_fx, /*realBuffer, imagBuffer,*/ &tmpBufferScale, st, st->cng_ism_flag ); #endif // !FIX_BASOP_2457_HARM_GEN diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index 6254b2dcf..cd34d50f1 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -3434,6 +3434,7 @@ void generate_comfort_noise_dec_ivas_fx( return; } +#ifndef FIX_BASOP_2457_HARM_GEN void generate_comfort_noise_dec_hf_fx( Word32 **bufferReal, /* o : matrix to real part of input bands bufferScale*/ Word32 **bufferImag, /* o : matrix to imaginary part of input bands bufferScale*/ @@ -3503,7 +3504,13 @@ void generate_comfort_noise_dec_hf_fx( } } +#endif // !FIX_BASOP_2457_HARM_GEN + +#ifndef FIX_BASOP_2457_HARM_GEN void generate_comfort_noise_dec_hf_ivas_fx( +#else +void generate_comfort_noise_dec_hf_fx( +#endif // !FIX_BASOP_2457_HARM_GEN Word32 **bufferReal, /* o : matrix to real part of input bands bufferScale*/ Word32 **bufferImag, /* o : matrix to imaginary part of input bands bufferScale*/ Word16 *bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ -- GitLab From 56d61f6d4ec40d0f2bd67aea000adcce2b041ae5 Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Mon, 16 Mar 2026 09:45:34 +0100 Subject: [PATCH 15/22] issue: 2457 replacing a zero flag with The flag from decoder state to see if the tests run well again! --- lib_dec/acelp_core_dec_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index baac31d34..e38e73c0b 100644 --- a/lib_dec/acelp_core_dec_fx.c +++ b/lib_dec/acelp_core_dec_fx.c @@ -1842,7 +1842,7 @@ ivas_error acelp_core_dec_fx( generate_comfort_noise_dec_hf_fx( realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st ); #else - generate_comfort_noise_dec_hf_fx( realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st, 0 ); + generate_comfort_noise_dec_hf_fx( realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st, st->cng_ism_flag); #endif // !FIX_BASOP_2457_HARM_GEN -- GitLab From 31f8b0d7a04715d69182524ffab47ec65f1eb765 Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Mon, 16 Mar 2026 10:01:15 +0100 Subject: [PATCH 16/22] issue: 2457 Clang formatting patch --- lib_dec/acelp_core_dec_fx.c | 2 +- lib_dec/fd_cng_dec_fx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index e38e73c0b..df0e3eb86 100644 --- a/lib_dec/acelp_core_dec_fx.c +++ b/lib_dec/acelp_core_dec_fx.c @@ -1842,7 +1842,7 @@ ivas_error acelp_core_dec_fx( generate_comfort_noise_dec_hf_fx( realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st ); #else - generate_comfort_noise_dec_hf_fx( realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st, st->cng_ism_flag); + generate_comfort_noise_dec_hf_fx( realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st, st->cng_ism_flag ); #endif // !FIX_BASOP_2457_HARM_GEN diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index cd34d50f1..a6a6118db 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -3510,7 +3510,7 @@ void generate_comfort_noise_dec_hf_fx( void generate_comfort_noise_dec_hf_ivas_fx( #else void generate_comfort_noise_dec_hf_fx( -#endif // !FIX_BASOP_2457_HARM_GEN +#endif // !FIX_BASOP_2457_HARM_GEN Word32 **bufferReal, /* o : matrix to real part of input bands bufferScale*/ Word32 **bufferImag, /* o : matrix to imaginary part of input bands bufferScale*/ Word16 *bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ -- GitLab From ba77116985a489c0af9b33f52655c1dcdd5a8191 Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Mon, 16 Mar 2026 10:09:37 +0100 Subject: [PATCH 17/22] issue: 2457 Fixing corrupted function declaration --- lib_com/prot_fx.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 2a5e38df3..c431a463e 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -6758,8 +6758,11 @@ void generate_comfort_noise_dec_hf_fx( Word16 *bufferScale, /* o : pointer to scalefactor for real and imaginary part of i bands */ Decoder_State *stdec ); #endif - +#ifndef FIX_BASOP_2457_HARM_GEN void generate_comfort_noise_dec_hf_ivas_fx( +#else +generate_comfort_noise_dec_hf_fx( +#endif Word32 **bufferReal, /* o : matrix to real part of input bands */ Word32 **bufferImag, /* o : matrix to imaginary part of input bands */ Word16 *bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ -- GitLab From 869474f48715bdd8f21347b0fa16d2ce223f5f90 Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Mon, 16 Mar 2026 10:15:37 +0100 Subject: [PATCH 18/22] issue: 2457 Clang Formatting Patch --- lib_com/prot_fx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index c431a463e..1bace4f8a 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -6760,7 +6760,7 @@ void generate_comfort_noise_dec_hf_fx( #endif #ifndef FIX_BASOP_2457_HARM_GEN void generate_comfort_noise_dec_hf_ivas_fx( -#else +#else generate_comfort_noise_dec_hf_fx( #endif Word32 **bufferReal, /* o : matrix to real part of input bands */ -- GitLab From 22209f31d6765c75f465a180d3473986aa5958cf Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Mon, 16 Mar 2026 10:20:50 +0100 Subject: [PATCH 19/22] issue: 2457 Fixing missing return void value in declaration --- lib_com/prot_fx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 1bace4f8a..cfed4d31f 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -6761,7 +6761,7 @@ void generate_comfort_noise_dec_hf_fx( #ifndef FIX_BASOP_2457_HARM_GEN void generate_comfort_noise_dec_hf_ivas_fx( #else -generate_comfort_noise_dec_hf_fx( +void generate_comfort_noise_dec_hf_fx( #endif Word32 **bufferReal, /* o : matrix to real part of input bands */ Word32 **bufferImag, /* o : matrix to imaginary part of input bands */ -- GitLab From 7d2f94e160a88609cbeeeb74507257a1c6b70bd9 Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Mon, 16 Mar 2026 11:06:20 +0100 Subject: [PATCH 20/22] issue: 2457 Editorial changes to function signature and input arguments. removing suc structures of Decoder state. Passing only The whole structure to the Function. Changing function instances according to this change --- lib_com/prot_fx.h | 29 +++++++++++------------------ lib_dec/acelp_core_dec_fx.c | 4 ++-- lib_dec/fd_cng_dec_fx.c | 23 ++++++++++++----------- 3 files changed, 25 insertions(+), 31 deletions(-) diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index cfed4d31f..718a339f3 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -6751,29 +6751,22 @@ void generate_comfort_noise_dec_ivas_fx( const Word16 nchan_out /* i : number of output channels */ ); -#ifndef FIX_BASOP_2457_HARM_GEN -void generate_comfort_noise_dec_hf_fx( - Word32 **bufferReal, /* o : matrix to real part of i bands */ - Word32 **bufferImag, /* o : matrix to imaginary part of i bands */ - Word16 *bufferScale, /* o : pointer to scalefactor for real and imaginary part of i bands */ - Decoder_State *stdec ); -#endif #ifndef FIX_BASOP_2457_HARM_GEN void generate_comfort_noise_dec_hf_ivas_fx( -#else -void generate_comfort_noise_dec_hf_fx( -#endif - Word32 **bufferReal, /* o : matrix to real part of input bands */ - Word32 **bufferImag, /* o : matrix to imaginary part of input bands */ - Word16 *bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ -#ifdef FIX_BASOP_2457_HARM_GEN - Decoder_State *st, -#endif // FIX_BASOP_2457_HARM_GEN -#ifndef FIX_BASOP_2457_HARM_GEN + Word32** bufferReal, /* o : matrix to real part of input bands bufferScale*/ + Word32** bufferImag, /* o : matrix to imaginary part of input bands bufferScale*/ + Word16* bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ -#endif const Word16 cng_coh_flag /* i : CNG Flag for coherence handling Q0*/ ); +#endif + +void generate_comfort_noise_dec_hf_fx( + Word32** bufferReal, /* o : matrix to real part of input bands bufferScale*/ + Word32** bufferImag, /* o : matrix to imaginary part of input bands bufferScale*/ + Word16* bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ + Decoder_State* st +); /* Generate the comfort noise based on the target noise level */ void generate_masking_noise_fx( diff --git a/lib_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index df0e3eb86..f30672429 100644 --- a/lib_dec/acelp_core_dec_fx.c +++ b/lib_dec/acelp_core_dec_fx.c @@ -1842,7 +1842,7 @@ ivas_error acelp_core_dec_fx( generate_comfort_noise_dec_hf_fx( realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st ); #else - generate_comfort_noise_dec_hf_fx( realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st, st->cng_ism_flag ); + generate_comfort_noise_dec_hf_fx( realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st ); #endif // !FIX_BASOP_2457_HARM_GEN @@ -2013,7 +2013,7 @@ ivas_error acelp_core_dec_fx( #ifndef FIX_BASOP_2457_HARM_GEN generate_comfort_noise_dec_hf_ivas_fx( realBuffer_fx, imagBuffer_fx, /*realBuffer, imagBuffer,*/ &tmpBufferScale, st->hFdCngDec->hFdCngCom, st->cng_ism_flag ); #else - generate_comfort_noise_dec_hf_fx( realBuffer_fx, imagBuffer_fx, /*realBuffer, imagBuffer,*/ &tmpBufferScale, st, st->cng_ism_flag ); + generate_comfort_noise_dec_hf_fx( realBuffer_fx, imagBuffer_fx, /*realBuffer, imagBuffer,*/ &tmpBufferScale, st ); #endif // !FIX_BASOP_2457_HARM_GEN diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index a6a6118db..9f99d5000 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -3508,20 +3508,20 @@ void generate_comfort_noise_dec_hf_fx( #ifndef FIX_BASOP_2457_HARM_GEN void generate_comfort_noise_dec_hf_ivas_fx( -#else -void generate_comfort_noise_dec_hf_fx( -#endif // !FIX_BASOP_2457_HARM_GEN - Word32 **bufferReal, /* o : matrix to real part of input bands bufferScale*/ - Word32 **bufferImag, /* o : matrix to imaginary part of input bands bufferScale*/ - Word16 *bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ -#ifdef FIX_BASOP_2457_HARM_GEN - Decoder_State *st, -#endif // FIX_BASOP_2457_HARM_GEN -#ifndef FIX_BASOP_2457_HARM_GEN + Word32** bufferReal, /* o : matrix to real part of input bands bufferScale*/ + Word32** bufferImag, /* o : matrix to imaginary part of input bands bufferScale*/ + Word16* bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ -#endif const Word16 cng_coh_flag /* i : CNG Flag for coherence handling Q0*/ ) +#else +void generate_comfort_noise_dec_hf_fx( + Word32** bufferReal, /* o : matrix to real part of input bands bufferScale*/ + Word32** bufferImag, /* o : matrix to imaginary part of input bands bufferScale*/ + Word16* bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ + Decoder_State *st +) +#endif { Word16 i, j, s, sc, sn; Word16 scaleCLDFB; @@ -3536,6 +3536,7 @@ void generate_comfort_noise_dec_hf_fx( Word32 tmp1, tmp2; #ifdef FIX_BASOP_2457_HARM_GEN HANDLE_FD_CNG_COM hFdCngCom = st->hFdCngDec->hFdCngCom; + Word16 cng_coh_flag = st->cng_ism_flag; #endif // FIX_BASOP_2457_HARM_GEN cngNoiseLevel = hFdCngCom->cngNoiseLevel + sub( hFdCngCom->stopFFTbin, hFdCngCom->startBand ); /*Q31 - hFdCngCom->cngNoiseLevelExp*/ -- GitLab From e16d4bd5c47df42b7005d217ad57a79a8b930775 Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Mon, 16 Mar 2026 12:45:22 +0100 Subject: [PATCH 21/22] issue: 2457 Clang formatting patch --- lib_com/prot_fx.h | 17 ++++++++--------- lib_dec/fd_cng_dec_fx.c | 17 ++++++++--------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 718a339f3..fb70f1932 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -6753,20 +6753,19 @@ void generate_comfort_noise_dec_ivas_fx( #ifndef FIX_BASOP_2457_HARM_GEN void generate_comfort_noise_dec_hf_ivas_fx( - Word32** bufferReal, /* o : matrix to real part of input bands bufferScale*/ - Word32** bufferImag, /* o : matrix to imaginary part of input bands bufferScale*/ - Word16* bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ + Word32 **bufferReal, /* o : matrix to real part of input bands bufferScale*/ + Word32 **bufferImag, /* o : matrix to imaginary part of input bands bufferScale*/ + Word16 *bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ - const Word16 cng_coh_flag /* i : CNG Flag for coherence handling Q0*/ + const Word16 cng_coh_flag /* i : CNG Flag for coherence handling Q0*/ ); #endif void generate_comfort_noise_dec_hf_fx( - Word32** bufferReal, /* o : matrix to real part of input bands bufferScale*/ - Word32** bufferImag, /* o : matrix to imaginary part of input bands bufferScale*/ - Word16* bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ - Decoder_State* st -); + Word32 **bufferReal, /* o : matrix to real part of input bands bufferScale*/ + Word32 **bufferImag, /* o : matrix to imaginary part of input bands bufferScale*/ + Word16 *bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ + Decoder_State *st ); /* Generate the comfort noise based on the target noise level */ void generate_masking_noise_fx( diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index 9f99d5000..a737a4908 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -3508,19 +3508,18 @@ void generate_comfort_noise_dec_hf_fx( #ifndef FIX_BASOP_2457_HARM_GEN void generate_comfort_noise_dec_hf_ivas_fx( - Word32** bufferReal, /* o : matrix to real part of input bands bufferScale*/ - Word32** bufferImag, /* o : matrix to imaginary part of input bands bufferScale*/ - Word16* bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ + Word32 **bufferReal, /* o : matrix to real part of input bands bufferScale*/ + Word32 **bufferImag, /* o : matrix to imaginary part of input bands bufferScale*/ + Word16 *bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ - const Word16 cng_coh_flag /* i : CNG Flag for coherence handling Q0*/ + const Word16 cng_coh_flag /* i : CNG Flag for coherence handling Q0*/ ) #else void generate_comfort_noise_dec_hf_fx( - Word32** bufferReal, /* o : matrix to real part of input bands bufferScale*/ - Word32** bufferImag, /* o : matrix to imaginary part of input bands bufferScale*/ - Word16* bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ - Decoder_State *st -) + Word32 **bufferReal, /* o : matrix to real part of input bands bufferScale*/ + Word32 **bufferImag, /* o : matrix to imaginary part of input bands bufferScale*/ + Word16 *bufferScale, /* o : pointer to scalefactor for real and imaginary part of input bands */ + Decoder_State *st ) #endif { Word16 i, j, s, sc, sn; -- GitLab From 7dd73aad3e3babbecb5ad36f9ee09fe87498e4f5 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 16 Mar 2026 16:46:33 +0100 Subject: [PATCH 22/22] revert unncessary changes --- lib_dec/acelp_core_dec_fx.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index f30672429..b192eb852 100644 --- a/lib_dec/acelp_core_dec_fx.c +++ b/lib_dec/acelp_core_dec_fx.c @@ -1838,15 +1838,8 @@ ivas_error acelp_core_dec_fx( test(); IF( ( ( st->core_brate == FRAME_NO_DATA ) || EQ_32( st->core_brate, SID_2k40 ) ) && ( EQ_16( st->cng_type, FD_CNG ) ) && ( LT_16( st->hFdCngDec->hFdCngCom->numCoreBands, st->cldfbSyn->no_channels ) ) ) { -#ifndef FIX_BASOP_2457_HARM_GEN - generate_comfort_noise_dec_hf_fx( realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st ); - -#else generate_comfort_noise_dec_hf_fx( realBuffer_fx, imagBuffer_fx, &scaleFactor.hb_scale, st ); -#endif // !FIX_BASOP_2457_HARM_GEN - - st->cldfbSyn->bandsToZero = 0; move16(); IF( LT_16( st->hFdCngDec->hFdCngCom->regularStopBand, st->cldfbSyn->no_channels ) ) -- GitLab