Commit 0907c068 authored by emerit's avatar emerit
Browse files

On going

parent 1838dde3
Loading
Loading
Loading
Loading
+10214 −10214

File changed.

Preview size limit exceeded, changes collapsed.

+21 −0
Original line number Diff line number Diff line
@@ -133,6 +133,7 @@ void write_binary_file( const char *name, HRTFS_DATA *hrtf, struct ivas_layout_c

#endif // MIXER_CONV_BINARY_FILE_311


/*---------------------------------------------------------------------*
 *
 * Avoid compiling all decoder create a false get_next_indice function
@@ -313,6 +314,7 @@ int main( int argc, char *argv[] )
                return -1;
            }
            lib_rend_path = malloc( strlen( argv[i] ) + 1 );
            convert_backslash( argv[i] );
            strcpy( lib_rend_path, argv[i] );
            notEndingWithSeparator = ( ( argv[i][strlen( argv[i] ) - 1] == '\\' ) || ( ( argv[i][strlen( argv[i] ) - 1] == '/' ) ) ) ? 0 : 1;
            i++;
@@ -327,6 +329,7 @@ int main( int argc, char *argv[] )
                usage_gen_crend_tables();
                return -1;
            }
            convert_backslash( argv[i] );
            binary_path = malloc( strlen( argv[i] ) + 1 );
            strcpy( binary_path, argv[i] );
            notEndingWithSeparator = ( ( argv[i][strlen( argv[i] ) - 1] == '\\' ) || ( ( argv[i][strlen( argv[i] ) - 1] == '/' ) ) ) ? 0 : 1;
@@ -783,6 +786,8 @@ int main( int argc, char *argv[] )
                }
            }
        }
        convert_backslash( argv[i] );

#ifdef FIX_INV_DIFFUSE_WEIGHT
        err = generate_crend_ivas_tables_from_sofa( argv[i], no_optim, harmonize_late_reverb_binaural_gain, late_reverb_compensation_gain );
#else
@@ -933,6 +938,16 @@ int generate_crend_ivas_tables_from_sofa( const char *file_path, bool no_optim )
        args = Py_BuildValue( "(s)", sofa_file_path );
        kwargs = NULL;
        py_results = PyObject_Call( sofa_load_func, args, kwargs );
        if ( py_results == NULL )
        {
            Py_DECREF( py_results );

            fprintf( stderr, "Wrong file with wrong sample rate %s!\n\n", sofa_file_path );
            usage_gen_crend_tables();
            free( sofa_file_path );

            return -1;
        }
        Py_DECREF( args );
        ret = PyTuple_Check( py_results );
        if ( ret )
@@ -1519,7 +1534,11 @@ int generate_crend_ivas_tables_from_sofa( const char *file_path, bool no_optim )

#ifdef MIXER_CONV_BINARY_FILE_311

#ifdef _WIN32
        char *tmpstr = strrchr( file_path, '\\' );
#else
        char *tmpstr = strrchr( file_path, '/' );
#endif
        char *file_name;
        if ( tmpstr == NULL )
        {
@@ -2396,6 +2415,8 @@ void write_binary_file( const char *name, HRTFS_DATA *hrtf, struct ivas_layout_c

    binary_file_full_path = (char *) malloc( sizeof( char ) * ( strlen( binary_file_path ) + strlen( name ) + 1 + 1 + 2 + 8 ) );
    sprintf( binary_file_full_path, "%s_%s_%ikHz.bin", binary_file_path, name, samplerate / 1000 );
    fprintf( stdout, "Write Binary file %s:\n", binary_file_full_path );


    output_binary_file = fopen( binary_file_full_path, "wb" );
    if ( output_binary_file == NULL )
+3 −2
Original line number Diff line number Diff line
@@ -55,8 +55,8 @@ ivas_path = ['..' filesep '..' filesep];

%% Set input files
%hrir_file_name = 'D1_48K_24bit_256tap_FIR_SOFA.sofa';
hrir_file_name = 'HRIR_128_Meth5_IRC_51_Q10_symL_Itrp1_48000.sofa';
% hrir_file_name = 'HRIR_128_Meth5_IRC_53_Q10_symL_Itrp1_48000.sofa';
%hrir_file_name = 'HRIR_128_Meth5_IRC_51_Q10_symL_Itrp1_48000.sofa';
hrir_file_name = 'HRIR_128_Meth5_IRC_53_Q10_symL_Itrp1_48000.sofa';
brir_file_name = 'IIS_BRIR_officialMPEG_Combined.sofa';
hrir_path = fullfile ('.','HRIRs_sofa');
brir_path = fullfile ('.','BRIRs_sofa');
@@ -99,6 +99,7 @@ command = [command ...
                    erase(hrir_file,'.sofa') '_HOA3.sofa ' ... 
                    brir_file ];

%display(command);

[status, cmdout] = system(command);
if status ~= 0