comparison mp3lib/dct64_altivec.c @ 25996:dcb28cc9ca2c

Refactor AltiVec macros as done for FFmpeg.
author diego
date Mon, 18 Feb 2008 23:33:14 +0000
parents baddb0681b2e
children 2aadf9302854
comparison
equal deleted inserted replaced
25995:236ab58453f7 25996:dcb28cc9ca2c
26 #define WORD_s1 0x14,0x15,0x16,0x17 26 #define WORD_s1 0x14,0x15,0x16,0x17
27 #define WORD_s2 0x18,0x19,0x1a,0x1b 27 #define WORD_s2 0x18,0x19,0x1a,0x1b
28 #define WORD_s3 0x1c,0x1d,0x1e,0x1f 28 #define WORD_s3 0x1c,0x1d,0x1e,0x1f
29 29
30 #ifdef __APPLE_CC__ 30 #ifdef __APPLE_CC__
31 #define vcprm(a,b,c,d) (const vector unsigned char)(WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d) 31 #define AVV(x...) (x)
32 #else 32 #else
33 #define vcprm(a,b,c,d) (const vector unsigned char){WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d} 33 #define AVV(x...) {x}
34 #endif 34 #endif
35
36 #define vcprm(a,b,c,d) (const vector unsigned char)AVV(WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d)
37 #define vcii(a,b,c,d) (const vector float)AVV(FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d)
38
39 #define FOUROF(a) AVV(a,a,a,a)
35 40
36 // vcprmle is used to keep the same index as in the SSE version. 41 // vcprmle is used to keep the same index as in the SSE version.
37 // it's the same as vcprm, with the index inversed 42 // it's the same as vcprm, with the index inversed
38 // ('le' is Little Endian) 43 // ('le' is Little Endian)
39 #define vcprmle(a,b,c,d) vcprm(d,c,b,a) 44 #define vcprmle(a,b,c,d) vcprm(d,c,b,a)
40 45
41 // used to build inverse/identity vectors (vcii) 46 // used to build inverse/identity vectors (vcii)
42 // n is _n_egative, p is _p_ositive 47 // n is _n_egative, p is _p_ositive
43 #define FLOAT_n -1. 48 #define FLOAT_n -1.
44 #define FLOAT_p 1. 49 #define FLOAT_p 1.
45
46 #ifdef __APPLE_CC__
47 #define vcii(a,b,c,d) (const vector float)(FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d)
48 #else
49 #define vcii(a,b,c,d) (const vector float){FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d}
50 #endif
51
52 #ifdef __APPLE_CC__
53 #define FOUROF(a) (a)
54 #else
55 #define FOUROF(a) {a,a,a,a}
56 #endif
57 50
58 void dct64_altivec(real *a,real *b,real *c) 51 void dct64_altivec(real *a,real *b,real *c)
59 { 52 {
60 real __attribute__ ((aligned(16))) b1[0x20]; 53 real __attribute__ ((aligned(16))) b1[0x20];
61 real __attribute__ ((aligned(16))) b2[0x20]; 54 real __attribute__ ((aligned(16))) b2[0x20];