Loading lib_rend/ivas_crend.c +11 −0 Original line number Diff line number Diff line Loading @@ -1360,7 +1360,11 @@ ivas_rend_openMultiBinCrend( ivas_error error; #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, NULL /* hHrtfStatistics */, output_Fs, pMultiBinPoseData->num_poses ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, output_Fs, pMultiBinPoseData->num_poses ) ) != IVAS_ERR_OK ) #endif #else if ( ( error = ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, output_Fs ) ) != IVAS_ERR_OK ) #endif Loading @@ -1385,6 +1389,9 @@ ivas_error ivas_rend_openCrend( const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, HRTFS_CREND_HANDLE hSetOfHRTF, #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES HRTFS_STATISTICS_HANDLE hHrtfStatistics, #endif #ifdef SPLIT_REND_WITH_HEAD_ROT const int32_t output_Fs, const int16_t num_poses Loading Loading @@ -1556,7 +1563,11 @@ ivas_error ivas_rend_openCrend( if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_reverb_open( &( hCrend->hReverb ), hHrtfStatistics, hRendCfg, output_Fs ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_reverb_open( &( hCrend->hReverb ), inConfig, ( *pCrend )->hHrtfCrend, NULL, hRendCfg, output_Fs ) ) != IVAS_ERR_OK ) #endif { return error; } Loading lib_rend/ivas_dirac_dec_binaural_functions.c +4 −0 Original line number Diff line number Diff line Loading @@ -246,8 +246,12 @@ ivas_error ivas_dirac_dec_init_binaural_data( #endif ) /* open reverb only for the main direction */ { #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, st_ivas->hHrtfParambin->parametricReverberationTimes, st_ivas->hHrtfParambin->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) #else /* Todo Philips: Room acoustics should be passed here once the underlying part works. Probably enough to pick it from st_ivas but you know best. */ if ( ( error = ivas_binaural_reverb_open_parambin( &hDiracDecBin->hReverb, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, NULL, output_Fs, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) #endif { return error; } Loading lib_rend/ivas_hrtf.c +98 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,9 @@ #include "ivas_error.h" #include "wmc_auto.h" #include "ivas_prot.h" #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES #include "ivas_rom_binaural_crend_head.h" #endif /*-----------------------------------------------------------------------* * ivas_HRTF_binary_open() Loading Loading @@ -210,3 +213,98 @@ void ivas_HRTF_parambin_binary_close( return; } #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*-----------------------------------------------------------------------* * ivas_HRTF_statistics_binary_open() * * Allocate HRTF binary handle for statistics handler *-----------------------------------------------------------------------*/ ivas_error ivas_HRTF_statistics_binary_open( HRTFS_STATISTICS **hHrtfStatistics ) { *hHrtfStatistics = (HRTFS_STATISTICS *) malloc( sizeof( HRTFS_STATISTICS ) ); if ( *hHrtfStatistics == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for statistics HRTF tables!" ); } return IVAS_ERR_OK; } /*-----------------------------------------------------------------------* * ivas_HRTF_statistics_close() * * Close HRTF binary handle for statistics handler *-----------------------------------------------------------------------*/ void ivas_HRTF_statistics_close( HRTFS_STATISTICS **hHrtfStatistics ) { if ( hHrtfStatistics == NULL || *hHrtfStatistics == NULL ) { return; } free( *hHrtfStatistics ); *hHrtfStatistics = NULL; return; } /*-----------------------------------------------------------------------* * ivas_HRTF_statistics_init() * * Allocates HRTF statistics handle and initializes from ROM *-----------------------------------------------------------------------*/ ivas_error ivas_HRTF_statistics_init( HRTFS_STATISTICS_HANDLE *hHrtfStatistics, int32_t sampleRate ) { HRTFS_STATISTICS *HrtfStatistics; if ( hHrtfStatistics != NULL && *hHrtfStatistics != NULL ) { /* Tables already loaded from file */ return IVAS_ERR_OK; } /* Initialise tables from ROM */ if ( ( HrtfStatistics = (HRTFS_STATISTICS *) malloc( sizeof( HRTFS_STATISTICS ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for statistics HRTF tables!" ); } HrtfStatistics->average_energy_l = NULL; HrtfStatistics->average_energy_r = NULL; HrtfStatistics->inter_aural_coherence = NULL; switch ( sampleRate ) { case 48000: HrtfStatistics->average_energy_l = defaultHRIR_left_avg_power_48kHz; HrtfStatistics->average_energy_r = defaultHRIR_right_avg_power_48kHz; HrtfStatistics->inter_aural_coherence = defaultHRIR_coherence_48kHz; break; case 32000: HrtfStatistics->average_energy_l = defaultHRIR_left_avg_power_32kHz; HrtfStatistics->average_energy_r = defaultHRIR_right_avg_power_32kHz; HrtfStatistics->inter_aural_coherence = defaultHRIR_coherence_32kHz; break; case 16000: HrtfStatistics->average_energy_l = defaultHRIR_left_avg_power_16kHz; HrtfStatistics->average_energy_r = defaultHRIR_right_avg_power_16kHz; HrtfStatistics->inter_aural_coherence = defaultHRIR_coherence_16kHz; break; } HrtfStatistics->fromROM = TRUE; *hHrtfStatistics = HrtfStatistics; return IVAS_ERR_OK; } #endif lib_rend/ivas_objectRenderer_mix.c +4 −0 Original line number Diff line number Diff line Loading @@ -393,6 +393,8 @@ static ivas_error DefaultBSplineModel( model = &( HrFiltSet_p->ModelParams ); modelITD = &( HrFiltSet_p->ModelParamsITD ); #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES #else switch ( output_Fs ) { case 48000: Loading @@ -411,6 +413,8 @@ static ivas_error DefaultBSplineModel( HrFiltSet_p->lr_energy_and_iac[2] = defaultHRIR_coherence_16kHz; break; } #endif /* Set ROM flag for correct deallocation */ model->modelROM = TRUE; Loading Loading
lib_rend/ivas_crend.c +11 −0 Original line number Diff line number Diff line Loading @@ -1360,7 +1360,11 @@ ivas_rend_openMultiBinCrend( ivas_error error; #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, NULL /* hHrtfStatistics */, output_Fs, pMultiBinPoseData->num_poses ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, output_Fs, pMultiBinPoseData->num_poses ) ) != IVAS_ERR_OK ) #endif #else if ( ( error = ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, output_Fs ) ) != IVAS_ERR_OK ) #endif Loading @@ -1385,6 +1389,9 @@ ivas_error ivas_rend_openCrend( const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, HRTFS_CREND_HANDLE hSetOfHRTF, #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES HRTFS_STATISTICS_HANDLE hHrtfStatistics, #endif #ifdef SPLIT_REND_WITH_HEAD_ROT const int32_t output_Fs, const int16_t num_poses Loading Loading @@ -1556,7 +1563,11 @@ ivas_error ivas_rend_openCrend( if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_reverb_open( &( hCrend->hReverb ), hHrtfStatistics, hRendCfg, output_Fs ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_reverb_open( &( hCrend->hReverb ), inConfig, ( *pCrend )->hHrtfCrend, NULL, hRendCfg, output_Fs ) ) != IVAS_ERR_OK ) #endif { return error; } Loading
lib_rend/ivas_dirac_dec_binaural_functions.c +4 −0 Original line number Diff line number Diff line Loading @@ -246,8 +246,12 @@ ivas_error ivas_dirac_dec_init_binaural_data( #endif ) /* open reverb only for the main direction */ { #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, st_ivas->hHrtfParambin->parametricReverberationTimes, st_ivas->hHrtfParambin->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) #else /* Todo Philips: Room acoustics should be passed here once the underlying part works. Probably enough to pick it from st_ivas but you know best. */ if ( ( error = ivas_binaural_reverb_open_parambin( &hDiracDecBin->hReverb, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, NULL, output_Fs, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) #endif { return error; } Loading
lib_rend/ivas_hrtf.c +98 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,9 @@ #include "ivas_error.h" #include "wmc_auto.h" #include "ivas_prot.h" #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES #include "ivas_rom_binaural_crend_head.h" #endif /*-----------------------------------------------------------------------* * ivas_HRTF_binary_open() Loading Loading @@ -210,3 +213,98 @@ void ivas_HRTF_parambin_binary_close( return; } #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*-----------------------------------------------------------------------* * ivas_HRTF_statistics_binary_open() * * Allocate HRTF binary handle for statistics handler *-----------------------------------------------------------------------*/ ivas_error ivas_HRTF_statistics_binary_open( HRTFS_STATISTICS **hHrtfStatistics ) { *hHrtfStatistics = (HRTFS_STATISTICS *) malloc( sizeof( HRTFS_STATISTICS ) ); if ( *hHrtfStatistics == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for statistics HRTF tables!" ); } return IVAS_ERR_OK; } /*-----------------------------------------------------------------------* * ivas_HRTF_statistics_close() * * Close HRTF binary handle for statistics handler *-----------------------------------------------------------------------*/ void ivas_HRTF_statistics_close( HRTFS_STATISTICS **hHrtfStatistics ) { if ( hHrtfStatistics == NULL || *hHrtfStatistics == NULL ) { return; } free( *hHrtfStatistics ); *hHrtfStatistics = NULL; return; } /*-----------------------------------------------------------------------* * ivas_HRTF_statistics_init() * * Allocates HRTF statistics handle and initializes from ROM *-----------------------------------------------------------------------*/ ivas_error ivas_HRTF_statistics_init( HRTFS_STATISTICS_HANDLE *hHrtfStatistics, int32_t sampleRate ) { HRTFS_STATISTICS *HrtfStatistics; if ( hHrtfStatistics != NULL && *hHrtfStatistics != NULL ) { /* Tables already loaded from file */ return IVAS_ERR_OK; } /* Initialise tables from ROM */ if ( ( HrtfStatistics = (HRTFS_STATISTICS *) malloc( sizeof( HRTFS_STATISTICS ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for statistics HRTF tables!" ); } HrtfStatistics->average_energy_l = NULL; HrtfStatistics->average_energy_r = NULL; HrtfStatistics->inter_aural_coherence = NULL; switch ( sampleRate ) { case 48000: HrtfStatistics->average_energy_l = defaultHRIR_left_avg_power_48kHz; HrtfStatistics->average_energy_r = defaultHRIR_right_avg_power_48kHz; HrtfStatistics->inter_aural_coherence = defaultHRIR_coherence_48kHz; break; case 32000: HrtfStatistics->average_energy_l = defaultHRIR_left_avg_power_32kHz; HrtfStatistics->average_energy_r = defaultHRIR_right_avg_power_32kHz; HrtfStatistics->inter_aural_coherence = defaultHRIR_coherence_32kHz; break; case 16000: HrtfStatistics->average_energy_l = defaultHRIR_left_avg_power_16kHz; HrtfStatistics->average_energy_r = defaultHRIR_right_avg_power_16kHz; HrtfStatistics->inter_aural_coherence = defaultHRIR_coherence_16kHz; break; } HrtfStatistics->fromROM = TRUE; *hHrtfStatistics = HrtfStatistics; return IVAS_ERR_OK; } #endif
lib_rend/ivas_objectRenderer_mix.c +4 −0 Original line number Diff line number Diff line Loading @@ -393,6 +393,8 @@ static ivas_error DefaultBSplineModel( model = &( HrFiltSet_p->ModelParams ); modelITD = &( HrFiltSet_p->ModelParamsITD ); #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES #else switch ( output_Fs ) { case 48000: Loading @@ -411,6 +413,8 @@ static ivas_error DefaultBSplineModel( HrFiltSet_p->lr_energy_and_iac[2] = defaultHRIR_coherence_16kHz; break; } #endif /* Set ROM flag for correct deallocation */ model->modelROM = TRUE; Loading