~ubuntu-branches/ubuntu/saucy/gst-libav1.0/saucy-proposed

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavcodec/lsp.c

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2013-07-30 09:00:15 UTC
  • mfrom: (1.1.16) (7.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20130730090015-sc1ou2yssu7q5w4e
Tags: 1.1.3-1
* New upstream development snapshot:
  + debian/control:
    - Build depend on GStreamer and gst-plugins-base >= 1.1.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#define FRAC_BITS 14
28
28
#include "mathops.h"
29
29
#include "lsp.h"
30
 
#include "celp_math.h"
31
30
 
32
31
void ff_acelp_reorder_lsf(int16_t* lsfq, int lsfq_min_distance, int lsfq_min, int lsfq_max, int lp_order)
33
32
{
55
54
        prev = lsf[i] = FFMAX(lsf[i], prev + min_spacing);
56
55
}
57
56
 
 
57
 
 
58
/* Cosine table: base_cos[i] = (1 << 15) * cos(i * PI / 64) */
 
59
static const int16_t tab_cos[65] =
 
60
{
 
61
  32767,  32738,  32617,  32421,  32145,  31793,  31364,  30860,
 
62
  30280,  29629,  28905,  28113,  27252,  26326,  25336,  24285,
 
63
  23176,  22011,  20793,  19525,  18210,  16851,  15451,  14014,
 
64
  12543,  11043,   9515,   7965,   6395,   4810,   3214,   1609,
 
65
      1,  -1607,  -3211,  -4808,  -6393,  -7962,  -9513, -11040,
 
66
 -12541, -14012, -15449, -16848, -18207, -19523, -20791, -22009,
 
67
 -23174, -24283, -25334, -26324, -27250, -28111, -28904, -29627,
 
68
 -30279, -30858, -31363, -31792, -32144, -32419, -32616, -32736, -32768,
 
69
};
 
70
 
 
71
static int16_t ff_cos(uint16_t arg)
 
72
{
 
73
    uint8_t offset= arg;
 
74
    uint8_t ind = arg >> 8;
 
75
 
 
76
    assert(arg <= 0x3fff);
 
77
 
 
78
    return tab_cos[ind] + (offset * (tab_cos[ind+1] - tab_cos[ind]) >> 8);
 
79
}
 
80
 
58
81
void ff_acelp_lsf2lsp(int16_t *lsp, const int16_t *lsf, int lp_order)
59
82
{
60
83
    int i;