[FFmpeg-devel] [PATCH] hardcoded ff_cos tables
Wed Oct 14 14:34:09 CEST 2009
Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:
> On Wed, Oct 14, 2009 at 11:57:18AM +0100, M?ns Rullg?rd wrote:
>> > Index: libavcodec/Makefile
>> > ===================================================================
>> > --- libavcodec/Makefile (revision 20231)
>> > +++ libavcodec/Makefile (working copy)
>> > @@ -571,6 +571,16 @@
>> > DIRS = alpha arm bfin mlib ppc ps2 sh4 sparc x86
>> > +CLEANFILES = cos_tables.h costablegen$(HOSTEXESUF)
>> > +
>> > include $(SUBDIR)../subdir.mak
>> > $(SUBDIR)dct-test$(EXESUF): $(SUBDIR)dctref.o
>> > +
>> > +$(SUBDIR)costablegen$(HOSTEXESUF): $(SUBDIR)costablegen.c
>> > + $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
>> > +
>> > +$(SUBDIR)cos_tables.h: $(SUBDIR)costablegen$(HOSTEXESUF)
>> > + ./$< > $@
>> You can't have ./ there. It won't work.
> On the contrary, it won't work without when doing make in libavcodec,
> while it will work in both cases with.
Indeed. My bad. Keep it.
>> > +#include "libavutil/mathematics.h"
>> You can't #include any ffmpeg headers in files to be compiled with
>> HOSTCC. They will pull in asm and other definitions for the target
>> machine. It doesn't look like you're using anything from that header
> M_PI. Though it might be best to just define that manually.
Yes, that's much simpler.
>> > + int i, j;
>> > + FILE *table = stdout;
>> > + fprintf(table, "/* This file was generated by libavcodec/costablegen */\n");
>> > + fprintf(table, "#include \"dsputil.h\"\n");
>> Why not simply use printf()?
> Well, I was undecided whether to print it or write directly to file.
Just use stdout. Saves you some error checking.
mans at mansr.com
More information about the ffmpeg-devel