shithub: opus

Download patch

ref: 3fe0db172c334b4fc3fc773cb08d96867402b532
parent: 784959e8e99efb462e23000ab25e6ede9bb3700e
author: Jean-Marc Valin <[email protected]>
date: Fri Apr 18 17:00:06 EDT 2008

removed unneeded variable shifts from alg_quant()

--- a/libcelt/vq.c
+++ b/libcelt/vq.c
@@ -139,16 +139,10 @@
       int pulsesAtOnce=1;
       int best_id;
       celt_word16_t magnitude;
-#ifdef FIXED_POINT
-      int rshift;
-#endif
       /* Decide on how many pulses to find at once */
       pulsesAtOnce = (pulsesLeft*N_1)>>9; /* pulsesLeft/N */
       if (pulsesAtOnce<1)
          pulsesAtOnce = 1;
-#ifdef FIXED_POINT
-      rshift = yshift+1+celt_ilog2(K-pulsesLeft+pulsesAtOnce);
-#endif
       magnitude = SHL16(pulsesAtOnce, yshift);
 
       best_id = 0;
@@ -167,9 +161,9 @@
             /* Select sign based on X[j] alone */
             s = signx[j]*magnitude;
             /* Temporary sums of the new pulse(s) */
-            Rxy = EXTRACT16(SHR32(xy + MULT16_16(s,X[j]),rshift));
+            Rxy = EXTRACT16(SHR32(xy + MULT16_16(s,X[j]),14));
             /* We're multiplying y[j] by two so we don't have to do it here */
-            Ryy = EXTRACT16(SHR32(yy + MULT16_16(s,y[j]),rshift));
+            Ryy = EXTRACT16(SHR32(yy + MULT16_16(s,y[j]),14));
             
             /* Approximate score: we maximise Rxy/sqrt(Ryy) (we're guaranteed that 
                Rxy is positive because the sign is pre-computed) */