Commit e454fb3f authored by multrus's avatar multrus
Browse files

formatting

parent 0e22a1db
Loading
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -292,7 +292,6 @@ ivas_error ind_list_realloc(
}



/*-----------------------------------------------------------------------*
 * get_ivas_max_num_indices()
 *
+9 −15
Original line number Diff line number Diff line
@@ -594,17 +594,14 @@ void ivas_fb_mixer_get_windowed_fr(
 *
 * FB Mixer cross fading
 *-----------------------------------------------------------------------------------------*/
    void
    ivas_fb_mixer_cross_fading(
void ivas_fb_mixer_cross_fading(
    IVAS_FB_MIXER_HANDLE hFbMixer,
    float **ppOut_pcm,
    float *pMdft_out_old,
    float *pMdft_out_new,
    const int16_t ch,
        const int16_t frame_len
        ,
        const int16_t cf_offset
    )
    const int16_t frame_len,
    const int16_t cf_offset )
{
    int16_t k, fade_start_offset, fade_end_offset;

@@ -724,10 +721,7 @@ void ivas_fb_mixer_process(
            ivas_imdft( pOut_fr_re, pOut_fr_im, pMdft_out[hist], frame_len );
        }

        ivas_fb_mixer_cross_fading( hFbMixer, ppOut_pcm, pMdft_out[0], pMdft_out[1], ch, frame_len
                                    ,
                                    frame_len
        );
        ivas_fb_mixer_cross_fading( hFbMixer, ppOut_pcm, pMdft_out[0], pMdft_out[1], ch, frame_len, frame_len );
    }

    return;
