32 #define REAL_MOVNTQ(a,b) "movntq " #a ", " #b " \n\t"
33 #define MOVNTQ2 "movntq "
34 #define MOVNTQ(a,b) REAL_MOVNTQ(a,b)
36 #define YSCALEYUV2PACKEDX_UV \
38 "xor %%"FF_REG_a", %%"FF_REG_a" \n\t"\
42 "lea "CHR_MMX_FILTER_OFFSET"(%0), %%"FF_REG_d" \n\t"\
43 "mov (%%"FF_REG_d"), %%"FF_REG_S" \n\t"\
44 "movq "VROUNDER_OFFSET"(%0), %%mm3 \n\t"\
45 "movq %%mm3, %%mm4 \n\t"\
48 "movq 8(%%"FF_REG_d"), %%mm0 \n\t" \
49 "movq (%%"FF_REG_S", %%"FF_REG_a"), %%mm2 \n\t" \
50 "add %6, %%"FF_REG_S" \n\t" \
51 "movq (%%"FF_REG_S", %%"FF_REG_a"), %%mm5 \n\t" \
52 "add $16, %%"FF_REG_d" \n\t"\
53 "mov (%%"FF_REG_d"), %%"FF_REG_S" \n\t"\
54 "pmulhw %%mm0, %%mm2 \n\t"\
55 "pmulhw %%mm0, %%mm5 \n\t"\
56 "paddw %%mm2, %%mm3 \n\t"\
57 "paddw %%mm5, %%mm4 \n\t"\
58 "test %%"FF_REG_S", %%"FF_REG_S" \n\t"\
61 #define YSCALEYUV2PACKEDX_YA(offset,coeff,src1,src2,dst1,dst2) \
62 "lea "offset"(%0), %%"FF_REG_d" \n\t"\
63 "mov (%%"FF_REG_d"), %%"FF_REG_S" \n\t"\
64 "movq "VROUNDER_OFFSET"(%0), "#dst1" \n\t"\
65 "movq "#dst1", "#dst2" \n\t"\
68 "movq 8(%%"FF_REG_d"), "#coeff" \n\t" \
69 "movq (%%"FF_REG_S", %%"FF_REG_a", 2), "#src1" \n\t" \
70 "movq 8(%%"FF_REG_S", %%"FF_REG_a", 2), "#src2" \n\t" \
71 "add $16, %%"FF_REG_d" \n\t"\
72 "mov (%%"FF_REG_d"), %%"FF_REG_S" \n\t"\
73 "pmulhw "#coeff", "#src1" \n\t"\
74 "pmulhw "#coeff", "#src2" \n\t"\
75 "paddw "#src1", "#dst1" \n\t"\
76 "paddw "#src2", "#dst2" \n\t"\
77 "test %%"FF_REG_S", %%"FF_REG_S" \n\t"\
80 #define YSCALEYUV2PACKEDX \
81 YSCALEYUV2PACKEDX_UV \
82 YSCALEYUV2PACKEDX_YA(LUM_MMX_FILTER_OFFSET,%%mm0,%%mm2,%%mm5,%%mm1,%%mm7) \
84 #define YSCALEYUV2PACKEDX_END \
85 :: "r" (&c->redDither), \
86 "m" (dummy), "m" (dummy), "m" (dummy),\
87 "r" (dest), "m" (dstW_reg), "m"(uv_off) \
88 NAMED_CONSTRAINTS_ADD(bF8,bFC) \
89 : "%"FF_REG_a, "%"FF_REG_d, "%"FF_REG_S \
92 #define YSCALEYUV2PACKEDX_ACCURATE_UV \
94 "xor %%"FF_REG_a", %%"FF_REG_a" \n\t"\
98 "lea "CHR_MMX_FILTER_OFFSET"(%0), %%"FF_REG_d" \n\t"\
99 "mov (%%"FF_REG_d"), %%"FF_REG_S" \n\t"\
100 "pxor %%mm4, %%mm4 \n\t"\
101 "pxor %%mm5, %%mm5 \n\t"\
102 "pxor %%mm6, %%mm6 \n\t"\
103 "pxor %%mm7, %%mm7 \n\t"\
106 "movq (%%"FF_REG_S", %%"FF_REG_a"), %%mm0 \n\t" \
107 "add %6, %%"FF_REG_S" \n\t" \
108 "movq (%%"FF_REG_S", %%"FF_REG_a"), %%mm2 \n\t" \
109 "mov "STR(APCK_PTR2)"(%%"FF_REG_d"), %%"FF_REG_S" \n\t"\
110 "movq (%%"FF_REG_S", %%"FF_REG_a"), %%mm1 \n\t" \
111 "movq %%mm0, %%mm3 \n\t"\
112 "punpcklwd %%mm1, %%mm0 \n\t"\
113 "punpckhwd %%mm1, %%mm3 \n\t"\
114 "movq "STR(APCK_COEF)"(%%"FF_REG_d"),%%mm1 \n\t" \
115 "pmaddwd %%mm1, %%mm0 \n\t"\
116 "pmaddwd %%mm1, %%mm3 \n\t"\
117 "paddd %%mm0, %%mm4 \n\t"\
118 "paddd %%mm3, %%mm5 \n\t"\
119 "add %6, %%"FF_REG_S" \n\t" \
120 "movq (%%"FF_REG_S", %%"FF_REG_a"), %%mm3 \n\t" \
121 "mov "STR(APCK_SIZE)"(%%"FF_REG_d"), %%"FF_REG_S" \n\t"\
122 "add $"STR(APCK_SIZE)", %%"FF_REG_d" \n\t"\
123 "test %%"FF_REG_S", %%"FF_REG_S" \n\t"\
124 "movq %%mm2, %%mm0 \n\t"\
125 "punpcklwd %%mm3, %%mm2 \n\t"\
126 "punpckhwd %%mm3, %%mm0 \n\t"\
127 "pmaddwd %%mm1, %%mm2 \n\t"\
128 "pmaddwd %%mm1, %%mm0 \n\t"\
129 "paddd %%mm2, %%mm6 \n\t"\
130 "paddd %%mm0, %%mm7 \n\t"\
132 "psrad $16, %%mm4 \n\t"\
133 "psrad $16, %%mm5 \n\t"\
134 "psrad $16, %%mm6 \n\t"\
135 "psrad $16, %%mm7 \n\t"\
136 "movq "VROUNDER_OFFSET"(%0), %%mm0 \n\t"\
137 "packssdw %%mm5, %%mm4 \n\t"\
138 "packssdw %%mm7, %%mm6 \n\t"\
139 "paddw %%mm0, %%mm4 \n\t"\
140 "paddw %%mm0, %%mm6 \n\t"\
141 "movq %%mm4, "U_TEMP"(%0) \n\t"\
142 "movq %%mm6, "V_TEMP"(%0) \n\t"\
144 #define YSCALEYUV2PACKEDX_ACCURATE_YA(offset) \
145 "lea "offset"(%0), %%"FF_REG_d" \n\t"\
146 "mov (%%"FF_REG_d"), %%"FF_REG_S" \n\t"\
147 "pxor %%mm1, %%mm1 \n\t"\
148 "pxor %%mm5, %%mm5 \n\t"\
149 "pxor %%mm7, %%mm7 \n\t"\
150 "pxor %%mm6, %%mm6 \n\t"\
153 "movq (%%"FF_REG_S", %%"FF_REG_a", 2), %%mm0 \n\t" \
154 "movq 8(%%"FF_REG_S", %%"FF_REG_a", 2), %%mm2 \n\t" \
155 "mov "STR(APCK_PTR2)"(%%"FF_REG_d"), %%"FF_REG_S" \n\t"\
156 "movq (%%"FF_REG_S", %%"FF_REG_a", 2), %%mm4 \n\t" \
157 "movq %%mm0, %%mm3 \n\t"\
158 "punpcklwd %%mm4, %%mm0 \n\t"\
159 "punpckhwd %%mm4, %%mm3 \n\t"\
160 "movq "STR(APCK_COEF)"(%%"FF_REG_d"), %%mm4 \n\t" \
161 "pmaddwd %%mm4, %%mm0 \n\t"\
162 "pmaddwd %%mm4, %%mm3 \n\t"\
163 "paddd %%mm0, %%mm1 \n\t"\
164 "paddd %%mm3, %%mm5 \n\t"\
165 "movq 8(%%"FF_REG_S", %%"FF_REG_a", 2), %%mm3 \n\t" \
166 "mov "STR(APCK_SIZE)"(%%"FF_REG_d"), %%"FF_REG_S" \n\t"\
167 "add $"STR(APCK_SIZE)", %%"FF_REG_d" \n\t"\
168 "test %%"FF_REG_S", %%"FF_REG_S" \n\t"\
169 "movq %%mm2, %%mm0 \n\t"\
170 "punpcklwd %%mm3, %%mm2 \n\t"\
171 "punpckhwd %%mm3, %%mm0 \n\t"\
172 "pmaddwd %%mm4, %%mm2 \n\t"\
173 "pmaddwd %%mm4, %%mm0 \n\t"\
174 "paddd %%mm2, %%mm7 \n\t"\
175 "paddd %%mm0, %%mm6 \n\t"\
177 "psrad $16, %%mm1 \n\t"\
178 "psrad $16, %%mm5 \n\t"\
179 "psrad $16, %%mm7 \n\t"\
180 "psrad $16, %%mm6 \n\t"\
181 "movq "VROUNDER_OFFSET"(%0), %%mm0 \n\t"\
182 "packssdw %%mm5, %%mm1 \n\t"\
183 "packssdw %%mm6, %%mm7 \n\t"\
184 "paddw %%mm0, %%mm1 \n\t"\
185 "paddw %%mm0, %%mm7 \n\t"\
186 "movq "U_TEMP"(%0), %%mm3 \n\t"\
187 "movq "V_TEMP"(%0), %%mm4 \n\t"\
189 #define YSCALEYUV2PACKEDX_ACCURATE \
190 YSCALEYUV2PACKEDX_ACCURATE_UV \
191 YSCALEYUV2PACKEDX_ACCURATE_YA(LUM_MMX_FILTER_OFFSET)
193 #define YSCALEYUV2RGBX \
194 "psubw "U_OFFSET"(%0), %%mm3 \n\t" \
195 "psubw "V_OFFSET"(%0), %%mm4 \n\t" \
196 "movq %%mm3, %%mm2 \n\t" \
197 "movq %%mm4, %%mm5 \n\t" \
198 "pmulhw "UG_COEFF"(%0), %%mm3 \n\t"\
199 "pmulhw "VG_COEFF"(%0), %%mm4 \n\t"\
201 "pmulhw "UB_COEFF"(%0), %%mm2 \n\t"\
202 "pmulhw "VR_COEFF"(%0), %%mm5 \n\t"\
203 "psubw "Y_OFFSET"(%0), %%mm1 \n\t" \
204 "psubw "Y_OFFSET"(%0), %%mm7 \n\t" \
205 "pmulhw "Y_COEFF"(%0), %%mm1 \n\t"\
206 "pmulhw "Y_COEFF"(%0), %%mm7 \n\t"\
208 "paddw %%mm3, %%mm4 \n\t"\
209 "movq %%mm2, %%mm0 \n\t"\
210 "movq %%mm5, %%mm6 \n\t"\
211 "movq %%mm4, %%mm3 \n\t"\
212 "punpcklwd %%mm2, %%mm2 \n\t"\
213 "punpcklwd %%mm5, %%mm5 \n\t"\
214 "punpcklwd %%mm4, %%mm4 \n\t"\
215 "paddw %%mm1, %%mm2 \n\t"\
216 "paddw %%mm1, %%mm5 \n\t"\
217 "paddw %%mm1, %%mm4 \n\t"\
218 "punpckhwd %%mm0, %%mm0 \n\t"\
219 "punpckhwd %%mm6, %%mm6 \n\t"\
220 "punpckhwd %%mm3, %%mm3 \n\t"\
221 "paddw %%mm7, %%mm0 \n\t"\
222 "paddw %%mm7, %%mm6 \n\t"\
223 "paddw %%mm7, %%mm3 \n\t"\
225 "packuswb %%mm0, %%mm2 \n\t"\
226 "packuswb %%mm6, %%mm5 \n\t"\
227 "packuswb %%mm3, %%mm4 \n\t"\
229 #define REAL_WRITEBGR32(dst, dstw, index, b, g, r, a, q0, q2, q3, t) \
230 "movq "#b", "#q2" \n\t" \
231 "movq "#r", "#t" \n\t" \
232 "punpcklbw "#g", "#b" \n\t" \
233 "punpcklbw "#a", "#r" \n\t" \
234 "punpckhbw "#g", "#q2" \n\t" \
235 "punpckhbw "#a", "#t" \n\t" \
236 "movq "#b", "#q0" \n\t" \
237 "movq "#q2", "#q3" \n\t" \
238 "punpcklwd "#r", "#q0" \n\t" \
239 "punpckhwd "#r", "#b" \n\t" \
240 "punpcklwd "#t", "#q2" \n\t" \
241 "punpckhwd "#t", "#q3" \n\t" \
243 MOVNTQ( q0, (dst, index, 4))\
244 MOVNTQ( b, 8(dst, index, 4))\
245 MOVNTQ( q2, 16(dst, index, 4))\
246 MOVNTQ( q3, 24(dst, index, 4))\
248 "add $8, "#index" \n\t"\
249 "cmp "dstw", "#index" \n\t"\
251 #define WRITEBGR32(dst, dstw, index, b, g, r, a, q0, q2, q3, t) REAL_WRITEBGR32(dst, dstw, index, b, g, r, a, q0, q2, q3, t)
254 const int16_t **lumSrc,
int lumFilterSize,
255 const int16_t *chrFilter,
const int16_t **chrUSrc,
256 const int16_t **chrVSrc,
257 int chrFilterSize,
const int16_t **alpSrc,
258 uint8_t *dest,
int dstW,
int dstY)
264 if (CONFIG_SWSCALE_ALPHA &&
c->needAlpha) {
267 "movq %%mm2, "U_TEMP"(%0) \n\t"
268 "movq %%mm4, "V_TEMP"(%0) \n\t"
269 "movq %%mm5, "Y_TEMP"(%0) \n\t"
271 "movq "Y_TEMP"(%0), %%mm5 \n\t"
272 "psraw $3, %%mm1 \n\t"
273 "psraw $3, %%mm7 \n\t"
274 "packuswb %%mm7, %%mm1 \n\t"
275 WRITEBGR32(%4,
"%5", %%FF_REGa, %%mm3, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm2, %%mm6)
280 "pcmpeqd %%mm7, %%mm7 \n\t"
281 WRITEBGR32(%4,
"%5", %%FF_REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
287 const int16_t **lumSrc,
int lumFilterSize,
288 const int16_t *chrFilter,
const int16_t **chrUSrc,
289 const int16_t **chrVSrc,
290 int chrFilterSize,
const int16_t **alpSrc,
291 uint8_t *dest,
int dstW,
int dstY)
297 if (CONFIG_SWSCALE_ALPHA &&
c->needAlpha) {
301 "psraw $3, %%mm1 \n\t"
302 "psraw $3, %%mm7 \n\t"
303 "packuswb %%mm7, %%mm1 \n\t"
304 WRITEBGR32(%4,
"%5", %%FF_REGa, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
309 "pcmpeqd %%mm7, %%mm7 \n\t"
310 WRITEBGR32(%4,
"%5", %%FF_REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
316 const int16_t **lumSrc,
int lumFilterSize,
317 const int16_t *chrFilter,
const int16_t **chrUSrc,
318 const int16_t **chrVSrc,
319 int chrFilterSize,
const int16_t **alpSrc,
320 uint8_t *dest,
int dstW,
int dstY)
326 if (CONFIG_SWSCALE_ALPHA &&
c->needAlpha) {
330 "psraw $3, %%mm1 \n\t"
331 "psraw $3, %%mm7 \n\t"
332 "packuswb %%mm7, %%mm1 \n\t"
333 WRITEBGR32(%4,
"%5", %%FF_REGa, %%mm5, %%mm4, %%mm2, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
338 "pcmpeqd %%mm7, %%mm7 \n\t"
339 WRITEBGR32(%4,
"%5", %%FF_REGa, %%mm5, %%mm4, %%mm2, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
344 #define REAL_WRITERGB16(dst, dstw, index) \
345 "pand "MANGLE(bF8)", %%mm2 \n\t" \
346 "pand "MANGLE(bFC)", %%mm4 \n\t" \
347 "pand "MANGLE(bF8)", %%mm5 \n\t" \
348 "psrlq $3, %%mm2 \n\t"\
350 "movq %%mm2, %%mm1 \n\t"\
351 "movq %%mm4, %%mm3 \n\t"\
353 "punpcklbw %%mm7, %%mm3 \n\t"\
354 "punpcklbw %%mm5, %%mm2 \n\t"\
355 "punpckhbw %%mm7, %%mm4 \n\t"\
356 "punpckhbw %%mm5, %%mm1 \n\t"\
358 "psllq $3, %%mm3 \n\t"\
359 "psllq $3, %%mm4 \n\t"\
361 "por %%mm3, %%mm2 \n\t"\
362 "por %%mm4, %%mm1 \n\t"\
364 MOVNTQ(%%mm2, (dst, index, 2))\
365 MOVNTQ(%%mm1, 8(dst, index, 2))\
367 "add $8, "#index" \n\t"\
368 "cmp "dstw", "#index" \n\t"\
370 #define WRITERGB16(dst, dstw, index) REAL_WRITERGB16(dst, dstw, index)
373 const int16_t **lumSrc,
int lumFilterSize,
374 const int16_t *chrFilter,
const int16_t **chrUSrc,
375 const int16_t **chrVSrc,
376 int chrFilterSize,
const int16_t **alpSrc,
377 uint8_t *dest,
int dstW,
int dstY)
385 "pxor %%mm7, %%mm7 \n\t"
395 const int16_t **lumSrc,
int lumFilterSize,
396 const int16_t *chrFilter,
const int16_t **chrUSrc,
397 const int16_t **chrVSrc,
398 int chrFilterSize,
const int16_t **alpSrc,
399 uint8_t *dest,
int dstW,
int dstY)
407 "pxor %%mm7, %%mm7 \n\t"
416 #define REAL_WRITERGB15(dst, dstw, index) \
417 "pand "MANGLE(bF8)", %%mm2 \n\t" \
418 "pand "MANGLE(bF8)", %%mm4 \n\t" \
419 "pand "MANGLE(bF8)", %%mm5 \n\t" \
420 "psrlq $3, %%mm2 \n\t"\
421 "psrlq $1, %%mm5 \n\t"\
423 "movq %%mm2, %%mm1 \n\t"\
424 "movq %%mm4, %%mm3 \n\t"\
426 "punpcklbw %%mm7, %%mm3 \n\t"\
427 "punpcklbw %%mm5, %%mm2 \n\t"\
428 "punpckhbw %%mm7, %%mm4 \n\t"\
429 "punpckhbw %%mm5, %%mm1 \n\t"\
431 "psllq $2, %%mm3 \n\t"\
432 "psllq $2, %%mm4 \n\t"\
434 "por %%mm3, %%mm2 \n\t"\
435 "por %%mm4, %%mm1 \n\t"\
437 MOVNTQ(%%mm2, (dst, index, 2))\
438 MOVNTQ(%%mm1, 8(dst, index, 2))\
440 "add $8, "#index" \n\t"\
441 "cmp "dstw", "#index" \n\t"\
443 #define WRITERGB15(dst, dstw, index) REAL_WRITERGB15(dst, dstw, index)
446 const int16_t **lumSrc,
int lumFilterSize,
447 const int16_t *chrFilter,
const int16_t **chrUSrc,
448 const int16_t **chrVSrc,
449 int chrFilterSize,
const int16_t **alpSrc,
450 uint8_t *dest,
int dstW,
int dstY)
458 "pxor %%mm7, %%mm7 \n\t"
468 const int16_t **lumSrc,
int lumFilterSize,
469 const int16_t *chrFilter,
const int16_t **chrUSrc,
470 const int16_t **chrVSrc,
471 int chrFilterSize,
const int16_t **alpSrc,
472 uint8_t *dest,
int dstW,
int dstY)
480 "pxor %%mm7, %%mm7 \n\t"
489 #define WRITEBGR24MMX(dst, dstw, index) \
491 "movq %%mm2, %%mm1 \n\t" \
492 "movq %%mm5, %%mm6 \n\t" \
493 "punpcklbw %%mm4, %%mm2 \n\t" \
494 "punpcklbw %%mm7, %%mm5 \n\t" \
495 "punpckhbw %%mm4, %%mm1 \n\t" \
496 "punpckhbw %%mm7, %%mm6 \n\t" \
497 "movq %%mm2, %%mm0 \n\t" \
498 "movq %%mm1, %%mm3 \n\t" \
499 "punpcklwd %%mm5, %%mm0 \n\t" \
500 "punpckhwd %%mm5, %%mm2 \n\t" \
501 "punpcklwd %%mm6, %%mm1 \n\t" \
502 "punpckhwd %%mm6, %%mm3 \n\t" \
504 "movq %%mm0, %%mm4 \n\t" \
505 "movq %%mm2, %%mm6 \n\t" \
506 "movq %%mm1, %%mm5 \n\t" \
507 "movq %%mm3, %%mm7 \n\t" \
509 "psllq $40, %%mm0 \n\t" \
510 "psllq $40, %%mm2 \n\t" \
511 "psllq $40, %%mm1 \n\t" \
512 "psllq $40, %%mm3 \n\t" \
514 "punpckhdq %%mm4, %%mm0 \n\t" \
515 "punpckhdq %%mm6, %%mm2 \n\t" \
516 "punpckhdq %%mm5, %%mm1 \n\t" \
517 "punpckhdq %%mm7, %%mm3 \n\t" \
519 "psrlq $8, %%mm0 \n\t" \
520 "movq %%mm2, %%mm6 \n\t" \
521 "psllq $40, %%mm2 \n\t" \
522 "por %%mm2, %%mm0 \n\t" \
523 MOVNTQ(%%mm0, (dst))\
525 "psrlq $24, %%mm6 \n\t" \
526 "movq %%mm1, %%mm5 \n\t" \
527 "psllq $24, %%mm1 \n\t" \
528 "por %%mm1, %%mm6 \n\t" \
529 MOVNTQ(%%mm6, 8(dst))\
531 "psrlq $40, %%mm5 \n\t" \
532 "psllq $8, %%mm3 \n\t" \
533 "por %%mm3, %%mm5 \n\t" \
534 MOVNTQ(%%mm5, 16(dst))\
536 "add $24, "#dst" \n\t"\
538 "add $8, "#index" \n\t"\
539 "cmp "dstw", "#index" \n\t"\
542 #define WRITEBGR24MMXEXT(dst, dstw, index) \
544 "movq "MANGLE(ff_M24A)", %%mm0 \n\t"\
545 "movq "MANGLE(ff_M24C)", %%mm7 \n\t"\
546 "pshufw $0x50, %%mm2, %%mm1 \n\t" \
547 "pshufw $0x50, %%mm4, %%mm3 \n\t" \
548 "pshufw $0x00, %%mm5, %%mm6 \n\t" \
550 "pand %%mm0, %%mm1 \n\t" \
551 "pand %%mm0, %%mm3 \n\t" \
552 "pand %%mm7, %%mm6 \n\t" \
554 "psllq $8, %%mm3 \n\t" \
555 "por %%mm1, %%mm6 \n\t"\
556 "por %%mm3, %%mm6 \n\t"\
557 MOVNTQ(%%mm6, (dst))\
559 "psrlq $8, %%mm4 \n\t" \
560 "pshufw $0xA5, %%mm2, %%mm1 \n\t" \
561 "pshufw $0x55, %%mm4, %%mm3 \n\t" \
562 "pshufw $0xA5, %%mm5, %%mm6 \n\t" \
564 "pand "MANGLE(ff_M24B)", %%mm1 \n\t" \
565 "pand %%mm7, %%mm3 \n\t" \
566 "pand %%mm0, %%mm6 \n\t" \
568 "por %%mm1, %%mm3 \n\t" \
569 "por %%mm3, %%mm6 \n\t"\
570 MOVNTQ(%%mm6, 8(dst))\
572 "pshufw $0xFF, %%mm2, %%mm1 \n\t" \
573 "pshufw $0xFA, %%mm4, %%mm3 \n\t" \
574 "pshufw $0xFA, %%mm5, %%mm6 \n\t" \
576 "pand %%mm7, %%mm1 \n\t" \
577 "pand %%mm0, %%mm3 \n\t" \
578 "pand "MANGLE(ff_M24B)", %%mm6 \n\t" \
580 "por %%mm1, %%mm3 \n\t"\
581 "por %%mm3, %%mm6 \n\t"\
582 MOVNTQ(%%mm6, 16(dst))\
584 "add $24, "#dst" \n\t"\
586 "add $8, "#index" \n\t"\
587 "cmp "dstw", "#index" \n\t"\
591 #define WRITEBGR24(dst, dstw, index) WRITEBGR24MMXEXT(dst, dstw, index)
595 const int16_t **lumSrc,
int lumFilterSize,
596 const int16_t *chrFilter,
const int16_t **chrUSrc,
597 const int16_t **chrVSrc,
598 int chrFilterSize,
const int16_t **alpSrc,
599 uint8_t *dest,
int dstW,
int dstY)
607 "pxor %%mm7, %%mm7 \n\t"
608 "lea (%%"FF_REG_a
", %%"FF_REG_a
", 2), %%"FF_REG_c
"\n\t"
609 "add %4, %%"FF_REG_c
" \n\t"
611 ::
"r" (&
c->redDither),
613 "r" (dest),
"m" (dstW_reg),
"m"(uv_off)
615 :
"%"FF_REG_a,
"%"FF_REG_c,
"%"FF_REG_d,
"%"FF_REG_S
620 const int16_t **lumSrc,
int lumFilterSize,
621 const int16_t *chrFilter,
const int16_t **chrUSrc,
622 const int16_t **chrVSrc,
623 int chrFilterSize,
const int16_t **alpSrc,
624 uint8_t *dest,
int dstW,
int dstY)
632 "pxor %%mm7, %%mm7 \n\t"
633 "lea (%%"FF_REG_a
", %%"FF_REG_a
", 2), %%"FF_REG_c
" \n\t"
634 "add %4, %%"FF_REG_c
" \n\t"
636 ::
"r" (&
c->redDither),
638 "r" (dest),
"m" (dstW_reg),
"m"(uv_off)
640 :
"%"FF_REG_a,
"%"FF_REG_c,
"%"FF_REG_d,
"%"FF_REG_S
645 #define REAL_WRITEYUY2(dst, dstw, index) \
646 "packuswb %%mm3, %%mm3 \n\t"\
647 "packuswb %%mm4, %%mm4 \n\t"\
648 "packuswb %%mm7, %%mm1 \n\t"\
649 "punpcklbw %%mm4, %%mm3 \n\t"\
650 "movq %%mm1, %%mm7 \n\t"\
651 "punpcklbw %%mm3, %%mm1 \n\t"\
652 "punpckhbw %%mm3, %%mm7 \n\t"\
654 MOVNTQ(%%mm1, (dst, index, 2))\
655 MOVNTQ(%%mm7, 8(dst, index, 2))\
657 "add $8, "#index" \n\t"\
658 "cmp "dstw", "#index" \n\t"\
660 #define WRITEYUY2(dst, dstw, index) REAL_WRITEYUY2(dst, dstw, index)
663 const int16_t **lumSrc,
int lumFilterSize,
664 const int16_t *chrFilter,
const int16_t **chrUSrc,
665 const int16_t **chrVSrc,
666 int chrFilterSize,
const int16_t **alpSrc,
667 uint8_t *dest,
int dstW,
int dstY)
675 "psraw $3, %%mm3 \n\t"
676 "psraw $3, %%mm4 \n\t"
677 "psraw $3, %%mm1 \n\t"
678 "psraw $3, %%mm7 \n\t"
684 const int16_t **lumSrc,
int lumFilterSize,
685 const int16_t *chrFilter,
const int16_t **chrUSrc,
686 const int16_t **chrVSrc,
687 int chrFilterSize,
const int16_t **alpSrc,
688 uint8_t *dest,
int dstW,
int dstY)
696 "psraw $3, %%mm3 \n\t"
697 "psraw $3, %%mm4 \n\t"
698 "psraw $3, %%mm1 \n\t"
699 "psraw $3, %%mm7 \n\t"
704 #define REAL_YSCALEYUV2RGB_UV(index, c) \
705 "xor "#index", "#index" \n\t"\
708 "movq (%2, "#index"), %%mm2 \n\t" \
709 "movq (%3, "#index"), %%mm3 \n\t" \
710 "add "UV_OFF_BYTE"("#c"), "#index" \n\t" \
711 "movq (%2, "#index"), %%mm5 \n\t" \
712 "movq (%3, "#index"), %%mm4 \n\t" \
713 "sub "UV_OFF_BYTE"("#c"), "#index" \n\t" \
714 "psubw %%mm3, %%mm2 \n\t" \
715 "psubw %%mm4, %%mm5 \n\t" \
716 "movq "CHR_MMX_FILTER_OFFSET"+8("#c"), %%mm0 \n\t"\
717 "pmulhw %%mm0, %%mm2 \n\t" \
718 "pmulhw %%mm0, %%mm5 \n\t" \
719 "psraw $4, %%mm3 \n\t" \
720 "psraw $4, %%mm4 \n\t" \
721 "paddw %%mm2, %%mm3 \n\t" \
722 "paddw %%mm5, %%mm4 \n\t" \
723 "psubw "U_OFFSET"("#c"), %%mm3 \n\t" \
724 "psubw "V_OFFSET"("#c"), %%mm4 \n\t" \
725 "movq %%mm3, %%mm2 \n\t" \
726 "movq %%mm4, %%mm5 \n\t" \
727 "pmulhw "UG_COEFF"("#c"), %%mm3 \n\t"\
728 "pmulhw "VG_COEFF"("#c"), %%mm4 \n\t"\
731 #define REAL_YSCALEYUV2RGB_YA(index, c, b1, b2) \
732 "movq ("#b1", "#index", 2), %%mm0 \n\t" \
733 "movq ("#b2", "#index", 2), %%mm1 \n\t" \
734 "movq 8("#b1", "#index", 2), %%mm6 \n\t" \
735 "movq 8("#b2", "#index", 2), %%mm7 \n\t" \
736 "psubw %%mm1, %%mm0 \n\t" \
737 "psubw %%mm7, %%mm6 \n\t" \
738 "pmulhw "LUM_MMX_FILTER_OFFSET"+8("#c"), %%mm0 \n\t" \
739 "pmulhw "LUM_MMX_FILTER_OFFSET"+8("#c"), %%mm6 \n\t" \
740 "psraw $4, %%mm1 \n\t" \
741 "psraw $4, %%mm7 \n\t" \
742 "paddw %%mm0, %%mm1 \n\t" \
743 "paddw %%mm6, %%mm7 \n\t" \
745 #define REAL_YSCALEYUV2RGB_COEFF(c) \
746 "pmulhw "UB_COEFF"("#c"), %%mm2 \n\t"\
747 "pmulhw "VR_COEFF"("#c"), %%mm5 \n\t"\
748 "psubw "Y_OFFSET"("#c"), %%mm1 \n\t" \
749 "psubw "Y_OFFSET"("#c"), %%mm7 \n\t" \
750 "pmulhw "Y_COEFF"("#c"), %%mm1 \n\t"\
751 "pmulhw "Y_COEFF"("#c"), %%mm7 \n\t"\
753 "paddw %%mm3, %%mm4 \n\t"\
754 "movq %%mm2, %%mm0 \n\t"\
755 "movq %%mm5, %%mm6 \n\t"\
756 "movq %%mm4, %%mm3 \n\t"\
757 "punpcklwd %%mm2, %%mm2 \n\t"\
758 "punpcklwd %%mm5, %%mm5 \n\t"\
759 "punpcklwd %%mm4, %%mm4 \n\t"\
760 "paddw %%mm1, %%mm2 \n\t"\
761 "paddw %%mm1, %%mm5 \n\t"\
762 "paddw %%mm1, %%mm4 \n\t"\
763 "punpckhwd %%mm0, %%mm0 \n\t"\
764 "punpckhwd %%mm6, %%mm6 \n\t"\
765 "punpckhwd %%mm3, %%mm3 \n\t"\
766 "paddw %%mm7, %%mm0 \n\t"\
767 "paddw %%mm7, %%mm6 \n\t"\
768 "paddw %%mm7, %%mm3 \n\t"\
770 "packuswb %%mm0, %%mm2 \n\t"\
771 "packuswb %%mm6, %%mm5 \n\t"\
772 "packuswb %%mm3, %%mm4 \n\t"\
774 #define YSCALEYUV2RGB_YA(index, c, b1, b2) REAL_YSCALEYUV2RGB_YA(index, c, b1, b2)
776 #define YSCALEYUV2RGB(index, c) \
777 REAL_YSCALEYUV2RGB_UV(index, c) \
778 REAL_YSCALEYUV2RGB_YA(index, c, %0, %1) \
779 REAL_YSCALEYUV2RGB_COEFF(c)
785 const int16_t *ubuf[2],
const int16_t *vbuf[2],
786 const int16_t *abuf[2], uint8_t *dest,
787 int dstW,
int yalpha,
int uvalpha,
int y)
789 const int16_t *buf0 = buf[0], *buf1 = buf[1],
790 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
792 if (CONFIG_SWSCALE_ALPHA &&
c->needAlpha) {
793 const int16_t *abuf0 = abuf[0], *abuf1 = abuf[1];
798 "psraw $3, %%mm1 \n\t"
799 "psraw $3, %%mm7 \n\t"
800 "packuswb %%mm7, %%mm1 \n\t"
801 WRITEBGR32(%4,
DSTW_OFFSET"(%5)", %%r8, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
802 ::
"c" (buf0),
"d" (buf1),
"S" (ubuf0),
"D" (ubuf1),
"r" (dest),
804 "r" (abuf0),
"r" (abuf1)
808 c->u_temp=(intptr_t)abuf0;
809 c->v_temp=(intptr_t)abuf1;
812 "mov %4, %%"FF_REG_b
" \n\t"
813 "push %%"FF_REG_BP
" \n\t"
817 "mov "U_TEMP"(%5), %0 \n\t"
818 "mov "V_TEMP"(%5), %1 \n\t"
820 "psraw $3, %%mm1 \n\t"
821 "psraw $3, %%mm7 \n\t"
822 "packuswb %%mm7, %%mm1 \n\t"
825 WRITEBGR32(%%FF_REGb,
DSTW_OFFSET"(%5)", %%FF_REGBP, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
826 "pop %%"FF_REG_BP
" \n\t"
828 ::
"c" (buf0),
"d" (buf1),
"S" (ubuf0),
"D" (ubuf1),
"m" (dest),
835 "mov %4, %%"FF_REG_b
" \n\t"
836 "push %%"FF_REG_BP
" \n\t"
838 "pcmpeqd %%mm7, %%mm7 \n\t"
839 WRITEBGR32(%%FF_REGb,
DSTW_OFFSET"(%5)", %%FF_REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
840 "pop %%"FF_REG_BP
" \n\t"
842 ::
"c" (buf0),
"d" (buf1),
"S" (ubuf0),
"D" (ubuf1),
"m" (dest),
849 const int16_t *ubuf[2],
const int16_t *vbuf[2],
850 const int16_t *abuf[2], uint8_t *dest,
851 int dstW,
int yalpha,
int uvalpha,
int y)
853 const int16_t *buf0 = buf[0], *buf1 = buf[1],
854 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
858 "mov %4, %%"FF_REG_b
" \n\t"
859 "push %%"FF_REG_BP
" \n\t"
861 "pxor %%mm7, %%mm7 \n\t"
863 "pop %%"FF_REG_BP
" \n\t"
865 ::
"c" (buf0),
"d" (buf1),
"S" (ubuf0),
"D" (ubuf1),
"m" (dest),
872 const int16_t *ubuf[2],
const int16_t *vbuf[2],
873 const int16_t *abuf[2], uint8_t *dest,
874 int dstW,
int yalpha,
int uvalpha,
int y)
876 const int16_t *buf0 = buf[0], *buf1 = buf[1],
877 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
881 "mov %4, %%"FF_REG_b
" \n\t"
882 "push %%"FF_REG_BP
" \n\t"
884 "pxor %%mm7, %%mm7 \n\t"
890 "pop %%"FF_REG_BP
" \n\t"
892 ::
"c" (buf0),
"d" (buf1),
"S" (ubuf0),
"D" (ubuf1),
"m" (dest),
899 const int16_t *ubuf[2],
const int16_t *vbuf[2],
900 const int16_t *abuf[2], uint8_t *dest,
901 int dstW,
int yalpha,
int uvalpha,
int y)
903 const int16_t *buf0 = buf[0], *buf1 = buf[1],
904 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
908 "mov %4, %%"FF_REG_b
" \n\t"
909 "push %%"FF_REG_BP
" \n\t"
911 "pxor %%mm7, %%mm7 \n\t"
917 "pop %%"FF_REG_BP
" \n\t"
919 ::
"c" (buf0),
"d" (buf1),
"S" (ubuf0),
"D" (ubuf1),
"m" (dest),
925 #define REAL_YSCALEYUV2PACKED(index, c) \
926 "movq "CHR_MMX_FILTER_OFFSET"+8("#c"), %%mm0 \n\t"\
927 "movq "LUM_MMX_FILTER_OFFSET"+8("#c"), %%mm1 \n\t"\
928 "psraw $3, %%mm0 \n\t"\
929 "psraw $3, %%mm1 \n\t"\
930 "movq %%mm0, "CHR_MMX_FILTER_OFFSET"+8("#c") \n\t"\
931 "movq %%mm1, "LUM_MMX_FILTER_OFFSET"+8("#c") \n\t"\
932 "xor "#index", "#index" \n\t"\
935 "movq (%2, "#index"), %%mm2 \n\t" \
936 "movq (%3, "#index"), %%mm3 \n\t" \
937 "add "UV_OFF_BYTE"("#c"), "#index" \n\t" \
938 "movq (%2, "#index"), %%mm5 \n\t" \
939 "movq (%3, "#index"), %%mm4 \n\t" \
940 "sub "UV_OFF_BYTE"("#c"), "#index" \n\t" \
941 "psubw %%mm3, %%mm2 \n\t" \
942 "psubw %%mm4, %%mm5 \n\t" \
943 "movq "CHR_MMX_FILTER_OFFSET"+8("#c"), %%mm0 \n\t"\
944 "pmulhw %%mm0, %%mm2 \n\t" \
945 "pmulhw %%mm0, %%mm5 \n\t" \
946 "psraw $7, %%mm3 \n\t" \
947 "psraw $7, %%mm4 \n\t" \
948 "paddw %%mm2, %%mm3 \n\t" \
949 "paddw %%mm5, %%mm4 \n\t" \
950 "movq (%0, "#index", 2), %%mm0 \n\t" \
951 "movq (%1, "#index", 2), %%mm1 \n\t" \
952 "movq 8(%0, "#index", 2), %%mm6 \n\t" \
953 "movq 8(%1, "#index", 2), %%mm7 \n\t" \
954 "psubw %%mm1, %%mm0 \n\t" \
955 "psubw %%mm7, %%mm6 \n\t" \
956 "pmulhw "LUM_MMX_FILTER_OFFSET"+8("#c"), %%mm0 \n\t" \
957 "pmulhw "LUM_MMX_FILTER_OFFSET"+8("#c"), %%mm6 \n\t" \
958 "psraw $7, %%mm1 \n\t" \
959 "psraw $7, %%mm7 \n\t" \
960 "paddw %%mm0, %%mm1 \n\t" \
961 "paddw %%mm6, %%mm7 \n\t" \
963 #define YSCALEYUV2PACKED(index, c) REAL_YSCALEYUV2PACKED(index, c)
966 const int16_t *ubuf[2],
const int16_t *vbuf[2],
967 const int16_t *abuf[2], uint8_t *dest,
968 int dstW,
int yalpha,
int uvalpha,
int y)
970 const int16_t *buf0 = buf[0], *buf1 = buf[1],
971 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
975 "mov %4, %%"FF_REG_b
" \n\t"
976 "push %%"FF_REG_BP
" \n\t"
979 "pop %%"FF_REG_BP
" \n\t"
981 ::
"c" (buf0),
"d" (buf1),
"S" (ubuf0),
"D" (ubuf1),
"m" (dest),
986 #define REAL_YSCALEYUV2RGB1(index, c) \
987 "xor "#index", "#index" \n\t"\
990 "movq (%2, "#index"), %%mm3 \n\t" \
991 "add "UV_OFF_BYTE"("#c"), "#index" \n\t" \
992 "movq (%2, "#index"), %%mm4 \n\t" \
993 "sub "UV_OFF_BYTE"("#c"), "#index" \n\t" \
994 "psraw $4, %%mm3 \n\t" \
995 "psraw $4, %%mm4 \n\t" \
996 "psubw "U_OFFSET"("#c"), %%mm3 \n\t" \
997 "psubw "V_OFFSET"("#c"), %%mm4 \n\t" \
998 "movq %%mm3, %%mm2 \n\t" \
999 "movq %%mm4, %%mm5 \n\t" \
1000 "pmulhw "UG_COEFF"("#c"), %%mm3 \n\t"\
1001 "pmulhw "VG_COEFF"("#c"), %%mm4 \n\t"\
1003 "movq (%0, "#index", 2), %%mm1 \n\t" \
1004 "movq 8(%0, "#index", 2), %%mm7 \n\t" \
1005 "psraw $4, %%mm1 \n\t" \
1006 "psraw $4, %%mm7 \n\t" \
1007 "pmulhw "UB_COEFF"("#c"), %%mm2 \n\t"\
1008 "pmulhw "VR_COEFF"("#c"), %%mm5 \n\t"\
1009 "psubw "Y_OFFSET"("#c"), %%mm1 \n\t" \
1010 "psubw "Y_OFFSET"("#c"), %%mm7 \n\t" \
1011 "pmulhw "Y_COEFF"("#c"), %%mm1 \n\t"\
1012 "pmulhw "Y_COEFF"("#c"), %%mm7 \n\t"\
1014 "paddw %%mm3, %%mm4 \n\t"\
1015 "movq %%mm2, %%mm0 \n\t"\
1016 "movq %%mm5, %%mm6 \n\t"\
1017 "movq %%mm4, %%mm3 \n\t"\
1018 "punpcklwd %%mm2, %%mm2 \n\t"\
1019 "punpcklwd %%mm5, %%mm5 \n\t"\
1020 "punpcklwd %%mm4, %%mm4 \n\t"\
1021 "paddw %%mm1, %%mm2 \n\t"\
1022 "paddw %%mm1, %%mm5 \n\t"\
1023 "paddw %%mm1, %%mm4 \n\t"\
1024 "punpckhwd %%mm0, %%mm0 \n\t"\
1025 "punpckhwd %%mm6, %%mm6 \n\t"\
1026 "punpckhwd %%mm3, %%mm3 \n\t"\
1027 "paddw %%mm7, %%mm0 \n\t"\
1028 "paddw %%mm7, %%mm6 \n\t"\
1029 "paddw %%mm7, %%mm3 \n\t"\
1031 "packuswb %%mm0, %%mm2 \n\t"\
1032 "packuswb %%mm6, %%mm5 \n\t"\
1033 "packuswb %%mm3, %%mm4 \n\t"\
1035 #define YSCALEYUV2RGB1(index, c) REAL_YSCALEYUV2RGB1(index, c)
1038 #define REAL_YSCALEYUV2RGB1b(index, c) \
1039 "xor "#index", "#index" \n\t"\
1042 "movq (%2, "#index"), %%mm2 \n\t" \
1043 "movq (%3, "#index"), %%mm3 \n\t" \
1044 "add "UV_OFF_BYTE"("#c"), "#index" \n\t" \
1045 "movq (%2, "#index"), %%mm5 \n\t" \
1046 "movq (%3, "#index"), %%mm4 \n\t" \
1047 "sub "UV_OFF_BYTE"("#c"), "#index" \n\t" \
1048 "paddw %%mm2, %%mm3 \n\t" \
1049 "paddw %%mm5, %%mm4 \n\t" \
1050 "psrlw $5, %%mm3 \n\t" \
1051 "psrlw $5, %%mm4 \n\t" \
1052 "psubw "U_OFFSET"("#c"), %%mm3 \n\t" \
1053 "psubw "V_OFFSET"("#c"), %%mm4 \n\t" \
1054 "movq %%mm3, %%mm2 \n\t" \
1055 "movq %%mm4, %%mm5 \n\t" \
1056 "pmulhw "UG_COEFF"("#c"), %%mm3 \n\t"\
1057 "pmulhw "VG_COEFF"("#c"), %%mm4 \n\t"\
1059 "movq (%0, "#index", 2), %%mm1 \n\t" \
1060 "movq 8(%0, "#index", 2), %%mm7 \n\t" \
1061 "psraw $4, %%mm1 \n\t" \
1062 "psraw $4, %%mm7 \n\t" \
1063 "pmulhw "UB_COEFF"("#c"), %%mm2 \n\t"\
1064 "pmulhw "VR_COEFF"("#c"), %%mm5 \n\t"\
1065 "psubw "Y_OFFSET"("#c"), %%mm1 \n\t" \
1066 "psubw "Y_OFFSET"("#c"), %%mm7 \n\t" \
1067 "pmulhw "Y_COEFF"("#c"), %%mm1 \n\t"\
1068 "pmulhw "Y_COEFF"("#c"), %%mm7 \n\t"\
1070 "paddw %%mm3, %%mm4 \n\t"\
1071 "movq %%mm2, %%mm0 \n\t"\
1072 "movq %%mm5, %%mm6 \n\t"\
1073 "movq %%mm4, %%mm3 \n\t"\
1074 "punpcklwd %%mm2, %%mm2 \n\t"\
1075 "punpcklwd %%mm5, %%mm5 \n\t"\
1076 "punpcklwd %%mm4, %%mm4 \n\t"\
1077 "paddw %%mm1, %%mm2 \n\t"\
1078 "paddw %%mm1, %%mm5 \n\t"\
1079 "paddw %%mm1, %%mm4 \n\t"\
1080 "punpckhwd %%mm0, %%mm0 \n\t"\
1081 "punpckhwd %%mm6, %%mm6 \n\t"\
1082 "punpckhwd %%mm3, %%mm3 \n\t"\
1083 "paddw %%mm7, %%mm0 \n\t"\
1084 "paddw %%mm7, %%mm6 \n\t"\
1085 "paddw %%mm7, %%mm3 \n\t"\
1087 "packuswb %%mm0, %%mm2 \n\t"\
1088 "packuswb %%mm6, %%mm5 \n\t"\
1089 "packuswb %%mm3, %%mm4 \n\t"\
1091 #define YSCALEYUV2RGB1b(index, c) REAL_YSCALEYUV2RGB1b(index, c)
1093 #define REAL_YSCALEYUV2RGB1_ALPHA(index) \
1094 "movq (%1, "#index", 2), %%mm7 \n\t" \
1095 "movq 8(%1, "#index", 2), %%mm1 \n\t" \
1096 "psraw $7, %%mm7 \n\t" \
1097 "psraw $7, %%mm1 \n\t" \
1098 "packuswb %%mm1, %%mm7 \n\t"
1099 #define YSCALEYUV2RGB1_ALPHA(index) REAL_YSCALEYUV2RGB1_ALPHA(index)
1105 const int16_t *ubuf[2],
const int16_t *vbuf[2],
1106 const int16_t *abuf0, uint8_t *dest,
1107 int dstW,
int uvalpha,
int y)
1109 const int16_t *ubuf0 = ubuf[0];
1110 const int16_t *buf1= buf0;
1112 if (uvalpha < 2048) {
1113 const int16_t *ubuf1 = ubuf[0];
1114 if (CONFIG_SWSCALE_ALPHA &&
c->needAlpha) {
1117 "mov %4, %%"FF_REG_b
" \n\t"
1118 "push %%"FF_REG_BP
" \n\t"
1121 WRITEBGR32(%%FF_REGb,
DSTW_OFFSET"(%5)", %%FF_REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
1122 "pop %%"FF_REG_BP
" \n\t"
1124 ::
"c" (buf0),
"d" (abuf0),
"S" (ubuf0),
"D" (ubuf1),
"m" (dest),
1130 "mov %4, %%"FF_REG_b
" \n\t"
1131 "push %%"FF_REG_BP
" \n\t"
1133 "pcmpeqd %%mm7, %%mm7 \n\t"
1134 WRITEBGR32(%%FF_REGb,
DSTW_OFFSET"(%5)", %%FF_REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
1135 "pop %%"FF_REG_BP
" \n\t"
1137 ::
"c" (buf0),
"d" (buf1),
"S" (ubuf0),
"D" (ubuf1),
"m" (dest),
1142 const int16_t *ubuf1 = ubuf[1];
1143 if (CONFIG_SWSCALE_ALPHA &&
c->needAlpha) {
1146 "mov %4, %%"FF_REG_b
" \n\t"
1147 "push %%"FF_REG_BP
" \n\t"
1150 WRITEBGR32(%%FF_REGb,
DSTW_OFFSET"(%5)", %%FF_REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
1151 "pop %%"FF_REG_BP
" \n\t"
1153 ::
"c" (buf0),
"d" (abuf0),
"S" (ubuf0),
"D" (ubuf1),
"m" (dest),
1159 "mov %4, %%"FF_REG_b
" \n\t"
1160 "push %%"FF_REG_BP
" \n\t"
1162 "pcmpeqd %%mm7, %%mm7 \n\t"
1163 WRITEBGR32(%%FF_REGb,
DSTW_OFFSET"(%5)", %%FF_REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
1164 "pop %%"FF_REG_BP
" \n\t"
1166 ::
"c" (buf0),
"d" (buf1),
"S" (ubuf0),
"D" (ubuf1),
"m" (dest),
1174 const int16_t *ubuf[2],
const int16_t *vbuf[2],
1175 const int16_t *abuf0, uint8_t *dest,
1176 int dstW,
int uvalpha,
int y)
1178 const int16_t *ubuf0 = ubuf[0];
1179 const int16_t *buf1= buf0;
1181 if (uvalpha < 2048) {
1182 const int16_t *ubuf1 = ubuf[0];
1185 "mov %4, %%"FF_REG_b
" \n\t"
1186 "push %%"FF_REG_BP
" \n\t"
1188 "pxor %%mm7, %%mm7 \n\t"
1190 "pop %%"FF_REG_BP
" \n\t"
1192 ::
"c" (buf0),
"d" (buf1),
"S" (ubuf0),
"D" (ubuf1),
"m" (dest),
1197 const int16_t *ubuf1 = ubuf[1];
1200 "mov %4, %%"FF_REG_b
" \n\t"
1201 "push %%"FF_REG_BP
" \n\t"
1203 "pxor %%mm7, %%mm7 \n\t"
1205 "pop %%"FF_REG_BP
" \n\t"
1207 ::
"c" (buf0),
"d" (buf1),
"S" (ubuf0),
"D" (ubuf1),
"m" (dest),
1215 const int16_t *ubuf[2],
const int16_t *vbuf[2],
1216 const int16_t *abuf0, uint8_t *dest,
1217 int dstW,
int uvalpha,
int y)
1219 const int16_t *ubuf0 = ubuf[0];
1220 const int16_t *buf1= buf0;
1222 if (uvalpha < 2048) {
1223 const int16_t *ubuf1 = ubuf[0];
1226 "mov %4, %%"FF_REG_b
" \n\t"
1227 "push %%"FF_REG_BP
" \n\t"
1229 "pxor %%mm7, %%mm7 \n\t"
1235 "pop %%"FF_REG_BP
" \n\t"
1237 ::
"c" (buf0),
"d" (buf1),
"S" (ubuf0),
"D" (ubuf1),
"m" (dest),
1242 const int16_t *ubuf1 = ubuf[1];
1245 "mov %4, %%"FF_REG_b
" \n\t"
1246 "push %%"FF_REG_BP
" \n\t"
1248 "pxor %%mm7, %%mm7 \n\t"
1254 "pop %%"FF_REG_BP
" \n\t"
1256 ::
"c" (buf0),
"d" (buf1),
"S" (ubuf0),
"D" (ubuf1),
"m" (dest),
1264 const int16_t *ubuf[2],
const int16_t *vbuf[2],
1265 const int16_t *abuf0, uint8_t *dest,
1266 int dstW,
int uvalpha,
int y)
1268 const int16_t *ubuf0 = ubuf[0];
1269 const int16_t *buf1= buf0;
1271 if (uvalpha < 2048) {
1272 const int16_t *ubuf1 = ubuf[0];
1275 "mov %4, %%"FF_REG_b
" \n\t"
1276 "push %%"FF_REG_BP
" \n\t"
1278 "pxor %%mm7, %%mm7 \n\t"
1284 "pop %%"FF_REG_BP
" \n\t"
1286 ::
"c" (buf0),
"d" (buf1),
"S" (ubuf0),
"D" (ubuf1),
"m" (dest),
1291 const int16_t *ubuf1 = ubuf[1];
1294 "mov %4, %%"FF_REG_b
" \n\t"
1295 "push %%"FF_REG_BP
" \n\t"
1297 "pxor %%mm7, %%mm7 \n\t"
1303 "pop %%"FF_REG_BP
" \n\t"
1305 ::
"c" (buf0),
"d" (buf1),
"S" (ubuf0),
"D" (ubuf1),
"m" (dest),
1312 #define REAL_YSCALEYUV2PACKED1(index, c) \
1313 "xor "#index", "#index" \n\t"\
1316 "movq (%2, "#index"), %%mm3 \n\t" \
1317 "add "UV_OFF_BYTE"("#c"), "#index" \n\t" \
1318 "movq (%2, "#index"), %%mm4 \n\t" \
1319 "sub "UV_OFF_BYTE"("#c"), "#index" \n\t" \
1320 "psraw $7, %%mm3 \n\t" \
1321 "psraw $7, %%mm4 \n\t" \
1322 "movq (%0, "#index", 2), %%mm1 \n\t" \
1323 "movq 8(%0, "#index", 2), %%mm7 \n\t" \
1324 "psraw $7, %%mm1 \n\t" \
1325 "psraw $7, %%mm7 \n\t" \
1327 #define YSCALEYUV2PACKED1(index, c) REAL_YSCALEYUV2PACKED1(index, c)
1329 #define REAL_YSCALEYUV2PACKED1b(index, c) \
1330 "xor "#index", "#index" \n\t"\
1333 "movq (%2, "#index"), %%mm2 \n\t" \
1334 "movq (%3, "#index"), %%mm3 \n\t" \
1335 "add "UV_OFF_BYTE"("#c"), "#index" \n\t" \
1336 "movq (%2, "#index"), %%mm5 \n\t" \
1337 "movq (%3, "#index"), %%mm4 \n\t" \
1338 "sub "UV_OFF_BYTE"("#c"), "#index" \n\t" \
1339 "paddw %%mm2, %%mm3 \n\t" \
1340 "paddw %%mm5, %%mm4 \n\t" \
1341 "psrlw $8, %%mm3 \n\t" \
1342 "psrlw $8, %%mm4 \n\t" \
1343 "movq (%0, "#index", 2), %%mm1 \n\t" \
1344 "movq 8(%0, "#index", 2), %%mm7 \n\t" \
1345 "psraw $7, %%mm1 \n\t" \
1346 "psraw $7, %%mm7 \n\t"
1347 #define YSCALEYUV2PACKED1b(index, c) REAL_YSCALEYUV2PACKED1b(index, c)
1350 const int16_t *ubuf[2],
const int16_t *vbuf[2],
1351 const int16_t *abuf0, uint8_t *dest,
1352 int dstW,
int uvalpha,
int y)
1354 const int16_t *ubuf0 = ubuf[0];
1355 const int16_t *buf1= buf0;
1357 if (uvalpha < 2048) {
1358 const int16_t *ubuf1 = ubuf[0];
1361 "mov %4, %%"FF_REG_b
" \n\t"
1362 "push %%"FF_REG_BP
" \n\t"
1365 "pop %%"FF_REG_BP
" \n\t"
1367 ::
"c" (buf0),
"d" (buf1),
"S" (ubuf0),
"D" (ubuf1),
"m" (dest),
1371 const int16_t *ubuf1 = ubuf[1];
1374 "mov %4, %%"FF_REG_b
" \n\t"
1375 "push %%"FF_REG_BP
" \n\t"
1378 "pop %%"FF_REG_BP
" \n\t"
1380 ::
"c" (buf0),
"d" (buf1),
"S" (ubuf0),
"D" (ubuf1),
"m" (dest),
1389 c->use_mmx_vfilter= 0;
1395 switch (
c->opts.dst_format) {
1407 c->use_mmx_vfilter= 1;
1409 switch (
c->opts.dst_format) {
1423 switch (
c->opts.dst_format) {
1425 c->yuv2packed1 =
RENAME(yuv2rgb32_1);
1426 c->yuv2packed2 =
RENAME(yuv2rgb32_2);
1429 c->yuv2packed1 =
RENAME(yuv2bgr24_1);
1430 c->yuv2packed2 =
RENAME(yuv2bgr24_2);
1433 c->yuv2packed1 =
RENAME(yuv2rgb555_1);
1434 c->yuv2packed2 =
RENAME(yuv2rgb555_2);
1437 c->yuv2packed1 =
RENAME(yuv2rgb565_1);
1438 c->yuv2packed2 =
RENAME(yuv2rgb565_2);
1441 c->yuv2packed1 =
RENAME(yuv2yuyv422_1);
1442 c->yuv2packed2 =
RENAME(yuv2yuyv422_2);
1450 if (
c->srcBpc == 8 &&
c->dstBpc <= 14) {
1456 c->hyscale_fast =
NULL;
1457 c->hcscale_fast =
NULL;