Go to the documentation of this file.
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");
63 printf(
"#include \"libavcodec/%s\"\n", do_sin ?
"rdft.h" :
"fft.h");
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)
int(* func)(AVBPrint *dst, const char *in, const char *arg)
int main(int argc, char *argv[])
static double val(void *priv, double ch)
static __device__ float ceil(float a)
static __device__ float floor(float a)
printf("static const uint8_t my_array[100] = {\n")
#define i(width, name, range_min, range_max)
static void printval(double val, int fixed)
#define fixed(width, name, value)
static int clip_f15(int v)