annotate liba52/liba52_changes.diff @ 16745:a1e105d71db4

Implement seeking
author reimar
date Wed, 12 Oct 2005 21:55:55 +0000
parents 9de84a73f6d0
children 4bad7f00556e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14990
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1 --- include/a52.h 2005-03-22 19:58:53.000000000 +0100
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2 +++ a52.h 2004-03-19 01:15:49.000000000 +0100
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3 @@ -19,6 +25,9 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
4 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
5 */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
6
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
7 +#ifndef A52_H
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
8 +#define A52_H
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
9 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
10 #ifndef LIBA52_DOUBLE
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
11 typedef float sample_t;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
12 #else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
13 @@ -113,3 +122,10 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
14 void a52_dynrng (a52_state_t * state,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
15 sample_t (* call) (sample_t, void *), void * data);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
16 int a52_block (a52_state_t * state, sample_t * samples);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
17 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
18 +void* a52_resample_init(uint32_t mm_accel,int flags,int chans);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
19 +extern int (* a52_resample) (float * _f, int16_t * s16);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
20 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
21 +uint16_t crc16_block(uint8_t *data,uint32_t num_bytes);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
22 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
23 +#endif /* A52_H */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
24 --- liba52/a52_internal.h 2005-03-22 19:59:35.000000000 +0100
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
25 +++ a52_internal.h 2004-03-19 01:15:49.000000000 +0100
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
26 @@ -41,11 +43,12 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
27
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
28 int downmix_init (int input, int flags, sample_t * level,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
29 sample_t clev, sample_t slev);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
30 +void downmix_accel_init(uint32_t mm_accel);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
31 int downmix_coeff (sample_t * coeff, int acmod, int output, sample_t level,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
32 sample_t clev, sample_t slev);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
33 -void downmix (sample_t * samples, int acmod, int output, sample_t bias,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
34 +extern void (*downmix) (sample_t * samples, int acmod, int output, sample_t bias,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
35 sample_t clev, sample_t slev);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
36 -void upmix (sample_t * samples, int acmod, int output);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
37 +extern void (*upmix) (sample_t * samples, int acmod, int output);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
38
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
39 void imdct_init (uint32_t mm_accel);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
40 extern void (* imdct_256) (sample_t * data, sample_t * delay, sample_t bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
41 --- liba52/bitstream.c 2005-03-22 19:59:35.000000000 +0100
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
42 +++ bitstream.c 2004-03-19 01:15:49.000000000 +0100
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
43 @@ -29,7 +35,12 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
44
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
45 #define BUFFER_SIZE 4096
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
46
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
47 +#ifdef ALT_BITSTREAM_READER
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
48 +int indx=0;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
49 +uint32_t * buffer_start;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
50 +#else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
51 static uint32_t * buffer_start;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
52 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
53
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
54 uint32_t bits_left;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
55 uint32_t current_word;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
56 @@ -41,6 +52,9 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
57 align = (int)buf & 3;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
58 buffer_start = (uint32_t *) (buf - align);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
59 bits_left = 0;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
60 +#ifdef ALT_BITSTREAM_READER
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
61 + indx=0;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
62 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
63 bitstream_get (align * 8);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
64 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
65
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
66 --- liba52/bitstream.h 2005-03-22 19:59:35.000000000 +0100
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
67 +++ bitstream.h 2004-03-19 01:15:49.000000000 +0100
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
68 @@ -19,6 +25,48 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
69 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
70 */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
71
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
72 +/* code from ffmpeg/libavcodec */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
73 +#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC_ == 3 && __GNUC_MINOR__ > 0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
74 +# define always_inline __attribute__((always_inline)) inline
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
75 +#else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
76 +# define always_inline inline
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
77 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
78 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
79 +#if defined(__sparc__) || defined(hpux)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
80 +/*
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
81 + * the alt bitstream reader performs unaligned memory accesses; that doesn't work
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
82 + * on sparc/hpux. For now, disable ALT_BITSTREAM_READER.
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
83 + */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
84 +#undef ALT_BITSTREAM_READER
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
85 +#else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
86 +// alternative (faster) bitstram reader (reades upto 3 bytes over the end of the input)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
87 +#define ALT_BITSTREAM_READER
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
88 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
89 +/* used to avoid missaligned exceptions on some archs (alpha, ...) */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
90 +#if defined (ARCH_X86) || defined(ARCH_ARMV4L)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
91 +# define unaligned32(a) (*(uint32_t*)(a))
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
92 +#else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
93 +# ifdef __GNUC__
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
94 +static always_inline uint32_t unaligned32(const void *v) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
95 + struct Unaligned {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
96 + uint32_t i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
97 + } __attribute__((packed));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
98 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
99 + return ((const struct Unaligned *) v)->i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
100 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
101 +# elif defined(__DECC)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
102 +static inline uint32_t unaligned32(const void *v) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
103 + return *(const __unaligned uint32_t *) v;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
104 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
105 +# else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
106 +static inline uint32_t unaligned32(const void *v) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
107 + return *(const uint32_t *) v;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
108 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
109 +# endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
110 +#endif //!ARCH_X86
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
111 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
112 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
113 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
114 /* (stolen from the kernel) */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
115 #ifdef WORDS_BIGENDIAN
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
116
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
117 @@ -29,7 +77,7 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
118 # if defined (__i386__)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
119
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
120 # define swab32(x) __i386_swab32(x)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
121 - static inline const uint32_t __i386_swab32(uint32_t x)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
122 + static always_inline const uint32_t __i386_swab32(uint32_t x)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
123 {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
124 __asm__("bswap %0" : "=r" (x) : "0" (x));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
125 return x;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
126 @@ -37,25 +85,42 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
127
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
128 # else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
129
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
130 -# define swab32(x)\
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
131 -((((uint8_t*)&x)[0] << 24) | (((uint8_t*)&x)[1] << 16) | \
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
132 - (((uint8_t*)&x)[2] << 8) | (((uint8_t*)&x)[3]))
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
133 -
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
134 +# define swab32(x) __generic_swab32(x)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
135 + static always_inline const uint32_t __generic_swab32(uint32_t x)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
136 + {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
137 + return ((((uint8_t*)&x)[0] << 24) | (((uint8_t*)&x)[1] << 16) |
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
138 + (((uint8_t*)&x)[2] << 8) | (((uint8_t*)&x)[3]));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
139 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
140 # endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
141 #endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
142
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
143 +#ifdef ALT_BITSTREAM_READER
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
144 +extern uint32_t *buffer_start;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
145 +extern int indx;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
146 +#else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
147 extern uint32_t bits_left;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
148 extern uint32_t current_word;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
149 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
150
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
151 void bitstream_set_ptr (uint8_t * buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
152 uint32_t bitstream_get_bh(uint32_t num_bits);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
153 int32_t bitstream_get_bh_2(uint32_t num_bits);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
154
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
155 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
156 static inline uint32_t
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
157 -bitstream_get(uint32_t num_bits)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
158 +bitstream_get(uint32_t num_bits) // note num_bits is practically a constant due to inlineing
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
159 {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
160 +#ifdef ALT_BITSTREAM_READER
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
161 + uint32_t result= swab32( unaligned32(((uint8_t *)buffer_start)+(indx>>3)) );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
162 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
163 + result<<= (indx&0x07);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
164 + result>>= 32 - num_bits;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
165 + indx+= num_bits;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
166 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
167 + return result;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
168 +#else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
169 uint32_t result;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
170 -
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
171 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
172 if(num_bits < bits_left) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
173 result = (current_word << (32 - bits_left)) >> (32 - num_bits);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
174 bits_left -= num_bits;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
175 @@ -63,11 +128,30 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
176 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
177
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
178 return bitstream_get_bh(num_bits);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
179 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
180 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
181 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
182 +static inline void bitstream_skip(int num_bits)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
183 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
184 +#ifdef ALT_BITSTREAM_READER
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
185 + indx+= num_bits;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
186 +#else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
187 + bitstream_get(num_bits);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
188 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
189 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
190
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
191 static inline int32_t
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
192 bitstream_get_2(uint32_t num_bits)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
193 {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
194 +#ifdef ALT_BITSTREAM_READER
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
195 + int32_t result= swab32( unaligned32(((uint8_t *)buffer_start)+(indx>>3)) );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
196 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
197 + result<<= (indx&0x07);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
198 + result>>= 32 - num_bits;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
199 + indx+= num_bits;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
200 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
201 + return result;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
202 +#else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
203 int32_t result;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
204
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
205 if(num_bits < bits_left) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
206 @@ -77,4 +161,5 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
207 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
208
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
209 return bitstream_get_bh_2(num_bits);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
210 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
211 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
212 --- liba52/downmix.c 2005-03-22 19:59:35.000000000 +0100
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
213 +++ downmix.c 2004-04-12 18:42:14.000000000 +0200
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
214 @@ -17,18 +23,46 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
215 * You should have received a copy of the GNU General Public License
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
216 * along with this program; if not, write to the Free Software
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
217 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
218 + *
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
219 + * SSE optimizations from Michael Niedermayer (michaelni@gmx.at)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
220 */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
221
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
222 #include "config.h"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
223
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
224 -#include <inttypes.h>
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
225 #include <string.h>
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
226 +#include <inttypes.h>
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
227
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
228 #include "a52.h"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
229 #include "a52_internal.h"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
230 +#include "mm_accel.h"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
231
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
232 #define CONVERT(acmod,output) (((output) << 3) + (acmod))
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
233
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
234 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
235 +void (*downmix)(sample_t * samples, int acmod, int output, sample_t bias,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
236 + sample_t clev, sample_t slev)= NULL;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
237 +void (*upmix)(sample_t * samples, int acmod, int output)= NULL;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
238 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
239 +static void downmix_SSE (sample_t * samples, int acmod, int output, sample_t bias,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
240 + sample_t clev, sample_t slev);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
241 +static void downmix_3dnow (sample_t * samples, int acmod, int output, sample_t bias,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
242 + sample_t clev, sample_t slev);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
243 +static void downmix_C (sample_t * samples, int acmod, int output, sample_t bias,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
244 + sample_t clev, sample_t slev);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
245 +static void upmix_MMX (sample_t * samples, int acmod, int output);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
246 +static void upmix_C (sample_t * samples, int acmod, int output);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
247 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
248 +void downmix_accel_init(uint32_t mm_accel)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
249 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
250 + upmix= upmix_C;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
251 + downmix= downmix_C;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
252 +#ifdef ARCH_X86
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
253 + if(mm_accel & MM_ACCEL_X86_MMX) upmix= upmix_MMX;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
254 + if(mm_accel & MM_ACCEL_X86_SSE) downmix= downmix_SSE;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
255 + if(mm_accel & MM_ACCEL_X86_3DNOW) downmix= downmix_3dnow;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
256 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
257 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
258 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
259 int downmix_init (int input, int flags, sample_t * level,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
260 sample_t clev, sample_t slev)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
261 {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
262 @@ -61,7 +95,7 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
263 output = flags & A52_CHANNEL_MASK;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
264 if (output > A52_DOLBY)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
265 return -1;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
266 -
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
267 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
268 output = table[output][input & 7];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
269
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
270 if ((output == A52_STEREO) &&
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
271 @@ -145,7 +179,6 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
272 *level *= 1 / (1 + 3 * LEVEL_3DB);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
273 break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
274 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
275 -
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
276 return output;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
277 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
278
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
279 @@ -440,12 +473,11 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
280 static void zero (sample_t * samples)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
281 {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
282 int i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
283 -
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
284 for (i = 0; i < 256; i++)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
285 samples[i] = 0;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
286 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
287
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
288 -void downmix (sample_t * samples, int acmod, int output, sample_t bias,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
289 +static void downmix_C (sample_t * samples, int acmod, int output, sample_t bias,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
290 sample_t clev, sample_t slev)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
291 {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
292 switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
293 @@ -557,7 +589,7 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
294 break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
295
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
296 case CONVERT (A52_3F2R, A52_2F1R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
297 - mix3to2 (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
298 + mix3to2 (samples, bias); //FIXME possible bug? (output doesnt seem to be used)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
299 move2to1 (samples + 768, samples + 512, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
300 break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
301
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
302 @@ -581,12 +613,12 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
303 break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
304
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
305 case CONVERT (A52_3F1R, A52_3F2R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
306 - memcpy (samples + 1027, samples + 768, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
307 + memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
308 break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
309 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
310 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
311
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
312 -void upmix (sample_t * samples, int acmod, int output)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
313 +static void upmix_C (sample_t * samples, int acmod, int output)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
314 {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
315 switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
316
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
317 @@ -651,3 +683,1137 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
318 goto mix_31to21;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
319 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
320 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
321 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
322 +#ifdef ARCH_X86
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
323 +static void mix2to1_SSE (sample_t * dest, sample_t * src, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
324 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
325 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
326 + "movlps %2, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
327 + "shufps $0x00, %%xmm7, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
328 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
329 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
330 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
331 + "movaps (%0, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
332 + "movaps 16(%0, %%esi), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
333 + "addps (%1, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
334 + "addps 16(%1, %%esi), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
335 + "addps %%xmm7, %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
336 + "addps %%xmm7, %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
337 + "movaps %%xmm0, (%1, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
338 + "movaps %%xmm1, 16(%1, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
339 + "addl $32, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
340 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
341 + :: "r" (src+256), "r" (dest+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
342 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
343 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
344 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
345 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
346 +static void mix3to1_SSE (sample_t * samples, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
347 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
348 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
349 + "movlps %1, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
350 + "shufps $0x00, %%xmm7, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
351 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
352 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
353 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
354 + "movaps (%0, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
355 + "movaps 1024(%0, %%esi), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
356 + "addps 2048(%0, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
357 + "addps %%xmm7, %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
358 + "addps %%xmm1, %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
359 + "movaps %%xmm0, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
360 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
361 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
362 + :: "r" (samples+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
363 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
364 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
365 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
366 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
367 +static void mix4to1_SSE (sample_t * samples, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
368 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
369 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
370 + "movlps %1, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
371 + "shufps $0x00, %%xmm7, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
372 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
373 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
374 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
375 + "movaps (%0, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
376 + "movaps 1024(%0, %%esi), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
377 + "addps 2048(%0, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
378 + "addps 3072(%0, %%esi), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
379 + "addps %%xmm7, %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
380 + "addps %%xmm1, %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
381 + "movaps %%xmm0, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
382 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
383 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
384 + :: "r" (samples+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
385 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
386 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
387 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
388 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
389 +static void mix5to1_SSE (sample_t * samples, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
390 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
391 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
392 + "movlps %1, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
393 + "shufps $0x00, %%xmm7, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
394 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
395 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
396 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
397 + "movaps (%0, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
398 + "movaps 1024(%0, %%esi), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
399 + "addps 2048(%0, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
400 + "addps 3072(%0, %%esi), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
401 + "addps %%xmm7, %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
402 + "addps 4096(%0, %%esi), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
403 + "addps %%xmm1, %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
404 + "movaps %%xmm0, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
405 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
406 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
407 + :: "r" (samples+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
408 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
409 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
410 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
411 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
412 +static void mix3to2_SSE (sample_t * samples, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
413 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
414 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
415 + "movlps %1, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
416 + "shufps $0x00, %%xmm7, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
417 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
418 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
419 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
420 + "movaps 1024(%0, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
421 + "addps %%xmm7, %%xmm0 \n\t" //common
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
422 + "movaps (%0, %%esi), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
423 + "movaps 2048(%0, %%esi), %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
424 + "addps %%xmm0, %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
425 + "addps %%xmm0, %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
426 + "movaps %%xmm1, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
427 + "movaps %%xmm2, 1024(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
428 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
429 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
430 + :: "r" (samples+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
431 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
432 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
433 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
434 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
435 +static void mix21to2_SSE (sample_t * left, sample_t * right, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
436 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
437 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
438 + "movlps %2, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
439 + "shufps $0x00, %%xmm7, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
440 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
441 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
442 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
443 + "movaps 1024(%1, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
444 + "addps %%xmm7, %%xmm0 \n\t" //common
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
445 + "movaps (%0, %%esi), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
446 + "movaps (%1, %%esi), %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
447 + "addps %%xmm0, %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
448 + "addps %%xmm0, %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
449 + "movaps %%xmm1, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
450 + "movaps %%xmm2, (%1, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
451 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
452 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
453 + :: "r" (left+256), "r" (right+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
454 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
455 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
456 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
457 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
458 +static void mix21toS_SSE (sample_t * samples, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
459 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
460 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
461 + "movlps %1, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
462 + "shufps $0x00, %%xmm7, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
463 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
464 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
465 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
466 + "movaps 2048(%0, %%esi), %%xmm0 \n\t" // surround
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
467 + "movaps (%0, %%esi), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
468 + "movaps 1024(%0, %%esi), %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
469 + "addps %%xmm7, %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
470 + "addps %%xmm7, %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
471 + "subps %%xmm0, %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
472 + "addps %%xmm0, %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
473 + "movaps %%xmm1, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
474 + "movaps %%xmm2, 1024(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
475 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
476 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
477 + :: "r" (samples+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
478 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
479 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
480 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
481 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
482 +static void mix31to2_SSE (sample_t * samples, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
483 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
484 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
485 + "movlps %1, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
486 + "shufps $0x00, %%xmm7, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
487 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
488 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
489 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
490 + "movaps 1024(%0, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
491 + "addps 3072(%0, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
492 + "addps %%xmm7, %%xmm0 \n\t" // common
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
493 + "movaps (%0, %%esi), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
494 + "movaps 2048(%0, %%esi), %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
495 + "addps %%xmm0, %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
496 + "addps %%xmm0, %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
497 + "movaps %%xmm1, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
498 + "movaps %%xmm2, 1024(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
499 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
500 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
501 + :: "r" (samples+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
502 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
503 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
504 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
505 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
506 +static void mix31toS_SSE (sample_t * samples, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
507 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
508 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
509 + "movlps %1, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
510 + "shufps $0x00, %%xmm7, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
511 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
512 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
513 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
514 + "movaps 1024(%0, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
515 + "movaps 3072(%0, %%esi), %%xmm3 \n\t" // surround
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
516 + "addps %%xmm7, %%xmm0 \n\t" // common
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
517 + "movaps (%0, %%esi), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
518 + "movaps 2048(%0, %%esi), %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
519 + "addps %%xmm0, %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
520 + "addps %%xmm0, %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
521 + "subps %%xmm3, %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
522 + "addps %%xmm3, %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
523 + "movaps %%xmm1, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
524 + "movaps %%xmm2, 1024(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
525 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
526 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
527 + :: "r" (samples+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
528 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
529 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
530 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
531 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
532 +static void mix22toS_SSE (sample_t * samples, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
533 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
534 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
535 + "movlps %1, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
536 + "shufps $0x00, %%xmm7, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
537 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
538 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
539 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
540 + "movaps 2048(%0, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
541 + "addps 3072(%0, %%esi), %%xmm0 \n\t" // surround
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
542 + "movaps (%0, %%esi), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
543 + "movaps 1024(%0, %%esi), %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
544 + "addps %%xmm7, %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
545 + "addps %%xmm7, %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
546 + "subps %%xmm0, %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
547 + "addps %%xmm0, %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
548 + "movaps %%xmm1, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
549 + "movaps %%xmm2, 1024(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
550 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
551 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
552 + :: "r" (samples+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
553 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
554 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
555 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
556 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
557 +static void mix32to2_SSE (sample_t * samples, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
558 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
559 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
560 + "movlps %1, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
561 + "shufps $0x00, %%xmm7, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
562 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
563 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
564 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
565 + "movaps 1024(%0, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
566 + "addps %%xmm7, %%xmm0 \n\t" // common
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
567 + "movaps %%xmm0, %%xmm1 \n\t" // common
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
568 + "addps (%0, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
569 + "addps 2048(%0, %%esi), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
570 + "addps 3072(%0, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
571 + "addps 4096(%0, %%esi), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
572 + "movaps %%xmm0, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
573 + "movaps %%xmm1, 1024(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
574 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
575 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
576 + :: "r" (samples+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
577 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
578 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
579 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
580 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
581 +static void mix32toS_SSE (sample_t * samples, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
582 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
583 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
584 + "movlps %1, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
585 + "shufps $0x00, %%xmm7, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
586 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
587 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
588 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
589 + "movaps 1024(%0, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
590 + "movaps 3072(%0, %%esi), %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
591 + "addps %%xmm7, %%xmm0 \n\t" // common
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
592 + "addps 4096(%0, %%esi), %%xmm2 \n\t" // surround
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
593 + "movaps (%0, %%esi), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
594 + "movaps 2048(%0, %%esi), %%xmm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
595 + "subps %%xmm2, %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
596 + "addps %%xmm2, %%xmm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
597 + "addps %%xmm0, %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
598 + "addps %%xmm0, %%xmm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
599 + "movaps %%xmm1, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
600 + "movaps %%xmm3, 1024(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
601 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
602 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
603 + :: "r" (samples+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
604 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
605 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
606 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
607 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
608 +static void move2to1_SSE (sample_t * src, sample_t * dest, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
609 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
610 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
611 + "movlps %2, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
612 + "shufps $0x00, %%xmm7, %%xmm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
613 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
614 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
615 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
616 + "movaps (%0, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
617 + "movaps 16(%0, %%esi), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
618 + "addps 1024(%0, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
619 + "addps 1040(%0, %%esi), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
620 + "addps %%xmm7, %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
621 + "addps %%xmm7, %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
622 + "movaps %%xmm0, (%1, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
623 + "movaps %%xmm1, 16(%1, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
624 + "addl $32, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
625 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
626 + :: "r" (src+256), "r" (dest+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
627 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
628 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
629 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
630 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
631 +static void zero_MMX(sample_t * samples)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
632 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
633 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
634 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
635 + "pxor %%mm0, %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
636 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
637 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
638 + "movq %%mm0, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
639 + "movq %%mm0, 8(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
640 + "movq %%mm0, 16(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
641 + "movq %%mm0, 24(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
642 + "addl $32, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
643 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
644 + "emms"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
645 + :: "r" (samples+256)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
646 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
647 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
648 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
649 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
650 +/*
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
651 + I hope dest and src will be at least 8 byte aligned and size
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
652 + will devide on 8 without remain
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
653 + Note: untested and unused.
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
654 +*/
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
655 +static void copy_MMX(void *dest,const void *src,unsigned size)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
656 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
657 + unsigned i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
658 + size /= 64;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
659 + for(i=0;i<size;i++)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
660 + {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
661 + __asm __volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
662 + "movq %0, %%mm0\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
663 + "movq 8%0, %%mm1\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
664 + "movq 16%0, %%mm2\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
665 + "movq 24%0, %%mm3\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
666 + "movq 32%0, %%mm4\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
667 + "movq 40%0, %%mm5\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
668 + "movq 48%0, %%mm6\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
669 + "movq 56%0, %%mm7\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
670 + "movq %%mm0, %1\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
671 + "movq %%mm1, 8%1\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
672 + "movq %%mm2, 16%1\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
673 + "movq %%mm3, 24%1\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
674 + "movq %%mm4, 32%1\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
675 + "movq %%mm5, 40%1\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
676 + "movq %%mm6, 48%1\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
677 + "movq %%mm7, 56%1\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
678 + :
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
679 + :"m"(src),"m"(dest));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
680 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
681 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
682 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
683 +static void downmix_SSE (sample_t * samples, int acmod, int output, sample_t bias,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
684 + sample_t clev, sample_t slev)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
685 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
686 + switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
687 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
688 + case CONVERT (A52_CHANNEL, A52_CHANNEL2):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
689 + memcpy (samples, samples + 256, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
690 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
691 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
692 + case CONVERT (A52_CHANNEL, A52_MONO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
693 + case CONVERT (A52_STEREO, A52_MONO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
694 + mix_2to1_SSE:
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
695 + mix2to1_SSE (samples, samples + 256, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
696 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
697 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
698 + case CONVERT (A52_2F1R, A52_MONO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
699 + if (slev == 0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
700 + goto mix_2to1_SSE;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
701 + case CONVERT (A52_3F, A52_MONO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
702 + mix_3to1_SSE:
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
703 + mix3to1_SSE (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
704 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
705 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
706 + case CONVERT (A52_3F1R, A52_MONO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
707 + if (slev == 0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
708 + goto mix_3to1_SSE;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
709 + case CONVERT (A52_2F2R, A52_MONO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
710 + if (slev == 0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
711 + goto mix_2to1_SSE;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
712 + mix4to1_SSE (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
713 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
714 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
715 + case CONVERT (A52_3F2R, A52_MONO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
716 + if (slev == 0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
717 + goto mix_3to1_SSE;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
718 + mix5to1_SSE (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
719 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
720 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
721 + case CONVERT (A52_MONO, A52_DOLBY):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
722 + memcpy (samples + 256, samples, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
723 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
724 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
725 + case CONVERT (A52_3F, A52_STEREO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
726 + case CONVERT (A52_3F, A52_DOLBY):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
727 + mix_3to2_SSE:
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
728 + mix3to2_SSE (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
729 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
730 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
731 + case CONVERT (A52_2F1R, A52_STEREO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
732 + if (slev == 0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
733 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
734 + mix21to2_SSE (samples, samples + 256, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
735 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
736 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
737 + case CONVERT (A52_2F1R, A52_DOLBY):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
738 + mix21toS_SSE (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
739 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
740 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
741 + case CONVERT (A52_3F1R, A52_STEREO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
742 + if (slev == 0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
743 + goto mix_3to2_SSE;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
744 + mix31to2_SSE (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
745 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
746 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
747 + case CONVERT (A52_3F1R, A52_DOLBY):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
748 + mix31toS_SSE (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
749 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
750 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
751 + case CONVERT (A52_2F2R, A52_STEREO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
752 + if (slev == 0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
753 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
754 + mix2to1_SSE (samples, samples + 512, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
755 + mix2to1_SSE (samples + 256, samples + 768, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
756 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
757 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
758 + case CONVERT (A52_2F2R, A52_DOLBY):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
759 + mix22toS_SSE (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
760 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
761 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
762 + case CONVERT (A52_3F2R, A52_STEREO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
763 + if (slev == 0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
764 + goto mix_3to2_SSE;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
765 + mix32to2_SSE (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
766 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
767 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
768 + case CONVERT (A52_3F2R, A52_DOLBY):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
769 + mix32toS_SSE (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
770 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
771 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
772 + case CONVERT (A52_3F1R, A52_3F):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
773 + if (slev == 0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
774 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
775 + mix21to2_SSE (samples, samples + 512, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
776 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
777 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
778 + case CONVERT (A52_3F2R, A52_3F):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
779 + if (slev == 0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
780 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
781 + mix2to1_SSE (samples, samples + 768, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
782 + mix2to1_SSE (samples + 512, samples + 1024, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
783 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
784 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
785 + case CONVERT (A52_3F1R, A52_2F1R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
786 + mix3to2_SSE (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
787 + memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
788 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
789 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
790 + case CONVERT (A52_2F2R, A52_2F1R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
791 + mix2to1_SSE (samples + 512, samples + 768, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
792 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
793 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
794 + case CONVERT (A52_3F2R, A52_2F1R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
795 + mix3to2_SSE (samples, bias); //FIXME possible bug? (output doesnt seem to be used)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
796 + move2to1_SSE (samples + 768, samples + 512, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
797 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
798 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
799 + case CONVERT (A52_3F2R, A52_3F1R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
800 + mix2to1_SSE (samples + 768, samples + 1024, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
801 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
802 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
803 + case CONVERT (A52_2F1R, A52_2F2R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
804 + memcpy (samples + 768, samples + 512, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
805 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
806 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
807 + case CONVERT (A52_3F1R, A52_2F2R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
808 + mix3to2_SSE (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
809 + memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
810 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
811 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
812 + case CONVERT (A52_3F2R, A52_2F2R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
813 + mix3to2_SSE (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
814 + memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
815 + memcpy (samples + 768, samples + 1024, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
816 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
817 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
818 + case CONVERT (A52_3F1R, A52_3F2R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
819 + memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
820 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
821 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
822 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
823 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
824 +static void upmix_MMX (sample_t * samples, int acmod, int output)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
825 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
826 + switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
827 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
828 + case CONVERT (A52_CHANNEL, A52_CHANNEL2):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
829 + memcpy (samples + 256, samples, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
830 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
831 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
832 + case CONVERT (A52_3F2R, A52_MONO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
833 + zero_MMX (samples + 1024);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
834 + case CONVERT (A52_3F1R, A52_MONO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
835 + case CONVERT (A52_2F2R, A52_MONO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
836 + zero_MMX (samples + 768);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
837 + case CONVERT (A52_3F, A52_MONO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
838 + case CONVERT (A52_2F1R, A52_MONO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
839 + zero_MMX (samples + 512);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
840 + case CONVERT (A52_CHANNEL, A52_MONO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
841 + case CONVERT (A52_STEREO, A52_MONO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
842 + zero_MMX (samples + 256);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
843 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
844 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
845 + case CONVERT (A52_3F2R, A52_STEREO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
846 + case CONVERT (A52_3F2R, A52_DOLBY):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
847 + zero_MMX (samples + 1024);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
848 + case CONVERT (A52_3F1R, A52_STEREO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
849 + case CONVERT (A52_3F1R, A52_DOLBY):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
850 + zero_MMX (samples + 768);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
851 + case CONVERT (A52_3F, A52_STEREO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
852 + case CONVERT (A52_3F, A52_DOLBY):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
853 + mix_3to2_MMX:
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
854 + memcpy (samples + 512, samples + 256, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
855 + zero_MMX (samples + 256);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
856 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
857 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
858 + case CONVERT (A52_2F2R, A52_STEREO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
859 + case CONVERT (A52_2F2R, A52_DOLBY):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
860 + zero_MMX (samples + 768);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
861 + case CONVERT (A52_2F1R, A52_STEREO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
862 + case CONVERT (A52_2F1R, A52_DOLBY):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
863 + zero_MMX (samples + 512);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
864 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
865 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
866 + case CONVERT (A52_3F2R, A52_3F):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
867 + zero_MMX (samples + 1024);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
868 + case CONVERT (A52_3F1R, A52_3F):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
869 + case CONVERT (A52_2F2R, A52_2F1R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
870 + zero_MMX (samples + 768);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
871 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
872 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
873 + case CONVERT (A52_3F2R, A52_3F1R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
874 + zero_MMX (samples + 1024);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
875 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
876 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
877 + case CONVERT (A52_3F2R, A52_2F1R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
878 + zero_MMX (samples + 1024);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
879 + case CONVERT (A52_3F1R, A52_2F1R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
880 + mix_31to21_MMX:
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
881 + memcpy (samples + 768, samples + 512, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
882 + goto mix_3to2_MMX;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
883 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
884 + case CONVERT (A52_3F2R, A52_2F2R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
885 + memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
886 + goto mix_31to21_MMX;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
887 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
888 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
889 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
890 +static void mix2to1_3dnow (sample_t * dest, sample_t * src, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
891 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
892 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
893 + "movd %2, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
894 + "punpckldq %2, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
895 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
896 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
897 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
898 + "movq (%0, %%esi), %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
899 + "movq 8(%0, %%esi), %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
900 + "movq 16(%0, %%esi), %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
901 + "movq 24(%0, %%esi), %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
902 + "pfadd (%1, %%esi), %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
903 + "pfadd 8(%1, %%esi), %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
904 + "pfadd 16(%1, %%esi), %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
905 + "pfadd 24(%1, %%esi), %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
906 + "pfadd %%mm7, %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
907 + "pfadd %%mm7, %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
908 + "pfadd %%mm7, %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
909 + "pfadd %%mm7, %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
910 + "movq %%mm0, (%1, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
911 + "movq %%mm1, 8(%1, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
912 + "movq %%mm2, 16(%1, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
913 + "movq %%mm3, 24(%1, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
914 + "addl $32, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
915 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
916 + :: "r" (src+256), "r" (dest+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
917 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
918 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
919 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
920 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
921 +static void mix3to1_3dnow (sample_t * samples, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
922 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
923 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
924 + "movd %1, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
925 + "punpckldq %1, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
926 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
927 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
928 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
929 + "movq (%0, %%esi), %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
930 + "movq 8(%0, %%esi), %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
931 + "movq 1024(%0, %%esi), %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
932 + "movq 1032(%0, %%esi), %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
933 + "pfadd 2048(%0, %%esi), %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
934 + "pfadd 2056(%0, %%esi), %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
935 + "pfadd %%mm7, %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
936 + "pfadd %%mm7, %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
937 + "pfadd %%mm2, %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
938 + "pfadd %%mm3, %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
939 + "movq %%mm0, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
940 + "movq %%mm1, 8(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
941 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
942 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
943 + :: "r" (samples+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
944 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
945 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
946 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
947 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
948 +static void mix4to1_3dnow (sample_t * samples, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
949 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
950 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
951 + "movd %1, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
952 + "punpckldq %1, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
953 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
954 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
955 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
956 + "movq (%0, %%esi), %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
957 + "movq 8(%0, %%esi), %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
958 + "movq 1024(%0, %%esi), %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
959 + "movq 1032(%0, %%esi), %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
960 + "pfadd 2048(%0, %%esi), %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
961 + "pfadd 2056(%0, %%esi), %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
962 + "pfadd 3072(%0, %%esi), %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
963 + "pfadd 3080(%0, %%esi), %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
964 + "pfadd %%mm7, %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
965 + "pfadd %%mm7, %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
966 + "pfadd %%mm2, %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
967 + "pfadd %%mm3, %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
968 + "movq %%mm0, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
969 + "movq %%mm1, 8(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
970 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
971 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
972 + :: "r" (samples+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
973 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
974 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
975 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
976 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
977 +static void mix5to1_3dnow (sample_t * samples, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
978 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
979 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
980 + "movd %1, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
981 + "punpckldq %1, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
982 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
983 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
984 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
985 + "movq (%0, %%esi), %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
986 + "movq 8(%0, %%esi), %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
987 + "movq 1024(%0, %%esi), %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
988 + "movq 1032(%0, %%esi), %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
989 + "pfadd 2048(%0, %%esi), %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
990 + "pfadd 2056(%0, %%esi), %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
991 + "pfadd 3072(%0, %%esi), %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
992 + "pfadd 3080(%0, %%esi), %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
993 + "pfadd %%mm7, %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
994 + "pfadd %%mm7, %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
995 + "pfadd 4096(%0, %%esi), %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
996 + "pfadd 4104(%0, %%esi), %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
997 + "pfadd %%mm2, %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
998 + "pfadd %%mm3, %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
999 + "movq %%mm0, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1000 + "movq %%mm1, 8(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1001 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1002 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1003 + :: "r" (samples+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1004 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1005 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1006 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1007 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1008 +static void mix3to2_3dnow (sample_t * samples, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1009 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1010 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1011 + "movd %1, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1012 + "punpckldq %1, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1013 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1014 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1015 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1016 + "movq 1024(%0, %%esi), %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1017 + "movq 1032(%0, %%esi), %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1018 + "pfadd %%mm7, %%mm0 \n\t" //common
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1019 + "pfadd %%mm7, %%mm1 \n\t" //common
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1020 + "movq (%0, %%esi), %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1021 + "movq 8(%0, %%esi), %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1022 + "movq 2048(%0, %%esi), %%mm4 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1023 + "movq 2056(%0, %%esi), %%mm5 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1024 + "pfadd %%mm0, %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1025 + "pfadd %%mm1, %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1026 + "pfadd %%mm0, %%mm4 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1027 + "pfadd %%mm1, %%mm5 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1028 + "movq %%mm2, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1029 + "movq %%mm3, 8(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1030 + "movq %%mm4, 1024(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1031 + "movq %%mm5, 1032(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1032 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1033 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1034 + :: "r" (samples+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1035 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1036 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1037 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1038 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1039 +static void mix21to2_3dnow (sample_t * left, sample_t * right, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1040 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1041 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1042 + "movd %2, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1043 + "punpckldq %2, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1044 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1045 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1046 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1047 + "movq 1024(%1, %%esi), %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1048 + "movq 1032(%1, %%esi), %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1049 + "pfadd %%mm7, %%mm0 \n\t" //common
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1050 + "pfadd %%mm7, %%mm1 \n\t" //common
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1051 + "movq (%0, %%esi), %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1052 + "movq 8(%0, %%esi), %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1053 + "movq (%1, %%esi), %%mm4 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1054 + "movq 8(%1, %%esi), %%mm5 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1055 + "pfadd %%mm0, %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1056 + "pfadd %%mm1, %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1057 + "pfadd %%mm0, %%mm4 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1058 + "pfadd %%mm1, %%mm5 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1059 + "movq %%mm2, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1060 + "movq %%mm3, 8(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1061 + "movq %%mm4, (%1, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1062 + "movq %%mm5, 8(%1, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1063 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1064 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1065 + :: "r" (left+256), "r" (right+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1066 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1067 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1068 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1069 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1070 +static void mix21toS_3dnow (sample_t * samples, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1071 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1072 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1073 + "movd %1, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1074 + "punpckldq %1, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1075 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1076 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1077 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1078 + "movq 2048(%0, %%esi), %%mm0 \n\t" // surround
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1079 + "movq 2056(%0, %%esi), %%mm1 \n\t" // surround
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1080 + "movq (%0, %%esi), %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1081 + "movq 8(%0, %%esi), %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1082 + "movq 1024(%0, %%esi), %%mm4 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1083 + "movq 1032(%0, %%esi), %%mm5 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1084 + "pfadd %%mm7, %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1085 + "pfadd %%mm7, %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1086 + "pfadd %%mm7, %%mm4 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1087 + "pfadd %%mm7, %%mm5 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1088 + "pfsub %%mm0, %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1089 + "pfsub %%mm1, %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1090 + "pfadd %%mm0, %%mm4 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1091 + "pfadd %%mm1, %%mm5 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1092 + "movq %%mm2, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1093 + "movq %%mm3, 8(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1094 + "movq %%mm4, 1024(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1095 + "movq %%mm5, 1032(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1096 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1097 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1098 + :: "r" (samples+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1099 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1100 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1101 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1102 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1103 +static void mix31to2_3dnow (sample_t * samples, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1104 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1105 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1106 + "movd %1, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1107 + "punpckldq %1, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1108 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1109 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1110 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1111 + "movq 1024(%0, %%esi), %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1112 + "movq 1032(%0, %%esi), %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1113 + "pfadd 3072(%0, %%esi), %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1114 + "pfadd 3080(%0, %%esi), %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1115 + "pfadd %%mm7, %%mm0 \n\t" // common
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1116 + "pfadd %%mm7, %%mm1 \n\t" // common
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1117 + "movq (%0, %%esi), %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1118 + "movq 8(%0, %%esi), %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1119 + "movq 2048(%0, %%esi), %%mm4 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1120 + "movq 2056(%0, %%esi), %%mm5 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1121 + "pfadd %%mm0, %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1122 + "pfadd %%mm1, %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1123 + "pfadd %%mm0, %%mm4 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1124 + "pfadd %%mm1, %%mm5 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1125 + "movq %%mm2, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1126 + "movq %%mm3, 8(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1127 + "movq %%mm4, 1024(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1128 + "movq %%mm5, 1032(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1129 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1130 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1131 + :: "r" (samples+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1132 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1133 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1134 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1135 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1136 +static void mix31toS_3dnow (sample_t * samples, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1137 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1138 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1139 + "movd %1, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1140 + "punpckldq %1, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1141 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1142 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1143 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1144 + "movq 1024(%0, %%esi), %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1145 + "movq 1032(%0, %%esi), %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1146 + "pfadd %%mm7, %%mm0 \n\t" // common
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1147 + "pfadd %%mm7, %%mm1 \n\t" // common
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1148 + "movq (%0, %%esi), %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1149 + "movq 8(%0, %%esi), %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1150 + "movq 2048(%0, %%esi), %%mm4 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1151 + "movq 2056(%0, %%esi), %%mm5 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1152 + "pfadd %%mm0, %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1153 + "pfadd %%mm1, %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1154 + "pfadd %%mm0, %%mm4 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1155 + "pfadd %%mm1, %%mm5 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1156 + "movq 3072(%0, %%esi), %%mm0 \n\t" // surround
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1157 + "movq 3080(%0, %%esi), %%mm1 \n\t" // surround
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1158 + "pfsub %%mm0, %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1159 + "pfsub %%mm1, %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1160 + "pfadd %%mm0, %%mm4 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1161 + "pfadd %%mm1, %%mm5 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1162 + "movq %%mm2, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1163 + "movq %%mm3, 8(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1164 + "movq %%mm4, 1024(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1165 + "movq %%mm5, 1032(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1166 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1167 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1168 + :: "r" (samples+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1169 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1170 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1171 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1172 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1173 +static void mix22toS_3dnow (sample_t * samples, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1174 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1175 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1176 + "movd %1, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1177 + "punpckldq %1, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1178 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1179 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1180 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1181 + "movq 2048(%0, %%esi), %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1182 + "movq 2056(%0, %%esi), %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1183 + "pfadd 3072(%0, %%esi), %%mm0 \n\t" // surround
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1184 + "pfadd 3080(%0, %%esi), %%mm1 \n\t" // surround
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1185 + "movq (%0, %%esi), %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1186 + "movq 8(%0, %%esi), %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1187 + "movq 1024(%0, %%esi), %%mm4 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1188 + "movq 1032(%0, %%esi), %%mm5 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1189 + "pfadd %%mm7, %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1190 + "pfadd %%mm7, %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1191 + "pfadd %%mm7, %%mm4 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1192 + "pfadd %%mm7, %%mm5 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1193 + "pfsub %%mm0, %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1194 + "pfsub %%mm1, %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1195 + "pfadd %%mm0, %%mm4 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1196 + "pfadd %%mm1, %%mm5 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1197 + "movq %%mm2, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1198 + "movq %%mm3, 8(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1199 + "movq %%mm4, 1024(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1200 + "movq %%mm5, 1032(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1201 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1202 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1203 + :: "r" (samples+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1204 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1205 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1206 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1207 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1208 +static void mix32to2_3dnow (sample_t * samples, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1209 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1210 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1211 + "movd %1, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1212 + "punpckldq %1, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1213 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1214 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1215 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1216 + "movq 1024(%0, %%esi), %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1217 + "movq 1032(%0, %%esi), %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1218 + "pfadd %%mm7, %%mm0 \n\t" // common
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1219 + "pfadd %%mm7, %%mm1 \n\t" // common
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1220 + "movq %%mm0, %%mm2 \n\t" // common
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1221 + "movq %%mm1, %%mm3 \n\t" // common
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1222 + "pfadd (%0, %%esi), %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1223 + "pfadd 8(%0, %%esi), %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1224 + "pfadd 2048(%0, %%esi), %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1225 + "pfadd 2056(%0, %%esi), %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1226 + "pfadd 3072(%0, %%esi), %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1227 + "pfadd 3080(%0, %%esi), %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1228 + "pfadd 4096(%0, %%esi), %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1229 + "pfadd 4104(%0, %%esi), %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1230 + "movq %%mm0, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1231 + "movq %%mm1, 8(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1232 + "movq %%mm2, 1024(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1233 + "movq %%mm3, 1032(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1234 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1235 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1236 + :: "r" (samples+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1237 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1238 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1239 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1240 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1241 +/* todo: should be optimized better */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1242 +static void mix32toS_3dnow (sample_t * samples, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1243 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1244 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1245 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1246 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1247 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1248 + "movd %1, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1249 + "punpckldq %1, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1250 + "movq 1024(%0, %%esi), %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1251 + "movq 1032(%0, %%esi), %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1252 + "movq 3072(%0, %%esi), %%mm4 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1253 + "movq 3080(%0, %%esi), %%mm5 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1254 + "pfadd %%mm7, %%mm0 \n\t" // common
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1255 + "pfadd %%mm7, %%mm1 \n\t" // common
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1256 + "pfadd 4096(%0, %%esi), %%mm4 \n\t" // surround
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1257 + "pfadd 4104(%0, %%esi), %%mm5 \n\t" // surround
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1258 + "movq (%0, %%esi), %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1259 + "movq 8(%0, %%esi), %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1260 + "movq 2048(%0, %%esi), %%mm6 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1261 + "movq 2056(%0, %%esi), %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1262 + "pfsub %%mm4, %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1263 + "pfsub %%mm5, %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1264 + "pfadd %%mm4, %%mm6 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1265 + "pfadd %%mm5, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1266 + "pfadd %%mm0, %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1267 + "pfadd %%mm1, %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1268 + "pfadd %%mm0, %%mm6 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1269 + "pfadd %%mm1, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1270 + "movq %%mm2, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1271 + "movq %%mm3, 8(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1272 + "movq %%mm6, 1024(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1273 + "movq %%mm7, 1032(%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1274 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1275 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1276 + :: "r" (samples+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1277 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1278 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1279 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1280 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1281 +static void move2to1_3dnow (sample_t * src, sample_t * dest, sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1282 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1283 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1284 + "movd %2, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1285 + "punpckldq %2, %%mm7 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1286 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1287 + ".balign 16\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1288 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1289 + "movq (%0, %%esi), %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1290 + "movq 8(%0, %%esi), %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1291 + "movq 16(%0, %%esi), %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1292 + "movq 24(%0, %%esi), %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1293 + "pfadd 1024(%0, %%esi), %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1294 + "pfadd 1032(%0, %%esi), %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1295 + "pfadd 1040(%0, %%esi), %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1296 + "pfadd 1048(%0, %%esi), %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1297 + "pfadd %%mm7, %%mm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1298 + "pfadd %%mm7, %%mm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1299 + "pfadd %%mm7, %%mm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1300 + "pfadd %%mm7, %%mm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1301 + "movq %%mm0, (%1, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1302 + "movq %%mm1, 8(%1, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1303 + "movq %%mm2, 16(%1, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1304 + "movq %%mm3, 24(%1, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1305 + "addl $32, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1306 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1307 + :: "r" (src+256), "r" (dest+256), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1308 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1309 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1310 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1311 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1312 +static void downmix_3dnow (sample_t * samples, int acmod, int output, sample_t bias,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1313 + sample_t clev, sample_t slev)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1314 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1315 + switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1316 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1317 + case CONVERT (A52_CHANNEL, A52_CHANNEL2):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1318 + memcpy (samples, samples + 256, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1319 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1320 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1321 + case CONVERT (A52_CHANNEL, A52_MONO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1322 + case CONVERT (A52_STEREO, A52_MONO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1323 + mix_2to1_3dnow:
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1324 + mix2to1_3dnow (samples, samples + 256, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1325 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1326 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1327 + case CONVERT (A52_2F1R, A52_MONO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1328 + if (slev == 0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1329 + goto mix_2to1_3dnow;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1330 + case CONVERT (A52_3F, A52_MONO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1331 + mix_3to1_3dnow:
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1332 + mix3to1_3dnow (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1333 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1334 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1335 + case CONVERT (A52_3F1R, A52_MONO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1336 + if (slev == 0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1337 + goto mix_3to1_3dnow;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1338 + case CONVERT (A52_2F2R, A52_MONO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1339 + if (slev == 0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1340 + goto mix_2to1_3dnow;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1341 + mix4to1_3dnow (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1342 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1343 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1344 + case CONVERT (A52_3F2R, A52_MONO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1345 + if (slev == 0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1346 + goto mix_3to1_3dnow;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1347 + mix5to1_3dnow (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1348 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1349 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1350 + case CONVERT (A52_MONO, A52_DOLBY):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1351 + memcpy (samples + 256, samples, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1352 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1353 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1354 + case CONVERT (A52_3F, A52_STEREO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1355 + case CONVERT (A52_3F, A52_DOLBY):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1356 + mix_3to2_3dnow:
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1357 + mix3to2_3dnow (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1358 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1359 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1360 + case CONVERT (A52_2F1R, A52_STEREO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1361 + if (slev == 0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1362 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1363 + mix21to2_3dnow (samples, samples + 256, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1364 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1365 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1366 + case CONVERT (A52_2F1R, A52_DOLBY):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1367 + mix21toS_3dnow (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1368 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1369 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1370 + case CONVERT (A52_3F1R, A52_STEREO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1371 + if (slev == 0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1372 + goto mix_3to2_3dnow;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1373 + mix31to2_3dnow (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1374 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1375 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1376 + case CONVERT (A52_3F1R, A52_DOLBY):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1377 + mix31toS_3dnow (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1378 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1379 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1380 + case CONVERT (A52_2F2R, A52_STEREO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1381 + if (slev == 0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1382 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1383 + mix2to1_3dnow (samples, samples + 512, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1384 + mix2to1_3dnow (samples + 256, samples + 768, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1385 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1386 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1387 + case CONVERT (A52_2F2R, A52_DOLBY):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1388 + mix22toS_3dnow (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1389 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1390 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1391 + case CONVERT (A52_3F2R, A52_STEREO):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1392 + if (slev == 0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1393 + goto mix_3to2_3dnow;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1394 + mix32to2_3dnow (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1395 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1396 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1397 + case CONVERT (A52_3F2R, A52_DOLBY):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1398 + mix32toS_3dnow (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1399 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1400 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1401 + case CONVERT (A52_3F1R, A52_3F):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1402 + if (slev == 0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1403 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1404 + mix21to2_3dnow (samples, samples + 512, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1405 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1406 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1407 + case CONVERT (A52_3F2R, A52_3F):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1408 + if (slev == 0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1409 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1410 + mix2to1_3dnow (samples, samples + 768, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1411 + mix2to1_3dnow (samples + 512, samples + 1024, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1412 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1413 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1414 + case CONVERT (A52_3F1R, A52_2F1R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1415 + mix3to2_3dnow (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1416 + memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1417 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1418 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1419 + case CONVERT (A52_2F2R, A52_2F1R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1420 + mix2to1_3dnow (samples + 512, samples + 768, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1421 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1422 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1423 + case CONVERT (A52_3F2R, A52_2F1R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1424 + mix3to2_3dnow (samples, bias); //FIXME possible bug? (output doesnt seem to be used)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1425 + move2to1_3dnow (samples + 768, samples + 512, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1426 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1427 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1428 + case CONVERT (A52_3F2R, A52_3F1R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1429 + mix2to1_3dnow (samples + 768, samples + 1024, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1430 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1431 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1432 + case CONVERT (A52_2F1R, A52_2F2R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1433 + memcpy (samples + 768, samples + 512, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1434 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1435 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1436 + case CONVERT (A52_3F1R, A52_2F2R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1437 + mix3to2_3dnow (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1438 + memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1439 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1440 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1441 + case CONVERT (A52_3F2R, A52_2F2R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1442 + mix3to2_3dnow (samples, bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1443 + memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1444 + memcpy (samples + 768, samples + 1024, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1445 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1446 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1447 + case CONVERT (A52_3F1R, A52_3F2R):
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1448 + memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1449 + break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1450 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1451 + __asm __volatile("femms":::"memory");
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1452 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1453 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1454 +#endif //ARCH_X86
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1455 --- liba52/imdct.c 2005-03-22 19:59:35.000000000 +0100
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1456 +++ imdct.c 2004-04-26 22:00:57.000000000 +0200
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1457 @@ -17,17 +23,32 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1458 * You should have received a copy of the GNU General Public License
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1459 * along with this program; if not, write to the Free Software
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1460 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1461 + *
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1462 + * SSE optimizations from Michael Niedermayer (michaelni@gmx.at)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1463 + * 3DNOW optimizations from Nick Kurshev <nickols_k@mail.ru>
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1464 + * michael did port them from libac3 (untested, perhaps totally broken)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1465 + * AltiVec optimizations from Romain Dolbeau (romain@dolbeau.org)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1466 */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1467
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1468 #include "config.h"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1469
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1470 -#include <inttypes.h>
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1471 #include <math.h>
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1472 #include <stdio.h>
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1473 +#ifndef M_PI
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1474 +#define M_PI 3.1415926535897932384626433832795029
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1475 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1476 +#include <inttypes.h>
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1477
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1478 #include "a52.h"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1479 #include "a52_internal.h"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1480 #include "mm_accel.h"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1481 +#include "mangle.h"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1482 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1483 +#ifdef RUNTIME_CPUDETECT
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1484 +#undef HAVE_3DNOWEX
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1485 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1486 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1487 +#define USE_AC3_C
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1488
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1489 void (* imdct_256) (sample_t data[], sample_t delay[], sample_t bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1490 void (* imdct_512) (sample_t data[], sample_t delay[], sample_t bias);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1491 @@ -37,9 +58,22 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1492 sample_t imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1493 } complex_t;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1494
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1495 +static void fft_128p(complex_t *a);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1496 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1497 +static const int pm128[128] attribute_used __attribute__((aligned(16))) =
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1498 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1499 + 0, 16, 32, 48, 64, 80, 96, 112, 8, 40, 72, 104, 24, 56, 88, 120,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1500 + 4, 20, 36, 52, 68, 84, 100, 116, 12, 28, 44, 60, 76, 92, 108, 124,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1501 + 2, 18, 34, 50, 66, 82, 98, 114, 10, 42, 74, 106, 26, 58, 90, 122,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1502 + 6, 22, 38, 54, 70, 86, 102, 118, 14, 46, 78, 110, 30, 62, 94, 126,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1503 + 1, 17, 33, 49, 65, 81, 97, 113, 9, 41, 73, 105, 25, 57, 89, 121,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1504 + 5, 21, 37, 53, 69, 85, 101, 117, 13, 29, 45, 61, 77, 93, 109, 125,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1505 + 3, 19, 35, 51, 67, 83, 99, 115, 11, 43, 75, 107, 27, 59, 91, 123,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1506 + 7, 23, 39, 55, 71, 87, 103, 119, 15, 31, 47, 63, 79, 95, 111, 127
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1507 +};
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1508
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1509 /* 128 point bit-reverse LUT */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1510 -static uint8_t bit_reverse_512[] = {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1511 +static uint8_t attribute_used bit_reverse_512[] = {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1512 0x00, 0x40, 0x20, 0x60, 0x10, 0x50, 0x30, 0x70,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1513 0x08, 0x48, 0x28, 0x68, 0x18, 0x58, 0x38, 0x78,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1514 0x04, 0x44, 0x24, 0x64, 0x14, 0x54, 0x34, 0x74,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1515 @@ -67,23 +101,42 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1516 0x03, 0x23, 0x13, 0x33, 0x0b, 0x2b, 0x1b, 0x3b,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1517 0x07, 0x27, 0x17, 0x37, 0x0f, 0x2f, 0x1f, 0x3f};
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1518
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1519 -static complex_t buf[128];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1520 +#ifdef ARCH_X86
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1521 +// NOTE: SSE needs 16byte alignment or it will segfault
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1522 +//
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1523 +static complex_t __attribute__((aligned(16))) buf[128];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1524 +static float __attribute__((aligned(16))) sseSinCos1c[256];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1525 +static float __attribute__((aligned(16))) sseSinCos1d[256];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1526 +static float attribute_used __attribute__((aligned(16))) ps111_1[4]={1,1,1,-1};
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1527 +//static float __attribute__((aligned(16))) sseW0[4];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1528 +static float __attribute__((aligned(16))) sseW1[8];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1529 +static float __attribute__((aligned(16))) sseW2[16];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1530 +static float __attribute__((aligned(16))) sseW3[32];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1531 +static float __attribute__((aligned(16))) sseW4[64];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1532 +static float __attribute__((aligned(16))) sseW5[128];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1533 +static float __attribute__((aligned(16))) sseW6[256];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1534 +static float __attribute__((aligned(16))) *sseW[7]=
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1535 + {NULL /*sseW0*/,sseW1,sseW2,sseW3,sseW4,sseW5,sseW6};
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1536 +static float __attribute__((aligned(16))) sseWindow[512];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1537 +#else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1538 +static complex_t __attribute__((aligned(16))) buf[128];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1539 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1540
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1541 /* Twiddle factor LUT */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1542 -static complex_t w_1[1];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1543 -static complex_t w_2[2];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1544 -static complex_t w_4[4];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1545 -static complex_t w_8[8];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1546 -static complex_t w_16[16];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1547 -static complex_t w_32[32];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1548 -static complex_t w_64[64];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1549 -static complex_t * w[7] = {w_1, w_2, w_4, w_8, w_16, w_32, w_64};
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1550 +static complex_t __attribute__((aligned(16))) w_1[1];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1551 +static complex_t __attribute__((aligned(16))) w_2[2];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1552 +static complex_t __attribute__((aligned(16))) w_4[4];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1553 +static complex_t __attribute__((aligned(16))) w_8[8];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1554 +static complex_t __attribute__((aligned(16))) w_16[16];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1555 +static complex_t __attribute__((aligned(16))) w_32[32];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1556 +static complex_t __attribute__((aligned(16))) w_64[64];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1557 +static complex_t __attribute__((aligned(16))) * w[7] = {w_1, w_2, w_4, w_8, w_16, w_32, w_64};
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1558
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1559 /* Twiddle factors for IMDCT */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1560 -static sample_t xcos1[128];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1561 -static sample_t xsin1[128];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1562 -static sample_t xcos2[64];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1563 -static sample_t xsin2[64];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1564 +static sample_t __attribute__((aligned(16))) xcos1[128];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1565 +static sample_t __attribute__((aligned(16))) xsin1[128];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1566 +static sample_t __attribute__((aligned(16))) xcos2[64];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1567 +static sample_t __attribute__((aligned(16))) xsin2[64];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1568
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1569 /* Windowing function for Modified DCT - Thank you acroread */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1570 sample_t imdct_window[] = {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1571 @@ -145,16 +198,19 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1572 void
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1573 imdct_do_512(sample_t data[],sample_t delay[], sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1574 {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1575 - int i,k;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1576 + int i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1577 +#ifndef USE_AC3_C
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1578 + int k;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1579 int p,q;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1580 int m;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1581 int two_m;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1582 int two_m_plus_one;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1583
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1584 - sample_t tmp_a_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1585 - sample_t tmp_a_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1586 sample_t tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1587 sample_t tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1588 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1589 + sample_t tmp_a_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1590 + sample_t tmp_a_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1591
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1592 sample_t *data_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1593 sample_t *delay_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1594 @@ -162,22 +218,21 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1595
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1596 /* 512 IMDCT with source and dest data in 'data' */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1597
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1598 - /* Pre IFFT complex multiply plus IFFT cmplx conjugate */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1599 + /* Pre IFFT complex multiply plus IFFT cmplx conjugate & reordering*/
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1600 for( i=0; i < 128; i++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1601 /* z[i] = (X[256-2*i-1] + j * X[2*i]) * (xcos1[i] + j * xsin1[i]) ; */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1602 - buf[i].real = (data[256-2*i-1] * xcos1[i]) - (data[2*i] * xsin1[i]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1603 - buf[i].imag = -1.0 * ((data[2*i] * xcos1[i]) + (data[256-2*i-1] * xsin1[i]));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1604 - }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1605 -
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1606 - /* Bit reversed shuffling */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1607 - for(i=0; i<128; i++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1608 - k = bit_reverse_512[i];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1609 - if (k < i)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1610 - swap_cmplx(&buf[i],&buf[k]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1611 +#ifdef USE_AC3_C
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1612 + int j= pm128[i];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1613 +#else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1614 + int j= bit_reverse_512[i];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1615 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1616 + buf[i].real = (data[256-2*j-1] * xcos1[j]) - (data[2*j] * xsin1[j]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1617 + buf[i].imag = -1.0 * ((data[2*j] * xcos1[j]) + (data[256-2*j-1] * xsin1[j]));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1618 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1619
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1620 /* FFT Merge */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1621 - for (m=0; m < 7; m++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1622 +/* unoptimized variant
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1623 + for (m=1; m < 7; m++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1624 if(m)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1625 two_m = (1 << m);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1626 else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1627 @@ -185,8 +240,8 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1628
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1629 two_m_plus_one = (1 << (m+1));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1630
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1631 - for(k = 0; k < two_m; k++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1632 - for(i = 0; i < 128; i += two_m_plus_one) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1633 + for(i = 0; i < 128; i += two_m_plus_one) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1634 + for(k = 0; k < two_m; k++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1635 p = k + i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1636 q = p + two_m;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1637 tmp_a_r = buf[p].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1638 @@ -200,7 +255,102 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1639 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1640 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1641 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1642 +*/
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1643 +#ifdef USE_AC3_C
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1644 + fft_128p (&buf[0]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1645 +#else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1646 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1647 + /* 1. iteration */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1648 + for(i = 0; i < 128; i += 2) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1649 + tmp_a_r = buf[i].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1650 + tmp_a_i = buf[i].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1651 + tmp_b_r = buf[i+1].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1652 + tmp_b_i = buf[i+1].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1653 + buf[i].real = tmp_a_r + tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1654 + buf[i].imag = tmp_a_i + tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1655 + buf[i+1].real = tmp_a_r - tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1656 + buf[i+1].imag = tmp_a_i - tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1657 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1658 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1659 + /* 2. iteration */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1660 + // Note w[1]={{1,0}, {0,-1}}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1661 + for(i = 0; i < 128; i += 4) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1662 + tmp_a_r = buf[i].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1663 + tmp_a_i = buf[i].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1664 + tmp_b_r = buf[i+2].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1665 + tmp_b_i = buf[i+2].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1666 + buf[i].real = tmp_a_r + tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1667 + buf[i].imag = tmp_a_i + tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1668 + buf[i+2].real = tmp_a_r - tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1669 + buf[i+2].imag = tmp_a_i - tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1670 + tmp_a_r = buf[i+1].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1671 + tmp_a_i = buf[i+1].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1672 + tmp_b_r = buf[i+3].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1673 + tmp_b_i = buf[i+3].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1674 + buf[i+1].real = tmp_a_r + tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1675 + buf[i+1].imag = tmp_a_i - tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1676 + buf[i+3].real = tmp_a_r - tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1677 + buf[i+3].imag = tmp_a_i + tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1678 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1679
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1680 + /* 3. iteration */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1681 + for(i = 0; i < 128; i += 8) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1682 + tmp_a_r = buf[i].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1683 + tmp_a_i = buf[i].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1684 + tmp_b_r = buf[i+4].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1685 + tmp_b_i = buf[i+4].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1686 + buf[i].real = tmp_a_r + tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1687 + buf[i].imag = tmp_a_i + tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1688 + buf[i+4].real = tmp_a_r - tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1689 + buf[i+4].imag = tmp_a_i - tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1690 + tmp_a_r = buf[1+i].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1691 + tmp_a_i = buf[1+i].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1692 + tmp_b_r = (buf[i+5].real + buf[i+5].imag) * w[2][1].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1693 + tmp_b_i = (buf[i+5].imag - buf[i+5].real) * w[2][1].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1694 + buf[1+i].real = tmp_a_r + tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1695 + buf[1+i].imag = tmp_a_i + tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1696 + buf[i+5].real = tmp_a_r - tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1697 + buf[i+5].imag = tmp_a_i - tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1698 + tmp_a_r = buf[i+2].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1699 + tmp_a_i = buf[i+2].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1700 + tmp_b_r = buf[i+6].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1701 + tmp_b_i = - buf[i+6].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1702 + buf[i+2].real = tmp_a_r + tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1703 + buf[i+2].imag = tmp_a_i + tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1704 + buf[i+6].real = tmp_a_r - tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1705 + buf[i+6].imag = tmp_a_i - tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1706 + tmp_a_r = buf[i+3].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1707 + tmp_a_i = buf[i+3].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1708 + tmp_b_r = (buf[i+7].real - buf[i+7].imag) * w[2][3].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1709 + tmp_b_i = (buf[i+7].imag + buf[i+7].real) * w[2][3].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1710 + buf[i+3].real = tmp_a_r + tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1711 + buf[i+3].imag = tmp_a_i + tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1712 + buf[i+7].real = tmp_a_r - tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1713 + buf[i+7].imag = tmp_a_i - tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1714 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1715 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1716 + /* 4-7. iterations */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1717 + for (m=3; m < 7; m++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1718 + two_m = (1 << m);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1719 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1720 + two_m_plus_one = two_m<<1;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1721 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1722 + for(i = 0; i < 128; i += two_m_plus_one) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1723 + for(k = 0; k < two_m; k++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1724 + int p = k + i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1725 + int q = p + two_m;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1726 + tmp_a_r = buf[p].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1727 + tmp_a_i = buf[p].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1728 + tmp_b_r = buf[q].real * w[m][k].real - buf[q].imag * w[m][k].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1729 + tmp_b_i = buf[q].imag * w[m][k].real + buf[q].real * w[m][k].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1730 + buf[p].real = tmp_a_r + tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1731 + buf[p].imag = tmp_a_i + tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1732 + buf[q].real = tmp_a_r - tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1733 + buf[q].imag = tmp_a_i - tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1734 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1735 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1736 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1737 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1738 /* Post IFFT complex multiply plus IFFT complex conjugate*/
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1739 for( i=0; i < 128; i++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1740 /* y[n] = z[n] * (xcos1[n] + j * xsin1[n]) ; */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1741 @@ -219,12 +369,12 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1742 *data_ptr++ = -buf[64+i].imag * *window_ptr++ + *delay_ptr++ + bias;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1743 *data_ptr++ = buf[64-i-1].real * *window_ptr++ + *delay_ptr++ + bias;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1744 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1745 -
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1746 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1747 for(i=0; i< 64; i++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1748 *data_ptr++ = -buf[i].real * *window_ptr++ + *delay_ptr++ + bias;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1749 *data_ptr++ = buf[128-i-1].imag * *window_ptr++ + *delay_ptr++ + bias;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1750 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1751 -
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1752 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1753 /* The trailing edge of the window goes into the delay line */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1754 delay_ptr = delay;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1755
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1756 @@ -232,13 +382,717 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1757 *delay_ptr++ = -buf[64+i].real * *--window_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1758 *delay_ptr++ = buf[64-i-1].imag * *--window_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1759 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1760 -
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1761 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1762 for(i=0; i<64; i++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1763 *delay_ptr++ = buf[i].imag * *--window_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1764 *delay_ptr++ = -buf[128-i-1].real * *--window_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1765 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1766 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1767
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1768 +#ifdef HAVE_ALTIVEC
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1769 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1770 +#ifndef SYS_DARWIN
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1771 +#include <altivec.h>
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1772 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1773 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1774 +// used to build registers permutation vectors (vcprm)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1775 +// the 's' are for words in the _s_econd vector
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1776 +#define WORD_0 0x00,0x01,0x02,0x03
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1777 +#define WORD_1 0x04,0x05,0x06,0x07
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1778 +#define WORD_2 0x08,0x09,0x0a,0x0b
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1779 +#define WORD_3 0x0c,0x0d,0x0e,0x0f
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1780 +#define WORD_s0 0x10,0x11,0x12,0x13
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1781 +#define WORD_s1 0x14,0x15,0x16,0x17
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1782 +#define WORD_s2 0x18,0x19,0x1a,0x1b
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1783 +#define WORD_s3 0x1c,0x1d,0x1e,0x1f
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1784 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1785 +#ifdef SYS_DARWIN
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1786 +#define vcprm(a,b,c,d) (const vector unsigned char)(WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1787 +#else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1788 +#define vcprm(a,b,c,d) (const vector unsigned char){WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1789 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1790 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1791 +// vcprmle is used to keep the same index as in the SSE version.
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1792 +// it's the same as vcprm, with the index inversed
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1793 +// ('le' is Little Endian)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1794 +#define vcprmle(a,b,c,d) vcprm(d,c,b,a)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1795 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1796 +// used to build inverse/identity vectors (vcii)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1797 +// n is _n_egative, p is _p_ositive
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1798 +#define FLOAT_n -1.
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1799 +#define FLOAT_p 1.
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1800 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1801 +#ifdef SYS_DARWIN
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1802 +#define vcii(a,b,c,d) (const vector float)(FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1803 +#else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1804 +#define vcii(a,b,c,d) (const vector float){FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1805 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1806 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1807 +#ifdef SYS_DARWIN
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1808 +#define FOUROF(a) (a)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1809 +#else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1810 +#define FOUROF(a) {a,a,a,a}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1811 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1812 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1813 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1814 +void
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1815 +imdct_do_512_altivec(sample_t data[],sample_t delay[], sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1816 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1817 + int i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1818 + int k;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1819 + int p,q;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1820 + int m;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1821 + int two_m;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1822 + int two_m_plus_one;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1823 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1824 + sample_t tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1825 + sample_t tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1826 + sample_t tmp_a_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1827 + sample_t tmp_a_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1828 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1829 + sample_t *data_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1830 + sample_t *delay_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1831 + sample_t *window_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1832 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1833 + /* 512 IMDCT with source and dest data in 'data' */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1834 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1835 + /* Pre IFFT complex multiply plus IFFT cmplx conjugate & reordering*/
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1836 + for( i=0; i < 128; i++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1837 + /* z[i] = (X[256-2*i-1] + j * X[2*i]) * (xcos1[i] + j * xsin1[i]) ; */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1838 + int j= bit_reverse_512[i];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1839 + buf[i].real = (data[256-2*j-1] * xcos1[j]) - (data[2*j] * xsin1[j]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1840 + buf[i].imag = -1.0 * ((data[2*j] * xcos1[j]) + (data[256-2*j-1] * xsin1[j]));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1841 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1842 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1843 + /* 1. iteration */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1844 + for(i = 0; i < 128; i += 2) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1845 +#if 0
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1846 + tmp_a_r = buf[i].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1847 + tmp_a_i = buf[i].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1848 + tmp_b_r = buf[i+1].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1849 + tmp_b_i = buf[i+1].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1850 + buf[i].real = tmp_a_r + tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1851 + buf[i].imag = tmp_a_i + tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1852 + buf[i+1].real = tmp_a_r - tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1853 + buf[i+1].imag = tmp_a_i - tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1854 +#else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1855 + vector float temp, bufv;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1856 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1857 + bufv = vec_ld(i << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1858 + temp = vec_perm(bufv, bufv, vcprm(2,3,0,1));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1859 + bufv = vec_madd(bufv, vcii(p,p,n,n), temp);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1860 + vec_st(bufv, i << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1861 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1862 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1863 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1864 + /* 2. iteration */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1865 + // Note w[1]={{1,0}, {0,-1}}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1866 + for(i = 0; i < 128; i += 4) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1867 +#if 0
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1868 + tmp_a_r = buf[i].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1869 + tmp_a_i = buf[i].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1870 + tmp_b_r = buf[i+2].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1871 + tmp_b_i = buf[i+2].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1872 + buf[i].real = tmp_a_r + tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1873 + buf[i].imag = tmp_a_i + tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1874 + buf[i+2].real = tmp_a_r - tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1875 + buf[i+2].imag = tmp_a_i - tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1876 + tmp_a_r = buf[i+1].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1877 + tmp_a_i = buf[i+1].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1878 + /* WARNING: im <-> re here ! */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1879 + tmp_b_r = buf[i+3].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1880 + tmp_b_i = buf[i+3].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1881 + buf[i+1].real = tmp_a_r + tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1882 + buf[i+1].imag = tmp_a_i - tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1883 + buf[i+3].real = tmp_a_r - tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1884 + buf[i+3].imag = tmp_a_i + tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1885 +#else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1886 + vector float buf01, buf23, temp1, temp2;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1887 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1888 + buf01 = vec_ld((i + 0) << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1889 + buf23 = vec_ld((i + 2) << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1890 + buf23 = vec_perm(buf23,buf23,vcprm(0,1,3,2));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1891 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1892 + temp1 = vec_madd(buf23, vcii(p,p,p,n), buf01);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1893 + temp2 = vec_madd(buf23, vcii(n,n,n,p), buf01);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1894 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1895 + vec_st(temp1, (i + 0) << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1896 + vec_st(temp2, (i + 2) << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1897 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1898 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1899 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1900 + /* 3. iteration */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1901 + for(i = 0; i < 128; i += 8) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1902 +#if 0
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1903 + tmp_a_r = buf[i].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1904 + tmp_a_i = buf[i].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1905 + tmp_b_r = buf[i+4].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1906 + tmp_b_i = buf[i+4].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1907 + buf[i].real = tmp_a_r + tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1908 + buf[i].imag = tmp_a_i + tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1909 + buf[i+4].real = tmp_a_r - tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1910 + buf[i+4].imag = tmp_a_i - tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1911 + tmp_a_r = buf[1+i].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1912 + tmp_a_i = buf[1+i].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1913 + tmp_b_r = (buf[i+5].real + buf[i+5].imag) * w[2][1].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1914 + tmp_b_i = (buf[i+5].imag - buf[i+5].real) * w[2][1].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1915 + buf[1+i].real = tmp_a_r + tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1916 + buf[1+i].imag = tmp_a_i + tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1917 + buf[i+5].real = tmp_a_r - tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1918 + buf[i+5].imag = tmp_a_i - tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1919 + tmp_a_r = buf[i+2].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1920 + tmp_a_i = buf[i+2].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1921 + /* WARNING re <-> im & sign */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1922 + tmp_b_r = buf[i+6].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1923 + tmp_b_i = - buf[i+6].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1924 + buf[i+2].real = tmp_a_r + tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1925 + buf[i+2].imag = tmp_a_i + tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1926 + buf[i+6].real = tmp_a_r - tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1927 + buf[i+6].imag = tmp_a_i - tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1928 + tmp_a_r = buf[i+3].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1929 + tmp_a_i = buf[i+3].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1930 + tmp_b_r = (buf[i+7].real - buf[i+7].imag) * w[2][3].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1931 + tmp_b_i = (buf[i+7].imag + buf[i+7].real) * w[2][3].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1932 + buf[i+3].real = tmp_a_r + tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1933 + buf[i+3].imag = tmp_a_i + tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1934 + buf[i+7].real = tmp_a_r - tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1935 + buf[i+7].imag = tmp_a_i - tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1936 +#else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1937 + vector float buf01, buf23, buf45, buf67;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1938 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1939 + buf01 = vec_ld((i + 0) << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1940 + buf23 = vec_ld((i + 2) << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1941 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1942 + tmp_b_r = (buf[i+5].real + buf[i+5].imag) * w[2][1].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1943 + tmp_b_i = (buf[i+5].imag - buf[i+5].real) * w[2][1].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1944 + buf[i+5].real = tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1945 + buf[i+5].imag = tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1946 + tmp_b_r = (buf[i+7].real - buf[i+7].imag) * w[2][3].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1947 + tmp_b_i = (buf[i+7].imag + buf[i+7].real) * w[2][3].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1948 + buf[i+7].real = tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1949 + buf[i+7].imag = tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1950 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1951 + buf23 = vec_ld((i + 2) << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1952 + buf45 = vec_ld((i + 4) << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1953 + buf67 = vec_ld((i + 6) << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1954 + buf67 = vec_perm(buf67, buf67, vcprm(1,0,2,3));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1955 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1956 + vec_st(vec_add(buf01, buf45), (i + 0) << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1957 + vec_st(vec_madd(buf67, vcii(p,n,p,p), buf23), (i + 2) << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1958 + vec_st(vec_sub(buf01, buf45), (i + 4) << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1959 + vec_st(vec_nmsub(buf67, vcii(p,n,p,p), buf23), (i + 6) << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1960 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1961 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1962 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1963 + /* 4-7. iterations */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1964 + for (m=3; m < 7; m++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1965 + two_m = (1 << m);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1966 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1967 + two_m_plus_one = two_m<<1;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1968 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1969 + for(i = 0; i < 128; i += two_m_plus_one) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1970 + for(k = 0; k < two_m; k+=2) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1971 +#if 0
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1972 + int p = k + i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1973 + int q = p + two_m;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1974 + tmp_a_r = buf[p].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1975 + tmp_a_i = buf[p].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1976 + tmp_b_r =
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1977 + buf[q].real * w[m][k].real -
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1978 + buf[q].imag * w[m][k].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1979 + tmp_b_i =
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1980 + buf[q].imag * w[m][k].real +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1981 + buf[q].real * w[m][k].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1982 + buf[p].real = tmp_a_r + tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1983 + buf[p].imag = tmp_a_i + tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1984 + buf[q].real = tmp_a_r - tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1985 + buf[q].imag = tmp_a_i - tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1986 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1987 + tmp_a_r = buf[(p + 1)].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1988 + tmp_a_i = buf[(p + 1)].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1989 + tmp_b_r =
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1990 + buf[(q + 1)].real * w[m][(k + 1)].real -
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1991 + buf[(q + 1)].imag * w[m][(k + 1)].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1992 + tmp_b_i =
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1993 + buf[(q + 1)].imag * w[m][(k + 1)].real +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1994 + buf[(q + 1)].real * w[m][(k + 1)].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1995 + buf[(p + 1)].real = tmp_a_r + tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1996 + buf[(p + 1)].imag = tmp_a_i + tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1997 + buf[(q + 1)].real = tmp_a_r - tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1998 + buf[(q + 1)].imag = tmp_a_i - tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
1999 +#else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2000 + int p = k + i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2001 + int q = p + two_m;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2002 + vector float vecp, vecq, vecw, temp1, temp2, temp3, temp4;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2003 + const vector float vczero = (const vector float)FOUROF(0.);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2004 + // first compute buf[q] and buf[q+1]
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2005 + vecq = vec_ld(q << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2006 + vecw = vec_ld(0, (float*)&(w[m][k]));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2007 + temp1 = vec_madd(vecq, vecw, vczero);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2008 + temp2 = vec_perm(vecq, vecq, vcprm(1,0,3,2));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2009 + temp2 = vec_madd(temp2, vecw, vczero);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2010 + temp3 = vec_perm(temp1, temp2, vcprm(0,s0,2,s2));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2011 + temp4 = vec_perm(temp1, temp2, vcprm(1,s1,3,s3));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2012 + vecq = vec_madd(temp4, vcii(n,p,n,p), temp3);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2013 + // then butterfly with buf[p] and buf[p+1]
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2014 + vecp = vec_ld(p << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2015 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2016 + temp1 = vec_add(vecp, vecq);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2017 + temp2 = vec_sub(vecp, vecq);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2018 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2019 + vec_st(temp1, p << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2020 + vec_st(temp2, q << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2021 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2022 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2023 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2024 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2025 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2026 + /* Post IFFT complex multiply plus IFFT complex conjugate*/
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2027 + for( i=0; i < 128; i+=4) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2028 + /* y[n] = z[n] * (xcos1[n] + j * xsin1[n]) ; */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2029 +#if 0
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2030 + tmp_a_r = buf[(i + 0)].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2031 + tmp_a_i = -1.0 * buf[(i + 0)].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2032 + buf[(i + 0)].real =
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2033 + (tmp_a_r * xcos1[(i + 0)]) - (tmp_a_i * xsin1[(i + 0)]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2034 + buf[(i + 0)].imag =
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2035 + (tmp_a_r * xsin1[(i + 0)]) + (tmp_a_i * xcos1[(i + 0)]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2036 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2037 + tmp_a_r = buf[(i + 1)].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2038 + tmp_a_i = -1.0 * buf[(i + 1)].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2039 + buf[(i + 1)].real =
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2040 + (tmp_a_r * xcos1[(i + 1)]) - (tmp_a_i * xsin1[(i + 1)]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2041 + buf[(i + 1)].imag =
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2042 + (tmp_a_r * xsin1[(i + 1)]) + (tmp_a_i * xcos1[(i + 1)]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2043 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2044 + tmp_a_r = buf[(i + 2)].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2045 + tmp_a_i = -1.0 * buf[(i + 2)].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2046 + buf[(i + 2)].real =
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2047 + (tmp_a_r * xcos1[(i + 2)]) - (tmp_a_i * xsin1[(i + 2)]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2048 + buf[(i + 2)].imag =
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2049 + (tmp_a_r * xsin1[(i + 2)]) + (tmp_a_i * xcos1[(i + 2)]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2050 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2051 + tmp_a_r = buf[(i + 3)].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2052 + tmp_a_i = -1.0 * buf[(i + 3)].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2053 + buf[(i + 3)].real =
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2054 + (tmp_a_r * xcos1[(i + 3)]) - (tmp_a_i * xsin1[(i + 3)]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2055 + buf[(i + 3)].imag =
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2056 + (tmp_a_r * xsin1[(i + 3)]) + (tmp_a_i * xcos1[(i + 3)]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2057 +#else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2058 + vector float bufv_0, bufv_2, cosv, sinv, temp1, temp2;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2059 + vector float temp0022, temp1133, tempCS01;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2060 + const vector float vczero = (const vector float)FOUROF(0.);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2061 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2062 + bufv_0 = vec_ld((i + 0) << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2063 + bufv_2 = vec_ld((i + 2) << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2064 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2065 + cosv = vec_ld(i << 2, xcos1);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2066 + sinv = vec_ld(i << 2, xsin1);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2067 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2068 + temp0022 = vec_perm(bufv_0, bufv_0, vcprm(0,0,2,2));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2069 + temp1133 = vec_perm(bufv_0, bufv_0, vcprm(1,1,3,3));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2070 + tempCS01 = vec_perm(cosv, sinv, vcprm(0,s0,1,s1));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2071 + temp1 = vec_madd(temp0022, tempCS01, vczero);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2072 + tempCS01 = vec_perm(cosv, sinv, vcprm(s0,0,s1,1));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2073 + temp2 = vec_madd(temp1133, tempCS01, vczero);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2074 + bufv_0 = vec_madd(temp2, vcii(p,n,p,n), temp1);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2075 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2076 + vec_st(bufv_0, (i + 0) << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2077 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2078 + /* idem with bufv_2 and high-order cosv/sinv */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2079 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2080 + temp0022 = vec_perm(bufv_2, bufv_2, vcprm(0,0,2,2));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2081 + temp1133 = vec_perm(bufv_2, bufv_2, vcprm(1,1,3,3));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2082 + tempCS01 = vec_perm(cosv, sinv, vcprm(2,s2,3,s3));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2083 + temp1 = vec_madd(temp0022, tempCS01, vczero);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2084 + tempCS01 = vec_perm(cosv, sinv, vcprm(s2,2,s3,3));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2085 + temp2 = vec_madd(temp1133, tempCS01, vczero);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2086 + bufv_2 = vec_madd(temp2, vcii(p,n,p,n), temp1);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2087 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2088 + vec_st(bufv_2, (i + 2) << 3, (float*)buf);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2089 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2090 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2091 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2092 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2093 + data_ptr = data;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2094 + delay_ptr = delay;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2095 + window_ptr = imdct_window;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2096 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2097 + /* Window and convert to real valued signal */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2098 + for(i=0; i< 64; i++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2099 + *data_ptr++ = -buf[64+i].imag * *window_ptr++ + *delay_ptr++ + bias;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2100 + *data_ptr++ = buf[64-i-1].real * *window_ptr++ + *delay_ptr++ + bias;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2101 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2102 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2103 + for(i=0; i< 64; i++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2104 + *data_ptr++ = -buf[i].real * *window_ptr++ + *delay_ptr++ + bias;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2105 + *data_ptr++ = buf[128-i-1].imag * *window_ptr++ + *delay_ptr++ + bias;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2106 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2107 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2108 + /* The trailing edge of the window goes into the delay line */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2109 + delay_ptr = delay;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2110 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2111 + for(i=0; i< 64; i++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2112 + *delay_ptr++ = -buf[64+i].real * *--window_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2113 + *delay_ptr++ = buf[64-i-1].imag * *--window_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2114 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2115 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2116 + for(i=0; i<64; i++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2117 + *delay_ptr++ = buf[i].imag * *--window_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2118 + *delay_ptr++ = -buf[128-i-1].real * *--window_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2119 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2120 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2121 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2122 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2123 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2124 +// Stuff below this line is borrowed from libac3
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2125 +#include "srfftp.h"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2126 +#ifdef ARCH_X86
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2127 +#ifndef HAVE_3DNOW
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2128 +#define HAVE_3DNOW 1
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2129 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2130 +#include "srfftp_3dnow.h"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2131 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2132 +const i_cmplx_t x_plus_minus_3dnow __attribute__ ((aligned (8))) = {{ 0x00000000UL, 0x80000000UL }};
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2133 +const i_cmplx_t x_minus_plus_3dnow __attribute__ ((aligned (8))) = {{ 0x80000000UL, 0x00000000UL }};
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2134 +const complex_t HSQRT2_3DNOW __attribute__ ((aligned (8))) = { 0.707106781188, 0.707106781188 };
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2135 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2136 +#undef HAVE_3DNOWEX
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2137 +#include "imdct_3dnow.h"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2138 +#define HAVE_3DNOWEX
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2139 +#include "imdct_3dnow.h"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2140 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2141 +void
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2142 +imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2143 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2144 +/* int i,k;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2145 + int p,q;*/
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2146 + int m;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2147 + int two_m;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2148 + int two_m_plus_one;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2149 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2150 +/* sample_t tmp_a_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2151 + sample_t tmp_a_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2152 + sample_t tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2153 + sample_t tmp_b_r;*/
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2154 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2155 + sample_t *data_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2156 + sample_t *delay_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2157 + sample_t *window_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2158 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2159 + /* 512 IMDCT with source and dest data in 'data' */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2160 + /* see the c version (dct_do_512()), its allmost identical, just in C */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2161 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2162 + /* Pre IFFT complex multiply plus IFFT cmplx conjugate */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2163 + /* Bit reversed shuffling */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2164 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2165 + "xorl %%esi, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2166 + "leal "MANGLE(bit_reverse_512)", %%eax \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2167 + "movl $1008, %%edi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2168 + "pushl %%ebp \n\t" //use ebp without telling gcc
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2169 + ".balign 16 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2170 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2171 + "movlps (%0, %%esi), %%xmm0 \n\t" // XXXI
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2172 + "movhps 8(%0, %%edi), %%xmm0 \n\t" // RXXI
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2173 + "movlps 8(%0, %%esi), %%xmm1 \n\t" // XXXi
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2174 + "movhps (%0, %%edi), %%xmm1 \n\t" // rXXi
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2175 + "shufps $0x33, %%xmm1, %%xmm0 \n\t" // irIR
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2176 + "movaps "MANGLE(sseSinCos1c)"(%%esi), %%xmm2\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2177 + "mulps %%xmm0, %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2178 + "shufps $0xB1, %%xmm0, %%xmm0 \n\t" // riRI
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2179 + "mulps "MANGLE(sseSinCos1d)"(%%esi), %%xmm0\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2180 + "subps %%xmm0, %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2181 + "movzbl (%%eax), %%edx \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2182 + "movzbl 1(%%eax), %%ebp \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2183 + "movlps %%xmm2, (%1, %%edx,8) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2184 + "movhps %%xmm2, (%1, %%ebp,8) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2185 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2186 + "addl $2, %%eax \n\t" // avoid complex addressing for P4 crap
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2187 + "subl $16, %%edi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2188 + " jnc 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2189 + "popl %%ebp \n\t"//no we didnt touch ebp *g*
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2190 + :: "b" (data), "c" (buf)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2191 + : "%esi", "%edi", "%eax", "%edx"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2192 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2193 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2194 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2195 + /* FFT Merge */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2196 +/* unoptimized variant
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2197 + for (m=1; m < 7; m++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2198 + if(m)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2199 + two_m = (1 << m);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2200 + else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2201 + two_m = 1;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2202 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2203 + two_m_plus_one = (1 << (m+1));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2204 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2205 + for(i = 0; i < 128; i += two_m_plus_one) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2206 + for(k = 0; k < two_m; k++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2207 + p = k + i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2208 + q = p + two_m;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2209 + tmp_a_r = buf[p].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2210 + tmp_a_i = buf[p].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2211 + tmp_b_r = buf[q].real * w[m][k].real - buf[q].imag * w[m][k].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2212 + tmp_b_i = buf[q].imag * w[m][k].real + buf[q].real * w[m][k].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2213 + buf[p].real = tmp_a_r + tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2214 + buf[p].imag = tmp_a_i + tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2215 + buf[q].real = tmp_a_r - tmp_b_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2216 + buf[q].imag = tmp_a_i - tmp_b_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2217 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2218 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2219 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2220 +*/
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2221 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2222 + /* 1. iteration */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2223 + // Note w[0][0]={1,0}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2224 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2225 + "xorps %%xmm1, %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2226 + "xorps %%xmm2, %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2227 + "movl %0, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2228 + ".balign 16 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2229 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2230 + "movlps (%%esi), %%xmm0 \n\t" //buf[p]
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2231 + "movlps 8(%%esi), %%xmm1\n\t" //buf[q]
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2232 + "movhps (%%esi), %%xmm0 \n\t" //buf[p]
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2233 + "movhps 8(%%esi), %%xmm2\n\t" //buf[q]
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2234 + "addps %%xmm1, %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2235 + "subps %%xmm2, %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2236 + "movaps %%xmm0, (%%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2237 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2238 + "cmpl %1, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2239 + " jb 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2240 + :: "g" (buf), "r" (buf + 128)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2241 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2242 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2243 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2244 + /* 2. iteration */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2245 + // Note w[1]={{1,0}, {0,-1}}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2246 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2247 + "movaps "MANGLE(ps111_1)", %%xmm7\n\t" // 1,1,1,-1
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2248 + "movl %0, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2249 + ".balign 16 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2250 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2251 + "movaps 16(%%esi), %%xmm2 \n\t" //r2,i2,r3,i3
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2252 + "shufps $0xB4, %%xmm2, %%xmm2 \n\t" //r2,i2,i3,r3
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2253 + "mulps %%xmm7, %%xmm2 \n\t" //r2,i2,i3,-r3
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2254 + "movaps (%%esi), %%xmm0 \n\t" //r0,i0,r1,i1
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2255 + "movaps (%%esi), %%xmm1 \n\t" //r0,i0,r1,i1
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2256 + "addps %%xmm2, %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2257 + "subps %%xmm2, %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2258 + "movaps %%xmm0, (%%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2259 + "movaps %%xmm1, 16(%%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2260 + "addl $32, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2261 + "cmpl %1, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2262 + " jb 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2263 + :: "g" (buf), "r" (buf + 128)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2264 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2265 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2266 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2267 + /* 3. iteration */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2268 +/*
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2269 + Note sseW2+0={1,1,sqrt(2),sqrt(2))
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2270 + Note sseW2+16={0,0,sqrt(2),-sqrt(2))
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2271 + Note sseW2+32={0,0,-sqrt(2),-sqrt(2))
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2272 + Note sseW2+48={1,-1,sqrt(2),-sqrt(2))
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2273 +*/
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2274 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2275 + "movaps 48+"MANGLE(sseW2)", %%xmm6\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2276 + "movaps 16+"MANGLE(sseW2)", %%xmm7\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2277 + "xorps %%xmm5, %%xmm5 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2278 + "xorps %%xmm2, %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2279 + "movl %0, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2280 + ".balign 16 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2281 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2282 + "movaps 32(%%esi), %%xmm2 \n\t" //r4,i4,r5,i5
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2283 + "movaps 48(%%esi), %%xmm3 \n\t" //r6,i6,r7,i7
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2284 + "movaps "MANGLE(sseW2)", %%xmm4 \n\t" //r4,i4,r5,i5
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2285 + "movaps 32+"MANGLE(sseW2)", %%xmm5\n\t" //r6,i6,r7,i7
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2286 + "mulps %%xmm2, %%xmm4 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2287 + "mulps %%xmm3, %%xmm5 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2288 + "shufps $0xB1, %%xmm2, %%xmm2 \n\t" //i4,r4,i5,r5
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2289 + "shufps $0xB1, %%xmm3, %%xmm3 \n\t" //i6,r6,i7,r7
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2290 + "mulps %%xmm6, %%xmm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2291 + "mulps %%xmm7, %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2292 + "movaps (%%esi), %%xmm0 \n\t" //r0,i0,r1,i1
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2293 + "movaps 16(%%esi), %%xmm1 \n\t" //r2,i2,r3,i3
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2294 + "addps %%xmm4, %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2295 + "addps %%xmm5, %%xmm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2296 + "movaps %%xmm2, %%xmm4 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2297 + "movaps %%xmm3, %%xmm5 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2298 + "addps %%xmm0, %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2299 + "addps %%xmm1, %%xmm3 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2300 + "subps %%xmm4, %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2301 + "subps %%xmm5, %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2302 + "movaps %%xmm2, (%%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2303 + "movaps %%xmm3, 16(%%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2304 + "movaps %%xmm0, 32(%%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2305 + "movaps %%xmm1, 48(%%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2306 + "addl $64, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2307 + "cmpl %1, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2308 + " jb 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2309 + :: "g" (buf), "r" (buf + 128)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2310 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2311 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2312 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2313 + /* 4-7. iterations */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2314 + for (m=3; m < 7; m++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2315 + two_m = (1 << m);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2316 + two_m_plus_one = two_m<<1;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2317 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2318 + "movl %0, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2319 + ".balign 16 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2320 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2321 + "xorl %%edi, %%edi \n\t" // k
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2322 + "leal (%%esi, %3), %%edx \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2323 + "2: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2324 + "movaps (%%edx, %%edi), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2325 + "movaps (%4, %%edi, 2), %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2326 + "mulps %%xmm1, %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2327 + "shufps $0xB1, %%xmm1, %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2328 + "mulps 16(%4, %%edi, 2), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2329 + "movaps (%%esi, %%edi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2330 + "addps %%xmm2, %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2331 + "movaps %%xmm1, %%xmm2 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2332 + "addps %%xmm0, %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2333 + "subps %%xmm2, %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2334 + "movaps %%xmm1, (%%esi, %%edi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2335 + "movaps %%xmm0, (%%edx, %%edi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2336 + "addl $16, %%edi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2337 + "cmpl %3, %%edi \n\t" //FIXME (opt) count against 0
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2338 + " jb 2b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2339 + "addl %2, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2340 + "cmpl %1, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2341 + " jb 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2342 + :: "g" (buf), "m" (buf+128), "m" (two_m_plus_one<<3), "r" (two_m<<3),
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2343 + "r" (sseW[m])
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2344 + : "%esi", "%edi", "%edx"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2345 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2346 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2347 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2348 + /* Post IFFT complex multiply plus IFFT complex conjugate*/
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2349 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2350 + "movl $-1024, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2351 + ".balign 16 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2352 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2353 + "movaps (%0, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2354 + "movaps (%0, %%esi), %%xmm1 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2355 + "shufps $0xB1, %%xmm0, %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2356 + "mulps 1024+"MANGLE(sseSinCos1c)"(%%esi), %%xmm1\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2357 + "mulps 1024+"MANGLE(sseSinCos1d)"(%%esi), %%xmm0\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2358 + "addps %%xmm1, %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2359 + "movaps %%xmm0, (%0, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2360 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2361 + " jnz 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2362 + :: "r" (buf+128)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2363 + : "%esi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2364 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2365 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2366 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2367 + data_ptr = data;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2368 + delay_ptr = delay;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2369 + window_ptr = imdct_window;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2370 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2371 + /* Window and convert to real valued signal */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2372 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2373 + "xorl %%edi, %%edi \n\t" // 0
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2374 + "xorl %%esi, %%esi \n\t" // 0
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2375 + "movss %3, %%xmm2 \n\t" // bias
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2376 + "shufps $0x00, %%xmm2, %%xmm2 \n\t" // bias, bias, ...
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2377 + ".balign 16 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2378 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2379 + "movlps (%0, %%esi), %%xmm0 \n\t" // ? ? A ?
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2380 + "movlps 8(%0, %%esi), %%xmm1 \n\t" // ? ? C ?
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2381 + "movhps -16(%0, %%edi), %%xmm1 \n\t" // ? D C ?
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2382 + "movhps -8(%0, %%edi), %%xmm0 \n\t" // ? B A ?
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2383 + "shufps $0x99, %%xmm1, %%xmm0 \n\t" // D C B A
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2384 + "mulps "MANGLE(sseWindow)"(%%esi), %%xmm0\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2385 + "addps (%2, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2386 + "addps %%xmm2, %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2387 + "movaps %%xmm0, (%1, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2388 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2389 + "subl $16, %%edi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2390 + "cmpl $512, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2391 + " jb 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2392 + :: "r" (buf+64), "r" (data_ptr), "r" (delay_ptr), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2393 + : "%esi", "%edi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2394 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2395 + data_ptr+=128;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2396 + delay_ptr+=128;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2397 +// window_ptr+=128;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2398 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2399 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2400 + "movl $1024, %%edi \n\t" // 512
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2401 + "xorl %%esi, %%esi \n\t" // 0
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2402 + "movss %3, %%xmm2 \n\t" // bias
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2403 + "shufps $0x00, %%xmm2, %%xmm2 \n\t" // bias, bias, ...
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2404 + ".balign 16 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2405 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2406 + "movlps (%0, %%esi), %%xmm0 \n\t" // ? ? ? A
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2407 + "movlps 8(%0, %%esi), %%xmm1 \n\t" // ? ? ? C
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2408 + "movhps -16(%0, %%edi), %%xmm1 \n\t" // D ? ? C
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2409 + "movhps -8(%0, %%edi), %%xmm0 \n\t" // B ? ? A
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2410 + "shufps $0xCC, %%xmm1, %%xmm0 \n\t" // D C B A
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2411 + "mulps 512+"MANGLE(sseWindow)"(%%esi), %%xmm0\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2412 + "addps (%2, %%esi), %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2413 + "addps %%xmm2, %%xmm0 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2414 + "movaps %%xmm0, (%1, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2415 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2416 + "subl $16, %%edi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2417 + "cmpl $512, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2418 + " jb 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2419 + :: "r" (buf), "r" (data_ptr), "r" (delay_ptr), "m" (bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2420 + : "%esi", "%edi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2421 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2422 + data_ptr+=128;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2423 +// window_ptr+=128;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2424 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2425 + /* The trailing edge of the window goes into the delay line */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2426 + delay_ptr = delay;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2427 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2428 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2429 + "xorl %%edi, %%edi \n\t" // 0
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2430 + "xorl %%esi, %%esi \n\t" // 0
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2431 + ".balign 16 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2432 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2433 + "movlps (%0, %%esi), %%xmm0 \n\t" // ? ? ? A
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2434 + "movlps 8(%0, %%esi), %%xmm1 \n\t" // ? ? ? C
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2435 + "movhps -16(%0, %%edi), %%xmm1 \n\t" // D ? ? C
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2436 + "movhps -8(%0, %%edi), %%xmm0 \n\t" // B ? ? A
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2437 + "shufps $0xCC, %%xmm1, %%xmm0 \n\t" // D C B A
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2438 + "mulps 1024+"MANGLE(sseWindow)"(%%esi), %%xmm0\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2439 + "movaps %%xmm0, (%1, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2440 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2441 + "subl $16, %%edi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2442 + "cmpl $512, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2443 + " jb 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2444 + :: "r" (buf+64), "r" (delay_ptr)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2445 + : "%esi", "%edi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2446 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2447 + delay_ptr+=128;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2448 +// window_ptr-=128;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2449 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2450 + asm volatile(
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2451 + "movl $1024, %%edi \n\t" // 1024
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2452 + "xorl %%esi, %%esi \n\t" // 0
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2453 + ".balign 16 \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2454 + "1: \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2455 + "movlps (%0, %%esi), %%xmm0 \n\t" // ? ? A ?
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2456 + "movlps 8(%0, %%esi), %%xmm1 \n\t" // ? ? C ?
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2457 + "movhps -16(%0, %%edi), %%xmm1 \n\t" // ? D C ?
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2458 + "movhps -8(%0, %%edi), %%xmm0 \n\t" // ? B A ?
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2459 + "shufps $0x99, %%xmm1, %%xmm0 \n\t" // D C B A
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2460 + "mulps 1536+"MANGLE(sseWindow)"(%%esi), %%xmm0\n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2461 + "movaps %%xmm0, (%1, %%esi) \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2462 + "addl $16, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2463 + "subl $16, %%edi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2464 + "cmpl $512, %%esi \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2465 + " jb 1b \n\t"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2466 + :: "r" (buf), "r" (delay_ptr)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2467 + : "%esi", "%edi"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2468 + );
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2469 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2470 +#endif //arch_x86
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2471 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2472 void
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2473 imdct_do_256(sample_t data[],sample_t delay[],sample_t bias)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2474 {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2475 @@ -379,13 +1233,19 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2476 {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2477 int i, j, k;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2478
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2479 - fprintf (stderr, "No accelerated IMDCT transform found\n");
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2480 -
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2481 /* Twiddle factors to turn IFFT into IMDCT */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2482 for (i = 0; i < 128; i++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2483 xcos1[i] = -cos ((M_PI / 2048) * (8 * i + 1));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2484 xsin1[i] = -sin ((M_PI / 2048) * (8 * i + 1));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2485 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2486 +#ifdef ARCH_X86
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2487 + for (i = 0; i < 128; i++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2488 + sseSinCos1c[2*i+0]= xcos1[i];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2489 + sseSinCos1c[2*i+1]= -xcos1[i];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2490 + sseSinCos1d[2*i+0]= xsin1[i];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2491 + sseSinCos1d[2*i+1]= xsin1[i];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2492 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2493 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2494
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2495 /* More twiddle factors to turn IFFT into IMDCT */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2496 for (i = 0; i < 64; i++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2497 @@ -400,7 +1260,334 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2498 w[i][k].imag = sin (-M_PI * k / j);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2499 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2500 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2501 +#ifdef ARCH_X86
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2502 + for (i = 1; i < 7; i++) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2503 + j = 1 << i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2504 + for (k = 0; k < j; k+=2) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2505 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2506 + sseW[i][4*k + 0] = w[i][k+0].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2507 + sseW[i][4*k + 1] = w[i][k+0].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2508 + sseW[i][4*k + 2] = w[i][k+1].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2509 + sseW[i][4*k + 3] = w[i][k+1].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2510 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2511 + sseW[i][4*k + 4] = -w[i][k+0].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2512 + sseW[i][4*k + 5] = w[i][k+0].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2513 + sseW[i][4*k + 6] = -w[i][k+1].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2514 + sseW[i][4*k + 7] = w[i][k+1].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2515 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2516 + //we multiply more or less uninitalized numbers so we need to use exactly 0.0
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2517 + if(k==0)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2518 + {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2519 +// sseW[i][4*k + 0]= sseW[i][4*k + 1]= 1.0;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2520 + sseW[i][4*k + 4]= sseW[i][4*k + 5]= 0.0;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2521 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2522 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2523 + if(2*k == j)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2524 + {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2525 + sseW[i][4*k + 0]= sseW[i][4*k + 1]= 0.0;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2526 +// sseW[i][4*k + 4]= -(sseW[i][4*k + 5]= -1.0);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2527 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2528 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2529 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2530 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2531 + for(i=0; i<128; i++)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2532 + {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2533 + sseWindow[2*i+0]= -imdct_window[2*i+0];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2534 + sseWindow[2*i+1]= imdct_window[2*i+1];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2535 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2536 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2537 + for(i=0; i<64; i++)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2538 + {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2539 + sseWindow[256 + 2*i+0]= -imdct_window[254 - 2*i+1];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2540 + sseWindow[256 + 2*i+1]= imdct_window[254 - 2*i+0];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2541 + sseWindow[384 + 2*i+0]= imdct_window[126 - 2*i+1];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2542 + sseWindow[384 + 2*i+1]= -imdct_window[126 - 2*i+0];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2543 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2544 +#endif // arch_x86
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2545 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2546 imdct_512 = imdct_do_512;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2547 +#ifdef ARCH_X86
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2548 + if(mm_accel & MM_ACCEL_X86_SSE)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2549 + {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2550 + fprintf (stderr, "Using SSE optimized IMDCT transform\n");
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2551 + imdct_512 = imdct_do_512_sse;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2552 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2553 + else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2554 + if(mm_accel & MM_ACCEL_X86_3DNOWEXT)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2555 + {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2556 + fprintf (stderr, "Using 3DNowEx optimized IMDCT transform\n");
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2557 + imdct_512 = imdct_do_512_3dnowex;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2558 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2559 + else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2560 + if(mm_accel & MM_ACCEL_X86_3DNOW)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2561 + {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2562 + fprintf (stderr, "Using 3DNow optimized IMDCT transform\n");
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2563 + imdct_512 = imdct_do_512_3dnow;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2564 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2565 + else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2566 +#endif // arch_x86
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2567 +#ifdef HAVE_ALTIVEC
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2568 + if (mm_accel & MM_ACCEL_PPC_ALTIVEC)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2569 + {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2570 + fprintf(stderr, "Using AltiVec optimized IMDCT transform\n");
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2571 + imdct_512 = imdct_do_512_altivec;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2572 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2573 + else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2574 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2575 + fprintf (stderr, "No accelerated IMDCT transform found\n");
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2576 imdct_256 = imdct_do_256;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2577 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2578 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2579 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2580 +static void fft_asmb(int k, complex_t *x, complex_t *wTB,
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2581 + const complex_t *d, const complex_t *d_3)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2582 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2583 + register complex_t *x2k, *x3k, *x4k, *wB;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2584 + register float a_r, a_i, a1_r, a1_i, u_r, u_i, v_r, v_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2585 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2586 + x2k = x + 2 * k;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2587 + x3k = x2k + 2 * k;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2588 + x4k = x3k + 2 * k;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2589 + wB = wTB + 2 * k;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2590 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2591 + TRANSZERO(x[0],x2k[0],x3k[0],x4k[0]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2592 + TRANS(x[1],x2k[1],x3k[1],x4k[1],wTB[1],wB[1],d[1],d_3[1]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2593 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2594 + --k;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2595 + for(;;) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2596 + TRANS(x[2],x2k[2],x3k[2],x4k[2],wTB[2],wB[2],d[2],d_3[2]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2597 + TRANS(x[3],x2k[3],x3k[3],x4k[3],wTB[3],wB[3],d[3],d_3[3]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2598 + if (!--k) break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2599 + x += 2;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2600 + x2k += 2;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2601 + x3k += 2;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2602 + x4k += 2;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2603 + d += 2;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2604 + d_3 += 2;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2605 + wTB += 2;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2606 + wB += 2;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2607 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2608 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2609 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2610 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2611 +static void fft_asmb16(complex_t *x, complex_t *wTB)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2612 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2613 + register float a_r, a_i, a1_r, a1_i, u_r, u_i, v_r, v_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2614 + int k = 2;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2615 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2616 + /* transform x[0], x[8], x[4], x[12] */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2617 + TRANSZERO(x[0],x[4],x[8],x[12]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2618 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2619 + /* transform x[1], x[9], x[5], x[13] */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2620 + TRANS(x[1],x[5],x[9],x[13],wTB[1],wTB[5],delta16[1],delta16_3[1]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2621 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2622 + /* transform x[2], x[10], x[6], x[14] */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2623 + TRANSHALF_16(x[2],x[6],x[10],x[14]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2624 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2625 + /* transform x[3], x[11], x[7], x[15] */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2626 + TRANS(x[3],x[7],x[11],x[15],wTB[3],wTB[7],delta16[3],delta16_3[3]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2627 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2628 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2629 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2630 +static void fft_4(complex_t *x)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2631 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2632 + /* delta_p = 1 here */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2633 + /* x[k] = sum_{i=0..3} x[i] * w^{i*k}, w=e^{-2*pi/4}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2634 + */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2635 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2636 + register float yt_r, yt_i, yb_r, yb_i, u_r, u_i, vi_r, vi_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2637 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2638 + yt_r = x[0].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2639 + yb_r = yt_r - x[2].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2640 + yt_r += x[2].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2641 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2642 + u_r = x[1].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2643 + vi_i = x[3].real - u_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2644 + u_r += x[3].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2645 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2646 + u_i = x[1].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2647 + vi_r = u_i - x[3].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2648 + u_i += x[3].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2649 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2650 + yt_i = yt_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2651 + yt_i += u_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2652 + x[0].real = yt_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2653 + yt_r -= u_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2654 + x[2].real = yt_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2655 + yt_i = yb_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2656 + yt_i += vi_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2657 + x[1].real = yt_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2658 + yb_r -= vi_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2659 + x[3].real = yb_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2660 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2661 + yt_i = x[0].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2662 + yb_i = yt_i - x[2].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2663 + yt_i += x[2].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2664 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2665 + yt_r = yt_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2666 + yt_r += u_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2667 + x[0].imag = yt_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2668 + yt_i -= u_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2669 + x[2].imag = yt_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2670 + yt_r = yb_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2671 + yt_r += vi_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2672 + x[1].imag = yt_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2673 + yb_i -= vi_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2674 + x[3].imag = yb_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2675 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2676 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2677 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2678 +static void fft_8(complex_t *x)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2679 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2680 + /* delta_p = diag{1, sqrt(i)} here */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2681 + /* x[k] = sum_{i=0..7} x[i] * w^{i*k}, w=e^{-2*pi/8}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2682 + */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2683 + register float wT1_r, wT1_i, wB1_r, wB1_i, wT2_r, wT2_i, wB2_r, wB2_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2684 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2685 + wT1_r = x[1].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2686 + wT1_i = x[1].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2687 + wB1_r = x[3].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2688 + wB1_i = x[3].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2689 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2690 + x[1] = x[2];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2691 + x[2] = x[4];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2692 + x[3] = x[6];
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2693 + fft_4(&x[0]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2694 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2695 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2696 + /* x[0] x[4] */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2697 + wT2_r = x[5].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2698 + wT2_r += x[7].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2699 + wT2_r += wT1_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2700 + wT2_r += wB1_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2701 + wT2_i = wT2_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2702 + wT2_r += x[0].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2703 + wT2_i = x[0].real - wT2_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2704 + x[0].real = wT2_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2705 + x[4].real = wT2_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2706 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2707 + wT2_i = x[5].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2708 + wT2_i += x[7].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2709 + wT2_i += wT1_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2710 + wT2_i += wB1_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2711 + wT2_r = wT2_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2712 + wT2_r += x[0].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2713 + wT2_i = x[0].imag - wT2_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2714 + x[0].imag = wT2_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2715 + x[4].imag = wT2_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2716 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2717 + /* x[2] x[6] */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2718 + wT2_r = x[5].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2719 + wT2_r -= x[7].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2720 + wT2_r += wT1_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2721 + wT2_r -= wB1_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2722 + wT2_i = wT2_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2723 + wT2_r += x[2].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2724 + wT2_i = x[2].real - wT2_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2725 + x[2].real = wT2_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2726 + x[6].real = wT2_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2727 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2728 + wT2_i = x[5].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2729 + wT2_i -= x[7].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2730 + wT2_i += wT1_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2731 + wT2_i -= wB1_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2732 + wT2_r = wT2_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2733 + wT2_r += x[2].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2734 + wT2_i = x[2].imag - wT2_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2735 + x[2].imag = wT2_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2736 + x[6].imag = wT2_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2737 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2738 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2739 + /* x[1] x[5] */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2740 + wT2_r = wT1_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2741 + wT2_r += wB1_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2742 + wT2_r -= x[5].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2743 + wT2_r -= x[7].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2744 + wT2_i = wT1_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2745 + wT2_i -= wB1_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2746 + wT2_i -= x[5].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2747 + wT2_i += x[7].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2748 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2749 + wB2_r = wT2_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2750 + wB2_r += wT2_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2751 + wT2_i -= wT2_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2752 + wB2_r *= HSQRT2;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2753 + wT2_i *= HSQRT2;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2754 + wT2_r = wB2_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2755 + wB2_r += x[1].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2756 + wT2_r = x[1].real - wT2_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2757 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2758 + wB2_i = x[5].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2759 + x[1].real = wB2_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2760 + x[5].real = wT2_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2761 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2762 + wT2_r = wT2_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2763 + wT2_r += x[1].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2764 + wT2_i = x[1].imag - wT2_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2765 + wB2_r = x[5].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2766 + x[1].imag = wT2_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2767 + x[5].imag = wT2_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2768 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2769 + /* x[3] x[7] */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2770 + wT1_r -= wB1_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2771 + wT1_i += wB1_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2772 + wB1_r = wB2_i - x[7].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2773 + wB1_i = wB2_r + x[7].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2774 + wT1_r -= wB1_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2775 + wT1_i -= wB1_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2776 + wB1_r = wT1_r + wT1_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2777 + wB1_r *= HSQRT2;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2778 + wT1_i -= wT1_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2779 + wT1_i *= HSQRT2;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2780 + wB2_r = x[3].real;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2781 + wB2_i = wB2_r + wT1_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2782 + wB2_r -= wT1_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2783 + x[3].real = wB2_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2784 + x[7].real = wB2_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2785 + wB2_i = x[3].imag;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2786 + wB2_r = wB2_i + wB1_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2787 + wB2_i -= wB1_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2788 + x[3].imag = wB2_i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2789 + x[7].imag = wB2_r;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2790 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2791 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2792 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2793 +static void fft_128p(complex_t *a)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2794 +{
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2795 + fft_8(&a[0]); fft_4(&a[8]); fft_4(&a[12]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2796 + fft_asmb16(&a[0], &a[8]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2797 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2798 + fft_8(&a[16]), fft_8(&a[24]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2799 + fft_asmb(4, &a[0], &a[16],&delta32[0], &delta32_3[0]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2800 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2801 + fft_8(&a[32]); fft_4(&a[40]); fft_4(&a[44]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2802 + fft_asmb16(&a[32], &a[40]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2803 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2804 + fft_8(&a[48]); fft_4(&a[56]); fft_4(&a[60]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2805 + fft_asmb16(&a[48], &a[56]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2806 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2807 + fft_asmb(8, &a[0], &a[32],&delta64[0], &delta64_3[0]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2808 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2809 + fft_8(&a[64]); fft_4(&a[72]); fft_4(&a[76]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2810 + /* fft_16(&a[64]); */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2811 + fft_asmb16(&a[64], &a[72]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2812 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2813 + fft_8(&a[80]); fft_8(&a[88]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2814 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2815 + /* fft_32(&a[64]); */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2816 + fft_asmb(4, &a[64], &a[80],&delta32[0], &delta32_3[0]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2817 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2818 + fft_8(&a[96]); fft_4(&a[104]), fft_4(&a[108]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2819 + /* fft_16(&a[96]); */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2820 + fft_asmb16(&a[96], &a[104]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2821 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2822 + fft_8(&a[112]), fft_8(&a[120]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2823 + /* fft_32(&a[96]); */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2824 + fft_asmb(4, &a[96], &a[112], &delta32[0], &delta32_3[0]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2825 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2826 + /* fft_128(&a[0]); */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2827 + fft_asmb(16, &a[0], &a[64], &delta128[0], &delta128_3[0]);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2828 +}
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2829 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2830 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2831 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2832 --- liba52/imdct_mlib.c 2005-03-22 19:59:35.000000000 +0100
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2833 +++ imdct_mlib.c 2004-03-19 01:15:51.000000000 +0100
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2834 @@ -23,11 +29,11 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2835
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2836 #ifdef LIBA52_MLIB
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2837
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2838 -#include <inttypes.h>
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2839 -#include <string.h>
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2840 #include <mlib_types.h>
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2841 #include <mlib_status.h>
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2842 #include <mlib_signal.h>
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2843 +#include <string.h>
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2844 +#include <inttypes.h>
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2845
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2846 #include "a52.h"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2847 #include "a52_internal.h"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2848 @@ -42,7 +48,7 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2849 sample_t *data_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2850 sample_t *delay_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2851 sample_t *window_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2852 - sample_t tmp[256] __attribute__ ((__aligned__ (16)));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2853 + sample_t tmp[256] __attribute__((aligned(16)));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2854 int i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2855
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2856 memcpy(tmp, data, 256 * sizeof(sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2857 @@ -91,7 +97,7 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2858 sample_t *data_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2859 sample_t *delay_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2860 sample_t *window_ptr;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2861 - sample_t tmp[256] __attribute__ ((__aligned__ (16)));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2862 + sample_t tmp[256] __attribute__((aligned(16)));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2863 int i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2864
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2865 memcpy(tmp, data, 256 * sizeof(sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2866 --- include/mm_accel.h 2005-03-22 19:58:53.000000000 +0100
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2867 +++ mm_accel.h 2004-03-19 01:15:52.000000000 +0100
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2868 @@ -19,12 +25,22 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2869 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2870 */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2871
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2872 +#ifndef MM_ACCEL_H
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2873 +#define MM_ACCEL_H
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2874 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2875 /* generic accelerations */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2876 #define MM_ACCEL_MLIB 0x00000001
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2877
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2878 /* x86 accelerations */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2879 #define MM_ACCEL_X86_MMX 0x80000000
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2880 #define MM_ACCEL_X86_3DNOW 0x40000000
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2881 +#define MM_ACCEL_X86_3DNOWEXT 0x08000000
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2882 #define MM_ACCEL_X86_MMXEXT 0x20000000
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2883 +#define MM_ACCEL_X86_SSE 0x10000000
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2884 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2885 +/* PPC accelerations */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2886 +#define MM_ACCEL_PPC_ALTIVEC 0x00010000
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2887
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2888 uint32_t mm_accel (void);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2889 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2890 +#endif /* MM_ACCEL_H */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2891 --- liba52/parse.c 2005-03-22 19:59:35.000000000 +0100
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2892 +++ parse.c 2004-04-01 15:41:29.000000000 +0200
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2893 @@ -21,21 +27,19 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2894
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2895 #include "config.h"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2896
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2897 -#include <inttypes.h>
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2898 #include <stdlib.h>
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2899 #include <string.h>
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2900 +#include <inttypes.h>
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2901
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2902 #include "a52.h"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2903 #include "a52_internal.h"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2904 #include "bitstream.h"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2905 #include "tables.h"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2906 +#include "mm_accel.h"
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2907
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2908 #ifdef HAVE_MEMALIGN
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2909 /* some systems have memalign() but no declaration for it */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2910 void * memalign (size_t align, size_t size);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2911 -#else
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2912 -/* assume malloc alignment is sufficient */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2913 -#define memalign(align,size) malloc (size)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2914 #endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2915
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2916 typedef struct {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2917 @@ -54,12 +58,28 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2918 sample_t * samples;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2919 int i;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2920
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2921 - imdct_init (mm_accel);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2922 -
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2923 samples = memalign (16, 256 * 12 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2924 +#if defined(__MINGW32__) && defined(HAVE_SSE)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2925 + for(i=0;i<10;i++){
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2926 + if((int)samples%16){
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2927 + sample_t* samplestmp=malloc(256 * 12 * sizeof (sample_t));
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2928 + free(samples);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2929 + samples = samplestmp;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2930 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2931 + else break;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2932 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2933 +#endif
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2934 + if(((int)samples%16) && (mm_accel&MM_ACCEL_X86_SSE)){
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2935 + mm_accel &=~MM_ACCEL_X86_SSE;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2936 + printf("liba52: unable to get 16 byte aligned memory disabling usage of SSE instructions\n");
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2937 + }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2938 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2939 if (samples == NULL)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2940 - return NULL;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2941 -
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2942 + return NULL;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2943 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2944 + imdct_init (mm_accel);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2945 + downmix_accel_init(mm_accel);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2946 +
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2947 for (i = 0; i < 256 * 12; i++)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2948 samples[i] = 0;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2949
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2950 @@ -124,7 +144,7 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2951 state->acmod = acmod = buf[6] >> 5;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2952
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2953 bitstream_set_ptr (buf + 6);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2954 - bitstream_get (3); /* skip acmod we already parsed */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2955 + bitstream_skip (3); /* skip acmod we already parsed */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2956
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2957 if ((acmod == 2) && (bitstream_get (2) == 2)) /* dsurmod */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2958 acmod = A52_DOLBY;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2959 @@ -144,7 +164,7 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2960 if (state->lfeon && (*flags & A52_LFE))
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2961 state->output |= A52_LFE;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2962 *flags = state->output;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2963 - // the 2* compensates for differences in imdct
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2964 + /* the 2* compensates for differences in imdct */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2965 state->dynrng = state->level = 2 * *level;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2966 state->bias = bias;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2967 state->dynrnge = 1;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2968 @@ -152,28 +172,28 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2969
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2970 chaninfo = !acmod;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2971 do {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2972 - bitstream_get (5); /* dialnorm */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2973 + bitstream_skip (5); /* dialnorm */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2974 if (bitstream_get (1)) /* compre */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2975 - bitstream_get (8); /* compr */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2976 + bitstream_skip (8); /* compr */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2977 if (bitstream_get (1)) /* langcode */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2978 - bitstream_get (8); /* langcod */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2979 + bitstream_skip (8); /* langcod */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2980 if (bitstream_get (1)) /* audprodie */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2981 - bitstream_get (7); /* mixlevel + roomtyp */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2982 + bitstream_skip (7); /* mixlevel + roomtyp */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2983 } while (chaninfo--);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2984
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2985 - bitstream_get (2); /* copyrightb + origbs */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2986 + bitstream_skip (2); /* copyrightb + origbs */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2987
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2988 if (bitstream_get (1)) /* timecod1e */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2989 - bitstream_get (14); /* timecod1 */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2990 + bitstream_skip (14); /* timecod1 */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2991 if (bitstream_get (1)) /* timecod2e */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2992 - bitstream_get (14); /* timecod2 */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2993 + bitstream_skip (14); /* timecod2 */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2994
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2995 if (bitstream_get (1)) { /* addbsie */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2996 int addbsil;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2997
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2998 addbsil = bitstream_get (6);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
2999 do {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3000 - bitstream_get (8); /* addbsi */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3001 + bitstream_skip (8); /* addbsi */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3002 } while (addbsil--);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3003 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3004
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3005 @@ -647,7 +667,7 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3006 if (parse_exponents (chexpstr[i], nchgrps, state->fbw_exp[i][0],
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3007 state->fbw_exp[i] + 1))
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3008 return 1;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3009 - bitstream_get (2); /* gainrng */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3010 + bitstream_skip (2); /* gainrng */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3011 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3012 if (lfeexpstr != EXP_REUSE) {
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3013 do_bit_alloc |= 32;
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3014 @@ -729,7 +749,7 @@
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3015 if (bitstream_get (1)) { /* skiple */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3016 i = bitstream_get (9); /* skipl */
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3017 while (i--)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3018 - bitstream_get (8);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3019 + bitstream_skip (8);
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3020 }
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3021
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3022 if (state->output & A52_LFE)
9de84a73f6d0 MPlayer-specific changes to liba52
diego
parents:
diff changeset
3023