+2 −4
Original line number Diff line number Diff line
@@ -896,10 +896,8 @@ void reconstruct_ism_ratios(
 *---------------------------------------------------------------*/

void ivas_omasa_modify_masa_energy_ratios(
    IVAS_QMETADATA_HANDLE hQMetaData /* i/o: q_metadata handle  */
    ,
    float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_MAXIMUM_CODING_SUBBANDS]
)
    IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle  */
    float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_MAXIMUM_CODING_SUBBANDS] )
{
    int16_t i, m, d, b;

+34 −47
Original line number Diff line number Diff line
@@ -3530,8 +3530,7 @@ void ivas_dirac_param_est_enc(
    const int16_t input_frame, 
    const IVAS_FORMAT ivas_format ,
    const int16_t hodirac_flag,
    const int16_t nchan_fb_in
    ,
    const int16_t nchan_fb_in,
    int16_t *mono_frame_count,
    int16_t *dirac_mono_flag
 );
@@ -4221,8 +4220,8 @@ void FdCngDecodeDiracMDCTStereoSID(
 *----------------------------------------------------------------------------------*/

ivas_error ivas_spar_enc_open(
    Encoder_Struct *st_ivas                                     /* i/o: IVAS encoder handle                     */
   ,const int16_t spar_reconfig_flag                            /* i  : SPAR reconfiguration flag               */
    Encoder_Struct *st_ivas,                                    /* i/o: IVAS encoder handle                     */
    const int16_t spar_reconfig_flag                            /* i  : SPAR reconfiguration flag               */
);

void ivas_spar_enc_close(
@@ -4301,8 +4300,7 @@ void ivas_sba_mix_matrix_determiner(
#endif
    const int16_t bfi,                                          /* i  : BFI flag                                */
    const int16_t nchan_remapped,                               /* i  : num channels after remapping of TCs     */
    const int16_t output_frame                                  /* i  : output frame length                     */
    ,
    const int16_t output_frame,                                 /* i  : output frame length                     */
    const int16_t num_md_sub_frames                             /* i  : number of subframes in mixing matrix    */
);

@@ -4549,10 +4547,8 @@ ivas_error ivas_spar_md_enc_process(
    const int16_t dtx_vad,
    const int16_t nchan_inp,
    const int16_t sba_order,                                                    /* i  : Ambisonic (SBA) order                   */
    float *prior_mixer[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH]                                  /* i  : prior mixer_matrix     */
     ,
     const int16_t dyn_active_w_flag            /* i : flag to indicate dynamic active W*/
    ,
    float *prior_mixer[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH], /* i  : prior mixer_matrix                      */
    const int16_t dyn_active_w_flag,                                            /* i : flag to indicate dynamic active W        */
    const int16_t dirac_mono_flag                                               /* i : flag to indicate mono only mode in SBA   */
);

@@ -4571,8 +4567,7 @@ void ivas_compute_spar_params(
    ivas_spar_md_com_cfg *hSparCfg,
    ivas_spar_md_t *hSparMd,
    float *pWscale,
    const int16_t from_dirac 
    ,
    const int16_t from_dirac,
    const int16_t dyn_active_w_flag
);

@@ -4596,8 +4591,7 @@ void ivas_calc_c_p_coeffs(
    const int16_t num_dmx,
    const int16_t band_idx,
    const int16_t dtx_vad,
    const int16_t compute_p_flag
    ,
    const int16_t compute_p_flag,
    const int16_t dyn_active_w_flag
);

@@ -4613,19 +4607,16 @@ void ivas_get_spar_md_from_dirac(
    const int16_t end_band,
    const int16_t order,
    const int16_t dtx_vad,
    float Wscale_d[IVAS_MAX_NUM_BANDS]
	,
    float Wscale_d[IVAS_MAX_NUM_BANDS],
    const uint8_t useLowerRes,
    const int16_t active_w_vlbr
    ,
    const int16_t active_w_vlbr,
    const int16_t  dyn_active_w_flag
);

/*! r: number of MD subframes */
int16_t ivas_get_spar_dec_md_num_subframes(
    const int16_t sba_order,                                    /* i  : Ambisonic (SBA) order                   */
    const int32_t ivas_total_brate                              /* i  : IVAS total bitrate                      */
    ,
    const int32_t ivas_total_brate,                             /* i  : IVAS total bitrate                      */
    const int32_t ivas_last_active_brate                        /* i  : IVAS last active bitrate                */
);

@@ -4644,8 +4635,7 @@ ivas_error ivas_spar_md_dec_open(
    const DECODER_CONFIG_HANDLE hDecoderConfig,                 /* i  : configuration structure                 */
    const int16_t num_channels,                                 /* i  : number of internal channels             */
    const int16_t sba_order,                                    /* i  : SBA order                               */
    const int16_t sid_format                                    /* i  : SID format                              */
    ,
    const int16_t sid_format,                                   /* i  : SID format                              */
    const int32_t last_active_ivas_total_brate                  /* i  : IVAS last active bitrate                */
);

@@ -4682,8 +4672,7 @@ void ivas_spar_to_dirac(
    ivas_spar_md_dec_state_t *hMdDec,                           /* i/o: SPAR MD decoder handle                  */
    const int16_t dtx_vad,                                      /* i  : DTX frame flag                          */
    const int16_t num_bands_out,                                /* i  : number of output bands                  */
    const int16_t bw					        /* i  : band joining factor                     */
    ,
    const int16_t bw,                                           /* i  : band joining factor                     */
    const int16_t dyn_active_w_flag                             /* i  : dynamic active W flag                   */
);

@@ -4743,8 +4732,7 @@ void ivas_enc_cov_handler_process(
    const int16_t nchan_inp,
    const int16_t dtx_vad,
    const int16_t transient_det[2],
    const int16_t HOA_md_ind[IVAS_SPAR_MAX_CH]
    ,
    const int16_t HOA_md_ind[IVAS_SPAR_MAX_CH],
    int16_t *res_ind,
    const int16_t *remix_order,
    int16_t *dyn_active_w_flag,
@@ -6177,8 +6165,7 @@ void ivas_omasa_decode_masa_to_total(
);

void ivas_omasa_modify_masa_energy_ratios(
    IVAS_QMETADATA_HANDLE hQMetaData                            /* i/o: q_metadata handle                       */
    ,
    IVAS_QMETADATA_HANDLE hQMetaData,                          /* i/o: q_metadata handle                       */
    float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_MAXIMUM_CODING_SUBBANDS]
);

+19 −45
Original line number Diff line number Diff line
@@ -77,18 +77,11 @@
 *------------------------------------------------------------------------------------------*/


static void ivas_get_pred_coeffs( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float ppPred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], float ppDM_Fv_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], const int16_t in_chans, const int16_t start_band, const int16_t end_band, const int16_t active_w, const int16_t active_w_vlbr, const int16_t dtx_vad, const int16_t from_dirac
                                  ,
                                  const int16_t dyn_active_w_flag,
                                  const int16_t res_ind
);
static void ivas_get_pred_coeffs( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float ppPred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], float ppDM_Fv_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], const int16_t in_chans, const int16_t start_band, const int16_t end_band, const int16_t active_w, const int16_t active_w_vlbr, const int16_t dtx_vad, const int16_t from_dirac, const int16_t dyn_active_w_flag, const int16_t res_ind );

static void ivas_reorder_array( float in_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS], const int16_t in_chans, const int16_t order[IVAS_SPAR_MAX_CH], float ***mixer_mat, const int16_t start_band, const int16_t end_band );

static void ivas_get_Wscaling_factor( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float pred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], float ***mixer_mat, const int16_t start_band, const int16_t end_band, const int16_t dtx_vad, const int16_t num_ch, const int16_t *pNum_dmx, const int16_t bands_bw, const int16_t active_w, const int16_t active_w_vlbr, float *pWscale
                                      ,
                                      const int16_t dyn_active_w_flag
);
static void ivas_get_Wscaling_factor( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float pred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS], float ***mixer_mat, const int16_t start_band, const int16_t end_band, const int16_t dtx_vad, const int16_t num_ch, const int16_t *pNum_dmx, const int16_t bands_bw, const int16_t active_w, const int16_t active_w_vlbr, float *pWscale, const int16_t dyn_active_w_flag );

