Commit 27563342 authored by emerit's avatar emerit
Browse files

add readme file

parent 3ce80666
Loading
Loading
Loading
Loading
Loading
+33 −33
Original line number Diff line number Diff line
@@ -130,12 +130,12 @@ void usage_gen_crend_tables( void )

    fprintf( stdout, "Mandatory parameters:\n" );
    fprintf( stdout, "---------------------\n" );
    fprintf( stdout, "frame_length_ms                              : frame size in ms (5 or 20)" );
    fprintf( stdout, "sofa_file_path1 sofa_file_path2 ...          : paths of the sofa files to process %ld Hz sample rate mandatory\n", (long) DEFAULT_SAMPLERATE );
    fprintf( stdout, "frame_length_ms                              : path where header and c files will be created (lib_dec forlder for example, default = './')\n" );

    fprintf( stdout, "Options:\n" );
    fprintf( stdout, "--------\n" );
    fprintf( stdout, "-lib_dec_path path       : path where header and c files will be created (lib_dec forlder for example, default = './')\n" );
    fprintf( stdout, "-lib_rend_path path      : path where header and c files will be created (lib_dec forlder for example, default = './')\n" );
    fprintf( stdout, "-no_optim                : if present no BRIR optimisation is perfromed \n" );
    fprintf( stdout, "\n" );
}
@@ -167,7 +167,7 @@ int main( int argc, char *argv[] )

    FILE *fp = NULL;

    char *lib_dec_path = NULL;
    char *lib_rend_path = NULL;
    bool no_optim = false;
    int notEndingWithSeparator = 0;

@@ -175,7 +175,7 @@ int main( int argc, char *argv[] )
    /* Optional arguments */
    while ( argv[i][0] == '-' )
    {
        if ( strcmp( to_upper( argv[i] ), "-LIB_DEC_PATH" ) == 0 )
        if ( strcmp( to_upper( argv[i] ), "-LIB_REND_PATH" ) == 0 )
        {
            i++;
            if ( strlen( argv[i] ) == 0 )
@@ -184,8 +184,8 @@ int main( int argc, char *argv[] )
                usage_gen_crend_tables();
                return -1;
            }
            lib_dec_path = malloc( strlen( argv[i] ) + 1 );
            strcpy( lib_dec_path, argv[i] );
            lib_rend_path = malloc( strlen( argv[i] ) + 1 );
            strcpy( lib_rend_path, argv[i] );
            notEndingWithSeparator = ( ( argv[i][strlen( argv[i] ) - 1] == '\\' ) || ( ( argv[i][strlen( argv[i] ) - 1] == '/' ) ) ) ? 0 : 1;
            i++;
        }
@@ -206,8 +206,8 @@ int main( int argc, char *argv[] )
    {
        fprintf( stderr, "Unknown option: %s need to specify frame length in ms\n\n", argv[i] );
        usage_gen_crend_tables();
        if ( lib_dec_path )
            free( lib_dec_path );
        if ( lib_rend_path )
            free( lib_rend_path );
        return -1;
    }
    frame_len_ms = atoi( argv[i] );
@@ -217,8 +217,8 @@ int main( int argc, char *argv[] )
    {
        fprintf( stderr, "Unknown option: %s need to specify frame length in ms 5 or 20\n\n", argv[i] );
        usage_gen_crend_tables();
        if ( lib_dec_path )
            free( lib_dec_path );
        if ( lib_rend_path )
            free( lib_rend_path );
        return -1;
    }

