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

Fixes for stv32c_9600_32kHz.b10.cod

parent 21819f95
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -1447,9 +1447,7 @@ void scale_st(
    Word16 scal_in, scal_out;
    Word16 s_g_in, s_g_out, temp, sh_g0, g0;
    Word16 gain = 0;
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
#endif


    /* compute i  gain */
    L_acc = L_deposit_l(0);
@@ -1509,7 +1507,7 @@ void scale_st(
        /* L_gain_in/L_gain_out in Q14 */
        /* overflows if L_gain_in > 2 * L_gain_out */
#ifdef BASOP_NOGLOB
        g0 = shr_o(g0, sh_g0, &Overflow); /* sh_g0 may be >0, <0, or =0 */
        g0 = shr_sat(g0, sh_g0); /* sh_g0 may be >0, <0, or =0 */
#else
        g0 = shr(g0, sh_g0); /* sh_g0 may be >0, <0, or =0 */
#endif
@@ -1525,8 +1523,13 @@ void scale_st(
        temp = mult_r(AGC_FAC_FX, gain);
        gain = add(temp, g0); /* in Q14 */
        L_temp = L_mult(gain, sig_out[i]);
#ifdef BASOP_NOGLOB
        L_temp = L_shl_sat(L_temp, 1);
        sig_out[i] = round_fx_sat(L_temp);
#else
        L_temp = L_shl(L_temp, 1);
        sig_out[i] = round_fx(L_temp);
#endif
    }
    *gain_prec = gain;
    move16();
+14 −1
Original line number Diff line number Diff line
@@ -1243,7 +1243,11 @@ void swb_tbe_dec_fx(
    Q_shb = 0;   /* high band target Q factor set to zero */

    L_tmp = calc_tilt_bwe_fx(old_syn_12k8_16k, st_fx->Q_syn2, st_fx->L_frame_fx);
#ifdef BASOP_NOGLOB
    tilt_swb_fec = round_fx_sat(L_shl_sat(L_tmp, 3));
#else
    tilt_swb_fec = round_fx(L_shl(L_tmp, 3));
#endif
    /* i: old_syn_12k8_16k in st_fx->Q_syn2 */
    /* o: tilt_swb_fec in Q11 */
    test();
@@ -1923,8 +1927,13 @@ void swb_tbe_dec_fx(
    }
    FOR(  ; i < L_SHB_LAHEAD + 10; i++ )
    {
#ifdef BASOP_NOGLOB
        temp = i_mult_sat(sub(i,19), 3277/*0.1f Q15*/); /* Q15 */
        L_tmp1 = Mult_32_16(L_shl_sat(1, sub(31, exp)), temp); /* Q31-exp */
#else
        temp = i_mult(sub(i,19), 3277/*0.1f Q15*/); /* Q15 */
        L_tmp1 = Mult_32_16(L_shl(1, sub(31, exp)), temp); /* Q31-exp */
#endif
        temp = sub(32767/*1.0f Q15*/, temp);
        Lscale = L_add(Mult_32_16(Lscale, temp), L_tmp1);
        L_tmp = Mult_32_16( Lscale, shaped_shb_excitation[i] );     /* Q_bwe_exc + (31-exp) - 15 */
@@ -2321,7 +2330,11 @@ void swb_tbe_dec_fx(
        max = 0;
        FOR( i = 0;  i < L_FRAME16k; i++ )
        {
#ifdef BASOP_NOGLOB
            shaped_shb_excitation_frac[i] = shl_sat( shaped_shb_excitation[i], n ); /*Q_bwe_exc+n*/ move16();
#else
            shaped_shb_excitation_frac[i] = shl( shaped_shb_excitation[i], n ); /*Q_bwe_exc+n*/ move16();
#endif
        }

        curr_frame_pow = 0;