comparison costablegen.c @ 10407:57acce8b1380 libavcodec

Move/add COSTABLE/SINTABLE macros to dsputil to add extern definitions for ff_cos_* and ff_sin_* without introducing too much code duplication.
author reimar
date Thu, 15 Oct 2009 17:55:51 +0000
parents 866dffa620d1
children 8fd8f6c1cdcc
comparison
equal deleted inserted replaced
10406:825c7f57cfac 10407:57acce8b1380
35 printf("/* This file was generated by libavcodec/costablegen */\n"); 35 printf("/* This file was generated by libavcodec/costablegen */\n");
36 printf("#include \"dsputil.h\"\n"); 36 printf("#include \"dsputil.h\"\n");
37 for (i = 4; i <= BITS; i++) { 37 for (i = 4; i <= BITS; i++) {
38 int m = 1 << i; 38 int m = 1 << i;
39 double freq = 2*M_PI/m; 39 double freq = 2*M_PI/m;
40 printf("const DECLARE_ALIGNED_16(FFTSample, ff_cos_%i[]) = {\n ", m); 40 printf("COSTABLE(%i) = {\n ", m);
41 for (j = 0; j < m/2 - 1; j++) { 41 for (j = 0; j < m/2 - 1; j++) {
42 int idx = j > m/4 ? m/2 - j : j; 42 int idx = j > m/4 ? m/2 - j : j;
43 printf(" "FLOATFMT",", cos(idx*freq)); 43 printf(" "FLOATFMT",", cos(idx*freq));
44 if ((j & 3) == 3) 44 if ((j & 3) == 3)
45 printf("\n "); 45 printf("\n ");