Commit 2162de1b authored by emerit's avatar emerit
Browse files

specialize define for HRTF binary file format update

parent 0db7946e
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -539,7 +539,7 @@ int main(
        }
    }

#ifndef FIX_POINT_HRTF_FILE_OPTIM
#ifndef FIX_POINT_HRTF_FILE_FORMAT
    /*------------------------------------------------------------------------------------------*
     * Load HRTF binary file data
     *------------------------------------------------------------------------------------------*/
@@ -672,13 +672,29 @@ cleanup:
            destroy_td_hrtf( hHrtfBinary.hHrtfTD );
            destroy_hrtf_statistics( hHrtfBinary.hHrtfStatistics );
        }
#else
#ifdef FIX_POINT_HRTF_FILE_FORMAT
        IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL;
#else
        IVAS_DEC_HRTF_HANDLE hHrtfTD = NULL;
#endif
        IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD );
#ifdef FIX_POINT_HRTF_FILE_FORMAT
        dealloc_HRTF_binary( *hHrtfTD );
#else
        dealloc_HRTF_binary( hHrtfTD );
#endif
#ifdef FIX_POINT_HRTF_FILE_FORMAT
        IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL;
#else
        IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF = NULL;
#endif
        IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF );
#ifdef FIX_POINT_HRTF_FILE_FORMAT
        destroy_SetOfHRTF( *hSetOfHRTF );
#else
        destroy_SetOfHRTF( hSetOfHRTF );
#endif
#endif
    }

+42 −4
Original line number Diff line number Diff line
@@ -614,7 +614,9 @@ int main(
    IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL;
    IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL;
    IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL;
#ifdef FIX_POINT_HRTF_FILE_REVERB
    IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL;
#endif
#endif
    IsmPositionProvider *positionProvider;
    LfeRoutingConfig *lfeRoutingConfigs[RENDERER_MAX_MC_INPUTS];
@@ -895,8 +897,11 @@ int main(
                fprintf( stderr, "\nIVAS_REND_GetHrtfHandle failed: %s\n\n", ivas_error_to_string( error ) );
                goto cleanup;
            }

#ifdef FIX_POINT_HRTF_FILE_OPTIM
            if ( ( error = load_TDrend_HRTF_binary( *hHrtfTD, args.sampleRate, hrtfFileReader ) ) != IVAS_ERR_OK )
#else
            if ( ( error = load_HRTF_binary( *hHrtfTD, hrtfFileReader ) ) != IVAS_ERR_OK )
#endif
            {
                if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
                {
@@ -905,24 +910,33 @@ int main(
                }
                else
                {
#ifdef FIX_POINT_HRTF_FILE_OPTIM
                    destroy_td_hrtf( hHrtfTD );
#else
                    dealloc_HRTF_binary( *hHrtfTD );
#endif
                }
            }


            if ( ( error = IVAS_REND_GetHrtfCRendHandle( hIvasRend, &hHrtfCrend ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nIVAS_Rend_GetHrtfCRendHandle failed: %s\n\n", ivas_error_to_string( error ) );
                goto cleanup;
            }

#ifdef FIX_POINT_HRTF_FILE_OPTIM
            IVAS_AUDIO_CONFIG hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_7_1_4;
            if ( args.inConfig.ambisonicsBuses->audioConfig != IVAS_AUDIO_CONFIG_INVALID && args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR )
            {
                hrtf_set_audio_cfg = args.inConfig.ambisonicsBuses->audioConfig;
            }
#endif

#ifdef FIX_POINT_HRTF_FILE_OPTIM
            if ( ( error = load_Crend_HRTF_from_binary( *hHrtfCrend, hrtfFileReader, args.outConfig.audioConfig, hrtf_set_audio_cfg, args.sampleRate ) ) != IVAS_ERR_OK )
#else
            if ( ( error = create_SetOfHRTF_from_binary( *hHrtfCrend, hrtfFileReader, args.sampleRate ) ) != IVAS_ERR_OK )
#endif
            {
                if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
                {
@@ -931,7 +945,11 @@ int main(
                }
                else
                {
#ifdef FIX_POINT_HRTF_FILE_OPTIM
                    destroy_crend_hrtf( hHrtfCrend );
#else
                    destroy_SetOfHRTF( *hHrtfCrend );
#endif
                }
            }

@@ -941,7 +959,11 @@ int main(
                goto cleanup;
            }

#ifdef FIX_POINT_HRTF_FILE_OPTIM
            if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, args.outConfig.audioConfig, args.inConfig.ambisonicsBuses->audioConfig, hrtfFileReader ) ) != IVAS_ERR_OK )
#else
            if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, hrtfFileReader ) ) != IVAS_ERR_OK )
#endif
            {
                if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
                {
@@ -950,7 +972,10 @@ int main(
                }
                else
                {
#ifdef FIX_POINT_HRTF_FILE_OPTIM
                    destroy_fastconv_hrtf( hHrtfFastConv );
#else
#endif
                }
            }

@@ -969,10 +994,14 @@ int main(
                }
                else
                {
#ifdef FIX_POINT_HRTF_FILE_OPTIM
                    destroy_parambin_hrtf( hHrtfParambin );
#else
#endif
                }
            }

