Mercurial > libavcodec.hg
annotate i386/dsputil_mmx.c @ 954:13aec7e50c52 libavcodec
qpel in mmx2/3dnow
qpel refinement quality parameter
author | michaelni |
---|---|
date | Sun, 05 Jan 2003 15:57:10 +0000 |
parents | caa77cd960c0 |
children | 9bb668034ecf |
rev | line source |
---|---|
0 | 1 /* |
2 * MMX optimized DSP utils | |
429 | 3 * Copyright (c) 2000, 2001 Fabrice Bellard. |
0 | 4 * |
429 | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Lesser General Public | |
7 * License as published by the Free Software Foundation; either | |
8 * version 2 of the License, or (at your option) any later version. | |
0 | 9 * |
429 | 10 * This library is distributed in the hope that it will be useful, |
0 | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
429 | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Lesser General Public License for more details. | |
0 | 14 * |
429 | 15 * You should have received a copy of the GNU Lesser General Public |
16 * License along with this library; if not, write to the Free Software | |
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
0 | 18 * |
19 * MMX optimization by Nick Kurshev <nickols_k@mail.ru> | |
20 */ | |
21 | |
22 #include "../dsputil.h" | |
23 | |
5 | 24 int mm_flags; /* multimedia extension flags */ |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
25 /* FIXME use them in static form */ |
294 | 26 int pix_abs16x16_mmx(UINT8 *blk1, UINT8 *blk2, int lx); |
27 int pix_abs16x16_x2_mmx(UINT8 *blk1, UINT8 *blk2, int lx); | |
28 int pix_abs16x16_y2_mmx(UINT8 *blk1, UINT8 *blk2, int lx); | |
29 int pix_abs16x16_xy2_mmx(UINT8 *blk1, UINT8 *blk2, int lx); | |
30 | |
31 int pix_abs16x16_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); | |
32 int pix_abs16x16_x2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); | |
33 int pix_abs16x16_y2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); | |
34 int pix_abs16x16_xy2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); | |
35 | |
36 int pix_abs8x8_mmx(UINT8 *blk1, UINT8 *blk2, int lx); | |
37 int pix_abs8x8_x2_mmx(UINT8 *blk1, UINT8 *blk2, int lx); | |
38 int pix_abs8x8_y2_mmx(UINT8 *blk1, UINT8 *blk2, int lx); | |
39 int pix_abs8x8_xy2_mmx(UINT8 *blk1, UINT8 *blk2, int lx); | |
40 | |
41 int pix_abs8x8_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); | |
42 int pix_abs8x8_x2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); | |
43 int pix_abs8x8_y2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); | |
44 int pix_abs8x8_xy2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); | |
45 | |
936 | 46 int sad16x16_mmx(void *s, UINT8 *blk1, UINT8 *blk2, int lx); |
47 int sad8x8_mmx(void *s, UINT8 *blk1, UINT8 *blk2, int lx); | |
48 int sad16x16_mmx2(void *s, UINT8 *blk1, UINT8 *blk2, int lx); | |
49 int sad8x8_mmx2(void *s, UINT8 *blk1, UINT8 *blk2, int lx); | |
50 | |
0 | 51 /* pixel operations */ |
387 | 52 static const uint64_t mm_bone __attribute__ ((aligned(8))) = 0x0101010101010101ULL; |
53 static const uint64_t mm_wone __attribute__ ((aligned(8))) = 0x0001000100010001ULL; | |
54 static const uint64_t mm_wtwo __attribute__ ((aligned(8))) = 0x0002000200020002ULL; | |
0 | 55 |
954 | 56 static const uint64_t ff_pw_20 __attribute__ ((aligned(8))) = 0x0014001400140014ULL; |
57 static const uint64_t ff_pw_3 __attribute__ ((aligned(8))) = 0x0003000300030003ULL; | |
58 static const uint64_t ff_pw_16 __attribute__ ((aligned(8))) = 0x0010001000100010ULL; | |
59 static const uint64_t ff_pw_15 __attribute__ ((aligned(8))) = 0x000F000F000F000FULL; | |
60 | |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
61 #define JUMPALIGN() __asm __volatile (".balign 8"::) |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
62 #define MOVQ_ZERO(regd) __asm __volatile ("pxor %%" #regd ", %%" #regd ::) |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
63 |
448 | 64 #define MOVQ_WONE(regd) \ |
65 __asm __volatile ( \ | |
66 "pcmpeqd %%" #regd ", %%" #regd " \n\t" \ | |
67 "psrlw $15, %%" #regd ::) | |
68 | |
69 #define MOVQ_BFE(regd) \ | |
70 __asm __volatile ( \ | |
71 "pcmpeqd %%" #regd ", %%" #regd " \n\t"\ | |
72 "paddb %%" #regd ", %%" #regd " \n\t" ::) | |
73 | |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
74 #ifndef PIC |
448 | 75 #define MOVQ_BONE(regd) __asm __volatile ("movq %0, %%" #regd " \n\t" ::"m"(mm_bone)) |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
76 #define MOVQ_WTWO(regd) __asm __volatile ("movq %0, %%" #regd " \n\t" ::"m"(mm_wtwo)) |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
77 #else |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
78 // for shared library it's better to use this way for accessing constants |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
79 // pcmpeqd -> -1 |
448 | 80 #define MOVQ_BONE(regd) \ |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
81 __asm __volatile ( \ |
448 | 82 "pcmpeqd %%" #regd ", %%" #regd " \n\t" \ |
83 "psrlw $15, %%" #regd " \n\t" \ | |
84 "packuswb %%" #regd ", %%" #regd " \n\t" ::) | |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
85 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
86 #define MOVQ_WTWO(regd) \ |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
87 __asm __volatile ( \ |
448 | 88 "pcmpeqd %%" #regd ", %%" #regd " \n\t" \ |
89 "psrlw $15, %%" #regd " \n\t" \ | |
90 "psllw $1, %%" #regd " \n\t"::) | |
387 | 91 |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
92 #endif |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
93 |
448 | 94 // using regr as temporary and for the output result |
444
a5edef76dac6
* new mmx code - based upon http://aggregate.org/MAGIC
kabi
parents:
438
diff
changeset
|
95 // first argument is unmodifed and second is trashed |
471 | 96 // regfe is supposed to contain 0xfefefefefefefefe |
97 #define PAVGB_MMX_NO_RND(rega, regb, regr, regfe) \ | |
445
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
98 "movq " #rega ", " #regr " \n\t"\ |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
99 "pand " #regb ", " #regr " \n\t"\ |
444
a5edef76dac6
* new mmx code - based upon http://aggregate.org/MAGIC
kabi
parents:
438
diff
changeset
|
100 "pxor " #rega ", " #regb " \n\t"\ |
471 | 101 "pand " #regfe "," #regb " \n\t"\ |
444
a5edef76dac6
* new mmx code - based upon http://aggregate.org/MAGIC
kabi
parents:
438
diff
changeset
|
102 "psrlq $1, " #regb " \n\t"\ |
445
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
103 "paddb " #regb ", " #regr " \n\t" |
444
a5edef76dac6
* new mmx code - based upon http://aggregate.org/MAGIC
kabi
parents:
438
diff
changeset
|
104 |
471 | 105 #define PAVGB_MMX(rega, regb, regr, regfe) \ |
445
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
106 "movq " #rega ", " #regr " \n\t"\ |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
107 "por " #regb ", " #regr " \n\t"\ |
444
a5edef76dac6
* new mmx code - based upon http://aggregate.org/MAGIC
kabi
parents:
438
diff
changeset
|
108 "pxor " #rega ", " #regb " \n\t"\ |
471 | 109 "pand " #regfe "," #regb " \n\t"\ |
444
a5edef76dac6
* new mmx code - based upon http://aggregate.org/MAGIC
kabi
parents:
438
diff
changeset
|
110 "psrlq $1, " #regb " \n\t"\ |
445
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
111 "psubb " #regb ", " #regr " \n\t" |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
112 |
471 | 113 // mm6 is supposed to contain 0xfefefefefefefefe |
446
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
114 #define PAVGBP_MMX_NO_RND(rega, regb, regr, regc, regd, regp) \ |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
115 "movq " #rega ", " #regr " \n\t"\ |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
116 "movq " #regc ", " #regp " \n\t"\ |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
117 "pand " #regb ", " #regr " \n\t"\ |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
118 "pand " #regd ", " #regp " \n\t"\ |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
119 "pxor " #rega ", " #regb " \n\t"\ |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
120 "pxor " #regc ", " #regd " \n\t"\ |
448 | 121 "pand %%mm6, " #regb " \n\t"\ |
122 "pand %%mm6, " #regd " \n\t"\ | |
446
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
123 "psrlq $1, " #regb " \n\t"\ |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
124 "psrlq $1, " #regd " \n\t"\ |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
125 "paddb " #regb ", " #regr " \n\t"\ |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
126 "paddb " #regd ", " #regp " \n\t" |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
127 |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
128 #define PAVGBP_MMX(rega, regb, regr, regc, regd, regp) \ |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
129 "movq " #rega ", " #regr " \n\t"\ |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
130 "movq " #regc ", " #regp " \n\t"\ |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
131 "por " #regb ", " #regr " \n\t"\ |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
132 "por " #regd ", " #regp " \n\t"\ |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
133 "pxor " #rega ", " #regb " \n\t"\ |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
134 "pxor " #regc ", " #regd " \n\t"\ |
448 | 135 "pand %%mm6, " #regb " \n\t"\ |
136 "pand %%mm6, " #regd " \n\t"\ | |
446
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
137 "psrlq $1, " #regd " \n\t"\ |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
138 "psrlq $1, " #regb " \n\t"\ |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
139 "psubb " #regb ", " #regr " \n\t"\ |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
140 "psubb " #regd ", " #regp " \n\t" |
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
141 |
445
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
142 /***********************************/ |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
143 /* MMX no rounding */ |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
144 #define DEF(x, y) x ## _no_rnd_ ## y ##_mmx |
448 | 145 #define SET_RND MOVQ_WONE |
146 #define PAVGBP(a, b, c, d, e, f) PAVGBP_MMX_NO_RND(a, b, c, d, e, f) | |
471 | 147 #define PAVGB(a, b, c, e) PAVGB_MMX_NO_RND(a, b, c, e) |
445
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
148 |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
149 #include "dsputil_mmx_rnd.h" |
444
a5edef76dac6
* new mmx code - based upon http://aggregate.org/MAGIC
kabi
parents:
438
diff
changeset
|
150 |
445
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
151 #undef DEF |
448 | 152 #undef SET_RND |
446
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
153 #undef PAVGBP |
471 | 154 #undef PAVGB |
445
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
155 /***********************************/ |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
156 /* MMX rounding */ |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
157 |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
158 #define DEF(x, y) x ## _ ## y ##_mmx |
448 | 159 #define SET_RND MOVQ_WTWO |
160 #define PAVGBP(a, b, c, d, e, f) PAVGBP_MMX(a, b, c, d, e, f) | |
471 | 161 #define PAVGB(a, b, c, e) PAVGB_MMX(a, b, c, e) |
445
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
162 |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
163 #include "dsputil_mmx_rnd.h" |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
164 |
62c01dbdc1e0
* code with new PAVGB for MMX only CPU splited into separate file
kabi
parents:
444
diff
changeset
|
165 #undef DEF |
448 | 166 #undef SET_RND |
446
efe0c0d40577
* reenabled original xy2 put routine - rounding error is really bad with
kabi
parents:
445
diff
changeset
|
167 #undef PAVGBP |
471 | 168 #undef PAVGB |
387 | 169 |
0 | 170 /***********************************/ |
171 /* 3Dnow specific */ | |
172 | |
173 #define DEF(x) x ## _3dnow | |
174 /* for Athlons PAVGUSB is prefered */ | |
175 #define PAVGB "pavgusb" | |
176 | |
177 #include "dsputil_mmx_avg.h" | |
178 | |
179 #undef DEF | |
180 #undef PAVGB | |
181 | |
182 /***********************************/ | |
183 /* MMX2 specific */ | |
184 | |
386 | 185 #define DEF(x) x ## _mmx2 |
0 | 186 |
187 /* Introduced only in MMX2 set */ | |
188 #define PAVGB "pavgb" | |
189 | |
190 #include "dsputil_mmx_avg.h" | |
191 | |
192 #undef DEF | |
193 #undef PAVGB | |
194 | |
195 /***********************************/ | |
196 /* standard MMX */ | |
197 | |
198 static void get_pixels_mmx(DCTELEM *block, const UINT8 *pixels, int line_size) | |
199 { | |
386 | 200 asm volatile( |
201 "movl $-128, %%eax \n\t" | |
202 "pxor %%mm7, %%mm7 \n\t" | |
203 ".balign 16 \n\t" | |
204 "1: \n\t" | |
205 "movq (%0), %%mm0 \n\t" | |
206 "movq (%0, %2), %%mm2 \n\t" | |
207 "movq %%mm0, %%mm1 \n\t" | |
208 "movq %%mm2, %%mm3 \n\t" | |
209 "punpcklbw %%mm7, %%mm0 \n\t" | |
210 "punpckhbw %%mm7, %%mm1 \n\t" | |
211 "punpcklbw %%mm7, %%mm2 \n\t" | |
212 "punpckhbw %%mm7, %%mm3 \n\t" | |
213 "movq %%mm0, (%1, %%eax)\n\t" | |
214 "movq %%mm1, 8(%1, %%eax)\n\t" | |
215 "movq %%mm2, 16(%1, %%eax)\n\t" | |
216 "movq %%mm3, 24(%1, %%eax)\n\t" | |
217 "addl %3, %0 \n\t" | |
218 "addl $32, %%eax \n\t" | |
219 "js 1b \n\t" | |
220 : "+r" (pixels) | |
221 : "r" (block+64), "r" (line_size), "r" (line_size*2) | |
222 : "%eax" | |
223 ); | |
0 | 224 } |
225 | |
936 | 226 static inline void diff_pixels_mmx(DCTELEM *block, const UINT8 *s1, const UINT8 *s2, int stride) |
324 | 227 { |
228 asm volatile( | |
386 | 229 "pxor %%mm7, %%mm7 \n\t" |
230 "movl $-128, %%eax \n\t" | |
324 | 231 ".balign 16 \n\t" |
232 "1: \n\t" | |
233 "movq (%0), %%mm0 \n\t" | |
234 "movq (%1), %%mm2 \n\t" | |
235 "movq %%mm0, %%mm1 \n\t" | |
236 "movq %%mm2, %%mm3 \n\t" | |
237 "punpcklbw %%mm7, %%mm0 \n\t" | |
238 "punpckhbw %%mm7, %%mm1 \n\t" | |
239 "punpcklbw %%mm7, %%mm2 \n\t" | |
240 "punpckhbw %%mm7, %%mm3 \n\t" | |
241 "psubw %%mm2, %%mm0 \n\t" | |
242 "psubw %%mm3, %%mm1 \n\t" | |
243 "movq %%mm0, (%2, %%eax)\n\t" | |
244 "movq %%mm1, 8(%2, %%eax)\n\t" | |
245 "addl %3, %0 \n\t" | |
246 "addl %3, %1 \n\t" | |
247 "addl $16, %%eax \n\t" | |
248 "jnz 1b \n\t" | |
249 : "+r" (s1), "+r" (s2) | |
250 : "r" (block+64), "r" (stride) | |
251 : "%eax" | |
252 ); | |
253 } | |
254 | |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
255 void put_pixels_clamped_mmx(const DCTELEM *block, UINT8 *pixels, int line_size) |
0 | 256 { |
257 const DCTELEM *p; | |
258 UINT8 *pix; | |
259 | |
260 /* read the pixels */ | |
261 p = block; | |
262 pix = pixels; | |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
263 /* unrolled loop */ |
0 | 264 __asm __volatile( |
151
ae0516eadae2
fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents:
42
diff
changeset
|
265 "movq %3, %%mm0\n\t" |
ae0516eadae2
fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents:
42
diff
changeset
|
266 "movq 8%3, %%mm1\n\t" |
ae0516eadae2
fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents:
42
diff
changeset
|
267 "movq 16%3, %%mm2\n\t" |
ae0516eadae2
fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents:
42
diff
changeset
|
268 "movq 24%3, %%mm3\n\t" |
ae0516eadae2
fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents:
42
diff
changeset
|
269 "movq 32%3, %%mm4\n\t" |
ae0516eadae2
fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents:
42
diff
changeset
|
270 "movq 40%3, %%mm5\n\t" |
ae0516eadae2
fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents:
42
diff
changeset
|
271 "movq 48%3, %%mm6\n\t" |
ae0516eadae2
fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents:
42
diff
changeset
|
272 "movq 56%3, %%mm7\n\t" |
0 | 273 "packuswb %%mm1, %%mm0\n\t" |
274 "packuswb %%mm3, %%mm2\n\t" | |
275 "packuswb %%mm5, %%mm4\n\t" | |
276 "packuswb %%mm7, %%mm6\n\t" | |
151
ae0516eadae2
fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents:
42
diff
changeset
|
277 "movq %%mm0, (%0)\n\t" |
ae0516eadae2
fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents:
42
diff
changeset
|
278 "movq %%mm2, (%0, %1)\n\t" |
ae0516eadae2
fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents:
42
diff
changeset
|
279 "movq %%mm4, (%0, %1, 2)\n\t" |
ae0516eadae2
fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents:
42
diff
changeset
|
280 "movq %%mm6, (%0, %2)\n\t" |
ae0516eadae2
fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents:
42
diff
changeset
|
281 ::"r" (pix), "r" (line_size), "r" (line_size*3), "m"(*p) |
0 | 282 :"memory"); |
283 pix += line_size*4; | |
284 p += 32; | |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
285 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
286 // if here would be an exact copy of the code above |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
287 // compiler would generate some very strange code |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
288 // thus using "r" |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
289 __asm __volatile( |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
290 "movq (%3), %%mm0\n\t" |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
291 "movq 8(%3), %%mm1\n\t" |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
292 "movq 16(%3), %%mm2\n\t" |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
293 "movq 24(%3), %%mm3\n\t" |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
294 "movq 32(%3), %%mm4\n\t" |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
295 "movq 40(%3), %%mm5\n\t" |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
296 "movq 48(%3), %%mm6\n\t" |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
297 "movq 56(%3), %%mm7\n\t" |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
298 "packuswb %%mm1, %%mm0\n\t" |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
299 "packuswb %%mm3, %%mm2\n\t" |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
300 "packuswb %%mm5, %%mm4\n\t" |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
301 "packuswb %%mm7, %%mm6\n\t" |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
302 "movq %%mm0, (%0)\n\t" |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
303 "movq %%mm2, (%0, %1)\n\t" |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
304 "movq %%mm4, (%0, %1, 2)\n\t" |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
305 "movq %%mm6, (%0, %2)\n\t" |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
306 ::"r" (pix), "r" (line_size), "r" (line_size*3), "r"(p) |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
307 :"memory"); |
0 | 308 } |
309 | |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
310 void add_pixels_clamped_mmx(const DCTELEM *block, UINT8 *pixels, int line_size) |
0 | 311 { |
312 const DCTELEM *p; | |
313 UINT8 *pix; | |
314 int i; | |
315 | |
316 /* read the pixels */ | |
317 p = block; | |
318 pix = pixels; | |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
319 MOVQ_ZERO(mm7); |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
320 i = 4; |
342
8635a7036395
* fixes problem with -funroll-loops and buggy gcc compiler
kabi
parents:
324
diff
changeset
|
321 do { |
0 | 322 __asm __volatile( |
342
8635a7036395
* fixes problem with -funroll-loops and buggy gcc compiler
kabi
parents:
324
diff
changeset
|
323 "movq (%2), %%mm0\n\t" |
8635a7036395
* fixes problem with -funroll-loops and buggy gcc compiler
kabi
parents:
324
diff
changeset
|
324 "movq 8(%2), %%mm1\n\t" |
8635a7036395
* fixes problem with -funroll-loops and buggy gcc compiler
kabi
parents:
324
diff
changeset
|
325 "movq 16(%2), %%mm2\n\t" |
8635a7036395
* fixes problem with -funroll-loops and buggy gcc compiler
kabi
parents:
324
diff
changeset
|
326 "movq 24(%2), %%mm3\n\t" |
0 | 327 "movq %0, %%mm4\n\t" |
328 "movq %1, %%mm6\n\t" | |
329 "movq %%mm4, %%mm5\n\t" | |
330 "punpcklbw %%mm7, %%mm4\n\t" | |
331 "punpckhbw %%mm7, %%mm5\n\t" | |
332 "paddsw %%mm4, %%mm0\n\t" | |
333 "paddsw %%mm5, %%mm1\n\t" | |
334 "movq %%mm6, %%mm5\n\t" | |
335 "punpcklbw %%mm7, %%mm6\n\t" | |
336 "punpckhbw %%mm7, %%mm5\n\t" | |
337 "paddsw %%mm6, %%mm2\n\t" | |
338 "paddsw %%mm5, %%mm3\n\t" | |
339 "packuswb %%mm1, %%mm0\n\t" | |
340 "packuswb %%mm3, %%mm2\n\t" | |
341 "movq %%mm0, %0\n\t" | |
342 "movq %%mm2, %1\n\t" | |
151
ae0516eadae2
fixed gcc-3.0.x compilation (by Michael Niedermayer)
nickols_k
parents:
42
diff
changeset
|
343 :"+m"(*pix), "+m"(*(pix+line_size)) |
342
8635a7036395
* fixes problem with -funroll-loops and buggy gcc compiler
kabi
parents:
324
diff
changeset
|
344 :"r"(p) |
0 | 345 :"memory"); |
346 pix += line_size*2; | |
347 p += 16; | |
342
8635a7036395
* fixes problem with -funroll-loops and buggy gcc compiler
kabi
parents:
324
diff
changeset
|
348 } while (--i); |
0 | 349 } |
350 | |
651 | 351 static void put_pixels8_mmx(UINT8 *block, const UINT8 *pixels, int line_size, int h) |
0 | 352 { |
471 | 353 __asm __volatile( |
420 | 354 "lea (%3, %3), %%eax \n\t" |
422 | 355 ".balign 8 \n\t" |
420 | 356 "1: \n\t" |
357 "movq (%1), %%mm0 \n\t" | |
358 "movq (%1, %3), %%mm1 \n\t" | |
359 "movq %%mm0, (%2) \n\t" | |
360 "movq %%mm1, (%2, %3) \n\t" | |
361 "addl %%eax, %1 \n\t" | |
362 "addl %%eax, %2 \n\t" | |
363 "movq (%1), %%mm0 \n\t" | |
364 "movq (%1, %3), %%mm1 \n\t" | |
365 "movq %%mm0, (%2) \n\t" | |
366 "movq %%mm1, (%2, %3) \n\t" | |
367 "addl %%eax, %1 \n\t" | |
368 "addl %%eax, %2 \n\t" | |
369 "subl $4, %0 \n\t" | |
370 "jnz 1b \n\t" | |
371 : "+g"(h), "+r" (pixels), "+r" (block) | |
372 : "r"(line_size) | |
373 : "%eax", "memory" | |
374 ); | |
0 | 375 } |
376 | |
651 | 377 static void put_pixels16_mmx(UINT8 *block, const UINT8 *pixels, int line_size, int h) |
378 { | |
379 __asm __volatile( | |
380 "lea (%3, %3), %%eax \n\t" | |
381 ".balign 8 \n\t" | |
382 "1: \n\t" | |
383 "movq (%1), %%mm0 \n\t" | |
384 "movq 8(%1), %%mm4 \n\t" | |
385 "movq (%1, %3), %%mm1 \n\t" | |
386 "movq 8(%1, %3), %%mm5 \n\t" | |
387 "movq %%mm0, (%2) \n\t" | |
388 "movq %%mm4, 8(%2) \n\t" | |
389 "movq %%mm1, (%2, %3) \n\t" | |
390 "movq %%mm5, 8(%2, %3) \n\t" | |
391 "addl %%eax, %1 \n\t" | |
392 "addl %%eax, %2 \n\t" | |
393 "movq (%1), %%mm0 \n\t" | |
394 "movq 8(%1), %%mm4 \n\t" | |
395 "movq (%1, %3), %%mm1 \n\t" | |
396 "movq 8(%1, %3), %%mm5 \n\t" | |
397 "movq %%mm0, (%2) \n\t" | |
398 "movq %%mm4, 8(%2) \n\t" | |
399 "movq %%mm1, (%2, %3) \n\t" | |
400 "movq %%mm5, 8(%2, %3) \n\t" | |
401 "addl %%eax, %1 \n\t" | |
402 "addl %%eax, %2 \n\t" | |
403 "subl $4, %0 \n\t" | |
404 "jnz 1b \n\t" | |
405 : "+g"(h), "+r" (pixels), "+r" (block) | |
406 : "r"(line_size) | |
407 : "%eax", "memory" | |
408 ); | |
409 } | |
410 | |
296 | 411 static void clear_blocks_mmx(DCTELEM *blocks) |
412 { | |
471 | 413 __asm __volatile( |
296 | 414 "pxor %%mm7, %%mm7 \n\t" |
415 "movl $-128*6, %%eax \n\t" | |
416 "1: \n\t" | |
417 "movq %%mm7, (%0, %%eax) \n\t" | |
418 "movq %%mm7, 8(%0, %%eax) \n\t" | |
419 "movq %%mm7, 16(%0, %%eax) \n\t" | |
420 "movq %%mm7, 24(%0, %%eax) \n\t" | |
421 "addl $32, %%eax \n\t" | |
422 " js 1b \n\t" | |
423 : : "r" (((int)blocks)+128*6) | |
424 : "%eax" | |
425 ); | |
426 } | |
427 | |
688 | 428 static int pix_sum16_mmx(UINT8 * pix, int line_size){ |
429 const int h=16; | |
430 int sum; | |
431 int index= -line_size*h; | |
432 | |
433 __asm __volatile( | |
434 "pxor %%mm7, %%mm7 \n\t" | |
435 "pxor %%mm6, %%mm6 \n\t" | |
436 "1: \n\t" | |
437 "movq (%2, %1), %%mm0 \n\t" | |
438 "movq (%2, %1), %%mm1 \n\t" | |
439 "movq 8(%2, %1), %%mm2 \n\t" | |
440 "movq 8(%2, %1), %%mm3 \n\t" | |
441 "punpcklbw %%mm7, %%mm0 \n\t" | |
442 "punpckhbw %%mm7, %%mm1 \n\t" | |
443 "punpcklbw %%mm7, %%mm2 \n\t" | |
444 "punpckhbw %%mm7, %%mm3 \n\t" | |
445 "paddw %%mm0, %%mm1 \n\t" | |
446 "paddw %%mm2, %%mm3 \n\t" | |
447 "paddw %%mm1, %%mm3 \n\t" | |
448 "paddw %%mm3, %%mm6 \n\t" | |
449 "addl %3, %1 \n\t" | |
450 " js 1b \n\t" | |
451 "movq %%mm6, %%mm5 \n\t" | |
452 "psrlq $32, %%mm6 \n\t" | |
453 "paddw %%mm5, %%mm6 \n\t" | |
454 "movq %%mm6, %%mm5 \n\t" | |
455 "psrlq $16, %%mm6 \n\t" | |
456 "paddw %%mm5, %%mm6 \n\t" | |
457 "movd %%mm6, %0 \n\t" | |
458 "andl $0xFFFF, %0 \n\t" | |
459 : "=&r" (sum), "+r" (index) | |
460 : "r" (pix - index), "r" (line_size) | |
461 ); | |
462 | |
463 return sum; | |
464 } | |
465 | |
866 | 466 static void add_bytes_mmx(uint8_t *dst, uint8_t *src, int w){ |
467 int i=0; | |
468 asm volatile( | |
469 "1: \n\t" | |
470 "movq (%1, %0), %%mm0 \n\t" | |
471 "movq (%2, %0), %%mm1 \n\t" | |
472 "paddb %%mm0, %%mm1 \n\t" | |
473 "movq %%mm1, (%2, %0) \n\t" | |
474 "movq 8(%1, %0), %%mm0 \n\t" | |
475 "movq 8(%2, %0), %%mm1 \n\t" | |
476 "paddb %%mm0, %%mm1 \n\t" | |
477 "movq %%mm1, 8(%2, %0) \n\t" | |
478 "addl $16, %0 \n\t" | |
479 "cmpl %3, %0 \n\t" | |
480 " jb 1b \n\t" | |
481 : "+r" (i) | |
482 : "r"(src), "r"(dst), "r"(w-15) | |
483 ); | |
484 for(; i<w; i++) | |
485 dst[i+0] += src[i+0]; | |
486 } | |
487 | |
488 static void diff_bytes_mmx(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){ | |
489 int i=0; | |
490 asm volatile( | |
491 "1: \n\t" | |
492 "movq (%2, %0), %%mm0 \n\t" | |
493 "movq (%1, %0), %%mm1 \n\t" | |
494 "psubb %%mm0, %%mm1 \n\t" | |
495 "movq %%mm1, (%3, %0) \n\t" | |
496 "movq 8(%2, %0), %%mm0 \n\t" | |
497 "movq 8(%1, %0), %%mm1 \n\t" | |
498 "psubb %%mm0, %%mm1 \n\t" | |
499 "movq %%mm1, 8(%3, %0) \n\t" | |
500 "addl $16, %0 \n\t" | |
501 "cmpl %4, %0 \n\t" | |
502 " jb 1b \n\t" | |
503 : "+r" (i) | |
504 : "r"(src1), "r"(src2), "r"(dst), "r"(w-15) | |
505 ); | |
506 for(; i<w; i++) | |
507 dst[i+0] = src1[i+0]-src2[i+0]; | |
508 } | |
936 | 509 #define LBUTTERFLY(a,b)\ |
510 "paddw " #b ", " #a " \n\t"\ | |
511 "paddw " #b ", " #b " \n\t"\ | |
512 "psubw " #a ", " #b " \n\t" | |
866 | 513 |
936 | 514 #define HADAMARD48\ |
515 LBUTTERFLY(%%mm0, %%mm1)\ | |
516 LBUTTERFLY(%%mm2, %%mm3)\ | |
517 LBUTTERFLY(%%mm4, %%mm5)\ | |
518 LBUTTERFLY(%%mm6, %%mm7)\ | |
519 \ | |
520 LBUTTERFLY(%%mm0, %%mm2)\ | |
521 LBUTTERFLY(%%mm1, %%mm3)\ | |
522 LBUTTERFLY(%%mm4, %%mm6)\ | |
523 LBUTTERFLY(%%mm5, %%mm7)\ | |
524 \ | |
525 LBUTTERFLY(%%mm0, %%mm4)\ | |
526 LBUTTERFLY(%%mm1, %%mm5)\ | |
527 LBUTTERFLY(%%mm2, %%mm6)\ | |
528 LBUTTERFLY(%%mm3, %%mm7) | |
529 | |
530 #define MMABS(a,z)\ | |
531 "pxor " #z ", " #z " \n\t"\ | |
532 "pcmpgtw " #a ", " #z " \n\t"\ | |
533 "pxor " #z ", " #a " \n\t"\ | |
534 "psubw " #z ", " #a " \n\t" | |
535 | |
536 #define MMABS_SUM(a,z, sum)\ | |
537 "pxor " #z ", " #z " \n\t"\ | |
538 "pcmpgtw " #a ", " #z " \n\t"\ | |
539 "pxor " #z ", " #a " \n\t"\ | |
540 "psubw " #z ", " #a " \n\t"\ | |
541 "paddusw " #a ", " #sum " \n\t" | |
542 | |
543 | |
544 #define SBUTTERFLY(a,b,t,n)\ | |
545 "movq " #a ", " #t " \n\t" /* abcd */\ | |
546 "punpckl" #n " " #b ", " #a " \n\t" /* aebf */\ | |
547 "punpckh" #n " " #b ", " #t " \n\t" /* cgdh */\ | |
548 | |
549 #define TRANSPOSE4(a,b,c,d,t)\ | |
550 SBUTTERFLY(a,b,t,wd) /* a=aebf t=cgdh */\ | |
551 SBUTTERFLY(c,d,b,wd) /* c=imjn b=kolp */\ | |
552 SBUTTERFLY(a,c,d,dq) /* a=aeim d=bfjn */\ | |
553 SBUTTERFLY(t,b,c,dq) /* t=cgko c=dhlp */ | |
554 | |
555 #define LOAD4(o, a, b, c, d)\ | |
556 "movq "#o"(%1), " #a " \n\t"\ | |
557 "movq "#o"+16(%1), " #b " \n\t"\ | |
558 "movq "#o"+32(%1), " #c " \n\t"\ | |
559 "movq "#o"+48(%1), " #d " \n\t" | |
560 | |
561 #define STORE4(o, a, b, c, d)\ | |
562 "movq "#a", "#o"(%1) \n\t"\ | |
563 "movq "#b", "#o"+16(%1) \n\t"\ | |
564 "movq "#c", "#o"+32(%1) \n\t"\ | |
565 "movq "#d", "#o"+48(%1) \n\t"\ | |
566 | |
567 static int hadamard8_diff_mmx(void *s, uint8_t *src1, uint8_t *src2, int stride){ | |
568 uint64_t temp[16] __align8; | |
569 int sum=0; | |
570 | |
571 diff_pixels_mmx((DCTELEM*)temp, src1, src2, stride); | |
572 | |
573 asm volatile( | |
574 LOAD4(0 , %%mm0, %%mm1, %%mm2, %%mm3) | |
575 LOAD4(64, %%mm4, %%mm5, %%mm6, %%mm7) | |
576 | |
577 HADAMARD48 | |
578 | |
579 "movq %%mm7, 112(%1) \n\t" | |
580 | |
581 TRANSPOSE4(%%mm0, %%mm1, %%mm2, %%mm3, %%mm7) | |
582 STORE4(0 , %%mm0, %%mm3, %%mm7, %%mm2) | |
583 | |
584 "movq 112(%1), %%mm7 \n\t" | |
585 TRANSPOSE4(%%mm4, %%mm5, %%mm6, %%mm7, %%mm0) | |
586 STORE4(64, %%mm4, %%mm7, %%mm0, %%mm6) | |
587 | |
588 LOAD4(8 , %%mm0, %%mm1, %%mm2, %%mm3) | |
589 LOAD4(72, %%mm4, %%mm5, %%mm6, %%mm7) | |
590 | |
591 HADAMARD48 | |
592 | |
593 "movq %%mm7, 120(%1) \n\t" | |
594 | |
595 TRANSPOSE4(%%mm0, %%mm1, %%mm2, %%mm3, %%mm7) | |
596 STORE4(8 , %%mm0, %%mm3, %%mm7, %%mm2) | |
597 | |
598 "movq 120(%1), %%mm7 \n\t" | |
599 TRANSPOSE4(%%mm4, %%mm5, %%mm6, %%mm7, %%mm0) | |
600 "movq %%mm7, %%mm5 \n\t"//FIXME remove | |
601 "movq %%mm6, %%mm7 \n\t" | |
602 "movq %%mm0, %%mm6 \n\t" | |
603 // STORE4(72, %%mm4, %%mm7, %%mm0, %%mm6) //FIXME remove | |
604 | |
605 LOAD4(64, %%mm0, %%mm1, %%mm2, %%mm3) | |
606 // LOAD4(72, %%mm4, %%mm5, %%mm6, %%mm7) | |
607 | |
608 HADAMARD48 | |
609 "movq %%mm7, 64(%1) \n\t" | |
610 MMABS(%%mm0, %%mm7) | |
611 MMABS_SUM(%%mm1, %%mm7, %%mm0) | |
612 MMABS_SUM(%%mm2, %%mm7, %%mm0) | |
613 MMABS_SUM(%%mm3, %%mm7, %%mm0) | |
614 MMABS_SUM(%%mm4, %%mm7, %%mm0) | |
615 MMABS_SUM(%%mm5, %%mm7, %%mm0) | |
616 MMABS_SUM(%%mm6, %%mm7, %%mm0) | |
617 "movq 64(%1), %%mm1 \n\t" | |
618 MMABS_SUM(%%mm1, %%mm7, %%mm0) | |
619 "movq %%mm0, 64(%1) \n\t" | |
620 | |
621 LOAD4(0 , %%mm0, %%mm1, %%mm2, %%mm3) | |
622 LOAD4(8 , %%mm4, %%mm5, %%mm6, %%mm7) | |
623 | |
624 HADAMARD48 | |
625 "movq %%mm7, (%1) \n\t" | |
626 MMABS(%%mm0, %%mm7) | |
627 MMABS_SUM(%%mm1, %%mm7, %%mm0) | |
628 MMABS_SUM(%%mm2, %%mm7, %%mm0) | |
629 MMABS_SUM(%%mm3, %%mm7, %%mm0) | |
630 MMABS_SUM(%%mm4, %%mm7, %%mm0) | |
631 MMABS_SUM(%%mm5, %%mm7, %%mm0) | |
632 MMABS_SUM(%%mm6, %%mm7, %%mm0) | |
633 "movq (%1), %%mm1 \n\t" | |
634 MMABS_SUM(%%mm1, %%mm7, %%mm0) | |
635 "movq 64(%1), %%mm1 \n\t" | |
636 MMABS_SUM(%%mm1, %%mm7, %%mm0) | |
637 | |
638 "movq %%mm0, %%mm1 \n\t" | |
639 "psrlq $32, %%mm0 \n\t" | |
640 "paddusw %%mm1, %%mm0 \n\t" | |
641 "movq %%mm0, %%mm1 \n\t" | |
642 "psrlq $16, %%mm0 \n\t" | |
643 "paddusw %%mm1, %%mm0 \n\t" | |
644 "movd %%mm0, %0 \n\t" | |
645 | |
646 : "=r" (sum) | |
647 : "r"(temp) | |
648 ); | |
649 return sum&0xFFFF; | |
650 } | |
651 | |
652 WARPER88_1616(hadamard8_diff_mmx, hadamard8_diff16_mmx) | |
866 | 653 |
954 | 654 #define QPEL_V_LOW(m3,m4,m5,m6, pw_20, pw_3, rnd, in0, in1, in2, in7, out, OP)\ |
655 "paddw " #m4 ", " #m3 " \n\t" /* x1 */\ | |
656 "movq " #pw_20 ", %%mm4 \n\t" /* 20 */\ | |
657 "pmullw " #m3 ", %%mm4 \n\t" /* 20x1 */\ | |
658 "movq "#in7", " #m3 " \n\t" /* d */\ | |
659 "movq "#in0", %%mm5 \n\t" /* D */\ | |
660 "paddw " #m3 ", %%mm5 \n\t" /* x4 */\ | |
661 "psubw %%mm5, %%mm4 \n\t" /* 20x1 - x4 */\ | |
662 "movq "#in1", %%mm5 \n\t" /* C */\ | |
663 "movq "#in2", %%mm6 \n\t" /* B */\ | |
664 "paddw " #m6 ", %%mm5 \n\t" /* x3 */\ | |
665 "paddw " #m5 ", %%mm6 \n\t" /* x2 */\ | |
666 "paddw %%mm6, %%mm6 \n\t" /* 2x2 */\ | |
667 "psubw %%mm6, %%mm5 \n\t" /* -2x2 + x3 */\ | |
668 "pmullw " #pw_3 ", %%mm5 \n\t" /* -6x2 + 3x3 */\ | |
669 "paddw " #rnd ", %%mm4 \n\t" /* x2 */\ | |
670 "paddw %%mm4, %%mm5 \n\t" /* 20x1 - 6x2 + 3x3 - x4 */\ | |
671 "psraw $5, %%mm5 \n\t"\ | |
672 "packuswb %%mm5, %%mm5 \n\t"\ | |
673 OP(%%mm5, out, %%mm7, d) | |
674 | |
675 #define QPEL_BASE(OPNAME, ROUNDER, RND, OP)\ | |
676 void OPNAME ## mpeg4_qpel16_h_lowpass_mmx2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\ | |
677 uint64_t temp;\ | |
678 \ | |
679 asm volatile(\ | |
680 "pxor %%mm7, %%mm7 \n\t"\ | |
681 "1: \n\t"\ | |
682 "movq (%0), %%mm0 \n\t" /* ABCDEFGH */\ | |
683 "movq %%mm0, %%mm1 \n\t" /* ABCDEFGH */\ | |
684 "movq %%mm0, %%mm2 \n\t" /* ABCDEFGH */\ | |
685 "punpcklbw %%mm7, %%mm0 \n\t" /* 0A0B0C0D */\ | |
686 "punpckhbw %%mm7, %%mm1 \n\t" /* 0E0F0G0H */\ | |
687 "pshufw $0x90, %%mm0, %%mm5 \n\t" /* 0A0A0B0C */\ | |
688 "pshufw $0x41, %%mm0, %%mm6 \n\t" /* 0B0A0A0B */\ | |
689 "movq %%mm2, %%mm3 \n\t" /* ABCDEFGH */\ | |
690 "movq %%mm2, %%mm4 \n\t" /* ABCDEFGH */\ | |
691 "psllq $8, %%mm2 \n\t" /* 0ABCDEFG */\ | |
692 "psllq $16, %%mm3 \n\t" /* 00ABCDEF */\ | |
693 "psllq $24, %%mm4 \n\t" /* 000ABCDE */\ | |
694 "punpckhbw %%mm7, %%mm2 \n\t" /* 0D0E0F0G */\ | |
695 "punpckhbw %%mm7, %%mm3 \n\t" /* 0C0D0E0F */\ | |
696 "punpckhbw %%mm7, %%mm4 \n\t" /* 0B0C0D0E */\ | |
697 "paddw %%mm3, %%mm5 \n\t" /* b */\ | |
698 "paddw %%mm2, %%mm6 \n\t" /* c */\ | |
699 "paddw %%mm5, %%mm5 \n\t" /* 2b */\ | |
700 "psubw %%mm5, %%mm6 \n\t" /* c - 2b */\ | |
701 "pshufw $0x06, %%mm0, %%mm5 \n\t" /* 0C0B0A0A */\ | |
702 "pmullw %6, %%mm6 \n\t" /* 3c - 6b */\ | |
703 "paddw %%mm4, %%mm0 \n\t" /* a */\ | |
704 "paddw %%mm1, %%mm5 \n\t" /* d */\ | |
705 "pmullw %5, %%mm0 \n\t" /* 20a */\ | |
706 "psubw %%mm5, %%mm0 \n\t" /* 20a - d */\ | |
707 "paddw %8, %%mm6 \n\t"\ | |
708 "paddw %%mm6, %%mm0 \n\t" /* 20a - 6b + 3c - d */\ | |
709 "psraw $5, %%mm0 \n\t"\ | |
710 "movq %%mm0, %7 \n\t"\ | |
711 /* mm1=EFGH, mm2=DEFG, mm3=CDEF, mm4=BCDE, mm7=0 */\ | |
712 \ | |
713 "movq 5(%0), %%mm0 \n\t" /* FGHIJKLM */\ | |
714 "movq %%mm0, %%mm5 \n\t" /* FGHIJKLM */\ | |
715 "movq %%mm0, %%mm6 \n\t" /* FGHIJKLM */\ | |
716 "psrlq $8, %%mm0 \n\t" /* GHIJKLM0 */\ | |
717 "psrlq $16, %%mm5 \n\t" /* HIJKLM00 */\ | |
718 "punpcklbw %%mm7, %%mm0 \n\t" /* 0G0H0I0J */\ | |
719 "punpcklbw %%mm7, %%mm5 \n\t" /* 0H0I0J0K */\ | |
720 "paddw %%mm0, %%mm2 \n\t" /* b */\ | |
721 "paddw %%mm5, %%mm3 \n\t" /* c */\ | |
722 "paddw %%mm2, %%mm2 \n\t" /* 2b */\ | |
723 "psubw %%mm2, %%mm3 \n\t" /* c - 2b */\ | |
724 "movq %%mm6, %%mm2 \n\t" /* FGHIJKLM */\ | |
725 "psrlq $24, %%mm6 \n\t" /* IJKLM000 */\ | |
726 "punpcklbw %%mm7, %%mm2 \n\t" /* 0F0G0H0I */\ | |
727 "punpcklbw %%mm7, %%mm6 \n\t" /* 0I0J0K0L */\ | |
728 "pmullw %6, %%mm3 \n\t" /* 3c - 6b */\ | |
729 "paddw %%mm2, %%mm1 \n\t" /* a */\ | |
730 "paddw %%mm6, %%mm4 \n\t" /* d */\ | |
731 "pmullw %5, %%mm1 \n\t" /* 20a */\ | |
732 "psubw %%mm4, %%mm3 \n\t" /* - 6b +3c - d */\ | |
733 "paddw %8, %%mm1 \n\t"\ | |
734 "paddw %%mm1, %%mm3 \n\t" /* 20a - 6b +3c - d */\ | |
735 "psraw $5, %%mm3 \n\t"\ | |
736 "movq %7, %%mm1 \n\t"\ | |
737 "packuswb %%mm3, %%mm1 \n\t"\ | |
738 OP(%%mm1, (%1),%%mm4, q)\ | |
739 /* mm0= GHIJ, mm2=FGHI, mm5=HIJK, mm6=IJKL, mm7=0 */\ | |
740 \ | |
741 "movq 9(%0), %%mm1 \n\t" /* JKLMNOPQ */\ | |
742 "movq %%mm1, %%mm4 \n\t" /* JKLMNOPQ */\ | |
743 "movq %%mm1, %%mm3 \n\t" /* JKLMNOPQ */\ | |
744 "psrlq $8, %%mm1 \n\t" /* KLMNOPQ0 */\ | |
745 "psrlq $16, %%mm4 \n\t" /* LMNOPQ00 */\ | |
746 "punpcklbw %%mm7, %%mm1 \n\t" /* 0K0L0M0N */\ | |
747 "punpcklbw %%mm7, %%mm4 \n\t" /* 0L0M0N0O */\ | |
748 "paddw %%mm1, %%mm5 \n\t" /* b */\ | |
749 "paddw %%mm4, %%mm0 \n\t" /* c */\ | |
750 "paddw %%mm5, %%mm5 \n\t" /* 2b */\ | |
751 "psubw %%mm5, %%mm0 \n\t" /* c - 2b */\ | |
752 "movq %%mm3, %%mm5 \n\t" /* JKLMNOPQ */\ | |
753 "psrlq $24, %%mm3 \n\t" /* MNOPQ000 */\ | |
754 "pmullw %6, %%mm0 \n\t" /* 3c - 6b */\ | |
755 "punpcklbw %%mm7, %%mm3 \n\t" /* 0M0N0O0P */\ | |
756 "paddw %%mm3, %%mm2 \n\t" /* d */\ | |
757 "psubw %%mm2, %%mm0 \n\t" /* -6b + 3c - d */\ | |
758 "movq %%mm5, %%mm2 \n\t" /* JKLMNOPQ */\ | |
759 "punpcklbw %%mm7, %%mm2 \n\t" /* 0J0K0L0M */\ | |
760 "punpckhbw %%mm7, %%mm5 \n\t" /* 0N0O0P0Q */\ | |
761 "paddw %%mm2, %%mm6 \n\t" /* a */\ | |
762 "pmullw %5, %%mm6 \n\t" /* 20a */\ | |
763 "paddw %8, %%mm0 \n\t"\ | |
764 "paddw %%mm6, %%mm0 \n\t" /* 20a - 6b + 3c - d */\ | |
765 "psraw $5, %%mm0 \n\t"\ | |
766 /* mm1=KLMN, mm2=JKLM, mm3=MNOP, mm4=LMNO, mm5=NOPQ mm7=0 */\ | |
767 \ | |
768 "paddw %%mm5, %%mm3 \n\t" /* a */\ | |
769 "pshufw $0xF9, %%mm5, %%mm6 \n\t" /* 0O0P0Q0Q */\ | |
770 "paddw %%mm4, %%mm6 \n\t" /* b */\ | |
771 "pshufw $0xBE, %%mm5, %%mm4 \n\t" /* 0P0Q0Q0P */\ | |
772 "pshufw $0x6F, %%mm5, %%mm5 \n\t" /* 0Q0Q0P0O */\ | |
773 "paddw %%mm1, %%mm4 \n\t" /* c */\ | |
774 "paddw %%mm2, %%mm5 \n\t" /* d */\ | |
775 "paddw %%mm6, %%mm6 \n\t" /* 2b */\ | |
776 "psubw %%mm6, %%mm4 \n\t" /* c - 2b */\ | |
777 "pmullw %5, %%mm3 \n\t" /* 20a */\ | |
778 "pmullw %6, %%mm4 \n\t" /* 3c - 6b */\ | |
779 "psubw %%mm5, %%mm3 \n\t" /* -6b + 3c - d */\ | |
780 "paddw %8, %%mm4 \n\t"\ | |
781 "paddw %%mm3, %%mm4 \n\t" /* 20a - 6b + 3c - d */\ | |
782 "psraw $5, %%mm4 \n\t"\ | |
783 "packuswb %%mm4, %%mm0 \n\t"\ | |
784 OP(%%mm0, 8(%1), %%mm4, q)\ | |
785 \ | |
786 "addl %3, %0 \n\t"\ | |
787 "addl %4, %1 \n\t"\ | |
788 "decl %2 \n\t"\ | |
789 " jnz 1b \n\t"\ | |
790 : "+r"(src), "+r"(dst), "+g"(h)\ | |
791 : "r"(srcStride), "r"(dstStride), "m"(ff_pw_20), "m"(ff_pw_3), "m"(temp), "m"(ROUNDER)\ | |
792 );\ | |
793 }\ | |
794 \ | |
795 static void OPNAME ## mpeg4_qpel16_h_lowpass_3dnow(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\ | |
796 int i;\ | |
797 int16_t temp[16];\ | |
798 /* quick HACK, XXX FIXME MUST be optimized */\ | |
799 for(i=0; i<h; i++)\ | |
800 {\ | |
801 temp[ 0]= (src[ 0]+src[ 1])*20 - (src[ 0]+src[ 2])*6 + (src[ 1]+src[ 3])*3 - (src[ 2]+src[ 4]);\ | |
802 temp[ 1]= (src[ 1]+src[ 2])*20 - (src[ 0]+src[ 3])*6 + (src[ 0]+src[ 4])*3 - (src[ 1]+src[ 5]);\ | |
803 temp[ 2]= (src[ 2]+src[ 3])*20 - (src[ 1]+src[ 4])*6 + (src[ 0]+src[ 5])*3 - (src[ 0]+src[ 6]);\ | |
804 temp[ 3]= (src[ 3]+src[ 4])*20 - (src[ 2]+src[ 5])*6 + (src[ 1]+src[ 6])*3 - (src[ 0]+src[ 7]);\ | |
805 temp[ 4]= (src[ 4]+src[ 5])*20 - (src[ 3]+src[ 6])*6 + (src[ 2]+src[ 7])*3 - (src[ 1]+src[ 8]);\ | |
806 temp[ 5]= (src[ 5]+src[ 6])*20 - (src[ 4]+src[ 7])*6 + (src[ 3]+src[ 8])*3 - (src[ 2]+src[ 9]);\ | |
807 temp[ 6]= (src[ 6]+src[ 7])*20 - (src[ 5]+src[ 8])*6 + (src[ 4]+src[ 9])*3 - (src[ 3]+src[10]);\ | |
808 temp[ 7]= (src[ 7]+src[ 8])*20 - (src[ 6]+src[ 9])*6 + (src[ 5]+src[10])*3 - (src[ 4]+src[11]);\ | |
809 temp[ 8]= (src[ 8]+src[ 9])*20 - (src[ 7]+src[10])*6 + (src[ 6]+src[11])*3 - (src[ 5]+src[12]);\ | |
810 temp[ 9]= (src[ 9]+src[10])*20 - (src[ 8]+src[11])*6 + (src[ 7]+src[12])*3 - (src[ 6]+src[13]);\ | |
811 temp[10]= (src[10]+src[11])*20 - (src[ 9]+src[12])*6 + (src[ 8]+src[13])*3 - (src[ 7]+src[14]);\ | |
812 temp[11]= (src[11]+src[12])*20 - (src[10]+src[13])*6 + (src[ 9]+src[14])*3 - (src[ 8]+src[15]);\ | |
813 temp[12]= (src[12]+src[13])*20 - (src[11]+src[14])*6 + (src[10]+src[15])*3 - (src[ 9]+src[16]);\ | |
814 temp[13]= (src[13]+src[14])*20 - (src[12]+src[15])*6 + (src[11]+src[16])*3 - (src[10]+src[16]);\ | |
815 temp[14]= (src[14]+src[15])*20 - (src[13]+src[16])*6 + (src[12]+src[16])*3 - (src[11]+src[15]);\ | |
816 temp[15]= (src[15]+src[16])*20 - (src[14]+src[16])*6 + (src[13]+src[15])*3 - (src[12]+src[14]);\ | |
817 asm volatile(\ | |
818 "movq (%0), %%mm0 \n\t"\ | |
819 "movq 8(%0), %%mm1 \n\t"\ | |
820 "paddw %2, %%mm0 \n\t"\ | |
821 "paddw %2, %%mm1 \n\t"\ | |
822 "psraw $5, %%mm0 \n\t"\ | |
823 "psraw $5, %%mm1 \n\t"\ | |
824 "packuswb %%mm1, %%mm0 \n\t"\ | |
825 OP(%%mm0, (%1), %%mm1, q)\ | |
826 "movq 16(%0), %%mm0 \n\t"\ | |
827 "movq 24(%0), %%mm1 \n\t"\ | |
828 "paddw %2, %%mm0 \n\t"\ | |
829 "paddw %2, %%mm1 \n\t"\ | |
830 "psraw $5, %%mm0 \n\t"\ | |
831 "psraw $5, %%mm1 \n\t"\ | |
832 "packuswb %%mm1, %%mm0 \n\t"\ | |
833 OP(%%mm0, 8(%1), %%mm1, q)\ | |
834 :: "r"(temp), "r"(dst), "m"(ROUNDER)\ | |
835 );\ | |
836 dst+=dstStride;\ | |
837 src+=srcStride;\ | |
838 }\ | |
839 }\ | |
840 \ | |
841 void OPNAME ## mpeg4_qpel16_v_lowpass_mmx(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\ | |
842 uint64_t temp[17*4];\ | |
843 uint64_t *temp_ptr= temp;\ | |
844 int count= 17;\ | |
845 \ | |
846 /*FIXME unroll */\ | |
847 asm volatile(\ | |
848 "pxor %%mm7, %%mm7 \n\t"\ | |
849 "1: \n\t"\ | |
850 "movq (%0), %%mm0 \n\t"\ | |
851 "movq (%0), %%mm1 \n\t"\ | |
852 "movq 8(%0), %%mm2 \n\t"\ | |
853 "movq 8(%0), %%mm3 \n\t"\ | |
854 "punpcklbw %%mm7, %%mm0 \n\t"\ | |
855 "punpckhbw %%mm7, %%mm1 \n\t"\ | |
856 "punpcklbw %%mm7, %%mm2 \n\t"\ | |
857 "punpckhbw %%mm7, %%mm3 \n\t"\ | |
858 "movq %%mm0, (%1) \n\t"\ | |
859 "movq %%mm1, 17*8(%1) \n\t"\ | |
860 "movq %%mm2, (%1, %4) \n\t"\ | |
861 "movq %%mm3, (%1, %5) \n\t"\ | |
862 "addl $8, %1 \n\t"\ | |
863 "addl %3, %0 \n\t"\ | |
864 "decl %2 \n\t"\ | |
865 " jnz 1b \n\t"\ | |
866 : "+r" (src), "+r" (temp_ptr), "+r"(count)\ | |
867 : "r" (srcStride), "r"(2*8*17), "r"(3*8*17)\ | |
868 );\ | |
869 \ | |
870 temp_ptr= temp;\ | |
871 count=4;\ | |
872 \ | |
873 /*FIXME reorder for speed */\ | |
874 asm volatile(\ | |
875 /*"pxor %%mm7, %%mm7 \n\t"*/\ | |
876 "1: \n\t"\ | |
877 "movq (%0), %%mm0 \n\t"\ | |
878 "movq 8(%0), %%mm1 \n\t"\ | |
879 "movq 16(%0), %%mm2 \n\t"\ | |
880 "movq 24(%0), %%mm3 \n\t"\ | |
881 QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %7, 16(%0), 8(%0), (%0), 32(%0), (%1), OP)\ | |
882 QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %7, 8(%0), (%0), (%0), 40(%0), (%1, %3), OP)\ | |
883 "addl %4, %1 \n\t"\ | |
884 QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %7, (%0), (%0), 8(%0), 48(%0), (%1), OP)\ | |
885 \ | |
886 QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %7, (%0), 8(%0), 16(%0), 56(%0), (%1, %3), OP)\ | |
887 "addl %4, %1 \n\t"\ | |
888 QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %7, 8(%0), 16(%0), 24(%0), 64(%0), (%1), OP)\ | |
889 QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %7, 16(%0), 24(%0), 32(%0), 72(%0), (%1, %3), OP)\ | |
890 "addl %4, %1 \n\t"\ | |
891 QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %7, 24(%0), 32(%0), 40(%0), 80(%0), (%1), OP)\ | |
892 QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %7, 32(%0), 40(%0), 48(%0), 88(%0), (%1, %3), OP)\ | |
893 "addl %4, %1 \n\t"\ | |
894 QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %7, 40(%0), 48(%0), 56(%0), 96(%0), (%1), OP)\ | |
895 QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %7, 48(%0), 56(%0), 64(%0),104(%0), (%1, %3), OP)\ | |
896 "addl %4, %1 \n\t"\ | |
897 QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %7, 56(%0), 64(%0), 72(%0),112(%0), (%1), OP)\ | |
898 QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %7, 64(%0), 72(%0), 80(%0),120(%0), (%1, %3), OP)\ | |
899 "addl %4, %1 \n\t"\ | |
900 QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %7, 72(%0), 80(%0), 88(%0),128(%0), (%1), OP)\ | |
901 \ | |
902 QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %7, 80(%0), 88(%0), 96(%0),128(%0), (%1, %3), OP)\ | |
903 "addl %4, %1 \n\t" \ | |
904 QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %7, 88(%0), 96(%0),104(%0),120(%0), (%1), OP)\ | |
905 QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %7, 96(%0),104(%0),112(%0),112(%0), (%1, %3), OP)\ | |
906 \ | |
907 "addl $136, %0 \n\t"\ | |
908 "addl %8, %1 \n\t"\ | |
909 "decl %2 \n\t"\ | |
910 " jnz 1b \n\t"\ | |
911 \ | |
912 : "+r"(temp_ptr), "+r"(dst), "+g"(count)\ | |
913 : "r"(dstStride), "r"(2*dstStride), "m"(ff_pw_20), "m"(ff_pw_3), "m"(ROUNDER), "g"(4-14*dstStride)\ | |
914 );\ | |
915 }\ | |
916 void OPNAME ## mpeg4_qpel8_h_lowpass_mmx2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\ | |
917 uint64_t temp;\ | |
918 \ | |
919 asm volatile(\ | |
920 "pxor %%mm7, %%mm7 \n\t"\ | |
921 "1: \n\t"\ | |
922 "movq (%0), %%mm0 \n\t" /* ABCDEFGH */\ | |
923 "movq %%mm0, %%mm1 \n\t" /* ABCDEFGH */\ | |
924 "movq %%mm0, %%mm2 \n\t" /* ABCDEFGH */\ | |
925 "punpcklbw %%mm7, %%mm0 \n\t" /* 0A0B0C0D */\ | |
926 "punpckhbw %%mm7, %%mm1 \n\t" /* 0E0F0G0H */\ | |
927 "pshufw $0x90, %%mm0, %%mm5 \n\t" /* 0A0A0B0C */\ | |
928 "pshufw $0x41, %%mm0, %%mm6 \n\t" /* 0B0A0A0B */\ | |
929 "movq %%mm2, %%mm3 \n\t" /* ABCDEFGH */\ | |
930 "movq %%mm2, %%mm4 \n\t" /* ABCDEFGH */\ | |
931 "psllq $8, %%mm2 \n\t" /* 0ABCDEFG */\ | |
932 "psllq $16, %%mm3 \n\t" /* 00ABCDEF */\ | |
933 "psllq $24, %%mm4 \n\t" /* 000ABCDE */\ | |
934 "punpckhbw %%mm7, %%mm2 \n\t" /* 0D0E0F0G */\ | |
935 "punpckhbw %%mm7, %%mm3 \n\t" /* 0C0D0E0F */\ | |
936 "punpckhbw %%mm7, %%mm4 \n\t" /* 0B0C0D0E */\ | |
937 "paddw %%mm3, %%mm5 \n\t" /* b */\ | |
938 "paddw %%mm2, %%mm6 \n\t" /* c */\ | |
939 "paddw %%mm5, %%mm5 \n\t" /* 2b */\ | |
940 "psubw %%mm5, %%mm6 \n\t" /* c - 2b */\ | |
941 "pshufw $0x06, %%mm0, %%mm5 \n\t" /* 0C0B0A0A */\ | |
942 "pmullw %6, %%mm6 \n\t" /* 3c - 6b */\ | |
943 "paddw %%mm4, %%mm0 \n\t" /* a */\ | |
944 "paddw %%mm1, %%mm5 \n\t" /* d */\ | |
945 "pmullw %5, %%mm0 \n\t" /* 20a */\ | |
946 "psubw %%mm5, %%mm0 \n\t" /* 20a - d */\ | |
947 "paddw %8, %%mm6 \n\t"\ | |
948 "paddw %%mm6, %%mm0 \n\t" /* 20a - 6b + 3c - d */\ | |
949 "psraw $5, %%mm0 \n\t"\ | |
950 /* mm1=EFGH, mm2=DEFG, mm3=CDEF, mm4=BCDE, mm7=0 */\ | |
951 \ | |
952 "movd 5(%0), %%mm5 \n\t" /* FGHI */\ | |
953 "punpcklbw %%mm7, %%mm5 \n\t" /* 0F0G0H0I */\ | |
954 "pshufw $0xF9, %%mm5, %%mm6 \n\t" /* 0G0H0I0I */\ | |
955 "paddw %%mm5, %%mm1 \n\t" /* a */\ | |
956 "paddw %%mm6, %%mm2 \n\t" /* b */\ | |
957 "pshufw $0xBE, %%mm5, %%mm6 \n\t" /* 0H0I0I0H */\ | |
958 "pshufw $0x6F, %%mm5, %%mm5 \n\t" /* 0I0I0H0G */\ | |
959 "paddw %%mm6, %%mm3 \n\t" /* c */\ | |
960 "paddw %%mm5, %%mm4 \n\t" /* d */\ | |
961 "paddw %%mm2, %%mm2 \n\t" /* 2b */\ | |
962 "psubw %%mm2, %%mm3 \n\t" /* c - 2b */\ | |
963 "pmullw %5, %%mm1 \n\t" /* 20a */\ | |
964 "pmullw %6, %%mm3 \n\t" /* 3c - 6b */\ | |
965 "psubw %%mm4, %%mm3 \n\t" /* -6b + 3c - d */\ | |
966 "paddw %8, %%mm1 \n\t"\ | |
967 "paddw %%mm1, %%mm3 \n\t" /* 20a - 6b + 3c - d */\ | |
968 "psraw $5, %%mm3 \n\t"\ | |
969 "packuswb %%mm3, %%mm0 \n\t"\ | |
970 OP(%%mm0, (%1), %%mm4, q)\ | |
971 \ | |
972 "addl %3, %0 \n\t"\ | |
973 "addl %4, %1 \n\t"\ | |
974 "decl %2 \n\t"\ | |
975 " jnz 1b \n\t"\ | |
976 : "+r"(src), "+r"(dst), "+g"(h)\ | |
977 : "r"(srcStride), "r"(dstStride), "m"(ff_pw_20), "m"(ff_pw_3), "m"(temp), "m"(ROUNDER)\ | |
978 );\ | |
979 }\ | |
980 \ | |
981 static void OPNAME ## mpeg4_qpel8_h_lowpass_3dnow(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\ | |
982 int i;\ | |
983 int16_t temp[8];\ | |
984 /* quick HACK, XXX FIXME MUST be optimized */\ | |
985 for(i=0; i<h; i++)\ | |
986 {\ | |
987 temp[ 0]= (src[ 0]+src[ 1])*20 - (src[ 0]+src[ 2])*6 + (src[ 1]+src[ 3])*3 - (src[ 2]+src[ 4]);\ | |
988 temp[ 1]= (src[ 1]+src[ 2])*20 - (src[ 0]+src[ 3])*6 + (src[ 0]+src[ 4])*3 - (src[ 1]+src[ 5]);\ | |
989 temp[ 2]= (src[ 2]+src[ 3])*20 - (src[ 1]+src[ 4])*6 + (src[ 0]+src[ 5])*3 - (src[ 0]+src[ 6]);\ | |
990 temp[ 3]= (src[ 3]+src[ 4])*20 - (src[ 2]+src[ 5])*6 + (src[ 1]+src[ 6])*3 - (src[ 0]+src[ 7]);\ | |
991 temp[ 4]= (src[ 4]+src[ 5])*20 - (src[ 3]+src[ 6])*6 + (src[ 2]+src[ 7])*3 - (src[ 1]+src[ 8]);\ | |
992 temp[ 5]= (src[ 5]+src[ 6])*20 - (src[ 4]+src[ 7])*6 + (src[ 3]+src[ 8])*3 - (src[ 2]+src[ 8]);\ | |
993 temp[ 6]= (src[ 6]+src[ 7])*20 - (src[ 5]+src[ 8])*6 + (src[ 4]+src[ 8])*3 - (src[ 3]+src[ 7]);\ | |
994 temp[ 7]= (src[ 7]+src[ 8])*20 - (src[ 6]+src[ 8])*6 + (src[ 5]+src[ 7])*3 - (src[ 4]+src[ 6]);\ | |
995 asm volatile(\ | |
996 "movq (%0), %%mm0 \n\t"\ | |
997 "movq 8(%0), %%mm1 \n\t"\ | |
998 "paddw %2, %%mm0 \n\t"\ | |
999 "paddw %2, %%mm1 \n\t"\ | |
1000 "psraw $5, %%mm0 \n\t"\ | |
1001 "psraw $5, %%mm1 \n\t"\ | |
1002 "packuswb %%mm1, %%mm0 \n\t"\ | |
1003 OP(%%mm0, (%1), %%mm1, q)\ | |
1004 :: "r"(temp), "r"(dst), "m"(ROUNDER)\ | |
1005 );\ | |
1006 dst+=dstStride;\ | |
1007 src+=srcStride;\ | |
1008 }\ | |
1009 }\ | |
1010 \ | |
1011 void OPNAME ## mpeg4_qpel8_v_lowpass_mmx(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\ | |
1012 uint64_t temp[9*4];\ | |
1013 uint64_t *temp_ptr= temp;\ | |
1014 int count= 9;\ | |
1015 \ | |
1016 /*FIXME unroll */\ | |
1017 asm volatile(\ | |
1018 "pxor %%mm7, %%mm7 \n\t"\ | |
1019 "1: \n\t"\ | |
1020 "movq (%0), %%mm0 \n\t"\ | |
1021 "movq (%0), %%mm1 \n\t"\ | |
1022 "punpcklbw %%mm7, %%mm0 \n\t"\ | |
1023 "punpckhbw %%mm7, %%mm1 \n\t"\ | |
1024 "movq %%mm0, (%1) \n\t"\ | |
1025 "movq %%mm1, 9*8(%1) \n\t"\ | |
1026 "addl $8, %1 \n\t"\ | |
1027 "addl %3, %0 \n\t"\ | |
1028 "decl %2 \n\t"\ | |
1029 " jnz 1b \n\t"\ | |
1030 : "+r" (src), "+r" (temp_ptr), "+r"(count)\ | |
1031 : "r" (srcStride)\ | |
1032 );\ | |
1033 \ | |
1034 temp_ptr= temp;\ | |
1035 count=2;\ | |
1036 \ | |
1037 /*FIXME reorder for speed */\ | |
1038 asm volatile(\ | |
1039 /*"pxor %%mm7, %%mm7 \n\t"*/\ | |
1040 "1: \n\t"\ | |
1041 "movq (%0), %%mm0 \n\t"\ | |
1042 "movq 8(%0), %%mm1 \n\t"\ | |
1043 "movq 16(%0), %%mm2 \n\t"\ | |
1044 "movq 24(%0), %%mm3 \n\t"\ | |
1045 QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %7, 16(%0), 8(%0), (%0), 32(%0), (%1), OP)\ | |
1046 QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %7, 8(%0), (%0), (%0), 40(%0), (%1, %3), OP)\ | |
1047 "addl %4, %1 \n\t"\ | |
1048 QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %7, (%0), (%0), 8(%0), 48(%0), (%1), OP)\ | |
1049 \ | |
1050 QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %7, (%0), 8(%0), 16(%0), 56(%0), (%1, %3), OP)\ | |
1051 "addl %4, %1 \n\t"\ | |
1052 QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %7, 8(%0), 16(%0), 24(%0), 64(%0), (%1), OP)\ | |
1053 \ | |
1054 QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %7, 16(%0), 24(%0), 32(%0), 64(%0), (%1, %3), OP)\ | |
1055 "addl %4, %1 \n\t"\ | |
1056 QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %7, 24(%0), 32(%0), 40(%0), 56(%0), (%1), OP)\ | |
1057 QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %7, 32(%0), 40(%0), 48(%0), 48(%0), (%1, %3), OP)\ | |
1058 \ | |
1059 "addl $72, %0 \n\t"\ | |
1060 "addl %8, %1 \n\t"\ | |
1061 "decl %2 \n\t"\ | |
1062 " jnz 1b \n\t"\ | |
1063 \ | |
1064 : "+r"(temp_ptr), "+r"(dst), "+g"(count)\ | |
1065 : "r"(dstStride), "r"(2*dstStride), "m"(ff_pw_20), "m"(ff_pw_3), "m"(ROUNDER), "g"(4-6*dstStride)\ | |
1066 );\ | |
1067 } | |
1068 | |
1069 #define QPEL_OP(OPNAME, ROUNDER, RND, OP, MMX)\ | |
1070 \ | |
1071 static void OPNAME ## qpel8_mc00_ ## MMX (UINT8 *dst, UINT8 *src, int stride){\ | |
1072 put_pixels8_mmx(dst, src, stride, 8);\ | |
1073 }\ | |
1074 \ | |
1075 static void OPNAME ## qpel8_mc10_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1076 uint64_t temp[32];\ | |
1077 uint8_t * const half= (uint8_t*)temp;\ | |
1078 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(half, src, 8, stride, 8);\ | |
1079 OPNAME ## pixels8_l2_mmx(dst, src, half, stride, stride, 8);\ | |
1080 }\ | |
1081 \ | |
1082 static void OPNAME ## qpel8_mc20_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1083 OPNAME ## mpeg4_qpel8_h_lowpass_ ## MMX(dst, src, stride, stride, 8);\ | |
1084 }\ | |
1085 \ | |
1086 static void OPNAME ## qpel8_mc30_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1087 uint64_t temp[32];\ | |
1088 uint8_t * const half= (uint8_t*)temp;\ | |
1089 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(half, src, 8, stride, 8);\ | |
1090 OPNAME ## pixels8_l2_mmx(dst, src+1, half, stride, stride, 8);\ | |
1091 }\ | |
1092 \ | |
1093 static void OPNAME ## qpel8_mc01_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1094 uint64_t temp[32];\ | |
1095 uint8_t * const half= (uint8_t*)temp;\ | |
1096 put ## RND ## mpeg4_qpel8_v_lowpass_mmx(half, src, 8, stride);\ | |
1097 OPNAME ## pixels8_l2_mmx(dst, src, half, stride, stride, 8);\ | |
1098 }\ | |
1099 \ | |
1100 static void OPNAME ## qpel8_mc02_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1101 OPNAME ## mpeg4_qpel8_v_lowpass_mmx(dst, src, stride, stride);\ | |
1102 }\ | |
1103 \ | |
1104 static void OPNAME ## qpel8_mc03_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1105 uint64_t temp[32];\ | |
1106 uint8_t * const half= (uint8_t*)temp;\ | |
1107 put ## RND ## mpeg4_qpel8_v_lowpass_mmx(half, src, 8, stride);\ | |
1108 OPNAME ## pixels8_l2_mmx(dst, src+stride, half, stride, stride, 8);\ | |
1109 }\ | |
1110 static void OPNAME ## qpel8_mc11_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1111 uint64_t half[8*2 + 8*2 + 18*2];\ | |
1112 uint8_t * const halfH= ((uint8_t*)half) + 2*64 + 8;\ | |
1113 uint8_t * const halfV= ((uint8_t*)half);\ | |
1114 uint8_t * const halfHV= ((uint8_t*)half) + 64;\ | |
1115 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\ | |
1116 put ## RND ## mpeg4_qpel8_v_lowpass_mmx(halfV, src, 8, stride);\ | |
1117 put ## RND ## mpeg4_qpel8_v_lowpass_mmx(halfHV, halfH, 8, 8);\ | |
1118 OPNAME ## pixels8_l4_mmx(dst, src, (uint8_t*)half, stride, 8);\ | |
1119 }\ | |
1120 static void OPNAME ## qpel8_mc31_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1121 uint64_t half[8*2 + 8*2 + 18*2];\ | |
1122 uint8_t * const halfH= ((uint8_t*)half) + 2*64 + 8;\ | |
1123 uint8_t * const halfV= ((uint8_t*)half);\ | |
1124 uint8_t * const halfHV= ((uint8_t*)half) + 64;\ | |
1125 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\ | |
1126 put ## RND ## mpeg4_qpel8_v_lowpass_mmx(halfV, src+1, 8, stride);\ | |
1127 put ## RND ## mpeg4_qpel8_v_lowpass_mmx(halfHV, halfH, 8, 8);\ | |
1128 OPNAME ## pixels8_l4_mmx(dst, src+1, (uint8_t*)half, stride, 8);\ | |
1129 }\ | |
1130 static void OPNAME ## qpel8_mc13_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1131 uint64_t half[8*2 + 8*2 + 9*2];\ | |
1132 uint8_t * const halfH= ((uint8_t*)half) + 2*64;\ | |
1133 uint8_t * const halfV= ((uint8_t*)half);\ | |
1134 uint8_t * const halfHV= ((uint8_t*)half) + 64;\ | |
1135 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\ | |
1136 put ## RND ## mpeg4_qpel8_v_lowpass_mmx(halfV, src, 8, stride);\ | |
1137 put ## RND ## mpeg4_qpel8_v_lowpass_mmx(halfHV, halfH, 8, 8);\ | |
1138 OPNAME ## pixels8_l4_mmx(dst, src+stride, (uint8_t*)half, stride, 8);\ | |
1139 }\ | |
1140 static void OPNAME ## qpel8_mc33_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1141 uint64_t half[8*2 + 8*2 + 9*2];\ | |
1142 uint8_t * const halfH= ((uint8_t*)half) + 2*64;\ | |
1143 uint8_t * const halfV= ((uint8_t*)half);\ | |
1144 uint8_t * const halfHV= ((uint8_t*)half) + 64;\ | |
1145 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src , 8, stride, 9);\ | |
1146 put ## RND ## mpeg4_qpel8_v_lowpass_mmx(halfV, src+1, 8, stride);\ | |
1147 put ## RND ## mpeg4_qpel8_v_lowpass_mmx(halfHV, halfH, 8, 8);\ | |
1148 OPNAME ## pixels8_l4_mmx(dst, src+stride+1, (uint8_t*)half, stride, 8);\ | |
1149 }\ | |
1150 static void OPNAME ## qpel8_mc21_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1151 uint64_t half[8*2 + 9*2];\ | |
1152 uint8_t * const halfH= ((uint8_t*)half) + 64;\ | |
1153 uint8_t * const halfHV= ((uint8_t*)half);\ | |
1154 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\ | |
1155 put ## RND ## mpeg4_qpel8_v_lowpass_mmx(halfHV, halfH, 8, 8);\ | |
1156 OPNAME ## pixels8_l2_mmx(dst, halfH, halfHV, stride, 8, 8);\ | |
1157 }\ | |
1158 static void OPNAME ## qpel8_mc23_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1159 uint64_t half[8*2 + 9*2];\ | |
1160 uint8_t * const halfH= ((uint8_t*)half) + 64;\ | |
1161 uint8_t * const halfHV= ((uint8_t*)half);\ | |
1162 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\ | |
1163 put ## RND ## mpeg4_qpel8_v_lowpass_mmx(halfHV, halfH, 8, 8);\ | |
1164 OPNAME ## pixels8_l2_mmx(dst, halfH+8, halfHV, stride, 8, 8);\ | |
1165 }\ | |
1166 static void OPNAME ## qpel8_mc12_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1167 uint64_t half[8*2 + 8*2 + 9*2];\ | |
1168 uint8_t * const halfH= ((uint8_t*)half) + 2*64;\ | |
1169 uint8_t * const halfV= ((uint8_t*)half);\ | |
1170 uint8_t * const halfHV= ((uint8_t*)half) + 64;\ | |
1171 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\ | |
1172 put ## RND ## mpeg4_qpel8_v_lowpass_mmx(halfV, src, 8, stride);\ | |
1173 put ## RND ## mpeg4_qpel8_v_lowpass_mmx(halfHV, halfH, 8, 8);\ | |
1174 OPNAME ## pixels8_l2_mmx(dst, halfV, halfHV, stride, 8, 8);\ | |
1175 }\ | |
1176 static void OPNAME ## qpel8_mc32_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1177 uint64_t half[8*2 + 8*2 + 9*2];\ | |
1178 uint8_t * const halfH= ((uint8_t*)half) + 2*64;\ | |
1179 uint8_t * const halfV= ((uint8_t*)half);\ | |
1180 uint8_t * const halfHV= ((uint8_t*)half) + 64;\ | |
1181 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\ | |
1182 put ## RND ## mpeg4_qpel8_v_lowpass_mmx(halfV, src+1, 8, stride);\ | |
1183 put ## RND ## mpeg4_qpel8_v_lowpass_mmx(halfHV, halfH, 8, 8);\ | |
1184 OPNAME ## pixels8_l2_mmx(dst, halfV, halfHV, stride, 8, 8);\ | |
1185 }\ | |
1186 static void OPNAME ## qpel8_mc22_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1187 uint64_t half[9*2];\ | |
1188 uint8_t * const halfH= ((uint8_t*)half);\ | |
1189 put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\ | |
1190 OPNAME ## mpeg4_qpel8_v_lowpass_mmx(dst, halfH, stride, 8);\ | |
1191 }\ | |
1192 static void OPNAME ## qpel16_mc00_ ## MMX (UINT8 *dst, UINT8 *src, int stride){\ | |
1193 put_pixels16_mmx(dst, src, stride, 16);\ | |
1194 }\ | |
1195 \ | |
1196 static void OPNAME ## qpel16_mc10_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1197 uint64_t temp[32];\ | |
1198 uint8_t * const half= (uint8_t*)temp;\ | |
1199 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(half, src, 16, stride, 16);\ | |
1200 OPNAME ## pixels16_l2_mmx(dst, src, half, stride, stride, 16);\ | |
1201 }\ | |
1202 \ | |
1203 static void OPNAME ## qpel16_mc20_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1204 OPNAME ## mpeg4_qpel16_h_lowpass_ ## MMX(dst, src, stride, stride, 16);\ | |
1205 }\ | |
1206 \ | |
1207 static void OPNAME ## qpel16_mc30_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1208 uint64_t temp[32];\ | |
1209 uint8_t * const half= (uint8_t*)temp;\ | |
1210 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(half, src, 16, stride, 16);\ | |
1211 OPNAME ## pixels16_l2_mmx(dst, src+1, half, stride, stride, 16);\ | |
1212 }\ | |
1213 \ | |
1214 static void OPNAME ## qpel16_mc01_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1215 uint64_t temp[32];\ | |
1216 uint8_t * const half= (uint8_t*)temp;\ | |
1217 put ## RND ## mpeg4_qpel16_v_lowpass_mmx(half, src, 16, stride);\ | |
1218 OPNAME ## pixels16_l2_mmx(dst, src, half, stride, stride, 16);\ | |
1219 }\ | |
1220 \ | |
1221 static void OPNAME ## qpel16_mc02_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1222 OPNAME ## mpeg4_qpel16_v_lowpass_mmx(dst, src, stride, stride);\ | |
1223 }\ | |
1224 \ | |
1225 static void OPNAME ## qpel16_mc03_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1226 uint64_t temp[32];\ | |
1227 uint8_t * const half= (uint8_t*)temp;\ | |
1228 put ## RND ## mpeg4_qpel16_v_lowpass_mmx(half, src, 16, stride);\ | |
1229 OPNAME ## pixels16_l2_mmx(dst, src+stride, half, stride, stride, 16);\ | |
1230 }\ | |
1231 static void OPNAME ## qpel16_mc11_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1232 uint64_t half[16*2 + 16*2 + 18*2];\ | |
1233 uint8_t * const halfH= ((uint8_t*)half) + 2*256 + 16;\ | |
1234 uint8_t * const halfV= ((uint8_t*)half);\ | |
1235 uint8_t * const halfHV= ((uint8_t*)half) + 256;\ | |
1236 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\ | |
1237 put ## RND ## mpeg4_qpel16_v_lowpass_mmx(halfV, src, 16, stride);\ | |
1238 put ## RND ## mpeg4_qpel16_v_lowpass_mmx(halfHV, halfH, 16, 16);\ | |
1239 OPNAME ## pixels16_l4_mmx(dst, src, (uint8_t*)half, stride, 16);\ | |
1240 }\ | |
1241 static void OPNAME ## qpel16_mc31_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1242 uint64_t half[16*2 + 16*2 + 18*2];\ | |
1243 uint8_t * const halfH= ((uint8_t*)half) + 2*256 + 16;\ | |
1244 uint8_t * const halfV= ((uint8_t*)half);\ | |
1245 uint8_t * const halfHV= ((uint8_t*)half) + 256;\ | |
1246 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\ | |
1247 put ## RND ## mpeg4_qpel16_v_lowpass_mmx(halfV, src+1, 16, stride);\ | |
1248 put ## RND ## mpeg4_qpel16_v_lowpass_mmx(halfHV, halfH, 16, 16);\ | |
1249 OPNAME ## pixels16_l4_mmx(dst, src+1, (uint8_t*)half, stride, 16);\ | |
1250 }\ | |
1251 static void OPNAME ## qpel16_mc13_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1252 uint64_t half[16*2 + 16*2 + 17*2];\ | |
1253 uint8_t * const halfH= ((uint8_t*)half) + 2*256;\ | |
1254 uint8_t * const halfV= ((uint8_t*)half);\ | |
1255 uint8_t * const halfHV= ((uint8_t*)half) + 256;\ | |
1256 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\ | |
1257 put ## RND ## mpeg4_qpel16_v_lowpass_mmx(halfV, src, 16, stride);\ | |
1258 put ## RND ## mpeg4_qpel16_v_lowpass_mmx(halfHV, halfH, 16, 16);\ | |
1259 OPNAME ## pixels16_l4_mmx(dst, src+stride, (uint8_t*)half, stride, 16);\ | |
1260 }\ | |
1261 static void OPNAME ## qpel16_mc33_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1262 uint64_t half[16*2 + 16*2 + 17*2];\ | |
1263 uint8_t * const halfH= ((uint8_t*)half) + 2*256;\ | |
1264 uint8_t * const halfV= ((uint8_t*)half);\ | |
1265 uint8_t * const halfHV= ((uint8_t*)half) + 256;\ | |
1266 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src , 16, stride, 17);\ | |
1267 put ## RND ## mpeg4_qpel16_v_lowpass_mmx(halfV, src+1, 16, stride);\ | |
1268 put ## RND ## mpeg4_qpel16_v_lowpass_mmx(halfHV, halfH, 16, 16);\ | |
1269 OPNAME ## pixels16_l4_mmx(dst, src+stride+1, (uint8_t*)half, stride, 16);\ | |
1270 }\ | |
1271 static void OPNAME ## qpel16_mc21_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1272 uint64_t half[16*2 + 17*2];\ | |
1273 uint8_t * const halfH= ((uint8_t*)half) + 256;\ | |
1274 uint8_t * const halfHV= ((uint8_t*)half);\ | |
1275 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\ | |
1276 put ## RND ## mpeg4_qpel16_v_lowpass_mmx(halfHV, halfH, 16, 16);\ | |
1277 OPNAME ## pixels16_l2_mmx(dst, halfH, halfHV, stride, 16, 16);\ | |
1278 }\ | |
1279 static void OPNAME ## qpel16_mc23_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1280 uint64_t half[16*2 + 17*2];\ | |
1281 uint8_t * const halfH= ((uint8_t*)half) + 256;\ | |
1282 uint8_t * const halfHV= ((uint8_t*)half);\ | |
1283 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\ | |
1284 put ## RND ## mpeg4_qpel16_v_lowpass_mmx(halfHV, halfH, 16, 16);\ | |
1285 OPNAME ## pixels16_l2_mmx(dst, halfH+16, halfHV, stride, 16, 16);\ | |
1286 }\ | |
1287 static void OPNAME ## qpel16_mc12_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1288 uint64_t half[16*2 + 16*2 + 17*2];\ | |
1289 uint8_t * const halfH= ((uint8_t*)half) + 2*256;\ | |
1290 uint8_t * const halfV= ((uint8_t*)half);\ | |
1291 uint8_t * const halfHV= ((uint8_t*)half) + 256;\ | |
1292 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\ | |
1293 put ## RND ## mpeg4_qpel16_v_lowpass_mmx(halfV, src, 16, stride);\ | |
1294 put ## RND ## mpeg4_qpel16_v_lowpass_mmx(halfHV, halfH, 16, 16);\ | |
1295 OPNAME ## pixels16_l2_mmx(dst, halfV, halfHV, stride, 16, 16);\ | |
1296 }\ | |
1297 static void OPNAME ## qpel16_mc32_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1298 uint64_t half[16*2 + 16*2 + 17*2];\ | |
1299 uint8_t * const halfH= ((uint8_t*)half) + 2*256;\ | |
1300 uint8_t * const halfV= ((uint8_t*)half);\ | |
1301 uint8_t * const halfHV= ((uint8_t*)half) + 256;\ | |
1302 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\ | |
1303 put ## RND ## mpeg4_qpel16_v_lowpass_mmx(halfV, src+1, 16, stride);\ | |
1304 put ## RND ## mpeg4_qpel16_v_lowpass_mmx(halfHV, halfH, 16, 16);\ | |
1305 OPNAME ## pixels16_l2_mmx(dst, halfV, halfHV, stride, 16, 16);\ | |
1306 }\ | |
1307 static void OPNAME ## qpel16_mc22_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\ | |
1308 uint64_t half[17*2];\ | |
1309 uint8_t * const halfH= ((uint8_t*)half);\ | |
1310 put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\ | |
1311 OPNAME ## mpeg4_qpel16_v_lowpass_mmx(dst, halfH, stride, 16);\ | |
1312 } | |
1313 | |
1314 | |
1315 #define PUT_OP(a,b,temp, size) "mov" #size " " #a ", " #b " \n\t" | |
1316 #define AVG_OP(a,b,temp, size) \ | |
1317 "mov" #size " " #b ", " #temp " \n\t"\ | |
1318 "pavgusb " #temp ", " #a " \n\t"\ | |
1319 "mov" #size " " #a ", " #b " \n\t" | |
1320 | |
1321 QPEL_BASE(put_ , ff_pw_16, _ , PUT_OP) | |
1322 QPEL_BASE(avg_ , ff_pw_16, _ , AVG_OP) | |
1323 QPEL_BASE(put_no_rnd_, ff_pw_15, _no_rnd_, PUT_OP) | |
1324 QPEL_OP(put_ , ff_pw_16, _ , PUT_OP, 3dnow) | |
1325 QPEL_OP(avg_ , ff_pw_16, _ , AVG_OP, 3dnow) | |
1326 QPEL_OP(put_no_rnd_, ff_pw_15, _no_rnd_, PUT_OP, 3dnow) | |
1327 | |
1328 #undef AVG_OP | |
1329 #define AVG_OP(a,b,temp, size) \ | |
1330 "mov" #size " " #b ", " #temp " \n\t"\ | |
1331 "pavgb " #temp ", " #a " \n\t"\ | |
1332 "mov" #size " " #a ", " #b " \n\t" | |
1333 QPEL_OP(put_ , ff_pw_16, _ , PUT_OP, mmx2) | |
1334 QPEL_OP(avg_ , ff_pw_16, _ , AVG_OP, mmx2) | |
1335 QPEL_OP(put_no_rnd_, ff_pw_15, _no_rnd_, PUT_OP, mmx2) | |
1336 | |
393 | 1337 #if 0 |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1338 static void just_return() { return; } |
393 | 1339 #endif |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1340 |
954 | 1341 #define SET_QPEL_FUNC(postfix1, postfix2) \ |
1342 c->put_ ## postfix1 = put_ ## postfix2;\ | |
1343 c->put_no_rnd_ ## postfix1 = put_no_rnd_ ## postfix2;\ | |
1344 c->avg_ ## postfix1 = avg_ ## postfix2; | |
1345 | |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1346 void dsputil_init_mmx(DSPContext* c, unsigned mask) |
0 | 1347 { |
1348 mm_flags = mm_support(); | |
631
47a8964ba5cd
be less verbose patch by (Lennert Buytenhek <buytenh at math dot leidenuniv dot nl>)
michaelni
parents:
629
diff
changeset
|
1349 #if 0 |
47a8964ba5cd
be less verbose patch by (Lennert Buytenhek <buytenh at math dot leidenuniv dot nl>)
michaelni
parents:
629
diff
changeset
|
1350 fprintf(stderr, "libavcodec: CPU flags:"); |
0 | 1351 if (mm_flags & MM_MMX) |
631
47a8964ba5cd
be less verbose patch by (Lennert Buytenhek <buytenh at math dot leidenuniv dot nl>)
michaelni
parents:
629
diff
changeset
|
1352 fprintf(stderr, " mmx"); |
0 | 1353 if (mm_flags & MM_MMXEXT) |
631
47a8964ba5cd
be less verbose patch by (Lennert Buytenhek <buytenh at math dot leidenuniv dot nl>)
michaelni
parents:
629
diff
changeset
|
1354 fprintf(stderr, " mmxext"); |
0 | 1355 if (mm_flags & MM_3DNOW) |
631
47a8964ba5cd
be less verbose patch by (Lennert Buytenhek <buytenh at math dot leidenuniv dot nl>)
michaelni
parents:
629
diff
changeset
|
1356 fprintf(stderr, " 3dnow"); |
0 | 1357 if (mm_flags & MM_SSE) |
631
47a8964ba5cd
be less verbose patch by (Lennert Buytenhek <buytenh at math dot leidenuniv dot nl>)
michaelni
parents:
629
diff
changeset
|
1358 fprintf(stderr, " sse"); |
0 | 1359 if (mm_flags & MM_SSE2) |
631
47a8964ba5cd
be less verbose patch by (Lennert Buytenhek <buytenh at math dot leidenuniv dot nl>)
michaelni
parents:
629
diff
changeset
|
1360 fprintf(stderr, " sse2"); |
47a8964ba5cd
be less verbose patch by (Lennert Buytenhek <buytenh at math dot leidenuniv dot nl>)
michaelni
parents:
629
diff
changeset
|
1361 fprintf(stderr, "\n"); |
0 | 1362 #endif |
1363 | |
1364 if (mm_flags & MM_MMX) { | |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1365 c->get_pixels = get_pixels_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1366 c->diff_pixels = diff_pixels_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1367 c->put_pixels_clamped = put_pixels_clamped_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1368 c->add_pixels_clamped = add_pixels_clamped_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1369 c->clear_blocks = clear_blocks_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1370 c->pix_sum = pix_sum16_mmx; |
415 | 1371 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1372 c->pix_abs16x16 = pix_abs16x16_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1373 c->pix_abs16x16_x2 = pix_abs16x16_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1374 c->pix_abs16x16_y2 = pix_abs16x16_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1375 c->pix_abs16x16_xy2 = pix_abs16x16_xy2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1376 c->pix_abs8x8 = pix_abs8x8_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1377 c->pix_abs8x8_x2 = pix_abs8x8_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1378 c->pix_abs8x8_y2 = pix_abs8x8_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1379 c->pix_abs8x8_xy2 = pix_abs8x8_xy2_mmx; |
574 | 1380 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1381 c->put_pixels_tab[0][0] = put_pixels16_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1382 c->put_pixels_tab[0][1] = put_pixels16_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1383 c->put_pixels_tab[0][2] = put_pixels16_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1384 c->put_pixels_tab[0][3] = put_pixels16_xy2_mmx; |
0 | 1385 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1386 c->put_no_rnd_pixels_tab[0][0] = put_pixels16_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1387 c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1388 c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1389 c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_mmx; |
651 | 1390 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1391 c->avg_pixels_tab[0][0] = avg_pixels16_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1392 c->avg_pixels_tab[0][1] = avg_pixels16_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1393 c->avg_pixels_tab[0][2] = avg_pixels16_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1394 c->avg_pixels_tab[0][3] = avg_pixels16_xy2_mmx; |
415 | 1395 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1396 c->avg_no_rnd_pixels_tab[0][0] = avg_no_rnd_pixels16_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1397 c->avg_no_rnd_pixels_tab[0][1] = avg_no_rnd_pixels16_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1398 c->avg_no_rnd_pixels_tab[0][2] = avg_no_rnd_pixels16_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1399 c->avg_no_rnd_pixels_tab[0][3] = avg_no_rnd_pixels16_xy2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1400 |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1401 c->put_pixels_tab[1][0] = put_pixels8_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1402 c->put_pixels_tab[1][1] = put_pixels8_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1403 c->put_pixels_tab[1][2] = put_pixels8_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1404 c->put_pixels_tab[1][3] = put_pixels8_xy2_mmx; |
0 | 1405 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1406 c->put_no_rnd_pixels_tab[1][0] = put_pixels8_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1407 c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1408 c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1409 c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_mmx; |
651 | 1410 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1411 c->avg_pixels_tab[1][0] = avg_pixels8_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1412 c->avg_pixels_tab[1][1] = avg_pixels8_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1413 c->avg_pixels_tab[1][2] = avg_pixels8_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1414 c->avg_pixels_tab[1][3] = avg_pixels8_xy2_mmx; |
651 | 1415 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1416 c->avg_no_rnd_pixels_tab[1][0] = avg_no_rnd_pixels8_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1417 c->avg_no_rnd_pixels_tab[1][1] = avg_no_rnd_pixels8_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1418 c->avg_no_rnd_pixels_tab[1][2] = avg_no_rnd_pixels8_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1419 c->avg_no_rnd_pixels_tab[1][3] = avg_no_rnd_pixels8_xy2_mmx; |
954 | 1420 |
866 | 1421 c->add_bytes= add_bytes_mmx; |
1422 c->diff_bytes= diff_bytes_mmx; | |
936 | 1423 |
1424 c->hadamard8_diff[0]= hadamard8_diff16_mmx; | |
1425 c->hadamard8_diff[1]= hadamard8_diff_mmx; | |
1426 | |
1427 c->sad[0]= sad16x16_mmx; | |
1428 c->sad[1]= sad8x8_mmx; | |
1429 | |
0 | 1430 if (mm_flags & MM_MMXEXT) { |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1431 c->pix_abs16x16 = pix_abs16x16_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1432 c->pix_abs16x16_x2 = pix_abs16x16_x2_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1433 c->pix_abs16x16_y2 = pix_abs16x16_y2_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1434 c->pix_abs16x16_xy2 = pix_abs16x16_xy2_mmx2; |
415 | 1435 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1436 c->pix_abs8x8 = pix_abs8x8_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1437 c->pix_abs8x8_x2 = pix_abs8x8_x2_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1438 c->pix_abs8x8_y2 = pix_abs8x8_y2_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1439 c->pix_abs8x8_xy2 = pix_abs8x8_xy2_mmx2; |
386 | 1440 |
936 | 1441 c->sad[0]= sad16x16_mmx2; |
1442 c->sad[1]= sad8x8_mmx2; | |
1443 | |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1444 c->put_pixels_tab[0][1] = put_pixels16_x2_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1445 c->put_pixels_tab[0][2] = put_pixels16_y2_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1446 c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1447 c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_mmx2; |
651 | 1448 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1449 c->avg_pixels_tab[0][0] = avg_pixels16_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1450 c->avg_pixels_tab[0][1] = avg_pixels16_x2_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1451 c->avg_pixels_tab[0][2] = avg_pixels16_y2_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1452 c->avg_pixels_tab[0][3] = avg_pixels16_xy2_mmx2; |
415 | 1453 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1454 c->put_pixels_tab[1][1] = put_pixels8_x2_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1455 c->put_pixels_tab[1][2] = put_pixels8_y2_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1456 c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1457 c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_mmx2; |
651 | 1458 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1459 c->avg_pixels_tab[1][0] = avg_pixels8_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1460 c->avg_pixels_tab[1][1] = avg_pixels8_x2_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1461 c->avg_pixels_tab[1][2] = avg_pixels8_y2_mmx2; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1462 c->avg_pixels_tab[1][3] = avg_pixels8_xy2_mmx2; |
954 | 1463 SET_QPEL_FUNC(qpel_pixels_tab[0][ 0], qpel16_mc00_mmx2) |
1464 SET_QPEL_FUNC(qpel_pixels_tab[0][ 1], qpel16_mc10_mmx2) | |
1465 SET_QPEL_FUNC(qpel_pixels_tab[0][ 2], qpel16_mc20_mmx2) | |
1466 SET_QPEL_FUNC(qpel_pixels_tab[0][ 3], qpel16_mc30_mmx2) | |
1467 SET_QPEL_FUNC(qpel_pixels_tab[0][ 4], qpel16_mc01_mmx2) | |
1468 SET_QPEL_FUNC(qpel_pixels_tab[0][ 5], qpel16_mc11_mmx2) | |
1469 SET_QPEL_FUNC(qpel_pixels_tab[0][ 6], qpel16_mc21_mmx2) | |
1470 SET_QPEL_FUNC(qpel_pixels_tab[0][ 7], qpel16_mc31_mmx2) | |
1471 SET_QPEL_FUNC(qpel_pixels_tab[0][ 8], qpel16_mc02_mmx2) | |
1472 SET_QPEL_FUNC(qpel_pixels_tab[0][ 9], qpel16_mc12_mmx2) | |
1473 SET_QPEL_FUNC(qpel_pixels_tab[0][10], qpel16_mc22_mmx2) | |
1474 SET_QPEL_FUNC(qpel_pixels_tab[0][11], qpel16_mc32_mmx2) | |
1475 SET_QPEL_FUNC(qpel_pixels_tab[0][12], qpel16_mc03_mmx2) | |
1476 SET_QPEL_FUNC(qpel_pixels_tab[0][13], qpel16_mc13_mmx2) | |
1477 SET_QPEL_FUNC(qpel_pixels_tab[0][14], qpel16_mc23_mmx2) | |
1478 SET_QPEL_FUNC(qpel_pixels_tab[0][15], qpel16_mc33_mmx2) | |
1479 SET_QPEL_FUNC(qpel_pixels_tab[1][ 0], qpel8_mc00_mmx2) | |
1480 SET_QPEL_FUNC(qpel_pixels_tab[1][ 1], qpel8_mc10_mmx2) | |
1481 SET_QPEL_FUNC(qpel_pixels_tab[1][ 2], qpel8_mc20_mmx2) | |
1482 SET_QPEL_FUNC(qpel_pixels_tab[1][ 3], qpel8_mc30_mmx2) | |
1483 SET_QPEL_FUNC(qpel_pixels_tab[1][ 4], qpel8_mc01_mmx2) | |
1484 SET_QPEL_FUNC(qpel_pixels_tab[1][ 5], qpel8_mc11_mmx2) | |
1485 SET_QPEL_FUNC(qpel_pixels_tab[1][ 6], qpel8_mc21_mmx2) | |
1486 SET_QPEL_FUNC(qpel_pixels_tab[1][ 7], qpel8_mc31_mmx2) | |
1487 SET_QPEL_FUNC(qpel_pixels_tab[1][ 8], qpel8_mc02_mmx2) | |
1488 SET_QPEL_FUNC(qpel_pixels_tab[1][ 9], qpel8_mc12_mmx2) | |
1489 SET_QPEL_FUNC(qpel_pixels_tab[1][10], qpel8_mc22_mmx2) | |
1490 SET_QPEL_FUNC(qpel_pixels_tab[1][11], qpel8_mc32_mmx2) | |
1491 SET_QPEL_FUNC(qpel_pixels_tab[1][12], qpel8_mc03_mmx2) | |
1492 SET_QPEL_FUNC(qpel_pixels_tab[1][13], qpel8_mc13_mmx2) | |
1493 SET_QPEL_FUNC(qpel_pixels_tab[1][14], qpel8_mc23_mmx2) | |
1494 SET_QPEL_FUNC(qpel_pixels_tab[1][15], qpel8_mc33_mmx2) | |
0 | 1495 } else if (mm_flags & MM_3DNOW) { |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1496 c->put_pixels_tab[0][1] = put_pixels16_x2_3dnow; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1497 c->put_pixels_tab[0][2] = put_pixels16_y2_3dnow; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1498 c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_3dnow; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1499 c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_3dnow; |
393 | 1500 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1501 c->avg_pixels_tab[0][0] = avg_pixels16_3dnow; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1502 c->avg_pixels_tab[0][1] = avg_pixels16_x2_3dnow; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1503 c->avg_pixels_tab[0][2] = avg_pixels16_y2_3dnow; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1504 c->avg_pixels_tab[0][3] = avg_pixels16_xy2_3dnow; |
651 | 1505 |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1506 c->put_pixels_tab[1][1] = put_pixels8_x2_3dnow; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1507 c->put_pixels_tab[1][2] = put_pixels8_y2_3dnow; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1508 c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_3dnow; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1509 c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_3dnow; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1510 |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1511 c->avg_pixels_tab[1][0] = avg_pixels8_3dnow; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1512 c->avg_pixels_tab[1][1] = avg_pixels8_x2_3dnow; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1513 c->avg_pixels_tab[1][2] = avg_pixels8_y2_3dnow; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1514 c->avg_pixels_tab[1][3] = avg_pixels8_xy2_3dnow; |
954 | 1515 |
1516 SET_QPEL_FUNC(qpel_pixels_tab[0][ 0], qpel16_mc00_3dnow) | |
1517 SET_QPEL_FUNC(qpel_pixels_tab[0][ 1], qpel16_mc10_3dnow) | |
1518 SET_QPEL_FUNC(qpel_pixels_tab[0][ 2], qpel16_mc20_3dnow) | |
1519 SET_QPEL_FUNC(qpel_pixels_tab[0][ 3], qpel16_mc30_3dnow) | |
1520 SET_QPEL_FUNC(qpel_pixels_tab[0][ 4], qpel16_mc01_3dnow) | |
1521 SET_QPEL_FUNC(qpel_pixels_tab[0][ 5], qpel16_mc11_3dnow) | |
1522 SET_QPEL_FUNC(qpel_pixels_tab[0][ 6], qpel16_mc21_3dnow) | |
1523 SET_QPEL_FUNC(qpel_pixels_tab[0][ 7], qpel16_mc31_3dnow) | |
1524 SET_QPEL_FUNC(qpel_pixels_tab[0][ 8], qpel16_mc02_3dnow) | |
1525 SET_QPEL_FUNC(qpel_pixels_tab[0][ 9], qpel16_mc12_3dnow) | |
1526 SET_QPEL_FUNC(qpel_pixels_tab[0][10], qpel16_mc22_3dnow) | |
1527 SET_QPEL_FUNC(qpel_pixels_tab[0][11], qpel16_mc32_3dnow) | |
1528 SET_QPEL_FUNC(qpel_pixels_tab[0][12], qpel16_mc03_3dnow) | |
1529 SET_QPEL_FUNC(qpel_pixels_tab[0][13], qpel16_mc13_3dnow) | |
1530 SET_QPEL_FUNC(qpel_pixels_tab[0][14], qpel16_mc23_3dnow) | |
1531 SET_QPEL_FUNC(qpel_pixels_tab[0][15], qpel16_mc33_3dnow) | |
1532 SET_QPEL_FUNC(qpel_pixels_tab[1][ 0], qpel8_mc00_3dnow) | |
1533 SET_QPEL_FUNC(qpel_pixels_tab[1][ 1], qpel8_mc10_3dnow) | |
1534 SET_QPEL_FUNC(qpel_pixels_tab[1][ 2], qpel8_mc20_3dnow) | |
1535 SET_QPEL_FUNC(qpel_pixels_tab[1][ 3], qpel8_mc30_3dnow) | |
1536 SET_QPEL_FUNC(qpel_pixels_tab[1][ 4], qpel8_mc01_3dnow) | |
1537 SET_QPEL_FUNC(qpel_pixels_tab[1][ 5], qpel8_mc11_3dnow) | |
1538 SET_QPEL_FUNC(qpel_pixels_tab[1][ 6], qpel8_mc21_3dnow) | |
1539 SET_QPEL_FUNC(qpel_pixels_tab[1][ 7], qpel8_mc31_3dnow) | |
1540 SET_QPEL_FUNC(qpel_pixels_tab[1][ 8], qpel8_mc02_3dnow) | |
1541 SET_QPEL_FUNC(qpel_pixels_tab[1][ 9], qpel8_mc12_3dnow) | |
1542 SET_QPEL_FUNC(qpel_pixels_tab[1][10], qpel8_mc22_3dnow) | |
1543 SET_QPEL_FUNC(qpel_pixels_tab[1][11], qpel8_mc32_3dnow) | |
1544 SET_QPEL_FUNC(qpel_pixels_tab[1][12], qpel8_mc03_3dnow) | |
1545 SET_QPEL_FUNC(qpel_pixels_tab[1][13], qpel8_mc13_3dnow) | |
1546 SET_QPEL_FUNC(qpel_pixels_tab[1][14], qpel8_mc23_3dnow) | |
1547 SET_QPEL_FUNC(qpel_pixels_tab[1][15], qpel8_mc33_3dnow) | |
0 | 1548 } |
1549 } | |
247
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1550 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1551 #if 0 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1552 // for speed testing |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1553 get_pixels = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1554 put_pixels_clamped = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1555 add_pixels_clamped = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1556 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1557 pix_abs16x16 = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1558 pix_abs16x16_x2 = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1559 pix_abs16x16_y2 = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1560 pix_abs16x16_xy2 = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1561 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1562 put_pixels_tab[0] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1563 put_pixels_tab[1] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1564 put_pixels_tab[2] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1565 put_pixels_tab[3] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1566 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1567 put_no_rnd_pixels_tab[0] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1568 put_no_rnd_pixels_tab[1] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1569 put_no_rnd_pixels_tab[2] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1570 put_no_rnd_pixels_tab[3] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1571 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1572 avg_pixels_tab[0] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1573 avg_pixels_tab[1] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1574 avg_pixels_tab[2] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1575 avg_pixels_tab[3] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1576 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1577 avg_no_rnd_pixels_tab[0] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1578 avg_no_rnd_pixels_tab[1] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1579 avg_no_rnd_pixels_tab[2] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1580 avg_no_rnd_pixels_tab[3] = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1581 |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1582 //av_fdct = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1583 //ff_idct = just_return; |
6f48cacd9ed9
* some modifications to allow gcc to compile same code for -fPIC
kabi
parents:
188
diff
changeset
|
1584 #endif |
0 | 1585 } |
402 | 1586 |
1587 /* remove any non bit exact operation (testing purpose). NOTE that | |
1588 this function should be kept as small as possible because it is | |
1589 always difficult to test automatically non bit exact cases. */ | |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1590 void dsputil_set_bit_exact_mmx(DSPContext* c, unsigned mask) |
402 | 1591 { |
1592 if (mm_flags & MM_MMX) { | |
651 | 1593 /* MMX2 & 3DNOW */ |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1594 c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1595 c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1596 c->avg_pixels_tab[0][3] = avg_pixels16_xy2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1597 c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1598 c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1599 c->avg_pixels_tab[1][3] = avg_pixels8_xy2_mmx; |
651 | 1600 |
402 | 1601 if (mm_flags & MM_MMXEXT) { |
853
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1602 c->pix_abs16x16_x2 = pix_abs16x16_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1603 c->pix_abs16x16_y2 = pix_abs16x16_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1604 c->pix_abs16x16_xy2 = pix_abs16x16_xy2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1605 c->pix_abs8x8_x2 = pix_abs8x8_x2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1606 c->pix_abs8x8_y2 = pix_abs8x8_y2_mmx; |
eacc2dd8fd9d
* using DSPContext - so each codec could use its local (sub)set of CPU extension
kabi
parents:
706
diff
changeset
|
1607 c->pix_abs8x8_xy2= pix_abs8x8_xy2_mmx; |
402 | 1608 } |
1609 } | |
1610 } |