Loading scripts/binauralRenderer_interface/Table_Format_Converter/CMakeLists.txt +3 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,9 @@ include_directories(${IVAS_UTIL_PATH} ${IVAS_ENC_PATH} ${IVAS_DEC_PATH} ${IVAS_C set(SOURCE_FILES_C ${IVAS_REND_PATH}/ivas_rom_binauralRenderer.c ${IVAS_REND_PATH}/ivas_rom_binaural_crend_head.c ${IVAS_REND_PATH}/ivas_rom_rend.c) ${IVAS_REND_PATH}/ivas_rom_rend.c ${IVAS_UTIL_PATH}/cmdl_tools.c ) set(SOURCE_FILES_H ${IVAS_REND_PATH}/ivas_rom_binauralRenderer.h Loading scripts/binauralRenderer_interface/Table_Format_Converter/generate_tables_from_rom_to_bin.c +37 −35 Original line number Diff line number Diff line Loading @@ -51,9 +51,9 @@ *------------------------------------------------------------------------------------------*/ #ifdef WIN32 #define DEFAULT_PATH ".\\" #define DEFAULT_PATH ".\\bin" #else #define DEFAULT_PATH "./" #define DEFAULT_PATH "./bin" #endif #define DEFAULT_INPUT_ROM_FILE "ivas_binaural" Loading Loading @@ -122,6 +122,7 @@ void usage_tables_format_converter( void ); int rom2bin_init( int argc, char *argv[] ); void rom2bin_terminat( void ); char *to_upper( char *str ); void convert_backslash( char *str ); char *create_hrtf_crend( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG input_cfg, int32_t frequency, int32_t *hrtf_size /*OUT*/ ); char *create_hrtf_fastconv( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG input_cfg, int32_t frequency, int32_t *hrtf_size ); Loading Loading @@ -557,7 +558,7 @@ char *create_hrtf_crend( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG in { configuration_name = "HOA3_HRIR"; } full_in_mixerconv_path = malloc( strlen( input_mixerconv_bin_hrir_path ) + strlen( input_mixerconv_bin_hrir_file_name ) + 1 + strlen( configuration_name ) + 1 + 8 + strlen( DEFAULT_BIN_FILE_EXT ) + 1 ); full_in_mixerconv_path = malloc( strlen( input_mixerconv_bin_hrir_path ) + strlen( input_mixerconv_bin_hrir_file_name ) + 1 + strlen( configuration_name ) + 1 + 5 + strlen( DEFAULT_BIN_FILE_EXT ) + 1 ); sprintf( full_in_mixerconv_path, "%s%s_%s_%dkHz%s", input_mixerconv_bin_hrir_path, input_mixerconv_bin_hrir_file_name, configuration_name, frequency / 1000, DEFAULT_BIN_FILE_EXT ); } else if ( rend_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) Loading @@ -578,7 +579,7 @@ char *create_hrtf_crend( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG in { return NULL; } full_in_mixerconv_path = malloc( strlen( input_mixerconv_bin_brir_path ) + strlen( input_mixerconv_bin_brir_file_name ) + 1 + strlen( configuration_name ) + 1 + 8 + strlen( DEFAULT_BIN_FILE_EXT ) + 1 ); full_in_mixerconv_path = malloc( strlen( input_mixerconv_bin_brir_path ) + strlen( input_mixerconv_bin_brir_file_name ) + 1 + strlen( configuration_name ) + 1 + 5 + strlen( DEFAULT_BIN_FILE_EXT ) + 1 ); sprintf( full_in_mixerconv_path, "%s%s_%s_%dkHz%s", input_mixerconv_bin_brir_path, input_mixerconv_bin_brir_file_name, configuration_name, frequency / 1000, DEFAULT_BIN_FILE_EXT ); } Loading Loading @@ -2436,7 +2437,7 @@ int16_t check_hrtf_data( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG in hrtf_data_in_rptr = hrtf_data_in; // latency_s if ( *( tabs_ptrs.latency_s ) != *( (float *) ( hrtf_data_in_rptr ) ) ) if ( ( *( tabs_ptrs.latency_s ) - *( (float *) ( hrtf_data_in_rptr ) ) ) > 1e-9f ) { fprintf( stderr, "check_hrtf_data of binary file failed: bad latency_s!\n\n" ); return -1; Loading Loading @@ -2724,8 +2725,20 @@ int rom2bin_init( int argc, char *argv[] ) usage_tables_format_converter(); return -1; } convert_backslash( argv[i] ); output_path = malloc( strlen( argv[i] ) + 1 ); strcpy( output_path, argv[i] ); #ifdef _WIN32 if ( output_path[strlen( output_path ) - 1] == '\\' ) { output_path[strlen( output_path ) - 1] = '\0'; } #else if ( output_path[strlen( output_path ) - 1] == '/' ) { output_path[strlen( output_path ) - 1] = '\0'; } #endif i++; } else if ( strcmp( to_upper( argv[i] ), "-OUTPUT_FILE_NAME" ) == 0 ) Loading Loading @@ -2784,6 +2797,7 @@ int rom2bin_init( int argc, char *argv[] ) usage_tables_format_converter(); return -1; } convert_backslash( argv[i] ); input_td_bin_path = malloc( strlen( argv[i] ) + 1 ); strcpy( input_td_bin_path, argv[i] ); i++; Loading @@ -2798,6 +2812,7 @@ int rom2bin_init( int argc, char *argv[] ) usage_tables_format_converter(); return -1; } convert_backslash( argv[i] ); input_mixerconv_bin_hrir_path = malloc( strlen( argv[i] ) + 1 ); strcpy( input_mixerconv_bin_hrir_path, argv[i] ); i++; Loading @@ -2811,6 +2826,7 @@ int rom2bin_init( int argc, char *argv[] ) usage_tables_format_converter(); return -1; } convert_backslash( argv[i] ); input_mixerconv_bin_brir_path = malloc( strlen( argv[i] ) + 1 ); strcpy( input_mixerconv_bin_brir_path, argv[i] ); i++; Loading @@ -2824,6 +2840,7 @@ int rom2bin_init( int argc, char *argv[] ) usage_tables_format_converter(); return -1; } convert_backslash( argv[i] ); input_td_bin_path = malloc( strlen( argv[i] ) + 1 ); strcpy( input_td_bin_path, argv[i] ); i++; Loading @@ -2837,6 +2854,7 @@ int rom2bin_init( int argc, char *argv[] ) usage_tables_format_converter(); return -1; } convert_backslash( argv[i] ); input_fastconv_bin_path = malloc( strlen( argv[i] ) + 1 ); strcpy( input_fastconv_bin_path, argv[i] ); i++; Loading @@ -2850,6 +2868,7 @@ int rom2bin_init( int argc, char *argv[] ) usage_tables_format_converter(); return -1; } convert_backslash( argv[i] ); input_param_bin_path = malloc( strlen( argv[i] ) + 1 ); strcpy( input_param_bin_path, argv[i] ); i++; Loading Loading @@ -2965,8 +2984,12 @@ int rom2bin_init( int argc, char *argv[] ) if ( selected_frequency == 0 ) { full_out_path = (char *) malloc( sizeof( char ) * ( strlen( output_path ) + strlen( output_file_name ) + strlen( DEFAULT_BIN_FILE_EXT ) + 1 ) ); sprintf( full_out_path, "%s%s%s", output_path, output_file_name, DEFAULT_BIN_FILE_EXT ); full_out_path = (char *) malloc( sizeof( char ) * ( strlen( output_path ) + 1 + strlen( output_file_name ) + strlen( DEFAULT_BIN_FILE_EXT ) + 1 ) ); #ifdef _WIN32 sprintf( full_out_path, "%s\\%s%s", output_path, output_file_name, DEFAULT_BIN_FILE_EXT ); #else sprintf( full_out_path, "%s/%s%s", output_path, output_file_name, DEFAULT_BIN_FILE_EXT ); #endif } else { Loading @@ -2980,10 +3003,14 @@ int rom2bin_init( int argc, char *argv[] ) } } full_out_path = (char *) malloc( sizeof( char ) * ( strlen( output_path ) + strlen( output_file_name ) + 6 + strlen( DEFAULT_BIN_FILE_EXT ) + 1 ) ); full_out_path = (char *) malloc( sizeof( char ) * ( strlen( output_path ) + 1 + strlen( output_file_name ) + 6 + strlen( DEFAULT_BIN_FILE_EXT ) + 1 ) ); if ( full_out_path ) { sprintf( full_out_path, "%s%s_%dkHz%s", output_path, output_file_name, selected_frequency / 1000, DEFAULT_BIN_FILE_EXT ); #ifdef _WIN32 sprintf( full_out_path, "%s\\%s_%dkHz%s", output_path, output_file_name, selected_frequency / 1000, DEFAULT_BIN_FILE_EXT ); #else sprintf( full_out_path, "%s/%s_%dkHz%s", output_path, output_file_name, selected_frequency / 1000, DEFAULT_BIN_FILE_EXT ); #endif } else { Loading Loading @@ -3126,28 +3153,3 @@ void rom2bin_terminat( void ) #endif } No newline at end of file /*---------------------------------------------------------------------* * to_upper() * * Capitalize all letters of a string. * (normally to_upper() function would be used but it does not work in Unix) *---------------------------------------------------------------------*/ char *to_upper( char *str ) { int16_t i; char *p = str; i = 0; while ( str[i] != 0 ) { if ( str[i] >= 'a' && str[i] <= 'z' ) { str[i] -= 0x20; } i++; } return p; } scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c +7 −6 Original line number Diff line number Diff line Loading @@ -2208,7 +2208,11 @@ uint32_t compute_binary_size( HRTFS_DATA *hrtf, crend_hrtf_tables_dimensions *hr } hrtf_data_size += sizeof( uint16_t ); // index_frequency_max_diffuse #ifdef FIX_INV_DIFFUSE_WEIGHT hrtf_data_size += hrtf->max_num_ir * sizeof( float ) * BINAURAL_CHANNELS; // inv_diffuse_weight #else hrtf_data_size += hrtf->max_num_ir * sizeof( float ); // inv_diffuse_weight #endif hrtf_data_size += sizeof( uint16_t ); // max_total_num_fsamp_per_iteration Loading Loading @@ -2356,7 +2360,6 @@ void write_binary_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const hrtf_bin_wptr += sizeof( uint16_t ); #ifdef FIX_INV_DIFFUSE_WEIGHT data_size_tmp = hrtf->max_num_ir * sizeof( float ) * BINAURAL_CHANNELS; for ( iIR = 0; iIR < hrtf->max_num_ir; iIR++ ) { sprintf( tmpStr, FORMAT_FLOAT, hrtf->inv_diffuse_weight[0][iIR] ); Loading @@ -2367,9 +2370,8 @@ void write_binary_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const sprintf( tmpStr, FORMAT_FLOAT, hrtf->inv_diffuse_weight[1][iIR] ); sscanf( tmpStr, "%f", &( (float *) hrtf_bin_wptr )[hrtf->max_num_ir + iIR] ); } data_size_tmp = hrtf->max_num_ir * sizeof( float ); data_size_tmp = hrtf->max_num_ir * sizeof( float ) * BINAURAL_CHANNELS; #else data_size_tmp = hrtf->max_num_ir * sizeof( float ); for ( iIR = 0; iIR < hrtf->max_num_ir; iIR++ ) { sprintf( tmpStr, FORMAT_FLOAT, hrtf->inv_diffuse_weight[iIR] ); Loading @@ -2377,7 +2379,6 @@ void write_binary_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const } data_size_tmp = hrtf->max_num_ir * sizeof( float ); #endif // memcpy( hrtf_bin_wptr, hrtf->inv_diffuse_weight, data_size_tmp ); // inv_diffuse_weight hrtf_bin_wptr += data_size_tmp; memcpy( hrtf_bin_wptr, &( hrtf_table_dims.max_total_num_fsamp_per_iteration ), sizeof( uint16_t ) ); // max_total_num_fsamp_per_iteration Loading Loading @@ -2471,7 +2472,7 @@ void write_binary_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const } } binary_file_full_path = (char *) malloc( sizeof( char ) * ( strlen( binary_file_path ) + strlen( lscfg.name ) + 1 + 1 + 2 + 8 ) ); binary_file_full_path = (char *) malloc( sizeof( char ) * ( strlen( binary_file_path ) + 1 + strlen( lscfg.name ) + 1 + 5 + 3 + 4 ) ); sprintf( binary_file_full_path, "%s_%s_%ikHz.bin", binary_file_path, lscfg.name, samplerate / 1000 ); fprintf( stdout, "Write Binary file %s:\n", binary_file_full_path ); Loading Loading
scripts/binauralRenderer_interface/Table_Format_Converter/CMakeLists.txt +3 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,9 @@ include_directories(${IVAS_UTIL_PATH} ${IVAS_ENC_PATH} ${IVAS_DEC_PATH} ${IVAS_C set(SOURCE_FILES_C ${IVAS_REND_PATH}/ivas_rom_binauralRenderer.c ${IVAS_REND_PATH}/ivas_rom_binaural_crend_head.c ${IVAS_REND_PATH}/ivas_rom_rend.c) ${IVAS_REND_PATH}/ivas_rom_rend.c ${IVAS_UTIL_PATH}/cmdl_tools.c ) set(SOURCE_FILES_H ${IVAS_REND_PATH}/ivas_rom_binauralRenderer.h Loading
scripts/binauralRenderer_interface/Table_Format_Converter/generate_tables_from_rom_to_bin.c +37 −35 Original line number Diff line number Diff line Loading @@ -51,9 +51,9 @@ *------------------------------------------------------------------------------------------*/ #ifdef WIN32 #define DEFAULT_PATH ".\\" #define DEFAULT_PATH ".\\bin" #else #define DEFAULT_PATH "./" #define DEFAULT_PATH "./bin" #endif #define DEFAULT_INPUT_ROM_FILE "ivas_binaural" Loading Loading @@ -122,6 +122,7 @@ void usage_tables_format_converter( void ); int rom2bin_init( int argc, char *argv[] ); void rom2bin_terminat( void ); char *to_upper( char *str ); void convert_backslash( char *str ); char *create_hrtf_crend( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG input_cfg, int32_t frequency, int32_t *hrtf_size /*OUT*/ ); char *create_hrtf_fastconv( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG input_cfg, int32_t frequency, int32_t *hrtf_size ); Loading Loading @@ -557,7 +558,7 @@ char *create_hrtf_crend( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG in { configuration_name = "HOA3_HRIR"; } full_in_mixerconv_path = malloc( strlen( input_mixerconv_bin_hrir_path ) + strlen( input_mixerconv_bin_hrir_file_name ) + 1 + strlen( configuration_name ) + 1 + 8 + strlen( DEFAULT_BIN_FILE_EXT ) + 1 ); full_in_mixerconv_path = malloc( strlen( input_mixerconv_bin_hrir_path ) + strlen( input_mixerconv_bin_hrir_file_name ) + 1 + strlen( configuration_name ) + 1 + 5 + strlen( DEFAULT_BIN_FILE_EXT ) + 1 ); sprintf( full_in_mixerconv_path, "%s%s_%s_%dkHz%s", input_mixerconv_bin_hrir_path, input_mixerconv_bin_hrir_file_name, configuration_name, frequency / 1000, DEFAULT_BIN_FILE_EXT ); } else if ( rend_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) Loading @@ -578,7 +579,7 @@ char *create_hrtf_crend( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG in { return NULL; } full_in_mixerconv_path = malloc( strlen( input_mixerconv_bin_brir_path ) + strlen( input_mixerconv_bin_brir_file_name ) + 1 + strlen( configuration_name ) + 1 + 8 + strlen( DEFAULT_BIN_FILE_EXT ) + 1 ); full_in_mixerconv_path = malloc( strlen( input_mixerconv_bin_brir_path ) + strlen( input_mixerconv_bin_brir_file_name ) + 1 + strlen( configuration_name ) + 1 + 5 + strlen( DEFAULT_BIN_FILE_EXT ) + 1 ); sprintf( full_in_mixerconv_path, "%s%s_%s_%dkHz%s", input_mixerconv_bin_brir_path, input_mixerconv_bin_brir_file_name, configuration_name, frequency / 1000, DEFAULT_BIN_FILE_EXT ); } Loading Loading @@ -2436,7 +2437,7 @@ int16_t check_hrtf_data( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG in hrtf_data_in_rptr = hrtf_data_in; // latency_s if ( *( tabs_ptrs.latency_s ) != *( (float *) ( hrtf_data_in_rptr ) ) ) if ( ( *( tabs_ptrs.latency_s ) - *( (float *) ( hrtf_data_in_rptr ) ) ) > 1e-9f ) { fprintf( stderr, "check_hrtf_data of binary file failed: bad latency_s!\n\n" ); return -1; Loading Loading @@ -2724,8 +2725,20 @@ int rom2bin_init( int argc, char *argv[] ) usage_tables_format_converter(); return -1; } convert_backslash( argv[i] ); output_path = malloc( strlen( argv[i] ) + 1 ); strcpy( output_path, argv[i] ); #ifdef _WIN32 if ( output_path[strlen( output_path ) - 1] == '\\' ) { output_path[strlen( output_path ) - 1] = '\0'; } #else if ( output_path[strlen( output_path ) - 1] == '/' ) { output_path[strlen( output_path ) - 1] = '\0'; } #endif i++; } else if ( strcmp( to_upper( argv[i] ), "-OUTPUT_FILE_NAME" ) == 0 ) Loading Loading @@ -2784,6 +2797,7 @@ int rom2bin_init( int argc, char *argv[] ) usage_tables_format_converter(); return -1; } convert_backslash( argv[i] ); input_td_bin_path = malloc( strlen( argv[i] ) + 1 ); strcpy( input_td_bin_path, argv[i] ); i++; Loading @@ -2798,6 +2812,7 @@ int rom2bin_init( int argc, char *argv[] ) usage_tables_format_converter(); return -1; } convert_backslash( argv[i] ); input_mixerconv_bin_hrir_path = malloc( strlen( argv[i] ) + 1 ); strcpy( input_mixerconv_bin_hrir_path, argv[i] ); i++; Loading @@ -2811,6 +2826,7 @@ int rom2bin_init( int argc, char *argv[] ) usage_tables_format_converter(); return -1; } convert_backslash( argv[i] ); input_mixerconv_bin_brir_path = malloc( strlen( argv[i] ) + 1 ); strcpy( input_mixerconv_bin_brir_path, argv[i] ); i++; Loading @@ -2824,6 +2840,7 @@ int rom2bin_init( int argc, char *argv[] ) usage_tables_format_converter(); return -1; } convert_backslash( argv[i] ); input_td_bin_path = malloc( strlen( argv[i] ) + 1 ); strcpy( input_td_bin_path, argv[i] ); i++; Loading @@ -2837,6 +2854,7 @@ int rom2bin_init( int argc, char *argv[] ) usage_tables_format_converter(); return -1; } convert_backslash( argv[i] ); input_fastconv_bin_path = malloc( strlen( argv[i] ) + 1 ); strcpy( input_fastconv_bin_path, argv[i] ); i++; Loading @@ -2850,6 +2868,7 @@ int rom2bin_init( int argc, char *argv[] ) usage_tables_format_converter(); return -1; } convert_backslash( argv[i] ); input_param_bin_path = malloc( strlen( argv[i] ) + 1 ); strcpy( input_param_bin_path, argv[i] ); i++; Loading Loading @@ -2965,8 +2984,12 @@ int rom2bin_init( int argc, char *argv[] ) if ( selected_frequency == 0 ) { full_out_path = (char *) malloc( sizeof( char ) * ( strlen( output_path ) + strlen( output_file_name ) + strlen( DEFAULT_BIN_FILE_EXT ) + 1 ) ); sprintf( full_out_path, "%s%s%s", output_path, output_file_name, DEFAULT_BIN_FILE_EXT ); full_out_path = (char *) malloc( sizeof( char ) * ( strlen( output_path ) + 1 + strlen( output_file_name ) + strlen( DEFAULT_BIN_FILE_EXT ) + 1 ) ); #ifdef _WIN32 sprintf( full_out_path, "%s\\%s%s", output_path, output_file_name, DEFAULT_BIN_FILE_EXT ); #else sprintf( full_out_path, "%s/%s%s", output_path, output_file_name, DEFAULT_BIN_FILE_EXT ); #endif } else { Loading @@ -2980,10 +3003,14 @@ int rom2bin_init( int argc, char *argv[] ) } } full_out_path = (char *) malloc( sizeof( char ) * ( strlen( output_path ) + strlen( output_file_name ) + 6 + strlen( DEFAULT_BIN_FILE_EXT ) + 1 ) ); full_out_path = (char *) malloc( sizeof( char ) * ( strlen( output_path ) + 1 + strlen( output_file_name ) + 6 + strlen( DEFAULT_BIN_FILE_EXT ) + 1 ) ); if ( full_out_path ) { sprintf( full_out_path, "%s%s_%dkHz%s", output_path, output_file_name, selected_frequency / 1000, DEFAULT_BIN_FILE_EXT ); #ifdef _WIN32 sprintf( full_out_path, "%s\\%s_%dkHz%s", output_path, output_file_name, selected_frequency / 1000, DEFAULT_BIN_FILE_EXT ); #else sprintf( full_out_path, "%s/%s_%dkHz%s", output_path, output_file_name, selected_frequency / 1000, DEFAULT_BIN_FILE_EXT ); #endif } else { Loading Loading @@ -3126,28 +3153,3 @@ void rom2bin_terminat( void ) #endif } No newline at end of file /*---------------------------------------------------------------------* * to_upper() * * Capitalize all letters of a string. * (normally to_upper() function would be used but it does not work in Unix) *---------------------------------------------------------------------*/ char *to_upper( char *str ) { int16_t i; char *p = str; i = 0; while ( str[i] != 0 ) { if ( str[i] >= 'a' && str[i] <= 'z' ) { str[i] -= 0x20; } i++; } return p; }
scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c +7 −6 Original line number Diff line number Diff line Loading @@ -2208,7 +2208,11 @@ uint32_t compute_binary_size( HRTFS_DATA *hrtf, crend_hrtf_tables_dimensions *hr } hrtf_data_size += sizeof( uint16_t ); // index_frequency_max_diffuse #ifdef FIX_INV_DIFFUSE_WEIGHT hrtf_data_size += hrtf->max_num_ir * sizeof( float ) * BINAURAL_CHANNELS; // inv_diffuse_weight #else hrtf_data_size += hrtf->max_num_ir * sizeof( float ); // inv_diffuse_weight #endif hrtf_data_size += sizeof( uint16_t ); // max_total_num_fsamp_per_iteration Loading Loading @@ -2356,7 +2360,6 @@ void write_binary_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const hrtf_bin_wptr += sizeof( uint16_t ); #ifdef FIX_INV_DIFFUSE_WEIGHT data_size_tmp = hrtf->max_num_ir * sizeof( float ) * BINAURAL_CHANNELS; for ( iIR = 0; iIR < hrtf->max_num_ir; iIR++ ) { sprintf( tmpStr, FORMAT_FLOAT, hrtf->inv_diffuse_weight[0][iIR] ); Loading @@ -2367,9 +2370,8 @@ void write_binary_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const sprintf( tmpStr, FORMAT_FLOAT, hrtf->inv_diffuse_weight[1][iIR] ); sscanf( tmpStr, "%f", &( (float *) hrtf_bin_wptr )[hrtf->max_num_ir + iIR] ); } data_size_tmp = hrtf->max_num_ir * sizeof( float ); data_size_tmp = hrtf->max_num_ir * sizeof( float ) * BINAURAL_CHANNELS; #else data_size_tmp = hrtf->max_num_ir * sizeof( float ); for ( iIR = 0; iIR < hrtf->max_num_ir; iIR++ ) { sprintf( tmpStr, FORMAT_FLOAT, hrtf->inv_diffuse_weight[iIR] ); Loading @@ -2377,7 +2379,6 @@ void write_binary_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const } data_size_tmp = hrtf->max_num_ir * sizeof( float ); #endif // memcpy( hrtf_bin_wptr, hrtf->inv_diffuse_weight, data_size_tmp ); // inv_diffuse_weight hrtf_bin_wptr += data_size_tmp; memcpy( hrtf_bin_wptr, &( hrtf_table_dims.max_total_num_fsamp_per_iteration ), sizeof( uint16_t ) ); // max_total_num_fsamp_per_iteration Loading Loading @@ -2471,7 +2472,7 @@ void write_binary_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const } } binary_file_full_path = (char *) malloc( sizeof( char ) * ( strlen( binary_file_path ) + strlen( lscfg.name ) + 1 + 1 + 2 + 8 ) ); binary_file_full_path = (char *) malloc( sizeof( char ) * ( strlen( binary_file_path ) + 1 + strlen( lscfg.name ) + 1 + 5 + 3 + 4 ) ); sprintf( binary_file_full_path, "%s_%s_%ikHz.bin", binary_file_path, lscfg.name, samplerate / 1000 ); fprintf( stdout, "Write Binary file %s:\n", binary_file_full_path ); Loading