Commit a3dba4a9 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'masa_sba_conv_cleanup_msan_errors_fix' into 'main'

MASA and SBA path functions conversion, cleanup and MSAN error fixes [allow regression]

See merge request !681
parents 1bfab1c8 cb13a222
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -808,6 +808,7 @@ float getTcxBandwidth_flt(
    return tcxBandwidth;
}

#ifndef IVAS_FLOAT_FIXED
/*-------------------------------------------------------------------*
 * getIgfPresent()
 *
@@ -905,7 +906,7 @@ int16_t getIgfPresent(

    return igfPresent;
}

#else
Word16 getIgfPresent_fx(
    const Word16 element_mode, /* i  : IVAS element mode           */
    const Word32 total_brate,  /* i  : total bitrate               */
@@ -1009,6 +1010,8 @@ Word16 getIgfPresent_fx(

    return igfPresent;
}
#endif

/*-------------------------------------------------------------------*
 * getCnaPresent()
 *
+8 −1
Original line number Diff line number Diff line
@@ -1263,7 +1263,7 @@ enum
#endif
#define BITS_MASA2TOTTAL_DCT0                   6
#define STEP_M2T                                0.1f
#define STEP_M2T_FX                             214748364
#define STEP_M2T_FX                             214748365
#define MASA_HEADER_BITS                        2
#define MASA_SUBFRAME_BITS                      1
#define MASA_LOWBITRATE_MODE_BITS               1
@@ -1648,6 +1648,13 @@ typedef enum
#define LFE_PLC_LENANA                          LFE_PLC_BUFLEN
#define LFE_PLC_FDEL                            300

/*----------------------------------------------------------------------------------*
 * HO Dirac Constants
 *----------------------------------------------------------------------------------*/
#define HODIRAC_BETA                            (214748368)                 /* 0.2f in Q30 */
#define HODIRAC_FAC1                            (951579008)                 /* 1.772454f in Q29 */
#define HODIRAC_FAC2                            (549393984)                 /* 1.023326f in Q29 */
#define HODIRAC_FAC3                            (317192992)                 /* 0.590818f in Q29 */

/*----------------------------------------------------------------------------------*
 * Amplitude Panning (EFAP, VBAP) constants
+371 −0

File changed.

Preview size limit exceeded, changes collapsed.

+37 −21
Original line number Diff line number Diff line
@@ -70,9 +70,11 @@ void stereo_dmx_evs_enc(
);

/*! r: number of channels to be analysed */
#ifndef IVAS_FLOAT_FIXED
int16_t getNumChanAnalysis(
    Encoder_Struct *st_ivas                                     /* i  : IVAS encoder structure                  */
);
#endif

