# HG changeset patch # User nick # Date 1004264888 0 # Node ID 2aaa11d22f91bd9d4bedf301b42b4bc95d600281 # Parent 13e1c5ab417acdff81a534e58c396368491a7ef1 vo_vesa: more rgb2rgb support diff -r 13e1c5ab417a -r 2aaa11d22f91 libvo/vo_vesa.c --- a/libvo/vo_vesa.c Sun Oct 28 10:17:57 2001 +0000 +++ b/libvo/vo_vesa.c Sun Oct 28 10:28:08 2001 +0000 @@ -582,6 +582,8 @@ { if(image_bpp == 24 && video_mode_info.BitsPerPixel == 32) rgb2rgb_fnc = rgb24to32; else + if(image_bpp == 32 && video_mode_info.BitsPerPixel == 24) rgb2rgb_fnc = rgb32to24; + else { printf("vo_vesa: Can't convert %u to %u\n",image_bpp,video_mode_info.BitsPerPixel); return -1; diff -r 13e1c5ab417a -r 2aaa11d22f91 postproc/rgb2rgb.c --- a/postproc/rgb2rgb.c Sun Oct 28 10:17:57 2001 +0000 +++ b/postproc/rgb2rgb.c Sun Oct 28 10:28:08 2001 +0000 @@ -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 @@ 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 -r 13e1c5ab417a -r 2aaa11d22f91 postproc/rgb2rgb.h --- a/postproc/rgb2rgb.h Sun Oct 28 10:17:57 2001 +0000 +++ b/postproc/rgb2rgb.h Sun Oct 28 10:28:08 2001 +0000 @@ -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 -r 13e1c5ab417a -r 2aaa11d22f91 postproc/rgb2rgb_template.c --- a/postproc/rgb2rgb_template.c Sun Oct 28 10:17:57 2001 +0000 +++ b/postproc/rgb2rgb_template.c Sun Oct 28 10:28:08 2001 +0000 @@ -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 @@ 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++; + } +}