Mercurial > mplayer.hg
annotate libvo/osd_template.c @ 3343:58ab1490a0be
dunnowhat Q/A de biztos jo
author | gabucino |
---|---|
date | Wed, 05 Dec 2001 23:07:05 +0000 |
parents | 0f6cce3a8059 |
children | 63ecec3bdf93 |
rev | line source |
---|---|
326 | 1 // Generic alpha renderers for all YUV modes and RGB depths. |
2846 | 2 // Optimized by Nick and Michael |
3142 | 3 // Code from Michael Niedermayer (michaelni@gmx.at) is under GPL |
326 | 4 |
3142 | 5 #undef PREFETCH |
6 #undef EMMS | |
7 #undef PREFETCHW | |
8 #undef PAVGB | |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
9 |
3142 | 10 #ifdef HAVE_3DNOW |
11 #define PREFETCH "prefetch" | |
12 #define PREFETCHW "prefetchw" | |
13 #define PAVGB "pavgusb" | |
14 #elif defined ( HAVE_MMX2 ) | |
15 #define PREFETCH "prefetchnta" | |
16 #define PREFETCHW "prefetcht0" | |
17 #define PAVGB "pavgb" | |
18 #else | |
19 #define PREFETCH "/nop" | |
20 #define PREFETCHW "/nop" | |
2846 | 21 #endif |
622 | 22 |
3142 | 23 #ifdef HAVE_3DNOW |
24 /* On K6 femms is faster of emms. On K7 femms is directly mapped on emms. */ | |
25 #define EMMS "femms" | |
26 #else | |
27 #define EMMS "emms" | |
28 #endif | |
29 | |
30 static inline void RENAME(vo_draw_alpha_yv12)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ | |
326 | 31 int y; |
2846 | 32 #if defined(FAST_OSD) && !defined(HAVE_MMX) |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
33 w=w>>1; |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
34 #endif |
2846 | 35 PROFILE_START(); |
326 | 36 for(y=0;y<h;y++){ |
37 register int x; | |
2846 | 38 #ifdef HAVE_MMX |
39 asm volatile( | |
40 PREFETCHW" %0\n\t" | |
41 PREFETCH" %1\n\t" | |
42 PREFETCH" %2\n\t" | |
43 // "pxor %%mm7, %%mm7\n\t" | |
44 "pcmpeqb %%mm5, %%mm5\n\t" // F..F | |
45 "movq %%mm5, %%mm4\n\t" | |
46 "psllw $8, %%mm5\n\t" //FF00FF00FF00 | |
47 "psrlw $8, %%mm4\n\t" //00FF00FF00FF | |
48 ::"m"(*dstbase),"m"(*srca),"m"(*src):"memory"); | |
49 for(x=0;x<w;x+=8){ | |
50 asm volatile( | |
51 "movl %1, %%eax\n\t" | |
52 "orl 4%1, %%eax\n\t" | |
53 " jz 1f\n\t" | |
54 PREFETCHW" 32%0\n\t" | |
55 PREFETCH" 32%1\n\t" | |
56 PREFETCH" 32%2\n\t" | |
57 "movq %0, %%mm0\n\t" // dstbase | |
58 "movq %%mm0, %%mm1\n\t" | |
59 "pand %%mm4, %%mm0\n\t" //0Y0Y0Y0Y | |
60 "psrlw $8, %%mm1\n\t" //0Y0Y0Y0Y | |
61 "movq %1, %%mm2\n\t" //srca HGFEDCBA | |
62 "paddb bFF, %%mm2\n\t" | |
63 "movq %%mm2, %%mm3\n\t" | |
64 "pand %%mm4, %%mm2\n\t" //0G0E0C0A | |
65 "psrlw $8, %%mm3\n\t" //0H0F0D0B | |
66 "pmullw %%mm2, %%mm0\n\t" | |
67 "pmullw %%mm3, %%mm1\n\t" | |
68 "psrlw $8, %%mm0\n\t" | |
69 "pand %%mm5, %%mm1\n\t" | |
70 "por %%mm1, %%mm0\n\t" | |
71 "paddb %2, %%mm0\n\t" | |
72 "movq %%mm0, %0\n\t" | |
73 "1:\n\t" | |
74 :: "m" (dstbase[x]), "m" (srca[x]), "m" (src[x]) | |
75 : "%eax"); | |
76 } | |
77 #else | |
326 | 78 for(x=0;x<w;x++){ |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
79 #ifdef FAST_OSD |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
80 if(srca[2*x+0]) dstbase[2*x+0]=src[2*x+0]; |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
81 if(srca[2*x+1]) dstbase[2*x+1]=src[2*x+1]; |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
82 #else |
326 | 83 if(srca[x]) dstbase[x]=((dstbase[x]*srca[x])>>8)+src[x]; |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
84 #endif |
326 | 85 } |
2846 | 86 #endif |
326 | 87 src+=srcstride; |
88 srca+=srcstride; | |
89 dstbase+=dststride; | |
90 } | |
2846 | 91 #ifdef HAVE_MMX |
92 asm volatile(EMMS:::"memory"); | |
93 #endif | |
94 PROFILE_END("vo_draw_alpha_yv12"); | |
326 | 95 return; |
96 } | |
97 | |
3142 | 98 static inline void RENAME(vo_draw_alpha_yuy2)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ |
326 | 99 int y; |
2846 | 100 #if defined(FAST_OSD) && !defined(HAVE_MMX) |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
101 w=w>>1; |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
102 #endif |
2846 | 103 PROFILE_START(); |
326 | 104 for(y=0;y<h;y++){ |
105 register int x; | |
2846 | 106 #ifdef HAVE_MMX |
107 asm volatile( | |
108 PREFETCHW" %0\n\t" | |
109 PREFETCH" %1\n\t" | |
110 PREFETCH" %2\n\t" | |
111 "pxor %%mm7, %%mm7\n\t" | |
112 "pcmpeqb %%mm5, %%mm5\n\t" // F..F | |
113 "movq %%mm5, %%mm4\n\t" | |
114 "psllw $8, %%mm5\n\t" //FF00FF00FF00 | |
115 "psrlw $8, %%mm4\n\t" //00FF00FF00FF | |
116 ::"m"(*dstbase),"m"(*srca),"m"(*src)); | |
117 for(x=0;x<w;x+=4){ | |
118 asm volatile( | |
119 "movl %1, %%eax\n\t" | |
120 "orl %%eax, %%eax\n\t" | |
121 " jz 1f\n\t" | |
122 PREFETCHW" 32%0\n\t" | |
123 PREFETCH" 32%1\n\t" | |
124 PREFETCH" 32%2\n\t" | |
125 "movq %0, %%mm0\n\t" // dstbase | |
126 "movq %%mm0, %%mm1\n\t" | |
127 "pand %%mm4, %%mm0\n\t" //0Y0Y0Y0Y | |
128 "movd %%eax, %%mm2\n\t" //srca 0000DCBA | |
129 "paddb bFF, %%mm2\n\t" | |
130 "punpcklbw %%mm7, %%mm2\n\t" //srca 0D0C0B0A | |
131 "pmullw %%mm2, %%mm0\n\t" | |
132 "psrlw $8, %%mm0\n\t" | |
133 "pand %%mm5, %%mm1\n\t" //U0V0U0V0 | |
134 "movd %2, %%mm2\n\t" //src 0000DCBA | |
135 "punpcklbw %%mm7, %%mm2\n\t" //srca 0D0C0B0A | |
136 "por %%mm1, %%mm0\n\t" | |
137 "paddb %%mm2, %%mm0\n\t" | |
138 "movq %%mm0, %0\n\t" | |
139 "1:\n\t" | |
140 :: "m" (dstbase[x*2]), "m" (srca[x]), "m" (src[x]) | |
141 : "%eax"); | |
142 } | |
143 #else | |
326 | 144 for(x=0;x<w;x++){ |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
145 #ifdef FAST_OSD |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
146 if(srca[2*x+0]) dstbase[4*x+0]=src[2*x+0]; |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
147 if(srca[2*x+1]) dstbase[4*x+2]=src[2*x+1]; |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
148 #else |
326 | 149 if(srca[x]) dstbase[2*x]=((dstbase[2*x]*srca[x])>>8)+src[x]; |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
150 #endif |
326 | 151 } |
2846 | 152 #endif |
153 src+=srcstride; | |
326 | 154 srca+=srcstride; |
155 dstbase+=dststride; | |
156 } | |
2846 | 157 #ifdef HAVE_MMX |
158 asm volatile(EMMS:::"memory"); | |
159 #endif | |
160 PROFILE_END("vo_draw_alpha_yuy2"); | |
326 | 161 return; |
162 } | |
163 | |
3142 | 164 static inline void RENAME(vo_draw_alpha_rgb24)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ |
326 | 165 int y; |
166 for(y=0;y<h;y++){ | |
167 register unsigned char *dst = dstbase; | |
168 register int x; | |
2839 | 169 #ifdef ARCH_X86 |
170 #ifdef HAVE_MMX | |
171 asm volatile( | |
172 PREFETCHW" %0\n\t" | |
173 PREFETCH" %1\n\t" | |
174 PREFETCH" %2\n\t" | |
175 "pxor %%mm7, %%mm7\n\t" | |
176 "pcmpeqb %%mm6, %%mm6\n\t" // F..F | |
177 ::"m"(*dst),"m"(*srca),"m"(*src):"memory"); | |
178 for(x=0;x<w;x+=2){ | |
2843 | 179 if(srca[x] || srca[x+1]) |
2839 | 180 asm volatile( |
181 PREFETCHW" 32%0\n\t" | |
182 PREFETCH" 32%1\n\t" | |
183 PREFETCH" 32%2\n\t" | |
184 "movq %0, %%mm0\n\t" // dstbase | |
185 "movq %%mm0, %%mm1\n\t" | |
186 "movq %%mm0, %%mm5\n\t" | |
187 "punpcklbw %%mm7, %%mm0\n\t" | |
188 "punpckhbw %%mm7, %%mm1\n\t" | |
189 "movd %1, %%mm2\n\t" // srca ABCD0000 | |
190 "paddb %%mm6, %%mm2\n\t" | |
191 "punpcklbw %%mm2, %%mm2\n\t" // srca AABBCCDD | |
192 "punpcklbw %%mm2, %%mm2\n\t" // srca AAAABBBB | |
193 "movq %%mm2, %%mm3\n\t" | |
194 "punpcklbw %%mm7, %%mm2\n\t" // srca 0A0A0A0A | |
195 "punpckhbw %%mm7, %%mm3\n\t" // srca 0B0B0B0B | |
196 "pmullw %%mm2, %%mm0\n\t" | |
197 "pmullw %%mm3, %%mm1\n\t" | |
198 "psrlw $8, %%mm0\n\t" | |
199 "psrlw $8, %%mm1\n\t" | |
200 "packuswb %%mm1, %%mm0\n\t" | |
201 "movd %2, %%mm2 \n\t" // src ABCD0000 | |
202 "punpcklbw %%mm2, %%mm2\n\t" // src AABBCCDD | |
203 "punpcklbw %%mm2, %%mm2\n\t" // src AAAABBBB | |
204 "paddb %%mm2, %%mm0\n\t" | |
205 "pand %4, %%mm5\n\t" | |
206 "pand %3, %%mm0\n\t" | |
207 "por %%mm0, %%mm5\n\t" | |
208 "movq %%mm5, %0\n\t" | |
209 :: "m" (dst[0]), "m" (srca[x]), "m" (src[x]), "m"(mask24hl), "m"(mask24lh)); | |
210 dst += 6; | |
211 } | |
212 #else /* HAVE_MMX */ | |
213 for(x=0;x<w;x++){ | |
214 if(srca[x]){ | |
215 asm volatile( | |
216 "movzbl (%0), %%ecx\n\t" | |
217 "movzbl 1(%0), %%eax\n\t" | |
218 "movzbl 2(%0), %%edx\n\t" | |
219 | |
220 "imull %1, %%ecx\n\t" | |
221 "imull %1, %%eax\n\t" | |
222 "imull %1, %%edx\n\t" | |
223 | |
224 "addl %2, %%ecx\n\t" | |
225 "addl %2, %%eax\n\t" | |
226 "addl %2, %%edx\n\t" | |
227 | |
228 "movb %%ch, (%0)\n\t" | |
229 "movb %%ah, 1(%0)\n\t" | |
230 "movb %%dh, 2(%0)\n\t" | |
231 | |
232 : | |
233 :"r" (dst), | |
234 "r" ((unsigned)srca[x]), | |
235 "r" (((unsigned)src[x])<<8) | |
236 :"%eax", "%ecx", "%edx" | |
237 ); | |
238 } | |
239 dst += 3; | |
240 } | |
241 #endif /* HAVE_MMX */ | |
242 #else /*non x86 arch*/ | |
326 | 243 for(x=0;x<w;x++){ |
244 if(srca[x]){ | |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
245 #ifdef FAST_OSD |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
246 dst[0]=dst[1]=dst[2]=src[x]; |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
247 #else |
326 | 248 dst[0]=((dst[0]*srca[x])>>8)+src[x]; |
249 dst[1]=((dst[1]*srca[x])>>8)+src[x]; | |
250 dst[2]=((dst[2]*srca[x])>>8)+src[x]; | |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
251 #endif |
326 | 252 } |
253 dst+=3; // 24bpp | |
254 } | |
2839 | 255 #endif /* arch_x86 */ |
326 | 256 src+=srcstride; |
257 srca+=srcstride; | |
258 dstbase+=dststride; | |
259 } | |
2839 | 260 #ifdef HAVE_MMX |
261 asm volatile(EMMS:::"memory"); | |
262 #endif | |
326 | 263 return; |
264 } | |
265 | |
3142 | 266 static inline void RENAME(vo_draw_alpha_rgb32)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ |
326 | 267 int y; |
2833 | 268 PROFILE_START(); |
326 | 269 for(y=0;y<h;y++){ |
270 register int x; | |
2798
ee2cd36a81a2
Code cleanup - emms is not required when MMX block is commented out.
nick
parents:
2578
diff
changeset
|
271 #ifdef ARCH_X86 |
2833 | 272 #ifdef HAVE_MMX |
2846 | 273 #ifdef HAVE_3DNOW |
2835 | 274 asm volatile( |
275 PREFETCHW" %0\n\t" | |
276 PREFETCH" %1\n\t" | |
277 PREFETCH" %2\n\t" | |
278 "pxor %%mm7, %%mm7\n\t" | |
279 "pcmpeqb %%mm6, %%mm6\n\t" // F..F | |
2839 | 280 ::"m"(*dstbase),"m"(*srca),"m"(*src):"memory"); |
2835 | 281 for(x=0;x<w;x+=2){ |
2843 | 282 if(srca[x] || srca[x+1]) |
2798
ee2cd36a81a2
Code cleanup - emms is not required when MMX block is commented out.
nick
parents:
2578
diff
changeset
|
283 asm volatile( |
2835 | 284 PREFETCHW" 32%0\n\t" |
285 PREFETCH" 32%1\n\t" | |
286 PREFETCH" 32%2\n\t" | |
287 "movq %0, %%mm0\n\t" // dstbase | |
288 "movq %%mm0, %%mm1\n\t" | |
289 "punpcklbw %%mm7, %%mm0\n\t" | |
290 "punpckhbw %%mm7, %%mm1\n\t" | |
291 "movd %1, %%mm2\n\t" // srca ABCD0000 | |
292 "paddb %%mm6, %%mm2\n\t" | |
293 "punpcklbw %%mm2, %%mm2\n\t" // srca AABBCCDD | |
294 "punpcklbw %%mm2, %%mm2\n\t" // srca AAAABBBB | |
295 "movq %%mm2, %%mm3\n\t" | |
296 "punpcklbw %%mm7, %%mm2\n\t" // srca 0A0A0A0A | |
297 "punpckhbw %%mm7, %%mm3\n\t" // srca 0B0B0B0B | |
298 "pmullw %%mm2, %%mm0\n\t" | |
299 "pmullw %%mm3, %%mm1\n\t" | |
300 "psrlw $8, %%mm0\n\t" | |
301 "psrlw $8, %%mm1\n\t" | |
302 "packuswb %%mm1, %%mm0\n\t" | |
303 "movd %2, %%mm2 \n\t" // src ABCD0000 | |
304 "punpcklbw %%mm2, %%mm2\n\t" // src AABBCCDD | |
305 "punpcklbw %%mm2, %%mm2\n\t" // src AAAABBBB | |
306 "paddb %%mm2, %%mm0\n\t" | |
307 "movq %%mm0, %0\n\t" | |
308 :: "m" (dstbase[4*x]), "m" (srca[x]), "m" (src[x])); | |
309 } | |
2846 | 310 #else //this is faster for intels crap |
311 asm volatile( | |
312 PREFETCHW" %0\n\t" | |
313 PREFETCH" %1\n\t" | |
314 PREFETCH" %2\n\t" | |
315 "pxor %%mm7, %%mm7\n\t" | |
316 "pcmpeqb %%mm5, %%mm5\n\t" // F..F | |
317 "movq %%mm5, %%mm4\n\t" | |
318 "psllw $8, %%mm5\n\t" //FF00FF00FF00 | |
319 "psrlw $8, %%mm4\n\t" //00FF00FF00FF | |
320 ::"m"(*dstbase),"m"(*srca),"m"(*src):"memory"); | |
321 for(x=0;x<w;x+=4){ | |
322 asm volatile( | |
323 "movl %1, %%eax\n\t" | |
324 "orl %%eax, %%eax\n\t" | |
325 " jz 1f\n\t" | |
326 PREFETCHW" 32%0\n\t" | |
327 PREFETCH" 32%1\n\t" | |
328 PREFETCH" 32%2\n\t" | |
329 "movq %0, %%mm0\n\t" // dstbase | |
330 "movq %%mm0, %%mm1\n\t" | |
331 "pand %%mm4, %%mm0\n\t" //0R0B0R0B | |
332 "psrlw $8, %%mm1\n\t" //0?0G0?0G | |
333 "movd %%eax, %%mm2\n\t" //srca 0000DCBA | |
334 "paddb bFF, %%mm2\n\t" | |
335 "punpcklbw %%mm2, %%mm2\n\t" //srca DDCCBBAA | |
336 "movq %%mm2, %%mm3\n\t" | |
337 "punpcklbw %%mm7, %%mm2\n\t" //srca 0B0B0A0A | |
338 "pmullw %%mm2, %%mm0\n\t" | |
339 "pmullw %%mm2, %%mm1\n\t" | |
340 "psrlw $8, %%mm0\n\t" | |
341 "pand %%mm5, %%mm1\n\t" | |
342 "por %%mm1, %%mm0\n\t" | |
343 "movd %2, %%mm2 \n\t" //src 0000DCBA | |
344 "punpcklbw %%mm2, %%mm2\n\t" //src DDCCBBAA | |
345 "movq %%mm2, %%mm6\n\t" | |
346 "punpcklbw %%mm2, %%mm2\n\t" //src BBBBAAAA | |
347 "paddb %%mm2, %%mm0\n\t" | |
348 "movq %%mm0, %0\n\t" | |
349 | |
350 "movq 8%0, %%mm0\n\t" // dstbase | |
351 "movq %%mm0, %%mm1\n\t" | |
352 "pand %%mm4, %%mm0\n\t" //0R0B0R0B | |
353 "psrlw $8, %%mm1\n\t" //0?0G0?0G | |
354 "punpckhbw %%mm7, %%mm3\n\t" //srca 0D0D0C0C | |
355 "pmullw %%mm3, %%mm0\n\t" | |
356 "pmullw %%mm3, %%mm1\n\t" | |
357 "psrlw $8, %%mm0\n\t" | |
358 "pand %%mm5, %%mm1\n\t" | |
359 "por %%mm1, %%mm0\n\t" | |
360 "punpckhbw %%mm6, %%mm6\n\t" //src DDDDCCCC | |
361 "paddb %%mm6, %%mm0\n\t" | |
362 "movq %%mm0, 8%0\n\t" | |
363 "1:\n\t" | |
364 :: "m" (dstbase[4*x]), "m" (srca[x]), "m" (src[x]) | |
365 : "%eax"); | |
366 } | |
367 #endif | |
2839 | 368 #else /* HAVE_MMX */ |
2823
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
369 for(x=0;x<w;x++){ |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
370 if(srca[x]){ |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
371 asm volatile( |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
372 "movzbl (%0), %%ecx\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
373 "movzbl 1(%0), %%eax\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
374 "movzbl 2(%0), %%edx\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
375 |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
376 "imull %1, %%ecx\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
377 "imull %1, %%eax\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
378 "imull %1, %%edx\n\t" |
2578 | 379 |
2823
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
380 "addl %2, %%ecx\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
381 "addl %2, %%eax\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
382 "addl %2, %%edx\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
383 |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
384 "movb %%ch, (%0)\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
385 "movb %%ah, 1(%0)\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
386 "movb %%dh, 2(%0)\n\t" |
2578 | 387 |
2823
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
388 : |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
389 :"r" (&dstbase[4*x]), |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
390 "r" ((unsigned)srca[x]), |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
391 "r" (((unsigned)src[x])<<8) |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
392 :"%eax", "%ecx", "%edx" |
2578 | 393 ); |
2823
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
394 } |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
395 } |
2839 | 396 #endif /* HAVE_MMX */ |
2798
ee2cd36a81a2
Code cleanup - emms is not required when MMX block is commented out.
nick
parents:
2578
diff
changeset
|
397 #else /*non x86 arch*/ |
326 | 398 for(x=0;x<w;x++){ |
399 if(srca[x]){ | |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
400 #ifdef FAST_OSD |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
401 dstbase[4*x+0]=dstbase[4*x+1]=dstbase[4*x+2]=src[x]; |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
402 #else |
326 | 403 dstbase[4*x+0]=((dstbase[4*x+0]*srca[x])>>8)+src[x]; |
404 dstbase[4*x+1]=((dstbase[4*x+1]*srca[x])>>8)+src[x]; | |
405 dstbase[4*x+2]=((dstbase[4*x+2]*srca[x])>>8)+src[x]; | |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
406 #endif |
326 | 407 } |
408 } | |
2798
ee2cd36a81a2
Code cleanup - emms is not required when MMX block is commented out.
nick
parents:
2578
diff
changeset
|
409 #endif /* arch_x86 */ |
326 | 410 src+=srcstride; |
411 srca+=srcstride; | |
412 dstbase+=dststride; | |
413 } | |
2833 | 414 #ifdef HAVE_MMX |
2798
ee2cd36a81a2
Code cleanup - emms is not required when MMX block is commented out.
nick
parents:
2578
diff
changeset
|
415 asm volatile(EMMS:::"memory"); |
2578 | 416 #endif |
2833 | 417 PROFILE_END("vo_draw_alpha_rgb32"); |
326 | 418 return; |
419 } |