From 644c1857bb7961bba88b305d430f45625a993933 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:35:35 +0100 Subject: [PATCH 01/16] [cleanup] accept FIX_777_COMBI_RENDER_CONFIG_FILE --- lib_com/options.h | 1 - lib_util/render_config_reader.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 00b3446f52..6eb8d096c6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,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_777_COMBI_RENDER_CONFIG_FILE /* Philips: Fix for combined renderer config file support */ #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ #define FIX_699_FILE_READER_JBM_TSM /* VA: issue 699: complement FileReader_getFilePath() logic for TSM and JBM */ #define FIX_997_REMOVE_SPAR_DEC_UPMIXER /* VA: issue 997: remove obsolete function ivas_spar_dec_upmixer() */ diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 678f760a0b..a6229dc659 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -2301,11 +2301,7 @@ ivas_error RenderConfigReader_read( /* RT60 */ else if ( strcmp( item, "RT60" ) == 0 ) { -#ifdef FIX_777_COMBI_RENDER_CONFIG_FILE if ( read_txt_vector( pValue, pRenderConfigReader->pAE[acIdx].pFG->nrBands, pRenderConfigReader->pAE[acIdx].pRT60 ) ) -#else - if ( read_txt_vector( pValue, pRenderConfigReader->pFG[idx].nrBands, pRenderConfigReader->pAE[acIdx].pRT60 ) ) -#endif { errorHandler( item, ERROR_VALUE_INVALID ); return IVAS_ERR_INVALID_RENDER_CONFIG; @@ -2315,11 +2311,7 @@ ivas_error RenderConfigReader_read( /* DSR */ else if ( strcmp( item, "DSR" ) == 0 ) { -#ifdef FIX_777_COMBI_RENDER_CONFIG_FILE if ( read_txt_vector( pValue, pRenderConfigReader->pAE[acIdx].pFG->nrBands, pRenderConfigReader->pAE[acIdx].pDSR ) ) -#else - if ( read_txt_vector( pValue, pRenderConfigReader->pFG[idx].nrBands, pRenderConfigReader->pAE[acIdx].pDSR ) ) -#endif { errorHandler( item, ERROR_VALUE_INVALID ); return IVAS_ERR_INVALID_RENDER_CONFIG; -- GitLab From 7dfe775561973d6e2566a0894feb97e25fec5137 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:40:28 +0100 Subject: [PATCH 02/16] [cleanup] accept FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI --- lib_com/ari_hm.c | 4 ---- lib_com/options.h | 1 - 2 files changed, 5 deletions(-) diff --git a/lib_com/ari_hm.c b/lib_com/ari_hm.c index 0e9a18085c..7fe4d282d1 100644 --- a/lib_com/ari_hm.c +++ b/lib_com/ari_hm.c @@ -280,11 +280,7 @@ void tcx_hm_modify_envelope( const int16_t L_frame /* i : number of spectral lines */ ) { -#ifdef FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI int32_t h, x, k; -#else - int16_t k, h, x; -#endif Word16 inv_shape[2 * kTcxHmParabolaHalfWidth + 1]; /* Q15 */ if ( gain == 0 ) diff --git a/lib_com/options.h b/lib_com/options.h index 6eb8d096c6..0b344c9d78 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,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_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ #define FIX_699_FILE_READER_JBM_TSM /* VA: issue 699: complement FileReader_getFilePath() logic for TSM and JBM */ #define FIX_997_REMOVE_SPAR_DEC_UPMIXER /* VA: issue 997: remove obsolete function ivas_spar_dec_upmixer() */ #define FIX_944_REMOVE_LS_RENDERER_CALL_IN_STEREO /* VA: issue 994: remove an obsolete call of function ivas_ls_setup_conversion() in stereo */ -- GitLab From b6b0e802846184f0b4cc32591f13fd14a077bb79 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:41:46 +0100 Subject: [PATCH 03/16] [cleanup] accept FIX_699_FILE_READER_JBM_TSM --- apps/decoder.c | 4 ---- apps/encoder.c | 4 ---- lib_com/options.h | 1 - 3 files changed, 9 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index aca1635eae..ac560234ce 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -2301,11 +2301,7 @@ static ivas_error decodeG192( { if ( ( error = TsmScaleFileReader_readScale( tsmScaleFileReader, &scale ) ) != IVAS_ERR_OK ) { -#ifdef FIX_699_FILE_READER_JBM_TSM fprintf( stderr, "\nError (%s) when reading TSM data from %s \n\n", arg.inputBitstreamFilename, TsmScaleFileReader_getFilePath( tsmScaleFileReader ) ); -#else - fprintf( stderr, "\nError: input bitstream file couldn't be read: %s \n\n", arg.inputBitstreamFilename ); -#endif goto cleanup; } int16_t maxScaling; diff --git a/apps/encoder.c b/apps/encoder.c index 835c4d18f9..b00f4f75fd 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -686,11 +686,7 @@ int main( { if ( ( error = JbmFileReader_readCAconfig( jbmReader, &caConfig ) ) != IVAS_ERR_OK ) { -#ifdef FIX_699_FILE_READER_JBM_TSM fprintf( stderr, "\nError (%s) while reading Channel-Aware Config. from: %s\n\n", IVAS_ENC_GetErrorMessage( error ), JbmFileReader_getFilePath( jbmReader ) ); -#else - fprintf( stderr, "JbmFileReader_readCAconfig() failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) ); -#endif goto cleanup; } diff --git a/lib_com/options.h b/lib_com/options.h index 0b344c9d78..a29183f7e5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,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_699_FILE_READER_JBM_TSM /* VA: issue 699: complement FileReader_getFilePath() logic for TSM and JBM */ #define FIX_997_REMOVE_SPAR_DEC_UPMIXER /* VA: issue 997: remove obsolete function ivas_spar_dec_upmixer() */ #define FIX_944_REMOVE_LS_RENDERER_CALL_IN_STEREO /* VA: issue 994: remove an obsolete call of function ivas_ls_setup_conversion() in stereo */ #define FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig */ -- GitLab From 55e32cf99cf47905c5e045e10c269db19aa4d5da Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:43:20 +0100 Subject: [PATCH 04/16] [cleanup] accept FIX_997_REMOVE_SPAR_DEC_UPMIXER --- lib_com/ivas_prot.h | 8 --- lib_com/options.h | 1 - lib_dec/ivas_spar_decoder.c | 134 ------------------------------------ 3 files changed, 143 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index e091ce7305..840a459c79 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4368,14 +4368,6 @@ void ivas_spar_dec_upmixer_sf( const int16_t nchan_internal /* i : number of internal channels */ ); -#ifndef FIX_997_REMOVE_SPAR_DEC_UPMIXER -void ivas_spar_dec_upmixer( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - float *output[], /* i/o: input/output audio channels */ - const int16_t nchan_internal, /* i : number of internal channels */ - const int16_t output_frame /* i : output frame length */ -); -#endif /* MD module */ ivas_error ivas_spar_md_enc_open( ivas_spar_md_enc_state_t **hMdEnc, /* i/o: SPAR MD encoder handle */ diff --git a/lib_com/options.h b/lib_com/options.h index a29183f7e5..5d054f07b2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,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_997_REMOVE_SPAR_DEC_UPMIXER /* VA: issue 997: remove obsolete function ivas_spar_dec_upmixer() */ #define FIX_944_REMOVE_LS_RENDERER_CALL_IN_STEREO /* VA: issue 994: remove an obsolete call of function ivas_ls_setup_conversion() in stereo */ #define FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig */ #define FIX_1001_ARI_HM_OVERFLOW /* FhG: fix for undef behaviour in in the harmonic TCX model arithmetic coder */ diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 776f606c4d..2e0f4ae0eb 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -1250,19 +1250,11 @@ void ivas_spar_dec_set_render_map( return; } -#ifdef FIX_997_REMOVE_SPAR_DEC_UPMIXER /*-------------------------------------------------------------------* * ivas_spar_dec_set_render_params() * * IVAS SPAR set rendering parameters *-------------------------------------------------------------------*/ -#else -/*-------------------------------------------------------------------* - * ivas_spar_dec_upmixer() - * - * IVAS SPAR upmixer - *-------------------------------------------------------------------*/ -#endif void ivas_spar_dec_set_render_params( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ @@ -1369,132 +1361,6 @@ void ivas_spar_dec_digest_tc( return; } -#ifndef FIX_997_REMOVE_SPAR_DEC_UPMIXER -/*-------------------------------------------------------------------* - * ivas_spar_dec_upmixer() - * - * - *-------------------------------------------------------------------*/ - -void ivas_spar_dec_upmixer( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - float *output[], /* i/o: input/output audio channels */ - const int16_t nchan_internal, /* i : number of internal channels */ - const int16_t output_frame /* i : output frame length */ -) -{ - SPAR_DEC_HANDLE hSpar; - SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; - int16_t nchan_transport, nchan_out; - int16_t subframe_idx, n, i; - int16_t n_samples_sf; - float *output_f_local[MAX_OUTPUT_CHANNELS]; - float Pcm_tmp[MAX_OUTPUT_CHANNELS][L_FRAME48k]; - float *pPcm_tmp[MAX_OUTPUT_CHANNELS]; - int16_t nchan_internal_total; - int16_t sba_ch_offset; - - hSpar = st_ivas->hSpar; - nchan_transport = hSpar->hMdDec->spar_md_cfg.nchan_transport; - nchan_out = st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; - n_samples_sf = JBM_CLDFB_SLOTS_IN_SUBFRAME * NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); - - nchan_internal_total = nchan_internal; - sba_ch_offset = 0; - if ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) - { - nchan_internal_total += st_ivas->nchan_ism; - sba_ch_offset = st_ivas->nchan_ism; - } - - for ( n = 0; n < MAX_OUTPUT_CHANNELS; n++ ) - { - output_f_local[n] = output[n + sba_ch_offset]; - } - - for ( n = 0; n < nchan_internal_total; n++ ) - { - st_ivas->hTcBuffer->tc[n] = output[n]; - } - - /*---------------------------------------------------------------------* - * TD decorrelation - *---------------------------------------------------------------------*/ - - for ( i = 0; i < nchan_internal; i++ ) - { - pPcm_tmp[i] = Pcm_tmp[i]; - } - - if ( hSpar->hMdDec->td_decorr_flag ) - { - if ( hSpar->hTdDecorr ) - { - ivas_td_decorr_process( hSpar->hTdDecorr, output_f_local, pPcm_tmp, output_frame ); - - if ( hSpar->hTdDecorr->num_apd_outputs >= ( nchan_internal - nchan_transport ) ) - { - for ( i = 0; i < nchan_internal - nchan_transport; i++ ) - { - mvr2r( pPcm_tmp[hSpar->hTdDecorr->num_apd_outputs - 1 - i], st_ivas->hTcBuffer->tc[nchan_internal_total - 1 - i], output_frame ); - } - } - else - { - for ( i = 0; i < nchan_internal - nchan_transport; i++ ) - { - set_zero( st_ivas->hTcBuffer->tc[nchan_internal_total - 1 - i], output_frame ); - } - - for ( i = 0; i < hSpar->hTdDecorr->num_apd_outputs; i++ ) - { - mvr2r( pPcm_tmp[hSpar->hTdDecorr->num_apd_outputs - 1 - i], st_ivas->hTcBuffer->tc[nchan_internal_total - 1 - i], output_frame ); - } - } - } - } - - ivas_spar_dec_set_render_params( st_ivas, DEFAULT_JBM_CLDFB_TIMESLOTS ); - - if ( st_ivas->hDirAC != 0 ) - { - ivas_dirac_dec_set_md_map( st_ivas, DEFAULT_JBM_CLDFB_TIMESLOTS ); - } - - for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) - { - ivas_spar_dec_upmixer_sf( st_ivas, output_f_local, nchan_internal ); - - for ( n = 0; n < nchan_out; n++ ) - { - output_f_local[n] += n_samples_sf; - } - - /* update combined orientation access index */ - ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); - } - - for ( n = 0; n < nchan_internal_total; n++ ) - { - st_ivas->hTcBuffer->tc[n] = NULL; - } - - if ( st_ivas->hDirAC != NULL && st_ivas->hSpatParamRendCom != NULL ) - { - hSpatParamRendCom = st_ivas->hSpatParamRendCom; - if ( st_ivas->hDirAC->hConfig->dec_param_estim == 1 ) - { - hSpatParamRendCom->dirac_read_idx = ( hSpatParamRendCom->dirac_read_idx + DEFAULT_JBM_CLDFB_TIMESLOTS ) % hSpatParamRendCom->dirac_md_buffer_length; - } - else - { - hSpatParamRendCom->dirac_read_idx = ( hSpatParamRendCom->dirac_read_idx + DEFAULT_JBM_SUBFRAMES_5MS ) % hSpatParamRendCom->dirac_md_buffer_length; - } - } - - return; -} -#endif /*-------------------------------------------------------------------* * ivas_spar_dec_upmixer_sf() -- GitLab From acc9810984a3378aeb7b755a302f303a3572237e Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:44:49 +0100 Subject: [PATCH 05/16] [cleanup] accept FIX_944_REMOVE_LS_RENDERER_CALL_IN_STEREO --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 7 ------- 2 files changed, 8 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 5d054f07b2..e0a29920c5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,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_944_REMOVE_LS_RENDERER_CALL_IN_STEREO /* VA: issue 994: remove an obsolete call of function ivas_ls_setup_conversion() in stereo */ #define FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig */ #define FIX_1001_ARI_HM_OVERFLOW /* FhG: fix for undef behaviour in in the harmonic TCX model arithmetic coder */ #define FIX_901_PARAMMC_DEAD_CODE /* FhG: issue 901: remove dead ParamMC code */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index d631bfeec2..31018089c1 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -143,13 +143,6 @@ ivas_error ivas_jbm_dec_tc( { hp20( p_output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs ); } -#ifndef FIX_944_REMOVE_LS_RENDERER_CALL_IN_STEREO - - if ( st_ivas->renderer_type == RENDERER_MC && st_ivas->hDecoderConfig->nchan_out == 1 ) - { - ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, output_frame, p_output, p_output ); - } -#endif } else if ( st_ivas->ivas_format == ISM_FORMAT ) { -- GitLab From 1b8737802723ad2b93ddf44837fb797952ed0bfe Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:46:47 +0100 Subject: [PATCH 06/16] [cleanup] accept FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN --- lib_com/options.h | 1 - lib_dec/ivas_ism_dec.c | 7 ------- 2 files changed, 8 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index e0a29920c5..192c87c7a2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,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_1003_PARAMISM_BINAURAL_RECONFIG_USAN /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig */ #define FIX_1001_ARI_HM_OVERFLOW /* FhG: fix for undef behaviour in in the harmonic TCX model arithmetic coder */ #define FIX_901_PARAMMC_DEAD_CODE /* FhG: issue 901: remove dead ParamMC code */ #define FIX_1008_EXTORIENT_TARGET_INTERPOLATION /* FhG: issue #1008, external orientation init was wrong for 5ms */ diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 1d0f523222..4c0c0601cc 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -355,13 +355,6 @@ static ivas_error ivas_ism_bitrate_switching_dec( tc_nchan_allocate_new = tc_nchan_tc_new; tc_nchan_full_new = tc_nchan_tc_new; -#ifndef FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) - { - tc_nchan_allocate_new = 2 * BINAURAL_CHANNELS; - tc_nchan_full_new = tc_nchan_allocate_new; - } -#endif if ( st_ivas->ism_mode == ISM_MODE_PARAM && ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) { -- GitLab From d50098d3c1cb654348a23a95c06bdeb361c20af2 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:48:30 +0100 Subject: [PATCH 07/16] [cleanup] accept FIX_1001_ARI_HM_OVERFLOW --- lib_com/ari_hm.c | 8 -------- lib_com/options.h | 1 - lib_com/prot.h | 8 -------- lib_dec/ari_hm_dec.c | 8 -------- lib_enc/ari_hm_enc.c | 16 ---------------- 5 files changed, 41 deletions(-) diff --git a/lib_com/ari_hm.c b/lib_com/ari_hm.c index 7fe4d282d1..b0d65b4404 100644 --- a/lib_com/ari_hm.c +++ b/lib_com/ari_hm.c @@ -205,11 +205,7 @@ int16_t CountIndexBits( *-------------------------------------------------------------------*/ int16_t tcx_hm_render( -#ifdef FIX_1001_ARI_HM_OVERFLOW const int32_t lag, /* i : pitch lag */ -#else - const int16_t lag, /* i : pitch lag */ -#endif const int16_t fract_res, /* i : fractional resolution of the lag */ Word16 p[] /* o : harmonic model (Q13) */ ) @@ -269,11 +265,7 @@ int16_t tcx_hm_render( void tcx_hm_modify_envelope( const Word16 gain, /* i : HM gain (Q11) */ -#ifdef FIX_1001_ARI_HM_OVERFLOW const int32_t lag, -#else - const int16_t lag, -#endif const int16_t fract_res, const Word16 p[], /* i : harmonic model (Q13) */ Word32 env[], /* i/o: envelope (Q16) */ diff --git a/lib_com/options.h b/lib_com/options.h index 192c87c7a2..72393d1d2d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,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_1001_ARI_HM_OVERFLOW /* FhG: fix for undef behaviour in in the harmonic TCX model arithmetic coder */ #define FIX_901_PARAMMC_DEAD_CODE /* FhG: issue 901: remove dead ParamMC code */ #define FIX_1008_EXTORIENT_TARGET_INTERPOLATION /* FhG: issue #1008, external orientation init was wrong for 5ms */ #define FIX_1009_ISM_NONDIEGETIC_PANNING /* FhG: issue #1009: use correct object buffer for ISM1 non-diegetic pan */ diff --git a/lib_com/prot.h b/lib_com/prot.h index 10477f3587..9a88ea6d19 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -7830,22 +7830,14 @@ int16_t DecodeIndex( #define GET_ADJ2( T, L, F ) ( ( ( L ) << ( F ) ) - ( T ) ) int16_t tcx_hm_render( -#ifdef FIX_1001_ARI_HM_OVERFLOW const int32_t lag, /* i : pitch lag */ -#else - const int16_t lag, /* i : pitch lag */ -#endif const int16_t fract_res, /* i : fractional resolution of the lag */ Word16 p[] /* o : harmonic model (Q13) */ ); void tcx_hm_modify_envelope( const Word16 gain, /* i : HM gain (Q11) */ -#ifdef FIX_1001_ARI_HM_OVERFLOW const int32_t lag, -#else - const int16_t lag, -#endif const int16_t fract_res, const Word16 p[], /* i : harmonic model (Q13) */ Word32 env[], /* i/o: envelope (Q16) */ diff --git a/lib_dec/ari_hm_dec.c b/lib_dec/ari_hm_dec.c index 2a0e8bde04..d061a7d633 100644 --- a/lib_dec/ari_hm_dec.c +++ b/lib_dec/ari_hm_dec.c @@ -120,11 +120,7 @@ void tcx_hm_decode( int16_t *hm_bits /* o : bit consumption */ ) { -#ifdef FIX_1001_ARI_HM_OVERFLOW int32_t lag; -#else - int16_t lag; -#endif int32_t tmpL; int16_t NumTargetBits, fract_res; Word16 p[2 * kTcxHmParabolaHalfWidth + 1], gain; @@ -148,11 +144,7 @@ void tcx_hm_decode( /* Convert the index to lag */ UnmapIndex( prm_hm[1], L_frame >= 256, LtpPitchLag, ( NumTargetBits <= kSmallerLagsTargetBitsThreshold ) || ( L_frame < 256 ), &fract_res, &tmpL ); -#ifdef FIX_1001_ARI_HM_OVERFLOW lag = tmpL; -#else - lag = (int16_t) tmpL; -#endif /* Render the harmonic model */ if ( tcx_hm_render( lag, fract_res, p ) ) diff --git a/lib_enc/ari_hm_enc.c b/lib_enc/ari_hm_enc.c index 0a18a007ab..0b255f19b6 100644 --- a/lib_enc/ari_hm_enc.c +++ b/lib_enc/ari_hm_enc.c @@ -418,11 +418,7 @@ static void PeakFilter( static float tcx_hm_get_re( const float x[], /* i : absolute spectrum */ const Word16 gain, /* i : HM gain (Q11) */ -#ifdef FIX_1001_ARI_HM_OVERFLOW const int32_t lag, -#else - const int16_t lag, -#endif const int16_t fract_res, const Word16 p[], /* i : harmonic model (Q13) */ const Word32 env[], /* i : envelope (Q16) */ @@ -471,11 +467,7 @@ static float tcx_hm_get_re( static void tcx_hm_quantize_gain( const float x[], /* i : absolute spectrum */ const Word32 env[], /* i : envelope (Q16) */ -#ifdef FIX_1001_ARI_HM_OVERFLOW const int32_t lag, -#else - const int16_t lag, -#endif const int16_t fract_res, Word16 p[], /* i : harmonic model (Q13) */ const int16_t L_frame, /* i : number of spectral lines */ @@ -565,11 +557,7 @@ void tcx_hm_analyse( int16_t *hm_bits /* o : bit consumption */ ) { -#ifdef FIX_1001_ARI_HM_OVERFLOW int32_t lag; -#else - int16_t lag; -#endif int32_t tmpL; int16_t fract_res; float fspec[N_MAX_ARI], RelativeScore; @@ -595,11 +583,7 @@ void tcx_hm_analyse( /* Convert the index to lag */ UnmapIndex( prm_hm[1], L_frame >= 256, LtpPitchLag, ( targetBits - *hm_bits <= kSmallerLagsTargetBitsThreshold ) || ( L_frame < 256 ), &fract_res, &tmpL ); -#ifdef FIX_1001_ARI_HM_OVERFLOW lag = tmpL; -#else - lag = (int16_t) tmpL; -#endif /* Render harmonic model */ tcx_hm_render( lag, fract_res, p ); -- GitLab From 5c7128e0bf202819fd893bc52c501fc717fbf780 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:49:55 +0100 Subject: [PATCH 08/16] [cleanup] accept FIX_901_PARAMMC_DEAD_CODE --- lib_com/ivas_cnst.h | 8 - lib_com/ivas_mc_param_com.c | 135 --------------- lib_com/ivas_prot.h | 22 --- lib_com/ivas_rom_com.c | 61 ------- lib_com/ivas_stat_com.h | 7 - lib_com/options.h | 1 - lib_dec/ivas_mc_param_dec.c | 114 ------------ lib_enc/ivas_mc_param_enc.c | 334 ------------------------------------ 8 files changed, 682 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index db4e1a7c5b..e4946e9725 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1390,17 +1390,9 @@ typedef enum #define PARAM_MC_ICC_ERROR_BIAS_FAC (1.15f) /* factor for favouring past ICC maps in the adaptive ICC map decision */ #define PARAM_MC_TRANSIENT_BAND_STEP 2 /* Number of parameter bands combined in case of a transient frame*/ #define PARAM_MC_MAX_DECORR_CLDFB_BANDS 20 /* Maximum number of CLDFB bands with decorrelation */ -#ifdef FIX_901_PARAMMC_DEAD_CODE #define PARAM_MC_MAX_TRANSPORT_CHANS 3 /* Number of down mix channels */ -#else -#define PARAM_MC_MAX_TRANSPORT_CHANS 4 /* Number of down mix channels */ -#endif #define PARAM_MC_MAX_ILD_REF_CHANNELS 2 /* Maximum number of reference channels for a coded ILD */ -#ifdef FIX_901_PARAMMC_DEAD_CODE #define PARAM_MC_NUM_CONFIGS 14 /* Number of available Parametric MC configurations */ -#else -#define PARAM_MC_NUM_CONFIGS 15 /* Number of available Parametric MC configurations */ -#endif #define PARAM_MC_MAX_BAND_LFE 1 /* Number of parameter bands for LFE coding */ #define PARAM_MC_SZ_ICC_MAP 11 /* Maximum number of transmitted ICCs per parameter band */ #define PARAM_MC_SZ_ILD_MAP 12 /* Maximum number of transmitted channel energies per band*/ diff --git a/lib_com/ivas_mc_param_com.c b/lib_com/ivas_mc_param_com.c index 5a11a90d86..b080263506 100644 --- a/lib_com/ivas_mc_param_com.c +++ b/lib_com/ivas_mc_param_com.c @@ -87,22 +87,11 @@ uint16_t ivas_param_mc_get_configuration_index( void ivas_param_mc_metadata_open( const MC_LS_SETUP mc_ls_setup, /* i : MC ls setup */ -#ifndef FIX_901_PARAMMC_DEAD_CODE - const int16_t lfe_index, /* i : channel index of LFE */ -#endif const int32_t ivas_total_brate, /* i : IVAS total bitrate */ HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* o : handle for the Parametric MC parameter coding state */ ) { -#ifndef FIX_901_PARAMMC_DEAD_CODE - int16_t i; -#endif uint16_t config_index; -#ifndef FIX_901_PARAMMC_DEAD_CODE - int16_t nchan_setup; - - nchan_setup = ivas_mc_ls_setup_get_num_channels( mc_ls_setup ); -#endif /* get coding band mappings */ set_s( hMetadataPMC->coding_band_mapping, 0, PARAM_MC_MAX_PARAMETER_BANDS ); @@ -135,26 +124,12 @@ void ivas_param_mc_metadata_open( assert( 0 && "nbands must be 20 or 14!" ); } -#ifndef FIX_901_PARAMMC_DEAD_CODE - /* create map of all possible ICCs */ - ivas_param_mc_create_full_icc_mapping( nchan_setup, lfe_index, hMetadataPMC->icc_map_full, &hMetadataPMC->icc_map_size_full ); -#endif hMetadataPMC->icc_mapping_conf = ivas_param_mc_conf[config_index].icc_mapping_conf; hMetadataPMC->ild_mapping_conf = ivas_param_mc_conf[config_index].ild_mapping_conf; hMetadataPMC->ild_factors = ivas_param_mc_conf[config_index].ild_factors; -#ifndef FIX_901_PARAMMC_DEAD_CODE - /* set default ICC maps */ - for ( i = 0; i < PARAM_MC_PARAMETER_FRAMES; i++ ) - { - ivas_param_mc_default_icc_map( hMetadataPMC->icc_mapping_conf, hMetadataPMC->icc_mapping[i] ); - } -#endif /* init remaining flags and indices */ hMetadataPMC->param_frame_idx = 0; -#ifndef FIX_901_PARAMMC_DEAD_CODE - hMetadataPMC->flag_use_adaptive_icc_map = 0; -#endif hMetadataPMC->bAttackPresent = 0; hMetadataPMC->attackIndex = 0; hMetadataPMC->lfe_on = 1; @@ -209,32 +184,6 @@ void ivas_param_mc_set_coded_bands( return; } -#ifndef FIX_901_PARAMMC_DEAD_CODE -/*------------------------------------------------------------------------- - * ivas_param_mc_metadata_close() - * - * Parametric MC parameter coding state close function - *------------------------------------------------------------------------*/ - -void ivas_param_mc_metadata_close( - HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* i/o: handle for the Parametric MC parameter coding state */ -) -{ - uint16_t i; - - /* adaptive ICC mapping */ - for ( i = 0; i < 2; i++ ) - { - if ( hMetadataPMC->icc_map_full[i] ) - { - free( hMetadataPMC->icc_map_full[i] ); - hMetadataPMC->icc_map_full[i] = NULL; - } - } - - return; -} -#endif /*------------------------------------------------------------------------- * ivas_param_mc_getNumTransportChannels() @@ -258,85 +207,6 @@ int16_t ivas_param_mc_getNumTransportChannels( return nchan_transport; } -#ifndef FIX_901_PARAMMC_DEAD_CODE -/*------------------------------------------------------------------------- - * ivas_param_mc_create_full_icc_mapping() - * - * create the map of all possible ICCs for a certain internal setup - * indicated by the number of channels and LFE index - *------------------------------------------------------------------------*/ - -void ivas_param_mc_create_full_icc_mapping( - const int16_t n_channels, /* i : number of channels with LFE for the internal setup */ - const int16_t lfe_index, /* i : channel index of the LFE */ - int16_t *icc_map[2], /* o : map of all possible ICCs */ - int16_t *icc_map_size_full /* o : number of all possible ICCs */ -) -{ - int16_t i, k, l; - - l = 0; - - /* number of all possible ICCs is the number of non-diagonal upper elements of a - * ICC matrix for all channels not including the LFE plus one static ICC for the - * combination (LFE/center) */ - *icc_map_size_full = ( n_channels - 2 ) * ( n_channels - 1 ) / 2 + 1; - - /* allocate memory for the map */ - for ( i = 0; i < 2; i++ ) - { - icc_map[i] = (int16_t *) malloc( *icc_map_size_full * sizeof( int16_t ) ); - } - - /* create map (non-LFE ICCs) */ - for ( i = 0; i < n_channels; i++ ) - { - if ( i != lfe_index ) - { - for ( k = i + 1; k < n_channels; k++ ) - { - if ( k != lfe_index ) - { - icc_map[0][l] = i; - icc_map[1][l] = k; - l++; - } - } - } - } - - /* last one is the fixed mapping center -> LFE */ - assert( l == *icc_map_size_full - 1 ); - - icc_map[0][l] = 2; - icc_map[1][l] = lfe_index; - - return; -} - -/*------------------------------------------------------------------------- - * ivas_param_mc_default_icc_map() - * - * get the default ICC map for a certain internal setup - * indicated by the number of channels from the table ROM - *------------------------------------------------------------------------*/ - -void ivas_param_mc_default_icc_map( - const PARAM_MC_ICC_MAPPING *hIccMapping, /* i : ICC mapping table */ - int16_t icc_map[PARAM_MC_SZ_ICC_MAP][2] /* o : copy of map from ROM table */ -) -{ - int16_t i; - - for ( i = 0; i < hIccMapping->icc_map_size_lfe; i++ ) - { - icc_map[i][0] = hIccMapping->icc_mapping[i][0]; - icc_map[i][1] = hIccMapping->icc_mapping[i][1]; - } - - return; -} -#endif /*------------------------------------------------------------------------- @@ -419,11 +289,6 @@ static int16_t ivas_param_mc_get_num_param_bands( case IVAS_128k: num_parameter_bands = 14; break; -#ifndef FIX_901_PARAMMC_DEAD_CODE - case IVAS_160k: - num_parameter_bands = 20; - break; -#endif } break; default: diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 840a459c79..f0fe6d3cb4 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3808,9 +3808,6 @@ void ivas_mc_paramupmix_dec_render( void ivas_param_mc_metadata_open( const MC_LS_SETUP mc_ls_setup, /* i : MC ls setup */ -#ifndef FIX_901_PARAMMC_DEAD_CODE - const int16_t lfe_index, /* i : channel index of LFE */ -#endif const int32_t ivas_total_brate, /* i : IVAS total bitrate */ HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* o : handle for the Parametric MC parameter coding state */ ); @@ -3819,18 +3816,6 @@ void ivas_param_mc_set_coded_bands( HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* i/o: handle for the Parametric MC parameter coding state */ ); -#ifndef FIX_901_PARAMMC_DEAD_CODE -void ivas_param_mc_metadata_close( - HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* i/o: handle for the Parametric MC parameter coding state */ -); - -void ivas_param_mc_create_full_icc_mapping( - const int16_t n_channels, /* i : number of channels with LFE for the internal setup */ - const int16_t lfe_index, /* i : channel index of the LFE */ - int16_t *icc_map[2], /* o : map of all possible ICCs */ - int16_t *icc_map_size_full /* o : number of all possible ICCs */ -); -#endif /*! r: number of IVAS transport channels */ int16_t ivas_param_mc_getNumTransportChannels( const int32_t ivas_total_bitrate, /* i : IVAS total bitrate */ @@ -3895,13 +3880,6 @@ void ivas_param_mc_dec( float *output_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ ); -#ifndef FIX_901_PARAMMC_DEAD_CODE -void ivas_param_mc_default_icc_map( - const PARAM_MC_ICC_MAPPING * hIccMapping, /* i : handle to ICC mapping configuration */ - int16_t icc_map[PARAM_MC_SZ_ICC_MAP][2] /* o : copy of map from the configuration */ -); - -#endif /*! r: number of cldfb synthesis instances */ int16_t param_mc_get_num_cldfb_syntheses( Decoder_Struct *st_ivas /* i : IVAS decoder structure */ diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 8ab2c86821..68169f10d4 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -1973,24 +1973,6 @@ const float ivas_param_mc_ild_fac_CICP19_3tc[12] = 0.5f }; -#ifndef FIX_901_PARAMMC_DEAD_CODE -const float ivas_param_mc_ild_fac_CICP19_4tc[12] = -{ - 0.35f, - 0.35f, - 0.17f, - 0.22f, - 0.2f, - 0.2f, - 0.2f, - 0.5f, - 0.5f, - 0.5f, - 0.5f, - 0.2f, -}; - -#endif const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP6_2tc = { 5, @@ -2054,17 +2036,6 @@ const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP19_3tc = {{0},{1},{0},{1},{0},{1},{0},{1},{0},{1},{2},{2}} }; -#ifndef FIX_901_PARAMMC_DEAD_CODE -const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP19_4tc = -{ - 11, - 12, - {0,1,2,4,5,6,7,8,9,10,11,3}, - {1,1,2,1,1,1,1,1,1,1,1,2}, - {{0},{1},{0,1},{0},{1},{0},{1},{2},{3},{2},{3},{0,1}} -}; - -#endif const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP6_2tc = { 4, @@ -2165,24 +2136,6 @@ const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP19_3tc = } }; -#ifndef FIX_901_PARAMMC_DEAD_CODE -const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP19_4tc = -{ - 8, - 9, - { { 0, 4 }, /* L/LS */ - { 1, 5 }, /* R/RS */ - { 0, 2 }, /* L/C */ - { 1, 2 }, /* R/C */ - { 0, 6 }, /* L/LBS */ - { 1, 7 }, /* R/RBS */ - { 8, 10 }, /*UFL/UBL */ - { 9, 11 }, /*UFR/UBR */ - { 2, 3 } /* C/LFE */ - } -}; - -#endif const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] = { /* CICP6 48000 */ @@ -2339,20 +2292,6 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] = &ivas_param_mc_dmx_fac_CICP19_3tc[0], &ivas_param_mc_ild_fac_CICP19_3tc[0] } -#ifndef FIX_901_PARAMMC_DEAD_CODE - , - /* CICP19 160000 */ - { - MC_LS_SETUP_7_1_4, - 12, - 4, - IVAS_160k, - &ivas_param_mc_ild_mapping_CICP19_4tc, - &ivas_param_mc_icc_mapping_CICP19_4tc, - &ivas_param_mc_dmx_fac_CICP19_4tc[0], - &ivas_param_mc_ild_fac_CICP19_4tc[0] - } -#endif }; const float ivas_param_mc_quant_ild_5d1_48[PARAM_MC_SZ_ILD_QUANTIZER_4BITS] = diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index 1f55909a23..6feb8efd99 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -595,15 +595,8 @@ typedef struct ivas_parametric_mc_metadata_struct { const PARAM_MC_ILD_MAPPING *ild_mapping_conf; const PARAM_MC_ICC_MAPPING *icc_mapping_conf; -#ifndef FIX_901_PARAMMC_DEAD_CODE - int16_t icc_mapping[PARAM_MC_PARAMETER_FRAMES][PARAM_MC_SZ_ICC_MAP][2]; - int16_t *icc_map_full[2]; -#endif int16_t icc_map_size_full; int16_t param_frame_idx; -#ifndef FIX_901_PARAMMC_DEAD_CODE - int16_t flag_use_adaptive_icc_map; -#endif const float *ild_factors; int16_t coding_band_mapping[PARAM_MC_MAX_PARAMETER_BANDS]; int16_t nbands_in_param_frame[PARAM_MC_PARAMETER_FRAMES]; diff --git a/lib_com/options.h b/lib_com/options.h index 72393d1d2d..1942bd5405 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,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_901_PARAMMC_DEAD_CODE /* FhG: issue 901: remove dead ParamMC code */ #define FIX_1008_EXTORIENT_TARGET_INTERPOLATION /* FhG: issue #1008, external orientation init was wrong for 5ms */ #define FIX_1009_ISM_NONDIEGETIC_PANNING /* FhG: issue #1009: use correct object buffer for ISM1 non-diegetic pan */ diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 45ed71c978..70f01eb927 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -114,9 +114,6 @@ ivas_error ivas_param_mc_dec_open( { int16_t k, nchan_transport; PARAM_MC_DEC_HANDLE hParamMC; -#ifndef FIX_901_PARAMMC_DEAD_CODE - IVAS_OUTPUT_SETUP hTransportSetup; -#endif int16_t nchan_out_transport; int16_t nchan_out_cov; float proto_matrix[MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; @@ -148,9 +145,6 @@ ivas_error ivas_param_mc_dec_open( output_Fs = st_ivas->hDecoderConfig->output_Fs; output_config = st_ivas->hDecoderConfig->output_config; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; -#ifndef FIX_901_PARAMMC_DEAD_CODE - hTransportSetup = st_ivas->hTransSetup; -#endif mc_ls_setup = ivas_mc_map_output_config_to_mc_ls_setup( st_ivas->transport_config ); nchan_out_transport = st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe; hParamMC->hoa_encoder = NULL; @@ -231,11 +225,7 @@ ivas_error ivas_param_mc_dec_open( hParamMC->num_freq_bands = (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); hParamMC->max_band_energy_compensation = hParamMC->num_freq_bands; -#ifndef FIX_901_PARAMMC_DEAD_CODE - ivas_param_mc_metadata_open( mc_ls_setup, hTransportSetup.index_lfe[0], ivas_total_brate, hParamMC->hMetadataPMC ); -#else ivas_param_mc_metadata_open( mc_ls_setup, ivas_total_brate, hParamMC->hMetadataPMC ); -#endif /* init arrays for quantized parameters */ if ( ( hParamMC->icc_q = (float *) malloc( hParamMC->hMetadataPMC->num_parameter_bands * hParamMC->hMetadataPMC->icc_mapping_conf->icc_map_size_lfe * sizeof( float ) ) ) == NULL ) @@ -558,9 +548,6 @@ ivas_error ivas_param_mc_dec_reconfig( { int16_t k, nchan_transport; PARAM_MC_DEC_HANDLE hParamMC; -#ifndef FIX_901_PARAMMC_DEAD_CODE - IVAS_OUTPUT_SETUP hTransportSetup; -#endif int16_t nchan_out_transport; int16_t nchan_out_cov; float proto_matrix[MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; @@ -589,9 +576,6 @@ ivas_error ivas_param_mc_dec_reconfig( output_Fs = st_ivas->hDecoderConfig->output_Fs; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; -#ifndef FIX_901_PARAMMC_DEAD_CODE - hTransportSetup = st_ivas->hTransSetup; -#endif mc_ls_setup = ivas_mc_map_output_config_to_mc_ls_setup( st_ivas->transport_config ); nchan_out_transport = st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe; @@ -635,29 +619,9 @@ ivas_error ivas_param_mc_dec_reconfig( hParamMC->num_freq_bands = (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); hParamMC->max_band_energy_compensation = hParamMC->num_freq_bands; -#ifndef FIX_901_PARAMMC_DEAD_CODE - /* deallocate the full icc map, gets newly allocated in the metadata open function */ - - for ( k = 0; k < 2; k++ ) - { -#ifdef DEBUGGING - assert( hParamMC->hMetadataPMC->icc_map_full[k] != NULL ); -#endif - if ( hParamMC->hMetadataPMC->icc_map_full[k] != NULL ) - { - free( hParamMC->hMetadataPMC->icc_map_full[k] ); - hParamMC->hMetadataPMC->icc_map_full[k] = NULL; - } - } - -#endif mvs2s( hParamMC->band_grouping, band_grouping_old, hParamMC->hMetadataPMC->num_parameter_bands + 1 ); -#ifndef FIX_901_PARAMMC_DEAD_CODE - ivas_param_mc_metadata_open( mc_ls_setup, hTransportSetup.index_lfe[0], ivas_total_brate, hParamMC->hMetadataPMC ); -#else ivas_param_mc_metadata_open( mc_ls_setup, ivas_total_brate, hParamMC->hMetadataPMC ); -#endif /* Band Grouping */ if ( hParamMC->hMetadataPMC->num_parameter_bands == 20 ) @@ -1114,9 +1078,6 @@ void ivas_param_mc_dec_close( /* parameter decoding */ if ( hParamMC->hMetadataPMC != NULL ) { -#ifndef FIX_901_PARAMMC_DEAD_CODE - ivas_param_mc_metadata_close( hParamMC->hMetadataPMC ); -#endif free( hParamMC->hMetadataPMC ); hParamMC->hMetadataPMC = NULL; } @@ -1233,9 +1194,6 @@ void ivas_param_mc_dec_read_BS( int16_t num_param_bands; int16_t metadata_bit_pos; int16_t i, j, k; -#ifndef FIX_901_PARAMMC_DEAD_CODE - int16_t l; -#endif int16_t icc_map_size; int16_t icc_map_size_wo_lfe; int16_t ild_map_size; @@ -1324,67 +1282,6 @@ void ivas_param_mc_dec_read_BS( num_lfe_bands = 0; } -#ifndef FIX_901_PARAMMC_DEAD_CODE - if ( hMetadataPMC->flag_use_adaptive_icc_map == 1 ) - { - int16_t icc_mapping_index[PARAM_MC_SZ_ICC_MAP]; - - k = 0; - for ( i = 0; i < hMetadataPMC->icc_map_size_full - 1; i++ ) - { - if ( bit_buffer[bit_pos++] == 1 ) - { - icc_mapping_index[k++] = i; - } - } - - /* last one is always C/LFE */ - icc_mapping_index[k] = hMetadataPMC->icc_map_size_full - 1; - - /* save icc mapping of the previous frame*/ - /* build icc map for the current frame */ - for ( k = 0; k < icc_map_size; k++ ) - { - hMetadataPMC->icc_mapping[param_frame_idx][k][0] = hMetadataPMC->icc_map_full[0][icc_mapping_index[k]]; - hMetadataPMC->icc_mapping[param_frame_idx][k][1] = hMetadataPMC->icc_map_full[1][icc_mapping_index[k]]; - } - - if ( hMetadataPMC->bAttackPresent ) - { - for ( k = 0; k < icc_map_size; k++ ) - { - for ( l = 0; l < PARAM_MC_PARAMETER_FRAMES; l++ ) - { - hMetadataPMC->icc_mapping[l][k][0] = hMetadataPMC->icc_map_full[0][icc_mapping_index[k]]; - hMetadataPMC->icc_mapping[l][k][1] = hMetadataPMC->icc_map_full[1][icc_mapping_index[k]]; - } - } - } - else - { - for ( k = 0; k < icc_map_size; k++ ) - { - hMetadataPMC->icc_mapping[hMetadataPMC->param_frame_idx][k][0] = hMetadataPMC->icc_map_full[0][icc_mapping_index[k]]; - hMetadataPMC->icc_mapping[hMetadataPMC->param_frame_idx][k][1] = hMetadataPMC->icc_map_full[1][icc_mapping_index[k]]; - } - } - } - else - { - if ( hMetadataPMC->bAttackPresent ) - { - for ( l = 0; l < PARAM_MC_PARAMETER_FRAMES; l++ ) - { - ivas_param_mc_default_icc_map( hMetadataPMC->icc_mapping_conf, hMetadataPMC->icc_mapping[param_frame_idx] ); - } - } - else - { - ivas_param_mc_default_icc_map( hMetadataPMC->icc_mapping_conf, hMetadataPMC->icc_mapping[hMetadataPMC->param_frame_idx] ); - } - } - -#endif ivas_param_mc_bs_decode_parameter_values( bit_buffer, &bit_pos, bits_to_copy, &st->BER_detect, hMetadataPMC, &hMetadataPMC->icc_coding, icc_map_size_wo_lfe, icc_map_size, num_lfe_bands, band_step, num_param_bands, hParamMC->icc_q ); if ( !st->BER_detect ) @@ -2731,15 +2628,9 @@ static void ivas_param_mc_dequantize_cov( int16_t l; float *Cyp; float ap; -#ifndef FIX_901_PARAMMC_DEAD_CODE - int16_t param_frame_idx; -#endif const PARAM_MC_ILD_MAPPING *h_ild_mapping; float Cy_state_int[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; -#ifndef FIX_901_PARAMMC_DEAD_CODE - param_frame_idx = hParamMC->hMetadataPMC->param_frame_idx; -#endif set_zero( Nrqq, MAX_OUTPUT_CHANNELS ); h_ild_mapping = hParamMC->hMetadataPMC->ild_mapping_conf; @@ -2780,13 +2671,8 @@ static void ivas_param_mc_dequantize_cov( /* replace some estimated ICCs with transmitted values */ for ( k = 0; k < hParamMC->hMetadataPMC->icc_mapping_conf->icc_map_size_lfe; k++ ) { -#ifndef FIX_901_PARAMMC_DEAD_CODE - Cy_state_int[hParamMC->hMetadataPMC->icc_mapping[param_frame_idx][k][0] + nY_int * hParamMC->hMetadataPMC->icc_mapping[param_frame_idx][k][1]] = icc_q[k]; - Cy_state_int[hParamMC->hMetadataPMC->icc_mapping[param_frame_idx][k][1] + nY_int * hParamMC->hMetadataPMC->icc_mapping[param_frame_idx][k][0]] = icc_q[k]; -#else Cy_state_int[hParamMC->hMetadataPMC->icc_mapping_conf->icc_mapping[k][0] + nY_int * hParamMC->hMetadataPMC->icc_mapping_conf->icc_mapping[k][1]] = icc_q[k]; Cy_state_int[hParamMC->hMetadataPMC->icc_mapping_conf->icc_mapping[k][1] + nY_int * hParamMC->hMetadataPMC->icc_mapping_conf->icc_mapping[k][0]] = icc_q[k]; -#endif } if ( param_band_index >= PARAM_MC_MAX_BAND_LFE || !hParamMC->hMetadataPMC->lfe_on ) diff --git a/lib_enc/ivas_mc_param_enc.c b/lib_enc/ivas_mc_param_enc.c index b32bb1ce5d..4269103937 100644 --- a/lib_enc/ivas_mc_param_enc.c +++ b/lib_enc/ivas_mc_param_enc.c @@ -62,10 +62,6 @@ static void ivas_param_mc_parameter_quantizer( const float *x, const int16_t L, static void ivas_param_mc_transient_detection( PARAM_MC_ENC_HANDLE hParamMC, TRAN_DET_HANDLE hTranDet, int16_t *bAttackPresent, int16_t *attackIdx ); -#ifndef FIX_901_PARAMMC_DEAD_CODE -static void ivas_param_mc_enc_find_icc_map( PARAM_MC_ENC_HANDLE hParamMC, float Cx_sum[][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], float Cy_sum[][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], float ILD_q[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_SZ_ILD_MAP], const int16_t nchan_input, const int16_t nchan_transport ); - -#endif static void ivas_param_mc_quantize_iccs( PARAM_MC_ENC_HANDLE hParamMC, float Cy[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], const int16_t freq_idx, const int16_t nchan_input, int16_t *ICC_idx_out ); static void ivas_param_mc_quantize_ilds( PARAM_MC_ENC_HANDLE hParamMC, float Cy[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], float Cx[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], const int16_t freq_idx, const int16_t nchan_input, const int16_t nchan_transport, int16_t *ILD_idx_out, float ILD_q[PARAM_MC_SZ_ILD_MAP] ); @@ -89,9 +85,6 @@ ivas_error ivas_param_mc_enc_open( ) { int16_t i; -#ifndef FIX_901_PARAMMC_DEAD_CODE - int16_t k, l; -#endif IVAS_FB_CFG *fb_cfg; PARAM_MC_ENC_HANDLE hParamMC; uint16_t config_index; @@ -157,29 +150,7 @@ ivas_error ivas_param_mc_enc_open( } /* open/init parameter coding */ -#ifndef FIX_901_PARAMMC_DEAD_CODE - ivas_param_mc_metadata_open( mc_input_setup, hParamMC->lfe_index, ivas_total_brate, &hParamMC->hMetadataPMC ); -#else ivas_param_mc_metadata_open( mc_input_setup, ivas_total_brate, &hParamMC->hMetadataPMC ); -#endif -#ifndef FIX_901_PARAMMC_DEAD_CODE - /* init icc index states */ - for ( i = 0; i < PARAM_MC_PARAMETER_FRAMES; i++ ) - { - set_s( hParamMC->icc_map_index[i], -1, PARAM_MC_SZ_ICC_MAP ); - - for ( l = 0; l < hParamMC->hMetadataPMC.icc_mapping_conf->icc_map_size_lfe; l++ ) - { - for ( k = 0; k < hParamMC->hMetadataPMC.icc_map_size_full; k++ ) - { - if ( hParamMC->hMetadataPMC.icc_mapping[i][l][0] == hParamMC->hMetadataPMC.icc_map_full[0][k] && hParamMC->hMetadataPMC.icc_mapping[i][l][1] == hParamMC->hMetadataPMC.icc_map_full[1][k] ) - { - hParamMC->icc_map_index[i][l] = k; - } - } - } - } -#endif /* Band Grouping */ if ( hParamMC->hMetadataPMC.num_parameter_bands == 20 ) @@ -246,9 +217,6 @@ ivas_error ivas_param_mc_enc_reconfig( ) { int16_t i; -#ifndef FIX_901_PARAMMC_DEAD_CODE - int16_t k, l; -#endif PARAM_MC_ENC_HANDLE hParamMC; uint16_t config_index; MC_LS_SETUP mc_input_setup; @@ -293,47 +261,9 @@ ivas_error ivas_param_mc_enc_reconfig( /* get dmx factors */ hParamMC->dmx_factors = ivas_param_mc_conf[config_index].dmx_fac; -#ifndef FIX_901_PARAMMC_DEAD_CODE - /* deallocate the full icc map, gets newly allocated in the metadata open function */ - for ( i = 0; i < 2; i++ ) - { -#ifdef DEBUGGING - assert( hParamMC->hMetadataPMC.icc_map_full[i] != NULL ); -#endif - if ( hParamMC->hMetadataPMC.icc_map_full[i] != NULL ) - { - free( hParamMC->hMetadataPMC.icc_map_full[i] ); - hParamMC->hMetadataPMC.icc_map_full[i] = NULL; - } - } - -#endif /* open/init parameter coding */ -#ifndef FIX_901_PARAMMC_DEAD_CODE - ivas_param_mc_metadata_open( mc_input_setup, hParamMC->lfe_index, ivas_total_brate, &hParamMC->hMetadataPMC ); -#else ivas_param_mc_metadata_open( mc_input_setup, ivas_total_brate, &hParamMC->hMetadataPMC ); -#endif - -#ifndef FIX_901_PARAMMC_DEAD_CODE - /* init icc index states */ - for ( i = 0; i < PARAM_MC_PARAMETER_FRAMES; i++ ) - { - set_s( hParamMC->icc_map_index[i], -1, PARAM_MC_SZ_ICC_MAP ); - - for ( l = 0; l < hParamMC->hMetadataPMC.icc_mapping_conf->icc_map_size_lfe; l++ ) - { - for ( k = 0; k < hParamMC->hMetadataPMC.icc_map_size_full; k++ ) - { - if ( hParamMC->hMetadataPMC.icc_mapping[i][l][0] == hParamMC->hMetadataPMC.icc_map_full[0][k] && hParamMC->hMetadataPMC.icc_mapping[i][l][1] == hParamMC->hMetadataPMC.icc_map_full[1][k] ) - { - hParamMC->icc_map_index[i][l] = k; - } - } - } - } -#endif /* Band Grouping */ if ( hParamMC->hMetadataPMC.num_parameter_bands == 20 ) { @@ -396,9 +326,6 @@ void ivas_param_mc_enc_close( return; } -#ifndef FIX_901_PARAMMC_DEAD_CODE - ivas_param_mc_metadata_close( &( *hParamMC )->hMetadataPMC ); -#endif ivas_FB_mixer_close( &( *hParamMC )->hFbMixer, sampling_rate, 0 ); free( ( *hParamMC ) ); @@ -532,18 +459,6 @@ void ivas_param_mc_enc( ivas_param_mc_quantize_ilds( hParamMC, Cy_sum[k], Cx_sum[k], k, nchan_inp, st_ivas->nchan_transport, ILD_idx, ILD_q[k] ); } -#ifndef FIX_901_PARAMMC_DEAD_CODE - /* get icc map */ - if ( hParamMC->hMetadataPMC.flag_use_adaptive_icc_map == 1 ) - { - ivas_param_mc_enc_find_icc_map( hParamMC, Cx_sum, Cy_sum, ILD_q, nchan_inp, st_ivas->nchan_transport ); - } - else - { - ivas_param_mc_default_icc_map( hParamMC->hMetadataPMC.icc_mapping_conf, hParamMC->hMetadataPMC.icc_mapping[hParamMC->hMetadataPMC.param_frame_idx] ); - } - -#endif /* ICC parameter quantization */ for ( k = 0; k < hParamMC->hMetadataPMC.nbands_coded; k += band_step ) { @@ -1010,230 +925,6 @@ static void ivas_param_mc_param_est_enc( return; } -#ifndef FIX_901_PARAMMC_DEAD_CODE -/*------------------------------------------------------------------------- - * ivas_param_mc_enc_find_icc_map() - * - * decide which ICCs out of all possible ICCs should be sent - *------------------------------------------------------------------------*/ - -static void ivas_param_mc_enc_find_icc_map( - PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ - float Cx_sum[][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], /* i : Covariance matrix for the downmixed frame */ - float Cy_sum[][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix for the original frame */ - float ILD_q[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_SZ_ILD_MAP], /* i : quantized ILDs */ - const int16_t nchan_input, /* i : number of input channels */ - const int16_t nchan_transport /* i : number of transport channels */ -) -{ - float Cproto_band[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; - float Cx_band[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; - float mat_mult_buffer1[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; - float mapped_error[55]; /* max number of possible mappings for 7.1+4 */ - int16_t icc_map_index[PARAM_MC_SZ_ICC_MAP]; - int16_t map_idx; - float *sorted_error_desc[PARAM_MC_SZ_ICC_MAP]; - int16_t cur_param_band, k, m, i; - int16_t bandstep; - int16_t last_element, el; - int16_t num_parameter_bands; - int16_t ch_idx1, ch_idx2; - int16_t icc_map_size; - int16_t icc_map_size_wo_lfe; - float Nrqq[MAX_OUTPUT_CHANNELS]; - float a[MAX_OUTPUT_CHANNELS]; - float Cy_band[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; - - /* Initialisations */ - num_parameter_bands = hParamMC->hMetadataPMC.nbands_coded; - bandstep = hParamMC->hMetadataPMC.bAttackPresent ? 2 : 1; - set_f( mapped_error, 0.0f, 55 ); - set_s( icc_map_index, -1, PARAM_MC_SZ_ICC_MAP ); - icc_map_size_wo_lfe = hParamMC->hMetadataPMC.icc_mapping_conf->icc_map_size_wo_lfe; - icc_map_size = hParamMC->hMetadataPMC.icc_mapping_conf->icc_map_size_lfe; - - set_zero( Cy_band, nchan_input * nchan_input ); - - /* Estimate the target covariance like in the decoder using the - * already available qunantised ICLDs */ - for ( cur_param_band = 0; cur_param_band < num_parameter_bands; cur_param_band += bandstep ) - { - if ( hParamMC->hMetadataPMC.bAttackPresent || hParamMC->hMetadataPMC.coding_band_mapping[cur_param_band] == hParamMC->hMetadataPMC.param_frame_idx ) - { - /* transfer Cx_sum band to columnwise matrix */ - for ( ch_idx1 = 0; ch_idx1 < nchan_transport; ++ch_idx1 ) - { - for ( ch_idx2 = 0; ch_idx2 < nchan_transport; ++ch_idx2 ) - { - Cx_band[ch_idx1 + nchan_transport * ch_idx2] = Cx_sum[cur_param_band][ch_idx1][ch_idx2]; - } - } - - /* get estimated Cy from Cx and proto matrix */ - matrix_product( hParamMC->dmx_factors, nchan_input, nchan_transport, 0, - Cx_band, nchan_transport, nchan_transport, 0, - mat_mult_buffer1 ); - - matrix_product( mat_mult_buffer1, nchan_input, nchan_transport, 0, - hParamMC->dmx_factors, nchan_input, nchan_transport, 1, - Cproto_band ); - - set_zero( Nrqq, MAX_OUTPUT_CHANNELS ); - - /*get back Nrg*/ - for ( k = 0; k < nchan_input; k++ ) - { - float ref_ener = 0.0f; - int16_t ref_channel_cnt; - int16_t ref_channel_idx; - - for ( ref_channel_cnt = 0; ref_channel_cnt < hParamMC->hMetadataPMC.ild_mapping_conf->num_ref_channels[k]; ref_channel_cnt++ ) - { - ref_channel_idx = hParamMC->hMetadataPMC.ild_mapping_conf->ref_channel_idx[k][ref_channel_cnt]; - ref_ener += Cx_band[ref_channel_idx + ref_channel_idx * nchan_transport]; - } - Nrqq[hParamMC->hMetadataPMC.ild_mapping_conf->ild_index[k]] = powf( 10, ILD_q[cur_param_band][k] / 10.0f ) * hParamMC->hMetadataPMC.ild_factors[k] * ref_ener; - } - - /* apply quantized ICLDs in the estimated covariance */ - for ( k = 0; k < nchan_input; k++ ) - { - a[k] = sqrtf( Nrqq[k] ) / ( sqrtf( Cproto_band[k + nchan_input * k] ) + EPSILON ); - v_multc( Cproto_band + k * nchan_input, a[k], Cproto_band + k * nchan_input, nchan_input ); - } - - for ( k = 0; k < nchan_input; k++ ) - { - int16_t l; - float *Cyp = Cproto_band + k; - float ap = a[k]; - - for ( l = 0; l < nchan_input; l++ ) - { - ( *Cyp ) *= ap; - Cyp += nchan_input; - } - } - - /* transfer Cy_sum band to columnwise matrix */ - for ( ch_idx1 = 0; ch_idx1 < nchan_input; ++ch_idx1 ) - { - for ( ch_idx2 = 0; ch_idx2 < nchan_input; ++ch_idx2 ) - { - Cy_band[ch_idx1 + nchan_transport * ch_idx2] = Cy_sum[cur_param_band][ch_idx1][ch_idx2]; - } - } - - /* apply quantized ICLDs on the input covariance */ - for ( k = 0; k < nchan_input; k++ ) - { - a[k] = sqrtf( Nrqq[k] ) / ( sqrtf( Cy_band[k + nchan_input * k] ) + EPSILON ); - v_multc( Cy_band + k * nchan_input, a[k], Cy_band + k * nchan_input, nchan_input ); - } - - for ( k = 0; k < nchan_input; k++ ) - { - int16_t l; - float *Cyp = Cy_band + k; - float ap = a[k]; - - for ( l = 0; l < nchan_input; l++ ) - { - ( *Cyp ) *= ap; - Cyp += nchan_input; - } - } - - /* for all possible mappings, get the cumulated error between estimated and real Cy */ - for ( map_idx = 0; map_idx < hParamMC->hMetadataPMC.icc_map_size_full - 1; map_idx++ ) - { - int16_t idx0 = hParamMC->hMetadataPMC.icc_map_full[0][map_idx]; - int16_t idx1 = hParamMC->hMetadataPMC.icc_map_full[1][map_idx]; - mapped_error[map_idx] += fabsf( Cproto_band[idx0 + idx1 * nchan_input] - Cy_band[idx0 + idx1 * nchan_input] ); - } - } - } - - /* put a small bias on the error for the past transmitted indices*/ - if ( !hParamMC->hMetadataPMC.bAttackPresent ) - { - for ( i = 0; i < icc_map_size_wo_lfe; i++ ) - { - mapped_error[hParamMC->icc_map_index[hParamMC->hMetadataPMC.param_frame_idx][i]] *= PARAM_MC_ICC_ERROR_BIAS_FAC; - } - } - - /* get the mappings with the biggest expected errors as those who will be transmitted */ - for ( i = 0; i < hParamMC->hMetadataPMC.icc_map_size_full - 1; i++ ) - { - for ( k = 0; k < icc_map_size_wo_lfe; k++ ) - { - if ( icc_map_index[k] == -1 ) - { - /* not filled yet, take the value */ - icc_map_index[k] = i; - sorted_error_desc[k] = &mapped_error[i]; - break; - } - else if ( mapped_error[i] > *sorted_error_desc[k] ) - { - /* push all others down and insert value here */ - for ( m = icc_map_size_wo_lfe - 1; m >= k + 1; m-- ) - { - icc_map_index[m] = icc_map_index[m - 1]; - sorted_error_desc[m] = sorted_error_desc[m - 1]; - } - icc_map_index[k] = i; - sorted_error_desc[k] = &mapped_error[i]; - break; - } - } - } - - /* the indices in ascending order, simple bubble sort */ - for ( last_element = icc_map_size_wo_lfe - 1; last_element >= 0; last_element-- ) - { - for ( el = 0; el < last_element; el++ ) - { - if ( icc_map_index[el] > icc_map_index[el + 1] ) - { - int16_t swp_el = icc_map_index[el]; - icc_map_index[el] = icc_map_index[el + 1]; - icc_map_index[el + 1] = swp_el; - } - } - } - - /* last icc map element is always the C/LFE icc */ - icc_map_index[icc_map_size - 1] = hParamMC->hMetadataPMC.icc_map_size_full - 1; - - /* create map and map index, map index is sorted in ascending order*/ - if ( hParamMC->hMetadataPMC.bAttackPresent ) - { - for ( k = 0; k < PARAM_MC_PARAMETER_FRAMES; k++ ) - { - for ( i = 0; i < icc_map_size; i++ ) - { - hParamMC->hMetadataPMC.icc_mapping[k][i][0] = hParamMC->hMetadataPMC.icc_map_full[0][icc_map_index[i]]; - hParamMC->hMetadataPMC.icc_mapping[k][i][1] = hParamMC->hMetadataPMC.icc_map_full[1][icc_map_index[i]]; - } - mvs2s( icc_map_index, hParamMC->icc_map_index[k], icc_map_size ); - } - } - else - { - for ( i = 0; i < icc_map_size; i++ ) - { - hParamMC->hMetadataPMC.icc_mapping[hParamMC->hMetadataPMC.param_frame_idx][i][0] = hParamMC->hMetadataPMC.icc_map_full[0][icc_map_index[i]]; - hParamMC->hMetadataPMC.icc_mapping[hParamMC->hMetadataPMC.param_frame_idx][i][1] = hParamMC->hMetadataPMC.icc_map_full[1][icc_map_index[i]]; - } - - mvs2s( icc_map_index, hParamMC->icc_map_index[hParamMC->hMetadataPMC.param_frame_idx], icc_map_size ); - } - - return; -} -#endif /*------------------------------------------------------------------------- * ivas_param_mc_quantize_ilds() @@ -1471,13 +1162,8 @@ static void ivas_param_mc_quantize_iccs( /* Reduce set of parameters and quantize them */ for ( k = 0; k < num_iccs_to_code; ++k ) { -#ifndef FIX_901_PARAMMC_DEAD_CODE - tmp_map[0] = hParamMC->hMetadataPMC.icc_mapping[hParamMC->hMetadataPMC.param_frame_idx][k][0]; - tmp_map[1] = hParamMC->hMetadataPMC.icc_mapping[hParamMC->hMetadataPMC.param_frame_idx][k][1]; -#else tmp_map[0] = hParamMC->hMetadataPMC.icc_mapping_conf->icc_mapping[k][0]; tmp_map[1] = hParamMC->hMetadataPMC.icc_mapping_conf->icc_mapping[k][1]; -#endif ICC_vect[k] = Cy[tmp_map[0]][tmp_map[1]]; } @@ -1655,26 +1341,6 @@ static void ivas_param_mc_write_bs( nbands = hParamMC->hMetadataPMC.nbands_coded / band_step + ( ( hParamMC->hMetadataPMC.nbands_coded % band_step ) ? 1 : 0 ); } -#ifndef FIX_901_PARAMMC_DEAD_CODE - /* Encoding of the ICC mapping done as simple bitmap */ - if ( hParamMC->hMetadataPMC.flag_use_adaptive_icc_map == 1 ) - { - uint16_t *bit_buffer_icc_mapping = &bit_buffer[*bit_pos]; - - for ( i = 0; i < hParamMC->hMetadataPMC.icc_map_size_full - 1; i++ ) - { - bit_buffer_icc_mapping[i] = 0; - } - - for ( i = 0; i < icc_map_size_wo_lfe; i++ ) - { - bit_buffer_icc_mapping[hParamMC->icc_map_index[hParamMC->hMetadataPMC.param_frame_idx][i]] = 1; - } - - *bit_pos += hParamMC->hMetadataPMC.icc_map_size_full - 1; - } - -#endif ivas_param_mc_encode_parameter( ICC_idx, &hParamMC->hMetadataPMC, &hParamMC->hMetadataPMC.icc_coding, nbands, band_step, icc_map_size_wo_lfe, icc_map_size, bit_buffer, bit_pos ); -- GitLab From 589ef91e302eaf44cc60c0a0fd337fc2268423e5 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:50:49 +0100 Subject: [PATCH 09/16] [cleanup] accept FIX_1008_EXTORIENT_TARGET_INTERPOLATION --- lib_com/options.h | 1 - lib_rend/ivas_rotation.c | 11 ----------- 2 files changed, 12 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 1942bd5405..6873d94adc 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,7 +155,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_1008_EXTORIENT_TARGET_INTERPOLATION /* FhG: issue #1008, external orientation init was wrong for 5ms */ #define FIX_1009_ISM_NONDIEGETIC_PANNING /* FhG: issue #1009: use correct object buffer for ISM1 non-diegetic pan */ diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index b9f05c9f2d..48c52995cb 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -898,18 +898,7 @@ ivas_error ivas_combined_orientation_open( ( *hCombinedOrientationData )->num_subframes = num_subframes; ( *hCombinedOrientationData )->interpolationCoefficient = 1.0f; ( *hCombinedOrientationData )->interpolationIncrement = 1.0f; -#ifndef FIX_1008_EXTORIENT_TARGET_INTERPOLATION - if ( num_subframes == 1 ) - { - ( *hCombinedOrientationData )->maximumFramesToTargetOrientation = 2000; - } - else - { -#endif ( *hCombinedOrientationData )->maximumFramesToTargetOrientation = 500; -#ifndef FIX_1008_EXTORIENT_TARGET_INTERPOLATION - } -#endif ( *hCombinedOrientationData )->lrSwitchedNext = 0; ( *hCombinedOrientationData )->lrSwitchedCurrent = 0; ( *hCombinedOrientationData )->lrSwitchInterpVal = 0.0f; -- GitLab From 21f0026a3b0988b3a262a7fe03358bd5842d9fcc Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:56:04 +0100 Subject: [PATCH 10/16] [cleanup] accept NONBE_FIX_978_MC_TDREND_REVERB --- lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 4 ---- lib_dec/ivas_ism_dec.c | 4 ---- lib_dec/ivas_objectRenderer_internal.c | 8 -------- 4 files changed, 17 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6873d94adc..d3b35a40e1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_978_MC_TDREND_REVERB /* Eri : activate reverb for TDREND with headtracking */ #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */ #define NONBE_FIX_1000_G1_G2_SWB_TBE /* VA: issue 1000: avoid div by zero due to g1 + g2 being zero in SWB TBE */ #define NONBE_FIX_999_JBM_MCT_FLUSH /* FhG: issue #999: fix wrong flushing for MCT at a JBM rate switch */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 1e6ac794eb..f91b897ea7 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2010,11 +2010,7 @@ ivas_error ivas_init_decoder( { return error; } -#ifdef NONBE_FIX_978_MC_TDREND_REVERB if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#else - if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#endif // DEBUG { if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) { diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 4c0c0601cc..1a43d3ef07 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -199,11 +199,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( { return error; } -#ifdef NONBE_FIX_978_MC_TDREND_REVERB if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#else - if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#endif { if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) { diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 8a3189bc99..907affdae1 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -187,11 +187,7 @@ ivas_error ivas_td_binaural_renderer_sf( { return error; } -#ifdef NONBE_FIX_978_MC_TDREND_REVERB if ( st_ivas->hRenderConfig != NULL && st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#else - if ( st_ivas->hRenderConfig != NULL && st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#endif { if ( ( error = ivas_reverb_process( st_ivas->hReverb, st_ivas->transport_config, 0, tc_local, p_reverb_signal, 0 ) ) != IVAS_ERR_OK ) { @@ -206,11 +202,7 @@ ivas_error ivas_td_binaural_renderer_sf( { return error; } -#ifdef NONBE_FIX_978_MC_TDREND_REVERB if ( st_ivas->hRenderConfig != NULL && st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#else - if ( st_ivas->hRenderConfig != NULL && st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#endif { /* add reverb to rendered signals */ v_add( reverb_signal[0], output_f_local[0], output_f_local[0], output_frame ); -- GitLab From 6bb65670ee6f8f723622d65a59e817f501f9e46f Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:58:01 +0100 Subject: [PATCH 11/16] [cleanup] accept NONBE_FIX_984_OMASA_EXT_OUTPUT --- apps/decoder.c | 28 --------------- apps/renderer.c | 4 --- lib_com/ivas_cnst.h | 4 --- lib_com/ivas_prot.h | 2 -- lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 20 ----------- lib_dec/ivas_jbm_dec.c | 20 ----------- lib_dec/ivas_masa_dec.c | 31 ---------------- lib_dec/ivas_omasa_dec.c | 47 ------------------------ lib_dec/ivas_output_config.c | 4 --- lib_dec/ivas_sba_dec.c | 4 --- lib_dec/ivas_stat_dec.h | 4 --- lib_dec/lib_dec.c | 26 -------------- lib_enc/ivas_masa_enc.c | 12 ------- lib_rend/ivas_output_init.c | 2 -- lib_util/masa_file_writer.c | 70 ------------------------------------ lib_util/masa_file_writer.h | 4 --- 17 files changed, 283 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index ac560234ce..142c8a4ac6 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -1990,12 +1990,8 @@ static ivas_error initOnFirstGoodFrame( for ( int16_t j = 0; j < numInitialBadFrames; ++j ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT float delayMs = (float) ( pFullDelayNumSamples[0] ) / (float) ( *delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( *ppMasaWriter ) ); return error; @@ -2501,7 +2497,6 @@ static ivas_error decodeG192( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t fullDelayNumSamples[3]; float delayMs; @@ -2510,19 +2505,14 @@ static ivas_error decodeG192( { fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } -#endif if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; @@ -2657,7 +2647,6 @@ static ivas_error decodeG192( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t fullDelayNumSamples[3]; float delayMs; @@ -2665,19 +2654,14 @@ static ivas_error decodeG192( { fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } -#endif if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; @@ -3352,7 +3336,6 @@ static ivas_error decodeVoIP( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t fullDelayNumSamples[3]; float delayMs; @@ -3361,19 +3344,14 @@ static ivas_error decodeVoIP( { fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } -#endif if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 1 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; @@ -3459,7 +3437,6 @@ static ivas_error decodeVoIP( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t fullDelayNumSamples[3]; float delayMs; @@ -3468,19 +3445,14 @@ static ivas_error decodeVoIP( { fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } -#endif if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; diff --git a/apps/renderer.c b/apps/renderer.c index 007ef477e7..8a9e0b48f8 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -2110,11 +2110,7 @@ int main( } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMetaOutput, NULL ) ) != IVAS_ERR_OK ) /* NULL -> use default metadata delay settings */ -#else - if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMetaOutput ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); } diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index e4946e9725..4960db4712 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -118,13 +118,9 @@ typedef enum RENDERER_NON_DIEGETIC_DOWNMIX, RENDERER_OSBA_STEREO, RENDERER_OSBA_AMBI, -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT RENDERER_OSBA_LS, RENDERER_OMASA_OBJECT_EXT, RENDERER_OMASA_MIX_EXT -#else - RENDERER_OSBA_LS -#endif } RENDERER_TYPE; #ifdef SPLIT_REND_WITH_HEAD_ROT diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index f0fe6d3cb4..e0e3a40dff 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5768,7 +5768,6 @@ void ivas_omasa_rearrange_channels( const int16_t output_frame /* i : output frame length per channel */ ); -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT ivas_error ivas_omasa_combine_separate_ism_with_masa_open( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); @@ -5791,7 +5790,6 @@ void ivas_omasa_render_objects_from_mix( const int16_t output_frame /* i : output frame length per channel */ ); -#endif void ivas_omasa_dirac_rend_jbm( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamplesAsked, /* i : number of samples requested */ diff --git a/lib_com/options.h b/lib_com/options.h index d3b35a40e1..7a1293a32f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */ #define NONBE_FIX_1000_G1_G2_SWB_TBE /* VA: issue 1000: avoid div by zero due to g1 + g2 being zero in SWB TBE */ #define NONBE_FIX_999_JBM_MCT_FLUSH /* FhG: issue #999: fix wrong flushing for MCT at a JBM rate switch */ #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index f91b897ea7..ffb0dbacd0 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -385,7 +385,6 @@ ivas_error ivas_dec_setup( st_ivas->nchan_transport = 1; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* this should be non-zero if original input format was MASA_ISM_FORMAT */ st_ivas->nchan_ism = st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 3] + 2 * st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 2]; @@ -401,7 +400,6 @@ ivas_error ivas_dec_setup( element_mode_flag = 1; } -#endif if ( st_ivas->ini_frame > 0 ) { /* reconfigure in case a change of operation mode is detected */ @@ -1156,11 +1154,7 @@ ivas_error ivas_init_decoder( hDecoderConfig->nchan_out = audioCfg2channels( IVAS_AUDIO_CONFIG_HOA3 ); hDecoderConfig->nchan_out += st_ivas->nchan_ism; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->ivas_format == MASA_ISM_FORMAT || st_ivas->ivas_format == MASA_FORMAT ) -#else - else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#endif { hDecoderConfig->nchan_out = st_ivas->nchan_transport + st_ivas->nchan_ism; } @@ -2112,7 +2106,6 @@ ivas_error ivas_init_decoder( return error; } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) { @@ -2137,7 +2130,6 @@ ivas_error ivas_init_decoder( return error; } } -#endif } if ( ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) && @@ -3001,7 +2993,6 @@ void ivas_init_dec_get_num_cldfb_instances( *numCldfbSyntheses = 0; } break; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT case RENDERER_OMASA_OBJECT_EXT: *numCldfbAnalyses = st_ivas->nchan_transport; *numCldfbSyntheses = st_ivas->hDecoderConfig->nchan_out; @@ -3010,7 +3001,6 @@ void ivas_init_dec_get_num_cldfb_instances( *numCldfbAnalyses = st_ivas->nchan_transport + 1; *numCldfbSyntheses = 0; break; -#endif default: assert( 0 && "Renderer not handled for CLDFB reservation." ); } @@ -3149,16 +3139,6 @@ static ivas_error doSanityChecks_IVAS( return IVAS_ERROR( IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED, "Wrong set-up: Acoustic environment is not supported in this output configuration." ); } } -#ifndef NONBE_FIX_984_OMASA_EXT_OUTPUT - - if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) - { - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for combined MASA and ISM format" ); - } - } -#endif #ifdef DEBUGGING if ( ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) && ( ( st_ivas->ivas_format != MC_FORMAT && st_ivas->ivas_format != ISM_FORMAT ) || ( output_config != IVAS_AUDIO_CONFIG_BINAURAL && output_config != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_PARAM ) || ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode != MC_MODE_MCT ) ) ) diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 31018089c1..851d1397e7 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -311,7 +311,6 @@ ivas_error ivas_jbm_dec_tc( if ( st_ivas->ivas_format == MASA_FORMAT ) { ivas_masa_prerender( st_ivas, p_output, output_frame, nchan_remapped ); -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* external output */ if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->hMasa->config.input_ivas_format == MASA_ISM_FORMAT ) @@ -323,7 +322,6 @@ ivas_error ivas_jbm_dec_tc( ivas_omasa_rearrange_channels( p_output, st_ivas->nchan_ism, output_frame ); } -#endif } else if ( st_ivas->ivas_format == SBA_FORMAT && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) { @@ -400,7 +398,6 @@ ivas_error ivas_jbm_dec_tc( } else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { ivas_omasa_rearrange_channels( p_output, nchan_transport_ism, output_frame ); @@ -415,15 +412,6 @@ ivas_error ivas_jbm_dec_tc( /* Extract objects from MASA, output MASA + all objects (i.e., extracted and separated objects) */ ivas_omasa_render_objects_from_mix( st_ivas, p_output, st_ivas->nchan_ism, output_frame ); } -#else - /* sanity check in case of bitrate switching */ - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for combined MASA and ISM format" ); - } - - ivas_omasa_rearrange_channels( p_output, nchan_transport_ism, output_frame ); -#endif ivas_jbm_dec_copy_masa_meta_to_buffer( st_ivas ); } @@ -906,7 +894,6 @@ void ivas_jbm_dec_feed_tc_to_renderer( } else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT || st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) { ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); @@ -914,7 +901,6 @@ void ivas_jbm_dec_feed_tc_to_renderer( } else { -#endif if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { n_render_timeslots *= ( st_ivas->hTcBuffer->n_samples_granularity / st_ivas->hSpatParamRendCom->slot_size ); @@ -949,9 +935,7 @@ void ivas_jbm_dec_feed_tc_to_renderer( delay_signal( st_ivas->hTcBuffer->tc[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available, st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size ); } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT } -#endif } else if ( st_ivas->ivas_format == MC_FORMAT ) { @@ -1217,13 +1201,11 @@ ivas_error ivas_jbm_dec_render( { ivas_omasa_dirac_rend_jbm( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output ); } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT || st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT ) { ivas_jbm_dec_tc_buffer_playout( st_ivas, nSamplesAskedLocal, nSamplesRendered, p_output ); ivas_omasa_rearrange_channels( p_output, st_ivas->nchan_ism, *nSamplesRendered ); } -#endif } else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { @@ -2731,10 +2713,8 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( case RENDERER_PARAM_ISM: case RENDERER_BINAURAL_MIXER_CONV: case RENDERER_BINAURAL_MIXER_CONV_ROOM: -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT case RENDERER_OMASA_OBJECT_EXT: case RENDERER_OMASA_MIX_EXT: -#endif case RENDERER_OSBA_AMBI: case RENDERER_OSBA_LS: buffer_mode = TC_BUFFER_MODE_RENDERER; diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 3984b79c54..3957fa0c5f 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -250,7 +250,6 @@ ivas_error ivas_masa_decode( } } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* read 2 bits: '00' - MASA format at the encoder @@ -270,20 +269,6 @@ ivas_error ivas_masa_decode( { hMasa->config.input_ivas_format = MASA_ISM_FORMAT; } -#else - /* read the MASA_ISM_FORMAT bit */ - byteBuffer = st->bit_stream[( st->next_bit_pos )--]; - if ( byteBuffer == 1 ) - { - hMasa->config.input_ivas_format = MASA_ISM_FORMAT; - } - else - { - hMasa->config.input_ivas_format = MASA_FORMAT; - } - /* reserved bit */ - byteBuffer = st->bit_stream[( st->next_bit_pos )--]; -#endif *nb_bits_read += MASA_HEADER_BITS; /* read number of directions */ @@ -365,13 +350,11 @@ ivas_error ivas_masa_decode( } } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) { *nb_bits_read += ivas_decode_masaism_metadata( hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos, st_ivas->hMasaIsmData->idx_separated_ism, ism_imp, st_ivas->hSpatParamRendCom->dirac_bs_md_write_idx, st_ivas->hSpatParamRendCom->dirac_md_buffer_length ); } -#endif else { *nb_bits_read += ivas_decode_masaism_metadata( hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos, @@ -491,12 +474,10 @@ ivas_error ivas_masa_decode( dirac_bs_md_write_idx = st_ivas->hSpatParamRendCom->dirac_bs_md_write_idx; /* Store the write-index for this frame */ ivas_qmetadata_to_dirac( hQMetaData, st_ivas->hDirAC, hMasa, st_ivas->hSpatParamRendCom, ivas_total_brate, ivas_format, 0, 0 ); } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) { st_ivas->hSpatParamRendCom->dirac_bs_md_write_idx = ( st_ivas->hSpatParamRendCom->dirac_bs_md_write_idx + MAX_PARAM_SPATIAL_SUBFRAMES ) % st_ivas->hSpatParamRendCom->dirac_md_buffer_length; } -#endif if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { @@ -616,14 +597,12 @@ ivas_error ivas_masa_dec_open( } ism_total_brate = 0; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* ISM metadata */ if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hIsmMetaData[0] != NULL && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { /* these are not needed -> clean. EXT metafile writer in OMASA needs only the number of ISMs and writes default null-data */ ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); } -#endif if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) { for ( i = 0; i < st_ivas->nSCE; i++ ) @@ -694,13 +673,11 @@ ivas_error ivas_masa_dec_open( nchan_transport = 1; nchan_to_allocate = 1; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT || st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) ) { nchan_transport = st_ivas->nchan_transport + st_ivas->nchan_ism; nchan_to_allocate = st_ivas->nchan_transport + st_ivas->nchan_ism; } -#endif else if ( st_ivas->nchan_transport == 1 && ( st_ivas->renderer_type == RENDERER_DIRAC ) ) { /* addtl channel for CNG */ @@ -1499,16 +1476,12 @@ ivas_error ivas_masa_dec_reconfigure( if ( st_ivas->ivas_format == MASA_FORMAT ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { st_ivas->nchan_ism = 0; /* Initialization if it has not been already read from the end of the bitstream at the same time with reading of the format: nchan_ism is needed in MASA format because for the EXT output in MASA-only (pre-rendering mode of OMASA) the number of ISMs to output correct number of empty objects is needed */ } -#else - st_ivas->nchan_ism = 0; -#endif st_ivas->ism_mode = ISM_MODE_NONE; } @@ -1564,13 +1537,11 @@ ivas_error ivas_masa_dec_reconfigure( /* addtl channel for CNG */ tc_nchan_to_allocate++; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT || st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) ) { tc_nchan_transport = st_ivas->nchan_transport + st_ivas->nchan_ism; tc_nchan_to_allocate = st_ivas->nchan_transport + st_ivas->nchan_ism; } -#endif if ( tc_nchan_transport != st_ivas->hTcBuffer->nchan_transport_jbm || tc_nchan_to_allocate != st_ivas->hTcBuffer->nchan_transport_internal || buffer_mode_new != st_ivas->hTcBuffer->tc_buffer_mode ) { @@ -2546,13 +2517,11 @@ static int16_t ivas_decode_masaism_metadata( { hMasaIsmData->energy_ratio_ism[dir][meta_write_index][b] = energy_ratio_ism[i][band][dir]; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( hMasaIsmData->hExtData != NULL ) { hMasaIsmData->hExtData->masa_render_masa_to_total[meta_write_index][b] = hMasaIsmData->masa_to_total_energy_ratio[i][band]; } -#endif } } } diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index ab032e2440..763c37a709 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -32,9 +32,7 @@ #include "options.h" #include -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT #include -#endif #include "ivas_cnst.h" #include "ivas_prot.h" #include "prot.h" @@ -45,13 +43,11 @@ #endif #include "wmc_auto.h" -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /*------------------------------------------------------------------------- * Local constants *------------------------------------------------------------------------*/ #define EXT_RENDER_IIR_FAC 0.95f -#endif /*-------------------------------------------------------------------* * ivas_omasa_data_open() @@ -107,7 +103,6 @@ ivas_error ivas_omasa_data_open( set_s( hMasaIsmData->azimuth_separated_ism, 0, MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); set_s( hMasaIsmData->elevation_separated_ism, 0, MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT hMasaIsmData->hExtData = NULL; if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { @@ -141,7 +136,6 @@ ivas_error ivas_omasa_data_open( hMasaIsmData->hExtData = hExtData; } -#endif st_ivas->hMasaIsmData = hMasaIsmData; return IVAS_ERR_OK; @@ -175,14 +169,12 @@ void ivas_omasa_data_close( ( *hMasaIsmData )->delayBuffer = NULL; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( ( *hMasaIsmData )->hExtData != NULL ) { free( ( *hMasaIsmData )->hExtData ); ( *hMasaIsmData )->hExtData = NULL; } -#endif free( *hMasaIsmData ); *hMasaIsmData = NULL; @@ -305,7 +297,6 @@ ivas_error ivas_omasa_dec_config( /* ISM MD reconfig. */ n_MD = 0; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { /* the full number of hIsmMetaData are needed for EXT output */ @@ -347,33 +338,6 @@ ivas_error ivas_omasa_dec_config( ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); } -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) - { - n_MD = 1; - - if ( st_ivas->hIsmMetaData[0] == NULL ) - { - if ( ( error = ivas_ism_metadata_dec_create( st_ivas, 1, NULL ) ) != IVAS_ERR_OK ) - { - return error; - } - } - } - else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) - { - n_MD = st_ivas->nchan_ism; - - ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); - - if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); -#endif st_ivas->hCPE[0]->element_brate = ivas_total_brate - ism_total_brate; @@ -403,14 +367,9 @@ ivas_error ivas_omasa_dec_config( } /* objects renderer reconfig. */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->hMasaIsmData != NULL || st_ivas->hIsmRendererData != NULL ) { /* this calls also ivas_ism_renderer_close() closing st_ivas->hIsmRendererData used by the EXT renderers. also cleans st_ivas->hMasaIsmData */ -#else - if ( st_ivas->hMasaIsmData != NULL ) - { -#endif ivas_omasa_separate_object_renderer_close( st_ivas ); } @@ -463,7 +422,6 @@ ivas_error ivas_omasa_dec_config( } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT ) { /* Allocate 'hIsmRendererData' handle */ @@ -490,7 +448,6 @@ ivas_error ivas_omasa_dec_config( } } -#endif /*-----------------------------------------------------------------* * TD Decorrelator *-----------------------------------------------------------------*/ @@ -692,7 +649,6 @@ ivas_error ivas_omasa_ism_metadata_dec( } } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { azimuth_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->azimuth + 0.5f ); @@ -709,7 +665,6 @@ ivas_error ivas_omasa_ism_metadata_dec( st_ivas->hMasaIsmData->elevation_separated_ism[block] = elevation_ism; } } -#endif } return IVAS_ERR_OK; @@ -835,7 +790,6 @@ void ivas_omasa_rearrange_channels( return; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /*-------------------------------------------------------------------------* * ivas_omasa_combine_separate_ism_with_masa_open() @@ -1305,4 +1259,3 @@ void ivas_omasa_render_objects_from_mix( return; } -#endif diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index c93b16dcdb..1be9e61829 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -419,7 +419,6 @@ void ivas_renderer_select( } else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { *renderer_type = RENDERER_OMASA_OBJECT_EXT; @@ -432,9 +431,6 @@ void ivas_renderer_select( { *renderer_type = RENDERER_DISABLE; } -#else - *renderer_type = RENDERER_DISABLE; -#endif } } else if ( st_ivas->ivas_format == MC_FORMAT ) diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 897df0c96f..af102dd96e 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -693,11 +693,7 @@ void ivas_sba_dec_digest_tc( int16_t ch_idx, nchan_transport; /* set the md map */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->hDirAC || st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) -#else - if ( st_ivas->hDirAC ) -#endif { ivas_dirac_dec_set_md_map( st_ivas, nCldfbSlots ); } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index dccd1391a5..4deb6748e2 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -873,7 +873,6 @@ typedef struct ivas_masa_decoder_struct } MASA_DECODER, *MASA_DECODER_HANDLE; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* Data structure for MASA_ISM EXT rendering */ typedef struct ivas_masa_ism_ext_data_structure { @@ -886,7 +885,6 @@ typedef struct ivas_masa_ism_ext_data_structure float masa_render_masa_to_total[MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR][CLDFB_NO_CHANNELS_MAX]; } MASA_ISM_EXT_DATA, *MASA_ISM_EXT_DATA_HANDLE; -#endif /* Data structure for MASA_ISM rendering */ typedef struct ivas_masa_ism_data_structure @@ -918,9 +916,7 @@ typedef struct ivas_masa_ism_data_structure int16_t delayBuffer_size; int16_t delayBuffer_nchan; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT MASA_ISM_EXT_DATA_HANDLE hExtData; -#endif } MASA_ISM_DATA, *MASA_ISM_DATA_HANDLE; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index d06e882f4d..4e9dc2ac03 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1436,16 +1436,13 @@ ivas_error IVAS_DEC_GetNumObjects( uint16_t *numObjects /* o : number of objects for which the decoder has been configured */ ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t is_masa_ism; is_masa_ism = 0; -#endif if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( hIvasDec->st_ivas->hMasa != NULL ) { @@ -1455,9 +1452,6 @@ ivas_error IVAS_DEC_GetNumObjects( } } if ( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT || hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT || is_masa_ism ) -#else - if ( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT || hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT ) -#endif { *numObjects = hIvasDec->st_ivas->nchan_ism; } @@ -1491,12 +1485,10 @@ ivas_error IVAS_DEC_GetFormat( *format = IVAS_DEC_BS_UNKOWN; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( *format == IVAS_DEC_BS_MASA && hIvasDec->st_ivas->hMasa->config.input_ivas_format == MASA_ISM_FORMAT ) { *format = IVAS_DEC_BS_MASA_ISM; } -#endif return IVAS_ERR_OK; } @@ -1605,10 +1597,8 @@ ivas_error IVAS_DEC_GetObjectMetadata( { Decoder_Struct *st_ivas; ISM_METADATA_HANDLE hIsmMeta; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t is_masa_ism; is_masa_ism = 0; -#endif if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { @@ -1616,7 +1606,6 @@ ivas_error IVAS_DEC_GetObjectMetadata( } st_ivas = hIvasDec->st_ivas; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( hIvasDec->st_ivas->hMasa != NULL ) { if ( hIvasDec->st_ivas->hMasa->config.input_ivas_format == MASA_ISM_FORMAT ) @@ -1625,9 +1614,6 @@ ivas_error IVAS_DEC_GetObjectMetadata( } } if ( st_ivas->ivas_format != ISM_FORMAT && st_ivas->ivas_format != MASA_ISM_FORMAT && st_ivas->ivas_format != SBA_ISM_FORMAT && is_masa_ism == 0 ) -#else - if ( st_ivas->ivas_format != ISM_FORMAT && st_ivas->ivas_format != MASA_ISM_FORMAT && st_ivas->ivas_format != SBA_ISM_FORMAT ) -#endif { return IVAS_ERR_WRONG_MODE; } @@ -1639,11 +1625,7 @@ ivas_error IVAS_DEC_GetObjectMetadata( hIsmMeta = st_ivas->hIsmMetaData[objectIdx]; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( hIsmMeta == NULL || zero_flag || ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) -#else - if ( hIsmMeta == NULL || zero_flag ) -#endif { metadata->azimuth = 0.f; metadata->elevation = 0.f; @@ -2222,18 +2204,10 @@ ivas_error IVAS_DEC_GetDelay( st_ivas = hIvasDec->st_ivas; hDecoderConfig = st_ivas->hDecoderConfig; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT #ifdef SPLIT_REND_WITH_HEAD_ROT nSamples[1] = NS2SA( hDecoderConfig->output_Fs, get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbSynDec[0], hDecoderConfig->output_config ) ); #else nSamples[1] = NS2SA( hDecoderConfig->output_Fs, get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbSynDec[0] ) ); -#endif -#else -#ifdef SPLIT_REND_WITH_HEAD_ROT - nSamples[1] = NS2SA( hDecoderConfig->output_Fs, get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbAnaDec[0], hDecoderConfig->output_config ) ); -#else - nSamples[1] = NS2SA( hDecoderConfig->output_Fs, get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbAnaDec[0] ) ); -#endif #endif nSamples[2] = (int16_t) roundf( (float) st_ivas->binaural_latency_ns * hDecoderConfig->output_Fs / 1000000000.f ); diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index ac46219e40..831e343d72 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -418,7 +418,6 @@ ivas_error ivas_masa_encode( } else { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( ivas_format == MASA_ISM_FORMAT && ism_mode == ISM_MODE_NONE ) { /* use the MASA number of transport channels bit to signal if there are 3 or 4 objects */ @@ -433,18 +432,14 @@ ivas_error ivas_masa_encode( } else { -#endif /* write the number of MASA transport channels */ push_next_indice( hMetaData, nchan_transport - 1, MASA_TRANSP_BITS ); -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT } -#endif hQMetaData->metadata_max_bits -= MASA_TRANSP_BITS; } if ( ivas_format == MASA_ISM_FORMAT && ism_mode == ISM_MODE_NONE ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( nchan_ism <= 3 ) { push_next_indice( hMetaData, nchan_ism, MASA_HEADER_BITS ); @@ -454,13 +449,6 @@ ivas_error ivas_masa_encode( push_next_indice( hMetaData, nchan_ism - 1, MASA_HEADER_BITS ); } hQMetaData->metadata_max_bits -= MASA_HEADER_BITS; -#else - /* signal MASA_ISM_FORMAT to decoder */ - push_next_indice( hMetaData, 1, 1 ); - /* write reserved bit */ - push_next_indice( hMetaData, 0, MASA_HEADER_BITS - 1 ); - hQMetaData->metadata_max_bits -= MASA_HEADER_BITS; -#endif } else { diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 1ac22a5543..5d7d4d610f 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -337,12 +337,10 @@ int16_t ivas_get_nchan_buffers_dec( nchan_out_buff = max( nchan_out_buff, audioCfg2channels( output_config ) ); } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->nchan_ism > 0 ) { nchan_out_buff = st_ivas->nchan_ism + CPE_CHANNELS; } -#endif } else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { diff --git a/lib_util/masa_file_writer.c b/lib_util/masa_file_writer.c index 1f708d7b1b..12bcd65b19 100644 --- a/lib_util/masa_file_writer.c +++ b/lib_util/masa_file_writer.c @@ -41,20 +41,12 @@ typedef struct masaMetaDelayStorage { MASA_DECRIPTIVE_META descriptiveMeta; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT uint16_t directionIndex[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR + 1][MASA_FREQUENCY_BANDS]; uint8_t directToTotalRatio[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR + 1][MASA_FREQUENCY_BANDS]; uint8_t spreadCoherence[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR + 1][MASA_FREQUENCY_BANDS]; uint8_t surroundCoherence[DELAY_MASA_PARAM_DEC_SFR + 1][MASA_FREQUENCY_BANDS]; uint8_t diffuseToTotalRatio[DELAY_MASA_PARAM_DEC_SFR + 1][MASA_FREQUENCY_BANDS]; uint8_t prevDelay; -#else - uint16_t directionIndex[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR][MASA_FREQUENCY_BANDS]; - uint8_t directToTotalRatio[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR][MASA_FREQUENCY_BANDS]; - uint8_t spreadCoherence[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR][MASA_FREQUENCY_BANDS]; - uint8_t surroundCoherence[DELAY_MASA_PARAM_DEC_SFR][MASA_FREQUENCY_BANDS]; - uint8_t diffuseToTotalRatio[DELAY_MASA_PARAM_DEC_SFR][MASA_FREQUENCY_BANDS]; -#endif } MASA_META_DELAY_STORAGE; struct MasaFileWriter @@ -96,23 +88,16 @@ static void getExtMasaMetadataFileName( static void delayMasaMetadata( MASA_DECODER_EXT_OUT_META_HANDLE extOutMeta, /* i/o: New input metadata which is inplace replaced with delayed metadata frame */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT MASA_META_DELAY_STORAGE *delayStorage, /* i/o: Storage for 15 ms of metadata and related descriptive metadata */ uint8_t delayNsf -#else - MASA_META_DELAY_STORAGE *delayStorage /* i/o: Storage for 10 ms of metadata and related descriptive metadata */ -#endif ) { int16_t dir, sf, band; uint8_t currentNumberOfDirections; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t storeReadOffset; -#endif /* Move meta to delay and output. Always use two directions as the metadata is prepared to contain zero energy second direction * if there is 1dir meta. */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* stable state expected results delay change expected results delayNsf = 2 delayNsf = 3 delayNsf = 3 (from 2) delayNsf = 2 (from 3) ext[0] = delayStorage[0] (prev ext[2]) ext[0] = delayStorage[0] (prev ext[1]) ext[0] = delayStorage[0] (prev ext[2]) ext[0] = delayStorage[1] (prev ext[2]) @@ -183,43 +168,6 @@ static void delayMasaMetadata( } } -#else - for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES - DELAY_MASA_PARAM_DEC_SFR; sf++ ) - { - for ( band = 0; band < MASA_FREQUENCY_BANDS; band++ ) - { - uint16_t temp_u16; - uint8_t temp_u8; - for ( dir = 0; dir < MASA_MAXIMUM_DIRECTIONS; dir++ ) - { - temp_u16 = delayStorage->directionIndex[dir][sf][band]; - delayStorage->directionIndex[dir][sf][band] = extOutMeta->directionIndex[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band]; - extOutMeta->directionIndex[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band] = extOutMeta->directionIndex[dir][sf][band]; - extOutMeta->directionIndex[dir][sf][band] = temp_u16; - - temp_u8 = delayStorage->directToTotalRatio[dir][sf][band]; - delayStorage->directToTotalRatio[dir][sf][band] = extOutMeta->directToTotalRatio[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band]; - extOutMeta->directToTotalRatio[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band] = extOutMeta->directToTotalRatio[dir][sf][band]; - extOutMeta->directToTotalRatio[dir][sf][band] = temp_u8; - - temp_u8 = delayStorage->spreadCoherence[dir][sf][band]; - delayStorage->spreadCoherence[dir][sf][band] = extOutMeta->spreadCoherence[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band]; - extOutMeta->spreadCoherence[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band] = extOutMeta->spreadCoherence[dir][sf][band]; - extOutMeta->spreadCoherence[dir][sf][band] = temp_u8; - } - - temp_u8 = delayStorage->surroundCoherence[sf][band]; - delayStorage->surroundCoherence[sf][band] = extOutMeta->surroundCoherence[sf + DELAY_MASA_PARAM_DEC_SFR][band]; - extOutMeta->surroundCoherence[sf + DELAY_MASA_PARAM_DEC_SFR][band] = extOutMeta->surroundCoherence[sf][band]; - extOutMeta->surroundCoherence[sf][band] = temp_u8; - - temp_u8 = delayStorage->diffuseToTotalRatio[sf][band]; - delayStorage->diffuseToTotalRatio[sf][band] = extOutMeta->diffuseToTotalRatio[sf + DELAY_MASA_PARAM_DEC_SFR][band]; - extOutMeta->diffuseToTotalRatio[sf + DELAY_MASA_PARAM_DEC_SFR][band] = extOutMeta->diffuseToTotalRatio[sf][band]; - extOutMeta->diffuseToTotalRatio[sf][band] = temp_u8; - } - } -#endif /* Finalize descriptive meta by using new frame except for number of directions which is the larger of the two */ currentNumberOfDirections = extOutMeta->descriptiveMeta.numberOfDirections; @@ -229,10 +177,8 @@ static void delayMasaMetadata( } delayStorage->descriptiveMeta.numberOfDirections = currentNumberOfDirections; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayStorage->prevDelay = delayNsf; -#endif return; } @@ -275,9 +221,7 @@ ivas_error MasaFileWriter_open( if ( !delayCompensationEnabled ) { self->delayStorage = calloc( sizeof( MASA_META_DELAY_STORAGE ), 1 ); -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT self->delayStorage->prevDelay = DELAY_MASA_PARAM_DEC_SFR; -#endif } *masaWriter = self; @@ -294,12 +238,8 @@ ivas_error MasaFileWriter_open( ivas_error MasaFileWriter_writeFrame( MasaFileWriter *self, /* i/o: MasaFileWriter handle */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta, /* i/o: MASA ext out meta handle to be written */ const float *decDelay /* i : decoding audio delay */ -#else - MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta /* i/o: MASA ext out meta handle to be written */ -#endif ) { if ( self == NULL ) @@ -311,7 +251,6 @@ ivas_error MasaFileWriter_writeFrame( int16_t i, sf, dir, numDirections; uint8_t writeTempOther[MASA_FREQUENCY_BANDS]; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* If delay storage has been reserved, then we are in the normal mode for the decoder * (i.e., no delay compensation for PCM) which means that metadata should be delayed * by two or three subframes (10 or 15 ms). Descriptive metadata is a combined result. */ @@ -321,15 +260,6 @@ ivas_error MasaFileWriter_writeFrame( delayMasaMetadata( hMasaExtOutMeta, self->delayStorage, delayFrames ); } -#else - /* If delay storage has been reserved, then we are in the normal mode for the decoder - * (i.e., no delay compensation for PCM) which means that metadata should be delayed - * by two subframes (10 ms). Descriptive metadata is a combined result. */ - if ( self->delayStorage ) - { - delayMasaMetadata( hMasaExtOutMeta, self->delayStorage ); - } -#endif numDirections = hMasaExtOutMeta->descriptiveMeta.numberOfDirections + 1; diff --git a/lib_util/masa_file_writer.h b/lib_util/masa_file_writer.h index 11495a53f0..c6caf0a3f9 100644 --- a/lib_util/masa_file_writer.h +++ b/lib_util/masa_file_writer.h @@ -49,12 +49,8 @@ ivas_error MasaFileWriter_open( ivas_error MasaFileWriter_writeFrame( MasaFileWriter *self, /* i/o: MasaFileWriter handle */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta, /* i/o: MASA ext out meta handle to be written */ const float *decDelay /* i : decoding audio delay */ -#else - IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta /* i/o: MASA ext out meta handle to be written */ -#endif ); void MasaFileWriter_close( -- GitLab From aed5ed563aa9b3b850f0ab8a0a2f7d8f91579082 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:58:46 +0100 Subject: [PATCH 12/16] [cleanup] accept NONBE_FIX_1000_G1_G2_SWB_TBE --- lib_com/options.h | 1 - lib_com/swb_tbe_com.c | 6 ------ 2 files changed, 7 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 7a1293a32f..8e54f7d35e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_1000_G1_G2_SWB_TBE /* VA: issue 1000: avoid div by zero due to g1 + g2 being zero in SWB TBE */ #define NONBE_FIX_999_JBM_MCT_FLUSH /* FhG: issue #999: fix wrong flushing for MCT at a JBM rate switch */ #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin */ #define NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE /* FhG: issue #1005: fix TC Buffer update at a MC rate switch */ diff --git a/lib_com/swb_tbe_com.c b/lib_com/swb_tbe_com.c index 8e21ef1748..310c583218 100644 --- a/lib_com/swb_tbe_com.c +++ b/lib_com/swb_tbe_com.c @@ -939,12 +939,10 @@ void GenShapedSHBExcitation( den = 4.0f * c0 * c2 - c4 * c4; -#ifdef NONBE_FIX_1000_G1_G2_SWB_TBE if ( den == 0.0f ) { den = 1e-7f; } -#endif g1 = ( c3 * c4 - 2 * c1 * c2 ) / den; g2 = ( c1 * c4 - 2 * c0 * c3 ) / den; @@ -972,7 +970,6 @@ void GenShapedSHBExcitation( else { /* normalize gain */ -#ifdef NONBE_FIX_1000_G1_G2_SWB_TBE temp = 0.0f; if ( g1 + g2 == 0.0f ) { @@ -980,9 +977,6 @@ void GenShapedSHBExcitation( } g = g2 / ( g1 + g2 + temp ); -#else - g = g2 / ( g1 + g2 ); -#endif /* quantization of the mixing factor */ cbsize = 1 << NUM_BITS_SHB_VF; -- GitLab From bb1f29a75903483a18ce26e305b02ff2c98b03b0 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 10:59:32 +0100 Subject: [PATCH 13/16] [cleanup] accept NONBE_FIX_999_JBM_MCT_FLUSH --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 6 ------ 2 files changed, 7 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 8e54f7d35e..e640cbc495 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_999_JBM_MCT_FLUSH /* FhG: issue #999: fix wrong flushing for MCT at a JBM rate switch */ #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin */ #define NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE /* FhG: issue #1005: fix TC Buffer update at a MC rate switch */ #define NONBE_FIX_864_JBM_RENDER_FRAMESIZE /* FhG: issue #864: fix different behaviour of JBM TSM with different render frame sizes */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 851d1397e7..128754273c 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1682,11 +1682,7 @@ ivas_error ivas_jbm_dec_flush_renderer( ivas_binaural_add_LFE( st_ivas, hTcBuffer->n_samples_granularity, st_ivas->hTcBuffer->tc, p_output ); } -#ifdef NONBE_FIX_999_JBM_MCT_FLUSH else if ( renderer_type_old == RENDERER_BINAURAL_OBJECTS_TD ) -#else - else if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) -#endif { if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ) ) != IVAS_ERR_OK ) { @@ -1695,12 +1691,10 @@ ivas_error ivas_jbm_dec_flush_renderer( ivas_binaural_add_LFE( st_ivas, hTcBuffer->n_samples_granularity, st_ivas->hTcBuffer->tc, p_output ); } -#ifdef NONBE_FIX_999_JBM_MCT_FLUSH else { return IVAS_ERROR( IVAS_ERR_WRONG_MODE, "Wrong renderer in MCT VoIP renderer flushing!" ); } -#endif } else { -- GitLab From 1252e78bf92b727a13f3c145778a588b57c55946 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 11:00:14 +0100 Subject: [PATCH 14/16] [cleanup] accept NONBE_FIX_991_PARAMBIN_BINARY_HRTF --- lib_com/options.h | 1 - lib_dec/ivas_dirac_dec.c | 4 - lib_dec/ivas_init_dec.c | 4 - lib_dec/ivas_ism_dec.c | 8 -- lib_rend/ivas_dirac_dec_binaural_functions.c | 84 -------------------- lib_rend/ivas_prot_rend.h | 4 - lib_rend/ivas_stat_rend.h | 16 ---- lib_rend/lib_rend.c | 18 ----- 8 files changed, 139 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index e640cbc495..59c66a6a6b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin */ #define NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE /* FhG: issue #1005: fix TC Buffer update at a MC rate switch */ #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 */ diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 8e3f383fea..cd277123bb 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -872,11 +872,7 @@ ivas_error ivas_dirac_dec_config( if ( st_ivas->hDiracDecBin == NULL ) #endif { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, &( st_ivas->hHrtfParambin ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index ffb0dbacd0..b92dc19ded 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1989,11 +1989,7 @@ ivas_error ivas_init_decoder( } } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, &( st_ivas->hHrtfParambin ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 1a43d3ef07..b23b16ca63 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -263,11 +263,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( return error; } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, &( st_ivas->hHrtfParambin ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -298,11 +294,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( return error; } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, &( st_ivas->hHrtfParambin ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index f4e55a63d4..f318efbf53 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -119,17 +119,9 @@ static void ivas_dirac_dec_binaural_check_and_switch_transports_headtracked( COM static void formulate2x2MixingMatrix( float Ein1, float Ein2, float CinRe, float CinIm, float Eout1, float Eout2, float CoutRe, float CoutIm, float Q[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Mre[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Mim[BINAURAL_CHANNELS][BINAURAL_CHANNELS], const float regularizationFactor ); -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF static void hrtfShGetHrtf( const int16_t bin, const int16_t aziDeg, const int16_t eleDeg, float *lRealp, float *lImagp, float *rRealp, float *rImagp, PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t useCachedValue, HRTFS_PARAMBIN_HANDLE hHrtfParambin ); -#else -static void hrtfShGetHrtf( const int16_t bin, const int16_t aziDeg, const int16_t eleDeg, float *lRealp, float *lImagp, float *rRealp, float *rImagp, PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t useCachedValue ); -#endif -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF static void getDirectPartGains( const int16_t bin, int16_t aziDeg, int16_t eleDeg, float *lRealp, float *lImagp, float *rRealp, float *rImagp, const uint8_t stereoMode, float Rmat[3][3], PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t isHeadtracked, HRTFS_PARAMBIN_HANDLE hHrtfParambin ); -#else -static void getDirectPartGains( const int16_t bin, int16_t aziDeg, int16_t eleDeg, float *lRealp, float *lImagp, float *rRealp, float *rImagp, const uint8_t stereoMode, float Rmat[3][3], PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t isHeadtracked ); -#endif static void matrixMul( float Are[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Aim[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Bre[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Bim[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float outRe[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float outIm[BINAURAL_CHANNELS][BINAURAL_CHANNELS] ); @@ -149,11 +141,7 @@ static void ivas_masa_ext_rend_parambin_internal( MASA_EXT_REND_HANDLE hMasaExtR ivas_error ivas_dirac_dec_init_binaural_data( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF HRTFS_PARAMBIN_HANDLE *phHrtfParambin /* i : HRTF structure for rendering */ -#else - HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : HRTF structure for rendering */ -#endif ) { DIRAC_DEC_BIN_HANDLE hDiracDecBin; @@ -185,9 +173,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( hDiracDecBin->hReverb = NULL; hDiracDecBin->h_freq_domain_decorr_ap_params = NULL; hDiracDecBin->h_freq_domain_decorr_ap_state = NULL; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF hDiracDecBin->phHrtfParambin = NULL; -#endif } output_Fs = st_ivas->hDecoderConfig->output_Fs; @@ -239,11 +225,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( } else if ( renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) /* Indication of binaural rendering with room effect */ { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#else - mvr2r( hHrtfParambin->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#endif /* reconfiguration needed when Reverb. parameters are changed -> close and open the handle again */ if ( hDiracDecBin->hReverb != NULL && ( ( hDiracDecBin->hReverb->numBins != nBins ) || @@ -258,11 +240,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( if ( hDiracDecBin->hReverb == NULL ) #endif { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, st_ivas->hHrtfParambin->parametricReverberationTimes, st_ivas->hHrtfParambin->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -326,9 +304,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( hDiracDecBin->reqularizationFactor = configure_reqularization_factor( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate ); -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF hDiracDecBin->phHrtfParambin = phHrtfParambin; -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT st_ivas->hDiracDecBin[pos_idx] = hDiracDecBin; @@ -1316,11 +1292,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( spreadCoh = max( spreadCoh, altSpreadCoh ); } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked ); -#endif if ( hDiracDecBin->renderStereoOutputInsteadOfBinaural ) { @@ -1363,11 +1335,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( rImagp *= centerMul; /* Apply the gain for the left source of the three coherent sources */ -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked ); -#endif hrtfEneSides = ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; @@ -1377,11 +1345,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( /* Apply the gain for the right source of the three coherent sources. * -30 degrees to 330 wrapping due to internal functions. */ -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked ); -#endif hrtfEneSides += ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; lImagp += sidesMul * lImagpTmp; @@ -1770,11 +1734,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric spreadCoh = max( spreadCoh, altSpreadCoh ); } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked ); -#endif if ( hDiracDecBin->renderStereoOutputInsteadOfBinaural ) { @@ -1817,11 +1777,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric rImagp *= centerMul; /* Apply the gain for the left source of the three coherent sources */ -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked ); -#endif hrtfEneSides = ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; @@ -1831,11 +1787,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric /* Apply the gain for the right source of the three coherent sources. * -30 degrees to 330 wrapping due to internal functions. */ -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked ); -#endif hrtfEneSides += ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; lImagp += sidesMul * lImagpTmp; @@ -2219,11 +2171,7 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( hDiracDecBin->processMtxImPrev[chA][chB + 2][bin] = hDiracDecBin->processMtxIm[chA][chB + 2][bin]; } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[chB], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[chB], isHeadtracked ); -#endif hDiracDecBin->processMtxRe[0][chB + 2][bin] = lRealp * gainFactor; hDiracDecBin->processMtxIm[0][chB + 2][bin] = lImagp * gainFactor; @@ -2998,12 +2946,8 @@ static void getDirectPartGains( const uint8_t renderStereoOutputInsteadOfBinaural, float Rmat[3][3], PARAMBIN_HRTF_GAIN_CACHE *gainCache, -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF const int16_t isHeadtracked, HRTFS_PARAMBIN_HANDLE hHrtfParambin -#else - const int16_t isHeadtracked -#endif ) { float aziRad, eleRad; @@ -3049,11 +2993,7 @@ static void getDirectPartGains( { if ( aziDeg == gainCache->azi && eleDeg == gainCache->ele ) { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF hrtfShGetHrtf( bin, aziDeg, eleDeg, lRealp, lImagp, rRealp, rImagp, gainCache, TRUE, hHrtfParambin ); -#else - hrtfShGetHrtf( bin, aziDeg, eleDeg, lRealp, lImagp, rRealp, rImagp, gainCache, TRUE ); -#endif } else { @@ -3063,11 +3003,7 @@ static void getDirectPartGains( { rotateAziEle( (float) aziDeg, (float) eleDeg, &aziDeg, &eleDeg, Rmat, 0 ); } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF hrtfShGetHrtf( bin, aziDeg, eleDeg, lRealp, lImagp, rRealp, rImagp, gainCache, FALSE, hHrtfParambin ); -#else - hrtfShGetHrtf( bin, aziDeg, eleDeg, lRealp, lImagp, rRealp, rImagp, gainCache, FALSE ); -#endif } } @@ -3084,21 +3020,15 @@ static void hrtfShGetHrtf( float *rRealp, float *rImagp, PARAMBIN_HRTF_GAIN_CACHE *gainCache, -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF const int16_t useCachedValue, HRTFS_PARAMBIN_HANDLE hHrtfParambin -#else - const int16_t useCachedValue -#endif ) { int16_t k; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF float( *hrtfShCoeffsReInt )[16][60]; float( *hrtfShCoeffsImInt )[16][60]; hrtfShCoeffsReInt = hHrtfParambin->hrtfShCoeffsRe; hrtfShCoeffsImInt = hHrtfParambin->hrtfShCoeffsIm; -#endif *lRealp = 0.0f; *lImagp = 0.0f; @@ -3112,17 +3042,10 @@ static void hrtfShGetHrtf( for ( k = 0; k < HRTF_SH_CHANNELS; k++ ) { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF *lRealp += hrtfShCoeffsReInt[0][k][bin] * shVec[k]; *lImagp += hrtfShCoeffsImInt[0][k][bin] * shVec[k]; *rRealp += hrtfShCoeffsReInt[1][k][bin] * shVec[k]; *rImagp += hrtfShCoeffsImInt[1][k][bin] * shVec[k]; -#else - *lRealp += hrtfShCoeffsRe[0][k][bin] * shVec[k]; - *lImagp += hrtfShCoeffsIm[0][k][bin] * shVec[k]; - *rRealp += hrtfShCoeffsRe[1][k][bin] * shVec[k]; - *rImagp += hrtfShCoeffsIm[1][k][bin] * shVec[k]; -#endif } } else @@ -3136,17 +3059,10 @@ static void hrtfShGetHrtf( for ( k = 0; k < HRTF_SH_CHANNELS; k++ ) { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF *lRealp += hrtfShCoeffsReInt[0][k][bin] * shVec[k]; *lImagp += hrtfShCoeffsImInt[0][k][bin] * shVec[k]; *rRealp += hrtfShCoeffsReInt[1][k][bin] * shVec[k]; *rImagp += hrtfShCoeffsImInt[1][k][bin] * shVec[k]; -#else - *lRealp += hrtfShCoeffsRe[0][k][bin] * shVec[k]; - *lImagp += hrtfShCoeffsIm[0][k][bin] * shVec[k]; - *rRealp += hrtfShCoeffsRe[1][k][bin] * shVec[k]; - *rImagp += hrtfShCoeffsIm[1][k][bin] * shVec[k]; -#endif gainCache->shVec[k] = shVec[k]; } diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 3767a7fea2..196ed72f5e 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -245,11 +245,7 @@ void ivas_masa_ext_rend_parambin_render( ); ivas_error ivas_dirac_dec_init_binaural_data( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF HRTFS_PARAMBIN_HANDLE *phHrtfParambin /* i : HRTF structure for rendering */ -#else - HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : HRTF structure for rendering */ -#endif ); void ivas_dirac_dec_close_binaural_data( diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 516d6a7ee2..672f264211 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -500,7 +500,6 @@ typedef struct ivas_diffuse_distribution_data_structure } DIFFUSE_DISTRIBUTION_DATA, *DIFFUSE_DISTRIBUTION_HANDLE; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Parametric binaural renderer HRTF structure */ typedef struct ivas_hrtfs_parambin_struct { @@ -512,7 +511,6 @@ typedef struct ivas_hrtfs_parambin_struct float parametricEarlyPartEneCorrection[CLDFB_NO_CHANNELS_MAX]; } HRTFS_PARAMBIN, *HRTFS_PARAMBIN_HANDLE; -#endif /* Parametric binaural data structure */ typedef struct ivas_dirac_dec_binaural_data_structure @@ -549,9 +547,7 @@ typedef struct ivas_dirac_dec_binaural_data_structure ivas_td_decorr_state_t *hTdDecorr; float reqularizationFactor; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF HRTFS_PARAMBIN_HANDLE *phHrtfParambin; -#endif DIFFUSE_DISTRIBUTION_HANDLE hDiffuseDist; @@ -1331,18 +1327,6 @@ typedef struct ivas_hrtfs_fastconv_struct } HRTFS_FASTCONV, *HRTFS_FASTCONV_HANDLE; -#ifndef NONBE_FIX_991_PARAMBIN_BINARY_HRTF -typedef struct ivas_hrtfs_parambin_struct -{ - float hrtfShCoeffsRe[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; - float hrtfShCoeffsIm[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; - - float parametricReverberationTimes[CLDFB_NO_CHANNELS_MAX]; - float parametricReverberationEneCorrections[CLDFB_NO_CHANNELS_MAX]; - float parametricEarlyPartEneCorrection[CLDFB_NO_CHANNELS_MAX]; - -} HRTFS_PARAMBIN, *HRTFS_PARAMBIN_HANDLE; -#endif typedef struct ivas_hrtfs_statistics_struct { diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index cef7480443..a6ddac23a9 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -9167,11 +9167,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( ) { DIRAC_DEC_BIN_HANDLE hDiracDecBin; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF HRTFS_PARAMBIN_HANDLE *phHrtfParambin; -#else - HRTFS_PARAMBIN_HANDLE hHrtfParambin; -#endif int16_t nBins; int32_t output_Fs; RENDERER_TYPE renderer_type; @@ -9185,11 +9181,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( error = IVAS_ERR_OK; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF phHrtfParambin = inputMasa->hMasaExtRend->hHrtfParambin; -#else - hHrtfParambin = *( inputMasa->hMasaExtRend->hHrtfParambin ); -#endif /* Set common variables and defaults */ output_Fs = *( inputMasa->base.ctx.pOutSampleRate ); @@ -9259,11 +9251,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( } else if ( renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) /* Indication of binaural rendering with room effect */ { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#else - mvr2r( hHrtfParambin->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT if ( hDiracDecBin->hReverb == NULL && pos_idx == 0 ) /* open reverb only for the main direction */ @@ -9271,11 +9259,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( if ( hDiracDecBin->hReverb == NULL ) #endif { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, hHrtfParambin->parametricReverberationTimes, hHrtfParambin->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -9316,9 +9300,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( /* External renderer uses constant regularization factor */ hDiracDecBin->reqularizationFactor = 0.4f; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF hDiracDecBin->phHrtfParambin = phHrtfParambin; -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT inputMasa->hMasaExtRend->hDiracDecBin[pos_idx] = hDiracDecBin; -- GitLab From 9ea4cb60830d03d232afa7e78d9e29d17db6229f Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 11:01:21 +0100 Subject: [PATCH 15/16] [cleanup] accept NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE --- lib_com/options.h | 1 - lib_dec/ivas_mct_dec.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 59c66a6a6b..2f26539d5c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE /* FhG: issue #1005: fix TC Buffer update at a MC rate switch */ #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 */ diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index bfa2a6ad07..1df83b0ce5 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -774,10 +774,8 @@ static ivas_error ivas_mc_dec_reconfig( ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->intern_config ); /* transfer subframe info from DirAC or ParamMC to central tc buffer */ -#ifdef NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE if ( st_ivas->hTcBuffer->tc_buffer_mode != TC_BUFFER_MODE_BUFFER ) { -#endif if ( last_mc_mode == MC_MODE_PARAMMC ) { st_ivas->hTcBuffer->nb_subframes = st_ivas->hParamMC->nb_subframes; @@ -794,9 +792,7 @@ static ivas_error ivas_mc_dec_reconfig( st_ivas->hTcBuffer->slots_rendered = st_ivas->hSpatParamRendCom->slots_rendered; mvs2s( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); } -#ifdef NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE } -#endif /* JBM: when granularity goes down (e.g. MCT with CREND -> ParamMC with binaural fastconv render what still fits in the new granularity */ -- GitLab From 2cc5e4f83d8cb896cecde44badee6a806b5b6a4e Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 28 Feb 2024 11:05:52 +0100 Subject: [PATCH 16/16] formatting --- lib_com/ari_hm.c | 2 +- lib_com/ivas_mc_param_com.c | 3 +-- lib_com/prot.h | 2 +- lib_rend/ivas_dirac_dec_binaural_functions.c | 8 +++----- lib_rend/ivas_rotation.c | 2 +- lib_util/masa_file_writer.c | 7 +++---- lib_util/masa_file_writer.h | 2 +- 7 files changed, 11 insertions(+), 15 deletions(-) diff --git a/lib_com/ari_hm.c b/lib_com/ari_hm.c index b0d65b4404..d3c78833c6 100644 --- a/lib_com/ari_hm.c +++ b/lib_com/ari_hm.c @@ -205,7 +205,7 @@ int16_t CountIndexBits( *-------------------------------------------------------------------*/ int16_t tcx_hm_render( - const int32_t lag, /* i : pitch lag */ + const int32_t lag, /* i : pitch lag */ const int16_t fract_res, /* i : fractional resolution of the lag */ Word16 p[] /* o : harmonic model (Q13) */ ) diff --git a/lib_com/ivas_mc_param_com.c b/lib_com/ivas_mc_param_com.c index b080263506..e44e51a8be 100644 --- a/lib_com/ivas_mc_param_com.c +++ b/lib_com/ivas_mc_param_com.c @@ -86,7 +86,7 @@ uint16_t ivas_param_mc_get_configuration_index( *------------------------------------------------------------------------*/ void ivas_param_mc_metadata_open( - const MC_LS_SETUP mc_ls_setup, /* i : MC ls setup */ + const MC_LS_SETUP mc_ls_setup, /* i : MC ls setup */ const int32_t ivas_total_brate, /* i : IVAS total bitrate */ HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* o : handle for the Parametric MC parameter coding state */ ) @@ -208,7 +208,6 @@ int16_t ivas_param_mc_getNumTransportChannels( } - /*------------------------------------------------------------------------- * ivas_param_mc_get_num_param_bands() * diff --git a/lib_com/prot.h b/lib_com/prot.h index 9a88ea6d19..87f01a9161 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -7830,7 +7830,7 @@ int16_t DecodeIndex( #define GET_ADJ2( T, L, F ) ( ( ( L ) << ( F ) ) - ( T ) ) int16_t tcx_hm_render( - const int32_t lag, /* i : pitch lag */ + const int32_t lag, /* i : pitch lag */ const int16_t fract_res, /* i : fractional resolution of the lag */ Word16 p[] /* o : harmonic model (Q13) */ ); diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index f318efbf53..33a33cdcf3 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -140,7 +140,7 @@ static void ivas_masa_ext_rend_parambin_internal( MASA_EXT_REND_HANDLE hMasaExtR *------------------------------------------------------------------------*/ ivas_error ivas_dirac_dec_init_binaural_data( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ HRTFS_PARAMBIN_HANDLE *phHrtfParambin /* i : HRTF structure for rendering */ ) { @@ -2947,8 +2947,7 @@ static void getDirectPartGains( float Rmat[3][3], PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t isHeadtracked, - HRTFS_PARAMBIN_HANDLE hHrtfParambin -) + HRTFS_PARAMBIN_HANDLE hHrtfParambin ) { float aziRad, eleRad; float y, mappedX, aziRadMapped, A, A2, A3; @@ -3021,8 +3020,7 @@ static void hrtfShGetHrtf( float *rImagp, PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t useCachedValue, - HRTFS_PARAMBIN_HANDLE hHrtfParambin -) + HRTFS_PARAMBIN_HANDLE hHrtfParambin ) { int16_t k; float( *hrtfShCoeffsReInt )[16][60]; diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 48c52995cb..adf6bec226 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -898,7 +898,7 @@ ivas_error ivas_combined_orientation_open( ( *hCombinedOrientationData )->num_subframes = num_subframes; ( *hCombinedOrientationData )->interpolationCoefficient = 1.0f; ( *hCombinedOrientationData )->interpolationIncrement = 1.0f; - ( *hCombinedOrientationData )->maximumFramesToTargetOrientation = 500; + ( *hCombinedOrientationData )->maximumFramesToTargetOrientation = 500; ( *hCombinedOrientationData )->lrSwitchedNext = 0; ( *hCombinedOrientationData )->lrSwitchedCurrent = 0; ( *hCombinedOrientationData )->lrSwitchInterpVal = 0.0f; diff --git a/lib_util/masa_file_writer.c b/lib_util/masa_file_writer.c index 12bcd65b19..73ce19d593 100644 --- a/lib_util/masa_file_writer.c +++ b/lib_util/masa_file_writer.c @@ -88,9 +88,8 @@ static void getExtMasaMetadataFileName( static void delayMasaMetadata( MASA_DECODER_EXT_OUT_META_HANDLE extOutMeta, /* i/o: New input metadata which is inplace replaced with delayed metadata frame */ - MASA_META_DELAY_STORAGE *delayStorage, /* i/o: Storage for 15 ms of metadata and related descriptive metadata */ - uint8_t delayNsf -) + MASA_META_DELAY_STORAGE *delayStorage, /* i/o: Storage for 15 ms of metadata and related descriptive metadata */ + uint8_t delayNsf ) { int16_t dir, sf, band; uint8_t currentNumberOfDirections; @@ -237,7 +236,7 @@ ivas_error MasaFileWriter_open( *---------------------------------------------------------------------*/ ivas_error MasaFileWriter_writeFrame( - MasaFileWriter *self, /* i/o: MasaFileWriter handle */ + MasaFileWriter *self, /* i/o: MasaFileWriter handle */ MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta, /* i/o: MASA ext out meta handle to be written */ const float *decDelay /* i : decoding audio delay */ ) diff --git a/lib_util/masa_file_writer.h b/lib_util/masa_file_writer.h index c6caf0a3f9..3644881f35 100644 --- a/lib_util/masa_file_writer.h +++ b/lib_util/masa_file_writer.h @@ -48,7 +48,7 @@ ivas_error MasaFileWriter_open( ); ivas_error MasaFileWriter_writeFrame( - MasaFileWriter *self, /* i/o: MasaFileWriter handle */ + MasaFileWriter *self, /* i/o: MasaFileWriter handle */ IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta, /* i/o: MASA ext out meta handle to be written */ const float *decDelay /* i : decoding audio delay */ ); -- GitLab