Libav
|
00001 /* 00002 * software RGB to RGB converter 00003 * pluralize by Software PAL8 to RGB converter 00004 * Software YUV to YUV converter 00005 * Software YUV to RGB converter 00006 * Written by Nick Kurshev. 00007 * YUV & runtime CPU stuff by Michael (michaelni@gmx.at) 00008 * 00009 * This file is part of FFmpeg. 00010 * 00011 * FFmpeg is free software; you can redistribute it and/or 00012 * modify it under the terms of the GNU Lesser General Public 00013 * License as published by the Free Software Foundation; either 00014 * version 2.1 of the License, or (at your option) any later version. 00015 * 00016 * FFmpeg is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 * Lesser General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Lesser General Public 00022 * License along with FFmpeg; if not, write to the Free Software 00023 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00024 */ 00025 00026 #ifndef SWSCALE_RGB2RGB_H 00027 #define SWSCALE_RGB2RGB_H 00028 00029 #include <inttypes.h> 00030 00031 #include "libswscale/swscale.h" 00032 #include "libavutil/avutil.h" 00033 00034 /* A full collection of RGB to RGB(BGR) converters */ 00035 extern void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long src_size); 00036 extern void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long src_size); 00037 extern void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long src_size); 00038 extern void (*rgb32tobgr24)(const uint8_t *src, uint8_t *dst, long src_size); 00039 extern void (*rgb32to16) (const uint8_t *src, uint8_t *dst, long src_size); 00040 extern void (*rgb32to15) (const uint8_t *src, uint8_t *dst, long src_size); 00041 extern void (*rgb15to16) (const uint8_t *src, uint8_t *dst, long src_size); 00042 extern void (*rgb15tobgr24)(const uint8_t *src, uint8_t *dst, long src_size); 00043 extern void (*rgb15to32) (const uint8_t *src, uint8_t *dst, long src_size); 00044 extern void (*rgb16to15) (const uint8_t *src, uint8_t *dst, long src_size); 00045 extern void (*rgb16tobgr24)(const uint8_t *src, uint8_t *dst, long src_size); 00046 extern void (*rgb16to32) (const uint8_t *src, uint8_t *dst, long src_size); 00047 extern void (*rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long src_size); 00048 extern void (*rgb24to16) (const uint8_t *src, uint8_t *dst, long src_size); 00049 extern void (*rgb24to15) (const uint8_t *src, uint8_t *dst, long src_size); 00050 extern void (*rgb32tobgr32)(const uint8_t *src, uint8_t *dst, long src_size); 00051 extern void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long src_size); 00052 extern void (*rgb32tobgr15)(const uint8_t *src, uint8_t *dst, long src_size); 00053 00054 void rgb24to32 (const uint8_t *src, uint8_t *dst, long src_size); 00055 void rgb32to24 (const uint8_t *src, uint8_t *dst, long src_size); 00056 void rgb16tobgr32(const uint8_t *src, uint8_t *dst, long src_size); 00057 void rgb16to24 (const uint8_t *src, uint8_t *dst, long src_size); 00058 void rgb16tobgr16(const uint8_t *src, uint8_t *dst, long src_size); 00059 void rgb16tobgr15(const uint8_t *src, uint8_t *dst, long src_size); 00060 void rgb15tobgr32(const uint8_t *src, uint8_t *dst, long src_size); 00061 void rgb15to24 (const uint8_t *src, uint8_t *dst, long src_size); 00062 void rgb15tobgr16(const uint8_t *src, uint8_t *dst, long src_size); 00063 void rgb15tobgr15(const uint8_t *src, uint8_t *dst, long src_size); 00064 void bgr8torgb8 (const uint8_t *src, uint8_t *dst, long src_size); 00065 00066 void shuffle_bytes_0321(const uint8_t *src, uint8_t *dst, long src_size); 00067 void shuffle_bytes_1230(const uint8_t *src, uint8_t *dst, long src_size); 00068 void shuffle_bytes_2103(const uint8_t *src, uint8_t *dst, long src_size); 00069 void shuffle_bytes_3012(const uint8_t *src, uint8_t *dst, long src_size); 00070 void shuffle_bytes_3210(const uint8_t *src, uint8_t *dst, long src_size); 00071 00072 #if LIBSWSCALE_VERSION_MAJOR < 1 00073 /* deprecated, use the public versions in swscale.h */ 00074 attribute_deprecated void palette8topacked32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette); 00075 attribute_deprecated void palette8topacked24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette); 00076 00077 /* totally deprecated, please fix code that uses this */ 00078 attribute_deprecated void palette8torgb16(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette); 00079 attribute_deprecated void palette8tobgr16(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette); 00080 #endif 00081 00088 //void uyvytoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, 00089 00094 extern void (*yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, 00095 long width, long height, 00096 long lumStride, long chromStride, long dstStride); 00097 00101 extern void (*yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, 00102 long width, long height, 00103 long lumStride, long chromStride, long dstStride); 00104 00109 extern void (*yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, 00110 long width, long height, 00111 long lumStride, long chromStride, long srcStride); 00112 00117 extern void (*yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, 00118 long width, long height, 00119 long lumStride, long chromStride, long dstStride); 00120 00124 extern void (*yuv422ptouyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, 00125 long width, long height, 00126 long lumStride, long chromStride, long dstStride); 00127 00134 extern void (*rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, 00135 long width, long height, 00136 long lumStride, long chromStride, long srcStride); 00137 extern void (*planar2x)(const uint8_t *src, uint8_t *dst, long width, long height, 00138 long srcStride, long dstStride); 00139 00140 extern void (*interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst, 00141 long width, long height, long src1Stride, 00142 long src2Stride, long dstStride); 00143 00144 extern void (*vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2, 00145 uint8_t *dst1, uint8_t *dst2, 00146 long width, long height, 00147 long srcStride1, long srcStride2, 00148 long dstStride1, long dstStride2); 00149 00150 extern void (*yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, 00151 uint8_t *dst, 00152 long width, long height, 00153 long srcStride1, long srcStride2, 00154 long srcStride3, long dstStride); 00155 00156 00157 extern void (*uyvytoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, 00158 long width, long height, 00159 long lumStride, long chromStride, long srcStride); 00160 extern void (*uyvytoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, 00161 long width, long height, 00162 long lumStride, long chromStride, long srcStride); 00163 extern void (*yuyvtoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, 00164 long width, long height, 00165 long lumStride, long chromStride, long srcStride); 00166 extern void (*yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, 00167 long width, long height, 00168 long lumStride, long chromStride, long srcStride); 00169 00170 void sws_rgb2rgb_init(int flags); 00171 00172 #endif /* SWSCALE_RGB2RGB_H */