From 648b9cce6dd27f20be38fb125b7aabed2a8f7e62 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 10 Jun 2025 14:12:06 +0200 Subject: [PATCH 1/6] accept FIX_1320_STACK_CPE_DECODER and FIX_1314_STEREO_TO_EXT --- lib_com/cnst.h | 2 -- lib_com/options.h | 2 -- lib_dec/dec_LPD.c | 9 ------ lib_dec/ivas_core_dec.c | 47 ++--------------------------- lib_dec/ivas_cpe_dec.c | 47 ----------------------------- lib_dec/ivas_mdct_core_dec.c | 8 ----- lib_dec/ivas_out_setup_conversion.c | 14 --------- lib_dec/ivas_output_config.c | 4 --- lib_dec/ivas_stereo_mdct_core_dec.c | 10 ------ lib_dec/ivas_tcx_core_dec.c | 10 +----- 10 files changed, 3 insertions(+), 150 deletions(-) diff --git a/lib_com/cnst.h b/lib_com/cnst.h index ebb363e692..f06e880297 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -524,9 +524,7 @@ enum #define ACELP_TCX_TRANS_NS 1250000 /* Duration of the ACELP->TCX overlap - 1.25 ms */ #define L_FRAME_MAX L_FRAME48k /* Max 20ms frame size @48kHz */ #define L_FRAME_PLUS 1200 /* Max frame size (long TCX frame) */ -#ifdef FIX_1320_STACK_CPE_DECODER #define L_FRAME_PLUS_INTERNAL 800 /* Max frame size (long TCX frame) at maximum internal sampling rate */ -#endif #define L_MDCT_OVLP_MAX NS2SA( 48000, ACELP_LOOK_NS ) /* = Max mdct overlap */ #define N_TCX10_MAX 480 /* Max size of TCX10 MDCT spectrum */ #define BITS_TEC 1 /* number of bits for TEC */ diff --git a/lib_com/options.h b/lib_com/options.h index aec5a9e672..10c09c125b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,8 +160,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ -#define FIX_1314_STEREO_TO_EXT /* VA: issue 1314: set RENDERER_DISABLE for stereo to EXT output */ -#define FIX_1320_STACK_CPE_DECODER /* VA: issue 1320: Optimize the stack memory consumption in the CPE decoder */ #define FIX_NCHAN_BUFFERS /* VA: issue 1322: Correct the number of float buffers (channels) at the decoder */ #define FIX_RENDERER_STACK /* VA: issue 1322: reduction of renderers' buffers size */ #define FIX_1319_STACK_SBA_DECODER /* VA: issue 1319: Optimize the definition of buffer lengths in the SBA decoder */ diff --git a/lib_dec/dec_LPD.c b/lib_dec/dec_LPD.c index bf4aab5e31..3eb6e2ea33 100644 --- a/lib_dec/dec_LPD.c +++ b/lib_dec/dec_LPD.c @@ -71,11 +71,7 @@ void decoder_LPD( { int16_t *prm; int16_t param_lpc[NPRM_LPC_NEW]; -#ifdef FIX_1320_STACK_CPE_DECODER float synth_buf[OLD_SYNTH_INTERNAL_DEC + L_FRAME_PLUS_INTERNAL + M]; -#else - float synth_buf[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; -#endif float *synth; float synth_bufFB[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; float *synthFB; @@ -128,14 +124,9 @@ void decoder_LPD( synthFB = synth_bufFB + st->hTcxDec->old_synth_lenFB; mvr2r( st->hTcxDec->old_synth, synth_buf, st->hTcxDec->old_synth_len ); mvr2r( st->hTcxDec->old_synthFB, synth_bufFB, st->hTcxDec->old_synth_lenFB ); -#ifdef FIX_1320_STACK_CPE_DECODER set_zero( synth, L_FRAME_PLUS_INTERNAL + M ); -#else - set_zero( synth, L_FRAME_PLUS + M ); -#endif set_zero( synthFB, L_FRAME_PLUS + M ); - /*For post-processing (post-filtering+blind BWE)*/ if ( st->tcxonly == 0 ) { diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index f460c574cf..f10cd46c30 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -75,12 +75,8 @@ ivas_error ivas_core_dec( float synth[CPE_CHANNELS][L_FRAME48k]; float tmp_buffer[L_FRAME48k]; int16_t tmps, incr; -#ifdef FIX_1320_STACK_CPE_DECODER float *bwe_exc_extended[CPE_CHANNELS] = { NULL, NULL }; int16_t flag_bwe_bws; -#else - float bwe_exc_extended[CPE_CHANNELS][L_FRAME32k + NL_BUFF_OFFSET]; -#endif float voice_factors[CPE_CHANNELS][NB_SUBFR16k]; int16_t core_switching_flag[CPE_CHANNELS]; float old_syn_12k8_16k[CPE_CHANNELS][L_FRAME16k]; @@ -209,9 +205,7 @@ ivas_error ivas_core_dec( set_f( voice_factors[n], 0.f, NB_SUBFR16k ); set_f( hb_synth[n], 0.0f, L_FRAME48k ); -#ifdef FIX_1320_STACK_CPE_DECODER bwe_exc_extended[n] = hb_synth[n]; /* note: reuse the buffer */ -#endif /*------------------------------------------------------------------* * Decision matrix (selection of technologies) @@ -530,10 +524,8 @@ ivas_error ivas_core_dec( * SWB(FB) BWE decoding *---------------------------------------------------------------------*/ -#ifdef FIX_1320_STACK_CPE_DECODER flag_bwe_bws = ( output_Fs >= 32000 && st->core == ACELP_CORE && st->bwidth > NB && st->bws_cnt > 0 && st->bfi == 0 ); -#endif if ( st->extl == SWB_TBE || st->extl == FB_TBE || ( st->coder_type != AUDIO && st->coder_type != INACTIVE && st->core_brate >= SID_2k40 && st->core == ACELP_CORE && !st->con_tcx && output_Fs >= 32000 && st->bwidth > NB && st->bws_cnt > 0 ) ) { /* SWB TBE decoder */ @@ -545,23 +537,17 @@ ivas_error ivas_core_dec( fb_tbe_dec( st, tmp_buffer /*fb_exc*/, hb_synth[n], tmp_buffer /*fb_synth_ref*/, output_frame ); } } -#ifdef FIX_1320_STACK_CPE_DECODER else if ( st->extl == SWB_BWE || st->extl == FB_BWE || flag_bwe_bws ) -#else - else if ( st->extl == SWB_BWE || st->extl == FB_BWE || ( output_Fs >= 32000 && st->core == ACELP_CORE && st->bwidth > NB && st->bws_cnt > 0 && !st->ppp_mode_dec && !( st->nelp_mode_dec == 1 && st->bfi == 1 ) ) ) -#endif { /* SWB BWE decoder */ swb_bwe_dec( st, output[n], synth[n], hb_synth[n], use_cldfb_for_dft, output_frame ); } -#ifdef FIX_1320_STACK_CPE_DECODER if ( ( st->core == ACELP_CORE && ( st->extl == -1 || st->extl == SWB_CNG ) ) && flag_bwe_bws == 0 ) { set_f( hb_synth[n], 0.0f, L_FRAME48k ); } -#endif /*---------------------------------------------------------------------* * FEC - recovery after lost HQ core (smoothing of the BWE component) *---------------------------------------------------------------------*/ @@ -595,23 +581,6 @@ ivas_error ivas_core_dec( stereo_icBWE_dec( hCPE, hb_synth[0], hb_synth[1], tmp_buffer /*fb_synth_ref*/, voice_factors[0], output_frame ); } -#ifndef FIX_1320_STACK_CPE_DECODER - if ( st->element_mode == EVS_MONO ) - { - /*----------------------------------------------------------------* - * BFI waveform adjustment - *----------------------------------------------------------------*/ - - if ( st->core == ACELP_CORE && !st->bfi && st->prev_bfi && st->last_total_brate >= HQ_48k && st->last_codec_mode == MODE2 && ( st->last_core_bfi == TCX_20_CORE || st->last_core_bfi == TCX_10_CORE ) && st->hPlcInfo->concealment_method == TCX_NONTONAL && st->hPlcInfo->nbLostCmpt < 4 ) - { - tmps = NS2SA( output_Fs, DELAY_CLDFB_NS ); - - waveform_adj2( st->hPlcInfo, st->hTonalMDCTConc->secondLastPcmOut, synth[n] + tmps, tmps, st->hPlcInfo->nbLostCmpt + 1, st->bfi ); - - st->hPlcInfo->Pitch = 0; - } - } -#endif /*----------------------------------------------------------------* * Transition and synchronization of BWE components *----------------------------------------------------------------*/ @@ -626,20 +595,8 @@ ivas_error ivas_core_dec( } else { -#ifndef FIX_1320_STACK_CPE_DECODER - if ( st->extl == SWB_BWE_HIGHRATE || st->extl == FB_BWE_HIGHRATE ) - { - /* HR SWB BWE on top of ACELP@16kHz */ - tmps = NS2SA( output_Fs, DELAY_BWE_TOTAL_NS ); - } - else - { -#endif - /* TBE on top of ACELP@16kHz */ - tmps = NS2SA( output_Fs, MAX_DELAY_TBE_NS - DELAY_SWB_TBE_16k_NS ); -#ifndef FIX_1320_STACK_CPE_DECODER - } -#endif + /* TBE on top of ACELP@16kHz */ + tmps = NS2SA( output_Fs, MAX_DELAY_TBE_NS - DELAY_SWB_TBE_16k_NS ); } /* Smooth transitions when switching between different technologies */ diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 344b1f4357..0d48873291 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -54,10 +54,8 @@ static void read_stereo_mode_and_bwidth( CPE_DEC_HANDLE hCPE, const Decoder_Stru static void stereo_mode_combined_format_dec( const Decoder_Struct *st_ivas, CPE_DEC_HANDLE hCPE ); -#ifdef FIX_1320_STACK_CPE_DECODER static ivas_error stereo_dft_dec_main( CPE_DEC_HANDLE hCPE, const int32_t ivas_total_brate, const int16_t n_channels, float res_buf[STEREO_DFT_N_8k], float *output[], float outputHB[][L_FRAME48k], const int16_t output_frame ); -#endif /*--------------------------------------------------------------------------* * ivas_cpe_dec() @@ -78,11 +76,7 @@ ivas_error ivas_cpe_dec( int16_t last_bwidth; int16_t tdm_ratio_idx; float outputHB[CPE_CHANNELS][L_FRAME48k]; /* 'float' buffer for output HB synthesis, both channels */ -#ifdef FIX_1320_STACK_CPE_DECODER float *res_buf = NULL; -#else - float res_buf[STEREO_DFT_N_8k]; -#endif CPE_DEC_HANDLE hCPE; Decoder_State **sts; STEREO_DFT_CONFIG_DATA_HANDLE hConfigDft; @@ -273,10 +267,8 @@ ivas_error ivas_cpe_dec( } else { -#ifdef FIX_1320_STACK_CPE_DECODER res_buf = outputHB[0]; /* note: temporarily reused buffer */ -#endif if ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) { nb_bits -= nb_bits_metadata; @@ -465,47 +457,10 @@ ivas_error ivas_cpe_dec( if ( hCPE->element_mode == IVAS_CPE_DFT && !( hCPE->nchan_out == 1 && hConfigDft->res_cod_mode == STEREO_DFT_RES_COD_OFF ) ) { -#ifdef FIX_1320_STACK_CPE_DECODER if ( ( error = stereo_dft_dec_main( hCPE, ivas_total_brate, n_channels, res_buf, output, outputHB, output_frame ) ) != IVAS_ERR_OK ) { return error; } -#else - float DFT[CPE_CHANNELS][STEREO_DFT_BUF_MAX]; - - /* core decoder */ - if ( ( error = ivas_core_dec( NULL, NULL, hCPE, st_ivas->hMCT, n_channels, output, outputHB, DFT, 0 ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* DFT Stereo residual decoding */ - if ( hCPE->hStereoDft->res_cod_band_max > 0 && !st_ivas->bfi ) - { - stereo_dft_dec_res( hCPE, res_buf, output[1] ); - - stereo_dft_dec_analyze( hCPE, output[1], DFT, 1, L_FRAME8k, output_frame, DFT_STEREO_DEC_ANA_LB, 0, 0 ); - } - - /* DFT stereo CNG */ - stereo_dtf_cng( hCPE, ivas_total_brate, DFT, output_frame ); - - /* decoding */ - if ( hCPE->nchan_out == 1 ) - { - stereo_dft_unify_dmx( hCPE->hStereoDft, sts[0], DFT, hCPE->input_mem[1], hCPE->hStereoCng->prev_sid_nodata ); - } - else - { - stereo_dft_dec( hCPE->hStereoDft, sts[0], DFT, hCPE->input_mem[1], hCPE->hStereoCng, 0, 0, 0, 0, 0, 0, MAX_PARAM_SPATIAL_SUBFRAMES ); - } - - /* synthesis iFFT */ - for ( n = 0; n < hCPE->nchan_out; n++ ) - { - stereo_dft_dec_synthesize( hCPE, DFT, n, output[n], output_frame ); - } -#endif } else if ( hCPE->element_mode == IVAS_CPE_TD ) { @@ -630,7 +585,6 @@ ivas_error ivas_cpe_dec( return error; } -#ifdef FIX_1320_STACK_CPE_DECODER /*------------------------------------------------------------------------- * stereo_dft_dec_main() @@ -697,7 +651,6 @@ static ivas_error stereo_dft_dec_main( return IVAS_ERR_OK; } -#endif /*------------------------------------------------------------------------- * create_cpe_dec() diff --git a/lib_dec/ivas_mdct_core_dec.c b/lib_dec/ivas_mdct_core_dec.c index 29ca975ee0..d03cc5afd9 100644 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -804,11 +804,7 @@ void ivas_mdct_core_reconstruct( int16_t L_frame[CPE_CHANNELS], L_frameTCX[CPE_CHANNELS], nSubframes[CPE_CHANNELS]; int16_t L_frame_global[CPE_CHANNELS], L_frame_globalTCX[CPE_CHANNELS]; /* Synth */ -#ifdef FIX_1320_STACK_CPE_DECODER float synth_buf[OLD_SYNTH_INTERNAL_DEC + L_FRAME_PLUS_INTERNAL + M]; -#else - float synth_buf[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; -#endif float *synth; float synth_bufFB[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; float *synthFB; @@ -845,11 +841,7 @@ void ivas_mdct_core_reconstruct( synthFB = synth_bufFB + st->hTcxDec->old_synth_lenFB; mvr2r( st->hTcxDec->old_synth, synth_buf, st->hTcxDec->old_synth_len ); mvr2r( st->hTcxDec->old_synthFB, synth_bufFB, st->hTcxDec->old_synth_lenFB ); -#ifdef FIX_1320_STACK_CPE_DECODER set_zero( synth, L_FRAME_PLUS_INTERNAL + M ); -#else - set_zero( synth, L_FRAME_PLUS + M ); -#endif set_zero( synthFB, L_FRAME_PLUS + M ); if ( st->core != ACELP_CORE ) diff --git a/lib_dec/ivas_out_setup_conversion.c b/lib_dec/ivas_out_setup_conversion.c index 90473903d9..f897ad87b7 100644 --- a/lib_dec/ivas_out_setup_conversion.c +++ b/lib_dec/ivas_out_setup_conversion.c @@ -309,9 +309,7 @@ ivas_error ivas_ls_setup_conversion_open( int16_t output_frame; int32_t output_Fs; int16_t paramUpmixMonoStereo; -#ifdef FIX_1314_STEREO_TO_EXT ivas_error error; -#endif if ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMUPMIX && ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO ) ) { @@ -421,37 +419,25 @@ ivas_error ivas_ls_setup_conversion_open( { if ( paramUpmixMonoStereo == TRUE ) { -#ifdef FIX_1314_STEREO_TO_EXT if ( ( error = get_ls_conversion_matrix( hLsSetUpConversion, IVAS_AUDIO_CONFIG_5_1_2, st_ivas->hDecoderConfig->output_config ) ) != IVAS_ERR_OK ) { return error; } -#else - get_ls_conversion_matrix( hLsSetUpConversion, IVAS_AUDIO_CONFIG_5_1_2, st_ivas->hDecoderConfig->output_config ); -#endif } else { -#ifdef FIX_1314_STEREO_TO_EXT if ( ( error = get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->transport_config, st_ivas->hDecoderConfig->output_config ) ) != IVAS_ERR_OK ) { return error; } -#else - get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->transport_config, st_ivas->hDecoderConfig->output_config ); -#endif } } else { -#ifdef FIX_1314_STEREO_TO_EXT if ( ( error = get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->intern_config, st_ivas->hDecoderConfig->output_config ) ) != IVAS_ERR_OK ) { return error; } -#else - get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->intern_config, st_ivas->hDecoderConfig->output_config ); -#endif } } diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 5df52f8287..b0acefc17e 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -262,11 +262,7 @@ void ivas_renderer_select( } else if ( st_ivas->ivas_format == STEREO_FORMAT ) { -#ifdef FIX_1314_STEREO_TO_EXT if ( output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_MONO && output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) -#else - if ( output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_MONO ) -#endif { *renderer_type = RENDERER_MC; } diff --git a/lib_dec/ivas_stereo_mdct_core_dec.c b/lib_dec/ivas_stereo_mdct_core_dec.c index 5a3c4f8a7c..971163ae87 100644 --- a/lib_dec/ivas_stereo_mdct_core_dec.c +++ b/lib_dec/ivas_stereo_mdct_core_dec.c @@ -155,10 +155,6 @@ void stereo_mdct_core_dec( float Aq[CPE_CHANNELS][( NB_SUBFR16k + 1 ) * ( M + 1 )]; float *x[CPE_CHANNELS][NB_DIV]; - /*needed to allocate N_MAX to prevent stereo switching crash */ -#ifndef FIX_1320_STACK_CPE_DECODER - float x_0_buf[CPE_CHANNELS][N_MAX]; -#endif float *x_0[CPE_CHANNELS][NB_DIV]; /* Concealment */ @@ -205,15 +201,9 @@ void stereo_mdct_core_dec( x[ch][0] = &signal_out_tmp[ch][0]; x[ch][1] = &signal_out_tmp[ch][0] + L_FRAME_PLUS / 2; -#ifdef FIX_1320_STACK_CPE_DECODER set_zero( signal_outFB_tmp[ch], N_MAX ); /* length of N_MAX is needed to prevent stereo switching crash -> reuse buffer signal_outFB_tmp[][] */ x_0[ch][0] = &signal_outFB_tmp[ch][0]; x_0[ch][1] = &signal_outFB_tmp[ch][0] + L_FRAME48k / 2; -#else - set_zero( x_0_buf[ch], N_MAX ); - x_0[ch][0] = &x_0_buf[ch][0]; - x_0[ch][1] = &x_0_buf[ch][0] + L_FRAME48k / 2; -#endif nTnsBitsTCX10[ch][0] = 0; nTnsBitsTCX10[ch][1] = 0; diff --git a/lib_dec/ivas_tcx_core_dec.c b/lib_dec/ivas_tcx_core_dec.c index 4133af03ea..fc66dbc22a 100644 --- a/lib_dec/ivas_tcx_core_dec.c +++ b/lib_dec/ivas_tcx_core_dec.c @@ -179,11 +179,7 @@ void stereo_tcx_core_dec( Word16 Aind[M + 1], lspind[M]; /*Synth*/ -#ifdef FIX_1320_STACK_CPE_DECODER float synth_buf[OLD_SYNTH_INTERNAL_DEC + L_FRAME_PLUS_INTERNAL + M]; -#else - float synth_buf[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; -#endif float *synth; float synth_bufFB[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; float *synthFB; @@ -250,18 +246,14 @@ void stereo_tcx_core_dec( synthFB = synth_bufFB + hTcxDec->old_synth_lenFB; mvr2r( hTcxDec->old_synth, synth_buf, hTcxDec->old_synth_len ); mvr2r( hTcxDec->old_synthFB, synth_bufFB, hTcxDec->old_synth_lenFB ); -#ifdef FIX_1320_STACK_CPE_DECODER set_zero( synth, L_FRAME_PLUS_INTERNAL + M ); -#else - set_zero( synth, L_FRAME_PLUS + M ); -#endif set_zero( synthFB, L_FRAME_PLUS + M ); #ifdef DEBUG_MODE_INFO_PLC dbgwrite( synth_buf, sizeof( float ), OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M, 1, "res/synth_buf_init" ); dbgwrite( synth_bufFB, sizeof( float ), OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M, 1, "res/synthFB_buf_init" ); -#endif +#endif /*--------------------------------------------------------------------------------* * BITSTREAM DECODING *--------------------------------------------------------------------------------*/ -- GitLab From 8b912c2e7c3aaeaf7879e3005cb5c81deea51289 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 10 Jun 2025 14:17:47 +0200 Subject: [PATCH 2/6] accept FIX_RENDERER_STACK and FIX_NCHAN_BUFFERS --- lib_com/options.h | 2 - lib_dec/ivas_dirac_dec.c | 21 --- lib_dec/ivas_init_dec.c | 4 - lib_dec/ivas_jbm_dec.c | 4 - lib_dec/ivas_masa_dec.c | 10 -- lib_dec/ivas_mct_dec.c | 5 +- lib_dec/ivas_sba_dec.c | 2 - lib_rend/ivas_crend.c | 26 ---- lib_rend/ivas_dirac_dec_binaural_functions.c | 26 ---- lib_rend/ivas_output_init.c | 132 ------------------- 10 files changed, 1 insertion(+), 231 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 10c09c125b..57ca466e56 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,8 +160,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ -#define FIX_NCHAN_BUFFERS /* VA: issue 1322: Correct the number of float buffers (channels) at the decoder */ -#define FIX_RENDERER_STACK /* VA: issue 1322: reduction of renderers' buffers size */ #define FIX_1319_STACK_SBA_DECODER /* VA: issue 1319: Optimize the definition of buffer lengths in the SBA decoder */ #define JBM_MEMORY_OPT /* VA: issue 916: optimization of RAM in the JBM decoder */ diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 53c8d8ccd5..723c3f64d6 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1554,12 +1554,8 @@ void ivas_dirac_dec_render( uint16_t slot_size, n_samples_sf, ch, nchan_intern; SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; float *output_f_local[MAX_OUTPUT_CHANNELS]; -#ifdef FIX_RENDERER_STACK float *p_output_f[MAX_OUTPUT_CHANNELS]; float output_f_local_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; -#else - float output_f_local_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k]; -#endif hSpatParamRendCom = st_ivas->hSpatParamRendCom; @@ -1570,11 +1566,7 @@ void ivas_dirac_dec_render( for ( ch = 0; ch < nchan_intern; ch++ ) { output_f_local[ch] = output_f_local_buff[ch]; -#ifdef FIX_RENDERER_STACK p_output_f[ch] = output_f[ch]; -#else - set_zero( output_f_local_buff[ch], nSamplesAsked ); -#endif } slot_size = NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); @@ -1601,7 +1593,6 @@ void ivas_dirac_dec_render( for ( ch = 0; ch < nchan_intern; ch++ ) { -#ifdef FIX_RENDERER_STACK /* move to output */ if ( !( ( st_ivas->hDirACRend->hOutSetup.separateChannelEnabled ) && ( st_ivas->hDirACRend->hOutSetup.separateChannelIndex == ch || st_ivas->hDirACRend->hOutSetup.separateChannelIndex + 1 == ch ) ) ) { @@ -1609,24 +1600,12 @@ void ivas_dirac_dec_render( } p_output_f[ch] += n_samples_sf; -#else - output_f_local[ch] += n_samples_sf; -#endif } /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); } -#ifndef FIX_RENDERER_STACK - for ( ch = 0; ch < nchan_intern; ch++ ) - { - if ( !( ( st_ivas->hDirACRend->hOutSetup.separateChannelEnabled ) && ( st_ivas->hDirACRend->hOutSetup.separateChannelIndex == ch || st_ivas->hDirACRend->hOutSetup.separateChannelIndex + 1 == ch ) ) ) - { - mvr2r( output_f_local_buff[ch], output_f[ch], *nSamplesRendered ); - } - } -#endif if ( hSpatParamRendCom->slots_rendered == hSpatParamRendCom->num_slots ) { if ( st_ivas->hDirAC->hConfig->dec_param_estim == 1 ) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index f59064bbb8..7b4b631f40 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2378,12 +2378,8 @@ ivas_error ivas_init_decoder( * Allocate floating-point output audio buffers *-----------------------------------------------------------------*/ -#ifdef FIX_NCHAN_BUFFERS k = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); for ( n = 0; n < k; n++ ) -#else - for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) -#endif { /* note: these are intra-frame heap memories */ if ( ( st_ivas->p_output_f[n] = (float *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( float ) ) ) == NULL ) diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 31e6178c48..261b8159f2 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -862,16 +862,12 @@ void ivas_jbm_dec_feed_tc_to_renderer( p_data_f[n] = &st_ivas->p_output_f[n][0]; } -#ifdef FIX_NCHAN_BUFFERS #ifdef JBM_MEMORY_OPT ch = max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); #else ch = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); #endif for ( n = 0; n < ch; n++ ) -#else - for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) -#endif { hTcBuffer->tc[n] = st_ivas->p_output_f[n]; /* note: buffers needed in the TD decorellator */ } diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 560cb474b4..b698395d75 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1320,9 +1320,7 @@ ivas_error ivas_masa_dec_reconfigure( Decoder_State **sts; int32_t ivas_total_brate, last_ivas_total_brate; int16_t numCldfbAnalyses_old, numCldfbSyntheses_old; -#ifdef FIX_NCHAN_BUFFERS int16_t nchan_out_buff_old, nchan_out_buff; -#endif ivas_error error; int16_t pos_idx; int32_t ism_total_brate; @@ -1330,10 +1328,8 @@ ivas_error ivas_masa_dec_reconfigure( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; last_ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate; -#ifdef FIX_NCHAN_BUFFERS nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); -#endif /* Copy state to TC buffer if granularity matches and we are not in OMASA EXT rendering mode */ if ( st_ivas->hSpatParamRendCom != NULL && st_ivas->hSpatParamRendCom->slot_size == st_ivas->hTcBuffer->n_samples_granularity && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { @@ -1497,15 +1493,11 @@ ivas_error ivas_masa_dec_reconfigure( } else { -#ifdef FIX_NCHAN_BUFFERS tc_nchan_to_allocate = BINAURAL_CHANNELS; if ( st_ivas->hDiracDecBin[0] != NULL && st_ivas->hDiracDecBin[0]->useTdDecorr ) { tc_nchan_to_allocate = 2 * BINAURAL_CHANNELS; } -#else - tc_nchan_to_allocate = 2 * BINAURAL_CHANNELS; -#endif } } else if ( st_ivas->nchan_transport == 1 && ( st_ivas->renderer_type == RENDERER_DIRAC && st_ivas->hDirACRend->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) ) @@ -1545,7 +1537,6 @@ ivas_error ivas_masa_dec_reconfigure( } } -#ifdef FIX_NCHAN_BUFFERS /*-----------------------------------------------------------------* * floating-point output audio buffers *-----------------------------------------------------------------*/ @@ -1559,7 +1550,6 @@ ivas_error ivas_masa_dec_reconfigure( } } -#endif return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 4097c4d71d..3371c6554c 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -1279,7 +1279,6 @@ static ivas_error ivas_mc_dec_reconfig( if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { -#ifdef FIX_NCHAN_BUFFERS tc_nchan_allocate_new = BINAURAL_CHANNELS; if ( st_ivas->hDiracDecBin[0] != NULL && st_ivas->hDiracDecBin[0]->useTdDecorr ) { @@ -1289,9 +1288,7 @@ static ivas_error ivas_mc_dec_reconfig( { tc_nchan_allocate_new++; } -#else - tc_nchan_allocate_new = 2 * BINAURAL_CHANNELS; -#endif + tc_nchan_full_new = tc_nchan_allocate_new; } diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index de0e9444c6..8ddc7f0406 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -704,7 +704,6 @@ ivas_error ivas_sba_dec_render( nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); nchan_out = st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; -#ifdef FIX_NCHAN_BUFFERS if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { nchan_out = max( nchan_internal, st_ivas->hDecoderConfig->nchan_out ); @@ -717,7 +716,6 @@ ivas_error ivas_sba_dec_render( nchan_out = min( nchan_out, ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ) ); -#endif #ifdef DEBUGGING assert( hSpar ); #endif diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 6872f4d945..8455901f4d 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1501,13 +1501,8 @@ static ivas_error ivas_rend_crendConvolver( const float *pFreq_filt_re, *pFreq_filt_im; float *pFreq_buf_re = NULL, *pFreq_buf_im = NULL; float *pFreq_buf2_re = NULL, *pFreq_buf2_im = NULL; -#ifdef FIX_RENDERER_STACK float pOut[2 /*Re,Im*/ * L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; float tmp_out_re[L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES], tmp_out_im[L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; -#else - float pOut[L_FRAME48k * 2]; - float tmp_out_re[L_FRAME48k], tmp_out_im[L_FRAME48k]; -#endif CREND_HANDLE hCrend; ivas_error error; @@ -1713,12 +1708,8 @@ ivas_error ivas_rend_crendProcessSubframe( int16_t subframe_idx, subframe_len; int16_t nchan_out, nchan_in, ch, first_sf, last_sf, slot_size, slots_to_render; float *tc_local[MAX_OUTPUT_CHANNELS]; -#ifdef FIX_RENDERER_STACK float *p_output[BINAURAL_CHANNELS]; float pcm_tmp[BINAURAL_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; -#else - float pcm_tmp[BINAURAL_CHANNELS][L_FRAME48k]; -#endif float *p_pcm_tmp[BINAURAL_CHANNELS]; IVAS_REND_AudioConfigType inConfigType; ivas_error error; @@ -1757,9 +1748,7 @@ ivas_error ivas_rend_crendProcessSubframe( for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { p_pcm_tmp[ch] = pcm_tmp[ch]; -#ifdef FIX_RENDERER_STACK p_output[ch] = output[ch]; -#endif } if ( hTcBuffer != NULL ) @@ -1840,12 +1829,6 @@ ivas_error ivas_rend_crendProcessSubframe( { tc_local[ch] += subframe_len; } -#ifndef FIX_RENDERER_STACK - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - p_pcm_tmp[ch] += subframe_len; - } -#endif if ( hTcBuffer != NULL ) { @@ -1857,7 +1840,6 @@ ivas_error ivas_rend_crendProcessSubframe( return IVAS_ERR_INVALID_INPUT_FORMAT; } -#ifdef FIX_RENDERER_STACK for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { /* move to output */ @@ -1866,18 +1848,10 @@ ivas_error ivas_rend_crendProcessSubframe( p_output[ch] += subframe_len; } -#endif /* update combined orientation access index */ ivas_combined_orientation_update_index( hCombinedOrientationData, subframe_len ); } -#ifndef FIX_RENDERER_STACK - /* move to output */ - for ( ch = 0; ch < nchan_out; ch++ ) - { - mvr2r( pcm_tmp[ch], output[ch], n_samples_to_render ); - } -#endif if ( hTcBuffer != NULL ) { hTcBuffer->subframes_rendered = last_sf; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 6e25b6888d..bb0af1eb72 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -318,7 +318,6 @@ ivas_error ivas_dirac_dec_init_binaural_data( int16_t nchan_to_allocate; int16_t n_samples_granularity; -#ifdef FIX_NCHAN_BUFFERS nchan_to_allocate = BINAURAL_CHANNELS; if ( st_ivas->hDiracDecBin[0] != NULL && st_ivas->hDiracDecBin[0]->useTdDecorr ) { @@ -328,9 +327,6 @@ ivas_error ivas_dirac_dec_init_binaural_data( { nchan_to_allocate++; } -#else - nchan_to_allocate = 2 * BINAURAL_CHANNELS; -#endif if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { nchan_to_allocate = BINAURAL_CHANNELS + st_ivas->nchan_ism; @@ -456,10 +452,6 @@ void ivas_dirac_dec_binaural_render( uint16_t nchan_out; SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; float *output_f_local[MAX_OUTPUT_CHANNELS]; -#ifndef FIX_RENDERER_STACK - float output_f_local_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k]; - int16_t output_length; -#endif hSpatParamRendCom = st_ivas->hSpatParamRendCom; nchan_out = BINAURAL_CHANNELS; @@ -468,11 +460,7 @@ void ivas_dirac_dec_binaural_render( #endif for ( ch = 0; ch < nchan_out; ch++ ) { -#ifdef FIX_RENDERER_STACK output_f_local[ch] = output_f[ch]; -#else - output_f_local[ch] = output_f_local_buff[ch]; -#endif } slot_size = NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); @@ -490,9 +478,6 @@ void ivas_dirac_dec_binaural_render( #ifdef DEBUGGING assert( slots_to_render == 0 ); -#endif -#ifndef FIX_RENDERER_STACK - output_length = 0; #endif for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { @@ -504,21 +489,10 @@ void ivas_dirac_dec_binaural_render( output_f_local[ch] += n_samples_sf; } -#ifndef FIX_RENDERER_STACK - output_length += n_samples_sf; - -#endif /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); } -#ifndef FIX_RENDERER_STACK - for ( ch = 0; ch < nchan_out; ch++ ) - { - mvr2r( output_f_local_buff[ch], output_f[ch], output_length ); - } - -#endif if ( hSpatParamRendCom->slots_rendered == hSpatParamRendCom->num_slots ) { hSpatParamRendCom->dirac_read_idx = ( hSpatParamRendCom->dirac_read_idx + DEFAULT_JBM_SUBFRAMES_5MS ) % hSpatParamRendCom->dirac_md_buffer_length; diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 4458e9ea84..560f9f6661 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -271,11 +271,7 @@ int16_t ivas_get_nchan_buffers_dec( output_config = st_ivas->hDecoderConfig->output_config; -#ifdef FIX_NCHAN_BUFFERS nchan_out_buff = st_ivas->nchan_transport; -#else - nchan_out_buff = MAX_OUTPUT_CHANNELS; -#endif if ( st_ivas->ivas_format == MONO_FORMAT ) { @@ -287,108 +283,35 @@ int16_t ivas_get_nchan_buffers_dec( } else if ( st_ivas->ivas_format == ISM_FORMAT ) { -#ifdef FIX_NCHAN_BUFFERS nchan_out_buff = max( st_ivas->hDecoderConfig->nchan_out, st_ivas->nchan_ism ); if ( st_ivas->ism_mode == ISM_MODE_PARAM || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { nchan_out_buff = max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); } -#else - nchan_out_buff = st_ivas->nchan_ism; - - if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) - { - nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); - } - else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) - { - nchan_out_buff = max( audioCfg2channels( st_ivas->transport_config ), audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = max( nchan_out_buff, audioCfg2channels( output_config ) ); - } -#endif } else if ( st_ivas->ivas_format == SBA_FORMAT ) { -#ifdef FIX_NCHAN_BUFFERS int16_t nchan_internal; nchan_internal = ivas_sba_get_nchan_metadata( sba_analysis_order, ivas_total_brate ); nchan_out_buff = max( nchan_internal, st_ivas->hDecoderConfig->nchan_out ); -#else - int16_t nchan_internal; - nchan_internal = ivas_sba_get_nchan_metadata( sba_analysis_order, ivas_total_brate ); - nchan_out_buff = st_ivas->hDecoderConfig->nchan_out; - - if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) - { - nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); - } - else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) - { - nchan_out_buff = max( audioCfg2channels( st_ivas->transport_config ), audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = max( nchan_out_buff, audioCfg2channels( output_config ) ); - } - nchan_out_buff = max( nchan_out_buff, nchan_internal ); -#endif } else if ( st_ivas->ivas_format == MASA_FORMAT ) { -#ifdef FIX_NCHAN_BUFFERS nchan_out_buff = max( st_ivas->hDecoderConfig->nchan_out, st_ivas->nchan_transport ); if ( st_ivas->hDiracDecBin[0] != NULL && st_ivas->hDiracDecBin[0]->useTdDecorr ) { nchan_out_buff = 2 * BINAURAL_CHANNELS; } -#else - nchan_out_buff = CPE_CHANNELS; - - if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) - { - nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); - } - else if ( output_config == IVAS_AUDIO_CONFIG_STEREO || output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - nchan_out_buff = 2 * CPE_CHANNELS; - } - else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) - { - nchan_out_buff = max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = max( nchan_out_buff, audioCfg2channels( output_config ) ); - } - - if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->nchan_ism > 0 ) - { - nchan_out_buff = st_ivas->nchan_ism + CPE_CHANNELS; - } -#endif } else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifdef FIX_NCHAN_BUFFERS nchan_out_buff = max( st_ivas->hDecoderConfig->nchan_out, st_ivas->nchan_transport + st_ivas->nchan_ism ); -#else - nchan_out_buff = st_ivas->nchan_ism + CPE_CHANNELS; - - if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) - { - nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); - } - else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) - { - nchan_out_buff = max( nchan_out_buff, BINAURAL_CHANNELS + st_ivas->nchan_ism ); - } - else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) - { - nchan_out_buff = max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = max( nchan_out_buff, audioCfg2channels( output_config ) ); - } -#endif } else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { -#ifdef FIX_NCHAN_BUFFERS int16_t nchan_internal; nchan_internal = ivas_sba_get_nchan_metadata( sba_analysis_order, ivas_total_brate ); @@ -409,49 +332,9 @@ int16_t ivas_get_nchan_buffers_dec( { nchan_out_buff = max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); } -#else - int16_t nchan_internal; - nchan_internal = ivas_sba_get_nchan_metadata( sba_analysis_order, ivas_total_brate ); - nchan_out_buff = st_ivas->nchan_ism + st_ivas->nchan_transport; - - if ( st_ivas->hMCT != NULL ) - { - nchan_out_buff = ( ( nchan_out_buff + 1 ) >> 1 ) << 1; /* ensure odd number of channels in MCT */ - } - - if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) - { - nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); - } - else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) - { - nchan_out_buff = max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = max( nchan_out_buff, audioCfg2channels( output_config ) ); - - if ( st_ivas->renderer_type == RENDERER_OSBA_AMBI || st_ivas->renderer_type == RENDERER_OSBA_LS ) - { - nchan_out_buff = max( nchan_out_buff + st_ivas->nchan_ism, audioCfg2channels( output_config ) ); /* needed for ivas_sba_upmixer_renderer() */ - } - else - { - nchan_out_buff = max( nchan_out_buff + st_ivas->nchan_ism, audioCfg2channels( output_config ) ); /* needed for ivas_spar_dec_upmixer_sf() which is based on 'nchan_out' */ - } - } - else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) - { - nchan_out_buff = st_ivas->hDecoderConfig->nchan_out + st_ivas->nchan_ism; /*take into account sba_ch_idx' in ivas_dec() */ - } - - if ( !( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO ) ) - { - nchan_out_buff = max( nchan_out_buff, nchan_internal + st_ivas->nchan_ism ); - } - nchan_out_buff = min( nchan_out_buff, MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS ); -#endif } else if ( st_ivas->ivas_format == MC_FORMAT ) { -#ifdef FIX_NCHAN_BUFFERS nchan_out_buff = max( st_ivas->hDecoderConfig->nchan_out, st_ivas->nchan_transport ); if ( st_ivas->hOutSetup.separateChannelEnabled ) @@ -467,19 +350,6 @@ int16_t ivas_get_nchan_buffers_dec( { nchan_out_buff = max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); } -#else - nchan_out_buff = st_ivas->hDecoderConfig->nchan_out; - - if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) - { - nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); - } - else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) - { - nchan_out_buff = max( audioCfg2channels( st_ivas->transport_config ), audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = max( nchan_out_buff, audioCfg2channels( output_config ) ); - } -#endif } if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) @@ -509,13 +379,11 @@ ivas_error ivas_output_buff_dec( { for ( ch = nchan_out_buff_old; ch < nchan_out_buff; ch++ ) { -#ifdef FIX_NCHAN_BUFFERS #ifdef DEBUGGING if ( p_output_f[ch] != NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Memory for floating-point output audio buffer is already allocated!\n" ) ); } -#endif #endif /* note: these are intra-frame heap memories */ if ( ( p_output_f[ch] = (float *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( float ) ) ) == NULL ) -- GitLab From dab8a3eddd854b2f6226d40bca51da564502af8a Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 10 Jun 2025 14:21:40 +0200 Subject: [PATCH 3/6] accept FIX_1319_STACK_SBA_DECODER --- lib_com/ivas_prot.h | 5 --- lib_com/options.h | 1 - lib_dec/ivas_dirac_dec.c | 74 ++----------------------------------- lib_dec/ivas_spar_decoder.c | 17 --------- lib_dec/lib_dec.c | 2 - 5 files changed, 3 insertions(+), 96 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 0a804a5815..3247a0ba74 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3727,13 +3727,8 @@ void ivas_dirac_dec_render_sf( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float *output_f[], /* i/o: synthesized core-coder transport channels/DirAC output */ const int16_t nchan_transport, /* i : number of transport channels */ -#ifdef FIX_1319_STACK_SBA_DECODER float *pppQMfFrame_ts_re[HOA3_CHANNELS][CLDFB_NO_COL_MAX], float *pppQMfFrame_ts_im[HOA3_CHANNELS][CLDFB_NO_COL_MAX] -#else - float *pppQMfFrame_ts_re[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX], - float *pppQMfFrame_ts_im[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX] -#endif ); void computeDiffuseness_mdft( diff --git a/lib_com/options.h b/lib_com/options.h index 57ca466e56..e6050a82d2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,7 +160,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ -#define FIX_1319_STACK_SBA_DECODER /* VA: issue 1319: Optimize the definition of buffer lengths in the SBA decoder */ #define JBM_MEMORY_OPT /* VA: issue 916: optimization of RAM in the JBM decoder */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 723c3f64d6..279e38a821 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1623,7 +1623,7 @@ void ivas_dirac_dec_render( return; } -#ifdef FIX_1319_STACK_SBA_DECODER + /*------------------------------------------------------------------------- * Local functions to perform binaural rendering with optimized stack *------------------------------------------------------------------------*/ @@ -1696,7 +1696,7 @@ static void binRenderer( return; } -#endif + /*------------------------------------------------------------------------- * ivas_dirac_dec_render_sf() @@ -1708,14 +1708,8 @@ void ivas_dirac_dec_render_sf( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float *output_f[], /* i/o: synthesized core-coder transport channels/DirAC output */ const int16_t nchan_transport, /* i : number of transport channels */ -#ifdef FIX_1319_STACK_SBA_DECODER float *pppQMfFrame_ts_re[HOA3_CHANNELS][CLDFB_NO_COL_MAX], - float *pppQMfFrame_ts_im[HOA3_CHANNELS][CLDFB_NO_COL_MAX] -#else - float *pppQMfFrame_ts_re[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX], - float *pppQMfFrame_ts_im[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX] -#endif -) + float *pppQMfFrame_ts_im[HOA3_CHANNELS][CLDFB_NO_COL_MAX] ) { int16_t i, ch, idx_in, idx_lfe; DIRAC_DEC_HANDLE hDirAC; @@ -1730,19 +1724,10 @@ void ivas_dirac_dec_render_sf( int16_t slot_idx_start, slot_idx_start_cldfb_synth, md_idx; /*CLDFB: last output channels reserved to LFE for CICPx*/ -#ifdef FIX_1319_STACK_SBA_DECODER float Cldfb_RealBuffer[MAX_OUTPUT_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer[MAX_OUTPUT_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; float Cldfb_RealBuffer_Binaural[1][BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_Binaural[1][BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; -#else - float Cldfb_RealBuffer[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_RealBuffer_Temp[2][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer_Temp[2][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; -#endif int16_t index, num_freq_bands; /* local copies of azi, ele, diffuseness */ @@ -1919,29 +1904,17 @@ void ivas_dirac_dec_render_sf( /* CLDFB Analysis*/ for ( ch = 0; ch < nchan_transport; ch++ ) { -#ifdef FIX_1319_STACK_SBA_DECODER cldfbAnalysis_ts( &( st_ivas->hTcBuffer->tc[hDirACRend->sba_map_tc[ch]][hSpatParamRendCom->num_freq_bands * index_slot] ), Cldfb_RealBuffer_Binaural[0][ch][slot_idx], /* note: it is a tmp. buffer at this point */ Cldfb_ImagBuffer_Binaural[0][ch][slot_idx], /* note: it is a tmp. buffer at this point */ hSpatParamRendCom->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); -#else - cldfbAnalysis_ts( &( st_ivas->hTcBuffer->tc[hDirACRend->sba_map_tc[ch]][hSpatParamRendCom->num_freq_bands * index_slot] ), - Cldfb_RealBuffer_Temp[ch][slot_idx], - Cldfb_ImagBuffer_Temp[ch][slot_idx], - hSpatParamRendCom->num_freq_bands, - st_ivas->cldfbAnaDec[ch] ); -#endif } } if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { -#ifdef FIX_1319_STACK_SBA_DECODER ivas_omasa_preProcessStereoTransportsForEditedObjects( st_ivas, Cldfb_RealBuffer_Binaural[0], Cldfb_ImagBuffer_Binaural[0], hSpatParamRendCom->num_freq_bands, subframe_idx ); -#else - ivas_omasa_preProcessStereoTransportsForEditedObjects( st_ivas, Cldfb_RealBuffer_Temp, Cldfb_ImagBuffer_Temp, hSpatParamRendCom->num_freq_bands, subframe_idx ); -#endif } } @@ -1968,13 +1941,8 @@ void ivas_dirac_dec_render_sf( { for ( ch = 0; ch < nchan_transport; ch++ ) { -#ifdef FIX_1319_STACK_SBA_DECODER mvr2r( Cldfb_RealBuffer_Binaural[0][ch][slot_idx], Cldfb_RealBuffer[ch][0], hSpatParamRendCom->num_freq_bands ); mvr2r( Cldfb_ImagBuffer_Binaural[0][ch][slot_idx], Cldfb_ImagBuffer[ch][0], hSpatParamRendCom->num_freq_bands ); -#else - mvr2r( Cldfb_RealBuffer_Temp[ch][slot_idx], Cldfb_RealBuffer[ch][0], hSpatParamRendCom->num_freq_bands ); - mvr2r( Cldfb_ImagBuffer_Temp[ch][slot_idx], Cldfb_ImagBuffer[ch][0], hSpatParamRendCom->num_freq_bands ); -#endif } } else @@ -2417,7 +2385,6 @@ void ivas_dirac_dec_render_sf( } } -#ifdef FIX_1319_STACK_SBA_DECODER /* Perform binaural rendering */ if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { @@ -2430,42 +2397,12 @@ void ivas_dirac_dec_render_sf( Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); } -#else - /* Perform binaural rendering */ - ivas_binRenderer( st_ivas->hBinRenderer, ( st_ivas->hSplitBinRend == NULL ) ? NULL : &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, st_ivas->hCombinedOrientationData, hSpatParamRendCom->subframe_nbslots[subframe_idx], -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - NULL, -#endif - Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); - - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - int16_t pos_idx; - for ( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ ) - { - for ( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[subframe_idx]; slot_idx++ ) - { - for ( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) - { - mvr2r( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands ); - mvr2r( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], hSpatParamRendCom->num_freq_bands ); - } - } - } - } -#endif - /* Inverse CLDFB*/ for ( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) { /* open CLDFB buffer up to CLDFB_NO_CHANNELS_MAX bands for 48kHz */ -#ifdef FIX_1319_STACK_SBA_DECODER float *RealBuffer[CLDFB_SLOTS_PER_SUBFRAME]; float *ImagBuffer[CLDFB_SLOTS_PER_SUBFRAME]; -#else - float *RealBuffer[MAX_PARAM_SPATIAL_SUBFRAMES]; - float *ImagBuffer[MAX_PARAM_SPATIAL_SUBFRAMES]; -#endif for ( i = 0; i < hSpatParamRendCom->subframe_nbslots[subframe_idx]; i++ ) { @@ -2489,13 +2426,8 @@ void ivas_dirac_dec_render_sf( } else { -#ifdef FIX_1319_STACK_SBA_DECODER float *RealBuffer[CLDFB_SLOTS_PER_SUBFRAME]; float *ImagBuffer[CLDFB_SLOTS_PER_SUBFRAME]; -#else - float *RealBuffer[MAX_PARAM_SPATIAL_SUBFRAMES]; - float *ImagBuffer[MAX_PARAM_SPATIAL_SUBFRAMES]; -#endif int16_t outchannels; idx_in = 0; diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index bdcf15e2d8..41319e9fe2 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -1367,28 +1367,15 @@ void ivas_spar_dec_upmixer_sf( ) { int16_t cldfb_band, num_cldfb_bands, numch_in, numch_out; -#ifdef FIX_1319_STACK_SBA_DECODER float *cldfb_in_ts_re[HOA3_CHANNELS][CLDFB_NO_COL_MAX]; float *cldfb_in_ts_im[HOA3_CHANNELS][CLDFB_NO_COL_MAX]; -#else - float *cldfb_in_ts_re[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_COL_MAX]; - float *cldfb_in_ts_im[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_COL_MAX]; -#endif int16_t i, b, ts, out_ch, in_ch; int16_t num_spar_bands, spar_band, nchan_transport; int16_t num_in_ingest, split_band; int16_t slot_size, slot_idx_start; -#ifdef FIX_1319_STACK_SBA_DECODER float *p_tc[HOA3_CHANNELS]; -#else - float *p_tc[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; -#endif int16_t md_idx; -#ifdef FIX_1319_STACK_SBA_DECODER float Pcm_tmp[HOA3_CHANNELS][2 /* Re, Im*/ * L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; -#else - float Pcm_tmp[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][L_FRAME48k]; -#endif int16_t numch_out_dirac; float mixer_mat[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; int16_t b_skip_mat[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; @@ -1503,11 +1490,7 @@ void ivas_spar_dec_upmixer_sf( if ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA ) { /* at this point, output channels are used as intermediate procesing buffers */ -#ifdef FIX_1319_STACK_SBA_DECODER for ( in_ch = 0; in_ch < HOA3_CHANNELS; in_ch++ ) -#else - for ( in_ch = 0; in_ch < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; in_ch++ ) -#endif { for ( ts = 0; ts < MAX_PARAM_SPATIAL_SUBFRAMES; ts++ ) { diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 7750bc70fc..18794220a9 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -4832,11 +4832,9 @@ static void ivas_destroy_handle_isar( free( ( *hSplitBinRend )->hCldfbDataOut ); ( *hSplitBinRend )->hCldfbDataOut = NULL; } -#ifdef FIX_1319_STACK_SBA_DECODER free( ( *hSplitBinRend ) ); ( *hSplitBinRend ) = NULL; -#endif } return; -- GitLab From 56357cd28d770c2ad3306808891a028a6df8c881 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 10 Jun 2025 14:28:41 +0200 Subject: [PATCH 4/6] accept JBM_MEMORY_OPT --- lib_com/ivas_cnst.h | 5 - lib_com/ivas_prot.h | 13 --- lib_com/ivas_tools.c | 36 ------ lib_com/options.h | 2 +- lib_dec/ivas_jbm_dec.c | 245 +-------------------------------------- lib_dec/ivas_stat_dec.h | 26 ++--- lib_dec/jbm_pcmdsp_apa.c | 4 - lib_dec/jbm_pcmdsp_apa.h | 7 +- lib_dec/lib_dec.c | 56 +-------- 9 files changed, 16 insertions(+), 378 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 6efd67fd39..155fa08eb2 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -172,13 +172,8 @@ typedef enum #define JBM_CLDFB_SLOTS_IN_SUBFRAME 4 #define MAX_JBM_CLDFB_TIMESLOTS 32 #define DEFAULT_JBM_CLDFB_TIMESLOTS 16 -#ifdef JBM_MEMORY_OPT #define MAX_JBM_L_FRAME48k ( IVAS_MAX_FRAME_SIZE * 2 ) /* 1920: max. time-scaled frame buffer length (per channel) in samples */ #define MAX_JBM_L_FRAME_NS 40000000L /* 40 ms: time-scaled frame size in ns, proportional to MAX_JBM_L_FRAME48k */ -#else -#define MAX_JBM_L_FRAME48k 1920 -#define MAX_JBM_L_FRAME_NS 40000000L -#endif #define MAX_SPAR_INTERNAL_CHANNELS IVAS_SPAR_MAX_CH #define MAX_CLDFB_DIGEST_CHANNELS 3 /* == maximum of ParamISM TCs and ParamMC TCs */ diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 3247a0ba74..4f00e85a4d 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -259,7 +259,6 @@ uint32_t ivas_syn_output( int16_t *synth_out /* o : integer 16 bits synthesis signal */ ); -#ifdef JBM_MEMORY_OPT void ivas_buffer_interleaved_to_deinterleaved( float *audio, /* i/o: audio buffer */ const int16_t n_channels, /* i : number of channels */ @@ -273,14 +272,6 @@ void ivas_buffer_deinterleaved_to_interleaved( const int16_t frame_length, /* i : frame length (one channel) */ float *audio_out /* o : interleaved audio buffer */ ); -#else -void ivas_syn_output_f( - float *synth[], /* i/o: float synthesis signal */ - const int16_t output_frame, /* i : output frame length (one channel) */ - const int16_t n_channels, /* i : number of output channels */ - float *synth_out /* o : integer 16 bits synthesis signal */ -); -#endif void ivas_initialize_handles_enc( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ @@ -849,10 +840,6 @@ void ivas_jbm_dec_feed_tc_to_renderer( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const int16_t nSamplesForRendering, /* i : number of TC samples available for rendering */ int16_t *nSamplesResidual /* o : number of samples not fitting into the renderer grid and buffer for the next call*/ -#ifndef JBM_MEMORY_OPT - , - float *data /* i/o: time-scaled transport channels */ -#endif ); void ivas_dec_prepare_renderer( diff --git a/lib_com/ivas_tools.c b/lib_com/ivas_tools.c index a4b414b96d..baa98da6b7 100644 --- a/lib_com/ivas_tools.c +++ b/lib_com/ivas_tools.c @@ -148,7 +148,6 @@ uint32_t ivas_syn_output( return noClipping; } -#ifdef JBM_MEMORY_OPT /*-------------------------------------------------------------------* * ivas_buffer_interleaved_to_deinterleaved() @@ -211,41 +210,6 @@ void ivas_buffer_deinterleaved_to_interleaved( return; } -#else - -/*-------------------------------------------------------------------* - * ivas_syn_output_f() - * - * Output ivas synthesis signal with compensation for saturation - * returns number of clipped samples - *-------------------------------------------------------------------*/ - -/*! r: number of clipped samples */ -void ivas_syn_output_f( - float *synth[], /* i/o: float synthesis signal */ - const int16_t output_frame, /* i : output frame length (one channel) */ - const int16_t n_channels, /* i : number of output channels */ - float *synth_out /* o : integer 16 bits synthesis signal */ -) -{ - int16_t i, n; - - /*-----------------------------------------------------------------* - * float to integer conversion with saturation control - *-----------------------------------------------------------------*/ - - for ( n = 0; n < n_channels; n++ ) - { - for ( i = 0; i < output_frame; i++ ) - { - synth_out[i * n_channels + n] = synth[n][i]; - } - } - - return; -} - -#endif /*-------------------------------------------------------------------* * mvr2r_inc() diff --git a/lib_com/options.h b/lib_com/options.h index e6050a82d2..6f79c32f40 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,7 +160,7 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ -#define JBM_MEMORY_OPT /* VA: issue 916: optimization of RAM in the JBM decoder */ + /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 261b8159f2..1c9870433a 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -758,19 +758,10 @@ void ivas_jbm_dec_feed_tc_to_renderer( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const int16_t nSamplesForRendering, /* i : number of TC samples available for rendering */ int16_t *nSamplesResidual /* o : number of samples not fitting into the renderer grid and buffer for the next call*/ -#ifndef JBM_MEMORY_OPT - , - float *data /* i : transport channels */ -#endif ) { -#ifdef JBM_MEMORY_OPT float tmp_buf[MAX_JBM_L_FRAME48k]; float *p_data_f[FOA_CHANNELS + MAX_NUM_OBJECTS]; -#else - float data_f[MAX_CLDFB_DIGEST_CHANNELS][MAX_JBM_L_FRAME48k]; /* 'float' buffer for transport channels that will be directly converted with the CLDFB */ - float *p_data_f[MAX_CLDFB_DIGEST_CHANNELS]; -#endif int16_t n, n_render_timeslots, n_ch_cldfb; int16_t ch; DECODER_TC_BUFFER_HANDLE hTcBuffer; @@ -780,7 +771,6 @@ void ivas_jbm_dec_feed_tc_to_renderer( if ( st_ivas->hDecoderConfig->Opt_tsm ) { -#ifdef JBM_MEMORY_OPT int16_t n_samples_still_available; int16_t n_ch_full_copy, n_ch_res_copy; @@ -811,47 +801,6 @@ void ivas_jbm_dec_feed_tc_to_renderer( mvr2r( tmp_buf + nSamplesForRendering - *nSamplesResidual, hTcBuffer->tc_buffer_old[ch], *nSamplesResidual ); } } -#else - int16_t n_samples_still_available, m; - int16_t n_ch_full_copy; - int16_t n_ch_res_copy; - - for ( n = 0; n < n_ch_cldfb; n++ ) - { - p_data_f[n] = &data_f[n][0]; - } - - n_samples_still_available = hTcBuffer->n_samples_buffered - hTcBuffer->n_samples_rendered; - hTcBuffer->n_samples_buffered = n_samples_still_available + nSamplesForRendering + hTcBuffer->n_samples_discard; - hTcBuffer->n_samples_available = hTcBuffer->n_samples_granularity * ( hTcBuffer->n_samples_buffered / hTcBuffer->n_samples_granularity ); - *nSamplesResidual = hTcBuffer->n_samples_buffered - hTcBuffer->n_samples_available; - n_ch_full_copy = min( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); - n_ch_res_copy = hTcBuffer->nchan_transport_jbm - hTcBuffer->nchan_buffer_full; - - for ( ch = 0; ch < n_ch_full_copy; ch++ ) - { - set_zero( hTcBuffer->tc[ch], hTcBuffer->n_samples_discard ); - mvr2r( hTcBuffer->tc[ch] + hTcBuffer->n_samples_rendered, hTcBuffer->tc[ch] + hTcBuffer->n_samples_discard, n_samples_still_available ); - for ( m = 0; m < nSamplesForRendering; m++ ) - { - hTcBuffer->tc[ch][n_samples_still_available + hTcBuffer->n_samples_discard + m] = data[m * hTcBuffer->nchan_transport_jbm + ch]; - } - } - - if ( n_ch_res_copy > 0 ) - { - for ( ; ch < hTcBuffer->nchan_transport_jbm; ch++ ) - { - mvr2r( hTcBuffer->tc[ch], p_data_f[ch], n_samples_still_available ); - - for ( m = 0; m < nSamplesForRendering; m++ ) - { - p_data_f[ch][n_samples_still_available + m] = data[m * hTcBuffer->nchan_transport_jbm + ch]; - } - mvr2r( p_data_f[ch] + hTcBuffer->n_samples_available, hTcBuffer->tc[ch], *nSamplesResidual ); - } - } -#endif n_render_timeslots = hTcBuffer->n_samples_available / hTcBuffer->n_samples_granularity; } @@ -862,11 +811,7 @@ void ivas_jbm_dec_feed_tc_to_renderer( p_data_f[n] = &st_ivas->p_output_f[n][0]; } -#ifdef JBM_MEMORY_OPT ch = max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); -#else - ch = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); -#endif for ( n = 0; n < ch; n++ ) { hTcBuffer->tc[n] = st_ivas->p_output_f[n]; /* note: buffers needed in the TD decorellator */ @@ -940,11 +885,7 @@ ivas_error ivas_jbm_dec_render( if ( !st_ivas->hDecoderConfig->Opt_tsm ) { -#ifdef JBM_MEMORY_OPT for ( n = 0; n < MAX_INTERN_CHANNELS; n++ ) -#else - for ( n = 0; n < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; n++ ) -#endif { st_ivas->hTcBuffer->tc[n] = p_output[n]; } @@ -1397,11 +1338,7 @@ ivas_error ivas_jbm_dec_render( break; case PCM_FLOAT32: -#ifdef JBM_MEMORY_OPT ivas_buffer_deinterleaved_to_interleaved( p_output, nchan_out_syn_output, *nSamplesRendered, (float *) data ); -#else - ivas_syn_output_f( p_output, *nSamplesRendered, nchan_out_syn_output, (float *) data ); -#endif break; default: error = IVAS_ERR_UNKNOWN; @@ -1464,7 +1401,6 @@ ivas_error ivas_jbm_dec_flush_renderer( { int16_t ch_idx; -#ifdef JBM_MEMORY_OPT /* render available full slots (with new lower granularity) */ for ( ch_idx = 0; ch_idx < max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); ch_idx++ ) { @@ -1472,16 +1408,6 @@ ivas_error ivas_jbm_dec_flush_renderer( mvr2r( hTcBuffer->tc_buffer_old[ch_idx], hTcBuffer->tc[ch_idx], n_samples_to_render ); set_zero( hTcBuffer->tc[ch_idx] + n_samples_to_render, hTcBuffer->n_samples_granularity - n_samples_to_render ); } -#else - /* render what is still there with zero padding */ - for ( ch_idx = 0; ch_idx < hTcBuffer->nchan_buffer_full; ch_idx++ ) - { - /* move it at the beginning of the TC buffer with zero padding */ - mvr2r( hTcBuffer->tc[ch_idx] + hTcBuffer->n_samples_rendered, hTcBuffer->tc[ch_idx], n_samples_to_render ); - set_zero( hTcBuffer->tc[ch_idx] + n_samples_to_render, hTcBuffer->n_samples_granularity - n_samples_to_render ); - mvr2r( hTcBuffer->tc[ch_idx] + hTcBuffer->n_samples_rendered + n_samples_to_render, hTcBuffer->tc[ch_idx] + hTcBuffer->n_samples_granularity, n_samples_still_available ); - } -#endif /* simple change of the slot info */ hTcBuffer->num_slots = 1; @@ -1683,11 +1609,7 @@ ivas_error ivas_jbm_dec_flush_renderer( ivas_syn_output( p_output, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, (int16_t *) data ); break; case PCM_FLOAT32: -#ifdef JBM_MEMORY_OPT ivas_buffer_deinterleaved_to_interleaved( p_output, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, (float *) data ); -#else - ivas_syn_output_f( p_output, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, (float *) data ); -#endif break; default: error = IVAS_ERR_UNKNOWN; @@ -2108,7 +2030,6 @@ int16_t ivas_jbm_dec_get_render_granularity( return render_granularity; } -#ifdef JBM_MEMORY_OPT /*--------------------------------------------------------------------------* * ivas_jbm_dec_tc_audio_allocate() @@ -2228,7 +2149,7 @@ static void ivas_jbm_dec_tc_audio_deallocate( return; } -#endif + /*--------------------------------------------------------------------------* * ivas_jbm_dec_tc_buffer_open() @@ -2245,17 +2166,9 @@ ivas_error ivas_jbm_dec_tc_buffer_open( const int16_t n_samples_granularity /* i : granularity of the renderer/buffer */ ) { -#ifndef JBM_MEMORY_OPT - int16_t nsamp_to_allocate; -#endif DECODER_TC_BUFFER_HANDLE hTcBuffer; int16_t nMaxSlotsPerSubframe; -#ifdef JBM_MEMORY_OPT ivas_error error; -#else - int16_t nchan_residual; - int16_t ch_idx; -#endif /*-----------------------------------------------------------------* * prepare library opening @@ -2270,9 +2183,6 @@ ivas_error ivas_jbm_dec_tc_buffer_open( hTcBuffer->nchan_transport_jbm = nchan_transport_jbm; hTcBuffer->nchan_transport_internal = nchan_transport_internal; hTcBuffer->nchan_buffer_full = nchan_full; -#ifndef JBM_MEMORY_OPT - nchan_residual = nchan_transport_internal - nchan_full; -#endif hTcBuffer->n_samples_granularity = n_samples_granularity; hTcBuffer->n_samples_available = 0; hTcBuffer->n_samples_buffered = 0; @@ -2282,80 +2192,16 @@ ivas_error ivas_jbm_dec_tc_buffer_open( hTcBuffer->n_samples_discard = 0; hTcBuffer->n_samples_flushed = 0; hTcBuffer->nb_subframes = MAX_PARAM_SPATIAL_SUBFRAMES; -#ifndef JBM_MEMORY_OPT - nsamp_to_allocate = 0; -#endif + nMaxSlotsPerSubframe = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / ( FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES ) ) / hTcBuffer->n_samples_granularity; hTcBuffer->num_slots = nMaxSlotsPerSubframe * MAX_PARAM_SPATIAL_SUBFRAMES; set_s( hTcBuffer->subframe_nbslots, 0, MAX_JBM_SUBFRAMES_5MS ); set_s( hTcBuffer->subframe_nbslots, nMaxSlotsPerSubframe, MAX_PARAM_SPATIAL_SUBFRAMES ); -#ifdef JBM_MEMORY_OPT if ( ( error = ivas_jbm_dec_tc_audio_allocate( hTcBuffer, st_ivas->hDecoderConfig->output_Fs, st_ivas->hDecoderConfig->Opt_tsm ) ) != IVAS_ERR_OK ) { return error; } -#else - { - int16_t n_samp_full, n_samp_residual; - int32_t offset; - if ( st_ivas->hDecoderConfig->Opt_tsm ) - { - n_samp_full = ( NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) + hTcBuffer->n_samples_granularity - 1 ); - n_samp_residual = hTcBuffer->n_samples_granularity - 1; - } - else - { - n_samp_full = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); - n_samp_residual = 0; - } - - nsamp_to_allocate = hTcBuffer->nchan_buffer_full * n_samp_full; - nsamp_to_allocate += nchan_residual * n_samp_residual; - - if ( nsamp_to_allocate == 0 ) - { - hTcBuffer->tc_buffer = NULL; - - for ( ch_idx = 0; ch_idx < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ ) - { - hTcBuffer->tc[ch_idx] = NULL; - } - } - else - { - if ( st_ivas->hDecoderConfig->Opt_tsm ) - { - /* note: the maximum buffer length is for OSBA DISC mode with ISMs -> 15*(1920+239)=32385 samples */ - if ( ( hTcBuffer->tc_buffer = (float *) malloc( nsamp_to_allocate * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for JBM TC Buffer\n" ) ); - } - set_zero( hTcBuffer->tc_buffer, nsamp_to_allocate ); - - offset = 0; - for ( ch_idx = 0; ch_idx < hTcBuffer->nchan_buffer_full; ch_idx++ ) - { - hTcBuffer->tc[ch_idx] = &hTcBuffer->tc_buffer[offset]; - offset += n_samp_full; - } - for ( ; ch_idx < hTcBuffer->nchan_transport_internal; ch_idx++ ) - { - hTcBuffer->tc[ch_idx] = &hTcBuffer->tc_buffer[offset]; - offset += n_samp_residual; - } - for ( ; ch_idx < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ ) - { - hTcBuffer->tc[ch_idx] = NULL; - } - } - else - { - hTcBuffer->tc_buffer = NULL; - } - } - } -#endif st_ivas->hTcBuffer = hTcBuffer; @@ -2378,12 +2224,7 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( const int16_t n_samples_granularity /* i : new granularity of the renderer/buffer */ ) { -#ifdef JBM_MEMORY_OPT ivas_error error; -#else - int16_t nsamp_to_allocate, n_samp_full, n_samp_residual, offset, nchan_residual; - int16_t ch_idx; -#endif DECODER_TC_BUFFER_HANDLE hTcBuffer; hTcBuffer = st_ivas->hTcBuffer; @@ -2425,9 +2266,6 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( hTcBuffer->nchan_transport_jbm = nchan_transport_jbm; hTcBuffer->nchan_transport_internal = nchan_transport_internal; hTcBuffer->nchan_buffer_full = nchan_full; -#ifndef JBM_MEMORY_OPT - nchan_residual = nchan_transport_internal - nchan_full; -#endif hTcBuffer->n_samples_granularity = n_samples_granularity; #ifdef DEBUGGING @@ -2435,7 +2273,6 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( assert( ( hTcBuffer->n_samples_buffered - hTcBuffer->n_samples_rendered ) < n_samples_granularity ); #endif -#ifdef JBM_MEMORY_OPT /* reallocate TC audio buffers */ ivas_jbm_dec_tc_audio_deallocate( hTcBuffer ); @@ -2444,67 +2281,6 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( { return error; } -#else - /* realloc buffers */ - if ( hTcBuffer->tc_buffer != NULL ) - { - free( hTcBuffer->tc_buffer ); - hTcBuffer->tc_buffer = NULL; - } - - if ( st_ivas->hDecoderConfig->Opt_tsm ) - { - n_samp_full = ( NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) + hTcBuffer->n_samples_granularity - 1 ); - n_samp_residual = hTcBuffer->n_samples_granularity - 1; - } - else - { - n_samp_full = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); - n_samp_residual = 0; - } - nsamp_to_allocate = hTcBuffer->nchan_buffer_full * n_samp_full; - nsamp_to_allocate += nchan_residual * n_samp_residual; - - if ( nsamp_to_allocate == 0 ) - { - hTcBuffer->tc_buffer = NULL; - for ( ch_idx = 0; ch_idx < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ ) - { - hTcBuffer->tc[ch_idx] = NULL; - } - } - else - { - if ( st_ivas->hDecoderConfig->Opt_tsm ) - { - if ( ( hTcBuffer->tc_buffer = (float *) malloc( nsamp_to_allocate * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for JBM TC Buffer\n" ) ); - } - set_zero( hTcBuffer->tc_buffer, nsamp_to_allocate ); - - offset = 0; - for ( ch_idx = 0; ch_idx < hTcBuffer->nchan_buffer_full; ch_idx++ ) - { - hTcBuffer->tc[ch_idx] = &hTcBuffer->tc_buffer[offset]; - offset += n_samp_full; - } - for ( ; ch_idx < hTcBuffer->nchan_transport_internal; ch_idx++ ) - { - hTcBuffer->tc[ch_idx] = &hTcBuffer->tc_buffer[offset]; - offset += n_samp_residual; - } - for ( ; ch_idx < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ ) - { - hTcBuffer->tc[ch_idx] = NULL; - } - } - else - { - hTcBuffer->tc_buffer = NULL; - } - } -#endif return IVAS_ERR_OK; } @@ -2563,26 +2339,9 @@ void ivas_jbm_dec_tc_buffer_close( DECODER_TC_BUFFER_HANDLE *phTcBuffer /* i/o: TC buffer handle */ ) { -#ifndef JBM_MEMORY_OPT - int16_t i; - -#endif if ( *phTcBuffer != NULL ) { -#ifdef JBM_MEMORY_OPT ivas_jbm_dec_tc_audio_deallocate( *phTcBuffer ); -#else - for ( i = 0; i < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; i++ ) - { - ( *phTcBuffer )->tc[i] = NULL; - } - - if ( ( *phTcBuffer )->tc_buffer != NULL ) - { - free( ( *phTcBuffer )->tc_buffer ); - ( *phTcBuffer )->tc_buffer = NULL; - } -#endif free( *phTcBuffer ); *phTcBuffer = NULL; diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 28de5d7340..282d798e4d 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -944,23 +944,17 @@ typedef struct ivas_masa_ism_data_structure typedef struct decoder_tc_buffer_structure { -#ifdef JBM_MEMORY_OPT float *tc_buffer_old[MAX_INTERN_CHANNELS]; /* TC audio samples not rendered in the previous frame */ -#endif - float *tc_buffer; /* the buffer itself */ -#ifdef JBM_MEMORY_OPT - float *tc[MAX_INTERN_CHANNELS]; /* pointers into the buffer to the beginning of each tc */ -#else - float *tc[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; /* pointers into the buffer to the beginning of each tc */ // VE2SB: TBV -#endif - TC_BUFFER_MODE tc_buffer_mode; /* mode of the buffer (no buffering, render buffering, out buffering) */ - int16_t nchan_transport_jbm; /* number of TCs after TC decoding */ - int16_t nchan_transport_internal; /* total number of TC buffer channels, can include e.g. TD decorr data */ - int16_t nchan_buffer_full; /* number of channels to be fully buffered */ - int16_t n_samples_available; /* samples still available for rendering in the current frame */ - int16_t n_samples_buffered; /* full number of samples in the buffer (including spill to next frame) */ - int16_t n_samples_rendered; /* samples already rendered in the current frame */ - int16_t n_samples_granularity; /* render granularity */ + float *tc_buffer; /* the buffer itself */ + float *tc[MAX_INTERN_CHANNELS]; /* pointers into the buffer to the beginning of each tc */ + TC_BUFFER_MODE tc_buffer_mode; /* mode of the buffer (no buffering, render buffering, out buffering) */ + int16_t nchan_transport_jbm; /* number of TCs after TC decoding */ + int16_t nchan_transport_internal; /* total number of TC buffer channels, can include e.g. TD decorr data */ + int16_t nchan_buffer_full; /* number of channels to be fully buffered */ + int16_t n_samples_available; /* samples still available for rendering in the current frame */ + int16_t n_samples_buffered; /* full number of samples in the buffer (including spill to next frame) */ + int16_t n_samples_rendered; /* samples already rendered in the current frame */ + int16_t n_samples_granularity; /* render granularity */ int16_t n_samples_flushed; int16_t subframe_nbslots[MAX_JBM_SUBFRAMES_5MS]; int16_t nb_subframes; diff --git a/lib_dec/jbm_pcmdsp_apa.c b/lib_dec/jbm_pcmdsp_apa.c index fdb41a3cb2..0c0b478a1b 100644 --- a/lib_dec/jbm_pcmdsp_apa.c +++ b/lib_dec/jbm_pcmdsp_apa.c @@ -562,11 +562,7 @@ uint8_t apa_exec( ) { uint16_t i; -#ifdef JBM_MEMORY_OPT float frm_in[APA_BUF]; /* NOTE: this buffer could be smaller if alocated dynamically based on the actual sampling rate and number of channels */ -#else - float frm_in[APA_BUF]; /* TODO(mcjbm): this buffer could be smaller - always allocates space for 16 channels */ -#endif uint16_t l_frm_out; int16_t l_rem; int32_t dl_scaled, dl_copied, l_frm_out_target; diff --git a/lib_dec/jbm_pcmdsp_apa.h b/lib_dec/jbm_pcmdsp_apa.h index 6d35fa8b50..3fc00e9725 100644 --- a/lib_dec/jbm_pcmdsp_apa.h +++ b/lib_dec/jbm_pcmdsp_apa.h @@ -50,14 +50,9 @@ */ /* size of IO buffers (a_in[], a_out[]) for apa_exec() */ -#ifdef JBM_MEMORY_OPT #define APA_BUF_PER_CHANNEL ( IVAS_MAX_FRAME_SIZE * 2 ) /* == twice the max. frame length */ #define APA_MAX_NUM_CHANNELS ( 12 ) /* == MAX_TRANSPORT_CHANNELS */ -#else -#define APA_BUF_PER_CHANNEL ( IVAS_MAX_FRAME_SIZE * 3 ) -#define APA_MAX_NUM_CHANNELS 16 -#endif -#define APA_BUF ( APA_BUF_PER_CHANNEL * APA_MAX_NUM_CHANNELS ) +#define APA_BUF ( APA_BUF_PER_CHANNEL * APA_MAX_NUM_CHANNELS ) /* min/max sampling rate [Hz] */ #define APA_MIN_RATE 1000 diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 18794220a9..eb85d14dab 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -85,9 +85,6 @@ struct IVAS_DEC int16_t tsm_max_scaling; int16_t timeScalingDone; /* have we done already one TSM in a 20ms frame? */ float tsm_quality; -#ifndef JBM_MEMORY_OPT - float *apaExecBuffer; /* Buffer for APA scaling */ -#endif PCMDSP_APA_HANDLE hTimeScaler; bool needNewFrame; bool hasBeenFedFrame; @@ -159,11 +156,9 @@ ivas_error IVAS_DEC_Open( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for IVAS decoder handle" ); } + hIvasDec = *phIvasDec; hIvasDec->hVoIP = NULL; -#ifndef JBM_MEMORY_OPT - hIvasDec->apaExecBuffer = NULL; -#endif hIvasDec->hTimeScaler = NULL; hIvasDec->tsm_scale = 100; hIvasDec->tsm_max_scaling = 0; @@ -354,12 +349,6 @@ void IVAS_DEC_Close( apa_exit( &( *phIvasDec )->hTimeScaler ); -#ifndef JBM_MEMORY_OPT - if ( ( *phIvasDec )->apaExecBuffer != NULL ) - { - free( ( *phIvasDec )->apaExecBuffer ); - } -#endif if ( ( *phIvasDec )->flushbuffer != NULL ) { free( ( *phIvasDec )->flushbuffer ); @@ -1143,11 +1132,8 @@ ivas_error IVAS_DEC_GetSamplesDecoder( } st_ivas = hIvasDec->st_ivas; -#ifdef JBM_MEMORY_OPT + isInitialized_voip = hIvasDec->hTimeScaler != NULL; -#else - isInitialized_voip = hIvasDec->apaExecBuffer != NULL; -#endif if ( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame ) /* wait for the first good frame */ { @@ -1205,17 +1191,11 @@ ivas_error IVAS_DEC_GetSamplesDecoder( return IVAS_ERR_UNKNOWN; } -#ifdef JBM_MEMORY_OPT /* convert deinterleaved decoded TC audio channels buffer to an interleaved one */ ivas_buffer_deinterleaved_to_interleaved( st_ivas->p_output_f, nTransportChannels, hIvasDec->nSamplesFrame, st_ivas->hTcBuffer->tc_buffer ); /* time-scale modification */ if ( apa_exec( hIvasDec->hTimeScaler, st_ivas->hTcBuffer->tc_buffer, hIvasDec->nSamplesFrame * nTransportChannels, (uint16_t) hIvasDec->tsm_max_scaling, st_ivas->hTcBuffer->tc_buffer, &nTimeScalerOutSamples ) != 0 ) -#else - ivas_syn_output_f( st_ivas->p_output_f, hIvasDec->nSamplesFrame, nTransportChannels, hIvasDec->apaExecBuffer ); - - if ( apa_exec( hIvasDec->hTimeScaler, hIvasDec->apaExecBuffer, hIvasDec->nSamplesFrame * nTransportChannels, (uint16_t) hIvasDec->tsm_max_scaling, hIvasDec->apaExecBuffer, &nTimeScalerOutSamples ) != 0 ) -#endif { return IVAS_ERR_UNKNOWN; } @@ -1223,11 +1203,9 @@ ivas_error IVAS_DEC_GetSamplesDecoder( assert( nTimeScalerOutSamples <= APA_BUF ); nSamplesTcsScaled = nTimeScalerOutSamples / nTransportChannels; hIvasDec->timeScalingDone = 1; -#ifdef JBM_MEMORY_OPT /* convert interleaved time-scaled TC audio channels buffer to deinterleaved one */ ivas_buffer_interleaved_to_deinterleaved( st_ivas->hTcBuffer->tc_buffer, nTransportChannels, nSamplesTcsScaled, NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) ); -#endif } else { @@ -1238,11 +1216,7 @@ ivas_error IVAS_DEC_GetSamplesDecoder( * Feed decoded transport channels samples to the renderer *-----------------------------------------------------------------*/ -#ifdef JBM_MEMORY_OPT ivas_jbm_dec_feed_tc_to_renderer( st_ivas, nSamplesTcsScaled, &nResidualSamples ); -#else - ivas_jbm_dec_feed_tc_to_renderer( st_ivas, nSamplesTcsScaled, &nResidualSamples, hIvasDec->apaExecBuffer ); -#endif if ( st_ivas->hDecoderConfig->Opt_tsm ) { @@ -4507,9 +4481,6 @@ static ivas_error apa_setup( const bool isInitialized_voip, const uint16_t nTransportChannels ) { -#ifndef JBM_MEMORY_OPT - int16_t apa_buffer_size; -#endif uint16_t l_ts; l_ts = (uint16_t) hIvasDec->st_ivas->hTcBuffer->n_samples_granularity; @@ -4521,11 +4492,6 @@ static ivas_error apa_setup( float startQuality; startQuality = hIvasDec->tsm_quality; -#ifndef JBM_MEMORY_OPT - apa_buffer_size = APA_BUF_PER_CHANNEL; - /* get current renderer type*/ - -#endif hDecoderConfig = hIvasDec->st_ivas->hDecoderConfig; if ( hDecoderConfig->output_Fs == 8000 ) @@ -4569,15 +4535,6 @@ static ivas_error apa_setup( return IVAS_ERR_INIT_ERROR; } } -#ifndef JBM_MEMORY_OPT - - if ( ( hIvasDec->apaExecBuffer = malloc( sizeof( float ) * apa_buffer_size * nTransportChannels ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); - } - - set_zero( hIvasDec->apaExecBuffer, apa_buffer_size * nTransportChannels ); -#endif } else { @@ -4585,15 +4542,6 @@ static ivas_error apa_setup( { return IVAS_ERR_INIT_ERROR; } -#ifndef JBM_MEMORY_OPT - /* realloc apa_exe_buffer */ - free( hIvasDec->apaExecBuffer ); - if ( ( hIvasDec->apaExecBuffer = malloc( sizeof( float ) * apa_buffer_size * nTransportChannels ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); - } - set_zero( hIvasDec->apaExecBuffer, apa_buffer_size * nTransportChannels ); -#endif } hIvasDec->nTransportChannelsOld = nTransportChannels; -- GitLab From d0ab0d0a62a9b97359ed315b18815fb659e57482 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 10 Jun 2025 14:37:07 +0200 Subject: [PATCH 5/6] accept NONBE_FIX_1172_OBJ_EDIT_JBM, NONBE_1325_TD_STEREO_QUANT_LSF_SEC, and NONBE_FIX_1326_MASA_EXTREND_CUSTOMLS_OUT --- lib_com/bits_alloc.c | 13 ++------- lib_com/ivas_prot.h | 3 -- lib_com/ivas_stereo_td_bit_alloc.c | 43 +++++----------------------- lib_com/options.h | 4 +-- lib_com/prot.h | 28 +++++++----------- lib_dec/acelp_core_dec.c | 46 ++++++++---------------------- lib_dec/acelp_core_switch_dec.c | 4 --- lib_dec/evs_dec.c | 4 --- lib_dec/gs_dec.c | 4 --- lib_dec/init_dec.c | 5 ---- lib_dec/ivas_core_dec.c | 11 ------- lib_dec/ivas_cpe_dec.c | 6 ---- lib_dec/lib_dec.c | 7 ----- lib_enc/acelp_core_enc.c | 35 ++++++----------------- lib_enc/acelp_core_switch_enc.c | 4 --- lib_enc/ivas_core_enc.c | 6 ---- lib_enc/transition_enc.c | 8 ------ lib_rend/lib_rend.c | 7 ++--- 18 files changed, 44 insertions(+), 194 deletions(-) diff --git a/lib_com/bits_alloc.c b/lib_com/bits_alloc.c index 718b8a240e..58a5c8296a 100644 --- a/lib_com/bits_alloc.c +++ b/lib_com/bits_alloc.c @@ -552,12 +552,9 @@ ivas_error config_acelp1( const int16_t tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ const int16_t idchan, /* i : stereo channel ID */ -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - const int16_t active_cnt, /* i : Active frame counter */ -#endif - const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ - const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ - const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ + const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ + const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ + const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ ) { int16_t i, bits, nb_subfr; @@ -772,11 +769,7 @@ ivas_error config_acelp1( bits -= acelp_cfg->mid_lsf_bits; } -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC else if ( tdm_lp_reuse_flag == 1 && idchan == 1 ) -#else - else if ( tdm_lp_reuse_flag == 1 && idchan == 1 && active_cnt != 1 ) -#endif { bits -= TDM_IC_LSF_PRED_BITS; } diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 4f00e85a4d..ab7f7362b5 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -2109,9 +2109,6 @@ void td_stereo_param_updt( const float lsp_old_PCh[], /* i : primary channel old LSPs */ const float lsf_old_PCh[], /* i : primary channel old LSFs */ const float pitch_buf_PCh[], /* i : primary channel pitch buffer */ -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - float tdm_lspQ_PCh[], /* o : Q LSPs for primary channel */ -#endif float tdm_lsfQ_PCh[], /* o : Q LSFs for primary channel */ float tdm_Pri_pitch_buf[], /* o : pitch values for primary channel */ const int16_t flag_ACELP16k, /* i : ACELP@16kHz flag */ diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index 65f3f4d099..7c2c004d6f 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -440,12 +440,9 @@ void tdm_bit_alloc( *-------------------------------------------------------------------*/ void td_stereo_param_updt( - const float lsp_old_PCh[], /* i : primary channel old LSPs */ - const float lsf_old_PCh[], /* i : primary channel old LSFs */ - const float pitch_buf_PCh[], /* i : primary channel pitch buffer */ -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - float tdm_lspQ_PCh[], /* o : Q LSPs for primary channel */ -#endif + const float lsp_old_PCh[], /* i : primary channel old LSPs */ + const float lsf_old_PCh[], /* i : primary channel old LSFs */ + const float pitch_buf_PCh[], /* i : primary channel pitch buffer */ float tdm_lsfQ_PCh[], /* o : Q LSFs for primary channel */ float tdm_Pri_pitch_buf[], /* o : pitch values for primary channel */ const int16_t flag_ACELP16k, /* i : ACELP@16kHz flag */ @@ -458,42 +455,16 @@ void td_stereo_param_updt( if ( tdm_use_IAWB_Ave_lpc == 1 ) { mvr2r( IAWB_Ave, tdm_lsfQ_PCh, M ); -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - - if ( tdm_lspQ_PCh != NULL ) - { - lsf2lsp( tdm_lsfQ_PCh, tdm_lspQ_PCh, M, INT_FS_12k8 ); - } -#endif } else if ( flag_ACELP16k == 1 ) { -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - if ( tdm_lspQ_PCh != NULL ) - { - mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); - lsp_convert_poly( tdm_lspQ_PCh, L_FRAME, 0 ); - lsp2lsf( tdm_lspQ_PCh, tdm_lsfQ_PCh, M, INT_FS_12k8 ); - } - else - { -#endif - float lsp_temp[M]; - mvr2r( lsp_old_PCh, lsp_temp, M ); - lsp_convert_poly( lsp_temp, L_FRAME, 0 ); - lsp2lsf( lsp_temp, tdm_lsfQ_PCh, M, INT_FS_12k8 ); -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - } -#endif + float lsp_temp[M]; + mvr2r( lsp_old_PCh, lsp_temp, M ); + lsp_convert_poly( lsp_temp, L_FRAME, 0 ); + lsp2lsf( lsp_temp, tdm_lsfQ_PCh, M, INT_FS_12k8 ); } else { -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - if ( tdm_lspQ_PCh != NULL ) - { - mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); - } -#endif mvr2r( lsf_old_PCh, tdm_lsfQ_PCh, M ); } diff --git a/lib_com/options.h b/lib_com/options.h index 6f79c32f40..80cd7a383b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,9 +171,7 @@ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ -#define NONBE_FIX_1326_MASA_EXTREND_CUSTOMLS_OUT /* FhG: Fix crash for external renderer MASA to custom LS rendering, number of output channels not set correctly */ -#define NONBE_1325_TD_STEREO_QUANT_LSF_SEC /* Nokia: issue 1325: fix for usage of active_cnt variable in TD stereo LSFQ */ -#define NONBE_FIX_1172_OBJ_EDIT_JBM /* VA: issue 1172: fix OMASA object editing in JBM */ + /* ##################### End NON-BE switches ########################### */ diff --git a/lib_com/prot.h b/lib_com/prot.h index fe84276009..692b99c97c 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -4551,17 +4551,14 @@ ivas_error acelp_core_dec( int16_t *unbits, /* o : number of unused bits */ int16_t *sid_bw, /* o : 0-NB/WB, 1-SWB SID */ STEREO_TD_DEC_DATA_HANDLE hStereoTD, /* i/o: TD stereo decoder handle */ -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - const float tdm_lspQ_PCh[M], /* i : Q LSPs for primary channel */ -#endif - const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ - const int16_t use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ - const int16_t last_element_mode, /* i : last element mode */ - const int32_t last_element_brate, /* i : last element bitrate */ - const int16_t flag_sec_CNA, /* i : CNA flag for secondary channel */ - const int16_t nchan_out, /* i : number of output channels */ - STEREO_CNG_DEC_HANDLE hStereoCng, /* i : stereo CNG handle */ - const int16_t read_sid_info /* i : read SID info flag */ + const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ + const int16_t use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ + const int16_t last_element_mode, /* i : last element mode */ + const int32_t last_element_brate, /* i : last element bitrate */ + const int16_t flag_sec_CNA, /* i : CNA flag for secondary channel */ + const int16_t nchan_out, /* i : number of output channels */ + STEREO_CNG_DEC_HANDLE hStereoCng, /* i : stereo CNG handle */ + const int16_t read_sid_info /* i : read SID info flag */ ); void bass_psfilter_init( @@ -9115,12 +9112,9 @@ ivas_error config_acelp1( const int16_t tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel*/ const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag*/ const int16_t idchan, /* i : channel id */ -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - const int16_t active_cnt, /* i : Active frame counter */ -#endif - const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag */ - const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ - const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ + const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag */ + const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ + const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ ); /*! r: ACELP16k flag */ diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index a5f6b0d784..8e3a5cff68 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -67,17 +67,14 @@ ivas_error acelp_core_dec( int16_t *unbits, /* o : number of unused bits */ int16_t *sid_bw, /* o : 0-NB/WB, 1-SWB SID */ STEREO_TD_DEC_DATA_HANDLE hStereoTD, /* i/o: TD stereo decoder handle */ -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - const float tdm_lspQ_PCh[M], /* i : Q LSPs for primary channel */ -#endif - const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ - const int16_t use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ - const int16_t last_element_mode, /* i : last element mode */ - const int32_t last_element_brate, /* i : last element bitrate */ - const int16_t flag_sec_CNA, /* i : CNA flag for secondary channel */ - const int16_t nchan_out, /* i : number of output channels */ - STEREO_CNG_DEC_HANDLE hStereoCng, /* i : stereo CNG handle */ - const int16_t read_sid_info /* i : read SID info flag */ + const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ + const int16_t use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ + const int16_t last_element_mode, /* i : last element mode */ + const int32_t last_element_brate, /* i : last element bitrate */ + const int16_t flag_sec_CNA, /* i : CNA flag for secondary channel */ + const int16_t nchan_out, /* i : number of output channels */ + STEREO_CNG_DEC_HANDLE hStereoCng, /* i : stereo CNG handle */ + const int16_t read_sid_info /* i : read SID info flag */ ) { float old_exc[L_EXC_DEC], *exc; /* excitation signal buffer */ @@ -615,19 +612,11 @@ ivas_error acelp_core_dec( nb_bits = -1; } -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, st->inactive_coder_type_flag, tc_subfr_tmp, 1, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, st->inactive_coder_type_flag, tc_subfr_tmp, 1, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif if ( st->coder_type == TRANSITION && tc_subfr < L_SUBFR && st->L_frame == L_FRAME ) { -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, TRANSITION, -1, tc_subfr, 2, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, TRANSITION, -1, tc_subfr, 2, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif } } @@ -664,22 +653,11 @@ ivas_error acelp_core_dec( else { const float *pt_interp_2; -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - if ( st->active_cnt != 1 ) - { -#endif - int16_t beta_index; + int16_t beta_index; + + beta_index = get_next_indice( st, TDM_IC_LSF_PRED_BITS ); + tdm_SCh_lsf_reuse( DEC, st->element_brate, lsf_new, lsp_new, tdm_lsfQ_PCh, NULL, &beta_index ); - beta_index = get_next_indice( st, TDM_IC_LSF_PRED_BITS ); - tdm_SCh_lsf_reuse( DEC, st->element_brate, lsf_new, lsp_new, tdm_lsfQ_PCh, NULL, &beta_index ); -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - } - else - { - mvr2r( tdm_lspQ_PCh, lsp_new, M ); - mvr2r( tdm_lsfQ_PCh, lsf_new, M ); - } -#endif if ( st->rate_switching_reset ) { /* extrapolation in case of unstable LSF convert */ diff --git a/lib_dec/acelp_core_switch_dec.c b/lib_dec/acelp_core_switch_dec.c index 762de6e65e..50b70ad1a3 100644 --- a/lib_dec/acelp_core_switch_dec.c +++ b/lib_dec/acelp_core_switch_dec.c @@ -158,11 +158,7 @@ ivas_error acelp_core_switch_dec( * Excitation decoding *----------------------------------------------------------------*/ -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( DEC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, GENERIC, st->inactive_coder_type_flag, -1, -1, &decode_bwe /* dummy */, &i, st->element_mode, &i /*dummy*/, 0, 0, st->idchan, 0, 0, 0 /*st->GSC_IVAS_mode*/ ); -#else - config_acelp1( DEC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, GENERIC, st->inactive_coder_type_flag, -1, -1, &decode_bwe /* dummy */, &i, st->element_mode, &i /*dummy*/, 0, 0, st->idchan, st->active_cnt, 0, 0, 0 /*st->GSC_IVAS_mode*/ ); -#endif decod_gen_voic_core_switch( st, L_frame_for_cs, 0, Aq, exc, cbrate ); diff --git a/lib_dec/evs_dec.c b/lib_dec/evs_dec.c index a1b790df81..c022634825 100644 --- a/lib_dec/evs_dec.c +++ b/lib_dec/evs_dec.c @@ -259,11 +259,7 @@ ivas_error evs_dec( if ( st->core == ACELP_CORE ) { /* ACELP core decoder */ -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC if ( ( error = acelp_core_dec( st, NULL, synth, NULL, bwe_exc_extended, voice_factors, old_syn_12k8_16k, sharpFlag, pitch_buf, &unbits, &sid_bw, NULL, NULL, 0, EVS_MONO, 0, 0, 1, NULL, 1 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = acelp_core_dec( st, NULL, synth, NULL, bwe_exc_extended, voice_factors, old_syn_12k8_16k, sharpFlag, pitch_buf, &unbits, &sid_bw, NULL, NULL, NULL, 0, EVS_MONO, 0, 0, 1, NULL, 1 ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/gs_dec.c b/lib_dec/gs_dec.c index 2902b4daba..693631cf31 100644 --- a/lib_dec/gs_dec.c +++ b/lib_dec/gs_dec.c @@ -111,11 +111,7 @@ void decod_audio( } /* set bit-allocation */ -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, st->inactive_coder_type_flag, -1, 1, &nb_bits, NULL, st->element_mode, &nbits /*dummy*/, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, st->inactive_coder_type_flag, -1, 1, &nb_bits, NULL, st->element_mode, &nbits /*dummy*/, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif /*---------------------------------------------------------------* * Decode energy dynamics diff --git a/lib_dec/init_dec.c b/lib_dec/init_dec.c index 9451b41653..c2582a22d7 100644 --- a/lib_dec/init_dec.c +++ b/lib_dec/init_dec.c @@ -293,12 +293,7 @@ ivas_error init_decoder( st->last_vad = 0; st->last_active_brate = ACELP_7k20; st->last_CNG_L_frame = L_FRAME; - -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC st->active_cnt = CNG_TYPE_HO; -#else - st->active_cnt = 20; -#endif if ( idchan == 0 && ( st->element_mode == EVS_MONO || st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD ) ) { diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index f10cd46c30..a82b81243f 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -85,11 +85,7 @@ ivas_error ivas_core_dec( int16_t unbits[CPE_CHANNELS]; int16_t sid_bw[CPE_CHANNELS]; FRAME_MODE frameMode[CPE_CHANNELS]; -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC float tdm_lsfQ_PCh[M]; -#else - float tdm_lspQ_PCh[M], tdm_lsfQ_PCh[M]; -#endif int16_t tdm_LRTD_flag; int32_t element_brate, output_Fs; int32_t last_element_brate; @@ -355,9 +351,6 @@ ivas_error ivas_core_dec( { /* ACELP core decoder */ if ( ( error = acelp_core_dec( st, output[n], synth[n], save_hb_synth, bwe_exc_extended[n], voice_factors[n], old_syn_12k8_16k[n], sharpFlag[n], pitch_buf[n], &unbits[n], &sid_bw[n], hStereoTD, -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - tdm_lspQ_PCh, -#endif tdm_lsfQ_PCh, use_cldfb_for_dft, last_element_mode, last_element_brate, flag_sec_CNA, nchan_out, hStereoCng, read_sid_info ) ) != IVAS_ERR_OK ) { return error; @@ -382,11 +375,7 @@ ivas_error ivas_core_dec( if ( st->element_mode == IVAS_CPE_TD && n == 0 ) { -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC td_stereo_param_updt( st->lsp_old, st->lsf_old, st->old_pitch_buf + st->nb_subfr, tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); -#else - td_stereo_param_updt( st->lsp_old, st->lsf_old, st->old_pitch_buf + st->nb_subfr, tdm_lspQ_PCh, tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); -#endif } } /* n_channels loop */ diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 0d48873291..012be74c7f 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -386,23 +386,17 @@ ivas_error ivas_cpe_dec( if ( sts[1] != NULL ) { sts[1]->active_cnt = 0; -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC if ( sts[1]->ini_frame == 0 ) { sts[1]->active_cnt = CNG_TYPE_HO; } -#endif } } else { sts[n]->VAD = 1; sts[n]->active_cnt++; -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC sts[n]->active_cnt = min( sts[n]->active_cnt, 200 ); -#else - sts[n]->active_cnt = min( sts[n]->active_cnt, 100 ); -#endif } /* set CNA flag */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index eb85d14dab..c2b76d8c3a 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1652,13 +1652,6 @@ ivas_error IVAS_DEC_SetEditableParameters( st_ivas->hIsmMetaData[obj]->edited_yaw = hIvasEditableParameters.ism_metadata[obj].yaw; st_ivas->hIsmMetaData[obj]->edited_pitch = hIvasEditableParameters.ism_metadata[obj].pitch; st_ivas->hIsmMetaData[obj]->edited_radius = hIvasEditableParameters.ism_metadata[obj].radius; -#ifndef NONBE_FIX_1172_OBJ_EDIT_JBM - st_ivas->hIsmMetaData[obj]->azimuth = hIvasEditableParameters.ism_metadata[obj].azimuth; - st_ivas->hIsmMetaData[obj]->elevation = hIvasEditableParameters.ism_metadata[obj].elevation; - st_ivas->hIsmMetaData[obj]->yaw = hIvasEditableParameters.ism_metadata[obj].yaw; - st_ivas->hIsmMetaData[obj]->pitch = hIvasEditableParameters.ism_metadata[obj].pitch; - st_ivas->hIsmMetaData[obj]->radius = hIvasEditableParameters.ism_metadata[obj].radius; -#endif st_ivas->hIsmMetaData[obj]->edited_gain = hIvasEditableParameters.ism_metadata[obj].gain; st_ivas->hIsmMetaData[obj]->non_diegetic_flag = hIvasEditableParameters.ism_metadata[obj].non_diegetic_flag; } diff --git a/lib_enc/acelp_core_enc.c b/lib_enc/acelp_core_enc.c index e0e7b1be03..535a52430e 100644 --- a/lib_enc/acelp_core_enc.c +++ b/lib_enc/acelp_core_enc.c @@ -375,11 +375,7 @@ ivas_error acelp_core_enc( if ( !nelp_mode && !ppp_mode ) { -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 0, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 0, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif } /*-----------------------------------------------------------------* @@ -420,21 +416,14 @@ ivas_error acelp_core_enc( else { const float *pt_interp_2; -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - if ( st->active_cnt != 1 ) - { -#endif - int16_t beta_index; - float lsf_wgts[M]; - - /* intra_frame prediction for the LSFs */ - lsp2lsf( lsp_new, lsf_new, M, 12800 ); - Unified_weighting( &st->Bin_E[L_FFT / 2], lsf_new, lsf_wgts, st->bwidth == NB, st->coder_type == UNVOICED, st->sr_core, M ); - tdm_SCh_lsf_reuse( ENC, st->element_brate, lsf_new, lsp_new, tdm_lsfQ_PCh, lsf_wgts, &beta_index ); - push_indice( hBstr, IND_IC_LSF_PRED, beta_index, TDM_IC_LSF_PRED_BITS ); -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - } -#endif + int16_t beta_index; + float lsf_wgts[M]; + + /* intra_frame prediction for the LSFs */ + lsp2lsf( lsp_new, lsf_new, M, 12800 ); + Unified_weighting( &st->Bin_E[L_FFT / 2], lsf_new, lsf_wgts, st->bwidth == NB, st->coder_type == UNVOICED, st->sr_core, M ); + tdm_SCh_lsf_reuse( ENC, st->element_brate, lsf_new, lsp_new, tdm_lsfQ_PCh, lsf_wgts, &beta_index ); + push_indice( hBstr, IND_IC_LSF_PRED, beta_index, TDM_IC_LSF_PRED_BITS ); pt_interp_2 = interpol_frac_12k8; if ( tdm_low_rate_mode == 1 && st->coder_type > UNVOICED ) @@ -499,11 +488,7 @@ ivas_error acelp_core_enc( { tc_classif_enc( st->L_frame, &tc_subfr, &position, attack_flag, st->pitch[0], res ); -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 1, NULL, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 1, NULL, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif } /*---------------------------------------------------------------* @@ -561,11 +546,7 @@ ivas_error acelp_core_enc( lsf_syn_mem_restore( st, tilt_code_bck, gc_threshold_bck, clip_var_bck, next_force_sf_bck, lsp_new, lsp_mid, clip_var, mem_AR, mem_MA, lsp_new_bck, lsp_mid_bck, Bin_E, Bin_E_old, mem_syn_bck, mem_w0_bck, streaklimit, pstreaklen ); /* Configure ACELP bit allocation */ -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 0, &nb_bits, unbits, 0, &uc_two_stage_flag, 0, 0, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 0, &nb_bits, unbits, 0, &uc_two_stage_flag, 0, 0, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif /* redo LSF quantization */ lsf_enc( st, lsf_new, lsp_new, lsp_mid, Aq, tdm_low_rate_mode, 0, NULL ); diff --git a/lib_enc/acelp_core_switch_enc.c b/lib_enc/acelp_core_switch_enc.c index ce178ac43e..f5742b373b 100644 --- a/lib_enc/acelp_core_switch_enc.c +++ b/lib_enc/acelp_core_switch_enc.c @@ -153,11 +153,7 @@ void acelp_core_switch_enc( * Excitation encoding *----------------------------------------------------------------*/ -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( ENC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, GENERIC, st->inactive_coder_type_flag, -1, -1, &j, &i, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, 0 /*tdm_Pitch_reuse_flag*/, 0, 0 /*GSC_IVAS_mode*/ ); -#else - config_acelp1( ENC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, GENERIC, st->inactive_coder_type_flag, -1, -1, &j, &i, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, 0, 0 /*GSC_IVAS_mode*/ ); -#endif encod_gen_voic_core_switch( st, st->last_L_frame, inp, Aq, A, T_op, st->voicing, exc, cbrate ); diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index afc9b7ca28..35ac987a06 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -266,15 +266,10 @@ ivas_error ivas_core_enc( if ( st->element_mode == IVAS_CPE_TD && n == 0 ) { -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC td_stereo_param_updt( st->lsp_old, st->lsf_old, pitch_buf[0], tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); -#else - td_stereo_param_updt( st->lsp_old, st->lsf_old, pitch_buf[0], NULL, tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); -#endif } } - /*---------------------------------------------------------------------* * MDCT stereo: joint TCX Core Encoding *---------------------------------------------------------------------*/ @@ -316,7 +311,6 @@ ivas_error ivas_core_enc( } } - /*---------------------------------------------------------------------* * Postprocessing, BWEs and Updates *---------------------------------------------------------------------*/ diff --git a/lib_enc/transition_enc.c b/lib_enc/transition_enc.c index 804e9c0a48..cf05b43a1c 100644 --- a/lib_enc/transition_enc.c +++ b/lib_enc/transition_enc.c @@ -178,11 +178,7 @@ void transition_enc( if ( *tc_subfr == TC_0_0 ) { /* this is called only to compute unused bits */ -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, L_FRAME, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, TC_0_0, 3, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); -#else - config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, L_FRAME, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, TC_0_0, 3, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); -#endif } *clip_gain = gp_clip( st->element_mode, st->core_brate, st->voicing, i_subfr, TRANSITION, xn, gp_cl ); @@ -278,11 +274,7 @@ void transition_enc( if ( i_subfr - *tc_subfr <= L_SUBFR ) { -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, *tc_subfr, 2, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); -#else - config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, *tc_subfr, 2, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); -#endif } /*-----------------------------------------------------------------* diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 98b3177a15..f9f9a049ae 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -7501,7 +7501,7 @@ static ivas_error getSamplesInternal( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, @@ -8503,14 +8503,11 @@ static ivas_error initMasaExtRenderer( return error; } -#ifdef NONBE_FIX_1326_MASA_EXTREND_CUSTOMLS_OUT if ( outConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { hMasaExtRend->nchan_output = inputMasa->base.ctx.pCustomLsOut->num_spk + inputMasa->base.ctx.pCustomLsOut->num_lfe; } - else -#endif - if ( ( error = getAudioConfigNumChannels( outConfig, &hMasaExtRend->nchan_output ) ) != IVAS_ERR_OK ) + else if ( ( error = getAudioConfigNumChannels( outConfig, &hMasaExtRend->nchan_output ) ) != IVAS_ERR_OK ) { return error; } -- GitLab From 610c393e93e495ac20fd98e9e998415b2d9e7483 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 10 Jun 2025 14:46:13 +0200 Subject: [PATCH 6/6] comment + clang-format --- lib_dec/lib_dec.c | 3 ++- lib_dec/lib_dec.h | 2 +- lib_rend/lib_rend.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index c2b76d8c3a..25b5982aad 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1679,7 +1679,8 @@ ivas_error IVAS_DEC_SetEditableParameters( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_PrepareRenderer( - IVAS_DEC_HANDLE hIvasDec ) + IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ +) { if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 588399ef2a..f28279d86b 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -177,7 +177,7 @@ ivas_error IVAS_DEC_SetEditableParameters( ); ivas_error IVAS_DEC_PrepareRenderer( - IVAS_DEC_HANDLE hIvasDec + IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ ); /*! r: decoder error code */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index f9f9a049ae..ec4f99cd69 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -7501,7 +7501,7 @@ static ivas_error getSamplesInternal( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, -- GitLab