]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Add __aligned macro to gcc-compat.h. and use this instead of DECLARE_ALIGNED.
authorAndre Noll <maan@systemlinux.org>
Thu, 22 Oct 2009 21:58:04 +0000 (23:58 +0200)
committerAndre Noll <maan@systemlinux.org>
Wed, 18 Nov 2009 18:34:28 +0000 (19:34 +0100)
Fix some whitespace issues in gcc-compat.h while we're at it.

gcc-compat.h
imdct.c
wma.h
wmadec_filter.c

index 1cd30af2fc7219cb132aa9d0631518e4c6efa942..7367173aac419e9abd6232408d446a01cbf35d33 100644 (file)
@@ -1,7 +1,9 @@
-# define inline                inline __attribute__ ((always_inline))
-# define __noreturn    __attribute__ ((noreturn))
-# define __malloc      __attribute__ ((malloc))
-# define __a_unused    __attribute__ ((unused))
+#define inline inline __attribute__ ((always_inline))
+#define __noreturn __attribute__ ((noreturn))
+#define __malloc __attribute__ ((malloc))
+#define __a_unused __attribute__ ((unused))
+#define __aligned(alignment) __attribute__((__aligned__(alignment)))
+
 /*
  * p is the number of the "format string" parameter, and q is
  * the number of the first variadic parameter.
 /*
  * p is the number of the "format string" parameter, and q is
  * the number of the first variadic parameter.
diff --git a/imdct.c b/imdct.c
index ac085bbc519dcd5dfa8b359f96475270ef2e1a48..f77da7bb7228c6a982dff314ba3fd459f3006d32 100644 (file)
--- a/imdct.c
+++ b/imdct.c
@@ -51,20 +51,22 @@ struct mdct_context {
        struct fft_context fft;
 };
 
        struct fft_context fft;
 };
 
-/* cos(2*pi*x/n) for 0<=x<=n/4, followed by its reverse */
-DECLARE_ALIGNED_16(fftsample_t, ff_cos_16[8]);
-DECLARE_ALIGNED_16(fftsample_t, ff_cos_32[16]);
-DECLARE_ALIGNED_16(fftsample_t, ff_cos_64[32]);
-DECLARE_ALIGNED_16(fftsample_t, ff_cos_128[64]);
-DECLARE_ALIGNED_16(fftsample_t, ff_cos_256[128]);
-DECLARE_ALIGNED_16(fftsample_t, ff_cos_512[256]);
-DECLARE_ALIGNED_16(fftsample_t, ff_cos_1024[512]);
-DECLARE_ALIGNED_16(fftsample_t, ff_cos_2048[1024]);
-DECLARE_ALIGNED_16(fftsample_t, ff_cos_4096[2048]);
-DECLARE_ALIGNED_16(fftsample_t, ff_cos_8192[4096]);
-DECLARE_ALIGNED_16(fftsample_t, ff_cos_16384[8192]);
-DECLARE_ALIGNED_16(fftsample_t, ff_cos_32768[16384]);
-DECLARE_ALIGNED_16(fftsample_t, ff_cos_65536[32768]);
+/** cos(2 * pi * x / n) for 0 <= x <= n / 4, followed by its reverse */
+#define COSINE_TAB(n) fftsample_t ff_cos_ ## n[n / 2] __aligned(16)
+
+COSINE_TAB(16);
+COSINE_TAB(32);
+COSINE_TAB(64);
+COSINE_TAB(128);
+COSINE_TAB(256);
+COSINE_TAB(512);
+COSINE_TAB(1024);
+COSINE_TAB(2048);
+COSINE_TAB(4096);
+COSINE_TAB(8192);
+COSINE_TAB(16384);
+COSINE_TAB(32768);
+COSINE_TAB(65536);
 
 static fftsample_t *ff_cos_tabs[] = {
        ff_cos_16, ff_cos_32, ff_cos_64, ff_cos_128, ff_cos_256,
 
 static fftsample_t *ff_cos_tabs[] = {
        ff_cos_16, ff_cos_32, ff_cos_64, ff_cos_128, ff_cos_256,
diff --git a/wma.h b/wma.h
index df61c20a173e78ebd66465c4855c5c3f6d0fae90..33e34a3515b482c9f682e6c7472dbc7ec711e190 100644 (file)
--- a/wma.h
+++ b/wma.h
@@ -31,5 +31,3 @@ const char *search_pattern(const char *pattern, int pattern_len,
 int read_asf_header(const char *buf, int loaded, struct asf_header_info *ahi);
 
 #define WMA_FRAME_SKIP 31
 int read_asf_header(const char *buf, int loaded, struct asf_header_info *ahi);
 
 #define WMA_FRAME_SKIP 31
-#define DECLARE_ALIGNED(n,t,v)      t v __attribute__ ((aligned (n)))
-#define DECLARE_ALIGNED_16(t, v) DECLARE_ALIGNED(16, t, v)
index c5a91e0fcb7f28ec07abdadfaa85945a0e5035ba..d40cc3eb201d808be4d98e4665038e86f221ff70 100644 (file)
@@ -131,12 +131,14 @@ struct private_wmadec_data {
 #define VLCBITS 9
 #define VLCMAX ((22 + VLCBITS - 1) / VLCBITS)
 
 #define VLCBITS 9
 #define VLCMAX ((22 + VLCBITS - 1) / VLCBITS)
 
-DECLARE_ALIGNED(16, float, ff_sine_128[128]);
-DECLARE_ALIGNED(16, float, ff_sine_256[256]);
-DECLARE_ALIGNED(16, float, ff_sine_512[512]);
-DECLARE_ALIGNED(16, float, ff_sine_1024[1024]);
-DECLARE_ALIGNED(16, float, ff_sine_2048[2048]);
-DECLARE_ALIGNED(16, float, ff_sine_4096[4096]);
+#define SINE_WINDOW(x) float ff_sine_ ## x[x] __aligned(16)
+
+SINE_WINDOW(128);
+SINE_WINDOW(256);
+SINE_WINDOW(512);
+SINE_WINDOW(1024);
+SINE_WINDOW(2048);
+SINE_WINDOW(4096);
 
 static float *ff_sine_windows[6] = {
        ff_sine_128, ff_sine_256, ff_sine_512, ff_sine_1024,
 
 static float *ff_sine_windows[6] = {
        ff_sine_128, ff_sine_256, ff_sine_512, ff_sine_1024,