diff options
Diffstat (limited to 'postproc/rgb2rgb.c')
-rw-r--r-- | postproc/rgb2rgb.c | 159 |
1 files changed, 80 insertions, 79 deletions
diff --git a/postproc/rgb2rgb.c b/postproc/rgb2rgb.c index fc87b9c02c..c9af67e74c 100644 --- a/postproc/rgb2rgb.c +++ b/postproc/rgb2rgb.c @@ -18,56 +18,57 @@ #define FAST_BGR2YV12 // use 7 bit coeffs instead of 15bit -void (*rgb24to32)(const uint8_t *src,uint8_t *dst,unsigned src_size); -void (*rgb24to16)(const uint8_t *src,uint8_t *dst,unsigned src_size); -void (*rgb24to15)(const uint8_t *src,uint8_t *dst,unsigned src_size); -void (*rgb32to24)(const uint8_t *src,uint8_t *dst,unsigned src_size); -void (*rgb32to16)(const uint8_t *src,uint8_t *dst,unsigned src_size); -void (*rgb32to15)(const uint8_t *src,uint8_t *dst,unsigned src_size); -void (*rgb15to16)(const uint8_t *src,uint8_t *dst,unsigned src_size); -void (*rgb15to24)(const uint8_t *src,uint8_t *dst,unsigned src_size); -void (*rgb15to32)(const uint8_t *src,uint8_t *dst,unsigned src_size); -void (*rgb16to15)(const uint8_t *src,uint8_t *dst,unsigned src_size); -void (*rgb16to24)(const uint8_t *src,uint8_t *dst,unsigned src_size); -void (*rgb16to32)(const uint8_t *src,uint8_t *dst,unsigned src_size); -//void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, unsigned src_size); -void (*rgb24tobgr24)(const uint8_t *src, uint8_t *dst, unsigned src_size); -void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, unsigned src_size); -void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, unsigned src_size); -void (*rgb32tobgr32)(const uint8_t *src, uint8_t *dst, unsigned src_size); -//void (*rgb32tobgr24)(const uint8_t *src, uint8_t *dst, unsigned src_size); -void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, unsigned src_size); -void (*rgb32tobgr15)(const uint8_t *src, uint8_t *dst, unsigned src_size); +void (*rgb24to32)(const uint8_t *src,uint8_t *dst,long src_size); +void (*rgb24to16)(const uint8_t *src,uint8_t *dst,long src_size); +void (*rgb24to15)(const uint8_t *src,uint8_t *dst,long src_size); +void (*rgb32to24)(const uint8_t *src,uint8_t *dst,long src_size); +void (*rgb32to16)(const uint8_t *src,uint8_t *dst,long src_size); +void (*rgb32to15)(const uint8_t *src,uint8_t *dst,long src_size); +void (*rgb15to16)(const uint8_t *src,uint8_t *dst,long src_size); +void (*rgb15to24)(const uint8_t *src,uint8_t *dst,long src_size); +void (*rgb15to32)(const uint8_t *src,uint8_t *dst,long src_size); +void (*rgb16to15)(const uint8_t *src,uint8_t *dst,long src_size); +void (*rgb16to24)(const uint8_t *src,uint8_t *dst,long src_size); +void (*rgb16to32)(const uint8_t *src,uint8_t *dst,long src_size); +//void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long src_size); +void (*rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long src_size); +void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long src_size); +void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long src_size); +void (*rgb32tobgr32)(const uint8_t *src, uint8_t *dst, long src_size); +//void (*rgb32tobgr24)(const uint8_t *src, uint8_t *dst, long src_size); +void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long src_size); +void (*rgb32tobgr15)(const uint8_t *src, uint8_t *dst, long src_size); void (*yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, - unsigned int width, unsigned int height, - int lumStride, int chromStride, int dstStride); + long width, long height, + long lumStride, long chromStride, long dstStride); void (*yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, - unsigned int width, unsigned int height, - int lumStride, int chromStride, int dstStride); + long width, long height, + long lumStride, long chromStride, long dstStride); void (*yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, - unsigned int width, unsigned int height, - int lumStride, int chromStride, int dstStride); + long width, long height, + long lumStride, long chromStride, long dstStride); void (*yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, - unsigned int width, unsigned int height, - int lumStride, int chromStride, int srcStride); + long width, long height, + long lumStride, long chromStride, long srcStride); void (*rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, - unsigned int width, unsigned int height, - int lumStride, int chromStride, int srcStride); -void (*planar2x)(const uint8_t *src, uint8_t *dst, int width, int height, int srcStride, int dstStride); + long width, long height, + long lumStride, long chromStride, long srcStride); +void (*planar2x)(const uint8_t *src, uint8_t *dst, long width, long height, + long srcStride, long dstStride); void (*interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dst, - unsigned width, unsigned height, int src1Stride, - int src2Stride, int dstStride); + long width, long height, long src1Stride, + long src2Stride, long dstStride); void (*vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst1, uint8_t *dst2, - unsigned width, unsigned height, - int srcStride1, int srcStride2, - int dstStride1, int dstStride2); + long width, long height, + long srcStride1, long srcStride2, + long dstStride1, long dstStride2); void (*yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, uint8_t *dst, - unsigned width, unsigned height, - int srcStride1, int srcStride2, - int srcStride3, int dstStride); + long width, long height, + long srcStride1, long srcStride2, + long srcStride3, long dstStride); #if defined(ARCH_X86) || defined(ARCH_X86_64) static const uint64_t mmx_null __attribute__((aligned(8))) = 0x0000000000000000ULL; @@ -321,9 +322,9 @@ void sws_rgb2rgb_init(int flags){ /** * Pallete is assumed to contain bgr32 */ -void palette8torgb32(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette) +void palette8torgb32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette) { - unsigned i; + long i; /* for(i=0; i<num_pixels; i++) @@ -347,9 +348,9 @@ void palette8torgb32(const uint8_t *src, uint8_t *dst, unsigned num_pixels, cons } } -void palette8tobgr32(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette) +void palette8tobgr32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette) { - unsigned i; + long i; for(i=0; i<num_pixels; i++) { #ifdef WORDS_BIGENDIAN @@ -371,9 +372,9 @@ void palette8tobgr32(const uint8_t *src, uint8_t *dst, unsigned num_pixels, cons /** * Pallete is assumed to contain bgr32 */ -void palette8torgb24(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette) +void palette8torgb24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette) { - unsigned i; + long i; /* writes 1 byte o much and might cause alignment issues on some architectures? for(i=0; i<num_pixels; i++) @@ -389,9 +390,9 @@ void palette8torgb24(const uint8_t *src, uint8_t *dst, unsigned num_pixels, cons } } -void palette8tobgr24(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette) +void palette8tobgr24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette) { - unsigned i; + long i; /* writes 1 byte o much and might cause alignment issues on some architectures? for(i=0; i<num_pixels; i++) @@ -410,15 +411,15 @@ void palette8tobgr24(const uint8_t *src, uint8_t *dst, unsigned num_pixels, cons /** * Palette is assumed to contain bgr16, see rgb32to16 to convert the palette */ -void palette8torgb16(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette) +void palette8torgb16(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette) { - unsigned i; + long i; for(i=0; i<num_pixels; i++) ((uint16_t *)dst)[i] = ((uint16_t *)palette)[ src[i] ]; } -void palette8tobgr16(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette) +void palette8tobgr16(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette) { - unsigned i; + long i; for(i=0; i<num_pixels; i++) ((uint16_t *)dst)[i] = bswap_16(((uint16_t *)palette)[ src[i] ]); } @@ -426,23 +427,23 @@ void palette8tobgr16(const uint8_t *src, uint8_t *dst, unsigned num_pixels, cons /** * Pallete is assumed to contain bgr15, see rgb32to15 to convert the palette */ -void palette8torgb15(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette) +void palette8torgb15(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette) { - unsigned i; + long i; for(i=0; i<num_pixels; i++) ((uint16_t *)dst)[i] = ((uint16_t *)palette)[ src[i] ]; } -void palette8tobgr15(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette) +void palette8tobgr15(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette) { - unsigned i; + long i; for(i=0; i<num_pixels; i++) ((uint16_t *)dst)[i] = bswap_16(((uint16_t *)palette)[ src[i] ]); } -void rgb32tobgr24(const uint8_t *src, uint8_t *dst, unsigned int src_size) +void rgb32tobgr24(const uint8_t *src, uint8_t *dst, long src_size) { - unsigned i; - unsigned num_pixels = src_size >> 2; + long i; + long num_pixels = src_size >> 2; for(i=0; i<num_pixels; i++) { dst[3*i + 0] = src[4*i + 2]; @@ -451,9 +452,9 @@ void rgb32tobgr24(const uint8_t *src, uint8_t *dst, unsigned int src_size) } } -void rgb24tobgr32(const uint8_t *src, uint8_t *dst, unsigned int src_size) +void rgb24tobgr32(const uint8_t *src, uint8_t *dst, long src_size) { - unsigned i; + long i; for(i=0; 3*i<src_size; i++) { dst[4*i + 0] = src[3*i + 2]; @@ -463,7 +464,7 @@ void rgb24tobgr32(const uint8_t *src, uint8_t *dst, unsigned int src_size) } } -void rgb16tobgr32(const uint8_t *src, uint8_t *dst, unsigned int src_size) +void rgb16tobgr32(const uint8_t *src, uint8_t *dst, long src_size) { const uint16_t *end; uint8_t *d = (uint8_t *)dst; @@ -480,7 +481,7 @@ void rgb16tobgr32(const uint8_t *src, uint8_t *dst, unsigned int src_size) } } -void rgb16tobgr24(const uint8_t *src, uint8_t *dst, unsigned int src_size) +void rgb16tobgr24(const uint8_t *src, uint8_t *dst, long src_size) { const uint16_t *end; uint8_t *d = (uint8_t *)dst; @@ -496,10 +497,10 @@ void rgb16tobgr24(const uint8_t *src, uint8_t *dst, unsigned int src_size) } } -void rgb16tobgr16(const uint8_t *src, uint8_t *dst, unsigned int src_size) +void rgb16tobgr16(const uint8_t *src, uint8_t *dst, long src_size) { - unsigned i; - unsigned num_pixels = src_size >> 1; + long i; + long num_pixels = src_size >> 1; for(i=0; i<num_pixels; i++) { @@ -513,10 +514,10 @@ void rgb16tobgr16(const uint8_t *src, uint8_t *dst, unsigned int src_size) } } -void rgb16tobgr15(const uint8_t *src, uint8_t *dst, unsigned int src_size) +void rgb16tobgr15(const uint8_t *src, uint8_t *dst, long src_size) { - unsigned i; - unsigned num_pixels = src_size >> 1; + long i; + long num_pixels = src_size >> 1; for(i=0; i<num_pixels; i++) { @@ -530,7 +531,7 @@ void rgb16tobgr15(const uint8_t *src, uint8_t *dst, unsigned int src_size) } } -void rgb15tobgr32(const uint8_t *src, uint8_t *dst, unsigned int src_size) +void rgb15tobgr32(const uint8_t *src, uint8_t *dst, long src_size) { const uint16_t *end; uint8_t *d = (uint8_t *)dst; @@ -547,7 +548,7 @@ void rgb15tobgr32(const uint8_t *src, uint8_t *dst, unsigned int src_size) } } -void rgb15tobgr24(const uint8_t *src, uint8_t *dst, unsigned int src_size) +void rgb15tobgr24(const uint8_t *src, uint8_t *dst, long src_size) { const uint16_t *end; uint8_t *d = (uint8_t *)dst; @@ -563,10 +564,10 @@ void rgb15tobgr24(const uint8_t *src, uint8_t *dst, unsigned int src_size) } } -void rgb15tobgr16(const uint8_t *src, uint8_t *dst, unsigned int src_size) +void rgb15tobgr16(const uint8_t *src, uint8_t *dst, long src_size) { - unsigned i; - unsigned num_pixels = src_size >> 1; + long i; + long num_pixels = src_size >> 1; for(i=0; i<num_pixels; i++) { @@ -580,10 +581,10 @@ void rgb15tobgr16(const uint8_t *src, uint8_t *dst, unsigned int src_size) } } -void rgb15tobgr15(const uint8_t *src, uint8_t *dst, unsigned int src_size) +void rgb15tobgr15(const uint8_t *src, uint8_t *dst, long src_size) { - unsigned i; - unsigned num_pixels = src_size >> 1; + long i; + long num_pixels = src_size >> 1; for(i=0; i<num_pixels; i++) { @@ -597,10 +598,10 @@ void rgb15tobgr15(const uint8_t *src, uint8_t *dst, unsigned int src_size) } } -void rgb8tobgr8(const uint8_t *src, uint8_t *dst, unsigned int src_size) +void rgb8tobgr8(const uint8_t *src, uint8_t *dst, long src_size) { - unsigned i; - unsigned num_pixels = src_size; + long i; + long num_pixels = src_size; for(i=0; i<num_pixels; i++) { unsigned b,g,r; |