Commit 07e09291 authored by vaclav's avatar vaclav
Browse files

HARMONIZE_ACELP_ENC

parent eeae8dbd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@
#define FIX_2383_INIT_Q_A_ITF                           /* FhG: Initialize Q_A_itf, to avoid reading of uninitialized memory in case ITF is not triggered */
#define FIX_2382_COPY_AQ_IN_MCT                         /* FhG: basop issue 2382: 2nd instance of prevent copying uninitialized values from Aq_fx[][] to Aq_fx_32[][] in TCX */
#define FIX_2391_INIT_HQ_GENERIC_OFFSET                 /* FhG/Eri: basop issue 2391: make sure hq_generic_offset is initialized inside hq_hr_dec_fx() */
#define HARMONIZE_ACELP_ENC                             /* VA: basop issue 2400: Remove duplicated main ACELP encoder function */

/* #################### End BE switches ################################## */

+23 −17
Original line number Diff line number Diff line
@@ -10837,12 +10837,18 @@ ivas_error acelp_core_enc_ivas_fx(
    Word32 bwe_exc_extended_fx[],        /* i/o: bandwidth extended excitation           st->prev_Q_bwe_exc*/
    Word16 *voice_factors_fx,            /* o  : voicing factors                         Q15*/
    Word16 old_syn_12k8_16k[],           /* o  : intermediate ACELP synthesis at 12.8kHz or 16kHz to be used by SWB BWE        q_old_syn_12k8_16*/
    Word16 *q_old_syn_12k8_16,
    Word16 *q_old_syn_12k8_16,           /* o  : Q factor of old_syn_12k8_16k[]          */
    Word16 pitch_buf[NB_SUBFR16k],       /* o  : floating pitch for each subframe        Q6*/
    Word16 *unbits,                      /* o  : number of unused bits                   Q0*/
    STEREO_TD_ENC_DATA_HANDLE hStereoTD, /* i/o: TD stereo encoder handle                */
    Word16 tdm_lsfQ_PCh[M],              /* i  : Q LSFs for primary channel              X2.56*/
    const Word16 Q_new );
#ifdef HARMONIZE_ACELP_ENC
    const Word16 Q_new, /* i  : Scaling factor                          */
    const Word16 shift  /* i  : Shift need to obtain 12 bits vectors    */
#else
    const Word16 Q_new
#endif
);
void flip_and_downmix_generic_fx32(
    Word32 input[],                      /* i : input spectrum Qx*/
+425 −144

File changed.

Preview size limit exceeded, changes collapsed.

+5 −0
Original line number Diff line number Diff line
@@ -174,6 +174,11 @@ void decision_matrix_enc_fx(
            }
        }

#ifdef HARMONIZE_ACELP_ENC
        /* set inactive coder_type flag in ACELP core to GSC */
        st_fx->inactive_coder_type_flag = 1;
#endif

        return;
    }

+18 −9
Original line number Diff line number Diff line
@@ -43,8 +43,10 @@ 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
    Word16 epsP_h[M + 1]; /* LP prediction errors                     */
    Word16 epsP_l[M + 1]; /* LP prediction errors                     */
#endif
    Word32 epsP[M + 1]; /* LP prediction errors                     */
    Word16 lsp_new[M];  /* LSPs at the end of the frame             */
    Word16 lsp_mid[M];  /* ISPs in the middle of the frame          */
@@ -79,9 +81,6 @@ ivas_error evs_enc_fx(
#endif
    ivas_error error;
    SC_VBR_ENC_HANDLE hSC_VBR = st->hSC_VBR;
    // NOISE_EST_HANDLE hNoiseEst = st->hNoiseEst;
    // VAD_HANDLE hVAD = st->hVAD;
    // DTX_ENC_HANDLE  hDtxEnc = st->hDtxEnc;
    TD_CNG_ENC_HANDLE hTdCngEnc = st->hTdCngEnc;
    LPD_state_HANDLE hLPDmem = st->hLPDmem;
    TD_BWE_ENC_HANDLE hBWE_TD = st->hBWE_TD;
@@ -176,6 +175,7 @@ ivas_error evs_enc_fx(
    /*---------------------------------------------------------------------*
     * Pre-processing
     *---------------------------------------------------------------------*/

#ifdef FIX_I4_OL_PITCH
    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
@@ -184,7 +184,6 @@ ivas_error evs_enc_fx(
                 &attack_flag, new_inp_resamp16k, &Voicing_flag, realBuffer, imagBuffer, &cldfbScale, hLPDmem->old_exc,
                 &hq_core_type, &Q_new, &shift, Q_r );
#endif
    // st->sharpFlag = sharpFlag;

    IF( EQ_16( st->mdct_sw, MODE2 ) )
    {
@@ -268,9 +267,18 @@ ivas_error evs_enc_fx(

        IF( EQ_16( st->core, ACELP_CORE ) )
        {
#ifdef HARMONIZE_ACELP_ENC
            Word16 Q_old_syn_12k8_16k;
            IF( NE_32( ( error = acelp_core_enc_ivas_fx( st, inp, A, Aw, epsP, lsp_new, lsp_mid, vad_hover_flag, attack_flag, bwe_exc_extended, voice_factors, old_syn_12k8_16k, &Q_old_syn_12k8_16k, pitch_buf, &unbits, NULL, NULL, Q_new, shift ) ), IVAS_ERR_OK ) )
            {
                return error;
            }
#else
            acelp_core_enc_fx( st, inp, ener, A, Aw, epsP_h, epsP_l, lsp_new, lsp_mid, vad_hover_flag,
                               attack_flag, bwe_exc_extended, voice_factors, old_syn_12k8_16k, pitch_buf, &unbits, NULL, Q_new, shift );
#endif
        }

        /*---------------------------------------------------------------------*
         * HQ core encoding
         *---------------------------------------------------------------------*/
@@ -283,6 +291,7 @@ ivas_error evs_enc_fx(
        /*---------------------------------------------------------------------*
         * Postprocessing for ACELP/HQ core switching
         *---------------------------------------------------------------------*/

        core_switching_post_enc_fx( st, old_inp_12k8, old_inp_16k, A, shift, Q_new, st->Q_syn2, &Q_synth );
#ifndef FIX_I4_OL_PITCH
        IF( EQ_16( st->core, HQ_CORE ) )
Loading