From 199e88d20ca58477842421c4961a8db3efe8b026 Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 4 Nov 2001 19:36:24 +0000 Subject: bgr32to16, bgr32to15 (needed for palette stuff) paletteto 32,16,15bgr all in c, will be optimized as soon as they are tested (assuming opt. is possible) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2695 b3059339-0415-0410-9bf9-f77b7e298cf2 --- postproc/rgb2rgb_template.c | 59 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) (limited to 'postproc/rgb2rgb_template.c') diff --git a/postproc/rgb2rgb_template.c b/postproc/rgb2rgb_template.c index 5fe94f04ed..f83d565dbb 100644 --- a/postproc/rgb2rgb_template.c +++ b/postproc/rgb2rgb_template.c @@ -1,4 +1,4 @@ -/* +/* * * rgb2rgb.c, Software RGB to RGB convertor * Written by Nick Kurshev. @@ -170,3 +170,60 @@ void rgb15to16(const uint8_t *src,uint8_t *dst,uint32_t src_size) } #endif } + +/** + * Pallete is assumed to contain bgr32 + */ +void palette8torgb32(uint8_t *src, uint8_t *dst, int src_size, uint8_t *palette) +{ + int i; + for(i=0; i>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8); + } +} + +void rgb32to15(uint8_t *src, uint8_t *dst, int src_size) +{ + int i; + for(i=0; i>3) | ((g&0xF8)<<3) | ((r&0xF8)<<7); + } +} + + +/** + * Palette is assumed to contain bgr16, see rgb32to16 to convert the palette + */ +void palette8torgb16(uint8_t *src, uint8_t *dst, int src_size, uint8_t *palette) +{ + int i; + for(i=0; i