From 59ac5a936ca7eab31c8422b934f1872e61612f6a Mon Sep 17 00:00:00 2001 From: Nick Kurshev Date: Sun, 28 Oct 2001 10:28:08 +0000 Subject: vo_vesa: more rgb2rgb support Originally committed as revision 2506 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc --- postproc/rgb2rgb.c | 17 +++++++++++++++++ postproc/rgb2rgb.h | 3 ++- postproc/rgb2rgb_template.c | 17 +++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) (limited to 'postproc') diff --git a/postproc/rgb2rgb.c b/postproc/rgb2rgb.c index 1a71ba9..7e0a1e9 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 4224487..7d81ef1 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 1a71ba9..7e0a1e9 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++; + } +} -- cgit v1.1