From 0022fc7d38ba579292d452b6c84ae6a910080147 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 15:56:19 +0200 Subject: [PATCH 01/11] [cleanup] accept FIX_963_USAN_ERROR --- lib_com/options.h | 1 - lib_enc/ivas_stereo_dft_enc_itd.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index e91b5a9af..605c44df2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -193,7 +193,6 @@ #define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ #define FIX_INV_DIFFUSE_WEIGHT /* Orange : Fix error in energy compensation in late binaural */ #endif -#define FIX_963_USAN_ERROR /* Eri: Issue 963: USAN error in Stereo CNG, division by zero */ #define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ #define FIX_971_LOG2_IDX_GAIN_0 /* VA: prevent -Inf due to log2(ratio==0) */ diff --git a/lib_enc/ivas_stereo_dft_enc_itd.c b/lib_enc/ivas_stereo_dft_enc_itd.c index 4642f162a..1c29ea716 100644 --- a/lib_enc/ivas_stereo_dft_enc_itd.c +++ b/lib_enc/ivas_stereo_dft_enc_itd.c @@ -910,7 +910,6 @@ void stereo_dft_enc_compute_itd( { hStereoDft->expectedNumUpdates += 1 + min( hCPE->hFrontVad[0]->rem_dtx_ho, hCPE->hFrontVad[1]->rem_dtx_ho ); } -#ifdef FIX_963_USAN_ERROR if ( hStereoDft->expectedNumUpdates + hStereoDft->currentNumUpdates == 0 ) { cng_xcorr_filt = max( CORR_FILT, sfm_L ); @@ -919,9 +918,6 @@ void stereo_dft_enc_compute_itd( { cng_xcorr_filt = max( min( CORR_FILT, 10.0f * CORR_FILT / ( hStereoDft->expectedNumUpdates + hStereoDft->currentNumUpdates ) ), sfm_L ); } -#else - cng_xcorr_filt = max( min( CORR_FILT, 10.0f * CORR_FILT / ( hStereoDft->expectedNumUpdates + hStereoDft->currentNumUpdates ) ), sfm_L ); -#endif hStereoDft->currentNumUpdates++; for ( i = 1; i < NFFT / 2; i++ ) { @@ -956,7 +952,6 @@ void stereo_dft_enc_compute_itd( if ( vad_flag_dtx[0] == 0 ) { /* expectedNumUpdates updated after call to dtx() in SID frames */ -#ifdef FIX_963_USAN_ERROR if ( hStereoDft->expectedNumUpdates + hStereoDft->currentNumUpdates == 0 ) { cng_xcorr_filt = max( CORR_FILT, sfm_L ); @@ -965,9 +960,6 @@ void stereo_dft_enc_compute_itd( { cng_xcorr_filt = max( min( CORR_FILT, 10.0f * CORR_FILT / ( hStereoDft->expectedNumUpdates + hStereoDft->currentNumUpdates ) ), sfm_L ); } -#else - cng_xcorr_filt = max( min( CORR_FILT, 10.0f * CORR_FILT / ( hStereoDft->expectedNumUpdates + hStereoDft->currentNumUpdates ) ), sfm_L ); -#endif hStereoDft->currentNumUpdates++; hStereoDft->sfm = cng_xcorr_filt; } -- GitLab From f2b15a11c28fd93841ffe4e3aec6b37712a159c0 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 15:56:21 +0200 Subject: [PATCH 02/11] [cleanup] accept FIX_971_LOG2_IDX_GAIN_0 --- lib_com/options.h | 1 - lib_enc/swb_tbe_enc.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 605c44df2..a3dc18697 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -194,7 +194,6 @@ #define FIX_INV_DIFFUSE_WEIGHT /* Orange : Fix error in energy compensation in late binaural */ #endif #define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ -#define FIX_971_LOG2_IDX_GAIN_0 /* VA: prevent -Inf due to log2(ratio==0) */ #define BE_FIX_567_DOUBLE_STEREO_DMX /* NTT: Fix formal issues */ #define NONBE_FIX_567_DOUBLE_STEREO_DMX /* Orange: Double-precision replaced by single-precision */ diff --git a/lib_enc/swb_tbe_enc.c b/lib_enc/swb_tbe_enc.c index 3b5b4da9f..f748e8cdf 100644 --- a/lib_enc/swb_tbe_enc.c +++ b/lib_enc/swb_tbe_enc.c @@ -2753,12 +2753,10 @@ void fb_tbe_enc( hBWE_TD->prev_fb_energy = sum2_f( input_fhb + L_FRAME48k / 2, L_FRAME48k / 2 ); fb_exc_energy = sum2_f( fb_exc, L_FRAME16k ) + EPSILON; ratio = (float) sqrt( temp2 / fb_exc_energy ); -#ifdef FIX_971_LOG2_IDX_GAIN_0 if ( ratio < 1.0f ) { ratio = 1.0f; } -#endif idxGain = (int16_t) ( log2_f( (float) ratio ) + 0.5f ); idxGain = max( 0, min( 15, idxGain ) ); ratio = (float) ( 1 << idxGain ); -- GitLab From 6c31c0c0a4dcc08cf080fdff8e1bd6963adeddb9 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 15:56:24 +0200 Subject: [PATCH 03/11] [cleanup] accept FIX_ACCESS_WITHIN_NULL_STRUCT_MC_BW_SWITCHING --- lib_com/options.h | 1 - lib_enc/ivas_mct_core_enc.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a3dc18697..cf000b353 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -216,7 +216,6 @@ #define NONBE_FIX_975_JBM_USAN /* FhG: Fix issue #975, USAN in JBM decoding ad 13.2kbps */ #define FIX_944_REMOVE_LS_RENDERER_CALL_IN_STEREO /* VA: issue 994: remove an obsolete call of function ivas_ls_setup_conversion() in stereo */ -#define FIX_ACCESS_WITHIN_NULL_STRUCT_MC_BW_SWITCHING /* FhG: fix usan error in MCT with bw swicthing */ #define NONBE_FIX_986_MC_BW_SWITCHING /* FhG: fix crash in bw and br switching with MC */ #define NONBE_FIX_999_JBM_MCT_FLUSH /* FhG: issue #999: fix wrong flushing for MCT at a JBM rate switch */ #define NONBE_FIX_1000_G1_G2_SWB_TBE /* VA: issue 1000: avoid div by zero due to g1 + g2 being zero in SWB TBE */ diff --git a/lib_enc/ivas_mct_core_enc.c b/lib_enc/ivas_mct_core_enc.c index 6146378f4..e0a643e67 100644 --- a/lib_enc/ivas_mct_core_enc.c +++ b/lib_enc/ivas_mct_core_enc.c @@ -279,14 +279,10 @@ void ivas_mct_core_enc( if ( switch_bw ) { -#ifdef FIX_ACCESS_WITHIN_NULL_STRUCT_MC_BW_SWITCHING H_IGF_GRID igf_grid; igf_grid = sts[ch_core]->igf ? sts[ch_core]->hIGFEnc->igfData.igfInfo.grid : NULL; initMdctStereoEncData( hMCT->hBlockData[ch]->hStereoMdct, ivas_format, sts[ch_core]->element_mode, sts[ch_core]->element_brate, sts[ch_core]->bwidth, sts[ch_core]->igf, igf_grid, 0 ); -#else - initMdctStereoEncData( hMCT->hBlockData[ch]->hStereoMdct, ivas_format, sts[ch_core]->element_mode, sts[ch_core]->element_brate, sts[ch_core]->bwidth, sts[ch_core]->igf, sts[ch_core]->hIGFEnc->igfData.igfInfo.grid, 0 ); -#endif } if ( sts[ch_core]->igf ) -- GitLab From 2367d7ef92705685344840c73db0c28f3f0f76e5 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 15:56:26 +0200 Subject: [PATCH 04/11] [cleanup] accept FIX_983_DISC_ISM_DIGEST_NUM_OBJS --- lib_com/options.h | 1 - lib_dec/ivas_ism_param_dec.c | 9 --------- 2 files changed, 10 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index cf000b353..97faae8f4 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -209,7 +209,6 @@ #define NONBE_FIX_951_MCMASA_5MS_RENDERING /* Nokia: issue #951: Differences for 5ms and 20ms rendering for McMASA at 13.2kbps to BINAURAL */ #define NONBE_FIX_979_OSBA_STEREO_5MS /* FhG : issue #979 : 5ms and 20ms output different for OSBA and stereo */ -#define FIX_983_DISC_ISM_DIGEST_NUM_OBJS /* FhG: issue #983: the discrete ISM digest function uses the wrong number of objects */ #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ #define NONBE_FIX_974_OSBA_JBM_MONO_RS_USAN /* FhG : issue #974: usan in mono and stereo output in OSBA JBM RS */ #define NONBE_FIX_982_OMASA_DELAY_COMP_5MS /* FhG : issue #982 : 5ms and 20ms output different for OMASA */ diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index 955c7c9e9..e8839f270 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -996,11 +996,7 @@ void ivas_ism_dec_digest_tc( st_ivas->renderer_type == RENDERER_OSBA_STEREO || ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM && st_ivas->hDecoderConfig->Opt_Headrotation == 0 ) ) { -#ifdef FIX_983_DISC_ISM_DIGEST_NUM_OBJS int16_t i; -#else - int16_t i, num_objects; -#endif int16_t azimuth, elevation; /* we have a full frame interpolator, adapt it */ @@ -1033,12 +1029,7 @@ void ivas_ism_dec_digest_tc( } /* also get the gains here */ -#ifdef FIX_983_DISC_ISM_DIGEST_NUM_OBJS for ( i = 0; i < st_ivas->nchan_ism; i++ ) -#else - num_objects = st_ivas->nchan_transport; - for ( i = 0; i < num_objects; i++ ) -#endif { mvr2r( st_ivas->hIsmRendererData->gains[i], st_ivas->hIsmRendererData->prev_gains[i], MAX_OUTPUT_CHANNELS ); -- GitLab From 2ee3362715835bf9a9ce6378553da22f0e4507c3 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 15:56:30 +0200 Subject: [PATCH 05/11] [cleanup] accept NONBE_FIX_974_OSBA_JBM_MONO_RS_USAN --- lib_com/options.h | 1 - lib_dec/ivas_sba_dec.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 97faae8f4..5224b938e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -210,7 +210,6 @@ #define NONBE_FIX_979_OSBA_STEREO_5MS /* FhG : issue #979 : 5ms and 20ms output different for OSBA and stereo */ #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ -#define NONBE_FIX_974_OSBA_JBM_MONO_RS_USAN /* FhG : issue #974: usan in mono and stereo output in OSBA JBM RS */ #define NONBE_FIX_982_OMASA_DELAY_COMP_5MS /* FhG : issue #982 : 5ms and 20ms output different for OMASA */ #define NONBE_FIX_975_JBM_USAN /* FhG: Fix issue #975, USAN in JBM decoding ad 13.2kbps */ #define FIX_944_REMOVE_LS_RENDERER_CALL_IN_STEREO /* VA: issue 994: remove an obsolete call of function ivas_ls_setup_conversion() in stereo */ diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 5619ee2b5..335c5a2c3 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -254,11 +254,7 @@ ivas_error ivas_sba_dec_reconfigure( } /* save old */ -#ifdef NONBE_FIX_974_OSBA_JBM_MONO_RS_USAN if ( ism_mode_old != ISM_SBA_MODE_DISC && st_ivas->hTcBuffer->tc_buffer_mode != TC_BUFFER_MODE_BUFFER ) -#else - if ( ism_mode_old != ISM_SBA_MODE_DISC ) -#endif { if ( st_ivas->hDirAC == NULL && st_ivas->hSpar != NULL ) { -- GitLab From 3052fbcbc8e0e44f20a48dc1c0f5638a4064548f Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 15:56:33 +0200 Subject: [PATCH 06/11] [cleanup] accept NONBE_FIX_973_HODIRAC_BAND_GROUPING --- lib_com/ivas_dirac_com.c | 7 ------- lib_com/options.h | 1 - 2 files changed, 8 deletions(-) diff --git a/lib_com/ivas_dirac_com.c b/lib_com/ivas_dirac_com.c index 1ffeb6564..654640902 100644 --- a/lib_com/ivas_dirac_com.c +++ b/lib_com/ivas_dirac_com.c @@ -447,14 +447,7 @@ ivas_error ivas_dirac_sba_config( else { hQMetaData->useLowerBandRes = 0; -#ifndef NONBE_FIX_973_HODIRAC_BAND_GROUPING - if ( hodirac_flag == 0 ) - { - nbands_coded = nbands - 1; /* always combine the last two bands */ - } -#else nbands_coded = nbands - 1; /* always combine the last two bands */ -#endif } { diff --git a/lib_com/options.h b/lib_com/options.h index 5224b938e..552f34792 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -193,7 +193,6 @@ #define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ #define FIX_INV_DIFFUSE_WEIGHT /* Orange : Fix error in energy compensation in late binaural */ #endif -#define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ #define BE_FIX_567_DOUBLE_STEREO_DMX /* NTT: Fix formal issues */ #define NONBE_FIX_567_DOUBLE_STEREO_DMX /* Orange: Double-precision replaced by single-precision */ -- GitLab From cd9e03e11ff2c27682d928a96b9a3501ab330e46 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 15:56:35 +0200 Subject: [PATCH 07/11] [cleanup] accept NONBE_FIX_951_MCMASA_5MS_RENDERING --- lib_com/ivas_prot.h | 2 -- lib_com/options.h | 1 - lib_dec/fd_cng_dec.c | 6 ------ lib_dec/ivas_dirac_dec.c | 8 -------- lib_dec/ivas_sba_dec.c | 4 ---- lib_rend/ivas_dirac_dec_binaural_functions.c | 18 ------------------ 6 files changed, 39 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 949a30fdb..31860368b 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3719,9 +3719,7 @@ void generate_masking_noise_lb_dirac( HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ float *tdBuffer, /* i/o: time-domain signal, if NULL no LB-CNA */ const int16_t nCldfbTs, /* i : number of CLDFB slots that will be rendered */ -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i : common spatial rendering parameters handle */ -#endif const int16_t cna_flag /* i : CNA flag for LB and HB */ ); diff --git a/lib_com/options.h b/lib_com/options.h index 552f34792..3d0558fe2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -205,7 +205,6 @@ #define NONBE_FIX_947_STEREO_DMX_FADOPT /* Orange: Fading optimisation */ #endif -#define NONBE_FIX_951_MCMASA_5MS_RENDERING /* Nokia: issue #951: Differences for 5ms and 20ms rendering for McMASA at 13.2kbps to BINAURAL */ #define NONBE_FIX_979_OSBA_STEREO_5MS /* FhG : issue #979 : 5ms and 20ms output different for OSBA and stereo */ #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ diff --git a/lib_dec/fd_cng_dec.c b/lib_dec/fd_cng_dec.c index 99531a0da..14aa41f38 100644 --- a/lib_dec/fd_cng_dec.c +++ b/lib_dec/fd_cng_dec.c @@ -1805,9 +1805,7 @@ void generate_masking_noise_lb_dirac( HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ float *tdBuffer, /* i/o: time-domain signal, if NULL no LB-CNA */ const int16_t nCldfbTs, /* i : number of CLDFB slots that will be rendered */ -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i : common spatial rendering parameters handle */ -#endif const int16_t cna_flag /* i : CNA flag for LB and HB */ ) { @@ -1860,12 +1858,10 @@ void generate_masking_noise_lb_dirac( /* LB CLDFB - CNA from STFT: CNA applied only in channel 0*/ if ( cna_flag && tdBuffer != NULL ) { -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING int16_t cur_subframe; int16_t cur_subframe_start_outfs; int16_t cur_subframe_start_cngfs; int16_t slot_size_cng; -#endif while ( n_samples_out > 0 ) { @@ -1950,7 +1946,6 @@ void generate_masking_noise_lb_dirac( n_samples_out -= hFdCngCom->frameSize; n_samples_start += hFdCngCom->frameSize; } -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING /* move generated noise to the 5ms subframe starts in the tc buffer according to the output sampling frequency to avoid overwriting it with the synthesis in case of shared tc and synth channel memory, i.e. non-TSM mode */ slot_size_cng = hFdCngCom->frameSize / DEFAULT_JBM_CLDFB_TIMESLOTS; @@ -1971,7 +1966,6 @@ void generate_masking_noise_lb_dirac( /* set everything else to zero */ set_zero( tdBuffer + cur_subframe_start_outfs + move_size, subframe_size_outfs - move_size ); } -#endif } pop_wmops(); diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 7376fdf46..800b28aac 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1952,18 +1952,10 @@ void ivas_dirac_dec_render_sf( generate_masking_noise_dirac( st->hFdCngDec->hFdCngCom, st_ivas->cldfbAnaDec[1], -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING &st_ivas->hTcBuffer->tc[1][hSpatParamRendCom->num_freq_bands * hSpatParamRendCom->slots_rendered], -#else - st_ivas->hTcBuffer->tc[1], -#endif Cldfb_RealBuffer[1][0], Cldfb_ImagBuffer[1][0], -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING slot_idx, -#else - index_slot, -#endif st->cna_dirac_flag && st->flag_cna, ( st->core_brate == FRAME_NO_DATA || st->core_brate == SID_2k40 ) && st->cng_type == FD_CNG && st->cng_sba_flag ); } diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 335c5a2c3..a50dcf348 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -758,11 +758,7 @@ void ivas_sba_dec_digest_tc( ( ( st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) && ( nchan_transport == 1 && st_ivas->nchan_transport != 2 && st_ivas->hSCE[0]->hCoreCoder[0] != NULL && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag ) ) ) { Decoder_State *st = st_ivas->hSCE[0]->hCoreCoder[0]; -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING generate_masking_noise_lb_dirac( st->hFdCngDec->hFdCngCom, st_ivas->hTcBuffer->tc[1], nCldfbSlots, st_ivas->hSpatParamRendCom, st->cna_dirac_flag && st->flag_cna ); -#else - generate_masking_noise_lb_dirac( st->hFdCngDec->hFdCngCom, st_ivas->hTcBuffer->tc[1], nCldfbSlots, st->cna_dirac_flag && st->flag_cna ); -#endif } return; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 5ea4eaa7b..e769f9d90 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -677,28 +677,14 @@ static void ivas_dirac_dec_binaural_internal( if ( st_ivas->hSCE[0]->hCoreCoder[0] != NULL && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag ) { int16_t numCoreBands, b; -#ifndef NONBE_FIX_951_MCMASA_5MS_RENDERING - int16_t slotInFrame; -#endif numCoreBands = st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->numCoreBands; -#ifndef NONBE_FIX_951_MCMASA_5MS_RENDERING - slotInFrame = hSpatParamRendCom->slots_rendered + slot; -#endif generate_masking_noise_dirac( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom, st_ivas->cldfbAnaDec[1], -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING &st_ivas->hTcBuffer->tc[nchan_transport][hSpatParamRendCom->num_freq_bands * hSpatParamRendCom->slots_rendered], -#else - st_ivas->hTcBuffer->tc[nchan_transport], -#endif Cldfb_RealBuffer_in[2][slot], Cldfb_ImagBuffer_in[2][slot], -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING slot, -#else - slotInFrame, -#endif st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag && st_ivas->hSCE[0]->hCoreCoder[0]->flag_cna, ( st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == FRAME_NO_DATA || st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == SID_2k40 ) && ( st_ivas->hSCE[0]->hCoreCoder[0]->cng_type == FD_CNG ) && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag ); @@ -706,11 +692,7 @@ static void ivas_dirac_dec_binaural_internal( st_ivas->cldfbAnaDec[1], /*nothing will be analyzed, just get cnst*/ NULL, Cldfb_RealBuffer_in[1][slot], Cldfb_ImagBuffer_in[1][slot], -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING slot, -#else - slotInFrame, -#endif st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag && st_ivas->hSCE[0]->hCoreCoder[0]->flag_cna, ( st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == FRAME_NO_DATA || st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == SID_2k40 ) && ( st_ivas->hSCE[0]->hCoreCoder[0]->cng_type == FD_CNG ) && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag ); -- GitLab From 402227e7878383cfc422e9c11b1f56accf9ee96b Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 15:56:37 +0200 Subject: [PATCH 08/11] [cleanup] accept NONBE_FIX_979_OSBA_STEREO_5MS --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 4 ---- lib_dec/ivas_osba_dec.c | 8 -------- lib_rend/ivas_output_init.c | 2 -- 4 files changed, 15 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 3d0558fe2..efc27d08c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -206,7 +206,6 @@ #endif -#define NONBE_FIX_979_OSBA_STEREO_5MS /* FhG : issue #979 : 5ms and 20ms output different for OSBA and stereo */ #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ #define NONBE_FIX_982_OMASA_DELAY_COMP_5MS /* FhG : issue #982 : 5ms and 20ms output different for OMASA */ #define NONBE_FIX_975_JBM_USAN /* FhG: Fix issue #975, USAN in JBM decoding ad 13.2kbps */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 78a09f5a3..07623c8c1 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1001,11 +1001,7 @@ ivas_error ivas_jbm_dec_render( for ( n = 0; n < st_ivas->hTcBuffer->nchan_buffer_full; n++ ) { -#ifdef NONBE_FIX_979_OSBA_STEREO_5MS p_tc[n] = &p_output[n][st_ivas->hTcBuffer->n_samples_rendered]; -#else - p_tc[n] = p_output[n]; -#endif } for ( n = 0; n < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; n++ ) diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c index 9437bdb55..74321e83c 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -271,24 +271,16 @@ ivas_error ivas_osba_render_sf( p_output_ism[n] = &output_ism[n][0]; } -#ifdef NONBE_FIX_979_OSBA_STEREO_5MS if ( !st_ivas->hDecoderConfig->Opt_tsm ) { int16_t tc_offset; tc_offset = st_ivas->hTcBuffer->n_samples_rendered; -#endif for ( n = 0; n < st_ivas->nchan_ism; n++ ) { -#ifdef NONBE_FIX_979_OSBA_STEREO_5MS mvr2r( &p_output[n][tc_offset], &output_ism[n][tc_offset], nSamplesAsked ); -#else - mvr2r( p_output[n], output_ism[n], nSamplesAsked ); -#endif } -#ifdef NONBE_FIX_979_OSBA_STEREO_5MS } -#endif if ( ( error = ivas_sba_dec_render( st_ivas, nSamplesAsked, nSamplesRendered, nSamplesAvailableNext, p_output ) ) != IVAS_ERR_OK ) diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 11eec0dd7..4f77c20b7 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -293,12 +293,10 @@ int16_t ivas_get_nchan_buffers_dec( { nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); } -#ifdef NONBE_FIX_979_OSBA_STEREO_5MS else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { nchan_out_buff = max( nchan_out_buff, 2 * BINAURAL_CHANNELS + 2 ); } -#endif else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { nchan_out_buff = max( audioCfg2channels( st_ivas->transport_config ), audioCfg2channels( st_ivas->intern_config ) ); -- GitLab From ff67fea7aa91c8045d24583650c885c038b3ca78 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 15:56:39 +0200 Subject: [PATCH 09/11] [cleanup] accept NONBE_FIX_986_MC_BW_SWITCHING --- lib_com/options.h | 1 - lib_enc/bw_detect.c | 16 ---------------- lib_enc/ivas_cpe_enc.c | 4 ---- lib_enc/ivas_mct_enc.c | 10 ---------- 4 files changed, 31 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index efc27d08c..247501b63 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -211,7 +211,6 @@ #define NONBE_FIX_975_JBM_USAN /* FhG: Fix issue #975, USAN in JBM decoding ad 13.2kbps */ #define FIX_944_REMOVE_LS_RENDERER_CALL_IN_STEREO /* VA: issue 994: remove an obsolete call of function ivas_ls_setup_conversion() in stereo */ -#define NONBE_FIX_986_MC_BW_SWITCHING /* FhG: fix crash in bw and br switching with MC */ #define NONBE_FIX_999_JBM_MCT_FLUSH /* FhG: issue #999: fix wrong flushing for MCT at a JBM rate switch */ #define NONBE_FIX_1000_G1_G2_SWB_TBE /* VA: issue 1000: avoid div by zero due to g1 + g2 being zero in SWB TBE */ diff --git a/lib_enc/bw_detect.c b/lib_enc/bw_detect.c index cd26afb12..6a08b04d2 100644 --- a/lib_enc/bw_detect.c +++ b/lib_enc/bw_detect.c @@ -713,7 +713,6 @@ int16_t set_bw_mct( } bw_changed = 0; -#ifdef NONBE_FIX_986_MC_BW_SWITCHING if ( mct_bwidth != last_mct_bwidth ) { bw_changed = 1; @@ -732,21 +731,6 @@ int16_t set_bw_mct( st->bwidth = mct_bwidth; } } -#else - if ( mct_bwidth != last_mct_bwidth ) - { - bw_changed = 1; - - for ( cpe_id = 0; cpe_id < nCPE; cpe_id++ ) - { - for ( ch = 0; ch < CPE_CHANNELS; ch++ ) - { - st = hCPE[cpe_id]->hCoreCoder[ch]; - st->bwidth = mct_bwidth; - } - } - } -#endif return bw_changed; } diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 5b74cec0c..dbaeb581f 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -579,14 +579,10 @@ ivas_error ivas_cpe_enc( { int16_t igf; -#ifdef NONBE_FIX_986_MC_BW_SWITCHING int16_t bw; bw = ( hCPE->element_mode == IVAS_CPE_MDCT ) ? sts[n]->bwidth : sts[n]->max_bwidth; igf = getIgfPresent( sts[n]->element_mode, sts[n]->bits_frame_nominal * FRAMES_PER_SEC, bw, sts[n]->rf_mode ); -#else - igf = getIgfPresent( sts[n]->element_mode, sts[n]->bits_frame_nominal * FRAMES_PER_SEC, sts[n]->max_bwidth, sts[n]->rf_mode ); -#endif if ( ( error = IGF_Reconfig( &sts[n]->hIGFEnc, igf, 0, sts[n]->bits_frame_nominal * FRAMES_PER_SEC, sts[n]->max_bwidth, sts[n]->element_mode, sts[n]->rf_mode ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_enc/ivas_mct_enc.c b/lib_enc/ivas_mct_enc.c index 253ba48c1..023f603db 100644 --- a/lib_enc/ivas_mct_enc.c +++ b/lib_enc/ivas_mct_enc.c @@ -172,9 +172,6 @@ ivas_error ivas_mct_enc( float orig_spectrum_long[MCT_MAX_BLOCKS][CPE_CHANNELS][L_FRAME48k]; int16_t switch_bw; IVAS_FORMAT ivas_format; -#ifndef NONBE_FIX_986_MC_BW_SWITCHING - int16_t max_bwidth; -#endif int32_t ivas_total_brate; ivas_error error; float *pdata[MAX_INPUT_CHANNELS]; @@ -188,9 +185,6 @@ ivas_error ivas_mct_enc( hMCT->hBstr = st_ivas->hCPE[0]->hCoreCoder[0]->hBstr; /* pointer to write MCT side bits */ ivas_format = st_ivas->hEncoderConfig->ivas_format; -#ifndef NONBE_FIX_986_MC_BW_SWITCHING - max_bwidth = st_ivas->hEncoderConfig->max_bwidth; -#endif ivas_total_brate = st_ivas->hEncoderConfig->ivas_total_brate; #ifdef DEBUG_FORCE_MCT_CP @@ -234,11 +228,7 @@ ivas_error ivas_mct_enc( for ( n = 0; n < (int16_t) ( hMCT->nchan_out_woLFE * 0.5 ); n++ ) { -#ifdef NONBE_FIX_986_MC_BW_SWITCHING initMdctStereoEncData( hMCT->hBlockData[n]->hStereoMdct, ivas_format, IVAS_CPE_MDCT, cp_bitrate, st_ivas->hCPE[0]->hCoreCoder[0]->bwidth, st_ivas->hCPE[0]->hCoreCoder[0]->igf, st_ivas->hCPE[0]->hCoreCoder[0]->igf ? st_ivas->hCPE[0]->hCoreCoder[0]->hIGFEnc->igfData.igfInfo.grid : NULL, 0 ); -#else - initMdctStereoEncData( hMCT->hBlockData[n]->hStereoMdct, ivas_format, IVAS_CPE_MDCT, cp_bitrate, max_bwidth, st_ivas->hCPE[0]->hCoreCoder[0]->igf, st_ivas->hCPE[0]->hCoreCoder[0]->igf ? st_ivas->hCPE[0]->hCoreCoder[0]->hIGFEnc->igfData.igfInfo.grid : NULL, 0 ); -#endif } } -- GitLab From 6a7f832f80836c123219db7d47961dc69892773f Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 15:56:42 +0200 Subject: [PATCH 10/11] [cleanup] accept NONBE_FIX_975_JBM_USAN --- lib_com/options.h | 1 - lib_dec/lib_dec.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 247501b63..af91900f7 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -208,7 +208,6 @@ #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ #define NONBE_FIX_982_OMASA_DELAY_COMP_5MS /* FhG : issue #982 : 5ms and 20ms output different for OMASA */ -#define NONBE_FIX_975_JBM_USAN /* FhG: Fix issue #975, USAN in JBM decoding ad 13.2kbps */ #define FIX_944_REMOVE_LS_RENDERER_CALL_IN_STEREO /* VA: issue 994: remove an obsolete call of function ivas_ls_setup_conversion() in stereo */ #define NONBE_FIX_999_JBM_MCT_FLUSH /* FhG: issue #999: fix wrong flushing for MCT at a JBM rate switch */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index f59168ffc..bbc82772e 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2397,18 +2397,14 @@ ivas_error IVAS_DEC_VoIP_FeedFrame( return IVAS_ERR_INVALID_BITSTREAM; } -#ifdef NONBE_FIX_975_JBM_USAN partialCopyFrameType = 0; partialCopyOffset = 0; if ( hIvasDec->mode == IVAS_DEC_MODE_EVS ) { -#endif /* check if frame contains a partial copy and get its offset */ evs_dec_previewFrame( au, auSize, &partialCopyFrameType, &partialCopyOffset ); -#ifdef NONBE_FIX_975_JBM_USAN } -#endif /* create data unit for primary copy in the frame */ dataUnit = JB4_AllocDataUnit( hIvasDec->hVoIP->hJBM ); -- GitLab From 49dc00c3a402003bc9e66ddb7c2065503d3e0520 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 15:58:38 +0200 Subject: [PATCH 11/11] formatting --- lib_dec/fd_cng_dec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_dec/fd_cng_dec.c b/lib_dec/fd_cng_dec.c index 14aa41f38..2344539b6 100644 --- a/lib_dec/fd_cng_dec.c +++ b/lib_dec/fd_cng_dec.c @@ -1802,11 +1802,11 @@ void generate_stereo_masking_noise( *-------------------------------------------------------------------*/ void generate_masking_noise_lb_dirac( - HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ - float *tdBuffer, /* i/o: time-domain signal, if NULL no LB-CNA */ - const int16_t nCldfbTs, /* i : number of CLDFB slots that will be rendered */ + HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ + float *tdBuffer, /* i/o: time-domain signal, if NULL no LB-CNA */ + const int16_t nCldfbTs, /* i : number of CLDFB slots that will be rendered */ SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i : common spatial rendering parameters handle */ - const int16_t cna_flag /* i : CNA flag for LB and HB */ + const int16_t cna_flag /* i : CNA flag for LB and HB */ ) { int16_t i; -- GitLab