Commit 9ad83d1c authored by vaclav's avatar vaclav
Browse files

REMOVE_EVS_DUPLICATES2

parent e4e68a27
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -155,6 +155,6 @@
#define FIX_MINOR_SVD_WMOPS_MR1010X             /* FhG: Minor WMOPS tuning, bit-exact to previous version, saves about 8.2 WMOPS for MR1010 */
#define SVD_WMOPS_OPT                           /* Ittiam : SVD related optimizations */

#define REMOVE_EVS_DUPLICATES                   /* remove core-coder duplicated functions */
#define REMOVE_EVS_DUPLICATES3
#define REMOVE_EVS_DUPLICATES                   /* remove core-coder duplicated functions, ACELP low-band decoder */
#define REMOVE_EVS_DUPLICATES2
#endif
+19 −13
Original line number Diff line number Diff line
@@ -3220,6 +3220,7 @@ void synthesise_fb_high_band_fx(
    Word16 bpf_memory_Q[],
    Word16 Qout );
#ifndef REMOVE_EVS_DUPLICATES2
void prep_tbe_exc_fx(
    const Word16 L_frame_fx, /* i : length of the frame */
#ifdef ADD_IVAS_TBE_CODE
@@ -3247,6 +3248,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 */
@@ -4776,7 +4778,7 @@ Word16 BITS_ALLOC_config_acelp(
    const Word16 narrowband,
    const Word16 nb_subfr );
#ifndef REMOVE_EVS_DUPLICATES3
#ifndef REMOVE_EVS_DUPLICATES
ivas_error config_acelp1(
    const Word16 enc_dec,              /* i  : encoder/decoder flag            */
    const Word32 total_brate,          /* i  : total bitrate                   */
@@ -5763,7 +5765,7 @@ void tcx_ltp_post32(
    Word32 *tcx_buf,     /* sig_q */
    Word16 sig_q );
#ifndef REMOVE_EVS_DUPLICATES3
#ifndef REMOVE_EVS_DUPLICATES
// gs_inact_switching_fx.c
void Inac_swtch_ematch_fx(
    Word16 exc2[],             /* i/o: CELP/GSC excitation buffer       Q_exc*/
@@ -6038,7 +6040,7 @@ void td_bwe_dec_init_fx(
    const Word32 output_Fs /* i  : output sampling rate    */
);
#ifndef REMOVE_EVS_DUPLICATES3
#ifndef REMOVE_EVS_DUPLICATES
// lsf_dec_fx.c
void lsf_dec_fx(
    Decoder_State *st_fx,          /* i/o: State structure                               */
@@ -6208,7 +6210,7 @@ void lsf_mid_dec_fx(
    Word16 lsp_mid[]      /* o  : quantized LSPs					Q15*/
);
#ifndef REMOVE_EVS_DUPLICATES3
#ifndef REMOVE_EVS_DUPLICATES
// cng_dec_fx.c
void CNG_dec_fx(
    Decoder_State *st_fx,           /* i/o: State structure                          */
@@ -6825,7 +6827,7 @@ void PulseResynchronization_fx(
    Word32 /*float*/ const pitchEnd        /*i   Q16*/
);
#ifndef REMOVE_EVS_DUPLICATES3
#ifndef REMOVE_EVS_DUPLICATES
// gs_dec_fx.c
void decod_audio_fx(
    Decoder_State *st_fx,  /* i/o: decoder static memory                     */
@@ -6859,7 +6861,7 @@ void decod_audio_ivas_fx(
    const Word16 tdm_Pri_pitch_buf[]   /* i  : primary channel pitch buffer              Q6*/
);
#ifndef REMOVE_EVS_DUPLICATES3
#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*/
@@ -6940,6 +6942,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                                                     */
@@ -6954,6 +6957,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                                         */
@@ -7088,7 +7092,7 @@ void re8_PPV_fx(
    Word16 y[]        /* o  : point in RE8 (8-dimensional integer vector)	Q0  */
);
#ifndef REMOVE_EVS_DUPLICATES3
#ifndef REMOVE_EVS_DUPLICATES
// dec_pit_exc_fx.c
void dec_pit_exc_fx(
    Decoder_State *st_fx,    /* i/o: decoder static memory                     */
@@ -7167,7 +7171,7 @@ void Mode2_delta_pit_dec(
    Word16 **pt_indice   /* i/o: pointer to Vector of Q indexes */
);
#ifndef REMOVE_EVS_DUPLICATES3
#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                            */
@@ -7549,7 +7553,7 @@ void configureFdCngDec_fx(
    const Word16 Last_L_frame,
    const Word16 element_mode );
#ifndef REMOVE_EVS_DUPLICATES3
#ifndef REMOVE_EVS_DUPLICATES
/* Apply the CLDFB-based CNG */
Word16 ApplyFdCng_fx(
    Word16 *timeDomainInput, /* i  : pointer to time domain i   */
@@ -8196,7 +8200,7 @@ void FEC_pitch_estim_fx(
    Word16 element_mode      /* i  : element mode                                  */
);
#ifndef REMOVE_EVS_DUPLICATES3
#ifndef REMOVE_EVS_DUPLICATES
// FEC_scale_sync_fx.c
void FEC_scale_syn_fx(
    const Word16 L_frame,          /* i  : length of the frame                     */
@@ -8544,7 +8548,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_DUPLICATES3
#ifndef REMOVE_EVS_DUPLICATES
// dec_uv_fx.c
void decod_unvoiced_fx(
    Decoder_State *st_fx,     /*   i/o: decoder static memory                             */
@@ -8601,7 +8605,7 @@ void gaus_L2_dec(
    Word16 *seed_acelp  /*i/o : random seed                     Q0  */
);
#ifndef REMOVE_EVS_DUPLICATES3
#ifndef REMOVE_EVS_DUPLICATES
// dec_gen_voic_fx.c
ivas_error decod_gen_voic_fx(
    Decoder_State *st_fx,      /* i/o: decoder static memory                     */
@@ -9565,6 +9569,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                    */
@@ -9590,7 +9596,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 −1
Original line number Diff line number Diff line
@@ -7131,6 +7131,7 @@ void tbe_celp_exc(
/* _ None */
/*======================================================================================*/

#ifndef REMOVE_EVS_DUPLICATES2
void prep_tbe_exc_fx(
    const Word16 L_frame_fx, /* i : length of the frame */
#ifdef ADD_IVAS_TBE_CODE
@@ -7299,7 +7300,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
+7 −5
Original line number Diff line number Diff line
@@ -10,6 +10,8 @@
#include "ivas_prot_fx.h"
#include "ivas_cnst.h" /* Common constants                       */
#include "cnst.h"      /* Common constants                       */

#ifndef REMOVE_EVS_DUPLICATES
/*==========================================================================*/
/* FUNCTION      : void acelp_core_dec_fx ()                                */
/*--------------------------------------------------------------------------*/
@@ -661,7 +663,7 @@ ivas_error acelp_core_dec_fx(
                test();
                IF( EQ_32( st_fx->core_brate, SID_2k40 ) && NE_16( st_fx->element_mode, IVAS_CPE_MDCT ) )
                {
                    FdCng_decodeSID_fx( st_fx->hFdCngDec->hFdCngCom, st_fx ); // VE: 2 variants needed
                    FdCng_decodeSID_fx( st_fx->hFdCngDec->hFdCngCom, st_fx );
                    *sid_bw = 0;
                    move16();
                }
@@ -691,7 +693,7 @@ ivas_error acelp_core_dec_fx(
                    }
                }
#endif
                generate_comfort_noise_dec_fx( NULL, NULL, NULL, st_fx, &( st_fx->Q_exc ), 2, -1 ); // VE: 2 variants needed
                generate_comfort_noise_dec_fx( NULL, NULL, NULL, st_fx, &( st_fx->Q_exc ), 2, -1 );

                FdCng_exc( st_fx->hFdCngDec->hFdCngCom, &st_fx->CNG_mode, st_fx->L_frame, st_fx->lsp_old_fx, st_fx->first_CNG, st_fx->lspCNG_fx, Aq_fx, lsp_new_fx, lsf_new_fx, exc_fx, exc2_fx, bwe_exc_fx );

@@ -715,7 +717,6 @@ ivas_error acelp_core_dec_fx(
#ifdef REMOVE_EVS_DUPLICATES
                IF( EQ_16( st_fx->element_mode, EVS_MONO ) )
                {
                    // VE: TBV: 'st_fx->L_frame * HIBND_ACB_L_FAC' should be corrected
                    Rescale_exc( hMusicPF->dct_post_old_exc_fx, exc_fx, bwe_exc_fx, st_fx->hGSCDec->last_exc_dct_in_fx, st_fx->L_frame,
                                 st_fx->L_frame * HIBND_ACB_L_FAC, 0, &( st_fx->Q_exc ), st_fx->Q_subfr, NULL, 0, INACTIVE );
                }
@@ -754,7 +755,7 @@ ivas_error acelp_core_dec_fx(
                FOR( i = 0; i < DCT_L_POST; i++ )
                {
                    /*st_fx->filt_lfE_fx[i] = 0.3f + 0.7f * st_fx->filt_lfE_fx[i];*/
                    hMusicPF->filt_lfE_fx[i] = round_fx( L_mac( ( 1228 << ( 16 ) ), 22938, hMusicPF->filt_lfE_fx[i] ) ); // VE: 2 variants needed
                    hMusicPF->filt_lfE_fx[i] = round_fx( L_mac( ( 1228 << ( 16 ) ), 22938, hMusicPF->filt_lfE_fx[i] ) );
                    move16();
                }
            }
@@ -2054,7 +2055,7 @@ ivas_error acelp_core_dec_fx(
        {
            hf_synth_reset_fx( st_fx->hBWE_zero );
#ifdef MSAN_FIX
            IF( NE_16( st_fx->element_mode, EVS_MONO ) ) // VE: TBV: tmp hack - it is a bug in EVS but conditon is here to keep EVS bit-exact
            IF( NE_16( st_fx->element_mode, EVS_MONO ) )
            {
                set16_fx( st_fx->hBWE_zero->mem_hp400_fx, 0, 6 );
            }
@@ -2132,3 +2133,4 @@ ivas_error acelp_core_dec_fx(

    return IVAS_ERR_OK;
}
#endif
+5 −6
Original line number Diff line number Diff line
@@ -761,7 +761,7 @@ ivas_error acelp_core_dec_ivas_fx(
#ifdef REMOVE_EVS_DUPLICATES
                IF( EQ_16( st->element_mode, EVS_MONO ) )
                {
                    // VE: TBV: 'st_fx->L_frame * HIBND_ACB_L_FAC' should be corrected
                    // VE: TBV:  should 'st_fx->L_frame * HIBND_ACB_L_FAC' be corrected in EVS?
                    Rescale_exc( st->hMusicPF->dct_post_old_exc_fx, exc_fx, bwe_exc_fx, st->hGSCDec->last_exc_dct_in_fx, st->L_frame,
                                 st->L_frame * HIBND_ACB_L_FAC, 0, &( st->Q_exc ), st->Q_subfr, NULL, 0, INACTIVE );
                }
@@ -1223,7 +1223,7 @@ ivas_error acelp_core_dec_ivas_fx(
#ifdef REMOVE_EVS_DUPLICATES
                IF( EQ_16( st->element_mode, EVS_MONO ) )
                {
                    // VE: TBV: this is a bug in EVS - 'st->last_coder_type' should be replaced by 'st->core_brate'
                    // VE: TBV: this is likely a bug in EVS - 'st->last_coder_type' should be replaced by 'st->core_brate'
                    Prep_music_postP_fx( exc_buffer_fx, dct_buffer_fx, st->hMusicPF->filt_lfE_fx, st->last_coder_type, st->element_mode, pitch_buf_fx,
                                         st->hMusicPF->LDm_enh_lp_gbin_fx, st->Q_exc, &qdct );
                }
@@ -1760,7 +1760,7 @@ ivas_error acelp_core_dec_ivas_fx(
#ifdef REMOVE_EVS_DUPLICATES
                IF( EQ_16( st->element_mode, EVS_MONO ) )
                {
                    // VE:TBC - in FLP, it is:
                    // VE: TBV - is it correct in EVS? in FLP, it is:
                    // v_multc( st->hFdCngDec->hFdCngCom->olapBufferSynth2 + 5 * st->L_frame / 4, 256.f, temp_buf, st->L_frame / 2 );
                    // v_add( temp_buf, syn, syn, st->L_frame / 2 );
                    FOR( i = 0; i < st->L_frame / 2; i++ )
@@ -2381,7 +2381,7 @@ ivas_error acelp_core_dec_ivas_fx(
        {
            hf_synth_reset_fx( st->hBWE_zero );
#ifdef REMOVE_EVS_DUPLICATES
            IF( NE_16( st->element_mode, EVS_MONO ) ) // VE: TBV: tmp hack - it is a bug in EVS but conditon is here to keep EVS bit-exact
            IF( NE_16( st->element_mode, EVS_MONO ) ) // VE: TBV: tmp hack - it is a bug in EVS but condition is here to keep EVS bit-exact for the moment
#endif
            {
#ifdef MSAN_FIX
@@ -2425,8 +2425,7 @@ ivas_error acelp_core_dec_ivas_fx(
#ifdef REMOVE_EVS_DUPLICATES
            IF( EQ_16( st->element_mode, EVS_MONO ) )
            {
                non_linearity_fx( bwe_exc_fx, bwe_exc_extended_fx, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale_fx, st->Q_exc,
                                  st->coder_type, voice_factors_fx, st->L_frame );
                non_linearity_fx( bwe_exc_fx, bwe_exc_extended_fx, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale_fx, st->Q_exc, st->coder_type, voice_factors_fx, st->L_frame );
            }
            ELSE
#endif
Loading