annotate sub/osd.c @ 35730:330325df88ed

Relocate #defines and make them functions. Additionally, add doxygen comments.
author ib
date Tue, 22 Jan 2013 17:34:52 +0000
parents a0ff4fde7a48
children
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>
35049
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
30 #include <stdlib.h>
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
31 #include "libmpcodecs/img_format.h"
32469
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
32 #include "cpudetect.h"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
33
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
34 #if ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
35 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
36 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
37 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
38 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
39
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
40 //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
41 //Plain C versions
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
42 #if !HAVE_MMX || CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
43 #define COMPILE_C
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
44 #endif
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 ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
47
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
48 #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
49 #define COMPILE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
50 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
51
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
52 #if HAVE_MMX2 || CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
53 #define COMPILE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
54 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
55
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
56 #if (HAVE_AMD3DNOW && !HAVE_MMX2) || CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
57 #define COMPILE_3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
58 #endif
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 #endif /* ARCH_X86 */
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
61
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
62 #undef HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
63 #undef HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
64 #undef HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
65 #define HAVE_MMX 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
66 #define HAVE_MMX2 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
67 #define HAVE_AMD3DNOW 0
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 #if ! ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
70
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
71 #ifdef COMPILE_C
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
72 #undef HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
73 #undef HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
74 #undef HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
75 #define HAVE_MMX 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
76 #define HAVE_MMX2 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
77 #define HAVE_AMD3DNOW 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
78 #define RENAME(a) a ## _C
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
79 #include "osd_template.c"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
80 #endif
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 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
83
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
84 //X86 noMMX versions
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
85 #ifdef COMPILE_C
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
86 #undef RENAME
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
87 #undef HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
88 #undef HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
89 #undef HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
90 #define HAVE_MMX 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
91 #define HAVE_MMX2 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
92 #define HAVE_AMD3DNOW 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
93 #define RENAME(a) a ## _X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
94 #include "osd_template.c"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
95 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
96
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
97 //MMX versions
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
98 #ifdef COMPILE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
99 #undef RENAME
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
100 #undef HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
101 #undef HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
102 #undef HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
103 #define HAVE_MMX 1
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
104 #define HAVE_MMX2 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
105 #define HAVE_AMD3DNOW 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
106 #define RENAME(a) a ## _MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
107 #include "osd_template.c"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
108 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
109
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
110 //MMX2 versions
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
111 #ifdef COMPILE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
112 #undef RENAME
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
113 #undef HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
114 #undef HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
115 #undef HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
116 #define HAVE_MMX 1
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
117 #define HAVE_MMX2 1
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
118 #define HAVE_AMD3DNOW 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
119 #define RENAME(a) a ## _MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
120 #include "osd_template.c"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
121 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
122
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
123 //3DNOW versions
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
124 #ifdef COMPILE_3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
125 #undef RENAME
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
126 #undef HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
127 #undef HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
128 #undef HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
129 #define HAVE_MMX 1
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
130 #define HAVE_MMX2 0
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
131 #define HAVE_AMD3DNOW 1
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
132 #define RENAME(a) a ## _3DNow
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
133 #include "osd_template.c"
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
134 #endif
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 #endif /* ARCH_X86 */
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
137
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
138 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
139 #if CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
140 #if ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
141 // ordered by speed / fastest first
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
142 if(gCpuCaps.hasMMX2)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
143 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
144 else if(gCpuCaps.has3DNow)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
145 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
146 else if(gCpuCaps.hasMMX)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
147 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
148 else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
149 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
150 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
151 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
152 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
153 #else //CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
154 #if HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
155 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
156 #elif HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
157 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
158 #elif HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
159 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
160 #elif ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
161 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
162 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
163 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
164 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
165 #endif //!CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
166 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
167
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
168 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
169 #if CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
170 #if ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
171 // ordered by speed / fastest first
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
172 if(gCpuCaps.hasMMX2)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
173 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
174 else if(gCpuCaps.has3DNow)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
175 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
176 else if(gCpuCaps.hasMMX)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
177 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
178 else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
179 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
180 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
181 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
182 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
183 #else //CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
184 #if HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
185 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
186 #elif HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
187 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
188 #elif HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
189 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
190 #elif ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
191 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
192 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
193 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
194 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
195 #endif //!CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
196 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
197
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
198 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
199 #if CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
200 #if ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
201 // ordered by speed / fastest first
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
202 if(gCpuCaps.hasMMX2)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
203 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
204 else if(gCpuCaps.has3DNow)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
205 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
206 else if(gCpuCaps.hasMMX)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
207 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
208 else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
209 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
210 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
211 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
212 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
213 #else //CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
214 #if HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
215 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
216 #elif HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
217 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
218 #elif HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
219 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
220 #elif ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
221 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
222 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
223 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
224 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
225 #endif //!CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
226 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
227
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
228 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
229 #if CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
230 #if ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
231 // ordered by speed / fastest first
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
232 if(gCpuCaps.hasMMX2)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
233 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
234 else if(gCpuCaps.has3DNow)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
235 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
236 else if(gCpuCaps.hasMMX)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
237 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
238 else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
239 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
240 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
241 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
242 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
243 #else //CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
244 #if HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
245 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
246 #elif HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
247 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
248 #elif HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
249 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
250 #elif ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
251 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
252 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
253 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
254 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
255 #endif //!CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
256 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
257
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
258 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
259 #if CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
260 #if ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
261 // ordered by speed / fastest first
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
262 if(gCpuCaps.hasMMX2)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
263 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
264 else if(gCpuCaps.has3DNow)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
265 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
266 else if(gCpuCaps.hasMMX)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
267 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
268 else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
269 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
270 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
271 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
272 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
273 #else //CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
274 #if HAVE_MMX2
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
275 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
276 #elif HAVE_AMD3DNOW
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
277 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
278 #elif HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
279 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
280 #elif ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
281 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
282 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
283 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
284 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
285 #endif //!CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
286 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
287
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
288 #ifdef FAST_OSD_TABLE
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
289 static unsigned short fast_osd_12bpp_table[256];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
290 static unsigned short fast_osd_15bpp_table[256];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
291 static unsigned short fast_osd_16bpp_table[256];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
292 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
293
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
294 void vo_draw_alpha_init(void){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
295 #ifdef FAST_OSD_TABLE
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
296 int i;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
297 for(i=0;i<256;i++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
298 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
299 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
300 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
301 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
302 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
303 //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
304 if( mp_msg_test(MSGT_OSD,MSGL_V) )
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
305 {
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
306 #if CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
307 #if ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
308 // ordered per speed fasterst first
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
309 if(gCpuCaps.hasMMX2)
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 MMX2) Optimized OnScreenDisplay\n");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
311 else if(gCpuCaps.has3DNow)
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 (with tiny bit 3DNow) Optimized OnScreenDisplay\n");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
313 else if(gCpuCaps.hasMMX)
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
314 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
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 X86 Optimized OnScreenDisplay\n");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
317 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
318 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
319 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
320 #else //CONFIG_RUNTIME_CPUDETECT
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
321 #if HAVE_MMX2
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 MMX2) Optimized OnScreenDisplay\n");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
323 #elif HAVE_AMD3DNOW
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 (with tiny bit 3DNow) Optimized OnScreenDisplay\n");
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
325 #elif HAVE_MMX
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
326 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
327 #elif ARCH_X86
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
328 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
329 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
330 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
331 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
332 #endif //!CONFIG_RUNTIME_CPUDETECT
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 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
335
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
336 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
337 int srcstride, unsigned char* dstbase, int dststride) {
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
338 int y;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
339 for (y = 0; y < h; y++) {
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
340 register unsigned short *dst = (unsigned short*) dstbase;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
341 register int x;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
342 for (x = 0; x < w; x++) {
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
343 if(srca[x]){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
344 #ifdef FAST_OSD
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
345 #ifdef FAST_OSD_TABLE
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
346 dst[x] = fast_osd_12bpp_table[src[x]];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
347 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
348 register unsigned int a = src[x] >> 4;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
349 dst[x] = (a << 8) | (a << 4) | a;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
350 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
351 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
352 unsigned char r = dst[x] & 0x0F;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
353 unsigned char g = (dst[x] >> 4) & 0x0F;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
354 unsigned char b = (dst[x] >> 8) & 0x0F;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
355 r = (((r*srca[x]) >> 4) + src[x]) >> 4;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
356 g = (((g*srca[x]) >> 4) + src[x]) >> 4;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
357 b = (((b*srca[x]) >> 4) + src[x]) >> 4;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
358 dst[x] = (b << 8) | (g << 4) | r;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
359 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
360 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
361 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
362 src += srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
363 srca += srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
364 dstbase += dststride;
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 return;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
367 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
368
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
369 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
370 int y;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
371 for(y=0;y<h;y++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
372 register unsigned short *dst = (unsigned short*) dstbase;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
373 register int x;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
374 for(x=0;x<w;x++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
375 if(srca[x]){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
376 #ifdef FAST_OSD
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
377 #ifdef FAST_OSD_TABLE
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
378 dst[x]=fast_osd_15bpp_table[src[x]];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
379 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
380 register unsigned int a=src[x]>>3;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
381 dst[x]=(a<<10)|(a<<5)|a;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
382 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
383 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
384 unsigned char r=dst[x]&0x1F;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
385 unsigned char g=(dst[x]>>5)&0x1F;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
386 unsigned char b=(dst[x]>>10)&0x1F;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
387 r=(((r*srca[x])>>5)+src[x])>>3;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
388 g=(((g*srca[x])>>5)+src[x])>>3;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
389 b=(((b*srca[x])>>5)+src[x])>>3;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
390 dst[x]=(b<<10)|(g<<5)|r;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
391 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
392 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
393 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
394 src+=srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
395 srca+=srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
396 dstbase+=dststride;
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 return;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
399 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
400
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
401 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
402 int y;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
403 for(y=0;y<h;y++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
404 register unsigned short *dst = (unsigned short*) dstbase;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
405 register int x;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
406 for(x=0;x<w;x++){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
407 if(srca[x]){
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
408 #ifdef FAST_OSD
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
409 #ifdef FAST_OSD_TABLE
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
410 dst[x]=fast_osd_16bpp_table[src[x]];
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
411 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
412 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
413 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
414 #else
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
415 unsigned char r=dst[x]&0x1F;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
416 unsigned char g=(dst[x]>>5)&0x3F;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
417 unsigned char b=(dst[x]>>11)&0x1F;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
418 r=(((r*srca[x])>>5)+src[x])>>3;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
419 g=(((g*srca[x])>>6)+src[x])>>2;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
420 b=(((b*srca[x])>>5)+src[x])>>3;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
421 dst[x]=(b<<11)|(g<<5)|r;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
422 #endif
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
423 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
424 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
425 src+=srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
426 srca+=srcstride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
427 dstbase+=dststride;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
428 }
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
429 return;
3fef2e17a03f Move osd.[ch] and osd_template.c from libvo to sub.
cigaes
parents:
diff changeset
430 }
35049
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
431
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
432 vo_draw_alpha_func vo_get_draw_alpha(unsigned fmt) {
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
433 if (IMGFMT_IS_RGB(fmt) || IMGFMT_IS_BGR(fmt)) {
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
434 switch (IMGFMT_RGB_DEPTH(fmt))
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
435 {
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
436 case 12:
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
437 return vo_draw_alpha_rgb12;
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
438 case 15:
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
439 return vo_draw_alpha_rgb15;
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
440 case 16:
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
441 return vo_draw_alpha_rgb16;
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
442 case 24:
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
443 return vo_draw_alpha_rgb24;
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
444 case 32:
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
445 return vo_draw_alpha_rgb32;
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
446 }
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
447 return NULL;
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
448 }
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
449 switch (fmt) {
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
450 case IMGFMT_YV12:
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
451 case IMGFMT_I420:
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
452 case IMGFMT_IYUV:
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
453 return vo_draw_alpha_yv12;
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
454 case IMGFMT_YUY2:
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
455 case IMGFMT_YVYU:
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
456 return vo_draw_alpha_yuy2;
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
457 case IMGFMT_UYVY:
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
458 return vo_draw_alpha_uyvy;
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
459 }
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
460 return NULL;
a0ff4fde7a48 Add helper function to reduce code duplication for selecting
reimar
parents: 32469
diff changeset
461 }