~ubuntu-branches/ubuntu/precise/ffmpeg-debian/precise

« back to all changes in this revision

Viewing changes to libavcodec/qcelpdata.h

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-11-15 19:44:29 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20081115194429-zwlw86ht1rctd8z9
Tags: 3:0.svn20081115-1ubuntu1
* merge from debian.
* keep myself in the maintainer field. If you are touching this or the
  'ffmpeg' package in multiverse, please get in touch with me. Both
  source packages come from the same packaging branch.
* drop dependency on faad.

Show diffs side-by-side

added added

removed removed

Lines of Context:
378
378
    qcelp_lspvq5
379
379
};
380
380
 
 
381
/**
 
382
 * the final gain scalefactor before clipping into a usable output float
 
383
 */
 
384
#define QCELP_SCALE 8192.
 
385
 
 
386
/**
 
387
 * table for computing Ga (decoded linear codebook gain magnitude)
 
388
 *
 
389
 * @note The table could fit in int16_t in x*8 form, but it seems
 
390
 *       to be slower on x86
 
391
 *
 
392
 * TIA/EIA/IS-733 2.4.6.2.1-3
 
393
 */
 
394
 
 
395
static const float qcelp_g12ga[61] = {
 
396
    1.000/QCELP_SCALE,   1.125/QCELP_SCALE,   1.250/QCELP_SCALE,   1.375/QCELP_SCALE,
 
397
    1.625/QCELP_SCALE,   1.750/QCELP_SCALE,   2.000/QCELP_SCALE,   2.250/QCELP_SCALE,
 
398
    2.500/QCELP_SCALE,   2.875/QCELP_SCALE,   3.125/QCELP_SCALE,   3.500/QCELP_SCALE,
 
399
    4.000/QCELP_SCALE,   4.500/QCELP_SCALE,   5.000/QCELP_SCALE,   5.625/QCELP_SCALE,
 
400
    6.250/QCELP_SCALE,   7.125/QCELP_SCALE,   8.000/QCELP_SCALE,   8.875/QCELP_SCALE,
 
401
   10.000/QCELP_SCALE,  11.250/QCELP_SCALE,  12.625/QCELP_SCALE,  14.125/QCELP_SCALE,
 
402
   15.875/QCELP_SCALE,  17.750/QCELP_SCALE,  20.000/QCELP_SCALE,  22.375/QCELP_SCALE,
 
403
   25.125/QCELP_SCALE,  28.125/QCELP_SCALE,  31.625/QCELP_SCALE,  35.500/QCELP_SCALE,
 
404
   39.750/QCELP_SCALE,  44.625/QCELP_SCALE,  50.125/QCELP_SCALE,  56.250/QCELP_SCALE,
 
405
   63.125/QCELP_SCALE,  70.750/QCELP_SCALE,  79.375/QCELP_SCALE,  89.125/QCELP_SCALE,
 
406
  100.000/QCELP_SCALE, 112.250/QCELP_SCALE, 125.875/QCELP_SCALE, 141.250/QCELP_SCALE,
 
407
  158.500/QCELP_SCALE, 177.875/QCELP_SCALE, 199.500/QCELP_SCALE, 223.875/QCELP_SCALE,
 
408
  251.250/QCELP_SCALE, 281.875/QCELP_SCALE, 316.250/QCELP_SCALE, 354.875/QCELP_SCALE,
 
409
  398.125/QCELP_SCALE, 446.625/QCELP_SCALE, 501.125/QCELP_SCALE, 563.375/QCELP_SCALE,
 
410
  631.000/QCELP_SCALE, 708.000/QCELP_SCALE, 794.375/QCELP_SCALE, 891.250/QCELP_SCALE,
 
411
 1000.000/QCELP_SCALE};
 
412
 
 
413
/**
 
414
 * circular codebook for rate 1 frames in x*100 form
 
415
 *
 
416
 * TIA/EIA/IS-733 2.4.6.1-2
 
417
 */
 
