summaryrefslogtreecommitdiff
path: root/apps/codecs/libspeex/modes.c
diff options
context:
space:
mode:
authorThom Johansen <thomj@rockbox.org>2007-11-01 21:30:51 +0000
committerThom Johansen <thomj@rockbox.org>2007-11-01 21:30:51 +0000
commitbf1b7f131c933b83afe62f01c200366e4e2e37f3 (patch)
treea9ab90e6a01df357b7a8649d8e626a47e1678f64 /apps/codecs/libspeex/modes.c
parent6d88717f6949587908ec08affa07d06239c3bae1 (diff)
downloadrockbox-bf1b7f131c933b83afe62f01c200366e4e2e37f3.tar.gz
rockbox-bf1b7f131c933b83afe62f01c200366e4e2e37f3.zip
First attempt at ifdeffing out as much of the encoder stuff as possible from Speex. Gives a smaller binary and allows me to remove a couple more files from SOURCES.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15394 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libspeex/modes.c')
-rw-r--r--apps/codecs/libspeex/modes.c147
1 files changed, 147 insertions, 0 deletions
diff --git a/apps/codecs/libspeex/modes.c b/apps/codecs/libspeex/modes.c
index 7906ab5faa..0478f978d1 100644
--- a/apps/codecs/libspeex/modes.c
+++ b/apps/codecs/libspeex/modes.c
@@ -153,6 +153,7 @@ static const SpeexSubmode nb_submode1 = {
153 1, 153 1,
154 0, 154 0,
155 0, 155 0,
156#ifndef SPEEX_DISABLE_ENCODER
156 /* LSP quantization */ 157 /* LSP quantization */
157 lsp_quant_lbr, 158 lsp_quant_lbr,
158 lsp_unquant_lbr, 159 lsp_unquant_lbr,
@@ -163,6 +164,18 @@ static const SpeexSubmode nb_submode1 = {
163 /* No innovation quantization (noise only) */ 164 /* No innovation quantization (noise only) */
164 noise_codebook_quant, 165 noise_codebook_quant,
165 noise_codebook_unquant, 166 noise_codebook_unquant,
167#else
168 /* LSP quantization */
169 NULL,
170 lsp_unquant_lbr,
171 /* No pitch quantization */
172 NULL,
173 forced_pitch_unquant,
174 NULL,
175 /* No innovation quantization (noise only) */
176 NULL,
177 noise_codebook_unquant,
178#endif
166 NULL, 179 NULL,
167 -1, 180 -1,
168 43 181 43
@@ -174,6 +187,7 @@ static const SpeexSubmode nb_submode8 = {
174 1, 187 1,
175 0, 188 0,
176 0, 189 0,
190#ifndef SPEEX_DISABLE_ENCODER
177 /*LSP quantization*/ 191 /*LSP quantization*/
178 lsp_quant_lbr, 192 lsp_quant_lbr,
179 lsp_unquant_lbr, 193 lsp_unquant_lbr,
@@ -185,6 +199,19 @@ static const SpeexSubmode nb_submode8 = {
185 split_cb_search_shape_sign, 199 split_cb_search_shape_sign,
186 split_cb_shape_sign_unquant, 200 split_cb_shape_sign_unquant,
187 &split_cb_nb_ulbr, 201 &split_cb_nb_ulbr,
202#else
203 /*LSP quantization*/
204 NULL,
205 lsp_unquant_lbr,
206 /*No pitch quantization*/
207 NULL,
208 forced_pitch_unquant,
209 NULL,
210 /*Innovation quantization*/
211 NULL,
212 split_cb_shape_sign_unquant,
213 &split_cb_nb_ulbr,
214#endif
188 QCONST16(.5,15), 215 QCONST16(.5,15),
189 79 216 79
190}; 217};
@@ -195,6 +222,7 @@ static const SpeexSubmode nb_submode2 = {
195 0, 222 0,
196 0, 223 0,
197 0, 224 0,
225#ifndef SPEEX_DISABLE_ENCODER
198 /*LSP quantization*/ 226 /*LSP quantization*/
199 lsp_quant_lbr, 227 lsp_quant_lbr,
200 lsp_unquant_lbr, 228 lsp_unquant_lbr,
@@ -206,6 +234,19 @@ static const SpeexSubmode nb_submode2 = {
206 split_cb_search_shape_sign, 234 split_cb_search_shape_sign,
207 split_cb_shape_sign_unquant, 235 split_cb_shape_sign_unquant,
208 &split_cb_nb_vlbr, 236 &split_cb_nb_vlbr,
237#else
238 /*LSP quantization*/
239 NULL,
240 lsp_unquant_lbr,
241 /*No pitch quantization*/
242 NULL,
243 pitch_unquant_3tap,
244 &ltp_params_vlbr,
245 /*Innovation quantization*/
246 NULL,
247 split_cb_shape_sign_unquant,
248 &split_cb_nb_vlbr,
249#endif
209 QCONST16(.6,15), 250 QCONST16(.6,15),
210 119 251 119
211}; 252};
@@ -216,6 +257,7 @@ static const SpeexSubmode nb_submode3 = {
216 0, 257 0,
217 1, 258 1,
218 0, 259 0,
260#ifndef SPEEX_DISABLE_ENCODER
219 /*LSP quantization*/ 261 /*LSP quantization*/
220 lsp_quant_lbr, 262 lsp_quant_lbr,
221 lsp_unquant_lbr, 263 lsp_unquant_lbr,
@@ -227,6 +269,19 @@ static const SpeexSubmode nb_submode3 = {
227 split_cb_search_shape_sign, 269 split_cb_search_shape_sign,
228 split_cb_shape_sign_unquant, 270 split_cb_shape_sign_unquant,
229 &split_cb_nb_lbr, 271 &split_cb_nb_lbr,
272#else
273 /*LSP quantization*/
274 NULL,
275 lsp_unquant_lbr,
276 /*Pitch quantization*/
277 NULL,
278 pitch_unquant_3tap,
279 &ltp_params_lbr,
280 /*Innovation quantization*/
281 NULL,
282 split_cb_shape_sign_unquant,
283 &split_cb_nb_lbr,
284#endif
230 QCONST16(.55,15), 285 QCONST16(.55,15),
231 160 286 160
232}; 287};
@@ -237,6 +292,7 @@ static const SpeexSubmode nb_submode4 = {
237 0, 292 0,
238 1, 293 1,
239 0, 294 0,
295#ifndef SPEEX_DISABLE_ENCODER
240 /*LSP quantization*/ 296 /*LSP quantization*/
241 lsp_quant_lbr, 297 lsp_quant_lbr,
242 lsp_unquant_lbr, 298 lsp_unquant_lbr,
@@ -248,6 +304,19 @@ static const SpeexSubmode nb_submode4 = {
248 split_cb_search_shape_sign, 304 split_cb_search_shape_sign,
249 split_cb_shape_sign_unquant, 305 split_cb_shape_sign_unquant,
250 &split_cb_nb_med, 306 &split_cb_nb_med,
307#else
308 /*LSP quantization*/
309 NULL,
310 lsp_unquant_lbr,
311 /*Pitch quantization*/
312 NULL,
313 pitch_unquant_3tap,
314 &ltp_params_med,
315 /*Innovation quantization*/
316 NULL,
317 split_cb_shape_sign_unquant,
318 &split_cb_nb_med,
319#endif
251 QCONST16(.45,15), 320 QCONST16(.45,15),
252 220 321 220
253}; 322};
@@ -258,6 +327,7 @@ static const SpeexSubmode nb_submode5 = {
258 0, 327 0,
259 3, 328 3,
260 0, 329 0,
330#ifndef SPEEX_DISABLE_ENCODER
261 /*LSP quantization*/ 331 /*LSP quantization*/
262 lsp_quant_nb, 332 lsp_quant_nb,
263 lsp_unquant_nb, 333 lsp_unquant_nb,
@@ -269,6 +339,19 @@ static const SpeexSubmode nb_submode5 = {
269 split_cb_search_shape_sign, 339 split_cb_search_shape_sign,
270 split_cb_shape_sign_unquant, 340 split_cb_shape_sign_unquant,
271 &split_cb_nb, 341 &split_cb_nb,
342#else
343 /*LSP quantization*/
344 NULL,
345 lsp_unquant_nb,
346 /*Pitch quantization*/
347 NULL,
348 pitch_unquant_3tap,
349 &ltp_params_nb,
350 /*Innovation quantization*/
351 NULL,
352 split_cb_shape_sign_unquant,
353 &split_cb_nb,
354#endif
272 QCONST16(.3,15), 355 QCONST16(.3,15),
273 300 356 300
274}; 357};
@@ -279,6 +362,7 @@ static const SpeexSubmode nb_submode6 = {
279 0, 362 0,
280 3, 363 3,
281 0, 364 0,
365#ifndef SPEEX_DISABLE_ENCODER
282 /*LSP quantization*/ 366 /*LSP quantization*/
283 lsp_quant_nb, 367 lsp_quant_nb,
284 lsp_unquant_nb, 368 lsp_unquant_nb,
@@ -290,6 +374,19 @@ static const SpeexSubmode nb_submode6 = {
290 split_cb_search_shape_sign, 374 split_cb_search_shape_sign,
291 split_cb_shape_sign_unquant, 375 split_cb_shape_sign_unquant,
292 &split_cb_sb, 376 &split_cb_sb,
377#else
378 /*LSP quantization*/
379 NULL,
380 lsp_unquant_nb,
381 /*Pitch quantization*/
382 NULL,
383 pitch_unquant_3tap,
384 &ltp_params_nb,
385 /*Innovation quantization*/
386 NULL,
387 split_cb_shape_sign_unquant,
388 &split_cb_sb,
389#endif
293 QCONST16(.2,15), 390 QCONST16(.2,15),
294 364 391 364
295}; 392};
@@ -300,6 +397,7 @@ static const SpeexSubmode nb_submode7 = {
300 0, 397 0,
301 3, 398 3,
302 1, 399 1,
400#ifndef SPEEX_DISABLE_ENCODER
303 /*LSP quantization*/ 401 /*LSP quantization*/
304 lsp_quant_nb, 402 lsp_quant_nb,
305 lsp_unquant_nb, 403 lsp_unquant_nb,
@@ -311,6 +409,19 @@ static const SpeexSubmode nb_submode7 = {
311 split_cb_search_shape_sign, 409 split_cb_search_shape_sign,
312 split_cb_shape_sign_unquant, 410 split_cb_shape_sign_unquant,
313 &split_cb_nb, 411 &split_cb_nb,
412#else
413 /*LSP quantization*/
414 NULL,
415 lsp_unquant_nb,
416 /*Pitch quantization*/
417 NULL,
418 pitch_unquant_3tap,
419 &ltp_params_nb,
420 /*Innovation quantization*/
421 NULL,
422 split_cb_shape_sign_unquant,
423 &split_cb_nb,
424#endif
314 QCONST16(.1,15), 425 QCONST16(.1,15),
315 492 426 492
316}; 427};
@@ -347,6 +458,7 @@ const SpeexMode speex_nb_mode = {
347 "narrowband", 458 "narrowband",
348 0, 459 0,
349 4, 460 4,
461#ifndef SPEEX_DISABLE_ENCODER
350 &nb_encoder_init, 462 &nb_encoder_init,
351 &nb_encoder_destroy, 463 &nb_encoder_destroy,
352 &nb_encode, 464 &nb_encode,
@@ -355,6 +467,16 @@ const SpeexMode speex_nb_mode = {
355 &nb_decode, 467 &nb_decode,
356 &nb_encoder_ctl, 468 &nb_encoder_ctl,
357 &nb_decoder_ctl, 469 &nb_decoder_ctl,
470#else
471 NULL,
472 NULL,
473 NULL,
474 &nb_decoder_init,
475 &nb_decoder_destroy,
476 &nb_decode,
477 NULL,
478 &nb_decoder_ctl,
479#endif
358}; 480};
359 481
360 482
@@ -388,6 +510,7 @@ static const SpeexSubmode nb_48k_submode = {
388 0, 510 0,
389 0, 511 0,
390 0, 512 0,
513#ifndef SPEEX_DISABLE_ENCODER
391 /*LSP quantization*/ 514 /*LSP quantization*/
392 lsp_quant_48k, 515 lsp_quant_48k,
393 lsp_unquant_48k, 516 lsp_unquant_48k,
@@ -399,6 +522,19 @@ static const SpeexSubmode nb_48k_submode = {
399 split_cb_search_shape_sign, 522 split_cb_search_shape_sign,
400 split_cb_shape_sign_unquant, 523 split_cb_shape_sign_unquant,
401 &split_cb_nb_48k, 524 &split_cb_nb_48k,
525#else
526 /*LSP quantization*/
527 NULL,
528 lsp_unquant_48k,
529 /*No pitch quantization*/
530 NULL,
531 pitch_unquant_3tap,
532 &ltp_params_48k,
533 /*Innovation quantization*/
534 NULL,
535 split_cb_shape_sign_unquant,
536 &split_cb_nb_48k,
537#endif
402 QCONST16(.7,15), 538 QCONST16(.7,15),
403 144 539 144
404}; 540};
@@ -429,6 +565,7 @@ const SpeexMode speex_nb_48k_mode = {
429 "narrowband 4.8 kbps", 565 "narrowband 4.8 kbps",
430 1000, 566 1000,
431 4, 567 4,
568#ifndef SPEEX_DISABLE_ENCODER
432 &nb_encoder_init, 569 &nb_encoder_init,
433 &nb_encoder_destroy, 570 &nb_encoder_destroy,
434 &nb_encode, 571 &nb_encode,
@@ -437,6 +574,16 @@ const SpeexMode speex_nb_48k_mode = {
437 &nb_decode, 574 &nb_decode,
438 &nb_encoder_ctl, 575 &nb_encoder_ctl,
439 &nb_decoder_ctl, 576 &nb_decoder_ctl,
577#else
578 NULL,
579 NULL,
580 NULL,
581 &nb_decoder_init,
582 &nb_decoder_destroy,
583 &nb_decode,
584 NULL,
585 &nb_decoder_ctl,
586#endif
440}; 587};
441 588
442 589