From 20639c416c76d9213559bf1f681ec57b817c08a4 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Wed, 19 May 2010 16:10:12 -0400 Subject: [PATCH] Tuned the 5ms mode to have a band at 4 kHz and one at 8 kHz --- libcelt/modes.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libcelt/modes.c b/libcelt/modes.c index 478104f6..e01de39c 100644 --- a/libcelt/modes.c +++ b/libcelt/modes.c @@ -114,11 +114,22 @@ static const unsigned char band_allocation[BARK_BANDS*BITALLOC_SIZE] = }; #endif +static const celt_int16 eband5ms[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 17, 20, 23, 27, 33, 40, 48, 60, 78, 100}; + static celt_int16 *compute_ebands(celt_int32 Fs, int frame_size, int res, int *nbEBands) { celt_int16 *eBands; int i, lin, low, high, nBark, offset=0; + if (Fs == 400*(celt_int32)frame_size && Fs >= 40000) + { + *nbEBands = sizeof(eband5ms)/sizeof(eband5ms[0])-1; + eBands = celt_alloc(sizeof(celt_int16)*(*nbEBands+2)); + for (i=0;i<*nbEBands+2;i++) + eBands[i] = eband5ms[i]; + eBands[*nbEBands+1] = frame_size; + return eBands; + } /* Find the number of critical bands supported by our sampling rate */ for (nBark=1;nBark= Fs)