Mercurial > mplayer.hg
annotate liba52/liba52_changes.diff @ 18889:e60c8c7399d2
get_path as const, patch by Stefan Huehner, stefan AT huehner-org
author | reynaldo |
---|---|
date | Mon, 03 Jul 2006 23:27:37 +0000 |
parents | 722ac20fac5f |
children | 9960f9ef96fd |
rev | line source |
---|---|
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1 --- liba52-0.7.4/a52.h 2006-06-12 15:04:57.000000000 +0200 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2 +++ liba52/a52.h 2006-06-05 02:23:02.000000000 +0200 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
3 @@ -59,4 +63,9 @@ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
4 int a52_block (a52_state_t * state); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
5 void a52_free (a52_state_t * state); |
14990 | 6 |
7 +void* a52_resample_init(uint32_t mm_accel,int flags,int chans); | |
8 +extern int (* a52_resample) (float * _f, int16_t * s16); | |
9 + | |
10 +uint16_t crc16_block(uint8_t *data,uint32_t num_bytes); | |
11 + | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
12 #endif /* A52_H */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
13 --- liba52-0.7.4/a52_internal.h 2006-06-12 15:05:07.000000000 +0200 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
14 +++ liba52/a52_internal.h 2006-06-05 02:23:02.000000000 +0200 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
15 @@ -103,18 +107,34 @@ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
16 #define DELTA_BIT_NONE (2) |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
17 #define DELTA_BIT_RESERVED (3) |
14990 | 18 |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
19 +#ifdef ARCH_X86_64 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
20 +# define REG_a "rax" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
21 +# define REG_d "rdx" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
22 +# define REG_S "rsi" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
23 +# define REG_D "rdi" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
24 +# define REG_BP "rbp" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
25 +#else |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
26 +# define REG_a "eax" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
27 +# define REG_d "edx" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
28 +# define REG_S "esi" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
29 +# define REG_D "edi" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
30 +# define REG_BP "ebp" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
31 +#endif |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
32 + |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
33 void a52_bit_allocate (a52_state_t * state, ba_t * ba, int bndstart, |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
34 int start, int end, int fastleak, int slowleak, |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
35 expbap_t * expbap); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
36 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
37 int a52_downmix_init (int input, int flags, sample_t * level, |
18721
722ac20fac5f
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
18720
diff
changeset
|
38 sample_t clev, sample_t slev); |
14990 | 39 +void downmix_accel_init(uint32_t mm_accel); |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
40 int a52_downmix_coeff (sample_t * coeff, int acmod, int output, sample_t level, |
18721
722ac20fac5f
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
18720
diff
changeset
|
41 sample_t clev, sample_t slev); |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
42 -void a52_downmix (sample_t * samples, int acmod, int output, sample_t bias, |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
43 +extern void (*a52_downmix) (sample_t * samples, int acmod, int output, sample_t bias, |
18721
722ac20fac5f
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
18720
diff
changeset
|
44 sample_t clev, sample_t slev); |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
45 -void a52_upmix (sample_t * samples, int acmod, int output); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
46 +extern void (*a52_upmix) (sample_t * samples, int acmod, int output); |
14990 | 47 |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
48 void a52_imdct_init (uint32_t mm_accel); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
49 void a52_imdct_256 (sample_t * data, sample_t * delay, sample_t bias); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
50 -void a52_imdct_512 (sample_t * data, sample_t * delay, sample_t bias); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
51 +extern void (*a52_imdct_512) (sample_t * data, sample_t * delay, sample_t bias); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
52 +void imdct_do_512 (sample_t * data, sample_t * delay, sample_t bias); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
53 --- liba52-0.7.4/bitstream.c 2006-06-12 15:05:07.000000000 +0200 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
54 +++ liba52/bitstream.c 2006-06-05 02:23:02.000000000 +0200 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
55 @@ -31,6 +35,10 @@ |
14990 | 56 |
57 #define BUFFER_SIZE 4096 | |
58 | |
59 +#ifdef ALT_BITSTREAM_READER | |
60 +int indx=0; | |
61 +#endif | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
62 + |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
63 void a52_bitstream_set_ptr (a52_state_t * state, uint8_t * buf) |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
64 { |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
65 int align; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
66 @@ -38,6 +46,9 @@ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
67 align = (long)buf & 3; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
68 state->buffer_start = (uint32_t *) (buf - align); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
69 state->bits_left = 0; |
14990 | 70 +#ifdef ALT_BITSTREAM_READER |
71 + indx=0; | |
72 +#endif | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
73 bitstream_get (state, align * 8); |
14990 | 74 } |
75 | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
76 --- liba52-0.7.4/bitstream.h 2006-06-12 15:05:07.000000000 +0200 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
77 +++ liba52/bitstream.h 2006-06-05 02:23:02.000000000 +0200 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
78 @@ -21,6 +25,48 @@ |
14990 | 79 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
80 */ | |
81 | |
82 +/* code from ffmpeg/libavcodec */ | |
83 +#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC_ == 3 && __GNUC_MINOR__ > 0) | |
84 +# define always_inline __attribute__((always_inline)) inline | |
85 +#else | |
86 +# define always_inline inline | |
87 +#endif | |
88 + | |
89 +#if defined(__sparc__) || defined(hpux) | |
90 +/* | |
91 + * the alt bitstream reader performs unaligned memory accesses; that doesn't work | |
92 + * on sparc/hpux. For now, disable ALT_BITSTREAM_READER. | |
93 + */ | |
94 +#undef ALT_BITSTREAM_READER | |
95 +#else | |
96 +// alternative (faster) bitstram reader (reades upto 3 bytes over the end of the input) | |
97 +#define ALT_BITSTREAM_READER | |
98 + | |
99 +/* used to avoid missaligned exceptions on some archs (alpha, ...) */ | |
100 +#if defined (ARCH_X86) || defined(ARCH_ARMV4L) | |
101 +# define unaligned32(a) (*(uint32_t*)(a)) | |
102 +#else | |
103 +# ifdef __GNUC__ | |
104 +static always_inline uint32_t unaligned32(const void *v) { | |
105 + struct Unaligned { | |
106 + uint32_t i; | |
107 + } __attribute__((packed)); | |
108 + | |
109 + return ((const struct Unaligned *) v)->i; | |
110 +} | |
111 +# elif defined(__DECC) | |
112 +static inline uint32_t unaligned32(const void *v) { | |
113 + return *(const __unaligned uint32_t *) v; | |
114 +} | |
115 +# else | |
116 +static inline uint32_t unaligned32(const void *v) { | |
117 + return *(const uint32_t *) v; | |
118 +} | |
119 +# endif | |
120 +#endif //!ARCH_X86 | |
121 + | |
122 +#endif | |
18721
722ac20fac5f
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
18720
diff
changeset
|
123 + |
14990 | 124 /* (stolen from the kernel) */ |
125 #ifdef WORDS_BIGENDIAN | |
126 | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
127 @@ -28,7 +74,7 @@ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
128 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
129 #else |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
130 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
131 -# if 0 && defined (__i386__) |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
132 +# if defined (__i386__) |
14990 | 133 |
134 # define swab32(x) __i386_swab32(x) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
135 static inline const uint32_t __i386_swab32(uint32_t x) |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
136 @@ -39,19 +85,34 @@ |
14990 | 137 |
138 # else | |
139 | |
140 -# define swab32(x)\ | |
141 -((((uint8_t*)&x)[0] << 24) | (((uint8_t*)&x)[1] << 16) | \ | |
142 - (((uint8_t*)&x)[2] << 8) | (((uint8_t*)&x)[3])) | |
143 - | |
144 +# define swab32(x) __generic_swab32(x) | |
145 + static always_inline const uint32_t __generic_swab32(uint32_t x) | |
146 + { | |
147 + return ((((uint8_t*)&x)[0] << 24) | (((uint8_t*)&x)[1] << 16) | | |
148 + (((uint8_t*)&x)[2] << 8) | (((uint8_t*)&x)[3])); | |
149 + } | |
150 # endif | |
151 #endif | |
152 | |
153 +#ifdef ALT_BITSTREAM_READER | |
154 +extern int indx; | |
155 +#endif | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
156 + |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
157 void a52_bitstream_set_ptr (a52_state_t * state, uint8_t * buf); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
158 uint32_t a52_bitstream_get_bh (a52_state_t * state, uint32_t num_bits); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
159 int32_t a52_bitstream_get_bh_2 (a52_state_t * state, uint32_t num_bits); |
14990 | 160 |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
161 static inline uint32_t bitstream_get (a52_state_t * state, uint32_t num_bits) |
14990 | 162 { |
163 +#ifdef ALT_BITSTREAM_READER | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
164 + uint32_t result= swab32( unaligned32(((uint8_t *)state->buffer_start)+(indx>>3)) ); |
14990 | 165 + |
166 + result<<= (indx&0x07); | |
167 + result>>= 32 - num_bits; | |
168 + indx+= num_bits; | |
169 + | |
170 + return result; | |
171 +#else | |
172 uint32_t result; | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
173 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
174 if (num_bits < state->bits_left) { |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
175 @@ -61,10 +122,29 @@ |
14990 | 176 } |
177 | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
178 return a52_bitstream_get_bh (state, num_bits); |
14990 | 179 +#endif |
180 +} | |
181 + | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
182 +static inline void bitstream_skip(a52_state_t * state, int num_bits) |
14990 | 183 +{ |
184 +#ifdef ALT_BITSTREAM_READER | |
185 + indx+= num_bits; | |
186 +#else | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
187 + bitstream_get(state, num_bits); |
14990 | 188 +#endif |
189 } | |
190 | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
191 static inline int32_t bitstream_get_2 (a52_state_t * state, uint32_t num_bits) |
14990 | 192 { |
193 +#ifdef ALT_BITSTREAM_READER | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
194 + int32_t result= swab32( unaligned32(((uint8_t *)state->buffer_start)+(indx>>3)) ); |
14990 | 195 + |
196 + result<<= (indx&0x07); | |
197 + result>>= 32 - num_bits; | |
198 + indx+= num_bits; | |
199 + | |
200 + return result; | |
201 +#else | |
202 int32_t result; | |
203 | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
204 if (num_bits < state->bits_left) { |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
205 @@ -74,4 +154,5 @@ |
14990 | 206 } |
207 | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
208 return a52_bitstream_get_bh_2 (state, num_bits); |
14990 | 209 +#endif |
210 } | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
211 --- liba52-0.7.4/downmix.c 2006-06-12 15:17:53.000000000 +0200 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
212 +++ liba52/downmix.c 2006-06-05 02:23:02.000000000 +0200 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
213 @@ -23,18 +23,47 @@ |
14990 | 214 * You should have received a copy of the GNU General Public License |
215 * along with this program; if not, write to the Free Software | |
216 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
217 + * | |
218 + * SSE optimizations from Michael Niedermayer (michaelni@gmx.at) | |
219 */ | |
220 | |
221 #include "config.h" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
222 +#include "asmalign.h" |
14990 | 223 |
224 #include <string.h> | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
225 #include <inttypes.h> |
14990 | 226 |
227 #include "a52.h" | |
228 #include "a52_internal.h" | |
229 +#include "mm_accel.h" | |
230 | |
231 #define CONVERT(acmod,output) (((output) << 3) + (acmod)) | |
232 | |
233 + | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
234 +void (*a52_downmix)(sample_t * samples, int acmod, int output, sample_t bias, |
14990 | 235 + sample_t clev, sample_t slev)= NULL; |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
236 +void (*a52_upmix)(sample_t * samples, int acmod, int output)= NULL; |
14990 | 237 + |
238 +static void downmix_SSE (sample_t * samples, int acmod, int output, sample_t bias, | |
239 + sample_t clev, sample_t slev); | |
240 +static void downmix_3dnow (sample_t * samples, int acmod, int output, sample_t bias, | |
241 + sample_t clev, sample_t slev); | |
242 +static void downmix_C (sample_t * samples, int acmod, int output, sample_t bias, | |
243 + sample_t clev, sample_t slev); | |
244 +static void upmix_MMX (sample_t * samples, int acmod, int output); | |
245 +static void upmix_C (sample_t * samples, int acmod, int output); | |
246 + | |
247 +void downmix_accel_init(uint32_t mm_accel) | |
248 +{ | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
249 + a52_upmix= upmix_C; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
250 + a52_downmix= downmix_C; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
251 +#if defined(ARCH_X86) || defined(ARCH_X86_64) |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
252 + if(mm_accel & MM_ACCEL_X86_MMX) a52_upmix= upmix_MMX; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
253 + if(mm_accel & MM_ACCEL_X86_SSE) a52_downmix= downmix_SSE; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
254 + if(mm_accel & MM_ACCEL_X86_3DNOW) a52_downmix= downmix_3dnow; |
14990 | 255 +#endif |
256 +} | |
18721
722ac20fac5f
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
18720
diff
changeset
|
257 + |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
258 int a52_downmix_init (int input, int flags, sample_t * level, |
18721
722ac20fac5f
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
18720
diff
changeset
|
259 sample_t clev, sample_t slev) |
14990 | 260 { |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
261 @@ -451,7 +480,7 @@ |
14990 | 262 samples[i] = 0; |
263 } | |
264 | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
265 -void a52_downmix (sample_t * samples, int acmod, int output, sample_t bias, |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
266 +void downmix_C (sample_t * samples, int acmod, int output, sample_t bias, |
18721
722ac20fac5f
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
18720
diff
changeset
|
267 sample_t clev, sample_t slev) |
14990 | 268 { |
269 switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) { | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
270 @@ -563,7 +592,7 @@ |
14990 | 271 break; |
272 | |
273 case CONVERT (A52_3F2R, A52_2F1R): | |
274 - mix3to2 (samples, bias); | |
275 + mix3to2 (samples, bias); //FIXME possible bug? (output doesnt seem to be used) | |
276 move2to1 (samples + 768, samples + 512, bias); | |
277 break; | |
278 | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
279 @@ -587,12 +616,12 @@ |
14990 | 280 break; |
281 | |
282 case CONVERT (A52_3F1R, A52_3F2R): | |
283 - memcpy (samples + 1027, samples + 768, 256 * sizeof (sample_t)); | |
284 + memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t)); | |
285 break; | |
286 } | |
287 } | |
288 | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
289 -void a52_upmix (sample_t * samples, int acmod, int output) |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
290 +void upmix_C (sample_t * samples, int acmod, int output) |
14990 | 291 { |
292 switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) { | |
293 | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
294 @@ -657,3 +686,1137 @@ |
14990 | 295 goto mix_31to21; |
296 } | |
297 } | |
298 + | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
299 +#if defined(ARCH_X86) || defined(ARCH_X86_64) |
14990 | 300 +static void mix2to1_SSE (sample_t * dest, sample_t * src, sample_t bias) |
301 +{ | |
302 + asm volatile( | |
303 + "movlps %2, %%xmm7 \n\t" | |
304 + "shufps $0x00, %%xmm7, %%xmm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
305 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
306 + ASMALIGN16 |
14990 | 307 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
308 + "movaps (%0, %%"REG_S"), %%xmm0 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
309 + "movaps 16(%0, %%"REG_S"), %%xmm1\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
310 + "addps (%1, %%"REG_S"), %%xmm0 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
311 + "addps 16(%1, %%"REG_S"), %%xmm1\n\t" |
14990 | 312 + "addps %%xmm7, %%xmm0 \n\t" |
313 + "addps %%xmm7, %%xmm1 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
314 + "movaps %%xmm0, (%1, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
315 + "movaps %%xmm1, 16(%1, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
316 + "add $32, %%"REG_S" \n\t" |
14990 | 317 + " jnz 1b \n\t" |
318 + :: "r" (src+256), "r" (dest+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
319 + : "%"REG_S |
14990 | 320 + ); |
321 +} | |
322 + | |
323 +static void mix3to1_SSE (sample_t * samples, sample_t bias) | |
324 +{ | |
325 + asm volatile( | |
326 + "movlps %1, %%xmm7 \n\t" | |
327 + "shufps $0x00, %%xmm7, %%xmm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
328 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
329 + ASMALIGN16 |
14990 | 330 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
331 + "movaps (%0, %%"REG_S"), %%xmm0 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
332 + "movaps 1024(%0, %%"REG_S"), %%xmm1\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
333 + "addps 2048(%0, %%"REG_S"), %%xmm0\n\t" |
14990 | 334 + "addps %%xmm7, %%xmm1 \n\t" |
335 + "addps %%xmm1, %%xmm0 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
336 + "movaps %%xmm0, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
337 + "add $16, %%"REG_S" \n\t" |
14990 | 338 + " jnz 1b \n\t" |
339 + :: "r" (samples+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
340 + : "%"REG_S |
14990 | 341 + ); |
342 +} | |
343 + | |
344 +static void mix4to1_SSE (sample_t * samples, sample_t bias) | |
345 +{ | |
346 + asm volatile( | |
347 + "movlps %1, %%xmm7 \n\t" | |
348 + "shufps $0x00, %%xmm7, %%xmm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
349 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
350 + ASMALIGN16 |
14990 | 351 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
352 + "movaps (%0, %%"REG_S"), %%xmm0 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
353 + "movaps 1024(%0, %%"REG_S"), %%xmm1\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
354 + "addps 2048(%0, %%"REG_S"), %%xmm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
355 + "addps 3072(%0, %%"REG_S"), %%xmm1\n\t" |
14990 | 356 + "addps %%xmm7, %%xmm0 \n\t" |
357 + "addps %%xmm1, %%xmm0 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
358 + "movaps %%xmm0, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
359 + "add $16, %%"REG_S" \n\t" |
14990 | 360 + " jnz 1b \n\t" |
361 + :: "r" (samples+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
362 + : "%"REG_S |
14990 | 363 + ); |
364 +} | |
365 + | |
366 +static void mix5to1_SSE (sample_t * samples, sample_t bias) | |
367 +{ | |
368 + asm volatile( | |
369 + "movlps %1, %%xmm7 \n\t" | |
370 + "shufps $0x00, %%xmm7, %%xmm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
371 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
372 + ASMALIGN16 |
14990 | 373 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
374 + "movaps (%0, %%"REG_S"), %%xmm0 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
375 + "movaps 1024(%0, %%"REG_S"), %%xmm1\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
376 + "addps 2048(%0, %%"REG_S"), %%xmm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
377 + "addps 3072(%0, %%"REG_S"), %%xmm1\n\t" |
14990 | 378 + "addps %%xmm7, %%xmm0 \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
379 + "addps 4096(%0, %%"REG_S"), %%xmm1\n\t" |
14990 | 380 + "addps %%xmm1, %%xmm0 \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
381 + "movaps %%xmm0, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
382 + "add $16, %%"REG_S" \n\t" |
14990 | 383 + " jnz 1b \n\t" |
384 + :: "r" (samples+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
385 + : "%"REG_S |
14990 | 386 + ); |
387 +} | |
388 + | |
389 +static void mix3to2_SSE (sample_t * samples, sample_t bias) | |
390 +{ | |
391 + asm volatile( | |
392 + "movlps %1, %%xmm7 \n\t" | |
393 + "shufps $0x00, %%xmm7, %%xmm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
394 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
395 + ASMALIGN16 |
14990 | 396 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
397 + "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" |
14990 | 398 + "addps %%xmm7, %%xmm0 \n\t" //common |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
399 + "movaps (%0, %%"REG_S"), %%xmm1 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
400 + "movaps 2048(%0, %%"REG_S"), %%xmm2\n\t" |
14990 | 401 + "addps %%xmm0, %%xmm1 \n\t" |
402 + "addps %%xmm0, %%xmm2 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
403 + "movaps %%xmm1, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
404 + "movaps %%xmm2, 1024(%0, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
405 + "add $16, %%"REG_S" \n\t" |
14990 | 406 + " jnz 1b \n\t" |
407 + :: "r" (samples+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
408 + : "%"REG_S |
14990 | 409 + ); |
410 +} | |
411 + | |
412 +static void mix21to2_SSE (sample_t * left, sample_t * right, sample_t bias) | |
413 +{ | |
414 + asm volatile( | |
415 + "movlps %2, %%xmm7 \n\t" | |
416 + "shufps $0x00, %%xmm7, %%xmm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
417 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
418 + ASMALIGN16 |
14990 | 419 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
420 + "movaps 1024(%1, %%"REG_S"), %%xmm0\n\t" |
14990 | 421 + "addps %%xmm7, %%xmm0 \n\t" //common |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
422 + "movaps (%0, %%"REG_S"), %%xmm1 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
423 + "movaps (%1, %%"REG_S"), %%xmm2 \n\t" |
14990 | 424 + "addps %%xmm0, %%xmm1 \n\t" |
425 + "addps %%xmm0, %%xmm2 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
426 + "movaps %%xmm1, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
427 + "movaps %%xmm2, (%1, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
428 + "add $16, %%"REG_S" \n\t" |
14990 | 429 + " jnz 1b \n\t" |
430 + :: "r" (left+256), "r" (right+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
431 + : "%"REG_S |
14990 | 432 + ); |
433 +} | |
434 + | |
435 +static void mix21toS_SSE (sample_t * samples, sample_t bias) | |
436 +{ | |
437 + asm volatile( | |
438 + "movlps %1, %%xmm7 \n\t" | |
439 + "shufps $0x00, %%xmm7, %%xmm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
440 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
441 + ASMALIGN16 |
14990 | 442 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
443 + "movaps 2048(%0, %%"REG_S"), %%xmm0\n\t" // surround |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
444 + "movaps (%0, %%"REG_S"), %%xmm1 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
445 + "movaps 1024(%0, %%"REG_S"), %%xmm2\n\t" |
14990 | 446 + "addps %%xmm7, %%xmm1 \n\t" |
447 + "addps %%xmm7, %%xmm2 \n\t" | |
448 + "subps %%xmm0, %%xmm1 \n\t" | |
449 + "addps %%xmm0, %%xmm2 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
450 + "movaps %%xmm1, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
451 + "movaps %%xmm2, 1024(%0, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
452 + "add $16, %%"REG_S" \n\t" |
14990 | 453 + " jnz 1b \n\t" |
454 + :: "r" (samples+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
455 + : "%"REG_S |
14990 | 456 + ); |
457 +} | |
458 + | |
459 +static void mix31to2_SSE (sample_t * samples, sample_t bias) | |
460 +{ | |
461 + asm volatile( | |
462 + "movlps %1, %%xmm7 \n\t" | |
463 + "shufps $0x00, %%xmm7, %%xmm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
464 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
465 + ASMALIGN16 |
14990 | 466 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
467 + "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
468 + "addps 3072(%0, %%"REG_S"), %%xmm0\n\t" |
14990 | 469 + "addps %%xmm7, %%xmm0 \n\t" // common |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
470 + "movaps (%0, %%"REG_S"), %%xmm1 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
471 + "movaps 2048(%0, %%"REG_S"), %%xmm2\n\t" |
14990 | 472 + "addps %%xmm0, %%xmm1 \n\t" |
473 + "addps %%xmm0, %%xmm2 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
474 + "movaps %%xmm1, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
475 + "movaps %%xmm2, 1024(%0, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
476 + "add $16, %%"REG_S" \n\t" |
14990 | 477 + " jnz 1b \n\t" |
478 + :: "r" (samples+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
479 + : "%"REG_S |
14990 | 480 + ); |
481 +} | |
482 + | |
483 +static void mix31toS_SSE (sample_t * samples, sample_t bias) | |
484 +{ | |
485 + asm volatile( | |
486 + "movlps %1, %%xmm7 \n\t" | |
487 + "shufps $0x00, %%xmm7, %%xmm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
488 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
489 + ASMALIGN16 |
14990 | 490 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
491 + "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
492 + "movaps 3072(%0, %%"REG_S"), %%xmm3\n\t" // surround |
14990 | 493 + "addps %%xmm7, %%xmm0 \n\t" // common |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
494 + "movaps (%0, %%"REG_S"), %%xmm1 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
495 + "movaps 2048(%0, %%"REG_S"), %%xmm2\n\t" |
14990 | 496 + "addps %%xmm0, %%xmm1 \n\t" |
497 + "addps %%xmm0, %%xmm2 \n\t" | |
498 + "subps %%xmm3, %%xmm1 \n\t" | |
499 + "addps %%xmm3, %%xmm2 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
500 + "movaps %%xmm1, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
501 + "movaps %%xmm2, 1024(%0, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
502 + "add $16, %%"REG_S" \n\t" |
14990 | 503 + " jnz 1b \n\t" |
504 + :: "r" (samples+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
505 + : "%"REG_S |
14990 | 506 + ); |
507 +} | |
508 + | |
509 +static void mix22toS_SSE (sample_t * samples, sample_t bias) | |
510 +{ | |
511 + asm volatile( | |
512 + "movlps %1, %%xmm7 \n\t" | |
513 + "shufps $0x00, %%xmm7, %%xmm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
514 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
515 + ASMALIGN16 |
14990 | 516 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
517 + "movaps 2048(%0, %%"REG_S"), %%xmm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
518 + "addps 3072(%0, %%"REG_S"), %%xmm0\n\t" // surround |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
519 + "movaps (%0, %%"REG_S"), %%xmm1 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
520 + "movaps 1024(%0, %%"REG_S"), %%xmm2\n\t" |
14990 | 521 + "addps %%xmm7, %%xmm1 \n\t" |
522 + "addps %%xmm7, %%xmm2 \n\t" | |
523 + "subps %%xmm0, %%xmm1 \n\t" | |
524 + "addps %%xmm0, %%xmm2 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
525 + "movaps %%xmm1, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
526 + "movaps %%xmm2, 1024(%0, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
527 + "add $16, %%"REG_S" \n\t" |
14990 | 528 + " jnz 1b \n\t" |
529 + :: "r" (samples+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
530 + : "%"REG_S |
14990 | 531 + ); |
532 +} | |
533 + | |
534 +static void mix32to2_SSE (sample_t * samples, sample_t bias) | |
535 +{ | |
536 + asm volatile( | |
537 + "movlps %1, %%xmm7 \n\t" | |
538 + "shufps $0x00, %%xmm7, %%xmm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
539 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
540 + ASMALIGN16 |
14990 | 541 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
542 + "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" |
14990 | 543 + "addps %%xmm7, %%xmm0 \n\t" // common |
544 + "movaps %%xmm0, %%xmm1 \n\t" // common | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
545 + "addps (%0, %%"REG_S"), %%xmm0 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
546 + "addps 2048(%0, %%"REG_S"), %%xmm1\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
547 + "addps 3072(%0, %%"REG_S"), %%xmm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
548 + "addps 4096(%0, %%"REG_S"), %%xmm1\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
549 + "movaps %%xmm0, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
550 + "movaps %%xmm1, 1024(%0, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
551 + "add $16, %%"REG_S" \n\t" |
14990 | 552 + " jnz 1b \n\t" |
553 + :: "r" (samples+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
554 + : "%"REG_S |
14990 | 555 + ); |
556 +} | |
557 + | |
558 +static void mix32toS_SSE (sample_t * samples, sample_t bias) | |
559 +{ | |
560 + asm volatile( | |
561 + "movlps %1, %%xmm7 \n\t" | |
562 + "shufps $0x00, %%xmm7, %%xmm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
563 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
564 + ASMALIGN16 |
14990 | 565 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
566 + "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
567 + "movaps 3072(%0, %%"REG_S"), %%xmm2\n\t" |
14990 | 568 + "addps %%xmm7, %%xmm0 \n\t" // common |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
569 + "addps 4096(%0, %%"REG_S"), %%xmm2\n\t" // surround |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
570 + "movaps (%0, %%"REG_S"), %%xmm1 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
571 + "movaps 2048(%0, %%"REG_S"), %%xmm3\n\t" |
14990 | 572 + "subps %%xmm2, %%xmm1 \n\t" |
573 + "addps %%xmm2, %%xmm3 \n\t" | |
574 + "addps %%xmm0, %%xmm1 \n\t" | |
575 + "addps %%xmm0, %%xmm3 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
576 + "movaps %%xmm1, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
577 + "movaps %%xmm3, 1024(%0, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
578 + "add $16, %%"REG_S" \n\t" |
14990 | 579 + " jnz 1b \n\t" |
580 + :: "r" (samples+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
581 + : "%"REG_S |
14990 | 582 + ); |
583 +} | |
584 + | |
585 +static void move2to1_SSE (sample_t * src, sample_t * dest, sample_t bias) | |
586 +{ | |
587 + asm volatile( | |
588 + "movlps %2, %%xmm7 \n\t" | |
589 + "shufps $0x00, %%xmm7, %%xmm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
590 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
591 + ASMALIGN16 |
14990 | 592 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
593 + "movaps (%0, %%"REG_S"), %%xmm0 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
594 + "movaps 16(%0, %%"REG_S"), %%xmm1\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
595 + "addps 1024(%0, %%"REG_S"), %%xmm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
596 + "addps 1040(%0, %%"REG_S"), %%xmm1\n\t" |
14990 | 597 + "addps %%xmm7, %%xmm0 \n\t" |
598 + "addps %%xmm7, %%xmm1 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
599 + "movaps %%xmm0, (%1, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
600 + "movaps %%xmm1, 16(%1, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
601 + "add $32, %%"REG_S" \n\t" |
14990 | 602 + " jnz 1b \n\t" |
603 + :: "r" (src+256), "r" (dest+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
604 + : "%"REG_S |
14990 | 605 + ); |
606 +} | |
607 + | |
608 +static void zero_MMX(sample_t * samples) | |
609 +{ | |
610 + asm volatile( | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
611 + "mov $-1024, %%"REG_S" \n\t" |
14990 | 612 + "pxor %%mm0, %%mm0 \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
613 + ASMALIGN16 |
14990 | 614 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
615 + "movq %%mm0, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
616 + "movq %%mm0, 8(%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
617 + "movq %%mm0, 16(%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
618 + "movq %%mm0, 24(%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
619 + "add $32, %%"REG_S" \n\t" |
14990 | 620 + " jnz 1b \n\t" |
621 + "emms" | |
622 + :: "r" (samples+256) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
623 + : "%"REG_S |
14990 | 624 + ); |
625 +} | |
626 + | |
627 +/* | |
628 + I hope dest and src will be at least 8 byte aligned and size | |
629 + will devide on 8 without remain | |
630 + Note: untested and unused. | |
631 +*/ | |
632 +static void copy_MMX(void *dest,const void *src,unsigned size) | |
633 +{ | |
634 + unsigned i; | |
635 + size /= 64; | |
636 + for(i=0;i<size;i++) | |
637 + { | |
638 + __asm __volatile( | |
639 + "movq %0, %%mm0\n\t" | |
640 + "movq 8%0, %%mm1\n\t" | |
641 + "movq 16%0, %%mm2\n\t" | |
642 + "movq 24%0, %%mm3\n\t" | |
643 + "movq 32%0, %%mm4\n\t" | |
644 + "movq 40%0, %%mm5\n\t" | |
645 + "movq 48%0, %%mm6\n\t" | |
646 + "movq 56%0, %%mm7\n\t" | |
647 + "movq %%mm0, %1\n\t" | |
648 + "movq %%mm1, 8%1\n\t" | |
649 + "movq %%mm2, 16%1\n\t" | |
650 + "movq %%mm3, 24%1\n\t" | |
651 + "movq %%mm4, 32%1\n\t" | |
652 + "movq %%mm5, 40%1\n\t" | |
653 + "movq %%mm6, 48%1\n\t" | |
654 + "movq %%mm7, 56%1\n\t" | |
655 + : | |
656 + :"m"(src),"m"(dest)); | |
657 + } | |
658 +} | |
659 + | |
660 +static void downmix_SSE (sample_t * samples, int acmod, int output, sample_t bias, | |
661 + sample_t clev, sample_t slev) | |
662 +{ | |
663 + switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) { | |
664 + | |
665 + case CONVERT (A52_CHANNEL, A52_CHANNEL2): | |
666 + memcpy (samples, samples + 256, 256 * sizeof (sample_t)); | |
667 + break; | |
668 + | |
669 + case CONVERT (A52_CHANNEL, A52_MONO): | |
670 + case CONVERT (A52_STEREO, A52_MONO): | |
671 + mix_2to1_SSE: | |
672 + mix2to1_SSE (samples, samples + 256, bias); | |
673 + break; | |
674 + | |
675 + case CONVERT (A52_2F1R, A52_MONO): | |
676 + if (slev == 0) | |
677 + goto mix_2to1_SSE; | |
678 + case CONVERT (A52_3F, A52_MONO): | |
679 + mix_3to1_SSE: | |
680 + mix3to1_SSE (samples, bias); | |
681 + break; | |
682 + | |
683 + case CONVERT (A52_3F1R, A52_MONO): | |
684 + if (slev == 0) | |
685 + goto mix_3to1_SSE; | |
686 + case CONVERT (A52_2F2R, A52_MONO): | |
687 + if (slev == 0) | |
688 + goto mix_2to1_SSE; | |
689 + mix4to1_SSE (samples, bias); | |
690 + break; | |
691 + | |
692 + case CONVERT (A52_3F2R, A52_MONO): | |
693 + if (slev == 0) | |
694 + goto mix_3to1_SSE; | |
695 + mix5to1_SSE (samples, bias); | |
696 + break; | |
697 + | |
698 + case CONVERT (A52_MONO, A52_DOLBY): | |
699 + memcpy (samples + 256, samples, 256 * sizeof (sample_t)); | |
700 + break; | |
701 + | |
702 + case CONVERT (A52_3F, A52_STEREO): | |
703 + case CONVERT (A52_3F, A52_DOLBY): | |
704 + mix_3to2_SSE: | |
705 + mix3to2_SSE (samples, bias); | |
706 + break; | |
707 + | |
708 + case CONVERT (A52_2F1R, A52_STEREO): | |
709 + if (slev == 0) | |
710 + break; | |
711 + mix21to2_SSE (samples, samples + 256, bias); | |
712 + break; | |
713 + | |
714 + case CONVERT (A52_2F1R, A52_DOLBY): | |
715 + mix21toS_SSE (samples, bias); | |
716 + break; | |
717 + | |
718 + case CONVERT (A52_3F1R, A52_STEREO): | |
719 + if (slev == 0) | |
720 + goto mix_3to2_SSE; | |
721 + mix31to2_SSE (samples, bias); | |
722 + break; | |
723 + | |
724 + case CONVERT (A52_3F1R, A52_DOLBY): | |
725 + mix31toS_SSE (samples, bias); | |
726 + break; | |
727 + | |
728 + case CONVERT (A52_2F2R, A52_STEREO): | |
729 + if (slev == 0) | |
730 + break; | |
731 + mix2to1_SSE (samples, samples + 512, bias); | |
732 + mix2to1_SSE (samples + 256, samples + 768, bias); | |
733 + break; | |
734 + | |
735 + case CONVERT (A52_2F2R, A52_DOLBY): | |
736 + mix22toS_SSE (samples, bias); | |
737 + break; | |
738 + | |
739 + case CONVERT (A52_3F2R, A52_STEREO): | |
740 + if (slev == 0) | |
741 + goto mix_3to2_SSE; | |
742 + mix32to2_SSE (samples, bias); | |
743 + break; | |
744 + | |
745 + case CONVERT (A52_3F2R, A52_DOLBY): | |
746 + mix32toS_SSE (samples, bias); | |
747 + break; | |
748 + | |
749 + case CONVERT (A52_3F1R, A52_3F): | |
750 + if (slev == 0) | |
751 + break; | |
752 + mix21to2_SSE (samples, samples + 512, bias); | |
753 + break; | |
754 + | |
755 + case CONVERT (A52_3F2R, A52_3F): | |
756 + if (slev == 0) | |
757 + break; | |
758 + mix2to1_SSE (samples, samples + 768, bias); | |
759 + mix2to1_SSE (samples + 512, samples + 1024, bias); | |
760 + break; | |
761 + | |
762 + case CONVERT (A52_3F1R, A52_2F1R): | |
763 + mix3to2_SSE (samples, bias); | |
764 + memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t)); | |
765 + break; | |
766 + | |
767 + case CONVERT (A52_2F2R, A52_2F1R): | |
768 + mix2to1_SSE (samples + 512, samples + 768, bias); | |
769 + break; | |
770 + | |
771 + case CONVERT (A52_3F2R, A52_2F1R): | |
772 + mix3to2_SSE (samples, bias); //FIXME possible bug? (output doesnt seem to be used) | |
773 + move2to1_SSE (samples + 768, samples + 512, bias); | |
774 + break; | |
775 + | |
776 + case CONVERT (A52_3F2R, A52_3F1R): | |
777 + mix2to1_SSE (samples + 768, samples + 1024, bias); | |
778 + break; | |
779 + | |
780 + case CONVERT (A52_2F1R, A52_2F2R): | |
781 + memcpy (samples + 768, samples + 512, 256 * sizeof (sample_t)); | |
782 + break; | |
783 + | |
784 + case CONVERT (A52_3F1R, A52_2F2R): | |
785 + mix3to2_SSE (samples, bias); | |
786 + memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t)); | |
787 + break; | |
788 + | |
789 + case CONVERT (A52_3F2R, A52_2F2R): | |
790 + mix3to2_SSE (samples, bias); | |
791 + memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t)); | |
792 + memcpy (samples + 768, samples + 1024, 256 * sizeof (sample_t)); | |
793 + break; | |
794 + | |
795 + case CONVERT (A52_3F1R, A52_3F2R): | |
796 + memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t)); | |
797 + break; | |
798 + } | |
799 +} | |
800 + | |
801 +static void upmix_MMX (sample_t * samples, int acmod, int output) | |
802 +{ | |
803 + switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) { | |
804 + | |
805 + case CONVERT (A52_CHANNEL, A52_CHANNEL2): | |
806 + memcpy (samples + 256, samples, 256 * sizeof (sample_t)); | |
807 + break; | |
808 + | |
809 + case CONVERT (A52_3F2R, A52_MONO): | |
810 + zero_MMX (samples + 1024); | |
811 + case CONVERT (A52_3F1R, A52_MONO): | |
812 + case CONVERT (A52_2F2R, A52_MONO): | |
813 + zero_MMX (samples + 768); | |
814 + case CONVERT (A52_3F, A52_MONO): | |
815 + case CONVERT (A52_2F1R, A52_MONO): | |
816 + zero_MMX (samples + 512); | |
817 + case CONVERT (A52_CHANNEL, A52_MONO): | |
818 + case CONVERT (A52_STEREO, A52_MONO): | |
819 + zero_MMX (samples + 256); | |
820 + break; | |
821 + | |
822 + case CONVERT (A52_3F2R, A52_STEREO): | |
823 + case CONVERT (A52_3F2R, A52_DOLBY): | |
824 + zero_MMX (samples + 1024); | |
825 + case CONVERT (A52_3F1R, A52_STEREO): | |
826 + case CONVERT (A52_3F1R, A52_DOLBY): | |
827 + zero_MMX (samples + 768); | |
828 + case CONVERT (A52_3F, A52_STEREO): | |
829 + case CONVERT (A52_3F, A52_DOLBY): | |
830 + mix_3to2_MMX: | |
831 + memcpy (samples + 512, samples + 256, 256 * sizeof (sample_t)); | |
832 + zero_MMX (samples + 256); | |
833 + break; | |
834 + | |
835 + case CONVERT (A52_2F2R, A52_STEREO): | |
836 + case CONVERT (A52_2F2R, A52_DOLBY): | |
837 + zero_MMX (samples + 768); | |
838 + case CONVERT (A52_2F1R, A52_STEREO): | |
839 + case CONVERT (A52_2F1R, A52_DOLBY): | |
840 + zero_MMX (samples + 512); | |
841 + break; | |
842 + | |
843 + case CONVERT (A52_3F2R, A52_3F): | |
844 + zero_MMX (samples + 1024); | |
845 + case CONVERT (A52_3F1R, A52_3F): | |
846 + case CONVERT (A52_2F2R, A52_2F1R): | |
847 + zero_MMX (samples + 768); | |
848 + break; | |
849 + | |
850 + case CONVERT (A52_3F2R, A52_3F1R): | |
851 + zero_MMX (samples + 1024); | |
852 + break; | |
853 + | |
854 + case CONVERT (A52_3F2R, A52_2F1R): | |
855 + zero_MMX (samples + 1024); | |
856 + case CONVERT (A52_3F1R, A52_2F1R): | |
857 + mix_31to21_MMX: | |
858 + memcpy (samples + 768, samples + 512, 256 * sizeof (sample_t)); | |
859 + goto mix_3to2_MMX; | |
860 + | |
861 + case CONVERT (A52_3F2R, A52_2F2R): | |
862 + memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t)); | |
863 + goto mix_31to21_MMX; | |
864 + } | |
865 +} | |
866 + | |
867 +static void mix2to1_3dnow (sample_t * dest, sample_t * src, sample_t bias) | |
868 +{ | |
869 + asm volatile( | |
870 + "movd %2, %%mm7 \n\t" | |
871 + "punpckldq %2, %%mm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
872 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
873 + ASMALIGN16 |
14990 | 874 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
875 + "movq (%0, %%"REG_S"), %%mm0 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
876 + "movq 8(%0, %%"REG_S"), %%mm1 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
877 + "movq 16(%0, %%"REG_S"), %%mm2 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
878 + "movq 24(%0, %%"REG_S"), %%mm3 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
879 + "pfadd (%1, %%"REG_S"), %%mm0 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
880 + "pfadd 8(%1, %%"REG_S"), %%mm1 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
881 + "pfadd 16(%1, %%"REG_S"), %%mm2 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
882 + "pfadd 24(%1, %%"REG_S"), %%mm3 \n\t" |
14990 | 883 + "pfadd %%mm7, %%mm0 \n\t" |
884 + "pfadd %%mm7, %%mm1 \n\t" | |
885 + "pfadd %%mm7, %%mm2 \n\t" | |
886 + "pfadd %%mm7, %%mm3 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
887 + "movq %%mm0, (%1, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
888 + "movq %%mm1, 8(%1, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
889 + "movq %%mm2, 16(%1, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
890 + "movq %%mm3, 24(%1, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
891 + "add $32, %%"REG_S" \n\t" |
14990 | 892 + " jnz 1b \n\t" |
893 + :: "r" (src+256), "r" (dest+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
894 + : "%"REG_S |
14990 | 895 + ); |
896 +} | |
897 + | |
898 +static void mix3to1_3dnow (sample_t * samples, sample_t bias) | |
899 +{ | |
900 + asm volatile( | |
901 + "movd %1, %%mm7 \n\t" | |
902 + "punpckldq %1, %%mm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
903 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
904 + ASMALIGN16 |
14990 | 905 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
906 + "movq (%0, %%"REG_S"), %%mm0 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
907 + "movq 8(%0, %%"REG_S"), %%mm1 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
908 + "movq 1024(%0, %%"REG_S"), %%mm2\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
909 + "movq 1032(%0, %%"REG_S"), %%mm3\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
910 + "pfadd 2048(%0, %%"REG_S"), %%mm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
911 + "pfadd 2056(%0, %%"REG_S"), %%mm1\n\t" |
14990 | 912 + "pfadd %%mm7, %%mm0 \n\t" |
913 + "pfadd %%mm7, %%mm1 \n\t" | |
914 + "pfadd %%mm2, %%mm0 \n\t" | |
915 + "pfadd %%mm3, %%mm1 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
916 + "movq %%mm0, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
917 + "movq %%mm1, 8(%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
918 + "add $16, %%"REG_S" \n\t" |
14990 | 919 + " jnz 1b \n\t" |
920 + :: "r" (samples+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
921 + : "%"REG_S |
14990 | 922 + ); |
923 +} | |
924 + | |
925 +static void mix4to1_3dnow (sample_t * samples, sample_t bias) | |
926 +{ | |
927 + asm volatile( | |
928 + "movd %1, %%mm7 \n\t" | |
929 + "punpckldq %1, %%mm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
930 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
931 + ASMALIGN16 |
14990 | 932 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
933 + "movq (%0, %%"REG_S"), %%mm0 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
934 + "movq 8(%0, %%"REG_S"), %%mm1 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
935 + "movq 1024(%0, %%"REG_S"), %%mm2\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
936 + "movq 1032(%0, %%"REG_S"), %%mm3\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
937 + "pfadd 2048(%0, %%"REG_S"), %%mm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
938 + "pfadd 2056(%0, %%"REG_S"), %%mm1\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
939 + "pfadd 3072(%0, %%"REG_S"), %%mm2\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
940 + "pfadd 3080(%0, %%"REG_S"), %%mm3\n\t" |
14990 | 941 + "pfadd %%mm7, %%mm0 \n\t" |
942 + "pfadd %%mm7, %%mm1 \n\t" | |
943 + "pfadd %%mm2, %%mm0 \n\t" | |
944 + "pfadd %%mm3, %%mm1 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
945 + "movq %%mm0, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
946 + "movq %%mm1, 8(%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
947 + "add $16, %%"REG_S" \n\t" |
14990 | 948 + " jnz 1b \n\t" |
949 + :: "r" (samples+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
950 + : "%"REG_S |
14990 | 951 + ); |
952 +} | |
953 + | |
954 +static void mix5to1_3dnow (sample_t * samples, sample_t bias) | |
955 +{ | |
956 + asm volatile( | |
957 + "movd %1, %%mm7 \n\t" | |
958 + "punpckldq %1, %%mm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
959 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
960 + ASMALIGN16 |
14990 | 961 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
962 + "movq (%0, %%"REG_S"), %%mm0 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
963 + "movq 8(%0, %%"REG_S"), %%mm1 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
964 + "movq 1024(%0, %%"REG_S"), %%mm2\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
965 + "movq 1032(%0, %%"REG_S"), %%mm3\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
966 + "pfadd 2048(%0, %%"REG_S"), %%mm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
967 + "pfadd 2056(%0, %%"REG_S"), %%mm1\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
968 + "pfadd 3072(%0, %%"REG_S"), %%mm2\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
969 + "pfadd 3080(%0, %%"REG_S"), %%mm3\n\t" |
14990 | 970 + "pfadd %%mm7, %%mm0 \n\t" |
971 + "pfadd %%mm7, %%mm1 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
972 + "pfadd 4096(%0, %%"REG_S"), %%mm2\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
973 + "pfadd 4104(%0, %%"REG_S"), %%mm3\n\t" |
14990 | 974 + "pfadd %%mm2, %%mm0 \n\t" |
975 + "pfadd %%mm3, %%mm1 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
976 + "movq %%mm0, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
977 + "movq %%mm1, 8(%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
978 + "add $16, %%"REG_S" \n\t" |
14990 | 979 + " jnz 1b \n\t" |
980 + :: "r" (samples+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
981 + : "%"REG_S |
14990 | 982 + ); |
983 +} | |
984 + | |
985 +static void mix3to2_3dnow (sample_t * samples, sample_t bias) | |
986 +{ | |
987 + asm volatile( | |
988 + "movd %1, %%mm7 \n\t" | |
989 + "punpckldq %1, %%mm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
990 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
991 + ASMALIGN16 |
14990 | 992 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
993 + "movq 1024(%0, %%"REG_S"), %%mm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
994 + "movq 1032(%0, %%"REG_S"), %%mm1\n\t" |
14990 | 995 + "pfadd %%mm7, %%mm0 \n\t" //common |
996 + "pfadd %%mm7, %%mm1 \n\t" //common | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
997 + "movq (%0, %%"REG_S"), %%mm2 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
998 + "movq 8(%0, %%"REG_S"), %%mm3 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
999 + "movq 2048(%0, %%"REG_S"), %%mm4\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1000 + "movq 2056(%0, %%"REG_S"), %%mm5\n\t" |
14990 | 1001 + "pfadd %%mm0, %%mm2 \n\t" |
1002 + "pfadd %%mm1, %%mm3 \n\t" | |
1003 + "pfadd %%mm0, %%mm4 \n\t" | |
1004 + "pfadd %%mm1, %%mm5 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1005 + "movq %%mm2, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1006 + "movq %%mm3, 8(%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1007 + "movq %%mm4, 1024(%0, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1008 + "movq %%mm5, 1032(%0, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1009 + "add $16, %%"REG_S" \n\t" |
14990 | 1010 + " jnz 1b \n\t" |
1011 + :: "r" (samples+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1012 + : "%"REG_S |
14990 | 1013 + ); |
1014 +} | |
1015 + | |
1016 +static void mix21to2_3dnow (sample_t * left, sample_t * right, sample_t bias) | |
1017 +{ | |
1018 + asm volatile( | |
1019 + "movd %2, %%mm7 \n\t" | |
1020 + "punpckldq %2, %%mm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1021 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1022 + ASMALIGN16 |
14990 | 1023 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1024 + "movq 1024(%1, %%"REG_S"), %%mm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1025 + "movq 1032(%1, %%"REG_S"), %%mm1\n\t" |
14990 | 1026 + "pfadd %%mm7, %%mm0 \n\t" //common |
1027 + "pfadd %%mm7, %%mm1 \n\t" //common | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1028 + "movq (%0, %%"REG_S"), %%mm2 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1029 + "movq 8(%0, %%"REG_S"), %%mm3 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1030 + "movq (%1, %%"REG_S"), %%mm4 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1031 + "movq 8(%1, %%"REG_S"), %%mm5 \n\t" |
14990 | 1032 + "pfadd %%mm0, %%mm2 \n\t" |
1033 + "pfadd %%mm1, %%mm3 \n\t" | |
1034 + "pfadd %%mm0, %%mm4 \n\t" | |
1035 + "pfadd %%mm1, %%mm5 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1036 + "movq %%mm2, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1037 + "movq %%mm3, 8(%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1038 + "movq %%mm4, (%1, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1039 + "movq %%mm5, 8(%1, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1040 + "add $16, %%"REG_S" \n\t" |
14990 | 1041 + " jnz 1b \n\t" |
1042 + :: "r" (left+256), "r" (right+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1043 + : "%"REG_S |
14990 | 1044 + ); |
1045 +} | |
1046 + | |
1047 +static void mix21toS_3dnow (sample_t * samples, sample_t bias) | |
1048 +{ | |
1049 + asm volatile( | |
1050 + "movd %1, %%mm7 \n\t" | |
1051 + "punpckldq %1, %%mm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1052 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1053 + ASMALIGN16 |
14990 | 1054 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1055 + "movq 2048(%0, %%"REG_S"), %%mm0\n\t" // surround |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1056 + "movq 2056(%0, %%"REG_S"), %%mm1\n\t" // surround |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1057 + "movq (%0, %%"REG_S"), %%mm2 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1058 + "movq 8(%0, %%"REG_S"), %%mm3 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1059 + "movq 1024(%0, %%"REG_S"), %%mm4\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1060 + "movq 1032(%0, %%"REG_S"), %%mm5\n\t" |
14990 | 1061 + "pfadd %%mm7, %%mm2 \n\t" |
1062 + "pfadd %%mm7, %%mm3 \n\t" | |
1063 + "pfadd %%mm7, %%mm4 \n\t" | |
1064 + "pfadd %%mm7, %%mm5 \n\t" | |
1065 + "pfsub %%mm0, %%mm2 \n\t" | |
1066 + "pfsub %%mm1, %%mm3 \n\t" | |
1067 + "pfadd %%mm0, %%mm4 \n\t" | |
1068 + "pfadd %%mm1, %%mm5 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1069 + "movq %%mm2, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1070 + "movq %%mm3, 8(%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1071 + "movq %%mm4, 1024(%0, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1072 + "movq %%mm5, 1032(%0, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1073 + "add $16, %%"REG_S" \n\t" |
14990 | 1074 + " jnz 1b \n\t" |
1075 + :: "r" (samples+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1076 + : "%"REG_S |
14990 | 1077 + ); |
1078 +} | |
1079 + | |
1080 +static void mix31to2_3dnow (sample_t * samples, sample_t bias) | |
1081 +{ | |
1082 + asm volatile( | |
1083 + "movd %1, %%mm7 \n\t" | |
1084 + "punpckldq %1, %%mm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1085 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1086 + ASMALIGN16 |
14990 | 1087 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1088 + "movq 1024(%0, %%"REG_S"), %%mm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1089 + "movq 1032(%0, %%"REG_S"), %%mm1\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1090 + "pfadd 3072(%0, %%"REG_S"), %%mm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1091 + "pfadd 3080(%0, %%"REG_S"), %%mm1\n\t" |
14990 | 1092 + "pfadd %%mm7, %%mm0 \n\t" // common |
1093 + "pfadd %%mm7, %%mm1 \n\t" // common | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1094 + "movq (%0, %%"REG_S"), %%mm2 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1095 + "movq 8(%0, %%"REG_S"), %%mm3 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1096 + "movq 2048(%0, %%"REG_S"), %%mm4\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1097 + "movq 2056(%0, %%"REG_S"), %%mm5\n\t" |
14990 | 1098 + "pfadd %%mm0, %%mm2 \n\t" |
1099 + "pfadd %%mm1, %%mm3 \n\t" | |
1100 + "pfadd %%mm0, %%mm4 \n\t" | |
1101 + "pfadd %%mm1, %%mm5 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1102 + "movq %%mm2, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1103 + "movq %%mm3, 8(%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1104 + "movq %%mm4, 1024(%0, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1105 + "movq %%mm5, 1032(%0, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1106 + "add $16, %%"REG_S" \n\t" |
14990 | 1107 + " jnz 1b \n\t" |
1108 + :: "r" (samples+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1109 + : "%"REG_S |
14990 | 1110 + ); |
1111 +} | |
1112 + | |
1113 +static void mix31toS_3dnow (sample_t * samples, sample_t bias) | |
1114 +{ | |
1115 + asm volatile( | |
1116 + "movd %1, %%mm7 \n\t" | |
1117 + "punpckldq %1, %%mm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1118 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1119 + ASMALIGN16 |
14990 | 1120 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1121 + "movq 1024(%0, %%"REG_S"), %%mm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1122 + "movq 1032(%0, %%"REG_S"), %%mm1\n\t" |
14990 | 1123 + "pfadd %%mm7, %%mm0 \n\t" // common |
1124 + "pfadd %%mm7, %%mm1 \n\t" // common | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1125 + "movq (%0, %%"REG_S"), %%mm2 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1126 + "movq 8(%0, %%"REG_S"), %%mm3 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1127 + "movq 2048(%0, %%"REG_S"), %%mm4\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1128 + "movq 2056(%0, %%"REG_S"), %%mm5\n\t" |
14990 | 1129 + "pfadd %%mm0, %%mm2 \n\t" |
1130 + "pfadd %%mm1, %%mm3 \n\t" | |
1131 + "pfadd %%mm0, %%mm4 \n\t" | |
1132 + "pfadd %%mm1, %%mm5 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1133 + "movq 3072(%0, %%"REG_S"), %%mm0\n\t" // surround |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1134 + "movq 3080(%0, %%"REG_S"), %%mm1\n\t" // surround |
14990 | 1135 + "pfsub %%mm0, %%mm2 \n\t" |
1136 + "pfsub %%mm1, %%mm3 \n\t" | |
1137 + "pfadd %%mm0, %%mm4 \n\t" | |
1138 + "pfadd %%mm1, %%mm5 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1139 + "movq %%mm2, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1140 + "movq %%mm3, 8(%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1141 + "movq %%mm4, 1024(%0, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1142 + "movq %%mm5, 1032(%0, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1143 + "add $16, %%"REG_S" \n\t" |
14990 | 1144 + " jnz 1b \n\t" |
1145 + :: "r" (samples+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1146 + : "%"REG_S |
14990 | 1147 + ); |
1148 +} | |
1149 + | |
1150 +static void mix22toS_3dnow (sample_t * samples, sample_t bias) | |
1151 +{ | |
1152 + asm volatile( | |
1153 + "movd %1, %%mm7 \n\t" | |
1154 + "punpckldq %1, %%mm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1155 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1156 + ASMALIGN16 |
14990 | 1157 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1158 + "movq 2048(%0, %%"REG_S"), %%mm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1159 + "movq 2056(%0, %%"REG_S"), %%mm1\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1160 + "pfadd 3072(%0, %%"REG_S"), %%mm0\n\t" // surround |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1161 + "pfadd 3080(%0, %%"REG_S"), %%mm1\n\t" // surround |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1162 + "movq (%0, %%"REG_S"), %%mm2 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1163 + "movq 8(%0, %%"REG_S"), %%mm3 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1164 + "movq 1024(%0, %%"REG_S"), %%mm4\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1165 + "movq 1032(%0, %%"REG_S"), %%mm5\n\t" |
14990 | 1166 + "pfadd %%mm7, %%mm2 \n\t" |
1167 + "pfadd %%mm7, %%mm3 \n\t" | |
1168 + "pfadd %%mm7, %%mm4 \n\t" | |
1169 + "pfadd %%mm7, %%mm5 \n\t" | |
1170 + "pfsub %%mm0, %%mm2 \n\t" | |
1171 + "pfsub %%mm1, %%mm3 \n\t" | |
1172 + "pfadd %%mm0, %%mm4 \n\t" | |
1173 + "pfadd %%mm1, %%mm5 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1174 + "movq %%mm2, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1175 + "movq %%mm3, 8(%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1176 + "movq %%mm4, 1024(%0, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1177 + "movq %%mm5, 1032(%0, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1178 + "add $16, %%"REG_S" \n\t" |
14990 | 1179 + " jnz 1b \n\t" |
1180 + :: "r" (samples+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1181 + : "%"REG_S |
14990 | 1182 + ); |
1183 +} | |
1184 + | |
1185 +static void mix32to2_3dnow (sample_t * samples, sample_t bias) | |
1186 +{ | |
1187 + asm volatile( | |
1188 + "movd %1, %%mm7 \n\t" | |
1189 + "punpckldq %1, %%mm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1190 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1191 + ASMALIGN16 |
14990 | 1192 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1193 + "movq 1024(%0, %%"REG_S"), %%mm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1194 + "movq 1032(%0, %%"REG_S"), %%mm1\n\t" |
14990 | 1195 + "pfadd %%mm7, %%mm0 \n\t" // common |
1196 + "pfadd %%mm7, %%mm1 \n\t" // common | |
1197 + "movq %%mm0, %%mm2 \n\t" // common | |
1198 + "movq %%mm1, %%mm3 \n\t" // common | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1199 + "pfadd (%0, %%"REG_S"), %%mm0 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1200 + "pfadd 8(%0, %%"REG_S"), %%mm1 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1201 + "pfadd 2048(%0, %%"REG_S"), %%mm2\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1202 + "pfadd 2056(%0, %%"REG_S"), %%mm3\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1203 + "pfadd 3072(%0, %%"REG_S"), %%mm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1204 + "pfadd 3080(%0, %%"REG_S"), %%mm1\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1205 + "pfadd 4096(%0, %%"REG_S"), %%mm2\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1206 + "pfadd 4104(%0, %%"REG_S"), %%mm3\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1207 + "movq %%mm0, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1208 + "movq %%mm1, 8(%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1209 + "movq %%mm2, 1024(%0, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1210 + "movq %%mm3, 1032(%0, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1211 + "add $16, %%"REG_S" \n\t" |
14990 | 1212 + " jnz 1b \n\t" |
1213 + :: "r" (samples+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1214 + : "%"REG_S |
14990 | 1215 + ); |
1216 +} | |
1217 + | |
1218 +/* todo: should be optimized better */ | |
1219 +static void mix32toS_3dnow (sample_t * samples, sample_t bias) | |
1220 +{ | |
1221 + asm volatile( | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1222 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1223 + ASMALIGN16 |
14990 | 1224 + "1: \n\t" |
1225 + "movd %1, %%mm7 \n\t" | |
1226 + "punpckldq %1, %%mm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1227 + "movq 1024(%0, %%"REG_S"), %%mm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1228 + "movq 1032(%0, %%"REG_S"), %%mm1\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1229 + "movq 3072(%0, %%"REG_S"), %%mm4\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1230 + "movq 3080(%0, %%"REG_S"), %%mm5\n\t" |
14990 | 1231 + "pfadd %%mm7, %%mm0 \n\t" // common |
1232 + "pfadd %%mm7, %%mm1 \n\t" // common | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1233 + "pfadd 4096(%0, %%"REG_S"), %%mm4\n\t" // surround |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1234 + "pfadd 4104(%0, %%"REG_S"), %%mm5\n\t" // surround |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1235 + "movq (%0, %%"REG_S"), %%mm2 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1236 + "movq 8(%0, %%"REG_S"), %%mm3 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1237 + "movq 2048(%0, %%"REG_S"), %%mm6\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1238 + "movq 2056(%0, %%"REG_S"), %%mm7\n\t" |
14990 | 1239 + "pfsub %%mm4, %%mm2 \n\t" |
1240 + "pfsub %%mm5, %%mm3 \n\t" | |
1241 + "pfadd %%mm4, %%mm6 \n\t" | |
1242 + "pfadd %%mm5, %%mm7 \n\t" | |
1243 + "pfadd %%mm0, %%mm2 \n\t" | |
1244 + "pfadd %%mm1, %%mm3 \n\t" | |
1245 + "pfadd %%mm0, %%mm6 \n\t" | |
1246 + "pfadd %%mm1, %%mm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1247 + "movq %%mm2, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1248 + "movq %%mm3, 8(%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1249 + "movq %%mm6, 1024(%0, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1250 + "movq %%mm7, 1032(%0, %%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1251 + "add $16, %%"REG_S" \n\t" |
14990 | 1252 + " jnz 1b \n\t" |
1253 + :: "r" (samples+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1254 + : "%"REG_S |
14990 | 1255 + ); |
1256 +} | |
1257 + | |
1258 +static void move2to1_3dnow (sample_t * src, sample_t * dest, sample_t bias) | |
1259 +{ | |
1260 + asm volatile( | |
1261 + "movd %2, %%mm7 \n\t" | |
1262 + "punpckldq %2, %%mm7 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1263 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1264 + ASMALIGN16 |
14990 | 1265 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1266 + "movq (%0, %%"REG_S"), %%mm0 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1267 + "movq 8(%0, %%"REG_S"), %%mm1 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1268 + "movq 16(%0, %%"REG_S"), %%mm2 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1269 + "movq 24(%0, %%"REG_S"), %%mm3 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1270 + "pfadd 1024(%0, %%"REG_S"), %%mm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1271 + "pfadd 1032(%0, %%"REG_S"), %%mm1\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1272 + "pfadd 1040(%0, %%"REG_S"), %%mm2\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1273 + "pfadd 1048(%0, %%"REG_S"), %%mm3\n\t" |
14990 | 1274 + "pfadd %%mm7, %%mm0 \n\t" |
1275 + "pfadd %%mm7, %%mm1 \n\t" | |
1276 + "pfadd %%mm7, %%mm2 \n\t" | |
1277 + "pfadd %%mm7, %%mm3 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1278 + "movq %%mm0, (%1, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1279 + "movq %%mm1, 8(%1, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1280 + "movq %%mm2, 16(%1, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1281 + "movq %%mm3, 24(%1, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1282 + "add $32, %%"REG_S" \n\t" |
14990 | 1283 + " jnz 1b \n\t" |
1284 + :: "r" (src+256), "r" (dest+256), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1285 + : "%"REG_S |
14990 | 1286 + ); |
1287 +} | |
1288 + | |
1289 +static void downmix_3dnow (sample_t * samples, int acmod, int output, sample_t bias, | |
1290 + sample_t clev, sample_t slev) | |
1291 +{ | |
1292 + switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) { | |
1293 + | |
1294 + case CONVERT (A52_CHANNEL, A52_CHANNEL2): | |
1295 + memcpy (samples, samples + 256, 256 * sizeof (sample_t)); | |
1296 + break; | |
1297 + | |
1298 + case CONVERT (A52_CHANNEL, A52_MONO): | |
1299 + case CONVERT (A52_STEREO, A52_MONO): | |
1300 + mix_2to1_3dnow: | |
1301 + mix2to1_3dnow (samples, samples + 256, bias); | |
1302 + break; | |
1303 + | |
1304 + case CONVERT (A52_2F1R, A52_MONO): | |
1305 + if (slev == 0) | |
1306 + goto mix_2to1_3dnow; | |
1307 + case CONVERT (A52_3F, A52_MONO): | |
1308 + mix_3to1_3dnow: | |
1309 + mix3to1_3dnow (samples, bias); | |
1310 + break; | |
1311 + | |
1312 + case CONVERT (A52_3F1R, A52_MONO): | |
1313 + if (slev == 0) | |
1314 + goto mix_3to1_3dnow; | |
1315 + case CONVERT (A52_2F2R, A52_MONO): | |
1316 + if (slev == 0) | |
1317 + goto mix_2to1_3dnow; | |
1318 + mix4to1_3dnow (samples, bias); | |
1319 + break; | |
1320 + | |
1321 + case CONVERT (A52_3F2R, A52_MONO): | |
1322 + if (slev == 0) | |
1323 + goto mix_3to1_3dnow; | |
1324 + mix5to1_3dnow (samples, bias); | |
1325 + break; | |
1326 + | |
1327 + case CONVERT (A52_MONO, A52_DOLBY): | |
1328 + memcpy (samples + 256, samples, 256 * sizeof (sample_t)); | |
1329 + break; | |
1330 + | |
1331 + case CONVERT (A52_3F, A52_STEREO): | |
1332 + case CONVERT (A52_3F, A52_DOLBY): | |
1333 + mix_3to2_3dnow: | |
1334 + mix3to2_3dnow (samples, bias); | |
1335 + break; | |
1336 + | |
1337 + case CONVERT (A52_2F1R, A52_STEREO): | |
1338 + if (slev == 0) | |
1339 + break; | |
1340 + mix21to2_3dnow (samples, samples + 256, bias); | |
1341 + break; | |
1342 + | |
1343 + case CONVERT (A52_2F1R, A52_DOLBY): | |
1344 + mix21toS_3dnow (samples, bias); | |
1345 + break; | |
1346 + | |
1347 + case CONVERT (A52_3F1R, A52_STEREO): | |
1348 + if (slev == 0) | |
1349 + goto mix_3to2_3dnow; | |
1350 + mix31to2_3dnow (samples, bias); | |
1351 + break; | |
1352 + | |
1353 + case CONVERT (A52_3F1R, A52_DOLBY): | |
1354 + mix31toS_3dnow (samples, bias); | |
1355 + break; | |
1356 + | |
1357 + case CONVERT (A52_2F2R, A52_STEREO): | |
1358 + if (slev == 0) | |
1359 + break; | |
1360 + mix2to1_3dnow (samples, samples + 512, bias); | |
1361 + mix2to1_3dnow (samples + 256, samples + 768, bias); | |
1362 + break; | |
1363 + | |
1364 + case CONVERT (A52_2F2R, A52_DOLBY): | |
1365 + mix22toS_3dnow (samples, bias); | |
1366 + break; | |
1367 + | |
1368 + case CONVERT (A52_3F2R, A52_STEREO): | |
1369 + if (slev == 0) | |
1370 + goto mix_3to2_3dnow; | |
1371 + mix32to2_3dnow (samples, bias); | |
1372 + break; | |
1373 + | |
1374 + case CONVERT (A52_3F2R, A52_DOLBY): | |
1375 + mix32toS_3dnow (samples, bias); | |
1376 + break; | |
1377 + | |
1378 + case CONVERT (A52_3F1R, A52_3F): | |
1379 + if (slev == 0) | |
1380 + break; | |
1381 + mix21to2_3dnow (samples, samples + 512, bias); | |
1382 + break; | |
1383 + | |
1384 + case CONVERT (A52_3F2R, A52_3F): | |
1385 + if (slev == 0) | |
1386 + break; | |
1387 + mix2to1_3dnow (samples, samples + 768, bias); | |
1388 + mix2to1_3dnow (samples + 512, samples + 1024, bias); | |
1389 + break; | |
1390 + | |
1391 + case CONVERT (A52_3F1R, A52_2F1R): | |
1392 + mix3to2_3dnow (samples, bias); | |
1393 + memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t)); | |
1394 + break; | |
1395 + | |
1396 + case CONVERT (A52_2F2R, A52_2F1R): | |
1397 + mix2to1_3dnow (samples + 512, samples + 768, bias); | |
1398 + break; | |
1399 + | |
1400 + case CONVERT (A52_3F2R, A52_2F1R): | |
1401 + mix3to2_3dnow (samples, bias); //FIXME possible bug? (output doesnt seem to be used) | |
1402 + move2to1_3dnow (samples + 768, samples + 512, bias); | |
1403 + break; | |
1404 + | |
1405 + case CONVERT (A52_3F2R, A52_3F1R): | |
1406 + mix2to1_3dnow (samples + 768, samples + 1024, bias); | |
1407 + break; | |
1408 + | |
1409 + case CONVERT (A52_2F1R, A52_2F2R): | |
1410 + memcpy (samples + 768, samples + 512, 256 * sizeof (sample_t)); | |
1411 + break; | |
1412 + | |
1413 + case CONVERT (A52_3F1R, A52_2F2R): | |
1414 + mix3to2_3dnow (samples, bias); | |
1415 + memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t)); | |
1416 + break; | |
1417 + | |
1418 + case CONVERT (A52_3F2R, A52_2F2R): | |
1419 + mix3to2_3dnow (samples, bias); | |
1420 + memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t)); | |
1421 + memcpy (samples + 768, samples + 1024, 256 * sizeof (sample_t)); | |
1422 + break; | |
1423 + | |
1424 + case CONVERT (A52_3F1R, A52_3F2R): | |
1425 + memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t)); | |
1426 + break; | |
1427 + } | |
1428 + __asm __volatile("femms":::"memory"); | |
1429 +} | |
1430 + | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1431 +#endif // ARCH_X86 || ARCH_X86_64 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1432 --- liba52-0.7.4/imdct.c 2006-06-12 15:18:27.000000000 +0200 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1433 +++ liba52/imdct.c 2006-06-12 19:18:39.000000000 +0200 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1434 @@ -26,9 +26,15 @@ |
14990 | 1435 * You should have received a copy of the GNU General Public License |
1436 * along with this program; if not, write to the Free Software | |
1437 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
1438 + * | |
1439 + * SSE optimizations from Michael Niedermayer (michaelni@gmx.at) | |
1440 + * 3DNOW optimizations from Nick Kurshev <nickols_k@mail.ru> | |
1441 + * michael did port them from libac3 (untested, perhaps totally broken) | |
1442 + * AltiVec optimizations from Romain Dolbeau (romain@dolbeau.org) | |
1443 */ | |
1444 | |
1445 #include "config.h" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1446 +#include "asmalign.h" |
14990 | 1447 |
1448 #include <math.h> | |
1449 #include <stdio.h> | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1450 @@ -43,12 +49,49 @@ |
14990 | 1451 #include "a52.h" |
1452 #include "a52_internal.h" | |
1453 #include "mm_accel.h" | |
1454 +#include "mangle.h" | |
1455 + | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1456 +void (*a52_imdct_512) (sample_t * data, sample_t * delay, sample_t bias); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1457 + |
14990 | 1458 +#ifdef RUNTIME_CPUDETECT |
1459 +#undef HAVE_3DNOWEX | |
1460 +#endif | |
1461 | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1462 typedef struct complex_s { |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1463 sample_t real; |
14990 | 1464 sample_t imag; |
1465 } complex_t; | |
1466 | |
1467 +static const int pm128[128] attribute_used __attribute__((aligned(16))) = | |
1468 +{ | |
1469 + 0, 16, 32, 48, 64, 80, 96, 112, 8, 40, 72, 104, 24, 56, 88, 120, | |
1470 + 4, 20, 36, 52, 68, 84, 100, 116, 12, 28, 44, 60, 76, 92, 108, 124, | |
1471 + 2, 18, 34, 50, 66, 82, 98, 114, 10, 42, 74, 106, 26, 58, 90, 122, | |
1472 + 6, 22, 38, 54, 70, 86, 102, 118, 14, 46, 78, 110, 30, 62, 94, 126, | |
1473 + 1, 17, 33, 49, 65, 81, 97, 113, 9, 41, 73, 105, 25, 57, 89, 121, | |
1474 + 5, 21, 37, 53, 69, 85, 101, 117, 13, 29, 45, 61, 77, 93, 109, 125, | |
1475 + 3, 19, 35, 51, 67, 83, 99, 115, 11, 43, 75, 107, 27, 59, 91, 123, | |
1476 + 7, 23, 39, 55, 71, 87, 103, 119, 15, 31, 47, 63, 79, 95, 111, 127 | |
1477 +}; | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1478 + |
14990 | 1479 +static uint8_t attribute_used bit_reverse_512[] = { |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1480 + 0x00, 0x40, 0x20, 0x60, 0x10, 0x50, 0x30, 0x70, |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1481 + 0x08, 0x48, 0x28, 0x68, 0x18, 0x58, 0x38, 0x78, |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1482 + 0x04, 0x44, 0x24, 0x64, 0x14, 0x54, 0x34, 0x74, |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1483 + 0x0c, 0x4c, 0x2c, 0x6c, 0x1c, 0x5c, 0x3c, 0x7c, |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1484 + 0x02, 0x42, 0x22, 0x62, 0x12, 0x52, 0x32, 0x72, |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1485 + 0x0a, 0x4a, 0x2a, 0x6a, 0x1a, 0x5a, 0x3a, 0x7a, |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1486 + 0x06, 0x46, 0x26, 0x66, 0x16, 0x56, 0x36, 0x76, |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1487 + 0x0e, 0x4e, 0x2e, 0x6e, 0x1e, 0x5e, 0x3e, 0x7e, |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1488 + 0x01, 0x41, 0x21, 0x61, 0x11, 0x51, 0x31, 0x71, |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1489 + 0x09, 0x49, 0x29, 0x69, 0x19, 0x59, 0x39, 0x79, |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1490 + 0x05, 0x45, 0x25, 0x65, 0x15, 0x55, 0x35, 0x75, |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1491 + 0x0d, 0x4d, 0x2d, 0x6d, 0x1d, 0x5d, 0x3d, 0x7d, |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1492 + 0x03, 0x43, 0x23, 0x63, 0x13, 0x53, 0x33, 0x73, |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1493 + 0x0b, 0x4b, 0x2b, 0x6b, 0x1b, 0x5b, 0x3b, 0x7b, |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1494 + 0x07, 0x47, 0x27, 0x67, 0x17, 0x57, 0x37, 0x77, |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1495 + 0x0f, 0x4f, 0x2f, 0x6f, 0x1f, 0x5f, 0x3f, 0x7f}; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1496 + |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1497 static uint8_t fftorder[] = { |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1498 0,128, 64,192, 32,160,224, 96, 16,144, 80,208,240,112, 48,176, |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1499 8,136, 72,200, 40,168,232,104,248,120, 56,184, 24,152,216, 88, |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1500 @@ -60,6 +103,40 @@ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1501 6,134, 70,198, 38,166,230,102,246,118, 54,182, 22,150,214, 86 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1502 }; |
14990 | 1503 |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1504 +static complex_t __attribute__((aligned(16))) buf[128]; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1505 + |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1506 +/* Twiddle factor LUT */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1507 +static complex_t __attribute__((aligned(16))) w_1[1]; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1508 +static complex_t __attribute__((aligned(16))) w_2[2]; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1509 +static complex_t __attribute__((aligned(16))) w_4[4]; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1510 +static complex_t __attribute__((aligned(16))) w_8[8]; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1511 +static complex_t __attribute__((aligned(16))) w_16[16]; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1512 +static complex_t __attribute__((aligned(16))) w_32[32]; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1513 +static complex_t __attribute__((aligned(16))) w_64[64]; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1514 +static complex_t __attribute__((aligned(16))) * w[7] = {w_1, w_2, w_4, w_8, w_16, w_32, w_64}; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1515 + |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1516 +/* Twiddle factors for IMDCT */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1517 +static sample_t __attribute__((aligned(16))) xcos1[128]; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1518 +static sample_t __attribute__((aligned(16))) xsin1[128]; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1519 + |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1520 +#if defined(ARCH_X86) || defined(ARCH_X86_64) |
14990 | 1521 +// NOTE: SSE needs 16byte alignment or it will segfault |
1522 +// | |
1523 +static float __attribute__((aligned(16))) sseSinCos1c[256]; | |
1524 +static float __attribute__((aligned(16))) sseSinCos1d[256]; | |
1525 +static float attribute_used __attribute__((aligned(16))) ps111_1[4]={1,1,1,-1}; | |
1526 +//static float __attribute__((aligned(16))) sseW0[4]; | |
1527 +static float __attribute__((aligned(16))) sseW1[8]; | |
1528 +static float __attribute__((aligned(16))) sseW2[16]; | |
1529 +static float __attribute__((aligned(16))) sseW3[32]; | |
1530 +static float __attribute__((aligned(16))) sseW4[64]; | |
1531 +static float __attribute__((aligned(16))) sseW5[128]; | |
1532 +static float __attribute__((aligned(16))) sseW6[256]; | |
1533 +static float __attribute__((aligned(16))) *sseW[7]= | |
1534 + {NULL /*sseW0*/,sseW1,sseW2,sseW3,sseW4,sseW5,sseW6}; | |
1535 +static float __attribute__((aligned(16))) sseWindow[512]; | |
18721
722ac20fac5f
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
18720
diff
changeset
|
1536 +#endif |
722ac20fac5f
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
18720
diff
changeset
|
1537 + |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1538 /* Root values for IFFT */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1539 static sample_t roots16[3]; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1540 static sample_t roots32[7]; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1541 @@ -245,7 +322,7 @@ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1542 ifft_pass (buf, roots128 - 32, 32); |
18721
722ac20fac5f
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
18720
diff
changeset
|
1543 } |
14990 | 1544 |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1545 -void a52_imdct_512 (sample_t * data, sample_t * delay, sample_t bias) |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1546 +void imdct_do_512 (sample_t * data, sample_t * delay, sample_t bias) |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1547 { |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1548 int i, k; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1549 sample_t t_r, t_i, a_r, a_i, b_r, b_i, w_1, w_2; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1550 @@ -289,6 +366,714 @@ |
14990 | 1551 } |
1552 } | |
1553 | |
1554 +#ifdef HAVE_ALTIVEC | |
1555 + | |
1556 +#ifndef SYS_DARWIN | |
1557 +#include <altivec.h> | |
1558 +#endif | |
1559 + | |
1560 +// used to build registers permutation vectors (vcprm) | |
1561 +// the 's' are for words in the _s_econd vector | |
1562 +#define WORD_0 0x00,0x01,0x02,0x03 | |
1563 +#define WORD_1 0x04,0x05,0x06,0x07 | |
1564 +#define WORD_2 0x08,0x09,0x0a,0x0b | |
1565 +#define WORD_3 0x0c,0x0d,0x0e,0x0f | |
1566 +#define WORD_s0 0x10,0x11,0x12,0x13 | |
1567 +#define WORD_s1 0x14,0x15,0x16,0x17 | |
1568 +#define WORD_s2 0x18,0x19,0x1a,0x1b | |
1569 +#define WORD_s3 0x1c,0x1d,0x1e,0x1f | |
1570 + | |
1571 +#ifdef SYS_DARWIN | |
1572 +#define vcprm(a,b,c,d) (const vector unsigned char)(WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d) | |
1573 +#else | |
1574 +#define vcprm(a,b,c,d) (const vector unsigned char){WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d} | |
1575 +#endif | |
1576 + | |
1577 +// vcprmle is used to keep the same index as in the SSE version. | |
1578 +// it's the same as vcprm, with the index inversed | |
1579 +// ('le' is Little Endian) | |
1580 +#define vcprmle(a,b,c,d) vcprm(d,c,b,a) | |
1581 + | |
1582 +// used to build inverse/identity vectors (vcii) | |
1583 +// n is _n_egative, p is _p_ositive | |
1584 +#define FLOAT_n -1. | |
1585 +#define FLOAT_p 1. | |
1586 + | |
1587 +#ifdef SYS_DARWIN | |
1588 +#define vcii(a,b,c,d) (const vector float)(FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d) | |
1589 +#else | |
1590 +#define vcii(a,b,c,d) (const vector float){FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d} | |
1591 +#endif | |
1592 + | |
1593 +#ifdef SYS_DARWIN | |
1594 +#define FOUROF(a) (a) | |
1595 +#else | |
1596 +#define FOUROF(a) {a,a,a,a} | |
1597 +#endif | |
1598 + | |
1599 + | |
1600 +void | |
1601 +imdct_do_512_altivec(sample_t data[],sample_t delay[], sample_t bias) | |
1602 +{ | |
1603 + int i; | |
1604 + int k; | |
1605 + int p,q; | |
1606 + int m; | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1607 + long two_m; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1608 + long two_m_plus_one; |
14990 | 1609 + |
1610 + sample_t tmp_b_i; | |
1611 + sample_t tmp_b_r; | |
1612 + sample_t tmp_a_i; | |
1613 + sample_t tmp_a_r; | |
1614 + | |
1615 + sample_t *data_ptr; | |
1616 + sample_t *delay_ptr; | |
1617 + sample_t *window_ptr; | |
1618 + | |
1619 + /* 512 IMDCT with source and dest data in 'data' */ | |
1620 + | |
1621 + /* Pre IFFT complex multiply plus IFFT cmplx conjugate & reordering*/ | |
1622 + for( i=0; i < 128; i++) { | |
1623 + /* z[i] = (X[256-2*i-1] + j * X[2*i]) * (xcos1[i] + j * xsin1[i]) ; */ | |
1624 + int j= bit_reverse_512[i]; | |
1625 + buf[i].real = (data[256-2*j-1] * xcos1[j]) - (data[2*j] * xsin1[j]); | |
1626 + buf[i].imag = -1.0 * ((data[2*j] * xcos1[j]) + (data[256-2*j-1] * xsin1[j])); | |
1627 + } | |
1628 + | |
1629 + /* 1. iteration */ | |
1630 + for(i = 0; i < 128; i += 2) { | |
1631 +#if 0 | |
1632 + tmp_a_r = buf[i].real; | |
1633 + tmp_a_i = buf[i].imag; | |
1634 + tmp_b_r = buf[i+1].real; | |
1635 + tmp_b_i = buf[i+1].imag; | |
1636 + buf[i].real = tmp_a_r + tmp_b_r; | |
1637 + buf[i].imag = tmp_a_i + tmp_b_i; | |
1638 + buf[i+1].real = tmp_a_r - tmp_b_r; | |
1639 + buf[i+1].imag = tmp_a_i - tmp_b_i; | |
1640 +#else | |
1641 + vector float temp, bufv; | |
1642 + | |
1643 + bufv = vec_ld(i << 3, (float*)buf); | |
1644 + temp = vec_perm(bufv, bufv, vcprm(2,3,0,1)); | |
1645 + bufv = vec_madd(bufv, vcii(p,p,n,n), temp); | |
1646 + vec_st(bufv, i << 3, (float*)buf); | |
1647 +#endif | |
1648 + } | |
1649 + | |
1650 + /* 2. iteration */ | |
1651 + // Note w[1]={{1,0}, {0,-1}} | |
1652 + for(i = 0; i < 128; i += 4) { | |
1653 +#if 0 | |
1654 + tmp_a_r = buf[i].real; | |
1655 + tmp_a_i = buf[i].imag; | |
1656 + tmp_b_r = buf[i+2].real; | |
1657 + tmp_b_i = buf[i+2].imag; | |
1658 + buf[i].real = tmp_a_r + tmp_b_r; | |
1659 + buf[i].imag = tmp_a_i + tmp_b_i; | |
1660 + buf[i+2].real = tmp_a_r - tmp_b_r; | |
1661 + buf[i+2].imag = tmp_a_i - tmp_b_i; | |
1662 + tmp_a_r = buf[i+1].real; | |
1663 + tmp_a_i = buf[i+1].imag; | |
1664 + /* WARNING: im <-> re here ! */ | |
1665 + tmp_b_r = buf[i+3].imag; | |
1666 + tmp_b_i = buf[i+3].real; | |
1667 + buf[i+1].real = tmp_a_r + tmp_b_r; | |
1668 + buf[i+1].imag = tmp_a_i - tmp_b_i; | |
1669 + buf[i+3].real = tmp_a_r - tmp_b_r; | |
1670 + buf[i+3].imag = tmp_a_i + tmp_b_i; | |
1671 +#else | |
1672 + vector float buf01, buf23, temp1, temp2; | |
1673 + | |
1674 + buf01 = vec_ld((i + 0) << 3, (float*)buf); | |
1675 + buf23 = vec_ld((i + 2) << 3, (float*)buf); | |
1676 + buf23 = vec_perm(buf23,buf23,vcprm(0,1,3,2)); | |
1677 + | |
1678 + temp1 = vec_madd(buf23, vcii(p,p,p,n), buf01); | |
1679 + temp2 = vec_madd(buf23, vcii(n,n,n,p), buf01); | |
1680 + | |
1681 + vec_st(temp1, (i + 0) << 3, (float*)buf); | |
1682 + vec_st(temp2, (i + 2) << 3, (float*)buf); | |
1683 +#endif | |
1684 + } | |
1685 + | |
1686 + /* 3. iteration */ | |
1687 + for(i = 0; i < 128; i += 8) { | |
1688 +#if 0 | |
1689 + tmp_a_r = buf[i].real; | |
1690 + tmp_a_i = buf[i].imag; | |
1691 + tmp_b_r = buf[i+4].real; | |
1692 + tmp_b_i = buf[i+4].imag; | |
1693 + buf[i].real = tmp_a_r + tmp_b_r; | |
1694 + buf[i].imag = tmp_a_i + tmp_b_i; | |
1695 + buf[i+4].real = tmp_a_r - tmp_b_r; | |
1696 + buf[i+4].imag = tmp_a_i - tmp_b_i; | |
1697 + tmp_a_r = buf[1+i].real; | |
1698 + tmp_a_i = buf[1+i].imag; | |
1699 + tmp_b_r = (buf[i+5].real + buf[i+5].imag) * w[2][1].real; | |
1700 + tmp_b_i = (buf[i+5].imag - buf[i+5].real) * w[2][1].real; | |
1701 + buf[1+i].real = tmp_a_r + tmp_b_r; | |
1702 + buf[1+i].imag = tmp_a_i + tmp_b_i; | |
1703 + buf[i+5].real = tmp_a_r - tmp_b_r; | |
1704 + buf[i+5].imag = tmp_a_i - tmp_b_i; | |
1705 + tmp_a_r = buf[i+2].real; | |
1706 + tmp_a_i = buf[i+2].imag; | |
1707 + /* WARNING re <-> im & sign */ | |
1708 + tmp_b_r = buf[i+6].imag; | |
1709 + tmp_b_i = - buf[i+6].real; | |
1710 + buf[i+2].real = tmp_a_r + tmp_b_r; | |
1711 + buf[i+2].imag = tmp_a_i + tmp_b_i; | |
1712 + buf[i+6].real = tmp_a_r - tmp_b_r; | |
1713 + buf[i+6].imag = tmp_a_i - tmp_b_i; | |
1714 + tmp_a_r = buf[i+3].real; | |
1715 + tmp_a_i = buf[i+3].imag; | |
1716 + tmp_b_r = (buf[i+7].real - buf[i+7].imag) * w[2][3].imag; | |
1717 + tmp_b_i = (buf[i+7].imag + buf[i+7].real) * w[2][3].imag; | |
1718 + buf[i+3].real = tmp_a_r + tmp_b_r; | |
1719 + buf[i+3].imag = tmp_a_i + tmp_b_i; | |
1720 + buf[i+7].real = tmp_a_r - tmp_b_r; | |
1721 + buf[i+7].imag = tmp_a_i - tmp_b_i; | |
1722 +#else | |
1723 + vector float buf01, buf23, buf45, buf67; | |
1724 + | |
1725 + buf01 = vec_ld((i + 0) << 3, (float*)buf); | |
1726 + buf23 = vec_ld((i + 2) << 3, (float*)buf); | |
1727 + | |
1728 + tmp_b_r = (buf[i+5].real + buf[i+5].imag) * w[2][1].real; | |
1729 + tmp_b_i = (buf[i+5].imag - buf[i+5].real) * w[2][1].real; | |
1730 + buf[i+5].real = tmp_b_r; | |
1731 + buf[i+5].imag = tmp_b_i; | |
1732 + tmp_b_r = (buf[i+7].real - buf[i+7].imag) * w[2][3].imag; | |
1733 + tmp_b_i = (buf[i+7].imag + buf[i+7].real) * w[2][3].imag; | |
1734 + buf[i+7].real = tmp_b_r; | |
1735 + buf[i+7].imag = tmp_b_i; | |
1736 + | |
1737 + buf23 = vec_ld((i + 2) << 3, (float*)buf); | |
1738 + buf45 = vec_ld((i + 4) << 3, (float*)buf); | |
1739 + buf67 = vec_ld((i + 6) << 3, (float*)buf); | |
1740 + buf67 = vec_perm(buf67, buf67, vcprm(1,0,2,3)); | |
1741 + | |
1742 + vec_st(vec_add(buf01, buf45), (i + 0) << 3, (float*)buf); | |
1743 + vec_st(vec_madd(buf67, vcii(p,n,p,p), buf23), (i + 2) << 3, (float*)buf); | |
1744 + vec_st(vec_sub(buf01, buf45), (i + 4) << 3, (float*)buf); | |
1745 + vec_st(vec_nmsub(buf67, vcii(p,n,p,p), buf23), (i + 6) << 3, (float*)buf); | |
1746 +#endif | |
1747 + } | |
1748 + | |
1749 + /* 4-7. iterations */ | |
1750 + for (m=3; m < 7; m++) { | |
1751 + two_m = (1 << m); | |
1752 + | |
1753 + two_m_plus_one = two_m<<1; | |
1754 + | |
1755 + for(i = 0; i < 128; i += two_m_plus_one) { | |
1756 + for(k = 0; k < two_m; k+=2) { | |
1757 +#if 0 | |
1758 + int p = k + i; | |
1759 + int q = p + two_m; | |
1760 + tmp_a_r = buf[p].real; | |
1761 + tmp_a_i = buf[p].imag; | |
1762 + tmp_b_r = | |
1763 + buf[q].real * w[m][k].real - | |
1764 + buf[q].imag * w[m][k].imag; | |
1765 + tmp_b_i = | |
1766 + buf[q].imag * w[m][k].real + | |
1767 + buf[q].real * w[m][k].imag; | |
1768 + buf[p].real = tmp_a_r + tmp_b_r; | |
1769 + buf[p].imag = tmp_a_i + tmp_b_i; | |
1770 + buf[q].real = tmp_a_r - tmp_b_r; | |
1771 + buf[q].imag = tmp_a_i - tmp_b_i; | |
1772 + | |
1773 + tmp_a_r = buf[(p + 1)].real; | |
1774 + tmp_a_i = buf[(p + 1)].imag; | |
1775 + tmp_b_r = | |
1776 + buf[(q + 1)].real * w[m][(k + 1)].real - | |
1777 + buf[(q + 1)].imag * w[m][(k + 1)].imag; | |
1778 + tmp_b_i = | |
1779 + buf[(q + 1)].imag * w[m][(k + 1)].real + | |
1780 + buf[(q + 1)].real * w[m][(k + 1)].imag; | |
1781 + buf[(p + 1)].real = tmp_a_r + tmp_b_r; | |
1782 + buf[(p + 1)].imag = tmp_a_i + tmp_b_i; | |
1783 + buf[(q + 1)].real = tmp_a_r - tmp_b_r; | |
1784 + buf[(q + 1)].imag = tmp_a_i - tmp_b_i; | |
1785 +#else | |
1786 + int p = k + i; | |
1787 + int q = p + two_m; | |
1788 + vector float vecp, vecq, vecw, temp1, temp2, temp3, temp4; | |
1789 + const vector float vczero = (const vector float)FOUROF(0.); | |
1790 + // first compute buf[q] and buf[q+1] | |
1791 + vecq = vec_ld(q << 3, (float*)buf); | |
1792 + vecw = vec_ld(0, (float*)&(w[m][k])); | |
1793 + temp1 = vec_madd(vecq, vecw, vczero); | |
1794 + temp2 = vec_perm(vecq, vecq, vcprm(1,0,3,2)); | |
1795 + temp2 = vec_madd(temp2, vecw, vczero); | |
1796 + temp3 = vec_perm(temp1, temp2, vcprm(0,s0,2,s2)); | |
1797 + temp4 = vec_perm(temp1, temp2, vcprm(1,s1,3,s3)); | |
1798 + vecq = vec_madd(temp4, vcii(n,p,n,p), temp3); | |
1799 + // then butterfly with buf[p] and buf[p+1] | |
1800 + vecp = vec_ld(p << 3, (float*)buf); | |
1801 + | |
1802 + temp1 = vec_add(vecp, vecq); | |
1803 + temp2 = vec_sub(vecp, vecq); | |
1804 + | |
1805 + vec_st(temp1, p << 3, (float*)buf); | |
1806 + vec_st(temp2, q << 3, (float*)buf); | |
1807 +#endif | |
1808 + } | |
1809 + } | |
1810 + } | |
1811 + | |
1812 + /* Post IFFT complex multiply plus IFFT complex conjugate*/ | |
1813 + for( i=0; i < 128; i+=4) { | |
1814 + /* y[n] = z[n] * (xcos1[n] + j * xsin1[n]) ; */ | |
1815 +#if 0 | |
1816 + tmp_a_r = buf[(i + 0)].real; | |
1817 + tmp_a_i = -1.0 * buf[(i + 0)].imag; | |
1818 + buf[(i + 0)].real = | |
1819 + (tmp_a_r * xcos1[(i + 0)]) - (tmp_a_i * xsin1[(i + 0)]); | |
1820 + buf[(i + 0)].imag = | |
1821 + (tmp_a_r * xsin1[(i + 0)]) + (tmp_a_i * xcos1[(i + 0)]); | |
1822 + | |
1823 + tmp_a_r = buf[(i + 1)].real; | |
1824 + tmp_a_i = -1.0 * buf[(i + 1)].imag; | |
1825 + buf[(i + 1)].real = | |
1826 + (tmp_a_r * xcos1[(i + 1)]) - (tmp_a_i * xsin1[(i + 1)]); | |
1827 + buf[(i + 1)].imag = | |
1828 + (tmp_a_r * xsin1[(i + 1)]) + (tmp_a_i * xcos1[(i + 1)]); | |
1829 + | |
1830 + tmp_a_r = buf[(i + 2)].real; | |
1831 + tmp_a_i = -1.0 * buf[(i + 2)].imag; | |
1832 + buf[(i + 2)].real = | |
1833 + (tmp_a_r * xcos1[(i + 2)]) - (tmp_a_i * xsin1[(i + 2)]); | |
1834 + buf[(i + 2)].imag = | |
1835 + (tmp_a_r * xsin1[(i + 2)]) + (tmp_a_i * xcos1[(i + 2)]); | |
1836 + | |
1837 + tmp_a_r = buf[(i + 3)].real; | |
1838 + tmp_a_i = -1.0 * buf[(i + 3)].imag; | |
1839 + buf[(i + 3)].real = | |
1840 + (tmp_a_r * xcos1[(i + 3)]) - (tmp_a_i * xsin1[(i + 3)]); | |
1841 + buf[(i + 3)].imag = | |
1842 + (tmp_a_r * xsin1[(i + 3)]) + (tmp_a_i * xcos1[(i + 3)]); | |
1843 +#else | |
1844 + vector float bufv_0, bufv_2, cosv, sinv, temp1, temp2; | |
1845 + vector float temp0022, temp1133, tempCS01; | |
1846 + const vector float vczero = (const vector float)FOUROF(0.); | |
1847 + | |
1848 + bufv_0 = vec_ld((i + 0) << 3, (float*)buf); | |
1849 + bufv_2 = vec_ld((i + 2) << 3, (float*)buf); | |
1850 + | |
1851 + cosv = vec_ld(i << 2, xcos1); | |
1852 + sinv = vec_ld(i << 2, xsin1); | |
1853 + | |
1854 + temp0022 = vec_perm(bufv_0, bufv_0, vcprm(0,0,2,2)); | |
1855 + temp1133 = vec_perm(bufv_0, bufv_0, vcprm(1,1,3,3)); | |
1856 + tempCS01 = vec_perm(cosv, sinv, vcprm(0,s0,1,s1)); | |
1857 + temp1 = vec_madd(temp0022, tempCS01, vczero); | |
1858 + tempCS01 = vec_perm(cosv, sinv, vcprm(s0,0,s1,1)); | |
1859 + temp2 = vec_madd(temp1133, tempCS01, vczero); | |
1860 + bufv_0 = vec_madd(temp2, vcii(p,n,p,n), temp1); | |
1861 + | |
1862 + vec_st(bufv_0, (i + 0) << 3, (float*)buf); | |
1863 + | |
1864 + /* idem with bufv_2 and high-order cosv/sinv */ | |
1865 + | |
1866 + temp0022 = vec_perm(bufv_2, bufv_2, vcprm(0,0,2,2)); | |
1867 + temp1133 = vec_perm(bufv_2, bufv_2, vcprm(1,1,3,3)); | |
1868 + tempCS01 = vec_perm(cosv, sinv, vcprm(2,s2,3,s3)); | |
1869 + temp1 = vec_madd(temp0022, tempCS01, vczero); | |
1870 + tempCS01 = vec_perm(cosv, sinv, vcprm(s2,2,s3,3)); | |
1871 + temp2 = vec_madd(temp1133, tempCS01, vczero); | |
1872 + bufv_2 = vec_madd(temp2, vcii(p,n,p,n), temp1); | |
1873 + | |
1874 + vec_st(bufv_2, (i + 2) << 3, (float*)buf); | |
1875 + | |
1876 +#endif | |
1877 + } | |
1878 + | |
1879 + data_ptr = data; | |
1880 + delay_ptr = delay; | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1881 + window_ptr = a52_imdct_window; |
14990 | 1882 + |
1883 + /* Window and convert to real valued signal */ | |
1884 + for(i=0; i< 64; i++) { | |
1885 + *data_ptr++ = -buf[64+i].imag * *window_ptr++ + *delay_ptr++ + bias; | |
1886 + *data_ptr++ = buf[64-i-1].real * *window_ptr++ + *delay_ptr++ + bias; | |
1887 + } | |
1888 + | |
1889 + for(i=0; i< 64; i++) { | |
1890 + *data_ptr++ = -buf[i].real * *window_ptr++ + *delay_ptr++ + bias; | |
1891 + *data_ptr++ = buf[128-i-1].imag * *window_ptr++ + *delay_ptr++ + bias; | |
1892 + } | |
1893 + | |
1894 + /* The trailing edge of the window goes into the delay line */ | |
1895 + delay_ptr = delay; | |
1896 + | |
1897 + for(i=0; i< 64; i++) { | |
1898 + *delay_ptr++ = -buf[64+i].real * *--window_ptr; | |
1899 + *delay_ptr++ = buf[64-i-1].imag * *--window_ptr; | |
1900 + } | |
1901 + | |
1902 + for(i=0; i<64; i++) { | |
1903 + *delay_ptr++ = buf[i].imag * *--window_ptr; | |
1904 + *delay_ptr++ = -buf[128-i-1].real * *--window_ptr; | |
1905 + } | |
1906 +} | |
1907 +#endif | |
1908 + | |
1909 + | |
1910 +// Stuff below this line is borrowed from libac3 | |
1911 +#include "srfftp.h" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1912 +#if defined(ARCH_X86) || defined(ARCH_X86_64) |
14990 | 1913 +#ifndef HAVE_3DNOW |
1914 +#define HAVE_3DNOW 1 | |
1915 +#endif | |
1916 +#include "srfftp_3dnow.h" | |
1917 + | |
1918 +const i_cmplx_t x_plus_minus_3dnow __attribute__ ((aligned (8))) = {{ 0x00000000UL, 0x80000000UL }}; | |
1919 +const i_cmplx_t x_minus_plus_3dnow __attribute__ ((aligned (8))) = {{ 0x80000000UL, 0x00000000UL }}; | |
1920 +const complex_t HSQRT2_3DNOW __attribute__ ((aligned (8))) = { 0.707106781188, 0.707106781188 }; | |
1921 + | |
1922 +#undef HAVE_3DNOWEX | |
1923 +#include "imdct_3dnow.h" | |
1924 +#define HAVE_3DNOWEX | |
1925 +#include "imdct_3dnow.h" | |
1926 + | |
1927 +void | |
1928 +imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias) | |
1929 +{ | |
1930 +/* int i,k; | |
1931 + int p,q;*/ | |
1932 + int m; | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1933 + long two_m; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1934 + long two_m_plus_one; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1935 + long two_m_plus_one_shl3; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1936 + complex_t *buf_offset; |
14990 | 1937 + |
1938 +/* sample_t tmp_a_i; | |
1939 + sample_t tmp_a_r; | |
1940 + sample_t tmp_b_i; | |
1941 + sample_t tmp_b_r;*/ | |
1942 + | |
1943 + sample_t *data_ptr; | |
1944 + sample_t *delay_ptr; | |
1945 + sample_t *window_ptr; | |
1946 + | |
1947 + /* 512 IMDCT with source and dest data in 'data' */ | |
1948 + /* see the c version (dct_do_512()), its allmost identical, just in C */ | |
1949 + | |
1950 + /* Pre IFFT complex multiply plus IFFT cmplx conjugate */ | |
1951 + /* Bit reversed shuffling */ | |
1952 + asm volatile( | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1953 + "xor %%"REG_S", %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1954 + "lea "MANGLE(bit_reverse_512)", %%"REG_a"\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1955 + "mov $1008, %%"REG_D" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1956 + "push %%"REG_BP" \n\t" //use ebp without telling gcc |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1957 + ASMALIGN16 |
14990 | 1958 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1959 + "movlps (%0, %%"REG_S"), %%xmm0 \n\t" // XXXI |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1960 + "movhps 8(%0, %%"REG_D"), %%xmm0 \n\t" // RXXI |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1961 + "movlps 8(%0, %%"REG_S"), %%xmm1 \n\t" // XXXi |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1962 + "movhps (%0, %%"REG_D"), %%xmm1 \n\t" // rXXi |
14990 | 1963 + "shufps $0x33, %%xmm1, %%xmm0 \n\t" // irIR |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1964 + "movaps "MANGLE(sseSinCos1c)"(%%"REG_S"), %%xmm2\n\t" |
14990 | 1965 + "mulps %%xmm0, %%xmm2 \n\t" |
1966 + "shufps $0xB1, %%xmm0, %%xmm0 \n\t" // riRI | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1967 + "mulps "MANGLE(sseSinCos1d)"(%%"REG_S"), %%xmm0\n\t" |
14990 | 1968 + "subps %%xmm0, %%xmm2 \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1969 + "movzb (%%"REG_a"), %%"REG_d" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1970 + "movzb 1(%%"REG_a"), %%"REG_BP" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1971 + "movlps %%xmm2, (%1, %%"REG_d", 8) \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1972 + "movhps %%xmm2, (%1, %%"REG_BP", 8) \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1973 + "add $16, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1974 + "add $2, %%"REG_a" \n\t" // avoid complex addressing for P4 crap |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1975 + "sub $16, %%"REG_D" \n\t" |
18721
722ac20fac5f
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
18720
diff
changeset
|
1976 + "jnc 1b \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1977 + "pop %%"REG_BP" \n\t"//no we didnt touch ebp *g* |
14990 | 1978 + :: "b" (data), "c" (buf) |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
1979 + : "%"REG_S, "%"REG_D, "%"REG_a, "%"REG_d |
14990 | 1980 + ); |
1981 + | |
1982 + | |
1983 + /* FFT Merge */ | |
1984 +/* unoptimized variant | |
1985 + for (m=1; m < 7; m++) { | |
1986 + if(m) | |
1987 + two_m = (1 << m); | |
1988 + else | |
1989 + two_m = 1; | |
1990 + | |
1991 + two_m_plus_one = (1 << (m+1)); | |
1992 + | |
1993 + for(i = 0; i < 128; i += two_m_plus_one) { | |
1994 + for(k = 0; k < two_m; k++) { | |
1995 + p = k + i; | |
1996 + q = p + two_m; | |
1997 + tmp_a_r = buf[p].real; | |
1998 + tmp_a_i = buf[p].imag; | |
1999 + tmp_b_r = buf[q].real * w[m][k].real - buf[q].imag * w[m][k].imag; | |
2000 + tmp_b_i = buf[q].imag * w[m][k].real + buf[q].real * w[m][k].imag; | |
2001 + buf[p].real = tmp_a_r + tmp_b_r; | |
2002 + buf[p].imag = tmp_a_i + tmp_b_i; | |
2003 + buf[q].real = tmp_a_r - tmp_b_r; | |
2004 + buf[q].imag = tmp_a_i - tmp_b_i; | |
2005 + } | |
2006 + } | |
2007 + } | |
2008 +*/ | |
2009 + | |
2010 + /* 1. iteration */ | |
2011 + // Note w[0][0]={1,0} | |
2012 + asm volatile( | |
2013 + "xorps %%xmm1, %%xmm1 \n\t" | |
2014 + "xorps %%xmm2, %%xmm2 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2015 + "mov %0, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2016 + ASMALIGN16 |
14990 | 2017 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2018 + "movlps (%%"REG_S"), %%xmm0\n\t" //buf[p] |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2019 + "movlps 8(%%"REG_S"), %%xmm1\n\t" //buf[q] |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2020 + "movhps (%%"REG_S"), %%xmm0\n\t" //buf[p] |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2021 + "movhps 8(%%"REG_S"), %%xmm2\n\t" //buf[q] |
14990 | 2022 + "addps %%xmm1, %%xmm0 \n\t" |
2023 + "subps %%xmm2, %%xmm0 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2024 + "movaps %%xmm0, (%%"REG_S")\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2025 + "add $16, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2026 + "cmp %1, %%"REG_S" \n\t" |
14990 | 2027 + " jb 1b \n\t" |
2028 + :: "g" (buf), "r" (buf + 128) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2029 + : "%"REG_S |
14990 | 2030 + ); |
2031 + | |
2032 + /* 2. iteration */ | |
2033 + // Note w[1]={{1,0}, {0,-1}} | |
2034 + asm volatile( | |
2035 + "movaps "MANGLE(ps111_1)", %%xmm7\n\t" // 1,1,1,-1 | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2036 + "mov %0, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2037 + ASMALIGN16 |
14990 | 2038 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2039 + "movaps 16(%%"REG_S"), %%xmm2 \n\t" //r2,i2,r3,i3 |
14990 | 2040 + "shufps $0xB4, %%xmm2, %%xmm2 \n\t" //r2,i2,i3,r3 |
2041 + "mulps %%xmm7, %%xmm2 \n\t" //r2,i2,i3,-r3 | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2042 + "movaps (%%"REG_S"), %%xmm0 \n\t" //r0,i0,r1,i1 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2043 + "movaps (%%"REG_S"), %%xmm1 \n\t" //r0,i0,r1,i1 |
14990 | 2044 + "addps %%xmm2, %%xmm0 \n\t" |
2045 + "subps %%xmm2, %%xmm1 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2046 + "movaps %%xmm0, (%%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2047 + "movaps %%xmm1, 16(%%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2048 + "add $32, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2049 + "cmp %1, %%"REG_S" \n\t" |
14990 | 2050 + " jb 1b \n\t" |
2051 + :: "g" (buf), "r" (buf + 128) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2052 + : "%"REG_S |
14990 | 2053 + ); |
2054 + | |
2055 + /* 3. iteration */ | |
2056 +/* | |
2057 + Note sseW2+0={1,1,sqrt(2),sqrt(2)) | |
2058 + Note sseW2+16={0,0,sqrt(2),-sqrt(2)) | |
2059 + Note sseW2+32={0,0,-sqrt(2),-sqrt(2)) | |
2060 + Note sseW2+48={1,-1,sqrt(2),-sqrt(2)) | |
2061 +*/ | |
2062 + asm volatile( | |
2063 + "movaps 48+"MANGLE(sseW2)", %%xmm6\n\t" | |
2064 + "movaps 16+"MANGLE(sseW2)", %%xmm7\n\t" | |
2065 + "xorps %%xmm5, %%xmm5 \n\t" | |
2066 + "xorps %%xmm2, %%xmm2 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2067 + "mov %0, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2068 + ASMALIGN16 |
14990 | 2069 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2070 + "movaps 32(%%"REG_S"), %%xmm2 \n\t" //r4,i4,r5,i5 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2071 + "movaps 48(%%"REG_S"), %%xmm3 \n\t" //r6,i6,r7,i7 |
14990 | 2072 + "movaps "MANGLE(sseW2)", %%xmm4 \n\t" //r4,i4,r5,i5 |
2073 + "movaps 32+"MANGLE(sseW2)", %%xmm5\n\t" //r6,i6,r7,i7 | |
2074 + "mulps %%xmm2, %%xmm4 \n\t" | |
2075 + "mulps %%xmm3, %%xmm5 \n\t" | |
2076 + "shufps $0xB1, %%xmm2, %%xmm2 \n\t" //i4,r4,i5,r5 | |
2077 + "shufps $0xB1, %%xmm3, %%xmm3 \n\t" //i6,r6,i7,r7 | |
2078 + "mulps %%xmm6, %%xmm3 \n\t" | |
2079 + "mulps %%xmm7, %%xmm2 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2080 + "movaps (%%"REG_S"), %%xmm0 \n\t" //r0,i0,r1,i1 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2081 + "movaps 16(%%"REG_S"), %%xmm1 \n\t" //r2,i2,r3,i3 |
14990 | 2082 + "addps %%xmm4, %%xmm2 \n\t" |
2083 + "addps %%xmm5, %%xmm3 \n\t" | |
2084 + "movaps %%xmm2, %%xmm4 \n\t" | |
2085 + "movaps %%xmm3, %%xmm5 \n\t" | |
2086 + "addps %%xmm0, %%xmm2 \n\t" | |
2087 + "addps %%xmm1, %%xmm3 \n\t" | |
2088 + "subps %%xmm4, %%xmm0 \n\t" | |
2089 + "subps %%xmm5, %%xmm1 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2090 + "movaps %%xmm2, (%%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2091 + "movaps %%xmm3, 16(%%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2092 + "movaps %%xmm0, 32(%%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2093 + "movaps %%xmm1, 48(%%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2094 + "add $64, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2095 + "cmp %1, %%"REG_S" \n\t" |
14990 | 2096 + " jb 1b \n\t" |
2097 + :: "g" (buf), "r" (buf + 128) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2098 + : "%"REG_S |
14990 | 2099 + ); |
2100 + | |
2101 + /* 4-7. iterations */ | |
2102 + for (m=3; m < 7; m++) { | |
2103 + two_m = (1 << m); | |
2104 + two_m_plus_one = two_m<<1; | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2105 + two_m_plus_one_shl3 = (two_m_plus_one<<3); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2106 + buf_offset = buf+128; |
14990 | 2107 + asm volatile( |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2108 + "mov %0, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2109 + ASMALIGN16 |
14990 | 2110 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2111 + "xor %%"REG_D", %%"REG_D" \n\t" // k |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2112 + "lea (%%"REG_S", %3), %%"REG_d" \n\t" |
14990 | 2113 + "2: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2114 + "movaps (%%"REG_d", %%"REG_D"), %%xmm1 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2115 + "movaps (%4, %%"REG_D", 2), %%xmm2 \n\t" |
14990 | 2116 + "mulps %%xmm1, %%xmm2 \n\t" |
2117 + "shufps $0xB1, %%xmm1, %%xmm1 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2118 + "mulps 16(%4, %%"REG_D", 2), %%xmm1 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2119 + "movaps (%%"REG_S", %%"REG_D"), %%xmm0 \n\t" |
14990 | 2120 + "addps %%xmm2, %%xmm1 \n\t" |
2121 + "movaps %%xmm1, %%xmm2 \n\t" | |
2122 + "addps %%xmm0, %%xmm1 \n\t" | |
2123 + "subps %%xmm2, %%xmm0 \n\t" | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2124 + "movaps %%xmm1, (%%"REG_S", %%"REG_D") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2125 + "movaps %%xmm0, (%%"REG_d", %%"REG_D") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2126 + "add $16, %%"REG_D" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2127 + "cmp %3, %%"REG_D" \n\t" //FIXME (opt) count against 0 |
18721
722ac20fac5f
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
18720
diff
changeset
|
2128 + "jb 2b \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2129 + "add %2, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2130 + "cmp %1, %%"REG_S" \n\t" |
14990 | 2131 + " jb 1b \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2132 + :: "g" (buf), "m" (buf_offset), "m" (two_m_plus_one_shl3), "r" (two_m<<3), |
14990 | 2133 + "r" (sseW[m]) |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2134 + : "%"REG_S, "%"REG_D, "%"REG_d |
14990 | 2135 + ); |
2136 + } | |
2137 + | |
2138 + /* Post IFFT complex multiply plus IFFT complex conjugate*/ | |
2139 + asm volatile( | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2140 + "mov $-1024, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2141 + ASMALIGN16 |
14990 | 2142 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2143 + "movaps (%0, %%"REG_S"), %%xmm0 \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2144 + "movaps (%0, %%"REG_S"), %%xmm1 \n\t" |
14990 | 2145 + "shufps $0xB1, %%xmm0, %%xmm0 \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2146 + "mulps 1024+"MANGLE(sseSinCos1c)"(%%"REG_S"), %%xmm1\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2147 + "mulps 1024+"MANGLE(sseSinCos1d)"(%%"REG_S"), %%xmm0\n\t" |
14990 | 2148 + "addps %%xmm1, %%xmm0 \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2149 + "movaps %%xmm0, (%0, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2150 + "add $16, %%"REG_S" \n\t" |
14990 | 2151 + " jnz 1b \n\t" |
2152 + :: "r" (buf+128) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2153 + : "%"REG_S |
14990 | 2154 + ); |
2155 + | |
2156 + | |
2157 + data_ptr = data; | |
2158 + delay_ptr = delay; | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2159 + window_ptr = a52_imdct_window; |
14990 | 2160 + |
2161 + /* Window and convert to real valued signal */ | |
2162 + asm volatile( | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2163 + "xor %%"REG_D", %%"REG_D" \n\t" // 0 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2164 + "xor %%"REG_S", %%"REG_S" \n\t" // 0 |
14990 | 2165 + "movss %3, %%xmm2 \n\t" // bias |
2166 + "shufps $0x00, %%xmm2, %%xmm2 \n\t" // bias, bias, ... | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2167 + ASMALIGN16 |
14990 | 2168 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2169 + "movlps (%0, %%"REG_S"), %%xmm0 \n\t" // ? ? A ? |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2170 + "movlps 8(%0, %%"REG_S"), %%xmm1 \n\t" // ? ? C ? |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2171 + "movhps -16(%0, %%"REG_D"), %%xmm1 \n\t" // ? D C ? |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2172 + "movhps -8(%0, %%"REG_D"), %%xmm0 \n\t" // ? B A ? |
14990 | 2173 + "shufps $0x99, %%xmm1, %%xmm0 \n\t" // D C B A |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2174 + "mulps "MANGLE(sseWindow)"(%%"REG_S"), %%xmm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2175 + "addps (%2, %%"REG_S"), %%xmm0 \n\t" |
14990 | 2176 + "addps %%xmm2, %%xmm0 \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2177 + "movaps %%xmm0, (%1, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2178 + "add $16, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2179 + "sub $16, %%"REG_D" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2180 + "cmp $512, %%"REG_S" \n\t" |
14990 | 2181 + " jb 1b \n\t" |
2182 + :: "r" (buf+64), "r" (data_ptr), "r" (delay_ptr), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2183 + : "%"REG_S, "%"REG_D |
14990 | 2184 + ); |
2185 + data_ptr+=128; | |
2186 + delay_ptr+=128; | |
2187 +// window_ptr+=128; | |
2188 + | |
2189 + asm volatile( | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2190 + "mov $1024, %%"REG_D" \n\t" // 512 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2191 + "xor %%"REG_S", %%"REG_S" \n\t" // 0 |
14990 | 2192 + "movss %3, %%xmm2 \n\t" // bias |
2193 + "shufps $0x00, %%xmm2, %%xmm2 \n\t" // bias, bias, ... | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2194 + ASMALIGN16 |
14990 | 2195 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2196 + "movlps (%0, %%"REG_S"), %%xmm0 \n\t" // ? ? ? A |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2197 + "movlps 8(%0, %%"REG_S"), %%xmm1 \n\t" // ? ? ? C |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2198 + "movhps -16(%0, %%"REG_D"), %%xmm1 \n\t" // D ? ? C |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2199 + "movhps -8(%0, %%"REG_D"), %%xmm0 \n\t" // B ? ? A |
14990 | 2200 + "shufps $0xCC, %%xmm1, %%xmm0 \n\t" // D C B A |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2201 + "mulps 512+"MANGLE(sseWindow)"(%%"REG_S"), %%xmm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2202 + "addps (%2, %%"REG_S"), %%xmm0 \n\t" |
14990 | 2203 + "addps %%xmm2, %%xmm0 \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2204 + "movaps %%xmm0, (%1, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2205 + "add $16, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2206 + "sub $16, %%"REG_D" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2207 + "cmp $512, %%"REG_S" \n\t" |
14990 | 2208 + " jb 1b \n\t" |
2209 + :: "r" (buf), "r" (data_ptr), "r" (delay_ptr), "m" (bias) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2210 + : "%"REG_S, "%"REG_D |
14990 | 2211 + ); |
2212 + data_ptr+=128; | |
2213 +// window_ptr+=128; | |
2214 + | |
2215 + /* The trailing edge of the window goes into the delay line */ | |
2216 + delay_ptr = delay; | |
2217 + | |
2218 + asm volatile( | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2219 + "xor %%"REG_D", %%"REG_D" \n\t" // 0 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2220 + "xor %%"REG_S", %%"REG_S" \n\t" // 0 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2221 + ASMALIGN16 |
14990 | 2222 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2223 + "movlps (%0, %%"REG_S"), %%xmm0 \n\t" // ? ? ? A |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2224 + "movlps 8(%0, %%"REG_S"), %%xmm1 \n\t" // ? ? ? C |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2225 + "movhps -16(%0, %%"REG_D"), %%xmm1 \n\t" // D ? ? C |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2226 + "movhps -8(%0, %%"REG_D"), %%xmm0 \n\t" // B ? ? A |
14990 | 2227 + "shufps $0xCC, %%xmm1, %%xmm0 \n\t" // D C B A |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2228 + "mulps 1024+"MANGLE(sseWindow)"(%%"REG_S"), %%xmm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2229 + "movaps %%xmm0, (%1, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2230 + "add $16, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2231 + "sub $16, %%"REG_D" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2232 + "cmp $512, %%"REG_S" \n\t" |
14990 | 2233 + " jb 1b \n\t" |
2234 + :: "r" (buf+64), "r" (delay_ptr) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2235 + : "%"REG_S, "%"REG_D |
14990 | 2236 + ); |
2237 + delay_ptr+=128; | |
2238 +// window_ptr-=128; | |
2239 + | |
2240 + asm volatile( | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2241 + "mov $1024, %%"REG_D" \n\t" // 1024 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2242 + "xor %%"REG_S", %%"REG_S" \n\t" // 0 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2243 + ASMALIGN16 |
14990 | 2244 + "1: \n\t" |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2245 + "movlps (%0, %%"REG_S"), %%xmm0 \n\t" // ? ? A ? |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2246 + "movlps 8(%0, %%"REG_S"), %%xmm1 \n\t" // ? ? C ? |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2247 + "movhps -16(%0, %%"REG_D"), %%xmm1 \n\t" // ? D C ? |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2248 + "movhps -8(%0, %%"REG_D"), %%xmm0 \n\t" // ? B A ? |
14990 | 2249 + "shufps $0x99, %%xmm1, %%xmm0 \n\t" // D C B A |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2250 + "mulps 1536+"MANGLE(sseWindow)"(%%"REG_S"), %%xmm0\n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2251 + "movaps %%xmm0, (%1, %%"REG_S") \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2252 + "add $16, %%"REG_S" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2253 + "sub $16, %%"REG_D" \n\t" |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2254 + "cmp $512, %%"REG_S" \n\t" |
14990 | 2255 + " jb 1b \n\t" |
2256 + :: "r" (buf), "r" (delay_ptr) | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2257 + : "%"REG_S, "%"REG_D |
14990 | 2258 + ); |
2259 +} | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2260 +#endif // ARCH_X86 || ARCH_X86_64 |
14990 | 2261 + |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2262 void a52_imdct_256(sample_t * data, sample_t * delay, sample_t bias) |
14990 | 2263 { |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2264 int i, k; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2265 @@ -368,7 +1153,7 @@ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2266 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2267 void a52_imdct_init (uint32_t mm_accel) |
18721
722ac20fac5f
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
18720
diff
changeset
|
2268 { |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2269 - int i, k; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2270 + int i, j, k; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2271 double sum; |
14990 | 2272 |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2273 /* compute imdct window - kaiser-bessel derived window, alpha = 5.0 */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2274 @@ -420,6 +1205,99 @@ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2275 post2[i].real = cos ((M_PI / 128) * (i + 0.5)); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2276 post2[i].imag = sin ((M_PI / 128) * (i + 0.5)); |
18721
722ac20fac5f
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
18720
diff
changeset
|
2277 } |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2278 + for (i = 0; i < 128; i++) { |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2279 + xcos1[i] = -cos ((M_PI / 2048) * (8 * i + 1)); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2280 + xsin1[i] = -sin ((M_PI / 2048) * (8 * i + 1)); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2281 + } |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2282 + for (i = 0; i < 7; i++) { |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2283 + j = 1 << i; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2284 + for (k = 0; k < j; k++) { |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2285 + w[i][k].real = cos (-M_PI * k / j); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2286 + w[i][k].imag = sin (-M_PI * k / j); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2287 + } |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2288 + } |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2289 +#if defined(ARCH_X86) || defined(ARCH_X86_64) |
14990 | 2290 + for (i = 0; i < 128; i++) { |
2291 + sseSinCos1c[2*i+0]= xcos1[i]; | |
2292 + sseSinCos1c[2*i+1]= -xcos1[i]; | |
2293 + sseSinCos1d[2*i+0]= xsin1[i]; | |
2294 + sseSinCos1d[2*i+1]= xsin1[i]; | |
2295 + } | |
2296 + for (i = 1; i < 7; i++) { | |
2297 + j = 1 << i; | |
2298 + for (k = 0; k < j; k+=2) { | |
2299 + | |
2300 + sseW[i][4*k + 0] = w[i][k+0].real; | |
2301 + sseW[i][4*k + 1] = w[i][k+0].real; | |
2302 + sseW[i][4*k + 2] = w[i][k+1].real; | |
2303 + sseW[i][4*k + 3] = w[i][k+1].real; | |
2304 + | |
2305 + sseW[i][4*k + 4] = -w[i][k+0].imag; | |
2306 + sseW[i][4*k + 5] = w[i][k+0].imag; | |
2307 + sseW[i][4*k + 6] = -w[i][k+1].imag; | |
2308 + sseW[i][4*k + 7] = w[i][k+1].imag; | |
2309 + | |
2310 + //we multiply more or less uninitalized numbers so we need to use exactly 0.0 | |
2311 + if(k==0) | |
2312 + { | |
2313 +// sseW[i][4*k + 0]= sseW[i][4*k + 1]= 1.0; | |
2314 + sseW[i][4*k + 4]= sseW[i][4*k + 5]= 0.0; | |
2315 + } | |
2316 + | |
2317 + if(2*k == j) | |
2318 + { | |
2319 + sseW[i][4*k + 0]= sseW[i][4*k + 1]= 0.0; | |
2320 +// sseW[i][4*k + 4]= -(sseW[i][4*k + 5]= -1.0); | |
2321 + } | |
2322 + } | |
2323 + } | |
2324 + | |
2325 + for(i=0; i<128; i++) | |
2326 + { | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2327 + sseWindow[2*i+0]= -a52_imdct_window[2*i+0]; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2328 + sseWindow[2*i+1]= a52_imdct_window[2*i+1]; |
14990 | 2329 + } |
2330 + | |
2331 + for(i=0; i<64; i++) | |
2332 + { | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2333 + sseWindow[256 + 2*i+0]= -a52_imdct_window[254 - 2*i+1]; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2334 + sseWindow[256 + 2*i+1]= a52_imdct_window[254 - 2*i+0]; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2335 + sseWindow[384 + 2*i+0]= a52_imdct_window[126 - 2*i+1]; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2336 + sseWindow[384 + 2*i+1]= -a52_imdct_window[126 - 2*i+0]; |
14990 | 2337 + } |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2338 +#endif |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2339 + a52_imdct_512 = imdct_do_512; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2340 + ifft128 = ifft128_c; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2341 + ifft64 = ifft64_c; |
14990 | 2342 + |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2343 +#if defined(ARCH_X86) || defined(ARCH_X86_64) |
14990 | 2344 + if(mm_accel & MM_ACCEL_X86_SSE) |
2345 + { | |
2346 + fprintf (stderr, "Using SSE optimized IMDCT transform\n"); | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2347 + a52_imdct_512 = imdct_do_512_sse; |
18721
722ac20fac5f
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
18720
diff
changeset
|
2348 + } |
14990 | 2349 + else |
2350 + if(mm_accel & MM_ACCEL_X86_3DNOWEXT) | |
2351 + { | |
2352 + fprintf (stderr, "Using 3DNowEx optimized IMDCT transform\n"); | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2353 + a52_imdct_512 = imdct_do_512_3dnowex; |
14990 | 2354 + } |
2355 + else | |
2356 + if(mm_accel & MM_ACCEL_X86_3DNOW) | |
2357 + { | |
2358 + fprintf (stderr, "Using 3DNow optimized IMDCT transform\n"); | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2359 + a52_imdct_512 = imdct_do_512_3dnow; |
14990 | 2360 + } |
2361 + else | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2362 +#endif // ARCH_X86 || ARCH_X86_64 |
14990 | 2363 +#ifdef HAVE_ALTIVEC |
2364 + if (mm_accel & MM_ACCEL_PPC_ALTIVEC) | |
2365 + { | |
2366 + fprintf(stderr, "Using AltiVec optimized IMDCT transform\n"); | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2367 + a52_imdct_512 = imdct_do_512_altivec; |
14990 | 2368 + } |
18721
722ac20fac5f
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
18720
diff
changeset
|
2369 + else |
14990 | 2370 +#endif |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2371 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2372 #ifdef LIBA52_DJBFFT |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2373 if (mm_accel & MM_ACCEL_DJBFFT) { |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2374 @@ -430,7 +1308,5 @@ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2375 #endif |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2376 { |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2377 fprintf (stderr, "No accelerated IMDCT transform found\n"); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2378 - ifft128 = ifft128_c; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2379 - ifft64 = ifft64_c; |
14990 | 2380 } |
2381 } | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2382 --- liba52-0.7.4/mm_accel.h 2006-06-12 15:05:00.000000000 +0200 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2383 +++ liba52/mm_accel.h 2006-06-05 02:23:04.000000000 +0200 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2384 @@ -30,7 +34,12 @@ |
14990 | 2385 /* x86 accelerations */ |
2386 #define MM_ACCEL_X86_MMX 0x80000000 | |
2387 #define MM_ACCEL_X86_3DNOW 0x40000000 | |
2388 +#define MM_ACCEL_X86_3DNOWEXT 0x08000000 | |
2389 #define MM_ACCEL_X86_MMXEXT 0x20000000 | |
2390 +#define MM_ACCEL_X86_SSE 0x10000000 | |
2391 + | |
2392 +/* PPC accelerations */ | |
2393 +#define MM_ACCEL_PPC_ALTIVEC 0x00010000 | |
2394 | |
2395 uint32_t mm_accel (void); | |
2396 | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2397 --- liba52-0.7.4/parse.c 2006-06-12 15:05:07.000000000 +0200 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2398 +++ liba52/parse.c 2006-06-12 14:51:33.000000000 +0200 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2399 @@ -24,6 +28,7 @@ |
14990 | 2400 #include "config.h" |
2401 | |
2402 #include <stdlib.h> | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2403 +#include <stdio.h> |
14990 | 2404 #include <string.h> |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2405 #include <inttypes.h> |
14990 | 2406 |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2407 @@ -31,13 +36,11 @@ |
14990 | 2408 #include "a52_internal.h" |
2409 #include "bitstream.h" | |
2410 #include "tables.h" | |
2411 +#include "mm_accel.h" | |
2412 | |
2413 #ifdef HAVE_MEMALIGN | |
2414 /* some systems have memalign() but no declaration for it */ | |
2415 void * memalign (size_t align, size_t size); | |
2416 -#else | |
2417 -/* assume malloc alignment is sufficient */ | |
2418 -#define memalign(align,size) malloc (size) | |
2419 #endif | |
2420 | |
2421 typedef struct { | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2422 @@ -61,6 +64,21 @@ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2423 return NULL; |
14990 | 2424 |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2425 state->samples = memalign (16, 256 * 12 * sizeof (sample_t)); |
14990 | 2426 +#if defined(__MINGW32__) && defined(HAVE_SSE) |
2427 + for(i=0;i<10;i++){ | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2428 + if((int)state->samples%16){ |
14990 | 2429 + sample_t* samplestmp=malloc(256 * 12 * sizeof (sample_t)); |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2430 + free(state->samples); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2431 + state->samples = samplestmp; |
14990 | 2432 + } |
2433 + else break; | |
2434 + } | |
2435 +#endif | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2436 + if(((int)state->samples%16) && (mm_accel&MM_ACCEL_X86_SSE)){ |
14990 | 2437 + mm_accel &=~MM_ACCEL_X86_SSE; |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2438 + fprintf(stderr, "liba52: unable to get 16 byte aligned memory disabling usage of SSE instructions\n"); |
14990 | 2439 + } |
18721
722ac20fac5f
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
18720
diff
changeset
|
2440 + |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2441 if (state->samples == NULL) { |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2442 free (state); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2443 return NULL; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2444 @@ -74,6 +92,7 @@ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2445 state->lfsr_state = 1; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2446 |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2447 a52_imdct_init (mm_accel); |
14990 | 2448 + downmix_accel_init(mm_accel); |
2449 | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2450 return state; |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2451 } |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2452 @@ -141,7 +160,7 @@ |
14990 | 2453 state->acmod = acmod = buf[6] >> 5; |
2454 | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2455 a52_bitstream_set_ptr (state, buf + 6); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2456 - bitstream_get (state, 3); /* skip acmod we already parsed */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2457 + bitstream_skip (state, 3); /* skip acmod we already parsed */ |
14990 | 2458 |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2459 if ((acmod == 2) && (bitstream_get (state, 2) == 2)) /* dsurmod */ |
14990 | 2460 acmod = A52_DOLBY; |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2461 @@ -172,28 +191,28 @@ |
14990 | 2462 |
2463 chaninfo = !acmod; | |
2464 do { | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2465 - bitstream_get (state, 5); /* dialnorm */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2466 + bitstream_skip (state, 5); /* dialnorm */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2467 if (bitstream_get (state, 1)) /* compre */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2468 - bitstream_get (state, 8); /* compr */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2469 + bitstream_skip (state, 8); /* compr */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2470 if (bitstream_get (state, 1)) /* langcode */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2471 - bitstream_get (state, 8); /* langcod */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2472 + bitstream_skip (state, 8); /* langcod */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2473 if (bitstream_get (state, 1)) /* audprodie */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2474 - bitstream_get (state, 7); /* mixlevel + roomtyp */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2475 + bitstream_skip (state, 7); /* mixlevel + roomtyp */ |
14990 | 2476 } while (chaninfo--); |
2477 | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2478 - bitstream_get (state, 2); /* copyrightb + origbs */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2479 + bitstream_skip (state, 2); /* copyrightb + origbs */ |
14990 | 2480 |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2481 if (bitstream_get (state, 1)) /* timecod1e */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2482 - bitstream_get (state, 14); /* timecod1 */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2483 + bitstream_skip (state, 14); /* timecod1 */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2484 if (bitstream_get (state, 1)) /* timecod2e */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2485 - bitstream_get (state, 14); /* timecod2 */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2486 + bitstream_skip (state, 14); /* timecod2 */ |
14990 | 2487 |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2488 if (bitstream_get (state, 1)) { /* addbsie */ |
14990 | 2489 int addbsil; |
2490 | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2491 addbsil = bitstream_get (state, 6); |
14990 | 2492 do { |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2493 - bitstream_get (state, 8); /* addbsi */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2494 + bitstream_skip (state, 8); /* addbsi */ |
14990 | 2495 } while (addbsil--); |
2496 } | |
2497 | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2498 @@ -680,7 +699,7 @@ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2499 state->fbw_expbap[i].exp[0], |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2500 state->fbw_expbap[i].exp + 1)) |
14990 | 2501 return 1; |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2502 - bitstream_get (state, 2); /* gainrng */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2503 + bitstream_skip (state, 2); /* gainrng */ |
14990 | 2504 } |
2505 if (lfeexpstr != EXP_REUSE) { | |
2506 do_bit_alloc |= 32; | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2507 @@ -755,7 +774,7 @@ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2508 if (bitstream_get (state, 1)) { /* skiple */ |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2509 i = bitstream_get (state, 9); /* skipl */ |
14990 | 2510 while (i--) |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2511 - bitstream_get (state, 8); |
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2512 + bitstream_skip (state, 8); |
14990 | 2513 } |
2514 | |
18720
4bad7f00556e
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents:
14990
diff
changeset
|
2515 samples = state->samples; |