From 89018684fe70af430ecee2c9c8387cfb2958a67c Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:49:21 +0100 Subject: [PATCH 01/21] [cleanup] accept FIX_1320_STACK_CPE_DECODER --- lib_com/cnst.h | 2 - lib_com/options.h | 1 - lib_dec/dec_LPD_fx.c | 8 -- lib_dec/ivas_core_dec_fx.c | 91 ---------------- lib_dec/ivas_cpe_dec_fx.c | 182 -------------------------------- lib_dec/ivas_mdct_core_dec_fx.c | 16 --- lib_dec/ivas_tcx_core_dec_fx.c | 8 -- 7 files changed, 308 deletions(-) diff --git a/lib_com/cnst.h b/lib_com/cnst.h index 97dd19f18..ed4bd3f1e 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -668,9 +668,7 @@ enum #define ACELP_TCX_TRANS_NS 1250000 /* Duration of the ACELP->TCX overlap - 1.25 ms */ #define L_FRAME_MAX L_FRAME48k /* Max 20ms frame size @48kHz */ #define L_FRAME_PLUS 1200 /* Max frame size (long TCX frame) */ -#ifdef FIX_1320_STACK_CPE_DECODER #define L_FRAME_PLUS_INTERNAL 800 /* Max frame size (long TCX frame) at maximum internal sampling rate */ -#endif #define L_MDCT_OVLP_MAX NS2SA( 48000, ACELP_LOOK_NS ) /* = Max mdct overlap */ #define N_TCX10_MAX 480 /* Max size of TCX10 MDCT spectrum */ #define BITS_TEC 1 /* number of bits for TEC */ diff --git a/lib_com/options.h b/lib_com/options.h index 67f7d8cc9..6cf49d796 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -117,7 +117,6 @@ #define NONBE_1302_FIX_OMASA_JBM_FLUSH /* VA: issue 1302: fix OMASA JBM bitrate switching flush in binaural output */ #define NONBE_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0, float issue 1328 */ #define FIX_1319_STACK_SBA_DECODER /* VA: issue 1319: Optimize the definition of buffer lengths in the SBA decoder */ -#define FIX_1320_STACK_CPE_DECODER /* VA: issue 1320: Optimize the stack memory consumption in the CPE 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/dec_LPD_fx.c b/lib_dec/dec_LPD_fx.c index 6a06df267..de1e3ea0d 100644 --- a/lib_dec/dec_LPD_fx.c +++ b/lib_dec/dec_LPD_fx.c @@ -36,11 +36,7 @@ void decoder_LPD_fx( ) { Word16 *param_lpc; -#ifdef FIX_1320_STACK_CPE_DECODER Word16 synth_buf[OLD_SYNTH_INTERNAL_DEC + L_FRAME_PLUS_INTERNAL + M]; -#else - Word16 synth_buf[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; -#endif Word16 *synth; Word16 synth_bufFB[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; Word16 *synthFB; @@ -118,11 +114,7 @@ void decoder_LPD_fx( synth = synth_buf + hTcxDec->old_synth_len; /*st->old_synth: Q_0*/ Copy( hTcxDec->old_synth, synth_buf, hTcxDec->old_synth_len ); -#ifdef FIX_1320_STACK_CPE_DECODER set16_fx( synth, 0, L_FRAME_PLUS_INTERNAL + M ); -#else - set16_fx( synth, 0, L_FRAME_PLUS + M ); -#endif synthFB = synth_bufFB + hTcxDec->old_synth_lenFB; Copy( hTcxDec->old_synthFB_fx, synth_bufFB, hTcxDec->old_synth_lenFB ); diff --git a/lib_dec/ivas_core_dec_fx.c b/lib_dec/ivas_core_dec_fx.c index ae955c5ed..84f6391ac 100644 --- a/lib_dec/ivas_core_dec_fx.c +++ b/lib_dec/ivas_core_dec_fx.c @@ -76,12 +76,8 @@ ivas_error ivas_core_dec_fx( set16_fx( tmp_buffer_fx, 0, L_FRAME48k ); Word16 tmps, incr; -#ifdef FIX_1320_STACK_CPE_DECODER Word16 flag_bwe_bws, flaf_swb_tbe; Word32 *bwe_exc_extended_fx[CPE_CHANNELS] = { NULL, NULL }; -#else - Word32 bwe_exc_extended_fx[CPE_CHANNELS][L_FRAME32k + NL_BUFF_OFFSET]; -#endif Word16 voice_factors_fx[CPE_CHANNELS][NB_SUBFR16k]; // Q15 Word16 core_switching_flag[CPE_CHANNELS]; @@ -296,9 +292,7 @@ ivas_error ivas_core_dec_fx( set16_fx( voice_factors_fx[n], 0, NB_SUBFR16k ); set32_fx( hb_synth_32_fx[n], 0, L_FRAME48k ); set16_fx( hb_synth_16_fx[n], 0, L_FRAME48k ); -#ifdef FIX_1320_STACK_CPE_DECODER bwe_exc_extended_fx[n] = hb_synth_32_fx[n]; /* note: reuse the buffer */ -#endif /*------------------------------------------------------------------* * Decision matrix (selection of technologies) @@ -1003,7 +997,6 @@ ivas_error ivas_core_dec_fx( Word16 Q_input, Q_hb_synth_fx, Q_synth_fx; Word16 Q_syn_hb, sf; -#ifdef FIX_1320_STACK_CPE_DECODER flaf_swb_tbe = 0; move16(); test(); @@ -1019,7 +1012,6 @@ ivas_error ivas_core_dec_fx( flaf_swb_tbe = 1; move16(); } -#endif sf = getScaleFactor32( output_32_fx[n], L_FRAME48k ); @@ -1058,14 +1050,10 @@ ivas_error ivas_core_dec_fx( } /* Memories Re-Scaling */ -#ifdef FIX_1320_STACK_CPE_DECODER IF( !flaf_swb_tbe ) { -#endif Copy_Scale_sig_16_32_no_sat( hb_synth_16_fx[n], hb_synth_32_fx[n], L_FRAME48k, sub( Q11, Q_hb_synth_fx ) ); // Q11 -#ifdef FIX_1320_STACK_CPE_DECODER } -#endif Copy_Scale_sig_16_32_no_sat( output_16_fx[n], output_32_fx[n], L_FRAME48k, sub( Q11, Q_input ) ); // Q11 // Q_input can get value <= -5 Copy_Scale_sig_16_32_no_sat( synth_16_fx[n], synth_32_fx[n], output_frame, sub( Q11, Q_synth_fx ) ); // Q11 @@ -1083,42 +1071,19 @@ ivas_error ivas_core_dec_fx( * SWB(FB) BWE decoding *---------------------------------------------------------------------*/ -#ifdef FIX_1320_STACK_CPE_DECODER test(); test(); test(); test(); flag_bwe_bws = ( GE_32( output_Fs, 32000 ) && st->core == ACELP_CORE && st->bwidth > NB && st->bws_cnt > 0 && st->bfi == 0 ); move16(); -#endif Q_white_exc = 0; move16(); -#ifdef FIX_1320_STACK_CPE_DECODER test(); test(); IF( flaf_swb_tbe ) -#else - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - IF( EQ_16( st->extl, SWB_TBE ) || EQ_16( st->extl, FB_TBE ) || ( NE_16( st->coder_type, AUDIO ) && NE_16( st->coder_type, INACTIVE ) && GE_32( st->core_brate, SID_2k40 ) && EQ_16( st->core, ACELP_CORE ) && !st->con_tcx && GE_32( output_Fs, 32000 ) && GT_16( st->bwidth, NB ) && st->bws_cnt > 0 ) ) -#endif { /* SWB TBE decoder */ ivas_swb_tbe_dec_fx( st, hStereoICBWE, bwe_exc_extended_fx[n], st->Q_exc, voice_factors_fx[n], old_syn_12k8_16k_fx[n], tmp_buffer_fx /*fb_exc*/, hb_synth_32_fx[n], pitch_buf_fx[n], &Q_white_exc ); @@ -1139,11 +1104,7 @@ ivas_error ivas_core_dec_fx( fb_tbe_dec_ivas_fx( st, tmp_buffer_fx /*fb_exc*/, Q_white_exc, hb_synth_32_fx[n], 0, tmp_buffer_fx /*fb_synth_ref*/, Q_white_exc, output_frame ); } } -#ifdef FIX_1320_STACK_CPE_DECODER ELSE IF( EQ_16( st->extl, SWB_BWE ) || EQ_16( st->extl, FB_BWE ) || flag_bwe_bws ) -#else - ELSE IF( EQ_16( st->extl, SWB_BWE ) || EQ_16( st->extl, FB_BWE ) || ( GE_32( output_Fs, 32000 ) && st->core == ACELP_CORE && st->bwidth > NB && st->bws_cnt > 0 && !st->ppp_mode_dec && !( EQ_16( st->nelp_mode_dec, 1 ) && EQ_16( st->bfi, 1 ) ) ) ) -#endif { /* SWB BWE decoder */ Q_syn_hb = swb_bwe_dec_fx32( st, output_32_fx[n], synth_32_fx[n], hb_synth_32_fx[n], use_cldfb_for_dft, output_frame ); @@ -1153,7 +1114,6 @@ ivas_error ivas_core_dec_fx( Copy_Scale_sig_32_16( hBWE_FD->L_old_wtda_swb_fx32, hBWE_FD->L_old_wtda_swb_fx, output_frame, sub( hBWE_FD->old_wtda_swb_fx_exp, Q11 ) ); // old_wtda_swb_fx_exp } -#ifdef FIX_1320_STACK_CPE_DECODER test(); test(); test(); @@ -1161,7 +1121,6 @@ ivas_error ivas_core_dec_fx( { set32_fx( hb_synth_32_fx[n], 0, L_FRAME48k ); } -#endif /*---------------------------------------------------------------------* * FEC - recovery after lost HQ core (smoothing of the BWE component) @@ -1253,38 +1212,6 @@ ivas_error ivas_core_dec_fx( } } -#ifndef FIX_1320_STACK_CPE_DECODER - IF( EQ_16( st->element_mode, EVS_MONO ) ) - { - /*----------------------------------------------------------------* - * BFI waveform adjustment - *----------------------------------------------------------------*/ - - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - IF( EQ_16( st->core, ACELP_CORE ) && !st->bfi && st->prev_bfi && GE_32( st->last_total_brate, HQ_48k ) && EQ_16( st->last_codec_mode, MODE2 ) && ( EQ_16( st->last_core_bfi, TCX_20_CORE ) || EQ_16( st->last_core_bfi, TCX_10_CORE ) ) && EQ_16( st->hPlcInfo->concealment_method, TCX_NONTONAL ) && LT_16( st->hPlcInfo->nbLostCmpt, 4 ) ) - { - tmps = NS2SA_FX2( output_Fs, DELAY_CLDFB_NS ); - IF( st->hTonalMDCTConc->q_lastPcmOut != 0 ) - { - Scale_sig( st->hTonalMDCTConc->secondLastPcmOut, shr( st->hPlcInfo->L_frameTCX, 1 ), negate( st->hTonalMDCTConc->q_lastPcmOut ) ); - Scale_sig( st->hTonalMDCTConc->lastPcmOut, st->hPlcInfo->L_frameTCX, negate( st->hTonalMDCTConc->q_lastPcmOut ) ); - st->hTonalMDCTConc->q_lastPcmOut = 0; - move16(); - } - waveform_adj2_fix( st->hPlcInfo, st->hTonalMDCTConc->secondLastPcmOut, synth_16_fx[n] + tmps, tmps, add( st->hPlcInfo->nbLostCmpt, 1 ), st->bfi ); - - st->hPlcInfo->Pitch_fx = 0; - move16(); - } - } -#endif /*----------------------------------------------------------------* * Transition and synchronization of BWE components *----------------------------------------------------------------*/ @@ -1303,21 +1230,8 @@ ivas_error ivas_core_dec_fx( } ELSE { -#ifndef FIX_1320_STACK_CPE_DECODER - test(); - IF( EQ_16( st->extl, SWB_BWE_HIGHRATE ) || EQ_16( st->extl, FB_BWE_HIGHRATE ) ) - { - /* HR SWB BWE on top of ACELP@16kHz */ - tmps = NS2SA_FX2( output_Fs, DELAY_BWE_TOTAL_NS ); - } - ELSE - { -#endif /* TBE on top of ACELP@16kHz */ tmps = NS2SA_FX2( 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 */ @@ -1542,12 +1456,7 @@ ivas_error ivas_core_dec_fx( test(); test(); test(); -#ifdef FIX_1320_STACK_CPE_DECODER IF( st->hTcxDec != NULL && ( ( ( st->core == ACELP_CORE ) && !( EQ_16( st->bfi, 1 ) && EQ_16( st->con_tcx, 1 ) ) ) || EQ_16( st->core, HQ_CORE ) ) ) -#else - test(); - IF( ( EQ_16( st->codec_mode, MODE1 ) && st->hTcxDec != NULL ) && ( ( ( st->core == ACELP_CORE ) && !( EQ_16( st->bfi, 1 ) && EQ_16( st->con_tcx, 1 ) ) ) || EQ_16( st->core, HQ_CORE ) ) ) -#endif { Word16 exp_prev_synth_buffer = 0, exp_old_out = 0, exp_delay_buf_out = 0, exp_ouput = 0, exp_synth_history = 0; move16(); diff --git a/lib_dec/ivas_cpe_dec_fx.c b/lib_dec/ivas_cpe_dec_fx.c index 3b6f9d91f..d98255d14 100644 --- a/lib_dec/ivas_cpe_dec_fx.c +++ b/lib_dec/ivas_cpe_dec_fx.c @@ -51,9 +51,7 @@ static void read_stereo_mode_and_bwidth_fx( CPE_DEC_HANDLE hCPE, const Decoder_S static void stereo_mode_combined_format_dec_fx( 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 Word32 ivas_total_brate, const Word16 n_channels, Word32 *p_res_buf_fx, Word32 *output[], Word32 outputHB[][L_FRAME48k], const Word16 output_frame, const Word32 output_Fs ); -#endif /*--------------------------------------------------------------------------* @@ -75,12 +73,7 @@ ivas_error ivas_cpe_dec_fx( Word16 last_bwidth; Word16 tdm_ratio_idx; Word32 outputHB_fx[CPE_CHANNELS][L_FRAME48k]; /* buffer for output HB synthesis, both channels */ /* Q11 */ -#ifdef FIX_1320_STACK_CPE_DECODER Word32 *res_buf_fx = NULL; /* Q8 */ -#else - Word16 q_res_buf; - Word32 res_buf_fx[STEREO_DFT_N_8k]; /* Q(q_res_buf) */ -#endif CPE_DEC_HANDLE hCPE; STEREO_DFT_CONFIG_DATA_HANDLE hConfigDft; Decoder_State **sts; @@ -91,10 +84,6 @@ ivas_error ivas_cpe_dec_fx( error = IVAS_ERR_OK; move32(); -#ifndef FIX_1320_STACK_CPE_DECODER - q_res_buf = Q8; - move16(); -#endif push_wmops( "ivas_cpe_dec" ); @@ -353,10 +342,8 @@ ivas_error ivas_cpe_dec_fx( } ELSE { -#ifdef FIX_1320_STACK_CPE_DECODER res_buf_fx = outputHB_fx[0]; /* note: temporarily reused buffer */ -#endif test(); IF( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) || EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) { @@ -619,177 +606,10 @@ ivas_error ivas_cpe_dec_fx( test(); IF( EQ_16( hCPE->element_mode, IVAS_CPE_DFT ) && !( EQ_16( hCPE->nchan_out, 1 ) && EQ_16( hConfigDft->res_cod_mode, STEREO_DFT_RES_COD_OFF ) ) ) { -#ifdef FIX_1320_STACK_CPE_DECODER IF( NE_32( ( error = stereo_dft_dec_main( hCPE, ivas_total_brate, n_channels, res_buf_fx, output, outputHB_fx, output_frame, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) ) { return error; } -#else - Word32 DFT_fx[CPE_CHANNELS][STEREO_DFT_BUF_MAX]; // q_dft - set32_fx( DFT_fx[0], 0, STEREO_DFT_BUF_MAX ); - set32_fx( DFT_fx[1], 0, STEREO_DFT_BUF_MAX ); - - /* core decoder */ - IF( NE_32( ( error = ivas_core_dec_fx( NULL, NULL, hCPE, st_ivas->hMCT, n_channels, output, outputHB_fx, DFT_fx, 0 ) ), IVAS_ERR_OK ) ) - { - return error; - } - - // Scaling of DFT's - Word16 shift; - Word32 tmp1, tmp2; - Word16 shift1, shift2; - maximum_abs_32_fx( DFT_fx[0], STEREO_DFT_BUF_MAX, &tmp1 ); - maximum_abs_32_fx( DFT_fx[1], STEREO_DFT_BUF_MAX, &tmp2 ); - - IF( tmp1 == 0 ) - { - shift1 = Q31; - move16(); - } - ELSE - { - shift1 = norm_l( tmp1 ); - } - IF( tmp2 == 0 ) - { - shift2 = Q31; - move16(); - } - ELSE - { - shift2 = norm_l( tmp2 ); - } - shift = s_min( shift1, shift2 ); - - IF( NE_16( shift, 31 ) ) - { - shift = sub( add( hCPE->hStereoDft->q_dft, shift ), Q17 ); /* Q17 for guard bits */ - - IF( GT_16( shift, hCPE->hStereoDft->q_dft ) ) - { - Scale_sig32( DFT_fx[0], STEREO_DFT_BUF_MAX, sub( shift, hCPE->hStereoDft->q_dft ) ); // shift - Scale_sig32( DFT_fx[1], STEREO_DFT_BUF_MAX, sub( shift, hCPE->hStereoDft->q_dft ) ); // shift - hCPE->hStereoDft->q_dft = shift; - move16(); - } - } - ELSE - { - hCPE->hStereoDft->q_dft = Q8; - move16(); - } - - /* DFT Stereo residual decoding */ - test(); - IF( hCPE->hStereoDft->res_cod_band_max > 0 && !st_ivas->bfi ) - { - Word16 q; - Word16 q_out_DFT[2]; - - q = Q11; - move16(); - - Copy_Scale_sig_32_16( hCPE->hCoreCoder[0]->old_pitch_buf_fx, hCPE->hCoreCoder[0]->old_pitch_buf_16_fx, ( ( 2 * NB_SUBFR16k ) + 2 ), -( Q10 ) ); // Q16->Q6 - - stereo_dft_dec_res_fx( hCPE, res_buf_fx, q_res_buf, output[1] ); - - Copy_Scale_sig_16_32_DEPREC( hCPE->hCoreCoder[0]->old_pitch_buf_16_fx, hCPE->hCoreCoder[0]->old_pitch_buf_fx, ( ( 2 * NB_SUBFR16k ) + 2 ), 10 ); // Q6->Q16 - - Scale_sig32( output[1], L_FRAME8k, ( Q11 - Q15 ) ); // Q15 -> Q11 - - q_out_DFT[0] = q_out_DFT[1] = hCPE->hStereoDft->q_dft; - move16(); - move16(); - - stereo_dft_dec_analyze_fx( hCPE, output[1], DFT_fx, 1, L_FRAME8k, output_frame, DFT_STEREO_DEC_ANA_LB, 0, 0, &q, q_out_DFT ); - - Scale_sig32( DFT_fx[1], STEREO_DFT_BUF_MAX, sub( hCPE->hStereoDft->q_dft, q_out_DFT[1] ) ); // q_dft - } - - /* DFT stereo CNG */ - { - Word16 q_dft; - - q_dft = hCPE->hStereoDft->q_dft; - move16(); - - stereo_dtf_cng_fx( hCPE, ivas_total_brate, DFT_fx, output_frame, q_dft ); - } - - /* decoding */ - IF( EQ_16( hCPE->nchan_out, 1 ) ) - { - IF( EQ_16( hCPE->hStereoDft->first_frame, 1 ) ) - { - hCPE->hStereoDft->q_smoothed_nrg = hCPE->hStereoDft->q_dft; - move16(); - FOR( Word16 ii = 0; ii < (Word16) ( sizeof( hCPE->hStereoDft->q_DFT_past_DMX_fx ) / sizeof( hCPE->hStereoDft->q_DFT_past_DMX_fx[0] ) ); ii++ ) - { - hCPE->hStereoDft->q_DFT_past_DMX_fx[ii] = hCPE->hStereoDft->q_dft; - move16(); - } - hCPE->hStereoDft->first_frame = 0; - move16(); - } - - scale_sig32( hCPE->hStereoDft->res_cod_mem_fx, STEREO_DFT_OVL_8k, sub( hCPE->hStereoDft->q_dft, hCPE->hStereoDft->q_res_cod_mem_fx ) ); // q_dft - hCPE->hStereoDft->q_res_cod_mem_fx = hCPE->hStereoDft->q_dft; - move16(); - stereo_dft_unify_dmx_fx( hCPE->hStereoDft, sts[0], DFT_fx, hCPE->input_mem_fx[1], hCPE->hStereoCng->prev_sid_nodata ); - scale_sig32( hCPE->hStereoDft->res_cod_mem_fx, STEREO_DFT_OVL_8k, sub( Q15, hCPE->hStereoDft->q_res_cod_mem_fx ) ); // Q15 - hCPE->hStereoDft->q_res_cod_mem_fx = Q15; - move16(); - } - ELSE - { - { - IF( EQ_16( hCPE->hStereoDft->first_frame, 1 ) ) - { - hCPE->hStereoDft->q_smoothed_nrg = hCPE->hStereoDft->q_dft; - move16(); - FOR( Word16 ii = 0; ii < (Word16) ( sizeof( hCPE->hStereoDft->q_DFT_past_DMX_fx ) / sizeof( hCPE->hStereoDft->q_DFT_past_DMX_fx[0] ) ); ii++ ) - { - hCPE->hStereoDft->q_DFT_past_DMX_fx[ii] = hCPE->hStereoDft->q_dft; - move16(); - } - hCPE->hStereoDft->first_frame = 0; - move16(); - } - - scale_sig32( hCPE->hStereoDft->res_cod_mem_fx, STEREO_DFT_OVL_8k, sub( hCPE->hStereoDft->q_dft, hCPE->hStereoDft->q_res_cod_mem_fx ) ); // q_dft - hCPE->hStereoDft->q_res_cod_mem_fx = hCPE->hStereoDft->q_dft; - move16(); - } - stereo_dft_dec_fx( hCPE->hStereoDft, sts[0], DFT_fx, hCPE->input_mem_fx[1], hCPE->hStereoCng, 0, 0, 0, 0, 0, 0, MAX_PARAM_SPATIAL_SUBFRAMES ); - scale_sig32( hCPE->hStereoDft->res_cod_mem_fx, STEREO_DFT_OVL_8k, sub( Q15, hCPE->hStereoDft->q_res_cod_mem_fx ) ); // Q15 - hCPE->hStereoDft->q_res_cod_mem_fx = Q15; - move16(); - } - - FOR( n = 0; n < hCPE->nchan_out; n++ ) - { - Scale_sig32( output[n], L_FRAME48k, sub( hCPE->hStereoDft->q_dft, Q11 ) ); // q_dft - scale_sig32( hCPE->output_mem_fx[n], NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, STEREO_DFT32MS_OVL_NS ), sub( hCPE->hStereoDft->q_dft, Q11 ) ); // q_dft - hCPE->q_output_mem_fx[n] = hCPE->hStereoDft->q_dft; - move16(); - } - - /* synthesis iFFT */ - FOR( n = 0; n < hCPE->nchan_out; n++ ) - { - stereo_dft_dec_synthesize_fx( hCPE, DFT_fx, n, output[n], output_frame ); - } - - // delete below - FOR( n = 0; n < hCPE->nchan_out; n++ ) - { - Scale_sig32( output[n], L_FRAME48k, sub( Q11, hCPE->hStereoDft->q_dft ) ); // Q11 - scale_sig32( hCPE->output_mem_fx[n], NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, STEREO_DFT32MS_OVL_NS ), sub( Q11, hCPE->hStereoDft->q_dft ) ); // Q11 - hCPE->q_output_mem_fx[n] = Q11; - move16(); - } -#endif } ELSE IF( EQ_16( hCPE->element_mode, IVAS_CPE_TD ) ) { @@ -893,7 +713,6 @@ ivas_error ivas_cpe_dec_fx( return error; } -#ifdef FIX_1320_STACK_CPE_DECODER /*------------------------------------------------------------------------- * stereo_dft_dec_main() @@ -1099,7 +918,6 @@ static ivas_error stereo_dft_dec_main( return IVAS_ERR_OK; } -#endif /*------------------------------------------------------------------------- * create_cpe_dec_fx() diff --git a/lib_dec/ivas_mdct_core_dec_fx.c b/lib_dec/ivas_mdct_core_dec_fx.c index b95125885..be931598e 100644 --- a/lib_dec/ivas_mdct_core_dec_fx.c +++ b/lib_dec/ivas_mdct_core_dec_fx.c @@ -1104,11 +1104,7 @@ void ivas_mdct_core_reconstruct_fx( Word16 L_frame_global[CPE_CHANNELS], L_frame_globalTCX[CPE_CHANNELS]; /* Synth */ -#ifdef FIX_1320_STACK_CPE_DECODER Word16 synth_buf_fx[OLD_SYNTH_INTERNAL_DEC + L_FRAME_PLUS_INTERNAL + M]; -#else - Word16 synth_buf_fx[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; -#endif Word16 *synth_fx; Word16 synth_bufFB_fx[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; Word16 *synthFB_fx; @@ -1179,11 +1175,7 @@ void ivas_mdct_core_reconstruct_fx( } q_syn = st->hTcxDec->q_old_synth; move16(); -#ifdef FIX_1320_STACK_CPE_DECODER set16_fx( synth_fx, 0, L_FRAME_PLUS_INTERNAL + M ); -#else - set16_fx( synth_fx, 0, L_FRAME_PLUS + M ); -#endif set16_fx( synthFB_fx, 0, L_FRAME_PLUS + M ); IF( st->core != ACELP_CORE ) { @@ -1273,11 +1265,7 @@ void ivas_mdct_core_reconstruct_fx( // norm(synth_buf) >= q_syn - q_win // norm(synth_buf) + q_win >= q_syn -#ifdef FIX_1320_STACK_CPE_DECODER sf = s_min( getScaleFactor16( synth_buf_fx, add( add( st->hTcxDec->old_synth_len, L_FRAME_PLUS_INTERNAL ), M ) ), getScaleFactor16( synth_bufFB_fx, add( add( st->hTcxDec->old_synth_lenFB, L_FRAME_PLUS ), M ) ) ); -#else - sf = s_min( getScaleFactor16( synth_buf_fx, add( add( st->hTcxDec->old_synth_len, L_FRAME_PLUS ), M ) ), getScaleFactor16( synth_bufFB_fx, add( add( st->hTcxDec->old_synth_lenFB, L_FRAME_PLUS ), M ) ) ); -#endif q_syn = add( sub( sf, 1 ), s_min( q_win, q_winFB ) ); st->Q_syn = q_syn; move16(); @@ -1287,11 +1275,7 @@ void ivas_mdct_core_reconstruct_fx( sf = s_min( getScaleFactor16( st->hHQ_core->old_out_fx, L_FRAME48k ), getScaleFactor16( st->hHQ_core->old_out_LB_fx, L_FRAME32k ) ); st->Q_syn = add( sf, s_min( q_win, q_winFB ) ); -#ifdef FIX_1320_STACK_CPE_DECODER Scale_sig( synth_buf_fx, add( add( st->hTcxDec->old_synth_len, L_FRAME_PLUS_INTERNAL ), M ), sub( q_syn, q_win ) ); // st->hTcxDec->q_old_synth -> q_syn -#else - Scale_sig( synth_buf_fx, add( add( st->hTcxDec->old_synth_len, L_FRAME_PLUS ), M ), sub( q_syn, q_win ) ); // st->hTcxDec->q_old_synth -> q_syn -#endif Scale_sig( synth_bufFB_fx, add( add( st->hTcxDec->old_synth_lenFB, L_FRAME_PLUS ), M ), sub( q_syn, q_winFB ) ); // st->hTcxDec->q_old_synth -> q_syn // Scale_sig( st->syn, M + 1, add( st->Q_syn, 2 ) ); Scale_sig( st->syn, M + 1, sub( st->Q_syn, q_win ) ); diff --git a/lib_dec/ivas_tcx_core_dec_fx.c b/lib_dec/ivas_tcx_core_dec_fx.c index 6ee4bfe18..e24c76951 100644 --- a/lib_dec/ivas_tcx_core_dec_fx.c +++ b/lib_dec/ivas_tcx_core_dec_fx.c @@ -226,11 +226,7 @@ void stereo_tcx_core_dec_fx( Word16 pit_gain_fx[NB_SUBFR16k]; /*Synth*/ -#ifdef FIX_1320_STACK_CPE_DECODER Word16 synth_buf_fx[OLD_SYNTH_INTERNAL_DEC + L_FRAME_PLUS_INTERNAL + M]; -#else - Word16 synth_buf_fx[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; -#endif Word16 *synth_fx; Word16 synth_bufFB_fx[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; Word16 *synthFB_fx; @@ -305,11 +301,7 @@ void stereo_tcx_core_dec_fx( synthFB_fx = synth_bufFB_fx + hTcxDec->old_synth_lenFB; Copy_Scale_sig( hTcxDec->old_synth, synth_buf_fx, hTcxDec->old_synth_len, negate( st->Q_syn ) ); /* q_old_synth - st->Q_syn */ Copy( hTcxDec->old_synthFB_fx, synth_bufFB_fx, hTcxDec->old_synth_lenFB ); /* q_old_synthFB */ -#ifdef FIX_1320_STACK_CPE_DECODER set16_fx( synth_fx, 0, L_FRAME_PLUS_INTERNAL + M ); -#else - set16_fx( synth_fx, 0, L_FRAME_PLUS + M ); -#endif set16_fx( synthFB_fx, 0, L_FRAME_PLUS + M ); /*--------------------------------------------------------------------------------* -- GitLab From 4d598b9db7f71248b9e21b0ad40f9412ba1d01e9 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:49:24 +0100 Subject: [PATCH 02/21] [cleanup] accept FIX_NCHAN_BUFFERS --- lib_com/options.h | 1 - lib_dec/ivas_init_dec_fx.c | 4 - lib_dec/ivas_jbm_dec_fx.c | 4 - lib_dec/ivas_masa_dec_fx.c | 10 -- lib_dec/ivas_mct_dec_fx.c | 5 - lib_dec/ivas_sba_dec_fx.c | 2 - .../ivas_dirac_dec_binaural_functions_fx.c | 5 - lib_rend/ivas_output_init_fx.c | 146 ------------------ 8 files changed, 177 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6cf49d796..4ddcba5fa 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -133,7 +133,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_fx.c b/lib_dec/ivas_init_dec_fx.c index 984f02ece..6de48e51d 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -3222,12 +3222,8 @@ ivas_error ivas_init_decoder_fx( return error; } #else -#ifdef FIX_NCHAN_BUFFERS k = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, ivas_total_brate ); FOR( n = 0; n < k; n++ ) -#else - FOR( n = 0; n < ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, ivas_total_brate ); n++ ) -#endif { /* note: these are intra-frame heap memories */ IF( ( st_ivas->p_output_fx[n] = (Word32 *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( Word32 ) ) ) == NULL ) diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 853ea9aac..e4fe38732 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -1661,16 +1661,12 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( move16(); } -#ifdef FIX_NCHAN_BUFFERS #ifdef JBM_MEMORY_OPT ch = s_max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); #else ch = ivas_get_nchan_buffers_dec_fx( 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_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) -#endif { hTcBuffer->tc_fx[n] = st_ivas->p_output_fx[n]; /* note: buffers needed in the TD decorellator */ move16(); diff --git a/lib_dec/ivas_masa_dec_fx.c b/lib_dec/ivas_masa_dec_fx.c index 2b6ccf1ef..6f1385062 100644 --- a/lib_dec/ivas_masa_dec_fx.c +++ b/lib_dec/ivas_masa_dec_fx.c @@ -1689,12 +1689,10 @@ ivas_error ivas_masa_dec_reconfigure_fx( Decoder_State **sts; UWord32 ivas_total_brate, last_ivas_total_brate; Word16 numCldfbAnalyses_old, numCldfbSyntheses_old; -#ifdef FIX_NCHAN_BUFFERS #ifdef FIX_1330_JBM_MEMORY Word16 nchan_out_buff; #else Word16 nchan_out_buff_old, nchan_out_buff; -#endif #endif ivas_error error; Word32 ism_total_brate; @@ -1704,10 +1702,8 @@ ivas_error ivas_masa_dec_reconfigure_fx( move32(); last_ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate; move32(); -#ifdef FIX_NCHAN_BUFFERS #ifndef FIX_1330_JBM_MEMORY nchan_out_buff_old = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); -#endif #endif test(); @@ -1976,7 +1972,6 @@ ivas_error ivas_masa_dec_reconfigure_fx( } ELSE { -#ifdef FIX_NCHAN_BUFFERS tc_nchan_to_allocate = BINAURAL_CHANNELS; move16(); test(); @@ -1985,9 +1980,6 @@ ivas_error ivas_masa_dec_reconfigure_fx( tc_nchan_to_allocate = 2 * BINAURAL_CHANNELS; move16(); } -#else - tc_nchan_to_allocate = shl( BINAURAL_CHANNELS, 1 ); -#endif } test(); @@ -2054,7 +2046,6 @@ ivas_error ivas_masa_dec_reconfigure_fx( } } -#ifdef FIX_NCHAN_BUFFERS /*-----------------------------------------------------------------* * output audio buffers *-----------------------------------------------------------------*/ @@ -2073,7 +2064,6 @@ ivas_error ivas_masa_dec_reconfigure_fx( } } -#endif return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_mct_dec_fx.c b/lib_dec/ivas_mct_dec_fx.c index 8970a0820..86313996d 100644 --- a/lib_dec/ivas_mct_dec_fx.c +++ b/lib_dec/ivas_mct_dec_fx.c @@ -1555,7 +1555,6 @@ static ivas_error ivas_mc_dec_reconfig_fx( test(); IF( EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) || EQ_16( st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC ) ) { -#ifdef FIX_NCHAN_BUFFERS tc_nchan_allocate_new = BINAURAL_CHANNELS; move16(); test(); @@ -1568,10 +1567,6 @@ static ivas_error ivas_mc_dec_reconfig_fx( { tc_nchan_allocate_new = add( tc_nchan_allocate_new, 1 ); } -#else - tc_nchan_allocate_new = BINAURAL_CHANNELS * 2; - move16(); -#endif tc_nchan_full_new = tc_nchan_allocate_new; move16(); } diff --git a/lib_dec/ivas_sba_dec_fx.c b/lib_dec/ivas_sba_dec_fx.c index 793ed74d4..e8dab7dc4 100644 --- a/lib_dec/ivas_sba_dec_fx.c +++ b/lib_dec/ivas_sba_dec_fx.c @@ -849,7 +849,6 @@ ivas_error ivas_sba_dec_render_fx( hSpatParamRendCom = st_ivas->hSpatParamRendCom; nchan_internal = ivas_sba_get_nchan_metadata_fx( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); nchan_out = add( st_ivas->hIntSetup.nchan_out_woLFE, st_ivas->hIntSetup.num_lfe ); /*Q0*/ -#ifdef FIX_NCHAN_BUFFERS IF( EQ_32( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) ) { nchan_out = s_max( nchan_internal, st_ivas->hDecoderConfig->nchan_out ); @@ -868,7 +867,6 @@ ivas_error ivas_sba_dec_render_fx( } nchan_out = s_min( nchan_out, ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ) ); -#endif FOR( ch = 0; ch < nchan_out; ch++ ) { output_fx_local[ch] = output_fx[ch]; /*Q11*/ diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index 705b52fdb..083ea15f3 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -371,7 +371,6 @@ ivas_error ivas_dirac_dec_init_binaural_data_fx( Word16 nchan_to_allocate; Word16 n_samples_granularity; -#ifdef FIX_NCHAN_BUFFERS nchan_to_allocate = BINAURAL_CHANNELS; move16(); IF( st_ivas->hDiracDecBin[0] != NULL && st_ivas->hDiracDecBin[0]->useTdDecorr ) @@ -383,10 +382,6 @@ ivas_error ivas_dirac_dec_init_binaural_data_fx( { nchan_to_allocate = add( nchan_to_allocate, 1 ); } -#else - nchan_to_allocate = 2 * BINAURAL_CHANNELS; - move16(); -#endif if ( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) { nchan_to_allocate = add( BINAURAL_CHANNELS, st_ivas->nchan_ism ); diff --git a/lib_rend/ivas_output_init_fx.c b/lib_rend/ivas_output_init_fx.c index 5969fac17..e3cdefad5 100644 --- a/lib_rend/ivas_output_init_fx.c +++ b/lib_rend/ivas_output_init_fx.c @@ -318,11 +318,7 @@ Word16 ivas_get_nchan_buffers_dec_fx( output_config = st_ivas->hDecoderConfig->output_config; move16(); -#ifdef FIX_NCHAN_BUFFERS nchan_out_buff = st_ivas->nchan_transport; -#else - nchan_out_buff = MAX_OUTPUT_CHANNELS; -#endif move16(); IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) ) @@ -336,7 +332,6 @@ Word16 ivas_get_nchan_buffers_dec_fx( } ELSE IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) { -#ifdef FIX_NCHAN_BUFFERS nchan_out_buff = s_max( st_ivas->hDecoderConfig->nchan_out, st_ivas->nchan_ism ); test(); @@ -344,49 +339,16 @@ Word16 ivas_get_nchan_buffers_dec_fx( { nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); } -#else - nchan_out_buff = st_ivas->nchan_ism; - move16(); - - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); - } - ELSE IF( NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - nchan_out_buff = s_max( audioCfg2channels( st_ivas->transport_config ), audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( output_config ) ); - } -#endif } ELSE IF( EQ_32( st_ivas->ivas_format, SBA_FORMAT ) ) { -#ifdef FIX_NCHAN_BUFFERS Word16 nchan_internal; nchan_internal = ivas_sba_get_nchan_metadata_fx( sba_analysis_order, ivas_total_brate ); nchan_out_buff = s_max( nchan_internal, st_ivas->hDecoderConfig->nchan_out ); -#else - Word16 nchan_internal; - nchan_internal = ivas_sba_get_nchan_metadata_fx( sba_analysis_order, ivas_total_brate ); - nchan_out_buff = st_ivas->hDecoderConfig->nchan_out; - move16(); - - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); - } - ELSE IF( NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - nchan_out_buff = s_max( audioCfg2channels( st_ivas->transport_config ), audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( output_config ) ); - } - nchan_out_buff = s_max( nchan_out_buff, nchan_internal ); -#endif } ELSE IF( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) ) { -#ifdef FIX_NCHAN_BUFFERS nchan_out_buff = s_max( st_ivas->hDecoderConfig->nchan_out, st_ivas->nchan_transport ); test(); @@ -395,64 +357,13 @@ Word16 ivas_get_nchan_buffers_dec_fx( nchan_out_buff = 2 * BINAURAL_CHANNELS; move16(); } -#else - nchan_out_buff = CPE_CHANNELS; - move16(); - - test(); - test(); - test(); - test(); - test(); - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); - } - ELSE IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || - EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) - { - nchan_out_buff = shl( CPE_CHANNELS, 1 ); - } - ELSE IF( NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( output_config ) ); - } - test(); - test(); - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) && GT_16( st_ivas->nchan_ism, 0 ) && LT_16( st_ivas->nchan_ism, 5 ) ) /* Last condition needed only in BASOP */ - { - nchan_out_buff = add( st_ivas->nchan_ism, CPE_CHANNELS ); - } -#endif } ELSE IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) { -#ifdef FIX_NCHAN_BUFFERS nchan_out_buff = s_max( st_ivas->hDecoderConfig->nchan_out, add( st_ivas->nchan_transport, st_ivas->nchan_ism ) ); -#else - nchan_out_buff = add( st_ivas->nchan_ism, CPE_CHANNELS ); - - test(); - test(); - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); - } - ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) || EQ_32( st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( BINAURAL_CHANNELS, st_ivas->nchan_ism ) ); - } - ELSE IF( NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( output_config ) ); - } -#endif } ELSE IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) { -#ifdef FIX_NCHAN_BUFFERS Word16 nchan_internal; nchan_internal = ivas_sba_get_nchan_metadata_fx( sba_analysis_order, ivas_total_brate ); @@ -473,51 +384,9 @@ Word16 ivas_get_nchan_buffers_dec_fx( { nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); } -#else - Word16 nchan_internal; - nchan_internal = ivas_sba_get_nchan_metadata_fx( sba_analysis_order, ivas_total_brate ); - nchan_out_buff = add( st_ivas->nchan_ism, st_ivas->nchan_transport ); - - IF( st_ivas->hMCT != NULL ) - { - nchan_out_buff = shl( shr( add( nchan_out_buff, 1 ), 1 ), 1 ); /* ensure odd number of channels in MCT */ - } - - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); - } - ELSE IF( NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( output_config ) ); - - test(); - IF( EQ_32( st_ivas->renderer_type, RENDERER_OSBA_AMBI ) || EQ_32( st_ivas->renderer_type, RENDERER_OSBA_LS ) ) - { - nchan_out_buff = s_max( add( nchan_out_buff, st_ivas->nchan_ism ), audioCfg2channels( output_config ) ); /* needed for ivas_sba_upmixer_renderer() */ - } - ELSE - { - nchan_out_buff = s_max( add( 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( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - nchan_out_buff = add( st_ivas->hDecoderConfig->nchan_out, st_ivas->nchan_ism ); /*take into account sba_ch_idx' in ivas_dec() */ - } - - test(); - IF( !( EQ_32( output_config, IVAS_AUDIO_CONFIG_MONO ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( nchan_internal, st_ivas->nchan_ism ) ); - } - nchan_out_buff = s_min( nchan_out_buff, MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS ); -#endif } ELSE IF( EQ_32( 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 ) @@ -534,19 +403,6 @@ Word16 ivas_get_nchan_buffers_dec_fx( { nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); } -#else - nchan_out_buff = st_ivas->hDecoderConfig->nchan_out; - - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) - { - nchan_out_buff = s_max( nchan_out_buff, add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ) ); - } - ELSE IF( NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - nchan_out_buff = s_max( audioCfg2channels( st_ivas->transport_config ), audioCfg2channels( st_ivas->intern_config ) ); - nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( output_config ) ); - } -#endif } test(); @@ -646,13 +502,11 @@ ivas_error ivas_output_buff_dec_fx( { FOR( ch = nchan_out_buff_old; ch < nchan_out_buff; ch++ ) { -#ifdef FIX_NCHAN_BUFFERS #ifdef DEBUGGING if ( p_output_fx[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_fx[ch] = (Word32 *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( Word32 ) ) ) == NULL ) -- GitLab From cc5a7487e89706c496e195db7560a67f99d0f9cd Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:49:27 +0100 Subject: [PATCH 03/21] [cleanup] accept FIX_RENDERER_STACK --- lib_com/options.h | 1 - lib_dec/ivas_dirac_dec_fx.c | 23 ------------------- .../ivas_dirac_dec_binaural_functions_fx.c | 21 ----------------- 3 files changed, 45 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 4ddcba5fa..7963acd2c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -133,7 +133,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_fx.c b/lib_dec/ivas_dirac_dec_fx.c index e00d4e351..b68f6fd6b 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -2076,12 +2076,8 @@ void ivas_dirac_dec_render_fx( move16(); SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; Word32 *output_fx_local[MAX_OUTPUT_CHANNELS]; -#ifdef FIX_RENDERER_STACK Word32 *p_output_fx[MAX_OUTPUT_CHANNELS]; Word32 output_fx_local_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; -#else - Word32 output_fx_local_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k] = { 0 }; -#endif hSpatParamRendCom = st_ivas->hSpatParamRendCom; @@ -2089,11 +2085,7 @@ void ivas_dirac_dec_render_fx( FOR( ch = 0; ch < nchan_intern; ch++ ) { output_fx_local[ch] = output_fx_local_buff[ch]; -#ifdef FIX_RENDERER_STACK p_output_fx[ch] = output_fx[ch]; -#else - set_zero_fx( output_fx_local[ch], nSamplesAsked ); -#endif } slot_size = NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); // cL @@ -2122,7 +2114,6 @@ void ivas_dirac_dec_render_fx( FOR( ch = 0; ch < nchan_intern; ch++ ) { -#ifdef FIX_RENDERER_STACK /* move to output */ test(); test(); @@ -2132,26 +2123,12 @@ void ivas_dirac_dec_render_fx( } p_output_fx[ch] += n_samples_sf; -#else - output_fx_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++ ) - { - test(); - test(); - IF( !( ( st_ivas->hDirACRend->hOutSetup.separateChannelEnabled ) && ( ( EQ_16( st_ivas->hDirACRend->hOutSetup.separateChannelIndex, ch ) || EQ_16( add( st_ivas->hDirACRend->hOutSetup.separateChannelIndex, 1 ), ch ) ) ) ) ) - { - Copy32( output_fx_local_buff[ch], output_fx[ch], *nSamplesRendered ); - } - } -#endif /* clang-format off */ IF( EQ_16( hSpatParamRendCom->slots_rendered, hSpatParamRendCom->num_slots ) ) { diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index 083ea15f3..9683cd743 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -512,21 +512,13 @@ void ivas_dirac_dec_binaural_render_fx( UWord16 nchan_out; SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; Word32 *output_fx_local[MAX_OUTPUT_CHANNELS]; -#ifndef FIX_RENDERER_STACK - Word32 output_fx_local_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k]; - Word16 output_length; -#endif hSpatParamRendCom = st_ivas->hSpatParamRendCom; nchan_out = BINAURAL_CHANNELS; move16(); FOR( ch = 0; ch < nchan_out; ch++ ) { -#ifdef FIX_RENDERER_STACK output_fx_local[ch] = output_fx[ch]; -#else - output_fx_local[ch] = output_fx_local_buff[ch]; -#endif } slot_size = NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); @@ -545,10 +537,6 @@ void ivas_dirac_dec_binaural_render_fx( last_sf = add( last_sf, 1 ); } -#ifndef FIX_RENDERER_STACK - output_length = 0; - move16(); -#endif FOR( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { n_samples_sf = imult1616( slot_size, hSpatParamRendCom->subframe_nbslots[subframe_idx] ); @@ -560,19 +548,10 @@ void ivas_dirac_dec_binaural_render_fx( output_fx_local[ch] += n_samples_sf; } -#ifndef FIX_RENDERER_STACK - output_length = add( 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++ ) - { - Copy32( output_fx_local_buff[ch], output_fx[ch], output_length ); - } -#endif IF( EQ_16( hSpatParamRendCom->slots_rendered, hSpatParamRendCom->num_slots ) ) { hSpatParamRendCom->dirac_read_idx = add( hSpatParamRendCom->dirac_read_idx, DEFAULT_JBM_SUBFRAMES_5MS ) % hSpatParamRendCom->dirac_md_buffer_length; -- GitLab From c0fa39729b8c6c07a810803c3053c9a7e70a4023 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:49:31 +0100 Subject: [PATCH 04/21] [cleanup] accept FIX_1319_STACK_SBA_DECODER --- lib_com/ivas_prot_fx.h | 5 --- lib_com/options.h | 1 - lib_dec/ivas_dirac_dec_fx.c | 72 ---------------------------------- lib_dec/ivas_spar_decoder_fx.c | 18 --------- 4 files changed, 96 deletions(-) diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index db13b368b..149a49a74 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -2309,13 +2309,8 @@ void ivas_dirac_dec_render_sf_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Word32 *output_fx[], /* i/o: synthesized core-coder transport channels/DirAC output */ const Word16 nchan_transport, /* i : number of transport channels */ -#ifdef FIX_1319_STACK_SBA_DECODER Word32 *pppQMfFrame_ts_re_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX], Word32 *pppQMfFrame_ts_im_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX] -#else - Word32 *pppQMfFrame_ts_re_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX], - Word32 *pppQMfFrame_ts_im_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX] -#endif ); void ivas_dirac_dec_render_fx( diff --git a/lib_com/options.h b/lib_com/options.h index 7963acd2c..b388d0a67 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -116,7 +116,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_1302_FIX_OMASA_JBM_FLUSH /* VA: issue 1302: fix OMASA JBM bitrate switching flush in binaural output */ #define NONBE_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0, float issue 1328 */ -#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_fx.c b/lib_dec/ivas_dirac_dec_fx.c index b68f6fd6b..ff8565917 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -2152,7 +2152,6 @@ void ivas_dirac_dec_render_fx( /* clang-format on */ -#ifdef FIX_1319_STACK_SBA_DECODER /*------------------------------------------------------------------------- * Local functions to perform binaural rendering with optimized stack *------------------------------------------------------------------------*/ @@ -2243,7 +2242,6 @@ static void binRenderer_fx( return; } -#endif /*------------------------------------------------------------------------- @@ -2256,13 +2254,8 @@ void ivas_dirac_dec_render_sf_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Word32 *output_buf_fx[], /* i/o: synthesized core-coder transport channels/DirAC output Q(6-1)*/ const Word16 nchan_transport, /* i : number of transport channels */ -#ifdef FIX_1319_STACK_SBA_DECODER Word32 *pppQMfFrame_ts_re_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX], Word32 *pppQMfFrame_ts_im_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX] -#else - Word32 *pppQMfFrame_ts_re_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX], /*Q6*/ - Word32 *pppQMfFrame_ts_im_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX] /*Q6*/ -#endif ) { Word16 i, ch, idx_in, idx_lfe; @@ -2274,17 +2267,10 @@ void ivas_dirac_dec_render_sf_fx( Word16 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 Word32 Cldfb_RealBuffer_fx[MAX_OUTPUT_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; Word32 Cldfb_ImagBuffer_fx[MAX_OUTPUT_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; Word32 Cldfb_RealBuffer_Binaural_fx[1][BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; Word32 Cldfb_ImagBuffer_Binaural_fx[1][BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; -#else - Word32 Cldfb_RealBuffer_fx[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - Word32 Cldfb_ImagBuffer_fx[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - Word32 Cldfb_RealBuffer_Binaural_fx[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - Word32 Cldfb_ImagBuffer_Binaural_fx[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; -#endif Word16 index = 0, num_freq_bands = 0; move16(); move16(); @@ -2301,10 +2287,6 @@ void ivas_dirac_dec_render_sf_fx( Word16 surCohRatio_q_fx = 0, temp_q = 0; move16(); move16(); -#ifndef FIX_1319_STACK_SBA_DECODER - Word32 Cldfb_RealBuffer_Temp_fx[2][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; - Word32 Cldfb_ImagBuffer_Temp_fx[2][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; -#endif #ifndef FIX_2140_OBJECT_EDITING_SANITIZER_ISSUES Word16 cldfb_buf_q; #endif @@ -2799,19 +2781,11 @@ void ivas_dirac_dec_render_sf_fx( { q_temp_cldfb = Q11; move16(); -#ifdef FIX_1319_STACK_SBA_DECODER cldfbAnalysis_ts_fx_fixed_q( &( st_ivas->hTcBuffer->tc_fx[hDirACRend->sba_map_tc[ch]][hSpatParamRendCom->num_freq_bands * index_slot] ), Cldfb_RealBuffer_Binaural_fx[0][ch][slot_idx], /* note: it is a tmp. buffer at this point */ Cldfb_ImagBuffer_Binaural_fx[0][ch][slot_idx], /* note: it is a tmp. buffer at this point */ hSpatParamRendCom->num_freq_bands, st_ivas->cldfbAnaDec[ch], &q_temp_cldfb ); -#else - cldfbAnalysis_ts_fx_fixed_q( &st_ivas->hTcBuffer->tc_fx[hDirACRend->sba_map_tc[ch]][offset], - Cldfb_RealBuffer_Temp_fx[ch][slot_idx], - Cldfb_ImagBuffer_Temp_fx[ch][slot_idx], - hSpatParamRendCom->num_freq_bands, - st_ivas->cldfbAnaDec[ch], &q_temp_cldfb ); -#endif } q_cldfb = q_temp_cldfb; move16(); @@ -2819,14 +2793,10 @@ void ivas_dirac_dec_render_sf_fx( IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) { -#ifdef FIX_1319_STACK_SBA_DECODER #ifdef FIX_2140_OBJECT_EDITING_SANITIZER_ISSUES ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( st_ivas, Cldfb_RealBuffer_Binaural_fx[0], Cldfb_ImagBuffer_Binaural_fx[0], &q_cldfb, hSpatParamRendCom->num_freq_bands, subframe_idx ); #else ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( st_ivas, Cldfb_RealBuffer_Binaural_fx[0], Cldfb_ImagBuffer_Binaural_fx[0], &cldfb_buf_q, hSpatParamRendCom->num_freq_bands, subframe_idx ); -#endif -#else - ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( st_ivas, Cldfb_RealBuffer_Temp_fx, Cldfb_ImagBuffer_Temp_fx, &cldfb_buf_q, hSpatParamRendCom->num_freq_bands, subframe_idx ); #endif } } @@ -2860,13 +2830,8 @@ void ivas_dirac_dec_render_sf_fx( { FOR( ch = 0; ch < nchan_transport; ch++ ) { -#ifdef FIX_1319_STACK_SBA_DECODER Copy32( Cldfb_RealBuffer_Binaural_fx[0][ch][slot_idx], Cldfb_RealBuffer_fx[ch][0], hSpatParamRendCom->num_freq_bands ); Copy32( Cldfb_ImagBuffer_Binaural_fx[0][ch][slot_idx], Cldfb_ImagBuffer_fx[ch][0], hSpatParamRendCom->num_freq_bands ); -#else - Copy32( Cldfb_RealBuffer_Temp_fx[ch][slot_idx], Cldfb_RealBuffer_fx[ch][0], hSpatParamRendCom->num_freq_bands ); - Copy32( Cldfb_ImagBuffer_Temp_fx[ch][slot_idx], Cldfb_ImagBuffer_fx[ch][0], hSpatParamRendCom->num_freq_bands ); -#endif } } ELSE @@ -3840,7 +3805,6 @@ void ivas_dirac_dec_render_sf_fx( } /* Perform binaural rendering, output in Q6 format */ -#ifdef FIX_1319_STACK_SBA_DECODER test(); IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { @@ -3870,45 +3834,14 @@ void ivas_dirac_dec_render_sf_fx( binRenderer_fx( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, hSpatParamRendCom->subframe_nbslots[subframe_idx], Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, Cldfb_RealBuffer_fx, Cldfb_ImagBuffer_fx ); } -#else - IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) - { - IF( st_ivas->hSplitBinRend->hCldfbDataOut != NULL ) - { - FOR( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[subframe_idx]; slot_idx++ ) - { - FOR( ch = 0; ch < st_ivas->hBinRenderer->nInChannels; ch++ ) - { - Copy32( Cldfb_RealBuffer_fx[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_RealBuffer_fx[ch][add( slot_idx_start, slot_idx )], hSpatParamRendCom->num_freq_bands ); - Copy32( Cldfb_ImagBuffer_fx[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_ImagBuffer_fx[ch][add( slot_idx_start, slot_idx )], hSpatParamRendCom->num_freq_bands ); - } - } - st_ivas->hSplitBinRend->hCldfbDataOut->config = st_ivas->hIntSetup.output_config; - move16(); - } - } - - /*Binaural output in Q6 format*/ - ivas_binRenderer_fx( st_ivas->hBinRenderer, - ( st_ivas->hSplitBinRend == NULL ) ? NULL : &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, - st_ivas->hCombinedOrientationData, - hSpatParamRendCom->subframe_nbslots[subframe_idx], - Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, - Cldfb_RealBuffer_fx, Cldfb_ImagBuffer_fx, &input_q ); -#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 */ Word32 *synth_fx = &output_buf_fx[ch][index_slot * hSpatParamRendCom->num_freq_bands]; -#ifdef FIX_1319_STACK_SBA_DECODER Word32 *RealBuffer_fx[CLDFB_SLOTS_PER_SUBFRAME]; Word32 *ImagBuffer_fx[CLDFB_SLOTS_PER_SUBFRAME]; -#else - Word32 *RealBuffer_fx[MAX_PARAM_SPATIAL_SUBFRAMES]; - Word32 *ImagBuffer_fx[MAX_PARAM_SPATIAL_SUBFRAMES]; -#endif FOR( i = 0; i < hSpatParamRendCom->subframe_nbslots[subframe_idx]; i++ ) { RealBuffer_fx[i] = Cldfb_RealBuffer_Binaural_fx[0][ch][i]; @@ -3954,13 +3887,8 @@ void ivas_dirac_dec_render_sf_fx( } ELSE { -#ifdef FIX_1319_STACK_SBA_DECODER Word32 *RealBuffer_fx[CLDFB_SLOTS_PER_SUBFRAME]; Word32 *ImagBuffer_fx[CLDFB_SLOTS_PER_SUBFRAME]; -#else - Word32 *RealBuffer_fx[MAX_PARAM_SPATIAL_SUBFRAMES]; - Word32 *ImagBuffer_fx[MAX_PARAM_SPATIAL_SUBFRAMES]; -#endif Word16 outchannels; idx_in = 0; diff --git a/lib_dec/ivas_spar_decoder_fx.c b/lib_dec/ivas_spar_decoder_fx.c index 4161c57fa..af0f9d149 100644 --- a/lib_dec/ivas_spar_decoder_fx.c +++ b/lib_dec/ivas_spar_decoder_fx.c @@ -1683,25 +1683,15 @@ void ivas_spar_dec_upmixer_sf_fx( ) { Word16 cldfb_band, num_cldfb_bands, numch_in, numch_out; -#ifdef FIX_1319_STACK_SBA_DECODER Word32 *cldfb_in_ts_re_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX]; Word32 *cldfb_in_ts_im_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX]; -#else - Word32 *cldfb_in_ts_re_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_COL_MAX]; - Word32 *cldfb_in_ts_im_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_COL_MAX]; -#endif Word16 i, b, ts, out_ch, in_ch; Word16 num_spar_bands, spar_band, nchan_transport; Word16 num_in_ingest, split_band; Word16 slot_size, slot_idx_start; Word16 md_idx; -#ifdef FIX_1319_STACK_SBA_DECODER Word32 *p_tc_fx[HOA3_CHANNELS]; Word32 Pcm_tmp_fx[HOA3_CHANNELS][2 /* Re, Im*/ * L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; -#else - Word32 *p_tc_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; - Word32 Pcm_tmp_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][L_FRAME48k]; -#endif Word16 numch_out_dirac; Word32 mixer_mat_fx[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; Word16 b_skip_mat[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; @@ -1793,21 +1783,13 @@ void ivas_spar_dec_upmixer_sf_fx( * Prepare CLDFB buffers *---------------------------------------------------------------------*/ -#ifdef FIX_1319_STACK_SBA_DECODER set_zero_fx( &Pcm_tmp_fx[0][0], HOA3_CHANNELS * 2 * L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES ); -#else - set_zero_fx( &Pcm_tmp_fx[0][0], ( MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS ) * L_FRAME48k ); -#endif /* set-up pointers */ IF( NE_32( 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++ ) { -- GitLab From 5b8204ff3cad7e3e3bcd46780056a23697b92117 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:49:34 +0100 Subject: [PATCH 05/21] [cleanup] accept JBM_MEMORY_OPT --- lib_com/ivas_cnst.h | 5 - lib_com/ivas_prot_fx.h | 14 -- lib_com/ivas_tools_fx.c | 37 ------ lib_com/options.h | 1 - lib_dec/ivas_jbm_dec_fx.c | 247 ------------------------------------ lib_dec/ivas_stat_dec.h | 6 - lib_dec/jbm_pcmdsp_apa.h | 5 - lib_dec/jbm_pcmdsp_apa_fx.c | 8 -- lib_dec/lib_dec_fx.c | 85 ------------- 9 files changed, 408 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 335721a0a..a41ff84f5 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -192,13 +192,8 @@ typedef enum #define JBM_CLDFB_SLOTS_IN_SUBFRAME_LOG2 2 /* To be used for shift operation instead of division */ #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_fx.h b/lib_com/ivas_prot_fx.h index 149a49a74..c326ade0f 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -2079,7 +2079,6 @@ UWord32 ivas_syn_output_fx( Word16 *synth_out /* o : integer 16 bits synthesis signal */ ); -#ifdef JBM_MEMORY_OPT void ivas_buffer_interleaved_to_deinterleaved_fx( Word32 *audio, /* i/o: audio buffer */ const Word16 n_channels, /* i : number of channels */ @@ -2094,7 +2093,6 @@ void ivas_buffer_deinterleaved_to_interleaved_fx( Word32 *audio_out /* o : interleaved audio buffer */ ); -#endif void stereo_tcx_core_dec_fx( Decoder_State *st, /* i/o: decoder state structure */ const FRAME_MODE frameMode, /* i : Decoder frame mode */ @@ -4000,14 +3998,6 @@ void inverseMS_fx( const Word32 norm_fac /* i : normalization factor Q31*/ ); -#ifndef JBM_MEMORY_OPT -void ivas_syn_output_f_fx( - Word32 *synth[], /* i/o: Word32 synthesis signal */ - const Word16 output_frame, /* i : output frame length (one channel) */ - const Word16 n_channels, /* i : number of output channels */ - Word32 *synth_out /* o : integer 16 bits synthesis signal */ -); -#endif ivas_error ivas_init_encoder_fx( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ ); @@ -6186,10 +6176,6 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const Word16 nSamplesForRendering, /* i : number of TC samples available for rendering */ Word16 *nSamplesResidual /* o : number of samples not fitting into the renderer grid and buffer for the next call*/ -#ifndef JBM_MEMORY_OPT - , - Word32 *data_fx /* i/o: transport channels/output synthesis signal */ -#endif ); void ivas_dec_prepare_renderer_fx( diff --git a/lib_com/ivas_tools_fx.c b/lib_com/ivas_tools_fx.c index 973837ac0..69060e55d 100644 --- a/lib_com/ivas_tools_fx.c +++ b/lib_com/ivas_tools_fx.c @@ -149,7 +149,6 @@ UWord32 ivas_syn_output_fx( return noClipping; /*Q0*/ } -#ifdef JBM_MEMORY_OPT /*-------------------------------------------------------------------* * ivas_buffer_interleaved_to_deinterleaved() @@ -228,42 +227,6 @@ void ivas_buffer_deinterleaved_to_interleaved_fx( 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_fx( - Word32 *synth[], /* i/o: float synthesis signal Q11*/ - const Word16 output_frame, /* i : output frame length (one channel) Q0*/ - const Word16 n_channels, /* i : number of output channels Q0*/ - Word32 *synth_out /* o : integer 16 bits synthesis signal Q11*/ -) -{ - Word16 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]; /*Q11*/ - move16(); - } - } - - return; -} - -#endif /*-------------------------------------------------------------------* * mvr2r_inc() diff --git a/lib_com/options.h b/lib_com/options.h index b388d0a67..a20eb0762 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -132,7 +132,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_fx.c b/lib_dec/ivas_jbm_dec_fx.c index e4fe38732..ae119ae73 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -1520,19 +1520,10 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const Word16 nSamplesForRendering, /* i : number of TC samples available for rendering */ Word16 *nSamplesResidual /* o : number of samples not fitting into the renderer grid and buffer for the next call*/ -#ifndef JBM_MEMORY_OPT - , - Word32 *data /* i : transport channels */ -#endif ) { -#ifdef JBM_MEMORY_OPT Word32 tmp_buf_fx[MAX_JBM_L_FRAME48k]; Word32 *p_data_fx[FOA_CHANNELS + MAX_NUM_OBJECTS]; -#else - Word32 data_fx[MAX_CLDFB_DIGEST_CHANNELS][MAX_JBM_L_FRAME48k]; /* buffer for transport channels that will be directly converted with the CLDFB */ - Word32 *p_data_fx[MAX_CLDFB_DIGEST_CHANNELS]; -#endif Word16 n, n_render_timeslots, n_ch_cldfb; #ifdef FIX_1330_JBM_MEMORY Word16 ch, offset, len_offset; @@ -1550,7 +1541,6 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( IF( st_ivas->hDecoderConfig->Opt_tsm ) { -#ifdef JBM_MEMORY_OPT Word16 n_samples_still_available; Word16 n_ch_full_copy, n_ch_res_copy; @@ -1604,52 +1594,6 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( Copy32( tmp_buf_fx + nSamplesForRendering - *nSamplesResidual, hTcBuffer->tc_buffer_old_fx[ch], *nSamplesResidual ); } } -#else - Word16 n_samples_still_available, m; - Word16 n_ch_full_copy; - Word16 n_ch_res_copy; - - FOR( n = 0; n < n_ch_cldfb; n++ ) - { - p_data_fx[n] = &data_fx[n][0]; - } - - n_samples_still_available = sub( hTcBuffer->n_samples_buffered, hTcBuffer->n_samples_rendered ); - hTcBuffer->n_samples_buffered = add( add( n_samples_still_available, nSamplesForRendering ), hTcBuffer->n_samples_discard ); - hTcBuffer->n_samples_available = i_mult( hTcBuffer->n_samples_granularity, idiv1616( hTcBuffer->n_samples_buffered, hTcBuffer->n_samples_granularity ) ); - *nSamplesResidual = sub( hTcBuffer->n_samples_buffered, hTcBuffer->n_samples_available ); - move16(); - move16(); - move16(); - n_ch_full_copy = s_min( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); - n_ch_res_copy = sub( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); - - FOR( ch = 0; ch < n_ch_full_copy; ch++ ) - { - set32_fx( hTcBuffer->tc_fx[ch], 0, hTcBuffer->n_samples_discard ); - Copy32( hTcBuffer->tc_fx[ch] + hTcBuffer->n_samples_rendered, hTcBuffer->tc_fx[ch] + hTcBuffer->n_samples_discard, n_samples_still_available ); - FOR( m = 0; m < nSamplesForRendering; m++ ) - { - hTcBuffer->tc_fx[ch][n_samples_still_available + hTcBuffer->n_samples_discard + m] = data[m * hTcBuffer->nchan_transport_jbm + ch]; - move32(); - } - } - - IF( n_ch_res_copy > 0 ) - { - FOR( ; ch < hTcBuffer->nchan_transport_jbm; ch++ ) - { - Copy32( hTcBuffer->tc_fx[ch], p_data_fx[ch], n_samples_still_available ); - - FOR( m = 0; m < nSamplesForRendering; m++ ) - { - p_data_fx[ch][n_samples_still_available + m] = data[m * hTcBuffer->nchan_transport_jbm + ch]; - move32(); - } - Copy32( p_data_fx[ch] + hTcBuffer->n_samples_available, hTcBuffer->tc_fx[ch], *nSamplesResidual ); - } - } -#endif n_render_timeslots = idiv1616( st_ivas->hTcBuffer->n_samples_available, st_ivas->hTcBuffer->n_samples_granularity ); } @@ -1661,11 +1605,7 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( move16(); } -#ifdef JBM_MEMORY_OPT ch = s_max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); -#else - ch = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); -#endif FOR( n = 0; n < ch; n++ ) { hTcBuffer->tc_fx[n] = st_ivas->p_output_fx[n]; /* note: buffers needed in the TD decorellator */ @@ -1759,11 +1699,7 @@ ivas_error ivas_jbm_dec_render_fx( 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_fx[n] = st_ivas->p_output_fx[n]; } @@ -2643,7 +2579,6 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( { Word16 ch_idx; -#ifdef JBM_MEMORY_OPT /* render available full slots (with new lower granularity) */ FOR( ch_idx = 0; ch_idx < s_max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); ch_idx++ ) { @@ -2655,16 +2590,6 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( set_zero_fx( hTcBuffer->tc_fx[ch_idx] + n_samples_to_render, hTcBuffer->n_samples_granularity - n_samples_to_render ); #endif } -#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 */ - Copy32( hTcBuffer->tc_fx[ch_idx] + hTcBuffer->n_samples_rendered, hTcBuffer->tc_fx[ch_idx], n_samples_to_render ); - set_zero_fx( hTcBuffer->tc_fx[ch_idx] + n_samples_to_render, hTcBuffer->n_samples_granularity - n_samples_to_render ); - Copy32( hTcBuffer->tc_fx[ch_idx] + hTcBuffer->n_samples_rendered + n_samples_to_render, hTcBuffer->tc_fx[ch_idx] + hTcBuffer->n_samples_granularity, n_samples_still_available ); - } -#endif /* simple change of the slot info */ hTcBuffer->num_slots = 1; @@ -3466,7 +3391,6 @@ Word16 ivas_jbm_dec_get_render_granularity_fx( return render_granularity; } -#ifdef JBM_MEMORY_OPT /*--------------------------------------------------------------------------* * ivas_jbm_dec_tc_audio_allocate() @@ -3615,7 +3539,6 @@ static void ivas_jbm_dec_tc_audio_deallocate_fx( return; } -#endif /*--------------------------------------------------------------------------* * ivas_jbm_dec_tc_buffer_open() @@ -3632,17 +3555,9 @@ ivas_error ivas_jbm_dec_tc_buffer_open_fx( const Word16 n_samples_granularity /* i : granularity of the renderer/buffer */ ) { -#ifndef JBM_MEMORY_OPT - Word16 nsamp_to_allocate; -#endif DECODER_TC_BUFFER_HANDLE hTcBuffer; Word16 nMaxSlotsPerSubframe; -#ifdef JBM_MEMORY_OPT ivas_error error; -#else - Word16 nchan_residual; - Word16 ch_idx; -#endif Word16 tmp, tmp_e; Word32 tmp32; @@ -3663,9 +3578,6 @@ ivas_error ivas_jbm_dec_tc_buffer_open_fx( move16(); hTcBuffer->nchan_buffer_full = nchan_full; move16(); -#ifndef JBM_MEMORY_OPT - nchan_residual = sub( nchan_transport_internal, nchan_full ); -#endif hTcBuffer->n_samples_granularity = n_samples_granularity; move16(); hTcBuffer->n_samples_available = 0; @@ -3684,10 +3596,6 @@ ivas_error ivas_jbm_dec_tc_buffer_open_fx( move16(); hTcBuffer->nb_subframes = MAX_PARAM_SPATIAL_SUBFRAMES; move16(); -#ifndef JBM_MEMORY_OPT - nsamp_to_allocate = 0; - move16(); -#endif tmp32 = L_mult0( FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES, hTcBuffer->n_samples_granularity ); // Q0 tmp = BASOP_Util_Divide3232_Scale( st_ivas->hDecoderConfig->output_Fs, tmp32, &tmp_e ); @@ -3699,75 +3607,10 @@ ivas_error ivas_jbm_dec_tc_buffer_open_fx( set16_fx( hTcBuffer->subframe_nbslots, 0, MAX_JBM_SUBFRAMES_5MS ); set16_fx( hTcBuffer->subframe_nbslots, nMaxSlotsPerSubframe, MAX_PARAM_SPATIAL_SUBFRAMES ); -#ifdef JBM_MEMORY_OPT IF( ( error = ivas_jbm_dec_tc_audio_allocate_fx( hTcBuffer, st_ivas->hDecoderConfig->output_Fs, st_ivas->hDecoderConfig->Opt_tsm ) ) != IVAS_ERR_OK ) { return error; } -#else - { - Word16 n_samp_full, n_samp_residual; - Word32 offset; - IF( st_ivas->hDecoderConfig->Opt_tsm ) - { - n_samp_full = add( NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ), sub( hTcBuffer->n_samples_granularity, 1 ) ); - n_samp_residual = sub( hTcBuffer->n_samples_granularity, 1 ); - } - ELSE - { - /* n_samp_full = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); */ - n_samp_full = extract_l( Mpy_32_32( st_ivas->hDecoderConfig->output_Fs, ONE_BY_FRAMES_PER_SEC_Q31 ) ); - n_samp_residual = 0; - move16(); - } - - nsamp_to_allocate = mult0( hTcBuffer->nchan_buffer_full, n_samp_full ); - nsamp_to_allocate = add( nsamp_to_allocate, mult0( nchan_residual, n_samp_residual ) ); - - IF( nsamp_to_allocate == 0 ) - { - hTcBuffer->tc_buffer_fx = NULL; - - FOR( ch_idx = 0; ch_idx < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ ) - { - hTcBuffer->tc_fx[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_fx = (Word32 *) malloc( nsamp_to_allocate * sizeof( Word32 ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for JBM TC Buffer\n" ) ); - } - set32_fx( hTcBuffer->tc_buffer_fx, 0, nsamp_to_allocate ); - - offset = 0; - move16(); - FOR( ch_idx = 0; ch_idx < hTcBuffer->nchan_buffer_full; ch_idx++ ) - { - hTcBuffer->tc_fx[ch_idx] = &hTcBuffer->tc_buffer_fx[offset]; - offset = L_add( offset, n_samp_full ); - } - FOR( ; ch_idx < hTcBuffer->nchan_transport_internal; ch_idx++ ) - { - hTcBuffer->tc_fx[ch_idx] = &hTcBuffer->tc_buffer_fx[offset]; - offset = L_add( offset, n_samp_residual ); - } - FOR( ; ch_idx < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ ) - { - hTcBuffer->tc_fx[ch_idx] = NULL; - } - } - ELSE - { - hTcBuffer->tc_buffer_fx = NULL; - } - } - } -#endif st_ivas->hTcBuffer = hTcBuffer; @@ -3794,12 +3637,7 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure_fx( Word16 ch_idx, num_tc_buffer_mem, n_samples_still_available; Word32 tc_buffer_mem[MAX_INTERN_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES - 1]; #endif -#ifdef JBM_MEMORY_OPT ivas_error error; -#else - Word16 nsamp_to_allocate, n_samp_full, n_samp_residual, offset, nchan_residual; - Word16 ch_idx; -#endif DECODER_TC_BUFFER_HANDLE hTcBuffer; hTcBuffer = st_ivas->hTcBuffer; @@ -3857,13 +3695,9 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure_fx( move16(); hTcBuffer->nchan_buffer_full = nchan_full; move16(); -#ifndef JBM_MEMORY_OPT - nchan_residual = sub( nchan_transport_internal, nchan_full ); -#endif hTcBuffer->n_samples_granularity = n_samples_granularity; move16(); -#ifdef JBM_MEMORY_OPT /* reallocate TC audio buffers */ ivas_jbm_dec_tc_audio_deallocate_fx( hTcBuffer ); @@ -3872,70 +3706,6 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure_fx( { return error; } -#else - /* realloc buffers */ - IF( hTcBuffer->tc_buffer_fx != NULL ) - { - free( hTcBuffer->tc_buffer_fx ); - hTcBuffer->tc_buffer_fx = NULL; - } - - IF( st_ivas->hDecoderConfig->Opt_tsm ) - { - n_samp_full = ( add( NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ), sub( hTcBuffer->n_samples_granularity, 1 ) ) ); - n_samp_residual = sub( hTcBuffer->n_samples_granularity, 1 ); - } - ELSE - { - n_samp_full = extract_l( Mult_32_16( st_ivas->hDecoderConfig->output_Fs, INV_FRAME_PER_SEC_Q15 ) ); - n_samp_residual = 0; - move16(); - } - - nsamp_to_allocate = imult1616( hTcBuffer->nchan_buffer_full, n_samp_full ); - nsamp_to_allocate = add( nsamp_to_allocate, imult1616( nchan_residual, n_samp_residual ) ); - - IF( nsamp_to_allocate == 0 ) - { - hTcBuffer->tc_buffer_fx = NULL; - FOR( ch_idx = 0; ch_idx < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ ) - { - hTcBuffer->tc_fx[ch_idx] = NULL; - } - } - ELSE - { - IF( st_ivas->hDecoderConfig->Opt_tsm ) - { - IF( ( hTcBuffer->tc_buffer_fx = (Word32 *) malloc( nsamp_to_allocate * sizeof( Word32 ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory FOR JBM TC Buffer\n" ) ); - } - set32_fx( hTcBuffer->tc_buffer_fx, 0, nsamp_to_allocate ); - - offset = 0; - move16(); - FOR( ch_idx = 0; ch_idx < hTcBuffer->nchan_buffer_full; ch_idx++ ) - { - hTcBuffer->tc_fx[ch_idx] = &hTcBuffer->tc_buffer_fx[offset]; - offset = add( offset, n_samp_full ); - } - FOR( ; ch_idx < hTcBuffer->nchan_transport_internal; ch_idx++ ) - { - hTcBuffer->tc_fx[ch_idx] = &hTcBuffer->tc_buffer_fx[offset]; - offset = add( offset, n_samp_residual ); - } - FOR( ; ch_idx < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ ) - { - hTcBuffer->tc_fx[ch_idx] = NULL; - } - } - ELSE - { - hTcBuffer->tc_buffer_fx = NULL; - } - } -#endif #ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP /* propagate samples of the TC buffer from the previous frame */ @@ -4016,26 +3786,9 @@ void ivas_jbm_dec_tc_buffer_close_fx( DECODER_TC_BUFFER_HANDLE *phTcBuffer /* i/o: TC buffer handle */ ) { -#ifndef JBM_MEMORY_OPT - Word16 i; -#endif IF( *phTcBuffer != NULL ) { -#ifdef JBM_MEMORY_OPT ivas_jbm_dec_tc_audio_deallocate_fx( *phTcBuffer ); -#else - - FOR( i = 0; i < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; i++ ) - { - ( *phTcBuffer )->tc_fx[i] = NULL; - } - - IF( ( *phTcBuffer )->tc_buffer_fx != NULL ) - { - free( ( *phTcBuffer )->tc_buffer_fx ); - ( *phTcBuffer )->tc_buffer_fx = NULL; - } -#endif free( *phTcBuffer ); *phTcBuffer = NULL; diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index df8607cb5..3849c8ed4 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1017,15 +1017,9 @@ typedef struct ivas_masa_ism_data_structure typedef struct decoder_tc_buffer_structure { -#ifdef JBM_MEMORY_OPT Word32 *tc_buffer_old_fx[MAX_INTERN_CHANNELS]; /* TC audio samples not rendered in the previous frame */ -#endif Word32 *tc_buffer_fx; /* the buffer itself */ -#ifdef JBM_MEMORY_OPT Word32 *tc_fx[MAX_INTERN_CHANNELS]; /* pointers into the buffer to the beginning of each tc */ -#else - Word32 *tc_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; /* pointers into the buffer to the beginning of each tc Q11 for ivas */ -#endif Word16 no_channels; /*Stores no of channels in tc_fx with values*/ Word16 q_tc_fx; TC_BUFFER_MODE tc_buffer_mode; /* mode of the buffer (no buffering, render buffering, out buffering) */ diff --git a/lib_dec/jbm_pcmdsp_apa.h b/lib_dec/jbm_pcmdsp_apa.h index 98dd104c2..af937febb 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/jbm_pcmdsp_apa_fx.c b/lib_dec/jbm_pcmdsp_apa_fx.c index bc9ef573f..c5919ffe9 100644 --- a/lib_dec/jbm_pcmdsp_apa_fx.c +++ b/lib_dec/jbm_pcmdsp_apa_fx.c @@ -694,11 +694,7 @@ UWord8 apa_exec_fx( ) { UWord16 i; -#ifdef JBM_MEMORY_OPT Word16 frm_in[CPE_CHANNELS * APA_BUF / APA_MAX_NUM_CHANNELS]; /* in EVS, 2 output channels */ /* NOTE: this buffer could be smaller if alocated dynamically based on the actual sampling rate and number of channels */ -#else - Word16 frm_in[APA_BUF]; /* TODO(mcjbm): this buffer could be smaller - always allocates space for 16 channels */ -#endif UWord16 l_frm_out; Word16 l_rem; Word32 dl_scaled, dl_copied, l_frm_out_target; @@ -914,11 +910,7 @@ UWord8 apa_exec_ivas_fx( ) { UWord16 i; -#ifdef JBM_MEMORY_OPT Word16 frm_in[APA_BUF]; /* NOTE: this buffer could be smaller if alocated dynamically based on the actual sampling rate and number of channels */ -#else - Word16 frm_in[APA_BUF]; /* TODO(mcjbm): this buffer could be smaller - always allocates space for 16 channels */ -#endif UWord16 l_frm_out; Word16 l_rem; Word32 dl_scaled, dl_copied, l_frm_out_target; diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 82d52ca00..02e1cc76c 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -85,9 +85,6 @@ struct IVAS_DEC Word16 tsm_max_scaling; Word16 timeScalingDone; /* have we done already one TSM in a 20ms frame? */ Word16 tsm_quality; /*Q14*/ -#ifndef JBM_MEMORY_OPT - Word32 *apaExecBuffer_fx; /* Buffer for APA scaling */ -#endif PCMDSP_APA_HANDLE hTimeScaler; bool needNewFrame; bool hasBeenFedFrame; @@ -166,9 +163,6 @@ ivas_error IVAS_DEC_Open( hIvasDec = *phIvasDec; hIvasDec->hVoIP = NULL; -#ifndef JBM_MEMORY_OPT - hIvasDec->apaExecBuffer_fx = NULL; -#endif hIvasDec->hTimeScaler = NULL; hIvasDec->tsm_scale = 100; hIvasDec->tsm_max_scaling = 0; @@ -442,12 +436,6 @@ void IVAS_DEC_Close( apa_exit( &( *phIvasDec )->hTimeScaler ); -#ifndef JBM_MEMORY_OPT - IF( ( *phIvasDec )->apaExecBuffer_fx != NULL ) - { - free( ( *phIvasDec )->apaExecBuffer_fx ); - } -#endif IF( ( *phIvasDec )->flushbuffer != NULL ) { free( ( *phIvasDec )->flushbuffer ); @@ -4185,7 +4173,6 @@ ivas_error IVAS_DEC_ReadFormat( return IVAS_ERR_OK; } -#ifdef JBM_MEMORY_OPT /*---------------------------------------------------------------------* * apa_exec_evs_wrapper( ) @@ -4231,7 +4218,6 @@ static ivas_error apa_exec_evs_wrapper( return IVAS_ERR_OK; } -#endif /*---------------------------------------------------------------------* @@ -4268,12 +4254,8 @@ ivas_error IVAS_DEC_GetSamplesDecoder( } st_ivas = hIvasDec->st_ivas; -#ifdef JBM_MEMORY_OPT test(); isInitialized_voip = hIvasDec->hTimeScaler != NULL; -#else - isInitialized_voip = hIvasDec->apaExecBuffer_fx != NULL; -#endif test(); IF( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame ) /* wait for the first good frame */ @@ -4338,50 +4320,16 @@ 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_fx( st_ivas->p_output_fx, nTransportChannels, hIvasDec->nSamplesFrame, st_ivas->hTcBuffer->tc_buffer_fx ); -#else - ivas_syn_output_f_fx( st_ivas->p_output_fx, hIvasDec->nSamplesFrame, nTransportChannels, hIvasDec->apaExecBuffer_fx ); -#endif IF( EQ_16( (Word16) hIvasDec->mode, IVAS_DEC_MODE_EVS ) ) { -#ifdef JBM_MEMORY_OPT apa_exec_evs_wrapper( hIvasDec, nTransportChannels, &nTimeScalerOutSamples ); -#else - Word16 tmp_apaExecBuffer[APA_BUF]; - FOR( Word32 i = 0; i < APA_BUF_PER_CHANNEL * nTransportChannels; ++i ) - { -#ifdef JBM_MEMORY_OPT - tmp_apaExecBuffer[i] = extract_l( L_shr( st_ivas->hTcBuffer->tc_buffer_fx[i], Q11 ) ); // Q0 -#else - tmp_apaExecBuffer[i] = extract_l( L_shr( hIvasDec->apaExecBuffer_fx[i], Q11 ) ); // Q0 -#endif - } - - IF( apa_exec_fx( hIvasDec->hTimeScaler, tmp_apaExecBuffer, (UWord16) imult3216( hIvasDec->nSamplesFrame, nTransportChannels ), (UWord16) hIvasDec->tsm_max_scaling, tmp_apaExecBuffer, &nTimeScalerOutSamples ) != 0 ) - { - return IVAS_ERR_UNKNOWN; - } - - FOR( Word32 i = 0; i < APA_BUF_PER_CHANNEL * nTransportChannels; ++i ) - { -#ifdef JBM_MEMORY_OPT - st_ivas->hTcBuffer->tc_buffer_fx[i] = L_shl( tmp_apaExecBuffer[i], Q11 ); // Q11 -#else - hIvasDec->apaExecBuffer_fx[i] = L_shl( tmp_apaExecBuffer[i], Q11 ); // Q11 -#endif - } -#endif } ELSE { -#ifdef JBM_MEMORY_OPT IF( apa_exec_ivas_fx( hIvasDec->hTimeScaler, st_ivas->hTcBuffer->tc_buffer_fx, (UWord16) imult3216( hIvasDec->nSamplesFrame, nTransportChannels ), (UWord16) hIvasDec->tsm_max_scaling, st_ivas->hTcBuffer->tc_buffer_fx, &nTimeScalerOutSamples ) != 0 ) -#else - IF( apa_exec_ivas_fx( hIvasDec->hTimeScaler, hIvasDec->apaExecBuffer_fx, (UWord16) imult3216( hIvasDec->nSamplesFrame, nTransportChannels ), (UWord16) hIvasDec->tsm_max_scaling, hIvasDec->apaExecBuffer_fx, &nTimeScalerOutSamples ) != 0 ) -#endif { return IVAS_ERR_UNKNOWN; } @@ -4391,11 +4339,9 @@ ivas_error IVAS_DEC_GetSamplesDecoder( nSamplesTcsScaled = idiv1616U( extract_l( nTimeScalerOutSamples ), nTransportChannels ); hIvasDec->timeScalingDone = 1; move16(); -#ifdef JBM_MEMORY_OPT /* convert interleaved time-scaled TC audio channels buffer to deinterleaved one */ ivas_buffer_interleaved_to_deinterleaved_fx( st_ivas->hTcBuffer->tc_buffer_fx, nTransportChannels, nSamplesTcsScaled, NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) ); -#endif } else { @@ -4406,11 +4352,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_fx( st_ivas, nSamplesTcsScaled, &nResidualSamples ); -#else - ivas_jbm_dec_feed_tc_to_renderer_fx( st_ivas, nSamplesTcsScaled, &nResidualSamples, hIvasDec->apaExecBuffer_fx ); -#endif IF( st_ivas->hDecoderConfig->Opt_tsm ) { @@ -6267,9 +6209,6 @@ static ivas_error apa_setup( const bool isInitialized_voip, const UWord16 nTransportChannels ) { -#ifndef JBM_MEMORY_OPT - Word16 apa_buffer_size; -#endif UWord16 l_ts; l_ts = (UWord16) hIvasDec->st_ivas->hTcBuffer->n_samples_granularity; @@ -6283,12 +6222,6 @@ static ivas_error apa_setup( Word32 startQuality; startQuality = L_shl( L_deposit_l( hIvasDec->tsm_quality ), Q2 ); /* Q14 --> Q16*/ -#ifndef JBM_MEMORY_OPT - apa_buffer_size = APA_BUF_PER_CHANNEL; - - move16(); - /* get current renderer type*/ -#endif hDecoderConfig = hIvasDec->st_ivas->hDecoderConfig; IF( EQ_32( hDecoderConfig->output_Fs, 8000 ) ) @@ -6339,14 +6272,6 @@ static ivas_error apa_setup( return IVAS_ERR_INIT_ERROR; } } -#ifndef JBM_MEMORY_OPT - IF( ( hIvasDec->apaExecBuffer_fx = malloc( sizeof( Word32 ) * L_mult0( apa_buffer_size, (Word16) nTransportChannels ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); - } - - set_zero2_fx( hIvasDec->apaExecBuffer_fx, L_mult0( apa_buffer_size, (Word16) nTransportChannels ) ); -#endif } ELSE { @@ -6354,16 +6279,6 @@ static ivas_error apa_setup( { return IVAS_ERR_INIT_ERROR; } -#ifndef JBM_MEMORY_OPT - apa_buffer_size = APA_BUF_PER_CHANNEL; - move16(); - free( hIvasDec->apaExecBuffer_fx ); - IF( ( hIvasDec->apaExecBuffer_fx = malloc( sizeof( Word32 ) * L_mult0( apa_buffer_size, (Word16) nTransportChannels ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); - } - set_zero2_fx( hIvasDec->apaExecBuffer_fx, L_mult0( apa_buffer_size, (Word16) nTransportChannels ) ); -#endif } hIvasDec->nTransportChannelsOld = nTransportChannels; -- GitLab From 05a433c0b1fa2f714b826194a32b1137adbb29da Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:49:43 +0100 Subject: [PATCH 06/21] [cleanup] accept NONBE_FIX_1172_OBJ_EDIT_JBM --- lib_com/options.h | 1 - lib_dec/lib_dec_fx.c | 12 ------------ 2 files changed, 13 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a20eb0762..ac4c6af9b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,7 +157,6 @@ #define OBJ_EDIT_BASOP #define FIX_1372_OSBA_OBJECT_EDITING /* VA: issue 1372: Fix OSBA object-editing in BINAURAL_ROOM_IR */ #define FIX_2140_OBJECT_EDITING_SANITIZER_ISSUES /* Nokia: Issue 2140, fixes three different sanitizer issues persisting in object editing code. */ -#define NONBE_FIX_1172_OBJ_EDIT_JBM /* VA: issue 1172: fix OMASA object editing in JBM */ #define FIX_2193_ISM_GAINS_WITH_OE /* FhG: fix issue 2193: use edited angles in ISM gain calculation */ #define FIX_2192_OBJ_EDITING_EXT_METADATA /* Eri: Add support for extended metadata in object editing */ diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 02e1cc76c..dec6a9242 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -4961,18 +4961,6 @@ ivas_error IVAS_DEC_SetEditableParameters( st_ivas->hIsmMetaData[obj]->edited_radius_fx = hIvasEditableParameters.ism_metadata[obj].radius_fx; move32(); #endif -#ifndef NONBE_FIX_1172_OBJ_EDIT_JBM - st_ivas->hIsmMetaData[obj]->azimuth_fx = hIvasEditableParameters.ism_metadata[obj].azimuth_fx; - move32(); - st_ivas->hIsmMetaData[obj]->elevation_fx = hIvasEditableParameters.ism_metadata[obj].elevation_fx; - move32(); - st_ivas->hIsmMetaData[obj]->yaw_fx = hIvasEditableParameters.ism_metadata[obj].yaw_fx; - move32(); - st_ivas->hIsmMetaData[obj]->pitch_fx = hIvasEditableParameters.ism_metadata[obj].pitch_fx; - move32(); - st_ivas->hIsmMetaData[obj]->radius_fx = hIvasEditableParameters.ism_metadata[obj].radius_fx; - move32(); -#endif #ifdef FIX_GAIN_EDIT_LIMITS test(); IF( GT_32( hIvasEditableParameters.ism_metadata[obj].gain_fx, EDIT_GAIN_MAX_Q29 ) ) -- GitLab From 8ccb25782a03a5f894d41fbf53af0444e4b2957f Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:49:53 +0100 Subject: [PATCH 07/21] [cleanup] accept NONBE_1302_FIX_OMASA_JBM_FLUSH --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec_fx.c | 9 --------- 2 files changed, 10 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index ac4c6af9b..4165167e7 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -114,7 +114,6 @@ /* #################### 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 NONBE_1302_FIX_OMASA_JBM_FLUSH /* VA: issue 1302: fix OMASA JBM bitrate switching flush in binaural output */ #define NONBE_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0, float issue 1328 */ #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 */ diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index ae119ae73..6391010ab 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2737,13 +2737,11 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( IF( EQ_16( ism_mode_old, ISM_MASA_MODE_DISC ) ) { Word32 *tc_local_fx[MAX_NUM_OBJECTS]; -#ifdef NONBE_1302_FIX_OMASA_JBM_FLUSH Word16 last_dirac_md_idx; UWord16 nSamplesAvailableNext; ISM_MODE ism_mode_orig; RENDERER_TYPE renderer_type_orig; Word32 ivas_total_brate; -#endif /* copy from ISM delay buffer to the correct place in TCs */ move16(); @@ -2753,7 +2751,6 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( Copy32( st_ivas->hMasaIsmData->delayBuffer_fx[ch_idx], tc_local_fx[ch_idx], st_ivas->hMasaIsmData->delayBuffer_size ); /*Q11*/ } -#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; @@ -2780,12 +2777,6 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( 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( NE_32( ( error = ivas_td_binaural_renderer_sf_fx( st_ivas, p_output_fx, hTcBuffer->n_samples_granularity ) ), IVAS_ERR_OK ) ) - { - return error; - } -#endif } } ELSE IF( EQ_16( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) -- GitLab From e2e3cfc0352ce9ef86ad9fba5060f76f4ae9b1c8 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:49:56 +0100 Subject: [PATCH 08/21] [cleanup] accept NONBE_1324_TC_BUFFER_MEMOERY_KEEP --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec_fx.c | 8 -------- lib_dec/ivas_omasa_dec_fx.c | 2 -- 3 files changed, 11 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 4165167e7..5925e3511 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -131,7 +131,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 CODE_IMPROVEMENTS diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 6391010ab..a86e7cd1e 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -804,10 +804,8 @@ ivas_error ivas_jbm_dec_tc_fx( { Scale_sig32( p_output_fx[n], output_frame, sub( Q11, output_q ) ); // Q11 } -#ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP st_ivas->hCPE[0]->q_output_mem_fx[0] = output_q; st_ivas->hCPE[0]->q_output_mem_fx[1] = output_q; -#endif } } ELSE IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) @@ -3624,17 +3622,14 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure_fx( const Word16 n_samples_granularity /* i : new granularity of the renderer/buffer */ ) { -#ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP Word16 ch_idx, num_tc_buffer_mem, n_samples_still_available; Word32 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; move16(); -#ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP num_tc_buffer_mem = 0; move16(); n_samples_still_available = 0; @@ -3655,7 +3650,6 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure_fx( } } -#endif /* if granularity changes, adapt subframe_nb_slots */ IF( NE_16( n_samples_granularity, hTcBuffer->n_samples_granularity ) ) { @@ -3698,14 +3692,12 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure_fx( 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++ ) { Copy32( tc_buffer_mem[ch_idx], hTcBuffer->tc_buffer_old_fx[ch_idx], n_samples_still_available ); } -#endif return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_omasa_dec_fx.c b/lib_dec/ivas_omasa_dec_fx.c index 7df8ddfef..e74865e86 100644 --- a/lib_dec/ivas_omasa_dec_fx.c +++ b/lib_dec/ivas_omasa_dec_fx.c @@ -757,7 +757,6 @@ ivas_error ivas_omasa_dec_config_fx( /* ISM renderer handle + ISM data handle */ ivas_omasa_separate_object_renderer_close( st_ivas ); } -#ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP IF( EQ_32( old_renderer_type, RENDERER_MONO_DOWNMIX ) ) { @@ -769,7 +768,6 @@ ivas_error ivas_omasa_dec_config_fx( Scale_sig32( hTcBuffer->tc_buffer_old_fx[k], n_samples_still_available, st_ivas->hCPE[0]->q_output_mem_fx[0] - Q11 ); } } -#endif } IF( EQ_32( st_ivas->renderer_type, RENDERER_OMASA_MIX_EXT ) ) -- GitLab From 4ef47437a2635a694bac9affe141c408ad87d3e9 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:49:59 +0100 Subject: [PATCH 09/21] [cleanup] accept FIX_938_COMPILER_WARNING --- lib_com/options.h | 1 - lib_dec/ivas_mdct_core_dec_fx.c | 7 ------- 2 files changed, 8 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 5925e3511..86ffa03f2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -122,7 +122,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_fx.c b/lib_dec/ivas_mdct_core_dec_fx.c index be931598e..0b3f4651f 100644 --- a/lib_dec/ivas_mdct_core_dec_fx.c +++ b/lib_dec/ivas_mdct_core_dec_fx.c @@ -1406,16 +1406,9 @@ void ivas_mdct_core_reconstruct_fx( Copy_Scale_sig_16_32_no_sat( st->p_bpf_noise_buf, st->p_bpf_noise_buf_32, st->L_frame, Q11 ); // Q0 -> Q11 } -#ifndef FIX_938_COMPILER_WARNING - IF( signal_outFB_fx[ch] != NULL ) - { -#endif Copy( synthFB_fx, signal_outFB_fx[ch], st->hTcxDec->L_frameTCX ); e_sig[ch] = sub( 15, q_syn + st->Q_syn_factor ); move16(); -#ifndef FIX_938_COMPILER_WARNING - } -#endif /* updates */ st->last_voice_factor_fx = 0; -- GitLab From 774d52d6f64892fbfbb2d01a7dd8cdddbb4da221 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:50:03 +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 86ffa03f2..dfe2be993 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -129,7 +129,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 CODE_IMPROVEMENTS -- GitLab From 78384026c2f1ebfa2ff1fb6b9457b23a3b4985e5 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:50:18 +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 6f5bebe8a..f527fdf4d 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -3893,20 +3893,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 d1d9fb04b549fa1ee403af077173a9f12981834b Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:50:21 +0100 Subject: [PATCH 12/21] [cleanup] accept CODE_IMPROVEMENTS --- lib_com/options.h | 1 - lib_rend/ivas_rom_rend_fx.c | 6 ---- lib_rend/lib_rend_fx.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 ------------------------ 7 files changed, 124 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index dfe2be993..0c713a611 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -131,7 +131,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 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_rend/ivas_rom_rend_fx.c b/lib_rend/ivas_rom_rend_fx.c index 0579e68a4..fd56885f9 100644 --- a/lib_rend/ivas_rom_rend_fx.c +++ b/lib_rend/ivas_rom_rend_fx.c @@ -81,15 +81,9 @@ const Word32 ap_lattice_coeffs_2_fx[132] /* Q31 */ = { 1360843264, 1462880896, const Word32 ap_lattice_coeffs_3_fx[66] /* Q31 */ = { 1360843264, 1462880896, -106124344, 615715776, 313579872, 290773568, -880779712, -444026592, -1410828032, -218497872, 936944960, 729753600, -282142848, -1661606912, -647739072, 703431872, 713452032, 442076704, 1541038592, -1186205568, -322414592, 117158120, 514363136, -1392593792, -1550156800, 406684000, 146426176, 13348758, 165409920, 83060376, 909276800, -233341280, 927820288, -890434752, 596656832, 898691840, 167097856, -607873152, -766668864, 9951439, -950562176, -799540352, 866157440, 521887904, 675097984, 954584384, 746287104, 1065244224, 232804400, 1007990144, -365686400, 700745408, 369704352, 945610048, 125449552, 729442240, -418684160, 1054884800, -604078592, -92599496, -1036132928, -719417728, -721895936, 421913952, -353525216, 950242176}; const Word32 * const ap_lattice_coeffs_fx[DIRAC_DECORR_NUM_SPLIT_BANDS] = { -#ifdef CODE_IMPROVEMENTS ap_lattice_coeffs_1_fx, ap_lattice_coeffs_2_fx, ap_lattice_coeffs_3_fx, -#else - &ap_lattice_coeffs_1_fx[0], - &ap_lattice_coeffs_2_fx[0], - &ap_lattice_coeffs_3_fx[0], -#endif }; const Word16 ap_split_frequencies_fx[DIRAC_DECORR_NUM_SPLIT_BANDS + 1]/*Q14*/ = { diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index b1953ce96..07abd25f5 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -4199,7 +4199,6 @@ static ivas_error getConstInputById( return IVAS_ERR_OK; } -#ifdef CODE_IMPROVEMENTS static void *getInputByIndex_fx( void *inputsArray, const size_t index, @@ -4224,57 +4223,31 @@ static void *getInputByIndex_fx( /* include a final return to make the linter happy and avoid problems with wmc_tool (see #1355) */ return NULL; } -#endif static ivas_error findFreeInputSlot_fx( -#ifdef CODE_IMPROVEMENTS void *inputs, const IVAS_REND_AudioConfigType inputType, -#else - const void *inputs, - const int32_t inputStructSize, -#endif const Word32 maxInputs, Word32 *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 Word32 i; bool canAddInput; -#ifndef CODE_IMPROVEMENTS - const UWord8 *pByte; -#endif const input_base *pInputBase; canAddInput = false; move16(); /* 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_fx( inputs, i, inputType ); -#else - pInputBase = (const input_base *) pByte; -#endif IF( EQ_32( pInputBase->inConfig, IVAS_AUDIO_CONFIG_INVALID ) ) { @@ -4549,11 +4522,7 @@ ivas_error IVAS_REND_AddInput_fx( ivas_error error; Word32 maxNumInputsOfType; void *inputsArray; -#ifdef CODE_IMPROVEMENTS IVAS_REND_AudioConfigType inputType; -#else - Word32 inputStructSize; -#endif ivas_error ( *activateInput )( void *, AUDIO_CONFIG, IVAS_REND_InputId, RENDER_CONFIG_DATA *, hrtf_handles *hrtfs ); void ( *setInputDelay )( void *, bool ); Word32 inputIndex; @@ -4588,19 +4557,12 @@ ivas_error IVAS_REND_AddInput_fx( } -#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; move32(); @@ -4609,9 +4571,6 @@ ivas_error IVAS_REND_AddInput_fx( 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; move32(); @@ -4620,9 +4579,6 @@ ivas_error IVAS_REND_AddInput_fx( 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; move32(); @@ -4631,9 +4587,6 @@ ivas_error IVAS_REND_AddInput_fx( 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; move32(); @@ -4644,31 +4597,19 @@ ivas_error IVAS_REND_AddInput_fx( } /* Find first free input in array corresponding to input type */ -#ifdef CODE_IMPROVEMENTS IF( NE_32( ( error = findFreeInputSlot_fx( inputsArray, inputType, maxNumInputsOfType, &inputIndex ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = findFreeInputSlot_fx( inputsArray, inputStructSize, maxNumInputsOfType, &inputIndex ) ), IVAS_ERR_OK ) ) -#endif { return error; } *inputId = makeInputId( inConfig, inputIndex ); move16(); -#ifdef CODE_IMPROVEMENTS IF( NE_32( ( error = activateInput( getInputByIndex_fx( inputsArray, inputIndex, inputType ), inConfig, *inputId, hIvasRend->hRendererConfig, &hIvasRend->hHrtfs ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = activateInput( (uint8_t *) inputsArray + inputStructSize * inputIndex, inConfig, *inputId, hIvasRend->hRendererConfig, &hIvasRend->hHrtfs ) ), IVAS_ERR_OK ) ) -#endif { return error; } -#ifdef CODE_IMPROVEMENTS setInputDelay( getInputByIndex_fx( inputsArray, inputIndex, inputType ), splitPreRendCldfb ); -#else - setInputDelay( (Word8 *) 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 87ce9d131..3e837ca45 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 5c9faf59a..cbb6fb1f6 100644 --- a/lib_util/rtpdump.c +++ b/lib_util/rtpdump.c @@ -81,11 +81,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; } @@ -101,11 +97,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 423f6601f6888dd7e517c0bdb77abba084311cf4 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:50:24 +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 f527fdf4d..a4e828cb6 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -76,9 +76,7 @@ #define IVAS_MAX16B_FX 32767 #define IVAS_MIN16B_FX ( -32768 ) -#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS #define OMASA_TDREND_MATCHING_GAIN_DB ( -2.0f ) -#endif #if !defined( DEBUGGING ) && !defined( WMOPS ) static @@ -1304,30 +1302,22 @@ 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 ) @@ -1337,7 +1327,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 0c713a611..6b3aa8834 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -131,7 +131,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 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_1330_JBM_MEMORY /* VA: issue 1330: memory savings in the JBM decoder */ -- GitLab From c32cc04255d0870ab07a3decb70303adabe6e90c Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:50:28 +0100 Subject: [PATCH 14/21] [cleanup] accept NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING --- lib_com/options.h | 1 - lib_rend/ivas_omasa_ana_fx.c | 87 ------------------------------------ 2 files changed, 88 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6b3aa8834..f5a25fe8e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -131,7 +131,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 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_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 */ diff --git a/lib_rend/ivas_omasa_ana_fx.c b/lib_rend/ivas_omasa_ana_fx.c index ea4dadb73..9c209f036 100644 --- a/lib_rend/ivas_omasa_ana_fx.c +++ b/lib_rend/ivas_omasa_ana_fx.c @@ -676,13 +676,10 @@ static void ivas_omasa_dmx_fx( } set16_fx( data_e, 0, 4 ); set16_fx( in_e, 0, 960 ); -#ifdef NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING max_e = 0; -#endif FOR( i = 0; i < nchan_ism; i++ ) { -#ifdef NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING IF( EQ_16( nchan_transport, 1 ) ) { FOR( j = 0; j < input_frame; j++ ) @@ -749,66 +746,8 @@ static void ivas_omasa_dmx_fx( move32(); } } -#else - azimuth_fx = extract_l( L_shr( ism_azimuth_fx[i], Q22 ) ); // Q0 - elevation_fx = extract_l( L_shr( ism_elevation_fx[i], Q22 ) ); // Q0 - - ivas_ism_get_stereo_gains_fx( azimuth_fx, elevation_fx, &gains_fx[0], &gains_fx[1] ); - - /* Downmix using the panning gains */ - FOR( j = 0; j < nchan_transport; j++ ) - { - test(); - IF( abs_s( gains_fx[j] ) > 0 || L_abs( prev_gains_fx[i][j] ) > 0 ) - { - FOR( k = 0; k < input_frame; k++ ) - { - g1_fx = interpolator_fx[k]; // Q15 - move16(); - scale = BASOP_Util_Add_MantExp( 16384, 1, negate( g1_fx ), 0, &g2_fx ); - - tmp1 = mult( g1_fx, gains_fx[j] ); - tmp2 = mult( g2_fx, (Word16) L_shr( prev_gains_fx[i][j], 16 ) ); // Q: ( ( ( 15 - scale ) + ( Q31 - Q16 ) ) - Q15 ) -> ( 15 - scale ) - scale = BASOP_Util_Add_MantExp( tmp1, 0, tmp2, scale, &tmp1 ); - - L_tmp = data_in_f_fx[i][k]; // data_in_q - move32(); - tmp_e = sub( 31, *data_in_q ); - move16(); - - L_tmp = Mpy_32_16_1( L_tmp, tmp1 ); - scale = add( scale, tmp_e ); - - data_out_f_fx[j][k] = BASOP_Util_Add_Mant32Exp( data_out_f_fx[j][k], data_e[j], L_tmp, scale, &in_e[k] ); - move32(); - } - max_e = in_e[0]; - move16(); - FOR( l = 1; l < L_FRAME48k; l++ ) - { - IF( LT_16( max_e, in_e[l] ) ) - { - max_e = in_e[l]; - move16(); - } - } - - FOR( l = 0; l < L_FRAME48k; l++ ) - { - data_out_f_fx[j][l] = L_shr( data_out_f_fx[j][l], sub( max_e, in_e[l] ) ); // exponent: max_e, Q: ( 15 - max_e ) - move32(); - } - data_e[j] = max_e; - move16(); - } - - prev_gains_fx[i][j] = L_deposit_h( gains_fx[j] ); // Q31 - move32(); - } -#endif } -#ifdef NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING IF( NE_16( nchan_transport, 1 ) ) { max_e = data_e[0]; @@ -831,41 +770,15 @@ static void ivas_omasa_dmx_fx( } } } -#else - max_e = data_e[0]; - move16(); - FOR( i = 1; i < nchan_transport; i++ ) - { - IF( LT_16( max_e, data_e[i] ) ) - { - max_e = data_e[i]; - move16(); - } - } - - FOR( i = 0; i < nchan_transport; i++ ) - { - FOR( j = 0; j < input_frame; j++ ) - { - data_out_f_fx[i][j] = L_shr( data_out_f_fx[i][j], sub( max_e, data_e[i] ) ); // exponent: max_e, Q: ( 15 - max_e ) - move32(); - } - } -#endif FOR( i = 0; i < nchan_transport; i++ ) { Copy32( data_out_f_fx[i], data_in_f_fx[i], input_frame ); -#ifdef NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING IF( NE_16( nchan_transport, 1 ) ) { *data_in_q = sub( 31, max_e ); move16(); } -#else - *data_in_q = sub( 31, max_e ); - move16(); -#endif } return; -- GitLab From be4afbbdab668c024d7ce7da6ee4fee9963d6b01 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:50:40 +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 a4e828cb6..264cc07b1 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -663,7 +663,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] ) ) { @@ -672,18 +671,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 f5a25fe8e..aab65f877 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -122,7 +122,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 15f4cc016b664161c434e3d615d11cf934cc60bc Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:50:46 +0100 Subject: [PATCH 16/21] [cleanup] accept FIX_1330_JBM_MEMORY --- lib_com/ivas_prot_fx.h | 10 ------- lib_com/ivas_tools_fx.c | 6 ---- lib_com/options.h | 1 - lib_dec/ivas_cpe_dec_fx.c | 8 ------ lib_dec/ivas_init_dec_fx.c | 27 ------------------ lib_dec/ivas_ism_dec_fx.c | 21 -------------- lib_dec/ivas_ism_renderer_fx.c | 37 ------------------------ lib_dec/ivas_jbm_dec_fx.c | 52 ---------------------------------- lib_dec/ivas_masa_dec_fx.c | 11 ------- lib_dec/ivas_mct_dec_fx.c | 11 ------- lib_dec/ivas_omasa_dec_fx.c | 43 ---------------------------- lib_dec/ivas_osba_dec_fx.c | 34 ---------------------- lib_dec/ivas_sba_dec_fx.c | 16 ----------- lib_dec/ivas_stat_dec.h | 2 -- lib_rend/ivas_output_init_fx.c | 35 ----------------------- 15 files changed, 314 deletions(-) diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index c326ade0f..1adc3d5de 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -1044,12 +1044,7 @@ void ivas_omasa_separate_object_render_jbm_fx( const UWord16 nSamplesRendered, /* i : number of samples rendered */ Word32 input_fx_in[][L_FRAME48k], /* i : separated object signal */ Word32 *output_fx[], /* o : rendered time signal */ -#ifdef FIX_1330_JBM_MEMORY const Word16 subframes_rendered /* i : number of subframes rendered */ -#else - const Word16 subframes_rendered, /* i : number of subframes rendered */ - const Word16 slots_rendered /* i : number of CLDFB slots rendered */ -#endif ); void get_panning_gain_fx( @@ -4004,14 +3999,9 @@ ivas_error ivas_init_encoder_fx( ivas_error ivas_output_buff_dec_fx( Word32 *p_output_fx[], /* i/o: output audio buffers */ -#ifdef FIX_1330_JBM_MEMORY const Word16 nchan_out_buff, /* i : number of output channels */ const Word16 Opt_tsm, /* i : TSM option flag */ DECODER_TC_BUFFER_HANDLE hTcBuffer /* i : TSM buffer handle */ -#else - const Word16 nchan_out_buff_old, /* i : previous frame number of output channels */ - const Word16 nchan_out_buff /* i : number of output channels */ - #endif ); ivas_error ivas_dec_get_format_fx( diff --git a/lib_com/ivas_tools_fx.c b/lib_com/ivas_tools_fx.c index 69060e55d..d8ea700fc 100644 --- a/lib_com/ivas_tools_fx.c +++ b/lib_com/ivas_tools_fx.c @@ -201,25 +201,19 @@ void ivas_buffer_deinterleaved_to_interleaved_fx( ) { Word16 ch, m; -#ifdef FIX_1330_JBM_MEMORY Word32 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++ ) { Copy32( 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 move32(); } } diff --git a/lib_com/options.h b/lib_com/options.h index aab65f877..2d3d51d4b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -131,7 +131,6 @@ #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_1383_HEAD_TRACK_SANITIZER /* Nok: issue 1383: Fix head tracking struc values reading in renderer */ -#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_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_dec/ivas_cpe_dec_fx.c b/lib_dec/ivas_cpe_dec_fx.c index d98255d14..e5b8837f0 100644 --- a/lib_dec/ivas_cpe_dec_fx.c +++ b/lib_dec/ivas_cpe_dec_fx.c @@ -887,11 +887,7 @@ static ivas_error stereo_dft_dec_main( FOR( n = 0; n < hCPE->nchan_out; n++ ) { -#ifdef FIX_1330_JBM_MEMORY Scale_sig32( output[n], output_frame, sub( hCPE->hStereoDft->q_dft, Q11 ) ); // q_dft -#else - Scale_sig32( output[n], L_FRAME48k, sub( hCPE->hStereoDft->q_dft, Q11 ) ); // q_dft -#endif scale_sig32( hCPE->output_mem_fx[n], NS2SA_FX2( output_Fs, STEREO_DFT32MS_OVL_NS ), sub( hCPE->hStereoDft->q_dft, Q11 ) ); // q_dft hCPE->q_output_mem_fx[n] = hCPE->hStereoDft->q_dft; move16(); @@ -905,11 +901,7 @@ static ivas_error stereo_dft_dec_main( FOR( n = 0; n < hCPE->nchan_out; n++ ) { -#ifdef FIX_1330_JBM_MEMORY Scale_sig32( output[n], output_frame, sub( Q11, hCPE->hStereoDft->q_dft ) ); // Q11 -#else - Scale_sig32( output[n], L_FRAME48k, sub( Q11, hCPE->hStereoDft->q_dft ) ); // Q11 -#endif scale_sig32( hCPE->output_mem_fx[n], NS2SA_FX2( output_Fs, STEREO_DFT32MS_OVL_NS ), sub( Q11, hCPE->hStereoDft->q_dft ) ); // Q11 hCPE->q_output_mem_fx[n] = Q11; move16(); diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index 6de48e51d..90b5c7baa 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -1693,9 +1693,7 @@ ivas_error ivas_init_decoder_fx( Word16 sce_id, cpe_id; Word16 numCldfbAnalyses, numCldfbSyntheses; Word16 granularity, n_channels_transport_jbm; -#ifdef FIX_1330_JBM_MEMORY Word16 nchan_out_buff; -#endif Word32 output_Fs, ivas_total_brate, tmp_br, tmp32; Word32 delay_ns; AUDIO_CONFIG output_config; @@ -3215,28 +3213,11 @@ ivas_error ivas_init_decoder_fx( * Allocate output audio buffers *-----------------------------------------------------------------*/ -#ifdef FIX_1330_JBM_MEMORY nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, ivas_total_brate ); IF( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff, hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK ) { return error; } -#else - k = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, ivas_total_brate ); - FOR( n = 0; n < k; n++ ) - { - /* note: these are intra-frame heap memories */ - IF( ( st_ivas->p_output_fx[n] = (Word32 *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( Word32 ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for output audio buffer!\n" ) ); - } - set32_fx( st_ivas->p_output_fx[n], 0, 48000 / FRAMES_PER_SEC ); - } - FOR( ; n < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; n++ ) - { - st_ivas->p_output_fx[n] = NULL; - } -#endif return error; } @@ -3717,15 +3698,7 @@ void ivas_destroy_dec_fx( /* output audio buffers */ FOR( i = 0; i < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; i++ ) { -#ifdef FIX_1330_JBM_MEMORY st_ivas->p_output_fx[i] = NULL; -#else - IF( st_ivas->p_output_fx[i] != NULL ) - { - free( st_ivas->p_output_fx[i] ); - st_ivas->p_output_fx[i] = NULL; - } -#endif } #ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT diff --git a/lib_dec/ivas_ism_dec_fx.c b/lib_dec/ivas_ism_dec_fx.c index 5d8e1f705..4537b3840 100644 --- a/lib_dec/ivas_ism_dec_fx.c +++ b/lib_dec/ivas_ism_dec_fx.c @@ -59,11 +59,7 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( Word16 tc_nchan_tc_new; Word16 tc_nchan_allocate_new; Word16 tc_granularity_new; -#ifdef FIX_1330_JBM_MEMORY Word16 nchan_out_buff; -#else - Word16 nchan_out_buff, nchan_out_buff_old; -#endif nCPE_old = st_ivas->nCPE; move16(); @@ -78,9 +74,6 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( ivas_init_dec_get_num_cldfb_instances_fx( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); st_ivas->ism_mode = ism_mode; move16(); -#ifndef FIX_1330_JBM_MEMORY - nchan_out_buff_old = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); -#endif IF( NE_32( ( error = ivas_ism_config_fx( 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 ) ) { @@ -309,18 +302,6 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( return error; } -#ifndef FIX_1330_JBM_MEMORY - /*-----------------------------------------------------------------* - * output audio buffers - *-----------------------------------------------------------------*/ - - nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); - - IF( NE_32( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ), IVAS_ERR_OK ) ) - { - return error; - } -#endif /*-----------------------------------------------------------------* * JBM TC buffers *-----------------------------------------------------------------*/ @@ -373,7 +354,6 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( Copy( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); } -#ifdef FIX_1330_JBM_MEMORY /*-----------------------------------------------------------------* * output audio buffers @@ -384,7 +364,6 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( { return error; } -#endif return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_ism_renderer_fx.c b/lib_dec/ivas_ism_renderer_fx.c index 85d333c94..d8e5e069e 100644 --- a/lib_dec/ivas_ism_renderer_fx.c +++ b/lib_dec/ivas_ism_renderer_fx.c @@ -218,25 +218,11 @@ void ivas_ism_render_sf_fx( ism_md_subframe_update_jbm = sub( 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_fx[i] = &st_ivas->hTcBuffer->tc_fx[i][tc_offset]; // Q11 - } - } - ELSE - { -#endif FOR( i = 0; i < num_objects; i++ ) { Copy32( &output_fx[i][tc_offset], tc_local_fx[i], n_samples_to_render ); p_tc_fx[i] = tc_local_fx[i]; } -#ifndef FIX_1330_JBM_MEMORY - } -#endif FOR( i = 0; i < nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; i++ ) { @@ -511,12 +497,7 @@ void ivas_omasa_separate_object_render_jbm_fx( const UWord16 nSamplesRendered, /* i : number of samples rendered */ Word32 input_fx_in[][L_FRAME48k], /* i : separated object signal Q11*/ Word32 *output_fx[], /* o : rendered time signal Q11*/ -#ifdef FIX_1330_JBM_MEMORY const Word16 subframes_rendered /* i : number of subframes rendered */ -#else - const Word16 subframes_rendered, /* i : number of subframes rendered */ - const Word16 slots_rendered /* i : number of CLDFB slots rendered */ -#endif ) { VBAP_HANDLE hVBAPdata; @@ -565,34 +546,16 @@ void ivas_omasa_separate_object_render_jbm_fx( move16(); } -#ifndef FIX_1330_JBM_MEMORY - offsetSamples = i_mult( slots_rendered, hSpatParamRendCom->slot_size ); -#endif FOR( j = 0; j < nchan_out_woLFE + num_lfe; j++ ) { output_fx_local[j] = output_fx[j]; } -#ifndef FIX_1330_JBM_MEMORY - IF( st_ivas->hDecoderConfig->Opt_tsm ) - { - FOR( obj = 0; obj < num_objects; obj++ ) - { - input_fx[obj] = &st_ivas->hTcBuffer->tc_fx[obj + 2][offsetSamples]; - move32(); - } - } - ELSE - { -#endif FOR( obj = 0; obj < num_objects; obj++ ) { input_fx[obj] = input_fx_in[obj]; move32(); } -#ifndef FIX_1330_JBM_MEMORY - } -#endif slots_to_render = idiv1616( nSamplesRendered, hSpatParamRendCom->slot_size ); first_sf = subframes_rendered; diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index a86e7cd1e..018bdeeec 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -1523,11 +1523,7 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( Word32 tmp_buf_fx[MAX_JBM_L_FRAME48k]; Word32 *p_data_fx[FOA_CHANNELS + MAX_NUM_OBJECTS]; Word16 n, n_render_timeslots, n_ch_cldfb; -#ifdef FIX_1330_JBM_MEMORY Word16 ch, offset, len_offset; -#else - Word16 ch; -#endif DECODER_TC_BUFFER_HANDLE hTcBuffer; hTcBuffer = st_ivas->hTcBuffer; @@ -1552,7 +1548,6 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( n_ch_full_copy = s_min( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); n_ch_res_copy = sub( 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() */ @@ -1571,7 +1566,6 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( } } -#endif FOR( ch = 0; ch < n_ch_full_copy; ch++ ) { Copy32( hTcBuffer->tc_fx[ch], tmp_buf_fx, nSamplesForRendering ); @@ -2123,12 +2117,6 @@ ivas_error ivas_jbm_dec_render_fx( FOR( i = 0; i < nchan_in; i++ ) { scale_sig32( p_output_fx[i], *nSamplesRendered, negate( sub( Q11, *st_ivas->hCrendWrapper->p_io_qfactor ) ) ); // Q = *st_ivas->hCrendWrapper->p_io_qfactor -#ifndef FIX_1330_JBM_MEMORY - IF( st_ivas->hDecoderConfig->Opt_tsm ) - { - scale_sig32( p_tc_fx[i], *nSamplesRendered, negate( sub( Q11, *st_ivas->hCrendWrapper->p_io_qfactor ) ) ); // Q = *st_ivas->hCrendWrapper->p_io_qfactor - } -#endif } } ELSE @@ -2141,45 +2129,22 @@ ivas_error ivas_jbm_dec_render_fx( IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { -#ifdef FIX_1330_JBM_MEMORY IF( ( error = ivas_rend_crendProcessSubframesSplitBin( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, ( st_ivas->hSplitBinRend == NULL ) ? NULL : &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, p_output_fx, p_output_fx, *nSamplesRendered, output_Fs ) ) != IVAS_ERR_OK ) -#else - IF( ( error = ivas_rend_crendProcessSubframesSplitBin( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, ( st_ivas->hSplitBinRend == NULL ) ? NULL : &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, - &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output_fx : p_tc_fx, p_output_fx, *nSamplesRendered, output_Fs ) ) != IVAS_ERR_OK ) -#endif { return error; } } ELSE { -#ifdef FIX_1330_JBM_MEMORY IF( NE_32( ( error = ivas_rend_crendProcessSubframe_fx( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, p_output_fx, p_output_fx, *nSamplesRendered, output_Fs, 0 ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_rend_crendProcessSubframe_fx( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, - &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output_fx : p_tc_fx, p_output_fx, *nSamplesRendered, output_Fs, 0 ) ), - IVAS_ERR_OK ) ) -#endif { return error; } // Todo main-pc update: This might be needed also in the split rendering path -#ifndef FIX_1330_JBM_MEMORY - IF( st_ivas->hDecoderConfig->Opt_tsm ) - { - IF( NE_16( exp, *st_ivas->hCrendWrapper->p_io_qfactor ) ) - { - FOR( i = 0; i < nchan_in; i++ ) - { - scale_sig32( p_tc_fx[i], *nSamplesRendered, sub( *st_ivas->hCrendWrapper->p_io_qfactor, exp ) ); - } - } - } -#endif ivas_binaural_add_LFE_fx( st_ivas, *nSamplesRendered, p_tc_fx, p_output_fx ); } @@ -2197,13 +2162,6 @@ ivas_error ivas_jbm_dec_render_fx( { scale_sig32( p_output_fx[i], *nSamplesRendered, sub( Q11, *st_ivas->hCrendWrapper->p_io_qfactor ) ); // Q11 } -#ifndef FIX_1330_JBM_MEMORY - IF( st_ivas->hDecoderConfig->Opt_tsm && crendInPlaceRotation ) - { - n = 0; - move16(); - } -#endif FOR( i = n; i < nchan_in; i++ ) { @@ -3399,9 +3357,7 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate_fx( IF( Opt_tsm ) { n_samp_full = NS2SA_FX2( output_Fs, MAX_JBM_L_FRAME_NS ); -#ifdef FIX_1330_JBM_MEMORY n_samp_full = s_max( n_samp_full, L_FRAME48k ); /* buffers are shared between 'hTcBuffer->tc[]' and 'p_output_f[]': ensure minimal length */ -#endif #ifdef FIX_2174_JBM_BASOP_ALIGNMENT n_samp_residual = sub( hTcBuffer->n_samples_granularity, 1 ); #else @@ -3475,10 +3431,8 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate_fx( } } -#ifdef FIX_1330_JBM_MEMORY hTcBuffer->tc_buffer2_fx = NULL; -#endif return IVAS_ERR_OK; } @@ -3516,14 +3470,12 @@ static void ivas_jbm_dec_tc_audio_deallocate_fx( hTcBuffer->tc_buffer_old_fx[ch_idx] = NULL; } } -#ifdef FIX_1330_JBM_MEMORY IF( hTcBuffer->tc_buffer2_fx != NULL ) { free( hTcBuffer->tc_buffer2_fx ); hTcBuffer->tc_buffer2_fx = NULL; } -#endif } return; @@ -3744,12 +3696,8 @@ static void ivas_jbm_dec_tc_buffer_playout_fx( FOR( ch_idx = 0; ch_idx < st_ivas->hTcBuffer->nchan_transport_jbm; ch_idx++ ) { -#ifdef FIX_1330_JBM_MEMORY output_fx[ch_idx] = st_ivas->hTcBuffer->tc_fx[ch_idx] + st_ivas->hTcBuffer->n_samples_rendered; move32(); -#else - Copy32( st_ivas->hTcBuffer->tc_fx[ch_idx] + st_ivas->hTcBuffer->n_samples_rendered, output_fx[ch_idx], *nSamplesRendered ); -#endif } st_ivas->hTcBuffer->subframes_rendered = last_sf; diff --git a/lib_dec/ivas_masa_dec_fx.c b/lib_dec/ivas_masa_dec_fx.c index 6f1385062..b41036a5d 100644 --- a/lib_dec/ivas_masa_dec_fx.c +++ b/lib_dec/ivas_masa_dec_fx.c @@ -1689,11 +1689,7 @@ ivas_error ivas_masa_dec_reconfigure_fx( Decoder_State **sts; UWord32 ivas_total_brate, last_ivas_total_brate; Word16 numCldfbAnalyses_old, numCldfbSyntheses_old; -#ifdef FIX_1330_JBM_MEMORY Word16 nchan_out_buff; -#else - Word16 nchan_out_buff_old, nchan_out_buff; -#endif ivas_error error; Word32 ism_total_brate; Word16 pos_idx; @@ -1702,9 +1698,6 @@ ivas_error ivas_masa_dec_reconfigure_fx( move32(); last_ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate; move32(); -#ifndef FIX_1330_JBM_MEMORY - nchan_out_buff_old = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); -#endif test(); test(); @@ -2054,11 +2047,7 @@ ivas_error ivas_masa_dec_reconfigure_fx( IF( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) && EQ_32( st_ivas->last_ivas_format, MASA_FORMAT ) ) /* note: switching with OMASA is addressed in ivas_omasa_dec_config() */ { nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); -#ifdef FIX_1330_JBM_MEMORY IF( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff, st_ivas->hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK ) -#else - IF( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_mct_dec_fx.c b/lib_dec/ivas_mct_dec_fx.c index 86313996d..49b4edb18 100644 --- a/lib_dec/ivas_mct_dec_fx.c +++ b/lib_dec/ivas_mct_dec_fx.c @@ -902,19 +902,12 @@ static ivas_error ivas_mc_dec_reconfig_fx( Word16 tc_nchan_tc_new; Word16 tc_nchan_allocate_new; Word16 tc_granularity_new; -#ifdef FIX_1330_JBM_MEMORY Word16 nchan_out_buff; -#else - Word16 nchan_out_buff_old, nchan_out_buff; -#endif ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; move32(); nchan_transport_old = st_ivas->nchan_transport; move16(); -#ifndef FIX_1330_JBM_MEMORY - nchan_out_buff_old = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); -#endif last_mc_mode = ivas_mc_mode_select_fx( ivas_mc_map_output_config_to_mc_ls_setup_fx( 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 @@ -1644,11 +1637,7 @@ static ivas_error ivas_mc_dec_reconfig_fx( *-----------------------------------------------------------------*/ nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); -#ifdef FIX_1330_JBM_MEMORY IF( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff, st_ivas->hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK ) -#else - IF( NE_32( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ), IVAS_ERR_OK ) ) -#endif { return error; } diff --git a/lib_dec/ivas_omasa_dec_fx.c b/lib_dec/ivas_omasa_dec_fx.c index e74865e86..455f82c88 100644 --- a/lib_dec/ivas_omasa_dec_fx.c +++ b/lib_dec/ivas_omasa_dec_fx.c @@ -497,11 +497,7 @@ ivas_error ivas_omasa_dec_config_fx( Word32 brate_SCE, brate_CPE; ISM_MODE ism_mode_old; IVAS_FORMAT ivas_format_orig; -#ifdef FIX_1330_JBM_MEMORY Word16 nchan_out_buff; -#else - Word16 nchan_out_buff, nchan_out_buff_old; -#endif ivas_error error; RENDERER_TYPE old_renderer_type; @@ -522,10 +518,6 @@ ivas_error ivas_omasa_dec_config_fx( st_ivas->ivas_format = st_ivas->last_ivas_format; move16(); ivas_init_dec_get_num_cldfb_instances_fx( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); -#ifndef FIX_1330_JBM_MEMORY - nchan_out_buff_old = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); - move16(); -#endif st_ivas->ivas_format = ivas_format_orig; move16(); @@ -832,11 +824,7 @@ ivas_error ivas_omasa_dec_config_fx( *-----------------------------------------------------------------*/ nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); -#ifdef FIX_1330_JBM_MEMORY IF( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff, st_ivas->hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK ) -#else - IF( NE_32( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -1113,17 +1101,9 @@ void ivas_omasa_dirac_rend_jbm_fx( ) { Word16 subframes_rendered; -#ifndef FIX_1330_JBM_MEMORY - Word16 slots_rendered; -#endif Word16 n; Word32 data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; -#ifndef FIX_1330_JBM_MEMORY - test(); - IF( !st_ivas->hDecoderConfig->Opt_tsm ) - { -#endif *nSamplesRendered = s_min( nSamplesAsked, st_ivas->hTcBuffer->n_samples_available ); test(); @@ -1134,11 +1114,7 @@ void ivas_omasa_dirac_rend_jbm_fx( #ifdef NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) #else -#ifdef FIX_1330_JBM_MEMORY IF( !st_ivas->hDecoderConfig->Opt_tsm && EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) -#else - IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) -#endif #endif { /* Gain separated object, if edited */ @@ -1163,11 +1139,7 @@ void ivas_omasa_dirac_rend_jbm_fx( #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_fx_16( data_separated_objects[n], st_ivas->hMasaIsmData->gain_ism_edited_fx[n], data_separated_objects[n], *nSamplesRendered ); // Q = 8 @@ -1176,11 +1148,7 @@ void ivas_omasa_dirac_rend_jbm_fx( } /* 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++ ) { @@ -1189,16 +1157,9 @@ void ivas_omasa_dirac_rend_jbm_fx( } } } -#ifndef FIX_1330_JBM_MEMORY - } -#endif subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; move16(); -#ifndef FIX_1330_JBM_MEMORY - slots_rendered = st_ivas->hSpatParamRendCom->slots_rendered; - move16(); -#endif ivas_dirac_dec_render_fx( st_ivas, nchan_transport, nSamplesAsked, nSamplesRendered, nSamplesAvailable, output_fx ); @@ -1207,11 +1168,7 @@ void ivas_omasa_dirac_rend_jbm_fx( scale_sig32( st_ivas->hIsmRendererData->prev_gains_fx[ind1], MAX_OUTPUT_CHANNELS, -1 ); // Q30 -> Q29 } -#ifdef FIX_1330_JBM_MEMORY ivas_omasa_separate_object_render_jbm_fx( st_ivas, *nSamplesRendered, data_separated_objects, output_fx, subframes_rendered ); -#else - ivas_omasa_separate_object_render_jbm_fx( st_ivas, *nSamplesRendered, data_separated_objects, output_fx, subframes_rendered, slots_rendered ); -#endif FOR( Word16 ind1 = 0; ind1 < MAX_NUM_OBJECTS; ind1++ ) { diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index f81a8e8a2..20cd3d414 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -296,69 +296,35 @@ ivas_error ivas_osba_render_sf_fx( ) { Word16 n; -#ifdef FIX_1330_JBM_MEMORY Word32 output_sba[MAX_OUTPUT_CHANNELS][L_FRAME48k]; Word32 *p_output_sba[MAX_OUTPUT_CHANNELS]; -#else - Word32 output_ism[MAX_OUTPUT_CHANNELS][L_FRAME48k]; - Word32 *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 ) - { - Word16 tc_offset; - tc_offset = st_ivas->hTcBuffer->n_samples_rendered; - for ( n = 0; n < st_ivas->nchan_ism; n++ ) - { - v_shr( &p_output[n][tc_offset], Q11 - Q11, &output_ism[n][tc_offset], nSamplesAsked ); // Q11 - } - } -#endif -#ifdef FIX_1330_JBM_MEMORY IF( ( error = ivas_sba_dec_render_fx( st_ivas, nSamplesAsked, nSamplesRendered, nSamplesAvailableNext, p_output_sba ) ) != IVAS_ERR_OK ) -#else - IF( NE_32( ( error = ivas_sba_dec_render_fx( st_ivas, nSamplesAsked, nSamplesRendered, nSamplesAvailableNext, p_output ) ), IVAS_ERR_OK ) ) -#endif { return error; } IF( NE_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) { -#ifdef FIX_1330_JBM_MEMORY ivas_ism_render_sf_fx( st_ivas, st_ivas->renderer_type, p_output, *nSamplesRendered ); -#else - ivas_ism_render_sf_fx( st_ivas, st_ivas->renderer_type, p_output_ism, *nSamplesRendered ); -#endif } FOR( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) { IF( NE_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) { -#ifdef FIX_1330_JBM_MEMORY v_add_fx_no_hdrm( p_output[n], p_output_sba[n], p_output[n], *nSamplesRendered ); -#else - v_add_fx_no_hdrm( p_output[n], p_output_ism[n], p_output[n], *nSamplesRendered ); -#endif } -#ifdef FIX_1330_JBM_MEMORY ELSE { Copy32( p_output_sba[n], p_output[n], *nSamplesRendered ); } -#endif } return IVAS_ERR_OK; diff --git a/lib_dec/ivas_sba_dec_fx.c b/lib_dec/ivas_sba_dec_fx.c index e8dab7dc4..a7f2931b2 100644 --- a/lib_dec/ivas_sba_dec_fx.c +++ b/lib_dec/ivas_sba_dec_fx.c @@ -118,12 +118,7 @@ ivas_error ivas_sba_dec_reconfigure_fx( Word32 ivas_total_brate; Word32 last_ivas_total_brate; Word16 num_channels, num_md_sub_frames; -#ifdef FIX_1330_JBM_MEMORY Word16 nchan_out_buff; -#else - Word16 nchan_out_buff, nchan_out_buff_old; - Word16 sba_analysis_order_old_flush; -#endif DECODER_CONFIG_HANDLE hDecoderConfig; ivas_error error; ISM_MODE ism_mode_old; @@ -136,19 +131,12 @@ ivas_error ivas_sba_dec_reconfigure_fx( move32(); last_ivas_total_brate = st_ivas->last_active_ivas_total_brate; move32(); -#ifndef FIX_1330_JBM_MEMORY - sba_analysis_order_old_flush = st_ivas->sba_analysis_order; - move16(); -#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_fx( st_ivas, sba_analysis_order_old_flush, last_ivas_total_brate ); -#endif ivas_init_dec_get_num_cldfb_instances_fx( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); nchan_hp20_old = getNumChanSynthesis( st_ivas ); @@ -707,11 +695,7 @@ ivas_error ivas_sba_dec_reconfigure_fx( *-----------------------------------------------------------------*/ nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); /*Q0*/ -#ifdef FIX_1330_JBM_MEMORY IF( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff, hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK ) -#else - IF( NE_32( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, 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 3849c8ed4..46c0d760a 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1038,10 +1038,8 @@ typedef struct decoder_tc_buffer_structure Word16 num_slots; Word16 n_samples_discard; /* number of samples to discard from the beginning of the output */ -#ifdef FIX_1330_JBM_MEMORY Word32 *tc_buffer2_fx; /* 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_fx.c b/lib_rend/ivas_output_init_fx.c index e3cdefad5..7c5b53b29 100644 --- a/lib_rend/ivas_output_init_fx.c +++ b/lib_rend/ivas_output_init_fx.c @@ -423,17 +423,11 @@ Word16 ivas_get_nchan_buffers_dec_fx( ivas_error ivas_output_buff_dec_fx( Word32 *p_output_fx[], /* i/o: output audio buffers */ -#ifdef FIX_1330_JBM_MEMORY const Word16 nchan_out_buff, /* i : number of output channels */ const Word16 Opt_tsm, /* i : TSM option flag */ DECODER_TC_BUFFER_HANDLE hTcBuffer /* i : TSM buffer handle */ -#else - const Word16 nchan_out_buff_old, /* i : previous frame number of output channels */ - const Word16 nchan_out_buff /* i : number of output channels */ -#endif ) { -#ifdef FIX_1330_JBM_MEMORY Word16 ch, nchan_tc_jbm, nsamp_to_allocate, n_samp_full, offset; FOR( ch = 0; ch < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; ch++ ) @@ -495,35 +489,6 @@ ivas_error ivas_output_buff_dec_fx( offset = add( offset, n_samp_full ); } } -#else - Word16 ch; - - IF( GT_16( nchan_out_buff, nchan_out_buff_old ) ) - { - FOR( ch = nchan_out_buff_old; ch < nchan_out_buff; ch++ ) - { -#ifdef DEBUGGING - if ( p_output_fx[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_fx[ch] = (Word32 *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( Word32 ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for output audio buffer!\n" ) ); - } - } - } - ELSE - { - FOR( ch = nchan_out_buff; ch < nchan_out_buff_old; ch++ ) - { - free( p_output_fx[ch] ); - p_output_fx[ch] = NULL; - } - } -#endif return IVAS_ERR_OK; } -- GitLab From 1b990784754ff6a7b9353b576a160cae3cd363a6 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:50:49 +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 64209e04e..563fdeb36 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -128,9 +128,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) * @@ -278,10 +276,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 2d3d51d4b..6689dc9a6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -128,7 +128,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_1383_HEAD_TRACK_SANITIZER /* Nok: issue 1383: Fix head tracking struc values reading in renderer */ #define FIX_1330_JBM_MEMORY_FIX /* VA: basop issue: 2179 fix non-BE difference in FIX_1330_JBM_MEMORY */ diff --git a/lib_util/rotation_file_reader.c b/lib_util/rotation_file_reader.c index 9746c69ac..4385a9f83 100644 --- a/lib_util/rotation_file_reader.c +++ b/lib_util/rotation_file_reader.c @@ -197,14 +197,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_fx = float_to_fix( w, Q29 ); pQuaternion->x_fx = float_to_fix( x, Q29 ); -- GitLab From 496b858f460f1bc7838e35f1f86baecb66f71efa Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:50:59 +0100 Subject: [PATCH 18/21] [cleanup] accept FIX_1372_OSBA_OBJECT_EDITING --- lib_com/options.h | 1 - lib_dec/ivas_sba_dec_fx.c | 2 -- lib_dec/ivas_spar_decoder_fx.c | 6 ------ 3 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6689dc9a6..d9e1af7cf 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -145,7 +145,6 @@ #define TMP_FIX_OMASA_SR_BE // temporary fix to keep OMASA split-rendering BE #define NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES // Nokia: Fix 1399_1400 issue in float, this is essential for the BASOP porting #define OBJ_EDIT_BASOP -#define FIX_1372_OSBA_OBJECT_EDITING /* VA: issue 1372: Fix OSBA object-editing in BINAURAL_ROOM_IR */ #define FIX_2140_OBJECT_EDITING_SANITIZER_ISSUES /* Nokia: Issue 2140, fixes three different sanitizer issues persisting in object editing code. */ #define FIX_2193_ISM_GAINS_WITH_OE /* FhG: fix issue 2193: use edited angles in ISM gain calculation */ #define FIX_2192_OBJ_EDITING_EXT_METADATA /* Eri: Add support for extended metadata in object editing */ diff --git a/lib_dec/ivas_sba_dec_fx.c b/lib_dec/ivas_sba_dec_fx.c index a7f2931b2..c4a1b0de1 100644 --- a/lib_dec/ivas_sba_dec_fx.c +++ b/lib_dec/ivas_sba_dec_fx.c @@ -841,13 +841,11 @@ ivas_error ivas_sba_dec_render_fx( { nchan_out = s_max( nchan_internal, sub( st_ivas->hDecoderConfig->nchan_out, st_ivas->nchan_ism ) ); } -#ifdef FIX_1372_OSBA_OBJECT_EDITING ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) { nchan_out = BINAURAL_CHANNELS; move16(); } -#endif } nchan_out = s_min( nchan_out, ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ) ); diff --git a/lib_dec/ivas_spar_decoder_fx.c b/lib_dec/ivas_spar_decoder_fx.c index af0f9d149..864d05438 100644 --- a/lib_dec/ivas_spar_decoder_fx.c +++ b/lib_dec/ivas_spar_decoder_fx.c @@ -1735,13 +1735,7 @@ void ivas_spar_dec_upmixer_sf_fx( p_tc_fx[i] = st_ivas->hTcBuffer->tc_fx[( i + nchan_ism )] + prod; /*Q11*/ } -#ifdef FIX_1372_OSBA_OBJECT_EDITING IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) -#else - test(); - test(); - IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) && EQ_32( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) && EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) -#endif { FOR( i = 0; i < nchan_ism; i++ ) { -- GitLab From b2851e3cee96da79bf7b2000a6261bb8d59980a3 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:51:05 +0100 Subject: [PATCH 19/21] [cleanup] accept NONBE_FIX_1376_MDCT_CONCEALMENT --- lib_com/options.h | 1 - lib_dec/ivas_mdct_core_dec_fx.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index d9e1af7cf..e0b4f431b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -115,7 +115,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, float issue 1328 */ -#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_fx.c b/lib_dec/ivas_mdct_core_dec_fx.c index 0b3f4651f..b2af4c96b 100644 --- a/lib_dec/ivas_mdct_core_dec_fx.c +++ b/lib_dec/ivas_mdct_core_dec_fx.c @@ -1678,7 +1678,6 @@ void ivas_mdct_core_tns_ns_fx( q_x = add( q_x, 1 ); } -#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, @@ -1686,9 +1685,6 @@ void ivas_mdct_core_tns_ns_fx( in case this is not necessary, x[] is filled with zeros, and the multiplication is not causing any additional harm */ v_multc_fx( x_fx[ch][k] + st->hTcxCfg->psychParamsCurrent->nBins, sns_int_scf_fx[FDNS_NPTS - 1], x_fx[ch][k] + st->hTcxCfg->psychParamsCurrent->nBins, sub( s_max( L_spec[ch], L_frameTCX[ch] ), st->hTcxCfg->psychParamsCurrent->nBins ) ); -#else - v_multc_fx( x_fx[ch][k] + st->hTcxCfg->psychParamsCurrent->nBins, sns_int_scf_fx[FDNS_NPTS - 1], x_fx[ch][k] + st->hTcxCfg->psychParamsCurrent->nBins, sub( L_spec[ch], st->hTcxCfg->psychParamsCurrent->nBins ) ); -#endif q_2 = sub( add( q_x, q_sns_int_scf ), 31 ); Scale_sig32( &x_fx[ch][k][0], st->hTcxCfg->psychParamsCurrent->nBins, sub( q_2, q_x ) ); -- GitLab From 593b17fb21909814a02948045f777bbcae72a626 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:51:08 +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_fx.c | 18 ------------------ lib_rend/ivas_prot_rend_fx.h | 2 -- lib_rend/lib_rend.h | 2 -- lib_rend/lib_rend_fx.c | 24 ------------------------ 6 files changed, 49 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 264cc07b1..8256f1e46 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1354,7 +1354,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 ) { @@ -1363,7 +1362,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 e0b4f431b..34abbfeeb 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -115,7 +115,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, float issue 1328 */ -#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_fx.c b/lib_rend/ivas_objectRenderer_fx.c index c2e6b73fc..dd99c0070 100644 --- a/lib_rend/ivas_objectRenderer_fx.c +++ b/lib_rend/ivas_objectRenderer_fx.c @@ -631,16 +631,10 @@ ivas_error TDREND_Update_object_positions_fx( const ISM_METADATA_HANDLE *hIsmMetaData /* i : Input metadata for ISM objects */ ) { -#ifndef NONBE_1377_REND_DIRATT_CONF - TDREND_DirAtten_t *DirAtten_p; -#endif Word16 nS; Word32 Pos_fx[3]; // Q25 Word32 Dir_fx[3]; // Q30 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++ ) @@ -665,12 +659,6 @@ ivas_error TDREND_Update_object_positions_fx( { return error; } -#ifndef NONBE_1377_REND_DIRATT_CONF - IF( NE_32( ( error = TDREND_MIX_SRC_SetDirAtten_fx( hBinRendererTd, nS, DirAtten_p ) ), IVAS_ERR_OK ) ) - { - return error; - } -#endif if ( ( error = TDREND_MIX_SRC_SetGain( hBinRendererTd, nS, hIsmMetaData[nS]->gain_fx ) ) != IVAS_ERR_OK ) // TODO: Check Gain has correct Q-value { return error; @@ -825,9 +813,7 @@ ivas_error ivas_td_binaural_open_ext_fx( RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration */ LSSETUP_CUSTOM_STRUCT *customLsInput, const Word32 outFs, -#ifdef NONBE_1377_REND_DIRATT_CONF const Word16 object_id, /* i: Object ID */ -#endif Word16 *SrcInd, Word16 *num_src ) { @@ -877,11 +863,7 @@ ivas_error ivas_td_binaural_open_ext_fx( if ( NULL != hRendCfg ) { -#ifdef NONBE_1377_REND_DIRATT_CONF directivity_fx = hRendCfg->directivity_fx + 3 * object_id; /* Address calculation -- no BASOPs */ -#else - directivity_fx = hRendCfg->directivity_fx; -#endif distAtt_fx = hRendCfg->distAtt_fx; } diff --git a/lib_rend/ivas_prot_rend_fx.h b/lib_rend/ivas_prot_rend_fx.h index e257ccd12..a1e6f5167 100644 --- a/lib_rend/ivas_prot_rend_fx.h +++ b/lib_rend/ivas_prot_rend_fx.h @@ -683,9 +683,7 @@ ivas_error ivas_td_binaural_open_ext_fx( RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration */ LSSETUP_CUSTOM_STRUCT *customLsInput, const Word32 output_Fs, -#ifdef NONBE_1377_REND_DIRATT_CONF const Word16 object_id, /* i : Object ID */ -#endif Word16 *SrcInd, Word16 *num_src ); diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 4959a3a3c..1dd238afd 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -152,11 +152,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_fx( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index 07abd25f5..76045fab5 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -138,9 +138,7 @@ typedef struct Word32 nonDiegeticPanGain_fx; /* Q31 */ OMASA_ANA_HANDLE hOMasa; UWord16 total_num_objects; -#ifdef NONBE_1377_REND_DIRATT_CONF Word16 object_id; -#endif Word16 ism_metadata_delay_ms_fx; /* Q0 */ } input_ism; @@ -1854,11 +1852,7 @@ static ivas_error setRendInputActiveIsm( test(); IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { -#ifdef NONBE_1377_REND_DIRATT_CONF IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, inputIsm->object_id, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -1891,11 +1885,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( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate, inputIsm->object_id, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -1929,11 +1919,7 @@ static ivas_error setRendInputActiveIsm( } ELSE { -#ifdef NONBE_1377_REND_DIRATT_CONF IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, inputIsm->object_id, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -2871,11 +2857,7 @@ static ivas_error initMcBinauralRendering( { Word16 SrcInd[MAX_NUM_TDREND_CHANNELS]; Word16 num_src; -#ifdef NONBE_1377_REND_DIRATT_CONF IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputMc->tdRendWrapper, inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, 0, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputMc->tdRendWrapper, inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -2911,11 +2893,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( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputMc->splitTdRendWrappers[i], inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, 0, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputMc->splitTdRendWrappers[i], inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -4695,7 +4673,6 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( return IVAS_ERR_OK; } -#ifdef NONBE_1377_REND_DIRATT_CONF /*-------------------------------------------------------------------* * IVAS_REND_SetObjectIDs() @@ -4723,7 +4700,6 @@ ivas_error IVAS_REND_SetObjectIDs( return IVAS_ERR_OK; } -#endif /*-------------------------------------------------------------------* * IVAS_REND_SetInputGain() -- GitLab From a9f1139a626adabc51cab67f7c0bd1d487629abc Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 12 Nov 2025 10:53:57 +0100 Subject: [PATCH 21/21] clang-format --- lib_dec/ivas_core_dec_fx.c | 4 +-- lib_dec/ivas_cpe_dec_fx.c | 6 ++-- lib_dec/ivas_dirac_dec_fx.c | 3 +- lib_dec/ivas_ism_renderer_fx.c | 22 ++++++------ lib_dec/ivas_mdct_core_dec_fx.c | 8 ++--- lib_dec/ivas_omasa_dec_fx.c | 62 ++++++++++++++++----------------- lib_dec/ivas_stat_dec.h | 6 ++-- lib_dec/jbm_pcmdsp_apa.h | 2 +- lib_dec/jbm_pcmdsp_apa_fx.c | 2 +- lib_rend/ivas_output_init_fx.c | 2 +- lib_rend/lib_rend_fx.c | 2 +- 11 files changed, 59 insertions(+), 60 deletions(-) diff --git a/lib_dec/ivas_core_dec_fx.c b/lib_dec/ivas_core_dec_fx.c index 84f6391ac..23f75172a 100644 --- a/lib_dec/ivas_core_dec_fx.c +++ b/lib_dec/ivas_core_dec_fx.c @@ -1230,8 +1230,8 @@ ivas_error ivas_core_dec_fx( } ELSE { - /* TBE on top of ACELP@16kHz */ - tmps = NS2SA_FX2( output_Fs, MAX_DELAY_TBE_NS - DELAY_SWB_TBE_16k_NS ); + /* TBE on top of ACELP@16kHz */ + tmps = NS2SA_FX2( output_Fs, MAX_DELAY_TBE_NS - DELAY_SWB_TBE_16k_NS ); } /* Smooth transitions when switching between different technologies */ diff --git a/lib_dec/ivas_cpe_dec_fx.c b/lib_dec/ivas_cpe_dec_fx.c index e5b8837f0..7a134d59b 100644 --- a/lib_dec/ivas_cpe_dec_fx.c +++ b/lib_dec/ivas_cpe_dec_fx.c @@ -73,7 +73,7 @@ ivas_error ivas_cpe_dec_fx( Word16 last_bwidth; Word16 tdm_ratio_idx; Word32 outputHB_fx[CPE_CHANNELS][L_FRAME48k]; /* buffer for output HB synthesis, both channels */ /* Q11 */ - Word32 *res_buf_fx = NULL; /* Q8 */ + Word32 *res_buf_fx = NULL; /* Q8 */ CPE_DEC_HANDLE hCPE; STEREO_DFT_CONFIG_DATA_HANDLE hConfigDft; Decoder_State **sts; @@ -887,7 +887,7 @@ static ivas_error stereo_dft_dec_main( FOR( n = 0; n < hCPE->nchan_out; n++ ) { - Scale_sig32( output[n], output_frame, sub( hCPE->hStereoDft->q_dft, Q11 ) ); // q_dft + Scale_sig32( output[n], output_frame, sub( hCPE->hStereoDft->q_dft, Q11 ) ); // q_dft scale_sig32( hCPE->output_mem_fx[n], NS2SA_FX2( output_Fs, STEREO_DFT32MS_OVL_NS ), sub( hCPE->hStereoDft->q_dft, Q11 ) ); // q_dft hCPE->q_output_mem_fx[n] = hCPE->hStereoDft->q_dft; move16(); @@ -901,7 +901,7 @@ static ivas_error stereo_dft_dec_main( FOR( n = 0; n < hCPE->nchan_out; n++ ) { - Scale_sig32( output[n], output_frame, sub( Q11, hCPE->hStereoDft->q_dft ) ); // Q11 + Scale_sig32( output[n], output_frame, sub( Q11, hCPE->hStereoDft->q_dft ) ); // Q11 scale_sig32( hCPE->output_mem_fx[n], NS2SA_FX2( output_Fs, STEREO_DFT32MS_OVL_NS ), sub( Q11, hCPE->hStereoDft->q_dft ) ); // Q11 hCPE->q_output_mem_fx[n] = Q11; move16(); diff --git a/lib_dec/ivas_dirac_dec_fx.c b/lib_dec/ivas_dirac_dec_fx.c index ff8565917..11d80c14f 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -2255,8 +2255,7 @@ void ivas_dirac_dec_render_sf_fx( Word32 *output_buf_fx[], /* i/o: synthesized core-coder transport channels/DirAC output Q(6-1)*/ const Word16 nchan_transport, /* i : number of transport channels */ Word32 *pppQMfFrame_ts_re_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX], - Word32 *pppQMfFrame_ts_im_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX] -) + Word32 *pppQMfFrame_ts_im_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX] ) { Word16 i, ch, idx_in, idx_lfe; DIRAC_DEC_HANDLE hDirAC; diff --git a/lib_dec/ivas_ism_renderer_fx.c b/lib_dec/ivas_ism_renderer_fx.c index d8e5e069e..2e2a257a1 100644 --- a/lib_dec/ivas_ism_renderer_fx.c +++ b/lib_dec/ivas_ism_renderer_fx.c @@ -218,11 +218,11 @@ void ivas_ism_render_sf_fx( ism_md_subframe_update_jbm = sub( st_ivas->hTcBuffer->nb_subframes, 2 ); } - FOR( i = 0; i < num_objects; i++ ) - { - Copy32( &output_fx[i][tc_offset], tc_local_fx[i], n_samples_to_render ); - p_tc_fx[i] = tc_local_fx[i]; - } + FOR( i = 0; i < num_objects; i++ ) + { + Copy32( &output_fx[i][tc_offset], tc_local_fx[i], n_samples_to_render ); + p_tc_fx[i] = tc_local_fx[i]; + } FOR( i = 0; i < nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; i++ ) { @@ -497,7 +497,7 @@ void ivas_omasa_separate_object_render_jbm_fx( const UWord16 nSamplesRendered, /* i : number of samples rendered */ Word32 input_fx_in[][L_FRAME48k], /* i : separated object signal Q11*/ Word32 *output_fx[], /* o : rendered time signal Q11*/ - const Word16 subframes_rendered /* i : number of subframes rendered */ + const Word16 subframes_rendered /* i : number of subframes rendered */ ) { VBAP_HANDLE hVBAPdata; @@ -551,11 +551,11 @@ void ivas_omasa_separate_object_render_jbm_fx( output_fx_local[j] = output_fx[j]; } - FOR( obj = 0; obj < num_objects; obj++ ) - { - input_fx[obj] = input_fx_in[obj]; - move32(); - } + FOR( obj = 0; obj < num_objects; obj++ ) + { + input_fx[obj] = input_fx_in[obj]; + move32(); + } slots_to_render = idiv1616( nSamplesRendered, hSpatParamRendCom->slot_size ); first_sf = subframes_rendered; diff --git a/lib_dec/ivas_mdct_core_dec_fx.c b/lib_dec/ivas_mdct_core_dec_fx.c index b2af4c96b..e7507607f 100644 --- a/lib_dec/ivas_mdct_core_dec_fx.c +++ b/lib_dec/ivas_mdct_core_dec_fx.c @@ -1276,7 +1276,7 @@ void ivas_mdct_core_reconstruct_fx( st->Q_syn = add( sf, s_min( q_win, q_winFB ) ); Scale_sig( synth_buf_fx, add( add( st->hTcxDec->old_synth_len, L_FRAME_PLUS_INTERNAL ), M ), sub( q_syn, q_win ) ); // st->hTcxDec->q_old_synth -> q_syn - Scale_sig( synth_bufFB_fx, add( add( st->hTcxDec->old_synth_lenFB, L_FRAME_PLUS ), M ), sub( q_syn, q_winFB ) ); // st->hTcxDec->q_old_synth -> q_syn + Scale_sig( synth_bufFB_fx, add( add( st->hTcxDec->old_synth_lenFB, L_FRAME_PLUS ), M ), sub( q_syn, q_winFB ) ); // st->hTcxDec->q_old_synth -> q_syn // Scale_sig( st->syn, M + 1, add( st->Q_syn, 2 ) ); Scale_sig( st->syn, M + 1, sub( st->Q_syn, q_win ) ); @@ -1406,9 +1406,9 @@ void ivas_mdct_core_reconstruct_fx( Copy_Scale_sig_16_32_no_sat( st->p_bpf_noise_buf, st->p_bpf_noise_buf_32, st->L_frame, Q11 ); // Q0 -> Q11 } - Copy( synthFB_fx, signal_outFB_fx[ch], st->hTcxDec->L_frameTCX ); - e_sig[ch] = sub( 15, q_syn + st->Q_syn_factor ); - move16(); + Copy( synthFB_fx, signal_outFB_fx[ch], st->hTcxDec->L_frameTCX ); + e_sig[ch] = sub( 15, q_syn + st->Q_syn_factor ); + move16(); /* updates */ st->last_voice_factor_fx = 0; diff --git a/lib_dec/ivas_omasa_dec_fx.c b/lib_dec/ivas_omasa_dec_fx.c index 455f82c88..0c6c13d19 100644 --- a/lib_dec/ivas_omasa_dec_fx.c +++ b/lib_dec/ivas_omasa_dec_fx.c @@ -1104,59 +1104,59 @@ void ivas_omasa_dirac_rend_jbm_fx( Word16 n; Word32 data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; - *nSamplesRendered = s_min( nSamplesAsked, st_ivas->hTcBuffer->n_samples_available ); + *nSamplesRendered = s_min( nSamplesAsked, st_ivas->hTcBuffer->n_samples_available ); - test(); - IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_MASA_ONE_OBJ ) || EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) - { - Copy32( &output_fx[CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[0], *nSamplesRendered ); + test(); + IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_MASA_ONE_OBJ ) || EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) + { + Copy32( &output_fx[CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[0], *nSamplesRendered ); #ifdef NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES - IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) + IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) #else IF( !st_ivas->hDecoderConfig->Opt_tsm && EQ_32( 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++ ) + test(); + IF( st_ivas->hMasaIsmData->ism_gain_is_edited[n] && EQ_16( st_ivas->hMasaIsmData->idx_separated_ism, n ) ) { - test(); - IF( st_ivas->hMasaIsmData->ism_gain_is_edited[n] && EQ_16( st_ivas->hMasaIsmData->idx_separated_ism, n ) ) - { - v_multc_fx_16( data_separated_objects[0], st_ivas->hMasaIsmData->gain_ism_edited_fx[n], data_separated_objects[0], *nSamplesRendered ); // Q = 8 - Scale_sig32( data_separated_objects[0], *nSamplesRendered, Q3 ); // Q = 11 - } + v_multc_fx_16( data_separated_objects[0], st_ivas->hMasaIsmData->gain_ism_edited_fx[n], data_separated_objects[0], *nSamplesRendered ); // Q = 8 + Scale_sig32( data_separated_objects[0], *nSamplesRendered, Q3 ); // Q = 11 } } } - ELSE + } + ELSE + { + FOR( n = 0; n < st_ivas->nchan_ism; n++ ) { - FOR( n = 0; n < st_ivas->nchan_ism; n++ ) - { - Copy32( &output_fx[n + CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[n], *nSamplesRendered ); + Copy32( &output_fx[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_fx_16( data_separated_objects[n], st_ivas->hMasaIsmData->gain_ism_edited_fx[n], data_separated_objects[n], *nSamplesRendered ); // Q = 8 - Scale_sig32( data_separated_objects[n], *nSamplesRendered, Q3 ); // Q = 11 - } + { + v_multc_fx_16( data_separated_objects[n], st_ivas->hMasaIsmData->gain_ism_edited_fx[n], data_separated_objects[n], *nSamplesRendered ); // Q = 8 + Scale_sig32( data_separated_objects[n], *nSamplesRendered, Q3 ); // Q = 11 } + } - /* 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_fx_16( output_fx[n], st_ivas->hMasaIsmData->gain_masa_edited_fx, output_fx[n], *nSamplesRendered ); // Q = 8 - Scale_sig32( output_fx[n], *nSamplesRendered, Q3 ); // Q = 11 - } + v_multc_fx_16( output_fx[n], st_ivas->hMasaIsmData->gain_masa_edited_fx, output_fx[n], *nSamplesRendered ); // Q = 8 + Scale_sig32( output_fx[n], *nSamplesRendered, Q3 ); // Q = 11 } } + } subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; move16(); diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 46c0d760a..b2e5ecc9b 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1018,9 +1018,9 @@ typedef struct ivas_masa_ism_data_structure typedef struct decoder_tc_buffer_structure { Word32 *tc_buffer_old_fx[MAX_INTERN_CHANNELS]; /* TC audio samples not rendered in the previous frame */ - Word32 *tc_buffer_fx; /* the buffer itself */ - Word32 *tc_fx[MAX_INTERN_CHANNELS]; /* pointers into the buffer to the beginning of each tc */ - Word16 no_channels; /*Stores no of channels in tc_fx with values*/ + Word32 *tc_buffer_fx; /* the buffer itself */ + Word32 *tc_fx[MAX_INTERN_CHANNELS]; /* pointers into the buffer to the beginning of each tc */ + Word16 no_channels; /*Stores no of channels in tc_fx with values*/ Word16 q_tc_fx; TC_BUFFER_MODE tc_buffer_mode; /* mode of the buffer (no buffering, render buffering, out buffering) */ Word16 nchan_transport_jbm; /* number of TCs after TC decoding */ diff --git a/lib_dec/jbm_pcmdsp_apa.h b/lib_dec/jbm_pcmdsp_apa.h index af937febb..2c3bc84c8 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_dec/jbm_pcmdsp_apa_fx.c b/lib_dec/jbm_pcmdsp_apa_fx.c index c5919ffe9..14cf7dff3 100644 --- a/lib_dec/jbm_pcmdsp_apa_fx.c +++ b/lib_dec/jbm_pcmdsp_apa_fx.c @@ -130,7 +130,7 @@ struct apa_state_t #ifdef FIX_2173_UBSAN_IN_JBM_PCMDSP_APA Word16 last_pitch; /* last pitch/sync position */ #else - UWord16 last_pitch; /* last pitch/sync position */ + UWord16 last_pitch; /* last pitch/sync position */ #endif UWord16 bad_frame_count; /* # frames before quality threshold is lowered */ UWord16 good_frame_count; /* # scaled frames */ diff --git a/lib_rend/ivas_output_init_fx.c b/lib_rend/ivas_output_init_fx.c index 7c5b53b29..053cb43c1 100644 --- a/lib_rend/ivas_output_init_fx.c +++ b/lib_rend/ivas_output_init_fx.c @@ -422,7 +422,7 @@ Word16 ivas_get_nchan_buffers_dec_fx( *-------------------------------------------------------------------*/ ivas_error ivas_output_buff_dec_fx( - Word32 *p_output_fx[], /* i/o: output audio buffers */ + Word32 *p_output_fx[], /* i/o: output audio buffers */ const Word16 nchan_out_buff, /* i : number of output channels */ const Word16 Opt_tsm, /* i : TSM option flag */ DECODER_TC_BUFFER_HANDLE hTcBuffer /* i : TSM buffer handle */ diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index 76045fab5..b70cdcadb 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -4574,7 +4574,7 @@ ivas_error IVAS_REND_AddInput_fx( 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( NE_32( ( error = findFreeInputSlot_fx( inputsArray, inputType, maxNumInputsOfType, &inputIndex ) ), IVAS_ERR_OK ) ) { return error; -- GitLab