Mercurial > mplayer.hg
annotate libvo/osd.c @ 28402:c884d17bd005
Convert HAVE_WINSOCK2_H into a 0/1 definition.
author | diego |
---|---|
date | Sun, 01 Feb 2009 13:42:27 +0000 |
parents | 31287e75b5d8 |
children | 7681eab10aea |
rev | line source |
---|---|
326 | 1 // Generic alpha renderers for all YUV modes and RGB depths. |
2 // These are "reference implementations", should be optimized later (MMX, etc) | |
3142 | 3 // Templating Code from Michael Niedermayer (michaelni@gmx.at) is under GPL |
326 | 4 |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
5 //#define FAST_OSD |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
6 //#define FAST_OSD_TABLE |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
7 |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
8 #include "config.h" |
622 | 9 #include "osd.h" |
5935 | 10 #include "mp_msg.h" |
2846 | 11 #include <inttypes.h> |
13787
e047e70a9767
Handle "xxx.h" vs "../xxx.h" include paths in a consistent way.
diego
parents:
13720
diff
changeset
|
12 #include "cpudetect.h" |
2846 | 13 |
28290 | 14 #if ARCH_X86 |
3142 | 15 #define CAN_COMPILE_X86_ASM |
2846 | 16 #endif |
622 | 17 |
3142 | 18 #ifdef CAN_COMPILE_X86_ASM |
25903
7a1397677cb3
Avoid a MANGLE, there is no register pressure and the generated code
reimar
parents:
20577
diff
changeset
|
19 static const uint64_t bFF __attribute__((aligned(8))) = 0xFFFFFFFFFFFFFFFFULL; |
2839 | 20 static const unsigned long long mask24lh __attribute__((aligned(8))) = 0xFFFF000000000000ULL; |
21 static const unsigned long long mask24hl __attribute__((aligned(8))) = 0x0000FFFFFFFFFFFFULL; | |
22 #endif | |
3142 | 23 |
24 //Note: we have C, X86-nommx, MMX, MMX2, 3DNOW version therse no 3DNOW+MMX2 one | |
25 //Plain C versions | |
28290 | 26 #if !HAVE_MMX || defined (RUNTIME_CPUDETECT) |
3153 | 27 #define COMPILE_C |
28 #endif | |
29 | |
30 #ifdef CAN_COMPILE_X86_ASM | |
31 | |
28335 | 32 #if (HAVE_MMX && !HAVE_AMD3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT) |
3153 | 33 #define COMPILE_MMX |
34 #endif | |
35 | |
28290 | 36 #if HAVE_MMX2 || defined (RUNTIME_CPUDETECT) |
3153 | 37 #define COMPILE_MMX2 |
38 #endif | |
39 | |
28335 | 40 #if (HAVE_AMD3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT) |
3153 | 41 #define COMPILE_3DNOW |
42 #endif | |
43 #endif //CAN_COMPILE_X86_ASM | |
44 | |
45 #undef HAVE_MMX | |
46 #undef HAVE_MMX2 | |
28335 | 47 #undef HAVE_AMD3DNOW |
28290 | 48 #define HAVE_MMX 0 |
49 #define HAVE_MMX2 0 | |
28335 | 50 #define HAVE_AMD3DNOW 0 |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
12516
diff
changeset
|
51 |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
12516
diff
changeset
|
52 #ifndef CAN_COMPILE_X86_ASM |
3153 | 53 |
54 #ifdef COMPILE_C | |
3142 | 55 #undef HAVE_MMX |
56 #undef HAVE_MMX2 | |
28335 | 57 #undef HAVE_AMD3DNOW |
28290 | 58 #define HAVE_MMX 0 |
59 #define HAVE_MMX2 0 | |
28335 | 60 #define HAVE_AMD3DNOW 0 |
3142 | 61 #define RENAME(a) a ## _C |
62 #include "osd_template.c" | |
3153 | 63 #endif |
3142 | 64 |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
12516
diff
changeset
|
65 #else |
3142 | 66 |
67 //X86 noMMX versions | |
3153 | 68 #ifdef COMPILE_C |
3142 | 69 #undef RENAME |
70 #undef HAVE_MMX | |
71 #undef HAVE_MMX2 | |
28335 | 72 #undef HAVE_AMD3DNOW |
28290 | 73 #define HAVE_MMX 0 |
74 #define HAVE_MMX2 0 | |
28335 | 75 #define HAVE_AMD3DNOW 0 |
3142 | 76 #define RENAME(a) a ## _X86 |
77 #include "osd_template.c" | |
3153 | 78 #endif |
3142 | 79 |
80 //MMX versions | |
3153 | 81 #ifdef COMPILE_MMX |
3142 | 82 #undef RENAME |
28290 | 83 #undef HAVE_MMX |
3142 | 84 #undef HAVE_MMX2 |
28335 | 85 #undef HAVE_AMD3DNOW |
28290 | 86 #define HAVE_MMX 1 |
87 #define HAVE_MMX2 0 | |
28335 | 88 #define HAVE_AMD3DNOW 0 |
3142 | 89 #define RENAME(a) a ## _MMX |
90 #include "osd_template.c" | |
3153 | 91 #endif |
3142 | 92 |
93 //MMX2 versions | |
3153 | 94 #ifdef COMPILE_MMX2 |
3142 | 95 #undef RENAME |
28290 | 96 #undef HAVE_MMX |
97 #undef HAVE_MMX2 | |
28335 | 98 #undef HAVE_AMD3DNOW |
28290 | 99 #define HAVE_MMX 1 |
100 #define HAVE_MMX2 1 | |
28335 | 101 #define HAVE_AMD3DNOW 0 |
3142 | 102 #define RENAME(a) a ## _MMX2 |
103 #include "osd_template.c" | |
3153 | 104 #endif |
3142 | 105 |
106 //3DNOW versions | |
3153 | 107 #ifdef COMPILE_3DNOW |
3142 | 108 #undef RENAME |
28290 | 109 #undef HAVE_MMX |
3142 | 110 #undef HAVE_MMX2 |
28335 | 111 #undef HAVE_AMD3DNOW |
28290 | 112 #define HAVE_MMX 1 |
113 #define HAVE_MMX2 0 | |
28335 | 114 #define HAVE_AMD3DNOW 1 |
3142 | 115 #define RENAME(a) a ## _3DNow |
116 #include "osd_template.c" | |
3153 | 117 #endif |
3142 | 118 |
119 #endif //CAN_COMPILE_X86_ASM | |
120 | |
121 void vo_draw_alpha_yv12(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ | |
3153 | 122 #ifdef RUNTIME_CPUDETECT |
3142 | 123 #ifdef CAN_COMPILE_X86_ASM |
12516 | 124 // ordered by speed / fastest first |
3142 | 125 if(gCpuCaps.hasMMX2) |
126 vo_draw_alpha_yv12_MMX2(w, h, src, srca, srcstride, dstbase, dststride); | |
127 else if(gCpuCaps.has3DNow) | |
128 vo_draw_alpha_yv12_3DNow(w, h, src, srca, srcstride, dstbase, dststride); | |
129 else if(gCpuCaps.hasMMX) | |
130 vo_draw_alpha_yv12_MMX(w, h, src, srca, srcstride, dstbase, dststride); | |
131 else | |
132 vo_draw_alpha_yv12_X86(w, h, src, srca, srcstride, dstbase, dststride); | |
133 #else | |
134 vo_draw_alpha_yv12_C(w, h, src, srca, srcstride, dstbase, dststride); | |
135 #endif | |
3153 | 136 #else //RUNTIME_CPUDETECT |
28290 | 137 #if HAVE_MMX2 |
3153 | 138 vo_draw_alpha_yv12_MMX2(w, h, src, srca, srcstride, dstbase, dststride); |
28335 | 139 #elif HAVE_AMD3DNOW |
3153 | 140 vo_draw_alpha_yv12_3DNow(w, h, src, srca, srcstride, dstbase, dststride); |
28290 | 141 #elif HAVE_MMX |
3153 | 142 vo_draw_alpha_yv12_MMX(w, h, src, srca, srcstride, dstbase, dststride); |
28290 | 143 #elif ARCH_X86 |
3153 | 144 vo_draw_alpha_yv12_X86(w, h, src, srca, srcstride, dstbase, dststride); |
145 #else | |
146 vo_draw_alpha_yv12_C(w, h, src, srca, srcstride, dstbase, dststride); | |
147 #endif | |
148 #endif //!RUNTIME_CPUDETECT | |
3142 | 149 } |
150 | |
151 void vo_draw_alpha_yuy2(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ | |
3153 | 152 #ifdef RUNTIME_CPUDETECT |
3142 | 153 #ifdef CAN_COMPILE_X86_ASM |
12516 | 154 // ordered by speed / fastest first |
3142 | 155 if(gCpuCaps.hasMMX2) |
156 vo_draw_alpha_yuy2_MMX2(w, h, src, srca, srcstride, dstbase, dststride); | |
157 else if(gCpuCaps.has3DNow) | |
158 vo_draw_alpha_yuy2_3DNow(w, h, src, srca, srcstride, dstbase, dststride); | |
159 else if(gCpuCaps.hasMMX) | |
160 vo_draw_alpha_yuy2_MMX(w, h, src, srca, srcstride, dstbase, dststride); | |
161 else | |
162 vo_draw_alpha_yuy2_X86(w, h, src, srca, srcstride, dstbase, dststride); | |
163 #else | |
164 vo_draw_alpha_yuy2_C(w, h, src, srca, srcstride, dstbase, dststride); | |
165 #endif | |
3153 | 166 #else //RUNTIME_CPUDETECT |
28290 | 167 #if HAVE_MMX2 |
3153 | 168 vo_draw_alpha_yuy2_MMX2(w, h, src, srca, srcstride, dstbase, dststride); |
28335 | 169 #elif HAVE_AMD3DNOW |
3153 | 170 vo_draw_alpha_yuy2_3DNow(w, h, src, srca, srcstride, dstbase, dststride); |
28290 | 171 #elif HAVE_MMX |
3153 | 172 vo_draw_alpha_yuy2_MMX(w, h, src, srca, srcstride, dstbase, dststride); |
28290 | 173 #elif ARCH_X86 |
3153 | 174 vo_draw_alpha_yuy2_X86(w, h, src, srca, srcstride, dstbase, dststride); |
175 #else | |
176 vo_draw_alpha_yuy2_C(w, h, src, srca, srcstride, dstbase, dststride); | |
177 #endif | |
178 #endif //!RUNTIME_CPUDETECT | |
3142 | 179 } |
180 | |
12516 | 181 void vo_draw_alpha_uyvy(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ |
182 #ifdef RUNTIME_CPUDETECT | |
183 #ifdef CAN_COMPILE_X86_ASM | |
184 // ordered by speed / fastest first | |
185 if(gCpuCaps.hasMMX2) | |
186 vo_draw_alpha_uyvy_MMX2(w, h, src, srca, srcstride, dstbase, dststride); | |
187 else if(gCpuCaps.has3DNow) | |
188 vo_draw_alpha_uyvy_3DNow(w, h, src, srca, srcstride, dstbase, dststride); | |
189 else if(gCpuCaps.hasMMX) | |
190 vo_draw_alpha_uyvy_MMX(w, h, src, srca, srcstride, dstbase, dststride); | |
191 else | |
192 vo_draw_alpha_uyvy_X86(w, h, src, srca, srcstride, dstbase, dststride); | |
193 #else | |
194 vo_draw_alpha_uyvy_C(w, h, src, srca, srcstride, dstbase, dststride); | |
195 #endif | |
196 #else //RUNTIME_CPUDETECT | |
28290 | 197 #if HAVE_MMX2 |
12516 | 198 vo_draw_alpha_uyvy_MMX2(w, h, src, srca, srcstride, dstbase, dststride); |
28335 | 199 #elif HAVE_AMD3DNOW |
12516 | 200 vo_draw_alpha_uyvy_3DNow(w, h, src, srca, srcstride, dstbase, dststride); |
28290 | 201 #elif HAVE_MMX |
12516 | 202 vo_draw_alpha_uyvy_MMX(w, h, src, srca, srcstride, dstbase, dststride); |
28290 | 203 #elif ARCH_X86 |
12516 | 204 vo_draw_alpha_uyvy_X86(w, h, src, srca, srcstride, dstbase, dststride); |
205 #else | |
206 vo_draw_alpha_uyvy_C(w, h, src, srca, srcstride, dstbase, dststride); | |
207 #endif | |
208 #endif //!RUNTIME_CPUDETECT | |
209 } | |
210 | |
326 | 211 void vo_draw_alpha_rgb24(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ |
3153 | 212 #ifdef RUNTIME_CPUDETECT |
3142 | 213 #ifdef CAN_COMPILE_X86_ASM |
12516 | 214 // ordered by speed / fastest first |
3142 | 215 if(gCpuCaps.hasMMX2) |
216 vo_draw_alpha_rgb24_MMX2(w, h, src, srca, srcstride, dstbase, dststride); | |
217 else if(gCpuCaps.has3DNow) | |
218 vo_draw_alpha_rgb24_3DNow(w, h, src, srca, srcstride, dstbase, dststride); | |
219 else if(gCpuCaps.hasMMX) | |
220 vo_draw_alpha_rgb24_MMX(w, h, src, srca, srcstride, dstbase, dststride); | |
221 else | |
222 vo_draw_alpha_rgb24_X86(w, h, src, srca, srcstride, dstbase, dststride); | |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
223 #else |
3142 | 224 vo_draw_alpha_rgb24_C(w, h, src, srca, srcstride, dstbase, dststride); |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
225 #endif |
3153 | 226 #else //RUNTIME_CPUDETECT |
28290 | 227 #if HAVE_MMX2 |
3153 | 228 vo_draw_alpha_rgb24_MMX2(w, h, src, srca, srcstride, dstbase, dststride); |
28335 | 229 #elif HAVE_AMD3DNOW |
3153 | 230 vo_draw_alpha_rgb24_3DNow(w, h, src, srca, srcstride, dstbase, dststride); |
28290 | 231 #elif HAVE_MMX |
3153 | 232 vo_draw_alpha_rgb24_MMX(w, h, src, srca, srcstride, dstbase, dststride); |
28290 | 233 #elif ARCH_X86 |
3153 | 234 vo_draw_alpha_rgb24_X86(w, h, src, srca, srcstride, dstbase, dststride); |
235 #else | |
236 vo_draw_alpha_rgb24_C(w, h, src, srca, srcstride, dstbase, dststride); | |
237 #endif | |
238 #endif //!RUNTIME_CPUDETECT | |
326 | 239 } |
240 | |
241 void vo_draw_alpha_rgb32(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ | |
3153 | 242 #ifdef RUNTIME_CPUDETECT |
3142 | 243 #ifdef CAN_COMPILE_X86_ASM |
12516 | 244 // ordered by speed / fastest first |
3142 | 245 if(gCpuCaps.hasMMX2) |
246 vo_draw_alpha_rgb32_MMX2(w, h, src, srca, srcstride, dstbase, dststride); | |
247 else if(gCpuCaps.has3DNow) | |
248 vo_draw_alpha_rgb32_3DNow(w, h, src, srca, srcstride, dstbase, dststride); | |
249 else if(gCpuCaps.hasMMX) | |
250 vo_draw_alpha_rgb32_MMX(w, h, src, srca, srcstride, dstbase, dststride); | |
251 else | |
252 vo_draw_alpha_rgb32_X86(w, h, src, srca, srcstride, dstbase, dststride); | |
253 #else | |
254 vo_draw_alpha_rgb32_C(w, h, src, srca, srcstride, dstbase, dststride); | |
2846 | 255 #endif |
3153 | 256 #else //RUNTIME_CPUDETECT |
28290 | 257 #if HAVE_MMX2 |
3153 | 258 vo_draw_alpha_rgb32_MMX2(w, h, src, srca, srcstride, dstbase, dststride); |
28335 | 259 #elif HAVE_AMD3DNOW |
3153 | 260 vo_draw_alpha_rgb32_3DNow(w, h, src, srca, srcstride, dstbase, dststride); |
28290 | 261 #elif HAVE_MMX |
3153 | 262 vo_draw_alpha_rgb32_MMX(w, h, src, srca, srcstride, dstbase, dststride); |
28290 | 263 #elif ARCH_X86 |
3153 | 264 vo_draw_alpha_rgb32_X86(w, h, src, srca, srcstride, dstbase, dststride); |
265 #else | |
266 vo_draw_alpha_rgb32_C(w, h, src, srca, srcstride, dstbase, dststride); | |
267 #endif | |
268 #endif //!RUNTIME_CPUDETECT | |
326 | 269 } |
270 | |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
271 #ifdef FAST_OSD_TABLE |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
272 static unsigned short fast_osd_15bpp_table[256]; |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
273 static unsigned short fast_osd_16bpp_table[256]; |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
274 #endif |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
275 |
17566
f580a7755ac5
Patch by Stefan Huehner / stefan % huehner ! org \
rathann
parents:
13787
diff
changeset
|
276 void vo_draw_alpha_init(void){ |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
277 #ifdef FAST_OSD_TABLE |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
278 int i; |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
279 for(i=0;i<256;i++){ |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
280 fast_osd_15bpp_table[i]=((i>>3)<<10)|((i>>3)<<5)|(i>>3); |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
281 fast_osd_16bpp_table[i]=((i>>3)<<11)|((i>>2)<<5)|(i>>3); |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
282 } |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
283 #endif |
11000 | 284 //FIXME the optimized stuff is a lie for 15/16bpp as they aren't optimized yet |
17969
843e0427b5b9
Change 'if(verbose)' to the more appropriate mp_msg_test.
diego
parents:
17566
diff
changeset
|
285 if( mp_msg_test(MSGT_OSD,MSGL_V) ) |
3142 | 286 { |
3153 | 287 #ifdef RUNTIME_CPUDETECT |
3142 | 288 #ifdef CAN_COMPILE_X86_ASM |
289 // ordered per speed fasterst first | |
290 if(gCpuCaps.hasMMX2) | |
5935 | 291 mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay\n"); |
3142 | 292 else if(gCpuCaps.has3DNow) |
5935 | 293 mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX (with tiny bit 3DNow) Optimized OnScreenDisplay\n"); |
3142 | 294 else if(gCpuCaps.hasMMX) |
5935 | 295 mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX Optimized OnScreenDisplay\n"); |
3142 | 296 else |
5935 | 297 mp_msg(MSGT_OSD,MSGL_INFO,"Using X86 Optimized OnScreenDisplay\n"); |
3142 | 298 #else |
5935 | 299 mp_msg(MSGT_OSD,MSGL_INFO,"Using Unoptimized OnScreenDisplay\n"); |
3142 | 300 #endif |
3153 | 301 #else //RUNTIME_CPUDETECT |
28290 | 302 #if HAVE_MMX2 |
5935 | 303 mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay\n"); |
28335 | 304 #elif HAVE_AMD3DNOW |
5935 | 305 mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX (with tiny bit 3DNow) Optimized OnScreenDisplay\n"); |
28290 | 306 #elif HAVE_MMX |
5935 | 307 mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX Optimized OnScreenDisplay\n"); |
28290 | 308 #elif ARCH_X86 |
5935 | 309 mp_msg(MSGT_OSD,MSGL_INFO,"Using X86 Optimized OnScreenDisplay\n"); |
3153 | 310 #else |
5935 | 311 mp_msg(MSGT_OSD,MSGL_INFO,"Using Unoptimized OnScreenDisplay\n"); |
3153 | 312 #endif |
313 #endif //!RUNTIME_CPUDETECT | |
3142 | 314 } |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
315 } |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
316 |
326 | 317 void vo_draw_alpha_rgb15(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ |
318 int y; | |
319 for(y=0;y<h;y++){ | |
320 register unsigned short *dst = (unsigned short*) dstbase; | |
321 register int x; | |
322 for(x=0;x<w;x++){ | |
323 if(srca[x]){ | |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
324 #ifdef FAST_OSD |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
325 #ifdef FAST_OSD_TABLE |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
326 dst[x]=fast_osd_15bpp_table[src[x]]; |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
327 #else |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
328 register unsigned int a=src[x]>>3; |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
329 dst[x]=(a<<10)|(a<<5)|a; |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
330 #endif |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
331 #else |
326 | 332 unsigned char r=dst[x]&0x1F; |
333 unsigned char g=(dst[x]>>5)&0x1F; | |
334 unsigned char b=(dst[x]>>10)&0x1F; | |
335 r=(((r*srca[x])>>5)+src[x])>>3; | |
336 g=(((g*srca[x])>>5)+src[x])>>3; | |
337 b=(((b*srca[x])>>5)+src[x])>>3; | |
338 dst[x]=(b<<10)|(g<<5)|r; | |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
339 #endif |
326 | 340 } |
341 } | |
342 src+=srcstride; | |
343 srca+=srcstride; | |
344 dstbase+=dststride; | |
345 } | |
346 return; | |
347 } | |
348 | |
349 void vo_draw_alpha_rgb16(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ | |
350 int y; | |
351 for(y=0;y<h;y++){ | |
352 register unsigned short *dst = (unsigned short*) dstbase; | |
353 register int x; | |
354 for(x=0;x<w;x++){ | |
355 if(srca[x]){ | |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
356 #ifdef FAST_OSD |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
357 #ifdef FAST_OSD_TABLE |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
358 dst[x]=fast_osd_16bpp_table[src[x]]; |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
359 #else |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
360 dst[x]=((src[x]>>3)<<11)|((src[x]>>2)<<5)|(src[x]>>3); |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
361 #endif |
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
362 #else |
326 | 363 unsigned char r=dst[x]&0x1F; |
364 unsigned char g=(dst[x]>>5)&0x3F; | |
365 unsigned char b=(dst[x]>>11)&0x1F; | |
366 r=(((r*srca[x])>>5)+src[x])>>3; | |
367 g=(((g*srca[x])>>6)+src[x])>>2; | |
368 b=(((b*srca[x])>>5)+src[x])>>3; | |
369 dst[x]=(b<<11)|(g<<5)|r; | |
947
76fd9463b9d3
FAST_OSD option to disable font outline antialiasing
arpi_esp
parents:
622
diff
changeset
|
370 #endif |
326 | 371 } |
372 } | |
373 src+=srcstride; | |
374 srca+=srcstride; | |
375 dstbase+=dststride; | |
376 } | |
377 return; | |
378 } | |
379 |