Commit 53b7b2d0 authored by vaclav's avatar vaclav
Browse files

- Merge remote-tracking branch 'remotes/origin/main' into 20231020_maintenance

parents f4d9e245 ef533bba
Loading
Loading
Loading
Loading
Loading
+24 −195

File changed.

Preview size limit exceeded, changes collapsed.

+7 −44
Original line number Diff line number Diff line
@@ -32,17 +32,6 @@

#include "lib_isar_post_rend.h"

#ifndef SPLIT_REND_WITH_HEAD_ROT

int main( int argc, char **argv )
{
    (void) argc;
    (void) argv;
    ISAR_POST_REND_void_func();
    return 0;
}

#else

#include <assert.h>
#include <math.h>
@@ -733,13 +722,9 @@ int main(
    bitsBuffer.config.bufLenInBytes = 0;
    bitsBuffer.config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT;
    bitsBuffer.config.poseCorrection = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    bitsBuffer.config.codec_frame_size_ms = 5;
    bitsBuffer.config.isar_frame_size_ms = 20;
    bitsBuffer.config.lc3plusHighRes = 0;
#else
    bitsBuffer.config.codec_frame_size_ms = 20;
#endif

    /*------------------------------------------------------------------------------------------*
     * Parse command-line arguments
@@ -778,9 +763,7 @@ int main(
     * Open input files
     *------------------------------------------------------------------------------------------*/

#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    int32_t inFileSampleRate = 0;
#endif
    strncpy( audioFilePath, args.inputFilePath, FILENAME_MAX - 1 );
    hSplitRendFileReadWrite = NULL;
    if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
@@ -789,14 +772,10 @@ int main(
                                        args.inMetadataFilePaths[0],
                                        &bitsBuffer.config.codec,
                                        &bitsBuffer.config.poseCorrection,
                                        &bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                        ,
                                        &bitsBuffer.config.codec_frame_size_ms,
                                        &bitsBuffer.config.isar_frame_size_ms,
                                        &inFileSampleRate,
                                        &bitsBuffer.config.lc3plusHighRes
#endif
        );
                                        &bitsBuffer.config.lc3plusHighRes );
        if ( error != IVAS_ERR_OK )
        {
            fprintf( stderr, "Could not open split rend metadata file %s\n", args.inMetadataFilePaths[0] );
@@ -817,14 +796,10 @@ int main(
                                        args.inputFilePath,
                                        &bitsBuffer.config.codec,
                                        &bitsBuffer.config.poseCorrection,
                                        &bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                        ,
                                        &bitsBuffer.config.codec_frame_size_ms,
                                        &bitsBuffer.config.isar_frame_size_ms,
                                        &inFileSampleRate,
                                        &bitsBuffer.config.lc3plusHighRes
#endif
        );
                                        &bitsBuffer.config.lc3plusHighRes );
        if ( error != IVAS_ERR_OK )
        {
            fprintf( stderr, "Could not open split rend metadata file %s\n", args.inputFilePath );
@@ -833,17 +808,11 @@ int main(
        audioReader = NULL;
    }

#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS
    int32_t inFileSampleRate = 0;
#endif
    if ( audioReader != NULL )
    {
        error = AudioFileReader_getSamplingRate( audioReader, &inFileSampleRate );
    }
    else
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
        if ( hSplitRendFileReadWrite == NULL )
#endif
    else if ( hSplitRendFileReadWrite == NULL )
    {
        inFileSampleRate = args.sampleRate;
    }
@@ -913,13 +882,9 @@ int main(
        if ( ( error = ISAR_REND_SetSplitRendBitstreamHeader( hIsarPostRend,
                                                              bitsBuffer.config.codec,
                                                              bitsBuffer.config.poseCorrection,
                                                              bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                                              ,
                                                              bitsBuffer.config.codec_frame_size_ms,
                                                              bitsBuffer.config.isar_frame_size_ms,
                                                              bitsBuffer.config.lc3plusHighRes
#endif
                                                              ) ) != IVAS_ERR_OK )
                                                              bitsBuffer.config.lc3plusHighRes ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Error in getting split renderer bitstream header: %s\n", ivas_error_to_string( error ) );
            exit( -1 );
@@ -1285,5 +1250,3 @@ int main(


#undef WMC_TOOL_SKIP

#endif /* SPLIT_REND_WITH_HEAD_ROT */
+21 −175

File changed.

Preview size limit exceeded, changes collapsed.

+24 −38
Original line number Diff line number Diff line
@@ -83,10 +83,8 @@ typedef enum _IVAS_AUDIO_CONFIG
    IVAS_AUDIO_CONFIG_HOA3,                 /* ambisonics, order 3                    */
    IVAS_AUDIO_CONFIG_OBA,                  /* object based audio                     */
    IVAS_AUDIO_CONFIG_BINAURAL,             /* binaural with HRIR                     */
#ifdef SPLIT_REND_WITH_HEAD_ROT
    IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED, /* split binaural with CLDFB coded output */
    IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM,   /* split binaural with PCM coded output   */
#endif
    IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR,     /* binaural with BRIR                     */
    IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB, /* binaural with HRIR + reverb            */
    IVAS_AUDIO_CONFIG_ISM1,                 /* ISM1                                   */
@@ -204,7 +202,6 @@ typedef struct _IVAS_JBM_TRACE_DATA
} IVAS_JBM_TRACE_DATA;


#ifdef SPLIT_REND_WITH_HEAD_ROT
/*----------------------------------------------------------------------------------*
 * Split rendering API constants, structures, and enums
 *----------------------------------------------------------------------------------*/
@@ -261,10 +258,8 @@ typedef struct _ISAR_SPLIT_REND_BITS_DATA
    int16_t codec_frame_size_ms;
    ISAR_SPLIT_REND_CODEC codec;
    ISAR_SPLIT_REND_POSE_CORRECTION_MODE pose_correction;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    int16_t isar_frame_size_ms;
    int16_t lc3plus_highres;
#endif

} ISAR_SPLIT_REND_BITS_DATA, *ISAR_SPLIT_REND_BITS_HANDLE;

@@ -280,19 +275,14 @@ typedef struct _ISAR_SPLIT_REND_CONFIG
                                 3 - (3dof correction. By default YAW, PITCH and ROLL correction)
                                 */
    int16_t codec_delay_ms;      /* look ahead delay of the codec that is used to code BIN signal output of pre-renderer*/
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    int16_t isar_frame_size_ms;  /* ISAR bit stream frame size in milliseconds */
#endif
    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;
    ISAR_SPLIT_REND_RENDERER_SELECTION rendererSelection;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    int16_t lc3plus_highres;
#endif

} ISAR_SPLIT_REND_CONFIG_DATA, *ISAR_SPLIT_REND_CONFIG_HANDLE;
#endif

