Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members
xvidInterface.h
00001 /*********************************************************************** 00002 * * 00003 * ViTooKi * 00004 * * 00005 * title: xvidInterface.h * 00006 * * 00007 * * 00008 * * 00009 * ITEC institute of the University of Klagenfurt (Austria) * 00010 * http://www.itec.uni-klu.ac.at * 00011 * * 00012 * * 00013 * For more information visit the ViTooKi homepage: * 00014 * http://ViTooKi.sourceforge.net * 00015 * vitooki-user@lists.sourceforge.net * 00016 * vitooki-devel@lists.sourceforge.net * 00017 * * 00018 * This file is part of ViTooKi, a free video toolkit. * 00019 * ViTooKi is free software; you can redistribute it and/or * 00020 * modify it under the terms of the GNU General Public License * 00021 * as published by the Free Software Foundation; either version 2 * 00022 * of the License, or (at your option) any later version. * 00023 * * 00024 * This program is distributed in the hope that it will be useful, * 00025 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00026 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00027 * GNU General Public License for more details. * 00028 * * 00029 * You should have received a copy of the GNU General Public License * 00030 * along with this program; if not, write to the Free Software * 00031 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, * 00032 * MA 02111-1307, USA. * 00033 * * 00034 ***********************************************************************/ 00035 00036 /*********************************************************************** 00037 * * 00038 * REVISION HISTORY: * 00039 * * 00040 * * 00041 * * 00042 ***********************************************************************/ 00043 00044 #ifndef XVID_INTERFACE_H 00045 #define XVID_INTERFACE_H 00046 00047 00048 00049 #ifdef WINCE 00050 //for xvid on windows ce 00051 #define EDGE_SIZE 16 00052 #endif 00053 00054 00055 #ifdef __cplusplus 00056 extern "C" { 00057 #endif 00058 00059 //take care! copied from global.hpp !!! 00060 #define MAX_FRAME_SIZE 65536*8 //512KByte per frame 00061 #define ERR_OK 0 00062 #define ERR -1 00063 #define ERR_FILE -500 00064 00065 00076 /* 00077 defined colorspaces in XVID: 00078 #define XVID_CSP_PLANAR (1<< 0) //4:2:0 planar (==I420, except for pointers/strides) 00079 #define XVID_CSP_USER XVID_CSP_PLANAR 00080 #define XVID_CSP_I420 (1<< 1) //4:2:0 planar 00081 #define XVID_CSP_YV12 (1<< 2) //4:2:0 planar 00082 #define XVID_CSP_YUY2 (1<< 3) //4:2:2 packed 00083 #define XVID_CSP_UYVY (1<< 4) //4:2:2 packed 00084 #define XVID_CSP_YVYU (1<< 5) //4:2:2 packed 00085 #define XVID_CSP_BGRA (1<< 6) //32-bit bgra packed 00086 #define XVID_CSP_ABGR (1<< 7) //32-bit abgr packed 00087 #define XVID_CSP_RGBA (1<< 8) //32-bit rgba packed 00088 #define XVID_CSP_ARGB (1<<15) //32-bit argb packed 00089 #define XVID_CSP_BGR (1<< 9) //24-bit bgr packed 00090 #define XVID_CSP_RGB555 (1<<10) //16-bit rgb555 packed 00091 #define XVID_CSP_RGB565 (1<<11) //16-bit rgb565 packed 00092 #define XVID_CSP_SLICE (1<<12) //decoder only: 4:2:0 planar, per slice rendering 00093 #define XVID_CSP_INTERNAL (1<<13) //decoder only: 4:2:0 planar, returns ptrs to internal buffers 00094 #define XVID_CSP_NULL (1<<14) //decoder only: dont output anything 00095 #define XVID_CSP_VFLIP (1<<31) //vertical flip mask 00096 */ 00097 00098 typedef enum XVIDenumColorSpace { 00099 XVIDColorSpaceUnknown = -1, 00100 XVIDColorSpaceRGB24 = 512 /*0*/, 00101 XVIDColorSpaceYV12 = 4 /*1*/, 00102 XVIDColorSpaceI420 = 2 /*4*/, 00103 XVIDColorSpaceRGB32 = 256 /*1000*/} xvidColorSpace; 00104 00105 00106 00118 int XVIDDecoderInit2(char **pDecoderHandle, unsigned int uiWidth, unsigned int uiHeight); 00119 00128 void XVIDDecoderClose(char **pDecoderHandle); 00129 00139 int XVIDDecoderGetWidth(char *pDecoderHandle); 00140 00150 int XVIDDecoderGetHeight(char *pDecoderHandle); 00151 00165 int XVIDDecodeFrame(char *pDecoderHandle, char *pCompressedFrame, 00166 int iCFSize, char* pYUVFrame, xvidColorSpace eColorSpace); 00167 00168 00169 00170 00171 #ifdef WINCE 00172 int XVIDDecodeFrameCE(char *pCompressedFrame, int iCFSize, unsigned char * &y, unsigned char * &u, unsigned char * &v); 00173 #endif 00174 00175 00189 int XVIDDecodeFile2(char *in, char *out, unsigned int uiWidth, 00190 unsigned int uiHeight, xvidColorSpace eColorSpace); 00191 00203 int XVIDEncoderInit( char **pEncoderHandle, int iWidth, int iHeight, int iBitrate, int iFramerate, int numBFrames); 00204 00211 void XVIDEncoderClose(char **pEncoderHandle); 00212 00229 int XVIDEncodeFrame(char *pEncoderHandle, char *pYUVFrame, 00230 char *pCompressed, xvidColorSpace eColorSpace, int forceIFrame); 00231 00244 int XVIDEncodeFile(char *in, int width, int height, int bitrate, xvidColorSpace eColorSpace, char *out); 00245 00246 00247 #ifdef WINCE 00248 void XvidSetWidth(int width); 00249 void XvidSetHeight(int height); 00250 #endif 00251 00252 #ifdef __cplusplus 00253 } 00254 #endif 00255 00256 #endif