annotate libvo/osd.c @ 28830:79d82aac91a3

Make several constant mp3lib tables const
author reimar
date Sat, 07 Mar 2009 09:08:02 +0000
parents 7681eab10aea
children 62f0032e736a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
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
6737025afed0 to be sure in that header is okey
arpi_esp
parents: 326
diff changeset
27 #include "osd.h"
5935
5074aa8fae5a printf to mp_msg
albeu
parents: 4245
diff changeset
28 #include "mp_msg.h"
2846
ab51228bf3cf p2/p3 bgr32 version (20%faster)
michael
parents: 2843
diff changeset
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
ab51228bf3cf p2/p3 bgr32 version (20%faster)
michael
parents: 2843
diff changeset
31
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
32 #if ARCH_X86
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
33 #define CAN_COMPILE_X86_ASM
2846
ab51228bf3cf p2/p3 bgr32 version (20%faster)
michael
parents: 2843
diff changeset
34 #endif
622
6737025afed0 to be sure in that header is okey
arpi_esp
parents: 326
diff changeset
35
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
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
03ccbb72e2e9 Cloning 32 stuff to 24
nick
parents: 2835
diff changeset
38 static const unsigned long long mask24lh __attribute__((aligned(8))) = 0xFFFF000000000000ULL;
03ccbb72e2e9 Cloning 32 stuff to 24
nick
parents: 2835
diff changeset
39 static const unsigned long long mask24hl __attribute__((aligned(8))) = 0x0000FFFFFFFFFFFFULL;
03ccbb72e2e9 Cloning 32 stuff to 24
nick
parents: 2835
diff changeset
40 #endif
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
41
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
42 //Note: we have C, X86-nommx, MMX, MMX2, 3DNOW version therse no 3DNOW+MMX2 one
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
43 //Plain C versions
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
44 #if !HAVE_MMX || defined (RUNTIME_CPUDETECT)
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
45 #define COMPILE_C
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
46 #endif
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
47
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
48 #ifdef CAN_COMPILE_X86_ASM
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
49
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28290
diff changeset
50 #if (HAVE_MMX && !HAVE_AMD3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
51 #define COMPILE_MMX
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
52 #endif
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
53
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
54 #if HAVE_MMX2 || defined (RUNTIME_CPUDETECT)
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
55 #define COMPILE_MMX2
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
56 #endif
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
57
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28290
diff changeset
58 #if (HAVE_AMD3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
59 #define COMPILE_3DNOW
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
60 #endif
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
61 #endif //CAN_COMPILE_X86_ASM
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
62
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
63 #undef HAVE_MMX
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
64 #undef HAVE_MMX2
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28290
diff changeset
65 #undef HAVE_AMD3DNOW
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
66 #define HAVE_MMX 0
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
67 #define HAVE_MMX2 0
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28290
diff changeset
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
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
71
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
72 #ifdef COMPILE_C
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
73 #undef HAVE_MMX
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
74 #undef HAVE_MMX2
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28290
diff changeset
75 #undef HAVE_AMD3DNOW
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
76 #define HAVE_MMX 0
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
77 #define HAVE_MMX2 0
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28290
diff changeset
78 #define HAVE_AMD3DNOW 0
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
79 #define RENAME(a) a ## _C
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
80 #include "osd_template.c"
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
81 #endif
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
82
13720
821f464b4d90 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents: 12516
diff changeset
83 #else
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
84
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
85 //X86 noMMX versions
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
86 #ifdef COMPILE_C
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
87 #undef RENAME
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
88 #undef HAVE_MMX
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
89 #undef HAVE_MMX2
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28290
diff changeset
90 #undef HAVE_AMD3DNOW
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
91 #define HAVE_MMX 0
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
92 #define HAVE_MMX2 0
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28290
diff changeset
93 #define HAVE_AMD3DNOW 0
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
94 #define RENAME(a) a ## _X86
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
95 #include "osd_template.c"
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
96 #endif
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
97
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
98 //MMX versions
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
99 #ifdef COMPILE_MMX
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
100 #undef RENAME
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
101 #undef HAVE_MMX
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
102 #undef HAVE_MMX2
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28290
diff changeset
103 #undef HAVE_AMD3DNOW
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
104 #define HAVE_MMX 1
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
105 #define HAVE_MMX2 0
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28290
diff changeset
106 #define HAVE_AMD3DNOW 0
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
107 #define RENAME(a) a ## _MMX
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
108 #include "osd_template.c"
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
109 #endif
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
110
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
111 //MMX2 versions
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
112 #ifdef COMPILE_MMX2
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
113 #undef RENAME
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
114 #undef HAVE_MMX
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
115 #undef HAVE_MMX2
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28290
diff changeset
116 #undef HAVE_AMD3DNOW
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
117 #define HAVE_MMX 1
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
118 #define HAVE_MMX2 1
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28290
diff changeset
119 #define HAVE_AMD3DNOW 0
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
120 #define RENAME(a) a ## _MMX2
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
121 #include "osd_template.c"
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
122 #endif
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
123
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
124 //3DNOW versions
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
125 #ifdef COMPILE_3DNOW
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
126 #undef RENAME
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
127 #undef HAVE_MMX
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
128 #undef HAVE_MMX2
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28290
diff changeset
129 #undef HAVE_AMD3DNOW
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
130 #define HAVE_MMX 1
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
131 #define HAVE_MMX2 0
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28290
diff changeset
132 #define HAVE_AMD3DNOW 1
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
133 #define RENAME(a) a ## _3DNow
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
134 #include "osd_template.c"
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
135 #endif
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
136
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
137 #endif //CAN_COMPILE_X86_ASM
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
138
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
139 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
140 #ifdef RUNTIME_CPUDETECT
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
141 #ifdef CAN_COMPILE_X86_ASM
12516
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
142 // ordered by speed / fastest first
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
143 if(gCpuCaps.hasMMX2)
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
144 vo_draw_alpha_yv12_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
145 else if(gCpuCaps.has3DNow)
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
146 vo_draw_alpha_yv12_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
147 else if(gCpuCaps.hasMMX)
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
148 vo_draw_alpha_yv12_MMX(w, h, src, srca, srcstride, dstbase, dststride);
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
149 else
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
150 vo_draw_alpha_yv12_X86(w, h, src, srca, srcstride, dstbase, dststride);
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
151 #else
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
152 vo_draw_alpha_yv12_C(w, h, src, srca, srcstride, dstbase, dststride);
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
153 #endif
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
154 #else //RUNTIME_CPUDETECT
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
155 #if HAVE_MMX2
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
156 vo_draw_alpha_yv12_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28290
diff changeset
157 #elif HAVE_AMD3DNOW
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
158 vo_draw_alpha_yv12_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
159 #elif HAVE_MMX
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
160 vo_draw_alpha_yv12_MMX(w, h, src, srca, srcstride, dstbase, dststride);
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
161 #elif ARCH_X86
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
162 vo_draw_alpha_yv12_X86(w, h, src, srca, srcstride, dstbase, dststride);
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
163 #else
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
164 vo_draw_alpha_yv12_C(w, h, src, srca, srcstride, dstbase, dststride);
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
165 #endif
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
166 #endif //!RUNTIME_CPUDETECT
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
167 }
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
168
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
169 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
170 #ifdef RUNTIME_CPUDETECT
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
171 #ifdef CAN_COMPILE_X86_ASM
12516
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
172 // ordered by speed / fastest first
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
173 if(gCpuCaps.hasMMX2)
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
174 vo_draw_alpha_yuy2_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
175 else if(gCpuCaps.has3DNow)
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
176 vo_draw_alpha_yuy2_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
177 else if(gCpuCaps.hasMMX)
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
178 vo_draw_alpha_yuy2_MMX(w, h, src, srca, srcstride, dstbase, dststride);
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
179 else
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
180 vo_draw_alpha_yuy2_X86(w, h, src, srca, srcstride, dstbase, dststride);
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
181 #else
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
182 vo_draw_alpha_yuy2_C(w, h, src, srca, srcstride, dstbase, dststride);
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
183 #endif
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
184 #else //RUNTIME_CPUDETECT
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
185 #if HAVE_MMX2
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
186 vo_draw_alpha_yuy2_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28290
diff changeset
187 #elif HAVE_AMD3DNOW
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
188 vo_draw_alpha_yuy2_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
189 #elif HAVE_MMX
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
190 vo_draw_alpha_yuy2_MMX(w, h, src, srca, srcstride, dstbase, dststride);
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
191 #elif ARCH_X86
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
192 vo_draw_alpha_yuy2_X86(w, h, src, srca, srcstride, dstbase, dststride);
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
193 #else
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
194 vo_draw_alpha_yuy2_C(w, h, src, srca, srcstride, dstbase, dststride);
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
195 #endif
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
196 #endif //!RUNTIME_CPUDETECT
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
197 }
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
198
12516
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
199 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
200 #ifdef RUNTIME_CPUDETECT
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
201 #ifdef CAN_COMPILE_X86_ASM
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
202 // ordered by speed / fastest first
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
203 if(gCpuCaps.hasMMX2)
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
204 vo_draw_alpha_uyvy_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
205 else if(gCpuCaps.has3DNow)
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
206 vo_draw_alpha_uyvy_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
207 else if(gCpuCaps.hasMMX)
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
208 vo_draw_alpha_uyvy_MMX(w, h, src, srca, srcstride, dstbase, dststride);
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
209 else
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
210 vo_draw_alpha_uyvy_X86(w, h, src, srca, srcstride, dstbase, dststride);
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
211 #else
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
212 vo_draw_alpha_uyvy_C(w, h, src, srca, srcstride, dstbase, dststride);
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
213 #endif
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
214 #else //RUNTIME_CPUDETECT
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
215 #if HAVE_MMX2
12516
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
216 vo_draw_alpha_uyvy_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28290
diff changeset
217 #elif HAVE_AMD3DNOW
12516
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
218 vo_draw_alpha_uyvy_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
219 #elif HAVE_MMX
12516
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
220 vo_draw_alpha_uyvy_MMX(w, h, src, srca, srcstride, dstbase, dststride);
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
221 #elif ARCH_X86
12516
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
222 vo_draw_alpha_uyvy_X86(w, h, src, srca, srcstride, dstbase, dststride);
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
223 #else
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
224 vo_draw_alpha_uyvy_C(w, h, src, srca, srcstride, dstbase, dststride);
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
225 #endif
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
226 #endif //!RUNTIME_CPUDETECT
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
227 }
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
228
326
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
229 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
230 #ifdef RUNTIME_CPUDETECT
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
231 #ifdef CAN_COMPILE_X86_ASM
12516
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
232 // ordered by speed / fastest first
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
233 if(gCpuCaps.hasMMX2)
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
234 vo_draw_alpha_rgb24_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
235 else if(gCpuCaps.has3DNow)
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
236 vo_draw_alpha_rgb24_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
237 else if(gCpuCaps.hasMMX)
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
238 vo_draw_alpha_rgb24_MMX(w, h, src, srca, srcstride, dstbase, dststride);
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
239 else
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
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
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
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
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
244 #else //RUNTIME_CPUDETECT
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
245 #if HAVE_MMX2
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
246 vo_draw_alpha_rgb24_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28290
diff changeset
247 #elif HAVE_AMD3DNOW
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
248 vo_draw_alpha_rgb24_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
249 #elif HAVE_MMX
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
250 vo_draw_alpha_rgb24_MMX(w, h, src, srca, srcstride, dstbase, dststride);
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
251 #elif ARCH_X86
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
252 vo_draw_alpha_rgb24_X86(w, h, src, srca, srcstride, dstbase, dststride);
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
253 #else
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
254 vo_draw_alpha_rgb24_C(w, h, src, srca, srcstride, dstbase, dststride);
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
255 #endif
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
256 #endif //!RUNTIME_CPUDETECT
326
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
257 }
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
258
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
259 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
260 #ifdef RUNTIME_CPUDETECT
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
261 #ifdef CAN_COMPILE_X86_ASM
12516
6f7b5123ac56 draw alpha for uyvy
nplourde
parents: 12292
diff changeset
262 // ordered by speed / fastest first
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
263 if(gCpuCaps.hasMMX2)
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
264 vo_draw_alpha_rgb32_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
265 else if(gCpuCaps.has3DNow)
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
266 vo_draw_alpha_rgb32_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
267 else if(gCpuCaps.hasMMX)
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
268 vo_draw_alpha_rgb32_MMX(w, h, src, srca, srcstride, dstbase, dststride);
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
269 else
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
270 vo_draw_alpha_rgb32_X86(w, h, src, srca, srcstride, dstbase, dststride);
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
271 #else
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
272 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
273 #endif
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
274 #else //RUNTIME_CPUDETECT
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
275 #if HAVE_MMX2
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
276 vo_draw_alpha_rgb32_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28290
diff changeset
277 #elif HAVE_AMD3DNOW
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
278 vo_draw_alpha_rgb32_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
279 #elif HAVE_MMX
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
280 vo_draw_alpha_rgb32_MMX(w, h, src, srca, srcstride, dstbase, dststride);
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
281 #elif ARCH_X86
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
282 vo_draw_alpha_rgb32_X86(w, h, src, srca, srcstride, dstbase, dststride);
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
283 #else
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
284 vo_draw_alpha_rgb32_C(w, h, src, srca, srcstride, dstbase, dststride);
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
285 #endif
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
286 #endif //!RUNTIME_CPUDETECT
326
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
287 }
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
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
6e35326c742f many small typo and grammar fixes
gabucino
parents: 10516
diff changeset
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
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
304 {
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
305 #ifdef RUNTIME_CPUDETECT
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
306 #ifdef CAN_COMPILE_X86_ASM
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
307 // ordered per speed fasterst first
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
308 if(gCpuCaps.hasMMX2)
5935
5074aa8fae5a printf to mp_msg
albeu
parents: 4245
diff changeset
309 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
310 else if(gCpuCaps.has3DNow)
5935
5074aa8fae5a printf to mp_msg
albeu
parents: 4245
diff changeset
311 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
312 else if(gCpuCaps.hasMMX)
5935
5074aa8fae5a printf to mp_msg
albeu
parents: 4245
diff changeset
313 mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX Optimized OnScreenDisplay\n");
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
314 else
5935
5074aa8fae5a printf to mp_msg
albeu
parents: 4245
diff changeset
315 mp_msg(MSGT_OSD,MSGL_INFO,"Using X86 Optimized OnScreenDisplay\n");
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
316 #else
5935
5074aa8fae5a printf to mp_msg
albeu
parents: 4245
diff changeset
317 mp_msg(MSGT_OSD,MSGL_INFO,"Using Unoptimized OnScreenDisplay\n");
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
318 #endif
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
319 #else //RUNTIME_CPUDETECT
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
320 #if HAVE_MMX2
5935
5074aa8fae5a printf to mp_msg
albeu
parents: 4245
diff changeset
321 mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay\n");
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28290
diff changeset
322 #elif HAVE_AMD3DNOW
5935
5074aa8fae5a printf to mp_msg
albeu
parents: 4245
diff changeset
323 mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX (with tiny bit 3DNow) Optimized OnScreenDisplay\n");
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
324 #elif HAVE_MMX
5935
5074aa8fae5a printf to mp_msg
albeu
parents: 4245
diff changeset
325 mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX Optimized OnScreenDisplay\n");
28290
25337a2147e7 Lots and lots of #ifdef ARCH_... -> #if ARCH_...
reimar
parents: 26950
diff changeset
326 #elif ARCH_X86
5935
5074aa8fae5a printf to mp_msg
albeu
parents: 4245
diff changeset
327 mp_msg(MSGT_OSD,MSGL_INFO,"Using X86 Optimized OnScreenDisplay\n");
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
328 #else
5935
5074aa8fae5a printf to mp_msg
albeu
parents: 4245
diff changeset
329 mp_msg(MSGT_OSD,MSGL_INFO,"Using Unoptimized OnScreenDisplay\n");
3153
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
330 #endif
5b8db331d0c1 optional runtime cpu detect
michael
parents: 3142
diff changeset
331 #endif //!RUNTIME_CPUDETECT
3142
0f6cce3a8059 runtime cpu detection
michael
parents: 2850
diff changeset
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
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
335 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
336 int y;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
337 for(y=0;y<h;y++){
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
338 register unsigned short *dst = (unsigned short*) dstbase;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
339 register int x;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
340 for(x=0;x<w;x++){
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
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
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
350 unsigned char r=dst[x]&0x1F;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
351 unsigned char g=(dst[x]>>5)&0x1F;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
352 unsigned char b=(dst[x]>>10)&0x1F;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
353 r=(((r*srca[x])>>5)+src[x])>>3;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
354 g=(((g*srca[x])>>5)+src[x])>>3;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
355 b=(((b*srca[x])>>5)+src[x])>>3;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
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
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 }
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
360 src+=srcstride;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
361 srca+=srcstride;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
362 dstbase+=dststride;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
363 }
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
364 return;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
365 }
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
366
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
367 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
368 int y;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
369 for(y=0;y<h;y++){
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
370 register unsigned short *dst = (unsigned short*) dstbase;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
371 register int x;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
372 for(x=0;x<w;x++){
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
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
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
381 unsigned char r=dst[x]&0x1F;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
382 unsigned char g=(dst[x]>>5)&0x3F;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
383 unsigned char b=(dst[x]>>11)&0x1F;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
384 r=(((r*srca[x])>>5)+src[x])>>3;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
385 g=(((g*srca[x])>>6)+src[x])>>2;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
386 b=(((b*srca[x])>>5)+src[x])>>3;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
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
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
389 }
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
390 }
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
391 src+=srcstride;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
392 srca+=srcstride;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
393 dstbase+=dststride;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
394 }
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
395 return;
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
396 }
f6b5c2dbc88e OSD alpha renderers moved to osd.c
arpi_esp
parents:
diff changeset
397