30 #define FLOATFMT "%.18e" 31 #define FIXEDFMT "%6d" 35 return v < -32767 ? -32767 :
44 double new_val = val * (double) (1 << 15);
46 new_val = new_val >= 0 ? floor(new_val + 0.5) : ceil(new_val - 0.5);
54 int main(
int argc,
char *argv[])
57 int do_sin = argc > 1 && !strcmp(argv[1],
"sin");
58 int fixed = argc > 1 && strstr(argv[1],
"fixed");
59 double (*
func)(double) = do_sin ? sin : cos;
61 printf(
"/* This file was automatically generated. */\n");
62 printf(
"#define FFT_FLOAT %d\n", !fixed);
63 printf(
"#include \"libavcodec/%s\"\n", do_sin ?
"rdft.h" :
"fft.h");
64 for (i = 4; i <=
BITS; i++) {
66 double freq = 2*
M_PI/m;
67 printf(
"%s(%i) = {\n ", do_sin ?
"SINTABLE" :
"COSTABLE", m);
68 for (j = 0; j < m/2 - 1; j++) {
69 int idx = j > m/4 ? m/2 - j : j;
70 if (do_sin && j >= m/4)
const char const char void * val
static int clip_f15(int v)
int(* func)(AVBPrint *dst, const char *in, const char *arg)
static void printval(double val, int fixed)
int main(int argc, char *argv[])