mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-12 10:00:08 +01:00
Merge remote-tracking branch 'newdev/master'
* newdev/master: mpegts: propagate avio EOF in read_packet() configure: Initial support for --target-os=symbian Fixed-point FFT and MDCT Include dependencies for test programs ac3enc: simplify sym_quant() flvdec: read index stored in the 'keyframes' tag. mov: Add support for zero-sized stsc runs. Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -29,14 +29,33 @@
|
||||
#endif
|
||||
#define BITS 16
|
||||
#define FLOATFMT "%.18e"
|
||||
#define FIXEDFMT "%6d"
|
||||
|
||||
static int clip_f15(int v)
|
||||
{
|
||||
return v < -32767 ? -32767 :
|
||||
v > 32767 ? 32767 :
|
||||
v;
|
||||
}
|
||||
|
||||
static void printval(double val, int fixed)
|
||||
{
|
||||
if (fixed)
|
||||
printf(" "FIXEDFMT",", clip_f15(lrint(val * (double)(1<<15))));
|
||||
else
|
||||
printf(" "FLOATFMT",", val);
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int i, j;
|
||||
int do_sin = argc == 2 && !strcmp(argv[1], "sin");
|
||||
int do_sin = argc > 1 && !strcmp(argv[1], "sin");
|
||||
int fixed = argc > 2 && !strcmp(argv[2], "fixed");
|
||||
double (*func)(double) = do_sin ? sin : cos;
|
||||
|
||||
printf("/* This file was generated by libavcodec/costablegen */\n");
|
||||
printf("#define CONFIG_FFT_FLOAT %d\n", !fixed);
|
||||
printf("#include \"libavcodec/%s\"\n", do_sin ? "rdft.h" : "fft.h");
|
||||
for (i = 4; i <= BITS; i++) {
|
||||
int m = 1 << i;
|
||||
@@ -46,11 +65,12 @@ int main(int argc, char *argv[])
|
||||
int idx = j > m/4 ? m/2 - j : j;
|
||||
if (do_sin && j >= m/4)
|
||||
idx = m/4 - j;
|
||||
printf(" "FLOATFMT",", func(idx*freq));
|
||||
printval(func(idx*freq), fixed);
|
||||
if ((j & 3) == 3)
|
||||
printf("\n ");
|
||||
}
|
||||
printf(" "FLOATFMT"\n};\n", func(do_sin ? -(m/4 - 1)*freq : freq));
|
||||
printval(func(do_sin ? -(m/4 - 1)*freq : freq), fixed);
|
||||
printf("\n};\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user