comparison postproc/rgb2rgb.c @ 6484:c5cf988c6d6f

pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
author alex
date Fri, 21 Jun 2002 17:37:00 +0000
parents f0fa3373f616
children e7635c03910f
comparison
equal deleted inserted replaced
6483:2dd9691fe6b8 6484:c5cf988c6d6f
212 dst[2]= palette[ src[i]*4+2 ]; 212 dst[2]= palette[ src[i]*4+2 ];
213 dst+= 3; 213 dst+= 3;
214 } 214 }
215 } 215 }
216 216
217 void bgr24torgb24(const uint8_t *src, uint8_t *dst, unsigned src_size)
218 {
219 #ifdef CAN_COMPILE_X86_ASM
220 // ordered per speed fasterst first
221 if(gCpuCaps.hasMMX2)
222 bgr24torgb24_MMX2(src, dst, src_size);
223 else if(gCpuCaps.has3DNow)
224 bgr24torgb24_3DNow(src, dst, src_size);
225 else if(gCpuCaps.hasMMX)
226 bgr24torgb24_MMX(src, dst, src_size);
227 else
228 bgr24torgb24_C(src, dst, src_size);
229 #else
230 bgr24torgb24_C(src, dst, src_size);
231 #endif
232 }
233
217 void rgb32to16(const uint8_t *src, uint8_t *dst, unsigned src_size) 234 void rgb32to16(const uint8_t *src, uint8_t *dst, unsigned src_size)
218 { 235 {
219 #ifdef CAN_COMPILE_X86_ASM 236 #ifdef CAN_COMPILE_X86_ASM
220 // ordered per speed fasterst first 237 // ordered per speed fasterst first
221 if(gCpuCaps.hasMMX2) 238 if(gCpuCaps.hasMMX2)
430 #else 447 #else
431 uyvytoyv12_C(src, ydst, udst, vdst, width, height, lumStride, chromStride, srcStride); 448 uyvytoyv12_C(src, ydst, udst, vdst, width, height, lumStride, chromStride, srcStride);
432 #endif 449 #endif
433 } 450 }
434 451
452 void yvu9toyv12(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc,
453 uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
454 unsigned int width, unsigned int height,
455 unsigned int lumStride, unsigned int chromStride)
456 {
457 #ifdef CAN_COMPILE_X86_ASM
458 // ordered per speed fasterst first
459 if(gCpuCaps.hasMMX2)
460 yvu9toyv12_MMX2(ysrc, usrc, vsrc, ydst, udst, vdst, width, height, lumStride, chromStride);
461 else if(gCpuCaps.has3DNow)
462 yvu9toyv12_3DNow(ysrc, usrc, vsrc, ydst, udst, vdst, width, height, lumStride, chromStride);
463 else if(gCpuCaps.hasMMX)
464 yvu9toyv12_MMX(ysrc, usrc, vsrc, ydst, udst, vdst, width, height, lumStride, chromStride);
465 else
466 yvu9toyv12_C(ysrc, usrc, vsrc, ydst, udst, vdst, width, height, lumStride, chromStride);
467 #else
468 yvu9toyv12_C(ysrc, usrc, vsrc, ydst, udst, vdst, width, height, lumStride, chromStride);
469 #endif
470 }
471
435 /** 472 /**
436 * 473 *
437 * height should be a multiple of 2 and width should be a multiple of 2 (if this is a 474 * height should be a multiple of 2 and width should be a multiple of 2 (if this is a
438 * problem for anyone then tell me, and ill fix it) 475 * problem for anyone then tell me, and ill fix it)
439 * chrominance data is only taken from every secound line others are ignored FIXME write HQ version 476 * chrominance data is only taken from every secound line others are ignored FIXME write HQ version