Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

common.h

00001 /*****************************************************************************
00002  * common.h: a few defines and wrappers for swscale
00003  *****************************************************************************
00004  * Copyright (C) 1999-2004 the VideoLAN team
00005  * $Id: common.h 11664 2005-07-09 06:17:09Z courmisch $
00006  *
00007  * Authors: Gildas Bazin <[email protected]>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00022  *****************************************************************************/
00023 
00024 #define mp_msg(a,b,args... ) //fprintf(stderr, ##args)
00025 #define vo_format_name(a) ""
00026 
00027 #ifndef _VLC_FILTER_H
00028 extern void *( *swscale_fast_memcpy )( void *, const void *, int );
00029 #endif
00030 #define memcpy(a,b,c) swscale_fast_memcpy(a,b,c)
00031 
00032 #if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__OS2__) || \
00033    (defined(__OpenBSD__) && !defined(__ELF__))
00034 #define MANGLE(a) "_" #a
00035 #else
00036 #define MANGLE(a) #a
00037 #endif
00038 
00039 #ifdef ARCH_X86
00040 static inline unsigned short ByteSwap16(unsigned short x)
00041 {
00042   __asm("xchgb %b0,%h0" :
00043         "=q" (x)        :
00044         "0" (x));
00045     return x;
00046 }
00047 #define bswap_16(x) ByteSwap16(x)
00048 #else
00049 
00050 #define bswap_16(x) (((x) & 0x00ff) << 8 | ((x) & 0xff00) >> 8)
00051 #endif  /* !ARCH_X86 */
00052 
00053 /* SWSCALE image formats */
00054 #define IMGFMT_RGB_MASK 0xFFFFFF00
00055 #define IMGFMT_RGB (('R'<<24)|('G'<<16)|('B'<<8))
00056 #define IMGFMT_RGB1  (IMGFMT_RGB|1)
00057 #define IMGFMT_RGB4  (IMGFMT_RGB|4)
00058 #define IMGFMT_RGB4_CHAR  (IMGFMT_RGB|4|128) // RGB4 with 1 pixel per byte
00059 #define IMGFMT_RGB8  (IMGFMT_RGB|8)
00060 #define IMGFMT_RGB15 (IMGFMT_RGB|15)
00061 #define IMGFMT_RGB16 (IMGFMT_RGB|16)
00062 #define IMGFMT_RGB24 (IMGFMT_RGB|24)
00063 #define IMGFMT_RGB32 (IMGFMT_RGB|32)
00064 
00065 #define IMGFMT_BGR_MASK 0xFFFFFF00
00066 #define IMGFMT_BGR (('B'<<24)|('G'<<16)|('R'<<8))
00067 #define IMGFMT_BGR1 (IMGFMT_BGR|1)
00068 #define IMGFMT_BGR4 (IMGFMT_BGR|4)
00069 #define IMGFMT_BGR4_CHAR (IMGFMT_BGR|4|128) // BGR4 with 1 pixel per byte
00070 #define IMGFMT_BGR8 (IMGFMT_BGR|8)
00071 #define IMGFMT_BGR15 (IMGFMT_BGR|15)
00072 #define IMGFMT_BGR16 (IMGFMT_BGR|16)
00073 #define IMGFMT_BGR24 (IMGFMT_BGR|24)
00074 #define IMGFMT_BGR32 (IMGFMT_BGR|32)
00075 
00076 #ifdef WORDS_BIGENDIAN
00077 #define IMGFMT_ABGR IMGFMT_RGB32
00078 #define IMGFMT_BGRA (IMGFMT_RGB32|64)
00079 #define IMGFMT_ARGB IMGFMT_BGR32
00080 #define IMGFMT_RGBA (IMGFMT_BGR32|64)
00081 #else
00082 #define IMGFMT_ABGR (IMGFMT_BGR32|64)
00083 #define IMGFMT_BGRA IMGFMT_BGR32
00084 #define IMGFMT_ARGB (IMGFMT_RGB32|64)
00085 #define IMGFMT_RGBA IMGFMT_RGB32
00086 #endif
00087 
00088 /* old names for compatibility */
00089 #define IMGFMT_RG4B  IMGFMT_RGB4_CHAR
00090 #define IMGFMT_BG4B  IMGFMT_BGR4_CHAR
00091 
00092 #define IMGFMT_IS_RGB(fmt) (((fmt)&IMGFMT_RGB_MASK)==IMGFMT_RGB)
00093 #define IMGFMT_IS_BGR(fmt) (((fmt)&IMGFMT_BGR_MASK)==IMGFMT_BGR)
00094 
00095 #define IMGFMT_RGB_DEPTH(fmt) ((fmt)&0x3F)
00096 #define IMGFMT_BGR_DEPTH(fmt) ((fmt)&0x3F)
00097 
00098 /* Planar YUV Formats */
00099 #define IMGFMT_YVU9 0x39555659
00100 #define IMGFMT_IF09 0x39304649
00101 #define IMGFMT_YV12 0x32315659
00102 #define IMGFMT_I420 0x30323449
00103 #define IMGFMT_IYUV 0x56555949
00104 #define IMGFMT_CLPL 0x4C504C43
00105 #define IMGFMT_Y800 0x30303859
00106 #define IMGFMT_Y8   0x20203859
00107 #define IMGFMT_NV12 0x3231564E
00108 #define IMGFMT_NV21 0x3132564E
00109 
00110 /* unofficial Planar Formats, FIXME if official 4CC exists */
00111 #define IMGFMT_444P 0x50343434
00112 #define IMGFMT_422P 0x50323234
00113 #define IMGFMT_411P 0x50313134
00114 #define IMGFMT_HM12 0x32314D48
00115 
00116 /* Packed YUV Formats */
00117 #define IMGFMT_IUYV 0x56595549
00118 #define IMGFMT_IY41 0x31435949
00119 #define IMGFMT_IYU1 0x31555949
00120 #define IMGFMT_IYU2 0x32555949
00121 #define IMGFMT_UYVY 0x59565955
00122 #define IMGFMT_UYNV 0x564E5955
00123 #define IMGFMT_cyuv 0x76757963
00124 #define IMGFMT_Y422 0x32323459
00125 #define IMGFMT_YUY2 0x32595559
00126 #define IMGFMT_YUNV 0x564E5559
00127 #define IMGFMT_YVYU 0x55595659
00128 #define IMGFMT_Y41P 0x50313459
00129 #define IMGFMT_Y211 0x31313259
00130 #define IMGFMT_Y41T 0x54313459
00131 #define IMGFMT_Y42T 0x54323459
00132 #define IMGFMT_V422 0x32323456
00133 #define IMGFMT_V655 0x35353656
00134 #define IMGFMT_CLJR 0x524A4C43
00135 #define IMGFMT_YUVP 0x50565559
00136 #define IMGFMT_UYVP 0x50565955

Generated on Tue Dec 20 10:14:24 2005 for vlc-0.8.4a by  doxygen 1.4.2