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