annotate sub/osd_template.c @ 36664:aacfb0698863

Replace sublang pixmap by subtitle pixmap. The subtitle pixmap is appropriate for DVD subtitles as well. As a result, sublang.xpm isn't used any longer and can be removed.
author ib
date Mon, 27 Jan 2014 13:41:13 +0000
parents 3fef2e17a03f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
32469
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
1 /*
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
2 * generic alpha renderers for all YUV modes and RGB depths
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
3 * Optimized by Nick and Michael.
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
4 *
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
5 * This file is part of MPlayer.
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
6 *
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
7 * MPlayer is free software; you can redistribute it and/or modify
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
10 * (at your option) any later version.
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
11 *
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
12 * MPlayer is distributed in the hope that it will be useful,
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
15 * GNU General Public License for more details.
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
16 *
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License along
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
18 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
20 */
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
21
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
22 #undef PREFETCH
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
23 #undef EMMS
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
24 #undef PREFETCHW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
25 #undef PAVGB
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
26
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
27 #if HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
28 #define PREFETCH "prefetch"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
29 #define PREFETCHW "prefetchw"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
30 #define PAVGB "pavgusb"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
31 #elif HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
32 #define PREFETCH "prefetchnta"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
33 #define PREFETCHW "prefetcht0"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
34 #define PAVGB "pavgb"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
35 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
36 #define PREFETCH " # nop"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
37 #define PREFETCHW " # nop"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
38 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
39
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
40 #if HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
41 /* On K6 femms is faster of emms. On K7 femms is directly mapped on emms. */
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
42 #define EMMS "femms"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
43 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
44 #define EMMS "emms"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
45 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
46
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
47 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){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
48 int y;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
49 #if defined(FAST_OSD) && !HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
50 w=w>>1;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
51 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
52 #if HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
53 __asm__ volatile(
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
54 "pcmpeqb %%mm5, %%mm5\n\t" // F..F
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
55 "movq %%mm5, %%mm4\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
56 "movq %%mm5, %%mm7\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
57 "psllw $8, %%mm5\n\t" //FF00FF00FF00
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
58 "psrlw $8, %%mm4\n\t" //00FF00FF00FF
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
59 ::);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
60 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
61 for(y=0;y<h;y++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
62 register int x;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
63 #if HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
64 __asm__ volatile(
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
65 PREFETCHW" %0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
66 PREFETCH" %1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
67 PREFETCH" %2\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
68 ::"m"(*dstbase),"m"(*srca),"m"(*src):"memory");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
69 for(x=0;x<w;x+=8){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
70 __asm__ volatile(
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
71 "movl %1, %%eax\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
72 "orl 4%1, %%eax\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
73 " jz 1f\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
74 PREFETCHW" 32%0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
75 PREFETCH" 32%1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
76 PREFETCH" 32%2\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
77 "movq %0, %%mm0\n\t" // dstbase
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
78 "movq %%mm0, %%mm1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
79 "pand %%mm4, %%mm0\n\t" //0Y0Y0Y0Y
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
80 "psrlw $8, %%mm1\n\t" //0Y0Y0Y0Y
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
81 "movq %1, %%mm2\n\t" //srca HGFEDCBA
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
82 "paddb %%mm7, %%mm2\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
83 "movq %%mm2, %%mm3\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
84 "pand %%mm4, %%mm2\n\t" //0G0E0C0A
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
85 "psrlw $8, %%mm3\n\t" //0H0F0D0B
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
86 "pmullw %%mm2, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
87 "pmullw %%mm3, %%mm1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
88 "psrlw $8, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
89 "pand %%mm5, %%mm1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
90 "por %%mm1, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
91 "paddb %2, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
92 "movq %%mm0, %0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
93 "1:\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
94 :: "m" (dstbase[x]), "m" (srca[x]), "m" (src[x])
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
95 : "%eax");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
96 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
97 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
98 for(x=0;x<w;x++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
99 #ifdef FAST_OSD
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
100 if(srca[2*x+0]) dstbase[2*x+0]=src[2*x+0];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
101 if(srca[2*x+1]) dstbase[2*x+1]=src[2*x+1];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
102 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
103 if(srca[x]) dstbase[x]=((dstbase[x]*srca[x])>>8)+src[x];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
104 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
105 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
106 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
107 src+=srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
108 srca+=srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
109 dstbase+=dststride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
110 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
111 #if HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
112 __asm__ volatile(EMMS:::"memory");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
113 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
114 return;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
115 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
116
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
117 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){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
118 int y;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
119 #if defined(FAST_OSD) && !HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
120 w=w>>1;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
121 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
122 #if HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
123 __asm__ volatile(
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
124 "pxor %%mm7, %%mm7\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
125 "pcmpeqb %%mm5, %%mm5\n\t" // F..F
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
126 "movq %%mm5, %%mm6\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
127 "movq %%mm5, %%mm4\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
128 "psllw $8, %%mm5\n\t" //FF00FF00FF00
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
129 "psrlw $8, %%mm4\n\t" //00FF00FF00FF
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
130 ::);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
131 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
132 for(y=0;y<h;y++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
133 register int x;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
134 #if HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
135 __asm__ volatile(
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
136 PREFETCHW" %0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
137 PREFETCH" %1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
138 PREFETCH" %2\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
139 ::"m"(*dstbase),"m"(*srca),"m"(*src));
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
140 for(x=0;x<w;x+=4){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
141 __asm__ volatile(
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
142 "movl %1, %%eax\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
143 "orl %%eax, %%eax\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
144 " jz 1f\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
145 PREFETCHW" 32%0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
146 PREFETCH" 32%1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
147 PREFETCH" 32%2\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
148 "movq %0, %%mm0\n\t" // dstbase
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
149 "movq %%mm0, %%mm1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
150 "pand %%mm4, %%mm0\n\t" //0Y0Y0Y0Y
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
151 "movd %%eax, %%mm2\n\t" //srca 0000DCBA
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
152 "paddb %%mm6, %%mm2\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
153 "punpcklbw %%mm7, %%mm2\n\t" //srca 0D0C0B0A
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
154 "pmullw %%mm2, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
155 "psrlw $8, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
156 "pand %%mm5, %%mm1\n\t" //U0V0U0V0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
157 "movd %2, %%mm2\n\t" //src 0000DCBA
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
158 "punpcklbw %%mm7, %%mm2\n\t" //srca 0D0C0B0A
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
159 "por %%mm1, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
160 "paddb %%mm2, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
161 "movq %%mm0, %0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
162 "1:\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
163 :: "m" (dstbase[x*2]), "m" (srca[x]), "m" (src[x])
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
164 : "%eax");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
165 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
166 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
167 for(x=0;x<w;x++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
168 #ifdef FAST_OSD
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
169 if(srca[2*x+0]) dstbase[4*x+0]=src[2*x+0];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
170 if(srca[2*x+1]) dstbase[4*x+2]=src[2*x+1];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
171 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
172 if(srca[x]) {
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
173 dstbase[2*x]=((dstbase[2*x]*srca[x])>>8)+src[x];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
174 dstbase[2*x+1]=((((signed)dstbase[2*x+1]-128)*srca[x])>>8)+128;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
175 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
176 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
177 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
178 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
179 src+=srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
180 srca+=srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
181 dstbase+=dststride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
182 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
183 #if HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
184 __asm__ volatile(EMMS:::"memory");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
185 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
186 return;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
187 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
188
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
189 static inline void RENAME(vo_draw_alpha_uyvy)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
190 int y;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
191 #if defined(FAST_OSD)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
192 w=w>>1;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
193 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
194 for(y=0;y<h;y++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
195 register int x;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
196 for(x=0;x<w;x++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
197 #ifdef FAST_OSD
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
198 if(srca[2*x+0]) dstbase[4*x+2]=src[2*x+0];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
199 if(srca[2*x+1]) dstbase[4*x+0]=src[2*x+1];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
200 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
201 if(srca[x]) {
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
202 dstbase[2*x+1]=((dstbase[2*x+1]*srca[x])>>8)+src[x];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
203 dstbase[2*x]=((((signed)dstbase[2*x]-128)*srca[x])>>8)+128;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
204 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
205 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
206 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
207 src+=srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
208 srca+=srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
209 dstbase+=dststride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
210 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
211 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
212
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
213 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){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
214 int y;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
215 #if HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
216 __asm__ volatile(
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
217 "pxor %%mm7, %%mm7\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
218 "pcmpeqb %%mm6, %%mm6\n\t" // F..F
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
219 ::);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
220 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
221 for(y=0;y<h;y++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
222 register unsigned char *dst = dstbase;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
223 register int x;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
224 #if ARCH_X86 && (!ARCH_X86_64 || HAVE_MMX)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
225 #if HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
226 __asm__ volatile(
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
227 PREFETCHW" %0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
228 PREFETCH" %1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
229 PREFETCH" %2\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
230 ::"m"(*dst),"m"(*srca),"m"(*src):"memory");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
231 for(x=0;x<w;x+=2){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
232 if(srca[x] || srca[x+1])
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
233 __asm__ volatile(
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
234 PREFETCHW" 32%0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
235 PREFETCH" 32%1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
236 PREFETCH" 32%2\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
237 "movq %0, %%mm0\n\t" // dstbase
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
238 "movq %%mm0, %%mm1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
239 "movq %%mm0, %%mm5\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
240 "punpcklbw %%mm7, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
241 "punpckhbw %%mm7, %%mm1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
242 "movd %1, %%mm2\n\t" // srca ABCD0000
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
243 "paddb %%mm6, %%mm2\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
244 "punpcklbw %%mm2, %%mm2\n\t" // srca AABBCCDD
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
245 "punpcklbw %%mm2, %%mm2\n\t" // srca AAAABBBB
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
246 "psrlq $8, %%mm2\n\t" // srca AAABBBB0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
247 "movq %%mm2, %%mm3\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
248 "punpcklbw %%mm7, %%mm2\n\t" // srca 0A0A0A0B
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
249 "punpckhbw %%mm7, %%mm3\n\t" // srca 0B0B0B00
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
250 "pmullw %%mm2, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
251 "pmullw %%mm3, %%mm1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
252 "psrlw $8, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
253 "psrlw $8, %%mm1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
254 "packuswb %%mm1, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
255 "movd %2, %%mm2 \n\t" // src ABCD0000
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
256 "punpcklbw %%mm2, %%mm2\n\t" // src AABBCCDD
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
257 "punpcklbw %%mm2, %%mm2\n\t" // src AAAABBBB
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
258 "psrlq $8, %%mm2\n\t" // src AAABBBB0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
259 "paddb %%mm2, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
260 "pand %4, %%mm5\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
261 "pand %3, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
262 "por %%mm0, %%mm5\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
263 "movq %%mm5, %0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
264 :: "m" (dst[0]), "m" (srca[x]), "m" (src[x]), "m"(mask24hl), "m"(mask24lh));
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
265 dst += 6;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
266 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
267 #else /* HAVE_MMX */
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
268 for(x=0;x<w;x++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
269 if(srca[x]){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
270 __asm__ volatile(
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
271 "movzbl (%0), %%ecx\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
272 "movzbl 1(%0), %%eax\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
273
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
274 "imull %1, %%ecx\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
275 "imull %1, %%eax\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
276
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
277 "addl %2, %%ecx\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
278 "addl %2, %%eax\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
279
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
280 "movb %%ch, (%0)\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
281 "movb %%ah, 1(%0)\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
282
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
283 "movzbl 2(%0), %%eax\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
284 "imull %1, %%eax\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
285 "addl %2, %%eax\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
286 "movb %%ah, 2(%0)\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
287 :
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
288 :"D" (dst),
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
289 "r" ((unsigned)srca[x]),
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
290 "r" (((unsigned)src[x])<<8)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
291 :"%eax", "%ecx"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
292 );
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
293 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
294 dst += 3;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
295 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
296 #endif /* !HAVE_MMX */
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
297 #else /*non x86 arch or x86_64 with MMX disabled */
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
298 for(x=0;x<w;x++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
299 if(srca[x]){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
300 #ifdef FAST_OSD
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
301 dst[0]=dst[1]=dst[2]=src[x];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
302 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
303 dst[0]=((dst[0]*srca[x])>>8)+src[x];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
304 dst[1]=((dst[1]*srca[x])>>8)+src[x];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
305 dst[2]=((dst[2]*srca[x])>>8)+src[x];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
306 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
307 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
308 dst+=3; // 24bpp
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
309 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
310 #endif /* arch_x86 */
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
311 src+=srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
312 srca+=srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
313 dstbase+=dststride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
314 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
315 #if HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
316 __asm__ volatile(EMMS:::"memory");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
317 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
318 return;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
319 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
320
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
321 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){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
322 int y;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
323 #if HAVE_BIGENDIAN
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
324 dstbase++;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
325 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
326 #if HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
327 #if HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
328 __asm__ volatile(
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
329 "pxor %%mm7, %%mm7\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
330 "pcmpeqb %%mm6, %%mm6\n\t" // F..F
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
331 ::);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
332 #else /* HAVE_AMD3DNOW */
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
333 __asm__ volatile(
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
334 "pxor %%mm7, %%mm7\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
335 "pcmpeqb %%mm5, %%mm5\n\t" // F..F
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
336 "movq %%mm5, %%mm4\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
337 "psllw $8, %%mm5\n\t" //FF00FF00FF00
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
338 "psrlw $8, %%mm4\n\t" //00FF00FF00FF
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
339 ::);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
340 #endif /* HAVE_AMD3DNOW */
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
341 #endif /* HAVE_MMX */
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
342 for(y=0;y<h;y++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
343 register int x;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
344 #if ARCH_X86 && (!ARCH_X86_64 || HAVE_MMX)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
345 #if HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
346 #if HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
347 __asm__ volatile(
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
348 PREFETCHW" %0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
349 PREFETCH" %1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
350 PREFETCH" %2\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
351 ::"m"(*dstbase),"m"(*srca),"m"(*src):"memory");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
352 for(x=0;x<w;x+=2){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
353 if(srca[x] || srca[x+1])
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
354 __asm__ volatile(
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
355 PREFETCHW" 32%0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
356 PREFETCH" 32%1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
357 PREFETCH" 32%2\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
358 "movq %0, %%mm0\n\t" // dstbase
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
359 "movq %%mm0, %%mm1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
360 "punpcklbw %%mm7, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
361 "punpckhbw %%mm7, %%mm1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
362 "movd %1, %%mm2\n\t" // srca ABCD0000
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
363 "paddb %%mm6, %%mm2\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
364 "punpcklbw %%mm2, %%mm2\n\t" // srca AABBCCDD
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
365 "punpcklbw %%mm2, %%mm2\n\t" // srca AAAABBBB
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
366 "movq %%mm2, %%mm3\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
367 "punpcklbw %%mm7, %%mm2\n\t" // srca 0A0A0A0A
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
368 "punpckhbw %%mm7, %%mm3\n\t" // srca 0B0B0B0B
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
369 "pmullw %%mm2, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
370 "pmullw %%mm3, %%mm1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
371 "psrlw $8, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
372 "psrlw $8, %%mm1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
373 "packuswb %%mm1, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
374 "movd %2, %%mm2 \n\t" // src ABCD0000
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
375 "punpcklbw %%mm2, %%mm2\n\t" // src AABBCCDD
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
376 "punpcklbw %%mm2, %%mm2\n\t" // src AAAABBBB
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
377 "paddb %%mm2, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
378 "movq %%mm0, %0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
379 :: "m" (dstbase[4*x]), "m" (srca[x]), "m" (src[x]));
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
380 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
381 #else //this is faster for intels crap
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
382 __asm__ volatile(
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
383 PREFETCHW" %0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
384 PREFETCH" %1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
385 PREFETCH" %2\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
386 ::"m"(*dstbase),"m"(*srca),"m"(*src):"memory");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
387 for(x=0;x<w;x+=4){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
388 __asm__ volatile(
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
389 "movl %1, %%eax\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
390 "orl %%eax, %%eax\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
391 " jz 1f\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
392 PREFETCHW" 32%0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
393 PREFETCH" 32%1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
394 PREFETCH" 32%2\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
395 "movq %0, %%mm0\n\t" // dstbase
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
396 "movq %%mm0, %%mm1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
397 "pand %%mm4, %%mm0\n\t" //0R0B0R0B
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
398 "psrlw $8, %%mm1\n\t" //0?0G0?0G
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
399 "movd %%eax, %%mm2\n\t" //srca 0000DCBA
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
400 "paddb %3, %%mm2\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
401 "punpcklbw %%mm2, %%mm2\n\t" //srca DDCCBBAA
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
402 "movq %%mm2, %%mm3\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
403 "punpcklbw %%mm7, %%mm2\n\t" //srca 0B0B0A0A
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
404 "pmullw %%mm2, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
405 "pmullw %%mm2, %%mm1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
406 "psrlw $8, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
407 "pand %%mm5, %%mm1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
408 "por %%mm1, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
409 "movd %2, %%mm2 \n\t" //src 0000DCBA
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
410 "punpcklbw %%mm2, %%mm2\n\t" //src DDCCBBAA
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
411 "movq %%mm2, %%mm6\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
412 "punpcklbw %%mm2, %%mm2\n\t" //src BBBBAAAA
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
413 "paddb %%mm2, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
414 "movq %%mm0, %0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
415
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
416 "movq 8%0, %%mm0\n\t" // dstbase
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
417 "movq %%mm0, %%mm1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
418 "pand %%mm4, %%mm0\n\t" //0R0B0R0B
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
419 "psrlw $8, %%mm1\n\t" //0?0G0?0G
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
420 "punpckhbw %%mm7, %%mm3\n\t" //srca 0D0D0C0C
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
421 "pmullw %%mm3, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
422 "pmullw %%mm3, %%mm1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
423 "psrlw $8, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
424 "pand %%mm5, %%mm1\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
425 "por %%mm1, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
426 "punpckhbw %%mm6, %%mm6\n\t" //src DDDDCCCC
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
427 "paddb %%mm6, %%mm0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
428 "movq %%mm0, 8%0\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
429 "1:\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
430 :: "m" (dstbase[4*x]), "m" (srca[x]), "m" (src[x]), "m" (bFF)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
431 : "%eax");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
432 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
433 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
434 #else /* HAVE_MMX */
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
435 for(x=0;x<w;x++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
436 if(srca[x]){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
437 __asm__ volatile(
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
438 "movzbl (%0), %%ecx\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
439 "movzbl 1(%0), %%eax\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
440 "movzbl 2(%0), %%edx\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
441
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
442 "imull %1, %%ecx\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
443 "imull %1, %%eax\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
444 "imull %1, %%edx\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
445
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
446 "addl %2, %%ecx\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
447 "addl %2, %%eax\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
448 "addl %2, %%edx\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
449
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
450 "movb %%ch, (%0)\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
451 "movb %%ah, 1(%0)\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
452 "movb %%dh, 2(%0)\n\t"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
453
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
454 :
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
455 :"r" (&dstbase[4*x]),
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
456 "r" ((unsigned)srca[x]),
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
457 "r" (((unsigned)src[x])<<8)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
458 :"%eax", "%ecx", "%edx"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
459 );
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
460 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
461 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
462 #endif /* HAVE_MMX */
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
463 #else /*non x86 arch or x86_64 with MMX disabled */
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
464 for(x=0;x<w;x++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
465 if(srca[x]){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
466 #ifdef FAST_OSD
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
467 dstbase[4*x+0]=dstbase[4*x+1]=dstbase[4*x+2]=src[x];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
468 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
469 dstbase[4*x+0]=((dstbase[4*x+0]*srca[x])>>8)+src[x];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
470 dstbase[4*x+1]=((dstbase[4*x+1]*srca[x])>>8)+src[x];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
471 dstbase[4*x+2]=((dstbase[4*x+2]*srca[x])>>8)+src[x];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
472 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
473 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
474 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
475 #endif /* arch_x86 */
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
476 src+=srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
477 srca+=srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
478 dstbase+=dststride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
479 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
480 #if HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
481 __asm__ volatile(EMMS:::"memory");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
482 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
483 return;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
484 }