annotate sub/osd.c @ 32807:2564a237c211

At least for Wing Commander 4 files, -demuxer lavf is needed to playback XAN DPCM audio (while Wing Commander 3 avi plays fine with -demuxer avi although it also contains the video codec we call "XAN wc4").
author cehoyos
date Sat, 12 Feb 2011 11:39:43 +0000
parents 3fef2e17a03f
children a0ff4fde7a48
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
32469
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
1 /*
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
2 * generic alpha renderers for all YUV modes and RGB depths
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
3 * These are "reference implementations", should be optimized later (MMX, etc).
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
4 * templating code by Michael Niedermayer (michaelni@gmx.at)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
5 *
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
6 * This file is part of MPlayer.
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
7 *
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
8 * MPlayer is free software; you can redistribute it and/or modify
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
11 * (at your option) any later version.
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
12 *
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
13 * MPlayer is distributed in the hope that it will be useful,
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
16 * GNU General Public License for more details.
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
17 *
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License along
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
19 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
21 */
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
22
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
23 //#define FAST_OSD
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
24 //#define FAST_OSD_TABLE
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
25
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
26 #include "config.h"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
27 #include "osd.h"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
28 #include "mp_msg.h"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
29 #include <inttypes.h>
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
30 #include "cpudetect.h"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
31
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
32 #if ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
33 static const uint64_t bFF __attribute__((aligned(8))) = 0xFFFFFFFFFFFFFFFFULL;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
34 static const unsigned long long mask24lh __attribute__((aligned(8))) = 0xFFFF000000000000ULL;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
35 static const unsigned long long mask24hl __attribute__((aligned(8))) = 0x0000FFFFFFFFFFFFULL;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
36 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
37
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
38 //Note: we have C, X86-nommx, MMX, MMX2, 3DNOW version therse no 3DNOW+MMX2 one
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
39 //Plain C versions
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
40 #if !HAVE_MMX || CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
41 #define COMPILE_C
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
42 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
43
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
44 #if ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
45
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
46 #if (HAVE_MMX && !HAVE_AMD3DNOW && !HAVE_MMX2) || CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
47 #define COMPILE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
48 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
49
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
50 #if HAVE_MMX2 || CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
51 #define COMPILE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
52 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
53
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
54 #if (HAVE_AMD3DNOW && !HAVE_MMX2) || CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
55 #define COMPILE_3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
56 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
57
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
58 #endif /* ARCH_X86 */
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
59
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
60 #undef HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
61 #undef HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
62 #undef HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
63 #define HAVE_MMX 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
64 #define HAVE_MMX2 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
65 #define HAVE_AMD3DNOW 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
66
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
67 #if ! ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
68
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
69 #ifdef COMPILE_C
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
70 #undef HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
71 #undef HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
72 #undef HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
73 #define HAVE_MMX 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
74 #define HAVE_MMX2 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
75 #define HAVE_AMD3DNOW 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
76 #define RENAME(a) a ## _C
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
77 #include "osd_template.c"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
78 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
79
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
80 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
81
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
82 //X86 noMMX versions
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
83 #ifdef COMPILE_C
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
84 #undef RENAME
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
85 #undef HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
86 #undef HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
87 #undef HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
88 #define HAVE_MMX 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
89 #define HAVE_MMX2 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
90 #define HAVE_AMD3DNOW 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
91 #define RENAME(a) a ## _X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
92 #include "osd_template.c"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
93 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
94
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
95 //MMX versions
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
96 #ifdef COMPILE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
97 #undef RENAME
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
98 #undef HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
99 #undef HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
100 #undef HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
101 #define HAVE_MMX 1
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
102 #define HAVE_MMX2 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
103 #define HAVE_AMD3DNOW 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
104 #define RENAME(a) a ## _MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
105 #include "osd_template.c"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
106 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
107
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
108 //MMX2 versions
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
109 #ifdef COMPILE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
110 #undef RENAME
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
111 #undef HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
112 #undef HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
113 #undef HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
114 #define HAVE_MMX 1
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
115 #define HAVE_MMX2 1
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
116 #define HAVE_AMD3DNOW 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
117 #define RENAME(a) a ## _MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
118 #include "osd_template.c"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
119 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
120
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
121 //3DNOW versions
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
122 #ifdef COMPILE_3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
123 #undef RENAME
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
124 #undef HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
125 #undef HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
126 #undef HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
127 #define HAVE_MMX 1
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
128 #define HAVE_MMX2 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
129 #define HAVE_AMD3DNOW 1
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
130 #define RENAME(a) a ## _3DNow
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
131 #include "osd_template.c"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
132 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
133
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
134 #endif /* ARCH_X86 */
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
135
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
136 void vo_draw_alpha_yv12(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
137 #if CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
138 #if ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
139 // ordered by speed / fastest first
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
140 if(gCpuCaps.hasMMX2)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
141 vo_draw_alpha_yv12_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
142 else if(gCpuCaps.has3DNow)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
143 vo_draw_alpha_yv12_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
144 else if(gCpuCaps.hasMMX)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
145 vo_draw_alpha_yv12_MMX(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
146 else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
147 vo_draw_alpha_yv12_X86(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
148 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
149 vo_draw_alpha_yv12_C(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
150 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
151 #else //CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
152 #if HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
153 vo_draw_alpha_yv12_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
154 #elif HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
155 vo_draw_alpha_yv12_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
156 #elif HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
157 vo_draw_alpha_yv12_MMX(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
158 #elif ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
159 vo_draw_alpha_yv12_X86(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
160 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
161 vo_draw_alpha_yv12_C(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
162 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
163 #endif //!CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
164 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
165
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
166 void vo_draw_alpha_yuy2(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
167 #if CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
168 #if ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
169 // ordered by speed / fastest first
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
170 if(gCpuCaps.hasMMX2)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
171 vo_draw_alpha_yuy2_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
172 else if(gCpuCaps.has3DNow)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
173 vo_draw_alpha_yuy2_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
174 else if(gCpuCaps.hasMMX)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
175 vo_draw_alpha_yuy2_MMX(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
176 else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
177 vo_draw_alpha_yuy2_X86(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
178 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
179 vo_draw_alpha_yuy2_C(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
180 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
181 #else //CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
182 #if HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
183 vo_draw_alpha_yuy2_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
184 #elif HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
185 vo_draw_alpha_yuy2_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
186 #elif HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
187 vo_draw_alpha_yuy2_MMX(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
188 #elif ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
189 vo_draw_alpha_yuy2_X86(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
190 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
191 vo_draw_alpha_yuy2_C(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
192 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
193 #endif //!CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
194 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
195
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
196 void vo_draw_alpha_uyvy(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
197 #if CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
198 #if ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
199 // ordered by speed / fastest first
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
200 if(gCpuCaps.hasMMX2)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
201 vo_draw_alpha_uyvy_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
202 else if(gCpuCaps.has3DNow)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
203 vo_draw_alpha_uyvy_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
204 else if(gCpuCaps.hasMMX)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
205 vo_draw_alpha_uyvy_MMX(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
206 else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
207 vo_draw_alpha_uyvy_X86(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
208 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
209 vo_draw_alpha_uyvy_C(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
210 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
211 #else //CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
212 #if HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
213 vo_draw_alpha_uyvy_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
214 #elif HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
215 vo_draw_alpha_uyvy_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
216 #elif HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
217 vo_draw_alpha_uyvy_MMX(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
218 #elif ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
219 vo_draw_alpha_uyvy_X86(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
220 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
221 vo_draw_alpha_uyvy_C(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
222 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
223 #endif //!CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
224 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
225
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
226 void vo_draw_alpha_rgb24(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
227 #if CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
228 #if ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
229 // ordered by speed / fastest first
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
230 if(gCpuCaps.hasMMX2)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
231 vo_draw_alpha_rgb24_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
232 else if(gCpuCaps.has3DNow)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
233 vo_draw_alpha_rgb24_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
234 else if(gCpuCaps.hasMMX)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
235 vo_draw_alpha_rgb24_MMX(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
236 else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
237 vo_draw_alpha_rgb24_X86(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
238 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
239 vo_draw_alpha_rgb24_C(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
240 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
241 #else //CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
242 #if HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
243 vo_draw_alpha_rgb24_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
244 #elif HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
245 vo_draw_alpha_rgb24_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
246 #elif HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
247 vo_draw_alpha_rgb24_MMX(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
248 #elif ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
249 vo_draw_alpha_rgb24_X86(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
250 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
251 vo_draw_alpha_rgb24_C(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
252 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
253 #endif //!CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
254 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
255
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
256 void vo_draw_alpha_rgb32(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
257 #if CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
258 #if ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
259 // ordered by speed / fastest first
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
260 if(gCpuCaps.hasMMX2)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
261 vo_draw_alpha_rgb32_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
262 else if(gCpuCaps.has3DNow)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
263 vo_draw_alpha_rgb32_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
264 else if(gCpuCaps.hasMMX)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
265 vo_draw_alpha_rgb32_MMX(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
266 else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
267 vo_draw_alpha_rgb32_X86(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
268 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
269 vo_draw_alpha_rgb32_C(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
270 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
271 #else //CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
272 #if HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
273 vo_draw_alpha_rgb32_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
274 #elif HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
275 vo_draw_alpha_rgb32_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
276 #elif HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
277 vo_draw_alpha_rgb32_MMX(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
278 #elif ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
279 vo_draw_alpha_rgb32_X86(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
280 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
281 vo_draw_alpha_rgb32_C(w, h, src, srca, srcstride, dstbase, dststride);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
282 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
283 #endif //!CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
284 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
285
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
286 #ifdef FAST_OSD_TABLE
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
287 static unsigned short fast_osd_12bpp_table[256];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
288 static unsigned short fast_osd_15bpp_table[256];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
289 static unsigned short fast_osd_16bpp_table[256];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
290 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
291
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
292 void vo_draw_alpha_init(void){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
293 #ifdef FAST_OSD_TABLE
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
294 int i;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
295 for(i=0;i<256;i++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
296 fast_osd_12bpp_table[i]=((i>>4)<< 8)|((i>>4)<<4)|(i>>4);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
297 fast_osd_15bpp_table[i]=((i>>3)<<10)|((i>>3)<<5)|(i>>3);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
298 fast_osd_16bpp_table[i]=((i>>3)<<11)|((i>>2)<<5)|(i>>3);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
299 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
300 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
301 //FIXME the optimized stuff is a lie for 15/16bpp as they aren't optimized yet
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
302 if( mp_msg_test(MSGT_OSD,MSGL_V) )
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
303 {
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
304 #if CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
305 #if ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
306 // ordered per speed fasterst first
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
307 if(gCpuCaps.hasMMX2)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
308 mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay\n");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
309 else if(gCpuCaps.has3DNow)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
310 mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX (with tiny bit 3DNow) Optimized OnScreenDisplay\n");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
311 else if(gCpuCaps.hasMMX)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
312 mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX Optimized OnScreenDisplay\n");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
313 else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
314 mp_msg(MSGT_OSD,MSGL_INFO,"Using X86 Optimized OnScreenDisplay\n");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
315 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
316 mp_msg(MSGT_OSD,MSGL_INFO,"Using Unoptimized OnScreenDisplay\n");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
317 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
318 #else //CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
319 #if HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
320 mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay\n");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
321 #elif HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
322 mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX (with tiny bit 3DNow) Optimized OnScreenDisplay\n");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
323 #elif HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
324 mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX Optimized OnScreenDisplay\n");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
325 #elif ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
326 mp_msg(MSGT_OSD,MSGL_INFO,"Using X86 Optimized OnScreenDisplay\n");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
327 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
328 mp_msg(MSGT_OSD,MSGL_INFO,"Using Unoptimized OnScreenDisplay\n");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
329 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
330 #endif //!CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
331 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
332 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
333
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
334 void vo_draw_alpha_rgb12(int w, int h, unsigned char* src, unsigned char *srca,
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
335 int srcstride, unsigned char* dstbase, int dststride) {
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
336 int y;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
337 for (y = 0; y < h; y++) {
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
338 register unsigned short *dst = (unsigned short*) dstbase;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
339 register int x;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
340 for (x = 0; x < w; x++) {
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
341 if(srca[x]){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
342 #ifdef FAST_OSD
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
343 #ifdef FAST_OSD_TABLE
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
344 dst[x] = fast_osd_12bpp_table[src[x]];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
345 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
346 register unsigned int a = src[x] >> 4;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
347 dst[x] = (a << 8) | (a << 4) | a;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
348 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
349 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
350 unsigned char r = dst[x] & 0x0F;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
351 unsigned char g = (dst[x] >> 4) & 0x0F;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
352 unsigned char b = (dst[x] >> 8) & 0x0F;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
353 r = (((r*srca[x]) >> 4) + src[x]) >> 4;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
354 g = (((g*srca[x]) >> 4) + src[x]) >> 4;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
355 b = (((b*srca[x]) >> 4) + src[x]) >> 4;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
356 dst[x] = (b << 8) | (g << 4) | r;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
357 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
358 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
359 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
360 src += srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
361 srca += srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
362 dstbase += dststride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
363 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
364 return;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
365 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
366
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
367 void vo_draw_alpha_rgb15(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
368 int y;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
369 for(y=0;y<h;y++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
370 register unsigned short *dst = (unsigned short*) dstbase;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
371 register int x;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
372 for(x=0;x<w;x++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
373 if(srca[x]){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
374 #ifdef FAST_OSD
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
375 #ifdef FAST_OSD_TABLE
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
376 dst[x]=fast_osd_15bpp_table[src[x]];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
377 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
378 register unsigned int a=src[x]>>3;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
379 dst[x]=(a<<10)|(a<<5)|a;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
380 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
381 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
382 unsigned char r=dst[x]&0x1F;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
383 unsigned char g=(dst[x]>>5)&0x1F;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
384 unsigned char b=(dst[x]>>10)&0x1F;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
385 r=(((r*srca[x])>>5)+src[x])>>3;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
386 g=(((g*srca[x])>>5)+src[x])>>3;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
387 b=(((b*srca[x])>>5)+src[x])>>3;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
388 dst[x]=(b<<10)|(g<<5)|r;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
389 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
390 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
391 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
392 src+=srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
393 srca+=srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
394 dstbase+=dststride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
395 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
396 return;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
397 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
398
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
399 void vo_draw_alpha_rgb16(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
400 int y;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
401 for(y=0;y<h;y++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
402 register unsigned short *dst = (unsigned short*) dstbase;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
403 register int x;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
404 for(x=0;x<w;x++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
405 if(srca[x]){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
406 #ifdef FAST_OSD
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
407 #ifdef FAST_OSD_TABLE
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
408 dst[x]=fast_osd_16bpp_table[src[x]];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
409 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
410 dst[x]=((src[x]>>3)<<11)|((src[x]>>2)<<5)|(src[x]>>3);
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
411 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
412 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
413 unsigned char r=dst[x]&0x1F;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
414 unsigned char g=(dst[x]>>5)&0x3F;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
415 unsigned char b=(dst[x]>>11)&0x1F;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
416 r=(((r*srca[x])>>5)+src[x])>>3;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
417 g=(((g*srca[x])>>6)+src[x])>>2;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
418 b=(((b*srca[x])>>5)+src[x])>>3;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
419 dst[x]=(b<<11)|(g<<5)|r;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
420 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
421 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
422 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
423 src+=srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
424 srca+=srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
425 dstbase+=dststride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
426 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
427 return;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
428 }