From 412279d750d3d6f8bbcfc6f35ec7d94ba54fc2f7 Mon Sep 17 00:00:00 2001 From: naghibza Date: Wed, 10 Sep 2025 11:23:59 +0200 Subject: [PATCH 1/2] corrected the q_input in the input of generate_masking_noise_dirac_ivas_fx() --- lib_com/options.h | 1 + lib_rend/ivas_dirac_dec_binaural_functions_fx.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 85f0ed654..46e386b5c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -94,6 +94,7 @@ #define FIX1998_APA_EXEC_SCALING /* FhG: fix scaling of apa_exec_ivas_fx(); avoid continuously worse scaling with previous data */ #define FIX2007_BASSPSFILTER_OVERFLOW /* FhG: use saturing operator, to avoid overflow in bass_psfilter_fx() */ +#define FIX_2009_HIGH_NOISE_FLOOR_FOR_FX_DEC /* FhG: Corrected the q_input in the input of generate_masking_noise_dirac_ivas_fx() */ /* #################### Start BASOP porting switches ############################ */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index be1f5b9ce..c7dbe91fc 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -817,7 +817,11 @@ static void ivas_dirac_dec_binaural_internal_fx( slot, st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag && st_ivas->hSCE[0]->hCoreCoder[0]->flag_cna, ( st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == FRAME_NO_DATA || st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == SID_2k40 ) && ( st_ivas->hSCE[0]->hCoreCoder[0]->cng_type == FD_CNG ) && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag, +#ifdef FIX_2009_HIGH_NOISE_FLOOR_FOR_FX_DEC + st_ivas->hTcBuffer->q_tc_fx, &q_cldfb[2][slot] ); +#else 11, &q_cldfb[2][slot] ); +#endif generate_masking_noise_dirac_ivas_fx( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom, st_ivas->cldfbAnaDec[1], /*nothing will be analyzed, just get cnst*/ @@ -830,6 +834,10 @@ static void ivas_dirac_dec_binaural_internal_fx( scale_sig32( Cldfb_RealBuffer_in_fx[1][slot], CLDFB_NO_CHANNELS_MAX, negate( add( sub( q_cldfb[1][slot], q_input ), 5 ) ) ); scale_sig32( Cldfb_ImagBuffer_in_fx[1][slot], CLDFB_NO_CHANNELS_MAX, negate( add( sub( q_cldfb[1][slot], q_input ), 5 ) ) ); +#ifdef FIX_2009_HIGH_NOISE_FLOOR_FOR_FX_DEC + scale_sig32( Cldfb_RealBuffer_in_fx[2][slot], CLDFB_NO_CHANNELS_MAX, negate( add( sub( q_cldfb[2][slot], q_input ), 5 ) ) ); + scale_sig32( Cldfb_ImagBuffer_in_fx[2][slot], CLDFB_NO_CHANNELS_MAX, negate( add( sub( q_cldfb[2][slot], q_input ), 5 ) ) ); +#endif /* LB: Copy first channel + LB-CNG to first and second channels with same scaling (dual-mono)*/ FOR( b = 0; b < numCoreBands; b++ ) -- GitLab From 141121fb3de26eb62c99f315aeacdacef05f5dc1 Mon Sep 17 00:00:00 2001 From: naghibza Date: Wed, 10 Sep 2025 13:11:37 +0200 Subject: [PATCH 2/2] corrected Cldfb_RealBuffer_in_fx[2]/Cldfb_OmagBuffer_in_fx[2] scaling --- lib_rend/ivas_dirac_dec_binaural_functions_fx.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index c7dbe91fc..bb6cf8051 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -834,10 +834,6 @@ static void ivas_dirac_dec_binaural_internal_fx( scale_sig32( Cldfb_RealBuffer_in_fx[1][slot], CLDFB_NO_CHANNELS_MAX, negate( add( sub( q_cldfb[1][slot], q_input ), 5 ) ) ); scale_sig32( Cldfb_ImagBuffer_in_fx[1][slot], CLDFB_NO_CHANNELS_MAX, negate( add( sub( q_cldfb[1][slot], q_input ), 5 ) ) ); -#ifdef FIX_2009_HIGH_NOISE_FLOOR_FOR_FX_DEC - scale_sig32( Cldfb_RealBuffer_in_fx[2][slot], CLDFB_NO_CHANNELS_MAX, negate( add( sub( q_cldfb[2][slot], q_input ), 5 ) ) ); - scale_sig32( Cldfb_ImagBuffer_in_fx[2][slot], CLDFB_NO_CHANNELS_MAX, negate( add( sub( q_cldfb[2][slot], q_input ), 5 ) ) ); -#endif /* LB: Copy first channel + LB-CNG to first and second channels with same scaling (dual-mono)*/ FOR( b = 0; b < numCoreBands; b++ ) @@ -860,11 +856,18 @@ static void ivas_dirac_dec_binaural_internal_fx( { Cldfb_RealBuffer_in_fx[0][slot][b] = Mpy_32_16_1( Cldfb_RealBuffer_in_fx[0][slot][b], 23170 ); Cldfb_RealBuffer_in_fx[1][slot][b] = L_add( L_add( Cldfb_RealBuffer_in_fx[0][slot][b], L_shr( Cldfb_RealBuffer_in_fx[1][slot][b], 1 ) ), Cldfb_RealBuffer_in_fx[0][slot][b] ); +#ifdef FIX_2009_HIGH_NOISE_FLOOR_FOR_FX_DEC + Cldfb_RealBuffer_in_fx[0][slot][b] = L_add( Cldfb_RealBuffer_in_fx[0][slot][b], L_shr( Cldfb_RealBuffer_in_fx[2][slot][b], add( sub( q_cldfb[2][slot], q_input ), 6 ) ) ); +#else Cldfb_RealBuffer_in_fx[0][slot][b] = L_add( Cldfb_RealBuffer_in_fx[0][slot][b], L_shr( Cldfb_RealBuffer_in_fx[2][slot][b], 1 ) ); - +#endif Cldfb_ImagBuffer_in_fx[0][slot][b] = Mpy_32_16_1( Cldfb_ImagBuffer_in_fx[0][slot][b], 23170 ); Cldfb_ImagBuffer_in_fx[1][slot][b] = L_add( Cldfb_ImagBuffer_in_fx[0][slot][b], L_shr( Cldfb_ImagBuffer_in_fx[1][slot][b], 1 ) ); +#ifdef FIX_2009_HIGH_NOISE_FLOOR_FOR_FX_DEC + Cldfb_ImagBuffer_in_fx[0][slot][b] = L_add( Cldfb_ImagBuffer_in_fx[0][slot][b], L_shr( Cldfb_ImagBuffer_in_fx[2][slot][b], add( sub( q_cldfb[2][slot], q_input ), 6 ) ) ); +#else Cldfb_ImagBuffer_in_fx[0][slot][b] = L_add( Cldfb_ImagBuffer_in_fx[0][slot][b], L_shr( Cldfb_ImagBuffer_in_fx[2][slot][b], 1 ) ); +#endif move32(); move32(); move32(); -- GitLab