Commit 88d11123 authored by emerit's avatar emerit
Browse files

initial version

parent 6a18db23
Loading
Loading
Loading
Loading
+0 −54
Original line number Diff line number Diff line
@@ -722,20 +722,6 @@ int main(
        }

#ifdef NONBE_FIX_BINARY_BINAURAL_READING
        if ( ( error = load_HRTF_binary( *hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK )
        {
            if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
            {
#ifdef FIX_OLD_BINARY_FORMAT
                hrtfFileReader_close( &hrtfReader );
                strcat( arg.hrtfFileName, "new" );

                if ( hrtfFileReader_open( arg.hrtfFileName, &hrtfReader ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName );
                    goto cleanup;
                }

        if ( ( error = load_HRTF_binary( *hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK )
        {
            if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
@@ -748,16 +734,6 @@ int main(
                destroy_td_hrtf( hHrtfTD );
            }
        }
#else
                fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName );
                goto cleanup;
#endif
            }
            else
            {
                destroy_td_hrtf( hHrtfTD );
            }
        }
#else
        if ( ( error = load_HRTF_binary( hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK )
        {
@@ -797,29 +773,6 @@ int main(
#ifdef NONBE_FIX_BINARY_BINAURAL_READING
        if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfReader, arg.output_Fs ) ) != IVAS_ERR_OK )
        {
#ifdef FIX_OLD_BINARY_FORMAT
            cleanup_SetOfHRTF( hSetOfHRTF );
            hrtfFileReader_close( &hrtfReader );
            strcat( arg.hrtfFileName, "new" );

            if ( hrtfFileReader_open( arg.hrtfFileName, &hrtfReader ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName );
                goto cleanup;
            }
            if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfReader, arg.output_Fs ) ) != IVAS_ERR_OK )
            {
                if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
                {
                    fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName );
                    goto cleanup;
                }
                else
                {
                    destroy_SetOfHRTF( hSetOfHRTF );
                }
            }
#else
            if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
            {
                fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName );
@@ -831,13 +784,6 @@ int main(
            }
#endif
        }
