ref: b21b2a404e546995a0b92b2874a613a103d5a626
parent: 0a3e79aa11e3d11f288fb996f9623ed07b63028d
author: Jean-Marc Valin <[email protected]>
date: Mon Jan 7 18:04:43 EST 2008
Switched to mdct mask computation
--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -265,12 +265,15 @@
//for (i=0;i<(B+1)*C*N;i++) printf ("%f(%d) ", in[i], i); printf ("\n");
/* Compute MDCTs */
compute_mdcts(&st->mdct_lookup, st->window, in, X, N, B, C);
-
- compute_masking(X, mask, B*C*N, st->Fs);
- /* Invert and stretch the mask to length of X */
- for (i=B*C*N-1;i>=0;i--)
- mask[i] = 1/(1+mask[i>>1]);
-
+
+ compute_mdct_masking(X, mask, B*C*N, st->Fs);
+
+ /* Invert and stretch the mask to length of X
+ For some reason, I get better results by using the sqrt instead,
+ although there's no valid reason to. Must investigate further */
+ for (i=0;i<B*C*N;i++)
+ mask[i] = 1/(.1+mask[i]);
+
/* Pitch analysis */
for (c=0;c<C;c++)
{