shithub: opus

Download patch

ref: c992a0d7615b45e64d12dabe415ed8eff29d7b00
parent: 54d84c01304c4341de11febf0050afeac54060b6
author: Jean-Marc Valin <[email protected]>
date: Fri Nov 19 09:06:10 EST 2010

New bit allocation tuning now enabled by default

--- a/libcelt/modes.c
+++ b/libcelt/modes.c
@@ -46,7 +46,7 @@
   0,  1,  2,  3,  4,  5,  6,  7,  8, 10, 12, 14, 16, 20, 24, 28, 34, 40, 48, 60, 78, 100
 };
 
-#if 1
+#if 0
 
 #define BITALLOC_SIZE 9
 /* Bit allocation table in units of 1/32 bit/sample (0.1875 dB SNR) */
@@ -66,17 +66,18 @@
 #else
 
 /* Alternate tuning (partially derived from Vorbis) */
-#define BITALLOC_SIZE 9
+#define BITALLOC_SIZE 10
 /* Bit allocation table in units of 1/32 bit/sample (0.1875 dB SNR) */
 static const unsigned char band_allocation[] = {
 /*0  200 400 600 800  1k 1.2 1.4 1.6  2k 2.4 2.8 3.2  4k 4.8 5.6 6.8  8k 9.6 12k 15.6 */
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+ 90, 80, 75, 69, 63, 56, 49, 40, 34, 29, 20, 18, 10,  0,  0,  0,  0,  0,  0,  0,  0,
 110,100, 90, 84, 78, 71, 65, 58, 51, 45, 39, 32, 26, 20, 12,  0,  0,  0,  0,  0,  0,
-124,116,109, 98, 88, 77, 71, 65, 59, 52, 46, 40, 34, 27, 21, 15, 12,  0,  0,  0,  0,
-132,125,117,107, 97, 87, 80, 74, 68, 62, 55, 49, 43, 37, 30, 23, 17, 12,  1,  0,  0,
+118,110,103, 93, 86, 80, 75, 70, 65, 59, 53, 47, 40, 31, 23, 15,  4,  0,  0,  0,  0,
+126,119,112,104, 95, 89, 83, 78, 72, 66, 60, 54, 47, 39, 32, 25, 17, 12,  1,  0,  0,
 134,127,120,114,103, 97, 91, 85, 78, 72, 66, 60, 54, 47, 41, 35, 29, 23, 16, 10,  1,
 144,137,130,124,113,107,101, 95, 88, 82, 76, 70, 64, 57, 51, 45, 39, 33, 26, 20,  2,
-152,145,138,132,123,117,111,105, 98, 92, 86, 80, 74, 67, 61, 55, 49, 43, 36, 30, 4,
+152,145,138,132,123,117,111,105, 98, 92, 86, 80, 74, 67, 61, 55, 49, 43, 36, 30,  4,
 172,165,158,152,143,137,131,125,118,112,106,100, 94, 87, 81, 75, 69, 63, 56, 50, 12,
 200,200,200,200,200,200,200,200,198,193,188,183,178,173,168,163,158,153,148,143,138,
 };