ref: ec9b6df35d12381a7db66509880a20f867c4be2c
parent: 000973f7e2ecc621d16761e65cd20e6a1e5055e9
author: Jean-Marc Valin <[email protected]>
date: Fri Mar 7 12:05:47 EST 2008
fixed-point: intra_fold() converted
--- a/libcelt/vq.c
+++ b/libcelt/vq.c
@@ -484,9 +484,9 @@
{
int i, j;
celt_word32_t E;
- float g;
+ celt_word16_t g;
- E = 1e-10;
+ E = EPSILON;
if (N0 >= Nmax/2)
{
for (i=0;i<B;i++)
@@ -504,9 +504,9 @@
E = MAC16_16(E, P[j],P[j]);
}
}
- g = NORM_SCALING/sqrt(E);
+ g = DIV32_16(SHL32(EXTEND32(1),14+8),celt_sqrt(E));
for (j=0;j<N;j++)
- P[j] *= g;
+ P[j] = PSHR32(MULT16_16(g, P[j]),8);
for (j=0;j<N;j++)
x[j] = P[j];
}