From c55aeb0cef6428eb63e7c200aff94a81ff12a88c Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 21 Oct 2025 15:05:24 +0200 Subject: [PATCH 01/15] [cleanup] accept FIX_1129_EXT_REND_OUTPUT_HIGH --- lib_com/options.h | 1 - lib_rend/lib_rend_fx.c | 13 ------------- 2 files changed, 14 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a6ba3a9cf..69810798c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -89,7 +89,6 @@ /* #################### Start BASOP porting switches ############################ */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ -#define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1302_FIX_OMASA_JBM_FLUSH /* VA: issue 1302: fix OMASA JBM bitrate switching flush in binaural output */ #define NONBE_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0, float issue 1328 */ #define FIX_1319_STACK_SBA_DECODER /* VA: issue 1319: Optimize the definition of buffer lengths in the SBA decoder */ diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index 42ac97bd5..5140a9478 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -2988,9 +2988,7 @@ static ivas_error updateSbaPanGains( break; } case IVAS_AUDIO_CONFIG_BINAURAL: -#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: -#endif { IF( EQ_32( hRendCfg->split_rend_config.rendererSelection, IVAS_BIN_RENDERER_TYPE_FASTCONV ) ) { @@ -3009,9 +3007,6 @@ static ivas_error updateSbaPanGains( } BREAK; case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: -#ifndef FIX_1129_EXT_REND_OUTPUT_HIGH - case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: -#endif IF( NE_32( ( error = initSbaPanGainsForMcOut( inputSba, IVAS_AUDIO_CONFIG_7_1_4, NULL ) ), IVAS_ERR_OK ) ) { return error; @@ -8009,19 +8004,11 @@ static ivas_error renderInputSba( case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: error = renderSbaToSplitBinaural( sbaInput, outConfig, outAudio ); break; -#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH case IVAS_AUDIO_CONFIG_BINAURAL: case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: error = renderSbaToBinaural( sbaInput, outConfig, outAudio ); break; case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: -#else - case IVAS_AUDIO_CONFIG_BINAURAL: - error = renderSbaToBinaural( sbaInput, outConfig, outAudio ); - BREAK; - case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: - case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: -#endif error = renderSbaToBinauralRoom( sbaInput, outConfig, outAudio ); BREAK; default: -- GitLab From ea56adec0b05e91f522d21f8ccf2702349aa25a1 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 21 Oct 2025 15:05:29 +0200 Subject: [PATCH 02/15] [cleanup] accept NONBE_FIX_1143_MASA_BRSW --- lib_com/options.h | 1 - lib_dec/ivas_masa_dec_fx.c | 5 ----- 2 files changed, 6 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 69810798c..6350623ec 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -94,7 +94,6 @@ #define FIX_1319_STACK_SBA_DECODER /* VA: issue 1319: Optimize the definition of buffer lengths in the SBA decoder */ #define FIX_1320_STACK_CPE_DECODER /* VA: issue 1320: Optimize the stack memory consumption in the CPE decoder */ #define NONBE_FIX_1261_MASA_EXT_META_JBM /* Nokia: issue #1261: MASA metadata EXT output delay buffer init in JBM */ -#define NONBE_FIX_1143_MASA_BRSW /* Nok: Fix for issue 1143: MSAN use of uninitialized value in masa decoding to binaural with dtx bitrate switching and 5 % FER */ #define NONBE_FIX_1220_OMASA_JBM_EXT_USAN /* Nokia: fix issue 1220 OMASA EXT JBM USAN, also fix similar cases of free to avoid future problems */ #define NONBE_FIX_1376_MDCT_CONCEALMENT /* FhG: fix concealment artifact in MDCT Stereo with DTX, in case transition frame gets lost */ #define NONBE_1377_REND_DIRATT_CONF /* Eri: Issue 1377: Error in directivity attenuation configuration for both IVAS_dec and IVAS_rend */ diff --git a/lib_dec/ivas_masa_dec_fx.c b/lib_dec/ivas_masa_dec_fx.c index 1938761f2..0e05f8821 100644 --- a/lib_dec/ivas_masa_dec_fx.c +++ b/lib_dec/ivas_masa_dec_fx.c @@ -1860,16 +1860,11 @@ ivas_error ivas_masa_dec_reconfigure_fx( test(); test(); test(); -#ifdef NONBE_FIX_1143_MASA_BRSW test(); test(); IF( ( LT_32( ivas_total_brate, MASA_STEREO_MIN_BITRATE ) && GE_32( last_ivas_total_brate, MASA_STEREO_MIN_BITRATE ) ) || ( LT_32( ivas_total_brate, MASA_STEREO_MIN_BITRATE ) && EQ_32( last_ivas_total_brate, FRAME_NO_DATA ) ) || ( LT_32( ivas_total_brate, MASA_STEREO_MIN_BITRATE ) && EQ_32( last_ivas_total_brate, IVAS_SID_5k2 ) ) ) -#else - IF( ( LT_32( ivas_total_brate, MASA_STEREO_MIN_BITRATE ) && GE_32( last_ivas_total_brate, MASA_STEREO_MIN_BITRATE ) ) || - ( LT_32( ivas_total_brate, MASA_STEREO_MIN_BITRATE ) && EQ_32( last_ivas_total_brate, FRAME_NO_DATA ) ) ) -#endif { st_ivas->hCPE[cpe_id]->nchan_out = 1; move16(); -- GitLab From 7a1f273b9f721700c6a0f366f0431ef9a68400c8 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 21 Oct 2025 15:05:52 +0200 Subject: [PATCH 03/15] [cleanup] accept FIX_1166_TDREND_DIV0 --- lib_com/options.h | 1 - lib_rend/ivas_objectRenderer_hrFilt_fx.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6350623ec..75065fd84 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -101,7 +101,6 @@ #define FIX_1053_REVERB_RECONFIGURATION #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ #define FIX_1113_EXTREND_ISAR /* FhG: issue 1113: fix external renderer asserts for FOA/HOA2 and CLDFB config */ -#define FIX_1166_TDREND_DIV0 /* FhG,Eri: issue 1166: potential divide by zero in TD Renderer */ #define NONBE_1203_MDCT2DFT_SWITCHING /* VA: issue 1203: fix severe artifacts during MDCT to DFT stereo switching when MDCT ITD is not used */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ #define FIX_938_COMPILER_WARNING /* FhG: Fix compiler warning in ivas_mdct_core_reconstruct() */ diff --git a/lib_rend/ivas_objectRenderer_hrFilt_fx.c b/lib_rend/ivas_objectRenderer_hrFilt_fx.c index a162ec4c9..2a67d7a39 100644 --- a/lib_rend/ivas_objectRenderer_hrFilt_fx.c +++ b/lib_rend/ivas_objectRenderer_hrFilt_fx.c @@ -328,17 +328,13 @@ static void GenerateFilter_fx( ESynL_e = sub( ESynL_e, 32 ); ESynL = W_shl_sat_l( temp1, ESynL_e ); ESynL_e = sub( BMEnergiesL_e, ESynL_e ); -#ifdef FIX_1166_TDREND_DIV0 ESynL = BASOP_Util_Add_Mant32Exp( ESynL, ESynL_e, EPSILON_FX_M, EPSILON_FX_E, &ESynL_e ); -#endif ESynR_e = W_norm( temp2 ); ESynR_e = sub( ESynR_e, 32 ); ESynR = W_shl_sat_l( temp2, ESynR_e ); ESynR_e = sub( BMEnergiesR_e, ESynR_e ); -#ifdef FIX_1166_TDREND_DIV0 ESynR = BASOP_Util_Add_Mant32Exp( ESynR, ESynR_e, EPSILON_FX_M, EPSILON_FX_E, &ESynR_e ); -#endif tmp32 = L_deposit_h( BASOP_Util_Divide3232_Scale( ETotL, ESynL, &ScaleL_e ) ); -- GitLab From 06f91d3cad1a70e743235587fbe97bc652b7f7d2 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 21 Oct 2025 15:06:06 +0200 Subject: [PATCH 04/15] [cleanup] accept NONBE_FIX_1220_OMASA_JBM_EXT_USAN --- lib_com/options.h | 1 - lib_dec/ivas_masa_dec_fx.c | 20 -------------------- lib_dec/ivas_mct_dec_fx.c | 21 --------------------- 3 files changed, 42 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 75065fd84..34bdb2559 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -94,7 +94,6 @@ #define FIX_1319_STACK_SBA_DECODER /* VA: issue 1319: Optimize the definition of buffer lengths in the SBA decoder */ #define FIX_1320_STACK_CPE_DECODER /* VA: issue 1320: Optimize the stack memory consumption in the CPE decoder */ #define NONBE_FIX_1261_MASA_EXT_META_JBM /* Nokia: issue #1261: MASA metadata EXT output delay buffer init in JBM */ -#define NONBE_FIX_1220_OMASA_JBM_EXT_USAN /* Nokia: fix issue 1220 OMASA EXT JBM USAN, also fix similar cases of free to avoid future problems */ #define NONBE_FIX_1376_MDCT_CONCEALMENT /* FhG: fix concealment artifact in MDCT Stereo with DTX, in case transition frame gets lost */ #define NONBE_1377_REND_DIRATT_CONF /* Eri: Issue 1377: Error in directivity attenuation configuration for both IVAS_dec and IVAS_rend */ #define FIX_1377_HANDLE_ERROR_CODE /* Eri: Add missing error code handling from IVAS_REND_SetObjectIDs */ diff --git a/lib_dec/ivas_masa_dec_fx.c b/lib_dec/ivas_masa_dec_fx.c index 0e05f8821..70b244a94 100644 --- a/lib_dec/ivas_masa_dec_fx.c +++ b/lib_dec/ivas_masa_dec_fx.c @@ -1711,13 +1711,9 @@ ivas_error ivas_masa_dec_reconfigure_fx( move32(); test(); -#ifdef NONBE_FIX_1220_OMASA_JBM_EXT_USAN test(); /* Copy state to TC buffer if granularity matches and we are not in OMASA EXT rendering mode */ IF( st_ivas->hSpatParamRendCom != NULL && EQ_16( st_ivas->hSpatParamRendCom->slot_size, st_ivas->hTcBuffer->n_samples_granularity ) && NE_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) -#else - IF( st_ivas->hSpatParamRendCom != NULL && EQ_16( st_ivas->hSpatParamRendCom->slot_size, st_ivas->hTcBuffer->n_samples_granularity ) ) -#endif { Copy( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); st_ivas->hTcBuffer->nb_subframes = st_ivas->hSpatParamRendCom->nb_subframes; @@ -1737,9 +1733,7 @@ ivas_error ivas_masa_dec_reconfigure_fx( test(); test(); test(); -#ifdef NONBE_FIX_1220_OMASA_JBM_EXT_USAN test(); -#endif IF( ( EQ_32( st_ivas->renderer_type, RENDERER_DIRAC ) && st_ivas->hDirACRend == NULL ) || ( ( EQ_32( st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) && st_ivas->hDiracDecBin[0] == NULL ) ) { @@ -1749,7 +1743,6 @@ ivas_error ivas_masa_dec_reconfigure_fx( return error; } } -#ifdef NONBE_FIX_1220_OMASA_JBM_EXT_USAN ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_DISABLE ) || EQ_32( st_ivas->renderer_type, RENDERER_MONO_DOWNMIX ) || EQ_32( st_ivas->renderer_type, RENDERER_OMASA_MIX_EXT ) ) { /* close all unnecessary parametric decoding and rendering */ @@ -1758,19 +1751,6 @@ ivas_error ivas_masa_dec_reconfigure_fx( ivas_spat_hSpatParamRendCom_close_fx( &( st_ivas->hSpatParamRendCom ) ); ivas_dirac_dec_close_fx( &( st_ivas->hDirAC ) ); } -#else - ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_DISABLE ) || EQ_32( st_ivas->renderer_type, RENDERER_MONO_DOWNMIX ) ) - { - IF( st_ivas->hDirAC != NULL ) - { - /* close all unnecessary parametric decoding and rendering */ - ivas_dirac_dec_close_binaural_data_fx( st_ivas->hDiracDecBin ); - ivas_dirac_rend_close_fx( &( st_ivas->hDirACRend ) ); - ivas_spat_hSpatParamRendCom_close_fx( &( st_ivas->hSpatParamRendCom ) ); - ivas_dirac_dec_close_fx( &( st_ivas->hDirAC ) ); - } - } -#endif /* possible reconfigure is done later */ /*-----------------------------------------------------------------* diff --git a/lib_dec/ivas_mct_dec_fx.c b/lib_dec/ivas_mct_dec_fx.c index 4571716d6..7069d7db4 100644 --- a/lib_dec/ivas_mct_dec_fx.c +++ b/lib_dec/ivas_mct_dec_fx.c @@ -1031,17 +1031,10 @@ static ivas_error ivas_mc_dec_reconfig_fx( ivas_masa_dec_close_fx( &( st_ivas->hMasa ) ); ivas_qmetadata_close_fx( &st_ivas->hQMetaData ); -#ifndef NONBE_FIX_1220_OMASA_JBM_EXT_USAN - IF( st_ivas->hDirAC != NULL ) - { -#endif ivas_dirac_rend_close_fx( &( st_ivas->hDirACRend ) ); ivas_spat_hSpatParamRendCom_close_fx( &( st_ivas->hSpatParamRendCom ) ); ivas_dirac_dec_close_fx( &( st_ivas->hDirAC ) ); vbap_free_data_fx( &( st_ivas->hVBAPdata ) ); -#ifndef NONBE_FIX_1220_OMASA_JBM_EXT_USAN - } -#endif /* init LS conversion if the renderer type asks for it */ test(); @@ -1121,17 +1114,10 @@ static ivas_error ivas_mc_dec_reconfig_fx( ivas_masa_dec_close_fx( &( st_ivas->hMasa ) ); ivas_qmetadata_close_fx( &st_ivas->hQMetaData ); -#ifndef NONBE_FIX_1220_OMASA_JBM_EXT_USAN - IF( st_ivas->hDirAC != NULL ) - { -#endif ivas_dirac_rend_close_fx( &( st_ivas->hDirACRend ) ); ivas_spat_hSpatParamRendCom_close_fx( &( st_ivas->hSpatParamRendCom ) ); ivas_dirac_dec_close_fx( &( st_ivas->hDirAC ) ); vbap_free_data_fx( &( st_ivas->hVBAPdata ) ); -#ifndef NONBE_FIX_1220_OMASA_JBM_EXT_USAN - } -#endif IF( EQ_16( last_mc_mode, MC_MODE_MCT ) ) { @@ -1333,9 +1319,6 @@ static ivas_error ivas_mc_dec_reconfig_fx( IF( EQ_16( st_ivas->mc_mode, MC_MODE_MCMASA ) ) { test(); -#ifndef NONBE_FIX_1220_OMASA_JBM_EXT_USAN - test(); -#endif IF( ( NE_16( st_ivas->renderer_type, RENDERER_DISABLE ) ) && ( NE_16( st_ivas->renderer_type, RENDERER_MCMASA_MONO_STEREO ) ) ) { IF( st_ivas->hDirAC != NULL ) @@ -1355,11 +1338,7 @@ static ivas_error ivas_mc_dec_reconfig_fx( } } } -#ifdef NONBE_FIX_1220_OMASA_JBM_EXT_USAN ELSE IF( EQ_16( st_ivas->renderer_type, RENDERER_DISABLE ) ) -#else - ELSE IF( EQ_16( st_ivas->renderer_type, RENDERER_DISABLE ) && st_ivas->hDirAC != NULL ) -#endif { ivas_dirac_rend_close_fx( &( st_ivas->hDirACRend ) ); ivas_spat_hSpatParamRendCom_close_fx( &( st_ivas->hSpatParamRendCom ) ); -- GitLab From 553c0875e1d5de9941e73e590177d08ac2f72fd3 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 21 Oct 2025 15:06:20 +0200 Subject: [PATCH 05/15] [cleanup] accept OBJ_EDITING_INTERFACE --- lib_com/options.h | 1 - lib_rend/ivas_objectRenderer_fx.c | 4 ---- lib_rend/ivas_objectRenderer_sources_fx.c | 6 ------ lib_rend/ivas_prot_rend_fx.h | 2 -- 4 files changed, 13 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 34bdb2559..416ff1acc 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -120,7 +120,6 @@ #define LIB_DEC_REVISION /* VA: cleaning and simplification of lib_dec.c */ // object-editing feature porting -#define OBJ_EDITING_INTERFACE /* Interface for object editing */ #define OBJ_EDITING_API /* object editing changes related to the API */ #ifdef OBJ_EDITING_API #define TMP_FIX_SPLIT_REND // temporary fix to split-rendering (it follows the later state of the framework but it is needed now because of current test-conditions) diff --git a/lib_rend/ivas_objectRenderer_fx.c b/lib_rend/ivas_objectRenderer_fx.c index 2f950061a..937765171 100644 --- a/lib_rend/ivas_objectRenderer_fx.c +++ b/lib_rend/ivas_objectRenderer_fx.c @@ -677,12 +677,10 @@ ivas_error TDREND_Update_object_positions_fx( return error; } #endif -#ifdef OBJ_EDITING_INTERFACE if ( ( error = TDREND_MIX_SRC_SetGain( hBinRendererTd, nS, hIsmMetaData[nS]->gain_fx ) ) != IVAS_ERR_OK ) // TODO: Check Gain has correct Q-value { return error; } -#endif IF( hIsmMetaData[nS]->non_diegetic_flag ) { @@ -989,9 +987,7 @@ ivas_error ivas_td_binaural_renderer_ext_fx( move32(); hIsmMetaData[0]->radius_fx = currentPos->radius_fx; move32(); -#ifdef OBJ_EDITING_INTERFACE hIsmMetaData[0]->gain_fx = ONE_IN_Q29; // TODO: check Q value -#endif hIsmMetaData[0]->non_diegetic_flag = currentPos->non_diegetic_flag; move16(); } diff --git a/lib_rend/ivas_objectRenderer_sources_fx.c b/lib_rend/ivas_objectRenderer_sources_fx.c index bc4f76f19..45f649783 100644 --- a/lib_rend/ivas_objectRenderer_sources_fx.c +++ b/lib_rend/ivas_objectRenderer_sources_fx.c @@ -49,9 +49,7 @@ static Word16 TDREND_SRC_SPATIAL_GetDirGain_fx( const TDREND_DirAtten_t *DirAtte static Word16 TDREND_SRC_SPATIAL_GetDistGain_fx( const TDREND_DistAtten_t *DistAtten_p, const Word32 Dist_fx, const Word16 Dist_e ); static void TDREND_SRC_SPATIAL_SetDirAtten_fx( TDREND_SRC_SPATIAL_t *SrcSpatial_p, const TDREND_DirAtten_t *DirAtten_p ); static void TDREND_SRC_SPATIAL_SetDistAtten( TDREND_SRC_SPATIAL_t *SrcSpatial_p, const TDREND_DistAtten_t *DistAtten_p ); -#ifdef OBJ_EDITING_INTERFACE static void TDREND_SRC_SPATIAL_SetGain( const TDREND_SRC_t *Src_p, const Word32 Gain ); -#endif static ivas_error TDREND_SRC_REND_Alloc( TDREND_SRC_REND_t **SrcRend_pp ); static void TDREND_SRC_SPATIAL_Dealloc( TDREND_SRC_SPATIAL_t *SrcSpatial_p ); @@ -132,7 +130,6 @@ ivas_error TDREND_MIX_SRC_SetDir_fx( return IVAS_ERR_OK; } -#ifdef OBJ_EDITING_INTERFACE /*-------------------------------------------------------------------* * TDREND_MIX_SRC_SetGain() @@ -151,7 +148,6 @@ ivas_error TDREND_MIX_SRC_SetGain( return IVAS_ERR_OK; } -#endif /*-------------------------------------------------------------------* * TDREND_MIX_SRC_SetDirAtten() @@ -694,7 +690,6 @@ static void TDREND_SRC_SPATIAL_SetDistAtten( return; } -#ifdef OBJ_EDITING_INTERFACE /*-------------------------------------------------------------------* * TDREND_SRC_SPATIAL_SetGain() * @@ -710,7 +705,6 @@ static void TDREND_SRC_SPATIAL_SetGain( return; } -#endif /*-------------------------------------------------------------------* * TDREND_SRC_SPATIAL_GetDirGain() diff --git a/lib_rend/ivas_prot_rend_fx.h b/lib_rend/ivas_prot_rend_fx.h index dc9a2e5b0..8bbb23b44 100644 --- a/lib_rend/ivas_prot_rend_fx.h +++ b/lib_rend/ivas_prot_rend_fx.h @@ -750,13 +750,11 @@ ivas_error TDREND_MIX_SRC_SetDir_fx( const Word16 Vec_p_q /* i : Direction vector q */ ); -#ifdef OBJ_EDITING_INTERFACE ivas_error TDREND_MIX_SRC_SetGain( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ const Word16 SrcInd, const Word32 Gain /* i : Gain */ ); -#endif ivas_error TDREND_MIX_SRC_SetDirAtten_fx( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ -- GitLab From 909f5c332b86e46f02cd7e19cd947eee4e601635 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 21 Oct 2025 15:06:23 +0200 Subject: [PATCH 06/15] [cleanup] accept OBJ_EDITING_API --- apps/decoder.c | 14 - lib_com/common_api_types.h | 4 - lib_com/ivas_error.h | 4 - lib_com/ivas_ism_com_fx.c | 2 - lib_com/ivas_prot_fx.h | 17 -- lib_com/ivas_stat_com.h | 2 - lib_com/options.h | 3 - lib_dec/ivas_dirac_dec_fx.c | 2 - lib_dec/ivas_ism_param_dec_fx.c | 236 ---------------- lib_dec/ivas_ism_renderer_fx.c | 10 - lib_dec/ivas_jbm_dec_fx.c | 313 ---------------------- lib_dec/ivas_mc_param_dec_fx.c | 291 -------------------- lib_dec/ivas_objectRenderer_internal_fx.c | 2 - lib_dec/ivas_osba_dec_fx.c | 28 -- lib_dec/ivas_stat_dec.h | 6 - lib_dec/lib_dec.h | 4 - lib_dec/lib_dec_fx.c | 153 ----------- lib_rend/ivas_objectRenderer_fx.c | 2 - lib_rend/ivas_objectRenderer_sources_fx.c | 4 - lib_rend/ivas_prot_rend_fx.h | 2 - 20 files changed, 1099 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 6b53e2c65..8e3b166dd 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -2266,7 +2266,6 @@ static ivas_error decodeG192( return error; } -#ifdef OBJ_EDITING_API /* Object metadata editing */ if ( arg.objEditEnabled ) { @@ -2351,7 +2350,6 @@ static ivas_error decodeG192( fprintf( stderr, "\nError: could not prepare the renderer: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#endif } if ( isSplitRend ) @@ -2806,9 +2804,7 @@ static ivas_error decodeVoIP( int16_t vec_pos_update, vec_pos_len; int16_t nOutSamples = 0; bool bitstreamReadDone = false; -#ifdef OBJ_EDITING_API bool parametersAvailableForEditing = false; -#endif uint16_t nSamplesRendered; vec_pos_update = 0; @@ -3109,17 +3105,9 @@ static ivas_error decodeVoIP( while ( nSamplesRendered < nOutSamples ) { #ifdef SUPPORT_JBM_TRACEFILE -#ifdef OBJ_EDITING_API if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, ¶metersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) #else - if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, systemTime_ms ) ) != IVAS_ERR_OK ) -#endif -#else -#ifdef OBJ_EDITING_API if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, (void *) pcmBuf, &bitstreamReadDone, ¶metersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, (void *) pcmBuf, &bitstreamReadDone, systemTime_ms ) ) != IVAS_ERR_OK ) -#endif #endif { fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -3150,7 +3138,6 @@ static ivas_error decodeVoIP( } } -#ifdef OBJ_EDITING_API /* Object metadata editing */ if ( arg.objEditEnabled && parametersAvailableForEditing == true ) { @@ -3179,7 +3166,6 @@ static ivas_error decodeVoIP( return error; } } -#endif } /* while ( nSamplesRendered < nOutSamples ) */ /* write JBM Offset file entry */ diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index a37a58460..fcdaae90a 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -141,13 +141,10 @@ typedef struct _IVAS_ISM_METADATA float yaw; float pitch; Word16 non_diegetic_flag; -#ifdef OBJ_EDITING_API Word32 gain_fx; /* Q29 */ -#endif } IVAS_ISM_METADATA; -#ifdef OBJ_EDITING_API typedef struct _IVAS_EDITABLE_PARAMETERS { Word16 num_obj; @@ -155,7 +152,6 @@ typedef struct _IVAS_EDITABLE_PARAMETERS Word32 gain_bed_fx; /* Q29 */ } IVAS_EDITABLE_PARAMETERS; -#endif typedef struct { diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index d94bb0f53..035819c28 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -77,9 +77,7 @@ typedef enum IVAS_ERR_EXT_ORIENTATION_NOT_SUPPORTED, IVAS_ERR_DIRECTIVITY_NOT_SUPPORTED, IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED, -#ifdef OBJ_EDITING_API IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED, -#endif #ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE IVAS_ERR_OBJECTS_EDITING_AND_PANNING_NOT_SUPPORTED, #endif @@ -255,10 +253,8 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) return "Directivity not supported"; case IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED: return "Acoustic environment not supported"; -#ifdef OBJ_EDITING_API case IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED: return "Objects editing not supported"; -#endif #ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE case IVAS_ERR_OBJECTS_EDITING_AND_PANNING_NOT_SUPPORTED: return "Wrong use of both Object editing and Non-diegetic panning"; diff --git a/lib_com/ivas_ism_com_fx.c b/lib_com/ivas_ism_com_fx.c index 385e680bb..ea276c944 100644 --- a/lib_com/ivas_ism_com_fx.c +++ b/lib_com/ivas_ism_com_fx.c @@ -470,7 +470,6 @@ void ivas_ism_reset_metadata( hIsmMeta->non_diegetic_flag = 0; move16(); -#ifdef OBJ_EDITING_API hIsmMeta->edited_gain_fx = ONE_IN_Q29; move32(); hIsmMeta->edited_azimuth_fx = 0; @@ -487,7 +486,6 @@ void ivas_ism_reset_metadata( move32(); hIsmMeta->non_diegetic_flag = 0; move16(); -#endif return; } diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index dce0bac13..690dd7cb9 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -3924,7 +3924,6 @@ ivas_error ivas_osba_render_sf_fx( Word32 *p_output[] /* o : rendered time signal */ ); -#ifdef OBJ_EDITING_API void ivas_osba_stereo_add_channels_fx( Word32 *tc_fx[], /* i : transport channels */ Word32 *output_fx[], /* i/o: output channels */ @@ -3934,16 +3933,6 @@ void ivas_osba_stereo_add_channels_fx( const Word16 ism_mode, /* i : ISM mode */ const UWord16 n_samples_to_render /* i : output frame length per channel */ ); -#else -void ivas_osba_stereo_add_channels_fx( - Word32 *tc_fx[], /* i : transport channels */ - Word32 *output_fx[], /* i/o: output channels */ - const Word16 gain, /* i : gain bed value Q11 */ - const Word16 nchan_out, /* i : number of output channels */ - const Word16 nchan_ism, /* i : number of ISM channels */ - const UWord16 n_samples_to_render /* i : output frame length per channel */ -); -#endif void ivas_osba_data_close_fx( SBA_ISM_DATA_HANDLE *hSbaIsmData /* i/o: OSBA rendering handle */ @@ -4259,11 +4248,9 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( Word32 *data /* i/o: transport channels/output synthesis signal */ ); -#ifdef OBJ_EDITING_API void ivas_dec_prepare_renderer_fx( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); -#endif void ivas_jbm_dec_get_adapted_subframes( const Word16 nCldfbTs, /* i : number of time slots in the current frame */ @@ -4358,7 +4345,6 @@ void ivas_param_ism_dec_digest_tc_fx( ); -#ifdef OBJ_EDITING_API void ivas_param_ism_dec_dequant_md_fx( Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ ); @@ -4367,7 +4353,6 @@ void ivas_param_ism_dec_prepare_renderer_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const Word16 nCldfbSlots /* i : number of CLDFB slots in transport channels */ ); -#endif void ivas_param_ism_dec_render_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ @@ -5167,12 +5152,10 @@ void ivas_param_mc_dec_digest_tc_fx( const Word16 transport_f_e ); -#ifdef OBJ_EDITING_API void ivas_param_mc_dec_prepare_renderer( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const UWord8 nCldfbSlots /* i : number of CLFBS slots in the transport channels */ ); -#endif void ivas_param_mc_dec_render_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index db2c6ca69..4678acd31 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -65,7 +65,6 @@ typedef struct Word32 yaw_fx; /* yaw value read from the input metadata file */ /* Q22 */ Word32 pitch_fx; /* pitch value read from the input metadata file */ /* Q22 */ -#ifdef OBJ_EDITING_API Word32 gain_fx; /* Q29 */ Word32 edited_azimuth_fx; /* Q22 */ @@ -75,7 +74,6 @@ typedef struct Word32 edited_yaw_fx; /* Q22 */ Word32 edited_pitch_fx; /* Q22 */ Word32 edited_gain_fx; /* Q29 */ -#endif Word16 non_diegetic_flag; /* Non-diegetic (non-headtracked) object flag */ diff --git a/lib_com/options.h b/lib_com/options.h index 416ff1acc..ce7538a64 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -120,8 +120,6 @@ #define LIB_DEC_REVISION /* VA: cleaning and simplification of lib_dec.c */ // object-editing feature porting -#define OBJ_EDITING_API /* object editing changes related to the API */ -#ifdef OBJ_EDITING_API #define TMP_FIX_SPLIT_REND // temporary fix to split-rendering (it follows the later state of the framework but it is needed now because of current test-conditions) #define TMP_FIX_OMASA_SR_BE // temporary fix to keep OMASA split-rendering BE #define OBJ_EDITING_COMMANDLINE /* obj editing command-line option */ @@ -134,7 +132,6 @@ #define FIX_BRATE_SWITCHING /* VA: fix bitrate switching cases in OMASA and OSBA */ #define OBJ_EDIT_BASOP #define NONBE_1217_INIT_OBJ_EDIT /* VA: issue 1217: do object editing only when objects metadata is available */ -#endif #define FIX_1217_OBJECT_EDIT_FILE_INTERFACE /* Nokia: issue #1217: add decoder functionality to read object edit instructions from a file */ #define NONBE_1217_OBJ_EDIT_FOA /* VA/Nokia: isse 1217: fix crash in object editing to FOA output in ParamISM */ #define NONBE_FIX_1255_OBJ_EDIT_JBM /* VA: issue 1255: restore object editing in JBM */ diff --git a/lib_dec/ivas_dirac_dec_fx.c b/lib_dec/ivas_dirac_dec_fx.c index 1c20d23a8..dfb63376b 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -3777,14 +3777,12 @@ void ivas_dirac_dec_render_sf_fx( const Word32 azi_fx = L_shl( az1_32, Q22 - Q16 ); // Q16 -> Q22 const Word32 ele_fx = L_shl( el1_32, Q22 - Q16 ); // Q16 -> Q22 efap_determine_gains_fx( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains_fx[i], azi_fx, ele_fx, EFAP_MODE_EFAP ); -#ifdef OBJ_EDITING_API // TODO: Align Q-values IF( NE_32( st_ivas->hIsmMetaData[i]->edited_gain_fx, ONE_IN_Q29 ) ) { v_multc_fx( st_ivas->hIsmRendererData->gains_fx[i], st_ivas->hIsmMetaData[i]->edited_gain_fx, st_ivas->hIsmRendererData->gains_fx[i], nchan_out_woLFE ); // Q30, Q29 --> Q28 Scale_sig32( st_ivas->hIsmRendererData->gains_fx[i], nchan_out_woLFE, Q2 ); // Q28 --> Q30 } -#endif } } diff --git a/lib_dec/ivas_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index 50e2ee439..1ac19bd4d 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -993,7 +993,6 @@ void ivas_ism_dec_digest_tc_fx( IF( EQ_32( st_ivas->intern_config, IVAS_AUDIO_CONFIG_STEREO ) ) { -#ifdef OBJ_EDITING_API Word16 gains_fx[CPE_CHANNELS]; ivas_ism_get_stereo_gains_fx( (Word16) L_shr( st_ivas->hIsmMetaData[i]->azimuth_fx, 22 ), (Word16) L_shr( st_ivas->hIsmMetaData[i]->elevation_fx, 22 ), &gains_fx[0], &gains_fx[1] ); @@ -1009,25 +1008,12 @@ void ivas_ism_dec_digest_tc_fx( Scale_sig32( st_ivas->hIsmRendererData->gains_fx[i], CPE_CHANNELS, Q2 ); // Q28 --> Q30 } -#else - Word16 gains_fx[2]; - ivas_ism_get_stereo_gains_fx( (Word16) L_shr( st_ivas->hIsmMetaData[i]->azimuth_fx, 22 ), (Word16) L_shr( st_ivas->hIsmMetaData[i]->elevation_fx, 22 ), &gains_fx[0], &gains_fx[1] ); - st_ivas->hIsmRendererData->gains_fx[i][0] = L_shr( L_deposit_h( gains_fx[0] ), 1 ); // Q31 -> Q30 - move32(); - st_ivas->hIsmRendererData->gains_fx[i][1] = L_shr( L_deposit_h( gains_fx[1] ), 1 ); // Q31 -> Q30 - move32(); -#endif } ELSE { // TODO tmu review when #215 is resolved -#ifdef OBJ_EDITING_API azimuth_fx = L_shr( L_add( st_ivas->hIsmMetaData[i]->edited_azimuth_fx, 2097152 ), Q22 ); // Q0 ,2097152 = .5f in Q22 elevation_fx = L_shr( L_add( st_ivas->hIsmMetaData[i]->edited_elevation_fx, 2097152 ), Q22 ); // Q0 ,2097152 = .5f in Q22 -#else - azimuth_fx = L_shr( L_add( st_ivas->hIsmMetaData[i]->azimuth_fx, 2097152 ), Q22 ); // Q0 ,2097152 = .5f in Q22 - elevation_fx = L_shr( L_add( st_ivas->hIsmMetaData[i]->elevation_fx, 2097152 ), Q22 ); // Q0 ,2097152 = .5f in Q22 -#endif test(); test(); @@ -1056,14 +1042,12 @@ void ivas_ism_dec_digest_tc_fx( elevation_fx = L_shl( elevation_fx, Q22 ); // Q22 efap_determine_gains_fx( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains_fx[i], azimuth_fx, elevation_fx, EFAP_MODE_EFAP ); -#ifdef OBJ_EDITING_API // TODO: align Q values properly IF( NE_32( st_ivas->hIsmMetaData[i]->edited_gain_fx, ONE_IN_Q29 ) ) { v_multc_fx( st_ivas->hIsmRendererData->gains_fx[i], st_ivas->hIsmMetaData[i]->edited_gain_fx, st_ivas->hIsmRendererData->gains_fx[i], st_ivas->hEFAPdata->numSpk ); // Q30, Q29 --> Q28 Scale_sig32( st_ivas->hIsmRendererData->gains_fx[i], st_ivas->hEFAPdata->numSpk, Q2 ); // Q28 --> Q30 } -#endif } } ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_SBA_LINEAR_ENC ) || @@ -1076,14 +1060,12 @@ void ivas_ism_dec_digest_tc_fx( ivas_dirac_dec_get_response_fx( azi, ele, st_ivas->hIsmRendererData->gains_fx[i], st_ivas->hIntSetup.ambisonics_order, Q30 ); -#ifdef OBJ_EDITING_API // TODO: Align Q-values IF( NE_32( st_ivas->hIsmMetaData[i]->edited_gain_fx, ONE_IN_Q29 ) ) { v_multc_fx( st_ivas->hIsmRendererData->gains_fx[i], st_ivas->hIsmMetaData[i]->edited_gain_fx, st_ivas->hIsmRendererData->gains_fx[i], ivas_sba_get_nchan_fx( st_ivas->hIntSetup.ambisonics_order, 0 ) ); // Q30, Q29 --> Q28 Scale_sig32( st_ivas->hIsmRendererData->gains_fx[i], ivas_sba_get_nchan_fx( st_ivas->hIntSetup.ambisonics_order, 0 ), Q2 ); // Q28 --> 30 } -#endif } } } @@ -1109,36 +1091,18 @@ void ivas_param_ism_dec_digest_tc_fx( move16(); move16(); move16(); -#ifndef OBJ_EDITING_API - Word32 cx_diag_fx[CLDFB_NO_CHANNELS_MAX][PARAM_ISM_MAX_DMX]; - Word16 exp_cx_diag[CLDFB_NO_CHANNELS_MAX][PARAM_ISM_MAX_DMX]; - Word16 exp_real_tmp = 0, exp_imag_tmp = 0; -#endif Word16 q_tc = q_tc_in; move16(); -#ifndef OBJ_EDITING_API - Word16 ch, nchan_transport, nchan_out, nchan_out_woLFE, i; - Word16 slot_idx, bin_idx; - Word32 ivas_total_brate; -#else Word16 ch, nchan_transport, i; Word16 slot_idx; -#endif Word16 output_frame; -#ifndef OBJ_EDITING_API - /* Direct Response/EFAP Gains */ - Word32 direct_response_fx[MAX_NUM_OBJECTS][PARAM_ISM_MAX_CHAN]; -#endif PARAM_ISM_DEC_HANDLE hParamIsmDec; SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; Word16 fade_len; /* Initialization */ -#ifndef OBJ_EDITING_API - set32_fx( &direct_response_fx[0][0], 0, MAX_NUM_OBJECTS * PARAM_ISM_MAX_CHAN ); -#endif hParamIsmDec = st_ivas->hParamIsmDec; assert( hParamIsmDec ); hSpatParamRendCom = st_ivas->hSpatParamRendCom; @@ -1148,117 +1112,9 @@ void ivas_param_ism_dec_digest_tc_fx( nchan_transport = st_ivas->nchan_transport; move16(); -#ifndef OBJ_EDITING_API - ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; - move32(); - - hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc_exp = 25; - move16(); - hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc_exp = 25; - move16(); - IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - nchan_out = st_ivas->nchan_ism; - move16(); - nchan_out_woLFE = nchan_out; - move16(); - st_ivas->hDecoderConfig->nchan_out = nchan_out; - move16(); - } - ELSE - { - nchan_out = add( st_ivas->hIntSetup.nchan_out_woLFE, st_ivas->hIntSetup.num_lfe ); - nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; - move16(); - } -#endif push_wmops( "ivas_param_ism_dec" ); -#ifndef OBJ_EDITING_API - /* general setup */ - ivas_jbm_dec_get_adapted_linear_interpolator_fx( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbSlots, hParamIsmDec->hParamIsmRendering->interpolator_fx ); - - ivas_dirac_dec_set_md_map_fx( st_ivas, nCldfbSlots ); - /* set buffers to zero */ - - set_zero_fx( &cx_diag_fx[0][0], CLDFB_NO_CHANNELS_MAX * PARAM_ISM_MAX_DMX ); - set16_zero_fx( &exp_cx_diag[0][0], CLDFB_NO_CHANNELS_MAX * PARAM_ISM_MAX_DMX ); - - /* Frame-level Processing */ - /* De-quantization */ - test(); - IF( !( EQ_32( ivas_total_brate, IVAS_SID_5k2 ) || EQ_32( ivas_total_brate, FRAME_NO_DATA ) ) ) - { - ivas_param_ism_dec_dequant_DOA_fx( hParamIsmDec, st_ivas->nchan_ism ); - ivas_param_ism_dec_dequant_powrat_fx( hParamIsmDec ); - st_ivas->hISMDTX.dtx_flag = 0; - move16(); - } - ELSE - { - st_ivas->hISMDTX.dtx_flag = 1; - move16(); - } - - /* obtain the direct response using EFAP */ - IF( !( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) ) - { - FOR( i = 0; i < st_ivas->nchan_ism; i++ ) - { - efap_determine_gains_fx( st_ivas->hEFAPdata, direct_response_fx[i], hParamIsmDec->azimuth_values_fx[i], hParamIsmDec->elevation_values_fx[i], EFAP_MODE_EFAP ); - } - } - ELSE - { - Word16 j; - - FOR( i = 0; i < st_ivas->nchan_ism; i++ ) - { - FOR( j = 0; j < nchan_out_woLFE; j++ ) - { - IF( EQ_16( i, j ) ) - { - direct_response_fx[i][j] = ONE_IN_Q30; - move32(); - } - ELSE - { - direct_response_fx[i][j] = 0; - move32(); - } - } - } - - FOR( j = 0; j < nchan_out_woLFE; j++ ) - { - IF( hParamIsmDec->azimuth_values_fx[j] > 0 ) - { - hParamIsmDec->hParamIsmRendering->proto_matrix_fx[j] = 32767; // (1.0f in Q15) - 1 - move16(); - hParamIsmDec->hParamIsmRendering->proto_matrix_fx[nchan_out_woLFE + j] = 0; - move16(); - } - ELSE - { - IF( hParamIsmDec->azimuth_values_fx[j] < 0 ) - { - hParamIsmDec->hParamIsmRendering->proto_matrix_fx[j] = 0; - move16(); - hParamIsmDec->hParamIsmRendering->proto_matrix_fx[nchan_out_woLFE + j] = 32767; // (1.0f in Q15) - 1 - move16(); - } - ELSE /* == 0.0f */ - { - hParamIsmDec->hParamIsmRendering->proto_matrix_fx[j] = ONE_IN_Q14; // Q15 - move16(); - hParamIsmDec->hParamIsmRendering->proto_matrix_fx[nchan_out_woLFE + j] = ONE_IN_Q14; // Q15 - move16(); - } - } - } - } -#endif IF( st_ivas->hDecoderConfig->Opt_tsm ) { @@ -1296,54 +1152,14 @@ void ivas_param_ism_dec_digest_tc_fx( move16(); } -#ifndef OBJ_EDITING_API - Word16 scale_factor_real, scale_factor_imag; - Word16 current_idx; - exp_real_tmp = hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc_exp; - move16(); - exp_imag_tmp = hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc_exp; - move16(); - current_idx = add( imult1616( imult1616( slot_idx, hSpatParamRendCom->num_freq_bands ), nchan_transport ), imult1616( ch, hSpatParamRendCom->num_freq_bands ) ); - scale_factor_real = getScaleFactor32( &hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc_fx[current_idx], hSpatParamRendCom->num_freq_bands ); - scale_factor_imag = getScaleFactor32( &hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc_fx[current_idx], hSpatParamRendCom->num_freq_bands ); - scale_sig32( &hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc_fx[current_idx], hSpatParamRendCom->num_freq_bands, scale_factor_real ); // Q(31-(exp_real_tmp-scale_factor_real)) - scale_sig32( &hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc_fx[current_idx], hSpatParamRendCom->num_freq_bands, scale_factor_imag ); // Q(31-(exp_imag_tmp-scale_factor_imag)) - exp_real_tmp = sub( exp_real_tmp, scale_factor_real ); - exp_imag_tmp = sub( exp_imag_tmp, scale_factor_imag ); - ivas_param_ism_collect_slot_fx( hParamIsmDec, - &hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc_fx[current_idx], - exp_real_tmp, - &hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc_fx[current_idx], - exp_imag_tmp, - ch, - cx_diag_fx, exp_cx_diag ); - - exp_real_tmp = add( exp_real_tmp, scale_factor_real ); - exp_imag_tmp = add( exp_imag_tmp, scale_factor_imag ); - scale_sig32( &hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc_fx[current_idx], hSpatParamRendCom->num_freq_bands, -scale_factor_real ); // Q(31-(exp_real_tmp)) - scale_sig32( &hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc_fx[current_idx], hSpatParamRendCom->num_freq_bands, -scale_factor_imag ); // Q(31-(exp_imag_tmp)) -#endif } } -#ifndef OBJ_EDITING_API - /* Obtain Mixing Matrix on a frame-level */ - FOR( bin_idx = 0; bin_idx < CLDFB_NO_CHANNELS_MAX; bin_idx++ ) - { - set32_fx( hParamIsmDec->hParamIsmRendering->mixing_matrix_lin_fx[bin_idx], 0, PARAM_ISM_MAX_CHAN * PARAM_ISM_MAX_DMX ); - } - - /* Compute mixing matrix */ - ivas_param_ism_compute_mixing_matrix_fx( st_ivas->nchan_ism, hParamIsmDec, st_ivas->hISMDTX, direct_response_fx, nchan_transport, nchan_out_woLFE, cx_diag_fx, exp_cx_diag, - hParamIsmDec->hParamIsmRendering->mixing_matrix_lin_fx, hParamIsmDec->hParamIsmRendering->exp_mixing_matrix_lin_fx ); - -#endif pop_wmops(); return; } -#ifdef OBJ_EDITING_API /*-------------------------------------------------------------------------* * ivas_param_ism_dec_dequant_md() @@ -1562,7 +1378,6 @@ void ivas_param_ism_dec_prepare_renderer_fx( return; } -#endif /*-------------------------------------------------------------------------* * ivas_ism_param_dec_tc_gain_ajust() @@ -1967,7 +1782,6 @@ void ivas_param_ism_dec_render_fx( /* store MetaData parameters */ FOR( ch = 0; ch < st_ivas->nchan_ism; ch++ ) { -#ifdef OBJ_EDITING_API IF( GT_32( st_ivas->hParamIsmDec->azimuth_values_fx[ch], 754974720 ) /*180.f in Q22*/ ) { st_ivas->hIsmMetaData[ch]->azimuth_fx = L_sub( st_ivas->hParamIsmDec->edited_azimuth_values_fx[ch], 1509949440 ) /*360.0F in Q22*/; @@ -1980,18 +1794,6 @@ void ivas_param_ism_dec_render_fx( } st_ivas->hIsmMetaData[ch]->elevation_fx = st_ivas->hParamIsmDec->edited_elevation_values_fx[ch]; move32(); -#else - IF( GT_32( st_ivas->hParamIsmDec->azimuth_values_fx[ch], 754974720 ) /*180.f in Q22*/ ) - { - st_ivas->hIsmMetaData[ch]->azimuth_fx = L_sub( st_ivas->hParamIsmDec->azimuth_values_fx[ch], 1509949440 ) /*360.0F in Q22*/; - move32(); - } - ELSE - { - st_ivas->hIsmMetaData[ch]->azimuth_fx = st_ivas->hParamIsmDec->azimuth_values_fx[ch]; - move32(); - } -#endif st_ivas->hIsmMetaData[ch]->elevation_fx = st_ivas->hParamIsmDec->elevation_values_fx[ch]; move32(); @@ -2027,9 +1829,6 @@ void ivas_param_ism_params_to_masa_param_mapping_fx( Word16 obj; Word16 obj_idx; #endif -#ifndef OBJ_EDITING_API - Word32 ivas_total_brate; -#endif hParamIsmDec = st_ivas->hParamIsmDec; move16(); @@ -2040,24 +1839,6 @@ void ivas_param_ism_params_to_masa_param_mapping_fx( #endif nBins = hSpatParamRendCom->num_freq_bands; move16(); -#ifndef OBJ_EDITING_API - ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; - move32(); - - test(); - IF( !( EQ_32( ivas_total_brate, IVAS_SID_5k2 ) || ivas_total_brate == FRAME_NO_DATA ) ) - { - ivas_param_ism_dec_dequant_DOA_fx( hParamIsmDec, st_ivas->nchan_ism ); - ivas_param_ism_dec_dequant_powrat_fx( hParamIsmDec ); - st_ivas->hISMDTX.dtx_flag = 0; - move16(); - } - ELSE - { - st_ivas->hISMDTX.dtx_flag = 1; - move16(); - } -#endif IF( st_ivas->hISMDTX.dtx_flag ) @@ -2097,7 +1878,6 @@ void ivas_param_ism_params_to_masa_param_mapping_fx( { brange[0] = hParamIsmDec->hParamIsm->band_grouping[band_idx]; move16(); -#ifdef OBJ_EDITING_API brange[1] = hParamIsmDec->hParamIsm->band_grouping[band_idx + 1]; move16(); @@ -2105,29 +1885,13 @@ void ivas_param_ism_params_to_masa_param_mapping_fx( move16(); elevation[0] = extract_l( L_shr( L_add( hParamIsmDec->edited_elevation_values_fx[hParamIsmDec->hParamIsm->obj_indices[band_idx][0][0]], ( 1 << 21 ) ), 22 ) ); // Q0 move16(); -#else - brange[1] = hParamIsmDec->hParamIsm->band_grouping[band_idx + 1]; - move16(); - - azimuth[0] = extract_l( L_shr( L_add( hParamIsmDec->azimuth_values_fx[hParamIsmDec->hParamIsm->obj_indices[band_idx][0][0]], ( 1 << 21 ) ), 22 ) ); // Q0 - move16(); - elevation[0] = extract_l( L_shr( L_add( hParamIsmDec->elevation_values_fx[hParamIsmDec->hParamIsm->obj_indices[band_idx][0][0]], ( 1 << 21 ) ), 22 ) ); // Q0 - move16(); -#endif power_ratio_fx[0] = hParamIsmDec->power_ratios_fx[band_idx][0][0]; move16(); -#ifdef OBJ_EDITING_API azimuth[1] = extract_l( L_shr( L_add( hParamIsmDec->edited_azimuth_values_fx[hParamIsmDec->hParamIsm->obj_indices[band_idx][0][1]], ( 1 << 21 ) ), 22 ) ); // Q0 move16(); elevation[1] = extract_l( L_shr( L_add( hParamIsmDec->edited_elevation_values_fx[hParamIsmDec->hParamIsm->obj_indices[band_idx][0][1]], ( 1 << 21 ) ), 22 ) ); // Q0 move16(); -#else - azimuth[1] = extract_l( L_shr( L_add( hParamIsmDec->azimuth_values_fx[hParamIsmDec->hParamIsm->obj_indices[band_idx][0][1]], ( 1 << 21 ) ), 22 ) ); // Q0 - move16(); - elevation[1] = extract_l( L_shr( L_add( hParamIsmDec->elevation_values_fx[hParamIsmDec->hParamIsm->obj_indices[band_idx][0][1]], ( 1 << 21 ) ), 22 ) ); // Q0 - move16(); -#endif power_ratio_fx[1] = hParamIsmDec->power_ratios_fx[band_idx][0][1]; move16(); diff --git a/lib_dec/ivas_ism_renderer_fx.c b/lib_dec/ivas_ism_renderer_fx.c index e9edd161c..3f3ba29ff 100644 --- a/lib_dec/ivas_ism_renderer_fx.c +++ b/lib_dec/ivas_ism_renderer_fx.c @@ -260,32 +260,22 @@ void ivas_ism_render_sf_fx( { if ( GE_16( subframe_idx, ism_md_subframe_update_jbm ) ) { -#ifdef OBJ_EDITING_API rotateAziEle_fx( extract_l( L_shr( st_ivas->hIsmMetaData[i]->edited_azimuth_fx, 22 ) ), extract_l( L_shr( st_ivas->hIsmMetaData[i]->edited_elevation_fx, 22 ) ), &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat_fx[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup ); -#else - rotateAziEle_fx( extract_l( L_shr( st_ivas->hIsmMetaData[i]->azimuth_fx, 22 ) ), extract_l( L_shr( st_ivas->hIsmMetaData[i]->elevation_fx, 22 ) ), &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat_fx[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup ); -#endif } else { -#ifdef OBJ_EDITING_API rotateAziEle_fx( extract_l( L_shr( st_ivas->hIsmMetaData[i]->edited_azimuth_fx, 22 ) ), extract_l( L_shr( st_ivas->hIsmMetaData[i]->edited_elevation_fx, 22 ) ), &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat_fx[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup ); -#else - rotateAziEle_fx( extract_l( L_shr( st_ivas->hIsmMetaData[i]->last_azimuth_fx, 22 ) ), extract_l( L_shr( st_ivas->hIsmMetaData[i]->last_elevation_fx, 22 ) ), &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat_fx[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup ); -#endif } IF( st_ivas->hEFAPdata != NULL ) { efap_determine_gains_fx( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains_fx[i], L_shl( azimuth, 22 ), L_shl( elevation, 22 ), EFAP_MODE_EFAP ); -#ifdef OBJ_EDITING_API // TODO: Align Q-values IF( NE_32( st_ivas->hIsmMetaData[i]->edited_gain_fx, ONE_IN_Q29 ) ) { v_multc_fx( st_ivas->hIsmRendererData->gains_fx[i], st_ivas->hIsmMetaData[i]->edited_gain_fx, st_ivas->hIsmRendererData->gains_fx[i], nchan_out_woLFE ); // Q30, Q29 --> Q28 Scale_sig32( st_ivas->hIsmRendererData->gains_fx[i], nchan_out_woLFE, Q2 ); // Q28 --> Q30 } -#endif } } diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 045e4b110..78c5695ac 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -201,9 +201,7 @@ ivas_error ivas_jbm_dec_tc_fx( ivas_ism_dtx_limit_noise_energy_for_near_silence_fx( st_ivas->hSCE, st_ivas->hISMDTX.sce_id_dtx, st_ivas->nchan_transport, Q_cngNoiseLevel ); -#ifdef OBJ_EDITING_API ivas_param_ism_dec_dequant_md_fx( st_ivas ); -#endif } ELSE IF( EQ_32( st_ivas->ism_mode, ISM_MODE_PARAM ) ) { @@ -212,9 +210,7 @@ ivas_error ivas_jbm_dec_tc_fx( return error; } -#ifdef OBJ_EDITING_API ivas_param_ism_dec_dequant_md_fx( st_ivas ); -#endif } ELSE /* ISM_MODE_DISC */ { @@ -1600,284 +1596,19 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( } n_render_timeslots = idiv1616( st_ivas->hTcBuffer->n_samples_available, st_ivas->hTcBuffer->n_samples_granularity ); -#ifndef OBJ_EDITING_API - test(); - IF( EQ_16( st_ivas->hTcBuffer->tc_buffer_mode, TC_BUFFER_MODE_BUFFER ) ) - { - ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); - - test(); - test(); - test(); - IF( ( EQ_16( st_ivas->ivas_format, MASA_FORMAT ) || EQ_16( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) && EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) && st_ivas->hDecoderConfig->Opt_tsm ) - { - ivas_jbm_masa_sf_to_slot_map( st_ivas, n_render_timeslots ); - } - } - ELSE IF( EQ_16( st_ivas->ivas_format, STEREO_FORMAT ) ) - { - ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); - } - ELSE -#endif IF( EQ_16( st_ivas->ivas_format, ISM_FORMAT ) ) { /* Rendering */ IF( EQ_16( st_ivas->ism_mode, ISM_MODE_PARAM ) ) { test(); -#ifndef OBJ_EDITING_API - test(); - test(); - IF( EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) || EQ_16( st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC ) ) - { - ivas_dirac_dec_set_md_map_fx( st_ivas, n_render_timeslots ); - - ivas_param_ism_params_to_masa_param_mapping_fx( st_ivas ); - } - ELSE -#endif IF( EQ_16( st_ivas->renderer_type, RENDERER_PARAM_ISM ) || EQ_16( st_ivas->renderer_type, RENDERER_SBA_LINEAR_ENC ) ) { ivas_param_ism_dec_digest_tc_fx( st_ivas, n_render_timeslots, p_data_f_fx, Q11 ); } } -#ifndef OBJ_EDITING_API - ELSE /* ISM_MODE_DISC */ - { - ivas_ism_dec_digest_tc_fx( st_ivas ); - } -#endif - } -#ifndef OBJ_EDITING_API - ELSE IF( EQ_16( st_ivas->ivas_format, SBA_FORMAT ) || EQ_16( st_ivas->ivas_format, MASA_FORMAT ) ) - { - IF( st_ivas->hSCE[0] ) - { - Word16 shift = getScaleFactor32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN ); - IF( LT_16( sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, shift ), 4 ) ) - { - shift = sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, 4 ); - } - scale_sig32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, shift ); // Q(31-cngNoiseLevelExp+shift) - st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp = sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, shift ); - } - ivas_sba_dec_digest_tc_fx( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available ); - } - ELSE IF( EQ_16( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) - { - - IF( EQ_16( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) ) - { - ivas_ism_dec_digest_tc_fx( st_ivas ); - - test(); - test(); - test(); - test(); - /* delay the objects here for all renderers where it is needed */ - IF( - ( - EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) || - EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) || - EQ_16( st_ivas->renderer_type, RENDERER_OSBA_AMBI ) || - EQ_16( st_ivas->renderer_type, RENDERER_OSBA_LS ) || - EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) && - ( NE_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && NE_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) ) - { - FOR( n = 0; n < st_ivas->nchan_ism; n++ ) - { - delay_signal32_fx( st_ivas->hTcBuffer->tc_fx[n], st_ivas->hTcBuffer->n_samples_available, st_ivas->hSbaIsmData->delayBuffer_fx[n], st_ivas->hSbaIsmData->delayBuffer_size ); - } - } - - IF( !st_ivas->sba_dirac_stereo_flag ) - { - IF( EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) ) - { - Word16 temp, temp_e; - temp = BASOP_Util_Divide1616_Scale( st_ivas->hTcBuffer->n_samples_granularity, st_ivas->hSpatParamRendCom->slot_size, &temp_e ); - n_render_timeslots = extract_l( L_shr( L_mult0( n_render_timeslots, temp ), sub( 15, temp_e ) ) ); - } - - IF( st_ivas->hSCE[0] ) - { - Word16 shift = getScaleFactor32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN ); - if ( LT_16( sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, shift ), 4 ) ) - { - shift = sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, 4 ); - } - scale_sig32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, shift ); // Q(31-cngNoiseLevelExp+shift) - st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp = sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, shift ); - } - ivas_sba_dec_digest_tc_fx( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available ); - } - } - ELSE - { - ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); - - IF( st_ivas->hSCE[0] ) - { - Word16 shift = getScaleFactor32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN ); - if ( LT_16( sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, shift ), 4 ) ) - { - shift = sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, 4 ); - } - scale_sig32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, shift ); // Q(31-cngNoiseLevelExp+shift) - st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp = sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, shift ); - } - ivas_sba_dec_digest_tc_fx( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available ); - } - } - ELSE IF( EQ_16( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) - { - test(); - IF( EQ_32( st_ivas->renderer_type, RENDERER_OMASA_MIX_EXT ) || EQ_32( st_ivas->renderer_type, RENDERER_OMASA_OBJECT_EXT ) ) - { - ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); - IF( st_ivas->hDecoderConfig->Opt_tsm ) - { - ivas_jbm_masa_sf_to_slot_map( st_ivas, n_render_timeslots ); - } - } - ELSE - { - test(); - IF( EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) && EQ_16( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) - { - n_render_timeslots = i_mult( n_render_timeslots, idiv1616( st_ivas->hTcBuffer->n_samples_granularity, st_ivas->hSpatParamRendCom->slot_size ) ); - } - - IF( st_ivas->hSCE[0] ) - { - Word16 shift = getScaleFactor32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN ); - if ( LT_16( sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, shift ), 4 ) ) - { - shift = sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, 4 ); - } - scale_sig32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, shift ); // Q(31- (st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp - shift) - st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp = sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, shift ); - move16(); - } - ivas_sba_dec_digest_tc_fx( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available ); - - IF( EQ_16( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) - { - ivas_ism_dec_digest_tc_fx( st_ivas ); - } - } - - test(); - IF( EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_16( st_ivas->renderer_type, RENDERER_DIRAC ) ) - { - Word16 num_objects; - - /* Delay the signal to match CLDFB delay. Delay the whole buffer. */ - num_objects = 0; - move16(); - - test(); - test(); - IF( ( EQ_16( st_ivas->ism_mode, ISM_MASA_MODE_MASA_ONE_OBJ ) || EQ_16( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) && NE_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) ) - { - num_objects = 1; - move16(); - } - ELSE IF( EQ_16( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) - { - num_objects = st_ivas->nchan_ism; - move16(); - } - FOR( n = 0; n < num_objects; n++ ) - { - test(); - IF( EQ_16( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) && EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) ) - { - v_multc_fx_16( st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], OMASA_TDREND_MATCHING_GAIN_FX, st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available ); - } - delay_signal32_fx( st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available, st_ivas->hMasaIsmData->delayBuffer_fx[n], st_ivas->hMasaIsmData->delayBuffer_size ); - } - } } - ELSE IF( EQ_16( st_ivas->ivas_format, MC_FORMAT ) ) - { - IF( EQ_16( st_ivas->mc_mode, MC_MODE_MCT ) ) - { - ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); - } - ELSE IF( EQ_16( st_ivas->mc_mode, MC_MODE_PARAMUPMIX ) ) - { - ivas_mc_paramupmix_dec_digest_tc_fx( st_ivas, (UWord8) n_render_timeslots, st_ivas->hTcBuffer->n_samples_available ); - } - ELSE IF( EQ_16( st_ivas->mc_mode, MC_MODE_PARAMMC ) ) - { - - Word16 nchan_transport = st_ivas->nchan_transport; - move16(); - Word16 nchan_out_transport = add( st_ivas->hTransSetup.nchan_out_woLFE, st_ivas->hTransSetup.num_lfe ); - Word16 nchan_out_cov; - test(); - test(); - IF( EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) || EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) - { - nchan_out_cov = add( st_ivas->hTransSetup.nchan_out_woLFE, st_ivas->hTransSetup.num_lfe ); - } - ELSE IF( EQ_16( st_ivas->hParamMC->synthesis_conf, PARAM_MC_SYNTH_LS_CONV_CLDFB ) ) - { - nchan_out_cov = nchan_out_transport; - move16(); - } - ELSE IF( EQ_16( st_ivas->hParamMC->synthesis_conf, PARAM_MC_SYNTH_LS_CONV_COV ) || EQ_16( st_ivas->hParamMC->synthesis_conf, PARAM_MC_SYNTH_MONO_STEREO ) ) - { - nchan_out_cov = add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ); - } - ELSE - { - nchan_out_cov = nchan_out_transport; - move16(); - } - - scale_sig32( st_ivas->hParamMC->proto_matrix_int_fx, st_ivas->hParamMC->proto_matrix_int_len, -1 ); // Q(31-1) - st_ivas->hParamMC->proto_matrix_int_e = 1; - move16(); - - ivas_param_mc_dec_digest_tc_fx( st_ivas, (UWord8) n_render_timeslots, (Word32 **) p_data_f_fx, Q11 ); - - scale_sig32( st_ivas->hParamMC->proto_matrix_int_fx, st_ivas->hParamMC->proto_matrix_int_len, 1 ); // Q(31-1+1) - - Word16 shift; - FOR( Word16 param_band_idx = 0; param_band_idx < st_ivas->hParamMC->num_param_bands_synth; param_band_idx++ ) - { - shift = getScaleFactor32( st_ivas->hParamMC->h_output_synthesis_cov_state.cx_old_fx[param_band_idx], s_min( st_ivas->hParamMC->h_output_synthesis_cov_state.cx_old_len, nchan_transport * nchan_transport ) ); - scale_sig32( st_ivas->hParamMC->h_output_synthesis_cov_state.cx_old_fx[param_band_idx], s_min( st_ivas->hParamMC->h_output_synthesis_cov_state.cx_old_len, i_mult( nchan_transport, nchan_transport ) ), shift ); // Q(31-cx_old_e+shift) - st_ivas->hParamMC->h_output_synthesis_cov_state.cx_old_e[param_band_idx] = sub( st_ivas->hParamMC->h_output_synthesis_cov_state.cx_old_e[param_band_idx], shift ); - move16(); - - shift = getScaleFactor32( st_ivas->hParamMC->h_output_synthesis_cov_state.cy_old_fx[param_band_idx], nchan_out_cov * nchan_out_cov ); - scale_sig32( st_ivas->hParamMC->h_output_synthesis_cov_state.cy_old_fx[param_band_idx], i_mult( nchan_out_cov, nchan_out_cov ), shift ); // Q(31-cy_old_e+shift) - st_ivas->hParamMC->h_output_synthesis_cov_state.cy_old_e[param_band_idx] = sub( st_ivas->hParamMC->h_output_synthesis_cov_state.cy_old_e[param_band_idx], shift ); - move16(); - } - } - ELSE IF( EQ_16( st_ivas->mc_mode, MC_MODE_MCMASA ) ) - { - IF( st_ivas->hSCE[0] ) - { - Word16 shift = getScaleFactor32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN ); - if ( LT_16( sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, shift ), 4 ) ) - { - shift = sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, 4 ); - } - scale_sig32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, shift ); // Q(31-cngNoiseLevelExp+shift) - st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp = sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, shift ); - move16(); - } - ivas_sba_dec_digest_tc_fx( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available ); - } - } -#else ELSE IF( EQ_16( st_ivas->ivas_format, MC_FORMAT ) ) { test(); @@ -1886,7 +1617,6 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( ivas_param_mc_dec_digest_tc_fx( st_ivas, (UWord8) n_render_timeslots, (Word32 **) p_data_f_fx, Q11 ); } } -#endif pop_wmops(); return; @@ -2234,48 +1964,7 @@ ivas_error ivas_jbm_dec_render_fx( ivas_ism_render_sf_fx( st_ivas, st_ivas->renderer_type, p_output_fx, *nSamplesRendered ); /* add already rendered SBA part */ -#ifdef OBJ_EDITING_API ivas_osba_stereo_add_channels_fx( p_tc_fx, p_output_fx, st_ivas->hSbaIsmData->gain_bed_fx, nchan_out, st_ivas->nchan_ism, st_ivas->ism_mode, *nSamplesRendered ); -#else -#ifdef OBJ_EDITING_API - test(); - IF( EQ_16( st_ivas->ivas_format, SBA_ISM_FORMAT ) && EQ_16( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) ) - { - Word32 gain = st_ivas->hSbaIsmData->gain_bed_fx; - test(); - // TODO: Enable gain editing feature (NE_32 ( gain, ONE_IN_Q_gain ) ) - IF( NE_32( gain, ONE_IN_Q29 ) && GT_32( gain, 0 ) ) - { - FOR( n = 0; n < nchan_out; n++ ) - { - FOR( i = 0; i < *nSamplesRendered; i++ ) - { - Word32 tmp1 = Mpy_32_32( p_tc_fx[n + st_ivas->nchan_ism][i], gain ); // Q11 + Q29 - 31 = Q9 - tmp1 = L_shl( tmp1, 2 ); // Q9 --> Q11 - p_output_fx[n][i] = L_add_sat( p_output_fx[n][i], tmp1 ); // Q11 - } - } - } - ELSE - { - FOR( n = 0; n < nchan_out; n++ ) - { - FOR( n = 0; n < nchan_out; n++ ) - { - FOR( i = 0; i < *nSamplesRendered; i++ ) - { - p_output_fx[n][i] = L_add_sat( p_output_fx[n][i], p_tc_fx[n + st_ivas->nchan_ism][i] ); // Q11 - } - } - } - } - } - ELSE -#endif - { - ivas_osba_stereo_add_channels_fx( p_tc_fx, p_output_fx, ONE_IN_Q11, nchan_out, st_ivas->nchan_ism, *nSamplesRendered ); - } -#endif } ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_OSBA_AMBI ) || EQ_32( st_ivas->renderer_type, RENDERER_OSBA_LS ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) { @@ -4533,7 +4222,6 @@ void ivas_jbm_masa_sf_to_sf_map( } -#ifdef OBJ_EDITING_API /*--------------------------------------------------------------------------* * ivas_dec_prepare_renderer() * @@ -4855,4 +4543,3 @@ void ivas_dec_prepare_renderer_fx( pop_wmops(); return; } -#endif diff --git a/lib_dec/ivas_mc_param_dec_fx.c b/lib_dec/ivas_mc_param_dec_fx.c index 8741769c8..869800c6b 100644 --- a/lib_dec/ivas_mc_param_dec_fx.c +++ b/lib_dec/ivas_mc_param_dec_fx.c @@ -1528,141 +1528,29 @@ void ivas_param_mc_dec_digest_tc_fx( const Word16 transport_f_e ) { PARAM_MC_DEC_HANDLE hParamMC; -#ifdef OBJ_EDITING_API Word16 ch, slot_idx; Word16 nchan_transport; -#else - Word16 i, ch; - Word16 is_next_band, skip_next_band; - Word16 slot_idx, param_band_idx; - Word16 nchan_transport, nchan_out_transport, nchan_out_cldfb; - Word16 nchan_out_cov; -#endif /*CLDFB*/ hParamMC = st_ivas->hParamMC; assert( hParamMC ); -#ifndef OBJ_EDITING_API - Word32 *pCx, *pCx_imag; - Word32 cx_fx[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; // Q(31 - cx_e) - Word32 cx_imag_fx[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; // Q(31 - cx_imag_e) - Word32 cx_next_band_fx[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; // Q(31 - cx_next_band_e) - Word32 cx_imag_next_band_fx[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; // Q(31 - cx_imag_next_band_e) - Word32 real_part_fx, imag_part_fx, L_tmp1, L_tmp2; - - Word16 cx_buff_e[2][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; - Word16 cx_e; - Word16 cx_imag_e, tmp_e; - Word16 cx_imag_next_band_e, cx_next_band_e; - - Word16 max_e; - - /* format converter */ - Word16 channel_active[MAX_OUTPUT_CHANNELS]; - IVAS_OUTPUT_SETUP *hSynthesisOutputSetup; -#endif Word16 qout = 0; move16(); push_wmops( "param_mc_dec_digest_tc" ); -#ifndef OBJ_EDITING_API - set16_fx( channel_active, 0, MAX_CICP_CHANNELS ); -#endif nchan_transport = st_ivas->nchan_transport; move16(); -#ifndef OBJ_EDITING_API - nchan_out_transport = add( st_ivas->hTransSetup.nchan_out_woLFE, st_ivas->hTransSetup.num_lfe ); - - test(); - test(); - IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) - { - nchan_out_cldfb = BINAURAL_CHANNELS; - move16(); - set16_fx( channel_active, 1, nchan_out_cldfb ); - nchan_out_cov = add( st_ivas->hTransSetup.nchan_out_woLFE, st_ivas->hTransSetup.num_lfe ); - hSynthesisOutputSetup = &st_ivas->hTransSetup; - } - ELSE IF( EQ_32( hParamMC->synthesis_conf, PARAM_MC_SYNTH_LS_CONV_CLDFB ) ) - { - nchan_out_cov = nchan_out_transport; - move16(); - nchan_out_cldfb = add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ); - hSynthesisOutputSetup = &st_ivas->hTransSetup; - } - ELSE IF( EQ_32( hParamMC->synthesis_conf, PARAM_MC_SYNTH_LS_CONV_COV ) || EQ_32( hParamMC->synthesis_conf, PARAM_MC_SYNTH_MONO_STEREO ) ) - { - nchan_out_cov = add( st_ivas->hOutSetup.nchan_out_woLFE, st_ivas->hOutSetup.num_lfe ); - nchan_out_cldfb = nchan_out_cov; - move16(); - set16_fx( channel_active, 1, nchan_out_cov ); - hSynthesisOutputSetup = &st_ivas->hOutSetup; - } - ELSE - { - nchan_out_cov = nchan_out_transport; - move16(); - nchan_out_cldfb = nchan_out_transport; - move16(); - set16_fx( channel_active, 1, nchan_out_cov ); - hSynthesisOutputSetup = &st_ivas->hTransSetup; - } - - /* adapt transient position */ - IF( hParamMC->hMetadataPMC->bAttackPresent ) - { - hParamMC->hMetadataPMC->attackIndex = s_max( 0, add( hParamMC->hMetadataPMC->attackIndex, shr( sub( nCldfbSlots, DEFAULT_JBM_CLDFB_TIMESLOTS ), 1 ) ) ); - move16(); - } - /* adapt subframes */ - hParamMC->num_slots = nCldfbSlots; - move16(); - hParamMC->slots_rendered = 0; - move16(); - hParamMC->subframes_rendered = 0; - move16(); - ivas_jbm_dec_get_adapted_subframes( nCldfbSlots, hParamMC->subframe_nbslots, &hParamMC->nb_subframes ); - st_ivas->hTcBuffer->nb_subframes = hParamMC->nb_subframes; - move16(); - Copy( hParamMC->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, hParamMC->nb_subframes ); - - ivas_param_mc_dec_compute_interpolator_fx( hParamMC->hMetadataPMC->bAttackPresent, hParamMC->hMetadataPMC->attackIndex, nCldfbSlots, hParamMC->h_output_synthesis_params.interpolator_fx ); - - /* loop over two bands at a time */ - FOR( param_band_idx = 0; param_band_idx < hParamMC->num_param_bands_synth; param_band_idx += 2 ) - { - /* don't process next band if it exceeds the limit */ - skip_next_band = ( ( param_band_idx + 1 ) == hParamMC->num_param_bands_synth ) ? 1 : 0; - - set_zero_fx( cx_fx, PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS ); - set_zero_fx( cx_imag_fx, PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS ); - set_zero_fx( cx_next_band_fx, PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS ); - set_zero_fx( cx_imag_next_band_fx, PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS ); - - cx_e = 0; - move16(); - cx_imag_e = 0; - move16(); - cx_next_band_e = 0; - move16(); - cx_imag_next_band_e = 0; - move16(); -#endif /* slot loop for gathering the input data */ FOR( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ ) { IF( st_ivas->hDecoderConfig->Opt_tsm ) { -#ifndef OBJ_EDITING_API - IF( param_band_idx == 0 ) /* only run cldfbAna once */ - { -#endif Word32 RealBuffer_fx[CLDFB_NO_CHANNELS_MAX]; Word32 ImagBuffer_fx[CLDFB_NO_CHANNELS_MAX]; @@ -1679,194 +1567,16 @@ void ivas_param_mc_dec_digest_tc_fx( hParamMC->Cldfb_ImagBuffer_tc_e = qout; move16(); -#ifndef OBJ_EDITING_API - } -#endif } -#ifndef OBJ_EDITING_API - IF( GE_16( slot_idx, shl( hParamMC->hMetadataPMC->attackIndex, 1 ) ) ) - { - FOR( is_next_band = 0; is_next_band < 2; is_next_band++ ) - { - test(); - IF( is_next_band && skip_next_band ) - { - CONTINUE; - } - IF( is_next_band ) - { - ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot_fx( &hParamMC->Cldfb_RealBuffer_tc_fx[slot_idx * hParamMC->num_freq_bands * nchan_transport], - /*hParamMC->Cldfb_RealBuffer_tc_e*/ Q31 - Q6, - &hParamMC->Cldfb_ImagBuffer_tc_fx[slot_idx * hParamMC->num_freq_bands * nchan_transport], - /*hParamMC->Cldfb_ImagBuffer_tc_e*/ Q31 - Q6, - cx_next_band_fx, - &cx_next_band_e, - cx_imag_next_band_fx, - &cx_imag_next_band_e, - hParamMC, - add( param_band_idx, is_next_band ), - nchan_transport ); - } - ELSE - { - ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot_fx( &hParamMC->Cldfb_RealBuffer_tc_fx[slot_idx * hParamMC->num_freq_bands * nchan_transport], - /*hParamMC->Cldfb_RealBuffer_tc_e*/ Q31 - Q6, - &hParamMC->Cldfb_ImagBuffer_tc_fx[slot_idx * hParamMC->num_freq_bands * nchan_transport], - /*hParamMC->Cldfb_ImagBuffer_tc_e*/ Q31 - Q6, - cx_fx, - &cx_e, - cx_imag_fx, - &cx_imag_e, - hParamMC, - add( param_band_idx, is_next_band ), - nchan_transport ); - } - } - } -#endif - } - -#ifndef OBJ_EDITING_API - Word16 tmp_cx_e, tmp_cx_imag_e; - /* map from complex input covariance to real values */ - FOR( is_next_band = 0; is_next_band < 2; is_next_band++ ) - { - test(); - IF( is_next_band && skip_next_band ) - { - CONTINUE; - } - /* Cx for transport channels */ - IF( is_next_band ) - { - pCx = &cx_next_band_fx[0]; - pCx_imag = &cx_imag_next_band_fx[0]; - tmp_cx_e = cx_next_band_e; - tmp_cx_imag_e = cx_imag_next_band_e; - } - ELSE - { - pCx = &cx_fx[0]; - pCx_imag = &cx_imag_fx[0]; - tmp_cx_e = cx_e; - tmp_cx_imag_e = cx_imag_e; - } - - FOR( i = 0; i < nchan_transport * nchan_transport; i++ ) - { - real_part_fx = pCx[i]; // Q(31 - cx_buff_e) - imag_part_fx = pCx_imag[i]; - move32(); - move32(); - cx_buff_e[is_next_band][i] = tmp_cx_e; - move16(); - /* (a-ib)(c+id) = ac + bd + i(ad-bc) */ - IF( LT_16( param_band_idx, hParamMC->max_param_band_abs_cov ) ) - { - L_tmp1 = Mpy_32_32( real_part_fx, real_part_fx ); - L_tmp2 = Mpy_32_32( imag_part_fx, imag_part_fx ); - L_tmp1 = BASOP_Util_Add_Mant32Exp( L_tmp1, add( tmp_cx_e, tmp_cx_e ), L_tmp2, add( tmp_cx_imag_e, tmp_cx_imag_e ), &tmp_e ); - pCx[i] = Sqrt32( L_tmp1, &tmp_e ); - move32(); - cx_buff_e[is_next_band][i] = tmp_e; - move16(); - } - ELSE - { - pCx[i] = real_part_fx; - move32(); - cx_buff_e[is_next_band][i] = tmp_cx_e; - move16(); - } - } - } - - max_e = cx_buff_e[0][0]; - move16(); - - /* Cx for transport channels */ - FOR( is_next_band = 0; is_next_band < 2; is_next_band++ ) - { - FOR( i = 0; i < imult1616( nchan_transport, nchan_transport ); i++ ) - { - - IF( LT_16( max_e, cx_buff_e[is_next_band][i] ) ) - { - max_e = cx_buff_e[is_next_band][i]; - } - } - } - /* Cx for transport channels */ - FOR( is_next_band = 0; is_next_band < 2; is_next_band++ ) - { - FOR( i = 0; i < imult1616( nchan_transport, nchan_transport ); i++ ) - { - if ( is_next_band == 0 ) - { - cx_fx[i] = L_shr( cx_fx[i], sub( max_e, cx_buff_e[is_next_band][i] ) ); - } - else - { - cx_next_band_fx[i] = L_shr( cx_next_band_fx[i], sub( max_e, cx_buff_e[is_next_band][i] ) ); - } - move32(); - } - } - cx_e = max_e; - move16(); - - - /* we have to do it similar to the encoder in case of attacks (i.e. accumulate two bands) to ensure correct DMX of the target covariance*/ - - test(); - test(); - IF( hParamMC->hMetadataPMC->bAttackPresent && ( EQ_32( hParamMC->synthesis_conf, PARAM_MC_SYNTH_LS_CONV_COV ) || EQ_32( hParamMC->synthesis_conf, PARAM_MC_SYNTH_MONO_STEREO ) ) ) - { - Word16 len = imult1616( nchan_transport, nchan_transport ); - Word16 sc = s_min( getScaleFactor32( cx_fx, len ), getScaleFactor32( cx_next_band_fx, len ) ); - IF( EQ_16( sc, 0 ) ) - { - Scale_sig32( cx_fx, len, -Q1 ); // add one bit head room - Scale_sig32( cx_next_band_fx, len, -Q1 ); // add one bit head room - cx_e = add( cx_e, Q1 ); - cx_next_band_e = add( cx_e, Q1 ); - } - v_add_fx( cx_fx, cx_next_band_fx, cx_fx, len ); - Copy32( cx_fx, cx_next_band_fx, len ); } - FOR( is_next_band = 0; is_next_band < 2; is_next_band++ ) - { - test(); - IF( is_next_band && skip_next_band ) - { - CONTINUE; - } - - IF( NE_32( hParamMC->synthesis_conf, PARAM_MC_SYNTH_MONO_STEREO ) ) - { - IF( is_next_band ) - { - - ivas_param_mc_get_mixing_matrices_fx( hParamMC, hSynthesisOutputSetup, cx_next_band_fx, cx_e, add( param_band_idx, is_next_band ), hParamMC->h_output_synthesis_cov_state.mixing_matrix_fx, hParamMC->h_output_synthesis_cov_state.mixing_matrix_exp, hParamMC->h_output_synthesis_cov_state.mixing_matrix_res_fx, hParamMC->h_output_synthesis_cov_state.mixing_matrix_res_exp, nchan_out_transport, hParamMC->synthesis_conf, nchan_transport, nchan_out_cov ); - } - ELSE - { - - ivas_param_mc_get_mixing_matrices_fx( hParamMC, hSynthesisOutputSetup, cx_fx, cx_e, add( param_band_idx, is_next_band ), hParamMC->h_output_synthesis_cov_state.mixing_matrix_fx, hParamMC->h_output_synthesis_cov_state.mixing_matrix_exp, hParamMC->h_output_synthesis_cov_state.mixing_matrix_res_fx, hParamMC->h_output_synthesis_cov_state.mixing_matrix_res_exp, nchan_out_transport, hParamMC->synthesis_conf, nchan_transport, nchan_out_cov ); - } - } - } - } -#endif pop_wmops(); return; } -#ifdef OBJ_EDITING_API /*------------------------------------------------------------------------- * ivas_param_mc_dec_prepare_renderer() * @@ -2167,7 +1877,6 @@ void ivas_param_mc_dec_prepare_renderer( return; } -#endif /*------------------------------------------------------------------------- diff --git a/lib_dec/ivas_objectRenderer_internal_fx.c b/lib_dec/ivas_objectRenderer_internal_fx.c index 21613852e..98a57c4cd 100644 --- a/lib_dec/ivas_objectRenderer_internal_fx.c +++ b/lib_dec/ivas_objectRenderer_internal_fx.c @@ -213,7 +213,6 @@ ivas_error ivas_td_binaural_renderer_sf_fx( IF( EQ_16( subframe_idx, ism_md_subframe_update_jbm ) ) { -#ifdef OBJ_EDITING_API test(); IF( EQ_16( st_ivas->ivas_format, ISM_FORMAT ) || EQ_16( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) { @@ -244,7 +243,6 @@ ivas_error ivas_td_binaural_renderer_sf_fx( } } ELSE -#endif { IF( NE_16( error = TDREND_Update_object_positions_fx( st_ivas->hBinRendererTd, nchan_ism, st_ivas->ivas_format, st_ivas->hIsmMetaData ), IVAS_ERR_OK ) ) { diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index a5d5065be..792975339 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -329,7 +329,6 @@ ivas_error ivas_osba_render_sf_fx( * *-------------------------------------------------------------------------*/ -#ifdef OBJ_EDITING_API void ivas_osba_stereo_add_channels_fx( Word32 *tc_fx[], /* i : transport channels */ Word32 *output_fx[], /* i/o: output channels */ @@ -385,30 +384,3 @@ void ivas_osba_stereo_add_channels_fx( return; } -#else -void ivas_osba_stereo_add_channels_fx( - Word32 *tc_fx[], /* i : transport channels */ - Word32 *output_fx[], /* i/o: output channels */ - const Word16 gain, /* i : gain bed value Q11 */ - const Word16 nchan_out, /* i : number of output channels */ - const Word16 nchan_ism, /* i : number of ISM channels */ - const UWord16 n_samples_to_render /* i : output frame length per channel */ -) -{ - Word16 n; - - IF( NE_16( gain, ONE_IN_Q11 ) ) - { - assert( 0 && "Object editing is not implemented in the BASOP code!" ); - } - ELSE - { - FOR( n = 0; n < nchan_out; n++ ) - { - v_add_fx_no_hdrm( output_fx[n], tc_fx[n + nchan_ism], output_fx[n], n_samples_to_render ); - } - } - - return; -} -#endif diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index b6129f3c7..acf9d5904 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -463,10 +463,8 @@ typedef struct ivas_param_ism_dec_data_structure Word32 elevation_values_fx[MAX_PARAM_SPATIAL_SUBFRAMES * IVAS_MAX_NUM_BANDS]; /* Q22 */ Word16 power_ratios_fx[MAX_PARAM_ISM_NBANDS][MAX_PARAM_ISM_NBLOCKS][MAX_PARAM_ISM_WAVE]; /* Q15 */ -#ifdef OBJ_EDITING_API Word32 edited_azimuth_values_fx[MAX_PARAM_SPATIAL_SUBFRAMES * IVAS_MAX_NUM_BANDS]; // Q22 Word32 edited_elevation_values_fx[MAX_PARAM_SPATIAL_SUBFRAMES * IVAS_MAX_NUM_BANDS]; // Q22 -#endif /*sub-modules*/ PARAM_ISM_CONFIG_HANDLE hParamIsm; /* Parametric ISM common handle */ @@ -720,9 +718,7 @@ typedef struct ivas_osba_data Word16 delayBuffer_size; Word16 delayBuffer_nchan; -#ifdef OBJ_EDITING_API Word32 gain_bed_fx; // Q29 -#endif } SBA_ISM_DATA, *SBA_ISM_DATA_HANDLE; @@ -968,10 +964,8 @@ typedef struct ivas_masa_ism_data_structure #else UWord8 ism_is_edited[MAX_NUM_OBJECTS]; #endif -#ifdef OBJ_EDITING_API Word16 gain_ism_fx[MAX_NUM_OBJECTS]; Word16 gain_masa_fx; -#endif #ifdef OMASA_OBJECT_EDITING Word16 gain_ism_edited_fx[MAX_NUM_OBJECTS]; // Q12 diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 750d53d67..55a5dcee2 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -172,7 +172,6 @@ ivas_error IVAS_DEC_GetSamples( bool *needNewFrame /* o : indication that the decoder needs a new frame */ ); -#ifdef OBJ_EDITING_API ivas_error IVAS_DEC_GetEditableParameters( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_EDITABLE_PARAMETERS *hIvasEditableParameters /* o : object editing parameters handle */ @@ -186,7 +185,6 @@ ivas_error IVAS_DEC_SetEditableParameters( ivas_error IVAS_DEC_PrepareRenderer( IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ ); -#endif ivas_error IVAS_DEC_GetSplitBinauralBitstream( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ @@ -314,9 +312,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( #endif bool *bitstreamReadDone, /* o : flag indicating that bitstream was read */ UWord16 *nSamplesRendered, /* o : number of samples rendered */ -#ifdef OBJ_EDITING_API bool *parametersAvailableForEditing, /* o : indicates whether objects editing is available */ -#endif const UWord32 systemTimestamp_ms /* i : current system timestamp */ ); diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 5cb27fa2e..70e46422e 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -212,11 +212,7 @@ ivas_error IVAS_DEC_Open( move16(); move16(); move16(); -#ifdef OBJ_EDITING_API hIvasDec->flushbuffer = NULL; -#else - // hIvasDec->flushbuffer = NULL; -#endif hIvasDec->nSamplesFlushed = 0; move16(); hIvasDec->hasBeenPreparedRendering = false; @@ -454,12 +450,10 @@ void IVAS_DEC_Close( free( ( *phIvasDec )->apaExecBuffer_fx ); } -#ifdef OBJ_EDITING_API IF( ( *phIvasDec )->flushbuffer != NULL ) { free( ( *phIvasDec )->flushbuffer ); } -#endif free( *phIvasDec ); *phIvasDec = NULL; @@ -700,7 +694,6 @@ ivas_error IVAS_DEC_Configure( move16(); move16(); -#ifdef OBJ_EDITING_API /* init flush buffer if necessary (only needed for binaural)*/ test(); test(); @@ -712,7 +705,6 @@ ivas_error IVAS_DEC_Configure( hIvasDec->flushbuffer = (void *) malloc( CPE_CHANNELS * hIvasDec->nSamplesFrame / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES * sizeof( Word16 ) ); set16_fx( (Word16 *) hIvasDec->flushbuffer, 0, CPE_CHANNELS * hIvasDec->nSamplesFrame / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ); } -#endif #endif return IVAS_ERR_OK; @@ -1057,13 +1049,11 @@ ivas_error IVAS_DEC_EnableVoIP( return error; } #else -#ifdef OBJ_EDITING_API IF( hIvasDec->flushbuffer == NULL && ( EQ_32( hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_32( hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ) { hIvasDec->flushbuffer = (void *) malloc( CPE_CHANNELS * hIvasDec->nSamplesFrame / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES * sizeof( Word16 ) ); set16_fx( (Word16 *) hIvasDec->flushbuffer, 0, CPE_CHANNELS * hIvasDec->nSamplesFrame / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ); } -#endif #endif return IVAS_ERR_OK; @@ -1231,28 +1221,16 @@ ivas_error IVAS_DEC_GetSamples( ) { ivas_error error; -#ifdef OBJ_EDITING_API #ifndef LIB_DEC_REVISION Word16 nSamplesToRender; #endif UWord16 nSamplesRendered, nSamplesRendered_loop; UWord16 nOutChannels; -#else - Word16 nOutSamplesElse, nSamplesToRender; - UWord16 nSamplesRendered, nSamplesRendered_loop, l_ts, nTimeScalerOutSamples; - UWord8 nTransportChannels, nOutChannels; -#endif Decoder_Struct *st_ivas; nSamplesRendered = 0; nOutChannels = 0; nSamplesRendered_loop = 0; -#ifndef OBJ_EDITING_API - l_ts = 0; - nTransportChannels = 0; - move16(); - move16(); -#endif move16(); move16(); move16(); @@ -1263,13 +1241,11 @@ ivas_error IVAS_DEC_GetSamples( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef OBJ_EDITING_API /* the rendering needs to be prepared at this point */ IF( hIvasDec->hasBeenPreparedRendering == false ) { return IVAS_ERR_UNKNOWN; } -#endif st_ivas = hIvasDec->st_ivas; @@ -1343,112 +1319,9 @@ ivas_error IVAS_DEC_GetSamples( } ELSE { -#ifndef OBJ_EDITING_API - /* check if we need to run the setup function */ - test(); - IF( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame ) - { - /* setup */ - IF( NE_32( ( error = IVAS_DEC_Setup( hIvasDec, &l_ts, &nTransportChannels ) ), IVAS_ERR_OK ) ) - { - // return error; - } - } -#endif #ifndef LIB_DEC_REVISION { #endif -#ifndef OBJ_EDITING_API - /* check if we need to run the setup function, tc decoding and feeding the renderer */ - test(); - IF( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame ) - { - Word16 nResidualSamples, nSamplesTcsScaled; - nSamplesRendered = add( nSamplesRendered, nSamplesRendered_loop ); - - test(); - IF( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm && NE_16( (Word16) nTransportChannels, hIvasDec->nTransportChannelsOld ) ) - { - IF( NE_32( ( error = IVAS_DEC_VoIP_reconfigure( hIvasDec, nTransportChannels, l_ts ) ), IVAS_ERR_OK ) ) - { - return error; - } - } - - /* IVAS decoder */ - IF( NE_32( ( error = IVAS_DEC_GetTcSamples( hIvasDec, hIvasDec->apaExecBuffer_fx, &nOutSamplesElse ) ), IVAS_ERR_OK ) ) - { - return error; - } - - /* JBM */ - IF( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm ) - { - IF( apa_set_scale_fx( hIvasDec->hTimeScaler, hIvasDec->tsm_scale ) != 0 ) - { - return IVAS_ERR_UNKNOWN; - } - - // tmp apaExecBuffer - IF( EQ_16( (Word16) hIvasDec->mode, IVAS_DEC_MODE_EVS ) ) - { - Word16 tmp_apaExecBuffer[APA_BUF]; - FOR( Word32 i = 0; i < APA_BUF_PER_CHANNEL * nTransportChannels; ++i ) - { - tmp_apaExecBuffer[i] = extract_l( L_shr( hIvasDec->apaExecBuffer_fx[i], Q11 ) ); // Q0 - } - IF( apa_exec_fx( hIvasDec->hTimeScaler, tmp_apaExecBuffer, (UWord16) imult3216( hIvasDec->nSamplesFrame, nTransportChannels ), (UWord16) hIvasDec->tsm_max_scaling, tmp_apaExecBuffer, &nTimeScalerOutSamples ) != 0 ) - { - return IVAS_ERR_UNKNOWN; - } - FOR( Word32 i = 0; i < APA_BUF_PER_CHANNEL * nTransportChannels; ++i ) - { - hIvasDec->apaExecBuffer_fx[i] = L_shl( tmp_apaExecBuffer[i], Q11 ); // Q11 - } - } - ELSE - { - IF( apa_exec_ivas_fx( hIvasDec->hTimeScaler, hIvasDec->apaExecBuffer_fx, (UWord16) imult3216( hIvasDec->nSamplesFrame, nTransportChannels ), (UWord16) hIvasDec->tsm_max_scaling, hIvasDec->apaExecBuffer_fx, &nTimeScalerOutSamples ) != 0 ) - { - return IVAS_ERR_UNKNOWN; - } - } - assert( LE_32( (Word32) nTimeScalerOutSamples, APA_BUF ) ); - nSamplesTcsScaled = idiv1616U( extract_l( nTimeScalerOutSamples ), nTransportChannels ); - hIvasDec->timeScalingDone = 1; - move16(); - } - ELSE - { - nSamplesTcsScaled = hIvasDec->nSamplesFrame; - move16(); - } -#ifdef DEBUG_MODE_JBM - dbgwrite( &nTimeScalerOutSamples, sizeof( uint16_t ), 1, 1, "./res/JBM_nTimeScaleOutSamples.dat" ); -#endif - - /* Feed decoded transport channels samples to the renderer */ - IF( NE_32( ( error = IVAS_DEC_RendererFeedTcSamples( hIvasDec, nSamplesTcsScaled, &nResidualSamples, hIvasDec->apaExecBuffer_fx ) ), IVAS_ERR_OK ) ) - { - return error; - } -#ifdef DEBUG_MODE_JBM - dbgwrite( &nResidualSamples, sizeof( int16_t ), 1, 1, "./res/JBM_nResidualSamples.dat" ); -#endif - - - IF( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm ) - { - /* feed residual samples to TSM for the next call */ - IF( apa_set_renderer_residual_samples( hIvasDec->hTimeScaler, (UWord16) nResidualSamples ) != 0 ) - { - return IVAS_ERR_UNKNOWN; - } - } - hIvasDec->hasBeenFedFrame = false; - move16(); - } -#else nOutChannels = (UWord8) st_ivas->hDecoderConfig->nchan_out; hIvasDec->hasBeenFedFrame = false; @@ -1467,7 +1340,6 @@ ivas_error IVAS_DEC_GetSamples( move16(); move16(); } -#endif /* render IVAS frames directly to the output buffer */ #ifdef LIB_DEC_REVISION @@ -1569,13 +1441,6 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( *needNewFrame = false; hSplitBinRend = st_ivas->hSplitBinRend; -#ifndef OBJ_EDITING_API - IF( ( error = isar_set_split_rend_setup( hSplitBinRend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hCombinedOrientationData, splitRendBits ) ) != IVAS_ERR_OK ) - { - return error; - } - -#endif FOR( i = 0; i < MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; i++ ) { FOR( j = 0; j < CLDFB_NO_COL_MAX; j++ ) @@ -1602,14 +1467,12 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( numPoses = hSplitBinRend->splitrend.multiBinPoseData.num_poses; move16(); -#ifdef OBJ_EDITING_API /* init flush buffer for rate switch if not already initizalized */ IF( hIvasDec->flushbuffer == NULL ) { hIvasDec->flushbuffer = (void *) malloc( numPoses * BINAURAL_CHANNELS * hIvasDec->nSamplesFrame / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES * sizeof( float ) ); set16_fx( (Word16 *) hIvasDec->flushbuffer, 0, numPoses * BINAURAL_CHANNELS * hIvasDec->nSamplesFrame / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ); } -#endif IF( NE_32( st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_20MS ) && ( EQ_32( st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode, ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) || @@ -2441,7 +2304,6 @@ ivas_error IVAS_DEC_GetObjectMetadata( } ELSE { -#ifdef OBJ_EDITING_API IF( EQ_32( st_ivas->ism_mode, ISM_MODE_DISC ) ) { metadata->azimuth_fx = hIsmMeta->edited_azimuth_fx; @@ -2476,7 +2338,6 @@ ivas_error IVAS_DEC_GetObjectMetadata( metadata->non_diegetic_flag = st_ivas->hIsmMetaData[objectIdx]->non_diegetic_flag; } ELSE -#endif { metadata->azimuth_fx = hIsmMeta->azimuth_fx; // Q22 metadata->elevation_fx = hIsmMeta->elevation_fx; // Q22 @@ -4274,7 +4135,6 @@ ivas_error IVAS_DEC_GetSamplesDecoder( } -#ifdef OBJ_EDITING_API /*---------------------------------------------------------------------* * IVAS_DEC_GetEditableParameters( ) * @@ -4798,7 +4658,6 @@ ivas_error IVAS_DEC_PrepareRenderer( return IVAS_ERR_OK; } -#endif /*---------------------------------------------------------------------* @@ -4817,9 +4676,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( #endif bool *bitstreamReadDone, /* o : flag indicating that bitstream was read */ UWord16 *nSamplesRendered, /* o : number of samples rendered */ -#ifdef OBJ_EDITING_API bool *parametersAvailableForEditing, /* o : indicates whether objects editing is available */ -#endif const UWord32 systemTimestamp_ms /* i : current system timestamp */ ) { @@ -4833,10 +4690,8 @@ ivas_error IVAS_DEC_VoIP_GetSamples( ivas_error error; UWord8 nOutChannels; -#ifdef OBJ_EDITING_API *parametersAvailableForEditing = false; move16(); -#endif test(); test(); @@ -5024,7 +4879,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( move16(); } #ifndef NONBE_FIX_1255_OBJ_EDIT_JBM -#ifdef OBJ_EDITING_API IF( hIvasDec->hasBeenFedFirstGoodFrame ) { *parametersAvailableForEditing = true; @@ -5032,7 +4886,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( return IVAS_ERR_OK; } -#endif #endif } @@ -5045,11 +4898,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( set16_fx( pcmBuf + imult1616( *nSamplesRendered, nOutChannels ), 0, imult1616( nSamplesToZero, nOutChannels ) ); *nSamplesRendered = add( *nSamplesRendered, nSamplesToZero ); #ifndef LIB_DEC_REVISION -#ifndef OBJ_EDITING_API - nSamplesRendered = add( nSamplesRendered, nSamplesToZero ); -#else hIvasDec->nSamplesRendered = add( hIvasDec->nSamplesRendered, nSamplesToZero ); -#endif #endif hIvasDec->nSamplesAvailableNext = sub( hIvasDec->nSamplesAvailableNext, nSamplesToZero ); move16(); @@ -5092,7 +4941,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( nSamplesToRender = sub( nSamplesPerChannel, *nSamplesRendered ); -#ifdef OBJ_EDITING_API /* check if we still need to prepare the renderer */ IF( hIvasDec->hasBeenPreparedRendering == false ) { @@ -5101,7 +4949,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( return error; } } -#endif /* render IVAS frames directly to the output buffer */ #ifdef LIB_DEC_REVISION diff --git a/lib_rend/ivas_objectRenderer_fx.c b/lib_rend/ivas_objectRenderer_fx.c index 937765171..fc1acd283 100644 --- a/lib_rend/ivas_objectRenderer_fx.c +++ b/lib_rend/ivas_objectRenderer_fx.c @@ -614,10 +614,8 @@ static void TDREND_Clear_Update_flags_fx( { hBinRendererTd->Sources[i]->SrcSpatial_p->Updated = FALSE; move16(); -#ifdef OBJ_EDITING_API hBinRendererTd->Sources[i]->SrcRend_p->SrcGainUpdated = FALSE; move16(); -#endif } return; diff --git a/lib_rend/ivas_objectRenderer_sources_fx.c b/lib_rend/ivas_objectRenderer_sources_fx.c index 45f649783..33c519c8e 100644 --- a/lib_rend/ivas_objectRenderer_sources_fx.c +++ b/lib_rend/ivas_objectRenderer_sources_fx.c @@ -275,11 +275,7 @@ static void TDREND_SRC_REND_Init_fx( move16(); SrcRend_p->SrcGain_p_fx[nC] = ONE_IN_Q14; // Q14 move16(); -#ifdef OBJ_EDITING_API SrcRend_p->SrcGainMax_p_fx[nC] = 32767; // TODO: make it 2, this is one in Q15, i thinki, need to change Q for that -#else - SrcRend_p->SrcGainMax_p_fx[nC] = 32767; /* Q15 */ -#endif move16(); } SrcRend_p->SrcGainUpdated = FALSE; diff --git a/lib_rend/ivas_prot_rend_fx.h b/lib_rend/ivas_prot_rend_fx.h index 8bbb23b44..4ac104124 100644 --- a/lib_rend/ivas_prot_rend_fx.h +++ b/lib_rend/ivas_prot_rend_fx.h @@ -774,12 +774,10 @@ ivas_error TDREND_MIX_SRC_SetPlayState( const TDREND_PlayStatus_t PlayStatus /* i : Play state */ ); -#ifdef OBJ_EDITING_API // ivas_error TDREND_SRC_SPATIAL_SetGain( // BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ // const Word32 SrcGain_p /* i : Source gain */ // ); -#endif void TDREND_SRC_REND_UpdateFiltersFromSpatialParams_fx( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ -- GitLab From d9d2d0eb503a6956a74e05d0f4d423bd70f1d1e6 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 21 Oct 2025 15:06:26 +0200 Subject: [PATCH 07/15] [cleanup] accept OBJ_EDITING_EXAMPLE --- apps/decoder.c | 47 ----------------------------------------------- lib_com/options.h | 1 - 2 files changed, 48 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 8e3b166dd..f34d11536 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -171,13 +171,11 @@ static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); #endif static ivas_error load_hrtf_from_file( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const IVAS_AUDIO_CONFIG OutputConfig, const int32_t output_Fs ); -#ifdef OBJ_EDITING_EXAMPLE #ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE static void do_object_editing_fx( IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader ); #else static void do_object_editing_fx( IVAS_EDITABLE_PARAMETERS *editableParameters ); #endif -#endif /*------------------------------------------------------------------------------------------* @@ -2288,53 +2286,12 @@ static ivas_error decodeG192( } #endif -#ifdef OBJ_EDITING_EXAMPLE /* Do object metadata editing here ... */ #ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE do_object_editing_fx( &editableParameters, objectEditFileReader ); #else do_object_editing_fx( &editableParameters ); #endif -#else - /* edit object parameters...*/ - - /* put the objects equally spaced at the horizontal plane */ - /* and play a little bit with the gains... */ - Word16 obj_idx, non_diegetic_obj_idx; - Word16 num_nondiegetic_objects; - - num_nondiegetic_objects = 0; - for ( obj_idx = 0; obj_idx < editableParameters.num_obj; obj_idx++ ) - { - if ( !editableParameters.ism_metadata[obj_idx].non_diegetic_flag ) - { - num_nondiegetic_objects++; - } - } - if ( num_nondiegetic_objects ) - { - float start_angle, angle_inc; - angle_inc = 360.0f / (float) num_nondiegetic_objects; - start_angle = angle_inc / 2.0f; - for ( obj_idx = 0, non_diegetic_obj_idx = 0; obj_idx < editableParameters.num_obj; obj_idx++ ) - { - if ( !editableParameters.ism_metadata[obj_idx].non_diegetic_flag ) - { - editableParameters.ism_metadata[obj_idx].elevation_fx = 0; - editableParameters.ism_metadata[obj_idx].azimuth_fx = (Word32) ( ( start_angle + (float) non_diegetic_obj_idx * angle_inc ) * powf( 2.0f, 22.0f ) ); - non_diegetic_obj_idx++; - } - } - } - - /* breakover object gains */ - for ( obj_idx = 0; obj_idx < editableParameters.num_obj; obj_idx++ ) - { - editableParameters.ism_metadata[obj_idx].gain_fx = (Word32) ( ( 0.5f + (float) ( ( frame + obj_idx * 50 ) % 250 ) / 250.0f ) * powf( 2.0f, 29.0f ) ); - } - - editableParameters.gain_bed_fx = ( 1 << 28 ); // 0.5 in Q29 -#endif /* set new object parameters*/ if ( ( error = IVAS_DEC_SetEditableParameters( hIvasDec, editableParameters ) ) != IVAS_ERR_OK ) @@ -3151,14 +3108,12 @@ static ivas_error decodeVoIP( } /* Do object metadata editing here ... */ -#ifdef OBJ_EDITING_EXAMPLE #ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE do_object_editing_fx( &editableParameters, objectEditFileReader ); #else do_object_editing_fx( &editableParameters ); #endif -#endif /* set new object parameters */ if ( ( error = IVAS_DEC_SetEditableParameters( hIvasDec, editableParameters ) ) != IVAS_ERR_OK ) { @@ -3469,7 +3424,6 @@ cleanup: return error; } -#ifdef OBJ_EDITING_EXAMPLE /*---------------------------------------------------------------------* * do_object_editing_fx() @@ -3589,7 +3543,6 @@ static void do_object_editing_fx( return; } -#endif /*---------------------------------------------------------------------* * load_hrtf_from_file() diff --git a/lib_com/options.h b/lib_com/options.h index ce7538a64..9408536fc 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -123,7 +123,6 @@ #define TMP_FIX_SPLIT_REND // temporary fix to split-rendering (it follows the later state of the framework but it is needed now because of current test-conditions) #define TMP_FIX_OMASA_SR_BE // temporary fix to keep OMASA split-rendering BE #define OBJ_EDITING_COMMANDLINE /* obj editing command-line option */ -#define OBJ_EDITING_EXAMPLE /* obj editing example code in decoder.c */ #define OMASA_OBJECT_EDITING /* Nokia: object editing interface for OMASA */ #ifdef OMASA_OBJECT_EDITING #define NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES // Nokia: Fix 1399_1400 issue in float, this is essential for the BASOP porting -- GitLab From c815d52dde760947aedbad78a0166b2cb228dda4 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 21 Oct 2025 15:06:29 +0200 Subject: [PATCH 08/15] [cleanup] accept OMASA_OBJECT_EDITING --- lib_com/ivas_cnst.h | 2 - lib_com/ivas_prot_fx.h | 4 - lib_com/options.h | 3 - lib_dec/ivas_dirac_dec_fx.c | 12 - lib_dec/ivas_init_dec_fx.c | 14 - lib_dec/ivas_ism_renderer_fx.c | 14 - lib_dec/ivas_jbm_dec_fx.c | 6 - lib_dec/ivas_masa_dec_fx.c | 8 - lib_dec/ivas_omasa_dec_fx.c | 106 ---- lib_dec/ivas_stat_dec.h | 19 - lib_dec/lib_dec_fx.c | 14 - .../ivas_dirac_dec_binaural_functions_fx.c | 484 ------------------ lib_rend/ivas_dirac_output_synthesis_dec_fx.c | 14 - 13 files changed, 700 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index f40dad61d..bb61171a8 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1257,11 +1257,9 @@ enum #define NBITS_HR_COH 4 #define OMASA_TDREND_MATCHING_GAIN_FX 26026 //TODO: insert proper Q representations -#ifdef OMASA_OBJECT_EDITING #define OMASA_GAIN_EDIT_THR_FX 246 /* OMASA gain change threshold, 0.06f in Q12 */ #define OMASA_AZI_EDIT_THR_FX ONE_IN_Q22 /* OMASA-DISC azimuth change threshold, 1.0f in Q22 */ #define OMASA_ELE_EDIT_THR_FX ONE_IN_Q23 /* OMASA-DISC elevation change threshold, 2.0f in Q22 */ -#endif #define MASA_INV_ANGLE_AT_EQUATOR_DEG_Q30 1453366656l /* 1.353553128183453f in Q30 */ diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index 690dd7cb9..a88c13583 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -3951,11 +3951,7 @@ void ivas_set_ism_importance_interformat_fx( const Word16 lp_noise_CPE_fx, /* i : LP filtered total noise estimation */ Word16 ism_imp[] /* o : ISM importance flags */ ); -#ifdef OMASA_OBJECT_EDITING void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( -#else -void ivas_omasa_preProcessStereoTransportsForMovedObjects_fx( -#endif Decoder_Struct *st_ivas, Word32 inRe_fx[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /*cldfb_buf_q*/ Word32 inIm_fx[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /*cldfb_buf_q*/ diff --git a/lib_com/options.h b/lib_com/options.h index 9408536fc..7ffa1495b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -123,10 +123,7 @@ #define TMP_FIX_SPLIT_REND // temporary fix to split-rendering (it follows the later state of the framework but it is needed now because of current test-conditions) #define TMP_FIX_OMASA_SR_BE // temporary fix to keep OMASA split-rendering BE #define OBJ_EDITING_COMMANDLINE /* obj editing command-line option */ -#define OMASA_OBJECT_EDITING /* Nokia: object editing interface for OMASA */ -#ifdef OMASA_OBJECT_EDITING #define NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES // Nokia: Fix 1399_1400 issue in float, this is essential for the BASOP porting -#endif #define OBJ_EDITING_PARAMISM_BIN /* Nokia: object editing for ParamISM to binaural */ #define FIX_BRATE_SWITCHING /* VA: fix bitrate switching cases in OMASA and OSBA */ #define OBJ_EDIT_BASOP diff --git a/lib_dec/ivas_dirac_dec_fx.c b/lib_dec/ivas_dirac_dec_fx.c index dfb63376b..a41b2310f 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -2807,7 +2807,6 @@ void ivas_dirac_dec_render_sf_fx( move16(); } -#ifdef OMASA_OBJECT_EDITING IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) { #ifdef FIX_1319_STACK_SBA_DECODER @@ -2816,17 +2815,6 @@ void ivas_dirac_dec_render_sf_fx( ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( st_ivas, Cldfb_RealBuffer_Temp_fx, Cldfb_ImagBuffer_Temp_fx, &cldfb_buf_q, hSpatParamRendCom->num_freq_bands, subframe_idx ); #endif } -#else - test(); - IF( ( NE_16( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) && NE_16( st_ivas->ism_mode, ISM_MASA_MODE_MASA_ONE_OBJ ) ) ) - { -#ifdef FIX_1319_STACK_SBA_DECODER - ivas_omasa_preProcessStereoTransportsForMovedObjects_fx( st_ivas, Cldfb_RealBuffer_Binaural_fx[0], Cldfb_ImagBuffer_Binaural_fx[0], &cldfb_buf_q, hSpatParamRendCom->num_freq_bands, subframe_idx ); -#else - ivas_omasa_preProcessStereoTransportsForMovedObjects_fx( st_ivas, Cldfb_RealBuffer_Temp_fx, Cldfb_ImagBuffer_Temp_fx, &cldfb_buf_q, hSpatParamRendCom->num_freq_bands, subframe_idx ); -#endif - } -#endif } FOR( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[subframe_idx]; slot_idx++ ) diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index 52049a064..7844e6b65 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -2161,24 +2161,10 @@ ivas_error ivas_init_decoder_fx( reset_indices_dec( st_ivas->hSCE[0]->hCoreCoder[0] ); -#ifndef OMASA_OBJECT_EDITING - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { -#endif IF( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) { return error; } -#ifndef OMASA_OBJECT_EDITING - } - else - { - IF( NE_32( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, 1, NULL ) ), IVAS_ERR_OK ) ) - { - return error; - } - } -#endif } ELSE IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) { diff --git a/lib_dec/ivas_ism_renderer_fx.c b/lib_dec/ivas_ism_renderer_fx.c index 3f3ba29ff..64c7f7b08 100644 --- a/lib_dec/ivas_ism_renderer_fx.c +++ b/lib_dec/ivas_ism_renderer_fx.c @@ -618,7 +618,6 @@ void ivas_omasa_separate_object_render_jbm_fx( IF( single_separated ) { -#ifdef OMASA_OBJECT_EDITING test(); IF( EQ_16( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) && st_ivas->hMasaIsmData->ism_dir_is_edited[st_ivas->hMasaIsmData->idx_separated_ism] ) { @@ -634,16 +633,9 @@ void ivas_omasa_separate_object_render_jbm_fx( elevation = st_ivas->hMasaIsmData->elevation_separated_ism_fx[md_idx]; move16(); } -#else - azimuth = st_ivas->hMasaIsmData->azimuth_separated_ism[md_idx]; - move16(); - elevation = st_ivas->hMasaIsmData->elevation_separated_ism[md_idx]; - move16(); -#endif } ELSE { -#ifdef OMASA_OBJECT_EDITING IF( st_ivas->hMasaIsmData->ism_dir_is_edited[obj] ) { azimuth = st_ivas->hMasaIsmData->azimuth_ism_edited_fx[obj]; @@ -658,12 +650,6 @@ void ivas_omasa_separate_object_render_jbm_fx( elevation = st_ivas->hMasaIsmData->elevation_ism_fx[obj][md_idx]; move16(); } -#else - azimuth = st_ivas->hMasaIsmData->azimuth_ism[obj][md_idx]; - move16(); - elevation = st_ivas->hMasaIsmData->elevation_ism[obj][md_idx]; - move16(); -#endif } if ( st_ivas->hOutSetup.is_planar_setup ) diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index 78c5695ac..8a36dda92 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -4431,7 +4431,6 @@ void ivas_dec_prepare_renderer_fx( test(); IF( EQ_16( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) && EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) ) { -#ifdef OMASA_OBJECT_EDITING v_multc_fx_16( st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], OMASA_TDREND_MATCHING_GAIN_FX, st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available ); IF( st_ivas->hMasaIsmData->ism_gain_is_edited[n] ) @@ -4439,15 +4438,11 @@ void ivas_dec_prepare_renderer_fx( v_multc_fx_16( st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], st_ivas->hMasaIsmData->gain_ism_edited_fx[n], st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available ); Scale_sig32( st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available, Q3 ); // Q8 -> Q11 } -#else - v_multc_fx_16( st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], OMASA_TDREND_MATCHING_GAIN_FX, st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available ); -#endif } delay_signal32_fx( st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available, st_ivas->hMasaIsmData->delayBuffer_fx[n], st_ivas->hMasaIsmData->delayBuffer_size ); // TODO: check if tis is a bug in main already } -#ifdef OMASA_OBJECT_EDITING test(); IF( EQ_16( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) && EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) ) { @@ -4460,7 +4455,6 @@ void ivas_dec_prepare_renderer_fx( } } } -#endif } } ELSE IF( EQ_16( st_ivas->ivas_format, MC_FORMAT ) ) diff --git a/lib_dec/ivas_masa_dec_fx.c b/lib_dec/ivas_masa_dec_fx.c index 70b244a94..032a629a1 100644 --- a/lib_dec/ivas_masa_dec_fx.c +++ b/lib_dec/ivas_masa_dec_fx.c @@ -835,14 +835,8 @@ ivas_error ivas_masa_dec_open_fx( /* ISM metadata */ -#ifdef OMASA_OBJECT_EDITING test(); IF( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) && st_ivas->hIsmMetaData[0] != NULL ) -#else - test(); - test(); - IF( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) && st_ivas->hIsmMetaData[0] != NULL && EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) -#endif { /* 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 ); @@ -3333,9 +3327,7 @@ static Word16 ivas_decode_masaism_metadata_fx( FOR( obj = 0; obj < nchan_ism; obj++ ) { -#ifdef OMASA_OBJECT_EDITING hMasaIsmData->bits_ism[obj] = bits_ism[obj]; -#endif index = 0; move16(); IF( LT_16( bits_ism[obj], 8 ) ) /* if low resolution, can look to the past */ diff --git a/lib_dec/ivas_omasa_dec_fx.c b/lib_dec/ivas_omasa_dec_fx.c index 0285b724e..6a44c76a3 100644 --- a/lib_dec/ivas_omasa_dec_fx.c +++ b/lib_dec/ivas_omasa_dec_fx.c @@ -315,11 +315,7 @@ ivas_error ivas_omasa_data_open_fx( ) { MASA_ISM_DATA_HANDLE hMasaIsmData; -#ifdef OMASA_OBJECT_EDITING Word16 ch, band_idx; -#else - Word16 ch, bin; -#endif Word16 sf, obj_idx; IF( ( hMasaIsmData = (MASA_ISM_DATA_HANDLE) malloc( sizeof( MASA_ISM_DATA ) ) ) == NULL ) @@ -327,7 +323,6 @@ ivas_error ivas_omasa_data_open_fx( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MASA ISM data\n" ) ); } -#ifdef OMASA_OBJECT_EDITING FOR( band_idx = 0; band_idx < MASA_FREQUENCY_BANDS; band_idx++ ) { FOR( ch = 0; ch < 2; ch++ ) @@ -359,52 +354,22 @@ ivas_error ivas_omasa_data_open_fx( hMasaIsmData->objectsEdited = 0; move32(); -#else - FOR( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ ) - { - FOR( ch = 0; ch < 2; ch++ ) - { - hMasaIsmData->ismPreprocMatrix_fx[ch][ch][bin] = 32767; /* 1.0f in Q15 */ - move16(); - hMasaIsmData->ismPreprocMatrix_fx[1 - ch][ch][bin] = 0; // Q15 - move16(); - hMasaIsmData->eneMoveIIR_fx[ch][bin] = 0; // Q22 - move32(); - hMasaIsmData->enePreserveIIR_fx[ch][bin] = 0; // Q22 - move32(); - } - hMasaIsmData->preprocEneTarget_fx[bin] = 0; // Q19 - move32(); - hMasaIsmData->preprocEneRealized_fx[bin] = 0; // Q19 - move32(); - } - - hMasaIsmData->objectsMoved = 0; - move16(); -#endif hMasaIsmData->delayBuffer_fx = NULL; move16(); FOR( ch = 0; ch < MAX_NUM_OBJECTS; ch++ ) { -#ifdef OMASA_OBJECT_EDITING hMasaIsmData->ism_dir_is_edited[ch] = 0; hMasaIsmData->ism_gain_is_edited[ch] = 0; -#else - hMasaIsmData->ism_is_edited[ch] = 0; - move16(); -#endif hMasaIsmData->q_elevation_old_fx[ch] = 0; // Q22 move32(); hMasaIsmData->q_azimuth_old_fx[ch] = 0; // Q22 move32(); } -#ifdef OMASA_OBJECT_EDITING hMasaIsmData->masa_gain_is_edited = 0; hMasaIsmData->idx_separated_ism = -1; move16(); -#endif FOR( obj_idx = 0; obj_idx < MAX_NUM_OBJECTS; obj_idx++ ) { @@ -521,11 +486,7 @@ ivas_error ivas_omasa_dec_config_fx( Word16 *num_src, Word16 SrcInd[MAX_NUM_TDREND_CHANNELS] ) { -#ifdef OMASA_OBJECT_EDITING Word16 k, sce_id, nSCE_old, nchan_hp20_old, numCldfbAnalyses_old, numCldfbSyntheses_old; -#else - Word16 k, sce_id, nSCE_old, nchan_hp20_old, numCldfbAnalyses_old, numCldfbSyntheses_old, n_MD; -#endif Word32 ivas_total_brate, ism_total_brate, cpe_brate; Word32 brate_SCE, brate_CPE; ISM_MODE ism_mode_old; @@ -651,7 +612,6 @@ ivas_error ivas_omasa_dec_config_fx( IF( NE_16( ism_mode_old, st_ivas->ism_mode ) ) { /* ISM MD reconfig. */ -#ifdef OMASA_OBJECT_EDITING IF( st_ivas->hIsmMetaData[0] == NULL ) { IF( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) @@ -666,66 +626,6 @@ ivas_error ivas_omasa_dec_config_fx( ivas_ism_reset_metadata_handle_dec_fx( st_ivas->hIsmMetaData[k] ); } } -#else - n_MD = 0; - move16(); - - IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - /* the full number of hIsmMetaData are needed for EXT output */ - IF( st_ivas->hIsmMetaData[0] == NULL ) - { - IF( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) - { - return error; - } - } - ELSE - { - FOR( k = 0; k < st_ivas->nchan_ism; k++ ) - { - ivas_ism_reset_metadata_handle_dec_fx( st_ivas->hIsmMetaData[k] ); - } - } - } - ELSE - { - test(); - IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_MASA_ONE_OBJ ) || EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) - { - n_MD = 1; - move16(); - - IF( st_ivas->hIsmMetaData[0] == NULL ) - { - error = ivas_ism_metadata_dec_create_fx( st_ivas, 1, NULL ); - move32(); - IF( NE_32( error, IVAS_ERR_OK ) ) - { - return error; - } - } - ELSE - { - ivas_ism_reset_metadata_handle_dec_fx( st_ivas->hIsmMetaData[0] ); - } - } - ELSE IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) - { - n_MD = st_ivas->nchan_ism; - move16(); - - error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, NULL ); - move32(); - IF( NE_32( error, IVAS_ERR_OK ) ) - { - return error; - } - } - - ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); - } -#endif st_ivas->hCPE[0]->element_brate = L_sub( ivas_total_brate, ism_total_brate ); @@ -1184,7 +1084,6 @@ void ivas_omasa_dirac_rend_jbm_fx( IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_MASA_ONE_OBJ ) || EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) { Copy32( &output_f[CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[0], *nSamplesRendered ); -#ifdef OMASA_OBJECT_EDITING IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) { /* Gain separated object, if edited */ @@ -1198,7 +1097,6 @@ void ivas_omasa_dirac_rend_jbm_fx( } } } -#endif } ELSE { @@ -1206,17 +1104,14 @@ void ivas_omasa_dirac_rend_jbm_fx( { Copy32( &output_f[n + CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[n], *nSamplesRendered ); -#ifdef OMASA_OBJECT_EDITING /* Gain discrete objects, if edited */ IF( st_ivas->hMasaIsmData->ism_gain_is_edited[n] ) { v_multc_fx_16( data_separated_objects[n], st_ivas->hMasaIsmData->gain_ism_edited_fx[n], data_separated_objects[n], *nSamplesRendered ); // Q = 8 Scale_sig32( data_separated_objects[n], *nSamplesRendered, Q3 ); // Q = 11 } -#endif } -#ifdef OMASA_OBJECT_EDITING /* Gain MASA part, if edited */ IF( st_ivas->hMasaIsmData->masa_gain_is_edited ) { @@ -1226,7 +1121,6 @@ void ivas_omasa_dirac_rend_jbm_fx( Scale_sig32( output_f[n], *nSamplesRendered, Q3 ); // Q = 11 } } -#endif } } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index acf9d5904..a82fdf836 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -959,24 +959,14 @@ typedef struct ivas_masa_ism_data_structure Word16 azimuth_ism_edited_fx[MAX_NUM_OBJECTS]; // Q0 Word16 elevation_ism_edited_fx[MAX_NUM_OBJECTS]; // Q0 -#ifdef OMASA_OBJECT_EDITING UWord8 ism_dir_is_edited[MAX_NUM_OBJECTS]; -#else - UWord8 ism_is_edited[MAX_NUM_OBJECTS]; -#endif Word16 gain_ism_fx[MAX_NUM_OBJECTS]; Word16 gain_masa_fx; -#ifdef OMASA_OBJECT_EDITING Word16 gain_ism_edited_fx[MAX_NUM_OBJECTS]; // Q12 UWord8 ism_gain_is_edited[MAX_NUM_OBJECTS]; Word16 gain_masa_edited_fx; // Q12 UWord8 masa_gain_is_edited; -#else - Word16 azimuth_ism_edited[MAX_NUM_OBJECTS]; - Word16 elevation_ism_edited[MAX_NUM_OBJECTS]; - // UWord8 ism_is_edited[MAX_NUM_OBJECTS]; -#endif Word16 idx_separated_ism; Word16 azimuth_separated_ism_fx[MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR]; @@ -985,7 +975,6 @@ typedef struct ivas_masa_ism_data_structure Word32 q_azimuth_old_fx[MAX_NUM_OBJECTS]; /* Q22 */ Word32 q_elevation_old_fx[MAX_NUM_OBJECTS]; /* Q22 */ -#ifdef OMASA_OBJECT_EDITING UWord8 objectsEdited; Word32 preprocEneTarget_fx[MASA_FREQUENCY_BANDS]; Word16 preprocEneTarget_e[MASA_FREQUENCY_BANDS]; @@ -1000,14 +989,6 @@ typedef struct ivas_masa_ism_data_structure Word32 eneOrigIIR_fx[MASA_FREQUENCY_BANDS]; Word16 eneOrigIIR_e[MASA_FREQUENCY_BANDS]; Word16 bits_ism[MAX_NUM_OBJECTS]; -#else - Word16 ismPreprocMatrix_fx[2][2][CLDFB_NO_CHANNELS_MAX]; /* Q15 */ - UWord8 objectsMoved; - Word32 eneMoveIIR_fx[2][CLDFB_NO_CHANNELS_MAX]; /*Q-22*/ - Word32 enePreserveIIR_fx[2][CLDFB_NO_CHANNELS_MAX]; /*Q-22*/ - Word32 preprocEneTarget_fx[CLDFB_NO_CHANNELS_MAX]; /*Q-19*/ - Word32 preprocEneRealized_fx[CLDFB_NO_CHANNELS_MAX]; /*Q-19*/ -#endif Word32 **delayBuffer_fx; /* Q11 */ Word16 delayBuffer_size; diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 70e46422e..e7001e939 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -38,9 +38,7 @@ #include "ivas_prot_rend_fx.h" #include "prot_fx.h" #include "isar_prot.h" -#ifdef OMASA_OBJECT_EDITING #include "ivas_rom_com.h" -#endif #include "lib_isar_pre_rend.h" #include "ivas_prot_fx.h" #include "jbm_jb4sb.h" @@ -4081,14 +4079,10 @@ ivas_error IVAS_DEC_GetSamplesDecoder( test(); IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) || EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) || EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) { -#ifdef OMASA_OBJECT_EDITING test(); test(); test(); IF( EQ_32( st_ivas->ism_mode, ISM_MODE_DISC ) || EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) || EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) || EQ_32( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) ) -#else - IF( st_ivas->ism_mode == ISM_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_SBA_MODE_DISC ) -#endif { Word16 obj; ISM_METADATA_HANDLE *hIsmMetaData = st_ivas->hIsmMetaData; @@ -4254,7 +4248,6 @@ ivas_error IVAS_DEC_GetEditableParameters( assert( 0 && "This should never happen!" ); } } -#ifdef OMASA_OBJECT_EDITING ELSE IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) && ( EQ_32( ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) || EQ_32( ism_mode, ISM_MASA_MODE_DISC ) ) ) { /* object editing possible only in two highest OMASA modes */ @@ -4319,7 +4312,6 @@ ivas_error IVAS_DEC_GetEditableParameters( } } } -#endif return IVAS_ERR_OK; } @@ -4335,11 +4327,7 @@ ivas_error IVAS_DEC_SetEditableParameters( IVAS_DEC_HANDLE hIvasDec, IVAS_EDITABLE_PARAMETERS hIvasEditableParameters ) { -#ifdef OMASA_OBJECT_EDITING Word16 dirac_read_idx, obj; -#else - Word16 obj; -#endif Decoder_Struct *st_ivas; ISM_MODE ism_mode; @@ -4487,7 +4475,6 @@ ivas_error IVAS_DEC_SetEditableParameters( assert( 0 && "This should never happen!" ); } } -#ifdef OMASA_OBJECT_EDITING ELSE IF( EQ_16( st_ivas->ivas_format, MASA_ISM_FORMAT ) && ( EQ_16( ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) || EQ_16( ism_mode, ISM_MASA_MODE_DISC ) ) ) { Word32 id_th; @@ -4623,7 +4610,6 @@ ivas_error IVAS_DEC_SetEditableParameters( } move16(); } -#endif return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index 9d5302d1d..0b583aaa0 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -962,7 +962,6 @@ static void ivas_dirac_dec_binaural_internal_fx( test(); test(); test(); -#ifdef OMASA_OBJECT_EDITING #ifdef OBJ_EDITING_PARAMISM_BIN test(); test(); @@ -975,13 +974,6 @@ static void ivas_dirac_dec_binaural_internal_fx( ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( st_ivas, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, &q_inp, nBins, subframe ); } -#else - IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) && EQ_16( nchan_transport, 2 ) && NE_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) && NE_32( st_ivas->ism_mode, ISM_MASA_MODE_MASA_ONE_OBJ ) ) - { - /* Un-tested function. No test-case is hitting.*/ - ivas_omasa_preProcessStereoTransportsForMovedObjects_fx( st_ivas, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, &q_inp, nBins, subframe ); - } -#endif IF( hCombinedOrientationData ) { @@ -1721,7 +1713,6 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices_fx( UWord16 ismDirIndex; ismDirIndex = sub( dirIndex, hSpatParamRendCom->numParametricDirections ); assert( hMasaIsmData != NULL && "hMasaIsmData should not be NULL if we use it" ); -#ifdef OMASA_OBJECT_EDITING IF( hMasaIsmData->ism_dir_is_edited[ismDirIndex] ) { aziDeg = hMasaIsmData->azimuth_ism_edited_fx[ismDirIndex]; @@ -1729,15 +1720,6 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices_fx( eleDeg = hMasaIsmData->elevation_ism_edited_fx[ismDirIndex]; move16(); } -#else - IF( hMasaIsmData->ism_is_edited[ismDirIndex] ) - { - aziDeg = hMasaIsmData->azimuth_ism_edited[ismDirIndex]; - move16(); - eleDeg = hMasaIsmData->elevation_ism_edited[ismDirIndex]; - move16(); - } -#endif ELSE { aziDeg = hMasaIsmData->azimuth_ism_fx[ismDirIndex][dirac_read_idx]; @@ -2592,7 +2574,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( { IF( EQ_16( ism_mode, ISM_MASA_MODE_DISC ) ) { -#ifdef OMASA_OBJECT_EDITING IF( hMasaIsmData->ism_dir_is_edited[chB] ) { aziDeg = hMasaIsmData->azimuth_ism_edited_fx[chB]; @@ -2607,16 +2588,9 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( eleDeg = hMasaIsmData->elevation_ism_fx[chB][dirac_read_idx]; move16(); } -#else - aziDeg = hMasaIsmData->azimuth_ism[chB][dirac_read_idx]; - move16(); - eleDeg = hMasaIsmData->elevation_ism[chB][dirac_read_idx]; - move16(); -#endif } ELSE { -#ifdef OMASA_OBJECT_EDITING test(); IF( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ && hMasaIsmData->ism_dir_is_edited[hMasaIsmData->idx_separated_ism] ) { @@ -2632,12 +2606,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( eleDeg = hMasaIsmData->elevation_separated_ism_fx[dirac_read_idx]; move16(); } -#else - aziDeg = hMasaIsmData->azimuth_separated_ism[dirac_read_idx]; - move16(); - eleDeg = hMasaIsmData->elevation_separated_ism[dirac_read_idx]; - move16(); -#endif instantChange = 1; move16(); } @@ -4959,7 +4927,6 @@ static void getDirectPartGains_fx( IF( renderStereoOutputInsteadOfBinaural ) /* In stereo (i.e. non-binaural) rendering mode */ { -#ifdef OMASA_OBJECT_EDITING *lImagp = 0; *rImagp = 0; move32(); @@ -5091,115 +5058,6 @@ static void getDirectPartGains_fx( move32(); move32(); } -#else - /* Convert azi and ele to an azi value of the cone of confusion */ - - // y = ( sinf( aziRad ) * cosf( eleRad ) ); - - IF( GT_16( abs_s( eleDeg ), 180 ) ) - { - // cos(180 + x) = -cos(x) - cos_val = -ptr_cos[sub( abs_s( eleDeg ), 180 )]; // Q31 - } - ELSE - { - cos_val = ptr_cos[abs_s( eleDeg )]; // Q31 - } - move32(); - - IF( GT_16( aziDeg, 180 ) ) - { - // sin(180 + x) = -sin(x) - sin_val = -ptr_sin[sub( aziDeg, 180 )]; // Q31 - } - ELSE IF( LT_16( aziDeg, -180 ) ) - { - // sin(-(180 + x)) = sin(180 + x) = sinx - sin_val = ptr_sin[sub( abs_s( aziDeg ), 180 )]; // Q31 - } - ELSE - { - sin_val = ptr_sin[aziDeg]; // Q31 - } - move32(); - - y = Mpy_32_32( sin_val, cos_val ); // Q31 - e_mappedX = 0; - move16(); - mappedX = Sqrt32( L_max( 0, L_sub( ONE_IN_Q31, Mpy_32_32( y, y ) ) ), &e_mappedX ); - - aziRadMapped = BASOP_util_atan2( y, mappedX, negate( e_mappedX ) ); // Q13 - - /* Determine the real valued amplitude panning gains */ - *lImagp = 0; - *rImagp = 0; - move32(); - move32(); - IF( GE_16( aziRadMapped, shr( LsAngleRad, 2 ) ) ) - { /* Left side */ - *lRealp = ONE_IN_Q31; - *rRealp = 0; - move32(); - move32(); - } - ELSE IF( LE_16( aziRadMapped, negate( shr( LsAngleRad, 2 ) ) ) ) - { /* Right side */ - *lRealp = 0; - *rRealp = ONE_IN_Q31; - move32(); - move32(); - } - ELSE /* Tangent panning law */ - { - Word16 e_div, div, e_a, e_a3, temp_16_1, temp_16_2, e_num, e_den; - div = BASOP_Util_Divide3232_Scale( y, mappedX, &e_div ); - e_div = sub( e_div, e_mappedX ); - - A = mult( div, INV_TAN30_FX ); - e_a = add( e_div, 1 ); - - e_num = BASOP_Util_Add_MantExp( A, e_a, -32767, 0, &temp_16_1 ); - e_den = BASOP_Util_Add_MantExp( A, e_a, 32767, 0, &temp_16_2 ); - IF( temp_16_2 <= 0 ) - { - temp_16_2 = 32; - e_den = 0; - move16(); - move16(); - } - A2 = BASOP_Util_Divide1616_Scale( temp_16_1, temp_16_2, &e_div ); - e_div = add( e_div, sub( e_num, e_den ) ); - - e_den = BASOP_Util_Add_MantExp( mult( A2, A2 ), add( e_div, e_div ), 32767, 0, &temp_16_2 ); - A3 = BASOP_Util_Divide1616_Scale( 32767, temp_16_2, &e_a3 ); - e_a3 = sub( e_a3, e_den ); - // A3 = 1.0f / ( A2 * A2 + 1.0f ); // Q15 - Word32 temp_32 = L_shr( L_deposit_h( A3 ), sub( 0, e_a3 ) ); - Word16 temp_e = 0; - e_a3 = 0; - move16(); - move16(); - *lRealp = Sqrt32( temp_32, &e_a3 ); - *rRealp = Sqrt32( L_sub( ONE_IN_Q31, temp_32 ), &temp_e ); - *lRealp = L_shr( *lRealp, sub( 0, e_a3 ) ); // Q31 - *rRealp = L_shr( *rRealp, sub( 0, temp_e ) ); // Q31 - move32(); - move32(); - move32(); - move32(); - } - - /* Scaling to have the same expected gain as for the HRTF rendering */ - *lRealp = Mpy_32_32( *lRealp, SQRT2_FX ); // Q30 - *rRealp = Mpy_32_32( *rRealp, SQRT2_FX ); // Q30 - - *lRealp = L_shr( *lRealp, 2 ); // Q28 - *rRealp = L_shr( *rRealp, 2 ); // Q28 - move32(); - move32(); - move32(); - move32(); -#endif } ELSE /* In regular binaural rendering mode */ { @@ -5380,7 +5238,6 @@ Word16 configure_reqularization_factor_fx( } -#ifdef OMASA_OBJECT_EDITING /*-------------------------------------------------------------------* * ivas_omasa_preProcessStereoTransportsForEditedObjects() * @@ -6601,347 +6458,6 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( return; } -#else -/*-------------------------------------------------------------------* - * ivas_omasa_preProcessStereoTransportsForMovedObjects_fx() - * - * - *-------------------------------------------------------------------*/ - -void ivas_omasa_preProcessStereoTransportsForMovedObjects_fx( - Decoder_Struct *st_ivas, - Word32 inRe_fx[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /*cldfb_buf_q*/ - Word32 inIm_fx[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /*cldfb_buf_q*/ - Word16 *cldfb_buf_q, - const Word16 nBins, - const Word16 subframe ) -{ - Word16 bin, ch, inCh, outCh, ismDirIndex, slot; - SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; - MASA_ISM_DATA_HANDLE hMasaIsmData; - UWord8 enableCentering; - Word16 dirac_read_idx; - Word16 nSlots; - - hSpatParamRendCom = st_ivas->hSpatParamRendCom; - hMasaIsmData = st_ivas->hMasaIsmData; - - test(); - test(); - IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_FOA ) || EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_HOA2 ) || EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_HOA3 ) ) - { - enableCentering = 0; - move16(); - } - ELSE - { - enableCentering = 1; - move16(); - } - - /* Bypass processing until first object is moved */ - IF( EQ_16( hMasaIsmData->objectsMoved, 0 ) ) - { - FOR( ismDirIndex = 0; ismDirIndex < hSpatParamRendCom->numIsmDirections; ismDirIndex++ ) - { - if ( hMasaIsmData->ism_is_edited[ismDirIndex] ) - { - hMasaIsmData->objectsMoved = 1; - move16(); - } - } - IF( EQ_16( hMasaIsmData->objectsMoved, 0 ) ) - { - /* No objects have moved so far */ - return; - } - } - - /* Perform object-movement based processing */ - nSlots = hSpatParamRendCom->subframe_nbslots[subframe]; - move16(); - dirac_read_idx = hSpatParamRendCom->render_to_md_map[subframe]; - move16(); - - FOR( bin = 0; bin < nBins; bin++ ) - { - Word16 ismPreprocMtxNew_fx[2][2]; - Word16 ismPreprocMtxIncrement_fx[2][2]; - Word16 eneMove_fx[2]; - Word16 enePreserve_fx[2]; - Word16 ismRatioAcc_fx; - Word32 subframeEne_fx; - Word32 Enes_fx[2]; - Word16 normEnes_fx[2]; - Word16 remainderNormEne_fx; - Word16 normEnes_q_fx[2], temp_q = 0; - Word16 eneMove_q_fx[2], enePreserve_q_fx[2], temp1; - Word32 temp; - - set16_fx( ismPreprocMtxNew_fx[0], 0, 2 ); - set16_fx( ismPreprocMtxNew_fx[1], 0, 2 ); - set16_fx( ismPreprocMtxIncrement_fx[0], 0, 2 ); - set16_fx( ismPreprocMtxIncrement_fx[1], 0, 2 ); - set16_fx( eneMove_fx, 0, 2 ); - set16_fx( enePreserve_fx, 0, 2 ); - ismRatioAcc_fx = 0; - move16(); - subframeEne_fx = 0; - move32(); - set16_fx( normEnes_fx, 0, 2 ); - set32_fx( Enes_fx, 0, 2 ); - set16_fx( normEnes_q_fx, Q31, 2 ); - set16_fx( eneMove_q_fx, Q31, 2 ); - set16_fx( enePreserve_q_fx, Q31, 2 ); - - /* Determine transport normalized energies and subframe energy */ - FOR( slot = 0; slot < nSlots; slot++ ) - { - FOR( ch = 0; ch < 2; ch++ ) - { - Enes_fx[ch] = L_add( Enes_fx[ch], Mpy_32_32( inRe_fx[ch][slot][bin], inRe_fx[ch][slot][bin] ) ); // Q = *cldfb_buf_q + *cldfb_buf_q - 31 = Q-19 - move32(); - Enes_fx[ch] = L_add( Enes_fx[ch], Mpy_32_32( inIm_fx[ch][slot][bin], inIm_fx[ch][slot][bin] ) ); // Q = *cldfb_buf_q + *cldfb_buf_q - 31 = Q-19 - move32(); - } - - subframeEne_fx = L_add( Enes_fx[0], Enes_fx[1] ); // Q = *cldfb_buf_q + *cldfb_buf_q - 31 = Q-19 - - IF( NE_32( subframeEne_fx, 0 ) ) - { - normEnes_fx[0] = BASOP_Util_Divide3232_Scale( Enes_fx[0], subframeEne_fx, &temp_q ); - move32(); - normEnes_fx[0] = shr( normEnes_fx[0], sub( sub( 15, temp_q ), Q12 ) ); // Q12 - move32(); - normEnes_fx[1] = BASOP_Util_Divide3232_Scale( Enes_fx[1], subframeEne_fx, &temp_q ); - move32(); - normEnes_fx[1] = shr( normEnes_fx[1], sub( sub( 15, temp_q ), Q12 ) ); // Q12 - move32(); - } - ELSE - { - normEnes_fx[0] = BASOP_Util_Divide3232_Scale( Enes_fx[0], EPSILON_FX, &temp_q ); - move32(); - normEnes_fx[0] = shr( normEnes_fx[0], sub( sub( 15, temp_q ), Q12 ) ); // Q12 - move32(); - normEnes_fx[1] = BASOP_Util_Divide3232_Scale( Enes_fx[1], EPSILON_FX, &temp_q ); - move32(); - normEnes_fx[1] = shr( normEnes_fx[1], sub( sub( 15, temp_q ), Q12 ) ); // Q12 - move32(); - } - - - /* For each ismDir, formulate a mix-matrix that moves object audio signals between - * left and right channels when needed. Make a combined matrix by a ratio-weighted sum */ - FOR( ismDirIndex = 0; ismDirIndex < hSpatParamRendCom->numIsmDirections; ismDirIndex++ ) - { - Word16 panGainsOut_fx[2]; - Word16 panGainsIn_fx[2]; - Word16 ratio; - Word16 panEnesOut_fx[2]; - Word16 panEnesIn_fx[2]; - Word16 centeringFactor_fx; - - ratio = extract_l( hMasaIsmData->energy_ratio_ism_fx[ismDirIndex][dirac_read_idx][bin] ); // Q14 - ismRatioAcc_fx = add( ismRatioAcc_fx, ratio ); - - /* Get input and output panning gains */ - ivas_get_stereo_panning_gains_fx( hMasaIsmData->azimuth_ism[ismDirIndex][dirac_read_idx], - hMasaIsmData->elevation_ism[ismDirIndex][dirac_read_idx], - panGainsIn_fx ); - - IF( hMasaIsmData->ism_is_edited[ismDirIndex] ) - { - ivas_get_stereo_panning_gains_fx( hMasaIsmData->azimuth_ism_edited[ismDirIndex], - hMasaIsmData->elevation_ism_edited[ismDirIndex], - panGainsOut_fx ); - } - ELSE - { - /* When not edited, input and output pan gains are the same */ - FOR( ch = 0; ch < 2; ch++ ) - { - panGainsOut_fx[ch] = panGainsIn_fx[ch]; - move16(); - } - } - - /* Determine pan enes */ - FOR( ch = 0; ch < 2; ch++ ) - { - panEnesOut_fx[ch] = mult( panGainsOut_fx[ch], panGainsOut_fx[ch] ); // Q15 - move16(); - panEnesIn_fx[ch] = mult( panGainsIn_fx[ch], panGainsIn_fx[ch] ); // Q15 - move16(); - } - - IF( enableCentering ) - { - centeringFactor_fx = s_max( 0, sub( mult( shl( 2, 13 ), abs_s( sub( panEnesIn_fx[0], panEnesOut_fx[0] ) ) ), ONE_IN_Q13 ) ); // Q13 - FOR( ch = 0; ch < 2; ch++ ) - { - panEnesOut_fx[ch] = mult( panEnesOut_fx[ch], sub( ONE_IN_Q13, centeringFactor_fx ) ); // Q13 - move16(); - panEnesOut_fx[ch] = add( panEnesOut_fx[ch], shr( centeringFactor_fx, 1 ) ); // Q13 - move16(); - } - } - - FOR( ch = 0; ch < 2; ch++ ) - { - Word16 eneMoveThis_fx; - Word16 enePreserveThis_fx; - - eneMoveThis_fx = s_max( 0, sub( shr( panEnesIn_fx[ch], 2 ), panEnesOut_fx[ch] ) ); // Q13 - enePreserveThis_fx = sub( shr( panEnesIn_fx[ch], 2 ), eneMoveThis_fx ); // Q13 - - eneMove_fx[ch] = mult( ratio, eneMoveThis_fx ); // Q = 14 + 13 - 15 = 12 - move16(); - enePreserve_fx[ch] = mult( ratio, enePreserveThis_fx ); // Q = 14 + 13 - 15 = 12 - move16(); - - /* Subtract object parts from normEnes */ - normEnes_fx[ch] = sub( normEnes_fx[ch], shr( mult( panEnesIn_fx[ch], ratio ), 2 ) ); // Q12 - move16(); - } - } - - /* Any remaining (non-object) energy is set to be preserved at both channels */ - remainderNormEne_fx = s_max( 0, sub( sub( shr( sub( ONE_IN_Q14, ismRatioAcc_fx ), Q14 - Q12 ), normEnes_fx[0] ), normEnes_fx[1] ) ); // Q12 - - FOR( ch = 0; ch < 2; ch++ ) - { - enePreserve_fx[ch] = add( enePreserve_fx[ch], s_max( 0, add( enePreserve_fx[ch], shr( remainderNormEne_fx, 1 ) ) ) ); // Q12 - move16(); - } - - /* Temporally average energy moving and preserving, and generate the transport signal preprocessing matrix */ - FOR( ch = 0; ch < 2; ch++ ) - { - Word32 normVal_fx; - hMasaIsmData->eneMoveIIR_fx[ch][bin] = Mpy_32_16_1( hMasaIsmData->eneMoveIIR_fx[ch][bin], STEREO_PREPROCESS_IIR_FACTOR_Q15 ); - move32(); - temp = Mpy_32_16_1( subframeEne_fx, eneMove_fx[ch] ); - hMasaIsmData->eneMoveIIR_fx[ch][bin] = L_add( hMasaIsmData->eneMoveIIR_fx[ch][bin], temp ); // Q = *cldfb_buf_q + *cldfb_buf_q - 34 = Q-22 - move32(); - - hMasaIsmData->enePreserveIIR_fx[ch][bin] = Mpy_32_16_1( hMasaIsmData->enePreserveIIR_fx[ch][bin], STEREO_PREPROCESS_IIR_FACTOR_Q15 ); - move32(); - temp = Mpy_32_16_1( subframeEne_fx, enePreserve_fx[ch] ); - hMasaIsmData->enePreserveIIR_fx[ch][bin] = L_add( hMasaIsmData->enePreserveIIR_fx[ch][bin], temp ); // Q = *cldfb_buf_q + *cldfb_buf_q - 34 = Q-22 - move32(); - - normVal_fx = L_add( hMasaIsmData->eneMoveIIR_fx[ch][bin], hMasaIsmData->enePreserveIIR_fx[ch][bin] ); - IF( normVal_fx != 0 ) - { - - temp1 = BASOP_Util_Divide3232_Scale( hMasaIsmData->enePreserveIIR_fx[ch][bin], normVal_fx, &temp_q ); - ismPreprocMtxNew_fx[ch][ch] = Sqrt16( temp1, &temp_q ); - move16(); - ismPreprocMtxNew_fx[ch][ch] = shl( ismPreprocMtxNew_fx[ch][ch], temp_q ); // Q15 - move16(); - temp1 = BASOP_Util_Divide3232_Scale( hMasaIsmData->eneMoveIIR_fx[ch][bin], normVal_fx, &temp_q ); - ismPreprocMtxNew_fx[sub( 1, ch )][ch] = Sqrt16( temp1, &temp_q ); - move16(); - ismPreprocMtxNew_fx[sub( 1, ch )][ch] = shl( ismPreprocMtxNew_fx[sub( 1, ch )][ch], temp_q ); // Q15 - move16(); - } - ELSE - { - ismPreprocMtxNew_fx[ch][ch] = 0; - move16(); - ismPreprocMtxNew_fx[sub( 1, ch )][ch] = 0; - move16(); - } - } - - /* Get increment value for temporal interpolation */ - FOR( inCh = 0; inCh < 2; inCh++ ) - { - FOR( outCh = 0; outCh < 2; outCh++ ) - ismPreprocMtxIncrement_fx[outCh][inCh] = BASOP_Util_Divide1616_Scale( sub( ismPreprocMtxNew_fx[outCh][inCh], hMasaIsmData->ismPreprocMatrix_fx[outCh][inCh][bin] ), nSlots, &temp_q ); - move16(); - ismPreprocMtxIncrement_fx[outCh][inCh] = shl( ismPreprocMtxIncrement_fx[outCh][inCh], temp_q ); // Q15 - move16(); - } - } - - /* Mix signals */ - FOR( slot = 0; slot < nSlots; slot++ ) - { - Word16 eqVal_fx = 0; - Word16 eqVal_q_fx = 0; - move16(); - move16(); - Word32 outSlotRe_fx[2]; - Word32 outSlotIm_fx[2]; - - set_zero_fx( outSlotRe_fx, 2 ); - set_zero_fx( outSlotIm_fx, 2 ); - - FOR( outCh = 0; outCh < 2; outCh++ ) - { - FOR( inCh = 0; inCh < 2; inCh++ ) - { - hMasaIsmData->ismPreprocMatrix_fx[outCh][inCh][bin] = add( hMasaIsmData->ismPreprocMatrix_fx[outCh][inCh][bin], ismPreprocMtxIncrement_fx[outCh][inCh] ); // Q = 15 - move16(); - outSlotRe_fx[outCh] = Mpy_32_16_1( inRe_fx[inCh][slot][bin], hMasaIsmData->ismPreprocMatrix_fx[outCh][inCh][bin] ); // Q = *cldfb_buf_q; - move32(); - outSlotIm_fx[outCh] = Mpy_32_16_1( inIm_fx[inCh][slot][bin], hMasaIsmData->ismPreprocMatrix_fx[outCh][inCh][bin] ); // Q = *cldfb_buf_q; - move32(); - } - } - - /* IIR average the energy measures and determine and apply energy-preserving equalizer */ - hMasaIsmData->preprocEneTarget_fx[bin] = Mpy_32_16_1( hMasaIsmData->preprocEneTarget_fx[bin], STEREO_PREPROCESS_IIR_FACTOR_Q15 ); - move32(); - hMasaIsmData->preprocEneRealized_fx[bin] = Mpy_32_16_1( hMasaIsmData->preprocEneRealized_fx[bin], STEREO_PREPROCESS_IIR_FACTOR_Q15 ); - move32(); - FOR( ch = 0; ch < 2; ch++ ) - { - hMasaIsmData->preprocEneTarget_fx[bin] = L_add( hMasaIsmData->preprocEneTarget_fx[bin], Madd_32_32( Mpy_32_32( inRe_fx[ch][slot][bin], inRe_fx[ch][slot][bin] ), inIm_fx[ch][slot][bin], inIm_fx[ch][slot][bin] ) ); // Q= *cldfb_buf_q + *cldfb_buf_q - 31 = Q-19 - move32(); - hMasaIsmData->preprocEneRealized_fx[bin] = L_add( hMasaIsmData->preprocEneRealized_fx[bin], Madd_32_32( Mpy_32_32( outSlotRe_fx[ch], outSlotRe_fx[ch] ), outSlotIm_fx[ch], outSlotIm_fx[ch] ) ); // Q= *cldfb_buf_q + *cldfb_buf_q - 31 = Q-19 - move32(); - } - temp1 = BASOP_Util_Divide3232_Scale( hMasaIsmData->preprocEneTarget_fx[bin], L_max( EPSILON_FX, hMasaIsmData->preprocEneRealized_fx[bin] ), &eqVal_q_fx ); - eqVal_fx = Sqrt16( temp1, &eqVal_q_fx ); - temp1 = 4 << Q12; // Q12 - move16(); - IF( LT_16( eqVal_q_fx, Q12 ) ) - { - IF( GT_16( eqVal_fx, shr( temp1, sub( Q12, eqVal_q_fx ) ) ) ) - { - eqVal_fx = temp1; - move16(); - eqVal_q_fx = Q12; - move16(); - } - } - ELSE - { - if ( GT_16( shr( eqVal_fx, sub( eqVal_q_fx, Q12 ) ), temp1 ) ) - { - eqVal_fx = temp1; // eqVal_q_fx - move16(); - } - } - - FOR( ch = 0; ch < 2; ch++ ) - { - inRe_fx[ch][slot][bin] = Mpy_32_16_1( outSlotRe_fx[ch], eqVal_fx ); - move32(); - inIm_fx[ch][slot][bin] = Mpy_32_16_1( outSlotIm_fx[ch], eqVal_fx ); - move32(); - } - *cldfb_buf_q = sub( add( *cldfb_buf_q, eqVal_q_fx ), 15 ); - move16(); - } - } - - return; -} -#endif static void ivas_masa_ext_rend_parambin_internal_fx( MASA_EXT_REND_HANDLE hMasaExtRend, diff --git a/lib_rend/ivas_dirac_output_synthesis_dec_fx.c b/lib_rend/ivas_dirac_output_synthesis_dec_fx.c index e79973c77..29184695c 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec_fx.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec_fx.c @@ -2853,17 +2853,10 @@ void ivas_dirac_dec_compute_directional_responses_fx( FOR( dir = 0; dir < hSpatParamRendCom->numIsmDirections; dir++ ) { -#ifdef OMASA_OBJECT_EDITING IF( hMasaIsm->ism_dir_is_edited[dir] ) { ivas_dirac_dec_get_response_fx( hMasaIsm->azimuth_ism_edited_fx[dir], hMasaIsm->elevation_ism_edited_fx[dir], direct_response_temp_fx, hDirACRend->hOutSetup.ambisonics_order, Q29 ); } -#else - IF( hMasaIsm->ism_is_edited[dir] ) - { - ivas_dirac_dec_get_response_fx( hMasaIsm->azimuth_ism_edited[dir], hMasaIsm->elevation_ism_edited[dir], direct_response_temp_fx, hDirACRend->hOutSetup.ambisonics_order, Q29 ); - } -#endif ELSE { ivas_dirac_dec_get_response_fx( hMasaIsm->azimuth_ism_fx[dir][md_idx], hMasaIsm->elevation_ism_fx[dir][md_idx], direct_response_temp_fx, hDirACRend->hOutSetup.ambisonics_order, Q29 ); @@ -3111,17 +3104,10 @@ void ivas_dirac_dec_compute_directional_responses_fx( FOR( dir = 0; dir < hSpatParamRendCom->numIsmDirections; dir++ ) { -#ifdef OMASA_OBJECT_EDITING IF( hMasaIsm->ism_dir_is_edited[dir] ) { vbap_determine_gains_fx( hVBAPdata, direct_response_temp_fx, hMasaIsm->azimuth_ism_edited_fx[dir], hMasaIsm->elevation_ism_edited_fx[dir], 1 ); } -#else - IF( hMasaIsm->ism_is_edited[dir] ) - { - vbap_determine_gains_fx( hVBAPdata, direct_response_temp_fx, hMasaIsm->azimuth_ism_edited[dir], hMasaIsm->elevation_ism_edited[dir], 1 ); - } -#endif ELSE { vbap_determine_gains_fx( hVBAPdata, direct_response_temp_fx, hMasaIsm->azimuth_ism_fx[dir][md_idx], hMasaIsm->elevation_ism_fx[dir][md_idx], 1 ); -- GitLab From 6807958cd5622563310f01902939bd92615a7d00 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 21 Oct 2025 15:06:32 +0200 Subject: [PATCH 09/15] [cleanup] accept OBJ_EDITING_PARAMISM_BIN --- lib_com/options.h | 1 - lib_dec/ivas_init_dec_fx.c | 2 -- lib_dec/ivas_ism_dec_fx.c | 8 ----- lib_dec/ivas_ism_param_dec_fx.c | 6 ---- lib_dec/lib_dec_fx.c | 4 --- .../ivas_dirac_dec_binaural_functions_fx.c | 31 ------------------- 6 files changed, 52 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 7ffa1495b..c012c056e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -124,7 +124,6 @@ #define TMP_FIX_OMASA_SR_BE // temporary fix to keep OMASA split-rendering BE #define OBJ_EDITING_COMMANDLINE /* obj editing command-line option */ #define NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES // Nokia: Fix 1399_1400 issue in float, this is essential for the BASOP porting -#define OBJ_EDITING_PARAMISM_BIN /* Nokia: object editing for ParamISM to binaural */ #define FIX_BRATE_SWITCHING /* VA: fix bitrate switching cases in OMASA and OSBA */ #define OBJ_EDIT_BASOP #define NONBE_1217_INIT_OBJ_EDIT /* VA: issue 1217: do object editing only when objects metadata is available */ diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index 7844e6b65..006cc24ba 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -1786,7 +1786,6 @@ ivas_error ivas_init_decoder_fx( { st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->seed2 = st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->seed3; move16(); -#ifdef OBJ_EDITING_PARAMISM_BIN IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) { /* reusing OMASA function for allocating and initializing MASA_ISM rendering handle (even though not in OMASA) */ @@ -1795,7 +1794,6 @@ ivas_error ivas_init_decoder_fx( return error; } } -#endif } ELSE IF( EQ_32( st_ivas->ism_mode, ISM_MODE_DISC ) ) { diff --git a/lib_dec/ivas_ism_dec_fx.c b/lib_dec/ivas_ism_dec_fx.c index e5e05ab0a..e5ecb5c30 100644 --- a/lib_dec/ivas_ism_dec_fx.c +++ b/lib_dec/ivas_ism_dec_fx.c @@ -189,10 +189,8 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( { /* close the parametric binaural renderer */ ivas_dirac_dec_close_binaural_data_fx( st_ivas->hDiracDecBin ); -#ifdef OBJ_EDITING_PARAMISM_BIN /* Close omasa data struct (used for object editing) */ ivas_omasa_data_close_fx( &st_ivas->hMasaIsmData ); -#endif /* Open the TD Binaural renderer */ test(); @@ -229,10 +227,8 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( ivas_dirac_dec_close_binaural_data_fx( st_ivas->hDiracDecBin ); -#ifdef OBJ_EDITING_PARAMISM_BIN /* Close omasa data struct (used for object editing) */ ivas_omasa_data_close_fx( &st_ivas->hMasaIsmData ); -#endif /* Open Crend Binaural renderer */ IF( NE_32( ( error = ivas_rend_openCrend_fx( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) @@ -265,13 +261,11 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( { return error; } -#ifdef OBJ_EDITING_PARAMISM_BIN /* Open omasa data struct (used for object editing) */ IF( ( error = ivas_omasa_data_open_fx( st_ivas ) ) != IVAS_ERR_OK ) { return error; } -#endif /* Close the TD Binaural renderer */ ivas_td_binaural_close_fx( &st_ivas->hBinRendererTd ); @@ -300,13 +294,11 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( return error; } -#ifdef OBJ_EDITING_PARAMISM_BIN /* Open omasa data struct (used for object editing) */ IF( ( error = ivas_omasa_data_open_fx( st_ivas ) ) != IVAS_ERR_OK ) { return error; } -#endif /* close the crend binaural renderer */ ivas_rend_closeCrend_fx( &( st_ivas->hCrendWrapper ) ); } diff --git a/lib_dec/ivas_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index 1ac19bd4d..5f2665a2e 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -1824,19 +1824,15 @@ void ivas_param_ism_params_to_masa_param_mapping_fx( Word16 azimuth[2]; Word16 elevation[2]; Word16 power_ratio_fx[2]; /* Q15 */ -#ifdef OBJ_EDITING_PARAMISM_BIN MASA_ISM_DATA_HANDLE hMasaIsmData; Word16 obj; Word16 obj_idx; -#endif hParamIsmDec = st_ivas->hParamIsmDec; move16(); hSpatParamRendCom = st_ivas->hSpatParamRendCom; move16(); -#ifdef OBJ_EDITING_PARAMISM_BIN hMasaIsmData = st_ivas->hMasaIsmData; -#endif nBins = hSpatParamRendCom->num_freq_bands; move16(); @@ -1928,7 +1924,6 @@ void ivas_param_ism_params_to_masa_param_mapping_fx( } } -#ifdef OBJ_EDITING_PARAMISM_BIN FOR( obj = 0; obj < st_ivas->nchan_ism; obj++ ) { FOR( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) @@ -1965,7 +1960,6 @@ void ivas_param_ism_params_to_masa_param_mapping_fx( } } } -#endif } return; diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index e7001e939..a644fc221 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -4410,7 +4410,6 @@ ivas_error IVAS_DEC_SetEditableParameters( #endif FOR( obj = 0; obj < hIvasEditableParameters.num_obj; obj++ ) { -#ifdef OBJ_EDITING_PARAMISM_BIN st_ivas->hParamIsmDec->edited_azimuth_values_fx[obj] = hIvasEditableParameters.ism_metadata[obj].azimuth_fx; move32(); st_ivas->hParamIsmDec->edited_elevation_values_fx[obj] = hIvasEditableParameters.ism_metadata[obj].elevation_fx; @@ -4446,11 +4445,9 @@ ivas_error IVAS_DEC_SetEditableParameters( move16(); #ifdef NONBE_1217_OBJ_EDIT_FOA } -#endif #endif } -#ifdef OBJ_EDITING_PARAMISM_BIN #ifdef NONBE_1217_OBJ_EDIT_FOA IF( st_ivas->hMasaIsmData != NULL ) { @@ -4460,7 +4457,6 @@ ivas_error IVAS_DEC_SetEditableParameters( move16(); #ifdef NONBE_1217_OBJ_EDIT_FOA } -#endif #endif } ELSE IF( EQ_32( ism_mode, ISM_MODE_NONE ) ) diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index 0b583aaa0..3f0c938ce 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -962,14 +962,9 @@ static void ivas_dirac_dec_binaural_internal_fx( test(); test(); test(); -#ifdef OBJ_EDITING_PARAMISM_BIN test(); test(); IF( ( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) && ( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) || ( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) && ( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) || EQ_32( st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC ) ) ) ) ) || EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) -#else - test(); - IF( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) ) ) ) -#endif { ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( st_ivas, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, &q_inp, nBins, subframe ); } @@ -5255,9 +5250,7 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( Word16 bin, ch, inCh, outCh, ismDirIndex, slot, band_idx, bin_lo, bin_hi, max_band, n_ism; SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; MASA_ISM_DATA_HANDLE hMasaIsmData; -#ifdef OBJ_EDITING_PARAMISM_BIN PARAM_ISM_DEC_HANDLE hParamIsmDec; -#endif UWord8 enableCentering; Word16 dirac_read_idx; Word16 nSlots; @@ -5268,13 +5261,10 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( UWord8 ismGainEdited[4]; UWord8 ismDirEdited[4]; UWord8 masaGainEdited; -#ifdef OBJ_EDITING_PARAMISM_BIN UWord8 masaIsmMode; -#endif hSpatParamRendCom = st_ivas->hSpatParamRendCom; hMasaIsmData = st_ivas->hMasaIsmData; -#ifdef OBJ_EDITING_PARAMISM_BIN hParamIsmDec = st_ivas->hParamIsmDec; IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) @@ -5287,7 +5277,6 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( masaIsmMode = 0; move16(); } -#endif test(); test(); @@ -5302,12 +5291,8 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( move16(); } -#ifdef OBJ_EDITING_PARAMISM_BIN test(); IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) || EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) -#else - IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) -#endif { n_ism = st_ivas->nchan_ism; move16(); @@ -5405,7 +5390,6 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( } } } -#ifdef OBJ_EDITING_PARAMISM_BIN ELSE IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) && st_ivas->hISMDTX.dtx_flag ) /* If dtx on, perform just the smoothing of the processing gains */ { Word32 totalTargetEne; @@ -5586,7 +5570,6 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( } } } -#endif ELSE /* Other processing modes */ { Word32 subframeEne; @@ -5691,16 +5674,13 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( /* Determine the highest band */ max_band = 0; move16(); -#ifdef OBJ_EDITING_PARAMISM_BIN IF( masaIsmMode ) { -#endif test(); WHILE( GT_16( sub( MASA_FREQUENCY_BANDS, max_band ), 0 ) && GT_16( sub( nBins, MASA_band_grouping_24[max_band] ), 0 ) ) { max_band++; } -#ifdef OBJ_EDITING_PARAMISM_BIN } ELSE { @@ -5710,7 +5690,6 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( max_band++; } } -#endif /* Init out array */ FOR( Word16 k = 0; k < nSlots; k++ ) @@ -5751,15 +5730,12 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( set16_fx( ismPreprocMtxIncrement_e[1], 0, 2 ); set16_fx( ismPreprocMtxIncrement_e[1], 0, 2 ); -#ifdef OBJ_EDITING_PARAMISM_BIN IF( masaIsmMode ) { -#endif bin_lo = MASA_band_grouping_24[band_idx]; move16(); bin_hi = s_min( MASA_band_grouping_24[band_idx + 1], nBins ); move16(); -#ifdef OBJ_EDITING_PARAMISM_BIN } ELSE { @@ -5768,7 +5744,6 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( bin_hi = s_min( hParamIsmDec->hParamIsm->band_grouping[band_idx + 1], nBins ); move16(); } -#endif exp = sub( 63, shl( *cldfb_buf_q, 1 ) ); Word16 guardBits = 5; @@ -5970,10 +5945,8 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( } } -#ifdef OBJ_EDITING_PARAMISM_BIN IF( masaIsmMode ) { -#endif /* MASA original ratios */ ratio = L_add( hSpatParamRendCom->energy_ratio1_fx[dirac_read_idx][bin_lo], hSpatParamRendCom->energy_ratio2_fx[dirac_read_idx][bin_lo] ); // Q30 move32(); @@ -6014,9 +5987,7 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( { ratioAccNew = L_add( ratioAccNew, L_shr( ratio, 3 ) ); // Q27 } -#ifdef OBJ_EDITING_PARAMISM_BIN } -#endif #ifdef NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES @@ -6427,7 +6398,6 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( } } -#ifdef OBJ_EDITING_PARAMISM_BIN IF( !masaIsmMode ) { Word16 obj_idx1, obj_idx2; @@ -6453,7 +6423,6 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( } } } -#endif } return; -- GitLab From fc8601a3019cf5be31366ba3961b12b63b9adfb5 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 21 Oct 2025 15:06:54 +0200 Subject: [PATCH 10/15] [cleanup] accept NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH --- lib_com/options.h | 1 - lib_dec/ivas_init_dec_fx.c | 4 ---- lib_dec/ivas_masa_dec_fx.c | 14 -------------- lib_dec/lib_dec_fx.c | 12 ------------ 4 files changed, 31 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index c012c056e..dca6fe6cb 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -108,7 +108,6 @@ #define FIX_1387_INIT_PRM_SQQ /* FhG: initialize pointer prm_sqQ, which might be uninitialized in case of bfi == 1 */ #define FIX_1349_TNS_CRASH /* FhG: Fix crash in TNS entropy coding, in case order of joint TNS coding is reduced to 0 */ #define FIX_1179_USAN_PHASEECU /* Eri: issue 1179: better handling of 16 bit wrap around for very long(>200ms) FER-bursts */ -#define NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1199: fix bug in renderer flush in OMASA JBM bitrate switching */ #define NONBE_1200_ISM_JBM_BRATE_SW_FLUSH /* VA: issue 1200: fix bug in renderer flush in ISM JBM bitrate switching */ #define NONBE_1293_CRASH_FIRST_FRAME_LOST /* VA: issue 1293: fix G.192 decoder crash when first frame is lost */ #define FIX_1384_MSAN_stereo_tcx_core_enc /* VA: issue 1384: fix use-of-uninitialized value in stereo_tcx_core_enc() */ diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index 006cc24ba..9f1112a16 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -652,10 +652,8 @@ ivas_error ivas_dec_setup( } /* this should be non-zero if original input format was MASA_ISM_FORMAT */ -#ifdef NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH st_ivas->ism_mode = ISM_MODE_NONE; move16(); -#endif st_ivas->nchan_ism = add( st_ivas->bit_stream[sub( k, 3 )], shl( st_ivas->bit_stream[sub( k, 2 )], 1 ) ); IF( GT_16( st_ivas->nchan_ism, 0 ) ) @@ -947,7 +945,6 @@ ivas_error ivas_dec_setup( } } -#ifdef NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH test(); IF( GT_16( st_ivas->ini_frame, 0 ) && EQ_32( st_ivas->ivas_format, MASA_FORMAT ) ) { @@ -957,7 +954,6 @@ ivas_error ivas_dec_setup( move16(); } -#endif IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) { ISM_MODE last_ism_mode = st_ivas->ism_mode; diff --git a/lib_dec/ivas_masa_dec_fx.c b/lib_dec/ivas_masa_dec_fx.c index 032a629a1..cd449860a 100644 --- a/lib_dec/ivas_masa_dec_fx.c +++ b/lib_dec/ivas_masa_dec_fx.c @@ -1940,20 +1940,6 @@ ivas_error ivas_masa_dec_reconfigure_fx( ivas_masa_set_elements_fx( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp, st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate ); -#ifndef NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH - IF( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) ) - { - IF( NE_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - move16(); - 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 */ - } - st_ivas->ism_mode = ISM_MODE_NONE; - move16(); - } -#endif { Word16 tc_nchan_to_allocate; Word16 tc_nchan_transport; diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index a644fc221..80228526b 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -3786,12 +3786,6 @@ ivas_error IVAS_DEC_ReadFormat( // st_ivas->nchan_transport = nchan_transport_old; // ToDo: temporarily deactivated to keep FIX_HRTF_LOAD bit-exact but this is likely a bug in the main -> see issue #1200 #endif -#ifndef NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH - if ( st_ivas->ivas_format == MASA_FORMAT ) - { - st_ivas->nchan_ism = 0; // ToDo: temporary hack to keep FIX_HRTF_LOAD bit-exact but this is likely a bug in the main -> see issue #1199 - } -#endif IF( st_ivas->hTcBuffer == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -3829,12 +3823,6 @@ ivas_error IVAS_DEC_ReadFormat( // st_ivas->nchan_transport = nchan_transport_old; // ToDo: temporarily deactivated to keep FIX_HRTF_LOAD bit-exact but this is likely a bug in the main -> see issue #1200 #endif -#ifndef NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH - if ( st_ivas->ivas_format == MASA_FORMAT ) - { - st_ivas->nchan_ism = 0; // ToDo: temporary hack to keep FIX_HRTF_LOAD bit-exact but this is likely a bug in the main -> see issue #1199 - } -#endif IF( LT_16( tc_granularity_new, st_ivas->hTcBuffer->n_samples_granularity ) ) { IF( ( error = ivas_jbm_dec_flush_renderer_fx( st_ivas, tc_granularity_new, renderer_type_old, intern_config_old, &st_ivas->hIntSetup, mc_mode_old, ism_mode_old, &hIvasDec->nSamplesFlushed, hIvasDec->flushbuffer ) ) != IVAS_ERR_OK ) -- GitLab From cc2b0a4f667b9158be1f4e0322ebf87b2cc389e6 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 21 Oct 2025 15:06:57 +0200 Subject: [PATCH 11/15] [cleanup] accept OBJ_EDITING_COMMANDLINE --- apps/decoder.c | 14 -------------- lib_com/options.h | 1 - lib_dec/ivas_init_dec_fx.c | 2 -- lib_dec/ivas_stat_dec.h | 2 -- lib_dec/lib_dec.h | 2 -- lib_dec/lib_dec_fx.c | 8 -------- 6 files changed, 29 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index f34d11536..aea490aba 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -129,9 +129,7 @@ typedef struct AcousticEnvironmentSequence aeSequence; bool dpidEnabled; uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS]; -#ifdef OBJ_EDITING_COMMANDLINE bool objEditEnabled; -#endif #ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE char *objEditFileName; #endif @@ -426,15 +424,9 @@ int main( uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : 65535; #ifdef LIB_DEC_REVISION -#ifdef OBJ_EDITING_COMMANDLINE if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain_fx, arg.dpidEnabled, aeID, arg.objEditEnabled, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, - arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, - arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain_fx, arg.dpidEnabled, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) -#endif #else if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain_fx, arg.dpidEnabled, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) @@ -915,9 +907,7 @@ static bool parseCmdlIVAS_dec( { arg->directivityPatternId[i] = 65535; } -#ifdef OBJ_EDITING_COMMANDLINE arg->objEditEnabled = false; -#endif #ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE arg->objEditFileName = NULL; #endif @@ -1389,7 +1379,6 @@ static bool parseCmdlIVAS_dec( i += tmp; } -#ifdef OBJ_EDITING_COMMANDLINE else if ( strcmp( argv_to_upper, "-OBJ_EDIT" ) == 0 ) { arg->objEditEnabled = true; @@ -1413,7 +1402,6 @@ static bool parseCmdlIVAS_dec( i++; #endif } -#endif /*-----------------------------------------------------------------* * Option not recognized @@ -1602,12 +1590,10 @@ static void usage_dec( void ) fprintf( stdout, " without braces and spaces, with ':' character separating ID from duration and ',' separating\n" ); fprintf( stdout, " ID and duration pairs, where duration is specified in frames\n" ); fprintf( stdout, " for BINAURAL_ROOM_REVERB output configuration.\n" ); -#ifdef OBJ_EDITING_COMMANDLINE #ifndef FIX_1217_OBJECT_EDIT_FILE_INTERFACE fprintf( stdout, "-obj_edit : Enable objects editing\n" ); #else fprintf( stdout, "-obj_edit File : Object editing instructions file or NULL for built-in example\n" ); -#endif #endif fprintf( stdout, "-level level : Complexity level, level = (1, 2, 3), will be defined after characterisation. \n" ); diff --git a/lib_com/options.h b/lib_com/options.h index dca6fe6cb..08fd172c8 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -121,7 +121,6 @@ // object-editing feature porting #define TMP_FIX_SPLIT_REND // temporary fix to split-rendering (it follows the later state of the framework but it is needed now because of current test-conditions) #define TMP_FIX_OMASA_SR_BE // temporary fix to keep OMASA split-rendering BE -#define OBJ_EDITING_COMMANDLINE /* obj editing command-line option */ #define NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES // Nokia: Fix 1399_1400 issue in float, this is essential for the BASOP porting #define FIX_BRATE_SWITCHING /* VA: fix bitrate switching cases in OMASA and OSBA */ #define OBJ_EDIT_BASOP diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index 9f1112a16..be7715e6b 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -3855,7 +3855,6 @@ static ivas_error doSanityChecks_IVAS( } -#ifdef OBJ_EDITING_COMMANDLINE IF( st_ivas->hDecoderConfig->Opt_ObjEdit_on ) { #ifdef FIX_BRATE_SWITCHING @@ -3871,7 +3870,6 @@ static ivas_error doSanityChecks_IVAS( return IVAS_ERROR( IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED, "Wrong set-up: Obect editing is not supported in this IVAS format." ); } } -#endif #ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE test(); diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index a82fdf836..7791de9db 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1070,9 +1070,7 @@ typedef struct decoder_config_structure Word16 Opt_ExternalOrientation; /* indicates whether external orientations are used */ Word16 Opt_dpid_on; /* indicates whether Directivity pattern option is used */ Word16 Opt_aeid_on; /* indicates whether Acoustic environment option is used */ -#ifdef OBJ_EDITING_COMMANDLINE Word16 Opt_ObjEdit_on; /* indicates whether object editing option is used */ -#endif Word16 Opt_tsm; /* indicates whether time scaling modification is activated */ IVAS_RENDER_FRAMESIZE render_framesize; Word16 Opt_delay_comp; /* flag indicating delay compensation active */ diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 55a5dcee2..51c359227 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -125,9 +125,7 @@ ivas_error IVAS_DEC_Configure( const Word16 non_diegetic_pan_gain_fx, /* i : non diegetic panning gain */ const bool dpidEnabled, /* i : enable directivity pattern option */ const UWord16 acousticEnvironmentId, /* i : Acoustic environment ID */ -#ifdef OBJ_EDITING_COMMANDLINE const bool objEditEnabled, /* i : enable object editing */ -#endif const bool delayCompensationEnabled /* i : enable delay compensation */ ); diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 80228526b..0250c9098 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -381,10 +381,8 @@ static void init_decoder_config( hDecoderConfig->Opt_ExternalOrientation = 0; hDecoderConfig->Opt_dpid_on = 0; hDecoderConfig->Opt_aeid_on = 0; -#ifdef OBJ_EDITING_COMMANDLINE hDecoderConfig->Opt_ObjEdit_on = 0; move16(); -#endif move16(); move16(); move16(); @@ -545,9 +543,7 @@ ivas_error IVAS_DEC_Configure( const Word16 non_diegetic_pan_gain_fx, /* i : non diegetic panning gain */ const bool dpidEnabled, /* i : enable directivity pattern option */ const UWord16 acousticEnvironmentId, /* i : Acoustic environment ID */ -#ifdef OBJ_EDITING_COMMANDLINE const bool objEditEnabled, /* i : enable object editing */ -#endif const bool delayCompensationEnabled /* i : enable delay compensation */ ) { @@ -627,9 +623,7 @@ ivas_error IVAS_DEC_Configure( { hDecoderConfig->Opt_aeid_on = FALSE; } -#ifdef OBJ_EDITING_COMMANDLINE hDecoderConfig->Opt_ObjEdit_on = (Word16) objEditEnabled; -#endif move16(); move16(); move16(); @@ -5389,13 +5383,11 @@ static ivas_error printConfigInfo_dec( { fprintf( stdout, "Acoustic environment ID:ON\n" ); } -#ifdef OBJ_EDITING_COMMANDLINE IF( st_ivas->hDecoderConfig->Opt_ObjEdit_on ) { fprintf( stdout, "Objects editing : ON\n" ); } -#endif } /*-----------------------------------------------------------------* -- GitLab From 1ff07adcee3888595bdd6643ad662f5053c91968 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 21 Oct 2025 15:07:01 +0200 Subject: [PATCH 12/15] [cleanup] accept FIX_BRATE_SWITCHING --- lib_com/options.h | 1 - lib_dec/ivas_init_dec_fx.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 08fd172c8..36b43bdf4 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -122,7 +122,6 @@ #define TMP_FIX_SPLIT_REND // temporary fix to split-rendering (it follows the later state of the framework but it is needed now because of current test-conditions) #define TMP_FIX_OMASA_SR_BE // temporary fix to keep OMASA split-rendering BE #define NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES // Nokia: Fix 1399_1400 issue in float, this is essential for the BASOP porting -#define FIX_BRATE_SWITCHING /* VA: fix bitrate switching cases in OMASA and OSBA */ #define OBJ_EDIT_BASOP #define NONBE_1217_INIT_OBJ_EDIT /* VA: issue 1217: do object editing only when objects metadata is available */ #define FIX_1217_OBJECT_EDIT_FILE_INTERFACE /* Nokia: issue #1217: add decoder functionality to read object edit instructions from a file */ diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index be7715e6b..ffa6e3d71 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -3857,15 +3857,11 @@ static ivas_error doSanityChecks_IVAS( IF( st_ivas->hDecoderConfig->Opt_ObjEdit_on ) { -#ifdef FIX_BRATE_SWITCHING test(); test(); test(); test(); IF( !( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) || EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) || EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) || ( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) && GT_16( st_ivas->nchan_ism, 0 ) ) ) ) -#else - if ( !( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) ) -#endif { return IVAS_ERROR( IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED, "Wrong set-up: Obect editing is not supported in this IVAS format." ); } -- GitLab From 86dc9282038002fb7358ae3a6d10c0eb18a54afc Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 21 Oct 2025 15:07:12 +0200 Subject: [PATCH 13/15] [cleanup] accept NONBE_1200_ISM_JBM_BRATE_SW_FLUSH --- lib_com/options.h | 1 - lib_dec/ivas_ism_dec_fx.c | 18 ------------------ lib_dec/lib_dec_fx.c | 8 -------- 3 files changed, 27 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 36b43bdf4..46c15d9ee 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -108,7 +108,6 @@ #define FIX_1387_INIT_PRM_SQQ /* FhG: initialize pointer prm_sqQ, which might be uninitialized in case of bfi == 1 */ #define FIX_1349_TNS_CRASH /* FhG: Fix crash in TNS entropy coding, in case order of joint TNS coding is reduced to 0 */ #define FIX_1179_USAN_PHASEECU /* Eri: issue 1179: better handling of 16 bit wrap around for very long(>200ms) FER-bursts */ -#define NONBE_1200_ISM_JBM_BRATE_SW_FLUSH /* VA: issue 1200: fix bug in renderer flush in ISM JBM bitrate switching */ #define NONBE_1293_CRASH_FIRST_FRAME_LOST /* VA: issue 1293: fix G.192 decoder crash when first frame is lost */ #define FIX_1384_MSAN_stereo_tcx_core_enc /* VA: issue 1384: fix use-of-uninitialized value in stereo_tcx_core_enc() */ #define NONBE_1303_REND_GRANULARITY /* VA: issue 1303: Renderer granularity revision */ diff --git a/lib_dec/ivas_ism_dec_fx.c b/lib_dec/ivas_ism_dec_fx.c index e5ecb5c30..ae94021e9 100644 --- a/lib_dec/ivas_ism_dec_fx.c +++ b/lib_dec/ivas_ism_dec_fx.c @@ -123,9 +123,6 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->hDecoderConfig->output_config ); } -#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH - { -#endif test(); test(); /* transfer subframe info from DirAC or ParamMC to central tc buffer */ @@ -163,9 +160,6 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( return error; } } -#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH - } -#endif IF( NE_16( st_ivas->ism_mode, last_ism_mode ) ) { @@ -317,26 +311,17 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( * output audio buffers *-----------------------------------------------------------------*/ -#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH - { -#endif nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); IF( NE_32( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ), IVAS_ERR_OK ) ) { return error; } -#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH - } -#endif /*-----------------------------------------------------------------* * JBM TC buffers *-----------------------------------------------------------------*/ -#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH - { -#endif Word16 tc_nchan_full_new; DECODER_TC_BUFFER_HANDLE hTcBuffer; @@ -385,9 +370,6 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( Copy( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); } -#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH - } -#endif return IVAS_ERR_OK; } diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 0250c9098..f46bea4d4 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -3773,12 +3773,8 @@ ivas_error IVAS_DEC_ReadFormat( { Word16 tc_granularity_new = ivas_jbm_dec_get_render_granularity_fx( st_ivas->renderer_type, renderer_type_sec_new, st_ivas->hDecoderConfig->output_Fs ); -#ifdef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH st_ivas->nchan_transport = nchan_transport_old; move16(); -#else - // st_ivas->nchan_transport = nchan_transport_old; // ToDo: temporarily deactivated to keep FIX_HRTF_LOAD bit-exact but this is likely a bug in the main -> see issue #1200 -#endif IF( st_ivas->hTcBuffer == NULL ) { @@ -3810,12 +3806,8 @@ ivas_error IVAS_DEC_ReadFormat( render what still fits in the new granularity */ Word16 tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, st_ivas->ivas_format, st_ivas->mc_mode, st_ivas->hDecoderConfig->output_Fs ); -#ifdef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH st_ivas->nchan_transport = nchan_transport_old; move16(); -#else -// st_ivas->nchan_transport = nchan_transport_old; // ToDo: temporarily deactivated to keep FIX_HRTF_LOAD bit-exact but this is likely a bug in the main -> see issue #1200 -#endif IF( LT_16( tc_granularity_new, st_ivas->hTcBuffer->n_samples_granularity ) ) { -- GitLab From 68fe502e38a8f58c339b113d652ce5f8e887f640 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 21 Oct 2025 15:07:18 +0200 Subject: [PATCH 14/15] [cleanup] accept NONBE_1203_MDCT2DFT_SWITCHING --- lib_com/options.h | 1 - lib_enc/ivas_stereo_dft_td_itd_fx.c | 4 ---- lib_enc/ivas_stereo_switching_enc_fx.c | 8 -------- 3 files changed, 13 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 46c15d9ee..fefc866d6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -100,7 +100,6 @@ #define FIX_1053_REVERB_RECONFIGURATION #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ #define FIX_1113_EXTREND_ISAR /* FhG: issue 1113: fix external renderer asserts for FOA/HOA2 and CLDFB config */ -#define NONBE_1203_MDCT2DFT_SWITCHING /* VA: issue 1203: fix severe artifacts during MDCT to DFT stereo switching when MDCT ITD is not used */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ #define FIX_938_COMPILER_WARNING /* FhG: Fix compiler warning in ivas_mdct_core_reconstruct() */ #define FIX_1376_MISSING_ISM_METADATA /* FhG: IVAS_rend: throw error if there exists an ISM input without a corresponding metadata file path */ diff --git a/lib_enc/ivas_stereo_dft_td_itd_fx.c b/lib_enc/ivas_stereo_dft_td_itd_fx.c index 0e404a0de..2c044625c 100644 --- a/lib_enc/ivas_stereo_dft_td_itd_fx.c +++ b/lib_enc/ivas_stereo_dft_td_itd_fx.c @@ -573,10 +573,8 @@ void stereo_td_itd_mdct_stereo_fx( Word16 DFT_e[CPE_CHANNELS]; Word16 DFT_tmp_e[CPE_CHANNELS][STEREO_DFT_N_MAX_ENC]; STEREO_MDCT_ENC_DATA_HANDLE hStereoMdct; -#ifdef NONBE_1203_MDCT2DFT_SWITCHING Word16 dft_ovl; Word16 sf; -#endif test(); IF( hCPE->hStereoMdct != NULL && hCPE->hStereoMdct->hItd != NULL ) @@ -615,7 +613,6 @@ void stereo_td_itd_mdct_stereo_fx( /* Time Domain ITD compensation using extrapolation */ stereo_td_itd_fx( hStereoMdct->hItd, NULL, NULL, 1, hStereoMdct->hDft_ana->dft_ovl, hCPE->hCoreCoder, input_frame, hCPE->input_mem_fx, hCPE->q_input_mem ); } -#ifdef NONBE_1203_MDCT2DFT_SWITCHING ELSE IF( hCPE->input_mem_fx[0] != NULL ) { dft_ovl = extract_l( Mpy_32_32( imult3216( input_frame, STEREO_DFT_OVL_MAX ), 2236963 ) ); // 1/L_FRAME48k = 2236963 (Q31) @@ -628,7 +625,6 @@ void stereo_td_itd_mdct_stereo_fx( move16(); } } -#endif return; diff --git a/lib_enc/ivas_stereo_switching_enc_fx.c b/lib_enc/ivas_stereo_switching_enc_fx.c index a219aef81..437504623 100644 --- a/lib_enc/ivas_stereo_switching_enc_fx.c +++ b/lib_enc/ivas_stereo_switching_enc_fx.c @@ -649,25 +649,17 @@ void stereo_switching_enc_fx( dft_ovl = extract_l( Mpy_32_32( imult3216( input_frame, STEREO_DFT_OVL_MAX ), 2236963 ) ); // 1/L_FRAME48k = 2236963 (Q31) /* update DFT analysis overlap memory */ -#ifdef NONBE_1203_MDCT2DFT_SWITCHING /* note: in MDCT stereo, the update is done in stereo_td_itd_mdct_stereo() */ -#endif test(); test(); IF( GT_16( hCPE->element_mode, IVAS_CPE_DFT ) && hCPE->input_mem_fx[0] != NULL && NE_16( hCPE->element_mode, IVAS_CPE_MDCT ) ) { FOR( n = 0; n < CPE_CHANNELS; n++ ) { -#ifdef NONBE_1203_MDCT2DFT_SWITCHING Word16 sf = L_norm_arr( sts[n]->input32_fx + input_frame - dft_ovl, dft_ovl ); Copy_Scale_sig32_16( sts[n]->input32_fx + input_frame - dft_ovl, hCPE->input_mem_fx[n], dft_ovl, sf ); /* sts[n]->q_inp32 - 16 */ hCPE->q_input_mem[n] = sub( add( sts[n]->q_inp32, sf ), 16 ); move16(); -#else - Copy_Scale_sig32_16( sts[n]->input32_fx + input_frame - dft_ovl, hCPE->input_mem_fx[n], dft_ovl, 0 ); /* sts[n]->q_inp32 - 16 */ - hCPE->q_input_mem[n] = sub( sts[n]->q_inp32, 16 ); - move16(); -#endif } } -- GitLab From f9e7462d329f61449d3bee34475d226936a450c7 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 21 Oct 2025 15:16:33 +0200 Subject: [PATCH 15/15] clang-format --- lib_dec/ivas_init_dec_fx.c | 8 +- lib_dec/ivas_ism_dec_fx.c | 150 ++++++++++++++++---------------- lib_dec/ivas_ism_param_dec_fx.c | 2 - lib_dec/ivas_mc_param_dec_fx.c | 35 ++++---- lib_dec/ivas_mct_dec_fx.c | 16 ++-- lib_dec/ivas_stat_dec.h | 4 +- lib_dec/lib_dec_fx.c | 34 ++++---- 7 files changed, 123 insertions(+), 126 deletions(-) diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index ffa6e3d71..6f5694453 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -2155,10 +2155,10 @@ ivas_error ivas_init_decoder_fx( reset_indices_dec( st_ivas->hSCE[0]->hCoreCoder[0] ); - IF( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) - { - return error; - } + IF( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) + { + return error; + } } ELSE IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) { diff --git a/lib_dec/ivas_ism_dec_fx.c b/lib_dec/ivas_ism_dec_fx.c index ae94021e9..f225b793f 100644 --- a/lib_dec/ivas_ism_dec_fx.c +++ b/lib_dec/ivas_ism_dec_fx.c @@ -123,43 +123,43 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->hDecoderConfig->output_config ); } - test(); - test(); - /* transfer subframe info from DirAC or ParamMC to central tc buffer */ - /* only do this if we are not having done everything already in the TC decoding part and having only played out from the TC buffer */ - IF( EQ_32( last_ism_mode, ISM_MODE_PARAM ) && st_ivas->hSpatParamRendCom != NULL && NE_32( st_ivas->hTcBuffer->tc_buffer_mode, TC_BUFFER_MODE_BUFFER ) ) - { - st_ivas->hTcBuffer->nb_subframes = st_ivas->hSpatParamRendCom->nb_subframes; - move16(); - st_ivas->hTcBuffer->subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; - move16(); - st_ivas->hTcBuffer->num_slots = st_ivas->hSpatParamRendCom->num_slots; - move16(); - st_ivas->hTcBuffer->slots_rendered = st_ivas->hSpatParamRendCom->slots_rendered; - move16(); - Copy( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); - } + test(); + test(); + /* transfer subframe info from DirAC or ParamMC to central tc buffer */ + /* only do this if we are not having done everything already in the TC decoding part and having only played out from the TC buffer */ + IF( EQ_32( last_ism_mode, ISM_MODE_PARAM ) && st_ivas->hSpatParamRendCom != NULL && NE_32( st_ivas->hTcBuffer->tc_buffer_mode, TC_BUFFER_MODE_BUFFER ) ) + { + st_ivas->hTcBuffer->nb_subframes = st_ivas->hSpatParamRendCom->nb_subframes; + move16(); + st_ivas->hTcBuffer->subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; + move16(); + st_ivas->hTcBuffer->num_slots = st_ivas->hSpatParamRendCom->num_slots; + move16(); + st_ivas->hTcBuffer->slots_rendered = st_ivas->hSpatParamRendCom->slots_rendered; + move16(); + Copy( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); + } - /* JBM: when granularity goes down (e.g. Discrete ISM with TD Obj Renderer -> ParamISM with binaural fastconv - render what still fits in the new granularity */ + /* JBM: when granularity goes down (e.g. Discrete ISM with TD Obj Renderer -> ParamISM with binaural fastconv + render what still fits in the new granularity */ #ifdef NONBE_1303_REND_GRANULARITY - tc_granularity_new = ivas_jbm_dec_get_render_granularity_fx( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs ); + tc_granularity_new = ivas_jbm_dec_get_render_granularity_fx( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs ); #else tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, st_ivas->ivas_format, st_ivas->mc_mode, st_ivas->hDecoderConfig->output_Fs ); #endif - IF( LT_16( tc_granularity_new, st_ivas->hTcBuffer->n_samples_granularity ) ) - { - /* flush already done in IVAS_DEC_ReadFormat() */ - } - /* JBM: when granularity goes up set samples to discard at the beginning of the frame */ - ELSE IF( GT_16( tc_granularity_new, st_ivas->hTcBuffer->n_samples_granularity ) ) + IF( LT_16( tc_granularity_new, st_ivas->hTcBuffer->n_samples_granularity ) ) + { + /* flush already done in IVAS_DEC_ReadFormat() */ + } + /* JBM: when granularity goes up set samples to discard at the beginning of the frame */ + ELSE IF( GT_16( tc_granularity_new, st_ivas->hTcBuffer->n_samples_granularity ) ) + { + IF( NE_32( ( error = ivas_jbm_dec_set_discard_samples_fx( st_ivas ) ), IVAS_ERR_OK ) ) { - IF( NE_32( ( error = ivas_jbm_dec_set_discard_samples_fx( st_ivas ) ), IVAS_ERR_OK ) ) - { - return error; - } + return error; } + } IF( NE_16( st_ivas->ism_mode, last_ism_mode ) ) { @@ -311,65 +311,65 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( * output audio buffers *-----------------------------------------------------------------*/ - nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); + nchan_out_buff = ivas_get_nchan_buffers_dec_fx( st_ivas, -1, -1 ); - IF( NE_32( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ), IVAS_ERR_OK ) ) - { - return error; - } + IF( NE_32( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ), IVAS_ERR_OK ) ) + { + return error; + } /*-----------------------------------------------------------------* * JBM TC buffers *-----------------------------------------------------------------*/ - Word16 tc_nchan_full_new; - DECODER_TC_BUFFER_HANDLE hTcBuffer; + Word16 tc_nchan_full_new; + DECODER_TC_BUFFER_HANDLE hTcBuffer; - hTcBuffer = st_ivas->hTcBuffer; - tc_buffer_mode_new = ivas_jbm_dec_get_tc_buffer_mode_fx( st_ivas ); - tc_nchan_tc_new = ivas_jbm_dec_get_num_tc_channels_fx( st_ivas ); - tc_nchan_allocate_new = tc_nchan_tc_new; - move16(); - tc_nchan_full_new = tc_nchan_tc_new; - move16(); + hTcBuffer = st_ivas->hTcBuffer; + tc_buffer_mode_new = ivas_jbm_dec_get_tc_buffer_mode_fx( st_ivas ); + tc_nchan_tc_new = ivas_jbm_dec_get_num_tc_channels_fx( st_ivas ); + tc_nchan_allocate_new = tc_nchan_tc_new; + move16(); + tc_nchan_full_new = tc_nchan_tc_new; + move16(); - test(); - test(); - test(); - test(); - if ( EQ_32( st_ivas->ism_mode, ISM_MODE_PARAM ) && ( NE_32( st_ivas->renderer_type, RENDERER_MONO_DOWNMIX ) && NE_32( st_ivas->renderer_type, RENDERER_DISABLE ) && NE_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) && NE_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) ) - { - tc_nchan_full_new = 0; - move16(); - } + test(); + test(); + test(); + test(); + if ( EQ_32( st_ivas->ism_mode, ISM_MODE_PARAM ) && ( NE_32( st_ivas->renderer_type, RENDERER_MONO_DOWNMIX ) && NE_32( st_ivas->renderer_type, RENDERER_DISABLE ) && NE_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) && NE_32( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) ) + { + tc_nchan_full_new = 0; + move16(); + } - /* reconfigure buffer */ - test(); - test(); - test(); - IF( NE_32( hTcBuffer->tc_buffer_mode, tc_buffer_mode_new ) || NE_16( hTcBuffer->nchan_transport_jbm, tc_nchan_tc_new ) || - NE_16( hTcBuffer->nchan_buffer_full, tc_nchan_full_new ) || NE_16( hTcBuffer->nchan_transport_internal, tc_nchan_allocate_new ) ) + /* reconfigure buffer */ + test(); + test(); + test(); + IF( NE_32( hTcBuffer->tc_buffer_mode, tc_buffer_mode_new ) || NE_16( hTcBuffer->nchan_transport_jbm, tc_nchan_tc_new ) || + NE_16( hTcBuffer->nchan_buffer_full, tc_nchan_full_new ) || NE_16( hTcBuffer->nchan_transport_internal, tc_nchan_allocate_new ) ) + { + IF( NE_32( ( error = ivas_jbm_dec_tc_buffer_reconfigure_fx( st_ivas, tc_buffer_mode_new, tc_nchan_tc_new, tc_nchan_allocate_new, tc_nchan_full_new, tc_granularity_new ) ), IVAS_ERR_OK ) ) { - IF( NE_32( ( error = ivas_jbm_dec_tc_buffer_reconfigure_fx( st_ivas, tc_buffer_mode_new, tc_nchan_tc_new, tc_nchan_allocate_new, tc_nchan_full_new, tc_granularity_new ) ), IVAS_ERR_OK ) ) - { - return error; - } + return error; } + } - /* transfer subframe info from central tc buffer to ParamMC or McMASA (DirAC) */ - IF( st_ivas->hSpatParamRendCom != NULL ) - { - st_ivas->hSpatParamRendCom->nb_subframes = st_ivas->hTcBuffer->nb_subframes; - move16(); - st_ivas->hSpatParamRendCom->subframes_rendered = st_ivas->hTcBuffer->subframes_rendered; - move16(); - st_ivas->hSpatParamRendCom->num_slots = st_ivas->hTcBuffer->num_slots; - move16(); - st_ivas->hSpatParamRendCom->slots_rendered = st_ivas->hTcBuffer->slots_rendered; - move16(); + /* transfer subframe info from central tc buffer to ParamMC or McMASA (DirAC) */ + IF( st_ivas->hSpatParamRendCom != NULL ) + { + st_ivas->hSpatParamRendCom->nb_subframes = st_ivas->hTcBuffer->nb_subframes; + move16(); + st_ivas->hSpatParamRendCom->subframes_rendered = st_ivas->hTcBuffer->subframes_rendered; + move16(); + st_ivas->hSpatParamRendCom->num_slots = st_ivas->hTcBuffer->num_slots; + move16(); + st_ivas->hSpatParamRendCom->slots_rendered = st_ivas->hTcBuffer->slots_rendered; + move16(); - Copy( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); - } + Copy( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); + } return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index 5f2665a2e..d2243feb2 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -1007,7 +1007,6 @@ void ivas_ism_dec_digest_tc_fx( v_multc_fx( st_ivas->hIsmRendererData->gains_fx[i], st_ivas->hIsmMetaData[i]->edited_gain_fx, st_ivas->hIsmRendererData->gains_fx[i], CPE_CHANNELS ); // Q30, Q29 --> Q28 Scale_sig32( st_ivas->hIsmRendererData->gains_fx[i], CPE_CHANNELS, Q2 ); // Q28 --> Q30 } - } ELSE { @@ -1151,7 +1150,6 @@ void ivas_param_ism_dec_digest_tc_fx( hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc_exp = sub( 31, q_tc ); move16(); } - } } diff --git a/lib_dec/ivas_mc_param_dec_fx.c b/lib_dec/ivas_mc_param_dec_fx.c index 869800c6b..b56ffd566 100644 --- a/lib_dec/ivas_mc_param_dec_fx.c +++ b/lib_dec/ivas_mc_param_dec_fx.c @@ -1546,30 +1546,29 @@ void ivas_param_mc_dec_digest_tc_fx( move16(); - /* slot loop for gathering the input data */ - FOR( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ ) + /* slot loop for gathering the input data */ + FOR( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ ) + { + IF( st_ivas->hDecoderConfig->Opt_tsm ) { - IF( st_ivas->hDecoderConfig->Opt_tsm ) - { - Word32 RealBuffer_fx[CLDFB_NO_CHANNELS_MAX]; - Word32 ImagBuffer_fx[CLDFB_NO_CHANNELS_MAX]; + Word32 RealBuffer_fx[CLDFB_NO_CHANNELS_MAX]; + Word32 ImagBuffer_fx[CLDFB_NO_CHANNELS_MAX]; - /* CLDFB Analysis*/ - FOR( ch = 0; ch < nchan_transport; ch++ ) - { - qout = transport_f_e; - move16(); - cldfbAnalysis_ts_fx_fixed_q( &( p_data_fx[ch][hParamMC->num_freq_bands * slot_idx] ), RealBuffer_fx, ImagBuffer_fx, hParamMC->num_freq_bands, st_ivas->cldfbAnaDec[ch], &qout ); - - Copy32( RealBuffer_fx, &hParamMC->Cldfb_RealBuffer_tc_fx[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands ); - Copy32( ImagBuffer_fx, &hParamMC->Cldfb_ImagBuffer_tc_fx[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands ); - } + /* CLDFB Analysis*/ + FOR( ch = 0; ch < nchan_transport; ch++ ) + { + qout = transport_f_e; + move16(); + cldfbAnalysis_ts_fx_fixed_q( &( p_data_fx[ch][hParamMC->num_freq_bands * slot_idx] ), RealBuffer_fx, ImagBuffer_fx, hParamMC->num_freq_bands, st_ivas->cldfbAnaDec[ch], &qout ); - hParamMC->Cldfb_ImagBuffer_tc_e = qout; - move16(); + Copy32( RealBuffer_fx, &hParamMC->Cldfb_RealBuffer_tc_fx[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands ); + Copy32( ImagBuffer_fx, &hParamMC->Cldfb_ImagBuffer_tc_fx[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands ); } + hParamMC->Cldfb_ImagBuffer_tc_e = qout; + move16(); } + } pop_wmops(); diff --git a/lib_dec/ivas_mct_dec_fx.c b/lib_dec/ivas_mct_dec_fx.c index 7069d7db4..63b776d80 100644 --- a/lib_dec/ivas_mct_dec_fx.c +++ b/lib_dec/ivas_mct_dec_fx.c @@ -1031,10 +1031,10 @@ static ivas_error ivas_mc_dec_reconfig_fx( ivas_masa_dec_close_fx( &( st_ivas->hMasa ) ); ivas_qmetadata_close_fx( &st_ivas->hQMetaData ); - ivas_dirac_rend_close_fx( &( st_ivas->hDirACRend ) ); - ivas_spat_hSpatParamRendCom_close_fx( &( st_ivas->hSpatParamRendCom ) ); - ivas_dirac_dec_close_fx( &( st_ivas->hDirAC ) ); - vbap_free_data_fx( &( st_ivas->hVBAPdata ) ); + ivas_dirac_rend_close_fx( &( st_ivas->hDirACRend ) ); + ivas_spat_hSpatParamRendCom_close_fx( &( st_ivas->hSpatParamRendCom ) ); + ivas_dirac_dec_close_fx( &( st_ivas->hDirAC ) ); + vbap_free_data_fx( &( st_ivas->hVBAPdata ) ); /* init LS conversion if the renderer type asks for it */ test(); @@ -1114,10 +1114,10 @@ static ivas_error ivas_mc_dec_reconfig_fx( ivas_masa_dec_close_fx( &( st_ivas->hMasa ) ); ivas_qmetadata_close_fx( &st_ivas->hQMetaData ); - ivas_dirac_rend_close_fx( &( st_ivas->hDirACRend ) ); - ivas_spat_hSpatParamRendCom_close_fx( &( st_ivas->hSpatParamRendCom ) ); - ivas_dirac_dec_close_fx( &( st_ivas->hDirAC ) ); - vbap_free_data_fx( &( st_ivas->hVBAPdata ) ); + ivas_dirac_rend_close_fx( &( st_ivas->hDirACRend ) ); + ivas_spat_hSpatParamRendCom_close_fx( &( st_ivas->hSpatParamRendCom ) ); + ivas_dirac_dec_close_fx( &( st_ivas->hDirAC ) ); + vbap_free_data_fx( &( st_ivas->hVBAPdata ) ); IF( EQ_16( last_mc_mode, MC_MODE_MCT ) ) { diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 7791de9db..83e368364 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1070,8 +1070,8 @@ typedef struct decoder_config_structure Word16 Opt_ExternalOrientation; /* indicates whether external orientations are used */ Word16 Opt_dpid_on; /* indicates whether Directivity pattern option is used */ Word16 Opt_aeid_on; /* indicates whether Acoustic environment option is used */ - Word16 Opt_ObjEdit_on; /* indicates whether object editing option is used */ - Word16 Opt_tsm; /* indicates whether time scaling modification is activated */ + Word16 Opt_ObjEdit_on; /* indicates whether object editing option is used */ + Word16 Opt_tsm; /* indicates whether time scaling modification is activated */ IVAS_RENDER_FRAMESIZE render_framesize; Word16 Opt_delay_comp; /* flag indicating delay compensation active */ diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index f46bea4d4..9f6b28ed3 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -543,8 +543,8 @@ ivas_error IVAS_DEC_Configure( const Word16 non_diegetic_pan_gain_fx, /* i : non diegetic panning gain */ const bool dpidEnabled, /* i : enable directivity pattern option */ const UWord16 acousticEnvironmentId, /* i : Acoustic environment ID */ - const bool objEditEnabled, /* i : enable object editing */ - const bool delayCompensationEnabled /* i : enable delay compensation */ + const bool objEditEnabled, /* i : enable object editing */ + const bool delayCompensationEnabled /* i : enable delay compensation */ ) { Decoder_Struct *st_ivas; @@ -1314,24 +1314,24 @@ ivas_error IVAS_DEC_GetSamples( #ifndef LIB_DEC_REVISION { #endif - nOutChannels = (UWord8) st_ivas->hDecoderConfig->nchan_out; - hIvasDec->hasBeenFedFrame = false; + nOutChannels = (UWord8) st_ivas->hDecoderConfig->nchan_out; + hIvasDec->hasBeenFedFrame = false; - /* check for possible flushed samples from a rate switch */ - IF( GE_16( hIvasDec->nSamplesFlushed, 0 ) ) - { - /* note: offset (rendered samples) is always 0 */ - Copy( hIvasDec->flushbuffer, pcmBuf, imult1616( hIvasDec->nSamplesFlushed, nOutChannels ) ); + /* check for possible flushed samples from a rate switch */ + IF( GE_16( hIvasDec->nSamplesFlushed, 0 ) ) + { + /* note: offset (rendered samples) is always 0 */ + Copy( hIvasDec->flushbuffer, pcmBuf, imult1616( hIvasDec->nSamplesFlushed, nOutChannels ) ); #ifdef LIB_DEC_REVISION - nSamplesRendered = hIvasDec->nSamplesFlushed; + nSamplesRendered = hIvasDec->nSamplesFlushed; #else nSamplesRendered = add( nSamplesRendered, hIvasDec->nSamplesFlushed ); #endif - hIvasDec->nSamplesFlushed = 0; - move16(); - move16(); - } + hIvasDec->nSamplesFlushed = 0; + move16(); + move16(); + } /* render IVAS frames directly to the output buffer */ #ifdef LIB_DEC_REVISION @@ -4630,10 +4630,10 @@ ivas_error IVAS_DEC_VoIP_GetSamples( JbmTraceFileWriterFn jbmWriterFn, void *jbmWriter, #endif - bool *bitstreamReadDone, /* o : flag indicating that bitstream was read */ - UWord16 *nSamplesRendered, /* o : number of samples rendered */ + bool *bitstreamReadDone, /* o : flag indicating that bitstream was read */ + UWord16 *nSamplesRendered, /* o : number of samples rendered */ bool *parametersAvailableForEditing, /* o : indicates whether objects editing is available */ - const UWord32 systemTimestamp_ms /* i : current system timestamp */ + const UWord32 systemTimestamp_ms /* i : current system timestamp */ ) { Decoder_Struct *st_ivas; -- GitLab