Commit 2bbf2bfa authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

External Renderer APIv2 update

parent 157959e8
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ scripts/td_object_renderer/object_renderer_standalone/renderer_standalone.exe
# General/scripts
.DS_Store
.vscode
.cache
*.log
*.bak
scripts/c-code_instrument/
@@ -45,8 +46,13 @@ scripts/test/
scripts/self_test_summary.txt
scripts/tests/cut/
scripts/tests/ref/
tests/dut
tests/ref

# Python files that pop up when running scripts
__pycache__/
*.py[cod]
*$py.class

# clangd
.cache/
+659 −587

File changed.

Preview size limit exceeded, changes collapsed.

+4 −2
Original line number Diff line number Diff line
@@ -47,6 +47,9 @@
#define IVAS_MAX_NUM_OBJECTS       4
#define IVAS_MAX_OUTPUT_CHANNELS   16
#define IVAS_CLDFB_NO_CHANNELS_MAX ( 60 )
#ifdef EXT_RENDERER
#define IVAS_MAX_INPUT_LFE_CHANNELS 4
#endif

/*----------------------------------------------------------------------------------*
 * Common API structures
@@ -76,7 +79,7 @@ typedef struct _IVAS_ISM_METADATA
    float gainFactor;
} IVAS_ISM_METADATA;

typedef struct _IVAS_QUATERNION
typedef struct
{
    float w, x, y, z;

@@ -124,7 +127,6 @@ typedef struct _IVAS_LS_CUSTOM_LAYOUT
    float elevation[IVAS_MAX_OUTPUT_CHANNELS];
    int16_t num_lfe;
    int16_t lfe_idx[IVAS_MAX_OUTPUT_CHANNELS];

} IVAS_CUSTOM_LS_DATA;

typedef struct ivas_LS_setup_custom *IVAS_LSSETUP_CUSTOM_HANDLE;
+9 −5
Original line number Diff line number Diff line
@@ -110,7 +110,6 @@ typedef enum
#ifdef EXT_RENDERER /* TODO tmu : temporary, or use something like IVAS_ENC input format */
    AUDIO_CONFIG_MASA1,                         /* MASA1                        */
    AUDIO_CONFIG_MASA2,                         /* MASA2                        */
    AUDIO_CONFIG_META,                          /* scene description            */
#endif
    AUDIO_CONFIG_EXTERNAL                       /* external renderer            */

@@ -1183,11 +1182,7 @@ typedef enum
 *----------------------------------------------------------------------------------*/

#define MC_LS_SETUP_BITS                        3                           /* number of bits for writing the MC LS configuration */
#ifdef EXT_RENDERER
#define LS_SETUP_CONVERSION_NUM_MAPPINGS        37                          /* number of mappings for LS setup conversion         */
#else
#define LS_SETUP_CONVERSION_NUM_MAPPINGS        35                          /* number of mappings for LS setup conversion         */
#endif

typedef enum
{
@@ -1393,12 +1388,21 @@ typedef enum

#define BINAURAL_COHERENCE_DIFFERENCE_BINS      9                           /* Number of bins for direction-dependent diffuse-field binaural coherence */

#ifdef EXT_RENDERER
#define HEADROT_ORDER                           3
#define HEADROT_SHMAT_DIM                       ( ( HEADROT_ORDER + 1 ) * ( HEADROT_ORDER + 1 ) )
#define HEADROT_SHMAT_DIM2                      ( HEADROT_SHMAT_DIM * HEADROT_SHMAT_DIM )
#endif

/*----------------------------------------------------------------------------------*
 * TD Binaural Object renderer
 *----------------------------------------------------------------------------------*/

#ifdef EXT_RENDERER
#define MAX_NUM_TDREND_CHANNELS                 16                          /* max. number of channels in TD renderer (objects or loudspeaker channels) */
#else
#define MAX_NUM_TDREND_CHANNELS                 11                          /* max. number of channels in TD renderer (objects or loudspeaker channels) */
#endif

#define SFX_SPAT_BIN_MAX_NO_OF_OUTPUT_SAMPLES   288                         /* 288 = 6 msec @ 48 kHz.                                           */
#define HRTF_MODEL_N_SECTIONS                   3                           /* No. sections used in approximate evaluation of model             */
+33 −12
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ typedef enum
    IVAS_ERR_INVALID_CICP_INDEX,
    IVAS_ERR_INVALID_BITRATE,
    IVAS_ERR_INVALID_MASA_CONFIG,
    IVAS_ERR_TOO_MANY_OBJECT_INPUTS,
    IVAS_ERR_TOO_MANY_INPUTS,
    IVAS_ERR_INDEX_OUT_OF_BOUNDS,
    IVAS_ERR_RECONFIGURE_NOT_SUPPORTED,
    IVAS_ERR_INVALID_FEC_CONFIG,
@@ -86,6 +86,13 @@ typedef enum
    IVAS_ERR_FILE_READER_TIMESTAMP_MISMATCH,
    IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT,
    IVAS_ERR_INVALID_MASA_FORMAT_METADATA_FILE,
#ifdef EXT_RENDERER
    IVAS_ERR_NUM_CHANNELS_UNKNOWN,
    IVAS_ERR_INVALID_CUSTOM_LS_LAYOUT,
    IVAS_ERR_INVALID_INPUT_ID,
    IVAS_ERR_WRONG_NUM_CHANNELS,
    IVAS_ERR_INVALID_BUFFER_SIZE,
#endif

    /*----------------------------------------*
     *            input data errors           *
@@ -125,17 +132,6 @@ typedef enum

static inline const char *ivas_error_to_string( ivas_error error_code )
{
    /* For error categories that are likely to still have many changes to
     * specific error codes, return one string per category */
    if ( ( error_code & 0xF000 ) == 0x1000 )
    {
        return "API error";
    }
    if ( ( error_code & 0xF000 ) == 0x2000 )
    {
        return "data error";
    }

    /* For categories that are unlikely to change, use more specific strings */
    switch ( error_code )
    {
@@ -147,6 +143,20 @@ static inline const char *ivas_error_to_string( ivas_error error_code )
            return "Internal error";
        case IVAS_ERR_INTERNAL_FATAL:
            return "Internal fatal error";
#ifdef EXT_RENDERER
        case IVAS_ERR_INVALID_SAMPLING_RATE:
            return "Invalid sampling rate";
        case IVAS_ERR_INVALID_OUTPUT_FORMAT:
            return "Invalid output format";
        case IVAS_ERR_INVALID_CUSTOM_LS_LAYOUT:
            return "Invalid custom loudspeaker layout";
        case IVAS_ERR_INVALID_INPUT_ID:
            return "Invalid input ID";
        case IVAS_ERR_WRONG_NUM_CHANNELS:
            return "Wrong number of channels";
        case IVAS_ERR_INVALID_BUFFER_SIZE:
            return "Invalid buffer size";
#endif
        case IVAS_ERR_FAILED_FILE_OPEN:
            return "File open error";
        case IVAS_ERR_FAILED_FILE_WRITE:
@@ -161,6 +171,17 @@ static inline const char *ivas_error_to_string( ivas_error error_code )
            break;
    }

    /* For error categories that are likely to still have many changes to
     * specific error codes, return one string per category */
    if ( ( error_code & 0xF000 ) == 0x1000 )
    {
        return "API error";
    }
    if ( ( error_code & 0xF000 ) == 0x2000 )
    {
        return "data error";
    }

    return "Unknown error";
}

Loading