Commit c10d62a6 authored by Manuel Jander's avatar Manuel Jander
Browse files

Add st->hLPDmem->q_lpd_old_exc into account of Q_new calculation to avoid...

Add st->hLPDmem->q_lpd_old_exc into account of Q_new calculation to avoid saturation issue of EXC buffers.
parent 348500c8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@
#define NONBE_FIX_ISSUE_2206_AVOID_OVERFLOW_MSVQ_Interpol_Tran_fx /* FhG: Fix saturation crash in MSVQ_Interpol_Tran_fx() */
#define NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT_FIX_2527    /* Fix crash from issue #2527 */
#define NONBE_FIX_2507                                  /* Fix porting error in SQ_gain_estimate_fx() */
#define NONBE_FIX_ISSUE_2518                            /* FhG: Fix issue 2518, noise during ACELP switching from 16KHz to 12k8Hz */
#define NONBE_FIX_ISSUE_2518                            /* FhG: Fix issue 2518, noise during ACELP switching from 16KHz to 12k8Hz by improving Q_new calculation. */
#define FIX_FLOAT_1539_G192_FORMAT_SWITCH               /* VA/Nokia: reintroduce format switching for g192 bitstreams */
#define HARMONIZE_2499_CONFIGUREFDCNGDEC                /* FhG: basop issue 2499: harmonoize configureFdCngDec */
#define FIX_BASOP_2530_IVAS_DECISION_MAT                /* VA: Fix ambiguous usage of extract_l() */
+6 −1
Original line number Diff line number Diff line
@@ -776,7 +776,12 @@ void pre_proc_front_ivas_fx(
    /* Limit Q_new here to st->q_inp because inside ivas_compute_core_buffers_fx() st->input is rescaled to Q_new */
    *Q_new = s_min( *Q_new, st->q_inp );
#endif
#ifndef NONBE_FIX_ISSUE_2518
#ifdef NONBE_FIX_ISSUE_2518
    if ( st->hLPDmem != NULL )
    {
        *Q_new = s_min( *Q_new, add( st->hLPDmem->q_lpd_old_exc, 1 ) );
    }
#else
    *Q_new = add( *Q_new, Q_inp_const );
#endif
    move16();
+6 −0
Original line number Diff line number Diff line
@@ -1305,6 +1305,12 @@ void ivas_compute_core_buffers_fx(
        shift = sub( norm_s( inp_max ), 1 /* headroom */ );
#endif
#ifdef NONBE_FIX_ISSUE_2206
#ifdef NONBE_FIX_ISSUE_2518
        if ( st->hLPDmem != NULL )
        {
            *Q_new = s_min( *Q_new, add( st->hLPDmem->q_lpd_old_exc, 1 ) );
        }
#endif
        *Q_new = s_min( shift, Q_MAX );
        move16();
#else
+17 −0
Original line number Diff line number Diff line
@@ -34,8 +34,25 @@ void updt_enc_fx(
    GSC_ENC_HANDLE hGSCEnc = st->hGSCEnc;
    TD_BWE_ENC_HANDLE hBWE_TD = st->hBWE_TD;

#ifdef NONBE_FIX_2507
    /* update old excitation buffer */
    IF( st->element_mode > EVS_MONO )
    {
        Word16 tmp;

        tmp = norm_arr( &old_exc[st->L_frame], L_EXC_MEM );
        Copy_Scale_sig_nosat( &old_exc[st->L_frame], hLPDmem->old_exc, L_EXC_MEM, tmp );
        hLPDmem->q_lpd_old_exc = add( hLPDmem->q_lpd_old_exc, tmp );
        move16();
    }
    ELSE
    {
        Copy( &old_exc[st->L_frame], hLPDmem->old_exc, L_EXC_MEM );
    }
#else
    /* update old excitation buffer */
    Copy( &old_exc[st->L_frame], hLPDmem->old_exc, L_EXC_MEM );
#endif
    test();
    test();
    IF( !st->Opt_AMR_WB && st->hBWE_TD != NULL )