39 #define MACS(rt, ra, rb) rt+=(ra)*(rb)
40 #define MLSS(rt, ra, rb) rt-=(ra)*(rb)
42 #define SUM8(op, sum, w, p) \
44 op(sum, (w)[0 * 64], (p)[0 * 64]); \
45 op(sum, (w)[1 * 64], (p)[1 * 64]); \
46 op(sum, (w)[2 * 64], (p)[2 * 64]); \
47 op(sum, (w)[3 * 64], (p)[3 * 64]); \
48 op(sum, (w)[4 * 64], (p)[4 * 64]); \
49 op(sum, (w)[5 * 64], (p)[5 * 64]); \
50 op(sum, (w)[6 * 64], (p)[6 * 64]); \
51 op(sum, (w)[7 * 64], (p)[7 * 64]); \
55 const float *win2,
float *sum1,
float *sum2,
int len)
58 const float *win1a = win1+
len;
59 const float *win2a = win2+
len;
60 const float *bufa = buf+
len;
61 float *sum1a = sum1+
len;
62 float *sum2a = sum2+
len;
66 "movaps " #a "(%1,%0), %%xmm1 \n\t" \
67 "movaps " #a "(%3,%0), %%xmm2 \n\t" \
68 "mulps %%xmm2, %%xmm1 \n\t" \
69 "subps %%xmm1, %%xmm0 \n\t" \
70 "mulps " #b "(%2,%0), %%xmm2 \n\t" \
71 "subps %%xmm2, %%xmm4 \n\t" \
75 "xorps %%xmm0, %%xmm0 \n\t"
76 "xorps %%xmm4, %%xmm4 \n\t"
87 "movaps %%xmm0, (%4,%0) \n\t"
88 "movaps %%xmm4, (%5,%0) \n\t"
92 :
"r"(win1a),
"r"(win2a),
"r"(bufa),
"r"(sum1a),
"r"(sum2a)
109 memcpy(in + 512, in, 32 *
sizeof(*in));
112 apply_window(in + 32, win + 48, win + 640, sumb, sumd, 16);
114 SUM8(
MACS, suma[0], win + 32, in + 48);
120 #define SUMS(suma, sumb, sumc, sumd, out1, out2) \
121 "movups " #sumd "(%4), %%xmm0 \n\t" \
122 "shufps $0x1b, %%xmm0, %%xmm0 \n\t" \
123 "subps " #suma "(%1), %%xmm0 \n\t" \
124 "movaps %%xmm0," #out1 "(%0) \n\t" \
126 "movups " #sumc "(%3), %%xmm0 \n\t" \
127 "shufps $0x1b, %%xmm0, %%xmm0 \n\t" \
128 "addps " #sumb "(%2), %%xmm0 \n\t" \
129 "movaps %%xmm0," #out2 "(%0) \n\t"
133 SUMS( 0, 48, 4, 52, 0, 112)
134 SUMS(16, 32, 20, 36, 16, 96)
135 SUMS(32, 16, 36, 20, 32, 80)
136 SUMS(48, 0, 52, 4, 48, 64)
139 :
"r"(&suma[0]),
"r"(&sumb[0]),
"r"(&sumc[0]),
"r"(&sumd[0])
145 float *out2 = out + 32 * incr;
150 *out = -suma[ j] + sumd[16-j];
151 *out2 = sumb[16-j] + sumc[ j];
158 SUM8(
MLSS, sum, win + 16 + 32, in + 32);
164 #define DECL_IMDCT_BLOCKS(CPU1, CPU2) \
165 static void imdct36_blocks_ ## CPU1(float *out, float *buf, float *in, \
166 int count, int switch_point, int block_type) \
168 int align_end = count - (count & 3); \
170 for (j = 0; j < align_end; j+= 4) { \
171 LOCAL_ALIGNED_16(float, tmpbuf, [1024]); \
172 float *win = mdct_win_sse[switch_point && j < 4][block_type]; \
176 ff_four_imdct36_float_ ## CPU2(out, buf, in, win, tmpbuf); \
181 for (; j < count; j++) { \
185 int win_idx = (switch_point && j < 2) ? 0 : block_type; \
186 float *win = ff_mdct_win_float[win_idx + (4 & -(j & 1))]; \
188 ff_imdct36_float_ ## CPU1(out, buf, in, win); \
196 DECL_IMDCT_BLOCKS(
sse,
sse)
197 DECL_IMDCT_BLOCKS(sse2,
sse)
198 DECL_IMDCT_BLOCKS(sse3,
sse)
199 DECL_IMDCT_BLOCKS(ssse3,
sse)
200 DECL_IMDCT_BLOCKS(avx,avx)
208 for (j = 0; j < 4; j++) {
209 for (i = 0; i < 40; i ++) {
232 }
else if (mm_flags & AV_CPU_FLAG_SSE2) {