changeset 2505:2aaa11d22f91

vo_vesa: more rgb2rgb support
author nick
date Sun, 28 Oct 2001 10:28:08 +0000
parents 13e1c5ab417a
children 501752469c39
files libvo/vo_vesa.c postproc/rgb2rgb.c postproc/rgb2rgb.h postproc/rgb2rgb_template.c
diffstat 4 files changed, 38 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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++;
+  }
+}
--- 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
--- 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++;
+  }
+}