void copy_encoder_config(
    Encoder_Struct *st_ivas,                                    /* i  : IVAS encoder structure                  */
@@ -2318,7 +2320,7 @@ int16_t stereo_dft_band_config(
    const int16_t NFFT,                                         /* i  : analysis/synthesis window length        */
    const int16_t enc_dec                                       /* i  : flag to indicate enc vs dec             */
);

#ifndef IVAS_FLOAT_FIXED
void stereo_td_itd(
    ITD_DATA *hITD,                                             /* i/o: ITD data structure                      */
    float input_mem_itd[CPE_CHANNELS][STEREO_DFT_OVL_MAX],      /* o  : ITD memory (only used in DFT Stereo)    */
@@ -2328,6 +2330,7 @@ void stereo_td_itd(
    const int16_t input_frame,                                  /* i  : input frame length                      */
    float *input_mem[CPE_CHANNELS]                              /* i/o: input buffer memory                     */
);
#endif

void stereo_dft_dmx_out_reset(
    STEREO_DFT_DMX_DATA_HANDLE hStereoDftDmx                    /* i/o: DFT stereo DMX decoder                  */
@@ -2538,8 +2541,8 @@ void stereo_tca_dec(

void stereo_tca_dec_fx(
  CPE_DEC_HANDLE hCPE,                                        /* i/o: CPE decoder structure					 */
  Word32 *synth[CPE_CHANNELS],                                 /* i/o: output synth                    */
  const Word16 output_frame                                  /* i  : length of a frame per channel   */
  Word32 *synth[CPE_CHANNELS],                                 /* i/o: output synth                    qsynth*/
  const Word16 output_frame                                  /* i  : length of a frame per channel		   Q0*/
);

void stereo_tca_scale_R_channel(
@@ -2550,8 +2553,8 @@ void stereo_tca_scale_R_channel(

void stereo_tca_scale_R_channel_fx(
    CPE_DEC_HANDLE hCPE,      /* i/o: CPE decoder structure				 */
  Word32 *output_fx,         /* i/o: output synthesis, R channel */
  const Word16 output_frame /* i  : frame length                */
    Word32 *output_fx,        /* i/o: output synthesis, R channel	q_out*/
    const Word16 output_frame /* i  : frame length					   Q0*/
);

void adjustTargetSignal(
@@ -2633,13 +2636,15 @@ int16_t select_stereo_mode(
    const IVAS_FORMAT ivas_format                               /* i  : IVAS format                                     */
);

#ifndef IVAS_FLOAT_FIXED
void stereo_classifier_init(
    STEREO_CLASSIF_HANDLE hStereoClassif                        /* i/o: stereo classifier structure                     */
);

#else
void stereo_classifier_init_fx(
  STEREO_CLASSIF_HANDLE hStereoClassif                        /* i/o: stereo classifier structure                     */
);
#endif

void stereo_classifier_features(
    STEREO_CLASSIF_HANDLE hStereoClassif,                       /* i/o: stereo classifier structure                     */
@@ -2888,6 +2893,7 @@ void tdm_bit_alloc(
    const int16_t tdm_inst_ratio_idx                            /* i  : instantaneous correlation ratio index   */
);

#ifndef IVAS_FLOAT_FIXED
void td_stereo_param_updt(
    const float lsp_old_PCh[],                                  /* i  : primary channel old LSPs                */
    const float lsf_old_PCh[],                                  /* i  : primary channel old LSFs                */
@@ -2898,6 +2904,7 @@ void td_stereo_param_updt(
    const int16_t flag_ACELP16k,                                /* i  : ACELP@16kHz flag                        */
    const int16_t tdm_use_IAWB_Ave_lpc                          /* i  : flag to indicate the usage of mean inactive LP coefficients */
);
#endif

void gsc_enc(
    Encoder_State *st,                                          /* i/o: State structure                         */
@@ -2998,19 +3005,7 @@ void tdm_SCh_lsf_reuse_fx(
    const Word16 lsf_wgts_fx[M],                                /* i  : LSF weights                             */
    Word16 *beta_index                                          /* i/o: quantization index                      */
);
#endif


void tdm_SCh_lsf_reuse_ivas_fx(
    const Word16 enc_dec,       /* i  : encoder/decoder flag                */
    const Word32 element_brate, /* i  : element bitrate                     */
    Word16 lsf_new[M],            /* i/o: LSFs at the end of the frame        */
    Word16 lsp_new[M],            /* i/o: LSPs at the end of the frame        */
    const Word16 tdm_lsfQ_PCh[M], /* i  : primary channel LSFs (log2(2.56))   */
    const Word16 lsf_wgts[M],     /* i  : LSF weights Q15?                    */
    Word16 *beta_index          /* i/o: quantization index                  */
);

#else
void tdm_SCh_lsf_reuse(
    const int16_t enc_dec,                                      /* i  : encoder/decoder flag                    */
    const int32_t element_brate,                                /* i  : element bitrate                         */
@@ -3020,6 +3015,7 @@ void tdm_SCh_lsf_reuse(
    const float lsf_wgts[M],                                    /* i  : LSF weights                             */
    int16_t *beta_index                                         /* i/o: quantization index                      */
);
#endif

void first_VQstages(
    const float *const *cb,
@@ -5141,6 +5137,26 @@ void ivas_dirac_dec_get_response_fx(
    Word16 Q_out);
#endif


#ifdef IVAS_FLOAT_FIXED
void calculate_hodirac_sector_parameters_fx(
  DIRAC_ENC_HANDLE hDirAC,                                          /* i  : DirAC handle                                  */
  Word32 RealBuffer_fx[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], /* i  : signal vector (L+1)^2 x N_bins, real part     */
  Word32 ImagBuffer_fx[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], /* i  : signal vector, imaginary part                 */
  Word16 Qfac,                                                      /* i  : Q-factor of signal vector                     */
  const Word32 beta_fx,                                             /* i  : forgetting factor for average filtering, Q30  */
  const Word16 *band_grouping,                                      /* i  : indices of band groups                        */
  const Word16 N_bands,                                             /* i  : number of bands (groups)                      */
  const Word16 enc_param_start_band,                                /* i  : first band to process                         */
  Word32 *azi_fx,                                                   /* o  : array of sector azimuth angles, flat     Q23  */
  Word32 *ele_fx,                                                   /* o  : array of sector elevation angles, flat   Q23  */
  Word32 *diff_fx,                                                  /* o  : array of sector diffuseness values, flat      */
  Word16 *diff_exp,                                                 /* o  : array of sector diffuseness exponents, flat   */
  Word32 *ene_fx,                                                   /* o  : array of sector energy values, flat           */
  Word16 *ene_exp                                                   /* o  : array of sector energy exponents, flat        */
);
#endif

void calculate_hodirac_sector_parameters(
    DIRAC_ENC_HANDLE hDirAC,
    float RealBuffer[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX],/* i : signal vector (L+1)^2 x N_bins, real part       */
+6 −0
Original line number Diff line number Diff line
@@ -3461,4 +3461,10 @@ void stereo_dmx_evs_close_encoder_fx(
    STEREO_DMX_EVS_ENC_HANDLE *hStereoDmxEVS /* i/o: Stereo downmix for EVS encoder handle   */
);

void ivas_omasa_encode_masa_to_total_fx(
    Word32 masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* Q30 */
    BSTR_ENC_HANDLE hMetaData,
    const Word16 low_bitrate_mode,
    const Word16 nbands,
    const Word16 nblocks );
#endif
Loading