Mercurial > mplayer.hg
annotate libvo/osd_template.c @ 10113:443ac419f3a4
removed RGB24 and builtin swscaler support
author | alex |
---|---|
date | Fri, 16 May 2003 16:03:42 +0000 |
parents | 9d7477d0d64d |
children | 14c8c762c2b7 |
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 | |
222 "imull %1, %%ecx\n\t" | |
223 "imull %1, %%eax\n\t" | |
224 | |
5139 | 225 "addl %2, %%ecx\n\t" |
2839 | 226 "addl %2, %%eax\n\t" |
227 | |
228 "movb %%ch, (%0)\n\t" | |
229 "movb %%ah, 1(%0)\n\t" | |
5139 | 230 |
231 "movzbl 2(%0), %%eax\n\t" | |
232 "imull %1, %%eax\n\t" | |
233 "addl %2, %%eax\n\t" | |
234 "movb %%ah, 2(%0)\n\t" | |
2839 | 235 : |
236 :"r" (dst), | |
237 "r" ((unsigned)srca[x]), | |
238 "r" (((unsigned)src[x])<<8) | |
5139 | 239 :"%eax", "%ecx" |
2839 | 240 ); |
241 } | |
242 dst += 3; | |
243 } | |
5139 | 244 #endif /* !HAVE_MMX */ |
2839 | 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(); |
9960 | 272 #ifdef WORDS_BIGENDIAN |
273 dstbase++; | |
274 #endif | |
326 | 275 for(y=0;y<h;y++){ |
276 register int x; | |
2798
ee2cd36a81a2
Code cleanup - emms is not required when MMX block is commented out.
nick
parents:
2578
diff
changeset
|
277 #ifdef ARCH_X86 |
2833 | 278 #ifdef HAVE_MMX |
2846 | 279 #ifdef HAVE_3DNOW |
2835 | 280 asm volatile( |
281 PREFETCHW" %0\n\t" | |
282 PREFETCH" %1\n\t" | |
283 PREFETCH" %2\n\t" | |
284 "pxor %%mm7, %%mm7\n\t" | |
285 "pcmpeqb %%mm6, %%mm6\n\t" // F..F | |
2839 | 286 ::"m"(*dstbase),"m"(*srca),"m"(*src):"memory"); |
2835 | 287 for(x=0;x<w;x+=2){ |
2843 | 288 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
|
289 asm volatile( |
2835 | 290 PREFETCHW" 32%0\n\t" |
291 PREFETCH" 32%1\n\t" | |
292 PREFETCH" 32%2\n\t" | |
293 "movq %0, %%mm0\n\t" // dstbase | |
294 "movq %%mm0, %%mm1\n\t" | |
295 "punpcklbw %%mm7, %%mm0\n\t" | |
296 "punpckhbw %%mm7, %%mm1\n\t" | |
297 "movd %1, %%mm2\n\t" // srca ABCD0000 | |
298 "paddb %%mm6, %%mm2\n\t" | |
299 "punpcklbw %%mm2, %%mm2\n\t" // srca AABBCCDD | |
300 "punpcklbw %%mm2, %%mm2\n\t" // srca AAAABBBB | |
301 "movq %%mm2, %%mm3\n\t" | |
302 "punpcklbw %%mm7, %%mm2\n\t" // srca 0A0A0A0A | |
303 "punpckhbw %%mm7, %%mm3\n\t" // srca 0B0B0B0B | |
304 "pmullw %%mm2, %%mm0\n\t" | |
305 "pmullw %%mm3, %%mm1\n\t" | |
306 "psrlw $8, %%mm0\n\t" | |
307 "psrlw $8, %%mm1\n\t" | |
308 "packuswb %%mm1, %%mm0\n\t" | |
309 "movd %2, %%mm2 \n\t" // src ABCD0000 | |
310 "punpcklbw %%mm2, %%mm2\n\t" // src AABBCCDD | |
311 "punpcklbw %%mm2, %%mm2\n\t" // src AAAABBBB | |
312 "paddb %%mm2, %%mm0\n\t" | |
313 "movq %%mm0, %0\n\t" | |
314 :: "m" (dstbase[4*x]), "m" (srca[x]), "m" (src[x])); | |
315 } | |
2846 | 316 #else //this is faster for intels crap |
317 asm volatile( | |
318 PREFETCHW" %0\n\t" | |
319 PREFETCH" %1\n\t" | |
320 PREFETCH" %2\n\t" | |
321 "pxor %%mm7, %%mm7\n\t" | |
322 "pcmpeqb %%mm5, %%mm5\n\t" // F..F | |
323 "movq %%mm5, %%mm4\n\t" | |
324 "psllw $8, %%mm5\n\t" //FF00FF00FF00 | |
325 "psrlw $8, %%mm4\n\t" //00FF00FF00FF | |
326 ::"m"(*dstbase),"m"(*srca),"m"(*src):"memory"); | |
327 for(x=0;x<w;x+=4){ | |
328 asm volatile( | |
329 "movl %1, %%eax\n\t" | |
330 "orl %%eax, %%eax\n\t" | |
331 " jz 1f\n\t" | |
332 PREFETCHW" 32%0\n\t" | |
333 PREFETCH" 32%1\n\t" | |
334 PREFETCH" 32%2\n\t" | |
335 "movq %0, %%mm0\n\t" // dstbase | |
336 "movq %%mm0, %%mm1\n\t" | |
337 "pand %%mm4, %%mm0\n\t" //0R0B0R0B | |
338 "psrlw $8, %%mm1\n\t" //0?0G0?0G | |
339 "movd %%eax, %%mm2\n\t" //srca 0000DCBA | |
4245 | 340 "paddb "MANGLE(bFF)", %%mm2\n\t" |
2846 | 341 "punpcklbw %%mm2, %%mm2\n\t" //srca DDCCBBAA |
342 "movq %%mm2, %%mm3\n\t" | |
343 "punpcklbw %%mm7, %%mm2\n\t" //srca 0B0B0A0A | |
344 "pmullw %%mm2, %%mm0\n\t" | |
345 "pmullw %%mm2, %%mm1\n\t" | |
346 "psrlw $8, %%mm0\n\t" | |
347 "pand %%mm5, %%mm1\n\t" | |
348 "por %%mm1, %%mm0\n\t" | |
349 "movd %2, %%mm2 \n\t" //src 0000DCBA | |
350 "punpcklbw %%mm2, %%mm2\n\t" //src DDCCBBAA | |
351 "movq %%mm2, %%mm6\n\t" | |
352 "punpcklbw %%mm2, %%mm2\n\t" //src BBBBAAAA | |
353 "paddb %%mm2, %%mm0\n\t" | |
354 "movq %%mm0, %0\n\t" | |
355 | |
356 "movq 8%0, %%mm0\n\t" // dstbase | |
357 "movq %%mm0, %%mm1\n\t" | |
358 "pand %%mm4, %%mm0\n\t" //0R0B0R0B | |
359 "psrlw $8, %%mm1\n\t" //0?0G0?0G | |
360 "punpckhbw %%mm7, %%mm3\n\t" //srca 0D0D0C0C | |
361 "pmullw %%mm3, %%mm0\n\t" | |
362 "pmullw %%mm3, %%mm1\n\t" | |
363 "psrlw $8, %%mm0\n\t" | |
364 "pand %%mm5, %%mm1\n\t" | |
365 "por %%mm1, %%mm0\n\t" | |
366 "punpckhbw %%mm6, %%mm6\n\t" //src DDDDCCCC | |
367 "paddb %%mm6, %%mm0\n\t" | |
368 "movq %%mm0, 8%0\n\t" | |
369 "1:\n\t" | |
370 :: "m" (dstbase[4*x]), "m" (srca[x]), "m" (src[x]) | |
371 : "%eax"); | |
372 } | |
373 #endif | |
2839 | 374 #else /* HAVE_MMX */ |
2823
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
375 for(x=0;x<w;x++){ |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
376 if(srca[x]){ |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
377 asm volatile( |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
378 "movzbl (%0), %%ecx\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
379 "movzbl 1(%0), %%eax\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
380 "movzbl 2(%0), %%edx\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
381 |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
382 "imull %1, %%ecx\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
383 "imull %1, %%eax\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
384 "imull %1, %%edx\n\t" |
2578 | 385 |
2823
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
386 "addl %2, %%ecx\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
387 "addl %2, %%eax\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
388 "addl %2, %%edx\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
389 |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
390 "movb %%ch, (%0)\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
391 "movb %%ah, 1(%0)\n\t" |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
392 "movb %%dh, 2(%0)\n\t" |
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 :"r" (&dstbase[4*x]), |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
396 "r" ((unsigned)srca[x]), |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
397 "r" (((unsigned)src[x])<<8) |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
398 :"%eax", "%ecx", "%edx" |
2578 | 399 ); |
2823
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
400 } |
004ee19ebfcf
Extract parallelism from OSD stuff + MMX2 optimization.
nick
parents:
2807
diff
changeset
|
401 } |
2839 | 402 #endif /* HAVE_MMX */ |
2798
ee2cd36a81a2
Code cleanup - emms is not required when MMX block is commented out.
nick
parents:
2578
diff
changeset
|
403 #else /*non x86 arch*/ |
326 | 404 for(x=0;x<w;x++){ |
405 if(srca[x]){ | |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
406 #ifdef FAST_OSD |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
407 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
|
408 #else |
326 | 409 dstbase[4*x+0]=((dstbase[4*x+0]*srca[x])>>8)+src[x]; |
410 dstbase[4*x+1]=((dstbase[4*x+1]*srca[x])>>8)+src[x]; | |
411 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
|
412 #endif |
326 | 413 } |
414 } | |
2798
ee2cd36a81a2
Code cleanup - emms is not required when MMX block is commented out.
nick
parents:
2578
diff
changeset
|
415 #endif /* arch_x86 */ |
326 | 416 src+=srcstride; |
417 srca+=srcstride; | |
418 dstbase+=dststride; | |
419 } | |
2833 | 420 #ifdef HAVE_MMX |
2798
ee2cd36a81a2
Code cleanup - emms is not required when MMX block is commented out.
nick
parents:
2578
diff
changeset
|
421 asm volatile(EMMS:::"memory"); |
2578 | 422 #endif |
2833 | 423 PROFILE_END("vo_draw_alpha_rgb32"); |
326 | 424 return; |
425 } |