Commit 37712a04 authored by Manuel Jander's avatar Manuel Jander
Browse files

Resolve merge conflicts.

parent 76303f92
Loading
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -2665,6 +2665,12 @@ void ms_inv_mask_processing_fx(
    const Word32 x_1_fx[],                   /* i  : spectrum 2                              */
    Word32 x_inv_0_fx[],                     /* o  : inverse spectrum 1                      */
    Word32 x_inv_1_fx[],                     /* o  : inverse spectrum 2                      */
#ifdef FIX_1464_NO_SINGLE_SPEC_Q
    Word16 *x_0_e,
    Word16 *x_1_e,
    Word16 *x_inv_0_e,
    Word16 *x_inv_1_e,
#endif
    Word16 maxSfb                            /* i  : number of stereo frequency bands        */
);

@@ -2675,6 +2681,10 @@ void ms_processing_fx(
    const Word16 iSubframe,                  /* i  : subframe number                 */
    Word32 x_0_fx[],                         /* i/o: spectrum 1                      */
    Word32 x_1_fx[],                         /* i/o: spectrum 1                      */
#ifdef FIX_1464_NO_SINGLE_SPEC_Q
    Word16 *x_0_e,
    Word16 *x_1_e,
#endif
    Word16 maxSfb                            /* i  : number of stereo frequency bands*/
);

@@ -2682,6 +2692,10 @@ void convertToMS_fx(
    const Word16 L_frame, /* i  : frame length                    */
    Word32 x0[],          /* i/o: mid/left channel coefficients   */
    Word32 x1[],          /* i/o: side/right channel coefficients */
#ifdef FIX_1464_NO_SINGLE_SPEC_Q
    Word16 *x0_e,
    Word16 *x1_e,
#endif
    const Word32 norm_fac /* i  : normalization factor            */
);

