ref: 0da4f238e0771e35dedd12cd5c2c1da6a9374067
parent: 803ec8c6b4d959b6b1df4b2e8f253415c7b4c325
author: Jean-Marc Valin <[email protected]>
date: Sat Sep 24 20:11:46 EDT 2011
Avoiding more left shifts of negative values
--- a/celt/mathops.c
+++ b/celt/mathops.c
@@ -119,7 +119,7 @@
if (x==0)
return 0;
k = (celt_ilog2(x)>>1)-7;
- x = VSHR32(x, (k<<1));
+ x = VSHR32(x, 2*k);
n = x-32768;
rt = ADD16(C[0], MULT16_16_Q15(n, ADD16(C[1], MULT16_16_Q15(n, ADD16(C[2],
MULT16_16_Q15(n, ADD16(C[3], MULT16_16_Q15(n, (C[4])))))))));
--- a/celt/vq.c
+++ b/celt/vq.c
@@ -137,7 +137,7 @@
#ifdef FIXED_POINT
k = celt_ilog2(Ryy)>>1;
#endif
- t = VSHR32(Ryy, (k-7)<<1);
+ t = VSHR32(Ryy, 2*(k-7));
g = MULT16_16_P15(celt_rsqrt_norm(t),gain);
i=0;
@@ -378,7 +378,7 @@
#ifdef FIXED_POINT
k = celt_ilog2(E)>>1;
#endif
- t = VSHR32(E, (k-7)<<1);
+ t = VSHR32(E, 2*(k-7));
g = MULT16_16_P15(celt_rsqrt_norm(t),gain);
xptr = X;