From f5d935298609b3530f0e274033d264d8da20cd42 Mon Sep 17 00:00:00 2001 From: nick Date: Mon, 5 Nov 2001 17:46:20 +0000 Subject: [PATCH] Fixed rgb32(24)to16 stuff, rgb32(24)to15 is still broken git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2720 b3059339-0415-0410-9bf9-f77b7e298cf2 --- postproc/rgb2rgb.c | 28 ++++++++++++++++------------ postproc/rgb2rgb_template.c | 28 ++++++++++++++++------------ 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/postproc/rgb2rgb.c b/postproc/rgb2rgb.c index 19fa7faca0..5779bf5e30 100644 --- a/postproc/rgb2rgb.c +++ b/postproc/rgb2rgb.c @@ -216,53 +216,57 @@ void palette8torgb24(const uint8_t *src, uint8_t *dst, unsigned num_pixels, cons void rgb32to16(const uint8_t *src, uint8_t *dst, unsigned src_size) { - unsigned i,num_pixels=src_size/4; - for(i=0; i>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8); + d[j]= (b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8); } } void rgb32to15(const uint8_t *src, uint8_t *dst, unsigned src_size) { - unsigned i,num_pixels=src_size/4; - for(i=0; i>3) | ((g&0xF8)<<3) | ((r&0xF8)<<7); + d[j]= (b>>3) | ((g&0xF8)<<3) | ((r&0xF8)<<7); } } void rgb24to16(const uint8_t *src, uint8_t *dst, unsigned src_size) { - unsigned i,num_pixels=src_size/3; - for(i=0; i>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8); + d[j]= (b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8); } } void rgb24to15(const uint8_t *src, uint8_t *dst, unsigned src_size) { - unsigned i,num_pixels=src_size/3; - for(i=0; i>3) | ((g&0xF8)<<3) | ((r&0xF8)<<7); + d[j]= (b>>3) | ((g&0xF8)<<3) | ((r&0xF8)<<7); } } diff --git a/postproc/rgb2rgb_template.c b/postproc/rgb2rgb_template.c index 19fa7faca0..5779bf5e30 100644 --- a/postproc/rgb2rgb_template.c +++ b/postproc/rgb2rgb_template.c @@ -216,53 +216,57 @@ void palette8torgb24(const uint8_t *src, uint8_t *dst, unsigned num_pixels, cons void rgb32to16(const uint8_t *src, uint8_t *dst, unsigned src_size) { - unsigned i,num_pixels=src_size/4; - for(i=0; i>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8); + d[j]= (b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8); } } void rgb32to15(const uint8_t *src, uint8_t *dst, unsigned src_size) { - unsigned i,num_pixels=src_size/4; - for(i=0; i>3) | ((g&0xF8)<<3) | ((r&0xF8)<<7); + d[j]= (b>>3) | ((g&0xF8)<<3) | ((r&0xF8)<<7); } } void rgb24to16(const uint8_t *src, uint8_t *dst, unsigned src_size) { - unsigned i,num_pixels=src_size/3; - for(i=0; i>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8); + d[j]= (b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8); } } void rgb24to15(const uint8_t *src, uint8_t *dst, unsigned src_size) { - unsigned i,num_pixels=src_size/3; - for(i=0; i>3) | ((g&0xF8)<<3) | ((r&0xF8)<<7); + d[j]= (b>>3) | ((g&0xF8)<<3) | ((r&0xF8)<<7); } }