diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index ec30ba914abcf9a8f2380edd61e171a58b0518cb..23028e020975ee55a227dd0760726159339e5cd2 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 420ff36a168a40b3d7e239343bc70df0d7c7bab5..b9967dea984a2d8d350ac7abc9a0a582e6f85a21 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -127,6 +127,7 @@ #define NONBE_SVD_OPTIMIZATION #define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */ #define NONBE_1131_ACELP_OOB /* VA: issue 1131: fix division-by-zero in acelp gain decoding caused by wrong length of buffer update when switching from HQ core to ACELP core */ +#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 3c96b53921e5259a8000fa5f7507a7f912d0560e..89abe3f0c982b144b33faebaf5b049ddfdbb1f4c 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -2708,6 +2708,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*/ @@ -2716,7 +2717,7 @@ ivas_error ivas_init_decoder_fx( return error; } } - +#endif test(); #ifdef FIX_1099_JBM_MD_HANDLE_ALLOC test(); diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index a502d1b1c166036c71ab7b3abe9a24b8bb43b061..a0595eddd73d0e0fe80bdc988e9c3e959951dd73 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -82,7 +82,7 @@ ivas_error ivas_jbm_dec_tc_fx( Word32 *data_fx /*Q11*/ ) { - Word16 n, output_frame, nchan_out, i, ii; + Word16 ch, n, output_frame, nchan_out, i, ii; Decoder_State *st; /* used for bitstream handling */ Word32 *p_output_fx[MAX_TRANSPORT_CHANNELS]; /* buffer for output synthesis */ Word16 nchan_remapped; @@ -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,10 +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(); } - - Word16 ch; - - +#endif /*----------------------------------------------------------------* * Decoding + pre-rendering *----------------------------------------------------------------*/ @@ -1592,6 +1590,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 ); @@ -3611,6 +3619,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; @@ -3621,6 +3630,7 @@ ivas_error ivas_jbm_dec_tc_buffer_open_fx( } } ELSE +#endif { Word16 n_samp_full, n_samp_residual; Word32 offset; @@ -4092,7 +4102,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; @@ -4102,11 +4114,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 ) { @@ -4117,7 +4137,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 ) { @@ -4148,9 +4168,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++ ) {