27
27
#include "avcodec.h"
28
28
#include "celp_math.h"
31
* Cosine table: base_cos[i] = (1<<15) * cos(i*PI/64)
33
static const int16_t tab_cos[65] =
35
32767, 32738, 32617, 32421, 32145, 31793, 31364, 30860,
36
30280, 29629, 28905, 28113, 27252, 26326, 25336, 24285,
37
23176, 22011, 20793, 19525, 18210, 16851, 15451, 14014,
38
12543, 11043, 9515, 7965, 6395, 4810, 3214, 1609,
39
1, -1607, -3211, -4808, -6393, -7962, -9513, -11040,
40
-12541, -14012, -15449, -16848, -18207, -19523, -20791, -22009,
41
-23174, -24283, -25334, -26324, -27250, -28111, -28904, -29627,
42
-30279, -30858, -31363, -31792, -32144, -32419, -32616, -32736, -32768,
29
#include "libavutil/common.h"
45
31
static const uint16_t exp2a[]=
58
44
17176, 17898, 18620, 19343, 20066, 20790, 21514, 22238,
61
int16_t ff_cos(uint16_t arg)
64
uint8_t ind = arg >> 8;
66
assert(arg <= 0x3fff);
68
return tab_cos[ind] + (offset * (tab_cos[ind+1] - tab_cos[ind]) >> 8);
71
47
int ff_exp2(uint16_t power)
73
49
unsigned int result= exp2a[power>>10] + 0x10000;
91
67
26457, 27294, 28116, 28924, 29719, 30500, 31269, 32025, 32769,
94
int ff_log2(uint32_t value)
70
int ff_log2_q15(uint32_t value)