From 00b80aeb912016090af1d247a692a23e5a73b18f Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:47:01 +0200 Subject: [PATCH 01/23] accept FIX_563_PARAMMC_LIMITER --- lib_com/ivas_cnst.h | 2 -- lib_com/options.h | 1 - lib_enc/ivas_mc_param_enc.c | 10 ---------- 3 files changed, 13 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 0c84499778..b2c6a167b9 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1432,9 +1432,7 @@ typedef enum #define PARAM_MC_MAX_BAND_ABS_COV_DEC 10 #define PARAM_MC_ENER_LIMIT_INTRAFRAME (1.5f) #define PARAM_MC_ENER_LIMIT_INTERFRAME (2.0f) -#ifdef FIX_563_PARAMMC_LIMITER #define PARAM_MC_ENER_LIMIT_MAX_DELTA_FAC (15.0f) -#endif #ifdef FIX_580_PARAMMC_ENER_BURSTS #define PARAM_MC_NUM_ATTACK_ILD_THRESH (3) #endif diff --git a/lib_com/options.h b/lib_com/options.h index b35772ecc1..c937d818e2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -153,7 +153,6 @@ #define VLBR_20MS_MD /* Dlb: SBA VLBR 20ms Optimization*/ #define SBA_MODE_CLEANUP_2 /* Dlb : changes part of fix issue #523 for unused signaling bit in SBA SID*/ #define FIX_137_SID_MD_BITS /* Dlb: Fix issue #137 , SID bitrate mismatch correction */ -#define FIX_563_PARAMMC_LIMITER /* FhG: issue 563: fix ILD limiter when coming from silence w/o transient set */ #define FIX_560_VAD_FLAG /* Eri: Issue 560 - VAD flag issue for unified stereo */ #define FIX_549_DMX_GAIN /* FhG: issue 549: ParamISM output too quiet */ #define FIX_470_MASA_JBM_EXT /* Nokia: Issue 470, fix MASA EXT output with JBM */ diff --git a/lib_enc/ivas_mc_param_enc.c b/lib_enc/ivas_mc_param_enc.c index fe4f8e8cfc..95bb61c12d 100644 --- a/lib_enc/ivas_mc_param_enc.c +++ b/lib_enc/ivas_mc_param_enc.c @@ -932,11 +932,7 @@ static void ivas_param_mc_param_est_enc( for ( ; cur_param_band < num_parameter_bands; cur_param_band += 2 ) { -#ifdef FIX_563_PARAMMC_LIMITER if ( cur_param_band < num_parameter_bands ) -#else - if ( cur_param_band + 1 < num_parameter_bands ) -#endif { for ( ch_idx1 = 0; ch_idx1 < nchan_transport; ++ch_idx1 ) { @@ -1332,11 +1328,7 @@ static void ivas_param_mc_quantize_ilds( ener_fac = 10.0f * log10f( ( tot_ener + EPSILON ) / ( dmx_ener + EPSILON ) ); delta_fac = ener_fac - hParamMC->ener_fac[freq_idx]; -#ifdef FIX_563_PARAMMC_LIMITER if ( !hParamMC->hMetadataPMC.bAttackPresent && ( delta_fac > PARAM_MC_ENER_LIMIT_INTERFRAME ) && ( delta_fac < PARAM_MC_ENER_LIMIT_MAX_DELTA_FAC ) ) -#else - if ( !hParamMC->hMetadataPMC.bAttackPresent && ( delta_fac > PARAM_MC_ENER_LIMIT_INTERFRAME ) ) -#endif { float limit_fac; limit_fac = powf( 10.0f, ( ( 0.3f * logf( delta_fac - PARAM_MC_ENER_LIMIT_INTERFRAME + 1.0f ) - ( delta_fac - PARAM_MC_ENER_LIMIT_INTERFRAME ) ) / 10.0f ) ); @@ -1346,13 +1338,11 @@ static void ivas_param_mc_quantize_ilds( hParamMC->ener_fac[freq_idx] = ener_fac; -#ifdef FIX_563_PARAMMC_LIMITER /* update also combined bands ener_fac when in transient frame */ if ( hParamMC->hMetadataPMC.bAttackPresent && ( ( freq_idx + 1 ) < hParamMC->hMetadataPMC.nbands_coded ) ) { hParamMC->ener_fac[freq_idx + 1] = ener_fac; } -#endif for ( k = 0; k < num_ilds_to_code; ++k ) { -- GitLab From 09b3632cc45b5ea1bd9c0e97ea27002cb471b812 Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:47:02 +0200 Subject: [PATCH 02/23] accept FIX_560_VAD_FLAG --- lib_com/options.h | 1 - lib_enc/ivas_core_pre_proc_front.c | 13 ------------- 2 files changed, 14 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index c937d818e2..99060e6afd 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -153,7 +153,6 @@ #define VLBR_20MS_MD /* Dlb: SBA VLBR 20ms Optimization*/ #define SBA_MODE_CLEANUP_2 /* Dlb : changes part of fix issue #523 for unused signaling bit in SBA SID*/ #define FIX_137_SID_MD_BITS /* Dlb: Fix issue #137 , SID bitrate mismatch correction */ -#define FIX_560_VAD_FLAG /* Eri: Issue 560 - VAD flag issue for unified stereo */ #define FIX_549_DMX_GAIN /* FhG: issue 549: ParamISM output too quiet */ #define FIX_470_MASA_JBM_EXT /* Nokia: Issue 470, fix MASA EXT output with JBM */ #define ISM_FB /* issue 556: change SWB to FB coding in 1ISM at 24.4 kbps */ diff --git a/lib_enc/ivas_core_pre_proc_front.c b/lib_enc/ivas_core_pre_proc_front.c index 20c2f16452..92c66f0de3 100644 --- a/lib_enc/ivas_core_pre_proc_front.c +++ b/lib_enc/ivas_core_pre_proc_front.c @@ -161,9 +161,6 @@ ivas_error pre_proc_front_ivas( float temp1F_icatdmResampBuf[L_FILT_MAX]; /* temp buffers for ICA TDM resamplers */ int16_t old_pitch1; /* previous frame OL pitch[1] @12.8 kHz */ int16_t LR_localVAD; -#ifndef FIX_560_VAD_FLAG - int16_t LR_vad_flag; -#endif ivas_error error; push_wmops( "pre_proc_front" ); @@ -180,9 +177,6 @@ ivas_error pre_proc_front_ivas( res_cod_SNR_M = tmpF; LR_localVAD = 0; -#ifndef FIX_560_VAD_FLAG - LR_vad_flag = 0; -#endif if ( hSCE != NULL ) { @@ -210,9 +204,6 @@ ivas_error pre_proc_front_ivas( { /* Combine localVAD and vad_flag from LR processing */ LR_localVAD = hCPE->hCoreCoder[0]->localVAD || hCPE->hCoreCoder[1]->localVAD; -#ifndef FIX_560_VAD_FLAG - LR_vad_flag = hCPE->hFrontVad[0]->hVAD->vad_flag || hCPE->hFrontVad[1]->hVAD->vad_flag; -#endif } if ( hCPE->hStereoTD != NULL ) @@ -466,10 +457,6 @@ ivas_error pre_proc_front_ivas( /* Add down mix stereo activity to LR vad_flag_dtx */ *vad_flag_dtx = *vad_flag_dtx || st->vad_flag; -#ifndef FIX_560_VAD_FLAG - /* Combine the LR VAD flag and stereo downmix VAD flag */ - st->vad_flag = ( LR_vad_flag || st->vad_flag ); -#endif /* Determine hangover flag status based on LR localVAD and downmix localVAD */ *vad_hover_flag = *vad_flag_dtx && !( LR_localVAD || st->localVAD ); -- GitLab From b9e7d776a19b8769a3a171796478757f60867759 Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:48:06 +0200 Subject: [PATCH 03/23] accept FIX_549_DMX_GAIN --- lib_com/ivas_ism_com.c | 2 -- lib_com/ivas_stat_com.h | 2 -- lib_com/options.h | 1 - lib_dec/ivas_ism_param_dec.c | 12 ------------ lib_enc/ivas_ism_param_enc.c | 20 -------------------- 5 files changed, 37 deletions(-) diff --git a/lib_com/ivas_ism_com.c b/lib_com/ivas_ism_com.c index d57f658500..54cae6789b 100644 --- a/lib_com/ivas_ism_com.c +++ b/lib_com/ivas_ism_com.c @@ -510,10 +510,8 @@ void ivas_param_ism_config( hParamIsm->last_el_sgn[i] = 1; } -#ifdef FIX_549_DMX_GAIN hParamIsm->last_dmx_gain = 1.0f; set_f( hParamIsm->last_cardioid_left, 1.0f, MAX_NUM_OBJECTS ); -#endif return; } diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index 51337f1c5c..6d2ed4c4e9 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -169,10 +169,8 @@ typedef struct ivas_param_ism_data_structure int16_t noisy_speech_buffer[PARAM_ISM_HYS_BUF_SIZE]; int16_t flag_equal_energy; -#ifdef FIX_549_DMX_GAIN float last_dmx_gain; float last_cardioid_left[MAX_NUM_OBJECTS]; -#endif } PARAM_ISM_CONFIG_DATA, *PARAM_ISM_CONFIG_HANDLE; diff --git a/lib_com/options.h b/lib_com/options.h index 99060e6afd..408cc68e15 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -153,7 +153,6 @@ #define VLBR_20MS_MD /* Dlb: SBA VLBR 20ms Optimization*/ #define SBA_MODE_CLEANUP_2 /* Dlb : changes part of fix issue #523 for unused signaling bit in SBA SID*/ #define FIX_137_SID_MD_BITS /* Dlb: Fix issue #137 , SID bitrate mismatch correction */ -#define FIX_549_DMX_GAIN /* FhG: issue 549: ParamISM output too quiet */ #define FIX_470_MASA_JBM_EXT /* Nokia: Issue 470, fix MASA EXT output with JBM */ #define ISM_FB /* issue 556: change SWB to FB coding in 1ISM at 24.4 kbps */ #define FIX_558_PLC_DISCONT /* FhG: issue 558: fix discontinuities in DFT Stereo when switching from TCX concealment to ACELP */ diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index 4662304a4a..8cea5347b4 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -726,11 +726,9 @@ void ivas_param_ism_dec( int16_t ch, nchan_transport, nchan_out, nchan_out_woLFE, i; int16_t subframe_idx, slot_idx, index_slot, bin_idx; int32_t ivas_total_brate; -#ifdef FIX_549_DMX_GAIN int16_t output_frame; float gain, ene_tc, ene_sum, grad; float last_gain; -#endif float ref_power[CLDFB_NO_CHANNELS_MAX]; float cx_diag[CLDFB_NO_CHANNELS_MAX][PARAM_ISM_MAX_DMX]; /* CLDFB Input Buffers */ @@ -757,12 +755,10 @@ void ivas_param_ism_dec( assert( hDirAC ); hSpatParamRendCom = st_ivas->hSpatParamRendCom; assert( hSpatParamRendCom ); -#ifdef FIX_549_DMX_GAIN ene_tc = 0.0f; ene_sum = 0.0f; last_gain = st_ivas->hDirAC->hParamIsm->last_dmx_gain; output_frame = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); -#endif nchan_transport = st_ivas->nchan_transport; if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) @@ -846,7 +842,6 @@ void ivas_param_ism_dec( } } -#ifdef FIX_549_DMX_GAIN /* Energy Compensation */ for ( i = 0; i < output_frame; i++ ) { @@ -880,7 +875,6 @@ void ivas_param_ism_dec( } } st_ivas->hDirAC->hParamIsm->last_dmx_gain = gain; -#endif for ( ch = 0; ch < nchan_transport; ch++ ) { @@ -1097,11 +1091,9 @@ void ivas_param_ism_dec_digest_tc( int16_t ch, nchan_transport, nchan_out, nchan_out_woLFE, i; int16_t slot_idx, bin_idx; int32_t ivas_total_brate; -#ifdef FIX_549_DMX_GAIN int16_t output_frame; float gain, ene_tc, ene_sum, grad; float last_gain; -#endif float ref_power[CLDFB_NO_CHANNELS_MAX]; float cx_diag[CLDFB_NO_CHANNELS_MAX][PARAM_ISM_MAX_DMX]; /* Direct Response/EFAP Gains */ @@ -1114,12 +1106,10 @@ void ivas_param_ism_dec_digest_tc( assert( hDirAC ); hSpatParamRendCom = st_ivas->hSpatParamRendCom; assert( hSpatParamRendCom ); -#ifdef FIX_549_DMX_GAIN ene_tc = 0.0f; ene_sum = 0.0f; last_gain = st_ivas->hDirAC->hParamIsm->last_dmx_gain; output_frame = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); -#endif nchan_transport = st_ivas->nchan_transport; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; @@ -1206,7 +1196,6 @@ void ivas_param_ism_dec_digest_tc( } } -#ifdef FIX_549_DMX_GAIN /* Energy Compensation */ for ( i = 0; i < output_frame; i++ ) { @@ -1240,7 +1229,6 @@ void ivas_param_ism_dec_digest_tc( } } st_ivas->hDirAC->hParamIsm->last_dmx_gain = gain; -#endif for ( ch = 0; ch < nchan_transport; ch++ ) { diff --git a/lib_enc/ivas_ism_param_enc.c b/lib_enc/ivas_ism_param_enc.c index c3d50d24db..7c99c49184 100644 --- a/lib_enc/ivas_ism_param_enc.c +++ b/lib_enc/ivas_ism_param_enc.c @@ -222,11 +222,9 @@ void ivas_param_ism_stereo_dmx( float alpha, azi_shift, tmp, tmp_1; float cardioid_left[MAX_NUM_OBJECTS], cardioid_right[MAX_NUM_OBJECTS]; float stereo_dmx[2][L_FRAME48k]; -#ifdef FIX_549_DMX_GAIN float dmx_gain, ene_dmx, ene_data, grad; float last_dmx_gain; float last_cardioid_left; -#endif ISM_METADATA_HANDLE hIsmMetaData; push_wmops( "ivas_param_ism_st_dmx" ); @@ -234,12 +232,10 @@ void ivas_param_ism_stereo_dmx( /*Initialization*/ alpha = 0.5; azi_shift = 0; -#ifdef FIX_549_DMX_GAIN dmx_gain = 0; ene_dmx = 0; ene_data = 0; last_dmx_gain = st_ivas->hDirAC->hParamIsm->last_dmx_gain; -#endif /* Set the stereo dmx to zero */ set_zero( stereo_dmx[0], L_FRAME48k ); @@ -249,24 +245,11 @@ void ivas_param_ism_stereo_dmx( for ( i = 0; i < st_ivas->hEncoderConfig->nchan_ism; i++ ) { hIsmMetaData = st_ivas->hIsmMetaData[i]; -#ifdef FIX_549_DMX_GAIN last_cardioid_left = st_ivas->hDirAC->hParamIsm->last_cardioid_left[i]; -#endif /*Compute the Cardioids for the corresponding object direction */ tmp = hIsmMetaData->azimuth * ( EVS_PI / 180 ); tmp_1 = ( EVS_PI / 2 ) + azi_shift; cardioid_left[i] = alpha + ( 1 - alpha ) * cosf( tmp - tmp_1 ); -#ifndef FIX_549_DMX_GAIN - cardioid_right[i] = alpha + ( 1 - alpha ) * cosf( tmp + tmp_1 ); - - /* Loop over all samples */ - for ( j = 0; j < input_frame; j++ ) - { - tmp = data[i][j]; - stereo_dmx[0][j] += cardioid_left[i] * tmp; /* DMX Left */ - stereo_dmx[1][j] += cardioid_right[i] * tmp; /* DMX Right */ - } -#else if ( st_ivas->hSCE[0]->hCoreCoder[0]->ini_frame > 0 ) { float last_cardioid_right; @@ -306,10 +289,8 @@ void ivas_param_ism_stereo_dmx( } } st_ivas->hDirAC->hParamIsm->last_cardioid_left[i] = cardioid_left[i]; -#endif } -#ifdef FIX_549_DMX_GAIN /* Energy compensation */ for ( j = 0; j < input_frame; j++ ) { @@ -342,7 +323,6 @@ void ivas_param_ism_stereo_dmx( } } st_ivas->hDirAC->hParamIsm->last_dmx_gain = dmx_gain; -#endif /* Copy the stereo dmx to data variable */ mvr2r( stereo_dmx[0], data[0], input_frame ); mvr2r( stereo_dmx[1], data[1], input_frame ); -- GitLab From adaa09bb8b5e75346b09a5b26ad2be92f5b5d364 Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:48:07 +0200 Subject: [PATCH 04/23] accept ISM_FB --- lib_com/ivas_cnst.h | 2 -- lib_com/options.h | 1 - lib_dec/ivas_sce_dec.c | 4 ---- lib_enc/bw_detect.c | 4 ---- lib_enc/ivas_decision_matrix_enc.c | 4 ---- lib_enc/lib_enc.c | 6 ------ 6 files changed, 21 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index b2c6a167b9..0a9c2960af 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -313,13 +313,11 @@ typedef enum #define MIN_BRATE_SWB_SCE ACELP_9k60 /* min. SCE bitrate where SWB is supported */ #define MIN_BRATE_SWB_STEREO IVAS_13k2 /* min. stereo bitrate where SWB is supported */ #define MIN_BRATE_FB_STEREO IVAS_32k /* min. SCE and stereo bitrate where FB is supported */ -#ifdef ISM_FB #ifdef ISM_FB_16k4 #define MIN_BRATE_FB_ISM 16000 /* min. SCE bitrate where FB is supported in ISM format */ #else #define MIN_BRATE_FB_ISM 24000 /* min. SCE bitrate where FB is supported in ISM format */ #endif -#endif #define MIN_TDM_BRATE_WB_TBE_1k05 12000 /* min. per channel bitrate where WB TBE @1.05 kbps is supported (0.35kbs at lower bitrates) */ #define MIN_BRATE_WB_TBE_1k05 9650 /* min. per channel bitrate where WB TBE @1.05 kbps is supported (0.35kbs at lower bitrates) */ diff --git a/lib_com/options.h b/lib_com/options.h index 408cc68e15..247b040c84 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -154,7 +154,6 @@ #define SBA_MODE_CLEANUP_2 /* Dlb : changes part of fix issue #523 for unused signaling bit in SBA SID*/ #define FIX_137_SID_MD_BITS /* Dlb: Fix issue #137 , SID bitrate mismatch correction */ #define FIX_470_MASA_JBM_EXT /* Nokia: Issue 470, fix MASA EXT output with JBM */ -#define ISM_FB /* issue 556: change SWB to FB coding in 1ISM at 24.4 kbps */ #define FIX_558_PLC_DISCONT /* FhG: issue 558: fix discontinuities in DFT Stereo when switching from TCX concealment to ACELP */ #define FIX_564 /* Nokia: Issue 564: Fix gains in JBM path for SBA with parametric binaural renderer */ #define FIX_566_2DIR_MASA_384K /* Nokia: Issued 566: Bugfix in 384k MASA metadata encoding of second direction */ diff --git a/lib_dec/ivas_sce_dec.c b/lib_dec/ivas_sce_dec.c index 2e10552296..ec0e17107c 100755 --- a/lib_dec/ivas_sce_dec.c +++ b/lib_dec/ivas_sce_dec.c @@ -123,12 +123,8 @@ ivas_error ivas_sce_dec( /* only WB is supported */ st->bwidth = WB; } -#ifdef ISM_FB else if ( ( hSCE->element_brate < MIN_BRATE_FB_STEREO && !st->is_ism_format ) || ( hSCE->element_brate < MIN_BRATE_FB_ISM && st->is_ism_format ) ) -#else - else if ( hSCE->element_brate < MIN_BRATE_FB_STEREO ) -#endif { /* WB and SWB are supported */ st->bwidth = get_next_indice( st, 1 ) + WB; diff --git a/lib_enc/bw_detect.c b/lib_enc/bw_detect.c index e1e068ab2c..121754e1dc 100644 --- a/lib_enc/bw_detect.c +++ b/lib_enc/bw_detect.c @@ -579,12 +579,8 @@ void set_bw( { st->bwidth = WB; } -#ifdef ISM_FB else if ( st->bwidth > SWB && ( ( element_brate < MIN_BRATE_FB_STEREO && !st->is_ism_format ) || ( element_brate < MIN_BRATE_FB_ISM && st->is_ism_format ) ) ) -#else - else if ( element_brate < MIN_BRATE_FB_STEREO && st->bwidth > SWB ) -#endif { st->bwidth = SWB; } diff --git a/lib_enc/ivas_decision_matrix_enc.c b/lib_enc/ivas_decision_matrix_enc.c index b160193ad3..3fcf9154f7 100644 --- a/lib_enc/ivas_decision_matrix_enc.c +++ b/lib_enc/ivas_decision_matrix_enc.c @@ -453,12 +453,8 @@ void ivas_signaling_enc( { /* only WB is supported */ } -#ifdef ISM_FB else if ( ( element_brate < MIN_BRATE_FB_STEREO && !st->is_ism_format ) || ( element_brate < MIN_BRATE_FB_ISM && st->is_ism_format ) ) -#else - else if ( element_brate < MIN_BRATE_FB_STEREO ) -#endif { /* WB and SWB are supported */ ind = st->bwidth - WB; diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index ff7e2a6638..5e051e41b7 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -1649,13 +1649,11 @@ static ivas_error printConfigInfo_enc( { if ( newBandwidthApi != hEncoderConfig->max_bwidth ) { -#ifdef ISM_FB if ( hEncoderConfig->ivas_format == ISM_FORMAT ) { fprintf( stdout, "\nFB coding not supported below %.2f kbps for %i objects. Switching to SWB.\n", hEncoderConfig->nchan_ism * MIN_BRATE_FB_ISM / 1000.f, hEncoderConfig->nchan_ism ); } else -#endif { fprintf( stdout, "\nFB coding not supported below %.2f kbps. Switching to SWB.\n", MIN_BRATE_FB_STEREO / 1000.f ); } @@ -1955,12 +1953,8 @@ static ivas_error sanitizeBandwidth( } else { -#ifdef ISM_FB if ( max_bwidth_tmp == FB && ( ( hEncoderConfig->ivas_format != ISM_FORMAT && hEncoderConfig->ivas_total_brate < MIN_BRATE_FB_STEREO ) || ( hEncoderConfig->ivas_format == ISM_FORMAT && hEncoderConfig->ivas_total_brate / hEncoderConfig->nchan_ism < MIN_BRATE_FB_ISM ) ) ) -#else - if ( max_bwidth_tmp == FB && hEncoderConfig->ivas_total_brate < MIN_BRATE_FB_STEREO ) -#endif { max_bwidth_tmp = SWB; } -- GitLab From 4cd5b64665c592c960491ddde99bed45b4222366 Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:48:07 +0200 Subject: [PATCH 05/23] accept FIX_558_PLC_DISCONT --- lib_com/options.h | 1 - lib_dec/ivas_post_proc.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 247b040c84..e10b05ce3f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -154,7 +154,6 @@ #define SBA_MODE_CLEANUP_2 /* Dlb : changes part of fix issue #523 for unused signaling bit in SBA SID*/ #define FIX_137_SID_MD_BITS /* Dlb: Fix issue #137 , SID bitrate mismatch correction */ #define FIX_470_MASA_JBM_EXT /* Nokia: Issue 470, fix MASA EXT output with JBM */ -#define FIX_558_PLC_DISCONT /* FhG: issue 558: fix discontinuities in DFT Stereo when switching from TCX concealment to ACELP */ #define FIX_564 /* Nokia: Issue 564: Fix gains in JBM path for SBA with parametric binaural renderer */ #define FIX_566_2DIR_MASA_384K /* Nokia: Issued 566: Bugfix in 384k MASA metadata encoding of second direction */ #define FIX_568_ISM_BITRATE_SWITCHING /* Philips: Issue 568: Bugfix for renderer re-initialization by ISM and bitrate switching */ diff --git a/lib_dec/ivas_post_proc.c b/lib_dec/ivas_post_proc.c index 7f1c84983b..417cd7c5b4 100755 --- a/lib_dec/ivas_post_proc.c +++ b/lib_dec/ivas_post_proc.c @@ -208,11 +208,7 @@ void stereo_dft_dec_core_switching( lerp( hCPE->input_mem_BPF[0], hCPE->input_mem_BPF[0], NS2SA( st->L_frame * FRAMES_PER_SEC, STEREO_DFT32MS_OVL_NS ), NS2SA( st->last_L_frame * FRAMES_PER_SEC, STEREO_DFT32MS_OVL_NS ) ); } -#ifdef FIX_558_PLC_DISCONT if ( st->prev_bfi && !( st->last_core_bfi == ACELP_CORE && st->last_con_tcx == 1 ) ) -#else - if ( st->prev_bfi ) -#endif { /* last_core needed for correctly decoding ACELP->TCX/HQ switching frames in ivas_core_dec(). In the following steps the decoder needs to consider if the core was changed due to a lost frame to apply the correct transition */ -- GitLab From 6cf3b7ffb6b208eeb80ded665a349dbde2c9e4a8 Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:48:08 +0200 Subject: [PATCH 06/23] accept FIX_566_2DIR_MASA_384K --- lib_com/options.h | 1 - lib_dec/ivas_qmetadata_dec.c | 14 -------------- lib_enc/ivas_qmetadata_enc.c | 11 ----------- 3 files changed, 26 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index e10b05ce3f..cc774a5ab5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,6 @@ #define FIX_137_SID_MD_BITS /* Dlb: Fix issue #137 , SID bitrate mismatch correction */ #define FIX_470_MASA_JBM_EXT /* Nokia: Issue 470, fix MASA EXT output with JBM */ #define FIX_564 /* Nokia: Issue 564: Fix gains in JBM path for SBA with parametric binaural renderer */ -#define FIX_566_2DIR_MASA_384K /* Nokia: Issued 566: Bugfix in 384k MASA metadata encoding of second direction */ #define FIX_568_ISM_BITRATE_SWITCHING /* Philips: Issue 568: Bugfix for renderer re-initialization by ISM and bitrate switching */ #define FIX_565_SBA_BURST_IN_FEC /* VA: Issue 565: Fix noise burst during FEC, due to wrong total_brate initialization */ #define FIX_562_ISM2_64KBPS /* VA: issue 562: fix ISM2 at 64kbps issue */ diff --git a/lib_dec/ivas_qmetadata_dec.c b/lib_dec/ivas_qmetadata_dec.c index 3e978a59b9..e4c69cd288 100644 --- a/lib_dec/ivas_qmetadata_dec.c +++ b/lib_dec/ivas_qmetadata_dec.c @@ -962,7 +962,6 @@ int16_t ivas_qmetadata_dec_decode_hr_384_512( } } #else -#ifdef FIX_566_2DIR_MASA_384K float ratioSum; for ( b = hQMetaData->q_direction[1].cfg.start_band; b < hQMetaData->q_direction[1].cfg.nbands; b++ ) { @@ -980,19 +979,6 @@ int16_t ivas_qmetadata_dec_decode_hr_384_512( } } } -#else - for ( b = hQMetaData->q_direction[1].cfg.start_band; b < hQMetaData->q_direction[1].cfg.nbands; b++ ) - { - for ( m = 0; m < hQMetaData->q_direction[1].cfg.nblocks; m++ ) - { - hQMetaData->q_direction[1].band_data[b].energy_ratio[m] = 1.0f - diffuseness_reconstructions_hr[hQMetaData->q_direction[1].band_data[b].energy_ratio_index[m]]; - if ( hQMetaData->q_direction[1].band_data[b].energy_ratio[m] > 1.0f - hQMetaData->q_direction[0].band_data[b].energy_ratio[m] ) - { - hQMetaData->q_direction[1].band_data[b].energy_ratio[m] = 1.0f - hQMetaData->q_direction[0].band_data[b].energy_ratio[m]; - } - } - } -#endif #endif } diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index 122bbf2283..7cf68d677d 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -759,7 +759,6 @@ ivas_error ivas_qmetadata_enc_encode_hr_384_512( bits_no_dirs_coh += #endif write_2dir_info( hMetaData, hQMetaData->twoDirBands, hQMetaData->q_direction[0].cfg.nbands, hQMetaData->numTwoDirBands ); -#ifdef FIX_566_2DIR_MASA_384K d = 0; for ( i = hQMetaData->q_direction[1].cfg.start_band; i < hQMetaData->q_direction[1].cfg.nbands; i++ ) { @@ -776,7 +775,6 @@ ivas_error ivas_qmetadata_enc_encode_hr_384_512( d++; } } -#endif for ( i = hQMetaData->numTwoDirBands; i < hQMetaData->q_direction[0].cfg.nbands; i++ ) { set_f( hQMetaData->q_direction[1].band_data[i].energy_ratio, 0.0f, hQMetaData->q_direction[1].cfg.nblocks ); @@ -1622,9 +1620,7 @@ static void ivas_qmetadata_quantize_diffuseness_nrg_ratios_hr_512( } } #else -#ifdef FIX_566_2DIR_MASA_384K float ratioSum; -#endif for ( j = hQMetaData->q_direction[1].cfg.start_band; j < hQMetaData->q_direction[1].cfg.nbands; ++j ) { for ( k = 0; k < hQMetaData->q_direction[1].cfg.nblocks; k++ ) @@ -1633,19 +1629,12 @@ static void ivas_qmetadata_quantize_diffuseness_nrg_ratios_hr_512( push_next_indice( hMetaData, index, MASA_BITS_ER_HR ); hQMetaData->q_direction[1].band_data[j].energy_ratio_index[k] = index; hQMetaData->q_direction[1].band_data[j].energy_ratio[k] = 1.0f - diffuseness_reconstructions_hr[index]; -#ifdef FIX_566_2DIR_MASA_384K ratioSum = hQMetaData->q_direction[0].band_data[j].energy_ratio[k] + hQMetaData->q_direction[1].band_data[j].energy_ratio[k]; if ( ratioSum > 1.0f ) { hQMetaData->q_direction[0].band_data[j].energy_ratio[k] /= ratioSum; hQMetaData->q_direction[1].band_data[j].energy_ratio[k] /= ratioSum; } -#else - if ( hQMetaData->q_direction[1].band_data[j].energy_ratio[k] > 1.0f - hQMetaData->q_direction[0].band_data[j].energy_ratio[k] ) - { - hQMetaData->q_direction[1].band_data[j].energy_ratio[k] = 1.0f - hQMetaData->q_direction[0].band_data[j].energy_ratio[k]; - } -#endif needed_bits[1] += MASA_BITS_ER_HR; hQMetaData->q_direction[1].band_data[j].bits_sph_idx[k] = bits_dir_hr; } -- GitLab From e0a4cb89b80ce0e52468947152fe06abb0e122a0 Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:48:08 +0200 Subject: [PATCH 07/23] accept FIX_568_ISM_BITRATE_SWITCHING --- lib_com/options.h | 1 - lib_dec/ivas_ism_dec.c | 16 ---------------- 2 files changed, 17 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index cc774a5ab5..431a755f75 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,6 @@ #define FIX_137_SID_MD_BITS /* Dlb: Fix issue #137 , SID bitrate mismatch correction */ #define FIX_470_MASA_JBM_EXT /* Nokia: Issue 470, fix MASA EXT output with JBM */ #define FIX_564 /* Nokia: Issue 564: Fix gains in JBM path for SBA with parametric binaural renderer */ -#define FIX_568_ISM_BITRATE_SWITCHING /* Philips: Issue 568: Bugfix for renderer re-initialization by ISM and bitrate switching */ #define FIX_565_SBA_BURST_IN_FEC /* VA: Issue 565: Fix noise burst during FEC, due to wrong total_brate initialization */ #define FIX_562_ISM2_64KBPS /* VA: issue 562: fix ISM2 at 64kbps issue */ #define FIX_559_EXTL_IGF_MISMATCH /* VA: issue 559: fix mismatch between st->extl and st->igf observed as crash in PlanarSBA bitrate switching */ diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index fa5783d90a..63464def7f 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -171,11 +171,7 @@ static ivas_error ivas_ism_bitrate_switching( /* Deallocate the ParamISM struct */ ivas_param_ism_dec_close( &( st_ivas->hDirAC ), &( st_ivas->hSpatParamRendCom ), st_ivas->hDecoderConfig->output_config ); -#ifdef FIX_568_ISM_BITRATE_SWITCHING if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#else - if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL ) -#endif { /* close the parametric binaural renderer */ ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); @@ -214,11 +210,7 @@ static ivas_error ivas_ism_bitrate_switching( } } -#ifdef FIX_568_ISM_BITRATE_SWITCHING if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR ) -#else - if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#endif { /* close the parametric binaural renderer */ ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); @@ -246,11 +238,7 @@ static ivas_error ivas_ism_bitrate_switching( { return error; } -#ifdef FIX_568_ISM_BITRATE_SWITCHING if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#else - if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL ) -#endif { /* open the parametric binaural renderer */ if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) @@ -296,11 +284,7 @@ static ivas_error ivas_ism_bitrate_switching( } } -#ifdef FIX_568_ISM_BITRATE_SWITCHING if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR ) -#else - if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#endif { /* open the parametric binaural renderer */ if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) -- GitLab From 65169a29b0c3e206e8b2bba57452f0ac4529956e Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:48:09 +0200 Subject: [PATCH 08/23] accept FIX_565_SBA_BURST_IN_FEC --- lib_com/options.h | 1 - lib_dec/FEC.c | 8 -------- lib_dec/ivas_sce_dec.c | 7 ------- lib_dec/ivas_spar_decoder.c | 2 -- 4 files changed, 18 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 431a755f75..a1989e1479 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,6 @@ #define FIX_137_SID_MD_BITS /* Dlb: Fix issue #137 , SID bitrate mismatch correction */ #define FIX_470_MASA_JBM_EXT /* Nokia: Issue 470, fix MASA EXT output with JBM */ #define FIX_564 /* Nokia: Issue 564: Fix gains in JBM path for SBA with parametric binaural renderer */ -#define FIX_565_SBA_BURST_IN_FEC /* VA: Issue 565: Fix noise burst during FEC, due to wrong total_brate initialization */ #define FIX_562_ISM2_64KBPS /* VA: issue 562: fix ISM2 at 64kbps issue */ #define FIX_559_EXTL_IGF_MISMATCH /* VA: issue 559: fix mismatch between st->extl and st->igf observed as crash in PlanarSBA bitrate switching */ #define FIX_571_REVERB_NOT_ACTIVATED_ISM /* Philips: Issue 571: Reverb not activated for discrete and parametric ISM */ diff --git a/lib_dec/FEC.c b/lib_dec/FEC.c index 2a49ff3b1f..0a46a263cb 100644 --- a/lib_dec/FEC.c +++ b/lib_dec/FEC.c @@ -331,11 +331,7 @@ void FEC_exc_estim( /*-----------------------------------------------------------------* * Replicate the last spectrum in case the last good frame was coded by GSC *-----------------------------------------------------------------*/ -#ifndef FIX_565_SBA_BURST_IN_FEC - if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->total_brate <= ACELP_24k40 && !st->Opt_AMR_WB ) -#else if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->total_brate <= MAX_GSC_INACTIVE_BRATE && !st->Opt_AMR_WB ) -#endif { /* Replication of the last spectrum, with a slight downscaling of its dynamic */ st->GSC_noisy_speech = st->Last_GSC_noisy_speech_flag; @@ -407,11 +403,7 @@ void FEC_exc_estim( /*-----------------------------------------------------------------* * Total excitation *-----------------------------------------------------------------*/ -#ifndef FIX_565_SBA_BURST_IN_FEC - if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->total_brate <= ACELP_24k40 && !st->Opt_AMR_WB ) -#else if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->total_brate <= MAX_GSC_INACTIVE_BRATE && !st->Opt_AMR_WB ) -#endif { /* For GSC - the excitation is already computed */ mvr2r( exc, exc2, st->L_frame ); diff --git a/lib_dec/ivas_sce_dec.c b/lib_dec/ivas_sce_dec.c index ec0e17107c..9bb7fc227d 100755 --- a/lib_dec/ivas_sce_dec.c +++ b/lib_dec/ivas_sce_dec.c @@ -185,17 +185,10 @@ ivas_error ivas_sce_dec( { st->total_brate = ivas_total_brate; } -#ifndef FIX_565_SBA_BURST_IN_FEC - else if ( st_ivas->ivas_format != ISM_FORMAT ) /* note: in ISMs, total_brate[] is set in ivas_ism_config() */ - { - st->total_brate = hSCE->element_brate - nb_bits_metadata * FRAMES_PER_SEC; - } -#else else if ( !st_ivas->bfi && st_ivas->ivas_format != ISM_FORMAT ) /* note: in ISMs, total_brate[] is set in ivas_ism_config() */ { st->total_brate = hSCE->element_brate - nb_bits_metadata * FRAMES_PER_SEC; } -#endif /*----------------------------------------------------------------* * Core codec configuration *----------------------------------------------------------------*/ diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index dd8fbdc851..1c839316e5 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -345,9 +345,7 @@ ivas_error ivas_spar_dec( st0->bit_stream = bstr_meta; st0->next_bit_pos = 0; st0->bits_frame = min( MAX_BITS_METADATA, last_bit_pos + 1 ); -#ifdef FIX_565_SBA_BURST_IN_FEC if ( !st0->bfi ) -#endif { st0->total_brate = hDecoderConfig->ivas_total_brate; /* to avoid BER detect */ } -- GitLab From 8ce0c56e9e2dbecb11782288da4a35bfc038d557 Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:48:10 +0200 Subject: [PATCH 09/23] accept FIX_562_ISM2_64KBPS --- lib_com/ivas_ism_com.c | 4 ---- lib_com/options.h | 1 - lib_dec/ivas_ism_metadata_dec.c | 4 ---- lib_enc/ivas_ism_metadata_enc.c | 4 ---- 4 files changed, 13 deletions(-) diff --git a/lib_com/ivas_ism_com.c b/lib_com/ivas_ism_com.c index 54cae6789b..7944311470 100644 --- a/lib_com/ivas_ism_com.c +++ b/lib_com/ivas_ism_com.c @@ -54,9 +54,7 @@ #define BETA_ISM_LOW_IMP 0.6f #define BETA_ISM_MEDIUM_IMP 0.8f -#ifdef FIX_562_ISM2_64KBPS #define MAX_BRATE_TCX_32k 48000 -#endif /*-------------------------------------------------------------------* @@ -292,7 +290,6 @@ ivas_error ivas_ism_config( bits_CoreCoder[ch] = tmp; } -#ifdef FIX_562_ISM2_64KBPS /* limitaton to avoid too high bitrate in one active TCX channel */ if ( element_brate[0] >= SCE_CORE_16k_LOW_LIMIT && element_brate[0] <= IVAS_32k ) { @@ -307,7 +304,6 @@ ivas_error ivas_ism_config( bits_CoreCoder[ch] = tmp; } } -#endif if ( diff > 0 ) { diff --git a/lib_com/options.h b/lib_com/options.h index a1989e1479..82436315fe 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,6 @@ #define FIX_137_SID_MD_BITS /* Dlb: Fix issue #137 , SID bitrate mismatch correction */ #define FIX_470_MASA_JBM_EXT /* Nokia: Issue 470, fix MASA EXT output with JBM */ #define FIX_564 /* Nokia: Issue 564: Fix gains in JBM path for SBA with parametric binaural renderer */ -#define FIX_562_ISM2_64KBPS /* VA: issue 562: fix ISM2 at 64kbps issue */ #define FIX_559_EXTL_IGF_MISMATCH /* VA: issue 559: fix mismatch between st->extl and st->igf observed as crash in PlanarSBA bitrate switching */ #define FIX_571_REVERB_NOT_ACTIVATED_ISM /* Philips: Issue 571: Reverb not activated for discrete and parametric ISM */ #define FIX_572_LFE_LPF_ENC /* FhG: issue 572: always apply the low pass filter to the LFE channel */ diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index 86c43f0ffd..f5ed58974f 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -512,12 +512,8 @@ ivas_error ivas_ism_metadata_dec( hSCE[ch]->hCoreCoder[0]->low_rate_mode = 0; if ( ism_mode == ISM_MODE_DISC ) { -#ifdef FIX_562_ISM2_64KBPS if ( ism_imp[ch] == ISM_NO_META && ( ( total_brate[ch] < ACELP_8k00 && element_brate[ch] < SCE_CORE_16k_LOW_LIMIT ) || ( total_brate[ch] <= ACELP_16k_LOW_LIMIT && element_brate[ch] >= SCE_CORE_16k_LOW_LIMIT ) ) ) -#else - if ( ism_imp[ch] == ISM_NO_META && total_brate[ch] < ACELP_8k00 ) -#endif { hSCE[ch]->hCoreCoder[0]->low_rate_mode = 1; } diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index cbf3d945de..ed43af153d 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -576,12 +576,8 @@ ivas_error ivas_ism_metadata_enc( hSCE[ch]->hCoreCoder[0]->low_rate_mode = 0; if ( ism_mode == ISM_MODE_DISC ) { -#ifdef FIX_562_ISM2_64KBPS if ( ism_imp[ch] == ISM_NO_META && ( ( total_brate[ch] < ACELP_8k00 && element_brate[ch] < SCE_CORE_16k_LOW_LIMIT ) || ( total_brate[ch] <= ACELP_16k_LOW_LIMIT && element_brate[ch] >= SCE_CORE_16k_LOW_LIMIT ) ) ) -#else - if ( ism_imp[ch] == ISM_NO_META && total_brate[ch] < ACELP_8k00 ) -#endif { hSCE[ch]->hCoreCoder[0]->low_rate_mode = 1; } -- GitLab From 0f0b21ccf577cdf25e34da4b05961040cb072ef1 Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:48:10 +0200 Subject: [PATCH 10/23] accept FIX_572_LFE_LPF_ENC --- lib_com/ivas_prot.h | 2 -- lib_com/options.h | 1 - lib_enc/ivas_enc.c | 2 -- lib_enc/ivas_init_enc.c | 6 ------ lib_enc/ivas_lfe_enc.c | 13 ------------- lib_enc/ivas_stat_enc.h | 5 ----- 6 files changed, 29 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 3b6c1558be..885de08281 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5372,7 +5372,6 @@ void ivas_lfe_synth_with_filters( ); -#ifdef FIX_572_LFE_LPF_ENC /*----------------------------------------------------------------------------------* * LFE encoder low pass filter prototypes *----------------------------------------------------------------------------------*/ @@ -5391,7 +5390,6 @@ void ivas_lfe_lpf_enc_apply( float data_lfe_ch[], /* i/o: LFE signal */ const int16_t input_frame /* i : input frame length per channel */ ); -#endif /*----------------------------------------------------------------------------------* diff --git a/lib_com/options.h b/lib_com/options.h index 82436315fe..905ef21c5b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,7 +157,6 @@ #define FIX_564 /* Nokia: Issue 564: Fix gains in JBM path for SBA with parametric binaural renderer */ #define FIX_559_EXTL_IGF_MISMATCH /* VA: issue 559: fix mismatch between st->extl and st->igf observed as crash in PlanarSBA bitrate switching */ #define FIX_571_REVERB_NOT_ACTIVATED_ISM /* Philips: Issue 571: Reverb not activated for discrete and parametric ISM */ -#define FIX_572_LFE_LPF_ENC /* FhG: issue 572: always apply the low pass filter to the LFE channel */ #define FIX_QMETA_SID_5k2 /* Nokia: Issue 137: enable using full 5.2k bitrate in MASA SID */ #define FIX_578_PARAMMC_ILD_BS /* FhG: Issue 578: transmitt also center ILD in band 0 when LFE is active in 3TC ParamMC */ #define FIX_UNCLR_ISSUE /* VoiceAge: issue 574: Fix UNCLR mis-classifications in noisy speech stereo */ diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 854354ceb8..86d9dc3ec6 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -276,10 +276,8 @@ ivas_error ivas_enc( hMetaData = ( st_ivas->nSCE > 0 ) ? st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData : st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData; -#ifdef FIX_572_LFE_LPF_ENC /* LFE low pass filter */ ivas_lfe_lpf_enc_apply( st_ivas->hLfeLpf, data_f[LFE_CHANNEL], input_frame ); -#endif /* LFE channel encoder */ if ( st_ivas->mc_mode == MC_MODE_MCT ) diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index fdb562243c..6d0b1086c1 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -314,10 +314,8 @@ void ivas_initialize_handles_enc( /* LFE handle */ st_ivas->hLFE = NULL; -#ifdef FIX_572_LFE_LPF_ENC /* LFE low pass filter handle */ st_ivas->hLfeLpf = NULL; -#endif return; } @@ -548,12 +546,10 @@ ivas_error ivas_init_encoder( hEncoderConfig->nchan_inp = ivas_mc_ls_setup_get_num_channels( hEncoderConfig->mc_input_setup ); -#ifdef FIX_572_LFE_LPF_ENC if ( ( error = ivas_create_lfe_lpf_enc( &st_ivas->hLfeLpf, hEncoderConfig->input_Fs ) ) != IVAS_ERR_OK ) { return error; } -#endif if ( st_ivas->mc_mode == MC_MODE_MCT ) { @@ -956,10 +952,8 @@ void ivas_destroy_enc( /* LFE handle */ ivas_lfe_enc_close( &( st_ivas->hLFE ) ); -#ifdef FIX_572_LFE_LPF_ENC /* LFE low pass filter state */ ivas_lfe_lpf_enc_close( &( st_ivas->hLfeLpf ) ); -#endif /* Param-Upmix MC handle */ ivas_mc_paramupmix_enc_close( &( st_ivas->hMCParamUpmix ), st_ivas->hEncoderConfig->input_Fs ); diff --git a/lib_enc/ivas_lfe_enc.c b/lib_enc/ivas_lfe_enc.c index 61072cc187..75952fe62c 100644 --- a/lib_enc/ivas_lfe_enc.c +++ b/lib_enc/ivas_lfe_enc.c @@ -344,10 +344,6 @@ void ivas_lfe_enc( zero_pad_len = hLFE->pWindow_state->zero_pad_len; pWindow_coeffs = hLFE->pWindow_state->pWindow_coeffs; -#ifndef FIX_572_LFE_LPF_ENC - /*Low Pass Filter */ - ivas_filter_process( &hLFE->filter_state, data_lfe_ch, input_frame ); -#endif /* Windowing */ ivas_dct_windowing( fade_len, full_len, dct_len, zero_pad_len, pWindow_coeffs, input_frame, wtda_audio, hLFE->old_wtda_audio, data_lfe_ch ); @@ -382,9 +378,6 @@ ivas_error ivas_create_lfe_enc( { int16_t input_frame; LFE_ENC_HANDLE hLFE; -#ifndef FIX_572_LFE_LPF_ENC - const float *filt_coeff; -#endif int16_t i, j; input_frame = (int16_t) ( input_Fs / FRAMES_PER_SEC ); @@ -426,10 +419,6 @@ ivas_error ivas_create_lfe_enc( lfe_window_init( hLFE->pWindow_state, input_Fs, input_frame ); -#ifndef FIX_572_LFE_LPF_ENC - ivas_lfe_lpf_select_filt_coeff( input_Fs, IVAS_FILTER_ORDER_4, &filt_coeff ); - ivas_filters_init( &hLFE->filter_state, filt_coeff, IVAS_FILTER_ORDER_4 ); -#endif /* Initialization for entropy coding */ hLFE->cum_freq_models[0][0] = ivas_str_lfe_freq_models.entropy_coder_model_fine_sg1; @@ -489,7 +478,6 @@ void ivas_lfe_enc_close( return; } -#ifdef FIX_572_LFE_LPF_ENC /*------------------------------------------------------------------------- * ivas_create_lfe_lpf_enc() * @@ -563,4 +551,3 @@ void ivas_lfe_lpf_enc_apply( return; } -#endif diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index 12e0bd7d30..9a37f8f9cf 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -1061,9 +1061,6 @@ typedef struct stereo_dmx_evs_enc_data_structure typedef struct ivas_lfe_enc_data_structure { -#ifndef FIX_572_LFE_LPF_ENC - ivas_filters_process_state_t filter_state; -#endif LFE_WINDOW_HANDLE pWindow_state; BSTR_ENC_HANDLE hBstr; /* pointer to encoder bitstream handle */ const uint16_t *cum_freq_models[IVAS_MAX_NUM_QUANT_STRATS][IVAS_MAX_NUM_DCT_COEF_GROUPS]; @@ -1166,9 +1163,7 @@ typedef struct MC_PARAMUPMIX_ENC_HANDLE hMCParamUpmix; /* MC Param-Upmix handle */ MCMASA_ENC_HANDLE hMcMasa; /* Multi-channel MASA data handle */ LFE_ENC_HANDLE hLFE; /* LFE data handle */ -#ifdef FIX_572_LFE_LPF_ENC ivas_filters_process_state_t *hLfeLpf; /* low pass filter state for LFE */ -#endif ISM_MODE ism_mode; /* ISM format mode */ MC_MODE mc_mode; /* MC format mode */ -- GitLab From 19c0c55b07c4977c9e9df0e31a0129cd2c4888c7 Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:48:11 +0200 Subject: [PATCH 11/23] accept FIX_578_PARAMMC_ILD_BS --- lib_com/options.h | 1 - lib_dec/ivas_mc_param_dec.c | 10 ---------- lib_enc/ivas_mc_param_enc.c | 8 -------- 3 files changed, 19 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 905ef21c5b..eeb8e57926 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -158,7 +158,6 @@ #define FIX_559_EXTL_IGF_MISMATCH /* VA: issue 559: fix mismatch between st->extl and st->igf observed as crash in PlanarSBA bitrate switching */ #define FIX_571_REVERB_NOT_ACTIVATED_ISM /* Philips: Issue 571: Reverb not activated for discrete and parametric ISM */ #define FIX_QMETA_SID_5k2 /* Nokia: Issue 137: enable using full 5.2k bitrate in MASA SID */ -#define FIX_578_PARAMMC_ILD_BS /* FhG: Issue 578: transmitt also center ILD in band 0 when LFE is active in 3TC ParamMC */ #define FIX_UNCLR_ISSUE /* VoiceAge: issue 574: Fix UNCLR mis-classifications in noisy speech stereo */ #define FIX_TCX_LOWRATE_LIMITATION /* VA: issue 577: TCX bitrate limitation only when DEBUGGING is active */ #define FIX_575_LOW_OVERLAP_PLC_RECOVERY /* FhG: Issue 575 fix for PLC and transistion to TCX5*/ diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 8f750fa819..0ba001d415 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -3090,19 +3090,13 @@ static void ivas_param_mc_bs_decode_parameter_values( int16_t i, j, k; float dequant_seq[PARAM_MC_MAX_PARAMETER_BANDS * PARAM_MC_MAX_VAL_MAP_SIZE]; float dequant_ordered[PARAM_MC_MAX_PARAMETER_BANDS * PARAM_MC_MAX_VAL_MAP_SIZE]; -#ifdef FIX_578_PARAMMC_ILD_BS int16_t n_lfe_idx; -#endif range_coding = bit_buffer[( *bit_pos )++]; /* Decoding the sequence */ -#ifdef FIX_578_PARAMMC_ILD_BS n_lfe_idx = map_size - map_size_wo_lfe; sz_seq = num_param_bands * ( map_size_wo_lfe ) + num_lfe_bands * n_lfe_idx; -#else - sz_seq = num_param_bands * ( map_size_wo_lfe ) + num_lfe_bands; -#endif set_s( idx, 0, PARAM_MC_MAX_PARAMETER_BANDS * PARAM_MC_MAX_VAL_MAP_SIZE ); set_zero( dequant_ordered, PARAM_MC_MAX_PARAMETER_BANDS * PARAM_MC_MAX_VAL_MAP_SIZE ); @@ -3163,14 +3157,10 @@ static void ivas_param_mc_bs_decode_parameter_values( for ( i = 0; i < num_lfe_bands; i++ ) { -#ifdef FIX_578_PARAMMC_ILD_BS for ( j = 0; j < n_lfe_idx; j++ ) { dequant_ordered[map_size - n_lfe_idx + j + i * map_size] = dequant_seq[k++]; } -#else - dequant_ordered[map_size - 1 + i * map_size] = dequant_seq[k++]; -#endif } if ( !( *BER_detect ) ) diff --git a/lib_enc/ivas_mc_param_enc.c b/lib_enc/ivas_mc_param_enc.c index 95bb61c12d..248cae9e4d 100644 --- a/lib_enc/ivas_mc_param_enc.c +++ b/lib_enc/ivas_mc_param_enc.c @@ -1734,7 +1734,6 @@ static void ivas_param_mc_encode_parameter( if ( hMetadataPMC->bAttackPresent || hMetadataPMC->param_frame_idx == hMetadataPMC->coding_band_mapping[i] ) { /* LFE ICC/ILDs are always the last ones in coding band 0 */ -#ifdef FIX_578_PARAMMC_ILD_BS int16_t n_lfe_idx, k; n_lfe_idx = map_size - map_size_wo_lfe; for ( k = 0; k < n_lfe_idx; k++ ) @@ -1745,13 +1744,6 @@ static void ivas_param_mc_encode_parameter( idx_prev = idx; sz_seq++; } -#else - idx = quant_idx[( i + 1 ) * map_size - 1]; - seq[sz_seq] = idx; - seq_delta[sz_seq] = idx - idx_prev + idx_offset; - idx_prev = idx; - sz_seq++; -#endif } } } -- GitLab From e4754cd74fe52f6ae8ed860732970d83d3ce2333 Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:48:11 +0200 Subject: [PATCH 12/23] accept FIX_UNCLR_ISSUE --- lib_com/options.h | 1 - lib_enc/ivas_stereo_classifier.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index eeb8e57926..6caea5eb61 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -158,7 +158,6 @@ #define FIX_559_EXTL_IGF_MISMATCH /* VA: issue 559: fix mismatch between st->extl and st->igf observed as crash in PlanarSBA bitrate switching */ #define FIX_571_REVERB_NOT_ACTIVATED_ISM /* Philips: Issue 571: Reverb not activated for discrete and parametric ISM */ #define FIX_QMETA_SID_5k2 /* Nokia: Issue 137: enable using full 5.2k bitrate in MASA SID */ -#define FIX_UNCLR_ISSUE /* VoiceAge: issue 574: Fix UNCLR mis-classifications in noisy speech stereo */ #define FIX_TCX_LOWRATE_LIMITATION /* VA: issue 577: TCX bitrate limitation only when DEBUGGING is active */ #define FIX_575_LOW_OVERLAP_PLC_RECOVERY /* FhG: Issue 575 fix for PLC and transistion to TCX5*/ #define FIX_550_FIRST_FRAME_ACCESS /* Eri: Issue 550: TD Object renderer: first frame accesses wrong transport channel offsets */ diff --git a/lib_enc/ivas_stereo_classifier.c b/lib_enc/ivas_stereo_classifier.c index eb0c054cd3..555a27d725 100644 --- a/lib_enc/ivas_stereo_classifier.c +++ b/lib_enc/ivas_stereo_classifier.c @@ -107,10 +107,8 @@ int16_t select_stereo_mode( /* set binary flag indicating LRTD mode based on unclr/xtalk classifiers' decisions */ hStereoClassif->prev_lrtd_mode = hStereoClassif->lrtd_mode; -#ifdef FIX_UNCLR_ISSUE hStereoClassif->unclr_decision = ( hStereoClassif->unclr_decision && hCPE->hCoreCoder[0]->flag_noisy_speech_snr == 0 && hCPE->element_brate > IVAS_16k4 ); -#endif hStereoClassif->lrtd_mode = ( ( hStereoClassif->unclr_decision | hStereoClassif->xtalk_decision ) && is_speech ); stereo_switching_flag = 1; -- GitLab From 9f8407bf00b266be7567b5aec8d0f60eceb8efe8 Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:48:12 +0200 Subject: [PATCH 13/23] accept FIX_TCX_LOWRATE_LIMITATION --- lib_com/options.h | 1 - lib_enc/ivas_decision_matrix_enc.c | 29 ----------------------------- 2 files changed, 30 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6caea5eb61..9515c9eb2c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -158,7 +158,6 @@ #define FIX_559_EXTL_IGF_MISMATCH /* VA: issue 559: fix mismatch between st->extl and st->igf observed as crash in PlanarSBA bitrate switching */ #define FIX_571_REVERB_NOT_ACTIVATED_ISM /* Philips: Issue 571: Reverb not activated for discrete and parametric ISM */ #define FIX_QMETA_SID_5k2 /* Nokia: Issue 137: enable using full 5.2k bitrate in MASA SID */ -#define FIX_TCX_LOWRATE_LIMITATION /* VA: issue 577: TCX bitrate limitation only when DEBUGGING is active */ #define FIX_575_LOW_OVERLAP_PLC_RECOVERY /* FhG: Issue 575 fix for PLC and transistion to TCX5*/ #define FIX_550_FIRST_FRAME_ACCESS /* Eri: Issue 550: TD Object renderer: first frame accesses wrong transport channel offsets */ #define FIX_550_FIRST_FRAME_ACCESS_ALT /* Eri: Issue 550: Should be merged with FIX_550_FIRST_FRAME_ACCESS above, or accepted at the same time */ diff --git a/lib_enc/ivas_decision_matrix_enc.c b/lib_enc/ivas_decision_matrix_enc.c index 3fcf9154f7..d381d34f8d 100644 --- a/lib_enc/ivas_decision_matrix_enc.c +++ b/lib_enc/ivas_decision_matrix_enc.c @@ -165,19 +165,6 @@ void ivas_decision_matrix_enc( st->core = mdct_classifier( st, fft_buff, enerBuffer, st->bits_frame_nominal * FRAMES_PER_SEC ); } -#ifndef FIX_TCX_LOWRATE_LIMITATION - /* Warning: TCX not available at low bitrates -> replace it by GSC */ - if ( st->core == TCX_20_CORE && st->total_brate < STEREO_TCX_MIN_RATE ) - { - st->core = ACELP_CORE; - st->coder_type = AUDIO; - st->sp_aud_decision2 = 0; - if ( st->low_rate_mode ) - { - st->coder_type = INACTIVE; - } - } -#endif } /* do not allow TD stereo ACELP core -> DFT stereo TCX core switching as it is on the WC complexity path */ @@ -224,23 +211,8 @@ void ivas_decision_matrix_enc( } } -#ifndef FIX_TCX_LOWRATE_LIMITATION - /* TCX not available at low bitrates -> replace it by GSC */ - if ( st->core == TCX_20_CORE && st->total_brate < STEREO_TCX_MIN_RATE ) - { - st->core = ACELP_CORE; - st->coder_type = AUDIO; - st->sp_aud_decision2 = 0; - - if ( st->low_rate_mode ) - { - st->coder_type = INACTIVE; - } - } -#endif #endif -#ifdef FIX_TCX_LOWRATE_LIMITATION /* TCX not available at low bitrates -> replace it by GSC */ if ( st->core == TCX_20_CORE && st->total_brate < STEREO_TCX_MIN_RATE ) { @@ -253,7 +225,6 @@ void ivas_decision_matrix_enc( st->coder_type = INACTIVE; } } -#endif /*---------------------------------------------------------------------* * Select ACELP and GSC extension layer -- GitLab From 5d6d71ab9b8a5693b193ca8637c963b21a85c546 Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:48:12 +0200 Subject: [PATCH 14/23] accept FIX_575_LOW_OVERLAP_PLC_RECOVERY --- lib_com/options.h | 1 - lib_dec/dec_tcx.c | 28 ---------------------------- 2 files changed, 29 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 9515c9eb2c..29f0c7e2e3 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -158,7 +158,6 @@ #define FIX_559_EXTL_IGF_MISMATCH /* VA: issue 559: fix mismatch between st->extl and st->igf observed as crash in PlanarSBA bitrate switching */ #define FIX_571_REVERB_NOT_ACTIVATED_ISM /* Philips: Issue 571: Reverb not activated for discrete and parametric ISM */ #define FIX_QMETA_SID_5k2 /* Nokia: Issue 137: enable using full 5.2k bitrate in MASA SID */ -#define FIX_575_LOW_OVERLAP_PLC_RECOVERY /* FhG: Issue 575 fix for PLC and transistion to TCX5*/ #define FIX_550_FIRST_FRAME_ACCESS /* Eri: Issue 550: TD Object renderer: first frame accesses wrong transport channel offsets */ #define FIX_550_FIRST_FRAME_ACCESS_ALT /* Eri: Issue 550: Should be merged with FIX_550_FIRST_FRAME_ACCESS above, or accepted at the same time */ #define FIX_569_TD_FILTER_LENGTH /* Eri: Issue 569: If an HRTF binary file exceeds the SFX_SPAT_BIN_MAX_FILTER_LENGTH the decoder crashes. This truncates the filter when generated from the model. */ diff --git a/lib_dec/dec_tcx.c b/lib_dec/dec_tcx.c index dd10cef293..cffb6a1092 100644 --- a/lib_dec/dec_tcx.c +++ b/lib_dec/dec_tcx.c @@ -377,11 +377,7 @@ void IMDCT( TCX_MDCT_Inverse( x + w * L_spec_TCX5, win, L_ola, L_win - L_ola, L_ola, st->element_mode ); } -#ifndef FIX_575_LOW_OVERLAP_PLC_RECOVERY - tcx_windowing_synthesis_current_frame( win, tcx_aldo_window_2, tcx_mdct_window_half, tcx_mdct_window_minimum, L_ola, tcx_mdct_window_half_length, tcx_mdct_window_min_length, ( w > 0 ) ? 0 : left_rect, ( w > 0 ) || ( w == 0 && index == 2 ) ? MIN_OVERLAP : hTcxCfg->tcx_last_overlap_mode, acelp_zir, hTcxDec->old_syn_Overl, syn_Overl_TDAC, st->old_Aq_12_8, tcx_mdct_window_trans, L_win, tcx_offset < 0 ? -tcx_offset : 0, ( w > 0 ) || ( frame_cnt > 0 ) ? 1 : st->last_core_bfi, ( w > 0 ) || ( frame_cnt > 0 ) ? 0 : st->last_is_cng, fullbandScale ); -#else tcx_windowing_synthesis_current_frame( win, tcx_aldo_window_2, tcx_mdct_window_half, tcx_mdct_window_minimum, L_ola, tcx_mdct_window_half_length, tcx_mdct_window_min_length, ( w > 0 ) ? 0 : left_rect, ( w > 0 ) || ( w == 0 && index == 2 ) ? MIN_OVERLAP : hTcxCfg->tcx_last_overlap_mode, acelp_zir, hTcxDec->old_syn_Overl, syn_Overl_TDAC, st->old_Aq_12_8, tcx_mdct_window_trans, L_win, tcx_offset < 0 ? -tcx_offset : 0, ( w > 0 ) || ( frame_cnt > 0 ) ? 1 : st->last_core, ( w > 0 ) || ( frame_cnt > 0 ) ? 0 : st->last_is_cng, fullbandScale ); -#endif if ( w > 0 ) { @@ -398,13 +394,11 @@ void IMDCT( /* To assure that no garbage values are passed to overlap */ set_zero( xn_buf + L_frame + tcx_offset + ( L_ola >> 1 ), overlap - tcx_offset - ( L_ola >> 1 ) ); -#ifdef FIX_575_LOW_OVERLAP_PLC_RECOVERY if ( st->prev_bfi && frame_cnt == 0 && st->last_core != st->last_core_bfi && st->last_core_bfi == ACELP_CORE ) { tcx_windowing_synthesis_past_frame( old_syn_overl, tcx_aldo_window_1_trunc, tcx_mdct_window_half, tcx_mdct_window_minimum, overlap, tcx_mdct_window_half_length, tcx_mdct_window_min_length, hTcxCfg->tcx_last_overlap_mode ); v_add( xn_buf, old_syn_overl, xn_buf, overlap ); } -#endif } else if ( !bfi && ( frame_cnt == 0 ) && ( hTcxCfg->tcx_curr_overlap_mode == FULL_OVERLAP ) ) @@ -1252,7 +1246,6 @@ void decoder_tcx_noisefilling( if ( ( frame_cnt == 0 ) && ( L_frameTCX == hTcxDec->L_frameTCX >> 1 ) && ( st->tcxonly ) && ( !st->tonal_mdct_plc_active ) && ( st->nbLostCmpt == 1 ) && ( hTcxCfg->tcx_last_overlap_mode != FULL_OVERLAP ) && ( hTcxCfg->tcx_curr_overlap_mode != FULL_OVERLAP ) ) { E_2ndlast = E_last = EPSILON; -#ifdef FIX_575_LOW_OVERLAP_PLC_RECOVERY if ( st->element_mode > EVS_MONO ) { for ( i = 0; i < L_frameTCX; i = i + 2 ) @@ -1269,19 +1262,11 @@ void decoder_tcx_noisefilling( E_last += st->hTonalMDCTConc->lastBlockData.spectralData[i + 1] * st->hTonalMDCTConc->lastBlockData.spectralData[i + 1]; } } -#else - for ( i = 0; i < infoIGFStartLine; i = i + 2 ) - { - E_2ndlast += st->hTonalMDCTConc->lastBlockData.spectralData[i] * st->hTonalMDCTConc->lastBlockData.spectralData[i]; - E_last += st->hTonalMDCTConc->lastBlockData.spectralData[i + 1] * st->hTonalMDCTConc->lastBlockData.spectralData[i + 1]; - } -#endif tmp2 = E_2ndlast / E_last; /* replace higher energy TCX5 frame by lower one to avoid energy fluctuation */ if ( tmp2 > 2 ) { -#ifdef FIX_575_LOW_OVERLAP_PLC_RECOVERY if ( st->element_mode > EVS_MONO ) { for ( i = 0; i < L_frameTCX; i = i + 2 ) @@ -1296,16 +1281,9 @@ void decoder_tcx_noisefilling( st->hTonalMDCTConc->lastBlockData.spectralData[i] = st->hTonalMDCTConc->lastBlockData.spectralData[i + 1]; } } -#else - for ( i = 0; i < infoIGFStartLine; i = i + 2 ) - { - st->hTonalMDCTConc->lastBlockData.spectralData[i] = st->hTonalMDCTConc->lastBlockData.spectralData[i + 1]; - } -#endif } else if ( tmp2 < 0.5 ) { -#ifdef FIX_575_LOW_OVERLAP_PLC_RECOVERY if ( st->element_mode > EVS_MONO ) { for ( i = 0; i < L_frameTCX; i = i + 2 ) @@ -1320,12 +1298,6 @@ void decoder_tcx_noisefilling( st->hTonalMDCTConc->lastBlockData.spectralData[i + 1] = st->hTonalMDCTConc->lastBlockData.spectralData[i]; } } -#else - for ( i = 0; i < infoIGFStartLine; i = i + 2 ) - { - st->hTonalMDCTConc->lastBlockData.spectralData[i + 1] = st->hTonalMDCTConc->lastBlockData.spectralData[i]; - } -#endif } } -- GitLab From ba792e5898ce7d62100533100636fc6266f27e94 Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:48:13 +0200 Subject: [PATCH 15/23] accept ISM_FB_16k4 --- lib_com/ivas_cnst.h | 4 ---- lib_com/options.h | 1 - lib_dec/gs_dec.c | 4 ---- 3 files changed, 9 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 0a9c2960af..88b26c1454 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -313,11 +313,7 @@ typedef enum #define MIN_BRATE_SWB_SCE ACELP_9k60 /* min. SCE bitrate where SWB is supported */ #define MIN_BRATE_SWB_STEREO IVAS_13k2 /* min. stereo bitrate where SWB is supported */ #define MIN_BRATE_FB_STEREO IVAS_32k /* min. SCE and stereo bitrate where FB is supported */ -#ifdef ISM_FB_16k4 #define MIN_BRATE_FB_ISM 16000 /* min. SCE bitrate where FB is supported in ISM format */ -#else -#define MIN_BRATE_FB_ISM 24000 /* min. SCE bitrate where FB is supported in ISM format */ -#endif #define MIN_TDM_BRATE_WB_TBE_1k05 12000 /* min. per channel bitrate where WB TBE @1.05 kbps is supported (0.35kbs at lower bitrates) */ #define MIN_BRATE_WB_TBE_1k05 9650 /* min. per channel bitrate where WB TBE @1.05 kbps is supported (0.35kbs at lower bitrates) */ diff --git a/lib_com/options.h b/lib_com/options.h index 29f0c7e2e3..6a400ec2b1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ #define FIX_550_FIRST_FRAME_ACCESS /* Eri: Issue 550: TD Object renderer: first frame accesses wrong transport channel offsets */ #define FIX_550_FIRST_FRAME_ACCESS_ALT /* Eri: Issue 550: Should be merged with FIX_550_FIRST_FRAME_ACCESS above, or accepted at the same time */ #define FIX_569_TD_FILTER_LENGTH /* Eri: Issue 569: If an HRTF binary file exceeds the SFX_SPAT_BIN_MAX_FILTER_LENGTH the decoder crashes. This truncates the filter when generated from the model. */ -#define ISM_FB_16k4 /* VA: Issue: 579: change BW from SWB to FB in NxISM conditions to match the EVS codec */ #define FIX_580_PARAMMC_ENER_BURSTS /* FhG: issue 580: energy bursts due to ILD holding when energy relations change too much */ #define FIX_595_SHL_NOGLOB /* FhG: Issue 595: compilation with BASOP_NOGLOB disabled */ #define UPDATE_FASTCONV_SBA_FILTER /* Dlb: Issue 584: Update SBA CLDFB-Domain HRTFs */ diff --git a/lib_dec/gs_dec.c b/lib_dec/gs_dec.c index 1244f97793..5ed7aa92c4 100644 --- a/lib_dec/gs_dec.c +++ b/lib_dec/gs_dec.c @@ -104,11 +104,7 @@ void decod_audio( } /* safety check in case of bit errors */ -#ifdef ISM_FB_16k4 if ( st->GSC_noisy_speech && st->bwidth < SWB && st->GSC_IVAS_mode == 0 ) -#else - if ( st->GSC_noisy_speech && st->bwidth != SWB && st->GSC_IVAS_mode == 0 ) -#endif { st->BER_detect = 1; st->GSC_noisy_speech = 0; -- GitLab From f3f0387a3f3f96657a047b58ee0965676b07bcc6 Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:48:14 +0200 Subject: [PATCH 16/23] accept FIX_580_PARAMMC_ENER_BURSTS --- lib_com/ivas_cnst.h | 2 -- lib_com/options.h | 1 - lib_enc/ivas_mc_param_enc.c | 13 ------------- lib_enc/ivas_rom_enc.c | 2 -- lib_enc/ivas_rom_enc.h | 2 -- lib_enc/ivas_stat_enc.h | 2 -- 6 files changed, 22 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 88b26c1454..4cd06c6ed4 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1427,9 +1427,7 @@ typedef enum #define PARAM_MC_ENER_LIMIT_INTRAFRAME (1.5f) #define PARAM_MC_ENER_LIMIT_INTERFRAME (2.0f) #define PARAM_MC_ENER_LIMIT_MAX_DELTA_FAC (15.0f) -#ifdef FIX_580_PARAMMC_ENER_BURSTS #define PARAM_MC_NUM_ATTACK_ILD_THRESH (3) -#endif #define PARAM_MC_LFE_ON_THRESH (8000.0f) #define PARAM_MC_BAND_TO_MDCT_BAND_RATIO 16 /* Ratio of resolution of CLDFB Bands to MDCT Bands */ #define PARAM_MC_SLOT_ENC_NS 2500000L diff --git a/lib_com/options.h b/lib_com/options.h index 6a400ec2b1..20a6deb336 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ #define FIX_550_FIRST_FRAME_ACCESS /* Eri: Issue 550: TD Object renderer: first frame accesses wrong transport channel offsets */ #define FIX_550_FIRST_FRAME_ACCESS_ALT /* Eri: Issue 550: Should be merged with FIX_550_FIRST_FRAME_ACCESS above, or accepted at the same time */ #define FIX_569_TD_FILTER_LENGTH /* Eri: Issue 569: If an HRTF binary file exceeds the SFX_SPAT_BIN_MAX_FILTER_LENGTH the decoder crashes. This truncates the filter when generated from the model. */ -#define FIX_580_PARAMMC_ENER_BURSTS /* FhG: issue 580: energy bursts due to ILD holding when energy relations change too much */ #define FIX_595_SHL_NOGLOB /* FhG: Issue 595: compilation with BASOP_NOGLOB disabled */ #define UPDATE_FASTCONV_SBA_FILTER /* Dlb: Issue 584: Update SBA CLDFB-Domain HRTFs */ #define FIX_570_SF_EXT_ORIENTATION diff --git a/lib_enc/ivas_mc_param_enc.c b/lib_enc/ivas_mc_param_enc.c index 248cae9e4d..3292796656 100644 --- a/lib_enc/ivas_mc_param_enc.c +++ b/lib_enc/ivas_mc_param_enc.c @@ -35,9 +35,7 @@ #include "options.h" #include "cnst.h" #include "rom_enc.h" -#ifdef FIX_580_PARAMMC_ENER_BURSTS #include "ivas_rom_enc.h" -#endif #include "rom_com.h" #include "prot.h" #include "ivas_prot.h" @@ -215,13 +213,11 @@ ivas_error ivas_param_mc_enc_open( /* Init total/dmx ener factors */ set_f( hParamMC->ener_fac, 0.0f, PARAM_MC_MAX_PARAMETER_BANDS ); -#ifdef FIX_580_PARAMMC_ENER_BURSTS /* init previous ILDs */ for ( i = 0; i < PARAM_MC_MAX_PARAMETER_BANDS; i++ ) { set_zero( hParamMC->prev_ilds[i], PARAM_MC_SZ_ILD_MAP ); } -#endif st_ivas->hParamMC = hParamMC; @@ -494,9 +490,6 @@ void ivas_param_mc_enc( hParamMC->hMetadataPMC.attackIndex = 0; } -#ifndef FIX_580_PARAMMC_ENER_BURSTS - band_step = hParamMC->hMetadataPMC.bAttackPresent ? PARAM_MC_TRANSIENT_BAND_STEP : 1; -#endif } break; #ifdef DEBUGGING @@ -509,9 +502,7 @@ void ivas_param_mc_enc( /* parameter estimation*/ ivas_param_mc_param_est_enc( hParamMC, data_f, Cy_sum, Cx_sum, input_frame, nchan_inp, st_ivas->nchan_transport ); -#ifdef FIX_580_PARAMMC_ENER_BURSTS band_step = hParamMC->hMetadataPMC.bAttackPresent ? PARAM_MC_TRANSIENT_BAND_STEP : 1; -#endif /* ILD parameter quantization */ @@ -847,7 +838,6 @@ static void ivas_param_mc_param_est_enc( } } -#ifdef FIX_580_PARAMMC_ENER_BURSTS if ( !hParamMC->hMetadataPMC.bAttackPresent ) { const PARAM_MC_ILD_MAPPING *h_ild_mapping; @@ -903,7 +893,6 @@ static void ivas_param_mc_param_est_enc( hParamMC->hMetadataPMC.bAttackPresent = 1; } } -#endif if ( hParamMC->hMetadataPMC.bAttackPresent ) @@ -1356,13 +1345,11 @@ static void ivas_param_mc_quantize_ilds( ref_ener += Cx[ref_channel_idx][ref_channel_idx]; } ILD[k] = 10.0f * log10f( ( Nrg[h_ild_mapping->ild_index[k]] + EPSILON ) / ( hParamMC->hMetadataPMC.ild_factors[k] * ref_ener + EPSILON ) ); -#ifdef FIX_580_PARAMMC_ENER_BURSTS hParamMC->prev_ilds[freq_idx][k] = ILD[k]; if ( hParamMC->hMetadataPMC.bAttackPresent && ( ( freq_idx + 1 ) < hParamMC->hMetadataPMC.nbands_coded ) ) { hParamMC->prev_ilds[freq_idx + 1][k] = ILD[k]; } -#endif } diff --git a/lib_enc/ivas_rom_enc.c b/lib_enc/ivas_rom_enc.c index a031d6df28..ce24de702d 100644 --- a/lib_enc/ivas_rom_enc.c +++ b/lib_enc/ivas_rom_enc.c @@ -837,13 +837,11 @@ const HUFF_TABLE huff_beta_table[2] = const int16_t mc_paramupmix_fb_remix_order[4] = {0, 1, 2, 3}; -#ifdef FIX_580_PARAMMC_ENER_BURSTS /*----------------------------------------------------------------------------------* * ParamMC ROM tables *----------------------------------------------------------------------------------*/ const float param_mc_ild_diff_threshold[20] = { 8.0f, 8.0f, 10.0f, 20.0f, 20.0f, 20.0f, 20.0f, 20.0f, 20.0f, 20.0f, 20.0f, 20.0f }; -#endif /* clang-format on */ diff --git a/lib_enc/ivas_rom_enc.h b/lib_enc/ivas_rom_enc.h index 170bf31820..fa45706cab 100644 --- a/lib_enc/ivas_rom_enc.h +++ b/lib_enc/ivas_rom_enc.h @@ -130,12 +130,10 @@ extern const HUFF_TABLE huff_alpha_table[2]; extern const HUFF_TABLE huff_beta_table[2]; extern const int16_t mc_paramupmix_fb_remix_order[4]; -#ifdef FIX_580_PARAMMC_ENER_BURSTS /*----------------------------------------------------------------------------------* * ParamMC ROM tables *----------------------------------------------------------------------------------*/ extern const float param_mc_ild_diff_threshold[20]; -#endif #endif diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index 9a37f8f9cf..59abb33a0a 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -729,9 +729,7 @@ typedef struct ivas_param_mc_enc_data_structure int16_t lfe_index; int16_t icc_map_index[PARAM_MC_PARAMETER_FRAMES][PARAM_MC_SZ_ICC_MAP]; int16_t max_param_band_abs_cov; -#ifdef FIX_580_PARAMMC_ENER_BURSTS float prev_ilds[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_SZ_ILD_MAP]; -#endif float ener_fac[PARAM_MC_MAX_PARAMETER_BANDS]; -- GitLab From 0609449a180a554eaf566bbc9e4843076151380a Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:48:14 +0200 Subject: [PATCH 17/23] accept FIX_593_STL_INCLUDE --- lib_com/options.h | 1 - lib_enc/ivas_stereo_eclvq_enc.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 20a6deb336..a3af537486 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ #define FIX_595_SHL_NOGLOB /* FhG: Issue 595: compilation with BASOP_NOGLOB disabled */ #define UPDATE_FASTCONV_SBA_FILTER /* Dlb: Issue 584: Update SBA CLDFB-Domain HRTFs */ #define FIX_570_SF_EXT_ORIENTATION -#define FIX_593_STL_INCLUDE /* FhG: Issue 593: correct include of stl.h in lib_enc/ivas_stereo_eclvq_enc.c */ #define FIX_583_CLANG_TRANS_DET /* FhG: Issue 583: clang left shift on ramp_up_flag in transient detector */ #define FIX_280_PLANAR_CP /* Dlb : fix issue 28 : remove planarCP=1 related code*/ #define CODE_CLEAN_UP_DIRAC /* Dlb : code clean up*/ diff --git a/lib_enc/ivas_stereo_eclvq_enc.c b/lib_enc/ivas_stereo_eclvq_enc.c index 71f0bc805f..f71beece82 100644 --- a/lib_enc/ivas_stereo_eclvq_enc.c +++ b/lib_enc/ivas_stereo_eclvq_enc.c @@ -41,11 +41,7 @@ #include "prot.h" #include "wmc_auto.h" /* used only for norm_s in the code_length_from_count function */ -#ifdef FIX_593_STL_INCLUDE #include "stl.h" -#else -#include "basop32.h" -#endif /*--------------------------------------------------------------- -- GitLab From f8c9e32317f5bd26829f5de8714eca02116e1375 Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:48:15 +0200 Subject: [PATCH 18/23] accept FIX_583_CLANG_TRANS_DET --- lib_com/options.h | 1 - lib_enc/stat_enc.h | 4 ---- lib_enc/transient_detection.c | 4 ---- 3 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a3af537486..1fc9f4fdd7 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ #define FIX_595_SHL_NOGLOB /* FhG: Issue 595: compilation with BASOP_NOGLOB disabled */ #define UPDATE_FASTCONV_SBA_FILTER /* Dlb: Issue 584: Update SBA CLDFB-Domain HRTFs */ #define FIX_570_SF_EXT_ORIENTATION -#define FIX_583_CLANG_TRANS_DET /* FhG: Issue 583: clang left shift on ramp_up_flag in transient detector */ #define FIX_280_PLANAR_CP /* Dlb : fix issue 28 : remove planarCP=1 related code*/ #define CODE_CLEAN_UP_DIRAC /* Dlb : code clean up*/ #define COVARIANCE_MEMORY_OPT /* Dlb : Issue 231: define SPAR covariance buffers in stack instead of inter-frame heap */ diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index 45d01ac6ca..34efc3da7f 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -126,11 +126,7 @@ typedef struct float firState1; float firState2; -#ifdef FIX_583_CLANG_TRANS_DET uint16_t ramp_up_flag; /* bit map flags to indicate a ramp up in beginning of TCX frame */ -#else - int16_t ramp_up_flag; /* bit map flags to indicate a ramp up in beginning of TCX frame */ -#endif } SubblockEnergies; diff --git a/lib_enc/transient_detection.c b/lib_enc/transient_detection.c index 3b345b7333..04cf8ea247 100644 --- a/lib_enc/transient_detection.c +++ b/lib_enc/transient_detection.c @@ -241,11 +241,7 @@ void RunTransientDetection( UpdateDelayBuffer( filteredInput, length, &hTranDet->delayBuffer ); /* compute ramp up flag */ -#ifdef FIX_583_CLANG_TRANS_DET pSubblockEnergies->ramp_up_flag = ( ( pSubblockEnergies->ramp_up_flag << 1 ) & 0x0003 ); -#else - pSubblockEnergies->ramp_up_flag = pSubblockEnergies->ramp_up_flag << 1; -#endif e0 = dotp( filteredInput + length / 2, filteredInput + length / 2, pSubblockEnergies->pDelayBuffer->nSubblockSize / 2 ) + 0.5f * MIN_BLOCK_ENERGY; e1 = pSubblockEnergies->subblockNrg[pSubblockEnergies->nDelay + 4] - e0; if ( e1 > e0 ) -- GitLab From 791ff315b9ebcb6cd46e09ed680ccd53b16e8977 Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:48:15 +0200 Subject: [PATCH 19/23] accept FIX_581_CLANG_OFFSET_TO_NULL --- lib_com/options.h | 1 - lib_enc/ivas_stereo_mdct_stereo_enc.c | 14 -------------- 2 files changed, 15 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 1fc9f4fdd7..9fc5ffb8b5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -169,7 +169,6 @@ #define COVARIANCE_MEMORY_OPT /* Dlb : Issue 231: define SPAR covariance buffers in stack instead of inter-frame heap */ #define NONBE_FIX_589_JBM_TC_OFFSETS /* FhG: issue 589: wrong offset into the TC buffers is used in some rendering paths in the JBM main rendering function */ #define FIX_MEM_REALLOC_IND_LIST /* VA: issue 601: failure of the automatic memory re-allocation mechanism when ind_list[] buffer is depleted in MASA mode with 2 TC*/ -#define FIX_581_CLANG_OFFSET_TO_NULL /* FhG: issue 581: fix CLANG error about applying an offset to a NULL pointer */ #define JBM_PARAMUPMIX /* Dlb: Issue 471: Integrate the Multichannel Parametric Upmix into the JBM path */ #define FIX_582_INDEX_OUT_OF_BOUNDS_SNS_AVQ_DEC /* FhG: fix an undefined behaviour error in SNS AVQ decoding */ #define FIX_614_ADD_TO_NULL_PTR_DIRAC_SETUP /* FhG: Issue 614: prevent adding to a null pointer in dirac setup code */ diff --git a/lib_enc/ivas_stereo_mdct_stereo_enc.c b/lib_enc/ivas_stereo_mdct_stereo_enc.c index 3d277e241d..d959cdba2f 100755 --- a/lib_enc/ivas_stereo_mdct_stereo_enc.c +++ b/lib_enc/ivas_stereo_mdct_stereo_enc.c @@ -1133,29 +1133,15 @@ void initMdctStereoEncData( set_s( hStereoMdct->mdct_stereo_mode, -1, 2 ); /*Initialize sfb parameteres for TCX20 */ -#ifdef FIX_581_CLANG_OFFSET_TO_NULL stereo_mdct_init_bands( tcx_coded_lines, TCX_20_CORE, element_brate, igf, igf ? &hIgfGrid[IGF_GRID_LB_NORM] : NULL, &hStereoMdct->stbParamsTCX20.sfbOffset[0], &hStereoMdct->stbParamsTCX20.sfbCnt ); -#else - stereo_mdct_init_bands( tcx_coded_lines, TCX_20_CORE, element_brate, igf, &hIgfGrid[IGF_GRID_LB_NORM], &hStereoMdct->stbParamsTCX20.sfbOffset[0], &hStereoMdct->stbParamsTCX20.sfbCnt ); -#endif /*Initialize sfb parameteres for TCX10 */ -#ifdef FIX_581_CLANG_OFFSET_TO_NULL stereo_mdct_init_bands( tcx_coded_lines, TCX_10_CORE, element_brate, igf, igf ? &hIgfGrid[IGF_GRID_LB_SHORT] : NULL, &hStereoMdct->stbParamsTCX10.sfbOffset[0], &hStereoMdct->stbParamsTCX10.sfbCnt ); -#else - stereo_mdct_init_bands( tcx_coded_lines, TCX_10_CORE, element_brate, igf, &hIgfGrid[IGF_GRID_LB_SHORT], - &hStereoMdct->stbParamsTCX10.sfbOffset[0], &hStereoMdct->stbParamsTCX10.sfbCnt ); -#endif /*Initialize sfb parameteres for transitions */ -#ifdef FIX_581_CLANG_OFFSET_TO_NULL stereo_mdct_init_bands( tcx_coded_lines, -1, element_brate, igf, igf ? &hIgfGrid[IGF_GRID_LB_TRAN] : NULL, &hStereoMdct->stbParamsTCX20afterACELP.sfbOffset[0], &hStereoMdct->stbParamsTCX20afterACELP.sfbCnt ); -#else - stereo_mdct_init_bands( tcx_coded_lines, -1, element_brate, igf, &hIgfGrid[IGF_GRID_LB_TRAN], - &hStereoMdct->stbParamsTCX20afterACELP.sfbOffset[0], &hStereoMdct->stbParamsTCX20afterACELP.sfbCnt ); -#endif set_s( hStereoMdct->IGFStereoMode, -1, 2 ); -- GitLab From fb4a10a363096159ce0b47058396537652f8a51b Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:48:16 +0200 Subject: [PATCH 20/23] accept REND_STATIC_MEM_OPT --- lib_com/options.h | 1 - lib_rend/lib_rend.c | 87 --------------------------------------------- 2 files changed, 88 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 9fc5ffb8b5..612df0fdf2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -179,7 +179,6 @@ #define NONBE_FIX_539_MASA_384K_CHIRP /* Nokia: issue 539, puts the normalization of the energy ratios at the correct place, affect MASA 384k only */ /* Fixes for bugs found during split rendering contribution development */ -#define REND_STATIC_MEM_OPT /* Dlb: Static memory optimisation for external renderer */ #define EULER2QUAT_FIX /* Dlb: Fix for Euler2Quat()/Quat2EulerDegree functions */ #define SBA_CREND_ROT_OPT /* Dlb: Optimisation for rotateFrameSba() used for SHD rotations in external renderer */ #define TD_TDREND_FIX_NULLPTR_ACCESS /* FhG: avoid nullptr access in ivas_rend_TDObjRendOpen */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index c8c4cabc3b..87f6947c6a 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -57,13 +57,9 @@ /* Maximum buffer length (total) in samples. */ #ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef REND_STATIC_MEM_OPT #define MAX_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) #define MAX_CLDFB_BUFFER_LENGTH ( MAX_CLDFB_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) #define MAX_BIN_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * BINAURAL_CHANNELS ) -#else /* REND_STATIC_MEM_OPT */ -#define MAX_BUFFER_LENGTH ( MAX_CLDFB_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) -#endif /* REND_STATIC_MEM_OPT */ #else #define MAX_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) @@ -124,9 +120,6 @@ typedef struct IVAS_REND_AudioConfig inConfig; IVAS_REND_InputId id; IVAS_REND_AudioBuffer inputBuffer; -#ifndef REND_STATIC_MEM_OPT - float bufferData[MAX_BUFFER_LENGTH]; -#endif float gain; /* Linear, not in dB */ rendering_context ctx; int32_t numNewSamplesPerChannel; /* Used to keep track how much new audio was fed before rendering current frame */ @@ -144,9 +137,7 @@ typedef struct #ifdef SPLIT_REND_WITH_HEAD_ROT TDREND_WRAPPER splitTdRendWrappers[MAX_HEAD_ROT_POSES - 1]; /* Additional TD Rend instances used for split rendering */ #endif -#ifdef REND_STATIC_MEM_OPT float *bufferData; -#endif int16_t nonDiegeticPan; float nonDiegeticPanGain; OMASA_ANA_HANDLE hOMasa; @@ -183,9 +174,7 @@ typedef struct int16_t nonDiegeticPan; float nonDiegeticPanGain; lfe_routing lfeRouting; -#ifdef REND_STATIC_MEM_OPT float *bufferData; -#endif MCMASA_ANA_HANDLE hMcMasa; } input_mc; @@ -203,9 +192,7 @@ typedef struct rotation_gains rot_gains_prev; #endif -#ifdef REND_STATIC_MEM_OPT float *bufferData; -#endif DIRAC_ANA_HANDLE hDirAC; } input_sba; @@ -214,9 +201,7 @@ typedef struct { input_base base; SPLIT_POST_REND_WRAPPER splitPostRendWrapper; -#ifdef REND_STATIC_MEM_OPT float *bufferData; -#endif } input_split_post_rend; #endif @@ -230,9 +215,7 @@ typedef struct DecoderDummy *decDummy; MASA_METADATA_FRAME masaMetadata; bool metadataHasBeenFed; -#ifdef REND_STATIC_MEM_OPT float *bufferData; -#endif MASA_PREREND_HANDLE hMasaPrerend; } input_masa; @@ -281,7 +264,6 @@ struct IVAS_REND * Local functions *-------------------------------------------------------------------*/ -#ifdef REND_STATIC_MEM_OPT static ivas_error allocateInputBaseBufferData( float **data, const int16_t data_size ) { *data = (float *) malloc( data_size * sizeof( float ) ); @@ -303,7 +285,6 @@ static void freeInputBaseBufferData( float **data ) return; } -#endif static IVAS_QUATERNION quaternionInit( void ) @@ -1221,11 +1202,9 @@ static void initRendInputBase( const IVAS_REND_AudioConfig inConfig, const IVAS_REND_InputId id, const rendering_context rendCtx -#ifdef REND_STATIC_MEM_OPT , float *dataBuf, const int16_t dataBufSize -#endif ) { inputBase->inConfig = inConfig; @@ -1236,17 +1215,11 @@ static void initRendInputBase( inputBase->inputBuffer.config.numSamplesPerChannel = 0; inputBase->inputBuffer.config.numChannels = 0; -#ifndef REND_STATIC_MEM_OPT - inputBase->inputBuffer.data = inputBase->bufferData; - - set_zero( inputBase->bufferData, MAX_BUFFER_LENGTH ); -#else inputBase->inputBuffer.data = dataBuf; if ( inputBase->inputBuffer.data != NULL ) { set_zero( inputBase->inputBuffer.data, dataBufSize ); } -#endif return; } @@ -1386,17 +1359,13 @@ static ivas_error setRendInputActiveIsm( return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED; } -#ifdef REND_STATIC_MEM_OPT if ( ( error = allocateInputBaseBufferData( &inputIsm->bufferData, MAX_BUFFER_LENGTH ) ) != IVAS_ERR_OK ) { return error; } -#endif initRendInputBase( &inputIsm->base, inConfig, id, rendCtx -#ifdef REND_STATIC_MEM_OPT , inputIsm->bufferData, MAX_BUFFER_LENGTH -#endif ); inputIsm->currentPos = defaultObjectPosition(); @@ -1497,14 +1466,10 @@ static void clearInputIsm( rendCtx = inputIsm->base.ctx; -#ifdef REND_STATIC_MEM_OPT freeInputBaseBufferData( &inputIsm->base.inputBuffer.data ); -#endif initRendInputBase( &inputIsm->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx -#ifdef REND_STATIC_MEM_OPT , NULL, 0 -#endif ); /* Free input's internal handles */ @@ -2408,17 +2373,13 @@ static ivas_error setRendInputActiveMc( return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED; } -#ifdef REND_STATIC_MEM_OPT if ( ( error = allocateInputBaseBufferData( &inputMc->bufferData, MAX_BUFFER_LENGTH ) ) != IVAS_ERR_OK ) { return error; } -#endif initRendInputBase( &inputMc->base, inConfig, id, rendCtx -#ifdef REND_STATIC_MEM_OPT , inputMc->bufferData, MAX_BUFFER_LENGTH -#endif ); setZeroPanMatrix( inputMc->panGains ); inputMc->customLsInput = defaultCustomLs(); @@ -2472,14 +2433,10 @@ static void clearInputMc( rendCtx = inputMc->base.ctx; -#ifdef REND_STATIC_MEM_OPT freeInputBaseBufferData( &inputMc->bufferData ); -#endif initRendInputBase( &inputMc->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx -#ifdef REND_STATIC_MEM_OPT , NULL, 0 -#endif ); /* Free input's internal handles */ @@ -2777,17 +2734,13 @@ static ivas_error setRendInputActiveSplitPostRend( rendCtx = inputSplitPostRend->base.ctx; outConfig = *rendCtx.pOutConfig; -#ifdef REND_STATIC_MEM_OPT if ( ( error = allocateInputBaseBufferData( &inputSplitPostRend->bufferData, MAX_BIN_BUFFER_LENGTH ) ) != IVAS_ERR_OK ) { return error; } -#endif initRendInputBase( &inputSplitPostRend->base, inConfig, id, rendCtx -#ifdef REND_STATIC_MEM_OPT , inputSplitPostRend->bufferData, MAX_BIN_BUFFER_LENGTH -#endif ); if ( ( error = updateSplitPostRendPanGains( inputSplitPostRend, outConfig, hRendCfg ) ) != IVAS_ERR_OK ) @@ -2842,7 +2795,6 @@ static ivas_error setRendInputActiveSba( return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED; } -#ifdef REND_STATIC_MEM_OPT #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( error = allocateInputBaseBufferData( &inputSba->bufferData, MAX_CLDFB_BUFFER_LENGTH ) ) != IVAS_ERR_OK ) #else @@ -2856,9 +2808,6 @@ static ivas_error setRendInputActiveSba( #else initRendInputBase( &inputSba->base, inConfig, id, rendCtx, inputSba->bufferData, MAX_BUFFER_LENGTH ); #endif /* SPLIT_REND_WITH_HEAD_ROT */ -#else /* REND_STATIC_MEM_OPT */ - initRendInputBase( &inputSba->base, inConfig, id, rendCtx ); -#endif /* REND_STATIC_MEM_OPT */ setZeroPanMatrix( inputSba->hoaDecMtx ); #ifdef SPLIT_REND_WITH_HEAD_ROT inputSba->crendWrapper = NULL; @@ -2896,14 +2845,10 @@ static void clearInputSplitRend( rendCtx = inputSplitRend->base.ctx; -#ifdef REND_STATIC_MEM_OPT freeInputBaseBufferData( &inputSplitRend->bufferData ); -#endif initRendInputBase( &inputSplitRend->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx -#ifdef REND_STATIC_MEM_OPT , NULL, 0 -#endif ); if ( inputSplitRend->splitPostRendWrapper.hBinHrSplitPostRend != NULL ) { @@ -2929,14 +2874,10 @@ static void clearInputSba( rendCtx = inputSba->base.ctx; -#ifdef REND_STATIC_MEM_OPT freeInputBaseBufferData( &inputSba->bufferData ); -#endif initRendInputBase( &inputSba->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx -#ifdef REND_STATIC_MEM_OPT , NULL, 0 -#endif ); /* Free input's internal handles */ @@ -3341,17 +3282,13 @@ static ivas_error setRendInputActiveMasa( return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED; } -#ifdef REND_STATIC_MEM_OPT if ( ( error = allocateInputBaseBufferData( &inputMasa->bufferData, MAX_BUFFER_LENGTH ) ) != IVAS_ERR_OK ) { return error; } -#endif initRendInputBase( &inputMasa->base, inConfig, id, rendCtx -#ifdef REND_STATIC_MEM_OPT , inputMasa->bufferData, MAX_BUFFER_LENGTH -#endif ); if ( ( error = getAudioConfigNumChannels( inConfig, &numInChannels ) ) != IVAS_ERR_OK ) @@ -3473,16 +3410,12 @@ static void clearInputMasa( rendCtx = inputMasa->base.ctx; -#ifdef REND_STATIC_MEM_OPT freeInputBaseBufferData( &inputMasa->bufferData ); -#endif masaPrerendClose( &inputMasa->hMasaPrerend ); initRendInputBase( &inputMasa->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx -#ifdef REND_STATIC_MEM_OPT , NULL, 0 -#endif ); freeDecoderDummy( &inputMasa->decDummy ); @@ -3635,10 +3568,8 @@ ivas_error IVAS_REND_Open( for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) { initRendInputBase( &hIvasRend->inputsIsm[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) -#ifdef REND_STATIC_MEM_OPT , NULL, 0 -#endif ); hIvasRend->inputsIsm[i].crendWrapper = NULL; hIvasRend->inputsIsm[i].hReverb = NULL; @@ -3650,9 +3581,7 @@ ivas_error IVAS_REND_Open( hIvasRend->inputsIsm[i].splitTdRendWrappers[j].hHrtfTD = NULL; } #endif -#ifdef REND_STATIC_MEM_OPT hIvasRend->inputsIsm[i].bufferData = NULL; -#endif hIvasRend->inputsIsm[i].nonDiegeticPan = nonDiegeticPan; hIvasRend->inputsIsm[i].nonDiegeticPanGain = nonDiegeticPanGain; hIvasRend->inputsIsm[i].hOMasa = NULL; @@ -3661,18 +3590,14 @@ ivas_error IVAS_REND_Open( for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i ) { initRendInputBase( &hIvasRend->inputsMc[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) -#ifdef REND_STATIC_MEM_OPT , NULL, 0 -#endif ); hIvasRend->inputsMc[i].efapInWrapper.hEfap = NULL; hIvasRend->inputsMc[i].crendWrapper = NULL; hIvasRend->inputsMc[i].hReverb = NULL; hIvasRend->inputsMc[i].tdRendWrapper.hBinRendererTd = NULL; -#ifdef REND_STATIC_MEM_OPT hIvasRend->inputsMc[i].bufferData = NULL; -#endif hIvasRend->inputsMc[i].nonDiegeticPan = nonDiegeticPan; hIvasRend->inputsMc[i].nonDiegeticPanGain = nonDiegeticPanGain; hIvasRend->inputsMc[i].hMcMasa = NULL; @@ -3688,35 +3613,27 @@ ivas_error IVAS_REND_Open( for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i ) { initRendInputBase( &hIvasRend->inputsSba[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) -#ifdef REND_STATIC_MEM_OPT , NULL, 0 -#endif ); hIvasRend->inputsSba[i].crendWrapper = NULL; #ifdef SPLIT_REND_WITH_HEAD_ROT hIvasRend->inputsSba[i].cldfbRendWrapper.hCldfbRend = NULL; hIvasRend->inputsSba[i].cldfbRendWrapper.hHrtfFastConv = NULL; #endif -#ifdef REND_STATIC_MEM_OPT hIvasRend->inputsSba[i].bufferData = NULL; -#endif hIvasRend->inputsSba[i].hDirAC = NULL; } for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { initRendInputBase( &hIvasRend->inputsMasa[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) -#ifdef REND_STATIC_MEM_OPT , NULL, 0 -#endif ); hIvasRend->inputsMasa[i].decDummy = NULL; hIvasRend->inputsMasa[i].metadataHasBeenFed = false; -#ifdef REND_STATIC_MEM_OPT hIvasRend->inputsMasa[i].bufferData = NULL; -#endif hIvasRend->inputsMasa[i].hMasaPrerend = NULL; } #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -3726,19 +3643,15 @@ ivas_error IVAS_REND_Open( IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) -#ifdef REND_STATIC_MEM_OPT , NULL, 0 -#endif ); ivas_init_split_post_rend_handles( &hIvasRend->inputsSplitPost[i].splitPostRendWrapper ); #ifdef SPLIT_REND_WITH_HEAD_ROT hIvasRend->splitRendBFI = 0; #endif -#ifdef REND_STATIC_MEM_OPT hIvasRend->inputsSplitPost[i].bufferData = NULL; -#endif } #endif -- GitLab From d960ffa1e43260fd6cb707e2fa34753b2660bf5b Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:48:17 +0200 Subject: [PATCH 21/23] accept EULER2QUAT_FIX --- lib_com/options.h | 1 - lib_dec/lib_dec.c | 5 ----- lib_rend/ivas_rotation.c | 6 ------ lib_rend/lib_rend.c | 4 ---- 4 files changed, 16 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 612df0fdf2..84fd0427f7 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -179,7 +179,6 @@ #define NONBE_FIX_539_MASA_384K_CHIRP /* Nokia: issue 539, puts the normalization of the energy ratios at the correct place, affect MASA 384k only */ /* Fixes for bugs found during split rendering contribution development */ -#define EULER2QUAT_FIX /* Dlb: Fix for Euler2Quat()/Quat2EulerDegree functions */ #define SBA_CREND_ROT_OPT /* Dlb: Optimisation for rotateFrameSba() used for SHD rotations in external renderer */ #define TD_TDREND_FIX_NULLPTR_ACCESS /* FhG: avoid nullptr access in ivas_rend_TDObjRendOpen */ #define TD_REND_FIX_DIV_BY_ZERO /* FhG: avoid division by zero in sincResample fn */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index b66d4ac420..686a4b6da7 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1195,11 +1195,6 @@ ivas_error IVAS_DEC_FeedHeadTrackData( { /* check for Euler angle signaling */ #ifdef SPLIT_REND_WITH_HEAD_ROT -#ifndef EULER2QUAT_FIX - /* TODO: temp change until Euler2Quat() is fixed*/ - if ( ( hIvasDec->st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && - ( hIvasDec->st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#endif #endif { if ( orientation[i].w == -3.0f ) diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index a3bf1f1d92..c7d372d65d 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -225,17 +225,11 @@ void Quat2EulerDegree( { if ( quat.w != -3.0 ) { -#ifdef EULER2QUAT_FIX float p; -#endif *yaw = atan2f( 2 * ( quat.w * quat.x + quat.y * quat.z ), 1 - 2 * ( quat.x * quat.x + quat.y * quat.y ) ); -#ifdef EULER2QUAT_FIX p = 2 * ( quat.w * quat.y - quat.z * quat.x ); p = max( -1.0f, min( 1.0f, p ) ); *pitch = asinf( p ); -#else - *pitch = asinf( 2 * ( quat.w * quat.y - quat.z * quat.x ) ); -#endif *roll = atan2f( 2 * ( quat.w * quat.z + quat.x * quat.y ), 1 - 2 * ( quat.y * quat.y + quat.z * quat.z ) ); *yaw *= _180_OVER_PI; *pitch *= _180_OVER_PI; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 87f6947c6a..5f90e361ce 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -5013,11 +5013,7 @@ ivas_error IVAS_REND_SetHeadRotation( ( hIvasRend->inputsSplitPost[0].base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || ( hIvasRend->inputsSplitPost[0].base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { -#ifndef EULER2QUAT_FIX - rotQuat = headRot[i]; /* TODO: temp change until Euler2Quat() is fixed*/ -#else Euler2Quat( deg2rad( headRot[i].x ), deg2rad( headRot[i].y ), deg2rad( headRot[i].z ), &rotQuat ); -#endif } else #endif -- GitLab From 06abef459449d5fd02e129aff87982eeee03f77f Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 11:48:17 +0200 Subject: [PATCH 22/23] accept SBA_CREND_ROT_OPT --- lib_com/options.h | 1 - lib_rend/lib_rend.c | 15 --------------- 2 files changed, 16 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 84fd0427f7..b56d19f88d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -179,7 +179,6 @@ #define NONBE_FIX_539_MASA_384K_CHIRP /* Nokia: issue 539, puts the normalization of the energy ratios at the correct place, affect MASA 384k only */ /* Fixes for bugs found during split rendering contribution development */ -#define SBA_CREND_ROT_OPT /* Dlb: Optimisation for rotateFrameSba() used for SHD rotations in external renderer */ #define TD_TDREND_FIX_NULLPTR_ACCESS /* FhG: avoid nullptr access in ivas_rend_TDObjRendOpen */ #define TD_REND_FIX_DIV_BY_ZERO /* FhG: avoid division by zero in sincResample fn */ #define RENAME_GWLPR /* FhG: Rename clashing symbol */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 5f90e361ce..cde8417714 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -5502,19 +5502,13 @@ static ivas_error rotateFrameSba( int16_t m1, m2; int16_t shd_rot_max_order; int16_t subframe_idx, subframe_len; -#ifdef SBA_CREND_ROT_OPT float *writePtr; -#else - float *readPtr, *writePtr; -#endif rotation_matrix Rmat; float tmpRot[2 * HEADROT_ORDER + 1]; rotation_gains gains; ivas_error error; -#ifdef SBA_CREND_ROT_OPT int16_t idx; float val, cf, oneminuscf; -#endif push_wmops( "rotateFrameSba" ); @@ -5555,11 +5549,9 @@ static ivas_error rotateFrameSba( for ( i = 0; i < subframe_len; i++ ) { -#ifdef SBA_CREND_ROT_OPT idx = subframe_idx * subframe_len + i; cf = headRotData->crossfade[i]; oneminuscf = 1 - cf; -#endif /* As the rotation matrix becomes block diagonal in a SH basis, we can*/ /* apply each angular-momentum block individually to save complexity. */ @@ -5575,16 +5567,9 @@ static ivas_error rotateFrameSba( for ( m = m1; m < m2; m++ ) { -#ifdef SBA_CREND_ROT_OPT val = inAudio.data[m * inAudio.config.numSamplesPerChannel + idx]; /* crossfade with previous rotation gains */ tmpRot[n - m1] += ( cf * gains[n][m] * val + oneminuscf * gains_prev[n][m] * val ); -#else - readPtr = getSmplPtr( inAudio, m, subframe_idx * subframe_len + i ); - /* crossfade with previous rotation gains */ - tmpRot[n - m1] += headRotData->crossfade[i] * gains[n][m] * ( *readPtr ) + - ( 1 - headRotData->crossfade[i] ) * gains_prev[n][m] * ( *readPtr ); -#endif } } /* write back the result */ -- GitLab From 1577f8d841b0df2559f00f3637e7708ed7c66f88 Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 24 Jul 2023 12:38:40 +0200 Subject: [PATCH 23/23] apply clang-format --- lib_enc/ivas_decision_matrix_enc.c | 1 - lib_enc/ivas_mc_param_enc.c | 1 - lib_rend/lib_rend.c | 91 ++++++++++-------------------- 3 files changed, 30 insertions(+), 63 deletions(-) diff --git a/lib_enc/ivas_decision_matrix_enc.c b/lib_enc/ivas_decision_matrix_enc.c index d381d34f8d..c731eeff02 100644 --- a/lib_enc/ivas_decision_matrix_enc.c +++ b/lib_enc/ivas_decision_matrix_enc.c @@ -164,7 +164,6 @@ void ivas_decision_matrix_enc( /* select TCX core or HQ core using bits_frame_nominal to match the TCX configuration bitrate */ st->core = mdct_classifier( st, fft_buff, enerBuffer, st->bits_frame_nominal * FRAMES_PER_SEC ); } - } /* do not allow TD stereo ACELP core -> DFT stereo TCX core switching as it is on the WC complexity path */ diff --git a/lib_enc/ivas_mc_param_enc.c b/lib_enc/ivas_mc_param_enc.c index 3292796656..2979a9bdb5 100644 --- a/lib_enc/ivas_mc_param_enc.c +++ b/lib_enc/ivas_mc_param_enc.c @@ -489,7 +489,6 @@ void ivas_param_mc_enc( { hParamMC->hMetadataPMC.attackIndex = 0; } - } break; #ifdef DEBUGGING diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index cde8417714..9509f11bc5 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1201,11 +1201,9 @@ static void initRendInputBase( input_base *inputBase, const IVAS_REND_AudioConfig inConfig, const IVAS_REND_InputId id, - const rendering_context rendCtx - , + const rendering_context rendCtx, float *dataBuf, - const int16_t dataBufSize -) + const int16_t dataBufSize ) { inputBase->inConfig = inConfig; inputBase->id = id; @@ -1363,10 +1361,8 @@ static ivas_error setRendInputActiveIsm( { return error; } - initRendInputBase( &inputIsm->base, inConfig, id, rendCtx - , - inputIsm->bufferData, MAX_BUFFER_LENGTH - ); + initRendInputBase( &inputIsm->base, inConfig, id, rendCtx, + inputIsm->bufferData, MAX_BUFFER_LENGTH ); inputIsm->currentPos = defaultObjectPosition(); inputIsm->previousPos = defaultObjectPosition(); @@ -1467,10 +1463,8 @@ static void clearInputIsm( rendCtx = inputIsm->base.ctx; freeInputBaseBufferData( &inputIsm->base.inputBuffer.data ); - initRendInputBase( &inputIsm->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx - , - NULL, 0 - ); + initRendInputBase( &inputIsm->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx, + NULL, 0 ); /* Free input's internal handles */ @@ -2377,10 +2371,8 @@ static ivas_error setRendInputActiveMc( { return error; } - initRendInputBase( &inputMc->base, inConfig, id, rendCtx - , - inputMc->bufferData, MAX_BUFFER_LENGTH - ); + initRendInputBase( &inputMc->base, inConfig, id, rendCtx, + inputMc->bufferData, MAX_BUFFER_LENGTH ); setZeroPanMatrix( inputMc->panGains ); inputMc->customLsInput = defaultCustomLs(); inputMc->tdRendWrapper = defaultTdRendWrapper(); @@ -2434,10 +2426,8 @@ static void clearInputMc( rendCtx = inputMc->base.ctx; freeInputBaseBufferData( &inputMc->bufferData ); - initRendInputBase( &inputMc->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx - , - NULL, 0 - ); + initRendInputBase( &inputMc->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx, + NULL, 0 ); /* Free input's internal handles */ if ( inputMc->efapInWrapper.hEfap != NULL ) @@ -2738,10 +2728,8 @@ static ivas_error setRendInputActiveSplitPostRend( { return error; } - initRendInputBase( &inputSplitPostRend->base, inConfig, id, rendCtx - , - inputSplitPostRend->bufferData, MAX_BIN_BUFFER_LENGTH - ); + initRendInputBase( &inputSplitPostRend->base, inConfig, id, rendCtx, + inputSplitPostRend->bufferData, MAX_BIN_BUFFER_LENGTH ); if ( ( error = updateSplitPostRendPanGains( inputSplitPostRend, outConfig, hRendCfg ) ) != IVAS_ERR_OK ) { @@ -2846,10 +2834,8 @@ static void clearInputSplitRend( rendCtx = inputSplitRend->base.ctx; freeInputBaseBufferData( &inputSplitRend->bufferData ); - initRendInputBase( &inputSplitRend->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx - , - NULL, 0 - ); + initRendInputBase( &inputSplitRend->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx, + NULL, 0 ); if ( inputSplitRend->splitPostRendWrapper.hBinHrSplitPostRend != NULL ) { ivas_splitBinPostRendClose( &inputSplitRend->splitPostRendWrapper.hBinHrSplitPostRend ); @@ -2875,10 +2861,8 @@ static void clearInputSba( rendCtx = inputSba->base.ctx; freeInputBaseBufferData( &inputSba->bufferData ); - initRendInputBase( &inputSba->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx - , - NULL, 0 - ); + initRendInputBase( &inputSba->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx, + NULL, 0 ); /* Free input's internal handles */ #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -3286,10 +3270,8 @@ static ivas_error setRendInputActiveMasa( { return error; } - initRendInputBase( &inputMasa->base, inConfig, id, rendCtx - , - inputMasa->bufferData, MAX_BUFFER_LENGTH - ); + initRendInputBase( &inputMasa->base, inConfig, id, rendCtx, + inputMasa->bufferData, MAX_BUFFER_LENGTH ); if ( ( error = getAudioConfigNumChannels( inConfig, &numInChannels ) ) != IVAS_ERR_OK ) { @@ -3413,10 +3395,8 @@ static void clearInputMasa( freeInputBaseBufferData( &inputMasa->bufferData ); masaPrerendClose( &inputMasa->hMasaPrerend ); - initRendInputBase( &inputMasa->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx - , - NULL, 0 - ); + initRendInputBase( &inputMasa->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx, + NULL, 0 ); freeDecoderDummy( &inputMasa->decDummy ); return; @@ -3567,10 +3547,8 @@ ivas_error IVAS_REND_Open( for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) { - initRendInputBase( &hIvasRend->inputsIsm[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) - , - NULL, 0 - ); + initRendInputBase( &hIvasRend->inputsIsm[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ), + NULL, 0 ); hIvasRend->inputsIsm[i].crendWrapper = NULL; hIvasRend->inputsIsm[i].hReverb = NULL; hIvasRend->inputsIsm[i].tdRendWrapper.hBinRendererTd = NULL; @@ -3589,10 +3567,8 @@ ivas_error IVAS_REND_Open( for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i ) { - initRendInputBase( &hIvasRend->inputsMc[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) - , - NULL, 0 - ); + initRendInputBase( &hIvasRend->inputsMc[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ), + NULL, 0 ); hIvasRend->inputsMc[i].efapInWrapper.hEfap = NULL; hIvasRend->inputsMc[i].crendWrapper = NULL; hIvasRend->inputsMc[i].hReverb = NULL; @@ -3612,10 +3588,8 @@ ivas_error IVAS_REND_Open( for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i ) { - initRendInputBase( &hIvasRend->inputsSba[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) - , - NULL, 0 - ); + initRendInputBase( &hIvasRend->inputsSba[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ), + NULL, 0 ); hIvasRend->inputsSba[i].crendWrapper = NULL; #ifdef SPLIT_REND_WITH_HEAD_ROT hIvasRend->inputsSba[i].cldfbRendWrapper.hCldfbRend = NULL; @@ -3627,10 +3601,8 @@ ivas_error IVAS_REND_Open( for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { - initRendInputBase( &hIvasRend->inputsMasa[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) - , - NULL, 0 - ); + initRendInputBase( &hIvasRend->inputsMasa[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ), + NULL, 0 ); hIvasRend->inputsMasa[i].decDummy = NULL; hIvasRend->inputsMasa[i].metadataHasBeenFed = false; hIvasRend->inputsMasa[i].bufferData = NULL; @@ -3642,16 +3614,13 @@ ivas_error IVAS_REND_Open( initRendInputBase( &hIvasRend->inputsSplitPost[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, - getRendCtx( hIvasRend ) - , - NULL, 0 - ); + getRendCtx( hIvasRend ), + NULL, 0 ); ivas_init_split_post_rend_handles( &hIvasRend->inputsSplitPost[i].splitPostRendWrapper ); #ifdef SPLIT_REND_WITH_HEAD_ROT hIvasRend->splitRendBFI = 0; #endif hIvasRend->inputsSplitPost[i].bufferData = NULL; - } #endif -- GitLab