k
Size: a a a
k
z
k
k
СT
СT
k
СT
СT
СT
СT
G
DS
void Sin_Table_256(void) {
int x=0;
int y=8180;
SinT=(int *)MMalloc(512);
for (int t=0; t<(256); t++) {
x = x + (y<<2)/163;
y = y - (x<<2)/163;
SinT[t] = (x/80);
}
CosShift=64;
SinRes=255;
}
void Sin_Table_512(void) {
int x=0;
int y=8180;
SinT=(int *)MMalloc(1024);
for (int t=0; t<(512); t++) {
x = x + (y<<2)/324;
y = y - (x<<2)/324;
SinT[t] = (x/80);
}
CosShift=128;
SinRes=511;
}
void Sin_Table_1024(void) {
int x=0;
int y=8180;
SinT=(int *)MMalloc(2048);
for (int t=0; t<(1024); t++) {
x = x + (y<<2)/645;
y = y - (x<<2)/645;
SinT[t] = (x/80);
}
CosShift=256;
SinRes=1023;
}
#define sin(t) SinT[ (t) & SinRes ]
#define cos(t) SinT[((t)+CosShift) & SinRes ]
B
DS
DS
DS