libswscale/rgb2rgb.h
fcfbc150
 /*
8a322796
  *  software RGB to RGB converter
  *  pluralize by Software PAL8 to RGB converter
  *               Software YUV to YUV converter
  *               Software YUV to RGB converter
2111440a
  *  Written by Nick Kurshev.
2b991422
  *  YUV & runtime CPU stuff by Michael (michaelni@gmx.at)
2111440a
  *
d026b45e
  * This file is part of FFmpeg.
  *
807e0c66
  * FFmpeg is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
2111440a
  *
d026b45e
  * FFmpeg is distributed in the hope that it will be useful,
2111440a
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
807e0c66
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
2111440a
  *
807e0c66
  * You should have received a copy of the GNU Lesser General Public
  * License along with FFmpeg; if not, write to the Free Software
b19bcbaa
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
b234ae81
  */
 
0eaf5235
 #ifndef SWSCALE_RGB2RGB_H
 #define SWSCALE_RGB2RGB_H
b234ae81
 
064cd7a8
 #include <inttypes.h>
 
2b991422
 #include "libswscale/swscale.h"
 #include "libavutil/avutil.h"
 
8a322796
 /* A full collection of RGB to RGB(BGR) converters */
b8e89339
 extern void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, int src_size);
 extern void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, int src_size);
 extern void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, int src_size);
 extern void (*rgb32tobgr24)(const uint8_t *src, uint8_t *dst, int src_size);
83890c66
 extern void    (*rgb32to16)(const uint8_t *src, uint8_t *dst, int src_size);
 extern void    (*rgb32to15)(const uint8_t *src, uint8_t *dst, int src_size);
 extern void    (*rgb15to16)(const uint8_t *src, uint8_t *dst, int src_size);
b8e89339
 extern void (*rgb15tobgr24)(const uint8_t *src, uint8_t *dst, int src_size);
83890c66
 extern void    (*rgb15to32)(const uint8_t *src, uint8_t *dst, int src_size);
 extern void    (*rgb16to15)(const uint8_t *src, uint8_t *dst, int src_size);
b8e89339
 extern void (*rgb16tobgr24)(const uint8_t *src, uint8_t *dst, int src_size);
83890c66
 extern void    (*rgb16to32)(const uint8_t *src, uint8_t *dst, int src_size);
b8e89339
 extern void (*rgb24tobgr24)(const uint8_t *src, uint8_t *dst, int src_size);
83890c66
 extern void    (*rgb24to16)(const uint8_t *src, uint8_t *dst, int src_size);
 extern void    (*rgb24to15)(const uint8_t *src, uint8_t *dst, int src_size);
b8e89339
 extern void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, int src_size);
 extern void (*rgb32tobgr15)(const uint8_t *src, uint8_t *dst, int src_size);
 
83890c66
 extern void (*shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, int src_size);
 
 void    rgb24to32(const uint8_t *src, uint8_t *dst, int src_size);
 void    rgb32to24(const uint8_t *src, uint8_t *dst, int src_size);
b8e89339
 void rgb16tobgr32(const uint8_t *src, uint8_t *dst, int src_size);
83890c66
 void    rgb16to24(const uint8_t *src, uint8_t *dst, int src_size);
b8e89339
 void rgb16tobgr16(const uint8_t *src, uint8_t *dst, int src_size);
 void rgb16tobgr15(const uint8_t *src, uint8_t *dst, int src_size);
 void rgb15tobgr32(const uint8_t *src, uint8_t *dst, int src_size);
83890c66
 void    rgb15to24(const uint8_t *src, uint8_t *dst, int src_size);
b8e89339
 void rgb15tobgr16(const uint8_t *src, uint8_t *dst, int src_size);
 void rgb15tobgr15(const uint8_t *src, uint8_t *dst, int src_size);
4ad40d6d
 void rgb12tobgr12(const uint8_t *src, uint8_t *dst, int src_size);
0cc1a86d
 void    rgb12to15(const uint8_t *src, uint8_t *dst, int src_size);
