Commit 7fdc6b31 authored by vaillancour's avatar vaillancour
Browse files

some more saturation fixes

parent 61a6b182
Loading
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -1183,13 +1183,19 @@ static void fft5_shift4_16fx(
    /*    T2 = KP951056516 * Ts + KP587785252 * Tt; */
    L_tmp = Mult_32_16(KP951056516_16FX,Ts);
    L_tmp = Madd_32_16(L_tmp,KP587785252_16FX,Tt);
#ifdef BASOP_NOGLOB
    T2 = round_fx_sat( L_tmp );
#else
    T2 = round_fx( L_tmp );

#endif
    /*                T3 = KP951056516 * Tt - KP587785252 * Ts; */
    L_tmp = Mult_32_16(KP951056516_16FX,Tt);
    L_tmp = Msub_32_16(L_tmp,KP587785252_16FX,Ts);
#ifdef BASOP_NOGLOB
    T3 = round_fx_sat( L_tmp );
#else
    T3 = round_fx( L_tmp );

#endif
#ifdef BASOP_NOGLOB
    T6 = sub_sat(To, shr(Tp, 2));
    T4 = add_sat(Tn, T6);
+5 −0
Original line number Diff line number Diff line
@@ -2050,8 +2050,13 @@ void pz_filter_sp_fx (

        Lacc = L_deposit_l(0);
        FOR ( j = PNR - 1; j >= 0; j-- )
#ifdef BASOP_NOGLOB
        Lacc = L_mac_sat( Lacc, buf[j], b[j + 1] );
        Lacc = L_mac_sat( Lacc, s_mem, b[0] );
#else
        Lacc = L_mac( Lacc, buf[j], b[j + 1] );
        Lacc = L_mac( Lacc, s_mem, b[0] );
#endif
        /* Lacc in Q(1+Qc+Qn-Qa)*/

        FOR ( j = s_max(PDR, PNR ) - 1; j > 0; j-- )
+5 −1
Original line number Diff line number Diff line
@@ -855,7 +855,11 @@ void con_tcx(
        tmp_e = norm_l(L_tmp);
        L_tmp = L_shl(L_tmp,tmp_e);
        gain_inov_e = add(sub(gain_inov_e,tmp_e),31-29);/*->Q31*/
#ifdef BASOP_NOGLOB                                              /* Critical Overflow */
        gain_inov = round_fx_sat( L_tmp );                           /*Q15,gain_inov_e*/
#else
        gain_inov = round_fx( L_tmp );                           /*Q15,gain_inov_e*/
#endif
    }

    st->Mode2_lp_gainp = L_shr(L_deposit_h(alpha/*Q14*/)/*Q14+16*/,1);/*Q29*/
+6 −1
Original line number Diff line number Diff line
@@ -323,8 +323,13 @@ ivas_error ppp_voiced_decoder_fx(
    /*	temp32_fx = (Word32)divide_dp((Word40)819200,(Word40)L_shl((Word32)CURRP_Q_D_FX->lag_fx,6),-23,1);//Q6 */
    exp = norm_s(CURRP_Q_D_FX->lag_fx);
    tmp = div_s(shl(1,sub(14,exp)),CURRP_Q_D_FX->lag_fx);/*29-exp */
#ifdef BASOP_NOGLOB
    L_tmp = L_shl_sat( L_mult0( tmp, 12800 ), exp - 7 );
    temp32_fx = round_fx_sat( L_tmp );
#else
    L_tmp = L_shl( L_mult0( tmp, 12800 ), exp - 7 );
    temp32_fx = round_fx(L_tmp);
#endif
    diff = round_fx(L_shl(temp32_fx,16-6));/*Q0 */

    CURRP_Q_D_FX->nH_fx = find_rem(upper_cut_off_freq,diff,&rem_fx);/*Q0 */