Commit 165b06a5 authored by emerit's avatar emerit
Browse files

remove binnew and old format define

parent af7be1ea
Loading
Loading
Loading
Loading
Loading
+0 −48
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 );
@@ -829,7 +782,6 @@ int main(
            {
                destroy_SetOfHRTF( hSetOfHRTF );
            }
#endif
        }
#else
        if ( ( error = create_SetOfHRTF_from_binary( hSetOfHRTF, hrtfReader, arg.output_Fs ) ) != IVAS_ERR_OK )
+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*/
+0 −36
Original line number Diff line number Diff line
@@ -1209,18 +1209,6 @@ static ivas_error create_HRTF_from_rawdata(
    }
#endif

#ifdef FIX_OLD_BINARY_FORMAT
#ifdef FIX_INV_DIFFUSE_WEIGHT
    for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ )
    {
        if ( ( *hHRTF )->inv_diffuse_weight[1][i] != ( *hHRTF )->inv_diffuse_weight[0][i] )
        {
            return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file format not compliant (BINAURAL_CHANNELS)" );
        }
    }
#endif
#endif

    /* max_total_num_fsamp_per_iteration */
    max_total_num_fsamp_per_iteration = *( (uint16_t *) ( hrtf_data_rptr ) );
    hrtf_data_rptr += sizeof( uint16_t );
@@ -2178,30 +2166,6 @@ static ivas_error destroy_HRTF(
 *
 * Destroy the HRTF data set.
 *---------------------------------------------------------------------*/
#ifdef FIX_OLD_BINARY_FORMAT
/*---------------------------------------------------------------------*
 * cleanup_SetOfHRTF()
 *
 * Destroy the HRTF data set.
 *---------------------------------------------------------------------*/

void cleanup_SetOfHRTF(
    HRTFS_CREND_HANDLE *hSetOfHRTF /* i/o: Set of HRTF CRend handle */
)
{
    if ( ( hSetOfHRTF != NULL ) && ( *hSetOfHRTF != NULL ) )
    {
        destroy_HRTF( &( ( *hSetOfHRTF )->hHRTF_hrir_combined ) );
        destroy_HRTF( &( ( *hSetOfHRTF )->hHRTF_hrir_hoa3 ) );
        destroy_HRTF( &( ( *hSetOfHRTF )->hHRTF_hrir_hoa2 ) );
        destroy_HRTF( &( ( *hSetOfHRTF )->hHRTF_hrir_foa ) );
        destroy_HRTF( &( ( *hSetOfHRTF )->hHRTF_brir_combined ) );
    }

    return;
}
#endif

void destroy_SetOfHRTF(
    HRTFS_CREND_HANDLE *hSetOfHRTF /* i/o: Set of HRTF CRend handle */
)
+0 −12
Original line number Diff line number Diff line
@@ -117,18 +117,6 @@ ivas_error create_SetOfHRTF_from_binary(
    int32_t output_Fs                      /* i  : Output sampling frequency            */
);

#ifdef FIX_OLD_BINARY_FORMAT
/*---------------------------------------------------------------------*
 * cleanup_SetOfHRTF()
 *
 * Destroy the HRTF data set.
 *---------------------------------------------------------------------*/

void cleanup_SetOfHRTF(
    IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF /* i/o: Set of HRTF CRend handle */
);
#endif

/*---------------------------------------------------------------------*
 * destroy_SetOfHRTF()
 *
Loading