Commit b2ae92b3 authored by Mohammadreza Naghibzadeh's avatar Mohammadreza Naghibzadeh
Browse files

corrected bwe_exc_fx[] scaling in the prep_tbe_exc_fx()

parent e46fc474
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@
#define FIX_2009_HIGH_NOISE_FLOOR_FOR_FX_DEC                 /* FhG: Corrected the q_input in the input of generate_masking_noise_dirac_ivas_fx() */
#define FIX_ISSUE_2013_MDCT_STEREO_DTX_DISCONTINUITIES       /* Eri/FhG: Issue 2013 fix for dtx discontinuities */
#define FIX_ISSUE_2013_MDCT_STEREO_FER_DISCONTINUITIES       /* Eri/FhG: Issue 2013 fix for FER discontinuities */

#define FIX_2010_HF_ENERGY_LOSS                              /* FhG: corrected bwe_exc_fx[] scaling in the prep_tbe_exc_fx() */
/* #################### Start BASOP porting switches ############################ */

#define NONBE_1244_FIX_SWB_BWE_MEMORY                   /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */
+15 −1
Original line number Diff line number Diff line
@@ -7288,8 +7288,18 @@ void prep_tbe_exc_fx(
    }
    ELSE
    {
#ifdef FIX_2010_HF_ENERGY_LOSS
        Word16 shift = 0;
        move16();
        IF( LT_32( MIN_BRATE_AVQ_EXC, core_brate ) )
        {
            shift = 1;
            move16();
        }
#else
        Word16 shift = 4;
        move16();
#endif
        IF( gain_preQ_fx != 0 )
        {
            FOR( i = 0; i < L_subfr; i++ )
@@ -7299,9 +7309,13 @@ void prep_tbe_exc_fx(
                Ltemp2 = L_mult( gain_preQ_fx, code_preQ_fx[i] ); /*Q2 * Q10 -> Q12  */

#ifdef ISSUE_1836_replace_overflow_libcom
#ifdef FIX_2010_HF_ENERGY_LOSS
                Ltemp1 = L_shl_sat( Ltemp1, add( Q_exc, add( 6, shift ) ) /*Q_exc+16-19*/ );               /*Q_exc+16 */
                Ltemp2 = L_shl_sat( Ltemp2, add( Q_exc, add( 4, shift ) ) /*Q_exc+ 2 + 6 (or) 10 - 13*/ ); /*Q_exc+16 */
#else
                Ltemp1 = L_shl_sat( Ltemp1, add( Q_exc, 6 ) /*Q_exc+16-19*/ );                   /*Q_exc+16 */
                Ltemp2 = L_shl_sat( Ltemp2, add( Q_exc, shift ) /*Q_exc+ 2 + 6 (or) 10 - 13*/ ); /*Q_exc+16 */

#endif
                tmp_code_preInt_fx[i] = round_fx_sat( L_add_sat( Ltemp1, Ltemp2 ) ); /* Q_exc  */
#else
                Ltemp1 = L_shl_o( Ltemp1, add( Q_exc, 6 ) /*Q_exc+16-19*/, &Overflow );                   /*Q_exc+16 */