comparison postproc/rgb2rgb.c @ 5582:21bd4b32abb4

rgb24->bgr24
author michael
date Sat, 13 Apr 2002 00:48:21 +0000
parents 2819346c6049
children f0fa3373f616
comparison
equal deleted inserted replaced
5581:1f231091fb54 5582:21bd4b32abb4
22 #ifdef CAN_COMPILE_X86_ASM 22 #ifdef CAN_COMPILE_X86_ASM
23 static const uint64_t mask32b __attribute__((aligned(8))) = 0x000000FF000000FFULL; 23 static const uint64_t mask32b __attribute__((aligned(8))) = 0x000000FF000000FFULL;
24 static const uint64_t mask32g __attribute__((aligned(8))) = 0x0000FF000000FF00ULL; 24 static const uint64_t mask32g __attribute__((aligned(8))) = 0x0000FF000000FF00ULL;
25 static const uint64_t mask32r __attribute__((aligned(8))) = 0x00FF000000FF0000ULL; 25 static const uint64_t mask32r __attribute__((aligned(8))) = 0x00FF000000FF0000ULL;
26 static const uint64_t mask32 __attribute__((aligned(8))) = 0x00FFFFFF00FFFFFFULL; 26 static const uint64_t mask32 __attribute__((aligned(8))) = 0x00FFFFFF00FFFFFFULL;
27 static const uint64_t mask24b __attribute__((aligned(8))) = 0x00FF0000FF0000FFULL;
28 static const uint64_t mask24g __attribute__((aligned(8))) = 0xFF0000FF0000FF00ULL;
29 static const uint64_t mask24r __attribute__((aligned(8))) = 0x0000FF0000FF0000ULL;
27 static const uint64_t mask24l __attribute__((aligned(8))) = 0x0000000000FFFFFFULL; 30 static const uint64_t mask24l __attribute__((aligned(8))) = 0x0000000000FFFFFFULL;
28 static const uint64_t mask24h __attribute__((aligned(8))) = 0x0000FFFFFF000000ULL; 31 static const uint64_t mask24h __attribute__((aligned(8))) = 0x0000FFFFFF000000ULL;
29 static const uint64_t mask24hh __attribute__((aligned(8))) = 0xffff000000000000ULL; 32 static const uint64_t mask24hh __attribute__((aligned(8))) = 0xffff000000000000ULL;
30 static const uint64_t mask24hhh __attribute__((aligned(8))) = 0xffffffff00000000ULL; 33 static const uint64_t mask24hhh __attribute__((aligned(8))) = 0xffffffff00000000ULL;
31 static const uint64_t mask24hhhh __attribute__((aligned(8))) = 0xffffffffffff0000ULL; 34 static const uint64_t mask24hhhh __attribute__((aligned(8))) = 0xffffffffffff0000ULL;
314 #else 317 #else
315 rgb32tobgr32_C(src, dst, src_size); 318 rgb32tobgr32_C(src, dst, src_size);
316 #endif 319 #endif
317 } 320 }
318 321
322 void rgb24tobgr24(const uint8_t *src, uint8_t *dst, unsigned int src_size)
323 {
324 #ifdef CAN_COMPILE_X86_ASM
325 // ordered per speed fasterst first
326 if(gCpuCaps.hasMMX2)
327 rgb24tobgr24_MMX2(src, dst, src_size);
328 else if(gCpuCaps.has3DNow)
329 rgb24tobgr24_3DNow(src, dst, src_size);
330 else if(gCpuCaps.hasMMX)
331 rgb24tobgr24_MMX(src, dst, src_size);
332 else
333 rgb24tobgr24_C(src, dst, src_size);
334 #else
335 rgb24tobgr24_C(src, dst, src_size);
336 #endif
337 }
338
319 /** 339 /**
320 * 340 *
321 * height should be a multiple of 2 and width should be a multiple of 16 (if this is a 341 * height should be a multiple of 2 and width should be a multiple of 16 (if this is a
322 * problem for anyone then tell me, and ill fix it) 342 * problem for anyone then tell me, and ill fix it)
323 */ 343 */