fixing memory overwrite bugs again ...
[libav.git] / postproc / rgb2rgb.h
CommitLineData
fcfbc150 1/*
b234ae81 2 *
b238eb2e 3 * rgb2rgb.h, Software RGB to RGB convertor
6611aa83
NK
4 * pluralize by Software PAL8 to RGB convertor
5 * Software YUV to YUV convertor
6 * Software YUV to RGB convertor
b234ae81
NK
7 */
8
9#ifndef RGB2RGB_INCLUDED
10#define RGB2RGB_INCLUDED
11
996e1a7c 12extern void rgb24to32(const uint8_t *src,uint8_t *dst,unsigned src_size);
0d9f3d85
A
13extern void rgb24to16(const uint8_t *src,uint8_t *dst,unsigned src_size);
14extern void rgb24to15(const uint8_t *src,uint8_t *dst,unsigned src_size);
996e1a7c 15extern void rgb32to24(const uint8_t *src,uint8_t *dst,unsigned src_size);
4aecdf91
NK
16extern void rgb32to16(const uint8_t *src,uint8_t *dst,unsigned src_size);
17extern void rgb32to15(const uint8_t *src,uint8_t *dst,unsigned src_size);
0d9f3d85
A
18extern void rgb15to16(const uint8_t *src,uint8_t *dst,unsigned src_size);
19extern void rgb15to24(const uint8_t *src,uint8_t *dst,unsigned src_size);
20extern void rgb15to32(const uint8_t *src,uint8_t *dst,unsigned src_size);
21extern void rgb16to24(const uint8_t *src,uint8_t *dst,unsigned src_size);
22extern void rgb16to32(const uint8_t *src,uint8_t *dst,unsigned src_size);
1b383194 23extern void rgb32tobgr32(const uint8_t *src, uint8_t *dst, unsigned src_size);
74d35835 24extern void rgb24tobgr24(const uint8_t *src, uint8_t *dst, unsigned src_size);
b234ae81 25
fcfbc150 26
996e1a7c
NK
27extern void palette8torgb32(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette);
28extern void palette8torgb16(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette);
29extern void palette8torgb15(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette);
30extern void palette8torgb24(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette);
31
42b5fcb8 32extern void yv12toyuy2(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
b1ec5875
MN
33 unsigned int width, unsigned int height,
34 unsigned int lumStride, unsigned int chromStride, unsigned int dstStride);
35extern void yuv422ptoyuy2(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
cfc15dc6
MN
36 unsigned int width, unsigned int height,
37 unsigned int lumStride, unsigned int chromStride, unsigned int dstStride);
dabcdbc4 38extern void yuy2toyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
cfc15dc6
MN
39 unsigned int width, unsigned int height,
40 unsigned int lumStride, unsigned int chromStride, unsigned int srcStride);
aa21f0c3
MN
41extern void rgb24toyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
42 unsigned int width, unsigned int height,
43 unsigned int lumStride, unsigned int chromStride, unsigned int srcStride);
b241cbf2 44extern void planar2x(const uint8_t *src, uint8_t *dst, int width, int height, int srcStride, int dstStride);
d9d58d17 45
5d55fdb4 46extern void interleaveBytes(uint8_t *src1, uint8_t *src2, uint8_t *dst,
0d9f3d85
A
47 unsigned width, unsigned height, unsigned src1Stride,
48 unsigned src2Stride, unsigned dstStride);
5d55fdb4
MN
49
50
6611aa83
NK
51#define MODE_RGB 0x1
52#define MODE_BGR 0x2
53
54typedef void (* yuv2rgb_fun) (uint8_t * image, uint8_t * py,
55 uint8_t * pu, uint8_t * pv,
0d9f3d85
A
56 unsigned h_size, unsigned v_size,
57 unsigned rgb_stride, unsigned y_stride, unsigned uv_stride);
6611aa83
NK
58
59extern yuv2rgb_fun yuv2rgb;
60
0d9f3d85 61void yuv2rgb_init (unsigned bpp, int mode);
6611aa83 62
b234ae81 63#endif