Commit e11454d9 authored by vaillancour's avatar vaillancour
Browse files

fixes AMRIO higher rate

parent aaeaa81f
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -412,7 +412,9 @@ static void Decreas_freqPeak_fx(
    Word16 lsf_new_diff[M];
    Word16 tmp,tmp1,exp;
    Word16 tmp2;

#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
#endif
    move16();   /*ptr init*/
    lsf_new_diff[0] = 0;    /* prevent unitialized value */
    FOR(j=1; j<(M-1); j++)
@@ -468,7 +470,11 @@ static void Decreas_freqPeak_fx(
                        exp = norm_s(max_val);
                        tmp1 = div_s(shl(1,sub(14,exp)),max_val);/*Q(29 - exp - Q_exc) */
                        L_tmp = L_mult(tmp,tmp1);/*Q(30 - exp) */
#ifdef BASOP_NOGLOB
                        tmp = round_fx_o(L_shl_o(L_tmp,exp, &Overflow), &Overflow);/*Q14 */
#else
                        tmp = round_fx(L_shl(L_tmp,exp));/*Q14 */
#endif
                        tmp = sub(32767,tmp);/*Q14 */
                        L_tmp = L_mult(avrg,tmp);/*Q_exc +15 */

+20 −0
Original line number Diff line number Diff line
@@ -37,16 +37,28 @@ void Residu3_lc_fx(
    {
        q = add(q, shift);
    }
#ifdef BASOP_NOGLOB
    *y++ = shl_o(x[0], shift, &Overflow);
#else
    *y++ = shl(x[0], shift);
#endif
    move16();

    FOR (i = 1; i < m; i++)
    {
#ifdef BASOP_NOGLOB
        s = L_mult_o(x[i], a[0], &Overflow);
#else
        s = L_mult(x[i], a[0]);
#endif
        /* Stop at i to Avoid Mults with Zeros */
        FOR (j = 1; j <= i; j++)
        {
#ifdef BASOP_NOGLOB
            s = L_mac_o(s, x[i-j], a[j], &Overflow);
#else
            s = L_mac(s, x[i-j], a[j]);
#endif
        }

#ifdef BASOP_NOGLOB
@@ -60,10 +72,18 @@ void Residu3_lc_fx(

    FOR (; i < lg; i++)
    {
#ifdef BASOP_NOGLOB
        s = L_mult_o(x[i], a[0], &Overflow);
#else
        s = L_mult(x[i], a[0]);
#endif
        FOR (j = 1; j <= m; j++)
        {
#ifdef BASOP_NOGLOB
            s = L_mac_o(s, x[i-j], a[j], &Overflow);
#else
            s = L_mac(s, x[i-j], a[j]);
#endif
        }

#ifdef BASOP_NOGLOB
+19 −1
Original line number Diff line number Diff line
@@ -955,8 +955,13 @@ Word16 var_fx( /* o: variance of vector Qx*/
    v = L_deposit_l(0);
    FOR (i = 0; i < len; i++)
    {
#ifdef BASOP_NOGLOB
        tmp = sub_o(x[i],m, &Overflow); /*Qx */
        v = L_mac0_o(v,tmp,tmp, &Overflow); /*(Qx+Qx) */
#else
        tmp = sub(x[i],m); /*Qx */
        v = L_mac0(v,tmp,tmp); /*(Qx+Qx) */
#endif
    }
    L_tmp = Mult_32_16(v,inv_len); /*Q(14-exp+Qx+Qx) */
#ifdef BASOP_NOGLOB
@@ -1810,7 +1815,9 @@ void fir_fx( const Word16 x[], /* i : input vector
    Word16 buf_in[L_FRAME32k+L_FILT_MAX];
    Word16 i, j;
    Word32 s;

#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
#endif
    /* prepare the input buffer (copy and update memory) */
    Copy( mem, buf_in, K );
    Copy( x, buf_in + K, L );
@@ -1822,6 +1829,16 @@ void fir_fx( const Word16 x[], /* i : input vector
    /* do the filtering */
    FOR ( i = 0; i < L; i++ )
    {
#ifdef BASOP_NOGLOB
        s = L_mult_o( buf_in[K + i], h[0], &Overflow );

        FOR ( j = 1; j <= K; j++ )
        {
            s = L_mac_o( s, h[j], buf_in[K + i - j], &Overflow);
        }
        s = L_shl_o( s, shift, &Overflow);
        y[i] = round_fx_o( s, &Overflow); /*Qx */
#else
        s = L_mult( buf_in[K + i], h[0] );

        FOR ( j = 1; j <= K; j++ )
@@ -1830,6 +1847,7 @@ void fir_fx( const Word16 x[], /* i : input vector
        }
        s = L_shl( s, shift );
        y[i] = round_fx( s ); /*Qx */
#endif
    }
}

+10 −2
Original line number Diff line number Diff line
@@ -1330,9 +1330,9 @@ void E_ACELP_4tsearch(Word16 dn[], const Word16 cn[], const Word16 H[], Word16 c
            FOR (i = 1; i < L_SUBFR; i++)
#ifdef BASOP_NOGLOB
            L_tmp = L_mac_o(L_tmp, vec[i], vec[i], &Overflow);
#else /* BASOP_NOGLOB */
#else 
            L_tmp = L_mac(L_tmp, vec[i], vec[i]);
#endif /* BASOP_NOGLOB */
#endif 

            alp = round_fx(L_shr(L_tmp, 3));

@@ -1390,7 +1390,11 @@ void E_ACELP_4tsearch(Word16 dn[], const Word16 cn[], const Word16 H[], Word16 c
                FOR (i = 0; i < L_SUBFR; i++)
                {
                    tmp = add(*p0++, *p1++);
#ifdef BASOP_NOGLOB
                    vec[i] = add_o(vec[i], tmp, &Overflow); /* can saturate here. */         move16();
#else
                    vec[i] = add(vec[i], tmp); /* can saturate here. */         move16();
#endif
                }

            }
@@ -1439,7 +1443,11 @@ void E_ACELP_4tsearch(Word16 dn[], const Word16 cn[], const Word16 H[], Word16 c
        }
        FOR (i=0; i<L_SUBFR; i++)
        {
#ifdef BASOP_NOGLOB
            y[i] = add_o(y[i], *p0++, &Overflow);
#else
            y[i] = add(y[i], *p0++);
#endif
            move16();
        }
    }