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