Commit 60b1c7b2 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'rend_funcs_integration_and_float_code_removal' into 'main'

Renderer functions integration, float buffers and structure elements cleanup

See merge request !337
parents 4edf911f 210e424e
Loading
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -48,6 +48,10 @@
#include "vector3_pair_file_reader.h"
#include "wmc_auto.h"

#ifdef IVAS_FLOAT_FIXED
#include "prot_fx1.h"
#endif

#define WMC_TOOL_SKIP

/*------------------------------------------------------------------------------------------*
@@ -826,11 +830,20 @@ int main(
    }
    const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) );

    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
#ifdef IVAS_FLOAT_FIXED
    Word32 nonDiegeticPanGain_fx = (args.nonDiegeticPanGain ==1.0f)? ONE_IN_Q31: (args.nonDiegeticPanGain == -1.0f)? L_negate(ONE_IN_Q31):(Word32)(args.nonDiegeticPanGain*(1LL<< Q31 ));
    IF( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, nonDiegeticPanGain_fx, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) );
        exit( -1 );
    }
#else
    IF ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) );
        exit( -1 );
    }
#endif // IVAS_FLOAT_FIXED

    /* === Configure === */
    if ( ( error = IVAS_REND_InitConfig( hIvasRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK )
+6 −0
Original line number Diff line number Diff line
@@ -121,6 +121,11 @@ typedef struct _IVAS_ISM_METADATA
#ifdef IVAS_FLOAT_FIXED
    Word32 azimuth_fx;
    Word32 elevation_fx;
    Word16 radius_fx;
    Word32 spread_fx;
    Word32 gainFactor_fx;
    Word32 yaw_fx;
    Word32 pitch_fx;
#endif
    float azimuth;
    float elevation;
@@ -255,4 +260,5 @@ typedef struct _IVAS_RENDER_CONFIG
#endif
} IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE;


#endif /* COMMON_API_TYPES_H */
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@
#define ONE_BY_PI_OVER_180_Q25                             ( 1922527360 )
#define _180_OVER_PI                            ( 180.0f / EVS_PI )
#ifdef IVAS_FLOAT_FIXED
#define _180_OVER_PI_Q25                         1922527233
#define _180_OVER_PI_Q25                         1922521886
#define _180_IN_Q22 (754974720)
#define _360_IN_Q22 (1509949440)
#define _180_OVER_PI_FX                          (Word32) (( 180.0f / EVS_PI ) *ONE_IN_Q10)
+14 −0
Original line number Diff line number Diff line
@@ -1280,15 +1280,29 @@ ivas_error ivas_ism_dec_config(
);
#endif // IVAS_FLOAT_FIXED

#ifdef IVAS_FLOAT_FIXED
ivas_error ivas_param_ism_dec_open_fx(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                      */
);
#else
ivas_error ivas_param_ism_dec_open(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                      */
);
#endif

#ifdef IVAS_FLOAT_FIXED
void ivas_param_ism_dec_close_fx(
    PARAM_ISM_DEC_HANDLE *hParamIsmDec,                         /* i/o: decoder ParamISM handle                     */
    SPAT_PARAM_REND_COMMON_DATA_HANDLE *hSpatParamRendCom_out,  /* i/o: common spatial renderer data                */
    const AUDIO_CONFIG output_config                            /* i  : output audio configuration                  */
);
#else
void ivas_param_ism_dec_close(
    PARAM_ISM_DEC_HANDLE *hParamIsmDec,                         /* i/o: decoder ParamISM handle                     */
    SPAT_PARAM_REND_COMMON_DATA_HANDLE *hSpatParamRendCom_out,  /* i/o: common spatial renderer data                */
    const AUDIO_CONFIG output_config                            /* i  : output audio configuration                  */
);
#endif

void ivas_param_ism_dec(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                      */
+8 −8
Original line number Diff line number Diff line
@@ -446,10 +446,10 @@ typedef struct ivas_masa_directional_spatial_meta_struct
    float energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS];
    float spread_coherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS];
#ifdef IVAS_FLOAT_FIXED
    Word32 azimuth_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS];
    Word32 elevation_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS];
    Word32 energy_ratio_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS];
    Word16 spread_coherence_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS];
    Word32 azimuth_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS];          /* Q22 */
    Word32 elevation_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS];        /* Q22 */
    Word32 energy_ratio_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS];     /* Q30 */
    Word16 spread_coherence_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; /* Q15 */
#endif
    uint16_t spherical_index[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS];

@@ -522,15 +522,15 @@ typedef struct ivas_qdirection_band_data_struct
    float azimuth[MAX_PARAM_SPATIAL_SUBFRAMES];
    float elevation[MAX_PARAM_SPATIAL_SUBFRAMES];
#ifdef IVAS_FLOAT_FIXED
    Word32 azimuth_fx[MAX_PARAM_SPATIAL_SUBFRAMES];
    Word32 elevation_fx[MAX_PARAM_SPATIAL_SUBFRAMES];
    Word32 azimuth_fx[MAX_PARAM_SPATIAL_SUBFRAMES];   /* Q22 */
    Word32 elevation_fx[MAX_PARAM_SPATIAL_SUBFRAMES]; /* Q22 */
#endif
    int16_t elevation_m_alphabet[MAX_PARAM_SPATIAL_SUBFRAMES];
    int16_t azimuth_m_alphabet[MAX_PARAM_SPATIAL_SUBFRAMES];

    float energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES];
#ifdef IVAS_FLOAT_FIXED
    Word32 energy_ratio_fx[MAX_PARAM_SPATIAL_SUBFRAMES];
    Word32 energy_ratio_fx[MAX_PARAM_SPATIAL_SUBFRAMES]; /* Q30 */
#endif
    uint8_t distance[MAX_PARAM_SPATIAL_SUBFRAMES];

@@ -595,7 +595,7 @@ typedef struct ivas_masa_qmetadata_frame_struct
#ifndef IVAS_FLOAT_FIXED
    float dir_comp_ratio;
#else
    Word16 dir_comp_ratio_fx;
    Word16 dir_comp_ratio_fx; /* Q15 */
#endif
    uint8_t is_masa_ivas_format;

Loading