Commit 6936ba94 authored by emerit's avatar emerit
Browse files

fix for tests to pass

parent c625ac30
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -453,7 +453,9 @@ int main(
        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.hrtfCRendFileName );
#ifndef FIX_FOR_TEST
            goto cleanup;
#endif
        }
        IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv;
        IVAS_DEC_GetHrtfFastConvHandle( hIvasDec, &hHrtfFastConv );
+1 −1
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@

#define FIX_197_CREND_INTERFACE 
#define SET_TNS_FLAG_IN_EVERY_FRAME                     /* FhG: issue 288 - mismatch between encoder and decoder wrt TNS usage in unified stereo  with frameloss */

#define FIX_FOR_TEST                                    /* allows tests to pass using old TD binary file, to be removed after merge*/
/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
#endif
+42 −0
Original line number Diff line number Diff line
@@ -453,7 +453,49 @@ static ivas_error TDREND_MIX_LoadHRTF(

    if ( ( header_check_result = read_and_check_hrtf_binary_file_header( &hrtfs_file_header, f_hrtf ) ) != IVAS_ERR_OK )
    {
#ifdef FIX_FOR_TEST
        fseek( f_hrtf, 0, SEEK_SET );
        if ( fread( &tmp, 1, sizeof( int16_t ), f_hrtf ) == 0 )
        {
            return IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "Error in HRTF file reading" );
        }

        HrFiltSet_p->FilterMethod = (TDREND_HRFILT_Method_t) tmp;

#ifdef TDREND_HRTF_TABLE_METHODS
        switch ( HrFiltSet_p->FilterMethod )
        {
            case TDREND_HRFILT_Method_BSplineModel:
                error = LoadBSplineBinary( HrFiltSet_p, f_hrtf );
                break;
            case TDREND_HRFILT_Method_Table_F:
            case TDREND_HRFILT_Method_Table_S:
                TDREND_HRFILT_SetFiltSet( HrFiltSet_p, f_hrtf );
                break;
            default:
                error = IVAS_ERROR( IVAS_ERR_INVALID_HRTF, "The HR filter set file is not a supported type." );
        }
#else
        if ( HrFiltSet_p->FilterMethod != TDREND_HRFILT_Method_BSplineModel )
        {
            error = IVAS_ERROR( IVAS_ERR_INVALID_HRTF, "The HR filter set file is not a supported type." );
        }
        else
        {
            error = LoadBSplineBinary( HrFiltSet_p, f_hrtf );
        }
#endif
        if ( error != IVAS_ERR_OK )
        {
            return header_check_result;
        }
        else
        {
            return error;
        }
#else
        return header_check_result;
#endif
    }

    is_tdrend = FALSE;