28 #define FLOATFMT "%.18e"
29 #define FIXEDFMT "%6d"
33 return v < -32767 ? -32767 :
47 int main(
int argc,
char *argv[])
50 int do_sin = argc > 1 && !strcmp(argv[1],
"sin");
51 int fixed = argc > 1 && strstr(argv[1],
"fixed");
52 double (*
func)(double) = do_sin ? sin : cos;
54 printf(
"/* This file was automatically generated. */\n");
55 printf(
"#define CONFIG_FFT_FLOAT %d\n", !fixed);
56 printf(
"#include \"libavcodec/%s\"\n", do_sin ?
"rdft.h" :
"fft.h");
57 for (i = 4; i <=
BITS; i++) {
59 double freq = 2*3.14159265358979323846/
m;
60 printf(
"%s(%i) = {\n ", do_sin ?
"SINTABLE" :
"COSTABLE", m);
61 for (j = 0; j < m/2 - 1; j++) {
62 int idx = j > m/4 ? m/2 - j : j;
63 if (do_sin && j >= m/4)