Commit d4565ea6 authored by emerit's avatar emerit
Browse files

add missing file and fix same diff angle for all renderers

parent 2f13d4ca
Loading
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -707,7 +707,11 @@ ivas_error ivas_allocate_binaural_hrtf(
        }
    }

#ifdef FIX_1123_FASTCONV_16BIT_ROM
    if ( renderer_type == RENDERER_BINAURAL_FASTCONV && bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED )
#else
    if ( renderer_type == RENDERER_BINAURAL_FASTCONV || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED )
#endif
    {
        if ( ( HrtfFastConv->leftHRIRReal == NULL ) && ( HrtfFastConv->leftHRIRImag == NULL ) && ( HrtfFastConv->rightHRIRReal == NULL ) && ( HrtfFastConv->rightHRIRImag == NULL ) )
        {
@@ -748,8 +752,11 @@ ivas_error ivas_allocate_binaural_hrtf(
#endif
        }
    }

#ifdef FIX_1123_FASTCONV_16BIT_ROM
    if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED )
#else
    if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED )
#endif
    {
        if ( ( HrtfFastConv->leftBRIRReal == NULL ) && ( HrtfFastConv->leftBRIRImag == NULL ) && ( HrtfFastConv->rightBRIRReal == NULL ) && ( HrtfFastConv->rightBRIRImag == NULL ) )
        {
+4 −12
Original line number Diff line number Diff line
@@ -68,8 +68,7 @@
 * Constants
 *------------------------------------------------------------------------------------------*/

#define MAX_DIFF_AZI              5     /* angle in degree */
#define MAX_DIFF_ELE              20    /* angle in degree */
#define MAX_DIFF_ANGLE            10    /* angle in degree */
#define DEFAULT_SAMPLERATE        48000 /* Hz */
#define LAST_SAMPLERATE           16000 /* Hz */
#define TEMPLTATE_C_ROM_FILE_NAME "ivas_license_header.template"
@@ -1101,7 +1100,9 @@ int generate_crend_ivas_tables_from_sofa( const char *file_path, ConfigReader *c
                a[2] = sofa_src_pos_val[nearest * 3 + 2];
            }

            if ( fabs( t[0] - a[0] ) > MAX_DIFF_AZI )
            float prodScal = ( t[0] * a[0] + t[1] * a[1] + t[2] * a[2] ) / ( sqrtf( ( t[0] * t[0] + t[1] * t[1] + t[2] * t[2] ) ) * sqrtf( ( a[0] * a[0] + a[1] * a[1] + a[2] * a[2] ) ) );
            float cosAngleMin = cosf( PI_OVER_180 * MAX_DIFF_ANGLE );
            if ( prodScal < cosAngleMin )
            {
                mxDestroyArray( sofa );
                fprintf( stderr, "Nearest position to far from target incomplete sofa file\n" );
@@ -1111,15 +1112,6 @@ int generate_crend_ivas_tables_from_sofa( const char *file_path, ConfigReader *c
                free( index_pos );
                return -1;
            }
            if ( fabs( t[1] - a[1] ) > MAX_DIFF_ELE )
            {
                mxDestroyArray( sofa );
                fprintf( stderr, "Nearest position to far from target incomplete sofa file\n" );
                fprintf( stderr, "Searched for Position: %f, %f, %f\n", t[0], t[1], t[2] );
                fprintf( stderr, "Nearest Position: %f, %f, %f\n", a[0], a[1], a[2] );
                free( sofa_file_path );
                return -1;
            }
            if ( a[0] > 180. )
                a[0] -= 360.;
            if ( a[0] < -180. )
+1 −1
Original line number Diff line number Diff line
@@ -211,7 +211,7 @@ if isfile(Lib_Name)
            for ch = 1:length(refAziRad)
                [valMax(ch), chSelect(ch)] = max(Sofa.PosCartesian'*refVectors(ch,:)');
            end
            assert(min(valMax(ch))> 0.99, 'Missing speaker layout Combined directions in sofa file')
            assert(min(valMax(ch))> cos(10 * pi /180), 'Missing speaker layout Combined directions in sofa file')
            Sofa.Data.IR = Sofa.Data.IR(:,:,chSelect);
            Sofa.PosCartesian = Sofa.PosCartesian(:,chSelect);
            Sofa.PosSpherical = Sofa.PosSpherical(:,chSelect);
+1 −1
Original line number Diff line number Diff line
@@ -243,7 +243,7 @@ classdef hrtf_library_loader < handle
                        for ch = 1:length(refAziRad)
                            [valMax(ch), chSelect(ch)] = max(PosCartesian'*refVectors(ch,:)');
                        end
                        assert(min(valMax(ch))> 0.99, 'Missing speaker layout Combined directions in sofa file')
                        assert(min(valMax(ch))> cos(10 * pi /180), 'Missing speaker layout Combined directions in sofa file')
                        PosSpherical = PosSpherical(:,chSelect);
                        PosCartesian = PosCartesian(:,chSelect);
                        Data.IR =Data.IR (:,:,chSelect);