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

Måns Rullgård mans
Wed Oct 14 23:56:37 CEST 2009


Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:

> Hello,
> this adds extern declaration for those and also sightly reduces
> some ifdef mess.
> While I don't like it too much it is best idea I had so far.
>
> 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?

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list