Commit a8418e70 authored by norvell's avatar norvell
Browse files

Merge with main

parents 9d5a1dc4 10736414
Loading
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -90,18 +90,10 @@ void fill_spectrum(
    const int16_t element_mode         /* i  : element mode                                          */
)
{
#ifdef FIX_I178_HQ_BUFFER_OVERRUN
    float CodeBook[L_SPEC48k_EXT];
#else
    float CodeBook[FREQ_LENGTH];
#endif
    int16_t cb_size = 0;
    int16_t last_sfm;
#ifdef FIX_I178_HQ_BUFFER_OVERRUN
    float CodeBook_mod[L_SPEC48k_EXT];
#else
    float CodeBook_mod[FREQ_LENGTH];
#endif
    float norm_adj[NB_SFM];
    int16_t high_sfm = 23;
    int16_t flag_32K_env_hangover;
+0 −4
Original line number Diff line number Diff line
@@ -1319,11 +1319,7 @@ typedef enum
#define PANNING_ELE_RESOLUTION                  5

#define EFAP_MAX_CHAN_NUM                       5                           /* Maximum number of channels that constitute a polygon, 4 or 5 */
#ifdef ALLRAD_OPTIM
#define EFAP_MAX_POLY_SET                       50                          /* Upper bound on number of polygons; with a Speaker setup of 16.0, we obtain 44 polygons/triangles in the matlab implementation. */
#else
#define EFAP_MAX_POLY_SET                       70                          /* Upper bound on number of polygons; with a Speaker setup of 26.0, we obtain 54 polygons/triangles in the matlab implementation. */
#endif

#define EFAP_MODE_EFAP                          0                           /* EFAP Panning */
#define EFAP_MODE_EFIP                          1                           /* EFIP Panning */
+4 −37
Original line number Diff line number Diff line
@@ -169,36 +169,22 @@ void ivas_spar_covar_smooth_enc_close(

static void ivas_compute_smooth_cov(
    ivas_cov_smooth_state_t *hCovState,
#ifndef SBA_SPAR_HARM
    ivas_cov_smooth_in_buf_t *pIn_buf,
#endif
    ivas_filterbank_t *pFb,
    float *pCov_buf[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH],
    float *pPrior_cov_buf[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH],
    const float fac,
    const int16_t start_band,
    const int16_t end_band
#ifdef SBA_SPAR_HARM
    ,
    const int16_t end_band,
    const int16_t num_ch,
    const int16_t transient_det
#endif
)
    const int16_t transient_det )
{
    int16_t i, j, k;
    int16_t prev_idx = hCovState->prior_bank_idx;
#ifndef SBA_SPAR_HARM
    int16_t num_ch = pIn_buf->num_ch;
#endif
    float factor = 0;

    assert( end_band <= pFb->filterbank_num_bands );

#ifdef SBA_SPAR_HARM
    if ( prev_idx == -1 || transient_det == 1 )
#else
    if ( prev_idx == -1 || pIn_buf->reset_cov == 1 )
#endif
    {
        for ( i = 0; i < num_ch; i++ )
        {
@@ -243,42 +229,23 @@ static void ivas_compute_smooth_cov(

void ivas_cov_smooth_process(
    ivas_cov_smooth_state_t *hCovState, /* i/o: Covariance state handle */
#ifdef SBA_SPAR_HARM
    float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH],
#else
    ivas_cov_smooth_in_buf_t *pIn_buf,
#endif
    ivas_filterbank_t *pFb, /* i/o: FB handle               */
    const int16_t start_band,
    const int16_t end_band
#ifdef SBA_SPAR_HARM
    ,
    const int16_t end_band,
    const int16_t num_ch,
    const int16_t transient_det
#endif
)
    const int16_t transient_det )
{
    int16_t i, j;
#ifndef SBA_SPAR_HARM
    int16_t num_ch = pIn_buf->num_ch;
#endif
    int16_t num_bands = end_band - start_band;

#ifdef SBA_SPAR_HARM
    ivas_compute_smooth_cov( hCovState, pFb, cov_real, hCovState->pPrior_cov_real, 1e-20f, start_band, end_band, num_ch, transient_det );
#else
    ivas_compute_smooth_cov( hCovState, pIn_buf, pFb, pIn_buf->cov_real, hCovState->pPrior_cov_real, 1e-20f, start_band, end_band );
#endif

    for ( i = 0; i < num_ch; i++ )
    {
        for ( j = 0; j < num_ch; j++ )
        {
#ifdef SBA_SPAR_HARM
            mvr2r( &cov_real[i][j][start_band], &hCovState->pPrior_cov_real[i][j][start_band], num_bands );
#else
            mvr2r( &pIn_buf->cov_real[i][j][start_band], &hCovState->pPrior_cov_real[i][j][start_band], num_bands );
#endif
        }
    }

+0 −42
Original line number Diff line number Diff line
@@ -125,14 +125,12 @@ void ivas_mct_enc_close(
    MCT_ENC_HANDLE hMCT                                         /* i/o: MCT encoder structure                   */
);

#ifdef CORECODER_BITRATE_SWITCHING
ivas_error ivas_corecoder_enc_reconfig(
    Encoder_Struct *st_ivas,                                    /* i/o: IVAS encoder structure                  */
    const int16_t nSCE_old,                                     /* i  : number of SCEs in previous frame        */
    const int16_t nCPE_old,                                     /* i  : number of CPEs in previous frame        */
    const int16_t nchan_transport_old                           /* i  : number of TCs in previous frame         */
);
#endif

ivas_error ivas_sce_enc(
    Encoder_Struct *st_ivas,                                    /* i/o: IVAS encoder structure                  */
@@ -206,9 +204,7 @@ ivas_error pre_proc_ivas(
    Encoder_State *st,                                          /* i/o: encoder state structure                 */
    const int16_t last_element_mode,                            /* i  : last element mode                       */
    const int32_t element_brate,                                /* i  : element bitrate                         */
#ifdef CORECODER_BITRATE_SWITCHING
    const int32_t last_element_brate,                           /* i  : last element bitrate                    */
#endif
    const int16_t input_frame,                                  /* i  : frame length                            */
    float old_inp_12k8[],                                       /* i/o: buffer of old input signal              */
    float old_inp_16k[],                                        /* i/o: buffer of old input signal @ 16kHz      */
@@ -333,7 +329,6 @@ void ivas_mct_dec_close(
    MCT_DEC_HANDLE *hMCT                                        /* i/o: MCT decoder structure                   */
);

#ifdef CORECODER_BITRATE_SWITCHING
ivas_error ivas_corecoder_dec_reconfig(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                  */
    const int16_t nSCE_old,                                     /* i  : number of SCEs in previous frame        */
@@ -346,7 +341,6 @@ ivas_error ivas_hp20_dec_reconfig(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                  */
    const int16_t nchan_hp20_old                                /* i  : number of HP20 filters in previous frame*/
);
#endif

ivas_error ivas_sce_dec(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                  */
@@ -418,9 +412,7 @@ ivas_error ivas_core_enc(
    float enerBuffer[CPE_CHANNELS][CLDFB_NO_CHANNELS_MAX],                   /* i  : energy buffer                           */
    float fft_buff[CPE_CHANNELS][2 * L_FFT],                                 /* i  : FFT buffer                              */
    const int16_t tdm_SM_flag,                                               /* i  : channel combination scheme flag                 */
#ifdef CORECODER_BITRATE_SWITCHING
    const int16_t ivas_format,                                               /* i  : IVAS format                            */
#endif
    const int16_t flag_16k_smc                                               /* i  : flag to indicate if the OL SMC is run at 16 kHz */
);

@@ -2169,12 +2161,8 @@ void stereo_decoder_tcx(
    const int16_t core_l,                                       /* i  : core for left channel (TCX20/TCX10)     */
    const int16_t core_r,                                       /* i  : core for right channel (TCX20/TCX10)    */
    const int16_t igf,                                          /* i  : flag for IGF activity                   */
#ifdef FIX_TCX10_STEREO_PROC
    const int16_t L_frameTCX_l,                                 /* i  : TCX frame length of left channel        */
    const int16_t L_frameTCX_r,                                 /* i  : TCX frame length of right channel       */
#else
    const int16_t L_frame,                                      /* i  : TCX frame length                        */
#endif
    const int16_t mct_on,                                       /* i  : flag mct block (1) or stereo (0)        */
    const int16_t last_core_l,                                  /* i  : last core for left channel              */
    const int16_t last_core_r,                                  /* i  : last core for right channel             */
@@ -3030,10 +3018,8 @@ void ivas_dirac_param_est_enc(
    float **pp_fr_real,
    float **pp_fr_imag,
    const int16_t input_frame 
#ifdef SBA_HOA_HBR_IMPROV
	,
    const SBA_MODE sba_mode                                    
#endif
 );

/*----------------------------------------------------------------------------------*
@@ -3093,13 +3079,11 @@ int16_t ivas_sba_get_nchan_metadata(
    const int16_t sba_order                                     /* i  : Ambisonic (SBA) order                   */
);

#ifdef SBA_HOA_HBR_IMPROV
/*! r: flag indicating to code SPAR HOA MD for all bands */
int16_t ivas_sba_get_spar_hoa_md_flag(
    const int16_t sba_order,                                    /* i  : Ambisonic (SBA) order                   */
    const int32_t ivas_total_brate                              /* i  : IVAS total bitrate                      */
);
#endif

void ivas_sba_zero_vert_comp(
    float sba_data[][L_FRAME48k],                               /* i/o: SBA data frame                          */
@@ -3919,19 +3903,11 @@ void ivas_spar_md_enc_close(
ivas_error ivas_spar_md_enc_process(
    ivas_spar_md_enc_state_t *hMdEnc,                           /* i/o: SPAR MD encoder handle                  */
    const ENCODER_CONFIG_HANDLE hEncoderConfig,                 /* i  : configuration structure                 */
#ifdef SBA_SPAR_HARM
    float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH],
    float *cov_dtx_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH],
#else
    ivas_spar_md_enc_in_buf_t *pIn_buf,
#endif
    BSTR_ENC_HANDLE hMetaData,                                  /* i/o: MetaData handle                         */
#ifdef SBA_SPAR_HARM
    int16_t dtx_vad,
    const int16_t nchan_inp,
#else
    const int16_t dtx_silence_mode,
#endif
    const int16_t sba_order                                     /* i  : Ambisonic (SBA) order                   */
);

@@ -3995,10 +3971,8 @@ ivas_error ivas_spar_md_dec_open(
    ivas_spar_md_dec_state_t **hMdDec_out,                      /* i/o: SPAR MD decoder handle                  */
    const DECODER_CONFIG_HANDLE hDecoderConfig,                 /* i  : configuration structure                 */
    const int16_t num_channels                                  /* i  : number of internal channels             */
#ifdef SBA_HOA_HBR_IMPROV
    ,
	const int16_t sba_order                                     /* i  : SBA order                               */
#endif
);

void ivas_spar_md_dec_close(
@@ -4071,24 +4045,16 @@ void ivas_spar_covar_enc_close(

void ivas_enc_cov_handler_process( 
    ivas_enc_cov_handler_state_t *hCovEnc,                      /* i/o: SPAR Covar. encoder handle              */
#ifdef SBA_SPAR_HARM
    float **ppIn_FR_real,
    float **ppIn_FR_imag,
    float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH],
    float *cov_dtx_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH],
#else
    ivas_enc_cov_handler_in_buf_t *pIn_buf, 
    float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH],
    float *cov_dtx_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH],
#endif
    ivas_filterbank_t *pFb,                                     /* i/o: FB handle                               */
    const int16_t start_band,
    const int16_t end_band 
#ifdef SBA_SPAR_HARM
   ,const int16_t nchan_inp,
    const int16_t dtx_vad,
    const int16_t transient_det
#endif
);

ivas_error ivas_spar_covar_smooth_enc_open( 
@@ -4105,19 +4071,13 @@ void ivas_spar_covar_smooth_enc_close(

void ivas_cov_smooth_process( 
    ivas_cov_smooth_state_t *hCovState,                         /* i/o: Covariance state handle                 */
#ifdef SBA_SPAR_HARM
    float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH],
#else
    ivas_cov_smooth_in_buf_t *pIn_buf, 
#endif
    ivas_filterbank_t *pFb,                                     /* i/o: FB handle                               */
    const int16_t start_band,
    const int16_t end_band
#ifdef SBA_SPAR_HARM
    ,
    const int16_t num_ch,
    const int16_t transient_det
#endif
);

/* Transient detector module */
@@ -4846,10 +4806,8 @@ void computeReferencePower_enc(
    float *reference_power,                                     /* o  : Estimated power                                 */
    const int16_t enc_param_start_band,                         /* i  : first band to process                           */
    const int16_t num_freq_bands                                /* i  : Number of frequency bands                       */
#ifdef SBA_HOA_HBR_IMPROV
	,
    const SBA_MODE sba_mode                                     /* i  : SBA mode                                        */
#endif
);


+0 −2
Original line number Diff line number Diff line
@@ -281,7 +281,6 @@ int16_t ivas_sba_get_nchan_metadata(
    return ( nb_channels );
}

#ifdef SBA_HOA_HBR_IMPROV
/*-------------------------------------------------------------------*
 * ivas_sba_get_spar_hoa_md_flag()
 *
@@ -307,7 +306,6 @@ int16_t ivas_sba_get_spar_hoa_md_flag(

    return spar_hoa_md_flag;
}
#endif

/*-------------------------------------------------------------------*
 * ivas_sba_zero_vert_comp()
Loading