shithub: opus

Download patch

ref: 581fdba93690627d3a0faf61749596cf0284cd16
parent: 163b76e8c4a8ad3f33199e4d72526149a1e34911
author: Jean-Marc Valin <[email protected]>
date: Fri May 28 02:56:23 EDT 2010

changing probability of first tf resolution symbol

--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -579,8 +579,10 @@
    for (i=1;i<len-1;i++)
       if (tf_res[i] != tf_res[i-1] && tf_res[i] != tf_res[i+1])
          tf_res[i] = tf_res[i+1];
-   curr = 0;
-   for (i=0;i<len;i++)
+
+   ec_enc_bit_prob(enc, tf_res[0], isTransient ? 64 : 16);
+   curr = tf_res[0];
+   for (i=1;i<len;i++)
    {
       ec_enc_bit_prob(enc, tf_res[i], curr ? 240: 16);
       curr = tf_res[i];
@@ -591,13 +593,14 @@
 static void tf_decode(int len, int C, int isTransient, int *tf_res, ec_dec *dec)
 {
    int i, curr;
-   curr = 0;
-   for (i=0;i<len;i++)
+
+   tf_res[0] = ec_dec_bit_prob(dec, isTransient ? 64 : 16);
+   curr = tf_res[0];
+   for (i=1;i<len;i++)
    {
       tf_res[i] = ec_dec_bit_prob(dec, curr ? 240: 16);
       curr = tf_res[i];
    }
-
 }
 
 #ifdef FIXED_POINT