Commit 01f184c0 authored by emerit's avatar emerit
Browse files

simplified version

parent 289fa5c9
Loading
Loading
Loading
Loading
+5 −15
Original line number Diff line number Diff line
@@ -40,13 +40,15 @@
#include "stat_enc.h"
#include "stat_dec.h"
#include "stat_com.h"
#ifdef FIX_197_CREND_INTERFACE
#include "ivas_stat_rend.h"
#endif
#include "ivas_stat_enc.h"
#include "ivas_stat_dec.h"
#include "ivas_stat_com.h"
#include "ivas_error_utils.h"
#ifdef FIX_197_CREND_INTERFACE
#ifndef FIX_197_CREND_INTERFACE_LIB_REND_H
#include "lib_rend.h"
#endif
#endif

/* clang-format off */

@@ -5411,18 +5413,6 @@ ivas_error ivas_crend_process(

#else

#ifndef FIX_197_CREND_INTERFACE_LIB_REND_H
IVAS_REND_AudioConfigType getAudioConfigType(
    const IVAS_REND_AudioConfig config );

ivas_error getAudioConfigNumChannels(
    const IVAS_REND_AudioConfig config,
    int16_t *numChannels );

IVAS_REND_AudioConfig getRendAudioConfigFromIvasAudioConfig(
    AUDIO_CONFIG config );

#endif
ivas_error ivas_rend_initCrend(
    CREND_WRAPPER *pCrend,
#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H
+2 −75
Original line number Diff line number Diff line
@@ -48,8 +48,6 @@
#endif
#endif

#if !defined( FIX_197_CREND_INTERFACE ) || defined( FIX_197_CREND_INTERFACE_LIB_REND_H )

/*----------------------------------------------------------------------------------*
 * Output configuration for renderer (e.g. DirAC, MASA, Binaural Renderer...)
 *----------------------------------------------------------------------------------*/
@@ -73,7 +71,7 @@ typedef struct ivas_output_setup_structure

} IVAS_OUTPUT_SETUP, *IVAS_OUTPUT_SETUP_HANDLE;

#endif

/*----------------------------------------------------------------------------------*
 * DFT Stereo decoder structure
 *----------------------------------------------------------------------------------*/
@@ -824,8 +822,6 @@ typedef struct ivas_spar_md_dec_state_t
    int16_t spar_hoa_md_flag;
} ivas_spar_md_dec_state_t;

#if !defined( FIX_197_CREND_INTERFACE ) || defined( FIX_197_CREND_INTERFACE_LIB_REND_H )

/* AGC structure */
typedef struct ivas_agc_dec_chan_state_t
{
@@ -864,8 +860,6 @@ typedef struct ivas_td_decorr_state_t

} ivas_td_decorr_state_t;

#endif

/* PCA structure */
typedef struct
{
@@ -997,8 +991,6 @@ typedef struct mct_dec_data_structure

} MCT_DEC_DATA, *MCT_DEC_HANDLE;

#if !defined( FIX_197_CREND_INTERFACE ) || defined( FIX_197_CREND_INTERFACE_LIB_REND_H )

/*----------------------------------------------------------------------------------*
 * EFAP structures
 *----------------------------------------------------------------------------------*/
@@ -1131,7 +1123,6 @@ typedef struct renderer_struct

} ISM_RENDERER_DATA, *ISM_RENDERER_HANDLE;

#endif
/*----------------------------------------------------------------------------------*
 * MASA decoder structures
 *----------------------------------------------------------------------------------*/
@@ -1186,8 +1177,6 @@ typedef struct ivas_masa_decoder_struct

} MASA_DECODER, *MASA_DECODER_HANDLE;

#if !defined( FIX_197_CREND_INTERFACE ) || defined( FIX_197_CREND_INTERFACE_LIB_REND_H )

/*----------------------------------------------------------------------------------*
 * Binaural Rendering structure
 *----------------------------------------------------------------------------------*/
@@ -1824,7 +1813,7 @@ typedef struct ivas_hrtfs_file_header_t

#endif

