[Mplayer-cvslog] CVS: main/postproc rgb2rgb.c,1.22,1.23 rgb2rgb.h,1.9,1.10
Nick Kurshev
nick at mplayer.dev.hu
Mon Nov 5 09:55:43 CET 2001
Update of /cvsroot/mplayer/main/postproc
In directory mplayer:/var/tmp.root/cvs-serv15041/main/postproc
Modified Files:
rgb2rgb.c rgb2rgb.h
Log Message:
Michael, in the next time - please make compatible interface with existed stuff
Index: rgb2rgb.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/rgb2rgb.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- rgb2rgb.c 5 Nov 2001 08:37:27 -0000 1.22
+++ rgb2rgb.c 5 Nov 2001 08:55:27 -0000 1.23
@@ -214,29 +214,37 @@
}
}
-void rgb32to16(const uint8_t *src, uint8_t *dst, uint32_t num_pixels)
+void rgb32to16(const uint8_t *src, uint8_t *dst, uint32_t src_size)
{
- uint32_t i;
- for(i=0; i<num_pixels; i+=4)
+ const uint8_t *end, *s;
+ s = src;
+ end = s + src_size;
+ while(s < end)
{
- const int b= src[i+0];
- const int g= src[i+1];
- const int r= src[i+2];
+ const int b= *s++;
+ const int g= *s++;
+ const int r= *s++;
- ((uint16_t *)dst)[i]= (b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8);
+ *((uint16_t *)dst) = (b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8);
+ dst+=2;
+ s++;
}
}
-void rgb32to15(const uint8_t *src, uint8_t *dst, uint32_t num_pixels)
+void rgb32to15(const uint8_t *src, uint8_t *dst, uint32_t srcsize)
{
- uint32_t i;
- for(i=0; i<num_pixels; i+=4)
+ const uint8_t *end,*s;
+ s = src;
+ end = s + srcsize;
+ while(s < end)
{
- const int b= src[i+0];
- const int g= src[i+1];
- const int r= src[i+2];
+ const int b= *s++;
+ const int g= *s++;
+ const int r= *s++;
- ((uint16_t *)dst)[i]= (b>>3) | ((g&0xF8)<<3) | ((r&0xF8)<<7);
+ *((uint16_t *)dst) = (b>>3) | ((g&0xF8)<<3) | ((r&0xF8)<<7);
+ dst+=2;
+ s++;
}
}
Index: rgb2rgb.h
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/rgb2rgb.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- rgb2rgb.h 5 Nov 2001 08:37:27 -0000 1.9
+++ rgb2rgb.h 5 Nov 2001 08:55:27 -0000 1.10
@@ -10,8 +10,8 @@
extern void rgb24to32(const uint8_t *src,uint8_t *dst,uint32_t src_size);
extern void rgb32to24(const uint8_t *src,uint8_t *dst,uint32_t src_size);
extern void rgb15to16(const uint8_t *src,uint8_t *dst,uint32_t src_size);
-extern void rgb32to16(const uint8_t *src,uint8_t *dst,uint32_t num_pixels);
-extern void rgb32to15(const uint8_t *src,uint8_t *dst,uint32_t num_pixels);
+extern void rgb32to16(const uint8_t *src,uint8_t *dst,uint32_t src_size);
+extern void rgb32to15(const uint8_t *src,uint8_t *dst,uint32_t src_size);
extern void palette8torgb32(const uint8_t *src, uint8_t *dst, uint32_t num_pixels, const uint8_t *palette);
extern void palette8torgb16(const uint8_t *src, uint8_t *dst, uint32_t num_pixels, const uint8_t *palette);
More information about the MPlayer-cvslog
mailing list