@@ -232,30 +232,30 @@ int main( int argc, char *argv[] )
    {
        fprintf( stderr, "Memory issue for rom file temporary name\n\n" );
        usage_gen_crend_tables();
        if ( lib_dec_path )
            free( lib_dec_path );
        if ( lib_rend_path )
            free( lib_rend_path );
        return -1;
    }

    if ( lib_dec_path )
    if ( lib_rend_path )
    {
        c_file_path = (char *) malloc( sizeof( char ) * ( strlen( lib_dec_path ) + strlen( ROM_FILE_NAME ) + 2 + 1 + notEndingWithSeparator ) );
        c_file_path = (char *) malloc( sizeof( char ) * ( strlen( lib_rend_path ) + strlen( ROM_FILE_NAME ) + 2 + 1 + notEndingWithSeparator ) );
        if ( c_file_path )
        {
            if ( notEndingWithSeparator )
            {
#ifdef WIN32
                sprintf( c_file_path, "%s\\%s.c", lib_dec_path, ROM_FILE_NAME );
                sprintf( c_file_path, "%s\\%s.c", lib_rend_path, ROM_FILE_NAME );
#else
                sprintf( c_file_path, "%s/%s.c", lib_dec_path, ROM_FILE_NAME );
                sprintf( c_file_path, "%s/%s.c", lib_rend_path, ROM_FILE_NAME );
#endif
            }
            else
            {
#ifdef WIN32
                sprintf( c_file_path, "%s%s.c", lib_dec_path, ROM_FILE_NAME );
                sprintf( c_file_path, "%s%s.c", lib_rend_path, ROM_FILE_NAME );
#else
                sprintf( c_file_path, "%s%s.c", lib_dec_path, ROM_FILE_NAME );
                sprintf( c_file_path, "%s%s.c", lib_rend_path, ROM_FILE_NAME );
#endif
            }
        }
@@ -263,40 +263,40 @@ int main( int argc, char *argv[] )
        {
            fprintf( stderr, "Memory issue for c file path\n\n" );
            usage_gen_crend_tables();
            if ( lib_dec_path )
                free( lib_dec_path );
            if ( lib_rend_path )
                free( lib_rend_path );
            return -1;
        }
        fp = fopen( c_file_path, "w" );
        if ( fp == NULL )
        {
            fprintf( stderr, "Wrong lib_dec path: %s\n\n", lib_dec_path );
            fprintf( stderr, "Wrong lib_dec path: %s\n\n", lib_rend_path );
            usage_gen_crend_tables();
            if ( c_file_path )
                free( c_file_path );
            if ( lib_dec_path )
                free( lib_dec_path );
            if ( lib_rend_path )
                free( lib_rend_path );
            return -1;
        }
        fclose( fp );

        h_file_path = (char *) malloc( sizeof( char ) * ( strlen( lib_dec_path ) + strlen( ROM_FILE_NAME ) + 2 + 1 + notEndingWithSeparator ) );
        h_file_path = (char *) malloc( sizeof( char ) * ( strlen( lib_rend_path ) + strlen( ROM_FILE_NAME ) + 2 + 1 + notEndingWithSeparator ) );
        if ( h_file_path )
        {
            if ( notEndingWithSeparator )
            {
#ifdef WIN32
                sprintf( h_file_path, "%s\\%s.h", lib_dec_path, ROM_FILE_NAME );
                sprintf( h_file_path, "%s\\%s.h", lib_rend_path, ROM_FILE_NAME );
#else
                sprintf( h_file_path, "%s/%s.h", lib_dec_path, ROM_FILE_NAME );
                sprintf( h_file_path, "%s/%s.h", lib_rend_path, ROM_FILE_NAME );
#endif
            }
            else
            {
#ifdef WIN32
                sprintf( h_file_path, "%s\\%s.h", lib_dec_path, ROM_FILE_NAME );
                sprintf( h_file_path, "%s\\%s.h", lib_rend_path, ROM_FILE_NAME );
#else
                sprintf( h_file_path, "%s/%s.h", lib_dec_path, ROM_FILE_NAME );
                sprintf( h_file_path, "%s/%s.h", lib_rend_path, ROM_FILE_NAME );
#endif
            }
        }
@@ -306,21 +306,21 @@ int main( int argc, char *argv[] )
            usage_gen_crend_tables();
            if ( c_file_path )
                free( c_file_path );
            if ( lib_dec_path )
                free( lib_dec_path );
            if ( lib_rend_path )
                free( lib_rend_path );
            return -1;
        }
        fp = fopen( h_file_path, "w" );
        if ( fp == NULL )
        {
            fprintf( stderr, "Wrong lib_dec path: %s\n\n", lib_dec_path );
            fprintf( stderr, "Wrong lib_dec path: %s\n\n", lib_rend_path );
            usage_gen_crend_tables();
            if ( h_file_path )
                free( h_file_path );
            if ( c_file_path )
                free( c_file_path );
            if ( lib_dec_path )
                free( lib_dec_path );
            if ( lib_rend_path )
                free( lib_rend_path );
            return -1;
        }
        fclose( fp );
+56 −0
Original line number Diff line number Diff line
/******************************************************************************************************

   (C) 2022 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
   Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
   Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
   Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
   contributors to this repository. All Rights Reserved.

   This software is protected by copyright law and by international treaties.
   The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
   Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
   Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
   Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
   contributors to this repository retain full ownership rights in their respective contributions in
   the software. This notice grants no license of any kind, including but not limited to patent
   license, nor is any license granted by implication, estoppel or otherwise.

   Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
   contributions.

   This software is provided "AS IS", without any express or implied warranties. The software is in the
   development stage. It is intended exclusively for experts who have experience with such software and
   solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
   and fitness for a particular purpose are hereby disclaimed and excluded.

   Any dispute, controversy or claim arising under or in relation to providing this software shall be
   submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
   accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
   the United Nations Convention on Contracts on the International Sales of Goods.

*******************************************************************************************************/

Mixer conv sofa to rom table converter program
------------------------------

The sofa to rom format converter is used to generate the c files (*.h,*.c) containing the binary representation of the binaural 
filters for renderer MIXER_CONV and MIXER_CONV_ROOM 

First, build the converter under scripts/binauralRenderer_interface in VSCode (using CMakeList).

Usage: 
------
generate_crend_ivas_tables [Options]

Mandatory parameters : 
   - Frame size in ms (5 or 20)
   - list of sofa files (one with HRIR that directions of IVAS combined speakers configuration or more, one with HOA to binaura filters at least order 3, one with BRIR filters that directions of IVAS combined speakers configuration or more)

Options :
   -lib_rend_path : Path where output file will be created (with separator, default = './').
   -no_optim : if present the BRIR filters are not optimised the renderer will perform perfect convolution with the complete size of the BRIR (high files size and high complexity). It is useful for debug purpose

For example :
                
./build/generate_crend_ivas_tables.exe -lib_rend_path ../../lib_rend 5 ./HRIRs_sofa/HRIR_128_Meth5_IRC_53_Q10_symL_Itrp1_48000.sofa ./HRIRs_sofa/ORANGE_HRIR_53_HOA3S_48000.sofa ./BRIRs_sofa/IIS_BRIR_officialMPEG_Combined.sofa
./build/generate_crend_ivas_tables -lib_rend_path ../../lib_rend 5 ./HRIRs_sofa/HRIR_128_Meth5_IRC_53_Q10_symL_Itrp1_48000.sofa ./HRIRs_sofa/ORANGE_HRIR_53_HOA3S_48000.sofa ./BRIRs_sofa/IIS_BRIR_officialMPEG_Combined.sofa
 No newline at end of file