/*----------------------------------------------------------------------------------*
 * Renderer API structures and enums
@@ -333,9 +323,7 @@ typedef struct _IVAS_RENDER_CONFIG
    IVAS_RENDER_TYPE_OVERRIDE renderer_type_override;
#endif
    IVAS_ROOM_ACOUSTICS_CONFIG_DATA roomAcoustics;
#ifdef SPLIT_REND_WITH_HEAD_ROT
    ISAR_SPLIT_REND_CONFIG_DATA split_rend_config;
#endif
    float directivity[IVAS_MAX_NUM_OBJECTS * 3];
    float distAtt[3];

@@ -345,9 +333,7 @@ typedef struct
{
    int16_t numSamplesPerChannel;
    int16_t numChannels;
#ifdef SPLIT_REND_WITH_HEAD_ROT
    int16_t is_cldfb;
#endif

} IVAS_REND_AudioBufferConfig;

+3 −11
Original line number Diff line number Diff line
@@ -54,12 +54,8 @@ int32_t get_delay(
    const int16_t enc_dec,                  /* i  : encoder/decoder flag                */
    const int32_t io_fs,                    /* i  : input/output sampling frequency     */
    const IVAS_FORMAT ivas_format,          /* i  : IVAS format                         */
#ifdef SPLIT_REND_WITH_HEAD_ROT
    HANDLE_CLDFB_FILTER_BANK hCldfb,        /* i  : Handle of Cldfb analysis            */
    const int16_t flag_binaural_split_coded /* i  : split rendering on/off flag         */
#else
    HANDLE_CLDFB_FILTER_BANK hCldfb /* i  : Handle of Cldfb analysis            */
#endif
)
{
    int32_t delay = 0;
@@ -102,18 +98,14 @@ int32_t get_delay(
        {
            delay = IVAS_DEC_DELAY_NS;

#ifdef SPLIT_REND_WITH_HEAD_ROT
            if ( !flag_binaural_split_coded )
            {
#endif
                if ( hCldfb != NULL )
                {
                    /* compensate for filterbank delay */
                    delay += IVAS_FB_DEC_DELAY_NS;
                }
#ifdef SPLIT_REND_WITH_HEAD_ROT
            }
#endif

            if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT )
            {
Loading