From 94491653e0f0d0c9b1ce4c5da321b4799cccf060 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Thu, 21 Oct 2010 17:10:24 -0400 Subject: [PATCH] Alternate tuning found using exp_tuning_knobs (disabled by default) --- libcelt/modes.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/libcelt/modes.c b/libcelt/modes.c index a2779404..212102e7 100644 --- a/libcelt/modes.c +++ b/libcelt/modes.c @@ -63,6 +63,34 @@ static const unsigned char band_allocation[] = { 255,255,224,224,224,224,224,224,224,192,192,192,192,192,192,192,192,192,192,192,120, }; +#else + +#if 1 +/* Alternate tuning based on exp_tuning_knobs from 2010/10/21: + 87 5 25 14 300 +120 5 25 16 400 +125 5 25 17 500 +130 5 24 18 600 +130 5 24 19 920 +140 7 24 20 1240 +170 7 20 21 2000 +120 5 20 21 4000 + */ + +#define BITALLOC_SIZE 9 +/* Bit allocation table in units of 1/32 bit/sample (0.1875 dB SNR) */ +static const unsigned char band_allocation[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 99, 99, 90, 84, 78, 71, 65, 58, 51, 45, 39, 32, 26, 20, 1, 0, 0, 0, 0, 0, 0, +124,124,109, 98, 88, 77, 71, 65, 59, 52, 46, 40, 34, 27, 21, 15, 1, 0, 0, 0, 0, +132,132,117,107, 97, 87, 80, 74, 68, 62, 55, 49, 43, 37, 30, 23, 17, 1, 1, 0, 0, +138,138,123,112,102, 91, 85, 79, 73, 67, 61, 55, 49, 43, 37, 31, 25, 19, 1, 0, 0, +152,152,139,130,120,110,104, 98, 92, 86, 80, 74, 68, 62, 56, 50, 44, 38, 32, 8, 0, +167,167,154,145,136,127,117,108,102, 96, 90, 84, 78, 72, 66, 60, 54, 48, 42, 36, 2, +215,215,194,180,165,151,137,121,116,111,106,101, 96, 91, 86, 81, 76, 71, 66, 61, 56, +240,240,239,233,225,218,211,203,198,193,188,183,178,173,168,163,158,153,148,143,138, +}; + #else /* Alternate tuning (partially derived from Vorbis) */ #define BITALLOC_SIZE 11 @@ -80,7 +108,7 @@ static const unsigned char band_allocation[] = { 219,216,207,197,190,183,176,173,166,164,161,157,150,142,139,138,129,119,113,102, 80, 229,229,224,222,223,224,224,225,222,221,221,220,220,219,218,200,178,154,146,130,102, }; - +#endif #endif #ifdef STATIC_MODES