shithub: opus

Download patch

ref: f1c8fb106711362527442b897ce56bc176eb1211
parent: 32a1e6b6a37b17255be8fb5591ad315116076feb
author: Jean-Marc Valin <[email protected]>
date: Tue Aug 31 02:45:32 EDT 2010

qoffset tuning

--- a/libcelt/rate.c
+++ b/libcelt/rate.c
@@ -195,9 +195,9 @@
 
       /* Changing the offset for allocating the second and third fine energy bit */
       if (bits[j] + offset < den*2<<BITRES)
-         offset += (m->logN[j] + logM)*N*C>>BITRES-1;
+         offset += (m->logN[j] + logM)*N*C>>2;
       else if (bits[j] + offset < den*3<<BITRES)
-         offset += (m->logN[j] + logM)*N*C>>BITRES;
+         offset += (m->logN[j] + logM)*N*C>>3;
 
       ebits[j] = (bits[j] + offset + (den<<(BITRES-1))) / (den<<BITRES);
 
--- a/libcelt/rate.h
+++ b/libcelt/rate.h
@@ -41,7 +41,7 @@
 
 #define BITRES 3
 #define FINE_OFFSET 21
-#define QTHETA_OFFSET 6
+#define QTHETA_OFFSET 4
 #define QTHETA_OFFSET_STEREO 4
 
 #define BITOVERFLOW 30000