annotate libvo/osd.c @ 26950:7e09ce31f426

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