Loading basic_math/log2.c +1 −1 Original line number Diff line number Diff line Loading @@ -185,7 +185,7 @@ Word32 pow_10(Word32 x , Word16 *Q) FOR(i =1 ;i <= n ;i++) { Overflow = 0; move16(); L_tmp = L_shl(L_tmp,i); L_tmp = L_shl_o(L_tmp,i, &Overflow); IF(Overflow) { count = add(count,1); Loading basic_op/basop32.c +14 −1 Original line number Diff line number Diff line Loading @@ -2720,7 +2720,11 @@ Word16 div_l (Word32 L_num, Word16 den) { | are performed if ORIGINAL_G7231 is defined. | |___________________________________________________________________________| */ Word16 i_mult (Word16 a, Word16 b) { #ifdef BASOP_NOGLOB Word16 i_mult_o (Word16 a, Word16 b, Flag* Overflow) { #else Word16 i_mult (Word16 a, Word16 b, Flag* Overflow) { #endif #ifdef ORIGINAL_G7231 return a * b; #else Loading @@ -2728,9 +2732,18 @@ Word16 i_mult (Word16 a, Word16 b) { #if (WMOPS) multiCounter[currCounter].i_mult++; #endif #ifdef BASOP_NOGLOB return saturate_o (c, Overflow); #else return saturate (c); #endif #endif } #ifdef BASOP_NOGLOB Word16 i_mult(Word16 a, Word16 b) { return i_mult_o(a, b, NULL); } #endif /* Loading basic_op/basop32.h +1 −0 Original line number Diff line number Diff line Loading @@ -145,6 +145,7 @@ Word32 L_msu0 (Word32 L_v3, Word16 v1, Word16 v2); /* 32-bit Msu w/o shift /* * Overflowing operators */ Word16 i_mult_o(Word16 a, Word16 b, Flag* Overflow); Word16 add_o (Word16 var1, Word16 var2, Flag * Overflow); Word16 sub_o (Word16 var1, Word16 var2, Flag * Overflow); Word16 shl_o (Word16 var1, Word16 var2, Flag * Overflow); Loading lib_com/basop_util.c +8 −1 Original line number Diff line number Diff line Loading @@ -1484,7 +1484,9 @@ Word32 Norm32Norm(const Word32 *x, const Word16 headroom, const Word16 length, W { Word32 L_tmp, L_tmp2; Word16 i, shift, tmp; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif move16(); shift = headroom; Loading @@ -1496,8 +1498,13 @@ Word32 Norm32Norm(const Word32 *x, const Word16 headroom, const Word16 length, W if (L_tmp2 >= 0) shift = sub(shift,1); if (L_tmp2 >= 0) L_tmp = L_shr(L_tmp, 2); #ifdef BASOP_NOGLOB tmp = round_fx_o(L_shl_o(x[i], shift, &Overflow), &Overflow); L_tmp = L_mac0_o(L_tmp, tmp, tmp, &Overflow); /* exponent = (1-shift*2) , Q(30+shift*2) */ #else tmp = round_fx(L_shl(x[i], shift)); L_tmp = L_mac0(L_tmp, tmp, tmp); /* exponent = (1-shift*2) , Q(30+shift*2) */ #endif } move16(); Loading lib_com/bitalloc_fx.c +7 −0 Original line number Diff line number Diff line Loading @@ -244,6 +244,9 @@ Word16 BitAllocF_fx ( Word16 tmp, exp1, exp2; Word32 Rsubband_w32_fx[NB_SFM]; /* Q15 */ Word16 B_w16_fx; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif /* BASOP_NOGLOB */ set32_fx( Rsubband_w32_fx, 0, NB_SFM); Loading Loading @@ -433,7 +436,11 @@ Word16 BitAllocF_fx ( exp1 = sub(norm_l(L_tmp2), 1); exp2 = norm_s(n); tmp = div_s(extract_h(L_shl(L_tmp2, exp1)), shl(n, exp2));/*15 + 15 + exp1 - 16 - exp2*/ #ifdef BASOP_NOGLOB m_fx = shl_o(tmp, sub(exp2, exp1), &Overflow);/*Q14*/ #else m_fx = shl(tmp, sub(exp2, exp1));/*Q14*/ #endif if (L_tmp1 < 0) { m_fx = negate(m_fx); Loading Loading
basic_math/log2.c +1 −1 Original line number Diff line number Diff line Loading @@ -185,7 +185,7 @@ Word32 pow_10(Word32 x , Word16 *Q) FOR(i =1 ;i <= n ;i++) { Overflow = 0; move16(); L_tmp = L_shl(L_tmp,i); L_tmp = L_shl_o(L_tmp,i, &Overflow); IF(Overflow) { count = add(count,1); Loading
basic_op/basop32.c +14 −1 Original line number Diff line number Diff line Loading @@ -2720,7 +2720,11 @@ Word16 div_l (Word32 L_num, Word16 den) { | are performed if ORIGINAL_G7231 is defined. | |___________________________________________________________________________| */ Word16 i_mult (Word16 a, Word16 b) { #ifdef BASOP_NOGLOB Word16 i_mult_o (Word16 a, Word16 b, Flag* Overflow) { #else Word16 i_mult (Word16 a, Word16 b, Flag* Overflow) { #endif #ifdef ORIGINAL_G7231 return a * b; #else Loading @@ -2728,9 +2732,18 @@ Word16 i_mult (Word16 a, Word16 b) { #if (WMOPS) multiCounter[currCounter].i_mult++; #endif #ifdef BASOP_NOGLOB return saturate_o (c, Overflow); #else return saturate (c); #endif #endif } #ifdef BASOP_NOGLOB Word16 i_mult(Word16 a, Word16 b) { return i_mult_o(a, b, NULL); } #endif /* Loading
basic_op/basop32.h +1 −0 Original line number Diff line number Diff line Loading @@ -145,6 +145,7 @@ Word32 L_msu0 (Word32 L_v3, Word16 v1, Word16 v2); /* 32-bit Msu w/o shift /* * Overflowing operators */ Word16 i_mult_o(Word16 a, Word16 b, Flag* Overflow); Word16 add_o (Word16 var1, Word16 var2, Flag * Overflow); Word16 sub_o (Word16 var1, Word16 var2, Flag * Overflow); Word16 shl_o (Word16 var1, Word16 var2, Flag * Overflow); Loading
lib_com/basop_util.c +8 −1 Original line number Diff line number Diff line Loading @@ -1484,7 +1484,9 @@ Word32 Norm32Norm(const Word32 *x, const Word16 headroom, const Word16 length, W { Word32 L_tmp, L_tmp2; Word16 i, shift, tmp; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif move16(); shift = headroom; Loading @@ -1496,8 +1498,13 @@ Word32 Norm32Norm(const Word32 *x, const Word16 headroom, const Word16 length, W if (L_tmp2 >= 0) shift = sub(shift,1); if (L_tmp2 >= 0) L_tmp = L_shr(L_tmp, 2); #ifdef BASOP_NOGLOB tmp = round_fx_o(L_shl_o(x[i], shift, &Overflow), &Overflow); L_tmp = L_mac0_o(L_tmp, tmp, tmp, &Overflow); /* exponent = (1-shift*2) , Q(30+shift*2) */ #else tmp = round_fx(L_shl(x[i], shift)); L_tmp = L_mac0(L_tmp, tmp, tmp); /* exponent = (1-shift*2) , Q(30+shift*2) */ #endif } move16(); Loading
lib_com/bitalloc_fx.c +7 −0 Original line number Diff line number Diff line Loading @@ -244,6 +244,9 @@ Word16 BitAllocF_fx ( Word16 tmp, exp1, exp2; Word32 Rsubband_w32_fx[NB_SFM]; /* Q15 */ Word16 B_w16_fx; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif /* BASOP_NOGLOB */ set32_fx( Rsubband_w32_fx, 0, NB_SFM); Loading Loading @@ -433,7 +436,11 @@ Word16 BitAllocF_fx ( exp1 = sub(norm_l(L_tmp2), 1); exp2 = norm_s(n); tmp = div_s(extract_h(L_shl(L_tmp2, exp1)), shl(n, exp2));/*15 + 15 + exp1 - 16 - exp2*/ #ifdef BASOP_NOGLOB m_fx = shl_o(tmp, sub(exp2, exp1), &Overflow);/*Q14*/ #else m_fx = shl(tmp, sub(exp2, exp1));/*Q14*/ #endif if (L_tmp1 < 0) { m_fx = negate(m_fx); Loading