annotate liba52/liba52_changes.diff @ 20931:0cc7dfcb2e3b

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