comparison qcelpdata.h @ 8191:cc1e8c59f1e8 libavcodec

More OKed parts of the QCELP decoder patch by Kenan Gillet, kenan.gillet gmail com
author vitor
date Fri, 21 Nov 2008 18:39:16 +0000
parents e596efd84d27
children c245082d70f8
comparison
equal deleted inserted replaced
8190:e596efd84d27 8191:cc1e8c59f1e8
389 * the final gain scalefactor before clipping into a usable output float 389 * the final gain scalefactor before clipping into a usable output float
390 */ 390 */
391 #define QCELP_SCALE 8192. 391 #define QCELP_SCALE 8192.
392 392
393 /** 393 /**
394 * the upper boundary of the clipping, depends on QCELP_SCALE
395 */
396 #define QCELP_CLIP_UPPER_BOUND (8191.75/8192.)
397
398 /**
399 * the lower boundary of the clipping, depends on QCELP_SCALE
400 */
401 #define QCELP_CLIP_LOWER_BOUND -1.
402
403 /**
394 * table for computing Ga (decoded linear codebook gain magnitude) 404 * table for computing Ga (decoded linear codebook gain magnitude)
395 * 405 *
396 * @note The table could fit in int16_t in x*8 form, but it seems 406 * @note The table could fit in int16_t in x*8 form, but it seems
397 * to be slower on x86 407 * to be slower on x86
398 * 408 *
468 #define QCELP_RATE_HALF_CODEBOOK_RATIO 0.5 478 #define QCELP_RATE_HALF_CODEBOOK_RATIO 0.5
469 479
470 /** 480 /**
471 * sqrt(1.887) is the maximum of the pseudorandom 481 * sqrt(1.887) is the maximum of the pseudorandom
472 * white sequence used to generate the scaled codebook 482 * white sequence used to generate the scaled codebook
473 * vector for framerate 1/4. 483 * vector for bitrate 1/4.
474 * 484 *
475 * TIA/EIA/IS-733 2.4.8.1.2 485 * TIA/EIA/IS-733 2.4.8.1.2
476 */ 486 */
477 #define QCELP_SQRT1887 1.373681186 487 #define QCELP_SQRT1887 1.373681186
478 488
479 /** 489 /**
480 * table for impulse response of BPF used to filter 490 * table for impulse response of BPF used to filter
481 * the white excitation for framerate 1/4 synthesis 491 * the white excitation for bitrate 1/4 synthesis
482 * 492 *
483 * Only half the tables are needed because of symmetry. 493 * Only half the tables are needed because of symmetry.
484 * 494 *
485 * TIA/EIA/IS-733 2.4.8.1.2-1.1 495 * TIA/EIA/IS-733 2.4.8.1.2-1.1
486 */ 496 */
488 -1.344519e-1, 1.735384e-2, -6.905826e-2, 2.434368e-2, 498 -1.344519e-1, 1.735384e-2, -6.905826e-2, 2.434368e-2,
489 -8.210701e-2, 3.041388e-2, -9.251384e-2, 3.501983e-2, 499 -8.210701e-2, 3.041388e-2, -9.251384e-2, 3.501983e-2,
490 -9.918777e-2, 3.749518e-2, 8.985137e-1 500 -9.918777e-2, 3.749518e-2, 8.985137e-1
491 }; 501 };
492 502
503 /**
504 * This spread factor is used, for bitrate 1/8 and I_F_Q,
505 * to force the LSP frequencies to be at least 80 Hz apart.
506 *
507 * TIA/EIA/IS-733 2.4.3.3.2
508 */
509 #define QCELP_LSP_SPREAD_FACTOR 0.02
510
511 /**
512 * predictor coefficient for the conversion of LSP codes
513 * to LSP frequencies for 1/8 and I_F_Q
514 *
515 * TIA/EIA/IS-733 2.4.3.2.7-2
516 */
517 #define QCELP_LSP_OCTAVE_PREDICTOR 29.0/32
518
493 #endif /* AVCODEC_QCELPDATA_H */ 519 #endif /* AVCODEC_QCELPDATA_H */