From 2ccf2c7cf2dd04348a9f6cedac75caaeb6ba2aa0 Mon Sep 17 00:00:00 2001 From: Anjaneyulu Sana Date: Wed, 16 Apr 2025 06:47:41 +0530 Subject: [PATCH] Fix for 3GPP issue 1470: Increased noise in 6-14 kHz range with ParamBin rendering of MASA to STEREO using BASOP decoder --- lib_dec/fd_cng_dec_fx.c | 6 +++--- lib_rend/ivas_dirac_dec_binaural_functions_fx.c | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index 0309771ff..55c491efe 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -5664,7 +5664,7 @@ void generate_masking_noise_dirac_ivas_fx( scale_fx = L_shl( scale_fx, q_shift ); /*q_scale+q_shift*/ q_scale = add( q_scale, q_shift ); scale_fx = Mpy_32_32( scale_fx, Mpy_32_16_1( L_mult( h_cldfb->scale, h_cldfb->scale ), CLDFB_SCALING ) ); // Q = q_scale + 2 * Q8 - 34 - q_scale = sub( add( q_scale, 2 * Q8 ), 31 ); + q_scale = sub( add( q_scale, 2 * Q8 ), 31 + 3 ); ptr_level_fx = hFdCngCom->cngNoiseLevel + sub( hFdCngCom->stopFFTbin, hFdCngCom->startBand ); /*Q31 - hFdCngCom->cngNoiseLevelExp*/ q_ptr_level = sub( 31, hFdCngCom->cngNoiseLevelExp ); @@ -5675,8 +5675,8 @@ void generate_masking_noise_dirac_ivas_fx( q_shift = norm_l( scale_fx ); scale_fx = L_shl( scale_fx, q_shift ); /*q_scale+q_shift*/ q_scale = add( q_scale, q_shift ); - num = Mpy_32_32( scale_fx, *ptr_level_fx ); /*q_num*/ - q_num = sub( add( q_scale, q_ptr_level ), 31 ); + num = Mpy_32_32( scale_fx, *ptr_level_fx ); /*q_num*/ + q_num = sub( add( q_scale, q_ptr_level ), 31 - 1 ); // num = ( scale * *ptr_level ) * 0.5f exp = sub( 31, q_num ); num = Sqrt32( num, &exp ); /*Q31 - exp*/ /* Real part in CLDFB band */ diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index ce602160f..c7b420e38 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -758,6 +758,9 @@ static void ivas_dirac_dec_binaural_internal_fx( ( 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, 0, &q_cldfb[1][slot] ); + 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 ) ) ); + /* LB: Copy first channel + LB-CNG to first and second channels with same scaling (dual-mono)*/ FOR( b = 0; b < numCoreBands; b++ ) { -- GitLab