Loading lib_com/options.h +0 −1 Original line number Diff line number Diff line Loading @@ -164,7 +164,6 @@ #define FIX_POINT_HRTF_FILE_FORMAT /* All: fix point hrtf binary file format */ #ifdef FIX_POINT_HRTF_FILE_FORMAT /*#define FIX_1123_CREND_16BIT_ROM*/ /* Ora: update CREND ROM tables to 16 bit */ #define FIX_1123_CREND_16BIT_FMT /* Ora: update CREND binary file format to 16 bit */ #define FIX_1123_CREND_FLTFX_BE /* Ora: make CREND FLT ROM tables BE to FX file */ /*#define FIX_1123_TDREN_16BIT_ROM*/ /* Eri,Ora: update TD Object Renderer tables to 16 bit */ Loading lib_rend/ivas_crend.c +0 −402 File changed.Preview size limit exceeded, changes collapsed. Show changes lib_rend/ivas_stat_rend.h +0 −11 Original line number Diff line number Diff line Loading @@ -1175,17 +1175,6 @@ typedef struct ivas_hrtfs_structure float inv_diffuse_weight[BINAURAL_CHANNELS][MAX_INTERN_CHANNELS]; /* inverse diffuse weights array, access one inverse weight by pInvDiffuseWeight[channel] */ int16_t same_inv_diffuse_weight; float gain_lfe; #ifdef FIX_1123_CREND_16BIT_ROM int16_t *pOut_to_bin_re_fx[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS]; int16_t *pOut_to_bin_im_fx[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS]; int16_t *pOut_to_bin_diffuse_re_fx[BINAURAL_CHANNELS]; int16_t *pOut_to_bin_diffuse_im_fx[BINAURAL_CHANNELS]; int16_t factor_Q_inv_diffuse_weight_fx; int16_t factor_Q_latency_s_fx; int16_t inv_diffuse_weight_fx[BINAURAL_CHANNELS][MAX_INTERN_CHANNELS]; /* inverse diffuse weights array, access one inverse weight by pInvDiffuseWeight[channel] */ int32_t latency_s_fx; int16_t gain_lfe_fx; #endif } HRTFS_DATA, *HRTFS_HANDLE; Loading scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c +0 −214 Original line number Diff line number Diff line Loading @@ -1306,48 +1306,6 @@ int generate_crend_ivas_tables_from_sofa( const char *file_path, ConfigReader *c } #ifdef FIX_1123_CREND_16BIT_ROM hrtf_data.latency_s_fx = float2int32_t( hrtf_data.latency_s, factorQ[0] ); for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) { hrtf_data.inv_diffuse_weight_fx[0][i] = float2int16_t( hrtf_data.inv_diffuse_weight[0][i], factorQ[1] ); hrtf_data.inv_diffuse_weight_fx[1][i] = float2int16_t( hrtf_data.inv_diffuse_weight[1][i], factorQ[1] ); } for ( iIR = 0; iIR < hrtf_data.max_num_ir; iIR++ ) { for ( iChan = 0; iChan < BINAURAL_CHANNELS; iChan++ ) { offset = 0; for ( iIter = 0; iIter < hrtf_data.num_iterations[iIR][iChan]; iIter++ ) { // memcpy( hrtf_bin_wptr, coeff_rptr, data_size_tmp ); for ( i = 0; i < hrtf_data.pIndex_frequency_max[iIR][iChan][iIter]; i++ ) { hrtf_data.pOut_to_bin_re_fx[iIR][iChan][offset + i] = float2int16_t( hrtf_data.pOut_to_bin_re[iIR][iChan][offset + i], factorQ[2] ); hrtf_data.pOut_to_bin_im_fx[iIR][iChan][offset + i] = float2int16_t( hrtf_data.pOut_to_bin_im[iIR][iChan][offset + i], factorQ[2] ); } offset = offset + hrtf_data.pIndex_frequency_max[iIR][iChan][iIter]; } } } // pOut_to_bin_diffuse_re : The size depends on pIndex_frequency_max_diffuse for ( iChan = 0; iChan < BINAURAL_CHANNELS; iChan++ ) { offset = 0; for ( iIter = 0; iIter < hrtf_data.num_iterations_diffuse[iChan]; iIter++ ) { // memcpy( hrtf_bin_wptr, coeff_rptr, data_size_tmp ); for ( i = 0; i < hrtf_data.pIndex_frequency_max_diffuse[iChan][iIter]; i++ ) { hrtf_data.pOut_to_bin_diffuse_re_fx[iChan][offset + i] = float2int16_t( hrtf_data.pOut_to_bin_diffuse_re[iChan][offset + i], factorQ[2] ); hrtf_data.pOut_to_bin_diffuse_im_fx[iChan][offset + i] = float2int16_t( hrtf_data.pOut_to_bin_diffuse_im[iChan][offset + i], factorQ[2] ); } offset = offset + hrtf_data.pIndex_frequency_max_diffuse[iChan][iIter]; } } #endif #ifdef FIX_1123_CREND_FLTFX_BE int16_t factorQ[3]; Loading Loading @@ -2034,18 +1992,6 @@ int generate_reverb_ivas_tables_from_sofa( const char *file_path ) free( p_avg_lr ); p_avg_lr = NULL; } #ifdef FIX_1123_CREND_16BIT_ROM if ( pCoherence_fx ) { free( pCoherence_fx ); pCoherence_fx = NULL; } if ( p_avg_lr_fx ) { free( p_avg_lr_fx ); p_avg_lr_fx = NULL; } #endif } /* close the file */ Loading Loading @@ -2332,24 +2278,6 @@ void update_c_file_with_reverb( float *pEner_l, float *pEner_r, float *pCoherenc write_array_float_to_file( fp, pEner_r, len, NUM_SAMPLES_PER_LINES_REVERB, FORMAT_FLOAT_REVERB, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ";\n" ); #ifdef FIX_1123_CREND_16BIT_ROM fprintf( fp, "\n#ifdef FIX_1123_CREND_16BIT_ROM" ); /* float *defaultHRIR_right_avg_power_[LR_IAC_LENGTH_NR_FC];*/ fprintf( fp, "\nconst int16_t defaultHRIR_coherence_%dkHz_fx[%s] = \n", samplerate / 1000, len_str ); write_array_int16_t_to_file( fp, pCoherence_fx, len, NUM_SAMPLES_PER_LINES_REVERB, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ";\n" ); /* float *defaultHRIR_left_avg_power_[LR_IAC_LENGTH_NR_FC];*/ fprintf( fp, "\nconst int16_t defaultHRIR_left_avg_power_%dkHz_fx[%s] = \n", samplerate / 1000, len_str ); write_array_int16_t_to_file( fp, pEner_l_fx, len, NUM_SAMPLES_PER_LINES_REVERB, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ";\n" ); /* float *defaultHRIR_right_avg_power_[LR_IAC_LENGTH_NR_FC];*/ fprintf( fp, "\nconst int16_t defaultHRIR_right_avg_power_%dkHz_fx[%s] = \n", samplerate / 1000, len_str ); write_array_int16_t_to_file( fp, pEner_r_fx, len, NUM_SAMPLES_PER_LINES_REVERB, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ";\n" ); fprintf( fp, "\n#endif /* FIX_1123_CREND_16BIT_ROM */" ); #endif if ( fp ) fclose( fp ); Loading Loading @@ -2391,12 +2319,6 @@ void update_c_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int fprintf( fp, "\nconst float %s_%s_latency_s = ", DECLARATION_NAME, lscfg.name ); fprintf( fp, format_float_latency, hrtf->latency_s ); fprintf( fp, ";" ); #ifdef FIX_1123_CREND_16BIT_ROM fprintf( fp, "\n#ifdef FIX_1123_CREND_16BIT_ROM" ); fprintf( fp, "\nconst int16_t %s_%s_latency_s_Q_fx = %d;", DECLARATION_NAME, lscfg.name, factorQ[0] ); fprintf( fp, "\nconst int32_t %s_%s_latency_s_fx = %d;/*Q-31*/", DECLARATION_NAME, lscfg.name, hrtf->latency_s_fx ); fprintf( fp, "\n#endif // FIX_1123_CREND_16BIT_ROM" ); #endif } fprintf( fp, "\n\n/* Sample Rate = %ld */\n", (long) samplerate ); Loading Loading @@ -2486,19 +2408,6 @@ void update_c_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int write_array_float_to_file( fp, hrtf->inv_diffuse_weight[1], hrtf->max_num_ir, hrtf->max_num_ir, format_float, 0, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "}" ); fprintf( fp, ";" ); #ifdef FIX_1123_CREND_16BIT_ROM fprintf( fp, "\n#ifdef FIX_1123_CREND_16BIT_ROM" ); fprintf( fp, "\nconst int16_t %s_%s_inv_diffuse_weight_Q_%2dkHz_fx = %d;", DECLARATION_NAME, lscfg.name, samplerate / 1000, factorQ[1] ); /* float inv_diffuse_weight_fx[BINAURAL_CHANNELS][MAX_INTERN_CHANNELS]; */ fprintf( fp, "\nconst int16_t %s_%s_inv_diffuse_weight_%2dkHz_fx[BINAURAL_CHANNELS][%s]=", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name ); fprintf( fp, "{" ); write_array_int16_t_to_file( fp, hrtf->inv_diffuse_weight_fx[0], hrtf->max_num_ir, hrtf->max_num_ir, 0, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "," ); write_array_int16_t_to_file( fp, hrtf->inv_diffuse_weight_fx[1], hrtf->max_num_ir, hrtf->max_num_ir, 0, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "}" ); fprintf( fp, ";" ); fprintf( fp, "\n#endif // FIX_1123_CREND_16BIT_ROM" ); #endif /* uint16_t *pIndex_frequency_max_diffuse[BINAURAL_CHANNELS];*/ if ( hrtf->pIndex_frequency_max_diffuse[0] == NULL ) Loading Loading @@ -2547,78 +2456,7 @@ void update_c_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int fprintf( fp, "\n%s}", TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "\n};" ); #ifdef FIX_1123_CREND_16BIT_ROM fprintf( fp, "\n#ifdef FIX_1123_CREND_16BIT_ROM" ); fprintf( fp, "\nconst int16_t %s_%s_coeff_Q_%2dkHz_fx = %d;", DECLARATION_NAME, lscfg.name, samplerate / 1000, factorQ[2] ); /* float *pOut_to_bin_fx[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS];*/ fprintf( fp, "\nconst int16_t %s_%s_coeff_re_%2dkHz_fx[%s][BINAURAL_CHANNELS][%d]={", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name, maxTotalNumFreqSampPerIterations ); for ( i = 0; i < hrtf->max_num_ir - 1; i++ ) { fprintf( fp, "\n%s{\n", TAB_WITH_SPACE_OR_NOT ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_re_fx[i][0], pTotalNumFreqSampPerIterations[0][i], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ",\n" ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_re_fx[i][1], pTotalNumFreqSampPerIterations[1][i], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "\n%s},", TAB_WITH_SPACE_OR_NOT ); } fprintf( fp, "\n%s{\n", TAB_WITH_SPACE_OR_NOT ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_re_fx[i][0], pTotalNumFreqSampPerIterations[0][i], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ",\n" ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_re_fx[i][1], pTotalNumFreqSampPerIterations[1][i], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "\n%s}", TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "\n};" ); fprintf( fp, "\nconst int16_t %s_%s_coeff_im_%2dkHz_fx[%s][BINAURAL_CHANNELS][%d]={", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name, maxTotalNumFreqSampPerIterations ); for ( i = 0; i < hrtf->max_num_ir - 1; i++ ) { fprintf( fp, "\n%s{\n", TAB_WITH_SPACE_OR_NOT ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_im_fx[i][0], pTotalNumFreqSampPerIterations[0][i], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ",\n" ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_im_fx[i][1], pTotalNumFreqSampPerIterations[1][i], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "\n%s},", TAB_WITH_SPACE_OR_NOT ); } fprintf( fp, "\n%s{\n", TAB_WITH_SPACE_OR_NOT ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_im_fx[i][0], pTotalNumFreqSampPerIterations[0][i], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ",\n" ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_im_fx[i][1], pTotalNumFreqSampPerIterations[1][i], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "\n%s}", TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "\n};" ); fprintf( fp, "\n#endif // FIX_1123_CREND_16BIT_ROM" ); #endif #ifdef FIX_1123_CREND_16BIT_ROM fprintf( fp, "\n#ifdef FIX_1123_CREND_16BIT_ROM" ); /* float *pOut_to_bin_diffuse_re[BINAURAL_CHANNELS];*/ if ( hrtf->pOut_to_bin_diffuse_re_fx[0] == NULL ) { fprintf( fp, "\nconst int16_t *%s_%s_coeff_diffuse_re_%2dkHz_fx[BINAURAL_CHANNELS]={NULL,NULL};", DECLARATION_NAME, lscfg.name, samplerate / 1000 ); } else { fprintf( fp, "\nconst int16_t %s_%s_coeff_diffuse_re_%2dkHz_fx[BINAURAL_CHANNELS][%u]={", DECLARATION_NAME, lscfg.name, samplerate / 1000, maxTotalNumFreqSampPerIterationsDiffuse ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_diffuse_re_fx[0], pTotalNumFreqSampPerIterationsDiffuse[0], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ",\n" ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_diffuse_re_fx[1], pTotalNumFreqSampPerIterationsDiffuse[1], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "\n};" ); } /* float *pOut_to_bin_diffuse_im[BINAURAL_CHANNELS];*/ if ( hrtf->pOut_to_bin_diffuse_im_fx[0] == NULL ) { fprintf( fp, "\nconst int16_t *%s_%s_coeff_diffuse_im_%2dkHz_fx[BINAURAL_CHANNELS]={NULL,NULL};", DECLARATION_NAME, lscfg.name, samplerate / 1000 ); } else { fprintf( fp, "\nconst int16_t %s_%s_coeff_diffuse_im_%2dkHz_fx[BINAURAL_CHANNELS][%u]={", DECLARATION_NAME, lscfg.name, samplerate / 1000, maxTotalNumFreqSampPerIterationsDiffuse ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_diffuse_im_fx[0], pTotalNumFreqSampPerIterationsDiffuse[0], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ",\n" ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_diffuse_im_fx[1], pTotalNumFreqSampPerIterationsDiffuse[1], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "\n};" ); } fprintf( fp, "\n#endif // FIX_1123_CREND_16BIT_ROM" ); #endif /* float *pOut_to_bin_diffuse_re[BINAURAL_CHANNELS];*/ if ( hrtf->pOut_to_bin_diffuse_re[0] == NULL ) Loading Loading @@ -2695,15 +2533,6 @@ void update_h_file_with_reverb( int32_t samplerate ) /* float *defaultHRIR_left_avg_power[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS];*/ fprintf( fp, "\nextern float defaultHRIR_left_avg_power_%dkHz[%s];", samplerate / 1000, len_str ); fprintf( fp, "\nextern float defaultHRIR_right_avg_power_%dkHz[%s];", samplerate / 1000, len_str ); #ifdef FIX_1123_CREND_16BIT_ROM fprintf( fp, "\n#ifdef FIX_1123_CREND_16BIT_ROM" ); /* Uint16_t *defaultHRIR_coherence_[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS];*/ fprintf( fp, "\nextern int16_t defaultHRIR_coherence_%dkHz_fx[%s];", samplerate / 1000, len_str ); /* Uint16_t *defaultHRIR_left_avg_power[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS];*/ fprintf( fp, "\nextern int16_t defaultHRIR_left_avg_power_%dkHz_fx[%s];", samplerate / 1000, len_str ); fprintf( fp, "\nextern int16_t defaultHRIR_right_avg_power_%dkHz_fx[%s];", samplerate / 1000, len_str ); fprintf( fp, "\n#endif /* FIX_1123_CREND_16BIT_ROM */" ); #endif if ( fp ) fclose( fp ); Loading Loading @@ -2779,12 +2608,6 @@ void update_h_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int /* float latency_s; */ fprintf( fp, "\n\n/********************** %s_%s **********************/\n", DECLARATION_NAME, lscfg.name ); fprintf( fp, "\nextern float %s_%s_latency_s;", DECLARATION_NAME, lscfg.name ); #ifdef FIX_1123_CREND_16BIT_ROM fprintf( fp, "\n#ifdef FIX_1123_CREND_16BIT_ROM" ); fprintf( fp, "\nextern int16_t %s_%s_latency_s_Q_fx;", DECLARATION_NAME, lscfg.name ); fprintf( fp, "\nextern int32_t %s_%s_latency_s_fx;", DECLARATION_NAME, lscfg.name ); fprintf( fp, "\n#endif // FIX_1123_CREND_16BIT_ROM" ); #endif } fprintf( fp, "\n\n/* Sample Rate = %ld */\n", (long) samplerate ); Loading @@ -2805,13 +2628,6 @@ void update_h_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int /* float inv_diffuse_weight[BINAURAL_CHANNELS][MAX_INTERN_CHANNELS]; */ fprintf( fp, "\nextern float %s_%s_inv_diffuse_weight_%2dkHz[BINAURAL_CHANNELS][%s];", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name ); #ifdef FIX_1123_CREND_16BIT_ROM /* float inv_diffuse_weight_fx[BINAURAL_CHANNELS][MAX_INTERN_CHANNELS]; */ fprintf( fp, "\n#ifdef FIX_1123_CREND_16BIT_ROM" ); fprintf( fp, "\nextern int16_t %s_%s_inv_diffuse_weight_Q_%2dkHz_fx;", DECLARATION_NAME, lscfg.name, samplerate / 1000 ); fprintf( fp, "\nextern int16_t %s_%s_inv_diffuse_weight_%2dkHz_fx[BINAURAL_CHANNELS][%s];", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name ); fprintf( fp, "\n#endif // FIX_1123_CREND_16BIT_ROM" ); #endif /* uint16_t *pIndex_frequency_max_diffuse[BINAURAL_CHANNELS];*/ if ( hrtf->pIndex_frequency_max_diffuse[0] == NULL ) Loading @@ -2827,36 +2643,6 @@ void update_h_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int fprintf( fp, "\nextern float %s_%s_coeff_re_%2dkHz[%s][BINAURAL_CHANNELS][%u];", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name, maxTotalNumFreqSampPerIterations ); fprintf( fp, "\nextern float %s_%s_coeff_im_%2dkHz[%s][BINAURAL_CHANNELS][%u];", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name, maxTotalNumFreqSampPerIterations ); #ifdef FIX_1123_CREND_16BIT_ROM fprintf( fp, "\n#ifdef FIX_1123_CREND_16BIT_ROM" ); /* int32_t *pOut_to_bin_fx[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS];*/ fprintf( fp, "\n#ifdef FIX_1123_CREND_16BIT_ROM" ); fprintf( fp, "\nextern int16_t %s_%s_coeff_Q_%2dkHz_fx;", DECLARATION_NAME, lscfg.name, samplerate / 1000 ); fprintf( fp, "\n#endif" ); fprintf( fp, "\nextern int16_t %s_%s_coeff_re_%2dkHz_fx[%s][BINAURAL_CHANNELS][%u];", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name, maxTotalNumFreqSampPerIterations ); fprintf( fp, "\nextern int16_t %s_%s_coeff_im_%2dkHz_fx[%s][BINAURAL_CHANNELS][%u];", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name, maxTotalNumFreqSampPerIterations ); /* float *pOut_to_bin_diffuse_re_fx[BINAURAL_CHANNELS];*/ if ( hrtf->pOut_to_bin_diffuse_re_fx[0] == NULL ) { fprintf( fp, "\nextern int16_t *%s_%s_coeff_diffuse_re_%2dkHz_fx[BINAURAL_CHANNELS];", DECLARATION_NAME, lscfg.name, samplerate / 1000 ); } else { fprintf( fp, "\nextern int16_t %s_%s_coeff_diffuse_re_%2dkHz_fx[BINAURAL_CHANNELS][%u];", DECLARATION_NAME, lscfg.name, samplerate / 1000, maxTotalNumFreqSampPerIterationsDiffuse ); } /* float *pOut_to_bin_diffuse_im_fx[BINAURAL_CHANNELS];*/ if ( hrtf->pOut_to_bin_diffuse_im_fx[0] == NULL ) { fprintf( fp, "\nextern int16_t *%s_%s_coeff_diffuse_im_%2dkHz_fx[BINAURAL_CHANNELS];", DECLARATION_NAME, lscfg.name, samplerate / 1000 ); } else { fprintf( fp, "\nextern int16_t %s_%s_coeff_diffuse_im_%2dkHz_fx[BINAURAL_CHANNELS][%u];", DECLARATION_NAME, lscfg.name, samplerate / 1000, maxTotalNumFreqSampPerIterationsDiffuse ); } fprintf( fp, "\n#endif // FIX_1123_CREND_16BIT_ROM" ); #endif /* float *pOut_to_bin_diffuse_re[BINAURAL_CHANNELS];*/ if ( hrtf->pOut_to_bin_diffuse_re[0] == NULL ) { Loading scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.c +0 −67 Original line number Diff line number Diff line Loading @@ -216,18 +216,6 @@ ivas_error ivas_hrtf_close( free( hHRTF->pOut_to_bin_im[i][j] ); hHRTF->pOut_to_bin_im[i][j] = NULL; } #ifdef FIX_1123_CREND_16BIT_ROM if ( hHRTF->pOut_to_bin_re_fx[i][j] != NULL ) { free( hHRTF->pOut_to_bin_re_fx[i][j] ); hHRTF->pOut_to_bin_re_fx[i][j] = NULL; } if ( hHRTF->pOut_to_bin_im_fx[i][j] != NULL ) { free( hHRTF->pOut_to_bin_im_fx[i][j] ); hHRTF->pOut_to_bin_im_fx[i][j] = NULL; } #endif } } for ( j = 0; j < BINAURAL_CHANNELS; j++ ) Loading @@ -247,18 +235,6 @@ ivas_error ivas_hrtf_close( free( hHRTF->pOut_to_bin_diffuse_im[j] ); hHRTF->pOut_to_bin_diffuse_im[j] = NULL; } #ifdef FIX_1123_CREND_16BIT_ROM if ( hHRTF->pOut_to_bin_diffuse_re_fx[j] != NULL ) { free( hHRTF->pOut_to_bin_diffuse_re_fx[j] ); hHRTF->pOut_to_bin_diffuse_re_fx[j] = NULL; } if ( hHRTF->pOut_to_bin_diffuse_im_fx[j] != NULL ) { free( hHRTF->pOut_to_bin_diffuse_im_fx[j] ); hHRTF->pOut_to_bin_diffuse_im_fx[j] = NULL; } #endif } return IVAS_ERR_OK; Loading Loading @@ -798,10 +774,6 @@ ivas_error ivas_crend_binaural_filter_design_set_hrtf_fr( { pParam->pOut_to_bin_re[i_chan][i_ear] = (float *) malloc( (size_t) pParam->num_iterations[i_chan][i_ear] * frame_len * sizeof( float ) ); pParam->pOut_to_bin_im[i_chan][i_ear] = (float *) malloc( (size_t) pParam->num_iterations[i_chan][i_ear] * frame_len * sizeof( float ) ); #ifdef FIX_1123_CREND_16BIT_ROM pParam->pOut_to_bin_re_fx[i_chan][i_ear] = (int16_t *) malloc( (size_t) pParam->num_iterations[i_chan][i_ear] * frame_len * sizeof( int16_t ) ); pParam->pOut_to_bin_im_fx[i_chan][i_ear] = (int16_t *) malloc( (size_t) pParam->num_iterations[i_chan][i_ear] * frame_len * sizeof( int16_t ) ); #endif } } Loading Loading @@ -966,10 +938,6 @@ ivas_error ivas_crend_binaural_filter_design_set_hrtf_fr( { pParam->pOut_to_bin_re[i_chan][i_ear] = (float *) malloc( totSizeFreq[i_chan] * sizeof( float ) ); pParam->pOut_to_bin_im[i_chan][i_ear] = (float *) malloc( totSizeFreq[i_chan] * sizeof( float ) ); #ifdef FIX_1123_CREND_16BIT_ROM pParam->pOut_to_bin_re_fx[i_chan][i_ear] = (int16_t *) malloc( totSizeFreq[i_chan] * sizeof( int16_t ) ); pParam->pOut_to_bin_im_fx[i_chan][i_ear] = (int16_t *) malloc( totSizeFreq[i_chan] * sizeof( int16_t ) ); #endif offset = 0; for ( i_block = 0; i_block < pParam->num_iterations[i_chan][i_ear]; ++i_block ) { Loading Loading @@ -1008,10 +976,6 @@ ivas_error ivas_crend_binaural_filter_design_set_hrtf_fr( { pParam->pOut_to_bin_re[i_chan][i_ear][offset + i_tap] = pBlockSpectrum_r[i_tap]; pParam->pOut_to_bin_im[i_chan][i_ear][offset + i_tap] = pBlockSpectrum_i[i_tap]; #ifdef FIX_1123_CREND_16BIT_ROM pParam->pOut_to_bin_re_fx[i_chan][i_ear][offset + i_tap] = float2int16_t( pParam->pOut_to_bin_re[i_chan][i_ear][offset + i_tap], 15 ); pParam->pOut_to_bin_im_fx[i_chan][i_ear][offset + i_tap] = float2int16_t( pParam->pOut_to_bin_im[i_chan][i_ear][offset + i_tap], 15 ); #endif } offset = offset + pParam->pIndex_frequency_max[i_chan][i_ear][i_block]; } Loading @@ -1024,10 +988,6 @@ ivas_error ivas_crend_binaural_filter_design_set_hrtf_fr( { pParam->pOut_to_bin_diffuse_re[i_ear] = NULL; pParam->pOut_to_bin_diffuse_im[i_ear] = NULL; #ifdef FIX_1123_CREND_16BIT_ROM pParam->pOut_to_bin_diffuse_re_fx[i_ear] = NULL; pParam->pOut_to_bin_diffuse_im_fx[i_ear] = NULL; #endif } } Loading Loading @@ -1274,10 +1234,6 @@ ivas_error ivas_crend_binaural_filter_design_set_hrtf_fr( { pParam->pOut_to_bin_diffuse_re[i_ear] = (float *) malloc( totSizeFreqDiffuse * sizeof( float ) ); pParam->pOut_to_bin_diffuse_im[i_ear] = (float *) malloc( totSizeFreqDiffuse * sizeof( float ) ); #ifdef FIX_1123_CREND_16BIT_ROM pParam->pOut_to_bin_diffuse_re_fx[i_ear] = (int16_t *) malloc( totSizeFreqDiffuse * sizeof( int16_t ) ); pParam->pOut_to_bin_diffuse_im_fx[i_ear] = (int16_t *) malloc( totSizeFreqDiffuse * sizeof( int16_t ) ); #endif offset = 0; for ( i_block = 0; i_block < pParam->num_iterations_diffuse[0]; ++i_block ) { Loading Loading @@ -1326,10 +1282,6 @@ ivas_error ivas_crend_binaural_filter_design_set_hrtf_fr( { pParam->pOut_to_bin_diffuse_re[i_ear][offset + i_tap] = pBlockSpectrum_r[i_tap]; pParam->pOut_to_bin_diffuse_im[i_ear][offset + i_tap] = pBlockSpectrum_i[i_tap]; #ifdef FIX_1123_CREND_16BIT_ROM pParam->pOut_to_bin_diffuse_re_fx[i_ear][offset + i_tap] = float2int16_t( pParam->pOut_to_bin_diffuse_re[i_ear][offset + i_tap], 15 ); pParam->pOut_to_bin_diffuse_im_fx[i_ear][offset + i_tap] = float2int16_t( pParam->pOut_to_bin_diffuse_im[i_ear][offset + i_tap], 15 ); #endif } offset = offset + pParam->pIndex_frequency_max_diffuse[i_ear][i_block]; } Loading Loading @@ -1392,18 +1344,6 @@ ivas_error ivas_set_hrtf_fr( return IVAS_ERR_FAILED_ALLOC; } #ifdef FIX_1123_CREND_16BIT_ROM crend_hrtf->pOut_to_bin_re_fx[i][j] = (int16_t *) malloc( ( ( (size_t) crend_hrtf->num_iterations[i][j] * output_frame ) ) * sizeof( int16_t ) ); if ( crend_hrtf->pOut_to_bin_re_fx[i][j] == NULL ) { return IVAS_ERR_FAILED_ALLOC; } crend_hrtf->pOut_to_bin_im_fx[i][j] = (int16_t *) malloc( ( ( (size_t) crend_hrtf->num_iterations[i][j] * output_frame ) ) * sizeof( int16_t ) ); if ( crend_hrtf->pOut_to_bin_im_fx[i][j] == NULL ) { return IVAS_ERR_FAILED_ALLOC; } #endif n = 0; Loading Loading @@ -1437,13 +1377,6 @@ ivas_error ivas_set_hrtf_fr( v_multc( &crend_hrtf->pOut_to_bin_im[i][j][( crend_hrtf->num_iterations[i][j] - 1 - m ) * output_frame], mdft_scale_fact, &crend_hrtf->pOut_to_bin_im[i][j][( crend_hrtf->num_iterations[i][j] - 1 - m ) * output_frame], output_frame ); #ifdef FIX_1123_CREND_16BIT_ROM for ( k = 0; k < output_frame; k++ ) { crend_hrtf->pOut_to_bin_re_fx[i][j][( crend_hrtf->num_iterations[i][j] - 1 - m ) * output_frame + k] = float2int16_t( crend_hrtf->pOut_to_bin_re[i][j][( crend_hrtf->num_iterations[i][j] - 1 - m ) * output_frame + k], 15 ); crend_hrtf->pOut_to_bin_im_fx[i][j][( crend_hrtf->num_iterations[i][j] - 1 - m ) * output_frame + k] = float2int16_t( crend_hrtf->pOut_to_bin_im[i][j][( crend_hrtf->num_iterations[i][j] - 1 - m ) * output_frame + k], 15 ); } #endif } } } Loading Loading
lib_com/options.h +0 −1 Original line number Diff line number Diff line Loading @@ -164,7 +164,6 @@ #define FIX_POINT_HRTF_FILE_FORMAT /* All: fix point hrtf binary file format */ #ifdef FIX_POINT_HRTF_FILE_FORMAT /*#define FIX_1123_CREND_16BIT_ROM*/ /* Ora: update CREND ROM tables to 16 bit */ #define FIX_1123_CREND_16BIT_FMT /* Ora: update CREND binary file format to 16 bit */ #define FIX_1123_CREND_FLTFX_BE /* Ora: make CREND FLT ROM tables BE to FX file */ /*#define FIX_1123_TDREN_16BIT_ROM*/ /* Eri,Ora: update TD Object Renderer tables to 16 bit */ Loading
lib_rend/ivas_crend.c +0 −402 File changed.Preview size limit exceeded, changes collapsed. Show changes
lib_rend/ivas_stat_rend.h +0 −11 Original line number Diff line number Diff line Loading @@ -1175,17 +1175,6 @@ typedef struct ivas_hrtfs_structure float inv_diffuse_weight[BINAURAL_CHANNELS][MAX_INTERN_CHANNELS]; /* inverse diffuse weights array, access one inverse weight by pInvDiffuseWeight[channel] */ int16_t same_inv_diffuse_weight; float gain_lfe; #ifdef FIX_1123_CREND_16BIT_ROM int16_t *pOut_to_bin_re_fx[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS]; int16_t *pOut_to_bin_im_fx[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS]; int16_t *pOut_to_bin_diffuse_re_fx[BINAURAL_CHANNELS]; int16_t *pOut_to_bin_diffuse_im_fx[BINAURAL_CHANNELS]; int16_t factor_Q_inv_diffuse_weight_fx; int16_t factor_Q_latency_s_fx; int16_t inv_diffuse_weight_fx[BINAURAL_CHANNELS][MAX_INTERN_CHANNELS]; /* inverse diffuse weights array, access one inverse weight by pInvDiffuseWeight[channel] */ int32_t latency_s_fx; int16_t gain_lfe_fx; #endif } HRTFS_DATA, *HRTFS_HANDLE; Loading
scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c +0 −214 Original line number Diff line number Diff line Loading @@ -1306,48 +1306,6 @@ int generate_crend_ivas_tables_from_sofa( const char *file_path, ConfigReader *c } #ifdef FIX_1123_CREND_16BIT_ROM hrtf_data.latency_s_fx = float2int32_t( hrtf_data.latency_s, factorQ[0] ); for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) { hrtf_data.inv_diffuse_weight_fx[0][i] = float2int16_t( hrtf_data.inv_diffuse_weight[0][i], factorQ[1] ); hrtf_data.inv_diffuse_weight_fx[1][i] = float2int16_t( hrtf_data.inv_diffuse_weight[1][i], factorQ[1] ); } for ( iIR = 0; iIR < hrtf_data.max_num_ir; iIR++ ) { for ( iChan = 0; iChan < BINAURAL_CHANNELS; iChan++ ) { offset = 0; for ( iIter = 0; iIter < hrtf_data.num_iterations[iIR][iChan]; iIter++ ) { // memcpy( hrtf_bin_wptr, coeff_rptr, data_size_tmp ); for ( i = 0; i < hrtf_data.pIndex_frequency_max[iIR][iChan][iIter]; i++ ) { hrtf_data.pOut_to_bin_re_fx[iIR][iChan][offset + i] = float2int16_t( hrtf_data.pOut_to_bin_re[iIR][iChan][offset + i], factorQ[2] ); hrtf_data.pOut_to_bin_im_fx[iIR][iChan][offset + i] = float2int16_t( hrtf_data.pOut_to_bin_im[iIR][iChan][offset + i], factorQ[2] ); } offset = offset + hrtf_data.pIndex_frequency_max[iIR][iChan][iIter]; } } } // pOut_to_bin_diffuse_re : The size depends on pIndex_frequency_max_diffuse for ( iChan = 0; iChan < BINAURAL_CHANNELS; iChan++ ) { offset = 0; for ( iIter = 0; iIter < hrtf_data.num_iterations_diffuse[iChan]; iIter++ ) { // memcpy( hrtf_bin_wptr, coeff_rptr, data_size_tmp ); for ( i = 0; i < hrtf_data.pIndex_frequency_max_diffuse[iChan][iIter]; i++ ) { hrtf_data.pOut_to_bin_diffuse_re_fx[iChan][offset + i] = float2int16_t( hrtf_data.pOut_to_bin_diffuse_re[iChan][offset + i], factorQ[2] ); hrtf_data.pOut_to_bin_diffuse_im_fx[iChan][offset + i] = float2int16_t( hrtf_data.pOut_to_bin_diffuse_im[iChan][offset + i], factorQ[2] ); } offset = offset + hrtf_data.pIndex_frequency_max_diffuse[iChan][iIter]; } } #endif #ifdef FIX_1123_CREND_FLTFX_BE int16_t factorQ[3]; Loading Loading @@ -2034,18 +1992,6 @@ int generate_reverb_ivas_tables_from_sofa( const char *file_path ) free( p_avg_lr ); p_avg_lr = NULL; } #ifdef FIX_1123_CREND_16BIT_ROM if ( pCoherence_fx ) { free( pCoherence_fx ); pCoherence_fx = NULL; } if ( p_avg_lr_fx ) { free( p_avg_lr_fx ); p_avg_lr_fx = NULL; } #endif } /* close the file */ Loading Loading @@ -2332,24 +2278,6 @@ void update_c_file_with_reverb( float *pEner_l, float *pEner_r, float *pCoherenc write_array_float_to_file( fp, pEner_r, len, NUM_SAMPLES_PER_LINES_REVERB, FORMAT_FLOAT_REVERB, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ";\n" ); #ifdef FIX_1123_CREND_16BIT_ROM fprintf( fp, "\n#ifdef FIX_1123_CREND_16BIT_ROM" ); /* float *defaultHRIR_right_avg_power_[LR_IAC_LENGTH_NR_FC];*/ fprintf( fp, "\nconst int16_t defaultHRIR_coherence_%dkHz_fx[%s] = \n", samplerate / 1000, len_str ); write_array_int16_t_to_file( fp, pCoherence_fx, len, NUM_SAMPLES_PER_LINES_REVERB, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ";\n" ); /* float *defaultHRIR_left_avg_power_[LR_IAC_LENGTH_NR_FC];*/ fprintf( fp, "\nconst int16_t defaultHRIR_left_avg_power_%dkHz_fx[%s] = \n", samplerate / 1000, len_str ); write_array_int16_t_to_file( fp, pEner_l_fx, len, NUM_SAMPLES_PER_LINES_REVERB, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ";\n" ); /* float *defaultHRIR_right_avg_power_[LR_IAC_LENGTH_NR_FC];*/ fprintf( fp, "\nconst int16_t defaultHRIR_right_avg_power_%dkHz_fx[%s] = \n", samplerate / 1000, len_str ); write_array_int16_t_to_file( fp, pEner_r_fx, len, NUM_SAMPLES_PER_LINES_REVERB, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ";\n" ); fprintf( fp, "\n#endif /* FIX_1123_CREND_16BIT_ROM */" ); #endif if ( fp ) fclose( fp ); Loading Loading @@ -2391,12 +2319,6 @@ void update_c_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int fprintf( fp, "\nconst float %s_%s_latency_s = ", DECLARATION_NAME, lscfg.name ); fprintf( fp, format_float_latency, hrtf->latency_s ); fprintf( fp, ";" ); #ifdef FIX_1123_CREND_16BIT_ROM fprintf( fp, "\n#ifdef FIX_1123_CREND_16BIT_ROM" ); fprintf( fp, "\nconst int16_t %s_%s_latency_s_Q_fx = %d;", DECLARATION_NAME, lscfg.name, factorQ[0] ); fprintf( fp, "\nconst int32_t %s_%s_latency_s_fx = %d;/*Q-31*/", DECLARATION_NAME, lscfg.name, hrtf->latency_s_fx ); fprintf( fp, "\n#endif // FIX_1123_CREND_16BIT_ROM" ); #endif } fprintf( fp, "\n\n/* Sample Rate = %ld */\n", (long) samplerate ); Loading Loading @@ -2486,19 +2408,6 @@ void update_c_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int write_array_float_to_file( fp, hrtf->inv_diffuse_weight[1], hrtf->max_num_ir, hrtf->max_num_ir, format_float, 0, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "}" ); fprintf( fp, ";" ); #ifdef FIX_1123_CREND_16BIT_ROM fprintf( fp, "\n#ifdef FIX_1123_CREND_16BIT_ROM" ); fprintf( fp, "\nconst int16_t %s_%s_inv_diffuse_weight_Q_%2dkHz_fx = %d;", DECLARATION_NAME, lscfg.name, samplerate / 1000, factorQ[1] ); /* float inv_diffuse_weight_fx[BINAURAL_CHANNELS][MAX_INTERN_CHANNELS]; */ fprintf( fp, "\nconst int16_t %s_%s_inv_diffuse_weight_%2dkHz_fx[BINAURAL_CHANNELS][%s]=", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name ); fprintf( fp, "{" ); write_array_int16_t_to_file( fp, hrtf->inv_diffuse_weight_fx[0], hrtf->max_num_ir, hrtf->max_num_ir, 0, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "," ); write_array_int16_t_to_file( fp, hrtf->inv_diffuse_weight_fx[1], hrtf->max_num_ir, hrtf->max_num_ir, 0, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "}" ); fprintf( fp, ";" ); fprintf( fp, "\n#endif // FIX_1123_CREND_16BIT_ROM" ); #endif /* uint16_t *pIndex_frequency_max_diffuse[BINAURAL_CHANNELS];*/ if ( hrtf->pIndex_frequency_max_diffuse[0] == NULL ) Loading Loading @@ -2547,78 +2456,7 @@ void update_c_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int fprintf( fp, "\n%s}", TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "\n};" ); #ifdef FIX_1123_CREND_16BIT_ROM fprintf( fp, "\n#ifdef FIX_1123_CREND_16BIT_ROM" ); fprintf( fp, "\nconst int16_t %s_%s_coeff_Q_%2dkHz_fx = %d;", DECLARATION_NAME, lscfg.name, samplerate / 1000, factorQ[2] ); /* float *pOut_to_bin_fx[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS];*/ fprintf( fp, "\nconst int16_t %s_%s_coeff_re_%2dkHz_fx[%s][BINAURAL_CHANNELS][%d]={", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name, maxTotalNumFreqSampPerIterations ); for ( i = 0; i < hrtf->max_num_ir - 1; i++ ) { fprintf( fp, "\n%s{\n", TAB_WITH_SPACE_OR_NOT ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_re_fx[i][0], pTotalNumFreqSampPerIterations[0][i], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ",\n" ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_re_fx[i][1], pTotalNumFreqSampPerIterations[1][i], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "\n%s},", TAB_WITH_SPACE_OR_NOT ); } fprintf( fp, "\n%s{\n", TAB_WITH_SPACE_OR_NOT ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_re_fx[i][0], pTotalNumFreqSampPerIterations[0][i], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ",\n" ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_re_fx[i][1], pTotalNumFreqSampPerIterations[1][i], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "\n%s}", TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "\n};" ); fprintf( fp, "\nconst int16_t %s_%s_coeff_im_%2dkHz_fx[%s][BINAURAL_CHANNELS][%d]={", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name, maxTotalNumFreqSampPerIterations ); for ( i = 0; i < hrtf->max_num_ir - 1; i++ ) { fprintf( fp, "\n%s{\n", TAB_WITH_SPACE_OR_NOT ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_im_fx[i][0], pTotalNumFreqSampPerIterations[0][i], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ",\n" ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_im_fx[i][1], pTotalNumFreqSampPerIterations[1][i], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "\n%s},", TAB_WITH_SPACE_OR_NOT ); } fprintf( fp, "\n%s{\n", TAB_WITH_SPACE_OR_NOT ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_im_fx[i][0], pTotalNumFreqSampPerIterations[0][i], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ",\n" ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_im_fx[i][1], pTotalNumFreqSampPerIterations[1][i], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "\n%s}", TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "\n};" ); fprintf( fp, "\n#endif // FIX_1123_CREND_16BIT_ROM" ); #endif #ifdef FIX_1123_CREND_16BIT_ROM fprintf( fp, "\n#ifdef FIX_1123_CREND_16BIT_ROM" ); /* float *pOut_to_bin_diffuse_re[BINAURAL_CHANNELS];*/ if ( hrtf->pOut_to_bin_diffuse_re_fx[0] == NULL ) { fprintf( fp, "\nconst int16_t *%s_%s_coeff_diffuse_re_%2dkHz_fx[BINAURAL_CHANNELS]={NULL,NULL};", DECLARATION_NAME, lscfg.name, samplerate / 1000 ); } else { fprintf( fp, "\nconst int16_t %s_%s_coeff_diffuse_re_%2dkHz_fx[BINAURAL_CHANNELS][%u]={", DECLARATION_NAME, lscfg.name, samplerate / 1000, maxTotalNumFreqSampPerIterationsDiffuse ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_diffuse_re_fx[0], pTotalNumFreqSampPerIterationsDiffuse[0], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ",\n" ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_diffuse_re_fx[1], pTotalNumFreqSampPerIterationsDiffuse[1], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "\n};" ); } /* float *pOut_to_bin_diffuse_im[BINAURAL_CHANNELS];*/ if ( hrtf->pOut_to_bin_diffuse_im_fx[0] == NULL ) { fprintf( fp, "\nconst int16_t *%s_%s_coeff_diffuse_im_%2dkHz_fx[BINAURAL_CHANNELS]={NULL,NULL};", DECLARATION_NAME, lscfg.name, samplerate / 1000 ); } else { fprintf( fp, "\nconst int16_t %s_%s_coeff_diffuse_im_%2dkHz_fx[BINAURAL_CHANNELS][%u]={", DECLARATION_NAME, lscfg.name, samplerate / 1000, maxTotalNumFreqSampPerIterationsDiffuse ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_diffuse_im_fx[0], pTotalNumFreqSampPerIterationsDiffuse[0], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ",\n" ); write_array_int16_t_to_file( fp, hrtf->pOut_to_bin_diffuse_im_fx[1], pTotalNumFreqSampPerIterationsDiffuse[1], NUM_SAMPLES_PER_LINES, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, "\n};" ); } fprintf( fp, "\n#endif // FIX_1123_CREND_16BIT_ROM" ); #endif /* float *pOut_to_bin_diffuse_re[BINAURAL_CHANNELS];*/ if ( hrtf->pOut_to_bin_diffuse_re[0] == NULL ) Loading Loading @@ -2695,15 +2533,6 @@ void update_h_file_with_reverb( int32_t samplerate ) /* float *defaultHRIR_left_avg_power[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS];*/ fprintf( fp, "\nextern float defaultHRIR_left_avg_power_%dkHz[%s];", samplerate / 1000, len_str ); fprintf( fp, "\nextern float defaultHRIR_right_avg_power_%dkHz[%s];", samplerate / 1000, len_str ); #ifdef FIX_1123_CREND_16BIT_ROM fprintf( fp, "\n#ifdef FIX_1123_CREND_16BIT_ROM" ); /* Uint16_t *defaultHRIR_coherence_[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS];*/ fprintf( fp, "\nextern int16_t defaultHRIR_coherence_%dkHz_fx[%s];", samplerate / 1000, len_str ); /* Uint16_t *defaultHRIR_left_avg_power[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS];*/ fprintf( fp, "\nextern int16_t defaultHRIR_left_avg_power_%dkHz_fx[%s];", samplerate / 1000, len_str ); fprintf( fp, "\nextern int16_t defaultHRIR_right_avg_power_%dkHz_fx[%s];", samplerate / 1000, len_str ); fprintf( fp, "\n#endif /* FIX_1123_CREND_16BIT_ROM */" ); #endif if ( fp ) fclose( fp ); Loading Loading @@ -2779,12 +2608,6 @@ void update_h_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int /* float latency_s; */ fprintf( fp, "\n\n/********************** %s_%s **********************/\n", DECLARATION_NAME, lscfg.name ); fprintf( fp, "\nextern float %s_%s_latency_s;", DECLARATION_NAME, lscfg.name ); #ifdef FIX_1123_CREND_16BIT_ROM fprintf( fp, "\n#ifdef FIX_1123_CREND_16BIT_ROM" ); fprintf( fp, "\nextern int16_t %s_%s_latency_s_Q_fx;", DECLARATION_NAME, lscfg.name ); fprintf( fp, "\nextern int32_t %s_%s_latency_s_fx;", DECLARATION_NAME, lscfg.name ); fprintf( fp, "\n#endif // FIX_1123_CREND_16BIT_ROM" ); #endif } fprintf( fp, "\n\n/* Sample Rate = %ld */\n", (long) samplerate ); Loading @@ -2805,13 +2628,6 @@ void update_h_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int /* float inv_diffuse_weight[BINAURAL_CHANNELS][MAX_INTERN_CHANNELS]; */ fprintf( fp, "\nextern float %s_%s_inv_diffuse_weight_%2dkHz[BINAURAL_CHANNELS][%s];", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name ); #ifdef FIX_1123_CREND_16BIT_ROM /* float inv_diffuse_weight_fx[BINAURAL_CHANNELS][MAX_INTERN_CHANNELS]; */ fprintf( fp, "\n#ifdef FIX_1123_CREND_16BIT_ROM" ); fprintf( fp, "\nextern int16_t %s_%s_inv_diffuse_weight_Q_%2dkHz_fx;", DECLARATION_NAME, lscfg.name, samplerate / 1000 ); fprintf( fp, "\nextern int16_t %s_%s_inv_diffuse_weight_%2dkHz_fx[BINAURAL_CHANNELS][%s];", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name ); fprintf( fp, "\n#endif // FIX_1123_CREND_16BIT_ROM" ); #endif /* uint16_t *pIndex_frequency_max_diffuse[BINAURAL_CHANNELS];*/ if ( hrtf->pIndex_frequency_max_diffuse[0] == NULL ) Loading @@ -2827,36 +2643,6 @@ void update_h_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int fprintf( fp, "\nextern float %s_%s_coeff_re_%2dkHz[%s][BINAURAL_CHANNELS][%u];", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name, maxTotalNumFreqSampPerIterations ); fprintf( fp, "\nextern float %s_%s_coeff_im_%2dkHz[%s][BINAURAL_CHANNELS][%u];", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name, maxTotalNumFreqSampPerIterations ); #ifdef FIX_1123_CREND_16BIT_ROM fprintf( fp, "\n#ifdef FIX_1123_CREND_16BIT_ROM" ); /* int32_t *pOut_to_bin_fx[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS];*/ fprintf( fp, "\n#ifdef FIX_1123_CREND_16BIT_ROM" ); fprintf( fp, "\nextern int16_t %s_%s_coeff_Q_%2dkHz_fx;", DECLARATION_NAME, lscfg.name, samplerate / 1000 ); fprintf( fp, "\n#endif" ); fprintf( fp, "\nextern int16_t %s_%s_coeff_re_%2dkHz_fx[%s][BINAURAL_CHANNELS][%u];", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name, maxTotalNumFreqSampPerIterations ); fprintf( fp, "\nextern int16_t %s_%s_coeff_im_%2dkHz_fx[%s][BINAURAL_CHANNELS][%u];", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name, maxTotalNumFreqSampPerIterations ); /* float *pOut_to_bin_diffuse_re_fx[BINAURAL_CHANNELS];*/ if ( hrtf->pOut_to_bin_diffuse_re_fx[0] == NULL ) { fprintf( fp, "\nextern int16_t *%s_%s_coeff_diffuse_re_%2dkHz_fx[BINAURAL_CHANNELS];", DECLARATION_NAME, lscfg.name, samplerate / 1000 ); } else { fprintf( fp, "\nextern int16_t %s_%s_coeff_diffuse_re_%2dkHz_fx[BINAURAL_CHANNELS][%u];", DECLARATION_NAME, lscfg.name, samplerate / 1000, maxTotalNumFreqSampPerIterationsDiffuse ); } /* float *pOut_to_bin_diffuse_im_fx[BINAURAL_CHANNELS];*/ if ( hrtf->pOut_to_bin_diffuse_im_fx[0] == NULL ) { fprintf( fp, "\nextern int16_t *%s_%s_coeff_diffuse_im_%2dkHz_fx[BINAURAL_CHANNELS];", DECLARATION_NAME, lscfg.name, samplerate / 1000 ); } else { fprintf( fp, "\nextern int16_t %s_%s_coeff_diffuse_im_%2dkHz_fx[BINAURAL_CHANNELS][%u];", DECLARATION_NAME, lscfg.name, samplerate / 1000, maxTotalNumFreqSampPerIterationsDiffuse ); } fprintf( fp, "\n#endif // FIX_1123_CREND_16BIT_ROM" ); #endif /* float *pOut_to_bin_diffuse_re[BINAURAL_CHANNELS];*/ if ( hrtf->pOut_to_bin_diffuse_re[0] == NULL ) { Loading
scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.c +0 −67 Original line number Diff line number Diff line Loading @@ -216,18 +216,6 @@ ivas_error ivas_hrtf_close( free( hHRTF->pOut_to_bin_im[i][j] ); hHRTF->pOut_to_bin_im[i][j] = NULL; } #ifdef FIX_1123_CREND_16BIT_ROM if ( hHRTF->pOut_to_bin_re_fx[i][j] != NULL ) { free( hHRTF->pOut_to_bin_re_fx[i][j] ); hHRTF->pOut_to_bin_re_fx[i][j] = NULL; } if ( hHRTF->pOut_to_bin_im_fx[i][j] != NULL ) { free( hHRTF->pOut_to_bin_im_fx[i][j] ); hHRTF->pOut_to_bin_im_fx[i][j] = NULL; } #endif } } for ( j = 0; j < BINAURAL_CHANNELS; j++ ) Loading @@ -247,18 +235,6 @@ ivas_error ivas_hrtf_close( free( hHRTF->pOut_to_bin_diffuse_im[j] ); hHRTF->pOut_to_bin_diffuse_im[j] = NULL; } #ifdef FIX_1123_CREND_16BIT_ROM if ( hHRTF->pOut_to_bin_diffuse_re_fx[j] != NULL ) { free( hHRTF->pOut_to_bin_diffuse_re_fx[j] ); hHRTF->pOut_to_bin_diffuse_re_fx[j] = NULL; } if ( hHRTF->pOut_to_bin_diffuse_im_fx[j] != NULL ) { free( hHRTF->pOut_to_bin_diffuse_im_fx[j] ); hHRTF->pOut_to_bin_diffuse_im_fx[j] = NULL; } #endif } return IVAS_ERR_OK; Loading Loading @@ -798,10 +774,6 @@ ivas_error ivas_crend_binaural_filter_design_set_hrtf_fr( { pParam->pOut_to_bin_re[i_chan][i_ear] = (float *) malloc( (size_t) pParam->num_iterations[i_chan][i_ear] * frame_len * sizeof( float ) ); pParam->pOut_to_bin_im[i_chan][i_ear] = (float *) malloc( (size_t) pParam->num_iterations[i_chan][i_ear] * frame_len * sizeof( float ) ); #ifdef FIX_1123_CREND_16BIT_ROM pParam->pOut_to_bin_re_fx[i_chan][i_ear] = (int16_t *) malloc( (size_t) pParam->num_iterations[i_chan][i_ear] * frame_len * sizeof( int16_t ) ); pParam->pOut_to_bin_im_fx[i_chan][i_ear] = (int16_t *) malloc( (size_t) pParam->num_iterations[i_chan][i_ear] * frame_len * sizeof( int16_t ) ); #endif } } Loading Loading @@ -966,10 +938,6 @@ ivas_error ivas_crend_binaural_filter_design_set_hrtf_fr( { pParam->pOut_to_bin_re[i_chan][i_ear] = (float *) malloc( totSizeFreq[i_chan] * sizeof( float ) ); pParam->pOut_to_bin_im[i_chan][i_ear] = (float *) malloc( totSizeFreq[i_chan] * sizeof( float ) ); #ifdef FIX_1123_CREND_16BIT_ROM pParam->pOut_to_bin_re_fx[i_chan][i_ear] = (int16_t *) malloc( totSizeFreq[i_chan] * sizeof( int16_t ) ); pParam->pOut_to_bin_im_fx[i_chan][i_ear] = (int16_t *) malloc( totSizeFreq[i_chan] * sizeof( int16_t ) ); #endif offset = 0; for ( i_block = 0; i_block < pParam->num_iterations[i_chan][i_ear]; ++i_block ) { Loading Loading @@ -1008,10 +976,6 @@ ivas_error ivas_crend_binaural_filter_design_set_hrtf_fr( { pParam->pOut_to_bin_re[i_chan][i_ear][offset + i_tap] = pBlockSpectrum_r[i_tap]; pParam->pOut_to_bin_im[i_chan][i_ear][offset + i_tap] = pBlockSpectrum_i[i_tap]; #ifdef FIX_1123_CREND_16BIT_ROM pParam->pOut_to_bin_re_fx[i_chan][i_ear][offset + i_tap] = float2int16_t( pParam->pOut_to_bin_re[i_chan][i_ear][offset + i_tap], 15 ); pParam->pOut_to_bin_im_fx[i_chan][i_ear][offset + i_tap] = float2int16_t( pParam->pOut_to_bin_im[i_chan][i_ear][offset + i_tap], 15 ); #endif } offset = offset + pParam->pIndex_frequency_max[i_chan][i_ear][i_block]; } Loading @@ -1024,10 +988,6 @@ ivas_error ivas_crend_binaural_filter_design_set_hrtf_fr( { pParam->pOut_to_bin_diffuse_re[i_ear] = NULL; pParam->pOut_to_bin_diffuse_im[i_ear] = NULL; #ifdef FIX_1123_CREND_16BIT_ROM pParam->pOut_to_bin_diffuse_re_fx[i_ear] = NULL; pParam->pOut_to_bin_diffuse_im_fx[i_ear] = NULL; #endif } } Loading Loading @@ -1274,10 +1234,6 @@ ivas_error ivas_crend_binaural_filter_design_set_hrtf_fr( { pParam->pOut_to_bin_diffuse_re[i_ear] = (float *) malloc( totSizeFreqDiffuse * sizeof( float ) ); pParam->pOut_to_bin_diffuse_im[i_ear] = (float *) malloc( totSizeFreqDiffuse * sizeof( float ) ); #ifdef FIX_1123_CREND_16BIT_ROM pParam->pOut_to_bin_diffuse_re_fx[i_ear] = (int16_t *) malloc( totSizeFreqDiffuse * sizeof( int16_t ) ); pParam->pOut_to_bin_diffuse_im_fx[i_ear] = (int16_t *) malloc( totSizeFreqDiffuse * sizeof( int16_t ) ); #endif offset = 0; for ( i_block = 0; i_block < pParam->num_iterations_diffuse[0]; ++i_block ) { Loading Loading @@ -1326,10 +1282,6 @@ ivas_error ivas_crend_binaural_filter_design_set_hrtf_fr( { pParam->pOut_to_bin_diffuse_re[i_ear][offset + i_tap] = pBlockSpectrum_r[i_tap]; pParam->pOut_to_bin_diffuse_im[i_ear][offset + i_tap] = pBlockSpectrum_i[i_tap]; #ifdef FIX_1123_CREND_16BIT_ROM pParam->pOut_to_bin_diffuse_re_fx[i_ear][offset + i_tap] = float2int16_t( pParam->pOut_to_bin_diffuse_re[i_ear][offset + i_tap], 15 ); pParam->pOut_to_bin_diffuse_im_fx[i_ear][offset + i_tap] = float2int16_t( pParam->pOut_to_bin_diffuse_im[i_ear][offset + i_tap], 15 ); #endif } offset = offset + pParam->pIndex_frequency_max_diffuse[i_ear][i_block]; } Loading Loading @@ -1392,18 +1344,6 @@ ivas_error ivas_set_hrtf_fr( return IVAS_ERR_FAILED_ALLOC; } #ifdef FIX_1123_CREND_16BIT_ROM crend_hrtf->pOut_to_bin_re_fx[i][j] = (int16_t *) malloc( ( ( (size_t) crend_hrtf->num_iterations[i][j] * output_frame ) ) * sizeof( int16_t ) ); if ( crend_hrtf->pOut_to_bin_re_fx[i][j] == NULL ) { return IVAS_ERR_FAILED_ALLOC; } crend_hrtf->pOut_to_bin_im_fx[i][j] = (int16_t *) malloc( ( ( (size_t) crend_hrtf->num_iterations[i][j] * output_frame ) ) * sizeof( int16_t ) ); if ( crend_hrtf->pOut_to_bin_im_fx[i][j] == NULL ) { return IVAS_ERR_FAILED_ALLOC; } #endif n = 0; Loading Loading @@ -1437,13 +1377,6 @@ ivas_error ivas_set_hrtf_fr( v_multc( &crend_hrtf->pOut_to_bin_im[i][j][( crend_hrtf->num_iterations[i][j] - 1 - m ) * output_frame], mdft_scale_fact, &crend_hrtf->pOut_to_bin_im[i][j][( crend_hrtf->num_iterations[i][j] - 1 - m ) * output_frame], output_frame ); #ifdef FIX_1123_CREND_16BIT_ROM for ( k = 0; k < output_frame; k++ ) { crend_hrtf->pOut_to_bin_re_fx[i][j][( crend_hrtf->num_iterations[i][j] - 1 - m ) * output_frame + k] = float2int16_t( crend_hrtf->pOut_to_bin_re[i][j][( crend_hrtf->num_iterations[i][j] - 1 - m ) * output_frame + k], 15 ); crend_hrtf->pOut_to_bin_im_fx[i][j][( crend_hrtf->num_iterations[i][j] - 1 - m ) * output_frame + k] = float2int16_t( crend_hrtf->pOut_to_bin_im[i][j][( crend_hrtf->num_iterations[i][j] - 1 - m ) * output_frame + k], 15 ); } #endif } } } Loading