136a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/*
236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * jmorecfg.h
336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane *
4a73e870ad02de20c2b34cb3a5382c2846c2afbe3DRC * This file was part of the Independent JPEG Group's software:
55ead57a34a398aa798f35bd7a6abad19b2e453e2Thomas G. Lane * Copyright (C) 1991-1997, Thomas G. Lane.
6c23e36e80009728b8c0f5e36ba6cb07885334d3bDRC * Modified 1997-2009 by Guido Vollbeding.
7da13af6b8d5427af89bbdc5698b4e09d0ea814feDRC * libjpeg-turbo Modifications:
88e9cef2e6f5156c4b055a04a8f979b7291fc6b7aDRC * Copyright (C) 2009, 2011, 2014-2015, D. R. Commander.
96eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis * For conditions of distribution and use, see the accompanying README.ijg
106eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis * file.
1136a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane *
1236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * This file contains additional configuration options that customize the
1336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * JPEG software for special applications or support machine-dependent
1436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * optimizations.  Most users will not need to touch this file.
1536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane */
1636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
1736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
1836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/*
1936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * Maximum number of components (color channels) allowed in JPEG image.
2036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * To meet the letter of the JPEG spec, set this to 255.  However, darn
2136a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * few applications need more than 4 channels (maybe 5 for CMYK + alpha
2236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * mask).  We recommend 10 as a reasonable compromise; use 4 if you are
2336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * really short on memory.  (Each allowed component costs a hundred or so
2436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * bytes of storage, whether actually used in an image or not.)
2536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane */
2636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
27e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define MAX_COMPONENTS  10      /* maximum number of image components */
2836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
2936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
3036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/*
3136a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * Basic data types.
3236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * You may need to change these if you have a machine with unusual data
3336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * type sizes; for example, "char" not 8 bits, "short" not 16 bits,
3436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * or "long" not 32 bits.  We don't care whether "int" is 16 or 32 bits,
3536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * but it had better be at least 16.
3636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane */
3736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
3836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/* Representation of a single sample (pixel element value).
3936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * We frequently allocate large arrays of these, so it's important to keep
4036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * them small.  But if you have memory to burn and access to char or short
4136a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * arrays is very slow on your hardware, you might want to change these.
4236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane */
4336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
4436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#if BITS_IN_JSAMPLE == 8
4536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/* JSAMPLE should be the smallest type that will hold the values 0..255.
4636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * You can use a signed char by having GETJSAMPLE mask it with 0xFF.
4736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane */
4836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
4936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#ifdef HAVE_UNSIGNED_CHAR
5036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
5136a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lanetypedef unsigned char JSAMPLE;
5236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#define GETJSAMPLE(value)  ((int) (value))
5336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
5436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#else /* not HAVE_UNSIGNED_CHAR */
5536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
5636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lanetypedef char JSAMPLE;
570ca44258fc43bc44ea31b875001311591cc5634cConstantin Kaplinsky#ifdef __CHAR_UNSIGNED__
5836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#define GETJSAMPLE(value)  ((int) (value))
5936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#else
6036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#define GETJSAMPLE(value)  ((int) (value) & 0xFF)
610ca44258fc43bc44ea31b875001311591cc5634cConstantin Kaplinsky#endif /* __CHAR_UNSIGNED__ */
6236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
6336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#endif /* HAVE_UNSIGNED_CHAR */
6436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
65e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define MAXJSAMPLE      255
66e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define CENTERJSAMPLE   128
6736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
6836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#endif /* BITS_IN_JSAMPLE == 8 */
6936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
7036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
7136a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#if BITS_IN_JSAMPLE == 12
7236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/* JSAMPLE should be the smallest type that will hold the values 0..4095.
7336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * On nearly all machines "short" will do nicely.
7436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane */
7536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
7636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lanetypedef short JSAMPLE;
7736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#define GETJSAMPLE(value)  ((int) (value))
7836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
79e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define MAXJSAMPLE      4095
80e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define CENTERJSAMPLE   2048
8136a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
8236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#endif /* BITS_IN_JSAMPLE == 12 */
8336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
8436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
8536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/* Representation of a DCT frequency coefficient.
8636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * This should be a signed value of at least 16 bits; "short" is usually OK.
8736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * Again, we allocate large arrays of these, but you can change to int
8836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * if you have memory to burn and "short" is really slow.
8936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane */
9036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
9136a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lanetypedef short JCOEF;
9236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
9336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
9436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/* Compressed datastreams are represented as arrays of JOCTET.
9536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * These must be EXACTLY 8 bits wide, at least once they are written to
9636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * external storage.  Note that when using the stdio data source/destination
9736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * managers, this is also the data type passed to fread/fwrite.
9836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane */
9936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
10036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#ifdef HAVE_UNSIGNED_CHAR
10136a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
10236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lanetypedef unsigned char JOCTET;
10336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#define GETJOCTET(value)  (value)
10436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
10536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#else /* not HAVE_UNSIGNED_CHAR */
10636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
10736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lanetypedef char JOCTET;
1080ca44258fc43bc44ea31b875001311591cc5634cConstantin Kaplinsky#ifdef __CHAR_UNSIGNED__
10936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#define GETJOCTET(value)  (value)
11036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#else
11136a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#define GETJOCTET(value)  ((value) & 0xFF)
1120ca44258fc43bc44ea31b875001311591cc5634cConstantin Kaplinsky#endif /* __CHAR_UNSIGNED__ */
11336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
11436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#endif /* HAVE_UNSIGNED_CHAR */
11536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
11636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
11736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/* These typedefs are used for various table entries and so forth.
11836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * They must be at least as wide as specified; but making them too big
11936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * won't cost a huge amount of memory, so we don't provide special
12036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * extraction code like we did for JSAMPLE.  (In other words, these
12136a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * typedefs live at a different point on the speed/space tradeoff curve.)
12236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane */
12336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
12436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/* UINT8 must hold at least the values 0..255. */
12536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
12636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#ifdef HAVE_UNSIGNED_CHAR
12736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lanetypedef unsigned char UINT8;
12836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#else /* not HAVE_UNSIGNED_CHAR */
1290ca44258fc43bc44ea31b875001311591cc5634cConstantin Kaplinsky#ifdef __CHAR_UNSIGNED__
13036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lanetypedef char UINT8;
1310ca44258fc43bc44ea31b875001311591cc5634cConstantin Kaplinsky#else /* not __CHAR_UNSIGNED__ */
13236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lanetypedef short UINT8;
1330ca44258fc43bc44ea31b875001311591cc5634cConstantin Kaplinsky#endif /* __CHAR_UNSIGNED__ */
13436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#endif /* HAVE_UNSIGNED_CHAR */
13536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
13636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/* UINT16 must hold at least the values 0..65535. */
13736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
13836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#ifdef HAVE_UNSIGNED_SHORT
13936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lanetypedef unsigned short UINT16;
14036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#else /* not HAVE_UNSIGNED_SHORT */
14136a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lanetypedef unsigned int UINT16;
14236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#endif /* HAVE_UNSIGNED_SHORT */
14336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
14436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/* INT16 must hold at least the values -32768..32767. */
14536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
146e5eaf37440b8e337ab150c017df7c03faf846c51DRC#ifndef XMD_H                   /* X11/xmd.h correctly defines INT16 */
14736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lanetypedef short INT16;
14836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#endif
14936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
1506eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis/* INT32 must hold at least signed 32-bit values.
1516eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis *
1526eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis * NOTE: The INT32 typedef dates back to libjpeg v5 (1994.)  Integers were
1536eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis * sometimes 16-bit back then (MS-DOS), which is why INT32 is typedef'd to
1546eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis * long.  It also wasn't common (or at least as common) in 1994 for INT32 to be
1556eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis * defined by platform headers.  Since then, however, INT32 is defined in
1566eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis * several other common places:
1576eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis *
1586eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis * Xmd.h (X11 header) typedefs INT32 to int on 64-bit platforms and long on
1596eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis * 32-bit platforms (i.e always a 32-bit signed type.)
1606eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis *
1616eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis * basetsd.h (Win32 header) typedefs INT32 to int (always a 32-bit signed type
1626eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis * on modern platforms.)
1636eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis *
1646eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis * qglobal.h (Qt header) typedefs INT32 to int (always a 32-bit signed type on
1656eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis * modern platforms.)
1666eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis *
1676eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis * This is a recipe for conflict, since "long" and "int" aren't always
1686eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis * compatible types.  Since the definition of INT32 has technically been part
1696eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis * of the libjpeg API for more than 20 years, we can't remove it, but we do not
1706eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis * use it internally any longer.  We instead define a separate type (JLONG)
1716eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis * for internal use, which ensures that internal behavior will always be the
1726eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis * same regardless of any external headers that may be included.
1736eb7d3798b5a79347c62825fc4c16f7ce673bdd0Alex Naidis */
17436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
175e5eaf37440b8e337ab150c017df7c03faf846c51DRC#ifndef XMD_H                   /* X11/xmd.h correctly defines INT32 */
1765996a25e2f50d20d6a8f09830724035b49c3927bGuido Vollbeding#ifndef _BASETSD_H_		/* Microsoft defines it in basetsd.h */
177989630f70cf1af69ebfefca8910d1647bf189712Guido Vollbeding#ifndef _BASETSD_H		/* MinGW is slightly different */
1785996a25e2f50d20d6a8f09830724035b49c3927bGuido Vollbeding#ifndef QGLOBAL_H		/* Qt defines it in qglobal.h */
17936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lanetypedef long INT32;
18036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#endif
1815996a25e2f50d20d6a8f09830724035b49c3927bGuido Vollbeding#endif
1825996a25e2f50d20d6a8f09830724035b49c3927bGuido Vollbeding#endif
183989630f70cf1af69ebfefca8910d1647bf189712Guido Vollbeding#endif
18436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
18536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/* Datatype used for image dimensions.  The JPEG standard only supports
18636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * images up to 64K*64K due to 16-bit fields in SOF markers.  Therefore
18736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * "unsigned int" is sufficient on all machines.  However, if you need to
18836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * handle larger images and you don't mind deviating from the spec, you
189498d9bc92fcf39124b6f08e57326944dedd2ddd6Chandler Carruth * can change this datatype.  (Note that changing this datatype will
190498d9bc92fcf39124b6f08e57326944dedd2ddd6Chandler Carruth * potentially require modifying the SIMD code.  The x86-64 SIMD extensions,
191498d9bc92fcf39124b6f08e57326944dedd2ddd6Chandler Carruth * in particular, assume a 32-bit JDIMENSION.)
19236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane */
19336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
19436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lanetypedef unsigned int JDIMENSION;
19536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
19636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#define JPEG_MAX_DIMENSION  65500L  /* a tad under 64K to prevent overflows */
19736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
19836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
199489583f5165e05d37302e8eeec58104ea0109127Thomas G. Lane/* These macros are used in all function definitions and extern declarations.
200489583f5165e05d37302e8eeec58104ea0109127Thomas G. Lane * You could modify them if you need to change function linkage conventions;
201489583f5165e05d37302e8eeec58104ea0109127Thomas G. Lane * in particular, you'll need to do that to make the library a Windows DLL.
20236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * Another application is to make all functions global for use with debuggers
20336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * or code profilers that require it.
20436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane */
20536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
206489583f5165e05d37302e8eeec58104ea0109127Thomas G. Lane/* a function called through method pointers: */
207e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define METHODDEF(type)         static type
208489583f5165e05d37302e8eeec58104ea0109127Thomas G. Lane/* a function used only in its module: */
209e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define LOCAL(type)             static type
210489583f5165e05d37302e8eeec58104ea0109127Thomas G. Lane/* a function referenced thru EXTERNs: */
211e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define GLOBAL(type)            type
212489583f5165e05d37302e8eeec58104ea0109127Thomas G. Lane/* a reference to a GLOBAL function: */
213e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define EXTERN(type)            extern type
214489583f5165e05d37302e8eeec58104ea0109127Thomas G. Lane
215489583f5165e05d37302e8eeec58104ea0109127Thomas G. Lane
216e2dd3e3e5cb479f8596325e72f0595a31bf79921DRC/* Originally, this macro was used as a way of defining function prototypes
217e2dd3e3e5cb479f8596325e72f0595a31bf79921DRC * for both modern compilers as well as older compilers that did not support
2182a6b8316fce86aa05c00bf44a29a28d2e9aec99cDRC * prototype parameters.  libjpeg-turbo has never supported these older,
2192a6b8316fce86aa05c00bf44a29a28d2e9aec99cDRC * non-ANSI compilers, but the macro is still included because there is some
2202a6b8316fce86aa05c00bf44a29a28d2e9aec99cDRC * software out there that uses it.
221e2dd3e3e5cb479f8596325e72f0595a31bf79921DRC */
222e2dd3e3e5cb479f8596325e72f0595a31bf79921DRC
223e2dd3e3e5cb479f8596325e72f0595a31bf79921DRC#define JMETHOD(type,methodname,arglist)  type (*methodname) arglist
224e2dd3e3e5cb479f8596325e72f0595a31bf79921DRC
225e2dd3e3e5cb479f8596325e72f0595a31bf79921DRC
2262a6b8316fce86aa05c00bf44a29a28d2e9aec99cDRC/* libjpeg-turbo no longer supports platforms that have far symbols (MS-DOS),
2272a6b8316fce86aa05c00bf44a29a28d2e9aec99cDRC * but again, some software relies on this macro.
2282a6b8316fce86aa05c00bf44a29a28d2e9aec99cDRC */
2292a6b8316fce86aa05c00bf44a29a28d2e9aec99cDRC
2302a6b8316fce86aa05c00bf44a29a28d2e9aec99cDRC#undef FAR
2312a6b8316fce86aa05c00bf44a29a28d2e9aec99cDRC#define FAR
2322a6b8316fce86aa05c00bf44a29a28d2e9aec99cDRC
2332a6b8316fce86aa05c00bf44a29a28d2e9aec99cDRC
23436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/*
23536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * On a few systems, type boolean and/or its values FALSE, TRUE may appear
23636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * in standard header files.  Or you may have conflicts with application-
23736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * specific header files that you want to include together with these files.
23836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
23936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane */
24036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
24136a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#ifndef HAVE_BOOLEAN
24236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lanetypedef int boolean;
24336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#endif
244e5eaf37440b8e337ab150c017df7c03faf846c51DRC#ifndef FALSE                   /* in case these macros already exist */
245e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define FALSE   0               /* values of boolean */
24636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#endif
24736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#ifndef TRUE
248e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define TRUE    1
24936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#endif
25036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
25136a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
25236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/*
25336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * The remaining options affect code selection within the JPEG library,
25436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * but they don't need to be visible to most applications using the library.
25536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * To minimize application namespace pollution, the symbols won't be
25636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.
25736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane */
25836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
25936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#ifdef JPEG_INTERNALS
26036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#define JPEG_INTERNAL_OPTIONS
26136a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#endif
26236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
26336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#ifdef JPEG_INTERNAL_OPTIONS
26436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
26536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
26636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/*
26736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * These defines indicate whether to include various optional functions.
26836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * Undefining some of these symbols will produce a smaller but less capable
26936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * library.  Note that you can leave certain source files out of the
27036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * compilation/linking process if you've #undef'd the corresponding symbols.
27136a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * (You may HAVE to do that if your compiler doesn't like null source files.)
27236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane */
27336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
27436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/* Capability options common to encoder and decoder: */
27536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
276e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define DCT_ISLOW_SUPPORTED     /* slow but accurate integer algorithm */
277e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define DCT_IFAST_SUPPORTED     /* faster, less accurate integer method */
278e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define DCT_FLOAT_SUPPORTED     /* floating-point: accurate, fast on fast HW */
27936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
28036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/* Encoder capability options: */
28136a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
282bc79e0680a45d1ca330d690dae0340c8e17ab5e3Thomas G. Lane#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
283e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define C_PROGRESSIVE_SUPPORTED     /* Progressive JPEG? (Requires MULTISCAN)*/
284e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define ENTROPY_OPT_SUPPORTED       /* Optimization of entropy coding parms? */
28536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/* Note: if you selected 12-bit data precision, it is dangerous to turn off
28636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * ENTROPY_OPT_SUPPORTED.  The standard Huffman tables are only good for 8-bit
28736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * precision, so jchuff.c normally uses entropy optimization to compute
28836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * usable tables for higher precision.  If you don't want to do optimization,
28936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * you'll have to supply different default Huffman tables.
290bc79e0680a45d1ca330d690dae0340c8e17ab5e3Thomas G. Lane * The exact same statements apply for progressive JPEG: the default tables
291bc79e0680a45d1ca330d690dae0340c8e17ab5e3Thomas G. Lane * don't work for progressive mode.  (This may get fixed, however.)
29236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane */
29336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#define INPUT_SMOOTHING_SUPPORTED   /* Input image smoothing option? */
29436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
29536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/* Decoder capability options: */
29636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
29736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
298e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define D_PROGRESSIVE_SUPPORTED     /* Progressive JPEG? (Requires MULTISCAN)*/
299e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define SAVE_MARKERS_SUPPORTED      /* jpeg_save_markers() needed? */
300bc79e0680a45d1ca330d690dae0340c8e17ab5e3Thomas G. Lane#define BLOCK_SMOOTHING_SUPPORTED   /* Block smoothing? (Progressive only) */
301e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define IDCT_SCALING_SUPPORTED      /* Output rescaling via IDCT? */
30236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#undef  UPSAMPLE_SCALING_SUPPORTED  /* Output rescaling at upsample stage? */
30336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#define UPSAMPLE_MERGING_SUPPORTED  /* Fast path for sloppy upsampling? */
304e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define QUANT_1PASS_SUPPORTED       /* 1-pass color quantization? */
305e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define QUANT_2PASS_SUPPORTED       /* 2-pass color quantization? */
30636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
30736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/* more capability options later, no doubt */
30836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
30936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
31036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/*
311976fd9687e5773f3653385da7a3489ce4d58dd51DRC * The RGB_RED, RGB_GREEN, RGB_BLUE, and RGB_PIXELSIZE macros are a vestigial
312976fd9687e5773f3653385da7a3489ce4d58dd51DRC * feature of libjpeg.  The idea was that, if an application developer needed
313976fd9687e5773f3653385da7a3489ce4d58dd51DRC * to compress from/decompress to a BGR/BGRX/RGBX/XBGR/XRGB buffer, they could
314976fd9687e5773f3653385da7a3489ce4d58dd51DRC * change these macros, rebuild libjpeg, and link their application statically
315976fd9687e5773f3653385da7a3489ce4d58dd51DRC * with it.  In reality, few people ever did this, because there were some
316976fd9687e5773f3653385da7a3489ce4d58dd51DRC * severe restrictions involved (cjpeg and djpeg no longer worked properly,
317976fd9687e5773f3653385da7a3489ce4d58dd51DRC * compressing/decompressing RGB JPEGs no longer worked properly, and the color
318976fd9687e5773f3653385da7a3489ce4d58dd51DRC * quantizer wouldn't work with pixel sizes other than 3.)  Further, since all
319976fd9687e5773f3653385da7a3489ce4d58dd51DRC * of the O/S-supplied versions of libjpeg were built with the default values
320976fd9687e5773f3653385da7a3489ce4d58dd51DRC * of RGB_RED, RGB_GREEN, RGB_BLUE, and RGB_PIXELSIZE, many applications have
321976fd9687e5773f3653385da7a3489ce4d58dd51DRC * come to regard these values as immutable.
322976fd9687e5773f3653385da7a3489ce4d58dd51DRC *
323976fd9687e5773f3653385da7a3489ce4d58dd51DRC * The libjpeg-turbo colorspace extensions provide a much cleaner way of
324976fd9687e5773f3653385da7a3489ce4d58dd51DRC * compressing from/decompressing to buffers with arbitrary component orders
325976fd9687e5773f3653385da7a3489ce4d58dd51DRC * and pixel sizes.  Thus, we do not support changing the values of RGB_RED,
326976fd9687e5773f3653385da7a3489ce4d58dd51DRC * RGB_GREEN, RGB_BLUE, or RGB_PIXELSIZE.  In addition to the restrictions
327976fd9687e5773f3653385da7a3489ce4d58dd51DRC * listed above, changing these values will also break the SIMD extensions and
328976fd9687e5773f3653385da7a3489ce4d58dd51DRC * the regression tests.
32936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane */
33036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
331e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define RGB_RED         0       /* Offset of Red in an RGB scanline element */
332e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define RGB_GREEN       1       /* Offset of Green */
333e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define RGB_BLUE        2       /* Offset of Blue */
334e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define RGB_PIXELSIZE   3       /* JSAMPLEs per RGB scanline element */
33536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
33678df2e6115b0e579432d01cb034132cd4402a1baDRC#define JPEG_NUMCS 17
337f25c071eb745268452206bb633561b770c4d62eaDRC
338b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_RGB_RED        0
339b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_RGB_GREEN      1
340b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_RGB_BLUE       2
341b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_RGB_PIXELSIZE  3
342b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC
343b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_RGBX_RED       0
344b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_RGBX_GREEN     1
345b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_RGBX_BLUE      2
346b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_RGBX_PIXELSIZE 4
347b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC
348b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_BGR_RED        2
349b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_BGR_GREEN      1
350b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_BGR_BLUE       0
351b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_BGR_PIXELSIZE  3
352b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC
353b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_BGRX_RED       2
354b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_BGRX_GREEN     1
355b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_BGRX_BLUE      0
356b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_BGRX_PIXELSIZE 4
357b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC
358b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_XBGR_RED       3
359b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_XBGR_GREEN     2
360b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_XBGR_BLUE      1
361b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_XBGR_PIXELSIZE 4
362b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC
363b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_XRGB_RED       1
364b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_XRGB_GREEN     2
365b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_XRGB_BLUE      3
366b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC#define EXT_XRGB_PIXELSIZE 4
367b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC
368f25c071eb745268452206bb633561b770c4d62eaDRCstatic const int rgb_red[JPEG_NUMCS] = {
369b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC  -1, -1, RGB_RED, -1, -1, -1, EXT_RGB_RED, EXT_RGBX_RED,
37067ce3b2352fe1f7511edbfed74ec6960e41e97dcDRC  EXT_BGR_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED,
37178df2e6115b0e579432d01cb034132cd4402a1baDRC  EXT_RGBX_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED,
37278df2e6115b0e579432d01cb034132cd4402a1baDRC  -1
373f25c071eb745268452206bb633561b770c4d62eaDRC};
374f25c071eb745268452206bb633561b770c4d62eaDRC
375f25c071eb745268452206bb633561b770c4d62eaDRCstatic const int rgb_green[JPEG_NUMCS] = {
376b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC  -1, -1, RGB_GREEN, -1, -1, -1, EXT_RGB_GREEN, EXT_RGBX_GREEN,
37767ce3b2352fe1f7511edbfed74ec6960e41e97dcDRC  EXT_BGR_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN,
37878df2e6115b0e579432d01cb034132cd4402a1baDRC  EXT_RGBX_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN,
37978df2e6115b0e579432d01cb034132cd4402a1baDRC  -1
380f25c071eb745268452206bb633561b770c4d62eaDRC};
381f25c071eb745268452206bb633561b770c4d62eaDRC
382f25c071eb745268452206bb633561b770c4d62eaDRCstatic const int rgb_blue[JPEG_NUMCS] = {
383b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC  -1, -1, RGB_BLUE, -1, -1, -1, EXT_RGB_BLUE, EXT_RGBX_BLUE,
38467ce3b2352fe1f7511edbfed74ec6960e41e97dcDRC  EXT_BGR_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE,
38578df2e6115b0e579432d01cb034132cd4402a1baDRC  EXT_RGBX_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE,
38678df2e6115b0e579432d01cb034132cd4402a1baDRC  -1
387f25c071eb745268452206bb633561b770c4d62eaDRC};
388f25c071eb745268452206bb633561b770c4d62eaDRC
389f25c071eb745268452206bb633561b770c4d62eaDRCstatic const int rgb_pixelsize[JPEG_NUMCS] = {
390b4570bbf8cb3045e2b3cbf3d6a80d31735871d10DRC  -1, -1, RGB_PIXELSIZE, -1, -1, -1, EXT_RGB_PIXELSIZE, EXT_RGBX_PIXELSIZE,
39167ce3b2352fe1f7511edbfed74ec6960e41e97dcDRC  EXT_BGR_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE,
39278df2e6115b0e579432d01cb034132cd4402a1baDRC  EXT_RGBX_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE,
39378df2e6115b0e579432d01cb034132cd4402a1baDRC  -1
394f25c071eb745268452206bb633561b770c4d62eaDRC};
39536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
39636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/* Definitions for speed-related optimizations. */
39736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
39836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
39936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * two 16-bit shorts is faster than multiplying two ints.  Define MULTIPLIER
40036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * as short on such a machine.  MULTIPLIER must be at least 16 bits wide.
40136a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane */
40236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
40336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#ifndef MULTIPLIER
4045eb84ff97f00c02aadfdce0cb30ab3e899c1b113Pierre Ossman#ifndef WITH_SIMD
405e5eaf37440b8e337ab150c017df7c03faf846c51DRC#define MULTIPLIER  int         /* type for fastest integer multiply */
4065eb84ff97f00c02aadfdce0cb30ab3e899c1b113Pierre Ossman#else
4075eb84ff97f00c02aadfdce0cb30ab3e899c1b113Pierre Ossman#define MULTIPLIER short  /* prefer 16-bit with SIMD for parellelism */
4085eb84ff97f00c02aadfdce0cb30ab3e899c1b113Pierre Ossman#endif
40936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#endif
41036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
41136a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
41236a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane/* FAST_FLOAT should be either float or double, whichever is done faster
41336a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * by your compiler.  (Note that this type is only used in the floating point
41436a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)
41536a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane */
41636a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
41736a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#ifndef FAST_FLOAT
41836a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#define FAST_FLOAT  float
41936a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#endif
42036a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane
42136a4ccccd33f5cc9df62949554af87129ced7f84Thomas G. Lane#endif /* JPEG_INTERNAL_OPTIONS */
422