From a1c5c0e3dae7334e6aa9ece524bf4ef14bc9ec3b Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 11 Mar 2024 09:52:04 +0100 Subject: [PATCH 1/7] [cleanup] accept FIX_998_UNUSED_FUNCTION --- lib_com/options.h | 1 - lib_dec/ivas_dirac_dec.c | 73 -------- lib_rend/ivas_dirac_output_synthesis_dec.c | 195 --------------------- lib_rend/ivas_dirac_rend.c | 8 - lib_rend/ivas_prot_rend.h | 8 - 5 files changed, 285 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 9bfbf6050c..e27251eafe 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,7 +156,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_998_UNUSED_FUNCTION /* FhG: issue 998: delete unused funtion ivas_dirac_dec_get_response_split_order */ #define FIX_1009_ISM_NONDIEGETIC_PANNING /* FhG: issue #1009: use correct object buffer for ISM1 non-diegetic pan */ #define FIX_1020_AEID_SELECTION_ERRORS /* Philips: issue #1020: fix for acoustic environment ID selection errors */ #define FIX_993_REMOVE_SBA_GET_ORDER /* VA: issue 993: remove unused function ivas_sba_get_order() */ diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index a212e2a761..c8d52aa67e 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1840,39 +1840,6 @@ void ivas_dirac_dec_render_sf( set_zero( surCohRatio, hSpatParamRendCom->num_freq_bands ); } } -#ifndef FIX_998_UNUSED_FUNCTION - - if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] && st_ivas->hCombinedOrientationData->shd_rot_max_order == 1 ) - { - ivas_dirac_dec_compute_directional_responses( hSpatParamRendCom, - hDirACRend, - st_ivas->hVBAPdata, - st_ivas->hMasa == NULL ? NULL : st_ivas->hMasa->data.band_mapping, - st_ivas->hMasaIsmData, - azimuth, - elevation, - md_idx, - surCohRatio, - st_ivas->hCombinedOrientationData->shd_rot_max_order, - p_Rmat, - hodirac_flag ); - } - else - { - ivas_dirac_dec_compute_directional_responses( hSpatParamRendCom, - hDirACRend, - st_ivas->hVBAPdata, - st_ivas->hMasa == NULL ? NULL : st_ivas->hMasa->data.band_mapping, - st_ivas->hMasaIsmData, - azimuth, - elevation, - md_idx, - surCohRatio, - 0, - NULL, - hodirac_flag ); - } -#else ivas_dirac_dec_compute_directional_responses( hSpatParamRendCom, hDirACRend, st_ivas->hVBAPdata, @@ -1883,7 +1850,6 @@ void ivas_dirac_dec_render_sf( md_idx, surCohRatio, hodirac_flag ); -#endif } if ( st_ivas->ivas_format == MASA_ISM_FORMAT && nchan_transport == 2 ) @@ -2213,44 +2179,6 @@ void ivas_dirac_dec_render_sf( } /*Compute PSDs*/ -#ifndef FIX_998_UNUSED_FUNCTION - if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] && st_ivas->hCombinedOrientationData->shd_rot_max_order > 0 ) - { - ivas_dirac_dec_output_synthesis_process_slot( reference_power, - p_onset_filter, - azimuth, - elevation, - hSpatParamRendCom->diffuseness_vector[md_idx], - hSpatParamRendCom, - hDirACRend, - st_ivas->hCombinedOrientationData->shd_rot_max_order, - p_Rmat, - st_ivas->hVBAPdata, - hDirACRend->hOutSetup, - nchan_transport, - md_idx, - hodirac_flag, - hDirAC->hConfig->dec_param_estim ); - } - else - { - ivas_dirac_dec_output_synthesis_process_slot( reference_power, - p_onset_filter, - azimuth, - elevation, - hSpatParamRendCom->diffuseness_vector[md_idx], - hSpatParamRendCom, - hDirACRend, - 0, - 0, - st_ivas->hVBAPdata, - hDirACRend->hOutSetup, - nchan_transport, - md_idx, - hodirac_flag, - hDirAC->hConfig->dec_param_estim ); - } -#else ivas_dirac_dec_output_synthesis_process_slot( reference_power, p_onset_filter, azimuth, @@ -2264,7 +2192,6 @@ void ivas_dirac_dec_render_sf( md_idx, hodirac_flag, hDirAC->hConfig->dec_param_estim ); -#endif if ( hDirAC->hConfig->dec_param_estim ) { diff --git a/lib_rend/ivas_dirac_output_synthesis_dec.c b/lib_rend/ivas_dirac_output_synthesis_dec.c index 4e9d7db6cb..0f368b967b 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec.c @@ -542,10 +542,6 @@ void ivas_dirac_dec_output_synthesis_process_slot( const float *diffuseness, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i/o: common spatial renderer data handle */ DIRAC_REND_HANDLE hDirACRend, /* i/o: DirAC renderer handle */ -#ifndef FIX_998_UNUSED_FUNCTION - const int16_t sh_rot_max_order, - const float *p_Rmat, /* i : rotation matrix */ -#endif const VBAP_HANDLE hVBAPdata, /* i : VBAP structure */ const IVAS_OUTPUT_SETUP hOutSetup, /* i : output setup structure */ const int16_t nchan_transport, /* i : number of transport channels*/ @@ -592,10 +588,6 @@ void ivas_dirac_dec_output_synthesis_process_slot( elevation, md_idx, NULL, -#ifndef FIX_998_UNUSED_FUNCTION - 2, - p_Rmat, -#endif hodirac_flag ); } @@ -642,10 +634,6 @@ void ivas_dirac_dec_output_synthesis_process_slot( elevation, md_idx, NULL, -#ifndef FIX_998_UNUSED_FUNCTION - sh_rot_max_order, - p_Rmat, -#endif hodirac_flag ); if ( hDirACRend->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) @@ -1576,169 +1564,6 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls( return; } -#ifndef FIX_998_UNUSED_FUNCTION -/*------------------------------------------------------------------------- - * ivas_dirac_dec_get_response_split_order() - * - * calculate reponse, 1 degree resolution - *------------------------------------------------------------------------*/ - -static void ivas_dirac_dec_get_response_split_order( - const int16_t azimuth, - const int16_t elevation, - float *response, - const int16_t shd_rot_max_order, - const float *p_Rmat ) -{ - int16_t index_azimuth, index_elevation; - int16_t el, e, az; - float cos_1, cos_2, sin_1, cos_az[3]; - float sin_az[3]; - float f, c; - int16_t l, m; - int16_t b, b1, b_2, b1_2, a; - float dv_0, dv_1, dv_2, dv_r_0, dv_r_1, dv_r_2; - float w; - - push_wmops( "ivas_dirac_dec_get_response_split_order" ); - - index_azimuth = ( azimuth + 180 ) % 360; - index_elevation = elevation + 90; - e = index_elevation > 90 ? -1 : 1; - el = index_elevation > 90 ? 180 - index_elevation : index_elevation; - - az = index_azimuth > 180 ? 360 - index_azimuth : index_azimuth; - f = index_azimuth > 180 ? -1.0f : 1.0f; - - cos_1 = dirac_gains_trg_term[az][0]; - sin_1 = f * dirac_gains_trg_term[az][1]; - - cos_2 = cos_1 * cos_1; - - cos_az[0] = cos_1; - cos_az[1] = 2.0f * cos_2 - 1.0f; - cos_az[2] = 2.0f * cos_1 * cos_az[1] - cos_az[0]; - sin_az[0] = sin_1; - sin_az[1] = sin_1 * 2.0f * cos_1; - sin_az[2] = sin_1 * ( 4.0f * cos_2 - 1.0f ); - - response[0] = 1.0f; - for ( l = 1; l <= shd_rot_max_order; l++ ) - { - b_2 = l * l; - b1_2 = l * l + 2 * l; - for ( m = 0; m < l; m += 2 ) - { - b = b_2 + m; - a = dirac_gains_P_idx[b]; - c = SQRT2 * dirac_gains_norm_term[a] * dirac_gains_Pnm[el][a]; - - response[b] = c * sin_az[l - m - 1]; - - b1 = b1_2 - m; - response[b1] = c * cos_az[l - m - 1]; - } - - for ( m = 1; m < l; m += 2 ) - { - b = b_2 + m; - a = dirac_gains_P_idx[b]; - c = SQRT2 * dirac_gains_norm_term[a] * dirac_gains_Pnm[el][a]; - c = c * e; - - response[b] = c * sin_az[l - m - 1]; - - b1 = b1_2 - m; - response[b1] = c * cos_az[l - m - 1]; - } - - b = b_2 + l; - a = dirac_gains_P_idx[b]; - c = dirac_gains_norm_term[a] * dirac_gains_Pnm[el][a]; - if ( l % 2 == 1 ) - { - c = c * e; - } - - response[b] = c; - } - - /*Conversion spherical to cartesian coordinates*/ - w = -dirac_gains_trg_term[el][1]; - dv_0 = w * cos_1; - dv_1 = w * sin_1; - dv_2 = e * dirac_gains_trg_term[el][0]; - - /*Rotation mtx multiplication*/ - dv_r_0 = p_Rmat[0] * dv_0 + p_Rmat[1] * dv_1 + p_Rmat[2] * dv_2; - dv_r_1 = p_Rmat[3] * dv_0 + p_Rmat[4] * dv_1 + p_Rmat[5] * dv_2; - dv_r_2 = p_Rmat[6] * dv_0 + p_Rmat[7] * dv_1 + p_Rmat[8] * dv_2; - - index_azimuth = ( (int16_t) ( atan2f( dv_r_1, dv_r_0 ) * _180_OVER_PI ) + 180 ) % 360; - index_elevation = (int16_t) ( atan2f( dv_r_2, sqrtf( dv_r_0 * dv_r_0 + dv_r_1 * dv_r_1 ) ) * _180_OVER_PI ) + 90; - e = index_elevation > 90 ? -1 : 1; - el = index_elevation > 90 ? 180 - index_elevation : index_elevation; - - az = index_azimuth > 180 ? 360 - index_azimuth : index_azimuth; - f = index_azimuth > 180 ? -1.0f : 1.0f; - - cos_1 = dirac_gains_trg_term[az][0]; - sin_1 = f * dirac_gains_trg_term[az][1]; - - cos_2 = cos_1 * cos_1; - - cos_az[0] = cos_1; - cos_az[1] = 2.0f * cos_2 - 1.0f; - cos_az[2] = 2.0f * cos_1 * cos_az[1] - cos_az[0]; - sin_az[0] = sin_1; - sin_az[1] = sin_1 * 2.0f * cos_1; - sin_az[2] = sin_1 * ( 4.0f * cos_2 - 1.0f ); - - for ( l = shd_rot_max_order + 1; l <= 3; l++ ) - { - b_2 = l * l; - b1_2 = l * l + 2 * l; - for ( m = 0; m < l; m += 2 ) - { - b = b_2 + m; - a = dirac_gains_P_idx[b]; - c = SQRT2 * dirac_gains_norm_term[a] * dirac_gains_Pnm[el][a]; - - response[b] = c * sin_az[l - m - 1]; - - b1 = b1_2 - m; - response[b1] = c * cos_az[l - m - 1]; - } - - for ( m = 1; m < l; m += 2 ) - { - b = b_2 + m; - a = dirac_gains_P_idx[b]; - c = SQRT2 * dirac_gains_norm_term[a] * dirac_gains_Pnm[el][a]; - c = c * e; - - response[b] = c * sin_az[l - m - 1]; - - b1 = b1_2 - m; - response[b1] = c * cos_az[l - m - 1]; - } - - b = b_2 + l; - a = dirac_gains_P_idx[b]; - c = dirac_gains_norm_term[a] * dirac_gains_Pnm[el][a]; - if ( l % 2 == 1 ) - { - c = c * e; - } - - response[b] = c; - } - - pop_wmops(); - - return; -} -#endif /*------------------------------------------------------------------------- * ivas_dirac_dec_compute_directional_responses() @@ -1756,10 +1581,6 @@ void ivas_dirac_dec_compute_directional_responses( const int16_t *elevation, const int16_t md_idx, const float *surCohRatio, -#ifndef FIX_998_UNUSED_FUNCTION - const int16_t shd_rot_max_order, /* i : split-order rotation method */ - const float *p_Rmat, /* i : rotation matrix */ -#endif const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ ) { @@ -1830,28 +1651,12 @@ void ivas_dirac_dec_compute_directional_responses( set_f( direct_response_hoa, 1.0f, MAX_OUTPUT_CHANNELS ); set_f( direct_response_dir2, 1.0f, MAX_OUTPUT_CHANNELS ); -#ifndef FIX_998_UNUSED_FUNCTION - if ( p_Rmat != 0 ) - { - ivas_dirac_dec_get_response_split_order( azimuth[k], elevation[k], direct_response_hoa, shd_rot_max_order, p_Rmat ); - - if ( hodirac_flag ) - { - ivas_dirac_dec_get_response_split_order( azimuth2[k], elevation2[k], direct_response_dir2, shd_rot_max_order, p_Rmat ); - } - } - else - { -#endif ivas_dirac_dec_get_response( azimuth[k], elevation[k], direct_response_hoa, hDirACRend->hOutSetup.ambisonics_order ); if ( hodirac_flag ) { ivas_dirac_dec_get_response( azimuth2[k], elevation2[k], direct_response_dir2, hDirACRend->hOutSetup.ambisonics_order ); } -#ifndef FIX_998_UNUSED_FUNCTION - } -#endif if ( masa_band_mapping == NULL && hDirACRend->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) { diff --git a/lib_rend/ivas_dirac_rend.c b/lib_rend/ivas_dirac_rend.c index 7cd26526c7..94982acb10 100644 --- a/lib_rend/ivas_dirac_rend.c +++ b/lib_rend/ivas_dirac_rend.c @@ -2216,10 +2216,6 @@ static void ivas_masa_ext_dirac_render_sf( elevation, md_idx, surCohRatio, -#ifndef FIX_998_UNUSED_FUNCTION - 0, - NULL, -#endif 0 ); @@ -2374,10 +2370,6 @@ static void ivas_masa_ext_dirac_render_sf( hSpatParamRendCom->diffuseness_vector[md_idx], hSpatParamRendCom, hDirACRend, -#ifndef FIX_998_UNUSED_FUNCTION - 0, - 0, -#endif hMasaExtRend->hVBAPdata, hDirACRend->hOutSetup, nchan_transport, diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 5f97008849..7de4ed3e8c 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -466,10 +466,6 @@ void ivas_dirac_dec_output_synthesis_process_slot( const float *diffuseness, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i/o: common spatial renderer data handle */ DIRAC_REND_HANDLE hDirACRend, /* i/o: DirAC renderer handle */ -#ifndef FIX_998_UNUSED_FUNCTION - const int16_t sh_rot_max_order, - const float *p_Rmat, /* i : rotation matrix */ -#endif const VBAP_HANDLE hVBAPdata, /* i : VBAP structure */ const IVAS_OUTPUT_SETUP hOutSetup, /* i : output setup structure */ const int16_t nchan_transport, /* i : number of transport channels */ @@ -536,10 +532,6 @@ void ivas_dirac_dec_compute_directional_responses( const int16_t *elevation, const int16_t md_idx, const float *surCohRatio, -#ifndef FIX_998_UNUSED_FUNCTION - const int16_t shd_rot_max_order, /* i : split-order rotation method */ - const float *p_Rmat, /* i : rotation matrix */ -#endif const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ ); -- GitLab From 7485104e0b8dcc8b343fe9ef76ec585ee4279154 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 11 Mar 2024 09:52:52 +0100 Subject: [PATCH 2/7] [cleanup] accept FIX_1009_ISM_NONDIEGETIC_PANNING --- lib_com/ivas_prot.h | 2 -- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 4 ---- lib_dec/ivas_mono_dmx_renderer.c | 7 ------- 4 files changed, 14 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index e80b23aa15..0902af5530 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -769,9 +769,7 @@ void dtx_read_padding_bits( ); void ivas_apply_non_diegetic_panning( -#ifdef FIX_1009_ISM_NONDIEGETIC_PANNING float *input_f, /* i : non-diegetic object */ -#endif float *output_f[], /* o : core-coder transport mono channel/stereo output */ const float non_diegetic_pan_gain, /* i : non-diegetic panning gain */ const int16_t output_frame /* i : output frame length per channel */ diff --git a/lib_com/options.h b/lib_com/options.h index e27251eafe..bdec5fac48 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,7 +156,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_1009_ISM_NONDIEGETIC_PANNING /* FhG: issue #1009: use correct object buffer for ISM1 non-diegetic pan */ #define FIX_1020_AEID_SELECTION_ERRORS /* Philips: issue #1020: fix for acoustic environment ID selection errors */ #define FIX_993_REMOVE_SBA_GET_ORDER /* VA: issue 993: remove unused function ivas_sba_get_order() */ #define FIX_1002_DEC_PHASE_ECU_USAN_OF_PHASE /* Eri: issue #1002, usan-value-out-of-range-for-int16, kept BE for PLC-conditions */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 128754273c..1783b8efed 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1097,11 +1097,7 @@ ivas_error ivas_jbm_dec_render( } else if ( st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) { -#ifdef FIX_1009_ISM_NONDIEGETIC_PANNING ivas_apply_non_diegetic_panning( p_tc[0], p_output, st_ivas->hDecoderConfig->non_diegetic_pan_gain, *nSamplesRendered ); -#else - ivas_apply_non_diegetic_panning( p_output, st_ivas->hDecoderConfig->non_diegetic_pan_gain, *nSamplesRendered ); -#endif } #ifdef DEBUGGING else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c index 7b6552707a..a2154bb774 100644 --- a/lib_dec/ivas_mono_dmx_renderer.c +++ b/lib_dec/ivas_mono_dmx_renderer.c @@ -221,9 +221,7 @@ void ivas_mono_stereo_downmix_mcmasa( *------------------------------------------------------------------------*/ void ivas_apply_non_diegetic_panning( -#ifdef FIX_1009_ISM_NONDIEGETIC_PANNING float *input_f, /* i : non-diegetic object */ -#endif float *output_f[], /* o : core-coder transport mono channel/stereo output */ const float non_diegetic_pan_gain, /* i : non-diegetic panning gain */ const int16_t output_frame /* i : output frame length per channel */ @@ -233,13 +231,8 @@ void ivas_apply_non_diegetic_panning( pan_left = ( non_diegetic_pan_gain + 1.f ) * 0.5f; pan_right = 1.f - pan_left; -#ifdef FIX_1009_ISM_NONDIEGETIC_PANNING v_multc( input_f, pan_right, output_f[1], output_frame ); v_multc( input_f, pan_left, output_f[0], output_frame ); -#else - v_multc( output_f[0], pan_right, output_f[1], output_frame ); - v_multc( output_f[0], pan_left, output_f[0], output_frame ); -#endif return; } -- GitLab From b43426f81e1a6a34ba5e6ccd609251f91362004d Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 11 Mar 2024 09:53:52 +0100 Subject: [PATCH 3/7] [cleanup] accept NONBE_FIX_864_JBM_RENDER_FRAMESIZE --- apps/decoder.c | 6 ------ lib_com/options.h | 1 - lib_dec/lib_dec.c | 44 -------------------------------------------- 3 files changed, 51 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 142c8a4ac6..d993eb4144 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -3366,14 +3366,10 @@ static ivas_error decodeVoIP( } vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len; frame++; -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE if ( vec_pos_update == 0 ) { systemTime_ms += vec_pos_len * systemTimeInc_ms; } -#else - systemTime_ms += systemTimeInc_ms; -#endif #ifdef WMOPS update_mem(); @@ -3382,7 +3378,6 @@ static ivas_error decodeVoIP( } -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE int16_t nSamplesFlushed = 0; /* decode and get samples */ @@ -3460,7 +3455,6 @@ static ivas_error decodeVoIP( } } } -#endif /*------------------------------------------------------------------------------------------* * Add zeros at the end to have equal length of synthesized signals diff --git a/lib_com/options.h b/lib_com/options.h index bdec5fac48..085ad89b76 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -167,7 +167,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_864_JBM_RENDER_FRAMESIZE /* FhG: issue #864: fix different behaviour of JBM TSM with different render frame sizes */ #define NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER /* FhG: issues #1012, 1013: JBM flush function uses wrong output buffer */ #define NONBE_FIX_1004_USAN_DTX_MASA_NO_DIRS /* Nokia: fix USAN error caused by non-setting of correctly the number of MASA directions in DTX */ #define NONBE_FIX_1014_1015_1016_OSBA_JBM_STEREO /* FhG: issues #1014, #1015, #1016: fix tc buffer info update in the discrete ism renderer */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 4e9dc2ac03..8c5d5d3ad0 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -57,9 +57,7 @@ struct IVAS_DEC_VOIP uint16_t lastDecodedWasActive; JB4_DATAUNIT_HANDLE hCurrentDataUnit; /* Points to the currently processed data unit */ uint16_t *bs_conversion_buf; /* Buffer for bitstream conversion from packed to serial */ -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE int16_t nSamplesRendered20ms; /* how many samples have been rendered since the last 20ms render border*/ -#endif #ifdef SUPPORT_JBM_TRACEFILE IVAS_JBM_TRACE_DATA JbmTraceData; #endif @@ -81,9 +79,7 @@ struct IVAS_DEC bool Opt_VOIP; /* flag indicating VOIP mode with JBM */ int16_t tsm_scale; /* scale for TSM operation */ int16_t tsm_max_scaling; -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE int16_t timeScalingDone; /* have we done already one TSM in a 20ms frame? */ -#endif float tsm_quality; float *apaExecBuffer; /* Buffer for APA scaling */ PCMDSP_APA_HANDLE hTimeScaler; @@ -131,9 +127,7 @@ static void *pcm_buffer_offset( void *buffer, const IVAS_DEC_PCM_TYPE pcmType, c static ivas_error set_pcm_buffer_to_zero( void *buffer, const IVAS_DEC_PCM_TYPE pcmType, const int16_t nZeroSamples ); #endif static int16_t get_render_frame_size_ms( IVAS_RENDER_FRAMESIZE render_framesize ); -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE static void update_voip_rendered20ms( IVAS_DEC_HANDLE hIvasDec, const int16_t nSamplesRendered ); -#endif /*---------------------------------------------------------------------* * IVAS_DEC_Open() @@ -170,9 +164,7 @@ ivas_error IVAS_DEC_Open( hIvasDec->tsm_scale = 100; hIvasDec->tsm_max_scaling = 0; hIvasDec->tsm_quality = 1.0f; -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE hIvasDec->timeScalingDone = 0; -#endif hIvasDec->needNewFrame = false; hIvasDec->nTransportChannelsOld = 0; hIvasDec->nSamplesAvailableNext = 0; @@ -718,9 +710,7 @@ ivas_error IVAS_DEC_EnableVoIP( hIvasDec->hVoIP->lastDecodedWasActive = 0; hIvasDec->hVoIP->hCurrentDataUnit = NULL; hIvasDec->hVoIP->nSamplesFrame = (uint16_t) ( hDecoderConfig->output_Fs / FRAMES_PER_SEC ); -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE hIvasDec->hVoIP->nSamplesRendered20ms = 0; -#endif #define WMC_TOOL_SKIP /* Bitstream conversion is not counted towards complexity and memory usage */ @@ -979,9 +969,7 @@ ivas_error IVAS_DEC_GetSamples( assert( nTimeScalerOutSamples <= APA_BUF ); nSamplesTcsScaled = nTimeScalerOutSamples / nTransportChannels; -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE hIvasDec->timeScalingDone = 1; -#endif } else { @@ -1416,9 +1404,7 @@ static ivas_error IVAS_DEC_GetBufferedNumberOfSamples( if ( hIvasDec->st_ivas->hTcBuffer != NULL ) { *nSamplesBuffered = hIvasDec->st_ivas->hTcBuffer->n_samples_buffered - hIvasDec->st_ivas->hTcBuffer->n_samples_rendered; -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE *nSamplesBuffered += hIvasDec->hVoIP->nSamplesRendered20ms; -#endif } return IVAS_ERR_OK; @@ -2502,9 +2488,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( uint32_t extBufferedTime_ms, scale, maxScaling; JB4_DATAUNIT_HANDLE dataUnit; uint16_t extBufferedSamples; -#ifndef NONBE_FIX_864_JBM_RENDER_FRAMESIZE - int16_t timeScalingDone; -#endif int16_t result; ivas_error error; int16_t nSamplesRendered; @@ -2513,9 +2496,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( st_ivas = hIvasDec->st_ivas; hDecoderConfig = st_ivas->hDecoderConfig; hVoIP = hIvasDec->hVoIP; -#ifndef NONBE_FIX_864_JBM_RENDER_FRAMESIZE - timeScalingDone = 0; -#endif nOutChannels = (uint8_t) st_ivas->hDecoderConfig->nchan_out; nSamplesRendered = 0; @@ -2539,11 +2519,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( } } -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE extBufferedSamples = nSamplesBuffered; -#else - extBufferedSamples = nSamplesRendered + nSamplesBuffered; -#endif extBufferedTime_ms = extBufferedSamples * 1000 / hDecoderConfig->output_Fs; dataUnit = NULL; @@ -2566,20 +2542,10 @@ ivas_error IVAS_DEC_VoIP_GetSamples( /* avoid time scaling multiple times within one 20ms frame*/ if ( scale != 100U ) { -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE if ( hIvasDec->timeScalingDone ) -#else - if ( timeScalingDone ) -#endif { scale = 100; } -#ifndef NONBE_FIX_864_JBM_RENDER_FRAMESIZE - else - { - timeScalingDone = 1; - } -#endif } /* limit scale to range supported by time scaler */ @@ -2668,9 +2634,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( nSamplesRendered += nSamplesToZero; hIvasDec->nSamplesRendered += nSamplesToZero; hIvasDec->nSamplesAvailableNext -= nSamplesToZero; -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE update_voip_rendered20ms( hIvasDec, nSamplesToZero ); -#endif } else { @@ -2689,16 +2653,13 @@ ivas_error IVAS_DEC_VoIP_GetSamples( } nSamplesRendered += nSamplesRendered_loop; -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE update_voip_rendered20ms( hIvasDec, nSamplesRendered_loop ); -#endif } } return IVAS_ERR_OK; } -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE /*---------------------------------------------------------------------* * update_voip_rendered20ms( ) * @@ -2719,7 +2680,6 @@ static void update_voip_rendered20ms( hIvasDec->hVoIP->nSamplesRendered20ms = nSamplesRenderedTotal % hIvasDec->hVoIP->nSamplesFrame; } -#endif /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_Flush( ) @@ -2748,23 +2708,19 @@ ivas_error IVAS_DEC_Flush( nSamplesToRender = (uint16_t) *nSamplesFlushed; /* render IVAS frames */ -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE error = IVAS_ERR_OK; if ( nSamplesToRender > 0 && hIvasDec->st_ivas->ivas_format != MONO_FORMAT ) { -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesFlushedLocal, &hIvasDec->nSamplesAvailableNext, pcmType, pcmBuf ); #else error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesFlushedLocal, &hIvasDec->nSamplesAvailableNext, pcmBuf ); #endif -#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE } else { *nSamplesFlushed = 0; } -#endif return error; } -- GitLab From 3866cddaa89fd37868824b8d19ead794e632e850 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 11 Mar 2024 09:55:49 +0100 Subject: [PATCH 4/7] [cleanup] accept NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 12 ------------ 2 files changed, 13 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 085ad89b76..ed007445a0 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -167,7 +167,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER /* FhG: issues #1012, 1013: JBM flush function uses wrong output buffer */ #define NONBE_FIX_1004_USAN_DTX_MASA_NO_DIRS /* Nokia: fix USAN error caused by non-setting of correctly the number of MASA directions in DTX */ #define NONBE_FIX_1014_1015_1016_OSBA_JBM_STEREO /* FhG: issues #1014, #1015, #1016: fix tc buffer info update in the discrete ism renderer */ #define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING /* FhG: issue 987: solution b: downmix HOA3 to stereo a input for the reverberator */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 1783b8efed..c7ad64a60a 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1561,12 +1561,7 @@ ivas_error ivas_jbm_dec_flush_renderer( int16_t n_slots_still_available; int16_t n_samples_to_render; DECODER_TC_BUFFER_HANDLE hTcBuffer; -#ifdef NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER float *p_output[MAX_CICP_CHANNELS + MAX_NUM_OBJECTS]; -#else - float output[MAX_CICP_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; - float *p_output[MAX_CICP_CHANNELS]; -#endif if ( !st_ivas->hDecoderConfig->Opt_tsm ) { @@ -1611,17 +1606,10 @@ ivas_error ivas_jbm_dec_flush_renderer( hTcBuffer->n_samples_flushed = n_samples_to_render; hTcBuffer->n_samples_rendered = 0; -#ifdef NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER for ( ch_idx = 0; ch_idx < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ ) { p_output[ch_idx] = st_ivas->p_output_f[ch_idx]; } -#else - for ( ch_idx = 0; ch_idx < MAX_CICP_CHANNELS; ch_idx++ ) - { - p_output[ch_idx] = output[ch_idx]; - } -#endif if ( st_ivas->ivas_format == ISM_FORMAT ) { -- GitLab From db85cca9103da6c066e08ee1a5160f1895d420b8 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 11 Mar 2024 09:56:45 +0100 Subject: [PATCH 5/7] [cleanup] accept NONBE_FIX_1004_USAN_DTX_MASA_NO_DIRS --- lib_com/options.h | 1 - lib_dec/ivas_masa_dec.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index ed007445a0..86f6379d5c 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -167,7 +167,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_1004_USAN_DTX_MASA_NO_DIRS /* Nokia: fix USAN error caused by non-setting of correctly the number of MASA directions in DTX */ #define NONBE_FIX_1014_1015_1016_OSBA_JBM_STEREO /* FhG: issues #1014, #1015, #1016: fix tc buffer info update in the discrete ism renderer */ #define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING /* FhG: issue 987: solution b: downmix HOA3 to stereo a input for the reverberator */ #define NONBE_FIX_1006_PAST_DMX_NRG_ERROR /* Eri/FhG: Issue 1006: Bug fix in ivas_stereo_dft_dec not replicated in ivas_stereo_dft_dec_dmx */ diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 3957fa0c5f..3d05c01ad4 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -142,12 +142,10 @@ ivas_error ivas_masa_decode( st->next_bit_pos = (int16_t) ( ( masa_brate / FRAMES_PER_SEC ) - 1 ); } -#ifdef NONBE_FIX_1004_USAN_DTX_MASA_NO_DIRS if ( ivas_format == MASA_FORMAT && ( masa_brate == IVAS_SID_5k2 || ivas_total_brate == FRAME_NO_DATA ) ) { hMasa->config.numberOfDirections = 1; } -#endif if ( !st->bfi && ivas_total_brate > IVAS_SID_5k2 ) { -- GitLab From c9dcef1fbd11002d77d40532629ce01cbea8a93b Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 11 Mar 2024 09:57:28 +0100 Subject: [PATCH 6/7] [cleanup] accept NONBE_FIX_1014_1015_1016_OSBA_JBM_STEREO --- lib_com/options.h | 1 - lib_dec/ivas_ism_renderer.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 86f6379d5c..e720e4b664 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -167,7 +167,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_1014_1015_1016_OSBA_JBM_STEREO /* FhG: issues #1014, #1015, #1016: fix tc buffer info update in the discrete ism renderer */ #define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING /* FhG: issue 987: solution b: downmix HOA3 to stereo a input for the reverberator */ #define NONBE_FIX_1006_PAST_DMX_NRG_ERROR /* Eri/FhG: Issue 1006: Bug fix in ivas_stereo_dft_dec not replicated in ivas_stereo_dft_dec_dmx */ #define NONBE_FIX_1010_STEREO_CNG_DIV_BY_ZERO /* Eri: Issue 1010: Division by zero in Stereo CNG */ diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 6f5a2d90eb..7b321c523b 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -280,13 +280,9 @@ void ivas_ism_render_sf( ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_in_subframe ); n_samples_rendered_loop += n_samples_in_subframe; -#ifdef NONBE_FIX_1014_1015_1016_OSBA_JBM_STEREO /* update rendered subframe and slots info for all cases apart from a following crend call, the update will then happen in the crend call*/ if ( st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV_ROOM ) -#else - if ( st_ivas->renderer_type == RENDERER_TD_PANNING ) -#endif { st_ivas->hTcBuffer->subframes_rendered += 1; st_ivas->hTcBuffer->slots_rendered += st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; -- GitLab From bef6171057909ea1cb1cd80c7eee87b940fbc823 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 11 Mar 2024 10:41:55 +0100 Subject: [PATCH 7/7] formatting --- lib_dec/ivas_mono_dmx_renderer.c | 2 +- lib_dec/lib_dec.c | 4 ++-- lib_rend/ivas_dirac_output_synthesis_dec.c | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c index a2154bb774..84024ed209 100644 --- a/lib_dec/ivas_mono_dmx_renderer.c +++ b/lib_dec/ivas_mono_dmx_renderer.c @@ -221,7 +221,7 @@ void ivas_mono_stereo_downmix_mcmasa( *------------------------------------------------------------------------*/ void ivas_apply_non_diegetic_panning( - float *input_f, /* i : non-diegetic object */ + float *input_f, /* i : non-diegetic object */ float *output_f[], /* o : core-coder transport mono channel/stereo output */ const float non_diegetic_pan_gain, /* i : non-diegetic panning gain */ const int16_t output_frame /* i : output frame length per channel */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 8c5d5d3ad0..aeb8f84303 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -57,7 +57,7 @@ struct IVAS_DEC_VOIP uint16_t lastDecodedWasActive; JB4_DATAUNIT_HANDLE hCurrentDataUnit; /* Points to the currently processed data unit */ uint16_t *bs_conversion_buf; /* Buffer for bitstream conversion from packed to serial */ - int16_t nSamplesRendered20ms; /* how many samples have been rendered since the last 20ms render border*/ + int16_t nSamplesRendered20ms; /* how many samples have been rendered since the last 20ms render border*/ #ifdef SUPPORT_JBM_TRACEFILE IVAS_JBM_TRACE_DATA JbmTraceData; #endif @@ -2714,7 +2714,7 @@ ivas_error IVAS_DEC_Flush( #ifdef SPLIT_REND_WITH_HEAD_ROT error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesFlushedLocal, &hIvasDec->nSamplesAvailableNext, pcmType, pcmBuf ); #else - error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesFlushedLocal, &hIvasDec->nSamplesAvailableNext, pcmBuf ); + error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesFlushedLocal, &hIvasDec->nSamplesAvailableNext, pcmBuf ); #endif } else diff --git a/lib_rend/ivas_dirac_output_synthesis_dec.c b/lib_rend/ivas_dirac_output_synthesis_dec.c index 0f368b967b..54ea302165 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec.c @@ -542,9 +542,9 @@ void ivas_dirac_dec_output_synthesis_process_slot( const float *diffuseness, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i/o: common spatial renderer data handle */ DIRAC_REND_HANDLE hDirACRend, /* i/o: DirAC renderer handle */ - const VBAP_HANDLE hVBAPdata, /* i : VBAP structure */ - const IVAS_OUTPUT_SETUP hOutSetup, /* i : output setup structure */ - const int16_t nchan_transport, /* i : number of transport channels*/ + const VBAP_HANDLE hVBAPdata, /* i : VBAP structure */ + const IVAS_OUTPUT_SETUP hOutSetup, /* i : output setup structure */ + const int16_t nchan_transport, /* i : number of transport channels*/ const int16_t md_idx, const int16_t hodirac_flag, /* i : flag to indicate HO-DirAC mode */ const int16_t dec_param_estim ) @@ -1651,12 +1651,12 @@ void ivas_dirac_dec_compute_directional_responses( set_f( direct_response_hoa, 1.0f, MAX_OUTPUT_CHANNELS ); set_f( direct_response_dir2, 1.0f, MAX_OUTPUT_CHANNELS ); - ivas_dirac_dec_get_response( azimuth[k], elevation[k], direct_response_hoa, hDirACRend->hOutSetup.ambisonics_order ); + ivas_dirac_dec_get_response( azimuth[k], elevation[k], direct_response_hoa, hDirACRend->hOutSetup.ambisonics_order ); - if ( hodirac_flag ) - { - ivas_dirac_dec_get_response( azimuth2[k], elevation2[k], direct_response_dir2, hDirACRend->hOutSetup.ambisonics_order ); - } + if ( hodirac_flag ) + { + ivas_dirac_dec_get_response( azimuth2[k], elevation2[k], direct_response_dir2, hDirACRend->hOutSetup.ambisonics_order ); + } if ( masa_band_mapping == NULL && hDirACRend->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) { -- GitLab