@@ -2695,7 +2709,12 @@ void IGFEncStereoEncoder_fx(
    const IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i  : IGF handle                              */
    const Word32 *mdctSpectrumL_fx,        /* i  : left spectrum                           */
    const Word32 *mdctSpectrumR_fx,        /* i  : right spectrum                          */
#ifdef FIX_1464_NO_SINGLE_SPEC_Q
    const Word16 mdctSpectrumL_e,
    const Word16 mdctSpectrumR_e,
#else
    Word16 q_mdctSpectrum,
#endif
    Word16 *msMask,                /* i/o: MS mask                                 */
    Word16 *igfStereoMode,         /* o  : IGF stereo mode                         */
    const Word16 mdct_stereo_mode, /* i  : MDCT stereo mode                        */
@@ -2747,6 +2766,11 @@ void apply_MCT_enc_fx(
    Word32 *mdst_spectrum[MCT_MAX_CHANNELS][NB_DIV],     /* i/o: MDST spectrum                       */
    Word32 *inv_spectrum[MCT_MAX_CHANNELS][NB_DIV],      /* i/o: inverse spectrum                    */
    Word32 *inv_mdst_spectrum[MCT_MAX_CHANNELS][NB_DIV], /* i/o: inverse MDST spectrum               */
#ifdef FIX_1464_NO_SINGLE_SPEC_Q
    Word16 mdst_spectrum_e[MCT_MAX_CHANNELS][NB_DIV],     /* i/o: MDST spectrum exponent             Q0*/
    Word16 inv_spectrum_e[MCT_MAX_CHANNELS][NB_DIV],      /* i/o: inv spectrum exponent             Q0*/
    Word16 inv_mdst_spectrum_e[MCT_MAX_CHANNELS][NB_DIV], /* i/o: inverse MDST spectrum exponent     Q0*/
#endif
    const Word16 nchan                                   /* i  : number of channels                  */
);

@@ -3349,6 +3373,9 @@ void mctStereoIGF_enc_fx(
    Word32 *powerSpecMsInv_fx[MCT_MAX_CHANNELS][NB_DIV], /* i  : same as powerSpec_fx but for inverse spect.*/
    Word16 q_powerSpecMsInv[MCT_MAX_CHANNELS],           /* i  : Q for powSpecMsInv_fx                      */
    Word32 *inv_spectrum_fx[MCT_MAX_CHANNELS][NB_DIV],   /* i  : inverse spectrum                           */
#ifdef FIX_1464_NO_SINGLE_SPEC_Q
    Word16 q_inv_spectrum[MCT_MAX_CHANNELS][NB_DIV], /* i  : Q for inv_spectrum_fx                      */
#endif
    const Word16 sp_aud_decision0[MCT_MAX_CHANNELS]      /* i  : speech audio decision                      */
);

+3 −0
Original line number Diff line number Diff line
@@ -73,6 +73,9 @@

#define FIX_1379_MASA_ANGLE_ROUND

#define FIX_1464_SQ_GAIN_PRECISION
#define FIX_1464_NO_SINGLE_SPEC_Q

/* Note: each compile switch (FIX_1101_...) is independent from the other ones */
//#define OPT_STEREO_32KBPS_V1                    /* Optimization made in stereo decoding path for 32kbps decoding */
#define OPT_AVOID_STATE_BUF_RESCALE             /* Optimization made to avoid rescale of synth state buffer */
+36 −13
Original line number Diff line number Diff line
@@ -3306,6 +3306,7 @@ void synthesise_fb_high_band_fx(
#endif
);
#ifndef REMOVE_EVS_DUPLICATES
void prep_tbe_exc_fx(
    const Word16 L_frame_fx, /* i : length of the frame */
#ifdef ADD_IVAS_TBE_CODE
@@ -3333,6 +3334,7 @@ void prep_tbe_exc_fx(
    const Word16 tdm_LRTD_flag /* i  : LRTD stereo mode flag       */
#endif
);
#endif
void prep_tbe_exc_ivas_fx(
    const Word16 L_frame_fx, /* i : length of the frame */
@@ -4876,6 +4878,7 @@ Word16 BITS_ALLOC_config_acelp(
    const Word16 narrowband,
    const Word16 nb_subfr );
#ifndef REMOVE_EVS_DUPLICATES
ivas_error config_acelp1(
    const Word16 enc_dec,                  /* i  : encoder/decoder flag            */
    const Word32 total_brate,              /* i  : total bitrate                   */
@@ -4903,7 +4906,7 @@ ivas_error config_acelp1(
    const Word16 tdm_LRTD_flag,            /* i  : LRTD stereo mode flag           */
    const Word16 GSC_IVAS_mode             /* i  : GSC IVAS mode                   */
);
#endif
Word16 set_ACELP_flag(
    const Word16 element_mode,  /* i  : element mode                */
    const Word32 element_brate, /* i  : element bitrate             */
@@ -5850,6 +5853,7 @@ void tcx_ltp_post_fx32(
    Word32 *tcx_buf,     /* sig_q */
    Word16 sig_q );
#ifndef REMOVE_EVS_DUPLICATES
// gs_inact_switching_fx.c
void Inac_swtch_ematch_fx(
    Word16 exc2[],              /* i/o: CELP/GSC excitation buffer       Q_exc*/
@@ -5863,6 +5867,7 @@ void Inac_swtch_ematch_fx(
    const short last_core,      /* i  : Last core used                        */
    const short last_codec_mode /* i  : Last codec mode                       */
);
#endif
void Inac_switch_ematch_ivas_fx(
    Word16 exc2[],                         /* i/o: CELP/GSC excitation buffer       Q_exc*/
@@ -6109,6 +6114,7 @@ void td_bwe_dec_init_fx(
    const Word32 output_Fs     /* i  : output sampling rate    */
);
#ifndef REMOVE_EVS_DUPLICATES
// lsf_dec_fx.c
void lsf_dec_fx(
    Decoder_State *st_fx,          /* i/o: State structure                               */
@@ -6122,7 +6128,7 @@ void lsf_dec_fx(
    ,
    const Word16 tdm_lsfQ_PCh[M] /* i  : Q LSFs for primary channel          Qx*/
);
#endif
void lsf_dec_ivas_fx(
    Decoder_State *st_fx,          /* i/o: State structure                               */
    const Word16 tc_subfr,         /* i  : TC subframe index                           Q0*/
@@ -6278,6 +6284,7 @@ void lsf_mid_dec_fx(
    Word16 lsp_mid[]      /* o  : quantized LSPs					Q15*/
);
#ifndef REMOVE_EVS_DUPLICATES
// cng_dec_fx.c
void CNG_dec_fx(
    Decoder_State *st_fx,           /* i/o: State structure                          */
@@ -6288,7 +6295,7 @@ void CNG_dec_fx(
    Word16 *allow_cn_step,          /* o  : allow CN step                       Q0   */
    Word16 *sid_bw,                 /* i  : 0-NB/WB, 1-SWB SID                  Q0   */
    Word32 *q_env );
#endif
void CNG_dec_ivas_fx(
    Decoder_State *st_fx,           /* i/o: State structure                          */
    const Word16 last_element_mode, /* i  : last element mode                    Q0   */
@@ -6717,6 +6724,7 @@ void nb_post_filt_fx(
    const Word16 disable_hpf /* i  : flag to diabled HPF                     */
);
#ifndef REMOVE_EVS_DUPLICATES
void formant_post_filt_fx(
    PFSTAT_HANDLE hPFstat, /* i : core decoder parameters */
    Word16 *synth_in,      /* i  : 12k8 synthesis                    */
@@ -6727,7 +6735,7 @@ void formant_post_filt_fx(
    Word32 rate,          /* (i) : bit-rate */
    const Word16 off_flag /* i  : off flag                        */
);
#endif
void formant_post_filt_ivas_fx(
    PFSTAT_HANDLE hPFstat, /* i : core decoder parameters */
    Word16 *synth_in,      /* i  : 12k8 synthesis                    */
@@ -6902,6 +6910,7 @@ void PulseResynchronization_fx(
    Word32 /*float*/ const pitchEnd        /*i   Q16*/
);
#ifndef REMOVE_EVS_DUPLICATES
// gs_dec_fx.c
void decod_audio_fx(
    Decoder_State *st_fx,  /* i/o: decoder static memory                     */
@@ -6916,7 +6925,7 @@ void decod_audio_fx(
    ,
    Word16 *gain_buf /*Q14*/
);
#endif
void decod_audio_ivas_fx(
    Decoder_State *st_fx,  /* i/o: decoder static memory						*/
    Word16 dct_epit[],     /* o  : GSC excitation in DCT domain              Qx*/
@@ -6935,6 +6944,7 @@ void decod_audio_ivas_fx(
    const Word16 tdm_Pri_pitch_buf[]   /* i  : primary channel pitch buffer              Q6*/
);
#ifndef REMOVE_EVS_DUPLICATES
void gsc_dec_fx(
    Decoder_State *st_fx,      /* i/o: State structure                                     */
    Word16 exc_dct_in[],       /* i/o: dct of pitch-only excitation / total excitation     Q_exc*/
@@ -6947,7 +6957,7 @@ void gsc_dec_fx(
    const Word16 *lsf_new,     /* i  : ISFs at the end of the frame                        Qx*/
    Word16 *exc_wo_nf,         /* o  : excitation (in f domain) without noisefill          Q_exc*/
    Word16 Q_exc );
#endif
void gsc_dec_ivas_fx(
    Decoder_State *st_fx,      /* i/o: State structure                                     */
    Word16 exc_dct_in[],       /* i/o: dct of pitch-only excitation / total excitation     Q_exc*/
@@ -7015,6 +7025,7 @@ void gain_dec_mless_fx(
    Word32 *norm_gain_code_fx /* o  : norm. gain of the codebook excitation  Q16*/
);
#ifndef REMOVE_EVS_DUPLICATES
void gain_dec_lbr_fx(
    Decoder_State *st_fx,      /* i/o: decoder state structure                                         */
    const Word16 coder_type,   /* i  : coding type                                                     */
@@ -7029,6 +7040,7 @@ void gain_dec_lbr_fx(
    ,
    const Word16 L_subfr /* i  : subfr lenght                                                    */
);
#endif
void gain_dec_lbr_ivas_fx(
    Decoder_State *st_fx,      /* i/o: decoder state structure                                         */
@@ -7163,6 +7175,7 @@ void re8_PPV_fx(
    Word16 y[]        /* o  : point in RE8 (8-dimensional integer vector)	Q0  */
);
#ifndef REMOVE_EVS_DUPLICATES
// dec_pit_exc_fx.c
void dec_pit_exc_fx(
    Decoder_State *st_fx,    /* i/o: decoder static memory                     */
@@ -7177,7 +7190,7 @@ void dec_pit_exc_fx(
    ,
    Word16 *gain_buf /*Q14*/
);
#endif
void dec_pit_exc_ivas_fx(
    Decoder_State *st_fx,              /* i/o: decoder static memory                     */
    const Word16 *Aq_fx,               /* i  : LP filter coefficient                     */
@@ -7232,6 +7245,7 @@ void Mode2_delta_pit_dec(
    Word16 **pt_indice   /* i/o: pointer to Vector of Q indexes */
);
#ifndef REMOVE_EVS_DUPLICATES
Word16 pit_decode_fx(                          /* o  : floating pitch value                    */
                      Decoder_State *st_fx,    /* i/o: decoder state structure                 */
                      const Word32 core_brate, /* i  : core bitrate                            */
@@ -7246,7 +7260,7 @@ Word16 pit_decode_fx( /* o : floating pitch value
                      Word16 *T0_max,          /* i/o: delta search max for sf 2 & 4           */
                      const Word16 L_subfr     /* i  : subframe length                         */
);
#endif
/* o  : floating pitch value */
Word16 pit_decode_ivas_fx(
    Decoder_State *st_fx,              /* i/o: decoder state structure                 */
@@ -7609,6 +7623,7 @@ void configureFdCngDec_fx(
    const Word16 Last_L_frame,
    const Word16 element_mode );
#ifndef REMOVE_EVS_DUPLICATES
/* Apply the CLDFB-based CNG */
Word16 ApplyFdCng_fx(
    Word16 *timeDomainInput, /* i  : pointer to time domain i   */
@@ -7622,7 +7637,7 @@ Word16 ApplyFdCng_fx(
    Decoder_State *st,
    const Word16 concealWholeFrame, /* i  : binary flag indicating frame loss */
    Word16 is_music );
#endif
Word16 ApplyFdCng_ivas_fx(
    Word16 *timeDomainInput, /* i  : pointer to time domain input */
    Word16 Q,
@@ -8221,6 +8236,7 @@ void FEC_pitch_estim_fx(
    Word16 element_mode      /* i  : element mode                                  */
);
#ifndef REMOVE_EVS_DUPLICATES
// FEC_scale_sync_fx.c
void FEC_scale_syn_fx(
    const Word16 L_frame,          /* i  : length of the frame                     */
@@ -8251,7 +8267,7 @@ void FEC_scale_syn_fx(
    const Word16 avoid_lpc_burst_on_recovery, /* i  : if true the excitation energy is limited if LP has big gain */
    const Word16 force_scaling                /* i: force scaling                             */
);
#endif
void FEC_scale_syn_ivas_fx(
    const Word16 L_frame,          /* i  : length of the frame                     */
    Word16 *update_flg,            /* o: flag indicating re-synthesis after scaling*/
@@ -8278,6 +8294,9 @@ void FEC_scale_syn_ivas_fx(
    Word16 *mem_syn,               /* o:   initial synthesis filter states         */
    Word16 Q_exc,
    Word16 Q_syn,
#ifdef REMOVE_EVS_DUPLICATES
    const Word16 element_mode, /* i  : element mode                            */
#endif
    const Word16 avoid_lpc_burst_on_recovery, /* i  : if true the excitation energy is limited if LP has big gain */
    const Word16 force_scaling                /* i: force scaling                             */
);
@@ -8565,6 +8584,7 @@ Word16 FEC_synchro_exc_fx( /* o : do_WI flag
                           const Word16 Old_pitch        /* i  : Pitch use to create temporary adaptive codebook   */
);
#ifndef REMOVE_EVS_DUPLICATES
// dec_uv_fx.c
void decod_unvoiced_fx(
    Decoder_State *st_fx,     /*   i/o: decoder static memory                             */
@@ -8577,7 +8597,7 @@ void decod_unvoiced_fx(
    Word16 *exc2_fx,          /*   Q_X        o  : adapt. excitation/total exc            */
    Word16 *bwe_exc_fx,       /*   Q_X        i/o: excitation for SWB TBE                 */
    Word16 *gain_buf );
#endif
void decod_unvoiced_ivas_fx(
    Decoder_State *st_fx,            /* 					i/o: decoder static memory                  */
    const Word16 *Aq_fx,             /* 	Q12				i  : LP filter coefficient                  */
@@ -8621,6 +8641,7 @@ void gaus_L2_dec(
    Word16 *seed_acelp  /*i/o : random seed                     Q0  */
);
#ifndef REMOVE_EVS_DUPLICATES
// dec_gen_voic_fx.c
ivas_error decod_gen_voic_fx(
    Decoder_State *st_fx,      /* i/o: decoder static memory                     */
@@ -8637,7 +8658,7 @@ ivas_error decod_gen_voic_fx(
    Word16 *unbits,            /* number of unused bits                          */
    Word16 *gain_buf           /*Q14*/
);
#endif
ivas_error decod_gen_voic_ivas_fx(
    Decoder_State *st_fx,      /* i/o: decoder static memory                     */
    const Word16 L_frame,      /* i  : length of the frame                       */
@@ -9580,6 +9601,8 @@ void d_gain_pred_fx(
    Word16 *Es_pred,   /* o  : predicited scaled innovation energy       */
    Word16 **pt_indice /* i/o: pointer to the buffer of indices          */
);
#ifndef REMOVE_EVS_DUPLICATES
// acelp_core_dec_fx.c
ivas_error acelp_core_dec_fx(
    Decoder_State *st_fx,      /* i/o: decoder state structure                    */
@@ -9605,7 +9628,7 @@ ivas_error acelp_core_dec_fx(
    STEREO_CNG_DEC_HANDLE hStereoCng,    /* i  : stereo CNG handle                                                       */
    const Word16 read_sid_info           /* i  : read SID info flag                                                      */
);
#endif
// evs_dec_fx.c
ivas_error evs_dec_fx(
    Decoder_State *st_fx, /* i/o  : Decoder state structure  */
+2 −2
Original line number Diff line number Diff line
@@ -6748,7 +6748,6 @@ void elliptic_bpf_48k_generic_fx(
        memory_fx[0][i] = shl_sat( memory_fx0[0][i], sub( *Q_input_fx, memory_fx_Q[0] ) );
        memory2_fx[1][i] = L_shl_sat( memory_fx2[1][i], sub( add( *Q_input_fx, 11 ), memory_fx_Q[1] ) );
        memory2_fx[2][i] = L_shl_sat( memory_fx2[2][i], sub( add( *Q_input_fx, 6 ), memory_fx_Q[2] ) );
        memory2_fx[3][i] = L_shl_sat( memory_fx2[3][i], sub( add( *Q_input_fx, 1 ), memory_fx_Q[3] ) );
        move32();
        move32();
        move32();
@@ -7640,6 +7639,7 @@ void tbe_celp_exc(
/* _ None */
/*======================================================================================*/

#ifndef REMOVE_EVS_DUPLICATES
void prep_tbe_exc_fx(
    const Word16 L_frame_fx, /* i : length of the frame */
#ifdef ADD_IVAS_TBE_CODE
@@ -7808,7 +7808,7 @@ void prep_tbe_exc_fx(
/* RETURN ARGUMENTS : */
/* _ None */
/*======================================================================================*/

#endif
void prep_tbe_exc_ivas_fx(
    const Word16 L_frame_fx, /* i : length of the frame */
#if 1                        // def ADD_IVAS_TBE_CODE
+25 −1
Original line number Diff line number Diff line
@@ -794,14 +794,38 @@ void Copy_Scale_sig_16_32_no_sat(
        }
        return;
    }
#ifdef FIX_1439_SPEEDUP_Copy_Scale_sig_16_32_no_sat
    L_tmp = L_shl_o( 1, exp0 - 1, &Overflow );

    IF( L_tmp >= 0x7FFF )
    {
        FOR( i = 0; i < lg; i++ )
        {
            // y[i] = L_mult0(x[i], L_tmp);
            y[i] = W_extract_l( W_mult_32_16( L_tmp, x[i] ) );
        move32(); /* saturation can occur here */
            move32(); /* Overflow can occur here */
        }
        return;
    }
    // ELSE
    {
        Word16 tmp = extract_l( L_tmp );
        FOR( i = 0; i < lg; i++ )
        {
            y[i] = L_mult( x[i], tmp );
            move32();
        }
    }
#else
    L_tmp = L_shl_o( 1, exp0 - 1, &Overflow );
    FOR( i = 0; i < lg; i++ )
    {
        // y[i] = L_mult0(x[i], L_tmp);
        y[i] = W_extract_l( W_mult_32_16( L_tmp, x[i] ) );
        move32(); /* Overflow can occur here */
    }
#endif
}

void Copy_Scale_sig_32_16(
    const Word32 x[], /* i  : signal to scale input           Qx        */
Loading