418
static const int16_t qcelp_rate_full_codebook[128] = {
 
419
     10,  -65,  -59,   12,  110,   34, -134,  157,
 
420
    104,  -84,  -34, -115,   23, -101,    3,   45,
 
421
   -101,  -16,  -59,   28,  -45,  134,  -67,   22,
 
422
     61,  -29,  226,  -26,  -55, -179,  157,  -51,
 
423
   -220,  -93,  -37,   60,  118,   74,  -48,  -95,
 
424
   -181,  111,   36,  -52, -215,   78, -112,   39,
 
425
    -17,  -47, -223,   19,   12,  -98, -142,  130,
 
426
     54, -127,   21,  -12,   39,  -48,   12,  128,
 
427
      6, -167,   82, -102,  -79,   55,  -44,   48,
 
428
    -20,  -53,    8,  -61,   11,  -70, -157, -168,
 
429
     20,  -56,  -74,   78,   33,  -63, -173,   -2,
 
430
    -75,  -53, -146,   77,   66,  -29,    9,  -75,
 
431
     65,  119,  -43,   76,  233,   98,  125, -156,
 
432
    -27,   78,   -9,  170,  176,  143, -148,   -7,
 
433
     27, -136,    5,   27,   18,  139,  204,    7,
 
434
   -184, -197,   52,   -3,   78, -189,    8,  -65
 
435
};
 
436
#define QCELP_RATE_FULL_CODEBOOK_RATIO .01
 
437
 
 
438
/**
 
439
 * circular codebook for rate 1/2 frames in x*2 form
 
440
 *
 
441
 * TIA/EIA/IS-733 2.4.6.1-1
 
442
 */
 
443
static const int8_t qcelp_rate_half_codebook[128] = {
 
444
     0, -4,  0, -3,  0,  0,  0,  0,
 
445
     0,  0,  0,  0,  0,  0,  0,  0,
 
446
     0, -3, -2,  0,  0,  0,  0,  0,
 
447
     0,  0,  0,  0,  0,  0,  0,  5,
 
448
     0,  0,  0,  0,  0,  0,  4,  0,
 
449
     0,  3,  2,  0,  3,  4,  0,  0,
 
450
     0,  0,  0,  0,  0,  0,  0,  0,
 
451
     0,  0,  0,  0,  0,  3,  0,  0,
 
452
    -3,  3,  0,  0, -2,  0,  3,  0,
 
453
     0,  0,  0,  0,  0,  0, -5,  0,
 
454
     0,  0,  0,  3,  0,  0,  0,  3,
 
455
     0,  0,  0,  0,  0,  0,  0,  4,
 
456
     0,  0,  0,  0,  0,  0,  0,  0,
 
457
     0,  3,  6, -3, -4,  0, -3, -3,
 
458
     3, -3,  0,  0,  0,  0,  0,  0,
 
459
     0,  0,  0,  0,  0,  0,  0,  0
 
460
};
 
461
#define QCELP_RATE_HALF_CODEBOOK_RATIO 0.5
 
462
 
 
463
/**
 
464
 * sqrt(1.887) is the maximum of the pseudorandom
 
465
 * white sequence used to generate the scaled codebook
 
466
 * vector for framerate 1/4.
 
467
 *
 
468
 * TIA/EIA/IS-733 2.4.8.1.2
 
469
 */
 
470
#define QCELP_SQRT1887 1.373681186
 
471
 
 
472
/**
 
473
 * table for impulse response of BPF used to filter
 
474
 * the white excitation for framerate 1/4 synthesis
 
475
 *
 
476
 * Only half the tables are needed because of symetry.
 
477
 *
 
478
 * TIA/EIA/IS-733 2.4.8.1.2-1.1
 
479
 */
 
480
static const double qcelp_rnd_fir_coefs[11] = {
 
481
  -1.344519e-1, 1.735384e-2, -6.905826e-2, 2.434368e-2,
 
482
  -8.210701e-2, 3.041388e-2, -9.251384e-2, 3.501983e-2,
 
483
  -9.918777e-2, 3.749518e-2,  8.985137e-1
 
484
};
 
485
 
381
486
#endif /* AVCODEC_QCELPDATA_H */