#else
        if ( ( error = create_SetOfHRTF_from_binary( hSetOfHRTF, hrtfReader, arg.output_Fs ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError in loading HRTF binary file %s for CRend \n\n", arg.hrtfFileName );
            goto cleanup;
        }
#endif

#ifdef NONBE_FIX_BINARY_BINAURAL_READING
        IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL;
+0 −45
Original line number Diff line number Diff line
@@ -1044,18 +1044,6 @@ int main(
            {
                if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
                {
#ifdef FIX_OLD_BINARY_FORMAT
                    hrtfFileReader_close( &hrtfFileReader );
                    strcat( args.customHrtfFilePath, "new" );
                    if ( hrtfFileReader_open( args.customHrtfFilePath, &hrtfFileReader ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nError in loading HRTF binary file %s: %s \n\n", args.customHrtfFilePath, ivas_error_to_string( error ) );
                        goto cleanup;
                    }
                    if ( ( error = load_HRTF_binary( *hHrtfTD, hrtfFileReader ) ) != IVAS_ERR_OK )
                    {
                        if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
                        {
                    fprintf( stderr, "\nError in loading HRTF binary file %s: %s \n\n", args.customHrtfFilePath, ivas_error_to_string( error ) );
                    goto cleanup;
                }
@@ -1064,16 +1052,6 @@ int main(
                    destroy_td_hrtf( hHrtfTD );
                }
            }
#else
                    fprintf( stderr, "\nError in loading HRTF binary file %s: %s \n\n", args.customHrtfFilePath, ivas_error_to_string( error ) );
                    goto cleanup;
#endif
                }
                else
                {
                    destroy_td_hrtf( hHrtfTD );
                }
            }

#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES
            if ( ( hHrtfTD != NULL ) && ( error = load_reverb_binary( *hHrtfTD, hrtfFileReader ) ) != IVAS_ERR_OK )
@@ -1094,28 +1072,6 @@ int main(

            if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfFileReader, args.sampleRate ) ) != IVAS_ERR_OK )
            {
#ifdef FIX_OLD_BINARY_FORMAT
                cleanup_SetOfHRTF( hSetOfHRTF );
                hrtfFileReader_close( &hrtfFileReader );
                strcat( args.customHrtfFilePath, "new" );
                if ( hrtfFileReader_open( args.customHrtfFilePath, &hrtfFileReader ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError in loading HRTF binary file %s: %s \n\n", args.customHrtfFilePath, ivas_error_to_string( error ) );
                    goto cleanup;
                }
                if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfFileReader, args.sampleRate ) ) != IVAS_ERR_OK )
                {
                    if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
                    {
                        fprintf( stderr, "\nError in loading HRTF binary file %s:%s \n\n", args.customHrtfFilePath, ivas_error_to_string( error ) );
                        goto cleanup;
                    }
                    else
                    {
                        destroy_SetOfHRTF( hSetOfHRTF );
                    }
                }
#else
                if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
                {
                    fprintf( stderr, "\nError in loading HRTF binary file %s:%s \n\n", args.customHrtfFilePath, ivas_error_to_string( error ) );
@@ -1125,7 +1081,6 @@ int main(
                {
                    destroy_SetOfHRTF( hSetOfHRTF );
                }
#endif
            }

            if ( ( error = IVAS_REND_GetHrtfFastConvHandle( hIvasRend, &hHrtfFastConv ) ) != IVAS_ERR_OK )
+0 −1
Original line number Diff line number Diff line
@@ -153,7 +153,6 @@
#define FIX_954_OTR_REF_VEC                             /* FhG: Fix forward vector direction for OTR REF VEC mode */

#define FIX_638_ENERGIE_IAC_ROM_TABLES                  /* Orange : Missing left/right and coherence late reverb tables in binary format*/
#define FIX_OLD_BINARY_FORMAT                           /* Orange: temporary to maintain bitexactness */
#define FIX_WARNING_RENDER_CONFIG                       /* Orange: fix warning on windows build */
#define FIX_WARNING_SPLIT_RENDER                        /* Orange: fix warning on windows build vscode */
#define FIX_INV_DIFFUSE_WEIGHT                          /* Orange : Fix error in energy compensation in late binaural reverb*/
+3 −2
Original line number Diff line number Diff line
@@ -29,7 +29,8 @@
   the United Nations Convention on Contracts on the International Sales of Goods.
*******************************************************************************************************/
/* Generated on 08-Jan-2024 with Matlab version 9.3.0.948333 (R2017b) Update 9 by MUXE6256 on PCWIN64 */
/* Generated on 24-Jan-2024 with Matlab version 23.2.0.2485118 (R2023b) Update 6 by marcemerit on MACA64 */
/* clang-format off */
@@ -10111,7 +10112,7 @@ const uint32_t defaultHRIR_rom_ER16[HRTF_MODEL_N_SECTIONS * 470] = {
0x3933fa02,0x392db0b4,0x39271386,0x39265737,0x39253cfa,0x392dce3c,0x39336a79,0x393c7fe4,0x3944b0c9,0x39929d53,
};
const uint32_t defaultHRIR_rom_ITD_W[658] = {
0xb58b2818,0x3bdea435,0xbef12e52,0xbdeb5ab7,0x3dab4e66,0x3f042e6d,0xbf409841,0xbe91c05f,0xbd4540cb,0x3ee4982c,0xbe4f34d7,0xbf3c944d,0xbf5f4288,0xbe93aac2,0xbe41b919,0xbf30a7bb,0xbf8323e1,0x3ebe1f75,0xbebaee5e,0xbe7b161f,0xbf02cc15,0x3b313b38,0x3f0434ee,0x3e8240b5,0x3ec41384,
0xb58b2817,0x3bdea435,0xbef12e52,0xbdeb5ab7,0x3dab4e66,0x3f042e6d,0xbf409841,0xbe91c05f,0xbd4540cb,0x3ee4982c,0xbe4f34d7,0xbf3c944d,0xbf5f4288,0xbe93aac2,0xbe41b919,0xbf30a7bb,0xbf8323e1,0x3ebe1f75,0xbebaee5e,0xbe7b161f,0xbf02cc15,0x3b313b38,0x3f0434ee,0x3e8240b5,0x3ec41384,
0xbebd76c6,0x3f817fba,0x3f2f49e6,0x3e3d1acf,0x3e95178f,0x3f5ba8c7,0x3f366b13,0x3e4c380a,0xbed1f70f,0x3da000be,0x3e8ed0a6,0x3f3c34bd,0xbf08b389,0xbd9e0cca,0x3e05095b,0x3ef1ac80,0x3da7646f,0xbcd0576f,0x3e83e76e,0x3f870465,0xbf1894ad,0xbf475073,0xbff88503,0xc0368ecb,0xc03cf196,
0xc072281a,0xc0177033,0xbfe11f51,0xbfa3dc3f,0xc01c4557,0xc036030a,0xc0057814,0xbfb60610,0xbef03ace,0x3e105793,0x3fa28542,0x3e9390c2,0xbba00d1b,0xbe99f207,0xbfa3a0da,0xbe329ba0,0x3eef141d,0x3fb9604c,0x40058f0e,0x4036eac0,0x401b7835,0x3fa743f6,0x3fe5dc68,0x401807dc,0x406e3515,
0x40399f8f,0x4037b7c7,0x3ffabd23,0x3f51dc1c,0x3f11a8f6,0xbf868061,0xbea0be67,0x3e09ea72,0x3cb8fdf8,0x3d41b101,0xbfb65ff8,0xc03bf299,0xc073eb6a,0xc09e3e70,0xc0c35434,0xc10268f5,0xc0f009f8,0xc118ddc8,0xc11dbb79,0xc12f3e4a,0xc10f9075,0xc10e9eca,0xc0d71c87,0xc0c2d2c4,0xc09c2687,
+4 −4
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@
/* Tables generated by the script at "scripts/binauralRenderer_interface/fastconv/generate_tables_for_fastconv.m */
/* Can be replaced by your own generated HRIR tables */
/*
 * Generated on 08-Jan-2024 with Matlab version 9.3.0.948333 (R2017b) Update 9 by MUXE6256 on PCWIN64
 * Generated on 24-Jan-2024 with Matlab version 23.2.0.2485118 (R2023b) Update 6 by marcemerit on MACA64
*/
@@ -46944,18 +46944,18 @@ const float rightBRIRImag[BINAURAL_CONVBANDS][HRTF_LS_CHANNELS][BINAURAL_NTAPS_M
const float fastconvReverberationTimes[CLDFB_NO_CHANNELS_MAX] = 
{
	0.429201f,    0.205110f,    0.202338f,    0.208383f,    0.215664f,    0.236545f,    0.230598f,    0.228400f,    0.227467f,    0.218956f,    0.226083f,    0.220702f,    0.221501f,    0.223471f,    0.223705f,    0.227063f,    0.227899f,    0.223071f,    0.220000f,    0.218583f,    0.220417f,    0.218250f,    0.213250f,    0.210333f,    0.207417f,    0.198750f,    0.196250f,    0.194917f,    0.190333f,    0.184500f,    0.180333f,    0.176167f,    0.176500f,    0.177583f,    0.183583f,    0.195917f,    0.203250f,    0.208417f,    0.214667f,    0.220000f,    0.222917f,    0.230417f,    0.233928f,    0.233647f,    0.236333f,    0.237428f,    0.241629f,    0.241118f,    0.238847f,    0.242384f,    0.246292f,    0.245948f,    0.246100f,    0.245396f,    0.243951f,    0.244123f,    0.239270f,    0.241474f,    0.234824f,    0.253040f,    
	0.418859f,    0.207274f,    0.203009f,    0.207144f,    0.216519f,    0.236054f,    0.230524f,    0.229146f,    0.227994f,    0.219877f,    0.225572f,    0.220864f,    0.223692f,    0.222957f,    0.223599f,    0.227333f,    0.227468f,    0.223734f,    0.220167f,    0.218750f,    0.220417f,    0.218250f,    0.213250f,    0.210333f,    0.207417f,    0.198750f,    0.196250f,    0.194917f,    0.190333f,    0.184500f,    0.180333f,    0.176167f,    0.176500f,    0.177583f,    0.183583f,    0.195917f,    0.203250f,    0.208417f,    0.214667f,    0.220000f,    0.222917f,    0.230417f,    0.233928f,    0.233647f,    0.236333f,    0.237428f,    0.241629f,    0.241118f,    0.238847f,    0.242384f,    0.247249f,    0.245948f,    0.248208f,    0.245396f,    0.243951f,    0.244123f,    0.238878f,    0.242609f,    0.234824f,    0.253040f,    
};
const float fastconvReverberationEneCorrections[CLDFB_NO_CHANNELS_MAX] = 
{
	0.000584f,    0.000210f,    0.000233f,    0.000212f,    0.000257f,    0.001518f,    0.001154f,    0.001097f,    0.001265f,    0.001298f,    0.002320f,    0.002432f,    0.002686f,    0.002702f,    0.002632f,    0.002564f,    0.002732f,    0.002727f,    0.002609f,    0.002524f,    0.003417f,    0.001783f,    0.000987f,    0.000699f,    0.000606f,    0.000536f,    0.000511f,    0.000569f,    0.000600f,    0.000543f,    0.001257f,    0.001209f,    0.000957f,    0.000601f,    0.000274f,    0.000106f,    0.000072f,    0.000051f,    0.000040f,    0.000030f,    0.000024f,    0.000018f,    0.000014f,    0.000013f,    0.000012f,    0.000011f,    0.000009f,    0.000009f,    0.000008f,    0.000008f,    0.000007f,    0.000006f,    0.000005f,    0.000003f,    0.000002f,    0.000002f,    0.000001f,    0.000001f,    0.000000f,    0.000000f,    
	0.000584f,    0.000210f,    0.000233f,    0.000212f,    0.000257f,    0.001518f,    0.001155f,    0.001097f,    0.001265f,    0.001298f,    0.002320f,    0.002432f,    0.002686f,    0.002702f,    0.002632f,    0.002564f,    0.002732f,    0.002727f,    0.002609f,    0.002524f,    0.003417f,    0.001783f,    0.000987f,    0.000699f,    0.000606f,    0.000536f,    0.000511f,    0.000569f,    0.000600f,    0.000543f,    0.001257f,    0.001209f,    0.000957f,    0.000601f,    0.000274f,    0.000106f,    0.000072f,    0.000051f,    0.000040f,    0.000030f,    0.000024f,    0.000018f,    0.000014f,    0.000013f,    0.000012f,    0.000011f,    0.000009f,    0.000009f,    0.000008f,    0.000008f,    0.000007f,    0.000006f,    0.000005f,    0.000003f,    0.000002f,    0.000002f,    0.000001f,    0.000001f,    0.000000f,    0.000000f,    
};
/*
 * Generated on 08-Jan-2024 with Matlab version 9.3.0.948333 (R2017b) Update 9 by MUXE6256 on PCWIN64
 * Generated on 24-Jan-2024 with Matlab version 23.2.0.2485118 (R2023b) Update 6 by marcemerit on MACA64
 * Binaural rendering data set based on BRIRs 
 Tables derived from Mozart IIS BRIRs.*/
Loading