Commit a056fefd authored by emerit's avatar emerit
Browse files

Merge branch '1963_basop_portFltMR-1568-1471-1690' into hrtf_improvements_basop

parents 7be7c338 e1df50ad
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -121,9 +121,9 @@
#define FIX_CREND_SIMPLIFY_CODE   
#ifdef FIX_CREND_SIMPLIFY_CODE
#define FIX_989_TD_REND_ROM                             /* Eri: Clean-up for TD renderer and completion of ROM generation tool */
#define USE_REVERB_16BIT_ROM                            /* if desactivated old rom hrtf tables is used */
#define USE_TDREND_16BIT_ROM                            /* if desactivated old rom hrtf tables is used.  when active some tests case with 4 ISM fail due to owerflow in round_fixed function */
#define USE_FASTCONV_PARAMBIN_16BIT_ROM                 /* if desactivated old rom hrtf tables is used */
//#define USE_REVERB_16BIT_ROM                            /* if desactivated old rom hrtf tables is used */
//#define USE_TDREND_16BIT_ROM                            /* if desactivated old rom hrtf tables is used.  when active some tests case with 4 ISM fail due to owerflow in round_fixed function */
//#define USE_FASTCONV_PARAMBIN_16BIT_ROM                 /* if desactivated old rom hrtf tables is used */
#define FIX_HRTF_LOAD                                   /* VA: issue 1187: fix memory issue when HRTFs are loaded from a binary file */
#define FIX_HRTF_LOAD_KEEP_BE                           // VA: temp. hack to keep BE when FIX_HRTF_LOAD is activated - the code will be removed once HRTF updates are stable
#endif
+5 −4
Original line number Diff line number Diff line
@@ -538,13 +538,14 @@ static ivas_error DefaultBSplineModel_fx(
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural TD renderer\n" ) );
        }

        azimSegSamples = defaultHRIR_rom_azimSegSamples[model->azimShapeIdx[i]]; // Q0
        move16();                                                                // indirect addressing cost
        move16();
        if ( LT_16( model->azimShapeIdx[i], 0 ) )
        IF( LT_16( model->azimShapeIdx[i], 0 ) )
        {
            azimSegSamples = 360;
        }
        ELSE
        {
            azimSegSamples = defaultHRIR_rom_azimSegSamples[model->azimShapeIdx[i]]; // Q0
        }
        move16();

        assert( azimSegSamples == 360 / model->azimDim3[i] );
+12 −0
Original line number Diff line number Diff line
@@ -1319,11 +1319,17 @@ static ivas_error TDREND_MIX_LoadHRTF(
    {
        if ( read_hrtf_binary_header( &hrtf_header, f_hrtf ) != IVAS_ERR_OK )
        {
#ifdef FIX_989_TD_REND_ROM
            free( hrtf_data );
#endif
            return IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "HRTF binary file not compliant (number of HRTF)" );
        }

        if ( ( header_check_result = check_hrtf_binary_header( &hrtf_header ) ) != IVAS_ERR_OK )
        {
#ifdef FIX_989_TD_REND_ROM
            free( hrtf_data );
#endif
            return header_check_result;
        }

@@ -1332,6 +1338,9 @@ static ivas_error TDREND_MIX_LoadHRTF(
        {
            if ( fread( hrtf_data, 1, hrtf_header.data_size, f_hrtf ) != hrtf_header.data_size )
            {
#ifdef FIX_989_TD_REND_ROM
                free( hrtf_data );
#endif
                return IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "Error in HRTF file reading" );
            }
        }
@@ -1340,6 +1349,7 @@ static ivas_error TDREND_MIX_LoadHRTF(
        {
            if ( hrtf_header.frequency != sampleRate )
            {
                free( hrtf_data );
                return IVAS_ERR_INVALID_HRTF_SAMPLING_RATE;
            }
        }
@@ -2902,6 +2912,7 @@ ivas_error load_fastconv_HRTF_from_binary(
        {
            if ( hrtf_header.frequency != 48000 ) /* note: Parametric renderer data are always stored at 48 kHz */
            {
                free( hrtf_data );
                return IVAS_ERR_INVALID_HRTF_SAMPLING_RATE;
            }
#else
@@ -3095,6 +3106,7 @@ ivas_error load_parambin_HRTF_from_binary(
#ifdef FIX_CREND_SIMPLIFY_CODE
            if ( hrtf_header.frequency != 48000 ) /* note: Parametric renderer data are always stored at 48 kHz */
            {
                free( hrtf_data );
                return IVAS_ERR_INVALID_HRTF_SAMPLING_RATE;
            }
#endif