Commit 14d2c1c7 authored by vaillancour's avatar vaillancour
Browse files

Merge branch 'ALIGN_ACELP_CORE' into 'main'

Align acelp_core_enc() with BASOP

See merge request !2525
parents 7904167a cd9d9630
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -163,6 +163,7 @@
#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 FIX_FLOAT_1522_LTV_MSAN_QMETADATA_ENC_EC3       /* Nokia: float issue 1522: fix uninit MSAN in EC3 of qmetadata encoding */
#define FIX_FLOAT_1526_DIRAC_MEM_LEAK                   /* FhG: potential memory leak in DirAC handles in case of format switching */
#define ALIGN_ACELP_CORE                                /* VA: align ACELP core functions with BASOP */

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

+11 −7
Original line number Diff line number Diff line
@@ -2336,7 +2336,9 @@ void MDCT_classifier_reset(
ivas_error acelp_core_enc(
    Encoder_State *st, /* i/o: encoder state structure                 */
    const float inp[], /* i  : input signal of the current frame       */
#ifndef ALIGN_ACELP_CORE
    const float ener, /* i  : residual energy from Levinson-Durbin    */
#endif
    float A[NB_SUBFR16k * ( M + 1 )],    /* i  : A(z) unquantized for the 4 subframes    */
    float Aw[NB_SUBFR16k * ( M + 1 )],   /* i  : weighted A(z) unquant. for subframes    */
    const float epsP[M + 1],             /* i  : LP prediction errors                    */
@@ -3029,7 +3031,9 @@ void CNG_enc(
    Encoder_State *st,   /* i/o: State structure                                     */
    float Aq[],          /* o  : LP coefficients                                     */
    const float *speech, /* i  : pointer to current frame input speech buffer        */
#ifndef ALIGN_ACELP_CORE
    float enr, /* i  : frame energy output from Levinson recursion         */
#endif
    const float *lsp_mid,   /* i  : mid frame LSPs                                      */
    float *lsp_new,         /* i/o: current frame LSPs                                  */
    float *lsf_new,         /* i/o: current frame LSFs                                  */
+9 −3
Original line number Diff line number Diff line
@@ -59,7 +59,9 @@
ivas_error acelp_core_enc(
    Encoder_State *st, /* i/o: encoder state structure             */
    const float inp[], /* i  : input signal of the current frame   */
#ifndef ALIGN_ACELP_CORE
    const float ener, /* i  : residual energy from Levinson-Durbin*/
#endif
    float A[NB_SUBFR16k * ( M + 1 )],    /* i  : A(z) unquantized for the 4 subframes*/
    float Aw[NB_SUBFR16k * ( M + 1 )],   /* i  : weighted A(z) unquant. for subframes*/
    const float epsP[M + 1],             /* i  : LP prediction errors                */
@@ -294,7 +296,11 @@ ivas_error acelp_core_enc(
            cng_params_postupd( st->hTdCngEnc->ho_circ_ptr, &st->hTdCngEnc->cng_buf_cnt, st->hTdCngEnc->cng_exc2_buf, st->hTdCngEnc->cng_brate_buf, st->hTdCngEnc->ho_env_circ, st->element_mode, st->hFdCngEnc->hFdCngCom->CngBandwidth );

            /* encode CNG parameters */
#ifdef ALIGN_ACELP_CORE
            CNG_enc( st, Aq, inp, lsp_mid, lsp_new, lsf_new, &allow_cn_step, q_env, &sid_bw );
#else
            CNG_enc( st, Aq, inp, ener, lsp_mid, lsp_new, lsf_new, &allow_cn_step, q_env, &sid_bw );
#endif

            /* comfort noise generation */
            CNG_exc( st->core_brate, st->L_frame, &st->hTdCngEnc->Enew, &st->hTdCngEnc->cng_seed, exc, exc2, &st->hTdCngEnc->lp_ener, st->last_core_brate, &st->hDtxEnc->first_CNG, &st->hTdCngEnc->cng_ener_seed, bwe_exc, allow_cn_step, &st->hTdCngEnc->last_allow_cn_step, st->hTdCngEnc->num_ho, q_env, st->hTdCngEnc->lp_env, st->hTdCngEnc->old_env, st->hTdCngEnc->exc_mem, st->hTdCngEnc->exc_mem1, &sid_bw, &st->hTdCngEnc->cng_ener_seed1, exc3, st->Opt_AMR_WB, EVS_MONO );
+4 −0
Original line number Diff line number Diff line
@@ -410,7 +410,11 @@ void amr_wb_enc(
    if ( st->core_brate == SID_1k75 || st->core_brate == FRAME_NO_DATA )
    {
        /* encode CNG parameters */
#ifdef ALIGN_ACELP_CORE
        CNG_enc( st, Aq, inp, isp_new, isp_new, isf_new, &allow_cn_step, q_env, &sid_bw );
#else
        CNG_enc( st, Aq, inp, ener, isp_new, isp_new, isf_new, &allow_cn_step, q_env, &sid_bw );
#endif

        /* comfort noise generation */
        CNG_exc( st->core_brate, L_FRAME, &st->hTdCngEnc->Enew, &st->hTdCngEnc->cng_seed, exc, exc2, &st->hTdCngEnc->lp_ener, st->last_core_brate, &st->hDtxEnc->first_CNG, &st->hTdCngEnc->cng_ener_seed, dummy_buf, allow_cn_step, &st->hTdCngEnc->last_allow_cn_step, st->hTdCngEnc->num_ho, q_env, st->hTdCngEnc->lp_env, st->hTdCngEnc->old_env, st->hTdCngEnc->exc_mem, st->hTdCngEnc->exc_mem1, &sid_bw, &st->hTdCngEnc->cng_ener_seed1, exc3, st->Opt_AMR_WB, EVS_MONO );
+9 −6
Original line number Diff line number Diff line
@@ -72,7 +72,9 @@ void CNG_enc(
    Encoder_State *st,   /* i/o: State structure                                 */
    float Aq[],          /* o  : LP coefficients                                 */
    const float *speech, /* i  : pointer to current frame input speech buffer    */
#ifndef ALIGN_ACELP_CORE
    float enr, /* i  : residual energy from Levinson-Durbin            */
#endif
    const float *lsp_mid,   /* i  : mid frame LSPs                                  */
    float *lsp_new,         /* i/o: current frame ISPs                              */
    float *lsf_new,         /* i/o: current frame ISFs                              */
@@ -111,10 +113,11 @@ void CNG_enc(
    float res1[L_FRAME16k];
    float tmp_env[HO_HIST_SIZE * NUM_ENV_CNG];
    int16_t force_cn_step = 0;

    float st_lp_sp_enr;

    float lp_ener_thr_scale;
#ifdef ALIGN_ACELP_CORE
    float enr;
#endif

    BSTR_ENC_HANDLE hBstr = st->hBstr;
    TD_CNG_ENC_HANDLE hTdCngEnc = st->hTdCngEnc;
Loading