Commit 5d3161fe authored by vaclav's avatar vaclav
Browse files

move functions to appropriate libraries

parent e031c86f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -276,12 +276,14 @@
    <ClCompile Include="..\lib_dec\ivas_dirac_output_synthesis_cov.c" />
    <ClCompile Include="..\lib_dec\ivas_dirac_output_synthesis_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_entropy_decoder.c" />
    <ClCompile Include="..\lib_dec\ivas_hrtf.c" />
    <ClCompile Include="..\lib_dec\ivas_init_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_ism_metadata_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_ism_param_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_ism_renderer.c" />
    <ClCompile Include="..\lib_dec\ivas_lfe_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_lfe_plc.c" />
    <ClCompile Include="..\lib_dec\ivas_ls_custom_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_masa_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_mcmasa_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_mct_core_dec.c" />
@@ -290,6 +292,7 @@
    <ClCompile Include="..\lib_dec\ivas_mc_param_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_mdct_core_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_mono_dmx_renderer.c" />
    <ClCompile Include="..\lib_dec\ivas_objectRenderer_internal.c" />
    <ClCompile Include="..\lib_dec\ivas_output_config.c" />
    <ClCompile Include="..\lib_dec\ivas_out_setup_conversion.c" />
    <ClCompile Include="..\lib_dec\ivas_pca_dec.c" />
@@ -297,10 +300,10 @@
    <ClCompile Include="..\lib_dec\ivas_range_uni_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_qmetadata_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_qspherical_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_reverb_internal.c" />
    <ClCompile Include="..\lib_dec\ivas_rom_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_sba_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_sba_dirac_stereo_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_sba_rendering_internal.c" />
    <ClCompile Include="..\lib_dec\ivas_sce_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_spar_decoder.c" />
    <ClCompile Include="..\lib_dec\ivas_spar_md_dec.c" />
+11 −2
Original line number Diff line number Diff line
@@ -503,10 +503,19 @@
    <ClCompile Include="..\lib_dec\ivas_binRenderer_internal.c">
      <Filter>dec_ivas_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_dec\ivas_reverb_internal.c">
    <ClCompile Include="..\lib_dec\ivas_output_config.c">
      <Filter>dec_ivas_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_dec\ivas_output_config.c">
    <ClCompile Include="..\lib_dec\ivas_sba_rendering_internal.c">
      <Filter>dec_ivas_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_dec\ivas_objectRenderer_internal.c">
      <Filter>dec_ivas_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_dec\ivas_hrtf.c">
      <Filter>dec_ivas_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_dec\ivas_ls_custom_dec.c">
      <Filter>dec_ivas_c</Filter>
    </ClCompile>
  </ItemGroup>
+0 −2
Original line number Diff line number Diff line
@@ -202,9 +202,7 @@
    <ClCompile Include="..\lib_rend\ivas_allrad_dec.c" />
    <ClCompile Include="..\lib_rend\ivas_crend.c" />
    <ClCompile Include="..\lib_rend\ivas_efap.c" />
    <ClCompile Include="..\lib_rend\ivas_hrtf.c" />
    <ClCompile Include="..\lib_rend\ivas_limiter.c" />
    <ClCompile Include="..\lib_rend\ivas_ls_custom_dec.c" />
    <ClCompile Include="..\lib_rend\ivas_objectRenderer.c" />
    <ClCompile Include="..\lib_rend\ivas_objectRenderer_hrFilt.c" />
    <ClCompile Include="..\lib_rend\ivas_objectRenderer_mix.c" />
+35 −177
Original line number Diff line number Diff line
@@ -3182,16 +3182,6 @@ void ivas_sba_getTCs(
    const int16_t input_frame                                   /* i  : frame length                            */
);

// VE2AT: move to ivas_prot_rend.h ?
ivas_error ivas_sba_linear_renderer(
    float output_f[][L_FRAME48k],                               /* i/o: synthesized core-coder transport channels/DirAC output  */
    const int16_t output_frame,                                 /* i  : output frame length per channel                         */
    const int16_t nchan_in,                                     /* i  : number of input ambisonics channels                     */
    const AUDIO_CONFIG output_config,                           /* i  : output audio configuration                              */
    const IVAS_OUTPUT_SETUP output_setup,                       /* i  : output format setup                                     */
    const float hoa_dec_mtx[]                                   /* i  : HOA decoding mtx                                        */
);