#ifdef FIX_POINT_HRTF_FILE_REVERB
            if ( ( error = IVAS_REND_GetHrtfStatisticsHandle( hIvasRend, &hHrtfStatistics ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nIVAS_REND_GetHrtfStatisticsHandle failed\n\n" );
@@ -990,6 +1019,7 @@ int main(
                    destroy_hrtf_statistics( hHrtfStatistics );
                }
            }
#endif
        }

        hrtfFileReader_close( &hrtfFileReader );
@@ -1795,10 +1825,18 @@ cleanup:
    RotationFileReader_close( &externalOrientationFileReader );
    RotationFileReader_close( &referenceRotReader );
    Vector3PairFileReader_close( &referenceVectorReader );
#ifdef FIX_POINT_HRTF_FILE_FORMAT
    destroy_td_hrtf( hHrtfTD );
#ifdef FIX_POINT_HRTF_FILE_REVERB
    destroy_hrtf_statistics( hHrtfStatistics );
#endif

#ifdef FIX_POINT_HRTF_FILE_OPTIM
    destroy_td_hrtf( hHrtfTD );
#else
#ifdef FIX_POINT_HRTF_FILE_FORMAT
    dealloc_HRTF_binary( *hHrtfTD );
#endif
#endif
#ifndef FIX_POINT_HRTF_FILE_FORMAT
    hrtfFileReader_close( &hrtfFileReader );
#endif
    IVAS_REND_Close( &hIvasRend );
+1 −1
Original line number Diff line number Diff line
@@ -180,7 +180,7 @@ typedef struct ivas_hrtfs_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE;
#endif
typedef struct ivas_hrtfs_fastconv_struct *IVAS_DEC_HRTF_FASTCONV_HANDLE;
typedef struct ivas_hrtfs_parambin_struct *IVAS_DEC_HRTF_PARAMBIN_HANDLE;
#ifdef FIX_POINT_HRTF_FILE_FORMAT
#ifdef FIX_POINT_HRTF_FILE_FORMAT_REVERB
typedef struct ivas_hrtfs_statistics_struct *IVAS_DEC_HRTF_STATISTICS_HANDLE;
#endif
typedef struct cldfb_filter_bank_struct *IVAS_CLDFB_FILTER_BANK_HANDLE;
+2 −2
Original line number Diff line number Diff line
@@ -1740,11 +1740,11 @@ typedef enum
#define RV_FILTER_MAX_FFT_SIZE                  ( 512 )
#define RV_FILTER_MAX_HISTORY                   ( 512 - 160 )               /* for longest history */
#define RV_LENGTH_NR_FC                         ( RV_FILTER_MAX_FFT_SIZE / 2 ) + 1
#ifdef FIX_POINT_HRTF_FILE_FORMAT
#ifdef FIX_POINT_HRTF_FILE_FORMAT_REVERB
#define RV_LENGTH_NR_FC_16KHZ                   ( RV_FILTER_MAX_FFT_SIZE / 4 ) + 1
#endif
#define IVAS_REVERB_DEFAULT_N_BANDS             31
#ifdef FIX_POINT_HRTF_FILE_FORMAT
#ifdef FIX_POINT_HRTF_FILE_FORMAT_REVERB
#define LR_IAC_LENGTH_NR_FC                     ( RV_LENGTH_NR_FC )
#define LR_IAC_LENGTH_NR_FC_16KHZ               ( RV_LENGTH_NR_FC_16KHZ )
#endif
+19 −3
Original line number Diff line number Diff line
@@ -87,9 +87,25 @@

// #define FIX_1123_FASTCONV_PARAMBIN_16BIT_ROM                     /* FhG: issue 1123: update FastConv and ParamBin ROM tables and scripts to generate 16 bit tables instead of float */
//#define FIX_POINT_HRTF_FILE_FORMAT          /* ORANGE : add crend changes and fix point binaural rom and hrtf binary file format */
//#define FIX_POINT_HRTF_FILE_FORMAT_REVERB          /* ORANGE : add crend changes and fix point binaural rom and hrtf binary file format */
// #define FIX_POINT_CREND_HRTF_FILE_FORMAT
//#define FIX_TDREND_HRTF_FILE_FORMAT
//#define FIX_POINT_HRTF_FILE_OPTIM
#ifdef FIX_POINT_HRTF_FILE_OPTIM
#define FIX_POINT_HRTF_FILE_FORMAT
#endif
#ifdef FIX_POINT_HRTF_FILE_FORMAT_REVERB
#define FIX_POINT_HRTF_FILE_FORMAT
#endif
#ifdef FIX_POINT_CREND_HRTF_FILE_FORMAT
#define FIX_POINT_HRTF_FILE_FORMAT
#endif
#ifdef FIX_TDREND_HRTF_FILE_FORMAT
#define FIX_POINT_HRTF_FILE_FORMAT
#endif
#ifdef FIX_1123_FASTCONV_PARAMBIN_16BIT_ROM
#define FIX_POINT_HRTF_FILE_FORMAT
#endif

#define FIX_1013_CRASH_HQ_CORE_DEC /* Ittiam: Saturation added on the lines of EVS */
#define NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS /* DLB: adjust prerendering and mixing gain in OSBA encoder. This is fix to float codes*/
Loading