comparison postproc/rgb2rgb_template.c @ 2505:2aaa11d22f91

vo_vesa: more rgb2rgb support
author nick
date Sun, 28 Oct 2001 10:28:08 +0000
parents 13e1c5ab417a
children 501752469c39
comparison
equal deleted inserted replaced
2504:13e1c5ab417a 2505:2aaa11d22f91
1 #include <inttypes.h> 1 #include <inttypes.h>
2 #include "../config.h" 2 #include "../config.h"
3 #include "rgb2rgb.h" 3 #include "rgb2rgb.h"
4
5 /* TODO: MMX optimization */
4 6
5 void rgb24to32(uint8_t *src,uint8_t *dst,uint32_t src_size) 7 void rgb24to32(uint8_t *src,uint8_t *dst,uint32_t src_size)
6 { 8 {
7 uint32_t *dest = (uint32_t *)dst; 9 uint32_t *dest = (uint32_t *)dst;
8 uint8_t *s = src; 10 uint8_t *s = src;
14 rgb0 = *(uint32_t *)s; 16 rgb0 = *(uint32_t *)s;
15 *dest++ = rgb0 & 0xFFFFFFUL; 17 *dest++ = rgb0 & 0xFFFFFFUL;
16 s += 3; 18 s += 3;
17 } 19 }
18 } 20 }
21
22 void rgb32to24(uint8_t *src,uint8_t *dst,uint32_t src_size)
23 {
24 uint8_t *dest = dst;
25 uint8_t *s = src;
26 uint8_t *end;
27 end = s + src_size;
28 while(s < end)
29 {
30 *dest++ = *s++;
31 *dest++ = *s++;
32 *dest++ = *s++;
33 s++;
34 }
35 }