Loading lib_com/gs_noisefill_fx.c +7 −1 Original line number Diff line number Diff line Loading @@ -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++) Loading Loading @@ -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 */ Loading lib_com/residu_fx.c +20 −0 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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 Loading lib_com/tools_fx.c +19 −1 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 ); Loading @@ -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++ ) Loading @@ -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 } } Loading lib_enc/enc_acelp.c +10 −2 Original line number Diff line number Diff line Loading @@ -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)); Loading Loading @@ -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 } } Loading Loading @@ -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(); } } Loading Loading
lib_com/gs_noisefill_fx.c +7 −1 Original line number Diff line number Diff line Loading @@ -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++) Loading Loading @@ -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 */ Loading
lib_com/residu_fx.c +20 −0 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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 Loading
lib_com/tools_fx.c +19 −1 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 ); Loading @@ -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++ ) Loading @@ -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 } } Loading
lib_enc/enc_acelp.c +10 −2 Original line number Diff line number Diff line Loading @@ -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)); Loading Loading @@ -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 } } Loading Loading @@ -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(); } } Loading