Jean-Marc Valin | ecb36a3 | 2007-12-05 01:31:49 +1100 | [diff] [blame] | 1 | /* (C) 2007 Jean-Marc Valin, CSIRO |
| 2 | */ |
| 3 | /* |
| 4 | Redistribution and use in source and binary forms, with or without |
| 5 | modification, are permitted provided that the following conditions |
| 6 | are met: |
| 7 | |
| 8 | - Redistributions of source code must retain the above copyright |
| 9 | notice, this list of conditions and the following disclaimer. |
| 10 | |
| 11 | - Redistributions in binary form must reproduce the above copyright |
| 12 | notice, this list of conditions and the following disclaimer in the |
| 13 | documentation and/or other materials provided with the distribution. |
| 14 | |
| 15 | - Neither the name of the Xiph.org Foundation nor the names of its |
| 16 | contributors may be used to endorse or promote products derived from |
| 17 | this software without specific prior written permission. |
| 18 | |
| 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR |
| 23 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 24 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 25 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 26 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
| 27 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 28 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 | */ |
| 31 | |
| 32 | #include "modes.h" |
Jean-Marc Valin | 81a8295 | 2008-02-17 22:41:29 +1100 | [diff] [blame] | 33 | #include "os_support.h" |
Jean-Marc Valin | ecb36a3 | 2007-12-05 01:31:49 +1100 | [diff] [blame] | 34 | |
Jean-Marc Valin | 36d78e6 | 2007-12-13 14:59:30 +1100 | [diff] [blame] | 35 | #define NBANDS 18 |
Jean-Marc Valin | 2875f6b | 2008-01-05 13:32:32 +1100 | [diff] [blame] | 36 | #define PBANDS 8 |
Jean-Marc Valin | 95c59ea | 2008-01-08 16:22:37 +1100 | [diff] [blame] | 37 | #define PITCH_END 74 |
Jean-Marc Valin | 36d78e6 | 2007-12-13 14:59:30 +1100 | [diff] [blame] | 38 | |
Jean-Marc Valin | ecb36a3 | 2007-12-05 01:31:49 +1100 | [diff] [blame] | 39 | #define NBANDS128 15 |
Jean-Marc Valin | 2875f6b | 2008-01-05 13:32:32 +1100 | [diff] [blame] | 40 | #define PBANDS128 8 |
| 41 | #define PITCH_END128 45 |
Jean-Marc Valin | ecb36a3 | 2007-12-05 01:31:49 +1100 | [diff] [blame] | 42 | |
Jean-Marc Valin | 95c59ea | 2008-01-08 16:22:37 +1100 | [diff] [blame] | 43 | const int qbank0[NBANDS +2] = {0, 4, 8, 12, 16, 20, 24, 28, 32, 38, 44, 52, 62, 74, 90,112,142,182, 232,256}; |
| 44 | const int pbank0[PBANDS +2] = {0, 4, 8, 12, 16, 24, 38, 62, PITCH_END, 256}; |
Jean-Marc Valin | 36d78e6 | 2007-12-13 14:59:30 +1100 | [diff] [blame] | 45 | |
Jean-Marc Valin | 4fbd18d | 2008-01-17 14:07:55 +1100 | [diff] [blame] | 46 | #define NALLOCS 7 |
| 47 | int bitalloc0[NBANDS*NALLOCS] = |
| 48 | { 5, 4, 4, 4, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, |
| 49 | 8, 7, 7, 6, 6, 6, 5, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, |
| 50 | 10, 9, 9, 8, 8, 8, 8, 8, 8, 8, 9, 10, 11, 12, 17, 15, 6, 7, |
| 51 | 16, 15, 14, 14, 14, 13, 13, 13, 13, 13, 15, 16, 17, 18, 20, 18, 11, 12, |
| 52 | 26, 25, 24, 22, 20, 18, 19, 19, 25, 22, 25, 30, 30, 35, 35, 35, 35, 25, |
| 53 | 32, 30, 28, 27, 25, 24, 23, 21, 29, 27, 35, 40, 42, 50, 59, 54, 51, 36, |
| 54 | 42, 40, 38, 37, 35, 34, 33, 31, 39, 37, 45, 50, 52, 60, 60, 60, 60, 46, |
Jean-Marc Valin | f51ca49 | 2008-01-17 10:58:38 +1100 | [diff] [blame] | 55 | }; |
Jean-Marc Valin | a5431bf | 2008-01-03 20:53:01 +1100 | [diff] [blame] | 56 | |
Jean-Marc Valin | 4fbd18d | 2008-01-17 14:07:55 +1100 | [diff] [blame] | 57 | |
Jean-Marc Valin | a5431bf | 2008-01-03 20:53:01 +1100 | [diff] [blame] | 58 | #define NBANDS256 15 |
Jean-Marc Valin | 2875f6b | 2008-01-05 13:32:32 +1100 | [diff] [blame] | 59 | #define PBANDS256 8 |
| 60 | #define PITCH_END256 88 |
Jean-Marc Valin | a4833ff | 2008-01-10 15:34:00 +1100 | [diff] [blame] | 61 | const int qbank3[NBANDS256+2] = {0, 4, 8, 12, 16, 24, 32, 40, 48, 56, 72, 88, 104, 136, 168, 232, 256}; |
Jean-Marc Valin | 2875f6b | 2008-01-05 13:32:32 +1100 | [diff] [blame] | 62 | //const int pbank3[PBANDS256+2] = {0, 8, 16, 24, 40, PITCH_END256, 256}; |
Jean-Marc Valin | a4833ff | 2008-01-10 15:34:00 +1100 | [diff] [blame] | 63 | const int pbank3[PBANDS256+2] = {0, 4, 8, 12, 16, 24, 40, 56, PITCH_END256, 256}; |
Jean-Marc Valin | 36d78e6 | 2007-12-13 14:59:30 +1100 | [diff] [blame] | 64 | |
Jean-Marc Valin | 3cfcd05 | 2008-01-18 13:56:08 +1100 | [diff] [blame] | 65 | static const CELTMode mono_mode = { |
Jean-Marc Valin | a5431bf | 2008-01-03 20:53:01 +1100 | [diff] [blame] | 66 | 128, /**< overlap */ |
Jean-Marc Valin | 95c59ea | 2008-01-08 16:22:37 +1100 | [diff] [blame] | 67 | 256, /**< mdctSize */ |
| 68 | 1, /**< nbMdctBlocks */ |
Jean-Marc Valin | 36d78e6 | 2007-12-13 14:59:30 +1100 | [diff] [blame] | 69 | 1, /**< channels */ |
| 70 | |
| 71 | NBANDS, /**< nbEBands */ |
| 72 | PBANDS, /**< nbPBands */ |
| 73 | PITCH_END, /**< pitchEnd */ |
| 74 | |
| 75 | qbank0, /**< eBands */ |
| 76 | pbank0, /**< pBands*/ |
Jean-Marc Valin | 36d78e6 | 2007-12-13 14:59:30 +1100 | [diff] [blame] | 77 | |
| 78 | 0.8, /**< ePredCoef */ |
Jean-Marc Valin | f51ca49 | 2008-01-17 10:58:38 +1100 | [diff] [blame] | 79 | |
Jean-Marc Valin | 3cfcd05 | 2008-01-18 13:56:08 +1100 | [diff] [blame] | 80 | NALLOCS, /**< nbAllocVectors */ |
Jean-Marc Valin | f51ca49 | 2008-01-17 10:58:38 +1100 | [diff] [blame] | 81 | bitalloc0, /**< allocVectors */ |
Jean-Marc Valin | 36d78e6 | 2007-12-13 14:59:30 +1100 | [diff] [blame] | 82 | }; |
| 83 | |
Jean-Marc Valin | aa5bd61 | 2007-12-08 00:27:10 +1100 | [diff] [blame] | 84 | |
Jean-Marc Valin | 4a89768 | 2007-12-12 00:45:15 +1100 | [diff] [blame] | 85 | /* Stereo mode around 120 kbps */ |
Jean-Marc Valin | 3cfcd05 | 2008-01-18 13:56:08 +1100 | [diff] [blame] | 86 | static const CELTMode stereo_mode = { |
| 87 | 128, /**< overlap */ |
Jean-Marc Valin | fdca84b | 2008-01-09 10:44:18 +1100 | [diff] [blame] | 88 | 256, /**< mdctSize */ |
| 89 | 1, /**< nbMdctBlocks */ |
Jean-Marc Valin | ffa1347 | 2007-12-10 16:54:17 +1100 | [diff] [blame] | 90 | 2, /**< channels */ |
| 91 | |
Jean-Marc Valin | 3cfcd05 | 2008-01-18 13:56:08 +1100 | [diff] [blame] | 92 | NBANDS, /**< nbEBands */ |
| 93 | PBANDS, /**< nbPBands */ |
| 94 | PITCH_END, /**< pitchEnd */ |
Jean-Marc Valin | ffa1347 | 2007-12-10 16:54:17 +1100 | [diff] [blame] | 95 | |
Jean-Marc Valin | f8dda66 | 2008-01-10 17:02:36 +1100 | [diff] [blame] | 96 | qbank0, /**< eBands */ |
| 97 | pbank0, /**< pBands*/ |
Jean-Marc Valin | 36d78e6 | 2007-12-13 14:59:30 +1100 | [diff] [blame] | 98 | |
Jean-Marc Valin | f8dda66 | 2008-01-10 17:02:36 +1100 | [diff] [blame] | 99 | 0.8, /**< ePredCoef */ |
Jean-Marc Valin | f51ca49 | 2008-01-17 10:58:38 +1100 | [diff] [blame] | 100 | |
Jean-Marc Valin | 3cfcd05 | 2008-01-18 13:56:08 +1100 | [diff] [blame] | 101 | NALLOCS, /**< nbAllocVectors */ |
Jean-Marc Valin | f51ca49 | 2008-01-17 10:58:38 +1100 | [diff] [blame] | 102 | bitalloc0, /**< allocVectors */ |
Jean-Marc Valin | ffa1347 | 2007-12-10 16:54:17 +1100 | [diff] [blame] | 103 | }; |
| 104 | |
Jean-Marc Valin | 3cfcd05 | 2008-01-18 13:56:08 +1100 | [diff] [blame] | 105 | const CELTMode const *celt_mono = &mono_mode; |
| 106 | const CELTMode const *celt_stereo = &stereo_mode; |
Jean-Marc Valin | f997ad5 | 2008-01-31 16:47:16 +1100 | [diff] [blame] | 107 | |
| 108 | |
Jean-Marc Valin | 6da36c0 | 2008-02-15 14:20:29 +1100 | [diff] [blame] | 109 | #define NBANDS51 17 |
| 110 | #define PBANDS51 8 |
| 111 | #define PITCH_END51 64 |
| 112 | const int qbank51[NBANDS51 +2] = {0, 4, 8, 12, 16, 20, 24, 28, 32, 38, 44, 52, 64, 78, 96,122,156,204, 256}; |
| 113 | const int qbank51b[NBANDS +2] = {0, 3, 6, 9, 12, 16, 20, 24, 28, 32, 38, 44, 52, 64, 78, 96,122,156,204, 256}; |
| 114 | |
| 115 | const int pbank51[PBANDS51 +2] = {0, 4, 8, 12, 16, 24, 32, 44, PITCH_END51, 256}; |
| 116 | const int pbank51b[PBANDS +2] = {0, 3, 6, 9, 12, 20, 38, 52, PITCH_END51, 256}; |
| 117 | #define NALLOCS51 10 |
| 118 | int bitalloc51[NBANDS51*NALLOCS51] = |
| 119 | { 6, 5, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 120 | 7, 6, 5, 4, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, |
| 121 | 8, 7, 6, 5, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, |
| 122 | 9, 8, 7, 7, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, |
| 123 | 10, 9, 8, 8, 7, 7, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, |
| 124 | 10, 9, 9, 8, 8, 8, 8, 8, 8, 8, 9, 10, 11, 10, 10, 5, 5, |
| 125 | 16, 15, 14, 14, 14, 13, 13, 13, 13, 13, 15, 16, 17, 18, 20, 18, 11, |
| 126 | 26, 25, 24, 22, 20, 18, 19, 19, 25, 22, 25, 30, 30, 35, 35, 35, 35, |
| 127 | 32, 30, 28, 27, 25, 24, 23, 21, 29, 27, 35, 40, 42, 50, 59, 54, 51, |
| 128 | 42, 40, 38, 37, 35, 34, 33, 31, 39, 37, 45, 50, 52, 60, 60, 60, 60, |
| 129 | }; |
| 130 | |
| 131 | static const CELTMode ld51 = { |
| 132 | 128, /**< overlap */ |
| 133 | 256, /**< mdctSize */ |
| 134 | 1, /**< nbMdctBlocks */ |
| 135 | 1, /**< channels */ |
| 136 | |
| 137 | NBANDS51, /**< nbEBands */ |
| 138 | PBANDS51, /**< nbPBands */ |
| 139 | PITCH_END51, /**< pitchEnd */ |
| 140 | |
| 141 | qbank51, /**< eBands */ |
| 142 | pbank51, /**< pBands*/ |
Jean-Marc Valin | 6da36c0 | 2008-02-15 14:20:29 +1100 | [diff] [blame] | 143 | |
| 144 | 0.8, /**< ePredCoef */ |
Jean-Marc Valin | 6da36c0 | 2008-02-15 14:20:29 +1100 | [diff] [blame] | 145 | |
| 146 | NALLOCS51, /**< nbAllocVectors */ |
| 147 | bitalloc51, /**< allocVectors */ |
| 148 | }; |
| 149 | const CELTMode const *celt_ld51 = &ld51; |
| 150 | |
Jean-Marc Valin | f997ad5 | 2008-01-31 16:47:16 +1100 | [diff] [blame] | 151 | int celt_mode_info(const CELTMode *mode, int request, celt_int32_t *value) |
| 152 | { |
| 153 | switch (request) |
| 154 | { |
| 155 | case CELT_GET_FRAME_SIZE: |
| 156 | *value = mode->mdctSize; |
| 157 | break; |
| 158 | case CELT_GET_LOOKAHEAD: |
| 159 | *value = mode->overlap; |
| 160 | break; |
Jean-Marc Valin | 4c6bc88 | 2008-01-31 17:34:27 +1100 | [diff] [blame] | 161 | case CELT_GET_NB_CHANNELS: |
| 162 | *value = mode->nbChannels; |
| 163 | break; |
Jean-Marc Valin | cb7a2a3 | 2008-02-11 16:44:48 +1100 | [diff] [blame] | 164 | default: |
| 165 | return CELT_BAD_ARG; |
Jean-Marc Valin | f997ad5 | 2008-01-31 16:47:16 +1100 | [diff] [blame] | 166 | } |
Jean-Marc Valin | cb7a2a3 | 2008-02-11 16:44:48 +1100 | [diff] [blame] | 167 | return CELT_OK; |
Jean-Marc Valin | f997ad5 | 2008-01-31 16:47:16 +1100 | [diff] [blame] | 168 | } |
| 169 | |
Jean-Marc Valin | 81a8295 | 2008-02-17 22:41:29 +1100 | [diff] [blame] | 170 | #define MIN_BINS 4 |
| 171 | #define BARK_BANDS 25 |
Jean-Marc Valin | 2a8c371 | 2008-02-18 12:16:41 +1100 | [diff] [blame] | 172 | const celt_int16_t bark_freq[BARK_BANDS+1] = { |
Jean-Marc Valin | 81a8295 | 2008-02-17 22:41:29 +1100 | [diff] [blame] | 173 | 0, 101, 200, 301, 405, |
| 174 | 516, 635, 766, 912, 1077, |
| 175 | 1263, 1476, 1720, 2003, 2333, |
| 176 | 2721, 3184, 3742, 4428, 5285, |
| 177 | 6376, 7791, 9662, 12181, 15624, |
| 178 | 20397}; |
Jean-Marc Valin | 2a8c371 | 2008-02-18 12:16:41 +1100 | [diff] [blame] | 179 | |
| 180 | const celt_int16_t pitch_freq[PBANDS+1] ={0, 345, 689, 1034, 1378, 2067, 3273, 5340, 6374}; |
| 181 | |
Jean-Marc Valin | 81a8295 | 2008-02-17 22:41:29 +1100 | [diff] [blame] | 182 | |
| 183 | static int *compute_ebands(int Fs, int frame_size, int *nbEBands) |
| 184 | { |
| 185 | int *eBands; |
| 186 | int i, res, min_width, lin, low, high; |
| 187 | res = (Fs+frame_size)/(2*frame_size); |
| 188 | min_width = MIN_BINS*res; |
| 189 | //printf ("min_width = %d\n", min_width); |
| 190 | |
| 191 | /* Find where the linear part ends (i.e. where the spacing is more than min_width */ |
| 192 | for (lin=0;lin<BARK_BANDS;lin++) |
| 193 | if (bark_freq[lin+1]-bark_freq[lin] >= min_width) |
| 194 | break; |
| 195 | |
| 196 | //printf ("lin = %d (%d Hz)\n", lin, bark_freq[lin]); |
| 197 | low = ((bark_freq[lin]/res)+(MIN_BINS-1))/MIN_BINS; |
| 198 | high = BARK_BANDS-lin; |
| 199 | *nbEBands = low+high; |
| 200 | eBands = celt_alloc(sizeof(int)*(*nbEBands+2)); |
| 201 | |
| 202 | /* Linear spacing (min_width) */ |
| 203 | for (i=0;i<low;i++) |
| 204 | eBands[i] = MIN_BINS*i; |
| 205 | /* Spacing follows critical bands */ |
| 206 | for (i=0;i<high;i++) |
Jean-Marc Valin | 4991a56 | 2008-02-18 13:37:40 +1100 | [diff] [blame^] | 207 | eBands[i+low] = (bark_freq[lin+i]+res/2)/res; |
Jean-Marc Valin | 81a8295 | 2008-02-17 22:41:29 +1100 | [diff] [blame] | 208 | /* Enforce the minimum spacing at the boundary */ |
| 209 | for (i=0;i<*nbEBands;i++) |
| 210 | if (eBands[i] < MIN_BINS*i) |
| 211 | eBands[i] = MIN_BINS*i; |
Jean-Marc Valin | 4991a56 | 2008-02-18 13:37:40 +1100 | [diff] [blame^] | 212 | eBands[*nbEBands] = (bark_freq[BARK_BANDS]+res/2)/res; |
Jean-Marc Valin | 81a8295 | 2008-02-17 22:41:29 +1100 | [diff] [blame] | 213 | eBands[*nbEBands+1] = frame_size; |
| 214 | if (eBands[*nbEBands] > eBands[*nbEBands+1]) |
| 215 | eBands[*nbEBands] = eBands[*nbEBands+1]; |
Jean-Marc Valin | 2a8c371 | 2008-02-18 12:16:41 +1100 | [diff] [blame] | 216 | |
| 217 | /* FIXME: Remove last band if too small */ |
Jean-Marc Valin | 81a8295 | 2008-02-17 22:41:29 +1100 | [diff] [blame] | 218 | for (i=0;i<*nbEBands+2;i++) |
| 219 | printf("%d ", eBands[i]); |
| 220 | printf ("\n"); |
| 221 | return eBands; |
| 222 | } |
| 223 | |
Jean-Marc Valin | 2a8c371 | 2008-02-18 12:16:41 +1100 | [diff] [blame] | 224 | static void compute_pbands(CELTMode *mode, int res) |
| 225 | { |
| 226 | int i; |
| 227 | int *pBands; |
| 228 | pBands=celt_alloc(sizeof(int)*(PBANDS+2)); |
| 229 | mode->nbPBands = PBANDS; |
| 230 | for (i=0;i<PBANDS+1;i++) |
| 231 | { |
Jean-Marc Valin | 4991a56 | 2008-02-18 13:37:40 +1100 | [diff] [blame^] | 232 | pBands[i] = (pitch_freq[i]+res/2)/res; |
Jean-Marc Valin | 2a8c371 | 2008-02-18 12:16:41 +1100 | [diff] [blame] | 233 | if (pBands[i] < mode->eBands[i]) |
| 234 | pBands[i] = mode->eBands[i]; |
| 235 | } |
| 236 | pBands[PBANDS+1] = mode->eBands[mode->nbEBands+1]; |
Jean-Marc Valin | 4991a56 | 2008-02-18 13:37:40 +1100 | [diff] [blame^] | 237 | for (i=1;i<mode->nbPBands+1;i++) |
| 238 | { |
| 239 | int j; |
| 240 | for (j=0;j<mode->nbEBands;j++) |
| 241 | if (mode->eBands[j] <= pBands[i] && mode->eBands[j+1] > pBands[i]) |
| 242 | break; |
| 243 | printf ("%d %d\n", i, j); |
| 244 | if (mode->eBands[j] != pBands[i]) |
| 245 | { |
| 246 | if (pBands[i]-mode->eBands[j] < mode->eBands[j+1]-pBands[i] && |
| 247 | mode->eBands[j] != pBands[i-1]) |
| 248 | pBands[i] = mode->eBands[j]; |
| 249 | else |
| 250 | pBands[i] = mode->eBands[j+1]; |
| 251 | } |
| 252 | } |
Jean-Marc Valin | 2a8c371 | 2008-02-18 12:16:41 +1100 | [diff] [blame] | 253 | for (i=0;i<mode->nbPBands+2;i++) |
| 254 | printf("%d ", pBands[i]); |
| 255 | printf ("\n"); |
| 256 | mode->pBands = pBands; |
Jean-Marc Valin | 4991a56 | 2008-02-18 13:37:40 +1100 | [diff] [blame^] | 257 | mode->pitchEnd = pBands[PBANDS]; |
Jean-Marc Valin | 2a8c371 | 2008-02-18 12:16:41 +1100 | [diff] [blame] | 258 | } |
| 259 | |
Jean-Marc Valin | 81a8295 | 2008-02-17 22:41:29 +1100 | [diff] [blame] | 260 | CELTMode *celt_mode_create(int Fs, int channels, int frame_size, int overlap) |
| 261 | { |
Jean-Marc Valin | 4991a56 | 2008-02-18 13:37:40 +1100 | [diff] [blame^] | 262 | int res; |
Jean-Marc Valin | 81a8295 | 2008-02-17 22:41:29 +1100 | [diff] [blame] | 263 | CELTMode *mode; |
| 264 | |
Jean-Marc Valin | 2a8c371 | 2008-02-18 12:16:41 +1100 | [diff] [blame] | 265 | res = (Fs+frame_size)/(2*frame_size); |
| 266 | |
Jean-Marc Valin | 81a8295 | 2008-02-17 22:41:29 +1100 | [diff] [blame] | 267 | mode = celt_alloc(sizeof(CELTMode)); |
| 268 | mode->overlap = overlap; |
| 269 | mode->mdctSize = frame_size; |
| 270 | mode->nbMdctBlocks = 1; |
| 271 | mode->nbChannels = channels; |
| 272 | mode->eBands = compute_ebands(Fs, frame_size, &mode->nbEBands); |
Jean-Marc Valin | 2a8c371 | 2008-02-18 12:16:41 +1100 | [diff] [blame] | 273 | compute_pbands(mode, res); |
Jean-Marc Valin | 4991a56 | 2008-02-18 13:37:40 +1100 | [diff] [blame^] | 274 | mode->ePredCoef = .8; |
| 275 | |
Jean-Marc Valin | 2a8c371 | 2008-02-18 12:16:41 +1100 | [diff] [blame] | 276 | |
Jean-Marc Valin | 81a8295 | 2008-02-17 22:41:29 +1100 | [diff] [blame] | 277 | printf ("%d bands\n", mode->nbEBands); |
Jean-Marc Valin | 4991a56 | 2008-02-18 13:37:40 +1100 | [diff] [blame^] | 278 | return mode; |
Jean-Marc Valin | 81a8295 | 2008-02-17 22:41:29 +1100 | [diff] [blame] | 279 | } |
Jean-Marc Valin | 2a8c371 | 2008-02-18 12:16:41 +1100 | [diff] [blame] | 280 | |
| 281 | /*int main() |
Jean-Marc Valin | 81a8295 | 2008-02-17 22:41:29 +1100 | [diff] [blame] | 282 | { |
Jean-Marc Valin | 2a8c371 | 2008-02-18 12:16:41 +1100 | [diff] [blame] | 283 | celt_mode_create(44100, 1, 256, 128); |
Jean-Marc Valin | 4991a56 | 2008-02-18 13:37:40 +1100 | [diff] [blame^] | 284 | return 0; |
Jean-Marc Valin | 2a8c371 | 2008-02-18 12:16:41 +1100 | [diff] [blame] | 285 | }*/ |
Jean-Marc Valin | 81a8295 | 2008-02-17 22:41:29 +1100 | [diff] [blame] | 286 | |