shithub: opus

Download patch

ref: b7ed44ba0a3df8a95c6e0fe9fc86245a5a6485d5
parent: 66fa639c53c60ed0c8b3599457776a282f23752d
author: Jean-Marc Valin <[email protected]>
date: Mon Feb 11 06:15:33 EST 2008

minor tweak to pitch weighting function, disabled some code that doesn't
do anything yet.

--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -233,6 +233,7 @@
    /* Compute MDCTs */
    compute_mdcts(&st->mdct_lookup, st->window, in, X, N, B, C);
 
+#if 0 /* Mask disabled until it can be made to do something useful */
    compute_mdct_masking(X, mask, B*C*N, st->Fs);
 
    /* Invert and stretch the mask to length of X 
@@ -240,7 +241,10 @@
       although there's no valid reason to. Must investigate further */
    for (i=0;i<B*C*N;i++)
       mask[i] = 1/(.1+mask[i]);
-
+#else
+   for (i=0;i<B*C*N;i++)
+      mask[i] = 1;
+#endif
    /* Pitch analysis */
    for (c=0;c<C;c++)
    {
--- a/libcelt/pitch.c
+++ b/libcelt/pitch.c
@@ -58,7 +58,7 @@
       float n;
       //n = 1.f/(1e1+sqrt(sqrt((X[2*i-1]*X[2*i-1] + X[2*i  ]*X[2*i  ])*(Y[2*i-1]*Y[2*i-1] + Y[2*i  ]*Y[2*i  ]))));
       //n = 1;
-      n = 1.f/pow(1+curve[i],.5)/(i+60);
+      n = 1.f/sqrt(1+curve[i]);
       //n = 1.f/(1+curve[i]);
       float tmp = X[2*i];
       X[2*i] = (X[2*i  ]*Y[2*i  ] + X[2*i+1]*Y[2*i+1])*n;