b8e89339
 
 void shuffle_bytes_0321(const uint8_t *src, uint8_t *dst, int src_size);
 void shuffle_bytes_1230(const uint8_t *src, uint8_t *dst, int src_size);
 void shuffle_bytes_3012(const uint8_t *src, uint8_t *dst, int src_size);
 void shuffle_bytes_3210(const uint8_t *src, uint8_t *dst, int src_size);
7f526efd
 
7dc303a6
 void rgb24toyv12_c(const uint8_t *src, uint8_t *ydst, uint8_t *udst,
b8e89339
                    uint8_t *vdst, int width, int height, int lumStride,
                    int chromStride, int srcStride);
700490a4
 
 /**
8a322796
  * Height should be a multiple of 2 and width should be a multiple of 16.
  * (If this is a problem for anyone then tell me, and I will fix it.)
700490a4
  */
 extern void (*yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
b8e89339
                           int width, int height,
                           int lumStride, int chromStride, int dstStride);
700490a4
 
 /**
8a322796
  * Width should be a multiple of 16.
700490a4
  */
 extern void (*yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
b8e89339
                              int width, int height,
                              int lumStride, int chromStride, int dstStride);
700490a4
 
 /**
8a322796
  * Height should be a multiple of 2 and width should be a multiple of 16.
  * (If this is a problem for anyone then tell me, and I will fix it.)
700490a4
  */
 extern void (*yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
b8e89339
                           int width, int height,
                           int lumStride, int chromStride, int srcStride);
700490a4
 
 /**
8a322796
  * Height should be a multiple of 2 and width should be a multiple of 16.
  * (If this is a problem for anyone then tell me, and I will fix it.)
2549c2bc
  */
 extern void (*yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
b8e89339
                           int width, int height,
                           int lumStride, int chromStride, int dstStride);
2549c2bc
 
 /**
58f0ec5f
  * Width should be a multiple of 16.
a6100f39
  */
 extern void (*yuv422ptouyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
b8e89339
                              int width, int height,
                              int lumStride, int chromStride, int dstStride);
a6100f39
 
 /**
8a322796
  * Height should be a multiple of 2 and width should be a multiple of 2.
  * (If this is a problem for anyone then tell me, and I will fix it.)
  * Chrominance data is only taken from every second line, others are ignored.
58f0ec5f
  * FIXME: Write high quality version.
700490a4
  */
 extern void (*rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
b8e89339
                            int width, int height,
                            int lumStride, int chromStride, int srcStride);
 extern void (*planar2x)(const uint8_t *src, uint8_t *dst, int width, int height,
                         int srcStride, int dstStride);
d9d58d17
 
a959e247
 extern void (*interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst,
b8e89339
                                int width, int height, int src1Stride,
                                int src2Stride, int dstStride);
ac4d0aea
 
700490a4
 extern void (*vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
6e42e6c4
                            uint8_t *dst1, uint8_t *dst2,
b8e89339
                            int width, int height,
                            int srcStride1, int srcStride2,
                            int dstStride1, int dstStride2);
ac4d0aea
 
700490a4
 extern void (*yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint8_t *src3,
6e42e6c4
                             uint8_t *dst,
b8e89339
                             int width, int height,
                             int srcStride1, int srcStride2,
                             int srcStride3, int dstStride);
6a4970ab
 
0411072e
 extern void (*uyvytoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
b8e89339
                             int width, int height,
                             int lumStride, int chromStride, int srcStride);
0411072e
 extern void (*uyvytoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
b8e89339
                             int width, int height,
                             int lumStride, int chromStride, int srcStride);
0411072e
 extern void (*yuyvtoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
b8e89339
                             int width, int height,
                             int lumStride, int chromStride, int srcStride);
0411072e
 extern void (*yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
b8e89339
                             int width, int height,
                             int lumStride, int chromStride, int srcStride);
0411072e
 
e66149e7
 void sws_rgb2rgb_init(void);
35ca9454
 
e66149e7
 void rgb2rgb_init_x86(void);
d1adad3c
 
0eaf5235
 #endif /* SWSCALE_RGB2RGB_H */