diff options
author | nick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-10-28 10:28:08 +0000 |
---|---|---|
committer | nick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-10-28 10:28:08 +0000 |
commit | ce1e5d842b44623bc002b708bfa3371136843b1c (patch) | |
tree | bc6d929c6f94d7964afd297f27726d13faf70bb7 /postproc | |
parent | d6bed371d7742c5f9a3f934540212875d0e3bc4c (diff) | |
download | mpv-ce1e5d842b44623bc002b708bfa3371136843b1c.tar.bz2 mpv-ce1e5d842b44623bc002b708bfa3371136843b1c.tar.xz |
vo_vesa: more rgb2rgb support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2506 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'postproc')
-rw-r--r-- | postproc/rgb2rgb.c | 17 | ||||
-rw-r--r-- | postproc/rgb2rgb.h | 3 | ||||
-rw-r--r-- | postproc/rgb2rgb_template.c | 17 |
3 files changed, 36 insertions, 1 deletions
diff --git a/postproc/rgb2rgb.c b/postproc/rgb2rgb.c index 1a71ba9dce..7e0a1e9917 100644 --- a/postproc/rgb2rgb.c +++ b/postproc/rgb2rgb.c @@ -2,6 +2,8 @@ #include "../config.h" #include "rgb2rgb.h" +/* TODO: MMX optimization */ + void rgb24to32(uint8_t *src,uint8_t *dst,uint32_t src_size) { uint32_t *dest = (uint32_t *)dst; @@ -16,3 +18,18 @@ void rgb24to32(uint8_t *src,uint8_t *dst,uint32_t src_size) s += 3; } } + +void rgb32to24(uint8_t *src,uint8_t *dst,uint32_t src_size) +{ + uint8_t *dest = dst; + uint8_t *s = src; + uint8_t *end; + end = s + src_size; + while(s < end) + { + *dest++ = *s++; + *dest++ = *s++; + *dest++ = *s++; + s++; + } +} diff --git a/postproc/rgb2rgb.h b/postproc/rgb2rgb.h index 4224487d32..7d81ef171a 100644 --- a/postproc/rgb2rgb.h +++ b/postproc/rgb2rgb.h @@ -1,6 +1,6 @@ /* * - * rgb2rgb.h, Software RGB to RGB coverter + * rgb2rgb.h, Software RGB to RGB converter * */ @@ -8,5 +8,6 @@ #define RGB2RGB_INCLUDED extern void rgb24to32(uint8_t *src,uint8_t *dst,uint32_t src_size); +extern void rgb32to24(uint8_t *src,uint8_t *dst,uint32_t src_size); #endif diff --git a/postproc/rgb2rgb_template.c b/postproc/rgb2rgb_template.c index 1a71ba9dce..7e0a1e9917 100644 --- a/postproc/rgb2rgb_template.c +++ b/postproc/rgb2rgb_template.c @@ -2,6 +2,8 @@ #include "../config.h" #include "rgb2rgb.h" +/* TODO: MMX optimization */ + void rgb24to32(uint8_t *src,uint8_t *dst,uint32_t src_size) { uint32_t *dest = (uint32_t *)dst; @@ -16,3 +18,18 @@ void rgb24to32(uint8_t *src,uint8_t *dst,uint32_t src_size) s += 3; } } + +void rgb32to24(uint8_t *src,uint8_t *dst,uint32_t src_size) +{ + uint8_t *dest = dst; + uint8_t *s = src; + uint8_t *end; + end = s + src_size; + while(s < end) + { + *dest++ = *s++; + *dest++ = *s++; + *dest++ = *s++; + s++; + } +} |