Commit a354926f authored by michael's avatar michael

palette to bgr24


git-svn-id: file:///var/local/repositories/mplayer/trunk/postproc@2698 b3059339-0415-0410-9bf9-f77b7e298cf2
parent 3f6775bd
......@@ -181,6 +181,27 @@ void palette8torgb32(uint8_t *src, uint8_t *dst, int src_size, uint8_t *palette)
((uint32_t *)dst)[i] = ((uint32_t *)palette)[ src[i] ];
}
/**
* Pallete is assumed to contain bgr32
*/
void palette8torgb24(uint8_t *src, uint8_t *dst, int src_size, uint8_t *palette)
{
int i;
/*
writes 1 byte o much and might cause alignment issues on some architectures?
for(i=0; i<src_size; i++)
((uint32_t *)(&dst[i*3])) = ((uint32_t *)palette)[ src[i] ];
*/
for(i=0; i<src_size; i++)
{
//FIXME slow?
dst[0]= palette[ src[i]*4+0 ];
dst[1]= palette[ src[i]*4+1 ];
dst[2]= palette[ src[i]*4+2 ];
dst+= 3;
}
}
void rgb32to16(uint8_t *src, uint8_t *dst, int src_size)
{
int i;
......@@ -226,4 +247,4 @@ void palette8torgb15(uint8_t *src, uint8_t *dst, int src_size, uint8_t *palette)
int i;
for(i=0; i<src_size; i++)
((uint16_t *)dst)[i] = ((uint16_t *)palette)[ src[i] ];
}
\ No newline at end of file
}
......@@ -16,6 +16,6 @@ void rgb32to15(uint8_t *src, uint8_t *dst, int src_size);
void palette8torgb32(uint8_t *src, uint8_t *dst, int src_size, uint8_t *palette);
void palette8torgb16(uint8_t *src, uint8_t *dst, int src_size, uint8_t *palette);
void palette8torgb15(uint8_t *src, uint8_t *dst, int src_size, uint8_t *palette);
void palette8torgb24(uint8_t *src, uint8_t *dst, int src_size, uint8_t *palette);
#endif
......@@ -181,6 +181,27 @@ void palette8torgb32(uint8_t *src, uint8_t *dst, int src_size, uint8_t *palette)
((uint32_t *)dst)[i] = ((uint32_t *)palette)[ src[i] ];
}
/**
* Pallete is assumed to contain bgr32
*/
void palette8torgb24(uint8_t *src, uint8_t *dst, int src_size, uint8_t *palette)
{
int i;
/*
writes 1 byte o much and might cause alignment issues on some architectures?
for(i=0; i<src_size; i++)
((uint32_t *)(&dst[i*3])) = ((uint32_t *)palette)[ src[i] ];
*/
for(i=0; i<src_size; i++)
{
//FIXME slow?
dst[0]= palette[ src[i]*4+0 ];
dst[1]= palette[ src[i]*4+1 ];
dst[2]= palette[ src[i]*4+2 ];
dst+= 3;
}
}
void rgb32to16(uint8_t *src, uint8_t *dst, int src_size)
{
int i;
......@@ -226,4 +247,4 @@ void palette8torgb15(uint8_t *src, uint8_t *dst, int src_size, uint8_t *palette)
int i;
for(i=0; i<src_size; i++)
((uint16_t *)dst)[i] = ((uint16_t *)palette)[ src[i] ];
}
\ No newline at end of file
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment