shithub: opus

Download patch

ref: 54fb7e5683b9f7fd4a54608afd7fb4f1dc30e546
parent: 8852563a2ece33b2e17c03ba508d3ede96e4b9a9
author: Jean-Marc Valin <[email protected]>
date: Fri Oct 15 07:26:32 EDT 2010

Tuning the bias for the L1 tf metric

--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -438,7 +438,12 @@
       L1 += celt_sqrt(L2);
    }
    L1 = MULT16_32_Q15(sqrtM_1[LM], L1);
-   bias = QCONST16(.25f,15)*LM/width;
+   if (width==1)
+      bias = QCONST16(.12f,15)*LM;
+   else if (width==2)
+      bias = QCONST16(.05f,15)*LM;
+   else
+      bias = QCONST16(.02f,15)*LM;
    L1 = MAC16_32_Q15(L1, bias, L1);
    return L1;
 }
@@ -466,13 +471,13 @@
       return 0;
    }
    if (nbCompressedBytes<40)
-      lambda = 10;
+      lambda = 12;
    else if (nbCompressedBytes<60)
-      lambda = 4;
+      lambda = 6;
    else if (nbCompressedBytes<100)
-      lambda = 2;
+      lambda = 4;
    else
-      lambda = 2;
+      lambda = 3;
 
    ALLOC(metric, len, int);
    ALLOC(tmp, (m->eBands[len]-m->eBands[len-1])<<LM, celt_norm);