ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

jmorecfg.h
Go to the documentation of this file.
00001 /*
00002  * jmorecfg.h
00003  *
00004  * Copyright (C) 1991-1997, Thomas G. Lane.
00005  * Modified 1997-2009 by Guido Vollbeding.
00006  * This file is part of the Independent JPEG Group's software.
00007  * For conditions of distribution and use, see the accompanying README file.
00008  *
00009  * This file contains additional configuration options that customize the
00010  * JPEG software for special applications or support machine-dependent
00011  * optimizations.  Most users will not need to touch this file.
00012  */
00013 
00014 
00015 /*
00016  * Define BITS_IN_JSAMPLE as either
00017  *   8   for 8-bit sample values (the usual setting)
00018  *   12  for 12-bit sample values
00019  * Only 8 and 12 are legal data precisions for lossy JPEG according to the
00020  * JPEG standard, and the IJG code does not support anything else!
00021  * We do not support run-time selection of data precision, sorry.
00022  */
00023 
00024 #define BITS_IN_JSAMPLE  8  /* use 8 or 12 */
00025 
00026 
00027 /*
00028  * Maximum number of components (color channels) allowed in JPEG image.
00029  * To meet the letter of the JPEG spec, set this to 255.  However, darn
00030  * few applications need more than 4 channels (maybe 5 for CMYK + alpha
00031  * mask).  We recommend 10 as a reasonable compromise; use 4 if you are
00032  * really short on memory.  (Each allowed component costs a hundred or so
00033  * bytes of storage, whether actually used in an image or not.)
00034  */
00035 
00036 #define MAX_COMPONENTS  10  /* maximum number of image components */
00037 
00038 
00039 /*
00040  * Basic data types.
00041  * You may need to change these if you have a machine with unusual data
00042  * type sizes; for example, "char" not 8 bits, "short" not 16 bits,
00043  * or "long" not 32 bits.  We don't care whether "int" is 16 or 32 bits,
00044  * but it had better be at least 16.
00045  */
00046 
00047 /* Representation of a single sample (pixel element value).
00048  * We frequently allocate large arrays of these, so it's important to keep
00049  * them small.  But if you have memory to burn and access to char or short
00050  * arrays is very slow on your hardware, you might want to change these.
00051  */
00052 
00053 #if BITS_IN_JSAMPLE == 8
00054 /* JSAMPLE should be the smallest type that will hold the values 0..255.
00055  * You can use a signed char by having GETJSAMPLE mask it with 0xFF.
00056  */
00057 
00058 #ifdef HAVE_UNSIGNED_CHAR
00059 
00060 typedef unsigned char JSAMPLE;
00061 #define GETJSAMPLE(value)  ((int) (value))
00062 
00063 #else /* not HAVE_UNSIGNED_CHAR */
00064 
00065 typedef char JSAMPLE;
00066 #ifdef CHAR_IS_UNSIGNED
00067 #define GETJSAMPLE(value)  ((int) (value))
00068 #else
00069 #define GETJSAMPLE(value)  ((int) (value) & 0xFF)
00070 #endif /* CHAR_IS_UNSIGNED */
00071 
00072 #endif /* HAVE_UNSIGNED_CHAR */
00073 
00074 #define MAXJSAMPLE  255
00075 #define CENTERJSAMPLE   128
00076 
00077 #endif /* BITS_IN_JSAMPLE == 8 */
00078 
00079 
00080 #if BITS_IN_JSAMPLE == 12
00081 /* JSAMPLE should be the smallest type that will hold the values 0..4095.
00082  * On nearly all machines "short" will do nicely.
00083  */
00084 
00085 typedef short JSAMPLE;
00086 #define GETJSAMPLE(value)  ((int) (value))
00087 
00088 #define MAXJSAMPLE  4095
00089 #define CENTERJSAMPLE   2048
00090 
00091 #endif /* BITS_IN_JSAMPLE == 12 */
00092 
00093 
00094 /* Representation of a DCT frequency coefficient.
00095  * This should be a signed value of at least 16 bits; "short" is usually OK.
00096  * Again, we allocate large arrays of these, but you can change to int
00097  * if you have memory to burn and "short" is really slow.
00098  */
00099 
00100 typedef short JCOEF;
00101 
00102 
00103 /* Compressed datastreams are represented as arrays of JOCTET.
00104  * These must be EXACTLY 8 bits wide, at least once they are written to
00105  * external storage.  Note that when using the stdio data source/destination
00106  * managers, this is also the data type passed to fread/fwrite.
00107  */
00108 
00109 #ifdef HAVE_UNSIGNED_CHAR
00110 
00111 typedef unsigned char JOCTET;
00112 #define GETJOCTET(value)  (value)
00113 
00114 #else /* not HAVE_UNSIGNED_CHAR */
00115 
00116 typedef char JOCTET;
00117 #ifdef CHAR_IS_UNSIGNED
00118 #define GETJOCTET(value)  (value)
00119 #else
00120 #define GETJOCTET(value)  ((value) & 0xFF)
00121 #endif /* CHAR_IS_UNSIGNED */
00122 
00123 #endif /* HAVE_UNSIGNED_CHAR */
00124 
00125 
00126 /* These typedefs are used for various table entries and so forth.
00127  * They must be at least as wide as specified; but making them too big
00128  * won't cost a huge amount of memory, so we don't provide special
00129  * extraction code like we did for JSAMPLE.  (In other words, these
00130  * typedefs live at a different point on the speed/space tradeoff curve.)
00131  */
00132 
00133 /* UINT8 must hold at least the values 0..255. */
00134 
00135 #ifdef HAVE_UNSIGNED_CHAR
00136 typedef unsigned char UINT8;
00137 #else /* not HAVE_UNSIGNED_CHAR */
00138 #ifdef CHAR_IS_UNSIGNED
00139 typedef char UINT8;
00140 #else /* not CHAR_IS_UNSIGNED */
00141 typedef short UINT8;
00142 #endif /* CHAR_IS_UNSIGNED */
00143 #endif /* HAVE_UNSIGNED_CHAR */
00144 
00145 /* UINT16 must hold at least the values 0..65535. */
00146 
00147 #ifdef HAVE_UNSIGNED_SHORT
00148 typedef unsigned short UINT16;
00149 #else /* not HAVE_UNSIGNED_SHORT */
00150 typedef unsigned int UINT16;
00151 #endif /* HAVE_UNSIGNED_SHORT */
00152 
00153 /* INT16 must hold at least the values -32768..32767. */
00154 
00155 #ifndef XMD_H           /* X11/xmd.h correctly defines INT16 */
00156 typedef short INT16;
00157 #endif
00158 
00159 /* INT32 must hold at least signed 32-bit values. */
00160 
00161 #ifndef XMD_H           /* X11/xmd.h correctly defines INT32 */
00162 #ifndef _BASETSD_H_     /* Microsoft defines it in basetsd.h */
00163 #ifndef _BASETSD_H      /* MinGW is slightly different */
00164 #ifndef QGLOBAL_H       /* Qt defines it in qglobal.h */
00165 typedef long INT32;
00166 #endif
00167 #endif
00168 #endif
00169 #endif
00170 
00171 /* Datatype used for image dimensions.  The JPEG standard only supports
00172  * images up to 64K*64K due to 16-bit fields in SOF markers.  Therefore
00173  * "unsigned int" is sufficient on all machines.  However, if you need to
00174  * handle larger images and you don't mind deviating from the spec, you
00175  * can change this datatype.
00176  */
00177 
00178 typedef unsigned int JDIMENSION;
00179 
00180 #define JPEG_MAX_DIMENSION  65500L  /* a tad under 64K to prevent overflows */
00181 
00182 
00183 /* These macros are used in all function definitions and extern declarations.
00184  * You could modify them if you need to change function linkage conventions;
00185  * in particular, you'll need to do that to make the library a Windows DLL.
00186  * Another application is to make all functions global for use with debuggers
00187  * or code profilers that require it.
00188  */
00189 
00190 #ifdef _WIN32
00191 #  if defined(ALL_STATIC)
00192 #    if defined(JPEG_DLL)
00193 #      undef JPEG_DLL
00194 #    endif
00195 #    if !defined(JPEG_STATIC)
00196 #      define JPEG_STATIC
00197 #    endif
00198 #  endif
00199 #  if defined(JPEG_DLL)
00200 #    if defined(JPEG_STATIC)
00201 #      undef JPEG_STATIC
00202 #    endif
00203 #  endif
00204 #  if defined(JPEG_DLL)
00205 /* building a DLL */
00206 #    define JPEG_IMPEXP __declspec(dllexport)
00207 #  elif defined(JPEG_STATIC)
00208 /* building or linking to a static library */
00209 #    define JPEG_IMPEXP
00210 #  else
00211 /* linking to the DLL */
00212 #    define JPEG_IMPEXP __declspec(dllimport)
00213 #  endif
00214 #  if !defined(JPEG_API)
00215 #    define JPEG_API __cdecl
00216 #  endif
00217 /* The only remaining magic that is necessary for cygwin */
00218 #elif defined(__CYGWIN__)
00219 #  if !defined(JPEG_IMPEXP)
00220 #    define JPEG_IMPEXP
00221 #  endif
00222 #  if !defined(JPEG_API)
00223 #    define JPEG_API __cdecl
00224 #  endif
00225 #endif
00226 
00227 /* Ensure our magic doesn't hurt other platforms */
00228 #if !defined(JPEG_IMPEXP)
00229 #  define JPEG_IMPEXP
00230 #endif
00231 #if !defined(JPEG_API)
00232 #  define JPEG_API
00233 #endif
00234 
00235 /* a function called through method pointers: */
00236 #define METHODDEF(type)     static type
00237 /* a function used only in its module: */
00238 #define LOCAL(type)     static type
00239 /* a function referenced thru EXTERNs: */
00240 #define GLOBAL(type)        type JPEG_API
00241 /* a reference to a GLOBAL function: */
00242 #ifndef EXTERN
00243 # define EXTERN(type)          extern JPEG_IMPEXP type JPEG_API
00244 /* a reference to a "GLOBAL" function exported by sourcefiles of utility progs */
00245 #endif /* EXTERN */
00246 #define EXTERN_1(type)   extern type JPEG_API
00247 
00248 
00249 /* This macro is used to declare a "method", that is, a function pointer.
00250  * We want to supply prototype parameters if the compiler can cope.
00251  * Note that the arglist parameter must be parenthesized!
00252  * Again, you can customize this if you need special linkage keywords.
00253  */
00254 
00255 #ifdef HAVE_PROTOTYPES
00256 #define JMETHOD(type,methodname,arglist)  type (*methodname) arglist
00257 #else
00258 #define JMETHOD(type,methodname,arglist)  type (*methodname) ()
00259 #endif
00260 
00261 
00262 /* Here is the pseudo-keyword for declaring pointers that must be "far"
00263  * on 80x86 machines.  Most of the specialized coding for 80x86 is handled
00264  * by just saying "FAR *" where such a pointer is needed.  In a few places
00265  * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.
00266  */
00267 
00268 #ifndef FAR
00269 #ifdef NEED_FAR_POINTERS
00270 #define FAR  far
00271 #else
00272 #define FAR
00273 #endif
00274 #endif
00275 
00276 
00277 /*
00278  * On a few systems, type boolean and/or its values FALSE, TRUE may appear
00279  * in standard header files.  Or you may have conflicts with application-
00280  * specific header files that you want to include together with these files.
00281  * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
00282  */
00283 
00284 #ifndef HAVE_BOOLEAN
00285 typedef int boolean;
00286 #endif
00287 #ifndef FALSE           /* in case these macros already exist */
00288 #define FALSE   0       /* values of boolean */
00289 #endif
00290 #ifndef TRUE
00291 #define TRUE    1
00292 #endif
00293 
00294 
00295 /*
00296  * The remaining options affect code selection within the JPEG library,
00297  * but they don't need to be visible to most applications using the library.
00298  * To minimize application namespace pollution, the symbols won't be
00299  * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.
00300  */
00301 
00302 #ifdef JPEG_INTERNALS
00303 #define JPEG_INTERNAL_OPTIONS
00304 #endif
00305 
00306 #ifdef JPEG_INTERNAL_OPTIONS
00307 
00308 
00309 /*
00310  * These defines indicate whether to include various optional functions.
00311  * Undefining some of these symbols will produce a smaller but less capable
00312  * library.  Note that you can leave certain source files out of the
00313  * compilation/linking process if you've #undef'd the corresponding symbols.
00314  * (You may HAVE to do that if your compiler doesn't like null source files.)
00315  */
00316 
00317 /* Capability options common to encoder and decoder: */
00318 
00319 #define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */
00320 #define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */
00321 #define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */
00322 
00323 /* Encoder capability options: */
00324 
00325 #define C_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */
00326 #define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
00327 #define C_PROGRESSIVE_SUPPORTED     /* Progressive JPEG? (Requires MULTISCAN)*/
00328 #define DCT_SCALING_SUPPORTED       /* Input rescaling via DCT? (Requires DCT_ISLOW)*/
00329 #define ENTROPY_OPT_SUPPORTED       /* Optimization of entropy coding parms? */
00330 /* Note: if you selected 12-bit data precision, it is dangerous to turn off
00331  * ENTROPY_OPT_SUPPORTED.  The standard Huffman tables are only good for 8-bit
00332  * precision, so jchuff.c normally uses entropy optimization to compute
00333  * usable tables for higher precision.  If you don't want to do optimization,
00334  * you'll have to supply different default Huffman tables.
00335  * The exact same statements apply for progressive JPEG: the default tables
00336  * don't work for progressive mode.  (This may get fixed, however.)
00337  */
00338 #define INPUT_SMOOTHING_SUPPORTED   /* Input image smoothing option? */
00339 
00340 /* Decoder capability options: */
00341 
00342 #define D_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */
00343 #define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
00344 #define D_PROGRESSIVE_SUPPORTED     /* Progressive JPEG? (Requires MULTISCAN)*/
00345 #define IDCT_SCALING_SUPPORTED      /* Output rescaling via IDCT? */
00346 #define SAVE_MARKERS_SUPPORTED      /* jpeg_save_markers() needed? */
00347 #define BLOCK_SMOOTHING_SUPPORTED   /* Block smoothing? (Progressive only) */
00348 #undef  UPSAMPLE_SCALING_SUPPORTED  /* Output rescaling at upsample stage? */
00349 #define UPSAMPLE_MERGING_SUPPORTED  /* Fast path for sloppy upsampling? */
00350 #define QUANT_1PASS_SUPPORTED       /* 1-pass color quantization? */
00351 #define QUANT_2PASS_SUPPORTED       /* 2-pass color quantization? */
00352 
00353 /* more capability options later, no doubt */
00354 
00355 
00356 /*
00357  * Ordering of RGB data in scanlines passed to or from the application.
00358  * If your application wants to deal with data in the order B,G,R, just
00359  * change these macros.  You can also deal with formats such as R,G,B,X
00360  * (one extra byte per pixel) by changing RGB_PIXELSIZE.  Note that changing
00361  * the offsets will also change the order in which colormap data is organized.
00362  * RESTRICTIONS:
00363  * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.
00364  * 2. These macros only affect RGB<=>YCbCr color conversion, so they are not
00365  *    useful if you are using JPEG color spaces other than YCbCr or grayscale.
00366  * 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE
00367  *    is not 3 (they don't understand about dummy color components!).  So you
00368  *    can't use color quantization if you change that value.
00369  */
00370 
00371 #define RGB_RED     0   /* Offset of Red in an RGB scanline element */
00372 #define RGB_GREEN   1   /* Offset of Green */
00373 #define RGB_BLUE    2   /* Offset of Blue */
00374 #define RGB_PIXELSIZE   3   /* JSAMPLEs per RGB scanline element */
00375 
00376 
00377 /* Definitions for speed-related optimizations. */
00378 
00379 
00380 /* If your compiler supports inline functions, define INLINE
00381  * as the inline keyword; otherwise define it as empty.
00382  */
00383 
00384 #ifndef INLINE
00385 #ifdef __GNUC__         /* for instance, GNU C knows about inline */
00386 #define INLINE __inline__
00387 #endif
00388 #ifndef INLINE
00389 #define INLINE          /* default is to define it as empty */
00390 #endif
00391 #endif
00392 
00393 
00394 /* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
00395  * two 16-bit shorts is faster than multiplying two ints.  Define MULTIPLIER
00396  * as short on such a machine.  MULTIPLIER must be at least 16 bits wide.
00397  */
00398 
00399 #ifndef MULTIPLIER
00400 #define MULTIPLIER  int     /* type for fastest integer multiply */
00401 #endif
00402 
00403 
00404 /* FAST_FLOAT should be either float or double, whichever is done faster
00405  * by your compiler.  (Note that this type is only used in the floating point
00406  * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)
00407  * Typically, float is faster in ANSI C compilers, while double is faster in
00408  * pre-ANSI compilers (because they insist on converting to double anyway).
00409  * The code below therefore chooses float if we have ANSI-style prototypes.
00410  */
00411 
00412 #ifndef FAST_FLOAT
00413 #ifdef HAVE_PROTOTYPES
00414 #define FAST_FLOAT  float
00415 #else
00416 #define FAST_FLOAT  double
00417 #endif
00418 #endif
00419 
00420 #endif /* JPEG_INTERNAL_OPTIONS */

Generated on Sat May 26 2012 04:31:58 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.