Commit 1a844940 authored by vaclav's avatar vaclav
Browse files

HARMONIZE_ACELP_ENC

parent 07e09291
Loading
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ ivas_error evs_enc_fx(
    Word32 ener;                               /* residual energy from Levinson-Durbin     */
    Word16 A[NB_SUBFR16k * ( M + 1 )];         /* A(z) unquantized for subframes           */
    Word16 Aw[NB_SUBFR16k * ( M + 1 )];        /* weighted A(z) unquantized for subframes  */
#ifndef HARMONIZE_ACELP_ENCaa
#ifndef HARMONIZE_ACELP_ENC
    Word16 epsP_h[M + 1]; /* LP prediction errors                     */
    Word16 epsP_l[M + 1]; /* LP prediction errors                     */
#endif
@@ -180,7 +180,11 @@ ivas_error evs_enc_fx(
    pre_proc( st, input_frame, old_inp_12k8, old_inp_16k, &inp, fr_bands, &Etot, &ener, A, Aw, epsP, lsp_new, lsp_mid, &vad_hover_flag, &attack_flag, new_inp_resamp16k, &Voicing_flag, realBuffer, imagBuffer, &hq_core_type );
#else
    pre_proc_fx( st, input_frame, old_inp_12k8, old_inp_16k, &inp, fr_bands, &Etot, &ener,
#ifdef HARMONIZE_ACELP_ENC
                 pitch_orig, A, Aw, epsP, lsp_new, lsp_mid, &vad_hover_flag,
#else
                 pitch_orig, A, Aw, epsP_h, epsP_l, epsP, lsp_new, lsp_mid, &vad_hover_flag,
#endif
                 &attack_flag, new_inp_resamp16k, &Voicing_flag, realBuffer, imagBuffer, &cldfbScale, hLPDmem->old_exc,
                 &hq_core_type, &Q_new, &shift, Q_r );
#endif
+16 −16
Original line number Diff line number Diff line
@@ -32,8 +32,10 @@ void pre_proc_fx(
#endif
    Word16 A[NB_SUBFR16k * ( M + 1 )],  /* o  : A(z) unquantized for the 4 subframes     */
    Word16 Aw[NB_SUBFR16k * ( M + 1 )], /* o  : weighted A(z) unquantized for subframes  */
#ifndef HARMONIZE_ACELP_ENC
    Word16 epsP_h[M + 1], /* o  : LP prediction errors                     */
    Word16 epsP_l[M + 1], /* o  : LP prediction errors                     */
#endif
    Word32 epsP[M + 1], /* o  : LP prediction errors                     */
    Word16 lsp_new[M],  /* o  : LSPs at the end of the frame             */
    Word16 lsp_mid[M],  /* o  : LSPs in the middle of the frame          */
@@ -41,7 +43,6 @@ void pre_proc_fx(
    Word16 *attack_flag,                                        /* o  : flag signalling attack encoded by AC mode (GSC)    */
    Word16 *new_inp_resamp16k,                                  /* o  : new input signal @16kHz, non pre-emphasised, used by the WB TBE/BWE */
    Word16 *Voicing_flag,                                       /* o  : voicing flag for HQ FEC                  */

    Word32 realBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o : cldfb real buffer */
    Word32 imagBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o : cldfb imag buffer */
    CLDFB_SCALE_FACTOR *cldfbScale,                             /* o : cldfb scale */
@@ -53,7 +54,6 @@ void pre_proc_fx(
{
    Word16 delay;
    const Word16 *signal_in;

    Word16 i;
    Word16 *inp_12k8, *new_inp_12k8, *inp_16k, *new_inp_16k; /* pointers to current frame and new data */
    Word16 old_wsp[L_WSP], *wsp;                             /* weighted input signal buffer         */
@@ -69,13 +69,14 @@ void pre_proc_fx(
    Word16 cor_map_sum, sp_div;                              /* speech/music clasif. parameters      */
    Word32 PS[128];
    Word16 L_look; /* length of look-ahead                 */
#ifdef HARMONIZE_ACELP_ENC
    Word16 epsP_h[M + 1], epsP_l[M + 1];
#endif

    Word16 Q_sp_div, Q_esp;
    Word16 localVAD_HE_SAD; /* HE SAD parameters                    */
    Word16 snr_sum_he;      /* HE SAD parameters                    */

    Word16 vad_flag_cldfb;

    Word16 vad_flag_dtx;
    Word16 old_cor;
    Word32 hp_E[2];                                        /* Energy in HF                         */
@@ -126,10 +127,10 @@ void pre_proc_fx(
    LPD_state_HANDLE hLPDmem = st->hLPDmem;
    FD_BWE_ENC_HANDLE hBWE_FD = st->hBWE_FD;


    /*------------------------------------------------------------------*
     * Initializations
     *------------------------------------------------------------------*/

    signal_in = st->input_fx;

    vad_flag_dtx = 0;
@@ -209,16 +210,17 @@ void pre_proc_fx(
    /*----------------------------------------------------------------*
     * Change the sampling frequency to 12.8 kHz
     *----------------------------------------------------------------*/

    modify_Fs_fx( signal_in, input_frame, st->input_Fs, new_inp_12k8, INT_FS_12k8, st->mem_decim_fx, ( const Word16 )( EQ_16( st->max_bwidth, NB ) ) );
    Copy( new_inp_12k8, st->buf_speech_enc + L_FRAME32k, L_FRAME );
    Scale_sig( st->buf_speech_enc + L_FRAME32k, L_FRAME, 1 );

    /*------------------------------------------------------------------*
     * Perform fixed preemphasis (12.8 kHz signal) through 1 - g*z^-1
     *-----------------------------------------------------------------*/

    /* rf_mode: first time Q_new is computed here inside Preemph_scaled() for primary copy
                these are the same memories used in partial frame assembly as well */

    headroom = 1;
    move16();
    test();
@@ -483,7 +485,6 @@ void pre_proc_fx(
        move16();
    }


    /*------------------------------------------------------------------*
     * Update estimated noise energy and voicing cut-off frequency
     *-----------------------------------------------------------------*/
@@ -586,7 +587,6 @@ void pre_proc_fx(

    long_enr_fx( st, *Etot, localVAD_HE_SAD, high_lpn_flag ); /* has to be after  after sp_music classfier */


    /*----------------------------------------------------------------*
     * Rewrite the VAD flag by VAD flag  with DTX hangover for further processing)
     *----------------------------------------------------------------*/
+7 −5
Original line number Diff line number Diff line
@@ -3587,8 +3587,10 @@ void pre_proc_fx(
#endif
    Word16 A[NB_SUBFR16k * ( M + 1 )],  /* o  : A(z) unquantized for the 4 subframes     */
    Word16 Aw[NB_SUBFR16k * ( M + 1 )], /* o  : weighted A(z) unquantized for subframes  */
#ifndef HARMONIZE_ACELP_ENC
    Word16 epsP_h[M + 1], /* o  : LP prediction errors                     */
    Word16 epsP_l[M + 1], /* o  : LP prediction errors                     */
#endif
    Word32 epsP[M + 1], /* o  : LP prediction errors                     */
    Word16 lsp_new[M],  /* o  : LSPs at the end of the frame             */
    Word16 lsp_mid[M],  /* o  : LSPs in the middle of the frame          */