int16_t ivas_sba_remapTCs(
    float sba_data[][L_FRAME48k],                               /* i/o: SBA signals                             */
    Decoder_Struct *st_ivas,                                    /* i/o: decoder struct                          */
@@ -3212,11 +3202,13 @@ void ivas_sba_dirac_stereo_smooth_parameters(
    STEREO_DFT_DEC_DATA_HANDLE hStereoDft                       /* i/o: encoder DFT stereo handle               */
);

// VE2AT: move to ivas_prot_rend.h ?
ivas_error ivas_sba_get_hoa_dec_matrix(
    const IVAS_OUTPUT_SETUP hOutSetup,                          /* i  : target output setup                     */
    float **hoa_dec_mtx,                                        /* o  : ALLRAD decoder matrix                   */
    const int16_t ambisonics_order                              /* i  : Ambisonics order                        */
void ivas_sba2mc_cldfb(
    IVAS_OUTPUT_SETUP hInSetup,                                             /* i  : Format of input layout              */
    float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o: cldfb real part                     */
    float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o: cldfb imag part                     */
    const int16_t nb_channels_out,                                          /* i  : nb of output channels               */
    const int16_t nb_bands,                                                 /* i  : nb of CLDFB bands to process        */
    const float *hoa_dec_mtx                                                /* i  : HOA decoding mtx                    */
);


@@ -3307,61 +3299,6 @@ void ivas_dirac_dec(
    const int16_t i_sf
);

#ifdef HRTF_BINARY_FILE
ivas_error ivas_dirac_dec_init_binaural_data(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                  */
    HRTFS_PARAMBIN_HANDLE hHrtfParambin                         /* i  : HRTF structure for rendering            */
);
#else
ivas_error ivas_dirac_dec_init_binaural_data(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                  */
);
#endif

void ivas_dirac_dec_close_binaural_data(
    DIRAC_DEC_BIN_HANDLE *hBinaural                             /* i/o: decoder DirAC binaural data handle      */
);

#ifdef HRTF_BINARY_FILE
ivas_error ivas_dirac_dec_binaural_copy_hrtfs(
    HRTFS_PARAMBIN_HANDLE *hHrtfParambin                        /* i/o: HRTF structure for rendering            */
);
#endif
// VE2AT: move to lib_rend ?
void ivas_dirac_dec_binaural(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                  */
    float output_f[][L_FRAME48k],                               /* i/o: synthesized core-coder transport channels/DirAC output  */
    const int16_t nchan_transport                               /* i  : number of transport channels            */
);

ivas_error ivas_binaural_reverb_open(
    REVERB_STRUCT_HANDLE *hReverbPr,                            /* i/o: binaural reverb handle                  */
    const int16_t numBins,                                      /* i  : number of CLDFB bins                    */
    const int16_t numCldfbSlotsPerFrame,                        /* i  : number of CLDFB slots per frame         */
    ivas_roomAcoustics_t *roomAcoustics,                        /* i/o: room acoustics parameters               */
    const AUDIO_CONFIG output_config,                           /* i  : output audio configuration              */
    const int32_t sampling_rate,                                /* i  : sampling rate                           */
    const RENDERER_TYPE renderer_type                           /* i  : renderer type                           */
#ifdef HRTF_BINARY_FILE
    ,
    const HRTFS_FASTCONV_HANDLE hHrtfFastConv,                  /* i  : FastConv HRTF handle                    */
    const HRTFS_PARAMBIN_HANDLE hHrtfParambin                   /* i  : Parametric binauralizer HRTF handle     */
#endif
);

void ivas_binaural_reverb_close(
    REVERB_STRUCT_HANDLE *hReverb                               /* i/o: binaural reverb handle                  */
);

void ivas_binaural_reverb_processFrame(
    REVERB_STRUCT_HANDLE hReverb,                               /* i/o: binaural reverb handle                  */
    const int16_t numInChannels,                                /* i  : num input channels to be processed      */
    float inReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],    /* i  : input CLDFB data real                   */
    float inImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],    /* i  : input CLDFB data imag                   */
    float outReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],   /* o  : output CLDFB data real                  */
    float outImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],   /* o  : output CLDFB data imag                  */
    const uint8_t offsetSamplesIO                               /* i  : number of offset samples                */
);

void computeDiffuseness_mdft(
    float **buffer_intensity[DIRAC_NUM_DIMS],
@@ -3848,14 +3785,6 @@ void ivas_sba_mix_matrix_determiner(
    const int16_t output_frame                                  /* i  : output frame length                     */
);

void ivas_sba_prototype_renderer(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder struct                     */
    float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],      /* i  : Input audio in CLDFB domain, real       */
    float inIm[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX],      /* i  : Input audio in CLDFB domain, imag       */
    const int16_t firstSubframe,                                /* i  : First subframe to map                   */
    const int16_t nSubframes                                    /* i  : Number of subframes to map              */
);

