From 14ddd8a5cfbe0fa2084e90fbbfa6125d920bbf28 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 12 Aug 2025 15:24:17 +0200 Subject: [PATCH] port MR; under FIX_1101_CLEANING_JBM_CALL --- lib_com/ivas_cnst.h | 2 ++ lib_com/options.h | 1 + lib_dec/ivas_init_dec_fx.c | 2 ++ lib_dec/ivas_jbm_dec_fx.c | 33 ++++++++++++++++++++++++++++++--- 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index b5c0a7494..d8cc46919 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -215,7 +215,9 @@ typedef enum typedef enum { +#ifndef FIX_1101_CLEANING_JBM_CALL TC_BUFFER_MODE_NONE = 0, +#endif TC_BUFFER_MODE_RENDERER, TC_BUFFER_MODE_BUFFER } TC_BUFFER_MODE; diff --git a/lib_com/options.h b/lib_com/options.h index 62bccdca6..f9f706e61 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -130,6 +130,7 @@ #define NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART /* Nokia: Set default early part energy correction to unity for BINAURAL_ROOM_REVERB */ #define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */ #define NONBE_FIX_1052_SBA_EXT_FIX /* VA: SBA external output support fix - do not overwrite "output_config" parameter */ +#define FIX_1101_CLEANING_JBM_CALL /* VA: issue 1101: remove obsolete call of ivas_jbm_dec_tc_buffer_open() */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index f79ca8cca..cb70a5477 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -2927,6 +2927,7 @@ ivas_error ivas_init_decoder_fx( } } +#ifndef FIX_1101_CLEANING_JBM_CALL IF( st_ivas->hTcBuffer == NULL ) { /* we need the handle anyway, but without the buffer*/ @@ -2935,6 +2936,7 @@ ivas_error ivas_init_decoder_fx( return error; } } +#endif test(); IF( st_ivas->hJbmMetadata == NULL && st_ivas->hDecoderConfig->Opt_tsm ) { diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 40a7c207d..655927b60 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -122,6 +122,7 @@ ivas_error ivas_jbm_dec_tc_fx( } } +#ifndef FIX_1101_CLEANING_JBM_CALL IF( st_ivas->hDecoderConfig->Opt_tsm == 0 ) { FOR( n = 0; n < ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) @@ -132,7 +133,7 @@ ivas_error ivas_jbm_dec_tc_fx( st_ivas->hTcBuffer->no_channels = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); move16(); } - +#endif Word16 ch; @@ -1604,6 +1605,16 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( p_data_f_fx[n] = &data_f_fx[n][0]; } +#ifdef FIX_1101_CLEANING_JBM_CALL + IF( st_ivas->hDecoderConfig->Opt_tsm == 0 ) + { + FOR( n = 0; n < ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) + { + st_ivas->hTcBuffer->tc_fx[n] = st_ivas->p_output_fx[n]; /* note: buffers needed in the TD decorellator */ + } + } + +#endif IF( st_ivas->hDecoderConfig->Opt_tsm ) { ivas_jbm_dec_copy_tc( st_ivas, nSamplesForRendering, nSamplesResidual, data_fx, p_data_f_fx, 11 ); @@ -3606,6 +3617,7 @@ ivas_error ivas_jbm_dec_tc_buffer_open_fx( set16_fx( hTcBuffer->subframe_nbslots, 0, MAX_JBM_SUBFRAMES_5MS ); set16_fx( hTcBuffer->subframe_nbslots, nMaxSlotsPerSubframe, MAX_PARAM_SPATIAL_SUBFRAMES ); +#ifndef FIX_1101_CLEANING_JBM_CALL IF( EQ_16( hTcBuffer->tc_buffer_mode, TC_BUFFER_MODE_NONE ) ) { hTcBuffer->tc_buffer_fx = NULL; @@ -3616,6 +3628,7 @@ ivas_error ivas_jbm_dec_tc_buffer_open_fx( } } ELSE +#endif { Word16 n_samp_full, n_samp_residual; Word32 offset; @@ -4087,7 +4100,9 @@ void ivas_jbm_dec_copy_tc_no_tsm_fx( ) { Word16 Q_tc; +#ifndef FIX_1101_CLEANING_JBM_CALL Word16 n_ch_full_copy; +#endif Word16 n_ch_cldfb; Word16 ch_idx; DECODER_TC_BUFFER_HANDLE hTcBuffer; @@ -4097,11 +4112,19 @@ void ivas_jbm_dec_copy_tc_no_tsm_fx( hTcBuffer->n_samples_available = hTcBuffer->n_samples_buffered; move16(); move16(); +#ifndef FIX_1101_CLEANING_JBM_CALL n_ch_full_copy = s_min( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); +#endif n_ch_cldfb = sub( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); Q_tc = 11; /*tc buffer is at Q11*/ move16(); + +#ifdef FIX_1101_CLEANING_JBM_CALL +#ifdef DEBUGGING + assert( st_ivas->hDecoderConfig->Opt_tsm == 0 ); +#endif +#else /* copy full tcs*/ IF( st_ivas->hDecoderConfig->Opt_tsm ) { @@ -4112,7 +4135,7 @@ void ivas_jbm_dec_copy_tc_no_tsm_fx( } ch_idx = 0; move16(); - +#endif /* CLDFB ana for ParamMC/ParamISM */ IF( n_ch_cldfb > 0 ) { @@ -4143,9 +4166,13 @@ void ivas_jbm_dec_copy_tc_no_tsm_fx( num_freq_bands = st_ivas->hParamMC->num_freq_bands; move16(); } - /* CLDFB Analysis*/ + /* CLDFB Analysis*/ +#ifdef FIX_1101_CLEANING_JBM_CALL + FOR( ( ch_idx = 0, cldfb_ch = 0 ); cldfb_ch < n_ch_cldfb; ( cldfb_ch++, ch_idx++ ) ) +#else FOR( cldfb_ch = 0; cldfb_ch < n_ch_cldfb; ( cldfb_ch++, ch_idx++ ) ) +#endif { FOR( slot_idx = 0; slot_idx < DEFAULT_JBM_CLDFB_TIMESLOTS; slot_idx++ ) { -- GitLab