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