32 extern int32_t g_cosTable[512];
33 static const unsigned int DC_2PI = 2048;
34 static const unsigned int DC_PI = 1024;
35 static const unsigned int DC_PI2 = 512;
36 static const unsigned int DC_PI4 = 256;
38 static inline int32_t dCos(
unsigned int t) {
44 }
else if (t < DC_PI) {
45 r = -g_cosTable[DC_PI - 1 - t];
46 }
else if (t < (DC_PI + DC_PI2)) {
47 r = -g_cosTable[t - DC_PI];
49 r = g_cosTable[DC_2PI - 1 - t];
56 static inline int32_t dSin(
unsigned int t) {
59 if (t < DC_PI2)
return dCos(t + DC_2PI - DC_PI2);
60 return dCos(t - DC_PI2);
63 void generateCosTable();