From 0c6a51a03392d3faff26947e1af4468347de97a0 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 11 Nov 2024 17:21:56 +0100 Subject: [PATCH 01/10] [cleanup] accept OBJ_EDITING_INTERFACE, OBJ_EDITING_API, OBJ_EDITING_EXAMPLE, OMASA_OBJECT_EDITING, OBJ_EDITING_PARAMISM_BIN --- apps/decoder.c | 44 --- lib_com/common_api_types.h | 4 - lib_com/ivas_cnst.h | 2 - lib_com/ivas_error.h | 4 - lib_com/ivas_ism_com.c | 2 - lib_com/ivas_prot.h | 12 - lib_com/ivas_stat_com.h | 2 - lib_com/options.h | 7 - lib_dec/ivas_dirac_dec.c | 9 - lib_dec/ivas_init_dec.c | 16 - lib_dec/ivas_ism_dec.c | 8 - lib_dec/ivas_ism_param_dec.c | 185 ----------- lib_dec/ivas_ism_renderer.c | 20 -- lib_dec/ivas_jbm_dec.c | 170 ---------- lib_dec/ivas_masa_dec.c | 6 - lib_dec/ivas_mc_param_dec.c | 165 ---------- lib_dec/ivas_objectRenderer_internal.c | 2 - lib_dec/ivas_omasa_dec.c | 90 ------ lib_dec/ivas_osba_dec.c | 2 - lib_dec/ivas_sba_dec.c | 2 - lib_dec/ivas_stat_dec.h | 21 -- lib_dec/lib_dec.c | 202 ------------ lib_dec/lib_dec.h | 14 - lib_rend/ivas_dirac_dec_binaural_functions.c | 317 ------------------- lib_rend/ivas_dirac_output_synthesis_dec.c | 14 - lib_rend/ivas_objectRenderer.c | 6 - lib_rend/ivas_objectRenderer_sources.c | 10 - lib_rend/ivas_prot_rend.h | 4 - 28 files changed, 1340 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index c2c64e6ade..ffeb49748b 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -197,9 +197,7 @@ 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 static void do_object_editing( IVAS_EDITABLE_PARAMETERS *editableParameters ); -#endif /*------------------------------------------------------------------------------------------* @@ -2506,11 +2504,9 @@ static ivas_error decodeG192( #else /* Feed into decoder */ if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, bit_stream, num_bits, bfi -#ifdef OBJ_EDITING_API , isSplitRend, splitRendBits -#endif ) ) != IVAS_ERR_OK ) #endif { @@ -2547,7 +2543,6 @@ static ivas_error decodeG192( } #endif -#ifdef OBJ_EDITING_API /* Object metadata editing */ if ( arg.objEditEnabled ) { @@ -2561,10 +2556,8 @@ static ivas_error decodeG192( } /* Do object metadata editing here ... */ -#ifdef OBJ_EDITING_EXAMPLE do_object_editing( &editableParameters ); -#endif /* set new object parameters */ if ( ( error = IVAS_DEC_SetEditableParameters( hIvasDec, editableParameters ) ) != IVAS_ERR_OK ) { @@ -2580,7 +2573,6 @@ static ivas_error decodeG192( goto cleanup; } } -#endif /* Render */ if ( isSplitRend ) @@ -2596,19 +2588,11 @@ static ivas_error decodeG192( } else { -#ifdef OBJ_EDITING_API if ( ( error = IVAS_DEC_GetSamplesRenderer( hIvasDec, nSamplesToRender, IVAS_DEC_PCM_INT16, (void *) ( pcmBuf + nOutChannels * nSamplesRendered ), &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetSamplesRenderer(): %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#else - if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, IVAS_DEC_PCM_INT16, (void *) ( pcmBuf + nOutChannels * nSamplesRendered ), &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError in IVAS_DEC_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; - } -#endif nSamplesRendered += nSamplesRendered_loop; nSamplesToRender -= nSamplesRendered_loop; @@ -3147,10 +3131,8 @@ static ivas_error decodeVoIP( bool bitstreamReadDone = false; #endif -#ifdef OBJ_EDITING_API bool parameterAvailableForEditing = false; uint16_t nSamplesRendered = 0; -#endif vec_pos_update = 0; if ( ( error = IVAS_DEC_GetRenderFramesizeMs( hIvasDec, &systemTimeInc_ms ) ) != IVAS_ERR_OK ) @@ -3268,9 +3250,7 @@ static ivas_error decodeVoIP( while ( 1 ) { -#ifdef OBJ_EDITING_API nSamplesRendered = 0; -#endif /* reference vector */ if ( arg.enableReferenceVectorTracking && vec_pos_update == 0 ) @@ -3433,37 +3413,19 @@ static ivas_error decodeVoIP( /* decode and get samples */ -#ifdef OBJ_EDITING_API while ( nSamplesRendered < nOutSamples ) { -#endif #ifdef SUPPORT_JBM_TRACEFILE #ifdef FIX_HRTF_LOAD -#ifdef OBJ_EDITING_API if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, ¶meterAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) #else - if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, 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, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &nSamplesRendered, ¶meterAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, systemTime_ms ) ) != IVAS_ERR_OK ) -#endif #endif #else #ifdef FIX_HRTF_LOAD -#ifdef OBJ_EDITING_API if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &bitstreamReadDone, &nSamplesRendered, ¶meterAvailableForEditing, 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 -#else -#ifdef OBJ_EDITING_API if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms, &nSamplesRendered, ¶meterAvailableForEditing ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms ) ) != IVAS_ERR_OK ) -#endif #endif #endif { @@ -3497,7 +3459,6 @@ static ivas_error decodeVoIP( } #endif -#ifdef OBJ_EDITING_API /* Object metadata editing */ if ( arg.objEditEnabled && parameterAvailableForEditing == true ) { @@ -3511,10 +3472,8 @@ static ivas_error decodeVoIP( } /* Do object metadata editing here ... */ -#ifdef OBJ_EDITING_EXAMPLE do_object_editing( &editableParameters ); -#endif /* set new object parameters */ if ( ( error = IVAS_DEC_SetEditableParameters( hIvasDec, editableParameters ) ) != IVAS_ERR_OK ) { @@ -3523,7 +3482,6 @@ static ivas_error decodeVoIP( } } } /* while ( nSamplesRendered < nOutSamples ) */ -#endif /* write JBM Offset file entry */ if ( jbmOffsetWriter != NULL ) @@ -3806,7 +3764,6 @@ cleanup: return error; } -#ifdef OBJ_EDITING_EXAMPLE /*---------------------------------------------------------------------* * do_object_editing() @@ -3859,7 +3816,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 c0123bf7fd..766772dec8 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -128,13 +128,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; @@ -142,7 +139,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 4e6ad47f24..4a56f13237 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1219,11 +1219,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 905be753a5..50b6c2d9bc 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 IVAS_ERR_INVALID_HRTF, IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA, IVAS_ERR_INVALID_INPUT_FORMAT, @@ -257,10 +255,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 case IVAS_ERR_INVALID_HRTF: return "Unsupported HRTF filter set"; case IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA: diff --git a/lib_com/ivas_ism_com.c b/lib_com/ivas_ism_com.c index 99131d5e0f..82aec26acc 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 847cb924f4..f1f3ddf218 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -821,11 +821,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 */ @@ -1113,7 +1111,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 */ ); @@ -1122,7 +1119,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 */ @@ -3880,12 +3876,10 @@ void ivas_param_mc_dec_digest_tc( float *transport_channels_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 the transport channels */ ); -#endif void ivas_param_mc_dec_render( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ @@ -5625,7 +5619,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 */ @@ -5635,7 +5628,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 */ ); -#endif void ivas_osba_data_close( SBA_ISM_DATA_HANDLE *hSbaIsmData /* i/o: OSBA rendering handle */ @@ -5824,11 +5816,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 594e30ff26..aa3720a1f0 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 b82706a7eb..89c48d5a52 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -154,15 +154,8 @@ /* ################## Start DEVELOPMENT switches ######################### */ -#define OBJ_EDITING_INTERFACE /* Interface for object editing */ -#ifdef OBJ_EDITING_INTERFACE -#define OBJ_EDITING_API /* object editing changes related to the API */ #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 */ -#endif /* ################### Start BE switches ################################# */ /* only BE switches wrt selection floating point code */ diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index f28378698f..274ad432dd 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1839,17 +1839,10 @@ void ivas_dirac_dec_render_sf( } } -#ifdef OMASA_OBJECT_EDITING if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { ivas_omasa_preProcessStereoTransportsForEditedObjects( st_ivas, Cldfb_RealBuffer_Temp, Cldfb_ImagBuffer_Temp, hSpatParamRendCom->num_freq_bands, subframe_idx ); } -#else - if ( 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_Temp, Cldfb_ImagBuffer_Temp, hSpatParamRendCom->num_freq_bands, subframe_idx ); - } -#endif } for ( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[subframe_idx]; slot_idx++ ) @@ -2258,9 +2251,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 0984693976..36c1abf31c 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1580,7 +1580,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) */ @@ -1589,7 +1588,6 @@ ivas_error ivas_init_decoder( return error; } } -#endif } else if ( st_ivas->ism_mode == ISM_MODE_DISC ) { @@ -1907,24 +1905,10 @@ ivas_error ivas_init_decoder( reset_indices_dec( st_ivas->hSCE[0]->hCoreCoder[0] ); -#ifndef OMASA_OBJECT_EDITING - if ( hDecoderConfig->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, 1, NULL ) ) != IVAS_ERR_OK ) - { - return error; - } - } -#endif } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index bd0e7075e6..69a6c832d8 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -204,11 +204,9 @@ 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 ) { @@ -241,10 +239,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->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) @@ -278,13 +274,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 ); @@ -313,13 +307,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 ), ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ); diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index db93983e59..a751903bd4 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -740,23 +740,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 || @@ -772,9 +763,7 @@ 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 || @@ -783,9 +772,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 } } } @@ -807,21 +794,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; @@ -836,101 +811,8 @@ 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*/ @@ -951,23 +833,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(); @@ -975,7 +843,6 @@ void ivas_param_ism_dec_digest_tc( } -#ifdef OBJ_EDITING_API /*-------------------------------------------------------------------------* * ivas_param_ism_dec_dequant_md() * @@ -1061,11 +928,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 @@ -1132,7 +995,6 @@ void ivas_param_ism_dec_prepare_renderer( return; } -#endif /*-------------------------------------------------------------------------* @@ -1373,7 +1235,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; @@ -1383,18 +1244,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 } } @@ -1422,37 +1271,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 ) { float energy_ratio; @@ -1484,22 +1311,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++ ) @@ -1526,7 +1343,6 @@ void ivas_param_ism_params_to_masa_param_mapping( } } -#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++ ) @@ -1563,7 +1379,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 4e4fb628a4..c9a6dcb65a 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -233,27 +233,17 @@ 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 } } @@ -536,7 +526,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]; @@ -547,14 +536,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]; @@ -565,10 +549,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 f096ff4116..870337b9b8 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -151,9 +151,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 ) { @@ -162,9 +160,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 */ { @@ -818,165 +814,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 ) { /* 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 ) { 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 ); - } - if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - 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 ) @@ -984,7 +832,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; @@ -1249,16 +1096,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 - { - for ( n = 0; n < nchan_out; n++ ) - { - v_add( p_output[n], p_tc[n + st_ivas->nchan_ism], p_output[n], *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 ) { @@ -2981,7 +2819,6 @@ void ivas_jbm_masa_sf_to_sf_map( } -#ifdef OBJ_EDITING_API /*--------------------------------------------------------------------------* * ivas_dec_prepare_renderer() * @@ -3115,7 +2952,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; @@ -3125,9 +2961,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 } if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) @@ -3135,7 +2968,6 @@ void ivas_dec_prepare_renderer( delay_signal( st_ivas->hTcBuffer->tc[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available, st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size ); } } -#ifdef OMASA_OBJECT_EDITING if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) { @@ -3150,7 +2982,6 @@ void ivas_dec_prepare_renderer( } } } -#endif } } } @@ -3177,4 +3008,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 26732a868b..62a664caf9 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -650,11 +650,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 ); @@ -2443,9 +2439,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 59d3c1cb79..3279c8fb86 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -1327,107 +1327,21 @@ 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 - { - 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 ) { -#if !defined( 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]; @@ -1439,93 +1353,15 @@ void ivas_param_mc_dec_digest_tc( 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 ); } -#if !defined( 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 ( is_next_band && skip_next_band ) - { - continue; - } - /* 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++ ) - { - real_part = pCx[i]; - imag_part = pCx_imag[i]; - - /* (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; - } - } - } - - /* 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() * @@ -1700,7 +1536,6 @@ void ivas_param_mc_dec_prepare_renderer( return; } -#endif /*------------------------------------------------------------------------- diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 0e6c1025df..5785db4851 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -183,7 +183,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]; @@ -207,7 +206,6 @@ ivas_error ivas_td_binaural_renderer_sf( } } else -#endif { if ( ( error = TDREND_Update_object_positions( st_ivas->hBinRendererTd, nchan_ism, st_ivas->ivas_format, st_ivas->hIsmMetaData ) ) != IVAS_ERR_OK ) { diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 439a6baba1..d8a71cf589 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -60,11 +60,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 ) @@ -72,7 +68,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++ ) @@ -88,39 +83,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++ ) { @@ -229,11 +202,7 @@ ivas_error ivas_omasa_dec_config( #endif ) { -#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; @@ -329,7 +298,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 ) @@ -344,58 +312,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; @@ -781,7 +697,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 */ @@ -793,7 +708,6 @@ void ivas_omasa_dirac_rend_jbm( } } } -#endif } else { @@ -801,16 +715,13 @@ void ivas_omasa_dirac_rend_jbm( { 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 ) { @@ -819,7 +730,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 bb5f547beb..18493968bf 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -302,7 +302,6 @@ ivas_error ivas_osba_render_sf( } -#ifdef OBJ_EDITING_API /*-------------------------------------------------------------------------* * ivas_osba_stereo_add_channels() * @@ -352,4 +351,3 @@ void ivas_osba_stereo_add_channels( return; } -#endif diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 0f3dfba4c0..4f6e8a0587 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -809,7 +809,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; @@ -825,7 +824,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 9ed05b1ae2..787802f9e7 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; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 66d70060c8..3d9b616e5b 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -35,9 +35,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" @@ -99,12 +97,10 @@ struct IVAS_DEC int16_t prev_ft_speech; /* RXDTX handler: previous frametype flag for G.192 format AMRWB SID_FIRST detection */ int16_t CNG; /* RXDTX handler: CNG=1, nonCNG=0 */ -#ifdef OBJ_EDITING_API uint16_t nSamplesFlushed; void *flushbuffer; IVAS_DEC_PCM_TYPE pcmType; bool hasBeenPreparedRendering; -#endif }; @@ -186,12 +182,10 @@ ivas_error IVAS_DEC_Open( hIvasDec->hasDecodedFirstGoodFrame = false; hIvasDec->isInitialized = false; hIvasDec->updateOrientation = false; -#ifdef OBJ_EDITING_API hIvasDec->flushbuffer = NULL; hIvasDec->pcmType = IVAS_DEC_PCM_INVALID; hIvasDec->nSamplesFlushed = 0; hIvasDec->hasBeenPreparedRendering = false; -#endif hIvasDec->mode = mode; @@ -369,12 +363,10 @@ void IVAS_DEC_Close( free( ( *phIvasDec )->apaExecBuffer ); } -#ifdef OBJ_EDITING_API if ( ( *phIvasDec )->flushbuffer != NULL ) { free( ( *phIvasDec )->flushbuffer ); } -#endif free( *phIvasDec ); *phIvasDec = NULL; @@ -547,7 +539,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 ) ) { @@ -559,7 +550,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 return IVAS_ERR_OK; } @@ -814,7 +804,6 @@ ivas_error IVAS_DEC_EnableVoIP( return IVAS_ERR_FAILED_ALLOC; } -#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 ) ) { @@ -822,7 +811,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 return IVAS_ERR_OK; } @@ -841,13 +829,9 @@ ivas_error IVAS_DEC_FeedFrame_Serial( #ifdef FIX_HRTF_LOAD int16_t bfi /* i : bad frame indicator flag */ #else -#ifdef OBJ_EDITING_API int16_t bfi, /* i : bad frame indicator flag */ const int16_t isSplitRend, /* i : split rendering enabled flag */ ISAR_SPLIT_REND_BITS_DATA *splitRendBits /* o : output split rendering bits */ -#else - int16_t bfi /* i : bad frame indicator flag */ -#endif #endif ) { @@ -926,14 +910,12 @@ ivas_error IVAS_DEC_FeedFrame_Serial( hIvasDec->nSamplesAvailableNext = hIvasDec->nSamplesFrame; #ifndef FIX_HRTF_LOAD -#ifdef OBJ_EDITING_API /* Decode TCs, do TSM and feed to renderer */; if ( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, isSplitRend, splitRendBits ) ) != IVAS_ERR_OK ) { return error; } -#endif #endif return IVAS_ERR_OK; } @@ -1076,7 +1058,6 @@ ivas_error IVAS_DEC_ReadFormat( } #endif -#if ( defined FIX_HRTF_LOAD || defined OBJ_EDITING_API ) /*---------------------------------------------------------------------* * IVAS_DEC_GetSamplesDecoder( ) @@ -1183,18 +1164,13 @@ ivas_error IVAS_DEC_GetSamplesDecoder( hIvasDec->hasBeenFedFrame = false; } -#ifdef OBJ_EDITING_API hIvasDec->hasBeenPreparedRendering = false; if ( hIvasDec->st_ivas->hIsmMetaData[0] ) { 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; @@ -1229,14 +1205,11 @@ ivas_error IVAS_DEC_GetSamplesDecoder( } } } -#endif return IVAS_ERR_OK; } -#endif -#ifdef OBJ_EDITING_API /*---------------------------------------------------------------------* * IVAS_DEC_GetEditableParameters( ) * @@ -1320,7 +1293,6 @@ ivas_error IVAS_DEC_GetEditableParameters( } #endif } -#ifdef OMASA_OBJECT_EDITING else if ( hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT && ( hIvasDec->st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || hIvasDec->st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) { /* object editing possible only in two highest OMASA modes */ @@ -1368,7 +1340,6 @@ ivas_error IVAS_DEC_GetEditableParameters( } } } -#endif return IVAS_ERR_OK; } @@ -1443,7 +1414,6 @@ ivas_error IVAS_DEC_SetEditableParameters( { for ( obj = 0; obj < hIvasEditableParameters.num_obj; obj++ ) { -#ifdef OBJ_EDITING_PARAMISM_BIN hIvasDec->st_ivas->hParamIsmDec->edited_azimuth_values[obj] = hIvasEditableParameters.ism_metadata[obj].azimuth; hIvasDec->st_ivas->hParamIsmDec->edited_elevation_values[obj] = hIvasEditableParameters.ism_metadata[obj].elevation; hIvasDec->st_ivas->hMasaIsmData->gain_ism_edited[obj] = hIvasEditableParameters.ism_metadata[obj].gain; @@ -1468,13 +1438,10 @@ ivas_error IVAS_DEC_SetEditableParameters( { hIvasDec->st_ivas->hMasaIsmData->ism_gain_is_edited[obj] = 0u; } -#endif } -#ifdef OBJ_EDITING_PARAMISM_BIN /* MASA is not present with the ISM format */ hIvasDec->st_ivas->hMasaIsmData->masa_gain_is_edited = 0u; -#endif } else if ( hIvasDec->st_ivas->ism_mode == ISM_MODE_NONE ) { @@ -1488,7 +1455,6 @@ ivas_error IVAS_DEC_SetEditableParameters( assert( 0 && "This should never happen!" ); } } -#ifdef OMASA_OBJECT_EDITING else if ( hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT && ( hIvasDec->st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || hIvasDec->st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) { int16_t id_th; @@ -1606,7 +1572,6 @@ ivas_error IVAS_DEC_SetEditableParameters( hIvasDec->st_ivas->hMasaIsmData->masa_gain_is_edited = 0u; } } -#endif return IVAS_ERR_OK; } @@ -1633,9 +1598,7 @@ ivas_error IVAS_DEC_PrepareRenderer( return IVAS_ERR_OK; } -#endif -#ifdef OBJ_EDITING_API /*---------------------------------------------------------------------* * IVAS_DEC_GetSamplesRenderer( ) @@ -1644,16 +1607,6 @@ ivas_error IVAS_DEC_PrepareRenderer( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetSamplesRenderer( -#else -/*---------------------------------------------------------------------* - * IVAS_DEC_GetSamples( ) - * - * Main function to decode to PCM data - *---------------------------------------------------------------------*/ - - -ivas_error IVAS_DEC_GetSamples( -#endif IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const int16_t nSamplesAsked, /* i : number of samples wanted by the caller */ const IVAS_DEC_PCM_TYPE pcmType, /* i : type for the decoded PCM resolution */ @@ -1663,36 +1616,24 @@ ivas_error IVAS_DEC_GetSamples( ) { ivas_error error; -#ifdef OBJ_EDITING_API int16_t nSamplesToRender; 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 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 if ( hIvasDec->updateOrientation ) { @@ -1742,83 +1683,6 @@ 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, &nOutChannels, &nSamplesRendered_loop, pcmType, pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ) ) ) != IVAS_ERR_OK ) - - { - return error; - } - } -#endif -#ifndef OBJ_EDITING_API - { - /* check if we need to run the setup function, tc decoding and feeding the renderer */ - 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; - } - - 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 */ @@ -1846,7 +1710,6 @@ ivas_error IVAS_DEC_GetSamples( nSamplesRendered += hIvasDec->nSamplesFlushed; hIvasDec->nSamplesFlushed = 0; } -#endif /* render IVAS frames directly to the output buffer */ nSamplesToRender = nSamplesAsked - nSamplesRendered; @@ -1866,9 +1729,6 @@ ivas_error IVAS_DEC_GetSamples( { *needNewFrame = false; } -#ifndef OBJ_EDITING_API - } -#endif } *nOutSamples = nSamplesRendered; @@ -1925,16 +1785,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 ) { @@ -1946,7 +1798,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 || @@ -1978,19 +1829,11 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( } } -#ifdef OBJ_EDITING_API /* render */ if ( ( error = IVAS_DEC_GetSamplesRenderer( hIvasDec, numSamplesPerChannelToDecode, IVAS_DEC_PCM_FLOAT, pcmBuf, nOutSamples, needNewFrame ) ) != IVAS_ERR_OK ) { return error; } -#else - /* Decode and render */ - if ( ( error = IVAS_DEC_GetSamples( hIvasDec, numSamplesPerChannelToDecode, IVAS_DEC_PCM_FLOAT, pcmBuf, nOutSamples, needNewFrame ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif /* change buffer layout */ for ( i = 0; i < numSamplesPerChannelToDecode; ++i ) @@ -2556,7 +2399,6 @@ ivas_error IVAS_DEC_GetObjectMetadata( } else { -#ifdef OBJ_EDITING_API if ( st_ivas->ism_mode == ISM_MODE_DISC ) { metadata->azimuth = hIsmMeta->edited_azimuth; @@ -2593,7 +2435,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; @@ -3659,10 +3500,8 @@ ivas_error IVAS_DEC_VoIP_GetSamples( #ifdef FIX_HRTF_LOAD bool *bitstreamReadDone, /* o : flag indicating that bitstream was read */ #endif -#ifdef OBJ_EDITING_API uint16_t *nSamplesRendered, /* o : number of samples rendered */ bool *parametersAvailableForEditing, /* o : indicates whether objects editing is available */ -#endif const uint32_t systemTimestamp_ms /* i : current system timestamp */ ) { @@ -3674,9 +3513,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( uint16_t extBufferedSamples; int16_t result; ivas_error error; -#ifndef OBJ_EDITING_API - int16_t nSamplesRendered; -#endif uint8_t nOutChannels; if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->hVoIP == NULL ) @@ -3688,12 +3524,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( hDecoderConfig = st_ivas->hDecoderConfig; hVoIP = hIvasDec->hVoIP; nOutChannels = (uint8_t) st_ivas->hDecoderConfig->nchan_out; -#ifndef OBJ_EDITING_API - nSamplesRendered = 0; -#endif -#ifdef OBJ_EDITING_API *parametersAvailableForEditing = false; -#endif if ( nSamplesPerChannel == 0 ) { @@ -3709,11 +3540,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( #endif /* make sure that the FIFO after decoder/scaler contains at least one sound card frame (i.e. 20ms) */ -#ifdef OBJ_EDITING_API while ( *nSamplesRendered < nSamplesPerChannel ) -#else - while ( nSamplesRendered < nSamplesPerChannel ) -#endif { if ( hIvasDec->nSamplesAvailableNext == 0 ) { @@ -3781,11 +3608,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( #ifdef FIX_HRTF_LOAD if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, hIvasDec->hVoIP->bs_conversion_buf, dataUnit->dataSize, 0 ) ) != IVAS_ERR_OK ) #else -#ifdef OBJ_EDITING_API if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, hIvasDec->hVoIP->bs_conversion_buf, dataUnit->dataSize, 0, 0, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, hIvasDec->hVoIP->bs_conversion_buf, dataUnit->dataSize, 0 ) ) != IVAS_ERR_OK ) -#endif #endif { return error; @@ -3801,11 +3624,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( #ifdef FIX_HRTF_LOAD if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, hIvasDec->hVoIP->bs_conversion_buf, 0, 1 ) ) != IVAS_ERR_OK ) #else -#ifdef OBJ_EDITING_API if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, hIvasDec->hVoIP->bs_conversion_buf, 0, 1, 0, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, hIvasDec->hVoIP->bs_conversion_buf, 0, 1 ) ) != IVAS_ERR_OK ) -#endif #endif { return error; @@ -3854,13 +3673,11 @@ ivas_error IVAS_DEC_VoIP_GetSamples( hIvasDec->nSamplesRendered = 0; } -#ifdef OBJ_EDITING_API if ( hIvasDec->hasBeenFedFirstGoodFrame ) { *parametersAvailableForEditing = true; return IVAS_ERR_OK; } -#endif } /* decode */ @@ -3869,13 +3686,8 @@ ivas_error IVAS_DEC_VoIP_GetSamples( /* codec mode to use not known yet - simply output silence */ /* directly set output zero */ int16_t nSamplesToZero = min( nSamplesPerChannel, hIvasDec->nSamplesAvailableNext ); -#ifdef OBJ_EDITING_API set_pcm_buffer_to_zero( pcm_buffer_offset( pcmBuf, pcmType, ( *nSamplesRendered ) * nOutChannels ), pcmType, nSamplesToZero * nOutChannels ); *nSamplesRendered += nSamplesToZero; -#else - set_pcm_buffer_to_zero( pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ), pcmType, nSamplesToZero * nOutChannels ); - nSamplesRendered += nSamplesToZero; -#endif hIvasDec->nSamplesRendered += nSamplesToZero; hIvasDec->nSamplesAvailableNext -= nSamplesToZero; @@ -3906,13 +3718,8 @@ ivas_error IVAS_DEC_VoIP_GetSamples( } #endif -#ifdef OBJ_EDITING_API nSamplesToRender = nSamplesPerChannel - *nSamplesRendered; -#else - nSamplesToRender = nSamplesPerChannel - nSamplesRendered; -#endif -#ifdef OBJ_EDITING_API /* check if we still need to prepare the renderer */ if ( hIvasDec->hasBeenPreparedRendering == false ) { @@ -3921,23 +3728,14 @@ ivas_error IVAS_DEC_VoIP_GetSamples( return error; } } -#endif /* render IVAS frames directly to the output buffer */ -#ifdef OBJ_EDITING_API if ( ( error = IVAS_DEC_GetSamplesRenderer( hIvasDec, nSamplesToRender, pcmType, pcm_buffer_offset( pcmBuf, pcmType, *nSamplesRendered * nOutChannels ), &nSamplesRendered_loop, &tmp ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, pcmType, pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ), &nSamplesRendered_loop, &tmp ) ) != IVAS_ERR_OK ) -#endif { return error; } -#ifdef OBJ_EDITING_API *nSamplesRendered += nSamplesRendered_loop; -#else - nSamplesRendered += nSamplesRendered_loop; -#endif update_voip_rendered20ms( hIvasDec, nSamplesRendered_loop ); } } diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index fb5cee39fa..be272e48f8 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -155,13 +155,9 @@ ivas_error IVAS_DEC_FeedFrame_Serial( #ifdef FIX_HRTF_LOAD int16_t bfi /* i : bad frame indicator flag */ #else -#ifdef OBJ_EDITING_API int16_t bfi, /* i : bad frame indicator flag */ const int16_t isSplitRend, /* i : split rendering enabled flag */ ISAR_SPLIT_REND_BITS_DATA *splitRendBits /* o : output split rendering bits */ -#else - int16_t bfi /* i : bad frame indicator flag */ -#endif #endif ); @@ -175,7 +171,6 @@ ivas_error IVAS_DEC_ReadFormat( ); #endif -#if( defined FIX_HRTF_LOAD || defined OBJ_EDITING_API) /*! r: decoder error code */ ivas_error IVAS_DEC_GetSamplesDecoder( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ @@ -183,8 +178,6 @@ ivas_error IVAS_DEC_GetSamplesDecoder( ISAR_SPLIT_REND_BITS_DATA *splitRendBits /* o : output split rendering bits */ ); -#endif -#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 */ @@ -198,14 +191,9 @@ ivas_error IVAS_DEC_SetEditableParameters( ivas_error IVAS_DEC_PrepareRenderer( IVAS_DEC_HANDLE hIvasDec ); -#endif /*! r: decoder error code */ -#ifdef OBJ_EDITING_API ivas_error IVAS_DEC_GetSamplesRenderer( -#else -ivas_error IVAS_DEC_GetSamples( -#endif IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const int16_t nSamplesAsked, /* i : number of samples wanted by the caller */ const IVAS_DEC_PCM_TYPE pcmType, /* i : type for the decoded PCM resolution */ @@ -337,10 +325,8 @@ ivas_error IVAS_DEC_VoIP_GetSamples( #ifdef FIX_HRTF_LOAD bool *bitstreamReadDone, /* o : flag indicating that bitstream was read */ #endif -#ifdef OBJ_EDITING_API uint16_t *nSamplesRendered, /* o : number of samples rendered */ bool *parametersAvailableForEditing, /* o : indicates whether objects editing is available */ -#endif const uint32_t systemTimestamp_ms /* i : current system timestamp */ ); diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 19b08dbe81..00e4d10968 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -755,21 +755,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 ) { @@ -1247,19 +1236,11 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( 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]; @@ -1693,7 +1674,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]; @@ -1704,14 +1684,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]; @@ -1722,10 +1697,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; } } @@ -2500,7 +2471,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 ) @@ -2546,40 +2516,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 */ { @@ -2733,7 +2669,6 @@ float configure_reqularization_factor( } -#ifdef OMASA_OBJECT_EDITING /*-------------------------------------------------------------------* * ivas_omasa_preProcessStereoTransportsForEditedObjects() * @@ -2750,9 +2685,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; @@ -2763,13 +2696,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 ) @@ -2780,7 +2710,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 ) { @@ -2791,11 +2720,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; } @@ -2872,7 +2797,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; @@ -2980,7 +2904,6 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( } } } -#endif else /* Other processing modes */ { float subframeEne; @@ -3060,15 +2983,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 { @@ -3077,7 +2997,6 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( max_band++; } } -#endif /* Init out array */ for ( int k = 0; k < nSlots; k++ ) @@ -3101,20 +3020,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++ ) @@ -3188,10 +3103,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; @@ -3213,9 +3126,7 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( } ratioAccNew += ratio; -#ifdef OBJ_EDITING_PARAMISM_BIN } -#endif /* Limit target energies to non-negative values */ #ifdef NONBE_FIX_1197_OMASA_META_BUFFER @@ -3388,7 +3299,6 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( } } -#ifdef OBJ_EDITING_PARAMISM_BIN if ( !masaIsmMode ) { int16_t obj_idx1, obj_idx2; @@ -3408,237 +3318,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( diff --git a/lib_rend/ivas_dirac_output_synthesis_dec.c b/lib_rend/ivas_dirac_output_synthesis_dec.c index 0bfd43ddd8..9aafded8f3 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 4b1c5764b7..43bfe3c7a9 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -503,9 +503,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; @@ -553,12 +551,10 @@ ivas_error TDREND_Update_object_positions( return error; } -#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 ) { @@ -784,9 +780,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_sources.c b/lib_rend/ivas_objectRenderer_sources.c index 6079f93b5b..27c7801ad1 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 b3a826e71e..612f2656f4 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -720,13 +720,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 */ @@ -744,13 +742,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 */ -- GitLab From d7d7ab8aeb85caa9b39cc81189f925e477d46e84 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 11 Nov 2024 17:23:30 +0100 Subject: [PATCH 02/10] [cleanup] accept FIX_587_DEFAULT_REVERB --- apps/decoder.c | 3 --- apps/renderer.c | 3 --- lib_com/common_api_types.h | 3 --- lib_com/options.h | 1 - lib_dec/ivas_binRenderer_internal.c | 18 ------------- lib_dec/lib_dec.c | 6 ----- lib_rend/ivas_dirac_dec_binaural_functions.c | 22 --------------- lib_rend/ivas_render_config.c | 3 --- lib_rend/ivas_reverb.c | 7 ----- lib_rend/lib_rend.c | 28 -------------------- 10 files changed, 94 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index ffeb49748b..59dda20d12 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -698,9 +698,6 @@ int main( fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", aeID ); goto cleanup; } -#ifndef FIX_587_DEFAULT_REVERB - renderConfig.roomAcoustics.override = true; -#endif } /* ISAR frame size is set from command line, not renderer config file. diff --git a/apps/renderer.c b/apps/renderer.c index 767d4bb60d..9f3be788ea 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1052,9 +1052,6 @@ int main( fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", aeID ); exit( -1 ); } -#ifndef FIX_587_DEFAULT_REVERB - renderConfig.roomAcoustics.override = 1; -#endif } /* ISAR frame size is set from command line, not renderer config file. diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 766772dec8..4a9ca4665e 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -327,9 +327,6 @@ typedef enum typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG { -#ifndef FIX_587_DEFAULT_REVERB - int16_t override; -#endif int16_t nBands; /* Number of frequency bands for which reverb properties are provided, integer, range [2..256] */ float pFc_input[IVAS_CLDFB_NO_CHANNELS_MAX]; /* Center frequencies for which following values are provided: */ float pAcoustic_rt60[IVAS_CLDFB_NO_CHANNELS_MAX]; /* - The room's T60 per center frequency */ diff --git a/lib_com/options.h b/lib_com/options.h index 89c48d5a52..d66f1003a1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ -#define FIX_587_DEFAULT_REVERB /* Philips: issue 587: inconsistent default reverb parameters across renderers */ #define FIX_HRTF_LOAD /* VA: issue 1187: fix memory issue when HRTFs are loaded from a binary file */ #define FIX_1209_SID_SIGNALING /* VA: issue 1209: remove dead code in IVAS SID signaling */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 269c6bff98..e8a0e996c6 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1075,9 +1075,7 @@ ivas_error ivas_binRenderer_open( BINAURAL_RENDERER_HANDLE hBinRenderer; int16_t convBand, k; ivas_error error; -#ifdef FIX_587_DEFAULT_REVERB const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics; -#endif error = IVAS_ERR_OK; @@ -1224,7 +1222,6 @@ ivas_error ivas_binRenderer_open( /* Allocate memories needed for reverb module */ if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { -#ifdef FIX_587_DEFAULT_REVERB pRoomAcoustics = ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ? &( st_ivas->hRenderConfig->roomAcoustics ) : NULL; if ( ( error = ivas_binaural_reverb_init( &( hBinRenderer->hReverb ), st_ivas->hHrtfStatistics, @@ -1239,21 +1236,6 @@ ivas_error ivas_binRenderer_open( hBinRenderer->earlyPartEneCorrection #endif ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_binaural_reverb_init( &( hBinRenderer->hReverb ), - st_ivas->hHrtfStatistics, - hBinRenderer->conv_band, - hBinRenderer->timeSlots, - &( st_ivas->hRenderConfig->roomAcoustics ), - st_ivas->hDecoderConfig->output_Fs, - st_ivas->hHrtfFastConv->fastconvReverberationTimes, - st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 - , - hBinRenderer->earlyPartEneCorrection -#endif - ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 3d9b616e5b..d46f569feb 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2961,9 +2961,6 @@ static ivas_error copyRendererConfigStruct( hRCout->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_NONE; break; } -#endif -#ifndef FIX_587_DEFAULT_REVERB - hRCout->roomAcoustics.override = hRCin->roomAcoustics.override; #endif hRCout->roomAcoustics.nBands = hRCin->roomAcoustics.nBands; hRCout->roomAcoustics.acousticPreDelay = hRCin->roomAcoustics.acousticPreDelay; @@ -3058,9 +3055,6 @@ ivas_error IVAS_DEC_FeedRenderConfig( { hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_CREND; } -#endif -#ifndef FIX_587_DEFAULT_REVERB - hRenderConfig->roomAcoustics.override = renderConfig.roomAcoustics.override; #endif hRenderConfig->roomAcoustics.nBands = renderConfig.roomAcoustics.nBands; hRenderConfig->roomAcoustics.acousticPreDelay = renderConfig.roomAcoustics.acousticPreDelay; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 00e4d10968..f6ceba8a3d 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -143,9 +143,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( ivas_error error; float frequency_axis[CLDFB_NO_CHANNELS_MAX]; int16_t num_poses, pos_idx; -#ifdef FIX_587_DEFAULT_REVERB const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics; -#endif num_poses = 1; if ( st_ivas->hSplitBinRend != NULL ) @@ -223,16 +221,12 @@ ivas_error ivas_dirac_dec_init_binaural_data( if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#ifdef FIX_587_DEFAULT_REVERB pRoomAcoustics = NULL; -#endif } else { set_f( hDiracDecBin->earlyPartEneCorrection, 1.0f, CLDFB_NO_CHANNELS_MAX ); -#ifdef FIX_587_DEFAULT_REVERB pRoomAcoustics = &( st_ivas->hRenderConfig->roomAcoustics ); -#endif } /* reconfiguration needed when Reverb. parameters are changed -> close and open the handle again */ @@ -244,7 +238,6 @@ ivas_error ivas_dirac_dec_init_binaural_data( if ( hDiracDecBin->hReverb == NULL && pos_idx == 0 ) /* open reverb only for the main direction */ { -#ifdef FIX_587_DEFAULT_REVERB if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, @@ -258,21 +251,6 @@ ivas_error ivas_dirac_dec_init_binaural_data( hDiracDecBin->earlyPartEneCorrection #endif ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, - st_ivas->hHrtfStatistics, - nBins, - CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, - &( st_ivas->hRenderConfig->roomAcoustics ), - output_Fs, - ( *phHrtfParambin )->parametricReverberationTimes, - ( *phHrtfParambin )->parametricReverberationEneCorrections -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 - , - hDiracDecBin->earlyPartEneCorrection -#endif - ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_rend/ivas_render_config.c b/lib_rend/ivas_render_config.c index 950e9ee8bf..cc03379e9f 100644 --- a/lib_rend/ivas_render_config.c +++ b/lib_rend/ivas_render_config.c @@ -112,9 +112,6 @@ ivas_error ivas_render_config_init_from_rom( #ifdef DEBUGGING ( *hRenderConfig )->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_NONE; -#endif -#ifndef FIX_587_DEFAULT_REVERB - ( *hRenderConfig )->roomAcoustics.override = FALSE; #endif ( *hRenderConfig )->roomAcoustics.nBands = IVAS_REVERB_DEFAULT_N_BANDS; ( *hRenderConfig )->roomAcoustics.acousticPreDelay = IVAS_REVERB_DEFAULT_PRE_DELAY; diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index bc3bd4c605..484cb43bb0 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -1132,9 +1132,6 @@ ivas_error ivas_reverb_open( /* set reverb acoustic configuration based on renderer config */ #ifdef DEBUGGING pState->pConfig.renderer_type_override = hRenderConfig->renderer_type_override; -#endif -#ifndef FIX_587_DEFAULT_REVERB - pState->pConfig.roomAcoustics.override = hRenderConfig->roomAcoustics.override; #endif pState->pConfig.roomAcoustics.nBands = hRenderConfig->roomAcoustics.nBands; @@ -1902,11 +1899,7 @@ ivas_error ivas_binaural_reverb_init( error = IVAS_ERR_OK; -#ifdef FIX_587_DEFAULT_REVERB if ( roomAcoustics != NULL ) -#else - if ( ( roomAcoustics != NULL ) && roomAcoustics->override ) -#endif { #ifndef FIX_1139_REV_COLORATION_SHORT_T60 revTimes = t60; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 1d16f0d2f0..2ca20ede50 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4206,9 +4206,6 @@ ivas_error IVAS_REND_GetRenderConfig( hRCout->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_NONE; break; } -#endif -#ifndef FIX_587_DEFAULT_REVERB - hRCout->roomAcoustics.override = hRCin->roomAcoustics.override; #endif hRCout->roomAcoustics.nBands = hRCin->roomAcoustics.nBands; hRCout->roomAcoustics.acousticPreDelay = hRCin->roomAcoustics.acousticPreDelay; @@ -4265,9 +4262,6 @@ ivas_error IVAS_REND_FeedRenderConfig( hRenderConfig = hIvasRend->hRendererConfig; #ifdef DEBUGGING hRenderConfig->renderer_type_override = renderConfig.renderer_type_override; -#endif -#ifndef FIX_587_DEFAULT_REVERB - hRenderConfig->roomAcoustics.override = renderConfig.roomAcoustics.override; #endif hRenderConfig->roomAcoustics.nBands = renderConfig.roomAcoustics.nBands; hRenderConfig->roomAcoustics.acousticPreDelay = renderConfig.roomAcoustics.acousticPreDelay; @@ -8360,9 +8354,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( ivas_error error; float frequency_axis[CLDFB_NO_CHANNELS_MAX]; int16_t pos_idx; -#ifdef FIX_587_DEFAULT_REVERB const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics; -#endif error = IVAS_ERR_OK; @@ -8441,21 +8433,16 @@ static ivas_error ivas_masa_ext_rend_parambin_init( if ( *inputMasa->base.ctx.pOutConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#ifdef FIX_587_DEFAULT_REVERB pRoomAcoustics = NULL; -#endif } else { set_f( hDiracDecBin->earlyPartEneCorrection, 1.0f, CLDFB_NO_CHANNELS_MAX ); -#ifdef FIX_587_DEFAULT_REVERB pRoomAcoustics = &( hRendCfg->roomAcoustics ); -#endif } if ( hDiracDecBin->hReverb == NULL && pos_idx == 0 ) /* open reverb only for the main direction */ { -#ifdef FIX_587_DEFAULT_REVERB if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, @@ -8469,21 +8456,6 @@ static ivas_error ivas_masa_ext_rend_parambin_init( hDiracDecBin->earlyPartEneCorrection #endif ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, - hHrtfStatistics, - nBins, - CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, - &( hRendCfg->roomAcoustics ), - output_Fs, - ( *phHrtfParambin )->parametricReverberationTimes, - ( *phHrtfParambin )->parametricReverberationEneCorrections -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 - , - hDiracDecBin->earlyPartEneCorrection -#endif - ) ) != IVAS_ERR_OK ) -#endif { return error; } -- GitLab From af5df438bc8f30afb20f9cd7d6e3730f4b4098bf Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 11 Nov 2024 17:24:22 +0100 Subject: [PATCH 03/10] [cleanup] accept FIX_HRTF_LOAD --- apps/decoder.c | 166 ------------------------- apps/renderer.c | 8 -- lib_com/common_api_types.h | 17 --- lib_com/ivas_prot.h | 38 ------ lib_com/options.h | 1 - lib_dec/ivas_binRenderer_internal.c | 2 - lib_dec/ivas_init_dec.c | 78 ------------ lib_dec/ivas_ism_dec.c | 63 ---------- lib_dec/ivas_masa_dec.c | 29 ----- lib_dec/ivas_mct_dec.c | 45 ------- lib_dec/ivas_objectRenderer_internal.c | 2 - lib_dec/ivas_omasa_dec.c | 10 -- lib_dec/ivas_sba_dec.c | 28 ----- lib_dec/lib_dec.c | 73 ----------- lib_dec/lib_dec.h | 12 -- lib_isar/lib_isar_post_rend.c | 4 - lib_rend/ivas_render_config.c | 4 - lib_rend/lib_rend.c | 24 ---- lib_util/hrtf_file_reader.c | 6 - lib_util/hrtf_file_reader.h | 2 - lib_util/render_config_reader.c | 16 --- 21 files changed, 628 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 59dda20d12..31d34ee4f0 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -156,7 +156,6 @@ typedef struct } DecArguments; -#ifdef FIX_HRTF_LOAD typedef struct { hrtfFileReader *hrtfReader; @@ -176,7 +175,6 @@ typedef struct } IVAS_DEC_HRTF_BINARY_WRAPPER; -#endif /*------------------------------------------------------------------------------------------* * Local functions prototypes @@ -184,14 +182,9 @@ typedef struct static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg ); static void usage_dec( void ); -#ifdef FIX_HRTF_LOAD static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); static ivas_error IVAS_DEC_LoadHrtfFromFile( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const int32_t output_Fs ); -#else -static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); -static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); -#endif #ifdef DEBUGGING static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec ); static int16_t app_own_random( int16_t *seed ); @@ -228,13 +221,7 @@ int main( RenderConfigReader *renderConfigReader = NULL; int16_t *pcmBuf = NULL; IVAS_RENDER_FRAMESIZE asked_frame_size; -#ifdef FIX_HRTF_LOAD IVAS_DEC_HRTF_BINARY_WRAPPER hHrtfBinary; -#else - IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; - IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL; - IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; -#endif #ifdef DEBUGGING int32_t noClipping; int32_t cnt_frames_limited; @@ -251,11 +238,9 @@ int main( reset_mem( USE_BYTES ); #endif -#ifdef FIX_HRTF_LOAD hHrtfBinary.hHrtfTD = NULL; /* just to avoid compilation warning */ hHrtfBinary.hSetOfHRTF = NULL; /* just to avoid compilation warning */ hHrtfBinary.hHrtfStatistics = NULL; /* just to avoid compilation warning */ -#endif splitRendBits.bits_buf = splitRendBitsBuf; @@ -739,111 +724,12 @@ int main( if ( arg.hrtfReaderEnabled ) { -#ifdef FIX_HRTF_LOAD hHrtfBinary.hrtfReader = hrtfReader; hHrtfBinary.hrtfFileName = arg.hrtfFileName; hHrtfBinary.binaural_renderer = IVAS_BIN_RENDERER_TYPE_NONE; hHrtfBinary.binaural_renderer_sec = IVAS_BIN_RENDERER_TYPE_NONE; hHrtfBinary.room_reverb_flag = 0; hHrtfBinary.intern_audio_config = IVAS_AUDIO_CONFIG_INVALID; -#else - if ( ( error = IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; - } - - if ( ( error = load_HRTF_binary( *hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) - { - if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) - { - fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); - goto cleanup; - } - else - { - destroy_td_hrtf( hHrtfTD ); - } - } - - - if ( ( error = IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nIVAS_DEC_GetHrtfCRendHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; - } - - if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfReader, arg.output_Fs ) ) != IVAS_ERR_OK ) - { - if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) - { - fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); - goto cleanup; - } - else - { - destroy_SetOfHRTF( hSetOfHRTF ); - } - } - - IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL; - if ( ( error = IVAS_DEC_GetHrtfFastConvHandle( hIvasDec, &hHrtfFastConv ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nIVAS_DEC_GetHrtfFastConvHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; - } - - if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, hrtfReader ) ) != IVAS_ERR_OK ) - { - if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) - { - fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); - goto cleanup; - } - else - { - destroy_fastconv_hrtf( hHrtfFastConv ); - } - } - - IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL; - if ( ( error = IVAS_DEC_GetHrtfParamBinHandle( hIvasDec, &hHrtfParambin ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nIVAS_DEC_GetHrtfParamBinHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; - } - - if ( ( error = load_parambin_HRTF_from_binary( *hHrtfParambin, hrtfReader ) ) != IVAS_ERR_OK ) - { - if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) - { - fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); - goto cleanup; - } - else - { - destroy_parambin_hrtf( hHrtfParambin ); - } - } - - if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; - } - if ( ( error = load_reverb_binary( *hHrtfStatistics, arg.output_Fs, hrtfReader ) ) != IVAS_ERR_OK ) - { - if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) - { - fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); - goto cleanup; - } - else - { - destroy_hrtf_statistics( hHrtfStatistics ); - } - } -#endif } /*------------------------------------------------------------------------------------------* @@ -865,19 +751,11 @@ int main( if ( arg.voipMode ) { -#ifdef FIX_HRTF_LOAD error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec ); -#else - error = decodeVoIP( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec ); -#endif } else { -#ifdef FIX_HRTF_LOAD error = decodeG192( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, &splitRendBits, hIvasDec, pcmBuf ); -#else - error = decodeG192( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, &splitRendBits, hIvasDec, pcmBuf ); -#endif } if ( error == IVAS_ERR_OK || error == IVAS_ERR_END_OF_FILE ) @@ -893,11 +771,7 @@ int main( } else { -#ifdef FIX_HRTF_LOAD fprintf( stderr, "\nDecoding finished prematurely: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); -#else - fprintf( stdout, "Decoding finished prematurely\n\n" ); -#endif goto cleanup; } @@ -933,20 +807,9 @@ cleanup: #endif if ( arg.hrtfReaderEnabled ) { -#ifdef FIX_HRTF_LOAD destroy_td_hrtf( hHrtfBinary.hHrtfTD ); destroy_SetOfHRTF( hHrtfBinary.hSetOfHRTF ); destroy_hrtf_statistics( hHrtfBinary.hHrtfStatistics ); -#else - IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD ); - destroy_td_hrtf( hHrtfTD ); - - IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ); - destroy_SetOfHRTF( hSetOfHRTF ); - - IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ); - destroy_hrtf_statistics( hHrtfStatistics ); -#endif } IVAS_DEC_Close( &hIvasDec ); @@ -2137,9 +2000,7 @@ static ivas_error initOnFirstGoodFrame( static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, -#ifdef FIX_HRTF_LOAD IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, -#endif RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, @@ -2495,23 +2356,13 @@ static ivas_error decodeG192( } } #endif -#ifdef FIX_HRTF_LOAD /* Feed into decoder and decode transport channels */ if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, bit_stream, num_bits, bfi ) ) != IVAS_ERR_OK ) -#else - /* Feed into decoder */ - if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, bit_stream, num_bits, bfi - , - isSplitRend, - splitRendBits - ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError: could not feed frame to decoder: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef FIX_HRTF_LOAD /* Read main parameters from the bitstream to set-up the decoder */ hHrtfBinary->binaural_renderer_old = hHrtfBinary->binaural_renderer; hHrtfBinary->binaural_renderer_sec_old = hHrtfBinary->binaural_renderer_sec; @@ -2539,7 +2390,6 @@ static ivas_error decodeG192( return error; } -#endif /* Object metadata editing */ if ( arg.objEditEnabled ) { @@ -3071,9 +2921,7 @@ static ivas_error writeJbmTraceFileFrameWrapper( const void *data, void *writer static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, -#ifdef FIX_HRTF_LOAD IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, -#endif RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, @@ -3124,9 +2972,7 @@ static ivas_error decodeVoIP( int16_t vec_pos_update, vec_pos_len; int16_t nOutSamples = 0; -#ifdef FIX_HRTF_LOAD bool bitstreamReadDone = false; -#endif bool parameterAvailableForEditing = false; uint16_t nSamplesRendered = 0; @@ -3413,23 +3259,14 @@ static ivas_error decodeVoIP( while ( nSamplesRendered < nOutSamples ) { #ifdef SUPPORT_JBM_TRACEFILE -#ifdef FIX_HRTF_LOAD if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, ¶meterAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) #else - if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &nSamplesRendered, ¶meterAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) -#endif -#else -#ifdef FIX_HRTF_LOAD if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &bitstreamReadDone, &nSamplesRendered, ¶meterAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms, &nSamplesRendered, ¶meterAvailableForEditing ) ) != IVAS_ERR_OK ) -#endif #endif { fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef FIX_HRTF_LOAD if ( bitstreamReadDone == true ) { @@ -3455,7 +3292,6 @@ static ivas_error decodeVoIP( } } -#endif /* Object metadata editing */ if ( arg.objEditEnabled && parameterAvailableForEditing == true ) { @@ -3838,7 +3674,6 @@ static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( } #endif -#ifdef FIX_HRTF_LOAD /*---------------------------------------------------------------------* * IVAS_DEC_LoadHrtfFromFile() @@ -4014,6 +3849,5 @@ static ivas_error IVAS_DEC_LoadHrtfFromFile( return IVAS_ERR_OK; } -#endif #undef WMC_TOOL_SKIP diff --git a/apps/renderer.c b/apps/renderer.c index 9f3be788ea..3aa0a47428 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -615,11 +615,7 @@ static int16_t get_cldfb_in_flag( int16_t cldfb_in_flag; cldfb_in_flag = 0; -#ifdef FIX_HRTF_LOAD if ( renderConfig->split_rend_config.rendererSelection == IVAS_BIN_RENDERER_TYPE_FASTCONV ) -#else - if ( renderConfig->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) -#endif { #ifdef DEBUGGING cldfb_in_flag = 1; @@ -949,11 +945,7 @@ int main( goto cleanup; } -#ifdef FIX_HRTF_LOAD if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, 0, IVAS_AUDIO_CONFIG_INVALID, hrtfFileReader ) ) != IVAS_ERR_OK ) -#else - if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, hrtfFileReader ) ) != IVAS_ERR_OK ) -#endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 4a9ca4665e..00df25e87d 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -210,7 +210,6 @@ typedef struct _IVAS_JBM_TRACE_DATA } IVAS_JBM_TRACE_DATA; -#ifdef FIX_HRTF_LOAD typedef enum _ivas_binaural_renderer_type { IVAS_BIN_RENDERER_TYPE_NONE, @@ -221,7 +220,6 @@ typedef enum _ivas_binaural_renderer_type IVAS_BIN_RENDERER_TYPE_DEFAULT, } IVAS_BIN_RENDERER_TYPE; -#endif /*----------------------------------------------------------------------------------* * Split rendering API constants, structures, and enums @@ -260,17 +258,6 @@ typedef enum } ISAR_SPLIT_REND_CODEC; -#ifndef FIX_HRTF_LOAD -typedef enum -{ - ISAR_SPLIT_REND_RENDERER_SELECTION_CREND, - ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV, - ISAR_SPLIT_REND_RENDERER_SELECTION_PARAMBIN, - ISAR_SPLIT_REND_RENDERER_SELECTION_TDREND, - ISAR_SPLIT_REND_RENDERER_SELECTION_DEFAULT, - -} ISAR_SPLIT_REND_RENDERER_SELECTION; -#endif typedef struct _ISAR_SPLIT_REND_BITS_DATA { @@ -302,11 +289,7 @@ typedef struct _ISAR_SPLIT_REND_CONFIG int16_t codec_frame_size_ms; /* Codec frame size in milliseconds, only relevant with LC3plus */ ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode; ISAR_SPLIT_REND_CODEC codec; -#ifdef FIX_HRTF_LOAD IVAS_BIN_RENDERER_TYPE rendererSelection; -#else - ISAR_SPLIT_REND_RENDERER_SELECTION rendererSelection; -#endif int16_t lc3plus_highres; } ISAR_SPLIT_REND_CONFIG_DATA, *ISAR_SPLIT_REND_CONFIG_HANDLE; diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index f1f3ddf218..418d49267f 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -318,20 +318,12 @@ ivas_error ivas_dec( int16_t *data /* o : output synthesis signal */ ); -#ifdef FIX_HRTF_LOAD ivas_error ivas_dec_get_format( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); -#endif ivas_error ivas_dec_setup( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ -#ifndef FIX_HRTF_LOAD - , - uint16_t *nSamplesRendered, /* o : number of samples flushed from the previous frame (JBM) */ - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ -#endif ); ivas_error create_sce_dec( @@ -670,12 +662,6 @@ ivas_error ivas_mc_enc_config( ivas_error ivas_mc_dec_config( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const int16_t idx /* i : LS config. index */ -#ifndef FIX_HRTF_LOAD - , - uint16_t *nSamplesRendered, /* o : samples flushed from last frame (JBM) */ - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ - #endif ); /*! r: MC format mode (MCT, McMASA, ParamMC) */ @@ -1083,12 +1069,6 @@ ivas_error ivas_ism_enc_config( ivas_error ivas_ism_dec_config( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const ISM_MODE last_ism_mode /* i/o: last ISM mode */ -#ifndef FIX_HRTF_LOAD - , - uint16_t *nSamplesRendered, /* o : number of samples flushed on renderer change*/ - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ -#endif ); ivas_error ivas_param_ism_dec_open( @@ -3478,12 +3458,6 @@ void ivas_sba_set_cna_cng_flag( ivas_error ivas_sba_dec_reconfigure( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ -#ifndef FIX_HRTF_LOAD - , - uint16_t *nSamplesFlushed, /* o : number of samples flushed */ - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ -#endif ); ivas_error ivas_sba_digest_tc( @@ -4937,12 +4911,6 @@ void ivas_masa_enc_reconfigure( ivas_error ivas_masa_dec_reconfigure( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ -#ifndef FIX_HRTF_LOAD - , - uint16_t *nSamplesRendered, /* o : number of samples flushed from the previous frame (JBM) */ - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ - #endif ); ivas_error ivas_masa_encode( @@ -5657,12 +5625,6 @@ ivas_error ivas_omasa_enc_config( ivas_error ivas_omasa_dec_config( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ -#ifndef FIX_HRTF_LOAD - , - uint16_t *nSamplesRendered, /* o : number of samples flushed from the previous frame (JBM) */ - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ -#endif ); void ivas_omasa_set_config( diff --git a/lib_com/options.h b/lib_com/options.h index d66f1003a1..82b5f5814b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -165,7 +165,6 @@ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ -#define FIX_HRTF_LOAD /* VA: issue 1187: fix memory issue when HRTFs are loaded from a binary file */ #define FIX_1209_SID_SIGNALING /* VA: issue 1209: remove dead code in IVAS SID signaling */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index e8a0e996c6..05033d87a4 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1142,12 +1142,10 @@ ivas_error ivas_binRenderer_open( hBinRenderer->render_lfe = 1; } -#ifdef FIX_HRTF_LOAD if ( st_ivas->hHrtfFastConv == NULL && st_ivas->hDecoderConfig->Opt_HRTF_binary ) { return IVAS_ERROR( IVAS_ERR_INTERNAL, "HRTF binary file present but not used in FastConv renderer" ); } -#endif /* Load HRTF tables */ if ( ( error = ivas_binaural_hrtf_open( &st_ivas->hHrtfFastConv, st_ivas->hIntSetup.output_config, st_ivas->renderer_type ) ) != IVAS_ERR_OK ) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 36c1abf31c..423dfebec9 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -89,7 +89,6 @@ static AUDIO_CONFIG ivas_set_audio_config_from_sba_order( return output_config; } -#ifdef FIX_HRTF_LOAD /*---------------------------------------------------------------------* * ivas_dec_get_format( ) @@ -460,7 +459,6 @@ ivas_error ivas_dec_get_format( return IVAS_ERR_OK; } -#endif /*-------------------------------------------------------------------* * ivas_dec_setup() @@ -470,12 +468,6 @@ ivas_error ivas_dec_get_format( ivas_error ivas_dec_setup( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ -#ifndef FIX_HRTF_LOAD - , - uint16_t *nSamplesRendered, /* o : number of samples flushed from the previous frame (JBM) */ - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ -#endif ) { int16_t k, idx, num_bits_read; @@ -536,11 +528,7 @@ ivas_error ivas_dec_setup( st_ivas->nchan_ism = nchan_ism; -#ifdef FIX_HRTF_LOAD if ( ( error = ivas_ism_dec_config( st_ivas, st_ivas->ism_mode ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_ism_dec_config( st_ivas, st_ivas->ism_mode, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -558,11 +546,7 @@ ivas_error ivas_dec_setup( num_bits_read += SBA_ORDER_BITS; if ( st_ivas->ini_frame > 0 && ivas_total_brate != st_ivas->last_active_ivas_total_brate && ivas_total_brate > IVAS_SID_5k2 ) { -#ifdef FIX_HRTF_LOAD if ( ( error = ivas_sba_dec_reconfigure( st_ivas ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_sba_dec_reconfigure( st_ivas, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -628,11 +612,7 @@ ivas_error ivas_dec_setup( } else { -#ifdef FIX_HRTF_LOAD if ( ( error = ivas_masa_dec_reconfigure( st_ivas ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_masa_dec_reconfigure( st_ivas, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -640,11 +620,7 @@ ivas_error ivas_dec_setup( } else { -#ifdef FIX_HRTF_LOAD if ( ( error = ivas_omasa_dec_config( st_ivas ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_omasa_dec_config( st_ivas, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -665,11 +641,7 @@ ivas_error ivas_dec_setup( /* reconfigure in case a change of operation mode is detected */ if ( ( ivas_total_brate > IVAS_SID_5k2 && ivas_total_brate != st_ivas->hDecoderConfig->last_ivas_total_brate ) || ( st_ivas->ini_active_frame == 0 ) ) { -#ifdef FIX_HRTF_LOAD if ( ( error = ivas_omasa_dec_config( st_ivas ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_omasa_dec_config( st_ivas, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -700,11 +672,7 @@ ivas_error ivas_dec_setup( if ( st_ivas->ini_frame > 0 && ivas_total_brate != st_ivas->last_active_ivas_total_brate ) { -#ifdef FIX_HRTF_LOAD if ( ( error = ivas_sba_dec_reconfigure( st_ivas ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_sba_dec_reconfigure( st_ivas, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -750,11 +718,7 @@ ivas_error ivas_dec_setup( num_bits_read += MC_LS_SETUP_BITS; /* select MC format mode; reconfigure the MC format decoder */ -#ifdef FIX_HRTF_LOAD if ( ( error = ivas_mc_dec_config( st_ivas, idx ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_mc_dec_config( st_ivas, idx, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -839,11 +803,7 @@ ivas_error ivas_dec_setup( st_ivas->hDecoderConfig->ivas_total_brate = IVAS_24k4; } -#ifdef FIX_HRTF_LOAD if ( ( error = ivas_sba_dec_reconfigure( st_ivas ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_sba_dec_reconfigure( st_ivas, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -897,11 +857,7 @@ ivas_error ivas_dec_setup( last_ism_mode = st_ivas->ism_mode; } -#ifdef FIX_HRTF_LOAD if ( ( error = ivas_ism_dec_config( st_ivas, last_ism_mode ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_ism_dec_config( st_ivas, last_ism_mode, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1030,14 +986,12 @@ static ivas_error ivas_read_format( { st_ivas->ivas_format = SBA_ISM_FORMAT; -#ifdef FIX_HRTF_LOAD /* read the real Ambisonic order when the above bits are used to signal OSBA format */ if ( ivas_total_brate < IVAS_24k4 ) { st_ivas->sba_order = st_ivas->bit_stream[*num_bits_read + 2 + SBA_PLANAR_BITS + SBA_ORDER_BITS]; st_ivas->sba_order += 2 * st_ivas->bit_stream[*num_bits_read + 1 + SBA_PLANAR_BITS + SBA_ORDER_BITS]; } -#endif } } ( *num_bits_read )++; @@ -1284,38 +1238,6 @@ ivas_error ivas_init_decoder_front( } } -#ifndef FIX_HRTF_LOAD - /*-------------------------------------------------------------------* - * Allocate HRTF binary handle - *--------------------------------------------------------------------*/ - - if ( st_ivas->hDecoderConfig->Opt_HRTF_binary ) - { - if ( ( error = ivas_HRTF_binary_open( &( st_ivas->hHrtfTD ) ) ) != IVAS_ERR_OK ) - { - return error; - } - if ( ( error = ivas_HRTF_CRend_binary_open( &( st_ivas->hSetOfHRTF ) ) ) != IVAS_ERR_OK ) - { - return error; - } - - if ( ( error = ivas_HRTF_fastconv_binary_open( &st_ivas->hHrtfFastConv ) ) != IVAS_ERR_OK ) - { - return error; - } - - if ( ( error = ivas_HRTF_parambin_binary_open( &st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) - { - return error; - } - - if ( ( error = ivas_HRTF_statistics_binary_open( &st_ivas->hHrtfStatistics ) ) != IVAS_ERR_OK ) - { - return error; - } - } -#endif /*-------------------------------------------------------------------* * Allocate and initialize Binaural Renderer configuration handle *--------------------------------------------------------------------*/ diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 69a6c832d8..e66e1c9d43 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -50,12 +50,6 @@ static ivas_error ivas_ism_bitrate_switching_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const int16_t nchan_transport_old, /* i : last number of transport channels */ const ISM_MODE last_ism_mode /* i : last ISM mode */ -#ifndef FIX_HRTF_LOAD - , - uint16_t *nSamplesRendered, /* o : number of samples rendered */ - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ -#endif ) { ivas_error error; @@ -67,15 +61,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( int16_t tc_nchan_allocate_new; int16_t tc_granularity_new; int16_t nchan_out_buff, nchan_out_buff_old; -#ifndef FIX_HRTF_LOAD - AUDIO_CONFIG intern_config_old; - IVAS_OUTPUT_SETUP hIntSetupOld; - RENDERER_TYPE renderer_type_old; -#endif -#ifndef FIX_HRTF_LOAD - error = IVAS_ERR_OK; -#endif nCPE_old = st_ivas->nCPE; nSCE_old = st_ivas->nSCE; @@ -111,14 +97,6 @@ static ivas_error ivas_ism_bitrate_switching_dec( return error; } -#ifndef FIX_HRTF_LOAD - /* save old IntSetup, might be needed for JBM flushing...*/ - intern_config_old = st_ivas->intern_config; - hIntSetupOld = st_ivas->hIntSetup; - tc_granularity_new = 1; - renderer_type_old = st_ivas->renderer_type; - -#endif /*-----------------------------------------------------------------* * Initialize the needed renderer struct and destroy the unnecessary renderer struct *-----------------------------------------------------------------*/ @@ -153,23 +131,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) { -#ifdef FIX_HRTF_LOAD /* flush already done in IVAS_DEC_ReadFormat() */ -#else -#ifdef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH - /* write back info for correct rendering of the flushable samples */ - int16_t nchan_transport_ref = st_ivas->nchan_transport; - st_ivas->nchan_transport = nchan_transport_old; - -#endif - if ( ( error = ivas_jbm_dec_flush_renderer( st_ivas, tc_granularity_new, renderer_type_old, intern_config_old, &hIntSetupOld, MC_MODE_NONE, last_ism_mode, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) - { - return error; - } -#ifdef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH - st_ivas->nchan_transport = nchan_transport_ref; -#endif -#endif } /* 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 ) @@ -390,11 +352,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( } #endif -#ifdef FIX_HRTF_LOAD return IVAS_ERR_OK; -#else - return error; -#endif } @@ -408,21 +366,12 @@ static ivas_error ivas_ism_bitrate_switching_dec( ivas_error ivas_ism_dec_config( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const ISM_MODE last_ism_mode /* i/o: last ISM mode */ -#ifndef FIX_HRTF_LOAD - , - uint16_t *nSamplesRendered, /* o : number of samples flushed when the renderer granularity changes */ - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ -#endif ) { int32_t ivas_total_brate; ivas_error error; int16_t nchan_transport_old; -#ifndef FIX_HRTF_LOAD - error = IVAS_ERR_OK; -#endif ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; /* Assumes that num of input objects are constant */ @@ -453,11 +402,7 @@ ivas_error ivas_ism_dec_config( /* ISM bit-rate switching */ if ( ( st_ivas->ism_mode != last_ism_mode ) || ( ivas_total_brate != st_ivas->hDecoderConfig->last_ivas_total_brate ) ) { -#ifdef FIX_HRTF_LOAD if ( ( error = ivas_ism_bitrate_switching_dec( st_ivas, nchan_transport_old, last_ism_mode ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_ism_bitrate_switching_dec( st_ivas, nchan_transport_old, last_ism_mode, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -480,11 +425,7 @@ ivas_error ivas_ism_dec_config( if ( st_ivas->ism_mode != last_ism_mode ) { -#ifdef FIX_HRTF_LOAD if ( ( error = ivas_ism_bitrate_switching_dec( st_ivas, nchan_transport_old, last_ism_mode ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_ism_bitrate_switching_dec( st_ivas, nchan_transport_old, last_ism_mode, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -510,9 +451,5 @@ ivas_error ivas_ism_dec_config( break; } -#ifdef FIX_HRTF_LOAD return IVAS_ERR_OK; -#else - return error; -#endif } diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 62a664caf9..622a6dce64 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -151,7 +151,6 @@ ivas_error ivas_masa_decode( { if ( !( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ) { -#if ( defined FIX_HRTF_LOAD || defined NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH ) if ( ivas_format == MASA_FORMAT ) { /* re-read the number of objects, needed in case of bad frame */ @@ -165,14 +164,6 @@ ivas_error ivas_masa_decode( } if ( ivas_format == MASA_FORMAT && st_ivas->nchan_ism > 0 ) -#else - if ( ivas_format == MASA_FORMAT ) - { - /* re-read the number of objects, needed in case of bad frame */ - st_ivas->nchan_ism = 5 - ( st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 3] + 2 * st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 2] ); - } - if ( ivas_format == MASA_FORMAT && st_ivas->nchan_ism != 5 ) -#endif { /* there was OMASA in the input */ hMasa->config.input_ivas_format = MASA_ISM_FORMAT; @@ -1318,12 +1309,6 @@ static int16_t decode_lfe_to_total_energy_ratio( ivas_error ivas_masa_dec_reconfigure( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ -#ifndef FIX_HRTF_LOAD - , - uint16_t *nSamplesRendered, /* o : number of samples flushed from the previous frame (JBM) */ - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ -#endif ) { int16_t n, tmp, num_bits; @@ -1336,9 +1321,6 @@ ivas_error ivas_masa_dec_reconfigure( int16_t pos_idx; int32_t ism_total_brate; -#ifndef FIX_HRTF_LOAD - error = IVAS_ERR_OK; -#endif ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; last_ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate; @@ -1535,14 +1517,7 @@ ivas_error ivas_masa_dec_reconfigure( { if ( n_samples_granularity < st_ivas->hTcBuffer->n_samples_granularity ) { -#ifdef FIX_HRTF_LOAD /* flush already done in IVAS_DEC_ReadFormat() */ -#else - if ( ( error = ivas_jbm_dec_flush_renderer( st_ivas, n_samples_granularity, st_ivas->renderer_type, st_ivas->intern_config, &st_ivas->hIntSetup, MC_MODE_NONE, ISM_MASA_MODE_DISC, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif } } } @@ -1583,11 +1558,7 @@ ivas_error ivas_masa_dec_reconfigure( } } -#ifdef FIX_HRTF_LOAD return IVAS_ERR_OK; -#else - return error; -#endif } diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index fe2ca5dbaa..bb41bcd203 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -54,11 +54,7 @@ * Local function prototypes *-----------------------------------------------------------------------*/ -#ifdef FIX_HRTF_LOAD static ivas_error ivas_mc_dec_reconfig( Decoder_Struct *st_ivas ); -#else -static ivas_error ivas_mc_dec_reconfig( Decoder_Struct *st_ivas, uint16_t *nSamplesRendered, const PCM_RESOLUTION pcm_resolution, void *data ); -#endif /*--------------------------------------------------------------------------* @@ -667,12 +663,6 @@ void ivas_mct_dec_close( ivas_error ivas_mc_dec_config( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const int16_t idx /* i : LS config. index */ -#ifndef FIX_HRTF_LOAD - , - uint16_t *nSamplesRendered, /* o : samples flushed from last frame (JBM) */ - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ -#endif ) { AUDIO_CONFIG signaled_config; @@ -707,11 +697,7 @@ ivas_error ivas_mc_dec_config( { if ( st_ivas->hDecoderConfig->last_ivas_total_brate != st_ivas->hDecoderConfig->ivas_total_brate || last_mc_mode != st_ivas->mc_mode ) { -#ifdef FIX_HRTF_LOAD if ( ( error = ivas_mc_dec_reconfig( st_ivas ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_mc_dec_reconfig( st_ivas, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -733,12 +719,6 @@ ivas_error ivas_mc_dec_config( static ivas_error ivas_mc_dec_reconfig( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ -#ifndef FIX_HRTF_LOAD - , - uint16_t *nSamplesRendered, /* o : number of samples flushed from the last frame (JBM) */ - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ -#endif ) { int16_t nchan_transport_old, nSCE_old, nCPE_old, sba_dirac_stereo_flag_old, nchan_hp20_old; @@ -752,15 +732,8 @@ static ivas_error ivas_mc_dec_reconfig( int16_t tc_nchan_tc_new; int16_t tc_nchan_allocate_new; int16_t tc_granularity_new; -#ifndef FIX_HRTF_LOAD - AUDIO_CONFIG intern_config_old; - IVAS_OUTPUT_SETUP hIntSetupOld; -#endif int16_t nchan_out_buff_old, nchan_out_buff; -#ifndef FIX_HRTF_LOAD - error = IVAS_ERR_OK; -#endif ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; nchan_transport_old = st_ivas->nchan_transport; nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); @@ -788,13 +761,6 @@ static ivas_error ivas_mc_dec_reconfig( } st_ivas->sba_dirac_stereo_flag = ivas_get_sba_dirac_stereo_flag( st_ivas ); -#ifndef FIX_HRTF_LOAD - /* save old IntSetup, might be needed for JBM flushing...*/ - intern_config_old = st_ivas->intern_config; - hIntSetupOld = st_ivas->hIntSetup; - tc_granularity_new = 1; - -#endif /* renderer might have changed, reselect */ renderer_type_old = st_ivas->renderer_type; ivas_renderer_select( st_ivas ); @@ -828,14 +794,7 @@ static ivas_error ivas_mc_dec_reconfig( 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 ); if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) { -#ifdef FIX_HRTF_LOAD /* flush already done in IVAS_DEC_ReadFormat() */ -#else - if ( ( error = ivas_jbm_dec_flush_renderer( st_ivas, tc_granularity_new, renderer_type_old, intern_config_old, &hIntSetupOld, last_mc_mode, ISM_MODE_NONE, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif } /* 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 ) @@ -1396,9 +1355,5 @@ static ivas_error ivas_mc_dec_reconfig( return error; } -#ifdef FIX_HRTF_LOAD return IVAS_ERR_OK; -#else - return error; -#endif } diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 5785db4851..269f7a0fbd 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -61,14 +61,12 @@ ivas_error ivas_td_binaural_open( num_src = st_ivas->nchan_ism; } -#ifdef FIX_HRTF_LOAD if ( st_ivas->hHrtfTD == NULL && st_ivas->hDecoderConfig->Opt_HRTF_binary && ( st_ivas->ivas_format != SBA_ISM_FORMAT ) // ToDo: temporary hack to avoid ASAN errors -> see issue #1202 ) { return IVAS_ERROR( IVAS_ERR_INTERNAL, "HRTF binary file present but not used in TD renderer" ); } -#endif return ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, num_src, st_ivas->ivas_format, st_ivas->transport_config, st_ivas->hRenderConfig->directivity, st_ivas->hRenderConfig->distAtt, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns ); diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index d8a71cf589..83f6ae0b93 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -194,12 +194,6 @@ void ivas_omasa_data_close( ivas_error ivas_omasa_dec_config( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ -#ifndef FIX_HRTF_LOAD - , - uint16_t *nSamplesRendered, /* o : number of samples flushed from the previous frame (JBM) */ - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ -#endif ) { int16_t k, sce_id, nSCE_old, nchan_hp20_old, numCldfbAnalyses_old, numCldfbSyntheses_old; @@ -243,11 +237,7 @@ ivas_error ivas_omasa_dec_config( { st_ivas->hCPE[0]->nchan_out = 1; } -#ifdef FIX_HRTF_LOAD else if ( ( error = ivas_masa_dec_reconfigure( st_ivas ) ) != IVAS_ERR_OK ) -#else - else if ( ( error = ivas_masa_dec_reconfigure( st_ivas, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 4f6e8a0587..0d6be841ac 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -102,12 +102,6 @@ void ivas_sba_set_cna_cng_flag( ivas_error ivas_sba_dec_reconfigure( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ -#ifndef FIX_HRTF_LOAD - , - uint16_t *nSamplesFlushed, /* o : number of samples flushed */ - const PCM_RESOLUTION pcm_resolution, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ -#endif ) { int16_t nchan_transport_old, nSCE_old, nCPE_old, nchan_hp20_old; @@ -164,9 +158,6 @@ ivas_error ivas_sba_dec_reconfigure( st_ivas->sba_analysis_order = ivas_sba_get_analysis_order( ivas_total_brate, st_ivas->sba_order ); -#ifndef FIX_HRTF_LOAD - *nSamplesFlushed = 0; -#endif granularity_new = st_ivas->hTcBuffer->n_samples_granularity; /* we may need to flush only for binaural and OSBA and TSM */ @@ -214,22 +205,7 @@ ivas_error ivas_sba_dec_reconfigure( /* flush renderer on granularity change form 5ms to 1.25ms, again only possible for binaural rendering */ if ( granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) { -#ifdef FIX_HRTF_LOAD /* flush already done in IVAS_DEC_ReadFormat() */ -#else - /* write back info for correct rendering of the flushable samples */ - st_ivas->sba_analysis_order = sba_analysis_order_old_flush; - st_ivas->hDecoderConfig->ivas_total_brate = last_ivas_total_brate; - - if ( ( error = ivas_jbm_dec_flush_renderer( st_ivas, granularity_new, st_ivas->renderer_type, st_ivas->intern_config, &st_ivas->hIntSetup, st_ivas->mc_mode, ism_mode_old, nSamplesFlushed, pcm_resolution, data ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* restore correct values for the current frame*/ - st_ivas->sba_analysis_order = ivas_sba_get_analysis_order( ivas_total_brate, st_ivas->sba_order ); - st_ivas->hDecoderConfig->ivas_total_brate = ivas_total_brate; -#endif } else if ( granularity_new > st_ivas->hTcBuffer->n_samples_granularity ) { @@ -667,11 +643,7 @@ ivas_error ivas_sba_dec_reconfigure( return error; } -#ifdef FIX_HRTF_LOAD return IVAS_ERR_OK; -#else - return error; -#endif } diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index d46f569feb..3b21c19a08 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -116,11 +116,7 @@ static ivas_error evs_dec_main( Decoder_Struct *st_ivas, const int16_t nOutSampl static ivas_error input_format_API_to_internal( IVAS_DEC_INPUT_FORMAT input_format, int16_t *bitstream_format_internal, int16_t *sdp_hf_only, const bool is_voip_enabled ); static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig ); static ivas_error IVAS_DEC_VoIP_reconfigure( IVAS_DEC_HANDLE hIvasDec, const uint16_t nTransportChannels, const uint16_t l_ts ); -#ifdef FIX_HRTF_LOAD static ivas_error IVAS_DEC_Setup( IVAS_DEC_HANDLE hIvasDec, uint16_t *nTcBufferGranularity, uint8_t *nTransportChannels ); -#else -static ivas_error IVAS_DEC_Setup( IVAS_DEC_HANDLE hIvasDec, uint16_t *nTcBufferGranularity, uint8_t *nTransportChannels, uint8_t *nOutChannels, uint16_t *nSamplesRendered, const IVAS_DEC_PCM_TYPE pcmType, void *data ); -#endif static ivas_error IVAS_DEC_GetTcSamples( IVAS_DEC_HANDLE hIvasDec, float *pcmBuf, int16_t *nOutSamples ); static ivas_error IVAS_DEC_RendererFeedTcSamples( IVAS_DEC_HANDLE hIvasDec, const int16_t nSamplesForRendering, int16_t *nSamplesResidual, float *pcmBuf ); static ivas_error IVAS_DEC_GetRenderedSamples( IVAS_DEC_HANDLE hIvasDec, const uint16_t nSamplesForRendering, uint16_t *nSamplesRendered, uint16_t *nSamplesAvailableNext, const IVAS_DEC_PCM_TYPE pcmType, void *pcmBuf ); @@ -826,13 +822,7 @@ ivas_error IVAS_DEC_FeedFrame_Serial( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ uint16_t *serial, /* i : buffer containing serial input bitstream. Each bit should be stored as a single uint16_t value */ const uint16_t num_bits, /* i : number of bits in input bitstream */ -#ifdef FIX_HRTF_LOAD int16_t bfi /* i : bad frame indicator flag */ -#else - int16_t bfi, /* i : bad frame indicator flag */ - const int16_t isSplitRend, /* i : split rendering enabled flag */ - ISAR_SPLIT_REND_BITS_DATA *splitRendBits /* o : output split rendering bits */ -#endif ) { ivas_error error; @@ -909,18 +899,9 @@ ivas_error IVAS_DEC_FeedFrame_Serial( hIvasDec->nSamplesRendered = 0; hIvasDec->nSamplesAvailableNext = hIvasDec->nSamplesFrame; -#ifndef FIX_HRTF_LOAD - /* Decode TCs, do TSM and feed to renderer */; - if ( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, isSplitRend, splitRendBits ) ) != IVAS_ERR_OK ) - { - return error; - } - -#endif return IVAS_ERR_OK; } -#ifdef FIX_HRTF_LOAD /*---------------------------------------------------------------------* * IVAS_DEC_ReadFormat( ) @@ -1057,7 +1038,6 @@ ivas_error IVAS_DEC_ReadFormat( return IVAS_ERR_OK; } -#endif /*---------------------------------------------------------------------* * IVAS_DEC_GetSamplesDecoder( ) @@ -1080,18 +1060,10 @@ ivas_error IVAS_DEC_GetSamplesDecoder( /* If TSM is generally enabled, we have to wait for the first good frame. Otherwise, we directly decode the first frame in any case. */ -#ifdef FIX_HRTF_LOAD if ( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame ) -#else - if ( ( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm && hIvasDec->hasBeenFedFirstGoodFrame ) || !hIvasDec->st_ivas->hDecoderConfig->Opt_tsm ) -#endif { uint16_t l_ts, nTimeScalerOutSamples; -#ifdef FIX_HRTF_LOAD uint8_t nTransportChannels; -#else - uint8_t nTransportChannels, nOutChannels; -#endif int16_t nResidualSamples, nSamplesTcsScaled, nOutSamplesElse; if ( isSplitRend ) @@ -1102,11 +1074,7 @@ ivas_error IVAS_DEC_GetSamplesDecoder( } } -#ifdef FIX_HRTF_LOAD if ( ( error = IVAS_DEC_Setup( hIvasDec, &l_ts, &nTransportChannels ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_Setup( hIvasDec, &l_ts, &nTransportChannels, &nOutChannels, &hIvasDec->nSamplesFlushed, hIvasDec->pcmType, hIvasDec->flushbuffer ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1947,35 +1915,19 @@ static ivas_error IVAS_DEC_Setup( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ uint16_t *nTcBufferGranularity, /* o : granularity of the TC Buffer */ uint8_t *nTransportChannels /* o : number of decoded transport PCM channels */ -#ifndef FIX_HRTF_LOAD - , - uint8_t *nOutChannels, /* o : number of decoded out channels (PCM or CLDFB) */ - uint16_t *nSamplesRendered, /* o : number of samples flushed from the last frame */ - const IVAS_DEC_PCM_TYPE pcmType, /* i : type for the decoded PCM resolution */ - void *data /* o : output synthesis signal */ -#endif ) { ivas_error error; -#ifndef FIX_HRTF_LOAD - *nSamplesRendered = 0; -#endif if ( hIvasDec->mode == IVAS_DEC_MODE_EVS ) { if ( hIvasDec->st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) { *nTransportChannels = MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN; -#ifndef FIX_HRTF_LOAD - *nOutChannels = MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN; -#endif } else { *nTransportChannels = 1; -#ifndef FIX_HRTF_LOAD - *nOutChannels = 1; -#endif } } else @@ -1994,11 +1946,7 @@ static ivas_error IVAS_DEC_Setup( if ( st_ivas->bfi == 0 ) { -#ifdef FIX_HRTF_LOAD if ( ( error = ivas_dec_setup( st_ivas ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dec_setup( st_ivas, nSamplesRendered, pcm_type_API_to_internal( pcmType ), data ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2006,9 +1954,6 @@ static ivas_error IVAS_DEC_Setup( *nTransportChannels = (uint8_t) st_ivas->hTcBuffer->nchan_transport_jbm; *nTcBufferGranularity = (uint16_t) st_ivas->hTcBuffer->n_samples_granularity; -#ifndef FIX_HRTF_LOAD - *nOutChannels = (uint8_t) st_ivas->hDecoderConfig->nchan_out; -#endif /*-----------------------------------------------------------------* * ISAR: @@ -2802,7 +2747,6 @@ ivas_error IVAS_DEC_GetHrtfStatisticsHandle( return IVAS_ERR_OK; } -#ifdef FIX_HRTF_LOAD /*---------------------------------------------------------------------* * IVAS_DEC_HRTF_binary_open( ) @@ -2931,7 +2875,6 @@ ivas_error IVAS_DEC_HRTF_binary_close( return IVAS_ERR_OK; } -#endif /*---------------------------------------------------------------------* * copyRendererConfigStruct( ) @@ -3491,9 +3434,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( JbmTraceFileWriterFn jbmWriterFn, void *jbmWriter, #endif -#ifdef FIX_HRTF_LOAD bool *bitstreamReadDone, /* o : flag indicating that bitstream was read */ -#endif uint16_t *nSamplesRendered, /* o : number of samples rendered */ bool *parametersAvailableForEditing, /* o : indicates whether objects editing is available */ const uint32_t systemTimestamp_ms /* i : current system timestamp */ @@ -3599,27 +3540,17 @@ ivas_error IVAS_DEC_VoIP_GetSamples( bsCompactToSerial( dataUnit->data, hIvasDec->hVoIP->bs_conversion_buf, dataUnit->dataSize ); -#ifdef FIX_HRTF_LOAD if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, hIvasDec->hVoIP->bs_conversion_buf, dataUnit->dataSize, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, hIvasDec->hVoIP->bs_conversion_buf, dataUnit->dataSize, 0, 0, 0 ) ) != IVAS_ERR_OK ) -#endif { return error; } -#ifdef FIX_HRTF_LOAD *bitstreamReadDone = true; -#endif } else if ( hIvasDec->hasDecodedFirstGoodFrame ) { /* Decoder has been initialized with first good frame - do PLC */ -#ifdef FIX_HRTF_LOAD if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, hIvasDec->hVoIP->bs_conversion_buf, 0, 1 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, hIvasDec->hVoIP->bs_conversion_buf, 0, 1, 0, 0 ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -3653,14 +3584,12 @@ ivas_error IVAS_DEC_VoIP_GetSamples( JB4_FreeDataUnit( hVoIP->hJBM, dataUnit ); } -#ifdef FIX_HRTF_LOAD if ( hIvasDec->hasBeenFedFirstGoodFrame && *bitstreamReadDone == true ) { /* new bitstream was feeded, return for reconfiguration */ return IVAS_ERR_OK; } -#endif if ( !hIvasDec->hasBeenFedFirstGoodFrame ) { hIvasDec->nSamplesAvailableNext = hIvasDec->nSamplesFrame; @@ -3692,7 +3621,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( int16_t nSamplesToRender, nSamplesRendered_loop; bool tmp; -#ifdef FIX_HRTF_LOAD /* decode TCs, do TSM and prepare the renderer */ if ( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame ) { @@ -3710,7 +3638,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( *bitstreamReadDone = false; } } -#endif nSamplesToRender = nSamplesPerChannel - *nSamplesRendered; diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index be272e48f8..1345602dee 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -152,16 +152,9 @@ ivas_error IVAS_DEC_FeedFrame_Serial( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ uint16_t *serial, /* i : buffer containing serial input bitstream. Each bit should be stored as a single uint16_t value */ const uint16_t num_bits, /* i : number of bits in input bitstream */ -#ifdef FIX_HRTF_LOAD int16_t bfi /* i : bad frame indicator flag */ -#else - int16_t bfi, /* i : bad frame indicator flag */ - const int16_t isSplitRend, /* i : split rendering enabled flag */ - ISAR_SPLIT_REND_BITS_DATA *splitRendBits /* o : output split rendering bits */ -#endif ); -#ifdef FIX_HRTF_LOAD ivas_error IVAS_DEC_ReadFormat( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_BIN_RENDERER_TYPE *binaural_renderer, /* o : binaural renderer type */ @@ -170,7 +163,6 @@ ivas_error IVAS_DEC_ReadFormat( IVAS_AUDIO_CONFIG *intern_audio_config /* o : internal audio configuration */ ); -#endif /*! r: decoder error code */ ivas_error IVAS_DEC_GetSamplesDecoder( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ @@ -322,9 +314,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( JbmTraceFileWriterFn jbmWriterFn, void *jbmWriter, #endif -#ifdef FIX_HRTF_LOAD bool *bitstreamReadDone, /* o : flag indicating that bitstream was read */ -#endif uint16_t *nSamplesRendered, /* o : number of samples rendered */ bool *parametersAvailableForEditing, /* o : indicates whether objects editing is available */ const uint32_t systemTimestamp_ms /* i : current system timestamp */ @@ -470,7 +460,6 @@ ivas_error IVAS_DEC_GetHrtfStatisticsHandle( IVAS_DEC_HRTF_STATISTICS_HANDLE **hHrtfStatistics /* o : HRTF statistics handle */ ); -#ifdef FIX_HRTF_LOAD ivas_error IVAS_DEC_HRTF_binary_open( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const IVAS_BIN_RENDERER_TYPE binaural_renderer /* i : binaural renderer type */ @@ -481,7 +470,6 @@ ivas_error IVAS_DEC_HRTF_binary_close( const IVAS_BIN_RENDERER_TYPE binaural_renderer_old /* i : previous binaural renderer type */ ); -#endif /*! r: error code*/ ivas_error IVAS_DEC_GetRenderConfig( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ diff --git a/lib_isar/lib_isar_post_rend.c b/lib_isar/lib_isar_post_rend.c index 38c25ff21a..94d59501d0 100644 --- a/lib_isar/lib_isar_post_rend.c +++ b/lib_isar/lib_isar_post_rend.c @@ -1116,11 +1116,7 @@ ivas_error ISAR_POST_REND_InitConfig( hIvasRend->splitRenderConfig.isar_frame_size_ms = 0; /* 0 means "use default for selected codec" */ hIvasRend->splitRenderConfig.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; hIvasRend->splitRenderConfig.poseCorrectionMode = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB; -#ifdef FIX_HRTF_LOAD hIvasRend->splitRenderConfig.rendererSelection = IVAS_BIN_RENDERER_TYPE_DEFAULT; -#else - hIvasRend->splitRenderConfig.rendererSelection = ISAR_SPLIT_REND_RENDERER_SELECTION_DEFAULT; -#endif } return IVAS_ERR_OK; diff --git a/lib_rend/ivas_render_config.c b/lib_rend/ivas_render_config.c index cc03379e9f..8ca782994f 100644 --- a/lib_rend/ivas_render_config.c +++ b/lib_rend/ivas_render_config.c @@ -145,11 +145,7 @@ ivas_error ivas_render_config_init_from_rom( ( *hRenderConfig )->split_rend_config.codec_frame_size_ms = 0; /* 0 means "use default for selected codec" */ ( *hRenderConfig )->split_rend_config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; ( *hRenderConfig )->split_rend_config.poseCorrectionMode = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB; -#ifdef FIX_HRTF_LOAD ( *hRenderConfig )->split_rend_config.rendererSelection = IVAS_BIN_RENDERER_TYPE_DEFAULT; -#else - ( *hRenderConfig )->split_rend_config.rendererSelection = ISAR_SPLIT_REND_RENDERER_SELECTION_DEFAULT; -#endif ( *hRenderConfig )->split_rend_config.lc3plus_highres = 0; return IVAS_ERR_OK; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 2ca20ede50..5d8cad08e0 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2509,11 +2509,7 @@ static ivas_error updateSbaPanGains( case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: { -#ifdef FIX_HRTF_LOAD if ( hRendCfg->split_rend_config.rendererSelection == IVAS_BIN_RENDERER_TYPE_FASTCONV ) -#else - if ( hRendCfg->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) -#endif { assert( *rendCtx.pOutSampleRate == 48000 && "split binaural fast conv mode is currently supported with 48k sampling rate only" ); if ( ( error = ivas_rend_openCldfbRend( &inputSba->cldfbRendWrapper, inConfig, outConfig, &rendCtx.pSplitRendWrapper->multiBinPoseData, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) @@ -2533,11 +2529,7 @@ static ivas_error updateSbaPanGains( } case IVAS_AUDIO_CONFIG_BINAURAL: case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: -#ifdef FIX_HRTF_LOAD if ( hRendCfg->split_rend_config.rendererSelection == IVAS_BIN_RENDERER_TYPE_FASTCONV ) -#else - if ( hRendCfg->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) -#endif { if ( ( error = ivas_rend_openCldfbRend( &inputSba->cldfbRendWrapper, inConfig, outConfig, &rendCtx.pSplitRendWrapper->multiBinPoseData, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { @@ -3380,11 +3372,7 @@ static int16_t getCldfbRendFlag( { isCldfbRend = 0; } -#ifdef FIX_HRTF_LOAD else if ( ( numMasaInputs > 0 ) || ( numSbaInputs > 0 && hIvasRend->hRendererConfig->split_rend_config.rendererSelection == IVAS_BIN_RENDERER_TYPE_FASTCONV ) ) -#else - else if ( ( numMasaInputs > 0 ) || ( numSbaInputs > 0 && hIvasRend->hRendererConfig->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) ) -#endif { isCldfbRend = 1; } @@ -3904,11 +3892,7 @@ ivas_error IVAS_REND_GetDelay( { if ( hIvasRend->splitRendWrapper != NULL && hIvasRend->splitRendWrapper->hBinHrSplitPreRend != NULL ) { -#ifdef FIX_HRTF_LOAD if ( hIvasRend->hRendererConfig->split_rend_config.rendererSelection == IVAS_BIN_RENDERER_TYPE_FASTCONV ) -#else - if ( hIvasRend->hRendererConfig->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) -#endif { latency_ns = hIvasRend->inputsSba[i].cldfbRendWrapper.binaural_latency_ns; } @@ -6574,11 +6558,7 @@ static ivas_error renderSbaToSplitBinaural( push_wmops( "renderSbaToSplitBinaural" ); -#ifdef FIX_HRTF_LOAD if ( sbaInput->base.ctx.hhRendererConfig[0]->split_rend_config.rendererSelection == IVAS_BIN_RENDERER_TYPE_FASTCONV ) -#else - if ( sbaInput->base.ctx.hhRendererConfig[0]->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) -#endif { renderSbaToMultiBinauralCldfb( sbaInput, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, 1, getNumSubframesInBuffer( &outAudio, *sbaInput->base.ctx.pOutSampleRate ) ); @@ -6615,11 +6595,7 @@ static ivas_error renderSbaToBinaural( int16_t subframe_idx; push_wmops( "renderSbaToBinaural" ); -#ifdef FIX_HRTF_LOAD if ( sbaInput->base.ctx.hhRendererConfig[0]->split_rend_config.rendererSelection == IVAS_BIN_RENDERER_TYPE_FASTCONV ) -#else - if ( sbaInput->base.ctx.hhRendererConfig[0]->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) -#endif { float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index b4a0b24ea9..4332989b19 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -1887,10 +1887,8 @@ static ivas_error create_parambin_HRTF_from_rawdata( ivas_error load_fastconv_HRTF_from_binary( IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv, /* i/o: FastConv HRTF handle */ -#ifdef FIX_HRTF_LOAD const int16_t room_reverb_flag, /* i : room reverb flag */ const IVAS_AUDIO_CONFIG intern_audio_config, /* i : internal audio configuration */ -#endif const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ) { @@ -1939,7 +1937,6 @@ ivas_error load_fastconv_HRTF_from_binary( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "HRTF binary file not compliant (number of HRTF)" ); } -#ifdef FIX_HRTF_LOAD if ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && ( ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 && intern_audio_config == IVAS_AUDIO_CONFIG_HOA3 ) || ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 && intern_audio_config == IVAS_AUDIO_CONFIG_HOA2 ) || @@ -1947,9 +1944,6 @@ ivas_error load_fastconv_HRTF_from_binary( ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) ) ) || ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV || hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM ) && room_reverb_flag == 1 ) || ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV || hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM ) && intern_audio_config == IVAS_AUDIO_CONFIG_INVALID ) ) -#else - if ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV ) || ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM ) ) -#endif { if ( fread( hrtf_data, 1, hrtf_header.data_size, f_hrtf ) != hrtf_header.data_size ) { diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index 0ea25d323e..262ff8cee5 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -132,10 +132,8 @@ void destroy_SetOfHRTF( ivas_error load_fastconv_HRTF_from_binary( IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv, /* i/o: FastConv HRTF handle */ -#ifdef FIX_HRTF_LOAD const int16_t room_reverb_flag, /* i : room reverb flag */ IVAS_AUDIO_CONFIG intern_audio_config, /* i : internal audio configuration */ -#endif const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ); diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 8ad75acdd2..f602d16e62 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -2649,35 +2649,19 @@ ivas_error RenderConfigReader_read( { if ( strcmp( pValue, "CREND" ) == 0 ) { -#ifdef FIX_HRTF_LOAD hRenderConfig->split_rend_config.rendererSelection = IVAS_BIN_RENDERER_TYPE_CREND; -#else - hRenderConfig->split_rend_config.rendererSelection = ISAR_SPLIT_REND_RENDERER_SELECTION_CREND; -#endif } else if ( strcmp( pValue, "FASTCONV" ) == 0 ) { -#ifdef FIX_HRTF_LOAD hRenderConfig->split_rend_config.rendererSelection = IVAS_BIN_RENDERER_TYPE_FASTCONV; -#else - hRenderConfig->split_rend_config.rendererSelection = ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV; -#endif } else if ( strcmp( pValue, "PARAMBIN" ) == 0 ) { -#ifdef FIX_HRTF_LOAD hRenderConfig->split_rend_config.rendererSelection = IVAS_BIN_RENDERER_TYPE_PARAMBIN; -#else - hRenderConfig->split_rend_config.rendererSelection = ISAR_SPLIT_REND_RENDERER_SELECTION_PARAMBIN; -#endif } else if ( strcmp( pValue, "TDREND" ) == 0 ) { -#ifdef FIX_HRTF_LOAD hRenderConfig->split_rend_config.rendererSelection = IVAS_BIN_RENDERER_TYPE_TDREND; -#else - hRenderConfig->split_rend_config.rendererSelection = ISAR_SPLIT_REND_RENDERER_SELECTION_TDREND; -#endif } else { -- GitLab From 3e62d67f2abc589165ccfeb9d8dced8108d5b445 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 11 Nov 2024 17:25:08 +0100 Subject: [PATCH 04/10] [cleanup] accept NONBE_FIX_1213_SBA_DET_MAT_INV_3BY3 --- lib_com/ivas_spar_com.c | 4 ---- lib_com/options.h | 1 - 2 files changed, 5 deletions(-) diff --git a/lib_com/ivas_spar_com.c b/lib_com/ivas_spar_com.c index d8ec6d0ff5..79ae790488 100644 --- a/lib_com/ivas_spar_com.c +++ b/lib_com/ivas_spar_com.c @@ -1257,11 +1257,7 @@ static void ivas_calc_mat_inv( int16_t sign = 1; ivas_calc_mat_det( dbl_in_re, dim, &det_re ); -#ifdef NONBE_FIX_1213_SBA_DET_MAT_INV_3BY3 det = det_re > 0 ? 1 / max( IVAS_DBL_EPS, det_re ) : 1 / min( det_re, -IVAS_DBL_EPS ); -#else - det = det_re > 0 ? 1 / max( IVAS_DBL_EPS, det_re ) : min( det_re, -IVAS_DBL_EPS ); -#endif for ( i = 0; i < dim; i++ ) { diff --git a/lib_com/options.h b/lib_com/options.h index 82b5f5814b..6b4a78d949 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -172,7 +172,6 @@ /* #################### Start NON-BE switches ############################ */ -#define NONBE_FIX_1213_SBA_DET_MAT_INV_3BY3 /*Dolby: issue 1213: fix for inverse of det < 0*/ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -- GitLab From d29cd14f65b8105849d3f10bfc39c52d8348daf8 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 11 Nov 2024 17:26:13 +0100 Subject: [PATCH 05/10] [cleanup] accept NONBE_FIX_1197_OMASA_META_BUFFER --- lib_com/options.h | 1 - lib_dec/ivas_omasa_dec.c | 2 -- lib_rend/ivas_dirac_dec_binaural_functions.c | 6 ------ 3 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6b4a78d949..19074f4aa7 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -179,7 +179,6 @@ #define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */ -#define NONBE_FIX_1197_OMASA_META_BUFFER /* Nokia: OMASA ISM_MASA_MODE_PARAM_ONE_OBJ history zero in rateswitching */ #define NONBE_FIX_1212_TONAL_MDCT_CONCEALMENT /* FhG: Fix issue 1212, zero IGF spec also in 1st concealed frame */ diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 83f6ae0b93..3bdb2e0c76 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -337,7 +337,6 @@ ivas_error ivas_omasa_dec_config( ivas_omasa_separate_object_renderer_close( st_ivas ); } -#ifdef NONBE_FIX_1197_OMASA_META_BUFFER if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ && st_ivas->hMasaIsmData != NULL ) /* this structure is in use only in ISM_MASA_MODE_PARAM_ONE_OBJ */ { MASA_ISM_DATA_HANDLE hMasaIsmData = st_ivas->hMasaIsmData; @@ -353,7 +352,6 @@ ivas_error ivas_omasa_dec_config( set_s( hMasaIsmData->azimuth_separated_ism, 0, MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); set_s( hMasaIsmData->elevation_separated_ism, 0, MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); } -#endif if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) { diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index f6ceba8a3d..702262fa50 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -3107,17 +3107,11 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( } /* Limit target energies to non-negative values */ -#ifdef NONBE_FIX_1197_OMASA_META_BUFFER /* due to rounding, the sum may exceed 1.0f ever so slightly, so clip it */ ratioAccOrig = min( ratioAccOrig, 1.0f ); -#endif if ( masaGainEdited ) { -#ifdef NONBE_FIX_1197_OMASA_META_BUFFER ratioAccNew += gainMasaPow2 * ( 1.0f - ratioAccOrig ); -#else - ratioAccNew += gainMasaPow2 * ( 1 - ratioAccOrig ); -#endif } else { -- GitLab From 69e9982d4152ec9de7b6e34cac63dd615c275aae Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 11 Nov 2024 17:27:02 +0100 Subject: [PATCH 06/10] [cleanup] accept FIX_1139_REV_COLORATION_SHORT_T60 --- lib_com/options.h | 1 - lib_dec/ivas_binRenderer_internal.c | 2 -- lib_dec/lib_dec.c | 4 --- lib_rend/ivas_dirac_dec_binaural_functions.c | 2 -- lib_rend/ivas_prot_rend.h | 2 -- lib_rend/ivas_reverb.c | 30 -------------------- lib_rend/lib_rend.c | 6 ---- 7 files changed, 47 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 19074f4aa7..f6ad7aea0d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -182,7 +182,6 @@ #define NONBE_FIX_1212_TONAL_MDCT_CONCEALMENT /* FhG: Fix issue 1212, zero IGF spec also in 1st concealed frame */ -#define FIX_1139_REV_COLORATION_SHORT_T60 /* Nokia,FhG: Fix issue 1139, prevent sound coloration artefacts at very low reverberation times */ #define NONBE_FIX_1208_DFT_STEREO_PLC_BURST /* Ericsson: Issue 1208, fix for overflow of sample offset counter for burst error in DFT Stereo PLC. */ #define FIX_1206_ZERO_OUT_IMDCT_BUFFERS_FOR_MCT_IGNORE /* FhG: zero out all relevant imdct buffers in MCT decoding of channels with mct_chan_mode == MCT_CHAN_MODE_IGNORE */ #define NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1199: fix bug in renderer flush in OMASA JBM bitrate switching */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 05033d87a4..3a13446991 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1229,10 +1229,8 @@ ivas_error ivas_binRenderer_open( st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv->fastconvReverberationTimes, st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 , hBinRenderer->earlyPartEneCorrection -#endif ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 3b21c19a08..71c93d2089 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -3050,10 +3050,8 @@ ivas_error IVAS_DEC_FeedRenderConfig( hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, NULL -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 , NULL -#endif ) ) != IVAS_ERR_OK ) { return error; @@ -3071,10 +3069,8 @@ ivas_error IVAS_DEC_FeedRenderConfig( hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, NULL -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 , NULL -#endif ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 702262fa50..e51df6842a 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -246,10 +246,8 @@ ivas_error ivas_dirac_dec_init_binaural_data( output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 , hDiracDecBin->earlyPartEneCorrection -#endif ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 612f2656f4..583fe40348 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -934,10 +934,8 @@ ivas_error ivas_binaural_reverb_init( const int32_t sampling_rate, /* i : sampling rate */ const float *defaultTimes, /* i : default reverberation times */ const float *defaultEne /* i : default reverberation energies */ - #ifdef FIX_1139_REV_COLORATION_SHORT_T60 , float *earlyEne /* i/o: Early part energies to be modified */ - #endif ); void ivas_binaural_reverb_close( diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index 484cb43bb0..75b76d065f 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -56,9 +56,7 @@ #define CLDFB_SLOTS_PER_SECOND 800 /* Used for initializing reverb */ -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 #define REV_TIME_THRESHOLD ( 0.2f ) -#endif #define INNER_BLK_SIZE 80 /* size of data blocks used for more efficient delay line and IIR filter processing */ /* should be a divisor of the frame length at any sampling rate and an even number*/ @@ -258,7 +256,6 @@ static void ivas_binaural_reverb_setReverbTimes( } currentEnergy *= attenuationFactorPerSampleSq; } -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 /* In some configurations with small T60s it is possible the number of taps randomizes to zero. Ensure at least 1 filter tap. */ if ( tap == 0 ) @@ -269,7 +266,6 @@ static void ivas_binaural_reverb_setReverbTimes( tap = 1; actualizedEnergy = 1; } -#endif hReverb->taps[bin][ch] = tap; /* Number of taps determined at the above random procedure */ } @@ -1878,44 +1874,25 @@ ivas_error ivas_binaural_reverb_init( const int32_t sampling_rate, /* i : sampling rate */ const float *defaultTimes, /* i : default reverberation times */ const float *defaultEne /* i : default reverberation energies */ -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 , float *earlyEne /* i/o: Early part energies to be modified */ -#endif ) { ivas_error error; -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 int16_t preDelay, bin; float revTimes[CLDFB_NO_CHANNELS_MAX]; float revEne[CLDFB_NO_CHANNELS_MAX]; -#else - const float *revTimes; - const float *revEne; - float t60[CLDFB_NO_CHANNELS_MAX]; - float ene[CLDFB_NO_CHANNELS_MAX]; - int16_t preDelay; -#endif error = IVAS_ERR_OK; if ( roomAcoustics != NULL ) { -#ifndef FIX_1139_REV_COLORATION_SHORT_T60 - revTimes = t60; - revEne = ene; -#endif if ( ( error = ivas_reverb_prepare_cldfb_params( roomAcoustics, hHrtfStatistics, sampling_rate, -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 revTimes, revEne -#else - t60, - ene -#endif ) ) != IVAS_ERR_OK ) { return error; @@ -1924,20 +1901,14 @@ ivas_error ivas_binaural_reverb_init( } else { -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 for ( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ ) { revTimes[bin] = defaultTimes[bin]; revEne[bin] = defaultEne[bin]; } -#else - revTimes = defaultTimes; - revEne = defaultEne; -#endif preDelay = 10; } -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 for ( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ ) { /* Adjust the room effect parameters when the reverberation time is less than a threshold value, to avoid @@ -1963,7 +1934,6 @@ ivas_error ivas_binaural_reverb_init( earlyEne[bin] = adjustedEarlyEne; } } -#endif error = ivas_binaural_reverb_open( hReverbPr, numBins, numCldfbSlotsPerFrame, sampling_rate, revTimes, revEne, preDelay ); diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 5d8cad08e0..de90db4cd5 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4314,10 +4314,8 @@ ivas_error IVAS_REND_FeedRenderConfig( *pMasaInput->base.ctx.pOutSampleRate, NULL, NULL -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 , NULL -#endif ) ) != IVAS_ERR_OK ) { return error; @@ -4335,10 +4333,8 @@ ivas_error IVAS_REND_FeedRenderConfig( *pMasaInput->base.ctx.pOutSampleRate, NULL, NULL -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 , NULL -#endif ) ) != IVAS_ERR_OK ) { return error; @@ -8427,10 +8423,8 @@ static ivas_error ivas_masa_ext_rend_parambin_init( output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 , hDiracDecBin->earlyPartEneCorrection -#endif ) ) != IVAS_ERR_OK ) { return error; -- GitLab From 6319d2ee501e1931129fd911e343b919349b4278 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 11 Nov 2024 17:28:03 +0100 Subject: [PATCH 07/10] [cleanup] accept NONBE_FIX_1208_DFT_STEREO_PLC_BURST --- lib_com/options.h | 1 - lib_dec/ivas_stereo_dft_plc.c | 10 ---------- 2 files changed, 11 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index f6ad7aea0d..dc62278e85 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -182,7 +182,6 @@ #define NONBE_FIX_1212_TONAL_MDCT_CONCEALMENT /* FhG: Fix issue 1212, zero IGF spec also in 1st concealed frame */ -#define NONBE_FIX_1208_DFT_STEREO_PLC_BURST /* Ericsson: Issue 1208, fix for overflow of sample offset counter for burst error in DFT Stereo PLC. */ #define FIX_1206_ZERO_OUT_IMDCT_BUFFERS_FOR_MCT_IGNORE /* FhG: zero out all relevant imdct buffers in MCT decoding of channels with mct_chan_mode == MCT_CHAN_MODE_IGNORE */ #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 */ diff --git a/lib_dec/ivas_stereo_dft_plc.c b/lib_dec/ivas_stereo_dft_plc.c index 30fb49f4ce..a9024ff18f 100644 --- a/lib_dec/ivas_stereo_dft_plc.c +++ b/lib_dec/ivas_stereo_dft_plc.c @@ -80,9 +80,7 @@ void stereo_dft_res_ecu( float fac; float trigo_dec[STEREO_DFT32MS_N_8k / 2 + 1]; int16_t trigo_step; -#ifdef NONBE_FIX_1208_DFT_STEREO_PLC_BURST int16_t time_offs; -#endif set_zero( pDFT_RES, L_FRAME8k ); @@ -109,12 +107,8 @@ void stereo_dft_res_ecu( if ( k == 0 ) { mvr2r( pDFT_RES, res_buf, L_FRAME8k ); -#ifdef NONBE_FIX_1208_DFT_STEREO_PLC_BURST time_offs = min( MAX16B, hStereoDft->time_offs + output_frame ); stereo_dft_res_subst_spec( hStereoDft, res_buf, DFT_PRED_RES, time_offs, L_res, L_FRAME8k, k, num_plocs, plocs, plocsi, FALSE ); -#else - stereo_dft_res_subst_spec( hStereoDft, res_buf, DFT_PRED_RES, hStereoDft->time_offs + output_frame, L_res, L_FRAME8k, k, num_plocs, plocs, plocsi, FALSE ); -#endif rfft( res_buf, trigo_dec, L_FRAME8k, +1 ); @@ -141,11 +135,7 @@ void stereo_dft_res_ecu( } /*in case of burst error*/ -#ifdef NONBE_FIX_1208_DFT_STEREO_PLC_BURST hStereoDft->time_offs = min( MAX16B, hStereoDft->time_offs + L_FRAME8k ); -#else - hStereoDft->time_offs += L_FRAME8k; -#endif } set_zero( DFT_PRED_RES, 2 * L_res ); -- GitLab From c12340aeb0fb013f13f8c5b748a158e8668e49a8 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 11 Nov 2024 17:29:07 +0100 Subject: [PATCH 08/10] [cleanup] accept FIX_1206_ZERO_OUT_IMDCT_BUFFERS_FOR_MCT_IGNORE --- lib_com/options.h | 1 - lib_dec/ivas_mdct_core_dec.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index dc62278e85..c59af37529 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -182,7 +182,6 @@ #define NONBE_FIX_1212_TONAL_MDCT_CONCEALMENT /* FhG: Fix issue 1212, zero IGF spec also in 1st concealed frame */ -#define FIX_1206_ZERO_OUT_IMDCT_BUFFERS_FOR_MCT_IGNORE /* FhG: zero out all relevant imdct buffers in MCT decoding of channels with mct_chan_mode == MCT_CHAN_MODE_IGNORE */ #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 */ diff --git a/lib_dec/ivas_mdct_core_dec.c b/lib_dec/ivas_mdct_core_dec.c index e07b44da03..6049a4593c 100644 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -865,7 +865,6 @@ void ivas_mdct_core_reconstruct( { set_f( &synth[k * L_frame[ch]], 0.f, L_frame[ch] ); set_f( &synthFB[k * L_frame[ch]], 0.f, L_frameTCX[ch] ); -#ifdef FIX_1206_ZERO_OUT_IMDCT_BUFFERS_FOR_MCT_IGNORE /* Note: these buffers are not subframe-based, hence no indexing with k */ set_f( &st->hHQ_core->old_outLB[0], 0.f, L_frame[ch] ); set_f( &st->hHQ_core->old_out[0], 0.f, L_frameTCX[ch] ); @@ -873,7 +872,6 @@ void ivas_mdct_core_reconstruct( set_f( &st->hTcxDec->syn_OverlFB[0], 0.f, L_frameTCX[ch] / 2 ); set_f( &st->hTcxDec->syn_Overl_TDAC[0], 0.f, L_frame[ch] / 2 ); set_f( &st->hTcxDec->syn_Overl_TDACFB[0], 0.f, L_frameTCX[ch] / 2 ); -#endif } } -- GitLab From e11354bc3339d9e9e65e4cdf6bcdaee54dded688 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 11 Nov 2024 17:30:15 +0100 Subject: [PATCH 09/10] [cleanup] accept NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH --- lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 4 ---- lib_dec/ivas_masa_dec.c | 13 ------------- lib_dec/lib_dec.c | 7 ------- 4 files changed, 25 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index c59af37529..0d18daf5ea 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -182,7 +182,6 @@ #define NONBE_FIX_1212_TONAL_MDCT_CONCEALMENT /* FhG: Fix issue 1212, zero IGF spec also in 1st concealed frame */ -#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 */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 423dfebec9..237aec118f 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -573,9 +573,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 ) @@ -813,14 +811,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; diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 622a6dce64..2b9d071901 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1468,19 +1468,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; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 71c93d2089..b9a4cc1374 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1010,13 +1010,6 @@ ivas_error IVAS_DEC_ReadFormat( 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 ) { -- GitLab From f84fea7e442e6a904d66f94a439b0f09e16fb845 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 11 Nov 2024 17:32:23 +0100 Subject: [PATCH 10/10] formatting --- lib_dec/ivas_binRenderer_internal.c | 6 +-- lib_dec/ivas_init_dec.c | 8 +-- lib_dec/ivas_jbm_dec.c | 4 +- lib_dec/ivas_mc_param_dec.c | 26 +++++----- lib_dec/lib_dec.c | 53 +++++++++----------- lib_rend/ivas_dirac_dec_binaural_functions.c | 6 +-- lib_rend/ivas_reverb.c | 3 +- lib_rend/lib_rend.c | 18 +++---- lib_util/hrtf_file_reader.c | 2 +- lib_util/hrtf_file_reader.h | 6 +-- 10 files changed, 58 insertions(+), 74 deletions(-) diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 3a13446991..587f2c7b2b 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1228,10 +1228,8 @@ ivas_error ivas_binRenderer_open( pRoomAcoustics, st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv->fastconvReverberationTimes, - st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections - , - hBinRenderer->earlyPartEneCorrection - ) ) != IVAS_ERR_OK ) + st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections, + hBinRenderer->earlyPartEneCorrection ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 237aec118f..11516f7963 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1823,10 +1823,10 @@ ivas_error ivas_init_decoder( reset_indices_dec( st_ivas->hSCE[0]->hCoreCoder[0] ); - if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) - { - return error; - } + if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) + { + return error; + } } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 870337b9b8..e1e29265fd 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -814,12 +814,12 @@ void ivas_jbm_dec_feed_tc_to_renderer( } n_render_timeslots = st_ivas->hTcBuffer->n_samples_available / st_ivas->hTcBuffer->n_samples_granularity; - if ( st_ivas->ivas_format == ISM_FORMAT ) + if ( st_ivas->ivas_format == ISM_FORMAT ) { /* Rendering */ if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { - 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 ); } diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 3279c8fb86..426d9526a8 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -1337,24 +1337,24 @@ void ivas_param_mc_dec_digest_tc( nchan_transport = st_ivas->nchan_transport; - /* slot loop for gathering the input data */ - for ( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ ) + /* slot loop for gathering the input data */ + for ( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ ) + { + if ( st_ivas->hDecoderConfig->Opt_tsm ) { - if ( st_ivas->hDecoderConfig->Opt_tsm ) - { - float RealBuffer[CLDFB_NO_CHANNELS_MAX]; - float ImagBuffer[CLDFB_NO_CHANNELS_MAX]; + float RealBuffer[CLDFB_NO_CHANNELS_MAX]; + float ImagBuffer[CLDFB_NO_CHANNELS_MAX]; - /* CLDFB Analysis*/ - for ( ch = 0; ch < nchan_transport; ch++ ) - { - cldfbAnalysis_ts( &( transport_channels_f[ch][hParamMC->num_freq_bands * slot_idx] ), RealBuffer, ImagBuffer, hParamMC->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); + /* CLDFB Analysis*/ + for ( ch = 0; ch < nchan_transport; ch++ ) + { + cldfbAnalysis_ts( &( transport_channels_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 ); - } + 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 ); } } + } pop_wmops(); diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index b9a4cc1374..9fe3a8132e 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -822,7 +822,7 @@ ivas_error IVAS_DEC_FeedFrame_Serial( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ uint16_t *serial, /* i : buffer containing serial input bitstream. Each bit should be stored as a single uint16_t value */ const uint16_t num_bits, /* i : number of bits in input bitstream */ - int16_t bfi /* i : bad frame indicator flag */ + int16_t bfi /* i : bad frame indicator flag */ ) { ivas_error error; @@ -1560,7 +1560,6 @@ ivas_error IVAS_DEC_PrepareRenderer( } - /*---------------------------------------------------------------------* * IVAS_DEC_GetSamplesRenderer( ) * @@ -1672,24 +1671,24 @@ ivas_error IVAS_DEC_GetSamplesRenderer( hIvasDec->nSamplesFlushed = 0; } - /* render IVAS frames directly to the output buffer */ - nSamplesToRender = nSamplesAsked - nSamplesRendered; - if ( ( error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesRendered_loop, &hIvasDec->nSamplesAvailableNext, pcmType, pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ) ) ) != IVAS_ERR_OK ) - { - return error; - } + /* render IVAS frames directly to the output buffer */ + nSamplesToRender = nSamplesAsked - nSamplesRendered; + if ( ( error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesRendered_loop, &hIvasDec->nSamplesAvailableNext, pcmType, pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ) ) ) != IVAS_ERR_OK ) + { + return error; + } - nSamplesRendered += nSamplesRendered_loop; - nSamplesToRender -= nSamplesRendered_loop; - if ( hIvasDec->nSamplesAvailableNext == 0 ) - { - *needNewFrame = true; - hIvasDec->needNewFrame = true; - } - else - { - *needNewFrame = false; - } + nSamplesRendered += nSamplesRendered_loop; + nSamplesToRender -= nSamplesRendered_loop; + if ( hIvasDec->nSamplesAvailableNext == 0 ) + { + *needNewFrame = true; + hIvasDec->needNewFrame = true; + } + else + { + *needNewFrame = false; + } } *nOutSamples = nSamplesRendered; @@ -3042,10 +3041,8 @@ ivas_error IVAS_DEC_FeedRenderConfig( &( hRenderConfig->roomAcoustics ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, - NULL - , - NULL - ) ) != IVAS_ERR_OK ) + NULL, + NULL ) ) != IVAS_ERR_OK ) { return error; } @@ -3061,10 +3058,8 @@ ivas_error IVAS_DEC_FeedRenderConfig( &( hRenderConfig->roomAcoustics ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, - NULL - , - NULL - ) ) != IVAS_ERR_OK ) + NULL, + NULL ) ) != IVAS_ERR_OK ) { return error; } @@ -3423,10 +3418,10 @@ ivas_error IVAS_DEC_VoIP_GetSamples( JbmTraceFileWriterFn jbmWriterFn, void *jbmWriter, #endif - bool *bitstreamReadDone, /* o : flag indicating that bitstream was read */ + bool *bitstreamReadDone, /* o : flag indicating that bitstream was read */ uint16_t *nSamplesRendered, /* o : number of samples rendered */ bool *parametersAvailableForEditing, /* o : indicates whether objects editing is available */ - const uint32_t systemTimestamp_ms /* i : current system timestamp */ + const uint32_t systemTimestamp_ms /* i : current system timestamp */ ) { Decoder_Struct *st_ivas; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index e51df6842a..7acf77dfd9 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -245,10 +245,8 @@ ivas_error ivas_dirac_dec_init_binaural_data( pRoomAcoustics, output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, - ( *phHrtfParambin )->parametricReverberationEneCorrections - , - hDiracDecBin->earlyPartEneCorrection - ) ) != IVAS_ERR_OK ) + ( *phHrtfParambin )->parametricReverberationEneCorrections, + hDiracDecBin->earlyPartEneCorrection ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index 75b76d065f..a717f7b17b 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -1892,8 +1892,7 @@ ivas_error ivas_binaural_reverb_init( hHrtfStatistics, sampling_rate, revTimes, - revEne - ) ) != IVAS_ERR_OK ) + revEne ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index de90db4cd5..3c19a8c268 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4313,10 +4313,8 @@ ivas_error IVAS_REND_FeedRenderConfig( &( hRenderConfig->roomAcoustics ), *pMasaInput->base.ctx.pOutSampleRate, NULL, - NULL - , - NULL - ) ) != IVAS_ERR_OK ) + NULL, + NULL ) ) != IVAS_ERR_OK ) { return error; } @@ -4332,10 +4330,8 @@ ivas_error IVAS_REND_FeedRenderConfig( &( hRenderConfig->roomAcoustics ), *pMasaInput->base.ctx.pOutSampleRate, NULL, - NULL - , - NULL - ) ) != IVAS_ERR_OK ) + NULL, + NULL ) ) != IVAS_ERR_OK ) { return error; } @@ -8422,10 +8418,8 @@ static ivas_error ivas_masa_ext_rend_parambin_init( pRoomAcoustics, output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, - ( *phHrtfParambin )->parametricReverberationEneCorrections - , - hDiracDecBin->earlyPartEneCorrection - ) ) != IVAS_ERR_OK ) + ( *phHrtfParambin )->parametricReverberationEneCorrections, + hDiracDecBin->earlyPartEneCorrection ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 4332989b19..5979e0a251 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -1889,7 +1889,7 @@ ivas_error load_fastconv_HRTF_from_binary( IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv, /* i/o: FastConv HRTF handle */ const int16_t room_reverb_flag, /* i : room reverb flag */ const IVAS_AUDIO_CONFIG intern_audio_config, /* i : internal audio configuration */ - const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ + const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ) { FILE *f_hrtf; diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index 262ff8cee5..b98cbbd03a 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -132,9 +132,9 @@ void destroy_SetOfHRTF( ivas_error load_fastconv_HRTF_from_binary( IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv, /* i/o: FastConv HRTF handle */ - const int16_t room_reverb_flag, /* i : room reverb flag */ - IVAS_AUDIO_CONFIG intern_audio_config, /* i : internal audio configuration */ - const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ + const int16_t room_reverb_flag, /* i : room reverb flag */ + IVAS_AUDIO_CONFIG intern_audio_config, /* i : internal audio configuration */ + const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ); /*---------------------------------------------------------------------* -- GitLab