Commit 5fad0089 authored by vaclav's avatar vaclav
Browse files

Merge branch...

Merge branch '2465-calculating-of-optimum-q_bwe_exc-differs-between-encoder-and-decoder' into 'main'

[non-BE] Fix calculation of optimum Q_bwe_exc differs between encoder and decoder

Closes #2465

See merge request !2856
parents 5b8cdb5a e15bd5bb
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -103,6 +103,8 @@
#define FIX_BASOP_2262_OLAP_BUFFER_SYNTH_SWITCHING      /* FhG: basop issue 2262: correct buffer update for FD-CNG buffer in case of BR switching */
#define FIX_2440_AGC_PRESCALING                         /* FhG: basop issue 2440: Fix loop bounds when scaling p_output_fx before ivas_spar_dec_agc_pca_fx() */
#define FIX_2471_REMOVE_POSSIBLE_OVRF                   /* VA: basop issue 2471: correcting undesired overflow */
#define FIX_2465_Q_BWE_EXC                              /* VA: basop issue 2465: fix calculation of Q_bwe_exc in SWB TBE encoder */

/* ##################### End NON-BE switches ########################### */

/* ################## End MAINTENANCE switches ######################### */
+4 −0
Original line number Diff line number Diff line
@@ -5295,7 +5295,11 @@ void swb_tbe_dec_ivas_fx(

    Lmax = 0;
    move32();
#ifdef FIX_2465_Q_BWE_EXC
    FOR( cnt = 0; cnt < sig_len; cnt++ )
#else
    FOR( cnt = 0; cnt < sig_len; cnt++ ) // note: this differs from the encoder where the length is always L_FRAME32k
#endif
#else
    Lmax = 0;
    move32();
+13 −0
Original line number Diff line number Diff line
@@ -3080,8 +3080,21 @@ void swb_tbe_enc_ivas_fx(

    /* -------- start of  memory rescaling  -------- */
    /* ----- calculate optimum Q_bwe_exc and rescale memories accordingly ----- */
#ifdef FIX_2465_Q_BWE_EXC
    Word16 sig_len = L_FRAME32k + NL_BUFF_OFFSET;
    move16();
    IF( st_fx->element_mode == EVS_MONO )
    {
        sig_len = L_FRAME32k;
        move16();
    }

    Lmax = L_deposit_l( 0 );
    FOR( cnt = 0; cnt < sig_len; cnt++ )
#else
    Lmax = L_deposit_l( 0 );
    FOR( cnt = 0; cnt < L_FRAME32k; cnt++ )
#endif
    {
        Lmax = L_max( Lmax, L_abs( bwe_exc_extended[cnt] ) );
    }