shithub: opus

Download patch

ref: bdfb73bc26bd1b292e4fc982044181618c9a90a2
parent: 48923ae9966c4c065c7cea776944155ca0617f34
author: Jean-Marc Valin <[email protected]>
date: Fri Jul 23 13:46:53 EDT 2010

Just removing old code that was commented out anyway

--- a/libcelt/pitch.c
+++ b/libcelt/pitch.c
@@ -113,39 +113,6 @@
       x_lp[0] += SHR32(HALF32(HALF32(x[C+1])+x[1]), SIG_SHIFT);
       *xmem += x[end-C+1];
    }
-
-#if 0
-   {
-      int j;
-      float ac[3]={0,0,0};
-      float ak[2];
-      float det;
-      celt_word16 mem[2];
-      for (i=0;i<3;i++)
-      {
-         for (j=0;j<(len>>1)-i;j++)
-         {
-            ac[i] += x_lp[j]*x_lp[j+i];
-         }
-      }
-      det = 1./(.1+ac[0]*ac[0]-ac[1]*ac[1]);
-      ak[0] = .9*det*(ac[0]*ac[1] - ac[1]*ac[2]);
-      ak[1] = .81*det*(-ac[1]*ac[1] + ac[0]*ac[2]);
-      /*printf ("%f %f %f\n", 1., -ak[0], -ak[1]);*/
-      mem[0]=filt_mem[0];
-      mem[1]=filt_mem[1];
-      filt_mem[0]=x_lp[(end>>1)-1];
-      filt_mem[1]=x_lp[(end>>1)-2];
-      for (j=0;j<len>>1;j++)
-      {
-         float tmp = x_lp[j];
-         x_lp[j] = x_lp[j] - ak[0]*mem[0] - ak[1]*mem[1];
-         mem[1]=mem[0];
-         mem[0]=tmp;
-      }
-   }
-#endif
-
 }
 
 void pitch_search(const CELTMode *m, const celt_word16 * restrict x_lp, celt_word16 * restrict y, int len, int max_pitch, int *pitch, celt_sig *xmem, int M)
--- a/libcelt/rate.h
+++ b/libcelt/rate.h
@@ -76,43 +76,6 @@
    lo = 0;
    hi = MAX_PULSES-1;
    
-#if 0 /* Disabled until we can make that useful */
-   /* Use of more than MAX_PULSES is disabled until we are able to cwrs that decently */
-   if (bits > cache[MAX_PULSES-1] && N<=4)
-   {
-      /*int pulses;
-      pulses = 127;
-      while (16 + log2_frac(2*(pulses+1)*(pulses+1) + 1, BITRES) <= bits && pulses < 32767)
-         pulses++;*/
-      lo = 127;
-      switch (N)
-      {
-         case 3:
-            hi = 1024;
-            for (i=0;i<10;i++)
-            {
-               int pulses = (lo+hi)>>1;
-               if (log2_frac(((UMUL16_16(pulses,pulses)>>1)+1)>>1, BITRES) > bits)
-                  hi = pulses;
-               else
-                  lo = pulses;
-            }
-            break;
-         case 4:
-            hi = 1024;
-            for (i=0;i<10;i++)
-            {
-               int pulses = (lo+hi)>>1;
-               if (log2_frac((UMUL32(UMUL16_16(pulses,pulses)+2,pulses))/3<<3, BITRES) > bits)
-                  hi = pulses;
-               else
-                  lo = pulses;
-            }
-            break;
-      }
-      return lo;
-   }
-#endif
    /* Instead of using the "bisection condition" we use a fixed number of 
    iterations because it should be faster */
    /*while (hi-lo != 1)*/
@@ -134,23 +97,6 @@
 
 static inline int pulses2bits(const celt_int16 *cache, int N, int pulses)
 {
-#if 0 /* Use of more than MAX_PULSES is disabled until we are able to cwrs that decently */
-   if (pulses > 127)
-   {
-      int bits;
-      switch (N)
-      {
-         case 3:
-            bits = log2_frac(((UMUL16_16(pulses,pulses)>>1)+1)>>1, BITRES);
-            break;
-         case 4:
-            bits = log2_frac((UMUL32(UMUL16_16(pulses,pulses)+2,pulses))/3<<3, BITRES);
-            break;
-      }
-      /*printf ("%d <- %d\n", bits, pulses);*/
-      return bits;
-   }
-#endif
    return cache[pulses];
 }