[FFmpeg-devel] [RFC] declarations for ff_cos_* in dsputil.h

Reimar Döffinger Reimar.Doeffinger
Thu Oct 15 00:06:01 CEST 2009


On Wed, Oct 14, 2009 at 10:56:37PM +0100, M?ns Rullg?rd wrote:
> Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:
> > Index: libavcodec/costablegen.c
> > ===================================================================
> > --- libavcodec/costablegen.c	(revision 20232)
> > +++ libavcodec/costablegen.c	(working copy)
> > @@ -37,7 +37,7 @@
> >      for (i = 4; i <= BITS; i++) {
> >          int m = 1 << i;
> >          double freq = 2*M_PI/m;
> > -        printf("const DECLARE_ALIGNED_16(FFTSample, ff_cos_%i[]) = {\n   ", m);
> > +        printf("COSTABLE(%i) = {\n   ", m);
> >          for (j = 0; j < m/2 - 1; j++) {
> >              int idx = j > m/4 ? m/2 - j : j;
> >              printf(" "FLOATFMT",", cos(idx*freq));
> > Index: libavcodec/dsputil.h
> > ===================================================================
> > --- libavcodec/dsputil.h	(revision 20232)
> > +++ libavcodec/dsputil.h	(working copy)
> > @@ -743,11 +743,28 @@
> >  } FFTContext;
> >  
> >  #if CONFIG_HARDCODED_TABLES
> > -extern const FFTSample* const ff_cos_tabs[13];
> > +#define COSTABLE_CONST const
> >  #else
> > -extern FFTSample* const ff_cos_tabs[13];
> > +#define COSTABLE_CONST
> >  #endif
> >  
> > +#define COSTABLE(size) \
> > +    COSTABLE_CONST DECLARE_ALIGNED_16(FFTSample, ff_cos_##size[size/2]);
> 
> Doesn't that semicolon break the initialisers?

Yes, I was too lazy to let the compile run through on this slow thing.
I fixed it locally, I'll post a new version once I got time to run a full
compile and make test.
Any comments on the idea in general?



More information about the ffmpeg-devel mailing list