Commit a4d0f064 authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

reconsidered the fix ->apply also for EVS even though it might break the bit-exactness

parent 788c1748
Loading
Loading
Loading
Loading
Loading
+10 −17
Original line number Diff line number Diff line
@@ -2705,27 +2705,20 @@ void swb_tbe_dec_fx(


#ifdef FIX_2602_NONBE_SAT_IN_SWB_TBE_SCALE
    /* Note, that the code below is identical for both EVS and IVAS codecs. The only difference is the addition of _sat in IVAS functions to avoid the saturation problem. Thus, it's BE for EVS test sequences and legacy implementations. */
    IF( EQ_16( st_fx->element_mode, EVS_MONO ) )
    {
    /* Note, that the code below comes from the legacy EVS decoder but it leads to saturation issues in L_shl(). Thus, it's been fixed by adding _sat to L_shl() and round_fx() functions. However, this might break the bit-exactness with EVS for some corner case-signals. */
    FOR( i = 0; i < L_SHB_LAHEAD; i++ )
    {
        L_tmp = Mult_32_16( Lscale, shaped_shb_excitation[i] );     /* Q_bwe_exc + (31-exp) - 15 */
            shaped_shb_excitation[i] = round_fx( L_shl( L_tmp, exp ) ); /* Q_bwe_exc */
        shaped_shb_excitation[i] = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /* Q_bwe_exc */
        move16();
    }
    }
    ELSE
    {
#endif
#else
    FOR( i = 0; i < L_SHB_LAHEAD; i++ )
    {
        L_tmp = Mult_32_16( Lscale, shaped_shb_excitation[i] );             /* Q_bwe_exc + (31-exp) - 15 */
            shaped_shb_excitation[i] = round_fx_sat( L_shl_sat( L_tmp, exp ) ); /* Q_bwe_exc */
        shaped_shb_excitation[i] = round_fx( L_shl( L_tmp, exp ) ); /* Q_bwe_exc */
        move16();
    }
#ifdef FIX_2602_NONBE_SAT_IN_SWB_TBE_SCALE
    }
#endif

    IF( exp < 0 )