From 9eec50d7c0171bd3c607af72efc172b4e94d1208 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 15:58:52 +0200 Subject: [PATCH 01/10] [cleanup] accept FIX_963_USAN_ERROR --- lib_com/options.h | 1 - lib_enc/ivas_stereo_dft_enc_itd_fx.c | 21 --------------------- 2 files changed, 22 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 94d22ec45..2a90fa944 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -93,7 +93,6 @@ #define FIX_1372_ISAR_POST_REND #endif #define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */ -#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 */ diff --git a/lib_enc/ivas_stereo_dft_enc_itd_fx.c b/lib_enc/ivas_stereo_dft_enc_itd_fx.c index fabc35985..4e030ba01 100644 --- a/lib_enc/ivas_stereo_dft_enc_itd_fx.c +++ b/lib_enc/ivas_stereo_dft_enc_itd_fx.c @@ -1662,7 +1662,6 @@ void stereo_dft_enc_compute_itd_fx( move16(); } // cng_xcorr_filt = max( min( CORR_FILT, 10.0f * CORR_FILT / ( hStereoDft->expectedNumUpdates + hStereoDft->currentNumUpdates ) ), sfm_L ); -#ifdef FIX_963_USAN_ERROR IF( add( hStereoDft->expectedNumUpdates, hStereoDft->currentNumUpdates ) == 0 ) { cng_xcorr_filt = CORR_FILT_Q31; @@ -1675,11 +1674,6 @@ void stereo_dft_enc_compute_itd_fx( cng_xcorr_filt = L_shl_sat( cng_xcorr_filt, cng_xcorr_filt_e ); // Q31 cng_xcorr_filt = L_max( L_min( CORR_FILT_Q31, cng_xcorr_filt ), sfm_L ); // Q31 } -#else - cng_xcorr_filt = BASOP_Util_Divide3232_Scale_cadence( 8 /*10.0f * CORR_FILT*/, add( hStereoDft->expectedNumUpdates, hStereoDft->currentNumUpdates ), &cng_xcorr_filt_e ); - cng_xcorr_filt = L_shl_sat( cng_xcorr_filt, cng_xcorr_filt_e ); // Q31 - cng_xcorr_filt = L_max( L_min( CORR_FILT_Q31, cng_xcorr_filt ), sfm_L ); // Q31 -#endif hStereoDft->currentNumUpdates = add( hStereoDft->currentNumUpdates, 1 ); move16(); FOR( i = 1; i < NFFT / 4; i++ ) @@ -1735,7 +1729,6 @@ void stereo_dft_enc_compute_itd_fx( { /* expectedNumUpdates updated after call to dtx() in SID frames */ // cng_xcorr_filt = max( min( CORR_FILT, 10.0f * CORR_FILT / ( hStereoDft->expectedNumUpdates + hStereoDft->currentNumUpdates ) ), sfm_L ); -#ifdef FIX_963_USAN_ERROR IF( add( hStereoDft->expectedNumUpdates, hStereoDft->currentNumUpdates ) == 0 ) { cng_xcorr_filt = CORR_FILT_Q31; @@ -1748,20 +1741,6 @@ void stereo_dft_enc_compute_itd_fx( cng_xcorr_filt = L_shl_sat( cng_xcorr_filt, cng_xcorr_filt_e ); // Q31 cng_xcorr_filt = L_max( L_min( CORR_FILT_Q31, cng_xcorr_filt ), sfm_L ); // Q31 } -#else - IF( add( hStereoDft->expectedNumUpdates, hStereoDft->currentNumUpdates ) != 0 ) - { - cng_xcorr_filt = BASOP_Util_Divide3232_Scale_cadence( 8 /*10.0f * CORR_FILT*/, add( hStereoDft->expectedNumUpdates, hStereoDft->currentNumUpdates ), &cng_xcorr_filt_e ); - cng_xcorr_filt = L_shl_sat( cng_xcorr_filt, cng_xcorr_filt_e ); // Q31 - cng_xcorr_filt = L_max( L_min( CORR_FILT_Q31, cng_xcorr_filt ), sfm_L ); // Q31 - } - ELSE - { - cng_xcorr_filt = CORR_FILT_Q31; - move32(); - cng_xcorr_filt = L_max( cng_xcorr_filt, sfm_L ); // Q31 - } -#endif hStereoDft->currentNumUpdates = add( hStereoDft->currentNumUpdates, 1 ); move16(); hStereoDft->sfm_fx = cng_xcorr_filt; -- GitLab From c0f2ff2e49237af9a2d9d99275438b8c2c4453a8 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 15:58:58 +0200 Subject: [PATCH 02/10] [cleanup] accept FIX_ACCESS_WITHIN_NULL_STRUCT_MC_BW_SWITCHING --- lib_com/options.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 2a90fa944..b3e558742 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -116,7 +116,6 @@ #define NONBE_FIX_974_OSBA_JBM_MONO_RS_USAN /* FhG : issue #974: usan in mono and stereo output in OSBA JBM RS */ #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_982_OMASA_DELAY_COMP_5MS /* FhG : issue #982 : 5ms and 20ms output different for OMASA */ -#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_975_JBM_USAN /* FhG: Fix issue #975, USAN in JBM decoding ad 13.2kbps */ #define FIX_699_FILE_READER_JBM_TSM /* VA: issue 699: complement FileReader_getFilePath() logic for TSM and JBM */ -- GitLab From d27a73343d69df3efd1f66cb5e05fee2b0c47294 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 15:59:01 +0200 Subject: [PATCH 03/10] [cleanup] accept FIX_983_DISC_ISM_DIGEST_NUM_OBJS --- lib_com/options.h | 1 - lib_dec/ivas_ism_param_dec_fx.c | 10 ---------- 2 files changed, 11 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index b3e558742..bd1b075e4 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -111,7 +111,6 @@ #define NONBE_FIX_951_MCMASA_5MS_RENDERING /* Nokia: issue #951: Differences for 5ms and 20ms rendering for McMASA at 13.2 kbps 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 NONBE_FIX_974_OSBA_JBM_MONO_RS_USAN /* FhG : issue #974: usan in mono and stereo output in OSBA JBM RS */ #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_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index 1485c09c1..5552b3dc2 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -939,11 +939,7 @@ void ivas_ism_dec_digest_tc_fx( EQ_32( st_ivas->renderer_type, RENDERER_OSBA_STEREO ) || ( EQ_32( 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 Word32 azimuth_fx, elevation_fx; /* we have a full frame interpolator, adapt it */ @@ -985,13 +981,7 @@ void ivas_ism_dec_digest_tc_fx( } /* 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; - move16(); - FOR( i = 0; i < num_objects; i++ ) -#endif { Copy32( st_ivas->hIsmRendererData->gains_fx[i], st_ivas->hIsmRendererData->prev_gains_fx[i], MAX_OUTPUT_CHANNELS ); -- GitLab From 2a5711eaff11d6f8618ce466e9d30ec6bfca31e3 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 15:59:07 +0200 Subject: [PATCH 04/10] [cleanup] accept NONBE_FIX_974_OSBA_JBM_MONO_RS_USAN --- lib_com/options.h | 1 - lib_dec/ivas_sba_dec_fx.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index bd1b075e4..39eca1ba5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -112,7 +112,6 @@ #define NONBE_FIX_951_MCMASA_5MS_RENDERING /* Nokia: issue #951: Differences for 5ms and 20ms rendering for McMASA at 13.2 kbps to BINAURAL */ #define NONBE_FIX_979_OSBA_STEREO_5MS /* FhG : issue #979 : 5ms and 20ms output different for OSBA and stereo */ -#define NONBE_FIX_974_OSBA_JBM_MONO_RS_USAN /* FhG : issue #974: usan in mono and stereo output in OSBA JBM RS */ #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_982_OMASA_DELAY_COMP_5MS /* FhG : issue #982 : 5ms and 20ms output different for OMASA */ #define NONBE_FIX_986_MC_BW_SWITCHING /* FhG: fix crash in bw and br switching with MC */ diff --git a/lib_dec/ivas_sba_dec_fx.c b/lib_dec/ivas_sba_dec_fx.c index 86cd641c0..5fed861dc 100644 --- a/lib_dec/ivas_sba_dec_fx.c +++ b/lib_dec/ivas_sba_dec_fx.c @@ -282,11 +282,7 @@ ivas_error ivas_sba_dec_reconfigure_fx( } /* save old */ -#ifdef NONBE_FIX_974_OSBA_JBM_MONO_RS_USAN IF( NE_16( ism_mode_old, ISM_SBA_MODE_DISC ) && NE_16( st_ivas->hTcBuffer->tc_buffer_mode, TC_BUFFER_MODE_BUFFER ) ) -#else - IF( NE_16( ism_mode_old, ISM_SBA_MODE_DISC ) ) -#endif { test(); IF( st_ivas->hDirAC == NULL && st_ivas->hSpar != NULL ) -- GitLab From 744a16aa78da8edc0148f9fce9516c1c4d417135 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 15:59:11 +0200 Subject: [PATCH 05/10] [cleanup] accept NONBE_FIX_973_HODIRAC_BAND_GROUPING --- lib_com/ivas_dirac_com_fx.c | 7 ------- lib_com/options.h | 1 - 2 files changed, 8 deletions(-) diff --git a/lib_com/ivas_dirac_com_fx.c b/lib_com/ivas_dirac_com_fx.c index c3ba55b50..a5fd4821b 100644 --- a/lib_com/ivas_dirac_com_fx.c +++ b/lib_com/ivas_dirac_com_fx.c @@ -578,14 +578,7 @@ ivas_error ivas_dirac_sba_config_fx( { hQMetaData->useLowerBandRes = 0; move16(); -#ifndef NONBE_FIX_973_HODIRAC_BAND_GROUPING - IF( hodirac_flag == 0 ) - { - nbands_coded = sub( nbands, 1 ); /* always combine the last two bands */ - } -#else nbands_coded = sub( nbands, 1 ); /* always combine the last two bands */ -#endif } { diff --git a/lib_com/options.h b/lib_com/options.h index 39eca1ba5..597eef4c0 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -94,7 +94,6 @@ #endif #define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */ -#define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ //#define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ #ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT -- GitLab From 8aa4644f1ca06aab23da7af6124c13f31e8399d2 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 15:59:14 +0200 Subject: [PATCH 06/10] [cleanup] accept NONBE_FIX_951_MCMASA_5MS_RENDERING --- lib_com/ivas_prot_fx.h | 2 -- lib_com/options.h | 1 - lib_dec/fd_cng_dec_fx.c | 6 ------ lib_dec/ivas_dirac_dec_fx.c | 8 -------- lib_dec/ivas_sba_dec_fx.c | 4 ---- .../ivas_dirac_dec_binaural_functions_fx.c | 18 ------------------ 6 files changed, 39 deletions(-) diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index 4edcf0480..4f011abe8 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -4995,9 +4995,7 @@ void generate_masking_noise_lb_dirac_fx( HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ Word32 *tdBuffer, /* i/o: time-domain signal, if NULL no LB-CNA */ const Word16 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 Word16 cna_flag /* i : CNA flag for LB and HB */ ); diff --git a/lib_com/options.h b/lib_com/options.h index 597eef4c0..03070046d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -108,7 +108,6 @@ #endif -#define NONBE_FIX_951_MCMASA_5MS_RENDERING /* Nokia: issue #951: Differences for 5ms and 20ms rendering for McMASA at 13.2 kbps to BINAURAL */ #define NONBE_FIX_979_OSBA_STEREO_5MS /* FhG : issue #979 : 5ms and 20ms output different for OSBA and stereo */ #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/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index 6d73aa28c..bf82854fd 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -5447,9 +5447,7 @@ void generate_masking_noise_lb_dirac_fx( HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ Word32 *tdBuffer, /* i/o: time-domain signal, if NULL no LB-CNA Q11*/ const Word16 nCldfbTs, /* i : number of CLDFB slots that will be rendered Q0*/ -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i : common spatial rendering parameters handle */ -#endif const Word16 cna_flag /* i : CNA flag for LB and HB Q0*/ ) { @@ -5501,12 +5499,10 @@ void generate_masking_noise_lb_dirac_fx( test(); IF( cna_flag && tdBuffer != NULL ) { -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING Word16 cur_subframe; Word16 cur_subframe_start_outfs; Word16 cur_subframe_start_cngfs; Word16 slot_size_cng; -#endif WHILE( n_samples_out > 0 ) { @@ -5580,7 +5576,6 @@ void generate_masking_noise_lb_dirac_fx( n_samples_start = add( 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 = shr( hFdCngCom->frameSize, 4 /* DEFAULT_JBM_CLDFB_TIMESLOTS */ ); @@ -5602,7 +5597,6 @@ void generate_masking_noise_lb_dirac_fx( /* set everything else to zero */ set_zero_fx( tdBuffer + cur_subframe_start_outfs + move_size, sub( subframe_size_outfs, move_size ) ); } -#endif } pop_wmops(); diff --git a/lib_dec/ivas_dirac_dec_fx.c b/lib_dec/ivas_dirac_dec_fx.c index feca814c8..cda02a24a 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -2871,18 +2871,10 @@ void ivas_dirac_dec_render_sf_fx( test(); generate_masking_noise_dirac_ivas_fx( st->hFdCngDec->hFdCngCom, st_ivas->cldfbAnaDec[1], -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING &st_ivas->hTcBuffer->tc_fx[1][hSpatParamRendCom->num_freq_bands * hSpatParamRendCom->slots_rendered], -#else - st_ivas->hTcBuffer->tc_fx[1], -#endif Cldfb_RealBuffer_fx[1][0], Cldfb_ImagBuffer_fx[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 ) || EQ_32( st->core_brate, SID_2k40 ) ) ) && EQ_16( st->cng_type, FD_CNG ) && st->cng_sba_flag, Q_input, &q_temp_cldfb ); Scale_sig32( Cldfb_RealBuffer_fx[1][0], CLDFB_NO_CHANNELS_MAX, sub( Q6, q_temp_cldfb ) ); // Q6 diff --git a/lib_dec/ivas_sba_dec_fx.c b/lib_dec/ivas_sba_dec_fx.c index 5fed861dc..121b8a795 100644 --- a/lib_dec/ivas_sba_dec_fx.c +++ b/lib_dec/ivas_sba_dec_fx.c @@ -886,11 +886,7 @@ void ivas_sba_dec_digest_tc_fx( Decoder_State *st = st_ivas->hSCE[0]->hCoreCoder[0]; Scale_sig( st->hFdCngDec->hFdCngCom->A_cng, M + 1, sub( norm_s( sub( st->hFdCngDec->hFdCngCom->A_cng[0], 1 ) ), 2 ) ); /*Q12 -> Q13*/ -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING generate_masking_noise_lb_dirac_fx( st->hFdCngDec->hFdCngCom, st_ivas->hTcBuffer->tc_fx[1], nCldfbSlots, st_ivas->hSpatParamRendCom, st->cna_dirac_flag && st->flag_cna ); -#else - generate_masking_noise_lb_dirac_fx( st->hFdCngDec->hFdCngCom, st_ivas->hTcBuffer->tc_fx[1], nCldfbSlots, st->cna_dirac_flag && st->flag_cna ); -#endif } return; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index 3f24bfd85..1545ecd0c 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -830,29 +830,15 @@ static void ivas_dirac_dec_binaural_internal_fx( IF( st_ivas->hSCE[0]->hCoreCoder[0] != NULL && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag ) { Word16 numCoreBands, b; -#ifndef NONBE_FIX_951_MCMASA_5MS_RENDERING - Word16 slotInFrame; -#endif numCoreBands = st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->numCoreBands; move16(); -#ifndef NONBE_FIX_951_MCMASA_5MS_RENDERING - slotInFrame = add( hSpatParamRendCom->slots_rendered, slot ); -#endif generate_masking_noise_dirac_ivas_fx( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom, st_ivas->cldfbAnaDec[1], -#ifdef NONBE_FIX_951_MCMASA_5MS_RENDERING &st_ivas->hTcBuffer->tc_fx[nchan_transport][hSpatParamRendCom->num_freq_bands * hSpatParamRendCom->slots_rendered], -#else - st_ivas->hTcBuffer->tc_fx[nchan_transport], -#endif Cldfb_RealBuffer_in_fx[2][slot], Cldfb_ImagBuffer_in_fx[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, 11, &q_cldfb[2][slot] ); @@ -861,11 +847,7 @@ static void ivas_dirac_dec_binaural_internal_fx( st_ivas->cldfbAnaDec[1], /*nothing will be analyzed, just get cnst*/ NULL, Cldfb_RealBuffer_in_fx[1][slot], Cldfb_ImagBuffer_in_fx[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, 0, &q_cldfb[1][slot] ); -- GitLab From db41d47daf4c9ef54bcb8302b8edff6cd5bbf49c Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 15:59:17 +0200 Subject: [PATCH 07/10] [cleanup] accept NONBE_FIX_979_OSBA_STEREO_5MS --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec_fx.c | 4 ---- lib_dec/ivas_osba_dec_fx.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 03070046d..6e1a7dffe 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -108,7 +108,6 @@ #endif -#define NONBE_FIX_979_OSBA_STEREO_5MS /* FhG : issue #979 : 5ms and 20ms output different for OSBA and stereo */ #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_982_OMASA_DELAY_COMP_5MS /* FhG : issue #982 : 5ms and 20ms output different for OMASA */ diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 5afbc3acb..e80e24226 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -1893,11 +1893,7 @@ ivas_error ivas_jbm_dec_render_fx( { FOR( n = 0; n < st_ivas->hTcBuffer->nchan_buffer_full; n++ ) { -#ifdef NONBE_FIX_979_OSBA_STEREO_5MS p_tc_fx[n] = &p_output_fx[n][st_ivas->hTcBuffer->n_samples_rendered]; -#else - p_tc_fx[n] = p_output_fx[n]; -#endif } FOR( n = 0; n < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; n++ ) diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index 8445d96a3..87805290b 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -297,23 +297,15 @@ ivas_error ivas_osba_render_sf_fx( 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 v_shr( &p_output[n][tc_offset], Q11 - Q11, &output_ism[n][tc_offset], nSamplesAsked ); // Q11 -#else - v_shr( p_output[n], Q11 - Q11, output_ism[n], nSamplesAsked ); // Q11 -#endif } -#ifdef NONBE_FIX_979_OSBA_STEREO_5MS } -#endif IF( NE_32( ( error = ivas_sba_dec_render_fx( 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 ed51fbdd2..816193253 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -386,12 +386,10 @@ Word16 ivas_get_nchan_buffers_dec( { nchan_out_buff = shl( CPE_CHANNELS, 1 ); } -#ifdef NONBE_FIX_979_OSBA_STEREO_5MS 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( shl( BINAURAL_CHANNELS, 1 ), 2 ) ); } -#endif ELSE IF( NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) { nchan_out_buff = s_max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); -- GitLab From bdb1439758fde7b38355ee020a0039b6a65e180c Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 15:59:20 +0200 Subject: [PATCH 08/10] [cleanup] accept NONBE_FIX_986_MC_BW_SWITCHING --- lib_com/options.h | 1 - lib_enc/bw_detect_fx.c | 18 ------------------ lib_enc/ivas_cpe_enc_fx.c | 4 ---- lib_enc/ivas_mct_enc_fx.c | 23 ----------------------- 4 files changed, 46 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6e1a7dffe..5c6c344f0 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -111,7 +111,6 @@ #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_982_OMASA_DELAY_COMP_5MS /* FhG : issue #982 : 5ms and 20ms output different for OMASA */ -#define NONBE_FIX_986_MC_BW_SWITCHING /* FhG: fix crash in bw and br switching with MC */ #define NONBE_FIX_975_JBM_USAN /* FhG: Fix issue #975, USAN in JBM decoding ad 13.2kbps */ #define FIX_699_FILE_READER_JBM_TSM /* VA: issue 699: complement FileReader_getFilePath() logic for TSM and JBM */ #define FIX_997_REMOVE_SPAR_DEC_UPMIXER /* VA: issue 997: remove obsolete function ivas_spar_dec_upmixer() */ diff --git a/lib_enc/bw_detect_fx.c b/lib_enc/bw_detect_fx.c index eefd5057c..c79931e45 100644 --- a/lib_enc/bw_detect_fx.c +++ b/lib_enc/bw_detect_fx.c @@ -1140,7 +1140,6 @@ Word16 set_bw_mct_fx( bw_changed = 0; move16(); -#ifdef NONBE_FIX_986_MC_BW_SWITCHING IF( NE_16( mct_bwidth, last_mct_bwidth ) ) { bw_changed = 1; @@ -1161,22 +1160,5 @@ Word16 set_bw_mct_fx( move16(); } } -#else - IF( NE_16( mct_bwidth, last_mct_bwidth ) ) - { - bw_changed = 1; - move16(); - - 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; - move16(); - } - } - } -#endif return bw_changed; } diff --git a/lib_enc/ivas_cpe_enc_fx.c b/lib_enc/ivas_cpe_enc_fx.c index f6885dd81..849c7d7d5 100644 --- a/lib_enc/ivas_cpe_enc_fx.c +++ b/lib_enc/ivas_cpe_enc_fx.c @@ -1019,7 +1019,6 @@ ivas_error ivas_cpe_enc_fx( IF( ( NE_32( hCPE->last_element_brate, hCPE->element_brate ) || NE_16( hCPE->element_mode, hCPE->last_element_mode ) || ( EQ_16( hCPE->element_mode, IVAS_CPE_TD ) && NE_16( sts[0]->bits_frame_nominal, last_bits_frame_nominal ) ) || NE_16( sts[n]->last_bwidth, sts[n]->bwidth ) ) && ( n == 0 || EQ_16( hCPE->element_mode, IVAS_CPE_MDCT ) ) ) { Word16 igf; -#ifdef NONBE_FIX_986_MC_BW_SWITCHING Word16 bw; /* float uses ternary operator for this: bw = ( hCPE->element_mode == IVAS_CPE_MDCT ) ? sts[n]->bwidth : sts[n]->max_bwidth; */ @@ -1029,9 +1028,6 @@ ivas_error ivas_cpe_enc_fx( bw = sts[n]->bwidth; } igf = getIgfPresent_fx( sts[n]->element_mode, L_mult0( sts[n]->bits_frame_nominal, FRAMES_PER_SEC ), bw, sts[n]->rf_mode ); /* Q0 */ -#else - igf = getIgfPresent_fx( sts[n]->element_mode, L_mult0( sts[n]->bits_frame_nominal, FRAMES_PER_SEC ), sts[n]->max_bwidth, sts[n]->rf_mode ); /* Q0 */ -#endif IF( ( error = IGF_Reconfig_fx( &sts[n]->hIGFEnc, igf, 0, L_mult0( 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_fx.c b/lib_enc/ivas_mct_enc_fx.c index 565b318f5..bb98e6163 100644 --- a/lib_enc/ivas_mct_enc_fx.c +++ b/lib_enc/ivas_mct_enc_fx.c @@ -183,9 +183,6 @@ ivas_error ivas_mct_enc_fx( Word32 orig_spectrum_long_fx[MCT_MAX_BLOCKS][CPE_CHANNELS][L_FRAME48k]; Word16 switch_bw; IVAS_FORMAT ivas_format; -#ifndef NONBE_FIX_986_MC_BW_SWITCHING - Word16 max_bwidth; -#endif Word32 ivas_total_brate; ivas_error error; Word32 *pdata_fx[MAX_INPUT_CHANNELS]; @@ -200,9 +197,6 @@ ivas_error ivas_mct_enc_fx( 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; move32(); move16(); @@ -252,7 +246,6 @@ ivas_error ivas_mct_enc_fx( cp_bitrate = L_shl( L_deposit_l( div_l( ivas_total_brate, st_ivas->nchan_transport ) ), 2 ); // a/b => div_l(a, b/2) or (2 * div_l(a, b)) } -#ifdef NONBE_FIX_986_MC_BW_SWITCHING IF( st_ivas->hCPE[0]->hCoreCoder[0]->igf ) { FOR( n = 0; n < shr( hMCT->nchan_out_woLFE, 1 ); n++ ) @@ -267,22 +260,6 @@ ivas_error ivas_mct_enc_fx( initMdctStereoEncData_fx( 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, NULL, 0 ); } } -#else - IF( st_ivas->hCPE[0]->hCoreCoder[0]->igf ) - { - FOR( n = 0; n < shr( hMCT->nchan_out_woLFE, 1 ); n++ ) - { - initMdctStereoEncData_fx( 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]->hIGFEnc->igfData.igfInfo.grid, 0 ); - } - } - ELSE - { - FOR( n = 0; n < shr( hMCT->nchan_out_woLFE, 1 ); n++ ) - { - initMdctStereoEncData_fx( hMCT->hBlockData[n]->hStereoMdct, ivas_format, IVAS_CPE_MDCT, cp_bitrate, max_bwidth, st_ivas->hCPE[0]->hCoreCoder[0]->igf, NULL, 0 ); - } - } -#endif } /* set coded audio band-width */ -- GitLab From 236f13738816b416466ba5d0a879961809e3bd3a Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 15:59:23 +0200 Subject: [PATCH 09/10] [cleanup] accept NONBE_FIX_975_JBM_USAN --- lib_com/options.h | 1 - lib_dec/lib_dec_fx.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 5c6c344f0..34a9e4858 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -111,7 +111,6 @@ #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_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_699_FILE_READER_JBM_TSM /* VA: issue 699: complement FileReader_getFilePath() logic for TSM and JBM */ #define FIX_997_REMOVE_SPAR_DEC_UPMIXER /* VA: issue 997: remove obsolete function ivas_spar_dec_upmixer() */ diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 9cf06bdfb..628256729 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -2999,7 +2999,6 @@ ivas_error IVAS_DEC_VoIP_FeedFrame( } -#ifdef NONBE_FIX_975_JBM_USAN partialCopyFrameType = 0; move16(); partialCopyOffset = 0; @@ -3007,12 +3006,9 @@ ivas_error IVAS_DEC_VoIP_FeedFrame( IF( EQ_16( hIvasDec->mode, (Word16) 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 8a53dae7d59aa87876225556d9c68497113c9ca0 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 16:08:13 +0200 Subject: [PATCH 10/10] formatting --- lib_dec/fd_cng_dec_fx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index bf82854fd..e53c81209 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -5444,11 +5444,11 @@ void generate_stereo_masking_noise_fx( return; } void generate_masking_noise_lb_dirac_fx( - HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ - Word32 *tdBuffer, /* i/o: time-domain signal, if NULL no LB-CNA Q11*/ - const Word16 nCldfbTs, /* i : number of CLDFB slots that will be rendered Q0*/ + HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ + Word32 *tdBuffer, /* i/o: time-domain signal, if NULL no LB-CNA Q11*/ + const Word16 nCldfbTs, /* i : number of CLDFB slots that will be rendered Q0*/ SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i : common spatial rendering parameters handle */ - const Word16 cna_flag /* i : CNA flag for LB and HB Q0*/ + const Word16 cna_flag /* i : CNA flag for LB and HB Q0*/ ) { Word16 i; -- GitLab