shithub: opus

Download patch

ref: ece2cfa2d2adf2b705b9779daf2f17f54431dd1f
parent: 66e7816833b831751a4609a01c0116f54340ac9d
author: Jean-Marc Valin <[email protected]>
date: Sat Jul 4 18:46:38 EDT 2009

removed useless comments

--- a/libcelt/bands.c
+++ b/libcelt/bands.c
@@ -248,14 +248,7 @@
       gains[i] = EXTRACT16(celt_div(Sxy,ADD32(SHR32(Sxx, PGAIN_SHIFT),EPSILON)));
       if (gains[i]>QCONST16(.5,15))
          gain_sum++;
-      /*printf ("%f ", 1-sqrt(1-gain*gain));*/
    }
-   /*if(rand()%10==0)
-   {
-      for (i=0;i<m->nbPBands;i++)
-         printf ("%f ", 1-sqrt(1-gains[i]*gains[i]));
-      printf ("\n");
-   }*/
    return gain_sum > 5;
 }
 
@@ -411,12 +404,7 @@
    norm = _norm;
 
    balance = 0;
-   /*printf("bits left: %d\n", bits);
    for (i=0;i<m->nbEBands;i++)
-      printf ("(%d %d) ", pulses[i], ebits[i]);
-   printf ("\n");*/
-   /*printf ("%d %d\n", ec_enc_tell(enc, 0), compute_allocation(m, m->nbPulses));*/
-   for (i=0;i<m->nbEBands;i++)
    {
       int tell;
       int N;
@@ -512,12 +500,7 @@
    norm = _norm;
 
    balance = 0;
-   /*printf("bits left: %d\n", bits);
    for (i=0;i<m->nbEBands;i++)
-   printf ("(%d %d) ", pulses[i], ebits[i]);
-   printf ("\n");*/
-   /*printf ("%d %d\n", ec_enc_tell(enc, 0), compute_allocation(m, m->nbPulses));*/
-   for (i=0;i<m->nbEBands;i++)
    {
       int tell;
       int q1, q2;
@@ -863,11 +846,6 @@
    norm = _norm;
 
    balance = 0;
-   /*printf("bits left: %d\n", bits);
-   for (i=0;i<m->nbEBands;i++)
-   printf ("(%d %d) ", pulses[i], ebits[i]);
-   printf ("\n");*/
-   /*printf ("%d %d\n", ec_enc_tell(enc, 0), compute_allocation(m, m->nbPulses));*/
    for (i=0;i<m->nbEBands;i++)
    {
       int tell;
--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -240,7 +240,6 @@
 {
    int c, i, n;
    celt_word32_t ratio;
-   /* FIXME: Remove the floats here */
    VARDECL(celt_word32_t, begin);
    SAVE_STACK;
    ALLOC(begin, len, celt_word32_t);
@@ -266,7 +265,6 @@
    } else {
       ratio = DIV32(begin[len-1],1+begin[n-16]);
    }
-   /*printf ("%d %f\n", n, ratio*ratio);*/
    if (ratio < 0)
       ratio = 0;
    if (ratio > 1000)
@@ -1424,7 +1422,6 @@
 
    RESTORE_STACK;
    return 0;
-   /*printf ("\n");*/
 }
 
 #ifdef FIXED_POINT
--- a/libcelt/laplace.c
+++ b/libcelt/laplace.c
@@ -84,8 +84,6 @@
       fl = 0;
    if (s)
       fl += fs;
-   /*DEBUG*/
-   /*printf ("enc: %d %d %d\n", fl, fs, ft);*/
    ec_encode(enc, fl, fl+fs, ft);
 }
 
@@ -105,8 +103,6 @@
    ft = 32768;
    fh = fs;
    fm = ec_decode(dec, ft);
-   /*DEBUG*/
-   /*printf ("fm: %d/%d\n", fm, ft);*/
    while (fm >= fh && fs != 0)
    {
       fl = fh;
@@ -131,8 +127,6 @@
    /* Preventing an infinite loop in case something screws up in the decoding */
    if (fl==fh)
       fl--;
-   /*DEBUG*/
-   /*printf ("update: %d %d %d\n", fl, fh, ft);*/
    ec_dec_update(dec, fl, fh, ft);
    return val;
 }
--- a/libcelt/mathops.h
+++ b/libcelt/mathops.h
@@ -130,7 +130,6 @@
    frac = in.f - 1.5;
    /* -0.41446   0.96093  -0.33981   0.15600 */
    frac = -0.41446 + frac*(0.96093 + frac*(-0.33981 + frac*0.15600));
-   /*printf ("%f %d %f %f %f %f\n", x, integer, in.f, frac, log2(x), 1+integer+frac);*/
    return 1+integer+frac;
 }
 
@@ -150,7 +149,6 @@
    /* K0 = 1, K1 = log(2), K2 = 3-4*log(2), K3 = 3*log(2) - 2 */
    res.f = 1.f + frac * (0.696147f + frac * (0.224411f + 0.079442f*frac));
    res.i = (res.i + (integer<<23)) & 0x7fffffff;
-   /*printf ("%f %f %f %f\n", x, frac, exp2(x), res.f);*/
    return res.f;
 }
 
@@ -289,7 +287,6 @@
    i = celt_ilog2(x);
    n = VSHR32(x,i-15)-32768-16384;
    frac = ADD16(C[0], MULT16_16_Q14(n, ADD16(C[1], MULT16_16_Q14(n, ADD16(C[2], MULT16_16_Q14(n, (C[3])))))));
-   /*printf ("%d %d %d %d\n", x, n, ret, SHL16(i-13,8)+SHR16(ret,14-8));*/
    return SHL16(i-13,8)+SHR16(frac,14-8);
 }
 
--- a/libcelt/modes.c
+++ b/libcelt/modes.c
@@ -134,7 +134,6 @@
    int i, res, min_width, lin, low, high, nBark;
    res = (Fs+frame_size)/(2*frame_size);
    min_width = MIN_BINS*res;
-   /*printf ("min_width = %d\n", min_width);*/
 
    /* Find the number of critical bands supported by our sampling rate */
    for (nBark=1;nBark<BARK_BANDS;nBark++)
@@ -146,7 +145,6 @@
       if (bark_freq[lin+1]-bark_freq[lin] >= min_width)
          break;
    
-   /*printf ("lin = %d (%d Hz)\n", lin, bark_freq[lin]);*/
    low = ((bark_freq[lin]/res)+(MIN_BINS-1))/MIN_BINS;
    high = nBark-lin;
    *nbEBands = low+high;
@@ -171,10 +169,6 @@
       eBands[*nbEBands] = eBands[*nbEBands+1];
    
    /* FIXME: Remove last band if too small */
-   /*for (i=0;i<*nbEBands+2;i++)
-      printf("%d ", eBands[i]);
-   printf ("\n");
-   exit(1);*/
    return eBands;
 }
 
@@ -200,7 +194,6 @@
       for (j=0;j<mode->nbEBands;j++)
          if (mode->eBands[j] <= pBands[i] && mode->eBands[j+1] > pBands[i])
             break;
-      /*printf ("%d %d\n", i, j);*/
       if (mode->eBands[j] != pBands[i])
       {
          if (pBands[i]-mode->eBands[j] < mode->eBands[j+1]-pBands[i] && 
@@ -210,9 +203,6 @@
             pBands[i] = mode->eBands[j+1];
       }
    }
-   /*for (i=0;i<mode->nbPBands+2;i++)
-      printf("%d ", pBands[i]);
-   printf ("\n");*/
    mode->pitchEnd = pBands[PBANDS];
 }
 
@@ -394,7 +384,6 @@
    compute_allocation_table(mode, res);
    if (mode->allocVectors==NULL)
       goto failure;
-   /*printf ("%d bands\n", mode->nbEBands);*/
    
    window = (celt_word16_t*)celt_alloc(mode->overlap*sizeof(celt_word16_t));
    if (window==NULL)
--- a/libcelt/psy.c
+++ b/libcelt/psy.c
@@ -85,7 +85,6 @@
 {
    int i;
    celt_word32_t mem;
-   /*for (i=0;i<len;i++) printf ("%f ", psd[i]);*/
    /* Compute right slope (-10 dB/Bark) */
    mem=psd[0];
    for (i=0;i<len;i++)
@@ -105,7 +104,6 @@
       psd[i] = EPSILON + psd[i] + MULT16_32_Q15(decayL,mem-psd[i]);
       mem = psd[i];
    }
-   /*for (i=0;i<len;i++) printf ("%f ", mask[i]); printf ("\n");*/
 #if 0 /* Prints signal and mask energy per critical band */
    for (i=0;i<25;i++)
    {
--- a/libcelt/stack_alloc.h
+++ b/libcelt/stack_alloc.h
@@ -126,7 +126,6 @@
 
 #else 
 
-/* FIXME: Only align up to a certain size (not for structs) */
 #define ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1))
 #define PUSH(stack, size, type) (ALIGN((stack),sizeof(type)/sizeof(char)),(stack)+=(size)*(sizeof(type)/sizeof(char)),(type*)((stack)-(size)*(sizeof(type)/sizeof(char))))
 #define RESTORE_STACK (global_stack = _saved_stack)
--- a/libcelt/vq.c
+++ b/libcelt/vq.c
@@ -57,8 +57,6 @@
 #endif
    ALLOC(y, N, celt_norm_t);
 
-   /*for (i=0;i<N;i++)
-   printf ("%d ", iy[i]);*/
    Rpp = 0;
    i=0;
    do {
@@ -162,8 +160,6 @@
       }
       /* Do we have sufficient accuracy here? */
       rcp = EXTRACT16(MULT16_32_Q16(K-1, celt_rcp(sum)));
-      /*rcp = DIV32(SHL32(EXTEND32(K-1),15),EPSILON+sum);*/
-      /*printf ("%d (%d %d)\n", rcp, N, K);*/
       j=0; do {
 #ifdef FIXED_POINT
          /* It's really important to round *towards zero* here */
@@ -179,8 +175,6 @@
          pulsesLeft -= iy[j];
       }  while (++j<N);
    }
-   /*if (pulsesLeft > N+2)
-      printf ("%d / %d (%d)\n", pulsesLeft, K, N);*/
    celt_assert2(pulsesLeft>=1, "Allocated too many pulses in the quick pass");
 
    while (pulsesLeft > 1)
@@ -335,8 +329,6 @@
    }
 
    rE = celt_sqrt(E);
-   /*if (celt_rcp(SHL32(rE,9))>32767)
-      fprintf (stderr, "celt_rcp: %d %d\n",rE, E); */
 #ifdef FIXED_POINT
    if (rE <= 128)
       g = Q15ONE;