vo_vesa: more rgb2rgb support
[libav.git] / postproc / rgb2rgb.c
CommitLineData
b234ae81
NK
1#include <inttypes.h>
2#include "../config.h"
3#include "rgb2rgb.h"
4
59ac5a93
NK
5/* TODO: MMX optimization */
6
b234ae81
NK
7void rgb24to32(uint8_t *src,uint8_t *dst,uint32_t src_size)
8{
9 uint32_t *dest = (uint32_t *)dst;
10 uint8_t *s = src;
11 uint8_t *end;
12 end = s + src_size;
13 while(s < end)
14 {
15 uint32_t rgb0;
16 rgb0 = *(uint32_t *)s;
17 *dest++ = rgb0 & 0xFFFFFFUL;
18 s += 3;
19 }
20}
59ac5a93
NK
21
22void 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}