From 36428363d0a13a68c761d476413e3c9ef76c5a0a Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Tue, 24 Jun 2025 19:42:20 +0530 Subject: [PATCH] Fix for 3GPP issue 1759: Decoder crash for OSBA ISM4SBA3 at 32kbps FER in cldfbAnalysis_ts() Link #1759 --- lib_rend/ivas_dirac_dec_binaural_functions_fx.c | 17 ++++++++++++----- 1 file changed, 12 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 c92f800af..7c83143c3 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -596,7 +596,7 @@ static void ivas_dirac_dec_binaural_internal_fx( move16(); } } - + Word16 q_cldfb_temp = sub( q_input, 1 ); DIRAC_DEC_BIN_HANDLE hDiracDecBin; SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; PARAMBIN_REND_CONFIG config_data; @@ -616,7 +616,7 @@ static void ivas_dirac_dec_binaural_internal_fx( nBins = hSpatParamRendCom->num_freq_bands; move16(); offsetSamples = imult1616( hSpatParamRendCom->slots_rendered, nBins ); - + Word32 tmp_arr[CLDFB_NO_CHANNELS_MAX]; /* Setup internal config */ config_data.separateCenterChannelRendering = st_ivas->hOutSetup.separateChannelEnabled; move16(); @@ -713,13 +713,21 @@ static void ivas_dirac_dec_binaural_internal_fx( test(); IF( ch == 0 || EQ_16( nchan_transport, 2 ) ) { - q_cldfb[ch][slot] = q_input; + q_cldfb[ch][slot] = q_cldfb_temp; move16(); + Copy_Scale_sig32( &( st_ivas->hTcBuffer->tc_fx[ch][nBins * slot + offsetSamples] ), tmp_arr, nBins, -1 ); + scale_sig32( st_ivas->cldfbAnaDec[ch]->cldfb_state_fx, sub( st_ivas->cldfbAnaDec[ch]->p_filter_length, st_ivas->cldfbAnaDec[ch]->no_channels ), sub( q_cldfb_temp, st_ivas->cldfbAnaDec[ch]->Q_cldfb_state ) ); cldfbAnalysis_ts_fx_fixed_q( - &( st_ivas->hTcBuffer->tc_fx[ch][add( imult1616( nBins, slot ), offsetSamples )] ), + tmp_arr, Cldfb_RealBuffer_in_fx[ch][slot], Cldfb_ImagBuffer_in_fx[ch][slot], nBins, st_ivas->cldfbAnaDec[ch], &q_cldfb[ch][slot] ); + scale_sig32( st_ivas->cldfbAnaDec[ch]->cldfb_state_fx, sub( st_ivas->cldfbAnaDec[ch]->p_filter_length, st_ivas->cldfbAnaDec[ch]->no_channels ), sub( q_input, st_ivas->cldfbAnaDec[ch]->Q_cldfb_state ) ); + st_ivas->cldfbAnaDec[ch]->Q_cldfb_state = q_input; + scale_sig32( Cldfb_RealBuffer_in_fx[ch][slot], nBins, 1 ); // Q6 + scale_sig32( Cldfb_ImagBuffer_in_fx[ch][slot], nBins, 1 ); // Q6 + q_cldfb[ch][slot] = add( q_cldfb[ch][slot], 1 ); + move16(); } ELSE IF( EQ_16( config_data.nchan_transport, 2 ) ) /* Stereo signal transmitted as mono with DFT stereo */ { @@ -814,7 +822,6 @@ static void ivas_dirac_dec_binaural_internal_fx( IF( hDiracDecBin->useTdDecorr ) { - Word32 tmp_arr[60]; FOR( ch = BINAURAL_CHANNELS; ch < ( 2 * BINAURAL_CHANNELS ); ch++ ) { q_cldfb[ch][slot] = sub( q_input, 1 ); -- GitLab