Mercurial > mplayer.hg
annotate libvo/osd_template.c @ 4556:90a535d87e7b
emulating BITMAPINFOHDR (for win32 codecs)
author | arpi |
---|---|
date | Wed, 06 Feb 2002 22:03:19 +0000 |
parents | 27cb0e43de32 |
children | 473058a6211e |
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 | |
4245 | 62 "paddb "MANGLE(bFF)", %%mm2\n\t" |
2846 | 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 | |
4245 | 129 "paddb "MANGLE(bFF)", %%mm2\n\t" |
2846 | 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 |
3431
63ecec3bdf93
yuy2 in C color bugfix patch from Artur Zaprzala <artur.zaprzala@talex.com.pl>
michael
parents:
3142
diff
changeset
|
149 if(srca[x]) { |
63ecec3bdf93
yuy2 in C color bugfix patch from Artur Zaprzala <artur.zaprzala@talex.com.pl>
michael
parents:
3142
diff
changeset
|
150 dstbase[2*x]=((dstbase[2*x]*srca[x])>>8)+src[x]; |
63ecec3bdf93
yuy2 in C color bugfix patch from Artur Zaprzala <artur.zaprzala@talex.com.pl>
michael
parents:
3142
diff
changeset
|
151 dstbase[2*x+1]=((((signed)dstbase[2*x+1]-128)*srca[x])>>8)+128; |
63ecec3bdf93
yuy2 in C color bugfix patch from Artur Zaprzala <artur.zaprzala@talex.com.pl>
michael
parents:
3142
diff
changeset
|
152 } |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
153 #endif |
326 | 154 } |
2846 | 155 #endif |
156 src+=srcstride; | |
326 | 157 srca+=srcstride; |
158 dstbase+=dststride; | |
159 } | |
2846 | 160 #ifdef HAVE_MMX |
161 asm volatile(EMMS:::"memory"); | |
162 #endif | |
163 PROFILE_END("vo_draw_alpha_yuy2"); | |
326 | 164 return; |
165 } | |
166 | |
3142 | 167 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 | 168 int y; |
169 for(y=0;y<h;y++){ | |
170 register unsigned char *dst = dstbase; | |
171 register int x; | |
2839 | 172 #ifdef ARCH_X86 |
173 #ifdef HAVE_MMX | |
174 asm volatile( | |
175 PREFETCHW" %0\n\t" | |
176 PREFETCH" %1\n\t" | |
177 PREFETCH" %2\n\t" | |
178 "pxor %%mm7, %%mm7\n\t" | |
179 "pcmpeqb %%mm6, %%mm6\n\t" // F..F | |
180 ::"m"(*dst),"m"(*srca),"m"(*src):"memory"); | |
181 for(x=0;x<w;x+=2){ | |
2843 | 182 if(srca[x] || srca[x+1]) |
2839 | 183 asm volatile( |
184 PREFETCHW" 32%0\n\t" | |
185 PREFETCH" 32%1\n\t" | |
186 PREFETCH" 32%2\n\t" | |
187 "movq %0, %%mm0\n\t" // dstbase | |
188 "movq %%mm0, %%mm1\n\t" | |
189 "movq %%mm0, %%mm5\n\t" | |
190 "punpcklbw %%mm7, %%mm0\n\t" | |
191 "punpckhbw %%mm7, %%mm1\n\t" | |
192 "movd %1, %%mm2\n\t" // srca ABCD0000 | |
193 "paddb %%mm6, %%mm2\n\t" | |
194 "punpcklbw %%mm2, %%mm2\n\t" // srca AABBCCDD | |
195 "punpcklbw %%mm2, %%mm2\n\t" // srca AAAABBBB | |
196 "movq %%mm2, %%mm3\n\t" | |
197 "punpcklbw %%mm7, %%mm2\n\t" // srca 0A0A0A0A | |
198 "punpckhbw %%mm7, %%mm3\n\t" // srca 0B0B0B0B | |
199 "pmullw %%mm2, %%mm0\n\t" | |
200 "pmullw %%mm3, %%mm1\n\t" | |
201 "psrlw $8, %%mm0\n\t" | |
202 "psrlw $8, %%mm1\n\t" | |
203 "packuswb %%mm1, %%mm0\n\t" | |
204 "movd %2, %%mm2 \n\t" // src ABCD0000 | |
205 "punpcklbw %%mm2, %%mm2\n\t" // src AABBCCDD | |
206 "punpcklbw %%mm2, %%mm2\n\t" // src AAAABBBB | |
207 "paddb %%mm2, %%mm0\n\t" | |
208 "pand %4, %%mm5\n\t" | |
209 "pand %3, %%mm0\n\t" | |
210 "por %%mm0, %%mm5\n\t" | |
211 "movq %%mm5, %0\n\t" | |
212 :: "m" (dst[0]), "m" (srca[x]), "m" (src[x]), "m"(mask24hl), "m"(mask24lh)); | |
213 dst += 6; | |
214 } | |
215 #else /* HAVE_MMX */ | |
216 for(x=0;x<w;x++){ | |
217 if(srca[x]){ | |
218 asm volatile( | |
219 "movzbl (%0), %%ecx\n\t" | |
220 "movzbl 1(%0), %%eax\n\t" | |
221 "movzbl 2(%0), %%edx\n\t" | |
222 | |
223 "imull %1, %%ecx\n\t" | |
224 "imull %1, %%eax\n\t" | |
225 "imull %1, %%edx\n\t" | |
226 | |
227 "addl %2, %%ecx\n\t" | |
228 "addl %2, %%eax\n\t" | |
229 "addl %2, %%edx\n\t" | |
230 | |
231 "movb %%ch, (%0)\n\t" | |
232 "movb %%ah, 1(%0)\n\t" | |
233 "movb %%dh, 2(%0)\n\t" | |
234 | |
235 : | |
236 :"r" (dst), | |
237 "r" ((unsigned)srca[x]), | |
238 "r" (((unsigned)src[x])<<8) | |
239 :"%eax", "%ecx", "%edx" | |
240 ); | |
241 } | |
242 dst += 3; | |
243 } | |
244 #endif /* HAVE_MMX */ | |
245 #else /*non x86 arch*/ | |
326 | 246 for(x=0;x<w;x++){ |
247 if(srca[x]){ | |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
248 #ifdef FAST_OSD |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
249 dst[0]=dst[1]=dst[2]=src[x]; |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
250 #else |
326 | 251 dst[0]=((dst[0]*srca[x])>>8)+src[x]; |
252 dst[1]=((dst[1]*srca[x])>>8)+src[x]; | |
253 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
|
254 #endif |
326 | 255 } |
256 dst+=3; // 24bpp | |
257 } | |
2839 | 258 #endif /* arch_x86 */ |
326 | 259 src+=srcstride; |
260 srca+=srcstride; | |
261 dstbase+=dststride; | |
262 } | |
2839 | 263 #ifdef HAVE_MMX |
264 asm volatile(EMMS:::"memory"); | |
265 #endif | |
326 | 266 return; |
267 } | |
268 | |
3142 | 269 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 | 270 int y; |
2833 | 271 PROFILE_START(); |
326 | 272 for(y=0;y<h;y++){ |
273 register int x; | |
2798
ee2cd36a81a2
Code cleanup - emms is not required when MMX block is commented out.
nick
parents:
2578
diff
changeset
|
274 #ifdef ARCH_X86 |
2833 | 275 #ifdef HAVE_MMX |
2846 | 276 #ifdef HAVE_3DNOW |
2835 | 277 asm volatile( |
278 PREFETCHW" %0\n\t" | |
279 PREFETCH" %1\n\t" | |
280 PREFETCH" %2\n\t" | |
281 "pxor %%mm7, %%mm7\n\t" | |
282 "pcmpeqb %%mm6, %%mm6\n\t" // F..F | |
2839 | 283 ::"m"(*dstbase),"m"(*srca),"m"(*src):"memory"); |
2835 | 284 for(x=0;x<w;x+=2){ |
2843 | 285 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
|
286 asm volatile( |
2835 | 287 PREFETCHW" 32%0\n\t" |
288 PREFETCH" 32%1\n\t" | |
289 PREFETCH" 32%2\n\t" | |
290 "movq %0, %%mm0\n\t" // dstbase | |
291 "movq %%mm0, %%mm1\n\t" | |
292 "punpcklbw %%mm7, %%mm0\n\t" | |
293 "punpckhbw %%mm7, %%mm1\n\t" | |
294 "movd %1, %%mm2\n\t" // srca ABCD0000 | |
295 "paddb %%mm6, %%mm2\n\t" | |
296 "punpcklbw %%mm2, %%mm2\n\t" // srca AABBCCDD | |
297 "punpcklbw %%mm2, %%mm2\n\t" // srca AAAABBBB | |
298 "movq %%mm2, %%mm3\n\t" | |
299 "punpcklbw %%mm7, %%mm2\n\t" // srca 0A0A0A0A | |
300 "punpckhbw %%mm7, %%mm3\n\t" // srca 0B0B0B0B | |
301 "pmullw %%mm2, %%mm0\n\t" | |
302 "pmullw %%mm3, %%mm1\n\t" | |
303 "psrlw $8, %%mm0\n\t" | |
304 "psrlw $8, %%mm1\n\t" | |
305 "packuswb %%mm1, %%mm0\n\t" | |
306 "movd %2, %%mm2 \n\t" // src ABCD0000 | |
307 "punpcklbw %%mm2, %%mm2\n\t" // src AABBCCDD | |
308 "punpcklbw %%mm2, %%mm2\n\t" // src AAAABBBB | |
309 "paddb %%mm2, %%mm0\n\t" | |
310 "movq %%mm0, %0\n\t" | |
311 :: "m" (dstbase[4*x]), "m" (srca[x]), "m" (src[x])); | |
312 } | |
2846 | 313 #else //this is faster for intels crap |
314 asm volatile( | |
315 PREFETCHW" %0\n\t" | |
316 PREFETCH" %1\n\t" | |
317 PREFETCH" %2\n\t" | |
318 "pxor %%mm7, %%mm7\n\t" | |
319 "pcmpeqb %%mm5, %%mm5\n\t" // F..F | |
320 "movq %%mm5, %%mm4\n\t" | |
321 "psllw $8, %%mm5\n\t" //FF00FF00FF00 | |
322 "psrlw $8, %%mm4\n\t" //00FF00FF00FF | |
323 ::"m"(*dstbase),"m"(*srca),"m"(*src):"memory"); | |
324 for(x=0;x<w;x+=4){ | |
325 asm volatile( | |
326 "movl %1, %%eax\n\t" | |
327 "orl %%eax, %%eax\n\t" | |
328 " jz 1f\n\t" | |
329 PREFETCHW" 32%0\n\t" | |
330 PREFETCH" 32%1\n\t" | |
331 PREFETCH" 32%2\n\t" | |
332 "movq %0, %%mm0\n\t" // dstbase | |
333 "movq %%mm0, %%mm1\n\t" | |
334 "pand %%mm4, %%mm0\n\t" //0R0B0R0B | |
335 "psrlw $8, %%mm1\n\t" //0?0G0?0G | |
336 "movd %%eax, %%mm2\n\t" //srca 0000DCBA | |
4245 | 337 "paddb "MANGLE(bFF)", %%mm2\n\t" |
2846 | 338 "punpcklbw %%mm2, %%mm2\n\t" //srca DDCCBBAA |
339 "movq %%mm2, %%mm3\n\t" | |
340 "punpcklbw %%mm7, %%mm2\n\t" //srca 0B0B0A0A | |
341 "pmullw %%mm2, %%mm0\n\t" | |
342 "pmullw %%mm2, %%mm1\n\t" | |
343 "psrlw $8, %%mm0\n\t" | |
344 "pand %%mm5, %%mm1\n\t" | |
345 "por %%mm1, %%mm0\n\t" | |
346 "movd %2, %%mm2 \n\t" //src 0000DCBA | |
347 "punpcklbw %%mm2, %%mm2\n\t" //src DDCCBBAA | |
348 "movq %%mm2, %%mm6\n\t" | |
349 "punpcklbw %%mm2, %%mm2\n\t" //src BBBBAAAA | |
350 "paddb %%mm2, %%mm0\n\t" | |
351 "movq %%mm0, %0\n\t" | |
352 | |
353 "movq 8%0, %%mm0\n\t" // dstbase | |
354 "movq %%mm0, %%mm1\n\t" | |
355 "pand %%mm4, %%mm0\n\t" //0R0B0R0B | |
356 "psrlw $8, %%mm1\n\t" //0?0G0?0G | |
357 "punpckhbw %%mm7, %%mm3\n\t" //srca 0D0D0C0C | |
358 "pmullw %%mm3, %%mm0\n\t" | |
359 "pmullw %%mm3, %%mm1\n\t" | |
360 "psrlw $8, %%mm0\n\t" | |
361 "pand %%mm5, %%mm1\n\t" | |
362 "por %%mm1, %%mm0\n\t" | |
363 "punpckhbw %%mm6, %%mm6\n\t" //src DDDDCCCC | |
364 "paddb %%mm6, %%mm0\n\t" | |
365 "movq %%mm0, 8%0\n\t" | |
366 "1:\n\t" | |
367 :: "m" (dstbase[4*x]), "m" (srca[x]), "m" (src[x]) | |
368 : "%eax"); | |
369 } | |
370 #endif | |
2839 | 371 #else /* HAVE_MMX */ |
2823
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
372 for(x=0;x<w;x++){ |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
373 if(srca[x]){ |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
374 asm volatile( |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
375 "movzbl (%0), %%ecx\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
376 "movzbl 1(%0), %%eax\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
377 "movzbl 2(%0), %%edx\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
378 |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
379 "imull %1, %%ecx\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
380 "imull %1, %%eax\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
381 "imull %1, %%edx\n\t" |
2578 | 382 |
2823
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
383 "addl %2, %%ecx\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
384 "addl %2, %%eax\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
385 "addl %2, %%edx\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
386 |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
387 "movb %%ch, (%0)\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
388 "movb %%ah, 1(%0)\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
389 "movb %%dh, 2(%0)\n\t" |
2578 | 390 |
2823
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
391 : |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
392 :"r" (&dstbase[4*x]), |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
393 "r" ((unsigned)srca[x]), |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
394 "r" (((unsigned)src[x])<<8) |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
395 :"%eax", "%ecx", "%edx" |
2578 | 396 ); |
2823
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
397 } |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
398 } |
2839 | 399 #endif /* HAVE_MMX */ |
2798
ee2cd36a81a2
Code cleanup - emms is not required when MMX block is commented out.
nick
parents:
2578
diff
changeset
|
400 #else /*non x86 arch*/ |
326 | 401 for(x=0;x<w;x++){ |
402 if(srca[x]){ | |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
403 #ifdef FAST_OSD |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
404 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
|
405 #else |
326 | 406 dstbase[4*x+0]=((dstbase[4*x+0]*srca[x])>>8)+src[x]; |
407 dstbase[4*x+1]=((dstbase[4*x+1]*srca[x])>>8)+src[x]; | |
408 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
|
409 #endif |
326 | 410 } |
411 } | |
2798
ee2cd36a81a2
Code cleanup - emms is not required when MMX block is commented out.
nick
parents:
2578
diff
changeset
|
412 #endif /* arch_x86 */ |
326 | 413 src+=srcstride; |
414 srca+=srcstride; | |
415 dstbase+=dststride; | |
416 } | |
2833 | 417 #ifdef HAVE_MMX |
2798
ee2cd36a81a2
Code cleanup - emms is not required when MMX block is commented out.
nick
parents:
2578
diff
changeset
|
418 asm volatile(EMMS:::"memory"); |
2578 | 419 #endif |
2833 | 420 PROFILE_END("vo_draw_alpha_rgb32"); |
326 | 421 return; |
422 } |