Commit 747208eb authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'ivas-float-update' into 2106_ref_several_small_code_improvements

parents ef8361b0 5c5915ae
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@
    <ClCompile Include="..\lib_util\masa_file_reader.c" />
    <ClCompile Include="..\lib_util\masa_file_writer.c" />
    <ClCompile Include="..\lib_util\mime_io.c" />
    <ClCompile Include="..\lib_util\obj_edit_file_reader.c" />
    <ClCompile Include="..\lib_util\render_config_reader.c" />
    <ClCompile Include="..\lib_util\rotation_file_reader.c" />
    <ClCompile Include="..\lib_util\rtpdump.c" />
@@ -145,6 +146,7 @@
    <ClInclude Include="..\lib_util\jbm_file_writer.h" />
    <ClInclude Include="..\lib_util\ls_custom_file_reader.h" />
    <ClInclude Include="..\lib_util\mime_io.h" />
    <ClInclude Include="..\lib_util\obj_edit_file_reader.h" />
    <ClInclude Include="..\lib_util\masa_file_reader.h" />
    <ClInclude Include="..\lib_util\masa_file_writer.h" />
    <ClInclude Include="..\lib_util\render_config_reader.h" />
+374 −185

File changed.

Preview size limit exceeded, changes collapsed.

+0 −56
Original line number Diff line number Diff line
@@ -639,11 +639,7 @@ static int16_t get_cldfb_in_flag(
    int16_t cldfb_in_flag;

    cldfb_in_flag = 0;
#ifdef FIX_HRTF_LOAD
    if ( renderConfig->split_rend_config.rendererSelection == IVAS_BIN_RENDERER_TYPE_FASTCONV )
#else
    if ( renderConfig->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV )
#endif
    {
#ifdef DEBUGGING
        cldfb_in_flag = 1;
@@ -692,11 +688,7 @@ int main(
    SplitRendBFIFileReader *splitRendBFIReader = NULL;
    Vector3PairFileReader *referenceVectorReader = NULL;
    hrtfFileReader *hrtfFileReader = NULL;
#ifdef FIX_CREND_SIMPLIFY_CODE
    IVAS_DEC_HRTF_CREND_HANDLE *hHrtfCrend = NULL;
#else
    IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL;
#endif
    IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL;
    IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL;
    IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL;
@@ -982,11 +974,7 @@ int main(
                goto cleanup;
            }

#ifdef FIX_989_TD_REND_ROM
            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 )
                {
@@ -999,7 +987,6 @@ int main(
                }
            }

#ifdef FIX_CREND_SIMPLIFY_CODE
            if ( ( error = IVAS_REND_GetHrtfCRendHandle( hIvasRend, &hHrtfCrend ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nIVAS_Rend_GetHrtfCRendHandle failed: %s\n\n", ivas_error_to_string( error ) );
@@ -1012,15 +999,6 @@ int main(
            }

            if ( ( error = load_Crend_HRTF_from_binary( *hHrtfCrend, hrtfFileReader, args.outConfig.audioConfig, hrtf_set_audio_cfg, args.sampleRate ) ) != IVAS_ERR_OK )
#else
            if ( ( error = IVAS_REND_GetHrtfCRendHandle( hIvasRend, &hSetOfHRTF ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nIVAS_Rend_GetHrtfCRendHandle failed: %s\n\n", ivas_error_to_string( error ) );
                goto cleanup;
            }

            if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfFileReader, args.sampleRate ) ) != IVAS_ERR_OK )
#endif
            {
                if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
                {
@@ -1029,11 +1007,7 @@ int main(
                }
                else
                {
#ifdef FIX_CREND_SIMPLIFY_CODE
                    destroy_crend_hrtf( hHrtfCrend );
#else
                    destroy_SetOfHRTF( hSetOfHRTF );
#endif
                }
            }

@@ -1043,11 +1017,7 @@ int main(
                goto cleanup;
            }

#ifdef FIX_CREND_SIMPLIFY_CODE
            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 )
                {
@@ -2080,20 +2050,8 @@ cleanup:
    RotationFileReader_close( &headRotReader );
    RotationFileReader_close( &externalOrientationFileReader );
    RotationFileReader_close( &referenceRotReader );

    Vector3PairFileReader_close( &referenceVectorReader );
#ifdef FIX_CREND_SIMPLIFY_CODE
    destroy_td_hrtf( hHrtfTD );
#else
    if ( hSetOfHRTF != NULL && *hSetOfHRTF != NULL )
    {
        destroy_SetOfHRTF( hSetOfHRTF );
    }
    if ( hHrtfTD != NULL && *hHrtfTD != NULL )
    {
    destroy_td_hrtf( hHrtfTD );
    }
#endif
    destroy_hrtf_statistics( hHrtfStatistics );
    IVAS_REND_Close( &hIvasRend );
    IsmPositionProvider_close( positionProvider );
@@ -2687,9 +2645,7 @@ static CmdlnArgs defaultArgs(
    const char *executableName )
{
    CmdlnArgs args;
#ifdef FIX_CREND_SIMPLIFY_CODE
    int16_t i;
#endif

    strncpy( args.executableName, executableName, RENDERER_MAX_CLI_ARG_LENGTH );
    clearString( args.inputFilePath );
@@ -2706,20 +2662,12 @@ static CmdlnArgs defaultArgs(
    args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_INVALID;
    args.outConfig.outSetupCustom.num_spk = 0;
    args.outConfig.outSetupCustom.num_lfe = 0;
#ifdef FIX_CREND_SIMPLIFY_CODE
    for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i )
    {
        args.inConfig.ambisonicsBuses[i].audioConfig = IVAS_AUDIO_CONFIG_INVALID;
    }
#else
    args.inConfig.ambisonicsBuses->audioConfig = IVAS_AUDIO_CONFIG_INVALID;
#endif

#ifdef FIX_CREND_SIMPLIFY_CODE
    for ( i = 0; i < RENDERER_MAX_ISM_INPUTS + RENDERER_MAX_MASA_INPUTS; ++i )
#else
    for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i )
#endif
    {
        clearString( args.inMetadataFilePaths[i] );
    }
@@ -2757,11 +2705,7 @@ static CmdlnArgs defaultArgs(
    args.render_framesize = IVAS_RENDER_FRAMESIZE_20MS;
    args.syncMdDelay = 0;

#ifdef FIX_CREND_SIMPLIFY_CODE
    for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i )
#else
    for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i )
#endif
    {
        args.directivityPatternId[i] = 65535;
    }
+1 −25
Original line number Diff line number Diff line
@@ -140,6 +140,7 @@ typedef struct _IVAS_EDITABLE_PARAMETERS
    int16_t num_obj;
    IVAS_ISM_METADATA ism_metadata[IVAS_MAX_NUM_OBJECTS];
    float gain_bed;

} IVAS_EDITABLE_PARAMETERS;
#endif

@@ -177,19 +178,11 @@ typedef enum
typedef struct ivas_masa_metadata_frame_struct *IVAS_MASA_METADATA_HANDLE;
typedef struct ivas_masa_decoder_ext_out_meta_struct *IVAS_MASA_DECODER_EXT_OUT_META_HANDLE;

#ifdef FIX_CREND_SIMPLIFY_CODE
typedef struct ivas_hrtf_TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_HANDLE;
typedef struct ivas_hrtf_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE;
typedef struct ivas_hrtf_fastconv_struct *IVAS_DEC_HRTF_FASTCONV_HANDLE;
typedef struct ivas_hrtf_parambin_struct *IVAS_DEC_HRTF_PARAMBIN_HANDLE;
typedef struct ivas_hrtf_statistics_struct *IVAS_DEC_HRTF_STATISTICS_HANDLE;
#else
typedef struct TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_HANDLE;
typedef struct ivas_hrtfs_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE;
typedef struct ivas_hrtfs_fastconv_struct *IVAS_DEC_HRTF_FASTCONV_HANDLE;
typedef struct ivas_hrtfs_parambin_struct *IVAS_DEC_HRTF_PARAMBIN_HANDLE;
typedef struct ivas_hrtfs_statistics_struct *IVAS_DEC_HRTF_STATISTICS_HANDLE;
#endif
typedef struct cldfb_filter_bank_struct *IVAS_CLDFB_FILTER_BANK_HANDLE;

typedef struct ivas_LS_setup_custom *IVAS_LSSETUP_CUSTOM_HANDLE;
@@ -221,7 +214,6 @@ typedef struct _IVAS_JBM_TRACE_DATA

} IVAS_JBM_TRACE_DATA;

#ifdef FIX_CREND_SIMPLIFY_CODE
typedef enum _ivas_binaural_renderer_type
{
    IVAS_BIN_RENDERER_TYPE_NONE,
@@ -232,7 +224,6 @@ typedef enum _ivas_binaural_renderer_type
    IVAS_BIN_RENDERER_TYPE_DEFAULT,

} IVAS_BIN_RENDERER_TYPE;
#endif

/*----------------------------------------------------------------------------------*
 * Split rendering API constants, structures, and enums
@@ -271,17 +262,6 @@ typedef enum

} ISAR_SPLIT_REND_CODEC;

#ifndef FIX_HRTF_LOAD
typedef enum
{
    ISAR_SPLIT_REND_RENDERER_SELECTION_CREND,
    ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV,
    ISAR_SPLIT_REND_RENDERER_SELECTION_PARAMBIN,
    ISAR_SPLIT_REND_RENDERER_SELECTION_TDREND,
    ISAR_SPLIT_REND_RENDERER_SELECTION_DEFAULT,

} ISAR_SPLIT_REND_RENDERER_SELECTION;
#endif
typedef struct _ISAR_SPLIT_REND_BITS_DATA
{
    uint8_t *bits_buf;
@@ -312,11 +292,7 @@ typedef struct _ISAR_SPLIT_REND_CONFIG
    int16_t codec_frame_size_ms; /* Codec frame size in milliseconds, only relevant with LC3plus */
    ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode;
    ISAR_SPLIT_REND_CODEC codec;
#ifdef FIX_HRTF_LOAD
    IVAS_BIN_RENDERER_TYPE rendererSelection;
#else
    ISAR_SPLIT_REND_RENDERER_SELECTION rendererSelection;
#endif
    int16_t lc3plus_highres;

} ISAR_SPLIT_REND_CONFIG_DATA, *ISAR_SPLIT_REND_CONFIG_HANDLE;
+3 −38
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@
#include "prot.h"
#include "wmc_auto.h"
#include <math.h> /* for cosf, sinf */
#include <assert.h>

static ivas_error get_edct_table(
    const float **edct_table,
@@ -226,7 +227,6 @@ void edst(
    return;
}

#define FAST_EDXT /* optimized FFT-based DCT/DST algorithm */

/*-------------------------------------------------------------------------*
 * edxt()
@@ -243,9 +243,8 @@ void edxt(
)
{
    const float pi_len = EVS_PI / length;
    int16_t k, m;
    int16_t k;

#ifdef FAST_EDXT
    if ( kernelType == MDST_II || kernelType == MDCT_II )
    {
        const int16_t Nm1 = length - 1;
@@ -351,42 +350,8 @@ void edxt(
        }
    }
    else
#endif
        if ( kernelType & 1 ) /* DST */
    {
        const float offK = ( kernelType == MDST_II && synthesis ? 0.5f : 1.0f - 0.5f * ( kernelType >> 1 ) );
        const float offM = ( kernelType == MDST_II && synthesis ? 1.0f : 0.5f );

        for ( k = 0; k < length; k++ )
    {
            y[k] = 0.f;
            for ( m = 0; m < length; m++ )
            {
                y[k] += x[m] * sinf( pi_len * ( m + offM ) * ( k + offK ) );
            }
        }
        if ( offK == 1.f )
        {
            y[length - 1] *= 0.5f; /* scale Nyquist sample */
        }
    }
    else /* kernelType 0, 2: DCT */
    {
        const float offK = ( kernelType == MDCT_II && synthesis ? 0.5f : 0.5f - 0.5f * ( kernelType >> 1 ) );
        const float offM = ( kernelType == MDCT_II && synthesis ? 0.0f : 0.5f );

        for ( k = 0; k < length; k++ )
        {
            y[k] = 0.f;
            for ( m = 0; m < length; m++ )
            {
                y[k] += x[m] * cosf( pi_len * ( m + offM ) * ( k + offK ) );
            }
        }
        if ( offK == 0.f )
        {
            y[0] *= 0.5f; /* scale lowest (i.e. DC) sample */
        }
        assert( !"Unsupported Kernel type in edxt()" );
    }

    v_multc( y, ( kernelType == MDCT_II ? -1.f : 1.f ) * sqrtf( 2.f / length ), y, length );
Loading