#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H
#ifdef FIX_197_CREND_INTERFACE
/* Main Crend wrapper structure */
typedef struct ivas_binaural_crend_wrapper_struct
{
@@ -1903,68 +1892,6 @@ typedef struct decoder_config_structure

} DECODER_CONFIG, *DECODER_CONFIG_HANDLE;

/*----------------------------------------------------------------------------------*
 * Loudspeaker Configuration Conversion structure
 *----------------------------------------------------------------------------------*/

typedef struct ivas_LS_setupconversion_struct
{
    float *dmxMtx[MAX_OUTPUT_CHANNELS];
    float *targetEnergyPrev[MAX_OUTPUT_CHANNELS];
    float *dmxEnergyPrev[MAX_OUTPUT_CHANNELS];
    int16_t sfbOffset[MAX_SFB + 2];
    int16_t sfbCnt;

} LSSETUP_CONVERSION_STRUCT, *LSSETUP_CONVERSION_HANDLE;


typedef struct ivas_LS_setupconversion_matrix
{
    int16_t index;
    float value;
} LS_CONVERSION_MATRIX;

typedef struct ivas_LS_setupconversion_mapping
{
    AUDIO_CONFIG input_config;
    AUDIO_CONFIG output_config;
    const LS_CONVERSION_MATRIX *conversion_matrix;
} LS_CONVERSION_MAPPING;

typedef struct ivas_mono_downmix_renderer_struct
{
    float inputEnergy[CLDFB_NO_CHANNELS_MAX];
    float protoEnergy[CLDFB_NO_CHANNELS_MAX];

} MONO_DOWNMIX_RENDERER_STRUCT, *MONO_DOWNMIX_RENDERER_HANDLE;


/*----------------------------------------------------------------------------------*
 * Custom Loudspeaker configuration structure
 *----------------------------------------------------------------------------------*/

typedef struct ivas_LS_setup_custom
{
    int16_t is_planar_setup;                      /* flag to indicate if setup is planar or not                               */
    int16_t num_spk;                              /* number of custom loudspeakers                                            */
    float ls_azimuth[MAX_OUTPUT_CHANNELS];        /* custom loudspeaker azimuths                                              */
    float ls_elevation[MAX_OUTPUT_CHANNELS];      /* custom loudspeaker elevations                                            */
    int16_t num_lfe;                              /* number of LFE channels                                                   */
    int16_t lfe_idx[MAX_OUTPUT_CHANNELS];         /* index for LFE channel insertion                                          */
    int16_t separate_ch_found;                    /* flag to indicate if a center channel was found                           */
    float separate_ch_gains[MAX_OUTPUT_CHANNELS]; /* gains to pan McMASA separateChannel in case no center channel is present */

} LSSETUP_CUSTOM_STRUCT, *LSSETUP_CUSTOM_HANDLE;

/* Channel types in a channel-based config */
typedef enum
{
    CHANNEL_TYPE_UNUSED = 0,
    CHANNEL_TYPE_SPEAKER,
    CHANNEL_TYPE_LFE
} ChannelType;

#endif
/*----------------------------------------------------------------------------------*
 *
 * Main IVAS decoder structure
+7 −11
Original line number Diff line number Diff line
@@ -1467,8 +1467,8 @@ ivas_error ivas_crend_process(
ivas_error ivas_rend_initCrend(
    CREND_WRAPPER *pCrend,
#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H
    const AUDIO_CONFIG inConfig,
    const AUDIO_CONFIG outConfig,
    const AUDIO_CONFIG inIvasConfig,
    const AUDIO_CONFIG outIvasConfig,
#else
    const IVAS_REND_AudioConfig inConfig,
    const IVAS_REND_AudioConfig outConfig,
@@ -1486,14 +1486,14 @@ ivas_error ivas_rend_initCrend(
    HRTFS_HANDLE hHrtf;
    ivas_error error;
#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H
    IVAS_REND_AudioConfig inRendConfig;
    IVAS_REND_AudioConfig inConfig;
    IVAS_REND_AudioConfig outConfig;

    inRendConfig = getRendAudioConfigFromIvasAudioConfig( inConfig );
    inConfigType = getAudioConfigType( inRendConfig );
#else
    inConfig = getRendAudioConfigFromIvasAudioConfig( inIvasConfig );
    outConfig = getRendAudioConfigFromIvasAudioConfig( outIvasConfig );
#endif
    inConfigType = getAudioConfigType( inConfig );

#endif
    hHrtf = pCrend->hHrtfCrend;

    /* Do all error checks up front so that the nested if later is easier */
