Loading lib_dec/ivas_init_dec.c +7 −0 Original line number Diff line number Diff line Loading @@ -1995,6 +1995,13 @@ ivas_error ivas_init_decoder( * Allocate and initialize rendering handles *--------------------------------------------------------------------*/ #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_hrtf_statistics_open( &st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) { return error; } #endif if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { Loading lib_rend/ivas_hrtf.c +55 −24 Original line number Diff line number Diff line Loading @@ -256,30 +256,6 @@ ivas_error ivas_HRTF_statistics_binary_open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for statistics HRTF tables!" ); } ( *hHrtfStatistics )->average_energy_l = NULL; ( *hHrtfStatistics )->average_energy_r = NULL; ( *hHrtfStatistics )->inter_aural_coherence = NULL; switch ( sampleRate ) { case 48000: ( *hHrtfStatistics )->average_energy_l = defaultHRIR_left_avg_power_48kHz; ( *hHrtfStatistics )->average_energy_r = defaultHRIR_right_avg_power_48kHz; ( *hHrtfStatistics )->inter_aural_coherence = defaultHRIR_coherence_48kHz; break; case 32000: ( *hHrtfStatistics )->average_energy_l = defaultHRIR_left_avg_power_32kHz; ( *hHrtfStatistics )->average_energy_r = defaultHRIR_right_avg_power_32kHz; ( *hHrtfStatistics )->inter_aural_coherence = defaultHRIR_coherence_32kHz; break; case 16000: ( *hHrtfStatistics )->average_energy_l = defaultHRIR_left_avg_power_16kHz; ( *hHrtfStatistics )->average_energy_r = defaultHRIR_right_avg_power_16kHz; ( *hHrtfStatistics )->inter_aural_coherence = defaultHRIR_coherence_16kHz; break; } ( *hHrtfStatistics )->fromROM = TRUE; return IVAS_ERR_OK; } Loading @@ -303,4 +279,59 @@ void ivas_HRTF_statistics_binary_close( return; } /*-----------------------------------------------------------------------* * ivas_hrtf_statistics_open() * * Allocate HRTF handle for statistics handler *-----------------------------------------------------------------------*/ ivas_error ivas_hrtf_statistics_open( HRTFS_STATISTICS_HANDLE *hHrtfStatistics, int32_t sampleRate ) { if ( hHrtfStatistics != NULL && *hHrtfStatistics != NULL ) { /* Tables already loaded from file */ return IVAS_ERR_OK; } else { /* Initialise tables from ROM */ HRTFS_STATISTICS *HrtfStatistics; 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 No newline at end of file lib_rend/ivas_prot_rend.h +4 −0 Original line number Diff line number Diff line Loading @@ -626,6 +626,10 @@ ivas_error ivas_HRTF_statistics_binary_open( void ivas_HRTF_statistics_binary_close( HRTFS_STATISTICS **hHrtfStatistics /* i/o: HRTF statistics structure */ ); ivas_error ivas_hrtf_statistics_open( HRTFS_STATISTICS_HANDLE *hHrtfStatistics, /* i/o: HRTF statistics structure */ int32_t sampleRate ); /* i : Sample rate */ #endif ivas_error ivas_HRTF_CRend_binary_open( Loading Loading
lib_dec/ivas_init_dec.c +7 −0 Original line number Diff line number Diff line Loading @@ -1995,6 +1995,13 @@ ivas_error ivas_init_decoder( * Allocate and initialize rendering handles *--------------------------------------------------------------------*/ #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_hrtf_statistics_open( &st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) { return error; } #endif if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { Loading
lib_rend/ivas_hrtf.c +55 −24 Original line number Diff line number Diff line Loading @@ -256,30 +256,6 @@ ivas_error ivas_HRTF_statistics_binary_open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for statistics HRTF tables!" ); } ( *hHrtfStatistics )->average_energy_l = NULL; ( *hHrtfStatistics )->average_energy_r = NULL; ( *hHrtfStatistics )->inter_aural_coherence = NULL; switch ( sampleRate ) { case 48000: ( *hHrtfStatistics )->average_energy_l = defaultHRIR_left_avg_power_48kHz; ( *hHrtfStatistics )->average_energy_r = defaultHRIR_right_avg_power_48kHz; ( *hHrtfStatistics )->inter_aural_coherence = defaultHRIR_coherence_48kHz; break; case 32000: ( *hHrtfStatistics )->average_energy_l = defaultHRIR_left_avg_power_32kHz; ( *hHrtfStatistics )->average_energy_r = defaultHRIR_right_avg_power_32kHz; ( *hHrtfStatistics )->inter_aural_coherence = defaultHRIR_coherence_32kHz; break; case 16000: ( *hHrtfStatistics )->average_energy_l = defaultHRIR_left_avg_power_16kHz; ( *hHrtfStatistics )->average_energy_r = defaultHRIR_right_avg_power_16kHz; ( *hHrtfStatistics )->inter_aural_coherence = defaultHRIR_coherence_16kHz; break; } ( *hHrtfStatistics )->fromROM = TRUE; return IVAS_ERR_OK; } Loading @@ -303,4 +279,59 @@ void ivas_HRTF_statistics_binary_close( return; } /*-----------------------------------------------------------------------* * ivas_hrtf_statistics_open() * * Allocate HRTF handle for statistics handler *-----------------------------------------------------------------------*/ ivas_error ivas_hrtf_statistics_open( HRTFS_STATISTICS_HANDLE *hHrtfStatistics, int32_t sampleRate ) { if ( hHrtfStatistics != NULL && *hHrtfStatistics != NULL ) { /* Tables already loaded from file */ return IVAS_ERR_OK; } else { /* Initialise tables from ROM */ HRTFS_STATISTICS *HrtfStatistics; 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 No newline at end of file
lib_rend/ivas_prot_rend.h +4 −0 Original line number Diff line number Diff line Loading @@ -626,6 +626,10 @@ ivas_error ivas_HRTF_statistics_binary_open( void ivas_HRTF_statistics_binary_close( HRTFS_STATISTICS **hHrtfStatistics /* i/o: HRTF statistics structure */ ); ivas_error ivas_hrtf_statistics_open( HRTFS_STATISTICS_HANDLE *hHrtfStatistics, /* i/o: HRTF statistics structure */ int32_t sampleRate ); /* i : Sample rate */ #endif ivas_error ivas_HRTF_CRend_binary_open( Loading