Commit 620de6da authored by multrus's avatar multrus
Browse files

[cleanup] accept HARMONIZE_TBE2

parent 53f08a06
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -83,7 +83,6 @@
#define FIX_1990_SANITIZER_IN_REVERB_LOAD               /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define HARMONIZE_TBE2                                  /* VA: basop issue 2399: Remove duplicated code: TBE, step 2 */
#define HARMONIZE_2427_GETPLC                           /* FhG: basop issue : 2427 Harmonizing getPLCDecision functions:*/
#define HARM_FD_BWE                                     /* VA: harmonize core-coder FD BWE function duplications */
#define FIX_2429_POST_DECODER
+0 −81
Original line number Diff line number Diff line
@@ -2725,26 +2725,6 @@ void flip_spectrum_and_decimby4_fx(
);
void GenShapedWBExcitation_fx(
#ifndef HARMONIZE_TBE2
    Word16 *excSHB,                   /* o   : synthesized shaped shb exctiation      */
    const Word16 *lpc_shb,            /* i   : lpc coefficients                       */
    Word16 *exc4kWhtnd,               /* o   : whitened synthesized shb excitation    */
    Word32 *mem_csfilt,               /* i/o : memory                                 */
    Word16 *mem_genSHBexc_filt_down1, /* i/o : memory                                 */
    Word16 *mem_genSHBexc_filt_down2, /* i/o : memory                                 */
    Word16 *mem_genSHBexc_filt_down3, /* i/o : memory                                 */
    Word16 *state_lpc_syn,            /* i/o : memory                                 */
    const Word16 coder_type,          /* i   : coding type                            */
    const Word16 element_mode,        /* i   : element mode                           */
    const Word16 *bwe_exc_extended,   /* i   : bandwidth extended exciatation         */
    const Word16 Q_bwe_exc,           /* i   : Q for memories                         */
    Word16 bwe_seed[],                /* i/o : random number generator seed           */
    const Word16 voice_factors[],     /* i   : voicing factor                         */
    const Word16 signal_type,
    const Word16 igf_flag );
