From 5f567820d4191cc81f2980331fa3ed0b1176e3a7 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Tue, 25 Mar 2025 19:46:19 +0530 Subject: [PATCH] Fix for 3GPP issue 1397: Stereo Encoder: 48 kbit/s DTX on, click in LTV Link #1397 --- lib_enc/fd_cng_enc_fx.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib_enc/fd_cng_enc_fx.c b/lib_enc/fd_cng_enc_fx.c index 9c3a236d7..e51e2b682 100644 --- a/lib_enc/fd_cng_enc_fx.c +++ b/lib_enc/fd_cng_enc_fx.c @@ -2839,16 +2839,19 @@ void FdCngEncodeMDCTStereoSID_fx( { IF( lr_in_ptr_fx[ch][p] ) { - t1 = BASOP_Util_Log2( lr_in_ptr_fx[ch][p] ); // Q25 - t2 = L_add( t1, L_shl( lr_in_ptr_e[ch], Q25 ) ); // Q25 + t1 = BASOP_Util_Log2( lr_in_ptr_fx[ch][p] ); // Q25 + t2 = L_add( t1, L_shl( lr_in_ptr_e[ch], Q25 ) ); // Q25 + ms_ptr_fx[ch][p] = Mpy_32_32( t2, TEN_MULT_LOG10_2_IN_Q29 ); // Q23 + move32(); } ELSE { - t2 = 0; + // 10.f * log10f( EPSILON ) --> -150.0f + // Subsequent additions / subtractions happen on these numbers, so to avoid saturations + // this value is set to -128.0f in Q23 + ms_ptr_fx[ch][p] = -ONE_IN_Q30; // Q23 move32(); } - ms_ptr_fx[ch][p] = Mpy_32_32( t2, TEN_MULT_LOG10_2_IN_Q29 ); // Q23 - move32(); E_fx[ch] = L_add( E_fx[ch], L_shr( ms_ptr_fx[ch][p], 4 ) ); // Q19 move32(); } -- GitLab