38 ptrdiff_t line_size,
int h);
40 ptrdiff_t line_size,
int h);
42 ptrdiff_t line_size,
int h);
44 ptrdiff_t line_size,
int h);
46 ptrdiff_t line_size,
int h);
48 ptrdiff_t line_size,
int h);
50 ptrdiff_t line_size,
int h);
52 const uint8_t *pixels,
53 ptrdiff_t line_size,
int h);
55 ptrdiff_t line_size,
int h);
57 ptrdiff_t line_size,
int h);
59 const uint8_t *pixels,
60 ptrdiff_t line_size,
int h);
62 ptrdiff_t line_size,
int h);
64 ptrdiff_t line_size,
int h);
66 ptrdiff_t line_size,
int h);
68 #define put_pixels8_mmx ff_put_pixels8_mmx
69 #define put_pixels16_mmx ff_put_pixels16_mmx
70 #define put_pixels8_xy2_mmx ff_put_pixels8_xy2_mmx
71 #define put_no_rnd_pixels8_mmx ff_put_pixels8_mmx
72 #define put_no_rnd_pixels16_mmx ff_put_pixels16_mmx
78 #define DEF(x, y) x ## _no_rnd_ ## y ## _mmx
79 #define SET_RND MOVQ_WONE
89 static void avg_no_rnd_pixels8_xy2_mmx(uint8_t *
block,
const uint8_t *pixels,
90 ptrdiff_t line_size,
int h)
95 "movq (%1), %%mm0 \n\t"
96 "movq 1(%1), %%mm4 \n\t"
97 "movq %%mm0, %%mm1 \n\t"
98 "movq %%mm4, %%mm5 \n\t"
99 "punpcklbw %%mm7, %%mm0 \n\t"
100 "punpcklbw %%mm7, %%mm4 \n\t"
101 "punpckhbw %%mm7, %%mm1 \n\t"
102 "punpckhbw %%mm7, %%mm5 \n\t"
103 "paddusw %%mm0, %%mm4 \n\t"
104 "paddusw %%mm1, %%mm5 \n\t"
105 "xor %%"FF_REG_a
", %%"FF_REG_a
" \n\t"
109 "movq (%1, %%"FF_REG_a
"), %%mm0 \n\t"
110 "movq 1(%1, %%"FF_REG_a
"), %%mm2 \n\t"
111 "movq %%mm0, %%mm1 \n\t"
112 "movq %%mm2, %%mm3 \n\t"
113 "punpcklbw %%mm7, %%mm0 \n\t"
114 "punpcklbw %%mm7, %%mm2 \n\t"
115 "punpckhbw %%mm7, %%mm1 \n\t"
116 "punpckhbw %%mm7, %%mm3 \n\t"
117 "paddusw %%mm2, %%mm0 \n\t"
118 "paddusw %%mm3, %%mm1 \n\t"
119 "paddusw %%mm6, %%mm4 \n\t"
120 "paddusw %%mm6, %%mm5 \n\t"
121 "paddusw %%mm0, %%mm4 \n\t"
122 "paddusw %%mm1, %%mm5 \n\t"
123 "psrlw $2, %%mm4 \n\t"
124 "psrlw $2, %%mm5 \n\t"
125 "movq (%2, %%"FF_REG_a
"), %%mm3 \n\t"
126 "packuswb %%mm5, %%mm4 \n\t"
127 "pcmpeqd %%mm2, %%mm2 \n\t"
128 "paddb %%mm2, %%mm2 \n\t"
130 "movq %%mm5, (%2, %%"FF_REG_a
") \n\t"
131 "add %3, %%"FF_REG_a
" \n\t"
133 "movq (%1, %%"FF_REG_a
"), %%mm2 \n\t"
134 "movq 1(%1, %%"FF_REG_a
"), %%mm4 \n\t"
135 "movq %%mm2, %%mm3 \n\t"
136 "movq %%mm4, %%mm5 \n\t"
137 "punpcklbw %%mm7, %%mm2 \n\t"
138 "punpcklbw %%mm7, %%mm4 \n\t"
139 "punpckhbw %%mm7, %%mm3 \n\t"
140 "punpckhbw %%mm7, %%mm5 \n\t"
141 "paddusw %%mm2, %%mm4 \n\t"
142 "paddusw %%mm3, %%mm5 \n\t"
143 "paddusw %%mm6, %%mm0 \n\t"
144 "paddusw %%mm6, %%mm1 \n\t"
145 "paddusw %%mm4, %%mm0 \n\t"
146 "paddusw %%mm5, %%mm1 \n\t"
147 "psrlw $2, %%mm0 \n\t"
148 "psrlw $2, %%mm1 \n\t"
149 "movq (%2, %%"FF_REG_a
"), %%mm3 \n\t"
150 "packuswb %%mm1, %%mm0 \n\t"
151 "pcmpeqd %%mm2, %%mm2 \n\t"
152 "paddb %%mm2, %%mm2 \n\t"
154 "movq %%mm1, (%2, %%"FF_REG_a
") \n\t"
155 "add %3, %%"FF_REG_a
" \n\t"
159 :
"+g"(
h),
"+S"(pixels)
161 :FF_REG_a,
"memory");
164 static void put_no_rnd_pixels8_x2_mmx(uint8_t *
block,
const uint8_t *pixels, ptrdiff_t line_size,
int h)
168 "lea (%3, %3), %%"FF_REG_a
" \n\t"
171 "movq (%1), %%mm0 \n\t"
172 "movq 1(%1), %%mm1 \n\t"
173 "movq (%1, %3), %%mm2 \n\t"
174 "movq 1(%1, %3), %%mm3 \n\t"
176 "movq %%mm4, (%2) \n\t"
177 "movq %%mm5, (%2, %3) \n\t"
178 "add %%"FF_REG_a
", %1 \n\t"
179 "add %%"FF_REG_a
", %2 \n\t"
180 "movq (%1), %%mm0 \n\t"
181 "movq 1(%1), %%mm1 \n\t"
182 "movq (%1, %3), %%mm2 \n\t"
183 "movq 1(%1, %3), %%mm3 \n\t"
185 "movq %%mm4, (%2) \n\t"
186 "movq %%mm5, (%2, %3) \n\t"
187 "add %%"FF_REG_a
", %1 \n\t"
188 "add %%"FF_REG_a
", %2 \n\t"
191 :
"+g"(
h),
"+S"(pixels),
"+D"(
block)
193 :FF_REG_a,
"memory");
196 static void put_no_rnd_pixels16_x2_mmx(uint8_t *
block,
const uint8_t *pixels, ptrdiff_t line_size,
int h)
200 "lea (%3, %3), %%"FF_REG_a
" \n\t"
203 "movq (%1), %%mm0 \n\t"
204 "movq 1(%1), %%mm1 \n\t"
205 "movq (%1, %3), %%mm2 \n\t"
206 "movq 1(%1, %3), %%mm3 \n\t"
208 "movq %%mm4, (%2) \n\t"
209 "movq %%mm5, (%2, %3) \n\t"
210 "movq 8(%1), %%mm0 \n\t"
211 "movq 9(%1), %%mm1 \n\t"
212 "movq 8(%1, %3), %%mm2 \n\t"
213 "movq 9(%1, %3), %%mm3 \n\t"
215 "movq %%mm4, 8(%2) \n\t"
216 "movq %%mm5, 8(%2, %3) \n\t"
217 "add %%"FF_REG_a
", %1 \n\t"
218 "add %%"FF_REG_a
", %2 \n\t"
219 "movq (%1), %%mm0 \n\t"
220 "movq 1(%1), %%mm1 \n\t"
221 "movq (%1, %3), %%mm2 \n\t"
222 "movq 1(%1, %3), %%mm3 \n\t"
224 "movq %%mm4, (%2) \n\t"
225 "movq %%mm5, (%2, %3) \n\t"
226 "movq 8(%1), %%mm0 \n\t"
227 "movq 9(%1), %%mm1 \n\t"
228 "movq 8(%1, %3), %%mm2 \n\t"
229 "movq 9(%1, %3), %%mm3 \n\t"
231 "movq %%mm4, 8(%2) \n\t"
232 "movq %%mm5, 8(%2, %3) \n\t"
233 "add %%"FF_REG_a
", %1 \n\t"
234 "add %%"FF_REG_a
", %2 \n\t"
237 :
"+g"(
h),
"+S"(pixels),
"+D"(
block)
239 :FF_REG_a,
"memory");
242 static void put_no_rnd_pixels8_y2_mmx(uint8_t *
block,
const uint8_t *pixels, ptrdiff_t line_size,
int h)
246 "lea (%3, %3), %%"FF_REG_a
" \n\t"
247 "movq (%1), %%mm0 \n\t"
250 "movq (%1, %3), %%mm1 \n\t"
251 "movq (%1, %%"FF_REG_a
"),%%mm2\n\t"
253 "movq %%mm4, (%2) \n\t"
254 "movq %%mm5, (%2, %3) \n\t"
255 "add %%"FF_REG_a
", %1 \n\t"
256 "add %%"FF_REG_a
", %2 \n\t"
257 "movq (%1, %3), %%mm1 \n\t"
258 "movq (%1, %%"FF_REG_a
"),%%mm0\n\t"
260 "movq %%mm4, (%2) \n\t"
261 "movq %%mm5, (%2, %3) \n\t"
262 "add %%"FF_REG_a
", %1 \n\t"
263 "add %%"FF_REG_a
", %2 \n\t"
266 :
"+g"(
h),
"+S"(pixels),
"+D"(
block)
268 :FF_REG_a,
"memory");
271 static void avg_no_rnd_pixels16_x2_mmx(uint8_t *
block,
const uint8_t *pixels, ptrdiff_t line_size,
int h)
277 "movq (%1), %%mm0 \n\t"
278 "movq 1(%1), %%mm1 \n\t"
279 "movq (%2), %%mm3 \n\t"
282 "movq %%mm0, (%2) \n\t"
283 "movq 8(%1), %%mm0 \n\t"
284 "movq 9(%1), %%mm1 \n\t"
285 "movq 8(%2), %%mm3 \n\t"
288 "movq %%mm0, 8(%2) \n\t"
293 :
"+g"(
h),
"+S"(pixels),
"+D"(
block)
298 static void avg_no_rnd_pixels8_y2_mmx(uint8_t *
block,
const uint8_t *pixels, ptrdiff_t line_size,
int h)
302 "lea (%3, %3), %%"FF_REG_a
" \n\t"
303 "movq (%1), %%mm0 \n\t"
306 "movq (%1, %3), %%mm1 \n\t"
307 "movq (%1, %%"FF_REG_a
"), %%mm2 \n\t"
309 "movq (%2), %%mm3 \n\t"
311 "movq (%2, %3), %%mm3 \n\t"
313 "movq %%mm0, (%2) \n\t"
314 "movq %%mm1, (%2, %3) \n\t"
315 "add %%"FF_REG_a
", %1 \n\t"
316 "add %%"FF_REG_a
", %2 \n\t"
318 "movq (%1, %3), %%mm1 \n\t"
319 "movq (%1, %%"FF_REG_a
"), %%mm0 \n\t"
321 "movq (%2), %%mm3 \n\t"
323 "movq (%2, %3), %%mm3 \n\t"
325 "movq %%mm2, (%2) \n\t"
326 "movq %%mm1, (%2, %3) \n\t"
327 "add %%"FF_REG_a
", %1 \n\t"
328 "add %%"FF_REG_a
", %2 \n\t"
332 :
"+g"(
h),
"+S"(pixels),
"+D"(
block)
334 :FF_REG_a,
"memory");
338 CALL_2X_PIXELS(avg_no_rnd_pixels16_y2_mmx, avg_no_rnd_pixels8_y2_mmx, 8)
339 CALL_2X_PIXELS(put_no_rnd_pixels16_y2_mmx, put_no_rnd_pixels8_y2_mmx, 8)
341 CALL_2X_PIXELS(avg_no_rnd_pixels16_xy2_mmx, avg_no_rnd_pixels8_xy2_mmx, 8)
342 CALL_2X_PIXELS(put_no_rnd_pixels16_xy2_mmx, put_no_rnd_pixels8_xy2_mmx, 8)
348 #define SET_RND MOVQ_WTWO
349 #define DEF(x, y) ff_ ## x ## _ ## y ## _mmx
367 #define HPELDSP_AVG_PIXELS16(CPUEXT) \
368 CALL_2X_PIXELS(put_no_rnd_pixels16_x2 ## CPUEXT, ff_put_no_rnd_pixels8_x2 ## CPUEXT, 8) \
369 CALL_2X_PIXELS(put_pixels16_y2 ## CPUEXT, ff_put_pixels8_y2 ## CPUEXT, 8) \
370 CALL_2X_PIXELS(put_no_rnd_pixels16_y2 ## CPUEXT, ff_put_no_rnd_pixels8_y2 ## CPUEXT, 8) \
371 CALL_2X_PIXELS(avg_pixels16_x2 ## CPUEXT, ff_avg_pixels8_x2 ## CPUEXT, 8) \
372 CALL_2X_PIXELS(avg_pixels16_y2 ## CPUEXT, ff_avg_pixels8_y2 ## CPUEXT, 8) \
373 CALL_2X_PIXELS(avg_pixels16_xy2 ## CPUEXT, ff_avg_pixels8_xy2 ## CPUEXT, 8) \
374 CALL_2X_PIXELS(avg_approx_pixels16_xy2## CPUEXT, ff_avg_approx_pixels8_xy2## CPUEXT, 8)
376 HPELDSP_AVG_PIXELS16(_mmxext)
380 #define SET_HPEL_FUNCS_EXT(PFX, IDX, SIZE, CPU) \
381 if (HAVE_MMX_EXTERNAL) \
382 c->PFX ## _pixels_tab IDX [0] = PFX ## _pixels ## SIZE ## _ ## CPU
384 #define SET_HPEL_FUNCS03(PFX, IDX, SIZE, CPU) \
386 SET_HPEL_FUNCS_EXT(PFX, IDX, SIZE, CPU); \
387 c->PFX ## _pixels_tab IDX [3] = PFX ## _pixels ## SIZE ## _xy2_ ## CPU; \
389 #define SET_HPEL_FUNCS12(PFX, IDX, SIZE, CPU) \
391 c->PFX ## _pixels_tab IDX [1] = PFX ## _pixels ## SIZE ## _x2_ ## CPU; \
392 c->PFX ## _pixels_tab IDX [2] = PFX ## _pixels ## SIZE ## _y2_ ## CPU; \
394 #define SET_HPEL_FUNCS(PFX, IDX, SIZE, CPU) \
396 SET_HPEL_FUNCS03(PFX, IDX, SIZE, CPU); \
397 SET_HPEL_FUNCS12(PFX, IDX, SIZE, CPU); \
406 c->avg_no_rnd_pixels_tab[3] = avg_no_rnd_pixels16_xy2_mmx;
414 #if HAVE_MMXEXT_EXTERNAL
416 c->put_pixels_tab[0][2] = put_pixels16_y2_mmxext;
419 c->avg_pixels_tab[0][1] = avg_pixels16_x2_mmxext;
420 c->avg_pixels_tab[0][2] = avg_pixels16_y2_mmxext;
421 c->avg_pixels_tab[0][3] = avg_pixels16_xy2_mmxext;
437 c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_mmxext;
438 c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_mmxext;
442 c->avg_pixels_tab[0][3] = avg_approx_pixels16_xy2_mmxext;
450 #if HAVE_SSE2_EXTERNAL
466 #if HAVE_SSSE3_EXTERNAL