Loading lib_com/env_stab_fx.c +8 −0 Original line number Diff line number Diff line Loading @@ -46,7 +46,11 @@ Word16 env_stability_fx( /* in Q15 */ mem_norm[i] = ynrm[i]; move16(); } Overflow = 0; move16(); #ifdef BASOP_NOGLOB env_delta = shl_o(*mem_env_delta, 1, &Overflow); #else env_delta = shl(*mem_env_delta, 1); #endif } ELSE { Loading Loading @@ -85,7 +89,11 @@ Word16 env_stability_fx( /* in Q15 */ *mem_env_delta = round_fx(L_tmp); /* Q12 */ Overflow = 0; move16(); #ifdef BASOP_NOGLOB env_delta = round_fx_o(L_shl_o(L_tmp, 1, &Overflow), &Overflow); /* Q13 */ #else env_delta = round_fx(L_shl(L_tmp, 1)); /* Q13 */ #endif } IF (Overflow != 0) /* Saturated due to the above up-shifting operation. */ { Loading lib_com/lsf_tools_fx.c +12 −0 Original line number Diff line number Diff line Loading @@ -838,12 +838,20 @@ Word16 E_LPC_f_lsp_pol_get(const Word16 lsp[], Word32 f[], const Word16 n, cons Overflow = 0; move16(); plsp = lsp; #ifdef BASOP_NOGLOB f[0] = L_shl_o(1, sub(31, Q_out), &Overflow); #else f[0] = L_shl(1, sub(31, Q_out)); #endif move32(); /*b = -2.0f * *plsp;*/ b = *plsp; move16(); #ifdef BASOP_NOGLOB m2 = shl_o(-2, sub(15, Q_out), &Overflow); #else m2 = shl(-2, sub(15, Q_out)); #endif f[1] = L_mult(b, m2); move32(); Loading Loading @@ -874,7 +882,11 @@ Word16 E_LPC_f_lsp_pol_get(const Word16 lsp[], Word32 f[], const Word16 n, cons #endif } move32(); #ifdef BASOP_NOGLOB f[1] = L_add_o(f[1], b32, &Overflow); #else f[1] = L_add(f[1], b32); #endif } Loading lib_com/lsp_conv_poly_fx.c +3 −3 Original line number Diff line number Diff line Loading @@ -602,7 +602,7 @@ static void spectautocorr_fx( c[j] = mult_r(c[j-1], x[i-1]); move16(); #ifdef BASOP_NOGLOB c[j] = add_o(c[j], sub(c[j], c[j-2]), &Overflow); c[j] = add_o(c[j], sub_o(c[j], c[j-2], &Overflow), &Overflow); #else /* BASOP_NOGLOB */ c[j] = add(c[j], sub(c[j], c[j-2])); #endif /* BASOP_NOGLOB */ Loading @@ -620,7 +620,7 @@ static void spectautocorr_fx( c[j+1] = mult_r(c[j], x[i-1]); move16(); #ifdef BASOP_NOGLOB c[j+1] = add_o(c[j+1], sub(c[j+1], c[j-1]), &Overflow); c[j+1] = add_o(c[j+1], sub_o(c[j+1], c[j-1], &Overflow), &Overflow); #else /* BASOP_NOGLOB */ c[j+1] = add(c[j+1], sub(c[j+1], c[j-1])); #endif /* BASOP_NOGLOB */ Loading @@ -638,7 +638,7 @@ static void spectautocorr_fx( c[j] = mult_r(c[j-1], x[i-1]); move16(); #ifdef BASOP_NOGLOB c[j] = add_o(c[j], sub(c[j], c[j-2]), &Overflow); c[j] = add_o(c[j], sub_o(c[j], c[j-2], &Overflow), &Overflow); #else /* BASOP_NOGLOB */ c[j] = add(c[j], sub(c[j], c[j-2])); #endif /* BASOP_NOGLOB */ Loading lib_com/swb_bwe_com_fx.c +18 −0 Original line number Diff line number Diff line Loading @@ -546,16 +546,30 @@ Word32 calc_tilt_bwe_fx( /* o : Tilt in Q24 */ /* Divide Frame Length by 32 */ FOR (j = shr(N, 5); j > 0; j--) { #ifdef BASOP_NOGLOB tmp1 = mult_ro(*ptr++, 8192, &Overflow); /* Divide by 4 */ #else tmp1 = mult_r(*ptr++, 8192); /* Divide by 4 */ #endif L_ener = L_mult0(tmp1, tmp1); /* With the shift by 4 and the L_mult0, no overflow possible for 32 samples */ FOR (i = 1; i < 32; i++) { #ifdef BASOP_NOGLOB tmp1 = mult_ro(*ptr++, 8192, &Overflow); /* Divide by 4 */ L_ener = L_mac0_o(L_ener, tmp1, tmp1, &Overflow); #else tmp1 = mult_r(*ptr++, 8192); /* Divide by 4 */ L_ener = L_mac0(L_ener, tmp1, tmp1); #endif } #ifdef BASOP_NOGLOB L_ener = L_shr_o(L_ener, exp2, &Overflow); L_temp = L_add_o(L_ener_tot, L_ener, &Overflow); #else L_ener = L_shr(L_ener, exp2); L_temp = L_add(L_ener_tot, L_ener); #endif IF (Overflow != 0) { L_ener_tot = L_shr(L_ener_tot, 1); Loading @@ -565,7 +579,11 @@ Word32 calc_tilt_bwe_fx( /* o : Tilt in Q24 */ Overflow = 0; move16(); } #ifdef BASOP_NOGLOB L_ener_tot = L_add_o(L_ener_tot, L_ener, &Overflow); #else L_ener_tot = L_add(L_ener_tot, L_ener); #endif } L_ener = L_deposit_l(abs_s(sub(sp[1], sp[0]))); FOR (i = 2; i < N; i++) Loading lib_com/tools_fx.c +26 −0 Original line number Diff line number Diff line Loading @@ -510,7 +510,11 @@ void Scale_sig( #endif FOR (i = 0; i < lg; i++) { #ifdef BASOP_NOGLOB x[i] = msu_ro(0, x[i], tmp, &Overflow); #else x[i] = msu_r(0, x[i], tmp); #endif move16(); /* msu instead of mac because factor is negative */ } return; Loading Loading @@ -2118,21 +2122,39 @@ Word32 Calc_Energy_Autoscaled(/* o: Result (Energy) */ FOR (i = 0; i < j; i++) { /* divide by 2 so energy will be divided by 4 */ #ifdef BASOP_NOGLOB temp = mult_ro(*signal++, 16384, &Overflow); L_Energy = L_mac0_o(L_Energy, temp, temp, &Overflow); #else temp = mult_r(*signal++, 16384); L_Energy = L_mac0(L_Energy, temp, temp); #endif } FOR (i = j; i < len; i+=8) /* Process 8 Samples at a time */ { /* divide by 2 so energy will be divided by 4 */ #ifdef BASOP_NOGLOB temp = mult_ro(*signal++, 16384, &Overflow); #else temp = mult_r(*signal++, 16384); #endif L_temp = L_mult0(temp, temp); FOR (j = 1; j < 8; j++) { #ifdef BASOP_NOGLOB temp = mult_ro(*signal++, 16384, &Overflow); L_temp = L_mac0_o(L_temp, temp, temp, &Overflow); #else temp = mult_r(*signal++, 16384); L_temp = L_mac0(L_temp, temp, temp); #endif } #ifdef BASOP_NOGLOB L_temp = L_shr_o(L_temp, temp2, &Overflow); #else L_temp = L_shr(L_temp, temp2); #endif /* Here we try the addition just to check if we can sum the energy of the small (8 Iterations) loop with the total energy calculated so far without an overflow. Loading @@ -2153,7 +2175,11 @@ Word32 Calc_Energy_Autoscaled(/* o: Result (Energy) */ Overflow = 0; move16(); } #ifdef BASOP_NOGLOB L_Energy = L_add_o(L_Energy, L_temp, &Overflow); #else L_Energy = L_add(L_Energy, L_temp); #endif } /* Calc Final Exponent (sub 2 because of the mult_r by 16384 that already divs the ener by 4) */ temp2 = sub(sub(shl(signal_exp, 1), temp2), 2); Loading Loading
lib_com/env_stab_fx.c +8 −0 Original line number Diff line number Diff line Loading @@ -46,7 +46,11 @@ Word16 env_stability_fx( /* in Q15 */ mem_norm[i] = ynrm[i]; move16(); } Overflow = 0; move16(); #ifdef BASOP_NOGLOB env_delta = shl_o(*mem_env_delta, 1, &Overflow); #else env_delta = shl(*mem_env_delta, 1); #endif } ELSE { Loading Loading @@ -85,7 +89,11 @@ Word16 env_stability_fx( /* in Q15 */ *mem_env_delta = round_fx(L_tmp); /* Q12 */ Overflow = 0; move16(); #ifdef BASOP_NOGLOB env_delta = round_fx_o(L_shl_o(L_tmp, 1, &Overflow), &Overflow); /* Q13 */ #else env_delta = round_fx(L_shl(L_tmp, 1)); /* Q13 */ #endif } IF (Overflow != 0) /* Saturated due to the above up-shifting operation. */ { Loading
lib_com/lsf_tools_fx.c +12 −0 Original line number Diff line number Diff line Loading @@ -838,12 +838,20 @@ Word16 E_LPC_f_lsp_pol_get(const Word16 lsp[], Word32 f[], const Word16 n, cons Overflow = 0; move16(); plsp = lsp; #ifdef BASOP_NOGLOB f[0] = L_shl_o(1, sub(31, Q_out), &Overflow); #else f[0] = L_shl(1, sub(31, Q_out)); #endif move32(); /*b = -2.0f * *plsp;*/ b = *plsp; move16(); #ifdef BASOP_NOGLOB m2 = shl_o(-2, sub(15, Q_out), &Overflow); #else m2 = shl(-2, sub(15, Q_out)); #endif f[1] = L_mult(b, m2); move32(); Loading Loading @@ -874,7 +882,11 @@ Word16 E_LPC_f_lsp_pol_get(const Word16 lsp[], Word32 f[], const Word16 n, cons #endif } move32(); #ifdef BASOP_NOGLOB f[1] = L_add_o(f[1], b32, &Overflow); #else f[1] = L_add(f[1], b32); #endif } Loading
lib_com/lsp_conv_poly_fx.c +3 −3 Original line number Diff line number Diff line Loading @@ -602,7 +602,7 @@ static void spectautocorr_fx( c[j] = mult_r(c[j-1], x[i-1]); move16(); #ifdef BASOP_NOGLOB c[j] = add_o(c[j], sub(c[j], c[j-2]), &Overflow); c[j] = add_o(c[j], sub_o(c[j], c[j-2], &Overflow), &Overflow); #else /* BASOP_NOGLOB */ c[j] = add(c[j], sub(c[j], c[j-2])); #endif /* BASOP_NOGLOB */ Loading @@ -620,7 +620,7 @@ static void spectautocorr_fx( c[j+1] = mult_r(c[j], x[i-1]); move16(); #ifdef BASOP_NOGLOB c[j+1] = add_o(c[j+1], sub(c[j+1], c[j-1]), &Overflow); c[j+1] = add_o(c[j+1], sub_o(c[j+1], c[j-1], &Overflow), &Overflow); #else /* BASOP_NOGLOB */ c[j+1] = add(c[j+1], sub(c[j+1], c[j-1])); #endif /* BASOP_NOGLOB */ Loading @@ -638,7 +638,7 @@ static void spectautocorr_fx( c[j] = mult_r(c[j-1], x[i-1]); move16(); #ifdef BASOP_NOGLOB c[j] = add_o(c[j], sub(c[j], c[j-2]), &Overflow); c[j] = add_o(c[j], sub_o(c[j], c[j-2], &Overflow), &Overflow); #else /* BASOP_NOGLOB */ c[j] = add(c[j], sub(c[j], c[j-2])); #endif /* BASOP_NOGLOB */ Loading
lib_com/swb_bwe_com_fx.c +18 −0 Original line number Diff line number Diff line Loading @@ -546,16 +546,30 @@ Word32 calc_tilt_bwe_fx( /* o : Tilt in Q24 */ /* Divide Frame Length by 32 */ FOR (j = shr(N, 5); j > 0; j--) { #ifdef BASOP_NOGLOB tmp1 = mult_ro(*ptr++, 8192, &Overflow); /* Divide by 4 */ #else tmp1 = mult_r(*ptr++, 8192); /* Divide by 4 */ #endif L_ener = L_mult0(tmp1, tmp1); /* With the shift by 4 and the L_mult0, no overflow possible for 32 samples */ FOR (i = 1; i < 32; i++) { #ifdef BASOP_NOGLOB tmp1 = mult_ro(*ptr++, 8192, &Overflow); /* Divide by 4 */ L_ener = L_mac0_o(L_ener, tmp1, tmp1, &Overflow); #else tmp1 = mult_r(*ptr++, 8192); /* Divide by 4 */ L_ener = L_mac0(L_ener, tmp1, tmp1); #endif } #ifdef BASOP_NOGLOB L_ener = L_shr_o(L_ener, exp2, &Overflow); L_temp = L_add_o(L_ener_tot, L_ener, &Overflow); #else L_ener = L_shr(L_ener, exp2); L_temp = L_add(L_ener_tot, L_ener); #endif IF (Overflow != 0) { L_ener_tot = L_shr(L_ener_tot, 1); Loading @@ -565,7 +579,11 @@ Word32 calc_tilt_bwe_fx( /* o : Tilt in Q24 */ Overflow = 0; move16(); } #ifdef BASOP_NOGLOB L_ener_tot = L_add_o(L_ener_tot, L_ener, &Overflow); #else L_ener_tot = L_add(L_ener_tot, L_ener); #endif } L_ener = L_deposit_l(abs_s(sub(sp[1], sp[0]))); FOR (i = 2; i < N; i++) Loading
lib_com/tools_fx.c +26 −0 Original line number Diff line number Diff line Loading @@ -510,7 +510,11 @@ void Scale_sig( #endif FOR (i = 0; i < lg; i++) { #ifdef BASOP_NOGLOB x[i] = msu_ro(0, x[i], tmp, &Overflow); #else x[i] = msu_r(0, x[i], tmp); #endif move16(); /* msu instead of mac because factor is negative */ } return; Loading Loading @@ -2118,21 +2122,39 @@ Word32 Calc_Energy_Autoscaled(/* o: Result (Energy) */ FOR (i = 0; i < j; i++) { /* divide by 2 so energy will be divided by 4 */ #ifdef BASOP_NOGLOB temp = mult_ro(*signal++, 16384, &Overflow); L_Energy = L_mac0_o(L_Energy, temp, temp, &Overflow); #else temp = mult_r(*signal++, 16384); L_Energy = L_mac0(L_Energy, temp, temp); #endif } FOR (i = j; i < len; i+=8) /* Process 8 Samples at a time */ { /* divide by 2 so energy will be divided by 4 */ #ifdef BASOP_NOGLOB temp = mult_ro(*signal++, 16384, &Overflow); #else temp = mult_r(*signal++, 16384); #endif L_temp = L_mult0(temp, temp); FOR (j = 1; j < 8; j++) { #ifdef BASOP_NOGLOB temp = mult_ro(*signal++, 16384, &Overflow); L_temp = L_mac0_o(L_temp, temp, temp, &Overflow); #else temp = mult_r(*signal++, 16384); L_temp = L_mac0(L_temp, temp, temp); #endif } #ifdef BASOP_NOGLOB L_temp = L_shr_o(L_temp, temp2, &Overflow); #else L_temp = L_shr(L_temp, temp2); #endif /* Here we try the addition just to check if we can sum the energy of the small (8 Iterations) loop with the total energy calculated so far without an overflow. Loading @@ -2153,7 +2175,11 @@ Word32 Calc_Energy_Autoscaled(/* o: Result (Energy) */ Overflow = 0; move16(); } #ifdef BASOP_NOGLOB L_Energy = L_add_o(L_Energy, L_temp, &Overflow); #else L_Energy = L_add(L_Energy, L_temp); #endif } /* Calc Final Exponent (sub 2 because of the mult_r by 16384 that already divs the ener by 4) */ temp2 = sub(sub(shl(signal_exp, 1), temp2), 2); Loading