Mercurial > mplayer.hg
annotate postproc/rgb2rgb.c @ 9851:6a348d3ed626
A new control called upon stream reset.
author | albeu |
---|---|
date | Sun, 06 Apr 2003 16:34:26 +0000 |
parents | 50ef22bcc0c3 |
children | 988c2ffc5bc1 |
rev | line source |
---|---|
2694 | 1 /* |
2538
71320898b333
Finish mmx2, 3dnow optimiz. 15to16 should be tested. Better fix of can't compile
nick
parents:
2535
diff
changeset
|
2 * |
71320898b333
Finish mmx2, 3dnow optimiz. 15to16 should be tested. Better fix of can't compile
nick
parents:
2535
diff
changeset
|
3 * rgb2rgb.c, Software RGB to RGB convertor |
2732 | 4 * pluralize by Software PAL8 to RGB convertor |
5 * Software YUV to YUV convertor | |
6 * Software YUV to RGB convertor | |
2538
71320898b333
Finish mmx2, 3dnow optimiz. 15to16 should be tested. Better fix of can't compile
nick
parents:
2535
diff
changeset
|
7 * Written by Nick Kurshev. |
3132 | 8 * palette & yuv & runtime cpu stuff by Michael (michaelni@gmx.at) (under GPL) |
2538
71320898b333
Finish mmx2, 3dnow optimiz. 15to16 should be tested. Better fix of can't compile
nick
parents:
2535
diff
changeset
|
9 */ |
2504 | 10 #include <inttypes.h> |
11 #include "../config.h" | |
12 #include "rgb2rgb.h" | |
3132 | 13 #include "../cpudetect.h" |
4923 | 14 #include "../mangle.h" |
7159
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
15 #include "../bswap.h" |
8123
9fc45fe0d444
*HUGE* set of compiler warning fixes, unused variables removal
arpi
parents:
7334
diff
changeset
|
16 #include "../libvo/fastmemcpy.h" |
2538
71320898b333
Finish mmx2, 3dnow optimiz. 15to16 should be tested. Better fix of can't compile
nick
parents:
2535
diff
changeset
|
17 |
3132 | 18 #ifdef ARCH_X86 |
19 #define CAN_COMPILE_X86_ASM | |
20 #endif | |
21 | |
4622 | 22 #define FAST_BGR2YV12 // use 7 bit coeffs instead of 15bit |
23 | |
3132 | 24 #ifdef CAN_COMPILE_X86_ASM |
6492 | 25 static const uint64_t mmx_null __attribute__((aligned(8))) = 0x0000000000000000ULL; |
26 static const uint64_t mmx_one __attribute__((aligned(8))) = 0xFFFFFFFFFFFFFFFFULL; | |
2755 | 27 static const uint64_t mask32b __attribute__((aligned(8))) = 0x000000FF000000FFULL; |
28 static const uint64_t mask32g __attribute__((aligned(8))) = 0x0000FF000000FF00ULL; | |
29 static const uint64_t mask32r __attribute__((aligned(8))) = 0x00FF000000FF0000ULL; | |
2538
71320898b333
Finish mmx2, 3dnow optimiz. 15to16 should be tested. Better fix of can't compile
nick
parents:
2535
diff
changeset
|
30 static const uint64_t mask32 __attribute__((aligned(8))) = 0x00FFFFFF00FFFFFFULL; |
9454 | 31 static const uint64_t mask3216br __attribute__((aligned(8)))=0x00F800F800F800F8ULL; |
32 static const uint64_t mask3216g __attribute__((aligned(8)))=0x0000FC000000FC00ULL; | |
33 static const uint64_t mask3215g __attribute__((aligned(8)))=0x0000F8000000F800ULL; | |
34 static const uint64_t mul3216 __attribute__((aligned(8))) = 0x2000000420000004ULL; | |
35 static const uint64_t mul3215 __attribute__((aligned(8))) = 0x2000000820000008ULL; | |
5582 | 36 static const uint64_t mask24b __attribute__((aligned(8))) = 0x00FF0000FF0000FFULL; |
37 static const uint64_t mask24g __attribute__((aligned(8))) = 0xFF0000FF0000FF00ULL; | |
38 static const uint64_t mask24r __attribute__((aligned(8))) = 0x0000FF0000FF0000ULL; | |
2538
71320898b333
Finish mmx2, 3dnow optimiz. 15to16 should be tested. Better fix of can't compile
nick
parents:
2535
diff
changeset
|
39 static const uint64_t mask24l __attribute__((aligned(8))) = 0x0000000000FFFFFFULL; |
71320898b333
Finish mmx2, 3dnow optimiz. 15to16 should be tested. Better fix of can't compile
nick
parents:
2535
diff
changeset
|
40 static const uint64_t mask24h __attribute__((aligned(8))) = 0x0000FFFFFF000000ULL; |
2746
dece635a28e3
Minor speedup of rgb32to24. (performance is not successful)
nick
parents:
2741
diff
changeset
|
41 static const uint64_t mask24hh __attribute__((aligned(8))) = 0xffff000000000000ULL; |
dece635a28e3
Minor speedup of rgb32to24. (performance is not successful)
nick
parents:
2741
diff
changeset
|
42 static const uint64_t mask24hhh __attribute__((aligned(8))) = 0xffffffff00000000ULL; |
dece635a28e3
Minor speedup of rgb32to24. (performance is not successful)
nick
parents:
2741
diff
changeset
|
43 static const uint64_t mask24hhhh __attribute__((aligned(8))) = 0xffffffffffff0000ULL; |
2538
71320898b333
Finish mmx2, 3dnow optimiz. 15to16 should be tested. Better fix of can't compile
nick
parents:
2535
diff
changeset
|
44 static const uint64_t mask15b __attribute__((aligned(8))) = 0x001F001F001F001FULL; /* 00000000 00011111 xxB */ |
71320898b333
Finish mmx2, 3dnow optimiz. 15to16 should be tested. Better fix of can't compile
nick
parents:
2535
diff
changeset
|
45 static const uint64_t mask15rg __attribute__((aligned(8))) = 0x7FE07FE07FE07FE0ULL; /* 01111111 11100000 RGx */ |
2698
22652c028692
faster 15to16 bit rgb (the mmx routine is limited by memory speed so there is no difference ): but the c routine is faster
michael
parents:
2697
diff
changeset
|
46 static const uint64_t mask15s __attribute__((aligned(8))) = 0xFFE0FFE0FFE0FFE0ULL; |
6492 | 47 static const uint64_t mask15g __attribute__((aligned(8))) = 0x03E003E003E003E0ULL; |
48 static const uint64_t mask15r __attribute__((aligned(8))) = 0x7C007C007C007C00ULL; | |
49 #define mask16b mask15b | |
50 static const uint64_t mask16g __attribute__((aligned(8))) = 0x07E007E007E007E0ULL; | |
51 static const uint64_t mask16r __attribute__((aligned(8))) = 0xF800F800F800F800ULL; | |
2741 | 52 static const uint64_t red_16mask __attribute__((aligned(8))) = 0x0000f8000000f800ULL; |
53 static const uint64_t green_16mask __attribute__((aligned(8)))= 0x000007e0000007e0ULL; | |
54 static const uint64_t blue_16mask __attribute__((aligned(8))) = 0x0000001f0000001fULL; | |
55 static const uint64_t red_15mask __attribute__((aligned(8))) = 0x00007c000000f800ULL; | |
56 static const uint64_t green_15mask __attribute__((aligned(8)))= 0x000003e0000007e0ULL; | |
57 static const uint64_t blue_15mask __attribute__((aligned(8))) = 0x0000001f0000001fULL; | |
4622 | 58 |
59 #ifdef FAST_BGR2YV12 | |
60 static const uint64_t bgr2YCoeff __attribute__((aligned(8))) = 0x000000210041000DULL; | |
61 static const uint64_t bgr2UCoeff __attribute__((aligned(8))) = 0x0000FFEEFFDC0038ULL; | |
62 static const uint64_t bgr2VCoeff __attribute__((aligned(8))) = 0x00000038FFD2FFF8ULL; | |
63 #else | |
64 static const uint64_t bgr2YCoeff __attribute__((aligned(8))) = 0x000020E540830C8BULL; | |
65 static const uint64_t bgr2UCoeff __attribute__((aligned(8))) = 0x0000ED0FDAC23831ULL; | |
66 static const uint64_t bgr2VCoeff __attribute__((aligned(8))) = 0x00003831D0E6F6EAULL; | |
67 #endif | |
68 static const uint64_t bgr2YOffset __attribute__((aligned(8))) = 0x1010101010101010ULL; | |
69 static const uint64_t bgr2UVOffset __attribute__((aligned(8)))= 0x8080808080808080ULL; | |
70 static const uint64_t w1111 __attribute__((aligned(8))) = 0x0001000100010001ULL; | |
71 | |
2755 | 72 #if 0 |
73 static volatile uint64_t __attribute__((aligned(8))) b5Dither; | |
74 static volatile uint64_t __attribute__((aligned(8))) g5Dither; | |
75 static volatile uint64_t __attribute__((aligned(8))) g6Dither; | |
76 static volatile uint64_t __attribute__((aligned(8))) r5Dither; | |
77 | |
78 static uint64_t __attribute__((aligned(8))) dither4[2]={ | |
79 0x0103010301030103LL, | |
80 0x0200020002000200LL,}; | |
81 | |
82 static uint64_t __attribute__((aligned(8))) dither8[2]={ | |
83 0x0602060206020602LL, | |
84 0x0004000400040004LL,}; | |
85 #endif | |
2535 | 86 #endif |
2513 | 87 |
3132 | 88 #define RGB2YUV_SHIFT 8 |
89 #define BY ((int)( 0.098*(1<<RGB2YUV_SHIFT)+0.5)) | |
90 #define BV ((int)(-0.071*(1<<RGB2YUV_SHIFT)+0.5)) | |
91 #define BU ((int)( 0.439*(1<<RGB2YUV_SHIFT)+0.5)) | |
92 #define GY ((int)( 0.504*(1<<RGB2YUV_SHIFT)+0.5)) | |
93 #define GV ((int)(-0.368*(1<<RGB2YUV_SHIFT)+0.5)) | |
94 #define GU ((int)(-0.291*(1<<RGB2YUV_SHIFT)+0.5)) | |
95 #define RY ((int)( 0.257*(1<<RGB2YUV_SHIFT)+0.5)) | |
96 #define RV ((int)( 0.439*(1<<RGB2YUV_SHIFT)+0.5)) | |
97 #define RU ((int)(-0.148*(1<<RGB2YUV_SHIFT)+0.5)) | |
98 | |
99 //Note: we have C, MMX, MMX2, 3DNOW version therse no 3DNOW+MMX2 one | |
100 //Plain C versions | |
101 #undef HAVE_MMX | |
102 #undef HAVE_MMX2 | |
103 #undef HAVE_3DNOW | |
104 #undef ARCH_X86 | |
5338 | 105 #undef HAVE_SSE2 |
3132 | 106 #define RENAME(a) a ## _C |
107 #include "rgb2rgb_template.c" | |
108 | |
109 #ifdef CAN_COMPILE_X86_ASM | |
110 | |
111 //MMX versions | |
112 #undef RENAME | |
113 #define HAVE_MMX | |
114 #undef HAVE_MMX2 | |
115 #undef HAVE_3DNOW | |
5338 | 116 #undef HAVE_SSE2 |
3132 | 117 #define ARCH_X86 |
118 #define RENAME(a) a ## _MMX | |
119 #include "rgb2rgb_template.c" | |
120 | |
121 //MMX2 versions | |
122 #undef RENAME | |
123 #define HAVE_MMX | |
124 #define HAVE_MMX2 | |
125 #undef HAVE_3DNOW | |
5338 | 126 #undef HAVE_SSE2 |
3132 | 127 #define ARCH_X86 |
128 #define RENAME(a) a ## _MMX2 | |
129 #include "rgb2rgb_template.c" | |
130 | |
131 //3DNOW versions | |
132 #undef RENAME | |
133 #define HAVE_MMX | |
134 #undef HAVE_MMX2 | |
135 #define HAVE_3DNOW | |
5338 | 136 #undef HAVE_SSE2 |
3132 | 137 #define ARCH_X86 |
138 #define RENAME(a) a ## _3DNow | |
139 #include "rgb2rgb_template.c" | |
140 | |
141 #endif //CAN_COMPILE_X86_ASM | |
142 | |
2718 | 143 void rgb24to32(const uint8_t *src,uint8_t *dst,unsigned src_size) |
2504 | 144 { |
3132 | 145 #ifdef CAN_COMPILE_X86_ASM |
146 // ordered per speed fasterst first | |
147 if(gCpuCaps.hasMMX2) | |
148 rgb24to32_MMX2(src, dst, src_size); | |
149 else if(gCpuCaps.has3DNow) | |
150 rgb24to32_3DNow(src, dst, src_size); | |
151 else if(gCpuCaps.hasMMX) | |
152 rgb24to32_MMX(src, dst, src_size); | |
153 else | |
6492 | 154 #endif |
3132 | 155 rgb24to32_C(src, dst, src_size); |
6492 | 156 } |
157 | |
158 void rgb15to24(const uint8_t *src,uint8_t *dst,unsigned src_size) | |
159 { | |
160 #ifdef CAN_COMPILE_X86_ASM | |
161 // ordered per speed fasterst first | |
162 if(gCpuCaps.hasMMX2) | |
163 rgb15to24_MMX2(src, dst, src_size); | |
164 else if(gCpuCaps.has3DNow) | |
165 rgb15to24_3DNow(src, dst, src_size); | |
166 else if(gCpuCaps.hasMMX) | |
167 rgb15to24_MMX(src, dst, src_size); | |
168 else | |
169 #endif | |
170 rgb15to24_C(src, dst, src_size); | |
171 } | |
172 | |
173 void rgb16to24(const uint8_t *src,uint8_t *dst,unsigned src_size) | |
174 { | |
175 #ifdef CAN_COMPILE_X86_ASM | |
176 // ordered per speed fasterst first | |
177 if(gCpuCaps.hasMMX2) | |
178 rgb16to24_MMX2(src, dst, src_size); | |
179 else if(gCpuCaps.has3DNow) | |
180 rgb16to24_3DNow(src, dst, src_size); | |
181 else if(gCpuCaps.hasMMX) | |
182 rgb16to24_MMX(src, dst, src_size); | |
183 else | |
2510 | 184 #endif |
6492 | 185 rgb16to24_C(src, dst, src_size); |
186 } | |
187 | |
188 void rgb15to32(const uint8_t *src,uint8_t *dst,unsigned src_size) | |
189 { | |
190 #ifdef CAN_COMPILE_X86_ASM | |
191 // ordered per speed fasterst first | |
192 if(gCpuCaps.hasMMX2) | |
193 rgb15to32_MMX2(src, dst, src_size); | |
194 else if(gCpuCaps.has3DNow) | |
195 rgb15to32_3DNow(src, dst, src_size); | |
196 else if(gCpuCaps.hasMMX) | |
197 rgb15to32_MMX(src, dst, src_size); | |
198 else | |
199 #endif | |
200 rgb15to32_C(src, dst, src_size); | |
201 } | |
202 | |
203 void rgb16to32(const uint8_t *src,uint8_t *dst,unsigned src_size) | |
204 { | |
205 #ifdef CAN_COMPILE_X86_ASM | |
206 // ordered per speed fasterst first | |
207 if(gCpuCaps.hasMMX2) | |
208 rgb16to32_MMX2(src, dst, src_size); | |
209 else if(gCpuCaps.has3DNow) | |
210 rgb16to32_3DNow(src, dst, src_size); | |
211 else if(gCpuCaps.hasMMX) | |
212 rgb16to32_MMX(src, dst, src_size); | |
213 else | |
214 #endif | |
215 rgb16to32_C(src, dst, src_size); | |
2504 | 216 } |
2505 | 217 |
2718 | 218 void rgb32to24(const uint8_t *src,uint8_t *dst,unsigned src_size) |
2505 | 219 { |
3132 | 220 #ifdef CAN_COMPILE_X86_ASM |
221 // ordered per speed fasterst first | |
222 if(gCpuCaps.hasMMX2) | |
223 rgb32to24_MMX2(src, dst, src_size); | |
224 else if(gCpuCaps.has3DNow) | |
225 rgb32to24_3DNow(src, dst, src_size); | |
226 else if(gCpuCaps.hasMMX) | |
227 rgb32to24_MMX(src, dst, src_size); | |
228 else | |
6492 | 229 #endif |
3132 | 230 rgb32to24_C(src, dst, src_size); |
2505 | 231 } |
2506 | 232 |
2538
71320898b333
Finish mmx2, 3dnow optimiz. 15to16 should be tested. Better fix of can't compile
nick
parents:
2535
diff
changeset
|
233 /* |
71320898b333
Finish mmx2, 3dnow optimiz. 15to16 should be tested. Better fix of can't compile
nick
parents:
2535
diff
changeset
|
234 Original by Strepto/Astral |
71320898b333
Finish mmx2, 3dnow optimiz. 15to16 should be tested. Better fix of can't compile
nick
parents:
2535
diff
changeset
|
235 ported to gcc & bugfixed : A'rpi |
2564 | 236 MMX2, 3DNOW optimization by Nick Kurshev |
2698
22652c028692
faster 15to16 bit rgb (the mmx routine is limited by memory speed so there is no difference ): but the c routine is faster
michael
parents:
2697
diff
changeset
|
237 32bit c version, and and&add trick by Michael Niedermayer |
2538
71320898b333
Finish mmx2, 3dnow optimiz. 15to16 should be tested. Better fix of can't compile
nick
parents:
2535
diff
changeset
|
238 */ |
2718 | 239 void rgb15to16(const uint8_t *src,uint8_t *dst,unsigned src_size) |
2506 | 240 { |
3132 | 241 #ifdef CAN_COMPILE_X86_ASM |
242 // ordered per speed fasterst first | |
243 if(gCpuCaps.hasMMX2) | |
244 rgb15to16_MMX2(src, dst, src_size); | |
245 else if(gCpuCaps.has3DNow) | |
246 rgb15to16_3DNow(src, dst, src_size); | |
247 else if(gCpuCaps.hasMMX) | |
248 rgb15to16_MMX(src, dst, src_size); | |
249 else | |
6492 | 250 #endif |
3132 | 251 rgb15to16_C(src, dst, src_size); |
2506 | 252 } |
2694 | 253 |
6606
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
254 void rgb16to15(const uint8_t *src,uint8_t *dst,unsigned src_size) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
255 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
256 #ifdef CAN_COMPILE_X86_ASM |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
257 // ordered per speed fasterst first |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
258 if(gCpuCaps.hasMMX2) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
259 rgb16to15_MMX2(src, dst, src_size); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
260 else if(gCpuCaps.has3DNow) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
261 rgb16to15_3DNow(src, dst, src_size); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
262 else if(gCpuCaps.hasMMX) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
263 rgb16to15_MMX(src, dst, src_size); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
264 else |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
265 #endif |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
266 rgb16to15_C(src, dst, src_size); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
267 } |
2694 | 268 /** |
269 * Pallete is assumed to contain bgr32 | |
270 */ | |
2718 | 271 void palette8torgb32(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette) |
2694 | 272 { |
2718 | 273 unsigned i; |
7334 | 274 |
275 /* | |
2702 | 276 for(i=0; i<num_pixels; i++) |
2718 | 277 ((unsigned *)dst)[i] = ((unsigned *)palette)[ src[i] ]; |
7334 | 278 */ |
279 | |
280 for(i=0; i<num_pixels; i++) | |
281 { | |
282 //FIXME slow? | |
283 dst[0]= palette[ src[i]*4+2 ]; | |
284 dst[1]= palette[ src[i]*4+1 ]; | |
285 dst[2]= palette[ src[i]*4+0 ]; | |
286 // dst[3]= 0; /* do we need this cleansing? */ | |
287 dst+= 4; | |
288 } | |
2694 | 289 } |
290 | |
7159
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
291 void palette8tobgr32(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette) |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
292 { |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
293 unsigned i; |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
294 for(i=0; i<num_pixels; i++) |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
295 { |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
296 //FIXME slow? |
7334 | 297 dst[0]= palette[ src[i]*4+0 ]; |
298 dst[1]= palette[ src[i]*4+1 ]; | |
299 dst[2]= palette[ src[i]*4+2 ]; | |
300 // dst[3]= 0; /* do we need this cleansing? */ | |
7159
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
301 dst+= 4; |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
302 } |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
303 } |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
304 |
2697 | 305 /** |
306 * Pallete is assumed to contain bgr32 | |
307 */ | |
2718 | 308 void palette8torgb24(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette) |
2697 | 309 { |
2718 | 310 unsigned i; |
2697 | 311 /* |
312 writes 1 byte o much and might cause alignment issues on some architectures? | |
2702 | 313 for(i=0; i<num_pixels; i++) |
2718 | 314 ((unsigned *)(&dst[i*3])) = ((unsigned *)palette)[ src[i] ]; |
2697 | 315 */ |
2702 | 316 for(i=0; i<num_pixels; i++) |
2697 | 317 { |
318 //FIXME slow? | |
7334 | 319 dst[0]= palette[ src[i]*4+2 ]; |
2697 | 320 dst[1]= palette[ src[i]*4+1 ]; |
7334 | 321 dst[2]= palette[ src[i]*4+0 ]; |
2697 | 322 dst+= 3; |
323 } | |
324 } | |
325 | |
7159
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
326 void palette8tobgr24(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette) |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
327 { |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
328 unsigned i; |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
329 /* |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
330 writes 1 byte o much and might cause alignment issues on some architectures? |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
331 for(i=0; i<num_pixels; i++) |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
332 ((unsigned *)(&dst[i*3])) = ((unsigned *)palette)[ src[i] ]; |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
333 */ |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
334 for(i=0; i<num_pixels; i++) |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
335 { |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
336 //FIXME slow? |
7334 | 337 dst[0]= palette[ src[i]*4+0 ]; |
338 dst[1]= palette[ src[i]*4+1 ]; | |
339 dst[2]= palette[ src[i]*4+2 ]; | |
7159
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
340 dst+= 3; |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
341 } |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
342 } |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
343 |
6484
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
344 void bgr24torgb24(const uint8_t *src, uint8_t *dst, unsigned src_size) |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
345 { |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
346 #ifdef CAN_COMPILE_X86_ASM |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
347 // ordered per speed fasterst first |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
348 if(gCpuCaps.hasMMX2) |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
349 bgr24torgb24_MMX2(src, dst, src_size); |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
350 else if(gCpuCaps.has3DNow) |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
351 bgr24torgb24_3DNow(src, dst, src_size); |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
352 else if(gCpuCaps.hasMMX) |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
353 bgr24torgb24_MMX(src, dst, src_size); |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
354 else |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
355 bgr24torgb24_C(src, dst, src_size); |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
356 #else |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
357 bgr24torgb24_C(src, dst, src_size); |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
358 #endif |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
359 } |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
360 |
2718 | 361 void rgb32to16(const uint8_t *src, uint8_t *dst, unsigned src_size) |
2694 | 362 { |
3132 | 363 #ifdef CAN_COMPILE_X86_ASM |
364 // ordered per speed fasterst first | |
365 if(gCpuCaps.hasMMX2) | |
366 rgb32to16_MMX2(src, dst, src_size); | |
367 else if(gCpuCaps.has3DNow) | |
368 rgb32to16_3DNow(src, dst, src_size); | |
369 else if(gCpuCaps.hasMMX) | |
370 rgb32to16_MMX(src, dst, src_size); | |
371 else | |
6492 | 372 #endif |
3132 | 373 rgb32to16_C(src, dst, src_size); |
2694 | 374 } |
375 | |
2718 | 376 void rgb32to15(const uint8_t *src, uint8_t *dst, unsigned src_size) |
2694 | 377 { |
3132 | 378 #ifdef CAN_COMPILE_X86_ASM |
379 // ordered per speed fasterst first | |
380 if(gCpuCaps.hasMMX2) | |
381 rgb32to15_MMX2(src, dst, src_size); | |
382 else if(gCpuCaps.has3DNow) | |
383 rgb32to15_3DNow(src, dst, src_size); | |
384 else if(gCpuCaps.hasMMX) | |
385 rgb32to15_MMX(src, dst, src_size); | |
386 else | |
6492 | 387 #endif |
3132 | 388 rgb32to15_C(src, dst, src_size); |
2694 | 389 } |
390 | |
2718 | 391 void rgb24to16(const uint8_t *src, uint8_t *dst, unsigned src_size) |
392 { | |
3132 | 393 #ifdef CAN_COMPILE_X86_ASM |
394 // ordered per speed fasterst first | |
395 if(gCpuCaps.hasMMX2) | |
396 rgb24to16_MMX2(src, dst, src_size); | |
397 else if(gCpuCaps.has3DNow) | |
398 rgb24to16_3DNow(src, dst, src_size); | |
399 else if(gCpuCaps.hasMMX) | |
400 rgb24to16_MMX(src, dst, src_size); | |
401 else | |
6492 | 402 #endif |
3132 | 403 rgb24to16_C(src, dst, src_size); |
2718 | 404 } |
405 | |
406 void rgb24to15(const uint8_t *src, uint8_t *dst, unsigned src_size) | |
407 { | |
3132 | 408 #ifdef CAN_COMPILE_X86_ASM |
409 // ordered per speed fasterst first | |
410 if(gCpuCaps.hasMMX2) | |
411 rgb24to15_MMX2(src, dst, src_size); | |
412 else if(gCpuCaps.has3DNow) | |
413 rgb24to15_3DNow(src, dst, src_size); | |
414 else if(gCpuCaps.hasMMX) | |
415 rgb24to15_MMX(src, dst, src_size); | |
416 else | |
6492 | 417 #endif |
3132 | 418 rgb24to15_C(src, dst, src_size); |
2718 | 419 } |
2694 | 420 |
421 /** | |
422 * Palette is assumed to contain bgr16, see rgb32to16 to convert the palette | |
423 */ | |
2718 | 424 void palette8torgb16(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette) |
2694 | 425 { |
2718 | 426 unsigned i; |
2702 | 427 for(i=0; i<num_pixels; i++) |
2694 | 428 ((uint16_t *)dst)[i] = ((uint16_t *)palette)[ src[i] ]; |
429 } | |
7159
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
430 void palette8tobgr16(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette) |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
431 { |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
432 unsigned i; |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
433 for(i=0; i<num_pixels; i++) |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
434 ((uint16_t *)dst)[i] = bswap_16(((uint16_t *)palette)[ src[i] ]); |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
435 } |
2694 | 436 |
437 /** | |
438 * Pallete is assumed to contain bgr15, see rgb32to15 to convert the palette | |
439 */ | |
2718 | 440 void palette8torgb15(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette) |
2694 | 441 { |
2718 | 442 unsigned i; |
2702 | 443 for(i=0; i<num_pixels; i++) |
2694 | 444 ((uint16_t *)dst)[i] = ((uint16_t *)palette)[ src[i] ]; |
2697 | 445 } |
7159
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
446 void palette8tobgr15(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette) |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
447 { |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
448 unsigned i; |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
449 for(i=0; i<num_pixels; i++) |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
450 ((uint16_t *)dst)[i] = bswap_16(((uint16_t *)palette)[ src[i] ]); |
1df24fd752d0
added missing palette8tobgr pairs (hope it's correct)
alex
parents:
6614
diff
changeset
|
451 } |
2755 | 452 |
453 void rgb32tobgr32(const uint8_t *src, uint8_t *dst, unsigned int src_size) | |
454 { | |
3132 | 455 #ifdef CAN_COMPILE_X86_ASM |
456 // ordered per speed fasterst first | |
457 if(gCpuCaps.hasMMX2) | |
458 rgb32tobgr32_MMX2(src, dst, src_size); | |
459 else if(gCpuCaps.has3DNow) | |
460 rgb32tobgr32_3DNow(src, dst, src_size); | |
461 else if(gCpuCaps.hasMMX) | |
462 rgb32tobgr32_MMX(src, dst, src_size); | |
463 else | |
6492 | 464 #endif |
3132 | 465 rgb32tobgr32_C(src, dst, src_size); |
2755 | 466 } |
467 | |
6606
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
468 void rgb32tobgr24(const uint8_t *src, uint8_t *dst, unsigned int src_size) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
469 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
470 unsigned i; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
471 unsigned num_pixels = src_size >> 2; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
472 for(i=0; i<num_pixels; i++) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
473 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
474 dst[3*i + 0] = src[4*i + 2]; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
475 dst[3*i + 1] = src[4*i + 1]; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
476 dst[3*i + 2] = src[4*i + 0]; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
477 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
478 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
479 |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
480 void rgb32tobgr16(const uint8_t *src, uint8_t *dst, unsigned int src_size) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
481 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
482 #ifdef CAN_COMPILE_X86_ASM |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
483 // ordered per speed fasterst first |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
484 if(gCpuCaps.hasMMX2) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
485 rgb32tobgr16_MMX2(src, dst, src_size); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
486 else if(gCpuCaps.has3DNow) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
487 rgb32tobgr16_3DNow(src, dst, src_size); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
488 else if(gCpuCaps.hasMMX) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
489 rgb32tobgr16_MMX(src, dst, src_size); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
490 else |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
491 #endif |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
492 rgb32tobgr16_C(src, dst, src_size); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
493 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
494 |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
495 void rgb32tobgr15(const uint8_t *src, uint8_t *dst, unsigned int src_size) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
496 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
497 #ifdef CAN_COMPILE_X86_ASM |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
498 // ordered per speed fasterst first |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
499 if(gCpuCaps.hasMMX2) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
500 rgb32tobgr15_MMX2(src, dst, src_size); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
501 else if(gCpuCaps.has3DNow) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
502 rgb32tobgr15_3DNow(src, dst, src_size); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
503 else if(gCpuCaps.hasMMX) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
504 rgb32tobgr15_MMX(src, dst, src_size); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
505 else |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
506 #endif |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
507 rgb32tobgr15_C(src, dst, src_size); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
508 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
509 |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
510 void rgb24tobgr32(const uint8_t *src, uint8_t *dst, unsigned int src_size) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
511 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
512 unsigned i; |
6614 | 513 for(i=0; 3*i<src_size; i++) |
6606
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
514 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
515 dst[4*i + 0] = src[3*i + 2]; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
516 dst[4*i + 1] = src[3*i + 1]; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
517 dst[4*i + 2] = src[3*i + 0]; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
518 dst[4*i + 3] = 0; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
519 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
520 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
521 |
5582 | 522 void rgb24tobgr24(const uint8_t *src, uint8_t *dst, unsigned int src_size) |
523 { | |
524 #ifdef CAN_COMPILE_X86_ASM | |
525 // ordered per speed fasterst first | |
526 if(gCpuCaps.hasMMX2) | |
527 rgb24tobgr24_MMX2(src, dst, src_size); | |
528 else if(gCpuCaps.has3DNow) | |
529 rgb24tobgr24_3DNow(src, dst, src_size); | |
530 else if(gCpuCaps.hasMMX) | |
531 rgb24tobgr24_MMX(src, dst, src_size); | |
532 else | |
6492 | 533 #endif |
5582 | 534 rgb24tobgr24_C(src, dst, src_size); |
535 } | |
536 | |
6606
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
537 void rgb24tobgr16(const uint8_t *src, uint8_t *dst, unsigned int src_size) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
538 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
539 #ifdef CAN_COMPILE_X86_ASM |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
540 // ordered per speed fasterst first |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
541 if(gCpuCaps.hasMMX2) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
542 rgb24tobgr16_MMX2(src, dst, src_size); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
543 else if(gCpuCaps.has3DNow) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
544 rgb24tobgr16_3DNow(src, dst, src_size); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
545 else if(gCpuCaps.hasMMX) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
546 rgb24tobgr16_MMX(src, dst, src_size); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
547 else |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
548 #endif |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
549 rgb24tobgr16_C(src, dst, src_size); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
550 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
551 |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
552 void rgb24tobgr15(const uint8_t *src, uint8_t *dst, unsigned int src_size) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
553 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
554 #ifdef CAN_COMPILE_X86_ASM |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
555 // ordered per speed fasterst first |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
556 if(gCpuCaps.hasMMX2) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
557 rgb24tobgr15_MMX2(src, dst, src_size); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
558 else if(gCpuCaps.has3DNow) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
559 rgb24tobgr15_3DNow(src, dst, src_size); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
560 else if(gCpuCaps.hasMMX) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
561 rgb24tobgr15_MMX(src, dst, src_size); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
562 else |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
563 #endif |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
564 rgb24tobgr15_C(src, dst, src_size); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
565 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
566 |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
567 void rgb16tobgr32(const uint8_t *src, uint8_t *dst, unsigned int src_size) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
568 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
569 const uint16_t *end; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
570 uint8_t *d = (uint8_t *)dst; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
571 const uint16_t *s = (uint16_t *)src; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
572 end = s + src_size/2; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
573 while(s < end) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
574 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
575 register uint16_t bgr; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
576 bgr = *s++; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
577 *d++ = (bgr&0xF800)>>8; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
578 *d++ = (bgr&0x7E0)>>3; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
579 *d++ = (bgr&0x1F)<<3; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
580 *d++ = 0; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
581 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
582 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
583 |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
584 void rgb16tobgr24(const uint8_t *src, uint8_t *dst, unsigned int src_size) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
585 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
586 const uint16_t *end; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
587 uint8_t *d = (uint8_t *)dst; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
588 const uint16_t *s = (const uint16_t *)src; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
589 end = s + src_size/2; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
590 while(s < end) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
591 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
592 register uint16_t bgr; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
593 bgr = *s++; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
594 *d++ = (bgr&0xF800)>>8; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
595 *d++ = (bgr&0x7E0)>>3; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
596 *d++ = (bgr&0x1F)<<3; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
597 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
598 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
599 |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
600 void rgb16tobgr16(const uint8_t *src, uint8_t *dst, unsigned int src_size) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
601 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
602 unsigned i; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
603 unsigned num_pixels = src_size >> 1; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
604 |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
605 for(i=0; i<num_pixels; i++) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
606 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
607 unsigned b,g,r; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
608 register uint16_t rgb; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
609 rgb = src[2*i]; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
610 r = rgb&0x1F; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
611 g = (rgb&0x7E0)>>5; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
612 b = (rgb&0xF800)>>11; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
613 dst[2*i] = (b&0x1F) | ((g&0x3F)<<5) | ((r&0x1F)<<11); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
614 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
615 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
616 |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
617 void rgb16tobgr15(const uint8_t *src, uint8_t *dst, unsigned int src_size) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
618 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
619 unsigned i; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
620 unsigned num_pixels = src_size >> 1; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
621 |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
622 for(i=0; i<num_pixels; i++) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
623 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
624 unsigned b,g,r; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
625 register uint16_t rgb; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
626 rgb = src[2*i]; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
627 r = rgb&0x1F; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
628 g = (rgb&0x7E0)>>5; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
629 b = (rgb&0xF800)>>11; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
630 dst[2*i] = (b&0x1F) | ((g&0x1F)<<5) | ((r&0x1F)<<10); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
631 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
632 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
633 |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
634 void rgb15tobgr32(const uint8_t *src, uint8_t *dst, unsigned int src_size) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
635 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
636 const uint16_t *end; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
637 uint8_t *d = (uint8_t *)dst; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
638 const uint16_t *s = (const uint16_t *)src; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
639 end = s + src_size/2; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
640 while(s < end) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
641 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
642 register uint16_t bgr; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
643 bgr = *s++; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
644 *d++ = (bgr&0x7C00)>>7; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
645 *d++ = (bgr&0x3E0)>>2; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
646 *d++ = (bgr&0x1F)<<3; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
647 *d++ = 0; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
648 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
649 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
650 |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
651 void rgb15tobgr24(const uint8_t *src, uint8_t *dst, unsigned int src_size) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
652 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
653 const uint16_t *end; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
654 uint8_t *d = (uint8_t *)dst; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
655 const uint16_t *s = (uint16_t *)src; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
656 end = s + src_size/2; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
657 while(s < end) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
658 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
659 register uint16_t bgr; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
660 bgr = *s++; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
661 *d++ = (bgr&0x7C00)>>7; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
662 *d++ = (bgr&0x3E0)>>2; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
663 *d++ = (bgr&0x1F)<<3; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
664 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
665 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
666 |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
667 void rgb15tobgr16(const uint8_t *src, uint8_t *dst, unsigned int src_size) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
668 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
669 unsigned i; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
670 unsigned num_pixels = src_size >> 1; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
671 |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
672 for(i=0; i<num_pixels; i++) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
673 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
674 unsigned b,g,r; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
675 register uint16_t rgb; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
676 rgb = src[2*i]; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
677 r = rgb&0x1F; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
678 g = (rgb&0x3E0)>>5; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
679 b = (rgb&0x7C00)>>10; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
680 dst[2*i] = (b&0x1F) | ((g&0x3F)<<5) | ((r&0x1F)<<11); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
681 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
682 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
683 |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
684 void rgb15tobgr15(const uint8_t *src, uint8_t *dst, unsigned int src_size) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
685 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
686 unsigned i; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
687 unsigned num_pixels = src_size >> 1; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
688 |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
689 for(i=0; i<num_pixels; i++) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
690 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
691 unsigned b,g,r; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
692 register uint16_t rgb; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
693 rgb = src[2*i]; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
694 r = rgb&0x1F; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
695 g = (rgb&0x3E0)>>5; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
696 b = (rgb&0x7C00)>>10; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
697 dst[2*i] = (b&0x1F) | ((g&0x1F)<<5) | ((r&0x1F)<<10); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
698 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
699 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
700 |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
701 void rgb8tobgr8(const uint8_t *src, uint8_t *dst, unsigned int src_size) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
702 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
703 unsigned i; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
704 unsigned num_pixels = src_size; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
705 for(i=0; i<num_pixels; i++) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
706 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
707 unsigned b,g,r; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
708 register uint8_t rgb; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
709 rgb = src[i]; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
710 r = (rgb&0x07); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
711 g = (rgb&0x38)>>3; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
712 b = (rgb&0xC0)>>6; |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
713 dst[i] = ((b<<1)&0x07) | ((g&0x07)<<3) | ((r&0x03)<<6); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
714 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
715 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
716 |
2702 | 717 /** |
718 * | |
2724 | 719 * height should be a multiple of 2 and width should be a multiple of 16 (if this is a |
720 * problem for anyone then tell me, and ill fix it) | |
2702 | 721 */ |
2723 | 722 void yv12toyuy2(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, |
2725 | 723 unsigned int width, unsigned int height, |
9392 | 724 int lumStride, int chromStride, int dstStride) |
2701 | 725 { |
3132 | 726 #ifdef CAN_COMPILE_X86_ASM |
727 // ordered per speed fasterst first | |
728 if(gCpuCaps.hasMMX2) | |
729 yv12toyuy2_MMX2(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride); | |
730 else if(gCpuCaps.has3DNow) | |
731 yv12toyuy2_3DNow(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride); | |
732 else if(gCpuCaps.hasMMX) | |
733 yv12toyuy2_MMX(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride); | |
734 else | |
6492 | 735 #endif |
3132 | 736 yv12toyuy2_C(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride); |
2701 | 737 } |
738 | |
2724 | 739 /** |
740 * | |
5588 | 741 * width should be a multiple of 16 |
742 */ | |
743 void yuv422ptoyuy2(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, | |
744 unsigned int width, unsigned int height, | |
9392 | 745 int lumStride, int chromStride, int dstStride) |
5588 | 746 { |
747 #ifdef CAN_COMPILE_X86_ASM | |
748 // ordered per speed fasterst first | |
749 if(gCpuCaps.hasMMX2) | |
750 yuv422ptoyuy2_MMX2(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride); | |
751 else if(gCpuCaps.has3DNow) | |
752 yuv422ptoyuy2_3DNow(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride); | |
753 else if(gCpuCaps.hasMMX) | |
754 yuv422ptoyuy2_MMX(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride); | |
755 else | |
6492 | 756 #endif |
5588 | 757 yuv422ptoyuy2_C(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride); |
758 } | |
759 | |
760 /** | |
761 * | |
2724 | 762 * height should be a multiple of 2 and width should be a multiple of 16 (if this is a |
763 * problem for anyone then tell me, and ill fix it) | |
764 */ | |
765 void yuy2toyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, | |
2725 | 766 unsigned int width, unsigned int height, |
9392 | 767 int lumStride, int chromStride, int srcStride) |
2701 | 768 { |
3132 | 769 #ifdef CAN_COMPILE_X86_ASM |
770 // ordered per speed fasterst first | |
771 if(gCpuCaps.hasMMX2) | |
772 yuy2toyv12_MMX2(src, ydst, udst, vdst, width, height, lumStride, chromStride, srcStride); | |
773 else if(gCpuCaps.has3DNow) | |
774 yuy2toyv12_3DNow(src, ydst, udst, vdst, width, height, lumStride, chromStride, srcStride); | |
775 else if(gCpuCaps.hasMMX) | |
776 yuy2toyv12_MMX(src, ydst, udst, vdst, width, height, lumStride, chromStride, srcStride); | |
777 else | |
6492 | 778 #endif |
3132 | 779 yuy2toyv12_C(src, ydst, udst, vdst, width, height, lumStride, chromStride, srcStride); |
2723 | 780 } |
2801 | 781 |
782 /** | |
783 * | |
784 * height should be a multiple of 2 and width should be a multiple of 16 (if this is a | |
785 * problem for anyone then tell me, and ill fix it) | |
3132 | 786 * chrominance data is only taken from every secound line others are ignored FIXME write HQ version |
2801 | 787 */ |
788 void uyvytoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, | |
789 unsigned int width, unsigned int height, | |
9392 | 790 int lumStride, int chromStride, int srcStride) |
2801 | 791 { |
3132 | 792 #ifdef CAN_COMPILE_X86_ASM |
793 // ordered per speed fasterst first | |
794 if(gCpuCaps.hasMMX2) | |
795 uyvytoyv12_MMX2(src, ydst, udst, vdst, width, height, lumStride, chromStride, srcStride); | |
796 else if(gCpuCaps.has3DNow) | |
797 uyvytoyv12_3DNow(src, ydst, udst, vdst, width, height, lumStride, chromStride, srcStride); | |
798 else if(gCpuCaps.hasMMX) | |
799 uyvytoyv12_MMX(src, ydst, udst, vdst, width, height, lumStride, chromStride, srcStride); | |
800 else | |
801 uyvytoyv12_C(src, ydst, udst, vdst, width, height, lumStride, chromStride, srcStride); | |
2847 | 802 #else |
3132 | 803 uyvytoyv12_C(src, ydst, udst, vdst, width, height, lumStride, chromStride, srcStride); |
2847 | 804 #endif |
2801 | 805 } |
806 | |
6484
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
807 void yvu9toyv12(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
808 uint8_t *ydst, uint8_t *udst, uint8_t *vdst, |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
809 unsigned int width, unsigned int height, |
9392 | 810 int lumStride, int chromStride) |
6484
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
811 { |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
812 #ifdef CAN_COMPILE_X86_ASM |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
813 // ordered per speed fasterst first |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
814 if(gCpuCaps.hasMMX2) |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
815 yvu9toyv12_MMX2(ysrc, usrc, vsrc, ydst, udst, vdst, width, height, lumStride, chromStride); |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
816 else if(gCpuCaps.has3DNow) |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
817 yvu9toyv12_3DNow(ysrc, usrc, vsrc, ydst, udst, vdst, width, height, lumStride, chromStride); |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
818 else if(gCpuCaps.hasMMX) |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
819 yvu9toyv12_MMX(ysrc, usrc, vsrc, ydst, udst, vdst, width, height, lumStride, chromStride); |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
820 else |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
821 yvu9toyv12_C(ysrc, usrc, vsrc, ydst, udst, vdst, width, height, lumStride, chromStride); |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
822 #else |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
823 yvu9toyv12_C(ysrc, usrc, vsrc, ydst, udst, vdst, width, height, lumStride, chromStride); |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
824 #endif |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
825 } |
c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
alex
parents:
5588
diff
changeset
|
826 |
6582
f98313dcd428
yvu9 -> yv12 unscaled converter with linear chroma scaling
michael
parents:
6492
diff
changeset
|
827 void planar2x(const uint8_t *src, uint8_t *dst, int width, int height, int srcStride, int dstStride) |
f98313dcd428
yvu9 -> yv12 unscaled converter with linear chroma scaling
michael
parents:
6492
diff
changeset
|
828 { |
f98313dcd428
yvu9 -> yv12 unscaled converter with linear chroma scaling
michael
parents:
6492
diff
changeset
|
829 #ifdef CAN_COMPILE_X86_ASM |
f98313dcd428
yvu9 -> yv12 unscaled converter with linear chroma scaling
michael
parents:
6492
diff
changeset
|
830 // ordered per speed fasterst first |
f98313dcd428
yvu9 -> yv12 unscaled converter with linear chroma scaling
michael
parents:
6492
diff
changeset
|
831 if(gCpuCaps.hasMMX2) |
f98313dcd428
yvu9 -> yv12 unscaled converter with linear chroma scaling
michael
parents:
6492
diff
changeset
|
832 planar2x_MMX2(src, dst, width, height, srcStride, dstStride); |
f98313dcd428
yvu9 -> yv12 unscaled converter with linear chroma scaling
michael
parents:
6492
diff
changeset
|
833 else if(gCpuCaps.has3DNow) |
f98313dcd428
yvu9 -> yv12 unscaled converter with linear chroma scaling
michael
parents:
6492
diff
changeset
|
834 planar2x_3DNow(src, dst, width, height, srcStride, dstStride); |
f98313dcd428
yvu9 -> yv12 unscaled converter with linear chroma scaling
michael
parents:
6492
diff
changeset
|
835 else |
f98313dcd428
yvu9 -> yv12 unscaled converter with linear chroma scaling
michael
parents:
6492
diff
changeset
|
836 #endif |
f98313dcd428
yvu9 -> yv12 unscaled converter with linear chroma scaling
michael
parents:
6492
diff
changeset
|
837 planar2x_C(src, dst, width, height, srcStride, dstStride); |
f98313dcd428
yvu9 -> yv12 unscaled converter with linear chroma scaling
michael
parents:
6492
diff
changeset
|
838 } |
f98313dcd428
yvu9 -> yv12 unscaled converter with linear chroma scaling
michael
parents:
6492
diff
changeset
|
839 |
3132 | 840 /** |
841 * | |
842 * height should be a multiple of 2 and width should be a multiple of 2 (if this is a | |
843 * problem for anyone then tell me, and ill fix it) | |
844 * chrominance data is only taken from every secound line others are ignored FIXME write HQ version | |
845 */ | |
846 void rgb24toyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, | |
847 unsigned int width, unsigned int height, | |
9392 | 848 int lumStride, int chromStride, int srcStride) |
3132 | 849 { |
850 #ifdef CAN_COMPILE_X86_ASM | |
851 // ordered per speed fasterst first | |
852 if(gCpuCaps.hasMMX2) | |
853 rgb24toyv12_MMX2(src, ydst, udst, vdst, width, height, lumStride, chromStride, srcStride); | |
854 else if(gCpuCaps.has3DNow) | |
855 rgb24toyv12_3DNow(src, ydst, udst, vdst, width, height, lumStride, chromStride, srcStride); | |
856 else if(gCpuCaps.hasMMX) | |
857 rgb24toyv12_MMX(src, ydst, udst, vdst, width, height, lumStride, chromStride, srcStride); | |
858 else | |
6492 | 859 #endif |
3132 | 860 rgb24toyv12_C(src, ydst, udst, vdst, width, height, lumStride, chromStride, srcStride); |
861 } | |
5337 | 862 |
863 void interleaveBytes(uint8_t *src1, uint8_t *src2, uint8_t *dst, | |
9392 | 864 unsigned width, unsigned height, int src1Stride, |
865 int src2Stride, int dstStride) | |
5337 | 866 { |
867 #ifdef CAN_COMPILE_X86_ASM | |
868 // ordered per speed fasterst first | |
869 if(gCpuCaps.hasMMX2) | |
870 interleaveBytes_MMX2(src1, src2, dst, width, height, src1Stride, src2Stride, dstStride); | |
871 else if(gCpuCaps.has3DNow) | |
872 interleaveBytes_3DNow(src1, src2, dst, width, height, src1Stride, src2Stride, dstStride); | |
873 else if(gCpuCaps.hasMMX) | |
874 interleaveBytes_MMX(src1, src2, dst, width, height, src1Stride, src2Stride, dstStride); | |
875 else | |
6492 | 876 #endif |
5337 | 877 interleaveBytes_C(src1, src2, dst, width, height, src1Stride, src2Stride, dstStride); |
878 } | |
6606
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
879 |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
880 void vu9_to_vu12(const uint8_t *src1, const uint8_t *src2, |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
881 uint8_t *dst1, uint8_t *dst2, |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
882 unsigned width, unsigned height, |
9392 | 883 int srcStride1, int srcStride2, |
884 int dstStride1, int dstStride2) | |
6606
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
885 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
886 #ifdef CAN_COMPILE_X86_ASM |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
887 if(gCpuCaps.hasMMX2) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
888 vu9_to_vu12_MMX2(src1, src2, dst1, dst2, width, height, srcStride1, srcStride2, dstStride1, dstStride2); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
889 else if(gCpuCaps.has3DNow) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
890 vu9_to_vu12_3DNow(src1, src2, dst1, dst2, width, height, srcStride1, srcStride2, dstStride1, dstStride2); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
891 else if(gCpuCaps.hasMMX) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
892 vu9_to_vu12_MMX(src1, src2, dst1, dst2, width, height, srcStride1, srcStride2, dstStride1, dstStride2); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
893 else |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
894 #endif |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
895 vu9_to_vu12_C(src1, src2, dst1, dst2, width, height, srcStride1, srcStride2, dstStride1, dstStride2); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
896 } |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
897 |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
898 void yvu9_to_yuy2(const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
899 uint8_t *dst, |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
900 unsigned width, unsigned height, |
9392 | 901 int srcStride1, int srcStride2, |
902 int srcStride3, int dstStride) | |
6606
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
903 { |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
904 #ifdef CAN_COMPILE_X86_ASM |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
905 if(gCpuCaps.hasMMX2) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
906 yvu9_to_yuy2_MMX2(src1, src2, src3, dst, width, height, srcStride1, srcStride2, srcStride3, dstStride); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
907 else if(gCpuCaps.has3DNow) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
908 yvu9_to_yuy2_3DNow(src1, src2, src3, dst, width, height, srcStride1, srcStride2, srcStride3, dstStride); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
909 else if(gCpuCaps.hasMMX) |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
910 yvu9_to_yuy2_MMX(src1, src2, src3, dst, width, height, srcStride1, srcStride2, srcStride3, dstStride); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
911 else |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
912 #endif |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
913 yvu9_to_yuy2_C(src1, src2, src3, dst, width, height, srcStride1, srcStride2, srcStride3, dstStride); |
50b5d8367318
merging changes from mplayerxp (rgb2rgb*.{c,h} only)
michael
parents:
6582
diff
changeset
|
914 } |