diff --git a/lib_com/options.h b/lib_com/options.h index 92c5871eb0bf1c38039df9d2680804147f121880..488defa924c15ed18d677cd2b1057868a95ed729 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -100,6 +100,7 @@ #define FIX_ISSUE_2013_MDCT_STEREO_FER_DISCONTINUITIES /* Eri/FhG: Issue 2013 fix for FER discontinuities */ #define FIX_2000_NON_LINEARITY_OVERSHOOT /* Eri: Issue 2000: SWB TBE energy overshoot in non-linearity. Aligns with float */ #define FIX_2010_PREP_TBE_EXC /* FhG: fix issues with varying Q-values for code_preQ_fx[] */ +#define FIX_2025_FDCNG_MULT /* Nokia, FhG: Fix LB FDCNG noise introduced by changing mult to i_mult */ /* #################### Start BASOP porting switches ############################ */ diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index 000ef2ef3841379c80d7d2097610ad0eb2d5905d..d3b9634522e9c7e7ed83c4c2a6784a0ac57c2ca7 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -4996,17 +4996,29 @@ void generate_masking_noise_lb_dirac_fx( overwriting it with the synthesis in case of shared tc and synth channel memory, i.e. non-TSM mode */ slot_size_cng = shr( hFdCngCom->frameSize, 4 /* DEFAULT_JBM_CLDFB_TIMESLOTS */ ); /* move start indices forward to the end of the last subframe */ +#ifdef FIX_2025_FDCNG_MULT + cur_subframe_start_outfs = i_mult( nCldfbTs, hSpatParamRendCom->slot_size ); + cur_subframe_start_cngfs = i_mult( nCldfbTs, slot_size_cng ); +#else cur_subframe_start_outfs = mult( nCldfbTs, hSpatParamRendCom->slot_size ); cur_subframe_start_cngfs = mult( nCldfbTs, slot_size_cng ); +#endif /* go from the last subframe back and move the LB noise */ FOR( cur_subframe = sub( hSpatParamRendCom->nb_subframes, 1 ); cur_subframe >= 0; cur_subframe-- ) { Word16 move_size, subframe_size_outfs; +#ifdef FIX_2025_FDCNG_MULT + move_size = i_mult( slot_size_cng, hSpatParamRendCom->subframe_nbslots[cur_subframe] ); + subframe_size_outfs = i_mult( hSpatParamRendCom->subframe_nbslots[cur_subframe], hSpatParamRendCom->slot_size ); + cur_subframe_start_outfs = sub( cur_subframe_start_outfs, i_mult( hSpatParamRendCom->subframe_nbslots[cur_subframe], hSpatParamRendCom->slot_size ) ); + cur_subframe_start_cngfs = sub( cur_subframe_start_cngfs, i_mult( hSpatParamRendCom->subframe_nbslots[cur_subframe], slot_size_cng ) ); +#else move_size = mult( slot_size_cng, hSpatParamRendCom->subframe_nbslots[cur_subframe] ); subframe_size_outfs = mult( hSpatParamRendCom->subframe_nbslots[cur_subframe], hSpatParamRendCom->slot_size ); cur_subframe_start_outfs = sub( cur_subframe_start_outfs, mult( hSpatParamRendCom->subframe_nbslots[cur_subframe], hSpatParamRendCom->slot_size ) ); cur_subframe_start_cngfs = sub( cur_subframe_start_cngfs, mult( hSpatParamRendCom->subframe_nbslots[cur_subframe], slot_size_cng ) ); +#endif /* move cna */ Copy32( tdBuffer + cur_subframe_start_cngfs, tdBuffer + cur_subframe_start_outfs, move_size );