static void ivas_calc_post_pred_per_band( float *pppCov_mat_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], float ***mixer_mat, const int16_t num_ch, const int16_t num_dmx, const int16_t band_idx, float postpred_cov_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH] );

@@ -469,11 +462,9 @@ static void ivas_get_pred_coeffs(
    const int16_t active_w,
    const int16_t active_w_vlbr,
    const int16_t dtx_vad,
    const int16_t from_dirac
    ,
    const int16_t from_dirac,
    const int16_t dyn_active_w_flag,
    const int16_t res_ind
)
    const int16_t res_ind )
{
    int16_t i, j, k, b;
    float abs_value;
@@ -687,10 +678,8 @@ static void ivas_get_Wscaling_factor(
    const int16_t bands_bw,
    const int16_t active_w,
    const int16_t active_w_vlbr,
    float *pWscale
    ,
    const int16_t dyn_active_w_flag
)
    float *pWscale,
    const int16_t dyn_active_w_flag )
{
    int16_t b, ch;
    float dm_f_local, abs_val;
@@ -1259,10 +1248,8 @@ void ivas_calc_c_p_coeffs(
    const int16_t num_dmx,
    const int16_t band_idx,
    const int16_t dtx_vad,
    const int16_t compute_p_flag
    ,
    const int16_t dyn_active_w_flag
)
    const int16_t compute_p_flag,
    const int16_t dyn_active_w_flag )
{
    int16_t i, j;
    float postpred_cov_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH];
@@ -1549,31 +1536,25 @@ void ivas_compute_spar_params(
    ivas_spar_md_com_cfg *hSparCfg,
    ivas_spar_md_t *hSparMd,
    float *pWscale,
    const int16_t from_dirac
    ,
    const int16_t dyn_active_w_flag
)
    const int16_t from_dirac,
    const int16_t dyn_active_w_flag )
{
    float pred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS];
    int16_t b, i, ndm;

    ivas_get_pred_coeffs( cov_real, pred_coeffs_re, dm_fv_re, num_ch, start_band, end_band, active_w,
                          active_w_vlbr,
                          dtx_vad, from_dirac
                          ,
                          dtx_vad, from_dirac,
                          dyn_active_w_flag,
                          hSparMd->res_ind
    );
                          hSparMd->res_ind );

    ivas_create_fullr_dmx_mat( pred_coeffs_re, dm_fv_re, mixer_mat, num_ch, start_band, end_band, active_w, hSparCfg );

    ivas_get_Wscaling_factor( cov_real, pred_coeffs_re, mixer_mat, start_band, end_band, dtx_vad, num_ch,
                              hSparCfg->num_dmx_chans_per_band, bands_bw, active_w,
                              active_w_vlbr,
                              pWscale
                              ,
                              dyn_active_w_flag
    );
                              pWscale,
                              dyn_active_w_flag );

    for ( b = start_band; b < end_band; b++ )
    {
@@ -1595,10 +1576,7 @@ void ivas_compute_spar_params(

        if ( ndm != num_ch )
        {
            ivas_calc_c_p_coeffs( hSparMd, cov_real, i_ts, mixer_mat, num_ch, ndm, b, dtx_vad, 1
                                  ,
                                  dyn_active_w_flag
            );
            ivas_calc_c_p_coeffs( hSparMd, cov_real, i_ts, mixer_mat, num_ch, ndm, b, dtx_vad, 1, dyn_active_w_flag );

#ifdef SPAR_HOA_DBG
            /* if (b == 0) */
@@ -1648,10 +1626,8 @@ void ivas_get_spar_md_from_dirac(
    const int16_t dtx_vad,
    float Wscale_d[IVAS_MAX_NUM_BANDS],
    const uint8_t useLowerRes,
    const int16_t active_w_vlbr
    ,
    const int16_t dyn_active_w_flag
)
    const int16_t active_w_vlbr,
    const int16_t dyn_active_w_flag )
{
    int16_t num_ch, band, i, j;
    int16_t block, ch;
@@ -1924,10 +1900,8 @@ void ivas_get_spar_md_from_dirac(
                                  num_ch, 1,
                                  active_w,
                                  active_w_vlbr,
                                  hSpar_md_cfg, hSpar_md, Wscale, 1
                                  ,
                                  dyn_active_w_flag
        );
                                  hSpar_md_cfg, hSpar_md, Wscale, 1,
                                  dyn_active_w_flag );

        if ( mixer_mat != NULL )
        {
Loading