/* AGC */
/*! r: AGC enable flag */
int16_t ivas_agc_enc_get_flag(
@@ -4577,6 +4506,7 @@ void ivas_output_init(
    const AUDIO_CONFIG output_config                            /* i  : output audio configuration                      */
);

// VE2AT: this fucntion is used in lib_rend at one place - the fucntion ivas_rend_initEfap() is however not used; wh
// VE2AT: rename it
IVAS_REND_AudioConfig getRendAudioConfigFromIvasAudioConfig(
    AUDIO_CONFIG config 
@@ -4617,45 +4547,9 @@ void ivas_binaural_add_LFE(
);

#ifdef HRTF_BINARY_FILE
ivas_error ivas_HRTF_fastconv_binary_open(
    HRTFS_FASTCONV **hHrtfFastConv                              /* i/o: FASTCONV HRTF structure */
);

void ivas_HRTF_fastconv_binary_close(
    HRTFS_FASTCONV **hHrtfFastConv                              /* i/o: FASTCONV HRTF structure */
);

ivas_error ivas_HRTF_parambin_binary_open(
    HRTFS_PARAMBIN **hHrtfParambin                              /* i/o: Parametric binauralizer HRTF structure */
);

void ivas_HRTF_parambin_binary_close(
    HRTFS_PARAMBIN **hHrtfParambin                              /* i/o: Parametric binauralizer HRTF structure */
);
#endif

// VE2AT: move to ivas_prot_rend.h ??
void QuatToRotMat(
    const IVAS_QUATERNION quat,                                 /* i  : quaternion describing the rotation                      */
    float Rmat[3][3]                                            /* o  : real-space rotation matrix for this rotation            */
);

void rotateAziEle(
    float azi_in,                                               /* i  : output elevation                                        */
    float ele_in,                                               /* i  : input elevation                                         */
    int16_t *azi,                                               /* o  : rotated azimuth                                         */
    int16_t *ele,                                               /* o  : rotated elevation                                       */
    float Rmat[3][3],                                           /* i  : real-space rotation matrix                              */
    const int16_t isPlanar                                      /* i  : is roation planar and elevation meaningless?            */
);

void rotateAziEle_DirAC(
    int16_t *azi,                                               /* i/o: array of azimuth values                                 */
    int16_t *ele,                                               /* i/o: array of elevation values                               */
    const int16_t band1,                                        /* i  : bands to work on (lower limit)                          */
    const int16_t band2,                                        /* i  : bands to work on (upper bound)                          */
    const float *p_Rmat                                         /* i  : pointer to real-space rotation matrix                   */
);

ivas_error ivas_headTrack_open(
    HEAD_TRACK_DATA_HANDLE *hHeadTrackData                      /* o  : head track handle                                       */
@@ -5007,21 +4901,10 @@ void ivas_filter_process(
 * TD Binaural Object renderer
 *----------------------------------------------------------------------------------*/

ivas_error ivas_HRTF_binary_open(
    TDREND_HRFILT_FiltSet_t **hHrtfTD                           /* i/o: TD renderer HRTF handle                 */
);

void ivas_HRTF_binary_close(
    TDREND_HRFILT_FiltSet_t **hHrtfTD                           /* i/o: TD renderer HRTF handle                 */
);

ivas_error ivas_td_binaural_open(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                  */
);

void ivas_td_binaural_close(
    BINAURAL_TD_OBJECT_RENDERER_HANDLE *hBinRendererTd          /* i/o: TD binaural object renderer handle      */
);

void ObjRenderIVASFrame(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                  */
@@ -5030,10 +4913,7 @@ void ObjRenderIVASFrame(
);


void BSplineModelEvalDealloc(
    ModelParams_t *model,                                       /* i  : Model parameters                        */
    ModelEval_t *modelEval                                      /* i  : Model evaluation structure              */
);



/*----------------------------------------------------------------------------------*
@@ -5111,10 +4991,35 @@ int16_t ivas_get_num_bands_from_bw_idx(
);



/*----------------------------------------------------------------------------------*
 * Crend renderer
 * HRTF
 *----------------------------------------------------------------------------------*/

ivas_error ivas_HRTF_binary_open(
    TDREND_HRFILT_FiltSet_t **hHrtfTD                           /* i/o: TD renderer HRTF handle                 */
);

void ivas_HRTF_binary_close(
    TDREND_HRFILT_FiltSet_t **hHrtfTD                           /* i/o: TD renderer HRTF handle                 */
);

ivas_error ivas_HRTF_fastconv_binary_open(
    HRTFS_FASTCONV **hHrtfFastConv                              /* i/o: FASTCONV HRTF structure */
);

void ivas_HRTF_fastconv_binary_close(
    HRTFS_FASTCONV **hHrtfFastConv                              /* i/o: FASTCONV HRTF structure */
);

ivas_error ivas_HRTF_parambin_binary_open(
    HRTFS_PARAMBIN **hHrtfParambin                              /* i/o: Parametric binauralizer HRTF structure */
);

void ivas_HRTF_parambin_binary_close(
    HRTFS_PARAMBIN **hHrtfParambin                              /* i/o: Parametric binauralizer HRTF structure */
);

#ifdef HRTF_BINARY_FILE

ivas_error ivas_HRTF_CRend_binary_open(
@@ -5163,54 +5068,7 @@ ivas_error ivas_crend_process(

#else

ivas_error ivas_rend_openCrend(
    CREND_WRAPPER_HANDLE *pCrend,
    const IVAS_REND_AudioConfig inConfig,
    const IVAS_REND_AudioConfig outConfig,
    RENDER_CONFIG_DATA *hRendCfg,
    int16_t Opt_Headrotation,
#ifdef HRTF_BINARY_FILE
    HRTFS_CREND_HANDLE hSetOfHRTF,
#endif    
    const int32_t output_Fs 
);

#ifdef FIX_197_CREND_INTERFACE
void ivas_rend_closeCrend(
#else
ivas_error ivas_rend_closeCrend(
#endif
    CREND_WRAPPER_HANDLE *pCrend );

ivas_error ivas_rend_crendProcess(
    const CREND_WRAPPER *pCrend,
    const IVAS_REND_AudioConfig inConfig,
    const IVAS_REND_AudioConfig outConfig,
    DECODER_CONFIG_HANDLE hDecoderConfig,
    HEAD_TRACK_DATA_HANDLE hHeadTrackData,   
    IVAS_OUTPUT_SETUP_HANDLE hIntSetup, 
    EFAP_HANDLE hEFAPdata,     
    float output[][L_FRAME48k], /* i/o: input/output audio channels     */
    const int32_t output_Fs 
);
#endif

/*----------------------------------------------------------------------------------*
 * Renderer configuration
 *----------------------------------------------------------------------------------*/

ivas_error ivas_render_config_open(
    RENDER_CONFIG_HANDLE *hRenderConfig                         /* i/o: Renderer config handle                  */
);

void ivas_render_config_close(
    RENDER_CONFIG_HANDLE *hRenderConfig                         /* i/o: Renderer config handle                  */
);

ivas_error ivas_render_config_init_from_rom(
    RENDER_CONFIG_HANDLE *hRenderConfig,                        /* i/o: Renderer config handle                  */
    const int16_t room_flag_on                                  /* i  : room effect on/off flag                 */
);


/* clang-format on */
+51 −21
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@
#include "cnst.h"
#include "prot.h"
#include "ivas_prot.h"
#include "ivas_prot_rend.h"
#include "ivas_cnst.h"
#include "ivas_rom_com.h"
#include "ivas_rom_dec.h"
@@ -49,33 +50,16 @@
/*-----------------------------------------------------------------------*
 * Local function prototypes
 *-----------------------------------------------------------------------*/

static void ivas_dirac_alloc_mem( DIRAC_DEC_HANDLE hDirAC, const RENDERER_TYPE renderer_type, DIRAC_DEC_STACK_MEM_HANDLE hDirAC_mem );

static void ivas_dirac_free_mem( DIRAC_DEC_STACK_MEM_HANDLE hDirAC_mem );

static void initDiffuseResponses(
    float *diffuse_response_function,
    const int16_t num_channels,
    AUDIO_CONFIG output_config,
    IVAS_OUTPUT_SETUP hOutSetup,
    const int16_t ambisonics_order,
    const IVAS_FORMAT ivas_format,
    int16_t *num_ele_spk_no_diffuse_rendering,
    AUDIO_CONFIG transport_config );
static void initDiffuseResponses( float *diffuse_response_function, const int16_t num_channels, AUDIO_CONFIG output_config, IVAS_OUTPUT_SETUP hOutSetup, const int16_t ambisonics_order, const IVAS_FORMAT ivas_format, int16_t *num_ele_spk_no_diffuse_rendering, AUDIO_CONFIG transport_config );

static void computeIntensityVector_dec( float Cldfb_RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], const int16_t num_frequency_bands, float *intensity_real_x, float *intensity_real_y, float *intensity_real_z );

static void protoSignalComputation_shd(
    float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX],
    float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX],
    float *proto_direct_buffer_f,
    float *proto_diffuse_buffer_f,
    float *reference_power,
    const int16_t slot_index,
    const int16_t num_inputs,
    const int16_t num_outputs_diff,
    const int16_t num_freq_bands,
    float *p_Rmat );
static void protoSignalComputation_shd( float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], float *proto_direct_buffer_f, float *proto_diffuse_buffer_f, float *reference_power, const int16_t slot_index, const int16_t num_inputs, const int16_t num_outputs_diff, const int16_t num_freq_bands, float *p_Rmat );

static void protoSignalComputation1( float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], float *proto_frame_f, float *proto_direct_buffer_f, float *reference_power, float *proto_power_smooth, const int16_t slot_index, const int16_t num_outputs_diff, const int16_t num_freq_bands );

@@ -85,7 +69,6 @@ static void protoSignalComputation4( float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRA

static void ivas_dirac_dec_compute_diffuse_proto( DIRAC_DEC_HANDLE hDirAC, const int16_t slot_idx );


static void computeDirectionAngles( float *intensity_real_x, float *intensity_real_y, float *intensity_real_z, const int16_t num_frequency_bands, int16_t *azimuth, int16_t *elevation );

static void ivas_masa_init_stereotype_detection( MASA_STEREO_TYPE_DETECT *stereo_type_detect );
@@ -94,6 +77,8 @@ static void ivas_masa_stereotype_detection( MASA_STEREO_TYPE_DETECT *stereo_type

static void ivas_lfe_synth_with_cldfb( MCMASA_LFE_SYNTH_DATA_HANDLE hMasaLfeSynth, float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], float RealBufferLfe[MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], float ImagBufferLfe[MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], const int16_t slot_index, const int16_t subframe_index, const int16_t nchan_transport );

static void rotateAziEle_DirAC( int16_t *azi, int16_t *ele, const int16_t band1, const int16_t band2, const float *p_Rmat );


/*-------------------------------------------------------------------------
 * ivas_dirac_dec_open()
@@ -3617,3 +3602,48 @@ static void ivas_lfe_synth_with_cldfb(

    return;
}


/*-------------------------------------------------------------------------
 * rotateAziEle_DirAC()
 *
 * Apply rotation to DirAC DOAs
 *------------------------------------------------------------------------*/

static void rotateAziEle_DirAC(
    int16_t *azi,        /* i/o: array of azimuth values               */
    int16_t *ele,        /* i/o: array of elevation values             */
    const int16_t band1, /* i  : bands to work on (lower limit)        */
    const int16_t band2, /* i  : bands to work on (upper bound)        */
    const float *p_Rmat  /* i  : pointer to real-space rotation matrix */
)
{
    int16_t b;
    float dv_0, dv_1, dv_2;
    float dv_r_0, dv_r_1, dv_r_2;
    float w;

    push_wmops( "rotateAziEle_DirAC" );

    for ( b = band1; b < band2; b++ )
    {

        /*Conversion spherical to cartesian coordinates*/
        w = cosf( ele[b] * PI_OVER_180 );
        dv_0 = w * cosf( azi[b] * PI_OVER_180 );
        dv_1 = w * sinf( azi[b] * PI_OVER_180 );
        dv_2 = sinf( ele[b] * PI_OVER_180 );

        dv_r_0 = p_Rmat[0] * dv_0 + p_Rmat[1] * dv_1 + p_Rmat[2] * dv_2;
        dv_r_1 = p_Rmat[3] * dv_0 + p_Rmat[4] * dv_1 + p_Rmat[5] * dv_2;
        dv_r_2 = p_Rmat[6] * dv_0 + p_Rmat[7] * dv_1 + p_Rmat[8] * dv_2;

        /*Conversion spherical to cartesian coordinates*/
        azi[b] = (int16_t) ( atan2f( dv_r_1, dv_r_0 ) * _180_OVER_PI );
        ele[b] = (int16_t) ( atan2f( dv_r_2, sqrtf( dv_r_0 * dv_r_0 + dv_r_1 * dv_r_1 ) ) * _180_OVER_PI );
    }

    pop_wmops();

    return;
}
Loading