From b0ec5f47effb63aaeda6c7a8edb4a88b7dbb3de3 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 23 Sep 2025 14:52:09 +0200 Subject: [PATCH 1/4] address HRTF leftovers --- apps/decoder.c | 2 +- apps/renderer.c | 6 ++--- lib_com/common_api_types.h | 2 +- lib_dec/ivas_binRenderer_internal.c | 8 ++---- lib_dec/lib_dec.c | 4 +-- lib_dec/lib_dec.h | 2 +- lib_rend/ivas_crend.c | 14 +++++------ lib_rend/ivas_stat_rend.h | 5 ++-- lib_rend/lib_rend.c | 38 ++++++++++++++--------------- lib_rend/lib_rend.h | 6 ++--- lib_util/hrtf_file_reader.c | 21 +++++++--------- lib_util/hrtf_file_reader.h | 4 +-- 12 files changed, 52 insertions(+), 60 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 41089d057e..444367122d 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -150,7 +150,7 @@ typedef struct hrtfFileReader *hrtfReader; char *hrtfFileName; - IVAS_DEC_HRTF_HANDLE *hHrtfTD; + IVAS_DEC_HRTF_TD_HANDLE *hHrtfTD; IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics; diff --git a/apps/renderer.c b/apps/renderer.c index cf5a7e33d2..caa1ce00d8 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -682,7 +682,7 @@ int main( IVAS_DEC_HRTF_CREND_HANDLE *hHrtfCrend = NULL; IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL; IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL; - IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; + IVAS_DEC_HRTF_TD_HANDLE *hHrtfTD = NULL; IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; IsmPositionProvider *positionProvider = NULL; LfeRoutingConfig *lfeRoutingConfigs[RENDERER_MAX_MC_INPUTS]; @@ -961,9 +961,9 @@ int main( if ( hrtfFileReader != NULL ) { - if ( ( error = IVAS_REND_GetHrtfHandle( hIvasRend, &hHrtfTD ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_REND_GetHrtfTdHandle( hIvasRend, &hHrtfTD ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nIVAS_REND_GetHrtfHandle failed: %s\n\n", ivas_error_to_string( error ) ); + fprintf( stderr, "\nIVAS_REND_GetHrtfTdHandle failed: %s\n\n", ivas_error_to_string( error ) ); goto cleanup; } diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index f5b13c0dea..80c90d6b31 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -176,7 +176,7 @@ typedef enum typedef struct ivas_masa_metadata_frame_struct *IVAS_MASA_METADATA_HANDLE; typedef struct ivas_masa_decoder_ext_out_meta_struct *IVAS_MASA_DECODER_EXT_OUT_META_HANDLE; -typedef struct ivas_hrtf_TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_HANDLE; +typedef struct ivas_hrtf_TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_TD_HANDLE; typedef struct ivas_hrtf_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE; typedef struct ivas_hrtf_fastconv_struct *IVAS_DEC_HRTF_FASTCONV_HANDLE; typedef struct ivas_hrtf_parambin_struct *IVAS_DEC_HRTF_PARAMBIN_HANDLE; diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 8cda55017c..d6ba1e0c15 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -795,8 +795,6 @@ ivas_error ivas_rend_openCldfbRend( int16_t convBand; ivas_error error; - error = IVAS_ERR_OK; - /*-----------------------------------------------------------------* * prepare library opening *-----------------------------------------------------------------*/ @@ -866,7 +864,7 @@ ivas_error ivas_rend_openCldfbRend( pCldfbRend->hCldfbRend = hBinRenderer; - return error; + return IVAS_ERR_OK; } @@ -885,8 +883,6 @@ ivas_error ivas_binRenderer_open( ivas_error error; const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics; - error = IVAS_ERR_OK; - /*-----------------------------------------------------------------* * prepare library opening *-----------------------------------------------------------------*/ @@ -1045,7 +1041,7 @@ ivas_error ivas_binRenderer_open( /* Copy the handles to main handle */ st_ivas->hBinRenderer = hBinRenderer; - return error; + return IVAS_ERR_OK; } diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 0f54199425..95ebbcb1c7 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2943,8 +2943,8 @@ ivas_error IVAS_DEC_FeedCustomLsData( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetHrtfTDrendHandle( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HRTF_TD_HANDLE **hHrtfTD /* o : HRTF handle */ ) { if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfTD == NULL ) diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 18298954c4..3fff28470d 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -457,7 +457,7 @@ ivas_error IVAS_DEC_FeedCustomLsData( /*! r: error code */ ivas_error IVAS_DEC_GetHrtfTDrendHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ + IVAS_DEC_HRTF_TD_HANDLE **hHrtfTD /* o : HRTF handle */ ); /*! r: error code */ diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index b120fd6c6a..9134667502 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -104,15 +104,15 @@ ivas_error ivas_Crend_hrtf_init( *------------------------------------------------------------------------*/ static ivas_error ivas_hrtf_open( - HRTFS_HANDLE *hHrtf_out /* o : HRTF handle */ + HRTFS_CREND_HANDLE *hHrtf_out /* o : HRTF handle */ ) { - HRTFS_HANDLE hHrtf; + HRTFS_CREND_HANDLE hHrtf; ivas_error error; if ( *hHrtf_out == NULL ) { - if ( ( hHrtf = (HRTFS_HANDLE) malloc( sizeof( HRTFS_DATA ) ) ) == NULL ) + if ( ( hHrtf = (HRTFS_CREND_HANDLE) malloc( sizeof( HRTFS_CREND_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend HRTFS Handle\n" ); } @@ -140,7 +140,7 @@ static ivas_error ivas_hrtf_open( *------------------------------------------------------------------------*/ static void ivas_hrtf_close( - HRTFS_HANDLE *hHrtf /* i/o: HRTF handle */ + HRTFS_CREND_HANDLE *hHrtf /* i/o: Crend HRTF handle */ ) { if ( hHrtf == NULL || *hHrtf == NULL ) @@ -172,7 +172,7 @@ static ivas_error ivas_rend_initCrend( int16_t i, j, tmp, tmp2; int16_t nchan_in; IVAS_REND_AudioConfigType inConfigType; - HRTFS_HANDLE hHrtf; + HRTFS_CREND_HANDLE hHrtf; ivas_error error; inConfigType = getAudioConfigType( inConfig ); @@ -1158,13 +1158,11 @@ ivas_error ivas_rend_openCrend( { int16_t i, subframe_length; int32_t max_total_ir_len; - HRTFS_HANDLE hHrtf; + HRTFS_CREND_HANDLE hHrtf; CREND_HANDLE hCrend; ivas_error error; int16_t pos_idx; - error = IVAS_ERR_OK; - if ( ( error = ivas_rend_initCrendWrapper( pCrend, num_poses ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 69fcb30fb8..2552ef8ca1 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1182,7 +1182,7 @@ typedef struct ivas_hrtf_crend_structure uint16_t *pIndex_frequency_max_dyn[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS]; uint16_t *pIndex_frequency_max_diffuse_dyn[BINAURAL_CHANNELS]; -} HRTFS_DATA, *HRTFS_HANDLE, HRTFS_CREND_DATA, *HRTFS_CREND_HANDLE; // VE: all instance of HRTFS_DATAand *HRTFS_HANDLE should be renamed to HRTFS_CREND_DATA and *HRTFS_CREND_HANDLE +} HRTFS_CREND_DATA, *HRTFS_CREND_HANDLE; /* Main Crend structure */ typedef struct ivas_crend_state_t @@ -1209,7 +1209,7 @@ typedef struct ivas_binaural_crend_wrapper_struct { int32_t binaural_latency_ns; CREND_HANDLE hCrend[MAX_HEAD_ROT_POSES]; - HRTFS_HANDLE hHrtfCrend; + HRTFS_CREND_HANDLE hHrtfCrend; } CREND_WRAPPER, *CREND_WRAPPER_HANDLE; @@ -1272,6 +1272,7 @@ typedef struct ivas_hrtf_statistics_struct float *average_energy_r_dyn; float *inter_aural_coherence_dyn; int16_t fromROM; /* Flag that indicates that the pointers point to tables in ROM (controls init/dealloc).*/ + } HRTFS_STATISTICS, *HRTFS_STATISTICS_HANDLE; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 52994cdba1..c917353459 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -183,10 +183,10 @@ typedef struct typedef struct hrtf_handles { - IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF; + IVAS_DEC_HRTF_CREND_HANDLE hHrtfCrend; IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv; IVAS_DEC_HRTF_PARAMBIN_HANDLE hHrtfParambin; - IVAS_DEC_HRTF_HANDLE hHrtfTD; + IVAS_DEC_HRTF_TD_HANDLE hHrtfTD; IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics; } hrtf_handles; @@ -1672,7 +1672,7 @@ static ivas_error setRendInputActiveIsm( } else if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { - if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, 1, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hHrtfCrend, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, 1, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) { return error; } @@ -2631,7 +2631,7 @@ static ivas_error setRendInputActiveMc( if ( getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) { - if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, FALSE ) ) != IVAS_ERR_OK ) + if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg, hrtfs->hHrtfCrend, hrtfs->hHrtfStatistics, FALSE ) ) != IVAS_ERR_OK ) { return error; } @@ -2948,7 +2948,7 @@ static ivas_error setRendInputActiveSba( } } - if ( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics ) ) != IVAS_ERR_OK ) + if ( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg, hrtfs->hHrtfCrend, hrtfs->hHrtfStatistics ) ) != IVAS_ERR_OK ) { return error; } @@ -3241,7 +3241,7 @@ ivas_error IVAS_REND_Open( hIvasRend->hHrtfs.hHrtfFastConv = NULL; hIvasRend->hHrtfs.hHrtfParambin = NULL; hIvasRend->hHrtfs.hHrtfTD = NULL; - hIvasRend->hHrtfs.hSetOfHRTF = NULL; + hIvasRend->hHrtfs.hHrtfCrend = NULL; hIvasRend->hHrtfs.hHrtfStatistics = NULL; if ( asHrtfBinary ) { @@ -3249,7 +3249,7 @@ ivas_error IVAS_REND_Open( { return error; } - if ( ( error = ivas_HRTF_CRend_binary_open( &( hIvasRend->hHrtfs.hSetOfHRTF ) ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_HRTF_CRend_binary_open( &( hIvasRend->hHrtfs.hHrtfCrend ) ) ) != IVAS_ERR_OK ) { return error; } @@ -3947,7 +3947,7 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( inputMc->base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, - hIvasRend->hHrtfs.hSetOfHRTF, + hIvasRend->hHrtfs.hHrtfCrend, hIvasRend->hHrtfs.hHrtfStatistics, FALSE ) ) != IVAS_ERR_OK ) { @@ -4807,7 +4807,7 @@ ivas_error IVAS_REND_SetHeadRotation( hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, - hIvasRend->hHrtfs.hSetOfHRTF, + hIvasRend->hHrtfs.hHrtfCrend, hIvasRend->hHrtfs.hHrtfStatistics, TRUE ) ) != IVAS_ERR_OK ) { @@ -4871,7 +4871,7 @@ ivas_error IVAS_REND_DisableHeadRotation( hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, - hIvasRend->hHrtfs.hSetOfHRTF, + hIvasRend->hHrtfs.hHrtfCrend, hIvasRend->hHrtfs.hHrtfStatistics, TRUE ) ) != IVAS_ERR_OK ) { @@ -7961,7 +7961,7 @@ ivas_error IVAS_REND_GetSplitBinauralBitstream( Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, #endif - ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, @@ -8093,7 +8093,7 @@ void IVAS_REND_Close( /* Parametric binauralizer HRTF filters */ ivas_HRTF_binary_close( &( hIvasRend->hHrtfs.hHrtfTD ) ); - ivas_HRTF_CRend_binary_close( &( hIvasRend->hHrtfs.hSetOfHRTF ) ); + ivas_HRTF_CRend_binary_close( &( hIvasRend->hHrtfs.hHrtfCrend ) ); ivas_HRTF_fastconv_binary_close( &( hIvasRend->hHrtfs.hHrtfFastConv ) ); ivas_HRTF_parambin_binary_close( &( hIvasRend->hHrtfs.hHrtfParambin ) ); ivas_HRTF_statistics_close( &( hIvasRend->hHrtfs.hHrtfStatistics ) ); @@ -8250,14 +8250,14 @@ int32_t IVAS_REND_GetCntFramesLimited( /*---------------------------------------------------------------------* - * IVAS_REND_GetHrtfHandle( ) + * IVAS_REND_GetHrtfTdHandle( ) * * *---------------------------------------------------------------------*/ -ivas_error IVAS_REND_GetHrtfHandle( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ - IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ +ivas_error IVAS_REND_GetHrtfTdHandle( + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ + IVAS_DEC_HRTF_TD_HANDLE **hHrtfTD /* o : TD rend. HRTF handle */ ) { if ( hIvasRend == NULL || hIvasRend->hHrtfs.hHrtfTD == NULL ) @@ -8279,15 +8279,15 @@ ivas_error IVAS_REND_GetHrtfHandle( ivas_error IVAS_REND_GetHrtfCRendHandle( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ - IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ + IVAS_DEC_HRTF_CREND_HANDLE **hHrtfCrend /* o : Crend HRTF handle */ ) { - if ( hIvasRend == NULL || hIvasRend->hHrtfs.hSetOfHRTF == NULL ) + if ( hIvasRend == NULL || hIvasRend->hHrtfs.hHrtfCrend == NULL ) { return IVAS_ERR_WRONG_PARAMS; } - *hSetOfHRTF = &hIvasRend->hHrtfs.hSetOfHRTF; + *hHrtfCrend = &hIvasRend->hHrtfs.hHrtfCrend; return IVAS_ERR_OK; } diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index c03dd72485..2e635ad479 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -194,15 +194,15 @@ ivas_error IVAS_REND_GetDelay( ); /*! r: error code */ -ivas_error IVAS_REND_GetHrtfHandle( +ivas_error IVAS_REND_GetHrtfTdHandle( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS render handle */ - IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ + IVAS_DEC_HRTF_TD_HANDLE **hHrtfTD /* o : TD rend. HRTF handle */ ); /*! r: error code */ ivas_error IVAS_REND_GetHrtfCRendHandle( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ - IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ + IVAS_DEC_HRTF_CREND_HANDLE **hHrtfCrend /* o : Crend HRTF handle */ ); ivas_error IVAS_REND_GetHrtfFastConvHandle( diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 3347a0c9ab..66c886b7b6 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -436,8 +436,8 @@ static ivas_error TDREND_LoadBSplineBinaryITD( --------------------------------------------------------------------*/ static ivas_error TDREND_LoadBSplineBinary( - IVAS_DEC_HRTF_HANDLE HrFiltSet_p, /* i/o: HR filter model parameter structure */ - FILE *f_hrtf /* i : HR filter data file handle */ + IVAS_DEC_HRTF_TD_HANDLE HrFiltSet_p, /* i/o: HR filter model parameter structure */ + FILE *f_hrtf /* i : HR filter data file handle */ ) { ModelParams_t *model; @@ -882,9 +882,9 @@ ivas_error load_reverb_binary( --------------------------------------------------------------------*/ static ivas_error TDREND_MIX_LoadHRTF( - FILE *f_hrtf, /* i/o: File pointer to HRTF file */ - const int32_t sampleRate, /* i : sample rate */ - IVAS_DEC_HRTF_HANDLE HrFiltSet_p /* o : Loaded HR filter set */ + FILE *f_hrtf, /* i/o: File pointer to HRTF file */ + const int32_t sampleRate, /* i : sample rate */ + IVAS_DEC_HRTF_TD_HANDLE HrFiltSet_p /* o : Loaded HR filter set */ ) { int16_t tmp; @@ -1006,7 +1006,7 @@ static ivas_error TDREND_MIX_LoadHRTF( *---------------------------------------------------------------------*/ ivas_error load_TDrend_HRTF_binary( - IVAS_DEC_HRTF_HANDLE hHrtf, /* i/o: HRTF handle */ + IVAS_DEC_HRTF_TD_HANDLE hHrtf, /* i/o: TD rend. HRTF handle */ const int32_t sampleRate, /* i : sample rate */ const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ) @@ -1029,7 +1029,7 @@ ivas_error load_TDrend_HRTF_binary( *---------------------------------------------------------------------*/ void destroy_td_hrtf( - IVAS_DEC_HRTF_HANDLE *hHrtf /* i/o: HRTF handle */ + IVAS_DEC_HRTF_TD_HANDLE *hHrtf /* i/o: TD rend. HRTF handle */ ) { int16_t i; @@ -1099,8 +1099,8 @@ void destroy_td_hrtf( *---------------------------------------------------------------------*/ static ivas_error create_Crend_HRTF_from_rawdata( - HRTFS_HANDLE *hHRTF, /* i/o: HRTF CRend handle */ - char *hrtf_data /* i : pointer to binary file */ + HRTFS_CREND_HANDLE *hHRTF, /* i/o: HRTF CRend handle */ + char *hrtf_data /* i : pointer to binary file */ ) { int16_t i, j, k; @@ -1112,7 +1112,6 @@ static ivas_error create_Crend_HRTF_from_rawdata( ivas_error error; Word16 factorQ; - if ( hrtf_data == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -1254,7 +1253,6 @@ static ivas_error create_Crend_HRTF_from_rawdata( } } - /* coeff_im (the size depends on pIndex_frequency_max) */ for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ ) { @@ -2095,7 +2093,6 @@ void destroy_hrtf_statistics( IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics /* i/o: HRTF statistics handle */ ) { - if ( ( hHrtfStatistics != NULL ) && ( *hHrtfStatistics != NULL ) && ( ( *hHrtfStatistics )->fromROM == FALSE ) ) { if ( ( *hHrtfStatistics )->average_energy_l != NULL ) diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index 727e660dfb..938b5c1595 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -99,7 +99,7 @@ void hrtfFileReader_close( *---------------------------------------------------------------------*/ ivas_error load_TDrend_HRTF_binary( - IVAS_DEC_HRTF_HANDLE hHrtf, /* i/o: HRTF handle */ + IVAS_DEC_HRTF_TD_HANDLE hHrtf, /* i/o: TD rend. HRTF handle */ const int32_t sampleRate, /* i : sample rate */ const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ); @@ -192,7 +192,7 @@ void destroy_parambin_hrtf( *---------------------------------------------------------------------*/ void destroy_td_hrtf( - IVAS_DEC_HRTF_HANDLE *hHRTF /* i/o: HRTF handle */ + IVAS_DEC_HRTF_TD_HANDLE *hHRTF /* i/o: TD rend. HRTF handle */ ); /*---------------------------------------------------------------------* -- GitLab From c587e4dfa79af18844a2772a9eb07d545e8a1d27 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 23 Sep 2025 15:46:20 +0200 Subject: [PATCH 2/4] clang-format --- lib_rend/lib_rend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index c917353459..31efac60e4 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -7961,7 +7961,7 @@ ivas_error IVAS_REND_GetSplitBinauralBitstream( Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, #endif - (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, -- GitLab From b9c539e3d487aadaafab6f6acd3be26056778b57 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 29 Sep 2025 08:57:51 +0200 Subject: [PATCH 3/4] HRTF updates - bring float main in line with BASOP main; under FIX_HRTF_LEFTOVERS --- lib_com/options.h | 1 + lib_util/hrtf_file_reader.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 8b761e69b2..18b830f2b6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -165,6 +165,7 @@ #define FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add split rendering support to decoder in VoIP mode */ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define FIX_1377_HANDLE_ERROR_CODE /* Eri: Add missing error code handling from IVAS_REND_SetObjectIDs */ +#define FIX_HRTF_LEFTOVERS /* VA: HRTF updates - bring float main in line with BASOP main */ /* #################### End BE switches ################################## */ diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 66c886b7b6..0affb9401c 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -816,7 +816,11 @@ static ivas_error load_reverb_from_binary( hHrtfStatistics->average_energy_r_dyn = (float *) malloc( lr_iac_len * sizeof( float ) ); hHrtfStatistics->inter_aural_coherence_dyn = (float *) malloc( lr_iac_len * sizeof( float ) ); +#ifdef FIX_HRTF_LEFTOVERS + if ( hHrtfStatistics->average_energy_l_dyn == NULL || hHrtfStatistics->average_energy_r_dyn == NULL || hHrtfStatistics->inter_aural_coherence_dyn == NULL ) +#else if ( hHrtfStatistics->average_energy_l_dyn == NULL || hHrtfStatistics->average_energy_l_dyn == NULL || hHrtfStatistics->inter_aural_coherence_dyn == NULL ) +#endif { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); } -- GitLab From 7f5feb6ab0b774838f68a5734c78e09907bc6412 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 29 Sep 2025 09:55:00 +0200 Subject: [PATCH 4/4] improve ambisonicsBuses init in the renderer app --- apps/renderer.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/renderer.c b/apps/renderer.c index caa1ce00d8..bf2587680a 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -2611,7 +2611,14 @@ static CmdlnArgs defaultArgs( args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_INVALID; args.outConfig.outSetupCustom.num_spk = 0; args.outConfig.outSetupCustom.num_lfe = 0; +#ifdef FIX_HRTF_LEFTOVERS + for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i ) + { + args.inConfig.ambisonicsBuses[i].audioConfig = IVAS_AUDIO_CONFIG_INVALID; + } +#else args.inConfig.ambisonicsBuses->audioConfig = IVAS_AUDIO_CONFIG_INVALID; +#endif for ( i = 0; i < RENDERER_MAX_ISM_INPUTS + RENDERER_MAX_MASA_INPUTS; ++i ) { -- GitLab