@@ -1527,11 +1527,7 @@ ivas_error ivas_rend_initCrend(
    }
#endif

#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H
    if ( ( error = getAudioConfigNumChannels( inRendConfig, &nchan_in ) ) != IVAS_ERR_OK )
#else
    if ( ( error = getAudioConfigNumChannels( inConfig, &nchan_in ) ) != IVAS_ERR_OK )
#endif
    {
        return error;
    }
+6 −25
Original line number Diff line number Diff line
@@ -31,9 +31,7 @@
*******************************************************************************************************/

#include "ivas_error.h"
#ifdef FIX_197_CREND_INTERFACE
#include "ivas_stat_rend.h"
#else
#ifndef FIX_197_CREND_INTERFACE
#include "lib_rend.h"
#endif
#include "ivas_stat_dec.h"
@@ -41,23 +39,14 @@
#ifndef IVAS_LIB_REND_INTERNALS_H
#define IVAS_LIB_REND_INTERNALS_H

#ifdef FIX_197_CREND_INTERFACE
AUDIO_CONFIG getIvasAudioConfigFromRendAudioConfig(
    IVAS_REND_AudioConfig config );

IVAS_REND_AudioConfig getRendAudioConfigFromIvasAudioConfig(
    AUDIO_CONFIG config );
#endif

#ifndef FIX_197_CREND_INTERFACE

#ifndef FIX_197_CREND_INTERFACE_LIB_REND_H
typedef struct
{
    int8_t headRotEnabled;
    IVAS_QUATERNION headPositions[RENDERER_HEAD_POSITIONS_PER_FRAME];
    float crossfade[L_FRAME48k / RENDERER_HEAD_POSITIONS_PER_FRAME];
} IVAS_REND_HeadRotData;

#endif
typedef struct
{
    int32_t binaural_latency_ns;
@@ -65,7 +54,7 @@ typedef struct
    TDREND_HRFILT_FiltSet_t *hHrtfTD;
} TDREND_WRAPPER;

#ifndef FIX_197_CREND_INTERFACE_LIB_REND_H
#ifndef FIX_197_CREND_INTERFACE

typedef struct
{
@@ -88,6 +77,8 @@ AUDIO_CONFIG getIvasAudioConfigFromRendAudioConfig(
    IVAS_REND_AudioConfig config );
#endif

#ifndef FIX_197_CREND_INTERFACE

ivas_error ivas_rend_openCrend(
    CREND_WRAPPER *pCrend,
    const IVAS_REND_AudioConfig inConfig,
@@ -128,16 +119,6 @@ ivas_error ivas_rend_crendConvolver(
    const int16_t i_ts );
#endif

#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H
typedef struct
{
    int32_t binaural_latency_ns;
    BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd;
    TDREND_HRFILT_FiltSet_t *hHrtfTD;
} TDREND_WRAPPER;

#endif

ivas_error ivas_rend_TDObjRenderFrame(
    const TDREND_WRAPPER *pTDRend,                   /* i  : TD Renderer wrapper structure     */
    const IVAS_REND_AudioConfig inConfig,            /* i  : Input audio configuration         */
+0 −8
Original line number Diff line number Diff line
@@ -39,15 +39,7 @@
#include "debug.h"
#endif
#include "ivas_cnst.h"
#ifndef FIX_197_CREND_INTERFACE
#include "ivas_stat_dec.h"
#else
#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H
#include "ivas_stat_rend.h"
#else
#include "ivas_stat_dec.h"
#endif
#endif

/*----------------------------------------------------------------------------------*
 * FASTCONV and PARAMETRIC binaural renderer ROM tables
Loading