From 1965aaf383b2b2ea3303c35847a5a8a96a7df8ef Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:54:41 +0100 Subject: [PATCH 01/21] [cleanup] accept FIX_1320_STACK_CPE_DECODER --- lib_com/cnst.h | 2 -- lib_com/options.h | 2 -- lib_dec/dec_LPD.c | 8 ----- lib_dec/ivas_core_dec.c | 43 -------------------------- lib_dec/ivas_cpe_dec.c | 47 ----------------------------- lib_dec/ivas_mdct_core_dec.c | 8 ----- lib_dec/ivas_stereo_mdct_core_dec.c | 9 ------ lib_dec/ivas_tcx_core_dec.c | 8 ----- 8 files changed, 127 deletions(-) diff --git a/lib_com/cnst.h b/lib_com/cnst.h index 585bb4340..f8ab921cc 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -526,9 +526,7 @@ enum #define L_FRAME_MAX L_FRAME48k /* Max 20ms frame size @48kHz */ #define L_FRAME_PLUS 1200 /* Max frame size (long TCX frame) */ #define L_MDCT_OVLP_MAX NS2SA( 48000, ACELP_LOOK_NS ) /* = Max mdct overlap */ -#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 N_TCX10_MAX 480 /* Max size of TCX10 MDCT spectrum */ #define BITS_TEC 1 /* number of bits for TEC */ #define BITS_TFA 1 /* number of bits for TTF */ diff --git a/lib_com/options.h b/lib_com/options.h index b342d3314..a8ee878c1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -162,9 +162,7 @@ /* #################### Start BASOP porting switches ############################ */ #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 FIX_1320_STACK_CPE_DECODER /* VA: issue 1320: Optimize the stack memory consumption in the CPE decoder */ #define NONBE_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0 */ -#define FIX_1320_STACK_CPE_DECODER /* VA: issue 1320: Optimize the stack memory consumption in the CPE decoder */ #define NONBE_1302_FIX_OMASA_JBM_FLUSH /* VA: issue 1302: fix OMASA JBM bitrate switching flush in binaural output */ #define FIX_1319_STACK_SBA_DECODER /* VA: issue 1319: Optimize the definition of buffer lengths in the SBA decoder */ #define NONBE_FIX_1376_MDCT_CONCEALMENT /* FhG: fix concealment artifact in MDCT Stereo with DTX, in case transition frame gets lost */ diff --git a/lib_dec/dec_LPD.c b/lib_dec/dec_LPD.c index bf4aab5e3..0372dc26f 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,11 +124,7 @@ 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 ); diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index 0feea67e6..892372b99 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]; @@ -205,9 +201,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) @@ -518,10 +512,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 */ @@ -533,23 +525,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) @@ -584,23 +570,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 *----------------------------------------------------------------*/ @@ -615,20 +584,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 } /* Smooth transitions when switching between different technologies */ diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 5de10f5e7..3742d29e4 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -54,9 +54,7 @@ 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 *p_res_buf, float *output[], float outputHB[][L_FRAME48k], const int16_t output_frame ); -#endif /*--------------------------------------------------------------------------* @@ -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; STEREO_DFT_CONFIG_DATA_HANDLE hConfigDft; Decoder_State **sts; @@ -274,10 +268,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; @@ -460,47 +452,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 ) { @@ -625,7 +580,6 @@ ivas_error ivas_cpe_dec( return error; } -#ifdef FIX_1320_STACK_CPE_DECODER /*------------------------------------------------------------------------- * stereo_dft_dec_main() @@ -692,7 +646,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 273925bb4..b1e7d9692 100644 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -807,11 +807,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; @@ -848,11 +844,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_stereo_mdct_core_dec.c b/lib_dec/ivas_stereo_mdct_core_dec.c index 5b3839aef..9185aaaa8 100644 --- a/lib_dec/ivas_stereo_mdct_core_dec.c +++ b/lib_dec/ivas_stereo_mdct_core_dec.c @@ -156,9 +156,6 @@ void stereo_mdct_core_dec( 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 */ @@ -204,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 ee4e4598e..141fbb9aa 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,11 +246,7 @@ 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 -- GitLab From 929691ece0754b72e2281735457e0fd382881ad7 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:54:44 +0100 Subject: [PATCH 02/21] [cleanup] accept FIX_NCHAN_BUFFERS --- lib_com/options.h | 1 - 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 | 4 - lib_dec/ivas_sba_dec.c | 2 - lib_rend/ivas_dirac_dec_binaural_functions.c | 4 - lib_rend/ivas_output_init.c | 131 ------------------- 8 files changed, 160 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a8ee878c1..8055409c6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -181,7 +181,6 @@ #define FIX_1384_MSAN_ivas_spar_dec_open /* VA: issue 1386: fix use-of-uninitialized value in ivas_spar_dec_open() */ #define FIX_1388_MSAN_ivas_init_decoder /* VA: issue 1388: fix use-of-uninitialized value in ivas_init_decoder() */ #define FIX_1288_SPLIT_REND_XSAN /* Dlb: Fix asan, msan and usan issues in split rendering 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 JBM_MEMORY_OPT /* VA: issue 916: optimization of RAM in the JBM decoder */ #define NONBE_1324_TC_BUFFER_MEMOERY_KEEP /* VA: issue 1324: do not reset TSM memory in JBM bitrate switching */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 4cdddd428..03c222612 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2475,12 +2475,8 @@ ivas_error ivas_init_decoder( return error; } #else -#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 11892ffc0..27dfae4a8 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -883,16 +883,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 c1442f518..06f2382ce 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1320,12 +1320,10 @@ 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 #ifdef FIX_1330_JBM_MEMORY int16_t nchan_out_buff; #else int16_t nchan_out_buff_old, nchan_out_buff; -#endif #endif ivas_error error; int16_t pos_idx; @@ -1333,12 +1331,10 @@ 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 #ifndef FIX_1330_JBM_MEMORY nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); #endif -#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 ) { @@ -1505,15 +1501,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 } if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) @@ -1571,7 +1563,6 @@ ivas_error ivas_masa_dec_reconfigure( } } -#ifdef FIX_NCHAN_BUFFERS /*-----------------------------------------------------------------* * floating-point output audio buffers *-----------------------------------------------------------------*/ @@ -1590,7 +1581,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 8bfe30b36..293ff9396 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -1320,7 +1320,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 ) { @@ -1330,9 +1329,6 @@ 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 96bcb8c39..e87237599 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -720,7 +720,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 ); @@ -739,7 +738,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_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 0ba572c49..c7a8d41bf 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -319,7 +319,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 ) { @@ -329,9 +328,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 ) { diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 3c27b8562..e2df9c1a7 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,107 +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 ); @@ -408,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 ) @@ -466,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 ) @@ -573,13 +444,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 fe96ba23644e4157c2c5f0fb191a23e484a067a8 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:54:47 +0100 Subject: [PATCH 03/21] [cleanup] accept FIX_RENDERER_STACK --- lib_com/options.h | 1 - lib_dec/ivas_dirac_dec.c | 21 -------------------- lib_rend/ivas_crend.c | 5 ----- lib_rend/ivas_dirac_dec_binaural_functions.c | 20 ------------------- 4 files changed, 47 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 8055409c6..18542b853 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -181,7 +181,6 @@ #define FIX_1384_MSAN_ivas_spar_dec_open /* VA: issue 1386: fix use-of-uninitialized value in ivas_spar_dec_open() */ #define FIX_1388_MSAN_ivas_init_decoder /* VA: issue 1388: fix use-of-uninitialized value in ivas_init_decoder() */ #define FIX_1288_SPLIT_REND_XSAN /* Dlb: Fix asan, msan and usan issues in split rendering mode*/ -#define FIX_RENDERER_STACK /* VA: issue 1322: reduction of renderers' buffers size */ #define JBM_MEMORY_OPT /* VA: issue 916: optimization of RAM in the JBM decoder */ #define NONBE_1324_TC_BUFFER_MEMOERY_KEEP /* VA: issue 1324: do not reset TSM memory in JBM bitrate switching */ #define FIX_1370_EXTERNAL_ORIENTATION_CHECK /* Nokia: add sanity check for Euler angles for external orientations */ diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 142cac7e5..3f415e5b3 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1552,12 +1552,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; @@ -1568,11 +1564,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 ); @@ -1599,7 +1591,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 ) ) ) { @@ -1607,24 +1598,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_rend/ivas_crend.c b/lib_rend/ivas_crend.c index c153f3669..46f01c2cf 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1513,13 +1513,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[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]; -#endif CREND_HANDLE hCrend; ivas_error error; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index c7a8d41bf..f806b5acc 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -453,10 +453,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; @@ -466,11 +462,7 @@ void ivas_dirac_dec_binaural_render( 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 ); @@ -488,9 +480,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++ ) { @@ -502,19 +491,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; -- GitLab From d4b8237a58153d0b998a1f6b727ac8ae56a516fc Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:54:50 +0100 Subject: [PATCH 04/21] [cleanup] accept FIX_1319_STACK_SBA_DECODER --- lib_com/ivas_prot.h | 5 --- lib_com/options.h | 1 - lib_dec/ivas_dirac_dec.c | 68 ------------------------------------- lib_dec/ivas_spar_decoder.c | 17 ---------- lib_dec/lib_dec.c | 2 -- 5 files changed, 93 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 9e3858351..71ae838ad 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3744,13 +3744,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 18542b853..97f834380 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ #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_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0 */ #define NONBE_1302_FIX_OMASA_JBM_FLUSH /* VA: issue 1302: fix OMASA JBM bitrate switching flush in binaural output */ -#define FIX_1319_STACK_SBA_DECODER /* VA: issue 1319: Optimize the definition of buffer lengths in the SBA decoder */ #define NONBE_FIX_1376_MDCT_CONCEALMENT /* FhG: fix concealment artifact in MDCT Stereo with DTX, in case transition frame gets lost */ #define NONBE_1377_REND_DIRATT_CONF /* Eri: Issue 1377: Error in directivity attenuation configuration for both IVAS_dec and IVAS_rend */ #define FIX_1377_HANDLE_ERROR_CODE /* Eri: Add missing error code handling from IVAS_REND_SetObjectIDs */ diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 3f415e5b3..808f4a7c5 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1622,7 +1622,6 @@ void ivas_dirac_dec_render( } -#ifdef FIX_1319_STACK_SBA_DECODER /*------------------------------------------------------------------------- * Local functions to perform binaural rendering with optimized stack *------------------------------------------------------------------------*/ @@ -1705,7 +1704,6 @@ static void binRenderer( return; } -#endif /*------------------------------------------------------------------------- @@ -1718,13 +1716,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 ) { int16_t i, ch, idx_in, idx_lfe; @@ -1740,19 +1733,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 LFT 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 */ @@ -1929,29 +1913,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 } } @@ -1978,13 +1950,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 @@ -2427,7 +2394,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 ) { @@ -2444,42 +2410,13 @@ 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++ ) { @@ -2503,13 +2440,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 260ea208d..6d6ce6e14 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -1376,28 +1376,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]; @@ -1516,11 +1503,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 b58885cc8..ba21b172d 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -5421,11 +5421,9 @@ static void ivas_destroy_handle_isar( { free( ( *hSplitBinRend )->hCldfbDataOut ); ( *hSplitBinRend )->hCldfbDataOut = NULL; -#ifdef FIX_1319_STACK_SBA_DECODER free( ( *hSplitBinRend ) ); ( *hSplitBinRend ) = NULL; -#endif } } -- GitLab From 66cd59e310f92e21b9d512388a05db0b63add8e7 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:54:52 +0100 Subject: [PATCH 05/21] [cleanup] accept JBM_MEMORY_OPT --- lib_com/ivas_cnst.h | 5 - lib_com/ivas_prot.h | 13 --- lib_com/ivas_tools.c | 35 ------ lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 247 --------------------------------------- lib_dec/ivas_stat_dec.h | 6 - lib_dec/jbm_pcmdsp_apa.c | 4 - lib_dec/jbm_pcmdsp_apa.h | 5 - lib_dec/lib_dec.c | 53 --------- 9 files changed, 369 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index fa4a2f9ad..0c7806b96 100644 --- 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 71ae838ad..e2cfd5092 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -262,7 +262,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 */ @@ -276,14 +275,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 */ ); @@ -868,10 +859,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 6e66502dd..58ace45ef 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() @@ -223,40 +222,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 97f834380..35c8c5415 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -180,7 +180,6 @@ #define FIX_1384_MSAN_ivas_spar_dec_open /* VA: issue 1386: fix use-of-uninitialized value in ivas_spar_dec_open() */ #define FIX_1388_MSAN_ivas_init_decoder /* VA: issue 1388: fix use-of-uninitialized value in ivas_init_decoder() */ #define FIX_1288_SPLIT_REND_XSAN /* Dlb: Fix asan, msan and usan issues in split rendering mode*/ -#define JBM_MEMORY_OPT /* VA: issue 916: optimization of RAM in the JBM decoder */ #define NONBE_1324_TC_BUFFER_MEMOERY_KEEP /* VA: issue 1324: do not reset TSM memory in JBM bitrate switching */ #define FIX_1370_EXTERNAL_ORIENTATION_CHECK /* Nokia: add sanity check for Euler angles for external orientations */ #define FIX_1413_IGF_INIT_PRINTOUT /* FhG: use correct variable for IGF initiliazation */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 27dfae4a8..8619c40b3 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -756,19 +756,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; #ifdef FIX_1330_JBM_MEMORY int16_t ch, offset, len_offset; @@ -782,7 +773,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; @@ -832,47 +822,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; } @@ -883,11 +832,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 */ @@ -961,11 +906,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]; } @@ -1460,11 +1401,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; @@ -1527,7 +1464,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++ ) { @@ -1535,16 +1471,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; @@ -1781,11 +1707,7 @@ ivas_error ivas_jbm_dec_flush_renderer( 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; @@ -2210,7 +2132,6 @@ int16_t ivas_jbm_dec_get_render_granularity( return render_granularity; } -#ifdef JBM_MEMORY_OPT /*--------------------------------------------------------------------------* * ivas_jbm_dec_tc_audio_allocate() @@ -2346,7 +2267,6 @@ static void ivas_jbm_dec_tc_audio_deallocate( return; } -#endif /*--------------------------------------------------------------------------* * ivas_jbm_dec_tc_buffer_open() @@ -2363,17 +2283,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 @@ -2388,9 +2300,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; @@ -2400,80 +2309,15 @@ 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; @@ -2500,12 +2344,7 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( int16_t ch_idx, num_tc_buffer_mem, n_samples_still_available; float tc_buffer_mem[MAX_INTERN_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES - 1]; #endif -#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; @@ -2567,12 +2406,8 @@ 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 JBM_MEMORY_OPT /* reallocate TC audio buffers */ ivas_jbm_dec_tc_audio_deallocate( hTcBuffer ); @@ -2581,71 +2416,6 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( { return error; } -#else -#ifdef DEBUGGING - /* what is remaining from last frames needs always be smaller than n_samples_granularity */ - assert( ( hTcBuffer->n_samples_buffered - hTcBuffer->n_samples_rendered ) < n_samples_granularity ); -#endif - /* 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 #ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP /* propagate samples of the TC buffer from the previous frame */ @@ -2716,26 +2486,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 8022bf3ee..7b55867d1 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -956,15 +956,9 @@ 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 */ diff --git a/lib_dec/jbm_pcmdsp_apa.c b/lib_dec/jbm_pcmdsp_apa.c index baaa6e13c..84dd86740 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 6d35fa8b5..ad447279e 100644 --- a/lib_dec/jbm_pcmdsp_apa.h +++ b/lib_dec/jbm_pcmdsp_apa.h @@ -50,13 +50,8 @@ */ /* 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 ) /* min/max sampling rate [Hz] */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index ba21b172d..b552de770 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; @@ -168,9 +165,6 @@ ivas_error IVAS_DEC_Open( } 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; @@ -369,12 +363,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 ); @@ -1203,11 +1191,7 @@ 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 */ { @@ -1269,17 +1253,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( hIvasDec->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; } @@ -1287,11 +1265,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 { @@ -1302,11 +1278,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 ( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm ) { @@ -5066,9 +5038,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; @@ -5081,11 +5050,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 ) @@ -5129,14 +5093,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 { @@ -5144,15 +5100,6 @@ static ivas_error apa_setup( { return IVAS_ERR_INIT_ERROR; } -#ifndef JBM_MEMORY_OPT - apa_buffer_size = APA_BUF_PER_CHANNEL; - 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 222c0d00208ae20336294be2e78203e9063c9a9d Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:55:01 +0100 Subject: [PATCH 06/21] [cleanup] accept NONBE_FIX_1172_OBJ_EDIT_JBM --- lib_com/options.h | 1 - lib_dec/lib_dec.c | 7 ------- 2 files changed, 8 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 35c8c5415..ca882d8d1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -208,7 +208,6 @@ #define TMP_FIX_SPLIT_REND // temporary fix to split-rendering (it follows the later state of the framework but it is needed now because of current test-conditions) #define TMP_FIX_OMASA_SR_BE // temporary fix to keep OMASA split-rendering BE #define FIX_1372_OSBA_OBJECT_EDITING /* VA: issue 1372: Fix OSBA object-editing in BINAURAL_ROOM_IR */ -#define NONBE_FIX_1172_OBJ_EDIT_JBM /* VA: issue 1172: fix OMASA object editing in JBM */ #define NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES /* Nokia: Fix for issues 1399: obj edit broken with MC/SBA output in VOIP, and 1400: negative energy estimate used for gaining. */ #define FIX_2192_OBJ_EDITING_EXT_METADATA /* Eri: Add support for extended metadata in object editing */ #define FIX_1318_ROOM_SIZE_CMD_LINE /* Philips/Nokia: Default room sizes support */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index b552de770..dd72aaa1b 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1773,13 +1773,6 @@ ivas_error IVAS_DEC_SetEditableParameters( st_ivas->hIsmMetaData[obj]->edited_pitch = hIvasEditableParameters.ism_metadata[obj].pitch; st_ivas->hIsmMetaData[obj]->edited_radius = hIvasEditableParameters.ism_metadata[obj].radius; #endif -#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 #ifdef FIX_GAIN_EDIT_LIMITS if ( hIvasEditableParameters.ism_metadata[obj].gain > EDIT_GAIN_MAX ) { -- GitLab From e650f5285271a021d627623b5553a5a35caeb9e0 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:55:10 +0100 Subject: [PATCH 07/21] [cleanup] accept NONBE_1302_FIX_OMASA_JBM_FLUSH --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 9 --------- 2 files changed, 10 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index ca882d8d1..dca33dfde 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,7 +163,6 @@ #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_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0 */ -#define NONBE_1302_FIX_OMASA_JBM_FLUSH /* VA: issue 1302: fix OMASA JBM bitrate switching flush in binaural output */ #define NONBE_FIX_1376_MDCT_CONCEALMENT /* FhG: fix concealment artifact in MDCT Stereo with DTX, in case transition frame gets lost */ #define NONBE_1377_REND_DIRATT_CONF /* Eri: Issue 1377: Error in directivity attenuation configuration for both IVAS_dec and IVAS_rend */ #define FIX_1377_HANDLE_ERROR_CODE /* Eri: Add missing error code handling from IVAS_REND_SetObjectIDs */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 8619c40b3..8b57b9f89 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1567,13 +1567,11 @@ ivas_error ivas_jbm_dec_flush_renderer( if ( ism_mode_old == ISM_MASA_MODE_DISC ) { float *tc_local[MAX_NUM_OBJECTS]; -#ifdef NONBE_1302_FIX_OMASA_JBM_FLUSH int16_t last_dirac_md_idx; uint16_t nSamplesAvailableNext; ISM_MODE ism_mode_orig; RENDERER_TYPE renderer_type_orig; int32_t ivas_total_brate; -#endif /* copy from ISM delay buffer to the correct place in TCs */ for ( ch_idx = 0; ch_idx < st_ivas->nchan_ism; ch_idx++ ) @@ -1582,7 +1580,6 @@ ivas_error ivas_jbm_dec_flush_renderer( mvr2r( st_ivas->hMasaIsmData->delayBuffer[ch_idx], tc_local[ch_idx], st_ivas->hMasaIsmData->delayBuffer_size ); } -#ifdef NONBE_1302_FIX_OMASA_JBM_FLUSH /* to render flushed samples, use configuration from the last received frame */ ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; renderer_type_orig = st_ivas->renderer_type; @@ -1609,12 +1606,6 @@ ivas_error ivas_jbm_dec_flush_renderer( st_ivas->ism_mode = ism_mode_orig; st_ivas->renderer_type = renderer_type_orig; st_ivas->hDecoderConfig->ivas_total_brate = ivas_total_brate; -#else - if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif } } else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) -- GitLab From 017618d73dd2141ef98df5b7af2813b82dcba614 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:55:12 +0100 Subject: [PATCH 08/21] [cleanup] accept NONBE_1324_TC_BUFFER_MEMOERY_KEEP --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 6 ------ 2 files changed, 7 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index dca33dfde..77109973d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -179,7 +179,6 @@ #define FIX_1384_MSAN_ivas_spar_dec_open /* VA: issue 1386: fix use-of-uninitialized value in ivas_spar_dec_open() */ #define FIX_1388_MSAN_ivas_init_decoder /* VA: issue 1388: fix use-of-uninitialized value in ivas_init_decoder() */ #define FIX_1288_SPLIT_REND_XSAN /* Dlb: Fix asan, msan and usan issues in split rendering mode*/ -#define NONBE_1324_TC_BUFFER_MEMOERY_KEEP /* VA: issue 1324: do not reset TSM memory in JBM bitrate switching */ #define FIX_1370_EXTERNAL_ORIENTATION_CHECK /* Nokia: add sanity check for Euler angles for external orientations */ #define FIX_1413_IGF_INIT_PRINTOUT /* FhG: use correct variable for IGF initiliazation */ #define FIX_1330_JBM_MEMORY /* VA: issue 1330: memory savings in the JBM decoder */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 8b57b9f89..3e8180ae1 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -2331,16 +2331,13 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( const int16_t n_samples_granularity /* i : new granularity of the renderer/buffer */ ) { -#ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP int16_t ch_idx, num_tc_buffer_mem, n_samples_still_available; float tc_buffer_mem[MAX_INTERN_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES - 1]; -#endif ivas_error error; DECODER_TC_BUFFER_HANDLE hTcBuffer; hTcBuffer = st_ivas->hTcBuffer; -#ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP num_tc_buffer_mem = 0; n_samples_still_available = 0; @@ -2359,7 +2356,6 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( } } -#endif /* if granularity changes, adapt subframe_nb_slots */ if ( n_samples_granularity != hTcBuffer->n_samples_granularity ) { @@ -2408,14 +2404,12 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( return error; } -#ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP /* propagate samples of the TC buffer from the previous frame */ for ( ch_idx = 0; ch_idx < num_tc_buffer_mem; ch_idx++ ) { mvr2r( tc_buffer_mem[ch_idx], hTcBuffer->tc_buffer_old[ch_idx], n_samples_still_available ); } -#endif return IVAS_ERR_OK; } -- GitLab From 3bbe46abdf5edea2a05fc275b674e4d2dbb9c770 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:55:15 +0100 Subject: [PATCH 09/21] [cleanup] accept FIX_938_COMPILER_WARNING --- lib_com/options.h | 1 - lib_dec/ivas_mdct_core_dec.c | 7 ------- 2 files changed, 8 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 77109973d..74ab476d6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -170,7 +170,6 @@ #define FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add split rendering support to decoder in VoIP mode */ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #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 FIX_938_COMPILER_WARNING /* FhG: Fix compiler warning in ivas_mdct_core_reconstruct() */ #define FIX_1376_MISSING_ISM_METADATA /* FhG: IVAS_rend: throw error if there exists an ISM input without a corresponding metadata file path */ #define FIX_1385_INIT_IGF_STOP_FREQ /* FhG: Initialize infoIGFStopFreq in init_igf_dec() */ #define FIX_1387_INIT_PRM_SQQ /* FhG: initialize pointer prm_sqQ, which might be uninitialized in case of bfi == 1 */ diff --git a/lib_dec/ivas_mdct_core_dec.c b/lib_dec/ivas_mdct_core_dec.c index b1e7d9692..786d32061 100644 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -946,14 +946,7 @@ void ivas_mdct_core_reconstruct( /* Postfiltering */ post_decoder( st, synth_buf, pit_gain[ch], pitch[ch], x[ch][0], st->p_bpf_noise_buf ); -#ifndef FIX_938_COMPILER_WARNING - if ( signal_outFB[ch] ) - { -#endif mvr2r( synthFB, signal_outFB[ch], st->hTcxDec->L_frameTCX ); -#ifndef FIX_938_COMPILER_WARNING - } -#endif #ifdef DEBUG_PLC_INFO { -- GitLab From 054ec646d3f958beac71e26537100c8f2c68417e Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:55:19 +0100 Subject: [PATCH 10/21] [cleanup] accept FIX_1288_SPLIT_REND_XSAN --- lib_com/options.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 74ab476d6..eee9767af 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -177,7 +177,6 @@ #define FIX_1384_MSAN_stereo_tcx_core_enc /* VA: issue 1384: fix use-of-uninitialized value in stereo_tcx_core_enc() */ #define FIX_1384_MSAN_ivas_spar_dec_open /* VA: issue 1386: fix use-of-uninitialized value in ivas_spar_dec_open() */ #define FIX_1388_MSAN_ivas_init_decoder /* VA: issue 1388: fix use-of-uninitialized value in ivas_init_decoder() */ -#define FIX_1288_SPLIT_REND_XSAN /* Dlb: Fix asan, msan and usan issues in split rendering mode*/ #define FIX_1370_EXTERNAL_ORIENTATION_CHECK /* Nokia: add sanity check for Euler angles for external orientations */ #define FIX_1413_IGF_INIT_PRINTOUT /* FhG: use correct variable for IGF initiliazation */ #define FIX_1330_JBM_MEMORY /* VA: issue 1330: memory savings in the JBM decoder */ -- GitLab From 8289309864743cc49040268d2e578d53dfc8d455 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:55:33 +0100 Subject: [PATCH 11/21] [cleanup] accept NONBE_1352_HARMONIZE_OSBA_LOUDNESS --- apps/renderer.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 4e796917a..5231a2b5f 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -3706,20 +3706,10 @@ static void parseCombinedFormatInput( inConfig->numAmbisonicsBuses = 1; inConfig->ambisonicsBuses[0].audioConfig = audioConfig; inConfig->ambisonicsBuses[0].inputChannelIndex = inConfig->numAudioObjects; -#ifdef NONBE_1352_HARMONIZE_OSBA_LOUDNESS inConfig->ambisonicsBuses[0].gain_dB = 0.f; -#else - inConfig->ambisonicsBuses[0].gain_dB = -6.f; -#endif *configString += 4; /* Modify input gain for objects too */ -#ifndef NONBE_1352_HARMONIZE_OSBA_LOUDNESS - for ( int16_t i = 0; i < inConfig->numAudioObjects; ++i ) - { - inConfig->audioObjects[i].gain_dB = -6.f; - } -#endif } else if ( audioConfig == IVAS_AUDIO_CONFIG_MASA1 || audioConfig == IVAS_AUDIO_CONFIG_MASA2 ) { -- GitLab From 7b563a13c42ea931e98b26f9564d49916f32aca1 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:55:35 +0100 Subject: [PATCH 12/21] [cleanup] accept CODE_IMPROVEMENTS --- lib_com/options.h | 1 - lib_com/tools.c | 12 -------- lib_rend/ivas_rom_rend.c | 6 ---- lib_rend/lib_rend.c | 59 ---------------------------------------- lib_util/mime_io.c | 4 --- lib_util/rtpdump.c | 8 ------ lib_util/tinywavein_c.h | 8 ------ lib_util/tinywaveout_c.h | 38 -------------------------- 8 files changed, 136 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index eee9767af..be7d888c0 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -181,7 +181,6 @@ #define FIX_1413_IGF_INIT_PRINTOUT /* FhG: use correct variable for IGF initiliazation */ #define FIX_1330_JBM_MEMORY /* VA: issue 1330: memory savings in the JBM decoder */ #define FIX_1330_JBM_MEMORY_FIX /* VA: basop issue: 2179 fix non-BE difference in FIX_1330_JBM_MEMORY */ -#define CODE_IMPROVEMENTS #define NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS /* Nokia: issue 1339: Apply scaling to the object-part of OMASA for binaural rendering in IVAS_rend. */ #define NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING /* Nokia: Fix OMASA to MASA1 rendering in IVAS_rend */ #define FIX_1383_HEAD_TRACK_SANITIZER /* Nok: issue 1383: Fix head tracking struc values reading in renderer */ diff --git a/lib_com/tools.c b/lib_com/tools.c index 45e794148..6dca2331f 100644 --- a/lib_com/tools.c +++ b/lib_com/tools.c @@ -1742,23 +1742,11 @@ double anint( int16_t is_numeric_float( float x ) { -#ifdef CODE_IMPROVEMENTS int16_t retval; #define WMC_TOOL_SKIP retval = (int16_t) ( !isnan( x ) && !isinf( x ) ); #undef WMC_TOOL_SKIP return retval; -#else - union float_int - { - float float_val; - int32_t int_val; - } float_int; - - float_int.float_val = x; - - return ( ( float_int.int_val & 0x7f800000 ) != 0x7f800000 ); -#endif } /*-------------------------------------------------------------------* diff --git a/lib_rend/ivas_rom_rend.c b/lib_rend/ivas_rom_rend.c index b7df27a8c..9823e2db1 100644 --- a/lib_rend/ivas_rom_rend.c +++ b/lib_rend/ivas_rom_rend.c @@ -163,15 +163,9 @@ const float ap_lattice_coeffs_3[DIRAC_DECORR_FILTER_LEN_3*DIRAC_MAX_NUM_DECORR_F const float * const ap_lattice_coeffs[DIRAC_DECORR_NUM_SPLIT_BANDS] = { -#ifdef CODE_IMPROVEMENTS ap_lattice_coeffs_1, ap_lattice_coeffs_2, ap_lattice_coeffs_3, -#else - &ap_lattice_coeffs_1[0], - &ap_lattice_coeffs_2[0], - &ap_lattice_coeffs_3[0], -#endif }; const float ap_split_frequencies[DIRAC_DECORR_NUM_SPLIT_BANDS + 1] = diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index b7a764122..2fd641865 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -3641,7 +3641,6 @@ static ivas_error getConstInputById( return IVAS_ERR_OK; } -#ifdef CODE_IMPROVEMENTS static void *getInputByIndex( void *inputsArray, const size_t index, @@ -3666,56 +3665,30 @@ static void *getInputByIndex( /* include a final return to make the linter happy and avoid problems with wmc_tool (see #1355) */ return NULL; } -#endif static ivas_error findFreeInputSlot( -#ifdef CODE_IMPROVEMENTS void *inputs, const IVAS_REND_AudioConfigType inputType, -#else - const void *inputs, - const int32_t inputStructSize, -#endif const int32_t maxInputs, int32_t *inputIndex ) { -#ifdef CODE_IMPROVEMENTS /* Using a void pointer and a separately provided type is a hack for this function to be reusable for arrays of any input type (input_ism, input_mc, input_sba, input_masa). Assumptions: - input_base is always the first member in the input struct - memory alignments of original input type and input_base are the same */ -#else - /* Using a void pointer and a separately provided size is a hack for this function - to be reusable for arrays of any input type (input_ism, input_mc, input_sba, input_masa). - Assumptions: - - input_base is always the first member in the input struct - - provided size is correct - */ -#endif int32_t i; bool canAddInput; -#ifndef CODE_IMPROVEMENTS - const uint8_t *pByte; -#endif const input_base *pInputBase; canAddInput = false; /* Find first unused input in array */ -#ifdef CODE_IMPROVEMENTS for ( i = 0; i < maxInputs; ++i ) -#else - for ( i = 0, pByte = inputs; i < maxInputs; ++i, pByte += inputStructSize ) -#endif { -#ifdef CODE_IMPROVEMENTS pInputBase = (const input_base *) getInputByIndex( inputs, i, inputType ); -#else - pInputBase = (const input_base *) pByte; -#endif if ( pInputBase->inConfig == IVAS_AUDIO_CONFIG_INVALID ) { @@ -3939,11 +3912,7 @@ ivas_error IVAS_REND_AddInput( ivas_error error; int32_t maxNumInputsOfType; void *inputsArray; -#ifdef CODE_IMPROVEMENTS IVAS_REND_AudioConfigType inputType; -#else - int32_t inputStructSize; -#endif ivas_error ( *activateInput )( void *, AUDIO_CONFIG, IVAS_REND_InputId, RENDER_CONFIG_DATA *, hrtf_handles *hrtfs ); void ( *setInputDelay )( void *, bool ); int32_t inputIndex; @@ -3976,46 +3945,30 @@ ivas_error IVAS_REND_AddInput( splitPreRendCldfb = ( hIvasRend->hRendererConfig->split_rend_config.codec == ISAR_SPLIT_REND_CODEC_LCLD ); } -#ifdef CODE_IMPROVEMENTS inputType = getAudioConfigType( inConfig ); switch ( inputType ) -#else - switch ( getAudioConfigType( inConfig ) ) -#endif { case IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED: maxNumInputsOfType = RENDERER_MAX_ISM_INPUTS; inputsArray = hIvasRend->inputsIsm; -#ifndef CODE_IMPROVEMENTS - inputStructSize = sizeof( *hIvasRend->inputsIsm ); -#endif activateInput = setRendInputActiveIsm; setInputDelay = setRendInputDelayIsm; break; case IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED: maxNumInputsOfType = RENDERER_MAX_MC_INPUTS; inputsArray = hIvasRend->inputsMc; -#ifndef CODE_IMPROVEMENTS - inputStructSize = sizeof( *hIvasRend->inputsMc ); -#endif activateInput = setRendInputActiveMc; setInputDelay = setRendInputDelayMc; break; case IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS: maxNumInputsOfType = RENDERER_MAX_SBA_INPUTS; inputsArray = hIvasRend->inputsSba; -#ifndef CODE_IMPROVEMENTS - inputStructSize = sizeof( *hIvasRend->inputsSba ); -#endif activateInput = setRendInputActiveSba; setInputDelay = setRendInputDelaySba; break; case IVAS_REND_AUDIO_CONFIG_TYPE_MASA: maxNumInputsOfType = RENDERER_MAX_MASA_INPUTS; inputsArray = hIvasRend->inputsMasa; -#ifndef CODE_IMPROVEMENTS - inputStructSize = sizeof( *hIvasRend->inputsMasa ); -#endif activateInput = setRendInputActiveMasa; setInputDelay = setRendInputDelayMasa; break; @@ -4024,29 +3977,17 @@ ivas_error IVAS_REND_AddInput( } /* Find first free input in array corresponding to input type */ -#ifdef CODE_IMPROVEMENTS if ( ( error = findFreeInputSlot( inputsArray, inputType, maxNumInputsOfType, &inputIndex ) ) != IVAS_ERR_OK ) -#else - if ( ( error = findFreeInputSlot( inputsArray, inputStructSize, maxNumInputsOfType, &inputIndex ) ) != IVAS_ERR_OK ) -#endif { return error; } *inputId = makeInputId( inConfig, inputIndex ); -#ifdef CODE_IMPROVEMENTS if ( ( error = activateInput( getInputByIndex( inputsArray, inputIndex, inputType ), inConfig, *inputId, hIvasRend->hRendererConfig, &hIvasRend->hHrtfs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = activateInput( (uint8_t *) inputsArray + inputStructSize * inputIndex, inConfig, *inputId, hIvasRend->hRendererConfig, &hIvasRend->hHrtfs ) ) != IVAS_ERR_OK ) -#endif { return error; } -#ifdef CODE_IMPROVEMENTS setInputDelay( getInputByIndex( inputsArray, inputIndex, inputType ), splitPreRendCldfb ); -#else - setInputDelay( (uint8_t *) inputsArray + inputStructSize * inputIndex, splitPreRendCldfb ); -#endif /* set global maximum delay after adding an input */ setMaxGlobalDelayNs( hIvasRend ); diff --git a/lib_util/mime_io.c b/lib_util/mime_io.c index ee2a9c12a..9ca8ba1b8 100644 --- a/lib_util/mime_io.c +++ b/lib_util/mime_io.c @@ -317,11 +317,7 @@ static bool readByte( FILE *file, uint8_t *value ) static bool readLong( FILE *file, uint16_t *value ) { char buffer[4] = { 0 }; -#ifdef CODE_IMPROVEMENTS if ( fread( buffer, 1, 4, file ) != 1U ) -#else - if ( fread( buffer, 4, 1, file ) != 1U ) -#endif { return false; } diff --git a/lib_util/rtpdump.c b/lib_util/rtpdump.c index dfa15a9da..9b25633a9 100644 --- a/lib_util/rtpdump.c +++ b/lib_util/rtpdump.c @@ -80,11 +80,7 @@ static unsigned char *parseByte( unsigned char *buffer, unsigned char *value ) static int readLong( FILE *file, unsigned int *value ) { char buffer[4] = { 0 }; -#ifdef CODE_IMPROVEMENTS if ( fread( buffer, 1, 4, file ) != 1U ) -#else - if ( fread( buffer, 4, 1, file ) != 1U ) -#endif { return -1; } @@ -100,11 +96,7 @@ static int readLong( FILE *file, unsigned int *value ) static int readShort( FILE *file, unsigned short *value ) { char buffer[2] = { 0 }; -#ifdef CODE_IMPROVEMENTS if ( fread( buffer, 1, 2, file ) != 1U ) -#else - if ( fread( buffer, 2, 1, file ) != 1U ) -#endif { return -1; } diff --git a/lib_util/tinywavein_c.h b/lib_util/tinywavein_c.h index 179c676a8..1ff6f26bb 100644 --- a/lib_util/tinywavein_c.h +++ b/lib_util/tinywavein_c.h @@ -54,22 +54,14 @@ #define __TWI_SUCCESS ( 0 ) #define __TWI_ERROR ( -1 ) -#ifdef CODE_IMPROVEMENTS typedef struct tinyWaveInHandle -#else -typedef struct __tinyWaveInHandle -#endif { FILE *theFile; fpos_t dataChunkPos; uint32_t position; uint32_t length; uint32_t bps; -#ifdef CODE_IMPROVEMENTS } tinyWaveInHandle, WAVEFILEIN; -#else -} __tinyWaveInHandle, WAVEFILEIN; -#endif typedef struct { diff --git a/lib_util/tinywaveout_c.h b/lib_util/tinywaveout_c.h index 70373e3cc..a3982ba19 100644 --- a/lib_util/tinywaveout_c.h +++ b/lib_util/tinywaveout_c.h @@ -70,27 +70,15 @@ #endif #endif -#ifdef CODE_IMPROVEMENTS typedef struct tinyWaveOutHeader -#else -typedef struct __tinyWaveOutHeader -#endif { uint32_t riffType; /* 'RIFF' */ uint32_t riffSize; /* file size */ uint32_t waveType; /* 'WAVE' */ -#ifdef CODE_IMPROVEMENTS } tinyWaveOutHeader; -#else -} __tinyWaveOutHeader; -#endif -#ifdef CODE_IMPROVEMENTS typedef struct tinyWaveOutFmtChunk -#else -typedef struct __tinyWaveOutFmtChunk -#endif { uint32_t formatType; uint32_t formatSize; @@ -103,32 +91,16 @@ typedef struct __tinyWaveOutFmtChunk uint16_t bitsPerSample; /* wav fmt ext hdr here */ -#ifdef CODE_IMPROVEMENTS } tinyWaveOutFmtChunk; -#else -} __tinyWaveOutFmtChunk; -#endif -#ifdef CODE_IMPROVEMENTS typedef struct tinyWaveOutDataChunk -#else -typedef struct __tinyWaveOutDataChunk -#endif { uint32_t dataType; uint32_t dataSize; -#ifdef CODE_IMPROVEMENTS } tinyWaveOutDataChunk; -#else -} __tinyWaveOutDataChunk; -#endif -#ifdef CODE_IMPROVEMENTS typedef struct tinyWaveOutHandle -#else -typedef struct __tinyWaveOutHandle -#endif { FILE *theFile; uint32_t dataSize; @@ -137,11 +109,7 @@ typedef struct __tinyWaveOutHandle uint32_t dataChunkOffset; uint32_t bps; uint32_t clipCount; -#ifdef CODE_IMPROVEMENTS } tinyWaveOutHandle, WAVEFILEOUT; -#else -} __tinyWaveOutHandle, WAVEFILEOUT; -#endif /*--- local protos --------------------------------------------------*/ static __inline uint32_t BigEndian32( char, char, char, char ); @@ -164,15 +132,9 @@ static WAVEFILEOUT *CreateBWF( /* ,const uint32_t writeWaveExt */ ) { WAVEFILEOUT *self; -#ifdef CODE_IMPROVEMENTS tinyWaveOutHeader whdr; tinyWaveOutFmtChunk wfch; tinyWaveOutDataChunk wdch; -#else - __tinyWaveOutHeader whdr; - __tinyWaveOutFmtChunk wfch; - __tinyWaveOutDataChunk wdch; -#endif uint32_t blockAlignment = 0; uint32_t ByteCnt = 0; /* Byte counter for fwrite */ -- GitLab From 452b61ba81ddf35ba876275dd16e59bc0e2c39a0 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:55:38 +0100 Subject: [PATCH 13/21] [cleanup] accept NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS --- apps/renderer.c | 11 ----------- lib_com/options.h | 1 - 2 files changed, 12 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 5231a2b5f..d49cd0192 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -71,9 +71,7 @@ #define IVAS_MAX16B_FLT 32767.0f #define IVAS_MIN16B_FLT ( -32768.0f ) -#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS #define OMASA_TDREND_MATCHING_GAIN_DB ( -2.0f ) -#endif #if !defined( DEBUGGING ) && !defined( WMOPS ) static @@ -1210,29 +1208,21 @@ int main( } } -#ifndef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS - /* Set the total number of objects */ -#endif if ( args.inConfig.numAudioObjects > 0 ) { -#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS /* Set the total number of objects */ -#endif if ( ( error = IVAS_REND_SetTotalNumberOfObjects( hIvasRend, args.inConfig.numAudioObjects ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_REND_SetTotalNumberOfObjects(): %s\n", ivas_error_to_string( error ) ); goto cleanup; } -#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS /* Set the metadata delay for objects */ -#endif if ( ( error = IVAS_REND_SetIsmMetadataDelay( hIvasRend, args.syncMdDelay ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_REND_SetIsmMetadataDelay(): %s\n", ivas_error_to_string( error ) ); goto cleanup; } -#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS /* For OMASA input and BINAURAL output, apply a gain to objects to match the loudness with MASA part */ if ( args.inConfig.numMasaBuses > 0 && args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL ) @@ -1242,7 +1232,6 @@ int main( args.inConfig.audioObjects[i].gain_dB += OMASA_TDREND_MATCHING_GAIN_DB; } } -#endif } IVAS_REND_LfePanMtx lfePanMatrix; diff --git a/lib_com/options.h b/lib_com/options.h index be7d888c0..999deb4e1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -181,7 +181,6 @@ #define FIX_1413_IGF_INIT_PRINTOUT /* FhG: use correct variable for IGF initiliazation */ #define FIX_1330_JBM_MEMORY /* VA: issue 1330: memory savings in the JBM decoder */ #define FIX_1330_JBM_MEMORY_FIX /* VA: basop issue: 2179 fix non-BE difference in FIX_1330_JBM_MEMORY */ -#define NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS /* Nokia: issue 1339: Apply scaling to the object-part of OMASA for binaural rendering in IVAS_rend. */ #define NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING /* Nokia: Fix OMASA to MASA1 rendering in IVAS_rend */ #define FIX_1383_HEAD_TRACK_SANITIZER /* Nok: issue 1383: Fix head tracking struc values reading in renderer */ #define FIX_1411_IGF_CRASH_BW_SWITCHING /* FhG: Fix for issue 1411: fixes crash that can happen for IGF with BW switching and DTX*/ -- GitLab From a845df436241277d4c89c73db890aadb10c261be Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:55:41 +0100 Subject: [PATCH 14/21] [cleanup] accept NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING --- lib_com/options.h | 1 - lib_rend/ivas_omasa_ana.c | 22 ---------------------- 2 files changed, 23 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 999deb4e1..3e1d77622 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -181,7 +181,6 @@ #define FIX_1413_IGF_INIT_PRINTOUT /* FhG: use correct variable for IGF initiliazation */ #define FIX_1330_JBM_MEMORY /* VA: issue 1330: memory savings in the JBM decoder */ #define FIX_1330_JBM_MEMORY_FIX /* VA: basop issue: 2179 fix non-BE difference in FIX_1330_JBM_MEMORY */ -#define NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING /* Nokia: Fix OMASA to MASA1 rendering in IVAS_rend */ #define FIX_1383_HEAD_TRACK_SANITIZER /* Nok: issue 1383: Fix head tracking struc values reading in renderer */ #define FIX_1411_IGF_CRASH_BW_SWITCHING /* FhG: Fix for issue 1411: fixes crash that can happen for IGF with BW switching and DTX*/ #define FIX_1419_MONO_STEREO_UMX /* FhG: fix for issue 1419 : support upmix to all output formats for mono and stereo */ diff --git a/lib_rend/ivas_omasa_ana.c b/lib_rend/ivas_omasa_ana.c index 22dfafef1..9a05b8625 100644 --- a/lib_rend/ivas_omasa_ana.c +++ b/lib_rend/ivas_omasa_ana.c @@ -498,7 +498,6 @@ static void ivas_omasa_dmx( for ( i = 0; i < nchan_ism; i++ ) { -#ifdef NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING if ( nchan_transport == 1 ) { v_add( data_out_f[0], data_in_f[i], data_out_f[0], input_frame ); @@ -525,27 +524,6 @@ static void ivas_omasa_dmx( prev_gains[i][j] = gains[j]; } } -#else - azimuth = ism_azimuth[i]; - elevation = ism_elevation[i]; - - ivas_ism_get_stereo_gains( azimuth, elevation, &gains[0], &gains[1] ); - - /* Downmix using the panning gains */ - for ( j = 0; j < nchan_transport; j++ ) - { - if ( fabsf( gains[j] ) > 0.0 || fabsf( prev_gains[i][j] ) > 0.0f ) - { - for ( k = 0; k < input_frame; k++ ) - { - g1 = interpolator[k]; - g2 = 1.0f - g1; - data_out_f[j][k] += ( g1 * gains[j] + g2 * prev_gains[i][j] ) * data_in_f[i][k]; - } - } - prev_gains[i][j] = gains[j]; - } -#endif } for ( i = 0; i < nchan_transport; i++ ) -- GitLab From 14d1191e064c6a2a13baacd02a73d7902adc76d2 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:55:52 +0100 Subject: [PATCH 15/21] [cleanup] accept FIX_1376_MISSING_ISM_METADATA --- apps/renderer.c | 8 -------- lib_com/options.h | 1 - 2 files changed, 9 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index d49cd0192..fa7b6cd1d 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -587,7 +587,6 @@ static void setupWithSingleFormatInput( positionProvider->numObjects = args.inConfig.numAudioObjects; for ( int16_t i = 0; i < positionProvider->numObjects; ++i ) { -#ifdef FIX_1376_MISSING_ISM_METADATA /* Check if path to metadata file was given */ if ( isEmptyString( args.inMetadataFilePaths[i] ) ) { @@ -596,18 +595,11 @@ static void setupWithSingleFormatInput( } /* It is allowed on CLI to have no metadata for an ISM input - skip opening if string contains "NULL" */ -#else - /* It is allowed on CLI to have no metadata for an ISM input - skip opening if string is empty or contains "NULL" */ -#endif char charBuf[FILENAME_MAX]; strncpy( charBuf, args.inMetadataFilePaths[i], min( FILENAME_MAX, RENDERER_MAX_CLI_ARG_LENGTH ) - 1 ); charBuf[min( FILENAME_MAX, RENDERER_MAX_CLI_ARG_LENGTH ) - 1] = '\0'; to_upper( charBuf ); -#ifdef FIX_1376_MISSING_ISM_METADATA if ( strncmp( charBuf, "NULL", 4 ) == 0 ) -#else - if ( isEmptyString( args.inMetadataFilePaths[i] ) || strncmp( charBuf, "NULL", 4 ) == 0 ) -#endif { continue; } diff --git a/lib_com/options.h b/lib_com/options.h index 3e1d77622..e86cb6eb4 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -170,7 +170,6 @@ #define FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add split rendering support to decoder in VoIP mode */ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #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 FIX_1376_MISSING_ISM_METADATA /* FhG: IVAS_rend: throw error if there exists an ISM input without a corresponding metadata file path */ #define FIX_1385_INIT_IGF_STOP_FREQ /* FhG: Initialize infoIGFStopFreq in init_igf_dec() */ #define FIX_1387_INIT_PRM_SQQ /* FhG: initialize pointer prm_sqQ, which might be uninitialized in case of bfi == 1 */ #define FIX_1349_TNS_CRASH /* FhG: Fix crash in TNS entropy coding, in case order of joint TNS coding is reduced to 0 */ -- GitLab From 5416dc535e69078f97d70cceed300c96b1187d63 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:55:57 +0100 Subject: [PATCH 16/21] [cleanup] accept FIX_1330_JBM_MEMORY --- lib_com/ivas_prot.h | 10 ---------- lib_com/ivas_tools.c | 6 ------ lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 27 ------------------------- lib_dec/ivas_ism_dec.c | 21 ------------------- lib_dec/ivas_ism_renderer.c | 36 --------------------------------- lib_dec/ivas_jbm_dec.c | 16 --------------- lib_dec/ivas_masa_dec.c | 11 ---------- lib_dec/ivas_mct_dec.c | 11 ---------- lib_dec/ivas_omasa_dec.c | 40 ------------------------------------- lib_dec/ivas_osba_dec.c | 35 -------------------------------- lib_dec/ivas_sba_dec.c | 15 -------------- lib_dec/ivas_stat_dec.h | 2 -- lib_rend/ivas_output_init.c | 35 -------------------------------- 14 files changed, 266 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index e2cfd5092..f5425e101 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -310,14 +310,9 @@ ivas_error ivas_init_decoder( ivas_error ivas_output_buff_dec( float *p_output_f[], /* i/o: output audio buffers */ -#ifdef FIX_1330_JBM_MEMORY const int16_t nchan_out_buff, /* i : number of output channels */ const int16_t Opt_tsm, /* i : TSM option flag */ DECODER_TC_BUFFER_HANDLE hTcBuffer /* i : TSM buffer handle */ -#else - const int16_t nchan_out_buff_old, /* i : previous frame number of output channels*/ - const int16_t nchan_out_buff /* i : number of output channels */ -#endif ); /*! r: flag to indicate if split rendering is enabled */ @@ -5866,12 +5861,7 @@ void ivas_omasa_separate_object_render_jbm( const uint16_t nSamplesRendered, /* i : number of samples rendered */ float input_f[][L_FRAME48k], /* i : separated object signal */ float *output_f[], /* o : rendered time signal */ -#ifdef FIX_1330_JBM_MEMORY const int16_t subframes_rendered /* i : number of subframes rendered */ -#else - const int16_t subframes_rendered, /* i : number of subframes rendered */ - const int16_t slots_rendered /* i : number of CLDFB slots rendered */ -#endif ); void ivas_omasa_encode_masa_to_total( diff --git a/lib_com/ivas_tools.c b/lib_com/ivas_tools.c index 58ace45ef..992adb1b3 100644 --- a/lib_com/ivas_tools.c +++ b/lib_com/ivas_tools.c @@ -198,24 +198,18 @@ void ivas_buffer_deinterleaved_to_interleaved( ) { int16_t ch, m; -#ifdef FIX_1330_JBM_MEMORY float buffer[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][L_FRAME48k]; /* temp buffer needed when "*audio[]" and "*audio_out[]" are the same */ for ( ch = 0; ch < n_channels; ch++ ) { mvr2r( audio[ch], buffer[ch], frame_length ); } -#endif for ( ch = 0; ch < n_channels; ch++ ) { for ( m = 0; m < frame_length; m++ ) { -#ifdef FIX_1330_JBM_MEMORY audio_out[m * n_channels + ch] = buffer[ch][m]; -#else - audio_out[m * n_channels + ch] = audio[ch][m]; -#endif } } diff --git a/lib_com/options.h b/lib_com/options.h index e86cb6eb4..392e59df5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -178,7 +178,6 @@ #define FIX_1388_MSAN_ivas_init_decoder /* VA: issue 1388: fix use-of-uninitialized value in ivas_init_decoder() */ #define FIX_1370_EXTERNAL_ORIENTATION_CHECK /* Nokia: add sanity check for Euler angles for external orientations */ #define FIX_1413_IGF_INIT_PRINTOUT /* FhG: use correct variable for IGF initiliazation */ -#define FIX_1330_JBM_MEMORY /* VA: issue 1330: memory savings in the JBM decoder */ #define FIX_1330_JBM_MEMORY_FIX /* VA: basop issue: 2179 fix non-BE difference in FIX_1330_JBM_MEMORY */ #define FIX_1383_HEAD_TRACK_SANITIZER /* Nok: issue 1383: Fix head tracking struc values reading in renderer */ #define FIX_1411_IGF_CRASH_BW_SWITCHING /* FhG: Fix for issue 1411: fixes crash that can happen for IGF with BW switching and DTX*/ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 03c222612..fb1576800 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1260,9 +1260,7 @@ ivas_error ivas_init_decoder( int16_t sce_id, cpe_id; int16_t numCldfbAnalyses, numCldfbSyntheses; int16_t granularity, n_channels_transport_jbm; -#ifdef FIX_1330_JBM_MEMORY int16_t nchan_out_buff; -#endif int32_t output_Fs, ivas_total_brate; int32_t delay_ns; AUDIO_CONFIG output_config; @@ -2468,28 +2466,11 @@ ivas_error ivas_init_decoder( * Allocate floating-point output audio buffers *-----------------------------------------------------------------*/ -#ifdef FIX_1330_JBM_MEMORY nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, ivas_total_brate ); if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff, hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK ) { return error; } -#else - 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++ ) - { - /* note: these are intra-frame heap memories */ - if ( ( st_ivas->p_output_f[n] = (float *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for floating-point output audio buffer!\n" ) ); - } - } - - for ( ; n < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; n++ ) - { - st_ivas->p_output_f[n] = NULL; - } -#endif return error; } @@ -2962,15 +2943,7 @@ void ivas_destroy_dec( /* floating-point output audio buffers */ for ( i = 0; i < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; i++ ) { -#ifdef FIX_1330_JBM_MEMORY st_ivas->p_output_f[i] = NULL; -#else - if ( st_ivas->p_output_f[i] != NULL ) - { - free( st_ivas->p_output_f[i] ); - st_ivas->p_output_f[i] = NULL; - } -#endif } /* main IVAS handle */ diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index d04988395..966fcfdda 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -60,11 +60,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( int16_t tc_nchan_tc_new; int16_t tc_nchan_allocate_new; int16_t tc_granularity_new; -#ifdef FIX_1330_JBM_MEMORY int16_t nchan_out_buff; -#else - int16_t nchan_out_buff, nchan_out_buff_old; -#endif nCPE_old = st_ivas->nCPE; nSCE_old = st_ivas->nSCE; @@ -74,9 +70,6 @@ static ivas_error ivas_ism_bitrate_switching_dec( st_ivas->ism_mode = last_ism_mode; ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); st_ivas->ism_mode = ism_mode; -#ifndef FIX_1330_JBM_MEMORY - nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); -#endif if ( ( error = ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->nchan_ism, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL, 0 ) ) != IVAS_ERR_OK ) { @@ -290,18 +283,6 @@ static ivas_error ivas_ism_bitrate_switching_dec( return error; } -#ifndef FIX_1330_JBM_MEMORY - /*-----------------------------------------------------------------* - * floating-point output audio buffers - *-----------------------------------------------------------------*/ - - nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); - - if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif /*-----------------------------------------------------------------* * JBM TC buffers *-----------------------------------------------------------------*/ @@ -341,7 +322,6 @@ static ivas_error ivas_ism_bitrate_switching_dec( mvs2s( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); } -#ifdef FIX_1330_JBM_MEMORY /*-----------------------------------------------------------------* * floating-point output audio buffers @@ -352,7 +332,6 @@ static ivas_error ivas_ism_bitrate_switching_dec( { return error; } -#endif return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index d3897bba6..3ef3209ac 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -194,25 +194,11 @@ void ivas_ism_render_sf( ism_md_subframe_update_jbm = st_ivas->hTcBuffer->nb_subframes - 2; } -#ifndef FIX_1330_JBM_MEMORY - if ( st_ivas->hDecoderConfig->Opt_tsm ) - { - for ( i = 0; i < num_objects; i++ ) - { - p_tc[i] = &st_ivas->hTcBuffer->tc[i][tc_offset]; - } - } - else - { -#endif for ( i = 0; i < num_objects; i++ ) { mvr2r( &output_f[i][tc_offset], tc_local[i], n_samples_to_render ); p_tc[i] = tc_local[i]; } -#ifndef FIX_1330_JBM_MEMORY - } -#endif for ( i = 0; i < nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; i++ ) { @@ -451,12 +437,7 @@ void ivas_omasa_separate_object_render_jbm( const uint16_t nSamplesRendered, /* i : number of samples rendered */ float input_f_in[][L_FRAME48k], /* i : separated object signal */ float *output_f[], /* o : rendered time signal */ -#ifdef FIX_1330_JBM_MEMORY const int16_t subframes_rendered /* i : number of subframes rendered */ -#else - const int16_t subframes_rendered, /* i : number of subframes rendered */ - const int16_t slots_rendered /* i : number of CLDFB slots rendered */ -#endif ) { VBAP_HANDLE hVBAPdata; @@ -497,32 +478,15 @@ void ivas_omasa_separate_object_render_jbm( num_objects = st_ivas->nchan_ism; } -#ifndef FIX_1330_JBM_MEMORY - offsetSamples = slots_rendered * hSpatParamRendCom->slot_size; -#endif for ( j = 0; j < nchan_out_woLFE + num_lfe; j++ ) { output_f_local[j] = output_f[j]; } -#ifndef FIX_1330_JBM_MEMORY - if ( st_ivas->hDecoderConfig->Opt_tsm ) - { - for ( obj = 0; obj < num_objects; obj++ ) - { - input_f[obj] = &st_ivas->hTcBuffer->tc[obj + 2][offsetSamples]; - } - } - else - { -#endif for ( obj = 0; obj < num_objects; obj++ ) { input_f[obj] = input_f_in[obj]; } -#ifndef FIX_1330_JBM_MEMORY - } -#endif slots_to_render = nSamplesRendered / hSpatParamRendCom->slot_size; first_sf = subframes_rendered; diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 3e8180ae1..e70fbf0e4 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -761,11 +761,7 @@ void ivas_jbm_dec_feed_tc_to_renderer( float tmp_buf[MAX_JBM_L_FRAME48k]; float *p_data_f[FOA_CHANNELS + MAX_NUM_OBJECTS]; int16_t n, n_render_timeslots, n_ch_cldfb; -#ifdef FIX_1330_JBM_MEMORY int16_t ch, offset, len_offset; -#else - int16_t ch; -#endif DECODER_TC_BUFFER_HANDLE hTcBuffer; hTcBuffer = st_ivas->hTcBuffer; @@ -783,7 +779,6 @@ void ivas_jbm_dec_feed_tc_to_renderer( 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; -#ifdef FIX_1330_JBM_MEMORY /* buffers are shared between 'hTcBuffer->tc[]' and 'p_output_f[]': in case of 'length(hTcBuffer->tc[]) < length(p_output_f[])', reset of TC buffers pointers is needed after ivas_buffer_interleaved_to_deinterleaved() */ @@ -801,7 +796,6 @@ void ivas_jbm_dec_feed_tc_to_renderer( } } -#endif for ( ch = 0; ch < n_ch_full_copy; ch++ ) { mvr2r( hTcBuffer->tc[ch], tmp_buf, nSamplesForRendering ); @@ -2142,9 +2136,7 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate( if ( Opt_tsm ) { n_samp_full = ( NS2SA( output_Fs, MAX_JBM_L_FRAME_NS ) ); -#ifdef FIX_1330_JBM_MEMORY n_samp_full = max( n_samp_full, L_FRAME48k ); /* buffers are shared between 'hTcBuffer->tc[]' and 'p_output_f[]': ensure minimal length */ -#endif n_samp_residual = hTcBuffer->n_samples_granularity - 1; } else @@ -2204,10 +2196,8 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate( } } -#ifdef FIX_1330_JBM_MEMORY hTcBuffer->tc_buffer2 = NULL; -#endif return IVAS_ERR_OK; } @@ -2245,14 +2235,12 @@ static void ivas_jbm_dec_tc_audio_deallocate( hTcBuffer->tc_buffer_old[ch_idx] = NULL; } } -#ifdef FIX_1330_JBM_MEMORY if ( hTcBuffer->tc_buffer2 != NULL ) { free( hTcBuffer->tc_buffer2 ); hTcBuffer->tc_buffer2 = NULL; } -#endif } return; @@ -2448,11 +2436,7 @@ static void ivas_jbm_dec_tc_buffer_playout( for ( ch_idx = 0; ch_idx < st_ivas->hTcBuffer->nchan_transport_jbm; ch_idx++ ) { -#ifdef FIX_1330_JBM_MEMORY output[ch_idx] = st_ivas->hTcBuffer->tc[ch_idx] + st_ivas->hTcBuffer->n_samples_rendered; -#else - mvr2r( st_ivas->hTcBuffer->tc[ch_idx] + st_ivas->hTcBuffer->n_samples_rendered, output[ch_idx], *nSamplesRendered ); -#endif } st_ivas->hTcBuffer->subframes_rendered = last_sf; diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 06f2382ce..75749735c 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1320,20 +1320,13 @@ 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_1330_JBM_MEMORY int16_t nchan_out_buff; -#else - int16_t nchan_out_buff_old, nchan_out_buff; -#endif ivas_error error; int16_t pos_idx; int32_t ism_total_brate; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; last_ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate; -#ifndef FIX_1330_JBM_MEMORY - 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 ) @@ -1571,11 +1564,7 @@ ivas_error ivas_masa_dec_reconfigure( { nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); -#ifdef FIX_1330_JBM_MEMORY if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff, st_ivas->hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 293ff9396..55e8b89b8 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -733,17 +733,10 @@ static ivas_error ivas_mc_dec_reconfig( int16_t tc_nchan_tc_new; int16_t tc_nchan_allocate_new; int16_t tc_granularity_new; -#ifdef FIX_1330_JBM_MEMORY int16_t nchan_out_buff; -#else - int16_t nchan_out_buff_old, nchan_out_buff; -#endif ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; nchan_transport_old = st_ivas->nchan_transport; -#ifndef FIX_1330_JBM_MEMORY - nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); -#endif last_mc_mode = ivas_mc_mode_select( ivas_mc_map_output_config_to_mc_ls_setup( st_ivas->transport_config ), st_ivas->hDecoderConfig->last_ivas_total_brate ); /* NB: this assumes that LS config remains the same between frames */ /* temporally set the current mc_mode back to the previous one to make sure the following call to @@ -1385,11 +1378,7 @@ static ivas_error ivas_mc_dec_reconfig( *-----------------------------------------------------------------*/ nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); -#ifdef FIX_1330_JBM_MEMORY if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff, st_ivas->hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index e3b2716f2..7ed7a2792 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -197,11 +197,7 @@ ivas_error ivas_omasa_dec_config( int32_t ivas_total_brate, ism_total_brate, cpe_brate; ISM_MODE ism_mode_old; IVAS_FORMAT ivas_format_orig; -#ifdef FIX_1330_JBM_MEMORY int16_t nchan_out_buff; -#else - int16_t nchan_out_buff, nchan_out_buff_old; -#endif ivas_error error; RENDERER_TYPE old_renderer_type; @@ -216,9 +212,6 @@ ivas_error ivas_omasa_dec_config( ivas_format_orig = st_ivas->ivas_format; st_ivas->ivas_format = st_ivas->last_ivas_format; ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); -#ifndef FIX_1330_JBM_MEMORY - nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); -#endif st_ivas->ivas_format = ivas_format_orig; @@ -472,11 +465,7 @@ ivas_error ivas_omasa_dec_config( *-----------------------------------------------------------------*/ nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); -#ifdef FIX_1330_JBM_MEMORY if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff, st_ivas->hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -680,16 +669,9 @@ void ivas_omasa_dirac_rend_jbm( ) { int16_t subframes_rendered; -#ifndef FIX_1330_JBM_MEMORY - int16_t slots_rendered; -#endif int16_t n; float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; -#ifndef FIX_1330_JBM_MEMORY - if ( !st_ivas->hDecoderConfig->Opt_tsm ) - { -#endif *nSamplesRendered = min( nSamplesAsked, st_ivas->hTcBuffer->n_samples_available ); if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) @@ -699,11 +681,7 @@ void ivas_omasa_dirac_rend_jbm( #ifdef NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) #else -#ifdef FIX_1330_JBM_MEMORY if ( !st_ivas->hDecoderConfig->Opt_tsm && st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) -#endif #endif { /* Gain separated object, if edited */ @@ -726,11 +704,7 @@ void ivas_omasa_dirac_rend_jbm( #ifdef NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES if ( st_ivas->hMasaIsmData->ism_gain_is_edited[n] ) #else -#ifdef FIX_1330_JBM_MEMORY if ( !st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hMasaIsmData->ism_gain_is_edited[n] ) -#else - if ( st_ivas->hMasaIsmData->ism_gain_is_edited[n] ) -#endif #endif { v_multc( data_separated_objects[n], st_ivas->hMasaIsmData->gain_ism_edited[n], data_separated_objects[n], *nSamplesRendered ); @@ -738,11 +712,7 @@ void ivas_omasa_dirac_rend_jbm( } /* Gain MASA part, if edited in G192. MASA gaining with VOIP is done in ivas_dec_prepare_renderer() */ -#ifdef FIX_1330_JBM_MEMORY if ( !st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hMasaIsmData->masa_gain_is_edited ) -#else - if ( st_ivas->hMasaIsmData->masa_gain_is_edited ) -#endif { for ( n = 0; n < CPE_CHANNELS; n++ ) { @@ -750,22 +720,12 @@ void ivas_omasa_dirac_rend_jbm( } } } -#ifndef FIX_1330_JBM_MEMORY - } -#endif subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; -#ifndef FIX_1330_JBM_MEMORY - slots_rendered = st_ivas->hSpatParamRendCom->slots_rendered; -#endif ivas_dirac_dec_render( st_ivas, nchan_transport, nSamplesAsked, nSamplesRendered, nSamplesAvailable, output_f ); -#ifdef FIX_1330_JBM_MEMORY ivas_omasa_separate_object_render_jbm( st_ivas, *nSamplesRendered, data_separated_objects, output_f, subframes_rendered ); -#else - ivas_omasa_separate_object_render_jbm( st_ivas, *nSamplesRendered, data_separated_objects, output_f, subframes_rendered, slots_rendered ); -#endif return; } diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c index 00025b684..9ae349f40 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -320,70 +320,35 @@ ivas_error ivas_osba_render_sf( ) { int16_t n; -#ifdef FIX_1330_JBM_MEMORY float output_sba[MAX_OUTPUT_CHANNELS][L_FRAME48k]; float *p_output_sba[MAX_OUTPUT_CHANNELS]; -#else - float output_ism[MAX_OUTPUT_CHANNELS][L_FRAME48k]; - float *p_output_ism[MAX_OUTPUT_CHANNELS]; -#endif ivas_error error; for ( n = 0; n < MAX_OUTPUT_CHANNELS; n++ ) { -#ifdef FIX_1330_JBM_MEMORY p_output_sba[n] = output_sba[n]; -#else - p_output_ism[n] = &output_ism[n][0]; -#endif } -#ifndef FIX_1330_JBM_MEMORY - if ( !st_ivas->hDecoderConfig->Opt_tsm ) - { - int16_t tc_offset; - tc_offset = st_ivas->hTcBuffer->n_samples_rendered; - for ( n = 0; n < st_ivas->nchan_ism; n++ ) - { - - mvr2r( &p_output[n][tc_offset], &output_ism[n][tc_offset], nSamplesAsked ); - } - } -#endif -#ifdef FIX_1330_JBM_MEMORY if ( ( error = ivas_sba_dec_render( st_ivas, nSamplesAsked, nSamplesRendered, nSamplesAvailableNext, p_output_sba ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_sba_dec_render( st_ivas, nSamplesAsked, nSamplesRendered, nSamplesAvailableNext, p_output ) ) != IVAS_ERR_OK ) -#endif { return error; } if ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV_ROOM ) { -#ifdef FIX_1330_JBM_MEMORY ivas_ism_render_sf( st_ivas, st_ivas->renderer_type, p_output, *nSamplesRendered ); -#else - ivas_ism_render_sf( st_ivas, st_ivas->renderer_type, p_output_ism, *nSamplesRendered ); -#endif } for ( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) { if ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV_ROOM ) { -#ifdef FIX_1330_JBM_MEMORY v_add( p_output[n], p_output_sba[n], p_output[n], *nSamplesRendered ); -#else - v_add( p_output[n], p_output_ism[n], p_output[n], *nSamplesRendered ); -#endif } -#ifdef FIX_1330_JBM_MEMORY else { mvr2r( p_output_sba[n], p_output[n], *nSamplesRendered ); } -#endif } return IVAS_ERR_OK; diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index e87237599..665e1926e 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -111,12 +111,7 @@ ivas_error ivas_sba_dec_reconfigure( int32_t ivas_total_brate; int32_t last_ivas_total_brate; int16_t num_channels, num_md_sub_frames; -#ifdef FIX_1330_JBM_MEMORY int16_t nchan_out_buff; -#else - int16_t nchan_out_buff, nchan_out_buff_old; - int16_t sba_analysis_order_old_flush; -#endif DECODER_CONFIG_HANDLE hDecoderConfig; ivas_error error; ISM_MODE ism_mode_old; @@ -127,18 +122,12 @@ ivas_error ivas_sba_dec_reconfigure( hDecoderConfig = st_ivas->hDecoderConfig; ivas_total_brate = hDecoderConfig->ivas_total_brate; last_ivas_total_brate = st_ivas->last_active_ivas_total_brate; -#ifndef FIX_1330_JBM_MEMORY - sba_analysis_order_old_flush = st_ivas->sba_analysis_order; -#endif /*-----------------------------------------------------------------* * Set SBA high-level parameters * Save old SBA high-level parameters *-----------------------------------------------------------------*/ -#ifndef FIX_1330_JBM_MEMORY - nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, sba_analysis_order_old_flush, last_ivas_total_brate ); -#endif ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); nchan_hp20_old = getNumChanSynthesis( st_ivas ); @@ -604,11 +593,7 @@ ivas_error ivas_sba_dec_reconfigure( *-----------------------------------------------------------------*/ nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); -#ifdef FIX_1330_JBM_MEMORY if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff, hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 7b55867d1..4c3c1157a 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -975,10 +975,8 @@ typedef struct decoder_tc_buffer_structure int16_t num_slots; int16_t n_samples_discard; /* number of samples to discard from the beginning of the output */ -#ifdef FIX_1330_JBM_MEMORY float *tc_buffer2; /* non-scaled buffer of output audio - needed only when '*tc_buffer* is not long enough */ -#endif } DECODER_TC_BUFFER, *DECODER_TC_BUFFER_HANDLE; typedef struct jbm_metadata_structure diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index e2df9c1a7..ede3653f8 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -369,17 +369,11 @@ int16_t ivas_get_nchan_buffers_dec( ivas_error ivas_output_buff_dec( float *p_output_f[], /* i/o: output audio buffers */ -#ifdef FIX_1330_JBM_MEMORY const int16_t nchan_out_buff, /* i : number of output channels */ const int16_t Opt_tsm, /* i : TSM option flag */ DECODER_TC_BUFFER_HANDLE hTcBuffer /* i : TSM buffer handle */ -#else - const int16_t nchan_out_buff_old, /* i : previous frame number of output channels */ - const int16_t nchan_out_buff /* i : number of output channels */ -#endif ) { -#ifdef FIX_1330_JBM_MEMORY int16_t ch, nchan_tc_jbm, nsamp_to_allocate, n_samp_full, offset; for ( ch = 0; ch < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; ch++ ) @@ -437,35 +431,6 @@ ivas_error ivas_output_buff_dec( offset += n_samp_full; } } -#else - int16_t ch; - - if ( nchan_out_buff > nchan_out_buff_old ) - { - for ( ch = nchan_out_buff_old; ch < nchan_out_buff; ch++ ) - { -#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 - /* note: these are intra-frame heap memories */ - if ( ( p_output_f[ch] = (float *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for floating-point output audio buffer!\n" ) ); - } - } - } - else - { - for ( ch = nchan_out_buff; ch < nchan_out_buff_old; ch++ ) - { - free( p_output_f[ch] ); - p_output_f[ch] = NULL; - } - } -#endif return IVAS_ERR_OK; } -- GitLab From e95412117e43a2f9775642fc64340228525db23a Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:56:00 +0100 Subject: [PATCH 17/21] [cleanup] accept FIX_1370_EXTERNAL_ORIENTATION_CHECK --- lib_com/ivas_error.h | 4 ---- lib_com/options.h | 1 - lib_util/rotation_file_reader.c | 2 -- 3 files changed, 7 deletions(-) diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index c6d18125e..563b10e39 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -134,9 +134,7 @@ typedef enum IVAS_ERR_BITSTREAM_READER_INVALID_FORMAT, IVAS_ERR_NO_FILE_OPEN, IVAS_ERR_SAMPLING_RATE_UNKNOWN, -#ifdef FIX_1370_EXTERNAL_ORIENTATION_CHECK IVAS_ERR_EXTERNAL_ORIENTATION_INVALID_FORMAT, -#endif /*----------------------------------------* * renderer (lib_rend only) * @@ -274,10 +272,8 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) return "Invalid input format"; case IVAS_ERR_INVALID_INDEX: return "Invalid index"; -#ifdef FIX_1370_EXTERNAL_ORIENTATION_CHECK case IVAS_ERR_EXTERNAL_ORIENTATION_INVALID_FORMAT: return "Euler angles were detected in the input but only Quaternions are supported"; -#endif default: break; } diff --git a/lib_com/options.h b/lib_com/options.h index 392e59df5..f845074b4 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -176,7 +176,6 @@ #define FIX_1384_MSAN_stereo_tcx_core_enc /* VA: issue 1384: fix use-of-uninitialized value in stereo_tcx_core_enc() */ #define FIX_1384_MSAN_ivas_spar_dec_open /* VA: issue 1386: fix use-of-uninitialized value in ivas_spar_dec_open() */ #define FIX_1388_MSAN_ivas_init_decoder /* VA: issue 1388: fix use-of-uninitialized value in ivas_init_decoder() */ -#define FIX_1370_EXTERNAL_ORIENTATION_CHECK /* Nokia: add sanity check for Euler angles for external orientations */ #define FIX_1413_IGF_INIT_PRINTOUT /* FhG: use correct variable for IGF initiliazation */ #define FIX_1330_JBM_MEMORY_FIX /* VA: basop issue: 2179 fix non-BE difference in FIX_1330_JBM_MEMORY */ #define FIX_1383_HEAD_TRACK_SANITIZER /* Nok: issue 1383: Fix head tracking struc values reading in renderer */ diff --git a/lib_util/rotation_file_reader.c b/lib_util/rotation_file_reader.c index 6c62290b0..cbf36e42b 100644 --- a/lib_util/rotation_file_reader.c +++ b/lib_util/rotation_file_reader.c @@ -174,14 +174,12 @@ ivas_error ExternalOrientationFileReading( } ( externalOrientationReader->frameCounter )++; -#ifdef FIX_1370_EXTERNAL_ORIENTATION_CHECK /* Only Quaternion orientations are supported, raise an error if Euler angles are detected in the input */ if ( w == -3.0f ) { return IVAS_ERR_EXTERNAL_ORIENTATION_INVALID_FORMAT; } -#endif pQuaternion->w = w; pQuaternion->x = x; -- GitLab From 213c333c9ebed8e89b2cf77f6151c263f7a93a73 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:56:09 +0100 Subject: [PATCH 18/21] [cleanup] accept FIX_1372_OSBA_OBJECT_EDITING --- lib_com/options.h | 1 - lib_dec/ivas_sba_dec.c | 2 -- lib_dec/ivas_spar_decoder.c | 4 ---- 3 files changed, 7 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index f845074b4..2b69a8ac1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -197,7 +197,6 @@ #define FIX_HRTF_LOAD_API // solves API conflicts between HRTF and object-editing features #define TMP_FIX_SPLIT_REND // temporary fix to split-rendering (it follows the later state of the framework but it is needed now because of current test-conditions) #define TMP_FIX_OMASA_SR_BE // temporary fix to keep OMASA split-rendering BE -#define FIX_1372_OSBA_OBJECT_EDITING /* VA: issue 1372: Fix OSBA object-editing in BINAURAL_ROOM_IR */ #define NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES /* Nokia: Fix for issues 1399: obj edit broken with MC/SBA output in VOIP, and 1400: negative energy estimate used for gaining. */ #define FIX_2192_OBJ_EDITING_EXT_METADATA /* Eri: Add support for extended metadata in object editing */ #define FIX_1318_ROOM_SIZE_CMD_LINE /* Philips/Nokia: Default room sizes support */ diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 665e1926e..38a7b2a9b 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -713,12 +713,10 @@ ivas_error ivas_sba_dec_render( { nchan_out = max( nchan_internal, st_ivas->hDecoderConfig->nchan_out - st_ivas->nchan_ism ); } -#ifdef FIX_1372_OSBA_OBJECT_EDITING else if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { nchan_out = BINAURAL_CHANNELS; } -#endif } nchan_out = min( nchan_out, ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ) ); diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 6d6ce6e14..d79cdf7ba 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -1415,11 +1415,7 @@ void ivas_spar_dec_upmixer_sf( p_tc[i] = st_ivas->hTcBuffer->tc[i + nchan_ism] + slot_idx_start * slot_size; } -#ifdef FIX_1372_OSBA_OBJECT_EDITING if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) -#else - if ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) -#endif { for ( i = 0; i < nchan_ism; i++ ) { -- GitLab From fd5e5ea857075194745c0c7b1467254359b0deff Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:56:14 +0100 Subject: [PATCH 19/21] [cleanup] accept NONBE_FIX_1376_MDCT_CONCEALMENT --- lib_com/options.h | 1 - lib_dec/ivas_mdct_core_dec.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 2b69a8ac1..bc03942f0 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,7 +163,6 @@ #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_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0 */ -#define NONBE_FIX_1376_MDCT_CONCEALMENT /* FhG: fix concealment artifact in MDCT Stereo with DTX, in case transition frame gets lost */ #define NONBE_1377_REND_DIRATT_CONF /* Eri: Issue 1377: Error in directivity attenuation configuration for both IVAS_dec and IVAS_rend */ #define FIX_1377_HANDLE_ERROR_CODE /* Eri: Add missing error code handling from IVAS_REND_SetObjectIDs */ #define FIX_1053_REVERB_RECONFIGURATION diff --git a/lib_dec/ivas_mdct_core_dec.c b/lib_dec/ivas_mdct_core_dec.c index 786d32061..25dc163ac 100644 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -1108,7 +1108,6 @@ void ivas_mdct_core_tns_ns( decoder_tcx_tns( st, L_frame_global[ch], L_spec[ch], L_frame[ch], L_frameTCX[ch], &x[ch][k][0], fUseTns[ch][k], &tnsData[ch][k], bfi, k, 1 ); sns_shape_spectrum( x[ch][k], st->hTcxCfg->psychParamsCurrent, &sns_int_scf[0], st->hTcxCfg->psychParamsCurrent->nBins ); -#ifdef NONBE_FIX_1376_MDCT_CONCEALMENT /* 2025-09-07, mul: in case of PLC, applying SNS up to L_spec might not be enough: In case the transition frame from DTX after an inactive period is lost, L_spec is assumed to represent a regular TCX frame, @@ -1116,9 +1115,6 @@ void ivas_mdct_core_tns_ns( in case this is not necessary, x[] is filled with zeros, and the multiplication is not causing any additional harm */ v_multc( x[ch][k] + st->hTcxCfg->psychParamsCurrent->nBins, sns_int_scf[FDNS_NPTS - 1], x[ch][k] + st->hTcxCfg->psychParamsCurrent->nBins, max( L_spec[ch], L_frameTCX[ch] ) - st->hTcxCfg->psychParamsCurrent->nBins ); -#else - v_multc( x[ch][k] + st->hTcxCfg->psychParamsCurrent->nBins, sns_int_scf[FDNS_NPTS - 1], x[ch][k] + st->hTcxCfg->psychParamsCurrent->nBins, L_spec[ch] - st->hTcxCfg->psychParamsCurrent->nBins ); -#endif decoder_tcx_tns( st, L_frame_global[ch], L_spec[ch], L_frame[ch], L_frameTCX[ch], &x[ch][k][0], fUseTns[ch][k], &tnsData[ch][k], bfi, k, 0 ); } -- GitLab From 5805e19adcbff5d5a07384750ffdf0c4d05e253f Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:56:17 +0100 Subject: [PATCH 20/21] [cleanup] accept NONBE_1377_REND_DIRATT_CONF --- apps/renderer.c | 2 -- lib_com/options.h | 1 - lib_rend/ivas_objectRenderer.c | 20 -------------------- lib_rend/ivas_prot_rend.h | 4 ---- lib_rend/lib_rend.c | 24 ------------------------ lib_rend/lib_rend.h | 2 -- 6 files changed, 53 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index fa7b6cd1d..b4249cc49 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1259,7 +1259,6 @@ int main( { masaIds[i] = 0u; } -#ifdef NONBE_1377_REND_DIRATT_CONF #ifdef FIX_1377_HANDLE_ERROR_CODE if ( ( error = IVAS_REND_SetObjectIDs( hIvasRend ) ) != IVAS_ERR_OK ) { @@ -1268,7 +1267,6 @@ int main( } #else IVAS_REND_SetObjectIDs( hIvasRend ); -#endif #endif for ( i = 0; i < args.inConfig.numMultiChannelBuses; ++i ) diff --git a/lib_com/options.h b/lib_com/options.h index bc03942f0..9134728a8 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,7 +163,6 @@ #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_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0 */ -#define NONBE_1377_REND_DIRATT_CONF /* Eri: Issue 1377: Error in directivity attenuation configuration for both IVAS_dec and IVAS_rend */ #define FIX_1377_HANDLE_ERROR_CODE /* Eri: Add missing error code handling from IVAS_REND_SetObjectIDs */ #define FIX_1053_REVERB_RECONFIGURATION #define FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add split rendering support to decoder in VoIP mode */ diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index b9dafaed5..f01b26601 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -533,16 +533,10 @@ ivas_error TDREND_Update_object_positions( const ISM_METADATA_HANDLE *hIsmMetaData /* i : Input metadata for ISM objects */ ) { -#ifndef NONBE_1377_REND_DIRATT_CONF - TDREND_DirAtten_t *DirAtten_p; -#endif int16_t nS; float Pos[3]; float Dir[3]; ivas_error error; -#ifndef NONBE_1377_REND_DIRATT_CONF - DirAtten_p = hBinRendererTd->DirAtten_p; -#endif /* For each source, write the frame data to the source object*/ for ( nS = 0; nS < num_src; nS++ ) @@ -559,12 +553,6 @@ ivas_error TDREND_Update_object_positions( return error; } -#ifndef NONBE_1377_REND_DIRATT_CONF - if ( ( error = TDREND_MIX_SRC_SetDirAtten( hBinRendererTd, nS, DirAtten_p ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif if ( ( error = TDREND_MIX_SRC_SetGain( hBinRendererTd, nS, hIsmMetaData[nS]->gain ) ) != IVAS_ERR_OK ) { return error; @@ -678,13 +666,9 @@ ivas_error ivas_td_binaural_open_ext( AUDIO_CONFIG inConfig, RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration */ LSSETUP_CUSTOM_STRUCT *customLsInput, -#ifdef NONBE_1377_REND_DIRATT_CONF const int32_t outFs, /* i: output sampling rate */ const int16_t object_id /* i: Object ID */ ) -#else - const int32_t outFs ) -#endif { int16_t nchan_transport; AUDIO_CONFIG transport_config; @@ -721,11 +705,7 @@ ivas_error ivas_td_binaural_open_ext( if ( NULL != hRendCfg ) { -#ifdef NONBE_1377_REND_DIRATT_CONF directivity = hRendCfg->directivity + 3 * object_id; -#else - directivity = hRendCfg->directivity; -#endif distAtt = hRendCfg->distAtt; } diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 32f24c131..49038df2e 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -651,12 +651,8 @@ ivas_error ivas_td_binaural_open_ext( const AUDIO_CONFIG inConfig, RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration */ LSSETUP_CUSTOM_STRUCT *customLsInput, -#ifdef NONBE_1377_REND_DIRATT_CONF const int32_t output_Fs, /* i: output sampling rate */ const int16_t object_id /* i: Object ID */ -#else - const int32_t output_Fs -#endif ); void ivas_td_binaural_close( diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 2fd641865..f1e13a709 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -126,9 +126,7 @@ typedef struct float nonDiegeticPanGain; OMASA_ANA_HANDLE hOMasa; uint16_t total_num_objects; -#ifdef NONBE_1377_REND_DIRATT_CONF int16_t object_id; -#endif int16_t ism_metadata_delay_ms; } input_ism; @@ -1643,11 +1641,7 @@ static ivas_error setRendInputActiveIsm( if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { -#ifdef NONBE_1377_REND_DIRATT_CONF if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, inputIsm->object_id ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1655,11 +1649,7 @@ static ivas_error setRendInputActiveIsm( /* Open TD renderer wrappers */ for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { -#ifdef NONBE_1377_REND_DIRATT_CONF if ( ( error = ivas_td_binaural_open_ext( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate, inputIsm->object_id ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_td_binaural_open_ext( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1677,11 +1667,7 @@ static ivas_error setRendInputActiveIsm( } else { -#ifdef NONBE_1377_REND_DIRATT_CONF if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, inputIsm->object_id ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2438,11 +2424,7 @@ static ivas_error initMcBinauralRendering( if ( useTDRend && inputMc->tdRendWrapper.hBinRendererTd == NULL ) { -#ifdef NONBE_1377_REND_DIRATT_CONF if ( ( error = ivas_td_binaural_open_ext( &inputMc->tdRendWrapper, inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_td_binaural_open_ext( &inputMc->tdRendWrapper, inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2452,11 +2434,7 @@ static ivas_error initMcBinauralRendering( /* Open TD renderer wrappers */ for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { -#ifdef NONBE_1377_REND_DIRATT_CONF if ( ( error = ivas_td_binaural_open_ext( &inputMc->splitTdRendWrappers[i], inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_td_binaural_open_ext( &inputMc->splitTdRendWrappers[i], inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -4081,7 +4059,6 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( return IVAS_ERR_OK; } -#ifdef NONBE_1377_REND_DIRATT_CONF /*-------------------------------------------------------------------* * IVAS_REND_SetObjectIDs() * @@ -4107,7 +4084,6 @@ ivas_error IVAS_REND_SetObjectIDs( return IVAS_ERR_OK; } -#endif /*-------------------------------------------------------------------* diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 8c7323fc5..b2d4d8d53 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -151,11 +151,9 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( const IVAS_CUSTOM_LS_DATA layout /* i : custom loudspeaker layout for input */ ); -#ifdef NONBE_1377_REND_DIRATT_CONF ivas_error IVAS_REND_SetObjectIDs( IVAS_REND_HANDLE hIvasRend /* i/o: Renderer handle */ ); -#endif ivas_error IVAS_REND_SetInputGain( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ -- GitLab From 3ef8ea6a0415f3d9fbbdf1b35d964a2677a47981 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:58:30 +0100 Subject: [PATCH 21/21] clang-format --- lib_dec/ivas_core_dec.c | 4 +-- lib_dec/ivas_dirac_dec.c | 3 +-- lib_dec/ivas_ism_renderer.c | 18 ++++++------- lib_dec/ivas_mdct_core_dec.c | 2 +- lib_dec/ivas_omasa_dec.c | 52 ++++++++++++++++++------------------ lib_dec/ivas_stat_dec.h | 22 +++++++-------- lib_dec/jbm_pcmdsp_apa.h | 2 +- lib_rend/ivas_output_init.c | 2 +- lib_rend/lib_rend.c | 2 +- 9 files changed, 53 insertions(+), 54 deletions(-) diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index 892372b99..57f0fa7e8 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -584,8 +584,8 @@ ivas_error ivas_core_dec( } else { - /* TBE on top of ACELP@16kHz */ - tmps = NS2SA( output_Fs, MAX_DELAY_TBE_NS - DELAY_SWB_TBE_16k_NS ); + /* 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_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 808f4a7c5..6bc3575f0 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1717,8 +1717,7 @@ void ivas_dirac_dec_render_sf( float *output_f[], /* i/o: synthesized core-coder transport channels/DirAC output */ const int16_t nchan_transport, /* i : number of transport channels */ float *pppQMfFrame_ts_re[HOA3_CHANNELS][CLDFB_NO_COL_MAX], - float *pppQMfFrame_ts_im[HOA3_CHANNELS][CLDFB_NO_COL_MAX] -) + float *pppQMfFrame_ts_im[HOA3_CHANNELS][CLDFB_NO_COL_MAX] ) { int16_t i, ch, idx_in, idx_lfe; DIRAC_DEC_HANDLE hDirAC; diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 3ef3209ac..f01505fc5 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -194,11 +194,11 @@ void ivas_ism_render_sf( ism_md_subframe_update_jbm = st_ivas->hTcBuffer->nb_subframes - 2; } - for ( i = 0; i < num_objects; i++ ) - { - mvr2r( &output_f[i][tc_offset], tc_local[i], n_samples_to_render ); - p_tc[i] = tc_local[i]; - } + for ( i = 0; i < num_objects; i++ ) + { + mvr2r( &output_f[i][tc_offset], tc_local[i], n_samples_to_render ); + p_tc[i] = tc_local[i]; + } for ( i = 0; i < nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; i++ ) { @@ -483,10 +483,10 @@ void ivas_omasa_separate_object_render_jbm( output_f_local[j] = output_f[j]; } - for ( obj = 0; obj < num_objects; obj++ ) - { - input_f[obj] = input_f_in[obj]; - } + for ( obj = 0; obj < num_objects; obj++ ) + { + input_f[obj] = input_f_in[obj]; + } slots_to_render = nSamplesRendered / hSpatParamRendCom->slot_size; first_sf = subframes_rendered; diff --git a/lib_dec/ivas_mdct_core_dec.c b/lib_dec/ivas_mdct_core_dec.c index 25dc163ac..ce9cf08e9 100644 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -946,7 +946,7 @@ void ivas_mdct_core_reconstruct( /* Postfiltering */ post_decoder( st, synth_buf, pit_gain[ch], pitch[ch], x[ch][0], st->p_bpf_noise_buf ); - mvr2r( synthFB, signal_outFB[ch], st->hTcxDec->L_frameTCX ); + mvr2r( synthFB, signal_outFB[ch], st->hTcxDec->L_frameTCX ); #ifdef DEBUG_PLC_INFO { diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 7ed7a2792..bd779f3da 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -672,54 +672,54 @@ void ivas_omasa_dirac_rend_jbm( int16_t n; float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; - *nSamplesRendered = min( nSamplesAsked, st_ivas->hTcBuffer->n_samples_available ); + *nSamplesRendered = min( nSamplesAsked, st_ivas->hTcBuffer->n_samples_available ); - if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) - { - mvr2r( &output_f[CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[0], *nSamplesRendered ); + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) + { + mvr2r( &output_f[CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[0], *nSamplesRendered ); #ifdef NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES - if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) + if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) #else if ( !st_ivas->hDecoderConfig->Opt_tsm && st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) #endif + { + /* Gain separated object, if edited */ + for ( n = 0; n < st_ivas->nchan_ism; n++ ) { - /* Gain separated object, if edited */ - for ( n = 0; n < st_ivas->nchan_ism; n++ ) + if ( st_ivas->hMasaIsmData->ism_gain_is_edited[n] && st_ivas->hMasaIsmData->idx_separated_ism == n ) { - if ( st_ivas->hMasaIsmData->ism_gain_is_edited[n] && st_ivas->hMasaIsmData->idx_separated_ism == n ) - { - v_multc( data_separated_objects[0], st_ivas->hMasaIsmData->gain_ism_edited[n], data_separated_objects[0], *nSamplesRendered ); - } + v_multc( data_separated_objects[0], st_ivas->hMasaIsmData->gain_ism_edited[n], data_separated_objects[0], *nSamplesRendered ); } } } - else + } + else + { + for ( n = 0; n < st_ivas->nchan_ism; n++ ) { - for ( n = 0; n < st_ivas->nchan_ism; n++ ) - { - mvr2r( &output_f[n + CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[n], *nSamplesRendered ); + mvr2r( &output_f[n + CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[n], *nSamplesRendered ); - /* Gain discrete objects, if edited */ + /* Gain discrete objects, if edited */ #ifdef NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES - if ( st_ivas->hMasaIsmData->ism_gain_is_edited[n] ) + if ( st_ivas->hMasaIsmData->ism_gain_is_edited[n] ) #else if ( !st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hMasaIsmData->ism_gain_is_edited[n] ) #endif - { - v_multc( data_separated_objects[n], st_ivas->hMasaIsmData->gain_ism_edited[n], data_separated_objects[n], *nSamplesRendered ); - } + { + v_multc( data_separated_objects[n], st_ivas->hMasaIsmData->gain_ism_edited[n], data_separated_objects[n], *nSamplesRendered ); } + } - /* Gain MASA part, if edited in G192. MASA gaining with VOIP is done in ivas_dec_prepare_renderer() */ - if ( !st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hMasaIsmData->masa_gain_is_edited ) + /* Gain MASA part, if edited in G192. MASA gaining with VOIP is done in ivas_dec_prepare_renderer() */ + if ( !st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hMasaIsmData->masa_gain_is_edited ) + { + for ( n = 0; n < CPE_CHANNELS; n++ ) { - for ( n = 0; n < CPE_CHANNELS; n++ ) - { - v_multc( output_f[n], st_ivas->hMasaIsmData->gain_masa_edited, output_f[n], *nSamplesRendered ); - } + v_multc( output_f[n], st_ivas->hMasaIsmData->gain_masa_edited, output_f[n], *nSamplesRendered ); } } + } subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 4c3c1157a..a0370f614 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -849,7 +849,7 @@ typedef struct TD_RINGBUF_HANDLE hMultiBinTdData; ISAR_CLDFB_RINGBUF_HANDLE hMultiBinCldfbData[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS]; #else - ISAR_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA_HANDLE hMultiBinCldfbData; /*scratch buffer for frame by frame processing*/ + ISAR_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA_HANDLE hMultiBinCldfbData; /*scratch buffer for frame by frame processing*/ #endif ISAR_SPLIT_REND_BITS_HANDLE hSplitRendBits; /*scratch buffer for frame by frame processing*/ SPLIT_REND_WRAPPER splitrend; @@ -957,16 +957,16 @@ typedef struct ivas_masa_ism_data_structure typedef struct decoder_tc_buffer_structure { float *tc_buffer_old[MAX_INTERN_CHANNELS]; /* TC audio samples not rendered in the previous frame */ - 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 */ + 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.h b/lib_dec/jbm_pcmdsp_apa.h index ad447279e..3fc00e972 100644 --- a/lib_dec/jbm_pcmdsp_apa.h +++ b/lib_dec/jbm_pcmdsp_apa.h @@ -52,7 +52,7 @@ /* size of IO buffers (a_in[], a_out[]) for apa_exec() */ #define APA_BUF_PER_CHANNEL ( IVAS_MAX_FRAME_SIZE * 2 ) /* == twice the max. frame length */ #define APA_MAX_NUM_CHANNELS ( 12 ) /* == MAX_TRANSPORT_CHANNELS */ -#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_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index ede3653f8..dd5e7c48e 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -368,7 +368,7 @@ int16_t ivas_get_nchan_buffers_dec( *-------------------------------------------------------------------*/ ivas_error ivas_output_buff_dec( - float *p_output_f[], /* i/o: output audio buffers */ + float *p_output_f[], /* i/o: output audio buffers */ const int16_t nchan_out_buff, /* i : number of output channels */ const int16_t Opt_tsm, /* i : TSM option flag */ DECODER_TC_BUFFER_HANDLE hTcBuffer /* i : TSM buffer handle */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index f1e13a709..22b9b0a5b 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -3954,7 +3954,7 @@ ivas_error IVAS_REND_AddInput( return IVAS_ERR_INVALID_INPUT_FORMAT; } - /* Find first free input in array corresponding to input type */ + /* Find first free input in array corresponding to input type */ if ( ( error = findFreeInputSlot( inputsArray, inputType, maxNumInputsOfType, &inputIndex ) ) != IVAS_ERR_OK ) { return error; -- GitLab