ref: 2b35de9164477f19fc80b1c916fddc9f32a2774e
parent: 679f5cc6754f19674b79d2b0d444ca0dd5b4c8a5
author: Jean-Marc Valin <[email protected]>
date: Thu Mar 13 13:55:03 EDT 2008
fixed-point: Using reciproqual instead of DIV32_16 for find_spectral_pitch()
--- a/libcelt/pitch.c
+++ b/libcelt/pitch.c
@@ -170,7 +170,8 @@
celt_word16_t n;
celt_word32_t tmp;
/*printf ("%d %d ", X[2*i]*X[2*i]+X[2*i+1]*X[2*i+1], Y[2*i]*Y[2*i]+Y[2*i+1]*Y[2*i+1]);*/
- n = DIV32_16(Q15ONE,celt_sqrt(EPSILON+curve[i]));
+ /*n = DIV32_16(Q15ONE,celt_sqrt(EPSILON+curve[i]));*/
+ n = ROUND(celt_rcp(celt_sqrt(EPSILON+curve[i])),16);
/*printf ("%f ", n);*/
tmp = X[2*i];
X[2*i] = MULT16_32_Q15(n, ADD32(MULT16_16(X[2*i ],Y[2*i ]), MULT16_16(X[2*i+1],Y[2*i+1])));