From 37df1dacfb567f69943c8315c44cdecdc317160a Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Wed, 6 Dec 2023 10:40:44 +0100 Subject: [PATCH] fix #931: run the TCX core noise filling substitution for the Stereo IGF decoder on the correct spectra in case of no IGF whitening --- lib_com/options.h | 1 + lib_dec/igf_dec.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index d8bed8d76f..ecd15c9194 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -184,6 +184,7 @@ #define NONBE_FIX_855_JBM_FLUSH_OFFSET /* FhG: issue #855: add missing switch here for the code in JBM flushing */ #define NONBE_FIX_926_OSBA_DECODER_CRASH_PLANAR_SBA /* FhG: issue 926: crash in OSBA decoding with planar FOA */ #define NONBE_FIX_908_OSBA_BR_SWITCHING_CRASH /* FhG: issue 908: fix crash in OSBA BR switching with long test vectors */ +#define NONBE_FIX_931_IGF_STEREO_DEC_NOISE /* FhG: issue #931: fix noise substitution in the stereo IGF decoder */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/igf_dec.c b/lib_dec/igf_dec.c index 8095f6da41..5c727e3949 100755 --- a/lib_dec/igf_dec.c +++ b/lib_dec/igf_dec.c @@ -490,7 +490,11 @@ static void IGF_prepStereo( { if ( hPrivateDataL->n_noise_bands_off ) { +#ifdef NONBE_FIX_931_IGF_STEREO_DEC_NOISE + IGF_replaceTCXNoise_2_new( src_specL, TCXNoiseL, strt_cpy, stop, hPrivateDataL->totalNoiseNrg_off, hPrivateDataL->n_noise_bands_off, hInfoL->nfSeed ); +#else IGF_replaceTCXNoise_2_new( igf_specL, TCXNoiseL, strt_cpy, stop, hPrivateDataL->totalNoiseNrg_off, hPrivateDataL->n_noise_bands_off, hInfoL->nfSeed ); +#endif } sel_specL = src_specL; } @@ -507,7 +511,11 @@ static void IGF_prepStereo( { if ( hPrivateDataR->n_noise_bands_off ) { +#ifdef NONBE_FIX_931_IGF_STEREO_DEC_NOISE + IGF_replaceTCXNoise_2_new( src_specR, TCXNoiseR, strt_cpy, stop, hPrivateDataR->totalNoiseNrg_off, hPrivateDataR->n_noise_bands_off, hInfoR->nfSeed ); +#else IGF_replaceTCXNoise_2_new( igf_specR, TCXNoiseR, strt_cpy, stop, hPrivateDataR->totalNoiseNrg_off, hPrivateDataR->n_noise_bands_off, hInfoR->nfSeed ); +#endif } sel_specR = src_specR; } @@ -574,7 +582,11 @@ static void IGF_prepStereo( { if ( hPrivateDataL->n_noise_bands_off ) { +#ifdef NONBE_FIX_931_IGF_STEREO_DEC_NOISE + IGF_replaceTCXNoise_2_new( src_specL, TCXNoiseL, strt_cpy, stop, hPrivateDataL->totalNoiseNrg_off, hPrivateDataL->n_noise_bands_off, hInfoL->nfSeed ); +#else IGF_replaceTCXNoise_2_new( igf_specL, TCXNoiseL, strt_cpy, stop, hPrivateDataL->totalNoiseNrg_off, hPrivateDataL->n_noise_bands_off, hInfoL->nfSeed ); +#endif } sel_specL = src_specL; } @@ -591,7 +603,11 @@ static void IGF_prepStereo( { if ( hPrivateDataR->n_noise_bands_off ) { +#ifdef NONBE_FIX_931_IGF_STEREO_DEC_NOISE + IGF_replaceTCXNoise_2_new( src_specR, TCXNoiseR, strt_cpy, stop, hPrivateDataR->totalNoiseNrg_off, hPrivateDataR->n_noise_bands_off, hInfoR->nfSeed ); +#else IGF_replaceTCXNoise_2_new( igf_specR, TCXNoiseR, strt_cpy, stop, hPrivateDataR->totalNoiseNrg_off, hPrivateDataR->n_noise_bands_off, hInfoR->nfSeed ); +#endif } sel_specR = src_specR; } -- GitLab