diff --git a/apps/decoder.c b/apps/decoder.c index 7118e56c666d987404d6181581ecc1d085d64b6f..936a3e4f9c1e29117542d24d017751156e5b6e98 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -147,9 +147,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 @@ -194,13 +192,11 @@ static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBs static int16_t app_own_random( int16_t *seed ); static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( char *forcedRendModeChar ); #endif -#ifdef OBJ_EDITING_EXAMPLE #ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE static void do_object_editing( IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader ); #else static void do_object_editing( IVAS_EDITABLE_PARAMETERS *editableParameters ); #endif -#endif /*------------------------------------------------------------------------------------------* @@ -462,13 +458,8 @@ 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, 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, - 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, arg.dpidEnabled, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) @@ -1070,9 +1061,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 @@ -1605,7 +1594,6 @@ static bool parseCmdlIVAS_dec( i += tmp; } -#ifdef OBJ_EDITING_COMMANDLINE else if ( strcmp( argv_to_upper, "-OBJ_EDIT" ) == 0 ) { arg->objEditEnabled = true; @@ -1629,7 +1617,6 @@ static bool parseCmdlIVAS_dec( i++; #endif } -#endif /*-----------------------------------------------------------------* * Option not recognized @@ -1837,12 +1824,10 @@ static void usage_dec( void ) fprintf( stdout, " ID and duration pairs, where duration is specified in frames\n" ); #endif 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" ); fprintf( stdout, " Currently, all values default to level 3 (full functionality).\n" ); @@ -2599,7 +2584,6 @@ static ivas_error decodeG192( return error; } -#ifdef OBJ_EDITING_API /* Object metadata editing */ if ( arg.objEditEnabled ) { @@ -2624,12 +2608,10 @@ static ivas_error decodeG192( #endif /* Do object metadata editing here ... */ -#ifdef OBJ_EDITING_EXAMPLE #ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE do_object_editing( &editableParameters, objectEditFileReader ); #else do_object_editing( &editableParameters ); -#endif #endif /* set new object parameters*/ @@ -2639,7 +2621,6 @@ static ivas_error decodeG192( return error; } } -#endif /* Do the final preparations needed for rendering */ if ( ( error = IVAS_DEC_PrepareRenderer( hIvasDec ) ) != IVAS_ERR_OK ) { @@ -3206,9 +3187,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; @@ -3509,17 +3488,9 @@ static ivas_error decodeVoIP( while ( nSamplesRendered < nOutSamples ) { #ifdef SUPPORT_JBM_TRACEFILE -#ifdef OBJ_EDITING_API if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, ¶metersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) #else - if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (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, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &bitstreamReadDone, ¶metersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &bitstreamReadDone, systemTime_ms ) ) != IVAS_ERR_OK ) -#endif #endif { fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -3550,7 +3521,6 @@ static ivas_error decodeVoIP( } } -#ifdef OBJ_EDITING_API /* Object metadata editing */ if ( arg.objEditEnabled && parametersAvailableForEditing == true ) { @@ -3564,14 +3534,12 @@ static ivas_error decodeVoIP( } /* Do object metadata editing here ... */ -#ifdef OBJ_EDITING_EXAMPLE #ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE do_object_editing( &editableParameters, objectEditFileReader ); #else do_object_editing( &editableParameters ); #endif -#endif /* set new object parameters */ if ( ( error = IVAS_DEC_SetEditableParameters( hIvasDec, editableParameters ) ) != IVAS_ERR_OK ) { @@ -3579,7 +3547,6 @@ static ivas_error decodeVoIP( return error; } } -#endif } /* while ( nSamplesRendered < nOutSamples ) */ /* write JBM Offset file entry */ @@ -3885,7 +3852,6 @@ cleanup: return error; } -#ifdef OBJ_EDITING_EXAMPLE /*---------------------------------------------------------------------* * do_object_editing() @@ -4006,7 +3972,6 @@ static void do_object_editing( return; } -#endif #ifdef DEBUGGING /*---------------------------------------------------------------------* diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 90c17ff332c6914fdde014000fb0cfe12f278ddf..ad77fa155e5998eb3e3bd8ebc2cb510ad71fa398 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -131,13 +131,10 @@ typedef struct _IVAS_ISM_METADATA float yaw; float pitch; int16_t non_diegetic_flag; -#ifdef OBJ_EDITING_API float gain; -#endif } IVAS_ISM_METADATA; -#ifdef OBJ_EDITING_API typedef struct _IVAS_EDITABLE_PARAMETERS { int16_t num_obj; @@ -145,7 +142,6 @@ typedef struct _IVAS_EDITABLE_PARAMETERS float gain_bed; } IVAS_EDITABLE_PARAMETERS; -#endif typedef struct { diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 0dfee803658d93bfe02c6cd9f5c965e43f555786..5708e047935694e14c08f4383bd965af81365895 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1221,11 +1221,9 @@ enum #define MASA_MAXIMUM_TWO_DIR_BANDS 24 #define NBITS_HR_COH 4 #define OMASA_TDREND_MATCHING_GAIN 0.7943f -#ifdef OMASA_OBJECT_EDITING #define OMASA_GAIN_EDIT_THR 0.06f /* OMASA gain change threshold */ #define OMASA_AZI_EDIT_THR 1.0f /* OMASA-DISC azimuth change threshold */ #define OMASA_ELE_EDIT_THR 2.0f /* OMASA-DISC elevation change threshold */ -#endif #define MASA_JBM_RINGBUFFER_FRAMES 3 diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index e766962bd2e2b2a1fb0418b9241ad19da501d2e6..58c356adef991ebc1f76b23b1e17fb6a2d22038b 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 @@ -261,10 +259,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.c b/lib_com/ivas_ism_com.c index 11e184e1ce0f608978125c7455373bcf1ed2dbba..589552874a12b8e5c9ba24cfdf408b376738c6d4 100644 --- a/lib_com/ivas_ism_com.c +++ b/lib_com/ivas_ism_com.c @@ -418,7 +418,6 @@ void ivas_ism_reset_metadata( hIsmMeta->ism_metadata_flag = 0; hIsmMeta->non_diegetic_flag = 0; -#ifdef OBJ_EDITING_API hIsmMeta->edited_gain = 1.0f; hIsmMeta->edited_azimuth = 0.0f; hIsmMeta->edited_elevation = 0.0f; @@ -427,7 +426,6 @@ void ivas_ism_reset_metadata( hIsmMeta->edited_radius = 1.0f; hIsmMeta->gain = 1.0f; hIsmMeta->non_diegetic_flag = 0; -#endif return; } diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index a4db085e2d11c25cdc9f2ee5e56542bef317f8ee..ba06cab80024a4ee1e9319c9d9a00938c05f5618 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -853,11 +853,9 @@ void ivas_jbm_dec_feed_tc_to_renderer( float *data /* i/o: transport channels/output synthesis signal */ ); -#ifdef OBJ_EDITING_API void ivas_dec_prepare_renderer( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); -#endif ivas_error ivas_jbm_dec_set_discard_samples( Decoder_Struct *st_ivas /* i/o: main IVAS decoder structre */ @@ -1145,7 +1143,6 @@ void ivas_param_ism_dec_digest_tc( float *transport_channels_f[] /* i : synthesized core-coder transport channels/DirAC output */ ); -#ifdef OBJ_EDITING_API void ivas_param_ism_dec_dequant_md( Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ ); @@ -1154,7 +1151,6 @@ void ivas_param_ism_dec_prepare_renderer( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nCldfbSlots /* i : number of CLDFB slots in transport channels */ ); -#endif void ivas_ism_param_dec_tc_gain_ajust( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ @@ -3911,12 +3907,10 @@ void ivas_param_mc_dec_digest_tc( float *p_data_f[] /* i/o: synthesized core-coder transport channels/DirAC output*/ ); -#ifdef OBJ_EDITING_API void ivas_param_mc_dec_prepare_renderer( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint8_t nCldfbSlots /* i : number of CLDFB slots in transport channels */ ); -#endif void ivas_param_mc_dec_render( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ @@ -5633,7 +5627,6 @@ ivas_error ivas_osba_render_sf( float *output_f[] /* o : rendered time signal */ ); -#ifdef OBJ_EDITING_API void ivas_osba_stereo_add_channels( float *tc_f[], /* i : transport channels */ float *output_f[], /* i/o: output channels */ @@ -5643,16 +5636,6 @@ void ivas_osba_stereo_add_channels( const int16_t ism_mode, /* i : ISM mode */ const int16_t n_samples_to_render /* i : output frame length per channel */ ); -#else -void ivas_osba_stereo_add_channels( - float *tc_f[], /* i : transport channels */ - float *output_f[], /* i/o: output channels */ - const float gain, /* i : gain bed value */ - const int16_t nchan_out, /* i : number of output channels */ - const int16_t nchan_ism, /* i : number of ISM channels */ - const int16_t n_samples_to_render /* i : output frame length per channel */ -); -#endif void ivas_osba_data_close( SBA_ISM_DATA_HANDLE *hSbaIsmData /* i/o: OSBA rendering handle */ @@ -5835,11 +5818,7 @@ void ivas_omasa_dirac_rend_jbm( float *output_f[] /* o : rendered time signal */ ); -#ifdef OMASA_OBJECT_EDITING void ivas_omasa_preProcessStereoTransportsForEditedObjects( -#else -void ivas_omasa_preProcessStereoTransportsForMovedObjects( -#endif Decoder_Struct *st_ivas, float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index cb5b006994dba4a081ed4766bdd621bb76c97dfd..c9149d965dc8ff4f6ea3628cb96b70e5bf9b3a2c 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -65,7 +65,6 @@ typedef struct float yaw; /* yaw value read from the input metadata file */ float pitch; /* pitch value read from the input metadata file */ -#ifdef OBJ_EDITING_API float gain; float edited_azimuth; @@ -75,7 +74,6 @@ typedef struct float edited_yaw; float edited_pitch; float edited_gain; -#endif int16_t non_diegetic_flag; /* Non-diegetic (non-headtracked) object flag */ diff --git a/lib_com/options.h b/lib_com/options.h index eecc2fe2513efe915a46258b5f9169dd2e859103..e77fa5b8ff3a20a81d480bb5dfedbf15383061ec 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,7 +160,6 @@ /* #################### Start BASOP porting switches ############################ */ -#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_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_1320_STACK_CPE_DECODER /* VA: issue 1320: Optimize the stack memory consumption in the CPE decoder */ #define NONBE_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0 */ @@ -168,8 +167,6 @@ #define NONBE_1302_FIX_OMASA_JBM_FLUSH /* VA: issue 1302: fix OMASA JBM bitrate switching flush in binaural output */ #define FIX_1319_STACK_SBA_DECODER /* VA: issue 1319: Optimize the definition of buffer lengths in the SBA 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 */ #define FIX_1377_HANDLE_ERROR_CODE /* Eri: Add missing error code handling from IVAS_REND_SetObjectIDs */ @@ -178,8 +175,6 @@ #define NONBE_1246_INF_COHERENCE_IN_HIGH_LEVEL_DTX /* Ericsson: Issue 1246: High level input which triggers DTX can lead to numerical overflow in coherence calculation */ #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() */ #define FIX_1376_MISSING_ISM_METADATA /* FhG: IVAS_rend: throw error if there exists an ISM input without a corresponding metadata file path */ @@ -187,8 +182,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 NONBE_1300_TDREND_LARGE_ITD /* Eri: issue 1300: There was a bug feeding 1.25 ms frames to the TD renderer, causing out-of-buffer access. This was resolved. However, it is still possible that modeled HRTF with large ITDs could trigger out-of-buffer access. This adds a check to prevent this.*/ -#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() */ #define NONBE_1303_REND_GRANULARITY /* VA: issue 1303: Renderer granularity revision */ @@ -198,28 +191,14 @@ #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 -#endif // objject-editing feature porting -#define OBJ_EDITING_INTERFACE /* Interface for object editing */ -#ifdef OBJ_EDITING_INTERFACE -#define OBJ_EDITING_API /* object editing changes related to the API */ -#ifdef OBJ_EDITING_API #define FIX_HRTF_LOAD_API // solves API conflicts between HRTF and object-editing features #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 -#endif -#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 */ -#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 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.c b/lib_dec/ivas_dirac_dec.c index 493c38e441b9aae13a05878b85bef0c05244c3f9..b5173e70d51a4da147377b8ad472b65a5957e9b2 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1934,7 +1934,6 @@ void ivas_dirac_dec_render_sf( } } -#ifdef OMASA_OBJECT_EDITING if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { #ifdef FIX_1319_STACK_SBA_DECODER @@ -1943,16 +1942,6 @@ void ivas_dirac_dec_render_sf( ivas_omasa_preProcessStereoTransportsForEditedObjects( st_ivas, Cldfb_RealBuffer_Temp, Cldfb_ImagBuffer_Temp, hSpatParamRendCom->num_freq_bands, subframe_idx ); #endif } -#else - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) - { -#ifdef FIX_1319_STACK_SBA_DECODER - ivas_omasa_preProcessStereoTransportsForMovedObjects( st_ivas, Cldfb_RealBuffer_Binaural[0], Cldfb_ImagBuffer_Binaural[0], hSpatParamRendCom->num_freq_bands, subframe_idx ); -#else - ivas_omasa_preProcessStereoTransportsForMovedObjects( st_ivas, Cldfb_RealBuffer_Temp, Cldfb_ImagBuffer_Temp, hSpatParamRendCom->num_freq_bands, subframe_idx ); -#endif - } -#endif } for ( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[subframe_idx]; slot_idx++ ) @@ -2367,9 +2356,7 @@ void ivas_dirac_dec_render_sf( if ( st_ivas->hEFAPdata != NULL ) { efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], az1, el1, EFAP_MODE_EFAP ); -#ifdef OBJ_EDITING_API v_multc( st_ivas->hIsmRendererData->gains[i], st_ivas->hIsmMetaData[i]->edited_gain, st_ivas->hIsmRendererData->gains[i], nchan_out_woLFE ); -#endif } } diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 5e972172c0ffe991b2924d474df1e3f879899dc7..8aced209a4c338e996d2e00c81f80f6a951410b1 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -565,9 +565,7 @@ 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; -#endif st_ivas->nchan_ism = st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 3] + 2 * st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 2]; if ( st_ivas->nchan_ism > 0 ) @@ -804,14 +802,12 @@ ivas_error ivas_dec_setup( } } -#ifdef NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH if ( st_ivas->ini_frame > 0 && st_ivas->ivas_format == MASA_FORMAT ) { st_ivas->nchan_ism = 0; st_ivas->ism_mode = ISM_MODE_NONE; } -#endif if ( st_ivas->ivas_format == ISM_FORMAT ) { ISM_MODE last_ism_mode = st_ivas->ism_mode; @@ -1490,7 +1486,6 @@ ivas_error ivas_init_decoder( { st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->seed2 = st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->seed3; -#ifdef OBJ_EDITING_PARAMISM_BIN if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) { /* reusing OMASA function for allocating and initializing MASA_ISM rendering handle (even though not in OMASA) */ @@ -1499,7 +1494,6 @@ ivas_error ivas_init_decoder( return error; } } -#endif } else if ( st_ivas->ism_mode == ISM_MODE_DISC ) { @@ -1799,24 +1793,10 @@ ivas_error ivas_init_decoder( reset_indices_dec( st_ivas->hSCE[0]->hCoreCoder[0] ); -#ifndef OMASA_OBJECT_EDITING - if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) - { -#endif - if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) - { - return error; - } -#ifndef OMASA_OBJECT_EDITING - } - else + if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) { - if ( ( error = ivas_ism_metadata_dec_create( st_ivas, 1, NULL ) ) != IVAS_ERR_OK ) - { - return error; - } + return error; } -#endif } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { @@ -3250,19 +3230,13 @@ static ivas_error doSanityChecks_IVAS( } } -#ifdef OBJ_EDITING_COMMANDLINE if ( st_ivas->hDecoderConfig->Opt_ObjEdit_on ) { -#ifdef FIX_BRATE_SWITCHING if ( !( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT || ( st_ivas->ivas_format == MASA_FORMAT && 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: Object editing is not supported in this IVAS format." ); } } -#endif #ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE if ( st_ivas->hDecoderConfig->Opt_ObjEdit_on && st_ivas->hDecoderConfig->Opt_non_diegetic_pan ) diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 2120f49ba7b19ff89134c9fa6e5ede68692810b1..cf77aae0191e5a977001160ecfd7f63e48c7d9ea 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -111,43 +111,37 @@ static ivas_error ivas_ism_bitrate_switching_dec( ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->hDecoderConfig->output_config ); } -#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH + /* 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 ( last_ism_mode == ISM_MODE_PARAM && st_ivas->hSpatParamRendCom != NULL && st_ivas->hTcBuffer->tc_buffer_mode != TC_BUFFER_MODE_BUFFER ) { -#endif - /* 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 ( last_ism_mode == ISM_MODE_PARAM && st_ivas->hSpatParamRendCom != NULL && st_ivas->hTcBuffer->tc_buffer_mode != TC_BUFFER_MODE_BUFFER ) - { - st_ivas->hTcBuffer->nb_subframes = st_ivas->hSpatParamRendCom->nb_subframes; - st_ivas->hTcBuffer->subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; - st_ivas->hTcBuffer->num_slots = st_ivas->hSpatParamRendCom->num_slots; - st_ivas->hTcBuffer->slots_rendered = st_ivas->hSpatParamRendCom->slots_rendered; - mvs2s( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); - } + st_ivas->hTcBuffer->nb_subframes = st_ivas->hSpatParamRendCom->nb_subframes; + st_ivas->hTcBuffer->subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; + st_ivas->hTcBuffer->num_slots = st_ivas->hSpatParamRendCom->num_slots; + st_ivas->hTcBuffer->slots_rendered = st_ivas->hSpatParamRendCom->slots_rendered; + mvs2s( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); + } - /* 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( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs ); + tc_granularity_new = ivas_jbm_dec_get_render_granularity( 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 ( 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 ( tc_granularity_new > st_ivas->hTcBuffer->n_samples_granularity ) + if ( 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 ( tc_granularity_new > st_ivas->hTcBuffer->n_samples_granularity ) + { + if ( ( error = ivas_jbm_dec_set_discard_samples( st_ivas ) ) != IVAS_ERR_OK ) { - if ( ( error = ivas_jbm_dec_set_discard_samples( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } + return error; } -#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH } -#endif if ( st_ivas->ism_mode != last_ism_mode ) { @@ -170,10 +164,8 @@ static ivas_error ivas_ism_bitrate_switching_dec( /* close the parametric binaural renderer */ ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); -#ifdef OBJ_EDITING_PARAMISM_BIN /* Close omasa data struct (used for object editing) */ ivas_omasa_data_close( &st_ivas->hMasaIsmData ); -#endif /* Open the TD Binaural renderer */ if ( st_ivas->hHrtfTD == NULL || st_ivas->hBinRendererTd == NULL ) @@ -208,10 +200,8 @@ static ivas_error ivas_ism_bitrate_switching_dec( /* close the parametric binaural renderer */ ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); -#ifdef OBJ_EDITING_PARAMISM_BIN /* Close omasa data struct (used for object editing) */ ivas_omasa_data_close( &st_ivas->hMasaIsmData ); -#endif /* Open Crend Binaural renderer */ if ( ( error = ivas_rend_openCrend( &( 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 ) @@ -245,13 +235,11 @@ static ivas_error ivas_ism_bitrate_switching_dec( return error; } -#ifdef OBJ_EDITING_PARAMISM_BIN /* Open omasa data struct (used for object editing) */ if ( ( error = ivas_omasa_data_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; } -#endif /* Close the TD Binaural renderer */ ivas_td_binaural_close( &st_ivas->hBinRendererTd ); @@ -280,13 +268,11 @@ static ivas_error ivas_ism_bitrate_switching_dec( return error; } -#ifdef OBJ_EDITING_PARAMISM_BIN /* Open omasa data struct (used for object editing) */ if ( ( error = ivas_omasa_data_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; } -#endif /* close the crend binaural renderer */ ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) ); @@ -306,64 +292,52 @@ static ivas_error ivas_ism_bitrate_switching_dec( * floating-point output audio buffers *-----------------------------------------------------------------*/ -#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH - { -#endif - nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); + nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); - if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) - { - return error; - } -#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH + if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) + { + return error; } -#endif /*-----------------------------------------------------------------* * JBM TC buffers *-----------------------------------------------------------------*/ -#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH - { -#endif - int16_t tc_nchan_full_new; - DECODER_TC_BUFFER_HANDLE hTcBuffer; + int16_t tc_nchan_full_new; + DECODER_TC_BUFFER_HANDLE hTcBuffer; - hTcBuffer = st_ivas->hTcBuffer; - tc_buffer_mode_new = ivas_jbm_dec_get_tc_buffer_mode( st_ivas ); - tc_nchan_tc_new = ivas_jbm_dec_get_num_tc_channels( st_ivas ); - tc_nchan_allocate_new = tc_nchan_tc_new; - tc_nchan_full_new = tc_nchan_tc_new; + hTcBuffer = st_ivas->hTcBuffer; + tc_buffer_mode_new = ivas_jbm_dec_get_tc_buffer_mode( st_ivas ); + tc_nchan_tc_new = ivas_jbm_dec_get_num_tc_channels( st_ivas ); + tc_nchan_allocate_new = tc_nchan_tc_new; + tc_nchan_full_new = tc_nchan_tc_new; - if ( st_ivas->ism_mode == ISM_MODE_PARAM && ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) - { - tc_nchan_full_new = 0; - } + if ( st_ivas->ism_mode == ISM_MODE_PARAM && ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) + { + tc_nchan_full_new = 0; + } - /* reconfigure buffer */ - if ( hTcBuffer->tc_buffer_mode != tc_buffer_mode_new || hTcBuffer->nchan_transport_jbm != tc_nchan_tc_new || - hTcBuffer->nchan_buffer_full != tc_nchan_full_new || hTcBuffer->nchan_transport_internal != tc_nchan_allocate_new ) + /* reconfigure buffer */ + if ( hTcBuffer->tc_buffer_mode != tc_buffer_mode_new || hTcBuffer->nchan_transport_jbm != tc_nchan_tc_new || + hTcBuffer->nchan_buffer_full != tc_nchan_full_new || hTcBuffer->nchan_transport_internal != tc_nchan_allocate_new ) + { + if ( ( error = ivas_jbm_dec_tc_buffer_reconfigure( 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 ( ( error = ivas_jbm_dec_tc_buffer_reconfigure( 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; - st_ivas->hSpatParamRendCom->subframes_rendered = st_ivas->hTcBuffer->subframes_rendered; - st_ivas->hSpatParamRendCom->num_slots = st_ivas->hTcBuffer->num_slots; - st_ivas->hSpatParamRendCom->slots_rendered = st_ivas->hTcBuffer->slots_rendered; + /* 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; + st_ivas->hSpatParamRendCom->subframes_rendered = st_ivas->hTcBuffer->subframes_rendered; + st_ivas->hSpatParamRendCom->num_slots = st_ivas->hTcBuffer->num_slots; + st_ivas->hSpatParamRendCom->slots_rendered = st_ivas->hTcBuffer->slots_rendered; - mvs2s( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); - } -#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH + mvs2s( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); } -#endif return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index d2144ea8450d03d56d2d09a9d5759153054a787f..19da1332bb7b8e42b38a16a9baaaa83e1a8bfac8 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -755,23 +755,14 @@ void ivas_ism_dec_digest_tc( if ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_STEREO ) { -#ifdef OBJ_EDITING_API ivas_ism_get_stereo_gains( st_ivas->hIsmMetaData[i]->edited_azimuth, st_ivas->hIsmMetaData[i]->edited_elevation, &st_ivas->hIsmRendererData->gains[i][0], &st_ivas->hIsmRendererData->gains[i][1] ); v_multc( st_ivas->hIsmRendererData->gains[i], st_ivas->hIsmMetaData[i]->edited_gain, st_ivas->hIsmRendererData->gains[i], CPE_CHANNELS ); -#else - ivas_ism_get_stereo_gains( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &st_ivas->hIsmRendererData->gains[i][0], &st_ivas->hIsmRendererData->gains[i][1] ); -#endif } else { // TODO tmu review when #215 is resolved -#ifdef OBJ_EDITING_API azimuth = (int16_t) floorf( st_ivas->hIsmMetaData[i]->edited_azimuth + 0.5f ); elevation = (int16_t) floorf( st_ivas->hIsmMetaData[i]->edited_elevation + 0.5f ); -#else - azimuth = (int16_t) floorf( st_ivas->hIsmMetaData[i]->azimuth + 0.5f ); - elevation = (int16_t) floorf( st_ivas->hIsmMetaData[i]->elevation + 0.5f ); -#endif if ( ( st_ivas->renderer_type == RENDERER_TD_PANNING || st_ivas->renderer_type == RENDERER_OSBA_LS || @@ -787,10 +778,8 @@ void ivas_ism_dec_digest_tc( if ( st_ivas->hEFAPdata != NULL ) { efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], azimuth, elevation, EFAP_MODE_EFAP ); -#ifdef OBJ_EDITING_API v_multc( st_ivas->hIsmRendererData->gains[i], st_ivas->hIsmMetaData[i]->edited_gain, st_ivas->hIsmRendererData->gains[i], st_ivas->hEFAPdata->numSpk ); -#endif } } else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || @@ -799,9 +788,7 @@ void ivas_ism_dec_digest_tc( { /*get HOA gets for direction (ACN/SN3D)*/ ivas_dirac_dec_get_response( azimuth, elevation, st_ivas->hIsmRendererData->gains[i], st_ivas->hIntSetup.ambisonics_order ); -#ifdef OBJ_EDITING_API v_multc( st_ivas->hIsmRendererData->gains[i], st_ivas->hIsmMetaData[i]->edited_gain, st_ivas->hIsmRendererData->gains[i], ivas_sba_get_nchan( st_ivas->hIntSetup.ambisonics_order, 0 ) ); -#endif } } } @@ -823,21 +810,9 @@ void ivas_param_ism_dec_digest_tc( float *transport_channels_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ ) { -#ifndef OBJ_EDITING_API - int16_t ch, nchan_transport, nchan_out, nchan_out_woLFE, i; - int16_t slot_idx, bin_idx; - int32_t ivas_total_brate; -#else int16_t ch, nchan_transport; int16_t slot_idx; -#endif int16_t output_frame; -#ifndef OBJ_EDITING_API - float ref_power[CLDFB_NO_CHANNELS_MAX]; - float cx_diag[CLDFB_NO_CHANNELS_MAX][PARAM_ISM_MAX_DMX]; - /* Direct Response/EFAP Gains */ - float direct_response[MAX_NUM_OBJECTS][PARAM_ISM_MAX_CHAN]; -#endif PARAM_ISM_DEC_HANDLE hParamIsmDec; SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; int16_t fade_len; @@ -852,100 +827,9 @@ void ivas_param_ism_dec_digest_tc( nchan_transport = st_ivas->nchan_transport; -#ifndef OBJ_EDITING_API - ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; - - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) - { - nchan_out = st_ivas->nchan_ism; - nchan_out_woLFE = nchan_out; - st_ivas->hDecoderConfig->nchan_out = nchan_out; - } - else - { - nchan_out = st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; - nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; - } -#endif push_wmops( "ivas_param_ism_dec_digest_tc" ); -#ifndef OBJ_EDITING_API - /* general setup */ - ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbSlots, hParamIsmDec->hParamIsmRendering->interpolator ); - - ivas_dirac_dec_set_md_map( st_ivas, nCldfbSlots ); - - /* set buffers to zero */ - for ( bin_idx = 0; bin_idx < CLDFB_NO_CHANNELS_MAX; bin_idx++ ) - { - set_zero( cx_diag[bin_idx], PARAM_ISM_MAX_DMX ); - } - set_zero( ref_power, CLDFB_NO_CHANNELS_MAX ); - - /* Frame-level Processing */ - /* De-quantization */ - if ( !( ivas_total_brate == IVAS_SID_5k2 || ivas_total_brate == FRAME_NO_DATA ) ) - { - ivas_param_ism_dec_dequant_DOA( hParamIsmDec, st_ivas->nchan_ism ); - ivas_param_ism_dec_dequant_powrat( hParamIsmDec ); - st_ivas->hISMDTX.dtx_flag = 0; - } - else - { - st_ivas->hISMDTX.dtx_flag = 1; - } - - /* obtain the direct response using EFAP */ - if ( !( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - for ( i = 0; i < st_ivas->nchan_ism; i++ ) - { - efap_determine_gains( st_ivas->hEFAPdata, direct_response[i], hParamIsmDec->azimuth_values[i], hParamIsmDec->elevation_values[i], EFAP_MODE_EFAP ); - } - } - else - { - int16_t j; - - for ( i = 0; i < st_ivas->nchan_ism; i++ ) - { - for ( j = 0; j < nchan_out_woLFE; j++ ) - { - if ( i == j ) - { - direct_response[i][j] = 1.0f; - } - else - { - direct_response[i][j] = 0.0f; - } - } - } - - for ( j = 0; j < nchan_out_woLFE; j++ ) - { - if ( hParamIsmDec->azimuth_values[j] > 0.0f ) - { - hParamIsmDec->hParamIsmRendering->proto_matrix[j] = 1.0f; - hParamIsmDec->hParamIsmRendering->proto_matrix[nchan_out_woLFE + j] = 0.0f; - } - else - { - if ( hParamIsmDec->azimuth_values[j] < 0.0f ) - { - hParamIsmDec->hParamIsmRendering->proto_matrix[j] = 0.0f; - hParamIsmDec->hParamIsmRendering->proto_matrix[nchan_out_woLFE + j] = 1.0f; - } - else /* == 0.0f */ - { - hParamIsmDec->hParamIsmRendering->proto_matrix[j] = 0.5f; - hParamIsmDec->hParamIsmRendering->proto_matrix[nchan_out_woLFE + j] = 0.5f; - } - } - } - } -#endif if ( st_ivas->hDecoderConfig->Opt_tsm ) { /*TODO : FhG to check*/ @@ -967,22 +851,9 @@ void ivas_param_ism_dec_digest_tc( mvr2r( RealBuffer, &hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], hSpatParamRendCom->num_freq_bands ); mvr2r( ImagBuffer, &hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], hSpatParamRendCom->num_freq_bands ); } -#ifndef OBJ_EDITING_API - ivas_param_ism_collect_slot( hParamIsmDec, &hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], &hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], ch, ref_power, cx_diag ); -#endif } } -#ifndef OBJ_EDITING_API - /* Obtain Mixing Matrix on a frame-level */ - for ( bin_idx = 0; bin_idx < hSpatParamRendCom->num_freq_bands; bin_idx++ ) - { - set_f( hParamIsmDec->hParamIsmRendering->mixing_matrix_lin[bin_idx], 0.0f, nchan_transport * nchan_out_woLFE ); - } - - /* Compute mixing matrix */ - ivas_param_ism_compute_mixing_matrix( st_ivas->nchan_ism, hParamIsmDec, st_ivas->hISMDTX, direct_response, nchan_transport, nchan_out_woLFE, cx_diag, ref_power, hParamIsmDec->hParamIsmRendering->mixing_matrix_lin ); -#endif pop_wmops(); @@ -990,7 +861,6 @@ void ivas_param_ism_dec_digest_tc( } -#ifdef OBJ_EDITING_API /*-------------------------------------------------------------------------* * ivas_param_ism_dec_dequant_md() * @@ -1076,11 +946,7 @@ void ivas_param_ism_dec_prepare_renderer( { for ( i = 0; i < st_ivas->nchan_ism; i++ ) { -#ifdef OBJ_EDITING_API efap_determine_gains( st_ivas->hEFAPdata, direct_response[i], hParamIsmDec->edited_azimuth_values[i], hParamIsmDec->edited_elevation_values[i], EFAP_MODE_EFAP ); -#else - efap_determine_gains( st_ivas->hEFAPdata, direct_response[i], hParamIsmDec->azimuth_values[i], hParamIsmDec->elevation_values[i], EFAP_MODE_EFAP ); -#endif } } else @@ -1147,7 +1013,6 @@ void ivas_param_ism_dec_prepare_renderer( return; } -#endif /*-------------------------------------------------------------------------* @@ -1388,7 +1253,6 @@ void ivas_param_ism_dec_render( /* store MetaData parameters */ for ( ch = 0; ch < st_ivas->nchan_ism; ch++ ) { -#ifdef OBJ_EDITING_API if ( st_ivas->hParamIsmDec->azimuth_values[ch] > 180.0f ) { st_ivas->hIsmMetaData[ch]->azimuth = st_ivas->hParamIsmDec->edited_azimuth_values[ch] - 360.0f; @@ -1398,18 +1262,6 @@ void ivas_param_ism_dec_render( st_ivas->hIsmMetaData[ch]->azimuth = st_ivas->hParamIsmDec->edited_azimuth_values[ch]; } st_ivas->hIsmMetaData[ch]->elevation = st_ivas->hParamIsmDec->edited_elevation_values[ch]; -#else - if ( st_ivas->hParamIsmDec->azimuth_values[ch] > 180.0f ) - { - st_ivas->hIsmMetaData[ch]->azimuth = st_ivas->hParamIsmDec->azimuth_values[ch] - 360.0f; - } - else - { - st_ivas->hIsmMetaData[ch]->azimuth = st_ivas->hParamIsmDec->azimuth_values[ch]; - } - - st_ivas->hIsmMetaData[ch]->elevation = st_ivas->hParamIsmDec->elevation_values[ch]; -#endif } } @@ -1437,36 +1289,15 @@ void ivas_param_ism_params_to_masa_param_mapping( int16_t azimuth[2]; int16_t elevation[2]; float power_ratio[2]; -#ifdef OBJ_EDITING_PARAMISM_BIN MASA_ISM_DATA_HANDLE hMasaIsmData; int16_t obj; int16_t obj_idx; -#endif -#ifndef OBJ_EDITING_API - int32_t ivas_total_brate; -#endif hParamIsmDec = st_ivas->hParamIsmDec; hSpatParamRendCom = st_ivas->hSpatParamRendCom; -#ifdef OBJ_EDITING_PARAMISM_BIN hMasaIsmData = st_ivas->hMasaIsmData; -#endif nBins = hSpatParamRendCom->num_freq_bands; -#ifndef OBJ_EDITING_API - ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; - - if ( !( ivas_total_brate == IVAS_SID_5k2 || ivas_total_brate == FRAME_NO_DATA ) ) - { - ivas_param_ism_dec_dequant_DOA( hParamIsmDec, st_ivas->nchan_ism ); - ivas_param_ism_dec_dequant_powrat( hParamIsmDec ); - st_ivas->hISMDTX.dtx_flag = 0; - } - else - { - st_ivas->hISMDTX.dtx_flag = 1; - } -#endif if ( st_ivas->hISMDTX.dtx_flag ) { @@ -1499,22 +1330,12 @@ void ivas_param_ism_params_to_masa_param_mapping( brange[0] = hParamIsmDec->hParamIsm->band_grouping[band_idx]; brange[1] = hParamIsmDec->hParamIsm->band_grouping[band_idx + 1]; -#ifdef OBJ_EDITING_API azimuth[0] = (int16_t) roundf( hParamIsmDec->edited_azimuth_values[hParamIsmDec->hParamIsm->obj_indices[band_idx][0][0]] ); elevation[0] = (int16_t) roundf( hParamIsmDec->edited_elevation_values[hParamIsmDec->hParamIsm->obj_indices[band_idx][0][0]] ); -#else - azimuth[0] = (int16_t) roundf( hParamIsmDec->azimuth_values[hParamIsmDec->hParamIsm->obj_indices[band_idx][0][0]] ); - elevation[0] = (int16_t) roundf( hParamIsmDec->elevation_values[hParamIsmDec->hParamIsm->obj_indices[band_idx][0][0]] ); -#endif power_ratio[0] = hParamIsmDec->power_ratios[band_idx][0][0]; -#ifdef OBJ_EDITING_API azimuth[1] = (int16_t) roundf( hParamIsmDec->edited_azimuth_values[hParamIsmDec->hParamIsm->obj_indices[band_idx][0][1]] ); elevation[1] = (int16_t) roundf( hParamIsmDec->edited_elevation_values[hParamIsmDec->hParamIsm->obj_indices[band_idx][0][1]] ); -#else - azimuth[1] = (int16_t) roundf( hParamIsmDec->azimuth_values[hParamIsmDec->hParamIsm->obj_indices[band_idx][0][1]] ); - elevation[1] = (int16_t) roundf( hParamIsmDec->elevation_values[hParamIsmDec->hParamIsm->obj_indices[band_idx][0][1]] ); -#endif power_ratio[1] = hParamIsmDec->power_ratios[band_idx][0][1]; for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) @@ -1540,7 +1361,6 @@ void ivas_param_ism_params_to_masa_param_mapping( hSpatParamRendCom->surroundingCoherence[sf_idx][bin_idx] = 0.0; } } -#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++ ) @@ -1577,7 +1397,6 @@ void ivas_param_ism_params_to_masa_param_mapping( } } } -#endif } return; diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 81bfa29b9f9063730358ccbafccb08bccfbd7774..b3c52a0baaad8f1b623f98916f8e91d0c76971c8 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -234,26 +234,16 @@ void ivas_ism_render_sf( { if ( subframe_idx >= ism_md_subframe_update_jbm ) { -#ifdef OBJ_EDITING_API rotateAziEle( st_ivas->hIsmMetaData[i]->edited_azimuth, st_ivas->hIsmMetaData[i]->edited_elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup ); -#else - rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup ); -#endif } else { -#ifdef OBJ_EDITING_API rotateAziEle( st_ivas->hIsmMetaData[i]->edited_azimuth, st_ivas->hIsmMetaData[i]->edited_elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup ); -#else - rotateAziEle( st_ivas->hIsmMetaData[i]->last_azimuth, st_ivas->hIsmMetaData[i]->last_elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup ); -#endif } if ( st_ivas->hEFAPdata != NULL ) { efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], azimuth, elevation, EFAP_MODE_EFAP ); -#ifdef OBJ_EDITING_API v_multc( st_ivas->hIsmRendererData->gains[i], st_ivas->hIsmMetaData[i]->edited_gain, st_ivas->hIsmRendererData->gains[i], nchan_out_woLFE ); -#endif } } @@ -538,7 +528,6 @@ void ivas_omasa_separate_object_render_jbm( if ( single_separated ) { -#ifdef OMASA_OBJECT_EDITING if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ && st_ivas->hMasaIsmData->ism_dir_is_edited[st_ivas->hMasaIsmData->idx_separated_ism] ) { azimuth = st_ivas->hMasaIsmData->azimuth_ism_edited[st_ivas->hMasaIsmData->idx_separated_ism]; @@ -549,14 +538,9 @@ void ivas_omasa_separate_object_render_jbm( azimuth = st_ivas->hMasaIsmData->azimuth_separated_ism[md_idx]; elevation = st_ivas->hMasaIsmData->elevation_separated_ism[md_idx]; } -#else - azimuth = st_ivas->hMasaIsmData->azimuth_separated_ism[md_idx]; - elevation = st_ivas->hMasaIsmData->elevation_separated_ism[md_idx]; -#endif } else { -#ifdef OMASA_OBJECT_EDITING if ( st_ivas->hMasaIsmData->ism_dir_is_edited[obj] ) { azimuth = st_ivas->hMasaIsmData->azimuth_ism_edited[obj]; @@ -567,10 +551,6 @@ void ivas_omasa_separate_object_render_jbm( azimuth = st_ivas->hMasaIsmData->azimuth_ism[obj][md_idx]; elevation = st_ivas->hMasaIsmData->elevation_ism[obj][md_idx]; } -#else - azimuth = st_ivas->hMasaIsmData->azimuth_ism[obj][md_idx]; - elevation = st_ivas->hMasaIsmData->elevation_ism[obj][md_idx]; -#endif } if ( st_ivas->hOutSetup.is_planar_setup ) diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 62006552cde66547cc28202c9bc409579bf25d44..4a18112f1b5231a70ab2a53d474d09f6c2c88cd2 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -153,9 +153,7 @@ ivas_error ivas_jbm_dec_tc( } ivas_ism_dtx_limit_noise_energy_for_near_silence( st_ivas->hSCE, st_ivas->hISMDTX.sce_id_dtx, st_ivas->nchan_transport ); -#ifdef OBJ_EDITING_API ivas_param_ism_dec_dequant_md( st_ivas ); -#endif } else if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { @@ -163,9 +161,7 @@ ivas_error ivas_jbm_dec_tc( { return error; } -#ifdef OBJ_EDITING_API ivas_param_ism_dec_dequant_md( st_ivas ); -#endif } else /* ISM_MODE_DISC */ { @@ -821,163 +817,17 @@ void ivas_jbm_dec_feed_tc_to_renderer( } n_render_timeslots = st_ivas->hTcBuffer->n_samples_available / st_ivas->hTcBuffer->n_samples_granularity; -#ifndef OBJ_EDITING_API - if ( st_ivas->hTcBuffer->tc_buffer_mode == TC_BUFFER_MODE_BUFFER ) - { - ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); - - if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && 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 ( st_ivas->ivas_format == STEREO_FORMAT ) - { - ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); - } - else -#endif - if ( st_ivas->ivas_format == ISM_FORMAT ) + if ( st_ivas->ivas_format == ISM_FORMAT ) { /* Rendering */ if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { -#ifndef OBJ_EDITING_API - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) - { - ivas_dirac_dec_set_md_map( st_ivas, n_render_timeslots ); - - ivas_param_ism_params_to_masa_param_mapping( st_ivas ); - } - else -#endif - if ( st_ivas->renderer_type == RENDERER_PARAM_ISM || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) + if ( st_ivas->renderer_type == RENDERER_PARAM_ISM || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) { ivas_param_ism_dec_digest_tc( st_ivas, n_render_timeslots, p_data_f ); } } -#ifndef OBJ_EDITING_API - else /* ISM_MODE_DISC */ - { - ivas_ism_dec_digest_tc( st_ivas ); - } -#endif - } -#ifndef OBJ_EDITING_API - else if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT ) - { - ivas_sba_dec_digest_tc( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available ); - } - else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) - { - - if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) - { - ivas_ism_dec_digest_tc( st_ivas ); - - /* delay the objects here for all renderers where it is needed */ - if ( - ( - st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || - st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || - st_ivas->renderer_type == RENDERER_OSBA_AMBI || - st_ivas->renderer_type == RENDERER_OSBA_LS || - st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) && - ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) - { - for ( n = 0; n < st_ivas->nchan_ism; n++ ) - { - delay_signal( st_ivas->hTcBuffer->tc[n], st_ivas->hTcBuffer->n_samples_available, st_ivas->hSbaIsmData->delayBuffer[n], st_ivas->hSbaIsmData->delayBuffer_size ); - } - } - - if ( !st_ivas->sba_dirac_stereo_flag ) - { - if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) - { - n_render_timeslots *= ( st_ivas->hTcBuffer->n_samples_granularity / st_ivas->hSpatParamRendCom->slot_size ); - } - - ivas_sba_dec_digest_tc( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available ); - } - } - else - { - ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); - - ivas_sba_dec_digest_tc( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available ); - } - } - else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) - { - if ( st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT || st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) - { - ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); - - if ( st_ivas->hDecoderConfig->Opt_tsm ) - { - ivas_jbm_masa_sf_to_slot_map( st_ivas, n_render_timeslots ); - } - } - else - { - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) - { - n_render_timeslots *= ( st_ivas->hTcBuffer->n_samples_granularity / st_ivas->hSpatParamRendCom->slot_size ); - } - - ivas_sba_dec_digest_tc( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available ); - - if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) - { - ivas_ism_dec_digest_tc( st_ivas ); - } - } - - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_DIRAC ) - { - int16_t num_objects; - - /* Delay the signal to match CLDFB delay. Delay the whole buffer. */ - num_objects = 0; - if ( ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC ) - { - num_objects = 1; - } - else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) - { - num_objects = st_ivas->nchan_ism; - } - for ( n = 0; n < num_objects; n++ ) - { - if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) - { - v_multc( st_ivas->hTcBuffer->tc[CPE_CHANNELS + n], OMASA_TDREND_MATCHING_GAIN, st_ivas->hTcBuffer->tc[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available ); - } - delay_signal( st_ivas->hTcBuffer->tc[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available, st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size ); - } - } } - else if ( st_ivas->ivas_format == MC_FORMAT ) - { - if ( st_ivas->mc_mode == MC_MODE_MCT ) - { - ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); - } - else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) - { - ivas_mc_paramupmix_dec_digest_tc( st_ivas, (uint8_t) n_render_timeslots, st_ivas->hTcBuffer->n_samples_available ); - } - else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) - { - ivas_param_mc_dec_digest_tc( st_ivas, (uint8_t) n_render_timeslots, p_data_f ); - } - else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) - { - ivas_sba_dec_digest_tc( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available ); - } - } -#else else if ( st_ivas->ivas_format == MC_FORMAT ) { if ( st_ivas->mc_mode == MC_MODE_PARAMMC && st_ivas->hTcBuffer->tc_buffer_mode == TC_BUFFER_MODE_RENDERER ) @@ -985,7 +835,6 @@ void ivas_jbm_dec_feed_tc_to_renderer( ivas_param_mc_dec_digest_tc( st_ivas, (uint8_t) n_render_timeslots, p_data_f ); } } -#endif pop_wmops(); return; @@ -1246,11 +1095,7 @@ ivas_error ivas_jbm_dec_render( ivas_ism_render_sf( st_ivas, st_ivas->renderer_type, p_output, *nSamplesRendered ); /* add already rendered SBA part */ -#ifdef OBJ_EDITING_API ivas_osba_stereo_add_channels( p_tc, p_output, st_ivas->hSbaIsmData->gain_bed, nchan_out, st_ivas->nchan_ism, st_ivas->ism_mode, *nSamplesRendered ); -#else - ivas_osba_stereo_add_channels( p_tc, p_output, 1.0f, nchan_out, st_ivas->nchan_ism, *nSamplesRendered ); -#endif } else if ( st_ivas->renderer_type == RENDERER_OSBA_AMBI || st_ivas->renderer_type == RENDERER_OSBA_LS || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { @@ -3049,7 +2894,6 @@ void ivas_jbm_masa_sf_to_sf_map( } -#ifdef OBJ_EDITING_API /*--------------------------------------------------------------------------* * ivas_dec_prepare_renderer() * @@ -3182,7 +3026,6 @@ void ivas_dec_prepare_renderer( { if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) { -#ifdef OMASA_OBJECT_EDITING float gainIsm; gainIsm = OMASA_TDREND_MATCHING_GAIN; @@ -3192,9 +3035,6 @@ void ivas_dec_prepare_renderer( } v_multc( st_ivas->hTcBuffer->tc[CPE_CHANNELS + n], gainIsm, st_ivas->hTcBuffer->tc[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available ); -#else - v_multc( st_ivas->hTcBuffer->tc[CPE_CHANNELS + n], OMASA_TDREND_MATCHING_GAIN, st_ivas->hTcBuffer->tc[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available ); -#endif } #ifndef TMP_FIX_OMASA_SR_BE if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) @@ -3204,7 +3044,6 @@ void ivas_dec_prepare_renderer( } } -#ifdef OMASA_OBJECT_EDITING if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) { int16_t tcBufferSize; @@ -3218,7 +3057,6 @@ void ivas_dec_prepare_renderer( } } } -#endif } } } @@ -3245,4 +3083,3 @@ void ivas_dec_prepare_renderer( pop_wmops(); return; } -#endif diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 6b15e367b7a17c3268372ef53cce99956787c1cd..7bd25aa0cd9e746f0b8d56829fb238736348d095 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -641,11 +641,7 @@ ivas_error ivas_masa_dec_open( ism_total_brate = 0; /* ISM metadata */ -#ifdef OMASA_OBJECT_EDITING if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hIsmMetaData[0] != NULL ) -#else - if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hIsmMetaData[0] != NULL && 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 ); @@ -1337,12 +1333,8 @@ ivas_error ivas_masa_dec_reconfigure( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; last_ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate; -#ifdef NONBE_FIX_1220_OMASA_JBM_EXT_USAN /* Copy state to TC buffer if granularity matches and we are not in OMASA EXT rendering mode */ if ( st_ivas->hSpatParamRendCom != NULL && st_ivas->hSpatParamRendCom->slot_size == st_ivas->hTcBuffer->n_samples_granularity && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) -#else - if ( st_ivas->hSpatParamRendCom != NULL && st_ivas->hSpatParamRendCom->slot_size == st_ivas->hTcBuffer->n_samples_granularity ) -#endif { mvs2s( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); st_ivas->hTcBuffer->nb_subframes = st_ivas->hSpatParamRendCom->nb_subframes; @@ -1363,7 +1355,6 @@ ivas_error ivas_masa_dec_reconfigure( return error; } } -#ifdef NONBE_FIX_1220_OMASA_JBM_EXT_USAN else if ( st_ivas->renderer_type == RENDERER_DISABLE || st_ivas->renderer_type == RENDERER_MONO_DOWNMIX || st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT ) { /* close all unnecessary parametric decoding and rendering */ @@ -1372,19 +1363,6 @@ ivas_error ivas_masa_dec_reconfigure( ivas_spat_hSpatParamRendCom_close( &( st_ivas->hSpatParamRendCom ) ); ivas_dirac_dec_close( &( st_ivas->hDirAC ) ); } -#else - else if ( st_ivas->renderer_type == RENDERER_DISABLE || 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( st_ivas->hDiracDecBin ); - ivas_dirac_rend_close( &( st_ivas->hDirACRend ) ); - ivas_spat_hSpatParamRendCom_close( &( st_ivas->hSpatParamRendCom ) ); - ivas_dirac_dec_close( &( st_ivas->hDirAC ) ); - } - } -#endif /* possible reconfigure is done later */ /*-----------------------------------------------------------------* @@ -1424,14 +1402,9 @@ ivas_error ivas_masa_dec_reconfigure( sts = st_ivas->hCPE[cpe_id]->hCoreCoder; sts[0]->bit_stream = bit_stream + num_bits; num_bits += (int16_t) ( st_ivas->hCPE[cpe_id]->element_brate / FRAMES_PER_SEC ); -#ifdef NONBE_FIX_1143_MASA_BRSW if ( ( ivas_total_brate < MASA_STEREO_MIN_BITRATE && last_ivas_total_brate >= MASA_STEREO_MIN_BITRATE ) || ( ivas_total_brate < MASA_STEREO_MIN_BITRATE && last_ivas_total_brate == FRAME_NO_DATA ) || ( ivas_total_brate < MASA_STEREO_MIN_BITRATE && last_ivas_total_brate == IVAS_SID_5k2 ) ) -#else - if ( ( ivas_total_brate < MASA_STEREO_MIN_BITRATE && last_ivas_total_brate >= MASA_STEREO_MIN_BITRATE ) || - ( ivas_total_brate < MASA_STEREO_MIN_BITRATE && last_ivas_total_brate == FRAME_NO_DATA ) ) -#endif { st_ivas->hCPE[cpe_id]->nchan_out = 1; @@ -1504,19 +1477,6 @@ ivas_error ivas_masa_dec_reconfigure( ivas_masa_set_elements( 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 ( st_ivas->ivas_format == MASA_FORMAT ) - { - - if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) - { - st_ivas->nchan_ism = 0; /* Initialization if it has not been already read from the end of the bitstream at the same time - with reading of the format: nchan_ism is needed in MASA format because for the EXT output in - MASA-only (pre-rendering mode of OMASA) the number of ISMs to output correct number of empty objects is needed */ - } - st_ivas->ism_mode = ISM_MODE_NONE; - } -#endif { int16_t tc_nchan_to_allocate; int16_t tc_nchan_transport; @@ -2452,9 +2412,7 @@ static int16_t ivas_decode_masaism_metadata( for ( obj = 0; obj < nchan_ism; obj++ ) { -#ifdef OMASA_OBJECT_EDITING hMasaIsmData->bits_ism[obj] = bits_ism[obj]; -#endif index = 0; if ( bits_ism[obj] < 8 ) /* if low resolution, can look to the past */ { diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 77c048a062623ceb958314a86db5b96ff7604008..3f9c0ff9e330b195b10a8cb4f32f7b63ad663cb3 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -1336,209 +1336,41 @@ void ivas_param_mc_dec_digest_tc( ) { PARAM_MC_DEC_HANDLE hParamMC; -#ifdef OBJ_EDITING_API int16_t ch, slot_idx; int16_t nchan_transport; -#else - int16_t i, ch; - int16_t is_next_band, skip_next_band; - int16_t slot_idx, param_band_idx; - int16_t nchan_transport, nchan_out_transport, nchan_out_cldfb; - int16_t nchan_out_cov; -#endif -#ifndef OBJ_EDITING_API - /*CLDFB*/ - float *pCx, *pCx_imag; - float cx[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; - float cx_imag[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; - float cx_next_band[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; - float cx_imag_next_band[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; - float real_part, imag_part; - /* format converter */ - int16_t channel_active[MAX_OUTPUT_CHANNELS]; - IVAS_OUTPUT_SETUP *hSynthesisOutputSetup; -#endif hParamMC = st_ivas->hParamMC; assert( hParamMC ); push_wmops( "param_mc_dec_digest_tc" ); -#ifndef OBJ_EDITING_API - set_s( channel_active, 0, MAX_CICP_CHANNELS ); -#endif nchan_transport = st_ivas->nchan_transport; -#ifndef OBJ_EDITING_API - nchan_out_transport = st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe; - if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) - { - nchan_out_cldfb = BINAURAL_CHANNELS; - set_s( channel_active, 1, nchan_out_cldfb ); - nchan_out_cov = st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe; - hSynthesisOutputSetup = &st_ivas->hTransSetup; - } - else if ( hParamMC->synthesis_conf == PARAM_MC_SYNTH_LS_CONV_CLDFB ) - { - nchan_out_cov = nchan_out_transport; - nchan_out_cldfb = st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe; - hSynthesisOutputSetup = &st_ivas->hTransSetup; - } - else if ( hParamMC->synthesis_conf == PARAM_MC_SYNTH_LS_CONV_COV || hParamMC->synthesis_conf == PARAM_MC_SYNTH_MONO_STEREO ) - { - nchan_out_cov = st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe; - nchan_out_cldfb = nchan_out_cov; - set_s( channel_active, 1, nchan_out_cov ); - hSynthesisOutputSetup = &st_ivas->hOutSetup; - } - else + /* slot loop for gathering the input data */ + for ( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ ) { - nchan_out_cov = nchan_out_transport; - nchan_out_cldfb = nchan_out_transport; - set_s( channel_active, 1, nchan_out_cov ); - hSynthesisOutputSetup = &st_ivas->hTransSetup; - } - - /* adapt transient position */ - if ( hParamMC->hMetadataPMC->bAttackPresent ) - { - hParamMC->hMetadataPMC->attackIndex = (int16_t) max( 0, hParamMC->hMetadataPMC->attackIndex + ( ( nCldfbSlots - DEFAULT_JBM_CLDFB_TIMESLOTS ) / 2 ) ); - } - /* adapt subframes */ - hParamMC->num_slots = nCldfbSlots; - hParamMC->slots_rendered = 0; - hParamMC->subframes_rendered = 0; - ivas_jbm_dec_get_adapted_subframes( nCldfbSlots, hParamMC->subframe_nbslots, &hParamMC->nb_subframes ); - st_ivas->hTcBuffer->nb_subframes = hParamMC->nb_subframes; - mvs2s( hParamMC->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, hParamMC->nb_subframes ); - - ivas_param_mc_dec_compute_interpolator( hParamMC->hMetadataPMC->bAttackPresent, hParamMC->hMetadataPMC->attackIndex, nCldfbSlots, hParamMC->h_output_synthesis_params.interpolator ); - - - /* 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( cx, PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS ); - set_zero( cx_imag, PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS ); - set_zero( cx_next_band, PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS ); - set_zero( cx_imag_next_band, PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS ); -#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 - float RealBuffer[CLDFB_NO_CHANNELS_MAX]; - float ImagBuffer[CLDFB_NO_CHANNELS_MAX]; - - /* CLDFB Analysis*/ - for ( ch = 0; ch < nchan_transport; ch++ ) - { - cldfbAnalysis_ts( &( p_data_f[ch][hParamMC->num_freq_bands * slot_idx] ), RealBuffer, ImagBuffer, hParamMC->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); - - mvr2r( RealBuffer, &hParamMC->Cldfb_RealBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands ); - mvr2r( ImagBuffer, &hParamMC->Cldfb_ImagBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands ); - } -#ifndef OBJ_EDITING_API - } -#endif - } - -#ifndef OBJ_EDITING_API - if ( slot_idx >= 2 * hParamMC->hMetadataPMC->attackIndex ) - { - for ( is_next_band = 0; is_next_band < 2; is_next_band++ ) - { - if ( is_next_band && skip_next_band ) - { - continue; - } - - ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot( &hParamMC->Cldfb_RealBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport], - &hParamMC->Cldfb_ImagBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport], - is_next_band ? cx_next_band : cx, - is_next_band ? cx_imag_next_band : cx_imag, - param_band_idx + is_next_band, - hParamMC, - nchan_transport ); - } - } -#endif - } - -#ifndef OBJ_EDITING_API - /* map from complex input covariance to real values */ - for ( is_next_band = 0; is_next_band < 2; is_next_band++ ) + if ( st_ivas->hDecoderConfig->Opt_tsm ) { - if ( is_next_band && skip_next_band ) - { - continue; - } + float RealBuffer[CLDFB_NO_CHANNELS_MAX]; + float ImagBuffer[CLDFB_NO_CHANNELS_MAX]; - /* Cx for transport channels */ - pCx = is_next_band ? &cx_next_band[0] : &cx[0]; - pCx_imag = is_next_band ? &cx_imag_next_band[0] : &cx_imag[0]; - for ( i = 0; i < nchan_transport * nchan_transport; i++ ) + /* CLDFB Analysis*/ + for ( ch = 0; ch < nchan_transport; ch++ ) { - real_part = pCx[i]; - imag_part = pCx_imag[i]; + cldfbAnalysis_ts( &( p_data_f[ch][hParamMC->num_freq_bands * slot_idx] ), RealBuffer, ImagBuffer, hParamMC->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); - /* (a-ib)(c+id) = ac + bd + i(ad-bc) */ - if ( param_band_idx < hParamMC->max_param_band_abs_cov ) - { - pCx[i] = sqrtf( real_part * real_part + imag_part * imag_part ); - } - else - { - pCx[i] = real_part; - } + mvr2r( RealBuffer, &hParamMC->Cldfb_RealBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands ); + mvr2r( ImagBuffer, &hParamMC->Cldfb_ImagBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands ); } } - - /* 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*/ - if ( hParamMC->hMetadataPMC->bAttackPresent && ( hParamMC->synthesis_conf == PARAM_MC_SYNTH_LS_CONV_COV || hParamMC->synthesis_conf == PARAM_MC_SYNTH_MONO_STEREO ) ) - { - v_add( cx, cx_next_band, cx, nchan_transport * nchan_transport ); - mvr2r( cx, cx_next_band, nchan_transport * nchan_transport ); - } - - - for ( is_next_band = 0; is_next_band < 2; is_next_band++ ) - { - if ( is_next_band && skip_next_band ) - { - continue; - } - - /* generate mixing matrices */ - ivas_param_mc_get_mixing_matrices( hParamMC, - hSynthesisOutputSetup, - is_next_band ? cx_next_band : cx, - param_band_idx + is_next_band, - hParamMC->h_output_synthesis_cov_state.mixing_matrix, - hParamMC->h_output_synthesis_cov_state.mixing_matrix_res, - 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() * @@ -1715,7 +1547,6 @@ void ivas_param_mc_dec_prepare_renderer( return; } -#endif /*------------------------------------------------------------------------- diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index a464a11060c22b160e5b58a56f0afc05bb31d4b1..dc58121f14c9775e362e8abeb767b0e4ae0bac39 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -837,17 +837,10 @@ static ivas_error ivas_mc_dec_reconfig( ivas_masa_dec_close( &( st_ivas->hMasa ) ); ivas_qmetadata_close( &st_ivas->hQMetaData ); -#ifndef NONBE_FIX_1220_OMASA_JBM_EXT_USAN - if ( st_ivas->hDirAC != NULL ) - { -#endif - ivas_dirac_rend_close( &( st_ivas->hDirACRend ) ); - ivas_spat_hSpatParamRendCom_close( &( st_ivas->hSpatParamRendCom ) ); - ivas_dirac_dec_close( &( st_ivas->hDirAC ) ); - vbap_free_data( &( st_ivas->hVBAPdata ) ); -#ifndef NONBE_FIX_1220_OMASA_JBM_EXT_USAN - } -#endif + ivas_dirac_rend_close( &( st_ivas->hDirACRend ) ); + ivas_spat_hSpatParamRendCom_close( &( st_ivas->hSpatParamRendCom ) ); + ivas_dirac_dec_close( &( st_ivas->hDirAC ) ); + vbap_free_data( &( st_ivas->hVBAPdata ) ); /* init LS conversion if the renderer type asks for it */ if ( st_ivas->renderer_type == RENDERER_MC && st_ivas->hLsSetUpConversion == NULL ) @@ -927,18 +920,11 @@ static ivas_error ivas_mc_dec_reconfig( ivas_masa_dec_close( &( st_ivas->hMasa ) ); ivas_qmetadata_close( &st_ivas->hQMetaData ); -#ifndef NONBE_FIX_1220_OMASA_JBM_EXT_USAN - if ( st_ivas->hDirAC != NULL ) - { -#endif - ivas_dirac_rend_close( &( st_ivas->hDirACRend ) ); - ivas_spat_hSpatParamRendCom_close( &( st_ivas->hSpatParamRendCom ) ); - ivas_dirac_dec_close( &( st_ivas->hDirAC ) ); + ivas_dirac_rend_close( &( st_ivas->hDirACRend ) ); + ivas_spat_hSpatParamRendCom_close( &( st_ivas->hSpatParamRendCom ) ); + ivas_dirac_dec_close( &( st_ivas->hDirAC ) ); - vbap_free_data( &( st_ivas->hVBAPdata ) ); -#ifndef NONBE_FIX_1220_OMASA_JBM_EXT_USAN - } -#endif + vbap_free_data( &( st_ivas->hVBAPdata ) ); if ( last_mc_mode == MC_MODE_MCT ) { @@ -1138,11 +1124,7 @@ static ivas_error ivas_mc_dec_reconfig( } } } -#ifdef NONBE_FIX_1220_OMASA_JBM_EXT_USAN else if ( st_ivas->renderer_type == RENDERER_DISABLE ) -#else - else if ( st_ivas->renderer_type == RENDERER_DISABLE && st_ivas->hDirAC != NULL ) -#endif { ivas_dirac_rend_close( &( st_ivas->hDirACRend ) ); ivas_spat_hSpatParamRendCom_close( &( st_ivas->hSpatParamRendCom ) ); diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 26f9967c9e08473ce190de5724e2056cabc1a592..935a3ab365cfb0719e914a990a7c648ad3f5083a 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -184,7 +184,6 @@ ivas_error ivas_td_binaural_renderer_sf( } if ( subframe_idx == ism_md_subframe_update_jbm ) { -#ifdef OBJ_EDITING_API if ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) { ISM_METADATA_FRAME ismMetaData[MAX_NUM_OBJECTS]; @@ -206,9 +205,7 @@ ivas_error ivas_td_binaural_renderer_sf( return error; } } - else -#endif - if ( ( error = TDREND_Update_object_positions( st_ivas->hBinRendererTd, nchan_ism, st_ivas->ivas_format, st_ivas->hIsmMetaData ) ) != IVAS_ERR_OK ) + else if ( ( error = TDREND_Update_object_positions( st_ivas->hBinRendererTd, nchan_ism, st_ivas->ivas_format, st_ivas->hIsmMetaData ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 548f1fd61a0da26149f8decf2461084c4542a2a2..917af3b9e6340ddcd76dabb009972b44636eb9e3 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -61,11 +61,7 @@ ivas_error ivas_omasa_data_open( ) { MASA_ISM_DATA_HANDLE hMasaIsmData; -#ifdef OMASA_OBJECT_EDITING int16_t ch; -#else - int16_t ch, bin; -#endif int16_t sf, obj_idx; if ( ( hMasaIsmData = (MASA_ISM_DATA_HANDLE) malloc( sizeof( MASA_ISM_DATA ) ) ) == NULL ) @@ -73,7 +69,6 @@ ivas_error ivas_omasa_data_open( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MASA ISM data\n" ) ); } -#ifdef OMASA_OBJECT_EDITING for ( int16_t band_idx = 0; band_idx < MASA_FREQUENCY_BANDS; band_idx++ ) { for ( ch = 0; ch < 2; ch++ ) @@ -89,39 +84,17 @@ ivas_error ivas_omasa_data_open( } hMasaIsmData->objectsEdited = 0; -#else - for ( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ ) - { - for ( ch = 0; ch < 2; ch++ ) - { - hMasaIsmData->ismPreprocMatrix[ch][ch][bin] = 1.0f; - hMasaIsmData->ismPreprocMatrix[1 - ch][ch][bin] = 0.0f; - hMasaIsmData->eneMoveIIR[ch][bin] = 0.0f; - hMasaIsmData->enePreserveIIR[ch][bin] = 0.0f; - } - hMasaIsmData->preprocEneTarget[bin] = 0.0f; - hMasaIsmData->preprocEneRealized[bin] = 0.0f; - } - - hMasaIsmData->objectsMoved = 0; -#endif hMasaIsmData->delayBuffer = NULL; 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; -#endif hMasaIsmData->q_elevation_old[ch] = 0.0f; hMasaIsmData->q_azimuth_old[ch] = 0.0f; } -#ifdef OMASA_OBJECT_EDITING hMasaIsmData->masa_gain_is_edited = 0; hMasaIsmData->idx_separated_ism = -1; -#endif for ( obj_idx = 0; obj_idx < MAX_NUM_OBJECTS; obj_idx++ ) { @@ -220,11 +193,7 @@ ivas_error ivas_omasa_dec_config( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ) { -#ifdef OMASA_OBJECT_EDITING int16_t k, sce_id, nSCE_old, nchan_hp20_old, numCldfbAnalyses_old, numCldfbSyntheses_old; -#else - int16_t k, sce_id, nSCE_old, nchan_hp20_old, numCldfbAnalyses_old, numCldfbSyntheses_old, n_MD; -#endif int32_t ivas_total_brate, ism_total_brate, cpe_brate; ISM_MODE ism_mode_old; IVAS_FORMAT ivas_format_orig; @@ -316,7 +285,6 @@ ivas_error ivas_omasa_dec_config( if ( 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( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) @@ -331,57 +299,6 @@ ivas_error ivas_omasa_dec_config( ivas_ism_reset_metadata_handle_dec( st_ivas->hIsmMetaData[k] ); } } -#else - n_MD = 0; - if ( 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( 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( st_ivas->hIsmMetaData[k] ); - } - } - } - else - { - if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) - { - n_MD = 1; - - if ( st_ivas->hIsmMetaData[0] == NULL ) - { - if ( ( error = ivas_ism_metadata_dec_create( st_ivas, 1, NULL ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { - ivas_ism_reset_metadata_handle_dec( st_ivas->hIsmMetaData[0] ); - } - } - else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) - { - n_MD = st_ivas->nchan_ism; - - if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); - } -#endif st_ivas->hCPE[0]->element_brate = ivas_total_brate - ism_total_brate; @@ -749,7 +666,6 @@ void ivas_omasa_dirac_rend_jbm( { mvr2r( &output_f[CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[0], *nSamplesRendered ); -#ifdef OMASA_OBJECT_EDITING if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { /* Gain separated object, if edited */ @@ -761,22 +677,18 @@ void ivas_omasa_dirac_rend_jbm( } } } -#endif } else { for ( n = 0; n < st_ivas->nchan_ism; n++ ) { mvr2r( &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( data_separated_objects[n], st_ivas->hMasaIsmData->gain_ism_edited[n], data_separated_objects[n], *nSamplesRendered ); } -#endif } -#ifdef OMASA_OBJECT_EDITING /* Gain MASA part, if edited */ if ( st_ivas->hMasaIsmData->masa_gain_is_edited ) { @@ -785,7 +697,6 @@ void ivas_omasa_dirac_rend_jbm( v_multc( output_f[ch], st_ivas->hMasaIsmData->gain_masa_edited, output_f[ch], *nSamplesRendered ); } } -#endif } } diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c index 485dbfb1b9fabf2b789ffac91f9cd8c72b7c1ad2..7b30caee2a607a910aa24918900151d50c134f28 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -241,7 +241,6 @@ ivas_error ivas_osba_ism_metadata_dec( } -#ifdef OBJ_EDITING_API /*-------------------------------------------------------------------------* * ivas_osba_stereo_add_channels() * @@ -291,7 +290,6 @@ void ivas_osba_stereo_add_channels( return; } -#endif /*-------------------------------------------------------------------------* @@ -350,51 +348,3 @@ ivas_error ivas_osba_render_sf( return IVAS_ERR_OK; } - -#ifndef OBJ_EDITING_API -/*-------------------------------------------------------------------------* - * ivas_osba_stereo_add_channels() - * - * - *-------------------------------------------------------------------------*/ - -void ivas_osba_stereo_add_channels( - float *tc_f[], /* i : transport channels */ - float *output_f[], /* i/o: output channels */ - const float gain, /* i : gain bed value */ - const int16_t nchan_out, /* i : number of output channels */ - const int16_t nchan_ism, /* i : number of ISM channels */ - const int16_t n_samples_to_render /* i : output frame length per channel */ -) -{ - int16_t n; - -#if 0 - if ( ism_mode == ISM_SBA_MODE_DISC ) - { -#endif - if ( gain != 1.0f ) - { - assert( 0 && "Object editing is not implemented in this branch!" ); - } - else - { - for ( n = 0; n < nchan_out; n++ ) - { - v_add( output_f[n], tc_f[n + nchan_ism], output_f[n], n_samples_to_render ); - } - } -#if 0 - } - else - { - for ( n = 0; n < nchan_out; n++ ) - { - v_add( output_f[n], tc_f[n + nchan_ism], output_f[n], n_samples_to_render ); - } - } -#endif - - return; -} -#endif diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 2f96d59a40039518ced69ff1e4c7cc32d507f364..276265ba36d207555d47a35eb8aedfa0ba02c744 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -782,7 +782,6 @@ ivas_error ivas_sba_dec_render( ivas_spar_dec_upmixer_sf( st_ivas, output_f_local, nchan_internal ); -#ifdef OBJ_EDITING_API if ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { float gain = st_ivas->hSbaIsmData->gain_bed; @@ -798,7 +797,6 @@ ivas_error ivas_sba_dec_render( } } } -#endif for ( ch = 0; ch < nchan_out; ch++ ) { diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index c5958d8a980949d33fdb058b68fe335ef66ff38a..dcd0dbb03493e31e86f09355b3cde717badffbfa 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -422,10 +422,8 @@ typedef struct ivas_param_ism_dec_data_structure float elevation_values[MAX_PARAM_SPATIAL_SUBFRAMES * IVAS_MAX_NUM_BANDS]; float power_ratios[MAX_PARAM_ISM_NBANDS][MAX_PARAM_ISM_NBLOCKS][MAX_PARAM_ISM_WAVE]; -#ifdef OBJ_EDITING_API float edited_azimuth_values[MAX_PARAM_SPATIAL_SUBFRAMES * IVAS_MAX_NUM_BANDS]; float edited_elevation_values[MAX_PARAM_SPATIAL_SUBFRAMES * IVAS_MAX_NUM_BANDS]; -#endif /*sub-modules*/ PARAM_ISM_CONFIG_HANDLE hParamIsm; /* Parametric ISM common handle */ @@ -679,9 +677,7 @@ typedef struct ivas_osba_data float **delayBuffer; int16_t delayBuffer_size; int16_t delayBuffer_nchan; -#ifdef OBJ_EDITING_API float gain_bed; -#endif } SBA_ISM_DATA, *SBA_ISM_DATA_HANDLE; @@ -908,22 +904,14 @@ typedef struct ivas_masa_ism_data_structure int16_t azimuth_ism_edited[MAX_NUM_OBJECTS]; int16_t elevation_ism_edited[MAX_NUM_OBJECTS]; -#ifdef OMASA_OBJECT_EDITING uint8_t ism_dir_is_edited[MAX_NUM_OBJECTS]; -#else - uint8_t ism_is_edited[MAX_NUM_OBJECTS]; -#endif -#ifdef OBJ_EDITING_API float gain_ism[MAX_NUM_OBJECTS]; float gain_masa; -#endif -#ifdef OMASA_OBJECT_EDITING float gain_ism_edited[MAX_NUM_OBJECTS]; uint8_t ism_gain_is_edited[MAX_NUM_OBJECTS]; float gain_masa_edited; uint8_t masa_gain_is_edited; -#endif int16_t idx_separated_ism; int16_t azimuth_separated_ism[MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR]; @@ -932,7 +920,6 @@ typedef struct ivas_masa_ism_data_structure float q_azimuth_old[MAX_NUM_OBJECTS]; float q_elevation_old[MAX_NUM_OBJECTS]; -#ifdef OMASA_OBJECT_EDITING uint8_t objectsEdited; float preprocEneTarget[MASA_FREQUENCY_BANDS]; float preprocEneRealized[MASA_FREQUENCY_BANDS]; @@ -941,14 +928,6 @@ typedef struct ivas_masa_ism_data_structure float enePreserveIIR[2][MASA_FREQUENCY_BANDS]; float eneOrigIIR[MASA_FREQUENCY_BANDS]; int16_t bits_ism[MAX_NUM_OBJECTS]; -#else - float ismPreprocMatrix[2][2][CLDFB_NO_CHANNELS_MAX]; - uint8_t objectsMoved; - float eneMoveIIR[2][CLDFB_NO_CHANNELS_MAX]; - float enePreserveIIR[2][CLDFB_NO_CHANNELS_MAX]; - float preprocEneTarget[CLDFB_NO_CHANNELS_MAX]; - float preprocEneRealized[CLDFB_NO_CHANNELS_MAX]; -#endif float **delayBuffer; int16_t delayBuffer_size; @@ -1028,9 +1007,7 @@ typedef struct decoder_config_structure int16_t Opt_ExternalOrientation; /* indicates whether external orientations are used */ int16_t Opt_dpid_on; /* indicates whether Directivity pattern option is used */ int16_t Opt_aeid_on; /* indicates whether Acoustic environment option is used */ -#ifdef OBJ_EDITING_COMMANDLINE - int16_t Opt_ObjEdit_on; /* indicates whether object editing option is used */ -#endif + int16_t Opt_ObjEdit_on; /* indicates whether object editing option is used */ #ifdef DEBUGGING /* temp. development parameters */ int16_t force_rend; /* forced TD/CLDFB binaural renderer (for ISM and MC) */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 7d1b9e45558cde30b585dfc51f0438568dee1da5..3759819813ecb4c5cfe92b5349eb578f8e508c9d 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -38,9 +38,7 @@ #include "ivas_prot.h" #include "ivas_prot_rend.h" #include "isar_prot.h" -#ifdef OMASA_OBJECT_EDITING #include "ivas_rom_com.h" -#endif #include "lib_isar_pre_rend.h" #include "prot.h" #include "jbm_jb4sb.h" @@ -201,11 +199,7 @@ ivas_error IVAS_DEC_Open( hIvasDec->hasDecodedFirstGoodFrame = false; hIvasDec->isInitialized = false; hIvasDec->updateOrientation = false; -#ifdef OBJ_EDITING_API hIvasDec->flushbuffer = NULL; -#else - // hIvasDec->flushbuffer = NULL; -#endif hIvasDec->pcmType = IVAS_DEC_PCM_INVALID; hIvasDec->nSamplesFlushed = 0; hIvasDec->hasBeenPreparedRendering = false; @@ -347,9 +341,7 @@ 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; -#endif return; } @@ -397,12 +389,10 @@ void IVAS_DEC_Close( free( ( *phIvasDec )->apaExecBuffer ); } -#ifdef OBJ_EDITING_API if ( ( *phIvasDec )->flushbuffer != NULL ) { free( ( *phIvasDec )->flushbuffer ); } -#endif free( *phIvasDec ); *phIvasDec = NULL; @@ -497,10 +487,8 @@ ivas_error IVAS_DEC_Configure( const float non_diegetic_pan_gain, /* i : non diegetic panning gain */ const bool dpidEnabled, /* i : enable directivity pattern option */ const uint16_t acousticEnvironmentId, /* i : Acoustic environment ID */ -#ifdef OBJ_EDITING_COMMANDLINE - const bool objEditEnabled, /* i : enable object editing */ -#endif - 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; @@ -560,9 +548,7 @@ ivas_error IVAS_DEC_Configure( hDecoderConfig->Opt_ExternalOrientation = enableExternalOrientation; hDecoderConfig->Opt_dpid_on = (int16_t) dpidEnabled; hDecoderConfig->Opt_aeid_on = acousticEnvironmentId != 65535 ? TRUE : FALSE; -#ifdef OBJ_EDITING_COMMANDLINE hDecoderConfig->Opt_ObjEdit_on = (int16_t) objEditEnabled; -#endif if ( renderFramesize == IVAS_RENDER_FRAMESIZE_UNKNOWN ) { @@ -605,7 +591,6 @@ ivas_error IVAS_DEC_Configure( hIvasDec->tsm_max_scaling = 0; hIvasDec->tsm_quality = 1.0f; -#ifdef OBJ_EDITING_API /* init flush buffer if necessary (only needed for binaural)*/ if ( tsmEnabled && ( outputConfig == IVAS_AUDIO_CONFIG_BINAURAL || outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM || outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { @@ -613,7 +598,6 @@ ivas_error IVAS_DEC_Configure( hIvasDec->pcmType = IVAS_DEC_PCM_INT16; set_s( (int16_t *) hIvasDec->flushbuffer, 0, CPE_CHANNELS * hIvasDec->nSamplesFrame / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ); } -#endif #endif return IVAS_ERR_OK; @@ -887,7 +871,6 @@ ivas_error IVAS_DEC_EnableVoIP( return error; } #else -#ifdef OBJ_EDITING_API /* init flush buffer if necessary (only needed for binaural)*/ if ( hIvasDec->flushbuffer == NULL && ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL || hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { @@ -895,7 +878,6 @@ ivas_error IVAS_DEC_EnableVoIP( hIvasDec->pcmType = IVAS_DEC_PCM_INT16; set_s( (int16_t *) hIvasDec->flushbuffer, 0, CPE_CHANNELS * hIvasDec->nSamplesFrame / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ); } -#endif #endif return IVAS_ERR_OK; @@ -1180,18 +1162,8 @@ ivas_error IVAS_DEC_ReadFormat( { int16_t tc_granularity_new = ivas_jbm_dec_get_render_granularity( 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; -#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 -#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; @@ -1216,17 +1188,7 @@ ivas_error IVAS_DEC_ReadFormat( render what still fits in the new granularity */ int16_t 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; -#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 -#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 ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) { if ( ( error = ivas_jbm_dec_flush_renderer( st_ivas, tc_granularity_new, renderer_type_old, intern_config_old, &st_ivas->hIntSetup, mc_mode_old, ism_mode_old, &hIvasDec->nSamplesFlushed, pcm_type_API_to_internal( hIvasDec->pcmType ), hIvasDec->flushbuffer ) ) != IVAS_ERR_OK ) @@ -1425,7 +1387,6 @@ ivas_error IVAS_DEC_GetSamplesDecoder( hIvasDec->hasBeenPreparedRendering = false; -#ifdef OBJ_EDITING_API /*-----------------------------------------------------------------* * Set editable metadata *-----------------------------------------------------------------*/ @@ -1434,11 +1395,7 @@ ivas_error IVAS_DEC_GetSamplesDecoder( { if ( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT || hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT ) { -#ifdef OMASA_OBJECT_EDITING if ( hIvasDec->st_ivas->ism_mode == ISM_MODE_DISC || hIvasDec->st_ivas->ism_mode == ISM_MASA_MODE_DISC || hIvasDec->st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || hIvasDec->st_ivas->ism_mode == ISM_SBA_MODE_DISC ) -#else - if ( hIvasDec->st_ivas->ism_mode == ISM_MODE_DISC || hIvasDec->st_ivas->ism_mode == ISM_MASA_MODE_DISC || hIvasDec->st_ivas->ism_mode == ISM_SBA_MODE_DISC ) -#endif { int16_t obj; ISM_METADATA_HANDLE *hIsmMetaData = hIvasDec->st_ivas->hIsmMetaData; @@ -1473,13 +1430,11 @@ ivas_error IVAS_DEC_GetSamplesDecoder( } } } -#endif return IVAS_ERR_OK; } -#ifdef OBJ_EDITING_API /*---------------------------------------------------------------------* * IVAS_DEC_GetEditableParameters( ) * @@ -1494,9 +1449,7 @@ ivas_error IVAS_DEC_GetEditableParameters( int16_t obj; Decoder_Struct *st_ivas; ISM_MODE ism_mode; -#ifdef OMASA_OBJECT_EDITING int16_t dirac_read_idx; -#endif if ( hIvasEditableParameters == NULL || hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { @@ -1574,7 +1527,6 @@ ivas_error IVAS_DEC_GetEditableParameters( } #endif } -#ifdef OMASA_OBJECT_EDITING else 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 ) ) { /* object editing possible only in two highest OMASA modes */ @@ -1622,7 +1574,6 @@ ivas_error IVAS_DEC_GetEditableParameters( } } } -#endif return IVAS_ERR_OK; } @@ -1642,9 +1593,7 @@ ivas_error IVAS_DEC_SetEditableParameters( int16_t obj; Decoder_Struct *st_ivas; ISM_MODE ism_mode; -#ifdef OMASA_OBJECT_EDITING int16_t dirac_read_idx; -#endif if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { @@ -1709,7 +1658,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[obj] = hIvasEditableParameters.ism_metadata[obj].azimuth; st_ivas->hParamIsmDec->edited_elevation_values[obj] = hIvasEditableParameters.ism_metadata[obj].elevation; @@ -1741,11 +1689,9 @@ ivas_error IVAS_DEC_SetEditableParameters( } #ifdef NONBE_1217_OBJ_EDIT_FOA } -#endif #endif } -#ifdef OBJ_EDITING_PARAMISM_BIN #ifdef NONBE_1217_OBJ_EDIT_FOA if ( st_ivas->hMasaIsmData != NULL ) { @@ -1754,8 +1700,6 @@ ivas_error IVAS_DEC_SetEditableParameters( st_ivas->hMasaIsmData->masa_gain_is_edited = 0u; #ifdef NONBE_1217_OBJ_EDIT_FOA } -#endif - #endif } else if ( ism_mode == ISM_MODE_NONE ) @@ -1770,7 +1714,6 @@ ivas_error IVAS_DEC_SetEditableParameters( assert( 0 && "This should never happen!" ); } } -#ifdef OMASA_OBJECT_EDITING else 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 ) ) { int32_t id_th; @@ -1891,7 +1834,6 @@ ivas_error IVAS_DEC_SetEditableParameters( st_ivas->hMasaIsmData->masa_gain_is_edited = 0u; } } -#endif return IVAS_ERR_OK; } @@ -1922,7 +1864,6 @@ ivas_error IVAS_DEC_PrepareRenderer( return IVAS_ERR_OK; } -#endif /*---------------------------------------------------------------------* @@ -1945,39 +1886,27 @@ ivas_error IVAS_DEC_GetSamples( ) { ivas_error error; -#ifdef OBJ_EDITING_API #ifndef LIB_DEC_REVISION int16_t nSamplesToRender; #endif uint16_t nSamplesRendered, nSamplesRendered_loop; uint8_t nOutChannels; -#else - int16_t nOutSamplesElse, nSamplesToRender; - uint16_t nSamplesRendered, nSamplesRendered_loop, l_ts, nTimeScalerOutSamples; - uint8_t nTransportChannels, nOutChannels; -#endif Decoder_Struct *st_ivas; nSamplesRendered = 0; nOutChannels = 0; nSamplesRendered_loop = 0; -#ifndef OBJ_EDITING_API - l_ts = 0; - nTransportChannels = 0; -#endif if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { 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; @@ -2035,133 +1964,56 @@ ivas_error IVAS_DEC_GetSamples( } else { -#ifndef OBJ_EDITING_API - /* check if we need to run the setup function */ - if ( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame ) - { - /* setup */ - if ( ( error = IVAS_DEC_Setup( hIvasDec, &l_ts, &nTransportChannels ) ) != IVAS_ERR_OK ) - { - return error; - } - } -#endif #ifndef LIB_DEC_REVISION { /* check if we need to run the setup function, tc decoding and feeding the renderer */ #endif -#ifndef OBJ_EDITING_API - if ( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame ) - { - int16_t nResidualSamples, nSamplesTcsScaled; - nSamplesRendered += nSamplesRendered_loop; - - if ( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm && nTransportChannels != hIvasDec->nTransportChannelsOld ) - { - if ( ( error = IVAS_DEC_VoIP_reconfigure( hIvasDec, nTransportChannels, l_ts ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - /* IVAS decoder */ - if ( ( error = IVAS_DEC_GetTcSamples( hIvasDec, hIvasDec->apaExecBuffer, &nOutSamplesElse ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* JBM */ - if ( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm ) - { - if ( apa_set_scale( hIvasDec->hTimeScaler, hIvasDec->tsm_scale ) != 0 ) - { - return IVAS_ERR_UNKNOWN; - } + nOutChannels = (uint8_t) hIvasDec->st_ivas->hDecoderConfig->nchan_out; + hIvasDec->hasBeenFedFrame = false; - if ( apa_exec( hIvasDec->hTimeScaler, hIvasDec->apaExecBuffer, hIvasDec->nSamplesFrame * nTransportChannels, (uint16_t) hIvasDec->tsm_max_scaling, hIvasDec->apaExecBuffer, &nTimeScalerOutSamples ) != 0 ) - { - return IVAS_ERR_UNKNOWN; - } - - assert( nTimeScalerOutSamples <= APA_BUF ); - nSamplesTcsScaled = nTimeScalerOutSamples / nTransportChannels; - hIvasDec->timeScalingDone = 1; - } - else - { - nSamplesTcsScaled = hIvasDec->nSamplesFrame; - } - -#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 ( ( error = IVAS_DEC_RendererFeedTcSamples( hIvasDec, nSamplesTcsScaled, &nResidualSamples, hIvasDec->apaExecBuffer ) ) != 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, (uint16_t) nResidualSamples ) != 0 ) - { - return IVAS_ERR_UNKNOWN; - } - } - hIvasDec->hasBeenFedFrame = false; - } -#else - nOutChannels = (uint8_t) hIvasDec->st_ivas->hDecoderConfig->nchan_out; - hIvasDec->hasBeenFedFrame = false; - - /* check for possible flushed samples from a rate switch */ - if ( hIvasDec->nSamplesFlushed > 0 ) - { + /* check for possible flushed samples from a rate switch */ + if ( hIvasDec->nSamplesFlushed > 0 ) + { #ifndef LIB_DEC_REVISION - void *pPcmBuffer; + void *pPcmBuffer; #endif #ifdef DEBUGGING - assert( hIvasDec->pcmType == pcmType ); + assert( hIvasDec->pcmType == pcmType ); #endif #ifdef LIB_DEC_REVISION - /* note: offset (rendered samples) is always 0 */ + /* note: offset (rendered samples) is always 0 */ #else pPcmBuffer = pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ); #endif - if ( pcmType == IVAS_DEC_PCM_INT16 ) - { + if ( pcmType == IVAS_DEC_PCM_INT16 ) + { #ifdef LIB_DEC_REVISION - mvs2s( (int16_t *) hIvasDec->flushbuffer, pcmBuf, hIvasDec->nSamplesFlushed * nOutChannels ); + mvs2s( (int16_t *) hIvasDec->flushbuffer, pcmBuf, hIvasDec->nSamplesFlushed * nOutChannels ); #else mvs2s( (int16_t *) hIvasDec->flushbuffer, pPcmBuffer, hIvasDec->nSamplesFlushed * nOutChannels ); #endif - } - else if ( pcmType == IVAS_DEC_PCM_FLOAT ) - { + } + else if ( pcmType == IVAS_DEC_PCM_FLOAT ) + { #ifdef LIB_DEC_REVISION - mvr2r( (float *) hIvasDec->flushbuffer, pcmBuf, hIvasDec->nSamplesFlushed * nOutChannels ); + mvr2r( (float *) hIvasDec->flushbuffer, pcmBuf, hIvasDec->nSamplesFlushed * nOutChannels ); #else mvr2r( (float *) hIvasDec->flushbuffer, pPcmBuffer, hIvasDec->nSamplesFlushed * nOutChannels ); #endif - } + } #ifdef DEBUGGING - else - { - assert( 0 && "wrong PCM type for the flush buffer!" ); - } + else + { + assert( 0 && "wrong PCM type for the flush buffer!" ); + } #endif #ifdef LIB_DEC_REVISION - nSamplesRendered = hIvasDec->nSamplesFlushed; + nSamplesRendered = hIvasDec->nSamplesFlushed; #else nSamplesRendered += hIvasDec->nSamplesFlushed; #endif - hIvasDec->nSamplesFlushed = 0; - } -#endif + hIvasDec->nSamplesFlushed = 0; + } /* render IVAS frames directly to the output buffer */ #ifdef LIB_DEC_REVISION @@ -2258,15 +2110,8 @@ 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 numPoses = hSplitBinRend->splitrend.multiBinPoseData.num_poses; -#ifdef OBJ_EDITING_API /* init flush buffer for rate switch if not already initizalized */ if ( hIvasDec->flushbuffer == NULL ) { @@ -2274,7 +2119,6 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( hIvasDec->pcmType = IVAS_DEC_PCM_FLOAT; set_zero( (float *) hIvasDec->flushbuffer, numPoses * BINAURAL_CHANNELS * hIvasDec->nSamplesFrame / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ); } -#endif if ( st_ivas->hDecoderConfig->render_framesize != IVAS_RENDER_FRAMESIZE_20MS && ( hIvasDec->st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE || @@ -2935,7 +2779,6 @@ ivas_error IVAS_DEC_GetObjectMetadata( } else { -#ifdef OBJ_EDITING_API if ( st_ivas->ism_mode == ISM_MODE_DISC ) { metadata->azimuth = hIsmMeta->edited_azimuth; @@ -2949,7 +2792,6 @@ ivas_error IVAS_DEC_GetObjectMetadata( metadata->gainFactor = hIsmMeta->edited_gain; metadata->non_diegetic_flag = hIsmMeta->non_diegetic_flag; } -#ifdef OBJ_EDITING_API else if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { metadata->azimuth = st_ivas->hParamIsmDec->edited_azimuth_values[objectIdx]; @@ -2961,7 +2803,6 @@ ivas_error IVAS_DEC_GetObjectMetadata( metadata->gainFactor = 1.f; metadata->non_diegetic_flag = hIsmMeta->non_diegetic_flag; } -#endif else if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { metadata->azimuth = st_ivas->hIsmMetaData[objectIdx]->edited_azimuth; @@ -2974,7 +2815,6 @@ ivas_error IVAS_DEC_GetObjectMetadata( metadata->non_diegetic_flag = st_ivas->hIsmMetaData[objectIdx]->non_diegetic_flag; } else -#endif { metadata->azimuth = hIsmMeta->azimuth; metadata->elevation = hIsmMeta->elevation; @@ -4055,9 +3895,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( #endif bool *bitstreamReadDone, /* o : flag indicating that bitstream was read */ uint16_t *nSamplesRendered, /* o : number of samples rendered */ -#ifdef OBJ_EDITING_API bool *parametersAvailableForEditing, -#endif const uint32_t systemTimestamp_ms /* i : current system timestamp */ ) { @@ -4080,9 +3918,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( hDecoderConfig = st_ivas->hDecoderConfig; hVoIP = hIvasDec->hVoIP; nOutChannels = (uint8_t) st_ivas->hDecoderConfig->nchan_out; -#ifdef OBJ_EDITING_API *parametersAvailableForEditing = false; -#endif if ( nSamplesPerChannel == 0 ) { @@ -4230,13 +4066,11 @@ ivas_error IVAS_DEC_VoIP_GetSamples( #endif } #ifndef NONBE_FIX_1255_OBJ_EDIT_JBM -#ifdef OBJ_EDITING_API if ( hIvasDec->hasBeenFedFirstGoodFrame ) { *parametersAvailableForEditing = true; return IVAS_ERR_OK; } -#endif #endif } @@ -4284,7 +4118,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( nSamplesToRender = nSamplesPerChannel - *nSamplesRendered; -#ifdef OBJ_EDITING_API /* check if we still need to prepare the renderer */ if ( hIvasDec->hasBeenPreparedRendering == false ) { @@ -4294,7 +4127,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( return error; } } -#endif /* render IVAS frames directly to the output buffer */ #ifdef LIB_DEC_REVISION @@ -4723,13 +4555,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 } /*-----------------------------------------------------------------* diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 480719599f6a46ec807f8c77c5c58d36a225a199..8a45d867046cda948fda9bd270d29739cc9cdb7c 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -135,9 +135,7 @@ ivas_error IVAS_DEC_Configure( const float non_diegetic_pan_gain, /* i : non diegetic panning gain */ const bool dpidEnabled, /* i : enable directivity pattern option */ const uint16_t acousticEnvironmentId, /* i : Acoustic environment ID */ -#ifdef OBJ_EDITING_COMMANDLINE const bool objEditEnabled, /* i : enable object editing */ -#endif const bool delayCompensationEnabled /* i : enable delay compensation */ ); @@ -183,7 +181,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 */ @@ -197,7 +194,6 @@ ivas_error IVAS_DEC_SetEditableParameters( ivas_error IVAS_DEC_PrepareRenderer( IVAS_DEC_HANDLE hIvasDec ); -#endif ivas_error IVAS_DEC_GetSplitBinauralBitstream( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ @@ -326,9 +322,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( #endif bool *bitstreamReadDone, /* o : flag indicating that bitstream was read */ uint16_t *nSamplesRendered, /* o : number of samples rendered */ -#ifdef OBJ_EDITING_API bool *parametersAvailableForEditing, -#endif const uint32_t systemTimestamp_ms /* i : current system timestamp */ ); diff --git a/lib_enc/ivas_stereo_dft_td_itd.c b/lib_enc/ivas_stereo_dft_td_itd.c index 25ea30c35b217ad4bcec75c92767d9844e2345c2..995ffbd5728396073f8bc3c6fdbb7638c6045aa4 100644 --- a/lib_enc/ivas_stereo_dft_td_itd.c +++ b/lib_enc/ivas_stereo_dft_td_itd.c @@ -399,9 +399,7 @@ void stereo_td_itd_mdct_stereo( float bin_nrgR[STEREO_DFT_N_32k_ENC]; float DFT[CPE_CHANNELS][STEREO_DFT_N_MAX_ENC]; STEREO_MDCT_ENC_DATA_HANDLE hStereoMdct; -#ifdef NONBE_1203_MDCT2DFT_SWITCHING int16_t dft_ovl; -#endif if ( hCPE->hStereoMdct != NULL && hCPE->hStereoMdct->hItd != NULL ) { @@ -430,7 +428,6 @@ void stereo_td_itd_mdct_stereo( stereo_td_itd( hStereoMdct->hItd, NULL, 1, hStereoMdct->hDft_ana->dft_ovl, hCPE->hCoreCoder, input_frame, hCPE->input_mem ); #endif } -#ifdef NONBE_1203_MDCT2DFT_SWITCHING else if ( hCPE->input_mem[0] != NULL ) { dft_ovl = STEREO_DFT_OVL_MAX * input_frame / L_FRAME48k; @@ -440,7 +437,6 @@ void stereo_td_itd_mdct_stereo( mvr2r( hCPE->hCoreCoder[i]->input + input_frame - dft_ovl, hCPE->input_mem[i], dft_ovl ); } } -#endif return; } diff --git a/lib_enc/ivas_stereo_switching_enc.c b/lib_enc/ivas_stereo_switching_enc.c index 862eea204b749e6faf73f0aecb93b274bc3d710a..909fe387bffd58777a89af5a1eaaa6edd2388200 100644 --- a/lib_enc/ivas_stereo_switching_enc.c +++ b/lib_enc/ivas_stereo_switching_enc.c @@ -625,9 +625,7 @@ void stereo_switching_enc( dft_ovl = STEREO_DFT_OVL_MAX * input_frame / L_FRAME48k; /* 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 if ( hCPE->element_mode > IVAS_CPE_DFT && hCPE->input_mem[0] != NULL && hCPE->element_mode != IVAS_CPE_MDCT ) { for ( n = 0; n < CPE_CHANNELS; n++ ) diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 28f6b60a51b016a87737eb1e5fe617b036cbb86d..de384f2aeac3ada437ebabbd49e808f3e233333b 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -736,21 +736,10 @@ static void ivas_dirac_dec_binaural_internal( ivas_sba_prototype_renderer( st_ivas, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, subframe ); } -#ifdef OMASA_OBJECT_EDITING -#ifdef OBJ_EDITING_PARAMISM_BIN 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 ) ) ) ) || st_ivas->ivas_format == ISM_FORMAT ) -#else - 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( st_ivas, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, nBins, subframe ); } -#else - if ( st_ivas->ivas_format == MASA_ISM_FORMAT && nchan_transport == 2 && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) - { - ivas_omasa_preProcessStereoTransportsForMovedObjects( st_ivas, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, nBins, subframe ); - } -#endif if ( hCombinedOrientationData ) { @@ -1227,19 +1216,11 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( uint16_t ismDirIndex; ismDirIndex = 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[ismDirIndex]; eleDeg = hMasaIsmData->elevation_ism_edited[ismDirIndex]; } -#else - if ( hMasaIsmData->ism_is_edited[ismDirIndex] ) - { - aziDeg = hMasaIsmData->azimuth_ism_edited[ismDirIndex]; - eleDeg = hMasaIsmData->elevation_ism_edited[ismDirIndex]; - } -#endif else { aziDeg = hMasaIsmData->azimuth_ism[ismDirIndex][dirac_read_idx]; @@ -1673,7 +1654,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( { if ( ism_mode == ISM_MASA_MODE_DISC ) { -#ifdef OMASA_OBJECT_EDITING if ( hMasaIsmData->ism_dir_is_edited[chB] ) { aziDeg = hMasaIsmData->azimuth_ism_edited[chB]; @@ -1684,14 +1664,9 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( aziDeg = hMasaIsmData->azimuth_ism[chB][dirac_read_idx]; eleDeg = hMasaIsmData->elevation_ism[chB][dirac_read_idx]; } -#else - aziDeg = hMasaIsmData->azimuth_ism[chB][dirac_read_idx]; - eleDeg = hMasaIsmData->elevation_ism[chB][dirac_read_idx]; -#endif } else { -#ifdef OMASA_OBJECT_EDITING if ( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ && hMasaIsmData->ism_dir_is_edited[hMasaIsmData->idx_separated_ism] ) { aziDeg = hMasaIsmData->azimuth_ism_edited[hMasaIsmData->idx_separated_ism]; @@ -1702,10 +1677,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( aziDeg = hMasaIsmData->azimuth_separated_ism[dirac_read_idx]; eleDeg = hMasaIsmData->elevation_separated_ism[dirac_read_idx]; } -#else - aziDeg = hMasaIsmData->azimuth_separated_ism[dirac_read_idx]; - eleDeg = hMasaIsmData->elevation_separated_ism[dirac_read_idx]; -#endif instantChange = 1; } } @@ -2479,7 +2450,6 @@ static void getDirectPartGains( if ( renderStereoOutputInsteadOfBinaural ) /* In stereo (i.e. non-binaural) rendering mode */ { -#ifdef OMASA_OBJECT_EDITING *lImagp = 0.0f; *rImagp = 0.0f; if ( aziDeg == gainCache->azi && eleDeg == gainCache->ele ) @@ -2525,40 +2495,6 @@ static void getDirectPartGains( gainCache->shVec[0] = *lRealp; /* Reuse memory */ gainCache->shVec[1] = *rRealp; /* Reuse memory */ } -#else - /* Convert azi and ele to an azi value of the cone of confusion */ - aziRad = (float) aziDeg * PI_OVER_180; - eleRad = (float) eleDeg * PI_OVER_180; - y = ( sinf( aziRad ) * cosf( eleRad ) ); - mappedX = sqrtf( max( 0.0f, 1.0f - ( y * y ) ) ); - aziRadMapped = atan2f( y, mappedX ); - - /* Determine the real valued amplitude panning gains */ - *lImagp = 0.0f; - *rImagp = 0.0f; - if ( aziRadMapped >= LsAngleRad ) - { /* Left side */ - *lRealp = 1.0f; - *rRealp = 0.0f; - } - else if ( aziRadMapped <= -LsAngleRad ) - { /* Right side */ - *lRealp = 0.0f; - *rRealp = 1.0f; - } - else /* Tangent panning law */ - { - A = tanf( aziRadMapped ) / tanf( LsAngleRad ); - A2 = ( A - 1.0f ) / max( 0.001f, A + 1.0f ); - A3 = 1.0f / ( A2 * A2 + 1.0f ); - *lRealp = sqrtf( A3 ); - *rRealp = sqrtf( 1.0f - A3 ); - } - - /* Scaling to have the same expected gain as for the HRTF rendering */ - *lRealp *= SQRT2; - *rRealp *= SQRT2; -#endif } else /* In regular binaural rendering mode */ { @@ -2712,7 +2648,6 @@ float configure_reqularization_factor( } -#ifdef OMASA_OBJECT_EDITING /*-------------------------------------------------------------------* * ivas_omasa_preProcessStereoTransportsForEditedObjects() * @@ -2729,9 +2664,7 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( int16_t 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 uint8_t enableCentering; int16_t dirac_read_idx; int16_t nSlots; @@ -2742,13 +2675,10 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( uint8_t ismGainEdited[4]; uint8_t ismDirEdited[4]; uint8_t masaGainEdited; -#ifdef OBJ_EDITING_PARAMISM_BIN uint8_t masaIsmMode; -#endif hSpatParamRendCom = st_ivas->hSpatParamRendCom; hMasaIsmData = st_ivas->hMasaIsmData; -#ifdef OBJ_EDITING_PARAMISM_BIN hParamIsmDec = st_ivas->hParamIsmDec; if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) @@ -2759,7 +2689,6 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( { masaIsmMode = 0u; } -#endif if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_FOA || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA2 || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA3 ) { @@ -2770,11 +2699,7 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( enableCentering = 1; } -#ifdef OBJ_EDITING_PARAMISM_BIN if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ivas_format == ISM_FORMAT ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#endif { n_ism = st_ivas->nchan_ism; } @@ -2851,7 +2776,6 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( } } } -#ifdef OBJ_EDITING_PARAMISM_BIN else if ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->hISMDTX.dtx_flag ) /* If dtx on, perform just the smoothing of the processing gains */ { float totalTargetEne; @@ -2959,7 +2883,6 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( } } } -#endif else /* Other processing modes */ { float subframeEne; @@ -3039,15 +2962,12 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( /* Determine the highest band */ max_band = 0; -#ifdef OBJ_EDITING_PARAMISM_BIN if ( masaIsmMode ) { -#endif while ( max_band < MASA_FREQUENCY_BANDS && MASA_band_grouping_24[max_band] < nBins ) { max_band++; } -#ifdef OBJ_EDITING_PARAMISM_BIN } else { @@ -3056,7 +2976,6 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( max_band++; } } -#endif /* Init out array */ for ( int k = 0; k < nSlots; k++ ) @@ -3080,20 +2999,16 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( set_zero( ismPreprocMtxNew[1], 2 ); set_zero( eneMove, 2 ); set_zero( enePreserve, 2 ); -#ifdef OBJ_EDITING_PARAMISM_BIN if ( masaIsmMode ) { -#endif bin_lo = MASA_band_grouping_24[band_idx]; bin_hi = min( MASA_band_grouping_24[band_idx + 1], nBins ); -#ifdef OBJ_EDITING_PARAMISM_BIN } else { bin_lo = hParamIsmDec->hParamIsm->band_grouping[band_idx]; bin_hi = min( hParamIsmDec->hParamIsm->band_grouping[band_idx + 1], nBins ); } -#endif /* Determine transport normalized energies and subframe energy */ for ( slot = 0; slot < nSlots; slot++ ) @@ -3167,10 +3082,8 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( ratioAccNew += ratio; } -#ifdef OBJ_EDITING_PARAMISM_BIN if ( masaIsmMode ) { -#endif /* MASA original ratios */ ratio = hSpatParamRendCom->energy_ratio1[dirac_read_idx][bin_lo] + hSpatParamRendCom->energy_ratio2[dirac_read_idx][bin_lo]; ratioAccOrig += ratio; @@ -3192,9 +3105,7 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( } ratioAccNew += ratio; -#ifdef OBJ_EDITING_PARAMISM_BIN } -#endif /* Limit target energies to non-negative values */ for ( ch = 0; ch < 2; ch++ ) @@ -3365,7 +3276,6 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( } } -#ifdef OBJ_EDITING_PARAMISM_BIN if ( !masaIsmMode ) { int16_t obj_idx1, obj_idx2; @@ -3385,237 +3295,10 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( } } } -#endif - } - - return; -} -#else -/*-------------------------------------------------------------------* - * ivas_omasa_preProcessStereoTransportsForMovedObjects() - * - * - *-------------------------------------------------------------------*/ - -void ivas_omasa_preProcessStereoTransportsForMovedObjects( - Decoder_Struct *st_ivas, - float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], - float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], - const int16_t nBins, - const int16_t subframe ) -{ - int16_t bin, ch, inCh, outCh, ismDirIndex, slot; - SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; - MASA_ISM_DATA_HANDLE hMasaIsmData; - uint8_t enableCentering; - int16_t dirac_read_idx; - int16_t nSlots; - - hSpatParamRendCom = st_ivas->hSpatParamRendCom; - hMasaIsmData = st_ivas->hMasaIsmData; - - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_FOA || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA2 || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA3 ) - { - enableCentering = 0; - } - else - { - enableCentering = 1; - } - - /* Bypass processing until first object is moved */ - if ( hMasaIsmData->objectsMoved == 0 ) - { - for ( ismDirIndex = 0; ismDirIndex < hSpatParamRendCom->numIsmDirections; ismDirIndex++ ) - { - if ( hMasaIsmData->ism_is_edited[ismDirIndex] ) - { - hMasaIsmData->objectsMoved = 1; - } - } - if ( hMasaIsmData->objectsMoved == 0 ) - { - /* No objects have moved so far */ - return; - } - } - - /* Perform object-movement based processing */ - nSlots = hSpatParamRendCom->subframe_nbslots[subframe]; - dirac_read_idx = hSpatParamRendCom->render_to_md_map[subframe]; - - for ( bin = 0; bin < nBins; bin++ ) - { - float ismPreprocMtxNew[2][2]; - float ismPreprocMtxIncrement[2][2]; - float eneMove[2]; - float enePreserve[2]; - float ismRatioAcc; - float subframeEne; - float normEnes[2]; - float remainderNormEne; - - set_zero( ismPreprocMtxNew[0], 2 ); - set_zero( ismPreprocMtxNew[1], 2 ); - set_zero( ismPreprocMtxIncrement[0], 2 ); - set_zero( ismPreprocMtxIncrement[1], 2 ); - set_zero( eneMove, 2 ); - set_zero( enePreserve, 2 ); - ismRatioAcc = 0.0f; - subframeEne = 0.0f; - set_zero( normEnes, 2 ); - - /* Determine transport normalized energies and subframe energy */ - for ( slot = 0; slot < nSlots; slot++ ) - { - for ( ch = 0; ch < 2; ch++ ) - { - normEnes[ch] += inRe[ch][slot][bin] * inRe[ch][slot][bin]; - normEnes[ch] += inIm[ch][slot][bin] * inIm[ch][slot][bin]; - } - } - subframeEne = normEnes[0] + normEnes[1]; - normEnes[0] /= fmaxf( 1e-12f, subframeEne ); - normEnes[1] /= fmaxf( 1e-12f, subframeEne ); - - /* 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++ ) - { - float panGainsOut[2]; - float panGainsIn[2]; - float ratio; - float panEnesOut[2]; - float panEnesIn[2]; - float centeringFactor; - - ratio = hMasaIsmData->energy_ratio_ism[ismDirIndex][dirac_read_idx][bin]; - - ismRatioAcc += ratio; - - /* Get input and output panning gains */ - ivas_get_stereo_panning_gains( hMasaIsmData->azimuth_ism[ismDirIndex][dirac_read_idx], - hMasaIsmData->elevation_ism[ismDirIndex][dirac_read_idx], - panGainsIn ); - - if ( hMasaIsmData->ism_is_edited[ismDirIndex] ) - { - ivas_get_stereo_panning_gains( hMasaIsmData->azimuth_ism_edited[ismDirIndex], - hMasaIsmData->elevation_ism_edited[ismDirIndex], - panGainsOut ); - } - else - { - /* When not edited, input and output pan gains are the same */ - for ( ch = 0; ch < 2; ch++ ) - { - panGainsOut[ch] = panGainsIn[ch]; - } - } - - /* Determine pan enes */ - for ( ch = 0; ch < 2; ch++ ) - { - panEnesOut[ch] = panGainsOut[ch] * panGainsOut[ch]; - panEnesIn[ch] = panGainsIn[ch] * panGainsIn[ch]; - } - - if ( enableCentering ) - { - centeringFactor = fmaxf( 0.0f, 2.0f * fabsf( panEnesIn[0] - panEnesOut[0] ) - 1.0f ); - for ( ch = 0; ch < 2; ch++ ) - { - panEnesOut[ch] *= ( 1.0f - centeringFactor ); - panEnesOut[ch] += 0.5f * centeringFactor; - } - } - - for ( ch = 0; ch < 2; ch++ ) - { - float eneMoveThis; - float enePreserveThis; - eneMoveThis = fmaxf( 0.0f, panEnesIn[ch] - panEnesOut[ch] ); - enePreserveThis = panEnesIn[ch] - eneMoveThis; - - eneMove[ch] += ratio * eneMoveThis; - enePreserve[ch] += ratio * enePreserveThis; - - /* Subtract object parts from normEnes */ - normEnes[ch] -= panEnesIn[ch] * ratio; - } - } - - /* Any remaining (non-object) energy is set to be preserved at both channels */ - remainderNormEne = fmaxf( 0.0f, ( 1.0f - ismRatioAcc ) - normEnes[0] - normEnes[1] ); - for ( ch = 0; ch < 2; ch++ ) - { - enePreserve[ch] += fmaxf( 0.0f, normEnes[ch] + remainderNormEne / 2.0f ); - } - - /* Temporally average energy moving and preserving, and generate the transport signal preprocessing matrix */ - for ( ch = 0; ch < 2; ch++ ) - { - float normVal; - hMasaIsmData->eneMoveIIR[ch][bin] *= STEREO_PREPROCESS_IIR_FACTOR; - hMasaIsmData->eneMoveIIR[ch][bin] += eneMove[ch] * subframeEne; - hMasaIsmData->enePreserveIIR[ch][bin] *= STEREO_PREPROCESS_IIR_FACTOR; - hMasaIsmData->enePreserveIIR[ch][bin] += enePreserve[ch] * subframeEne; - normVal = fmaxf( EPSILON, hMasaIsmData->eneMoveIIR[ch][bin] + hMasaIsmData->enePreserveIIR[ch][bin] ); - ismPreprocMtxNew[ch][ch] = sqrtf( hMasaIsmData->enePreserveIIR[ch][bin] / normVal ); - ismPreprocMtxNew[1 - ch][ch] = sqrtf( hMasaIsmData->eneMoveIIR[ch][bin] / normVal ); - } - - /* Get increment value for temporal interpolation */ - for ( inCh = 0; inCh < 2; inCh++ ) - { - for ( outCh = 0; outCh < 2; outCh++ ) - { - ismPreprocMtxIncrement[outCh][inCh] = ( ismPreprocMtxNew[outCh][inCh] - hMasaIsmData->ismPreprocMatrix[outCh][inCh][bin] ) / (float) nSlots; - } - } - - /* Mix signals */ - for ( slot = 0; slot < nSlots; slot++ ) - { - float eqVal; - float outSlotRe[2]; - float outSlotIm[2]; - - set_zero( outSlotRe, 2 ); - set_zero( outSlotIm, 2 ); - - for ( outCh = 0; outCh < 2; outCh++ ) - { - for ( inCh = 0; inCh < 2; inCh++ ) - { - hMasaIsmData->ismPreprocMatrix[outCh][inCh][bin] += ismPreprocMtxIncrement[outCh][inCh]; - outSlotRe[outCh] += inRe[inCh][slot][bin] * hMasaIsmData->ismPreprocMatrix[outCh][inCh][bin]; - outSlotIm[outCh] += inIm[inCh][slot][bin] * hMasaIsmData->ismPreprocMatrix[outCh][inCh][bin]; - } - } - - /* IIR average the energy measures and determine and apply energy-preserving equalizer */ - hMasaIsmData->preprocEneTarget[bin] *= STEREO_PREPROCESS_IIR_FACTOR; - hMasaIsmData->preprocEneRealized[bin] *= STEREO_PREPROCESS_IIR_FACTOR; - for ( ch = 0; ch < 2; ch++ ) - { - hMasaIsmData->preprocEneTarget[bin] += inRe[ch][slot][bin] * inRe[ch][slot][bin]; - hMasaIsmData->preprocEneTarget[bin] += inIm[ch][slot][bin] * inIm[ch][slot][bin]; - hMasaIsmData->preprocEneRealized[bin] += outSlotRe[ch] * outSlotRe[ch]; - hMasaIsmData->preprocEneRealized[bin] += outSlotIm[ch] * outSlotIm[ch]; - } - eqVal = fminf( 4.0f, sqrtf( hMasaIsmData->preprocEneTarget[bin] / fmaxf( 1e-12f, hMasaIsmData->preprocEneRealized[bin] ) ) ); - for ( ch = 0; ch < 2; ch++ ) - { - inRe[ch][slot][bin] = outSlotRe[ch] * eqVal; - inIm[ch][slot][bin] = outSlotIm[ch] * eqVal; - } - } } return; } -#endif static void ivas_masa_ext_rend_parambin_internal( MASA_EXT_REND_HANDLE hMasaExtRend, diff --git a/lib_rend/ivas_dirac_output_synthesis_dec.c b/lib_rend/ivas_dirac_output_synthesis_dec.c index c925bb0e270ad064c8ad29720da341b237cb3073..3215c6f89b526d019dbf5f227ca7376d263deb73 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec.c @@ -1700,17 +1700,10 @@ void ivas_dirac_dec_compute_directional_responses( for ( dir = 0; dir < hSpatParamRendCom->numIsmDirections; dir++ ) { -#ifdef OMASA_OBJECT_EDITING if ( hMasaIsm->ism_dir_is_edited[dir] ) { ivas_dirac_dec_get_response( hMasaIsm->azimuth_ism_edited[dir], hMasaIsm->elevation_ism_edited[dir], direct_response_temp, hDirACRend->hOutSetup.ambisonics_order ); } -#else - if ( hMasaIsm->ism_is_edited[dir] ) - { - ivas_dirac_dec_get_response( hMasaIsm->azimuth_ism_edited[dir], hMasaIsm->elevation_ism_edited[dir], direct_response_temp, hDirACRend->hOutSetup.ambisonics_order ); - } -#endif else { ivas_dirac_dec_get_response( hMasaIsm->azimuth_ism[dir][md_idx], hMasaIsm->elevation_ism[dir][md_idx], direct_response_temp, hDirACRend->hOutSetup.ambisonics_order ); @@ -1817,17 +1810,10 @@ void ivas_dirac_dec_compute_directional_responses( for ( dir = 0; dir < hSpatParamRendCom->numIsmDirections; dir++ ) { -#ifdef OMASA_OBJECT_EDITING if ( hMasaIsm->ism_dir_is_edited[dir] ) { vbap_determine_gains( hVBAPdata, direct_response_temp, hMasaIsm->azimuth_ism_edited[dir], hMasaIsm->elevation_ism_edited[dir], 1 ); } -#else - if ( hMasaIsm->ism_is_edited[dir] ) - { - vbap_determine_gains( hVBAPdata, direct_response_temp, hMasaIsm->azimuth_ism_edited[dir], hMasaIsm->elevation_ism_edited[dir], 1 ); - } -#endif else { vbap_determine_gains( hVBAPdata, direct_response_temp, hMasaIsm->azimuth_ism[dir][md_idx], hMasaIsm->elevation_ism[dir][md_idx], 1 ); diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 870fa722a3648ffaf6b157584344309021e7d39e..e5b2210f76f8feeade400c0757aa25e74745e6b0 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -517,9 +517,7 @@ static void TDREND_Clear_Update_flags( for ( i = 0; i < hBinRendererTd->NumOfSrcs; i++ ) { hBinRendererTd->Sources[i]->SrcSpatial_p->Updated = FALSE; -#ifdef OBJ_EDITING_API hBinRendererTd->Sources[i]->SrcRend_p->SrcGainUpdated = FALSE; -#endif } return; @@ -571,12 +569,10 @@ ivas_error TDREND_Update_object_positions( return error; } #endif -#ifdef OBJ_EDITING_INTERFACE if ( ( error = TDREND_MIX_SRC_SetGain( hBinRendererTd, nS, hIsmMetaData[nS]->gain ) ) != IVAS_ERR_OK ) { return error; } -#endif if ( hIsmMetaData[nS]->non_diegetic_flag ) { @@ -812,9 +808,7 @@ ivas_error ivas_td_binaural_renderer_ext( hIsmMetaData[0]->yaw = currentPos->yaw; hIsmMetaData[0]->pitch = currentPos->pitch; hIsmMetaData[0]->radius = currentPos->radius; -#ifdef OBJ_EDITING_INTERFACE hIsmMetaData[0]->gain = 1.0f; -#endif hIsmMetaData[0]->non_diegetic_flag = currentPos->non_diegetic_flag; } diff --git a/lib_rend/ivas_objectRenderer_hrFilt.c b/lib_rend/ivas_objectRenderer_hrFilt.c index 3bc5c52f61bb20844972163799f23aab4d7f45f6..fc677c98e0aca0677f1882611900f538c39b776f 100644 --- a/lib_rend/ivas_objectRenderer_hrFilt.c +++ b/lib_rend/ivas_objectRenderer_hrFilt.c @@ -218,13 +218,8 @@ static void GenerateFilter( ESynL += modelEval->BMEnergiesL[modelEval->UseIndsL[i]].val; ESynR += modelEval->BMEnergiesR[modelEval->UseIndsR[i]].val; } -#ifdef FIX_1166_TDREND_DIV0 ScaleL = sqrtf( ETotL / ( ESynL + EPSILON ) ); ScaleR = sqrtf( ETotR / ( ESynR + EPSILON ) ); -#else - ScaleL = sqrtf( ETotL / ESynL ); - ScaleR = sqrtf( ETotR / ESynR ); -#endif /* Build using only the most energetic components. */ for ( k = model->iSecFirst[iSec]; k <= model->iSecLast[iSec]; k++ ) diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index b3fa269e9412ee520235d24b134fd73342d1c84b..4d3dfcc42ff0b7fa1c3cbeb6654d43446f3fc8e1 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -53,9 +53,7 @@ static void TDREND_SRC_SPATIAL_SetDirAtten( TDREND_SRC_SPATIAL_t *SrcSpatial_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 float Gain ); -#endif static float TDREND_SRC_SPATIAL_GetDirGain( const TDREND_DirAtten_t *DirAtten_p, const float *Front_p, const float *RelPos_p ); @@ -133,7 +131,6 @@ ivas_error TDREND_MIX_SRC_SetDir( } -#ifdef OBJ_EDITING_INTERFACE /*-------------------------------------------------------------------* * TDREND_MIX_SRC_SetGain() * @@ -150,7 +147,6 @@ ivas_error TDREND_MIX_SRC_SetGain( return IVAS_ERR_OK; } -#endif /*-------------------------------------------------------------------* @@ -275,11 +271,7 @@ static void TDREND_SRC_REND_Init( { SrcRend_p->SrcGainMin_p[nC] = 0.0f; SrcRend_p->SrcGain_p[nC] = 1.0f; -#ifdef OBJ_EDITING_API SrcRend_p->SrcGainMax_p[nC] = 2.0f; -#else - SrcRend_p->SrcGainMax_p[nC] = 1.0f; -#endif } SrcRend_p->SrcGainUpdated = FALSE; @@ -559,7 +551,6 @@ static void TDREND_SRC_SPATIAL_SetDistAtten( } -#ifdef OBJ_EDITING_INTERFACE /*-------------------------------------------------------------------* * TDREND_SRC_SPATIAL_SetGain() * @@ -575,7 +566,6 @@ static void TDREND_SRC_SPATIAL_SetGain( return; } -#endif /*-------------------------------------------------------------------* diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index d8517c812cf89d105df3bbfe2c18c39bb1c91b5d..1e9c4df5a06fa4c3572f7a4f228c74632999c196 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -728,13 +728,11 @@ ivas_error TDREND_MIX_SRC_SetDir( const float *Vec_p /* i : Direction vector */ ); -#ifdef OBJ_EDITING_INTERFACE ivas_error TDREND_MIX_SRC_SetGain( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ const int16_t SrcInd, /* i : Source index */ const float Gain /* i : Gain */ ); -#endif ivas_error TDREND_MIX_SRC_SetDirAtten( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ @@ -752,13 +750,11 @@ ivas_error TDREND_MIX_SRC_SetPlayState( const TDREND_PlayStatus_t PlayStatus /* i : Play state */ ); -#ifdef OBJ_EDITING_API ivas_error TDREND_MIX_SRC_SetSrcGain( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ const int16_t SrcInd, /* i : Source index */ const float SrcGain_p /* i : Source gain */ ); -#endif void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index d740eed347e9a4f8b0ce1498e147455472465e5a..740bdb065723850ee4d1c0eba08f3f104d27b801 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2553,9 +2553,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 ( hRendCfg->split_rend_config.rendererSelection == IVAS_BIN_RENDERER_TYPE_FASTCONV ) { @@ -2574,9 +2572,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 ( ( error = initSbaPanGainsForMcOut( inputSba, IVAS_AUDIO_CONFIG_7_1_4, NULL ) ) != IVAS_ERR_OK ) { return error; @@ -6885,19 +6880,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: