removed useless comments

This commit is contained in:
Jean-Marc Valin 2009-07-04 22:46:38 -04:00
parent 66e7816833
commit ece2cfa2d2
8 changed files with 0 additions and 56 deletions

View file

@ -248,14 +248,7 @@ int compute_pitch_gain(const CELTMode *m, const celt_norm_t *X, const celt_norm_
gains[i] = EXTRACT16(celt_div(Sxy,ADD32(SHR32(Sxx, PGAIN_SHIFT),EPSILON))); gains[i] = EXTRACT16(celt_div(Sxy,ADD32(SHR32(Sxx, PGAIN_SHIFT),EPSILON)));
if (gains[i]>QCONST16(.5,15)) if (gains[i]>QCONST16(.5,15))
gain_sum++; 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; return gain_sum > 5;
} }
@ -411,11 +404,6 @@ void quant_bands(const CELTMode *m, celt_norm_t * restrict X, celt_norm_t *P, ce
norm = _norm; norm = _norm;
balance = 0; 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++) for (i=0;i<m->nbEBands;i++)
{ {
int tell; int tell;
@ -512,11 +500,6 @@ void quant_bands_stereo(const CELTMode *m, celt_norm_t * restrict X, celt_norm_t
norm = _norm; norm = _norm;
balance = 0; 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++) for (i=0;i<m->nbEBands;i++)
{ {
int tell; int tell;
@ -863,11 +846,6 @@ void unquant_bands_stereo(const CELTMode *m, celt_norm_t * restrict X, celt_norm
norm = _norm; norm = _norm;
balance = 0; 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++) for (i=0;i<m->nbEBands;i++)
{ {
int tell; int tell;

View file

@ -240,7 +240,6 @@ static int transient_analysis(celt_word32_t *in, int len, int C, int *transient_
{ {
int c, i, n; int c, i, n;
celt_word32_t ratio; celt_word32_t ratio;
/* FIXME: Remove the floats here */
VARDECL(celt_word32_t, begin); VARDECL(celt_word32_t, begin);
SAVE_STACK; SAVE_STACK;
ALLOC(begin, len, celt_word32_t); ALLOC(begin, len, celt_word32_t);
@ -266,7 +265,6 @@ static int transient_analysis(celt_word32_t *in, int len, int C, int *transient_
} else { } else {
ratio = DIV32(begin[len-1],1+begin[n-16]); ratio = DIV32(begin[len-1],1+begin[n-16]);
} }
/*printf ("%d %f\n", n, ratio*ratio);*/
if (ratio < 0) if (ratio < 0)
ratio = 0; ratio = 0;
if (ratio > 1000) if (ratio > 1000)
@ -1424,7 +1422,6 @@ int celt_decode_float(CELTDecoder * restrict st, const unsigned char *data, int
RESTORE_STACK; RESTORE_STACK;
return 0; return 0;
/*printf ("\n");*/
} }
#ifdef FIXED_POINT #ifdef FIXED_POINT

View file

@ -84,8 +84,6 @@ void ec_laplace_encode_start(ec_enc *enc, int *value, int decay, int fs)
fl = 0; fl = 0;
if (s) if (s)
fl += fs; fl += fs;
/*DEBUG*/
/*printf ("enc: %d %d %d\n", fl, fs, ft);*/
ec_encode(enc, fl, fl+fs, ft); ec_encode(enc, fl, fl+fs, ft);
} }
@ -105,8 +103,6 @@ int ec_laplace_decode_start(ec_dec *dec, int decay, int fs)
ft = 32768; ft = 32768;
fh = fs; fh = fs;
fm = ec_decode(dec, ft); fm = ec_decode(dec, ft);
/*DEBUG*/
/*printf ("fm: %d/%d\n", fm, ft);*/
while (fm >= fh && fs != 0) while (fm >= fh && fs != 0)
{ {
fl = fh; fl = fh;
@ -131,8 +127,6 @@ int ec_laplace_decode_start(ec_dec *dec, int decay, int fs)
/* Preventing an infinite loop in case something screws up in the decoding */ /* Preventing an infinite loop in case something screws up in the decoding */
if (fl==fh) if (fl==fh)
fl--; fl--;
/*DEBUG*/
/*printf ("update: %d %d %d\n", fl, fh, ft);*/
ec_dec_update(dec, fl, fh, ft); ec_dec_update(dec, fl, fh, ft);
return val; return val;
} }

View file

@ -130,7 +130,6 @@ static inline float celt_log2(float x)
frac = in.f - 1.5; frac = in.f - 1.5;
/* -0.41446 0.96093 -0.33981 0.15600 */ /* -0.41446 0.96093 -0.33981 0.15600 */
frac = -0.41446 + frac*(0.96093 + frac*(-0.33981 + frac*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; return 1+integer+frac;
} }
@ -150,7 +149,6 @@ static inline float celt_exp2(float x)
/* K0 = 1, K1 = log(2), K2 = 3-4*log(2), K3 = 3*log(2) - 2 */ /* 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.f = 1.f + frac * (0.696147f + frac * (0.224411f + 0.079442f*frac));
res.i = (res.i + (integer<<23)) & 0x7fffffff; res.i = (res.i + (integer<<23)) & 0x7fffffff;
/*printf ("%f %f %f %f\n", x, frac, exp2(x), res.f);*/
return res.f; return res.f;
} }
@ -289,7 +287,6 @@ static inline celt_word16_t celt_log2(celt_word32_t x)
i = celt_ilog2(x); i = celt_ilog2(x);
n = VSHR32(x,i-15)-32768-16384; 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]))))))); 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); return SHL16(i-13,8)+SHR16(frac,14-8);
} }

View file

@ -134,7 +134,6 @@ static celt_int16_t *compute_ebands(celt_int32_t Fs, int frame_size, int *nbEBan
int i, res, min_width, lin, low, high, nBark; int i, res, min_width, lin, low, high, nBark;
res = (Fs+frame_size)/(2*frame_size); res = (Fs+frame_size)/(2*frame_size);
min_width = MIN_BINS*res; min_width = MIN_BINS*res;
/*printf ("min_width = %d\n", min_width);*/
/* Find the number of critical bands supported by our sampling rate */ /* Find the number of critical bands supported by our sampling rate */
for (nBark=1;nBark<BARK_BANDS;nBark++) for (nBark=1;nBark<BARK_BANDS;nBark++)
@ -146,7 +145,6 @@ static celt_int16_t *compute_ebands(celt_int32_t Fs, int frame_size, int *nbEBan
if (bark_freq[lin+1]-bark_freq[lin] >= min_width) if (bark_freq[lin+1]-bark_freq[lin] >= min_width)
break; break;
/*printf ("lin = %d (%d Hz)\n", lin, bark_freq[lin]);*/
low = ((bark_freq[lin]/res)+(MIN_BINS-1))/MIN_BINS; low = ((bark_freq[lin]/res)+(MIN_BINS-1))/MIN_BINS;
high = nBark-lin; high = nBark-lin;
*nbEBands = low+high; *nbEBands = low+high;
@ -171,10 +169,6 @@ static celt_int16_t *compute_ebands(celt_int32_t Fs, int frame_size, int *nbEBan
eBands[*nbEBands] = eBands[*nbEBands+1]; eBands[*nbEBands] = eBands[*nbEBands+1];
/* FIXME: Remove last band if too small */ /* FIXME: Remove last band if too small */
/*for (i=0;i<*nbEBands+2;i++)
printf("%d ", eBands[i]);
printf ("\n");
exit(1);*/
return eBands; return eBands;
} }
@ -200,7 +194,6 @@ static void compute_pbands(CELTMode *mode, int res)
for (j=0;j<mode->nbEBands;j++) for (j=0;j<mode->nbEBands;j++)
if (mode->eBands[j] <= pBands[i] && mode->eBands[j+1] > pBands[i]) if (mode->eBands[j] <= pBands[i] && mode->eBands[j+1] > pBands[i])
break; break;
/*printf ("%d %d\n", i, j);*/
if (mode->eBands[j] != pBands[i]) if (mode->eBands[j] != pBands[i])
{ {
if (pBands[i]-mode->eBands[j] < mode->eBands[j+1]-pBands[i] && if (pBands[i]-mode->eBands[j] < mode->eBands[j+1]-pBands[i] &&
@ -210,9 +203,6 @@ static void compute_pbands(CELTMode *mode, int res)
pBands[i] = mode->eBands[j+1]; pBands[i] = mode->eBands[j+1];
} }
} }
/*for (i=0;i<mode->nbPBands+2;i++)
printf("%d ", pBands[i]);
printf ("\n");*/
mode->pitchEnd = pBands[PBANDS]; mode->pitchEnd = pBands[PBANDS];
} }
@ -394,7 +384,6 @@ CELTMode *celt_mode_create(celt_int32_t Fs, int channels, int frame_size, int *e
compute_allocation_table(mode, res); compute_allocation_table(mode, res);
if (mode->allocVectors==NULL) if (mode->allocVectors==NULL)
goto failure; goto failure;
/*printf ("%d bands\n", mode->nbEBands);*/
window = (celt_word16_t*)celt_alloc(mode->overlap*sizeof(celt_word16_t)); window = (celt_word16_t*)celt_alloc(mode->overlap*sizeof(celt_word16_t));
if (window==NULL) if (window==NULL)

View file

@ -85,7 +85,6 @@ static void spreading_func(const struct PsyDecay *d, celt_word32_t * restrict ps
{ {
int i; int i;
celt_word32_t mem; celt_word32_t mem;
/*for (i=0;i<len;i++) printf ("%f ", psd[i]);*/
/* Compute right slope (-10 dB/Bark) */ /* Compute right slope (-10 dB/Bark) */
mem=psd[0]; mem=psd[0];
for (i=0;i<len;i++) for (i=0;i<len;i++)
@ -105,7 +104,6 @@ static void spreading_func(const struct PsyDecay *d, celt_word32_t * restrict ps
psd[i] = EPSILON + psd[i] + MULT16_32_Q15(decayL,mem-psd[i]); psd[i] = EPSILON + psd[i] + MULT16_32_Q15(decayL,mem-psd[i]);
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 */ #if 0 /* Prints signal and mask energy per critical band */
for (i=0;i<25;i++) for (i=0;i<25;i++)
{ {

View file

@ -126,7 +126,6 @@ extern char *global_stack_top;
#else #else
/* FIXME: Only align up to a certain size (not for structs) */
#define ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1)) #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 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) #define RESTORE_STACK (global_stack = _saved_stack)

View file

@ -57,8 +57,6 @@ static void mix_pitch_and_residual(int * restrict iy, celt_norm_t * restrict X,
#endif #endif
ALLOC(y, N, celt_norm_t); ALLOC(y, N, celt_norm_t);
/*for (i=0;i<N;i++)
printf ("%d ", iy[i]);*/
Rpp = 0; Rpp = 0;
i=0; i=0;
do { do {
@ -162,8 +160,6 @@ void alg_quant(celt_norm_t *X, celt_mask_t *W, int N, int K, celt_norm_t *P, ec_
} }
/* Do we have sufficient accuracy here? */ /* Do we have sufficient accuracy here? */
rcp = EXTRACT16(MULT16_32_Q16(K-1, celt_rcp(sum))); 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 { j=0; do {
#ifdef FIXED_POINT #ifdef FIXED_POINT
/* It's really important to round *towards zero* here */ /* It's really important to round *towards zero* here */
@ -179,8 +175,6 @@ void alg_quant(celt_norm_t *X, celt_mask_t *W, int N, int K, celt_norm_t *P, ec_
pulsesLeft -= iy[j]; pulsesLeft -= iy[j];
} while (++j<N); } 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"); celt_assert2(pulsesLeft>=1, "Allocated too many pulses in the quick pass");
while (pulsesLeft > 1) while (pulsesLeft > 1)
@ -335,8 +329,6 @@ celt_word16_t renormalise_vector(celt_norm_t *X, celt_word16_t value, int N, int
} }
rE = celt_sqrt(E); rE = celt_sqrt(E);
/*if (celt_rcp(SHL32(rE,9))>32767)
fprintf (stderr, "celt_rcp: %d %d\n",rE, E); */
#ifdef FIXED_POINT #ifdef FIXED_POINT
if (rE <= 128) if (rE <= 128)
g = Q15ONE; g = Q15ONE;