void GenShapedWBExcitation_ivas_fx(
#endif
    Word16 *excSHB,                   /* o  : synthesized shaped shb exctiation   Q_bwe_exc*/
    const Word16 *lpc_shb,            /* i  : lpc coefficients Q12                         */
    Word16 *exc4kWhtnd,               /* o  : whitened synthesized shb excitation Q_bwe_exc*/
@@ -2801,12 +2781,8 @@ void GenShapedSHBExcitation_fx(
    const Word32 bitrate,
    const Word16 prev_bfi );
#ifdef HARMONIZE_TBE2
void GenShapedSHBExcitation_ivas_fx(
    const Word16 enc_dec, /* i  : encoder/decoder flag */
#else
void GenShapedSHBExcitation_ivas_enc_fx(
#endif
    Word16 *excSHB,                      /* o  : synthesized shaped shb excitation Q_bwe_exc*/
    const Word16 *lpc_shb,               /* i  : lpc coefficients Q12*/
    Word16 *White_exc16k_FB,             /* o  : white excitation for the Fullband extension Q_bwe_exc_fb */
@@ -2851,49 +2827,6 @@ void GenShapedSHBExcitation_ivas_enc_fx(
    Word16 Env_error_part[]       /* o  : per-segment error in SHB residual envelope modelling */
);
#ifndef HARMONIZE_TBE2
void GenShapedSHBExcitation_ivas_dec_fx(
    Word16 *excSHB,                      /* o : synthesized shaped shb excitation Q_bwe_exc*/
    const Word16 *lpc_shb,               /* i : lpc coefficients Q12*/
    Word16 *White_exc16k_FB,             /* o : white excitation for the Fullband extension Q_bwe_exc */
    Word32 *mem_csfilt,                  /* i/o: memory */
    Word16 *mem_genSHBexc_filt_down_shb, /* i/o: memory */
    Word16 *state_lpc_syn,               /* i/o: memory */
    const Word16 coder_type,             /* i : coding type */
    const Word16 *bwe_exc_extended,      /* i : bwidth extended excitation */
    Word16 bwe_seed[],                   /* i/o: random number generator seed */
    Word16 voice_factors[],              /* i : voicing factor*/
    const Word16 extl,                   /* i : extension layer */
    Word16 *tbe_demph,                   /* i/o: de-emphasis memory */
    Word16 *tbe_premph,                  /* i/o: pre-emphasis memory */
    Word16 *lpc_shb_sf,                  /* i:   LP coefficients  */
    const Word32 shb_ener_sf_32,         /* i: input shb ener, Q31 */
    Word16 *shb_res_gshape,              /* i: input res gain shape, Q14 */
    Word16 *shb_res,
    Word16 *vf_ind,
    const Word16 formant_fac,  /* i   : Formant sharpening factor [0..1] */
    Word16 fb_state_lpc_syn[], /* i/o: memory */
    Word16 *fb_tbe_demph,      /* i/o: fb de-emphasis memory */
    Word16 *Q_bwe_exc,
    Word16 *Q_bwe_exc_fb,
    const Word16 Q_shb,
    Word16 n_mem2,         /* i :  n_mem2 scale factor to adjust 24.4/32kbps memories */
    Word16 prev_Q_bwe_syn, /* i :  st_fx->prev_Q_bwe_syn */
    const Word32 bitrate,
    const Word16 prev_bfi,        /* i  : previous frame was concealed            */
    const Word16 element_mode,    /* i  : element mode                            */
    const Word16 flag_ACELP16k,   /* i  : ACELP@16kHz flag                        */
    Word16 *nlExc16k,             /* i/o: NL exc for IC-BWE                       */
    Word16 *mixExc16k,            /* i/o: exc spreading for IC-BWE                */
    const Word32 extl_brate,      /* i  : extension layer bitarte                 */
    const Word16 MSFlag,          /* i  : Multi Source flag                       */
    Word16 EnvSHBres_4k[],        /* i/o: TD envelope of the SHB residual signal  */
    Word32 *prev_pow_exc16kWhtnd, /* i/o: power of the LB excitation signal in the previous frame */
    Word16 *prev_mix_factor,      /* i/o: mixing factor in the previous frame     */
    Word16 *Env_error,            /* o  : error in SHB residual envelope modelling*/
    Word16 Env_error_part[]       /* o  : per-segment error in SHB residual envelope modelling */
);
#endif
void GenSHBSynth_fx(
    const Word16 *shb_target_speech,  /* i  : i   synthesized speech                */
    Word16 *shb_syn_speech_32k,       /* o  : output highband component               */
@@ -10006,20 +9939,6 @@ void Copy_Scale_sig32(
    const Word16 exp0 /* i  : exponent: x = round(x << exp)   Qx ?exp  */
);
#ifndef HARMONIZE_TBE2
void swb_pre_proc_ivas_fx(
    Encoder_State *st,                                          /* i/o: encoder state structure                  */
    Word16 *new_swb_speech,                                     /* o  : original input signal at 32kHz - Q0      */
    Word16 *shb_speech,                                         /* o  : SHB target signal (6-14kHz) at 16kHz - Q0*/
    Word32 realBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i  : real buffer Q - q_reImbuffer             */
    Word32 imagBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i  : imag buffer Q - q_reImbuffer             */
    Word16 q_reImBuffer,                                        /* i  : scale data of real and imag CLDFB buffers*/
#ifdef HARMONIZE_TBE2
    const CLDFB_SCALE_FACTOR *cldfbScale, /* i : scale data of real and imag CLDFB buffers */
#endif
    CPE_ENC_HANDLE hCPE /* i/o: CPE encoder structure                    */
);
#endif
/* o  : Q(2x - 31 - gb)                      */
Word32 sum2_f_32_fx(
    const Word32 *vec, /* i  : input vector, Qx                     */
+23 −1429

File changed.

Preview size limit exceeded, changes collapsed.

+0 −28
Original line number Diff line number Diff line
@@ -945,27 +945,10 @@ void wb_tbe_dec_fx(

        Q_bwe_exc_ext = sub( Q_bwe_exc, 16 );

#ifdef HARMONIZE_TBE2
        GenShapedWBExcitation_fx( shaped_wb_excitation + L_SHB_LAHEAD / 4, lpc_wb, exc4kWhtnd, hBWE_TD->mem_csfilt_fx,
                                  hBWE_TD->mem_genSHBexc_filt_down_shb_fx, hBWE_TD->mem_genSHBexc_filt_down_wb2_fx,
                                  hBWE_TD->mem_genSHBexc_filt_down_wb3_fx, hBWE_TD->state_lpc_syn_fx, coder_type, st_fx->element_mode,
                                  bwe_exc_extended_16, Q_bwe_exc_ext, hBWE_TD->bwe_seed, vf_modified, uv_flag, st_fx->igf );
#else
        IF( st_fx->element_mode == EVS_MONO )
        {
            GenShapedWBExcitation_fx( shaped_wb_excitation + L_SHB_LAHEAD / 4, lpc_wb, exc4kWhtnd, hBWE_TD->mem_csfilt_fx,
                                      hBWE_TD->mem_genSHBexc_filt_down_shb_fx, hBWE_TD->mem_genSHBexc_filt_down_wb2_fx,
                                      hBWE_TD->mem_genSHBexc_filt_down_wb3_fx, hBWE_TD->state_lpc_syn_fx, coder_type, st_fx->element_mode,
                                      bwe_exc_extended_16, Q_bwe_exc_ext, hBWE_TD->bwe_seed, vf_modified, uv_flag, st_fx->igf );
        }
        ELSE
        {
            GenShapedWBExcitation_ivas_fx( shaped_wb_excitation + L_SHB_LAHEAD / 4, lpc_wb, exc4kWhtnd, hBWE_TD->mem_csfilt_fx,
                                           hBWE_TD->mem_genSHBexc_filt_down_shb_fx, hBWE_TD->mem_genSHBexc_filt_down_wb2_fx,
                                           hBWE_TD->mem_genSHBexc_filt_down_wb3_fx, hBWE_TD->state_lpc_syn_fx, coder_type, st_fx->element_mode,
                                           bwe_exc_extended_16, Q_bwe_exc_ext, hBWE_TD->bwe_seed, vf_modified, uv_flag, st_fx->igf );
        }
#endif

        curr_pow = 0;
        move32();
@@ -5410,7 +5393,6 @@ void swb_tbe_dec_ivas_fx(
    {
        Copy( hBWE_TD->state_syn_shbexc_fx, shaped_shb_excitation_fx, L_SHB_LAHEAD );

#ifdef HARMONIZE_TBE2
        GenShapedSHBExcitation_ivas_fx( DEC, shaped_shb_excitation_fx + L_SHB_LAHEAD, lpc_shb_fx, White_exc16k_fx,
                                        hBWE_TD->mem_csfilt_fx, hBWE_TD->mem_genSHBexc_filt_down_shb_fx, hBWE_TD->state_lpc_syn_fx,
                                        st->coder_type, bwe_exc_extended_16, hBWE_TD->bwe_seed, vf_modified_fx, st->extl,
@@ -5419,16 +5401,6 @@ void swb_tbe_dec_ivas_fx(
                                        &( hBWE_TD->fb_tbe_demph_fx ), &Q_bwe_exc, &Q_bwe_exc_fb, Q_shb, n_mem2, hBWE_TD->prev_Q_bwe_syn, st->total_brate, st->prev_bfi,
                                        st->element_mode, st->flag_ACELP16k, nlExc16k_fx, NULL, mixExc16k_fx, NULL, st->extl_brate, MSFlag,
                                        NULL, 0, &( hBWE_TD->prev_pow_exc16kWhtnd_fx32 ), &( hBWE_TD->prev_mix_factor_fx ), NULL, NULL );
#else
        GenShapedSHBExcitation_ivas_dec_fx( shaped_shb_excitation_fx + L_SHB_LAHEAD, lpc_shb_fx, White_exc16k_fx,
                                            hBWE_TD->mem_csfilt_fx, hBWE_TD->mem_genSHBexc_filt_down_shb_fx, hBWE_TD->state_lpc_syn_fx,
                                            st->coder_type, bwe_exc_extended_16, hBWE_TD->bwe_seed, vf_modified_fx, st->extl,
                                            &( hBWE_TD->tbe_demph_fx ), &( hBWE_TD->tbe_premph_fx ), lpc_shb_sf_fx, shb_ener_sf_32,
                                            shb_res_gshape_fx, shb_res_dummy_fx, &vind, formant_fac_fx, hBWE_TD->fb_state_lpc_syn_fx,
                                            &( hBWE_TD->fb_tbe_demph_fx ), &Q_bwe_exc, &Q_bwe_exc_fb, Q_shb, n_mem2, hBWE_TD->prev_Q_bwe_syn, st->total_brate, st->prev_bfi,
                                            st->element_mode, st->flag_ACELP16k, nlExc16k_fx, mixExc16k_fx, st->extl_brate, MSFlag,
                                            NULL, &( hBWE_TD->prev_pow_exc16kWhtnd_fx32 ), &( hBWE_TD->prev_mix_factor_fx ), NULL, NULL );
#endif
    }

    *Q_white_exc = Q_bwe_exc_fb;
+0 −9
Original line number Diff line number Diff line
@@ -416,12 +416,7 @@ ivas_error evs_enc_fx(
    IF( GE_32( st->input_Fs, 16000 ) && ( LT_16( st->bwidth, SWB ) ) )
    {
        /* Common pre-processing for WB TBE and WB BWE */
#ifdef HARMONIZE_TBE2
        wb_pre_proc_fx( st, EVS_MONO, new_inp_resamp16k, hb_speech );
#else
        wb_pre_proc_fx( st, new_inp_resamp16k, hb_speech );
        /* o: new_inp_resamp16k at Q = -1 */
#endif
    }

    IF( EQ_16( st->extl, WB_TBE ) )
@@ -452,11 +447,7 @@ ivas_error evs_enc_fx(
    IF( !st->Opt_SC_VBR && GE_32( st->input_Fs, 32000 ) )
    {
        /* Common pre-processing for SWB(FB) TBE and SWB BWE */
#ifdef HARMONIZE_TBE2
        swb_pre_proc_fx( st, new_swb_speech, shb_speech, realBuffer, imagBuffer, 0, &cldfbScale, NULL );
#else
        swb_pre_proc_fx( st, st->input_fx, new_swb_speech, shb_speech, &Q_shb_spch, realBuffer, imagBuffer, &cldfbScale );
#endif
    }
    ELSE IF( GE_32( st->input_Fs, 32000 ) )
    {
Loading