Commit 5dfb605b authored by vaillancour's avatar vaillancour
Browse files

Fixes IO T02_dtx_sw_amrwb_evs_16kHz.b10

parent ba9535b3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2022,7 +2022,11 @@ void bufferCopyFx(
    {
        FOR (i = 0 ; i < length ; i++)
        {
#ifdef BASOP_NOGLOB
            *(dest+i) = shr_sat(*(src+i),tmp_16);
#else
            *(dest+i) = shr(*(src+i),tmp_16);
#endif
            move16();
        }
    }
+15 −0
Original line number Diff line number Diff line
@@ -290,6 +290,20 @@ static void c_fft_fx(
                    kj = add(k, jj);            /* kj is butterfly bottom */

                    /* Butterfly computations */
#ifdef BASOP_NOGLOB
                    tmp1 = mac_r_sat(L_mult_sat(out_ptr[kj], table_ptr[ji]), out_ptr[kj+1], table_ptr[ji + 1]);

                    tmp2 = msu_r_sat(L_mult_sat(out_ptr[kj+1], table_ptr[ji]), out_ptr[kj], table_ptr[ji+1]);

                    out_ptr[kj] = sub_sat(out_ptr[k], tmp1);
                    move16();
                    out_ptr[kj+1] = sub_sat(out_ptr[k+1], tmp2);
                    move16();
                    out_ptr[k] = add_sat(out_ptr[k], tmp1);
                    move16();
                    out_ptr[k+1] = add_sat(out_ptr[k+1], tmp2);
                    move16();
#else
                    tmp1 = mac_r(L_mult(out_ptr[kj], table_ptr[ji]),
                    out_ptr[kj+1], table_ptr[ji + 1]);

@@ -304,6 +318,7 @@ static void c_fft_fx(
                    move16();
                    out_ptr[k+1] = add(out_ptr[k+1], tmp2);
                    move16();
#endif
                }
                ji = add(ji, ii);
            }
+4 −0
Original line number Diff line number Diff line
@@ -199,7 +199,11 @@ void hp20(Word16 signal[], /* i/o: signal to filter any *
    {
        prescale = s_min(prescale, diff);
    }
#ifdef BASOP_NOGLOB
    diff = norm_l(L_shl_o(mem[3], prescaleOld, &Overflow));
#else
    diff = norm_l(L_shl(mem[3], prescaleOld));
#endif
    if (mem[3] != 0)
    {
        prescale = s_min(prescale, diff);
+9 −0
Original line number Diff line number Diff line
@@ -1894,7 +1894,11 @@ void hq_wb_nf_bwe_fx(
                FOR( i = sfm_start[sfm]; i < sfm_end[sfm]; i++ )
                {
                    fabs_coeff_out_fx = L_abs(L_coeff_out[i]);
#ifdef BASOP_NOGLOB
                    mean_fx = L_add_sat(mean_fx, fabs_coeff_out_fx);/*Q12 */
#else
                    mean_fx = L_add(mean_fx, fabs_coeff_out_fx);/*Q12 */
#endif
                    if(GT_32(fabs_coeff_out_fx, peak_fx))
                    {
                        peak_fx = fabs_coeff_out_fx;/*Q12 */
@@ -1905,8 +1909,13 @@ void hq_wb_nf_bwe_fx(
                IF(mean_fx != 0)
                {
                    exp = norm_l(mean_fx);
#ifdef BASOP_NOGLOB
                    mean_fx = L_shl_sat(mean_fx, exp);/*Q(exp+12) */
                    tmp = round_fx_sat(mean_fx);/*Q(exp-4) */
#else
                    mean_fx = L_shl(mean_fx, exp);/*Q(exp+12) */
                    tmp = round_fx(mean_fx);/*Q(exp-4) */
#endif
                    tmp = div_s(16384,tmp); /*Q(15+14-exp+4 = 33-exp) */
                    L_tmp = Mult_32_16(peak_fx, tmp);/*Q(12+33-exp-15 = 30-exp) */
                    tmp = shl(sfmsize[sfm], 9);/*Q9 */
+29 −4
Original line number Diff line number Diff line
@@ -149,15 +149,25 @@ static void tcx_ltp_get_zir(
        move16();
        FOR (i = 0; i < L; i++)
        {
#ifdef BASOP_NOGLOB
            s = L_mac_sat(L_mac_sat(s, w0[k], x0[i]), w1[k], x1[-i]);
            s2 = L_mac_sat(L_mac_sat(s2, v0[k], y0[i]), v1[k], y1[-i]);
#else
            s = L_mac(L_mac(s, w0[k], x0[i]), w1[k], x1[-i]);
            s2 = L_mac(L_mac(s2, v0[k], y0[i]), v1[k], y1[-i]);
#endif
            k = add(k, pitres);
        }

        /* s2 *= ALPHA;
           buf[j] = ( synth[j] - gain * s2 ) - ( synth_ltp[j] - gain * s ); */
#ifdef BASOP_NOGLOB
        i = sub_sat(round_fx_sat(s), mult_r_sat(round_fx_sat(s2), ALPHA));
        buf[j] = add_sat(sub_sat(synth[j], synth_ltp[j]), mult_r_sat(gain, i));
#else
        i = sub(round_fx(s), mult_r(round_fx(s2), ALPHA));
        buf[j] = add(sub(synth[j], synth_ltp[j]), mult_r(gain, i));
#endif
        move16();

        x0++;
@@ -259,9 +269,7 @@ static void tcx_ltp_synth_filter(
    const Word16 *w0, *w1;
    Word16 alpha, step = 0; /* initialize just to avoid compiler warning */
    Word16 i, j, k, L;
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
#endif

    IF (gain > 0)
    {
        x0 = &synth_ltp[-pitch_int];
@@ -312,8 +320,13 @@ static void tcx_ltp_synth_filter(
            move16();
            FOR(i = 0; i < L; i++)
            {
#ifdef BASOP_NOGLOB
                s = L_mac_sat(L_mac_sat(s, w0[k], x0[i]), w1[k], x1[-i]);
                s2 = L_mac_sat(L_mac_sat(s2, v0[k], y0[i]), v1[k], y1[-i]);
#else
                s = L_mac(L_mac(s, w0[k], x0[i]), w1[k], x1[-i]);
                s2 = L_mac(L_mac(s2, v0[k], y0[i]), v1[k], y1[-i]);
#endif
                k = add(k, pitch_res);
            }

@@ -321,11 +334,23 @@ static void tcx_ltp_synth_filter(
               normal:      synth_ltp[j] = synth[j] - gain * s2 + gain * s;
               zir:         synth_ltp[j] = synth[j] - gain * s2 + gain * s - zir[j];
               fade-in/out: synth_ltp[j] = synth[j] - alpha * gain * s2 + alpha * gain * s; */
#ifdef BASOP_NOGLOB
            i = sub_sat(round_fx_sat(s), mult_r_sat(round_fx_sat(s2), ALPHA));
#else
            i = sub(round_fx(s), mult_r(round_fx(s2), ALPHA));
#endif
            k = mult_r(gain, i);
            if (fade != 0) k = mult_r(k, alpha);
#ifdef BASOP_NOGLOB
            k = add_sat(synth[j], k);
            if (zir != NULL)
            {
                k = sub_sat(k, zir[j]);
            }
#else
            k = add(synth[j], k);
            if (zir != NULL) k = sub(k, zir[j]);
#endif

            synth_ltp[j] = k;
            move16();
@@ -334,7 +359,7 @@ static void tcx_ltp_synth_filter(
#ifdef BASOP_NOGLOB
            if (fade != 0)
            {
                alpha = add_o(alpha, step, &Overflow);
                alpha = add_sat(alpha, step);
            }                                       
#else
            if (fade != 0) alpha = add(alpha, step);
Loading