Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(434)

Side by Side Diff: jmorecfg.h

Issue 1953443002: Update to libjpeg_turbo 1.4.90 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « jmemsys.h ('k') | jpeg_nbits_table.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * jmorecfg.h 2 * jmorecfg.h
3 * 3 *
4 * This file was part of the Independent JPEG Group's software: 4 * This file was part of the Independent JPEG Group's software:
5 * Copyright (C) 1991-1997, Thomas G. Lane. 5 * Copyright (C) 1991-1997, Thomas G. Lane.
6 * Modifications: 6 * Modified 1997-2009 by Guido Vollbeding.
7 * Copyright (C) 2009, 2011, 2014, D. R. Commander. 7 * libjpeg-turbo Modifications:
8 * For conditions of distribution and use, see the accompanying README file. 8 * Copyright (C) 2009, 2011, 2014-2015, D. R. Commander.
9 * For conditions of distribution and use, see the accompanying README.ijg
10 * file.
9 * 11 *
10 * This file contains additional configuration options that customize the 12 * This file contains additional configuration options that customize the
11 * JPEG software for special applications or support machine-dependent 13 * JPEG software for special applications or support machine-dependent
12 * optimizations. Most users will not need to touch this file. 14 * optimizations. Most users will not need to touch this file.
13 */ 15 */
14 16
15 17
16 /* 18 /*
17 * Define BITS_IN_JSAMPLE as either
18 * 8 for 8-bit sample values (the usual setting)
19 * 12 for 12-bit sample values
20 * Only 8 and 12 are legal data precisions for lossy JPEG according to the
21 * JPEG standard, and the IJG code does not support anything else!
22 * We do not support run-time selection of data precision, sorry.
23 */
24
25 #define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
26
27
28 /*
29 * Maximum number of components (color channels) allowed in JPEG image. 19 * Maximum number of components (color channels) allowed in JPEG image.
30 * To meet the letter of the JPEG spec, set this to 255. However, darn 20 * To meet the letter of the JPEG spec, set this to 255. However, darn
31 * few applications need more than 4 channels (maybe 5 for CMYK + alpha 21 * few applications need more than 4 channels (maybe 5 for CMYK + alpha
32 * mask). We recommend 10 as a reasonable compromise; use 4 if you are 22 * mask). We recommend 10 as a reasonable compromise; use 4 if you are
33 * really short on memory. (Each allowed component costs a hundred or so 23 * really short on memory. (Each allowed component costs a hundred or so
34 * bytes of storage, whether actually used in an image or not.) 24 * bytes of storage, whether actually used in an image or not.)
35 */ 25 */
36 26
37 #define MAX_COMPONENTS 10» /* maximum number of image components */ 27 #define MAX_COMPONENTS 10 /* maximum number of image components */
38 28
39 29
40 /* 30 /*
41 * Basic data types. 31 * Basic data types.
42 * You may need to change these if you have a machine with unusual data 32 * You may need to change these if you have a machine with unusual data
43 * type sizes; for example, "char" not 8 bits, "short" not 16 bits, 33 * type sizes; for example, "char" not 8 bits, "short" not 16 bits,
44 * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits, 34 * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits,
45 * but it had better be at least 16. 35 * but it had better be at least 16.
46 */ 36 */
47 37
(...skipping 17 matching lines...) Expand all
65 55
66 typedef char JSAMPLE; 56 typedef char JSAMPLE;
67 #ifdef __CHAR_UNSIGNED__ 57 #ifdef __CHAR_UNSIGNED__
68 #define GETJSAMPLE(value) ((int) (value)) 58 #define GETJSAMPLE(value) ((int) (value))
69 #else 59 #else
70 #define GETJSAMPLE(value) ((int) (value) & 0xFF) 60 #define GETJSAMPLE(value) ((int) (value) & 0xFF)
71 #endif /* __CHAR_UNSIGNED__ */ 61 #endif /* __CHAR_UNSIGNED__ */
72 62
73 #endif /* HAVE_UNSIGNED_CHAR */ 63 #endif /* HAVE_UNSIGNED_CHAR */
74 64
75 #define MAXJSAMPLE» 255 65 #define MAXJSAMPLE 255
76 #define CENTERJSAMPLE» 128 66 #define CENTERJSAMPLE 128
77 67
78 #endif /* BITS_IN_JSAMPLE == 8 */ 68 #endif /* BITS_IN_JSAMPLE == 8 */
79 69
80 70
81 #if BITS_IN_JSAMPLE == 12 71 #if BITS_IN_JSAMPLE == 12
82 /* JSAMPLE should be the smallest type that will hold the values 0..4095. 72 /* JSAMPLE should be the smallest type that will hold the values 0..4095.
83 * On nearly all machines "short" will do nicely. 73 * On nearly all machines "short" will do nicely.
84 */ 74 */
85 75
86 typedef short JSAMPLE; 76 typedef short JSAMPLE;
87 #define GETJSAMPLE(value) ((int) (value)) 77 #define GETJSAMPLE(value) ((int) (value))
88 78
89 #define MAXJSAMPLE» 4095 79 #define MAXJSAMPLE 4095
90 #define CENTERJSAMPLE» 2048 80 #define CENTERJSAMPLE 2048
91 81
92 #endif /* BITS_IN_JSAMPLE == 12 */ 82 #endif /* BITS_IN_JSAMPLE == 12 */
93 83
94 84
95 /* Representation of a DCT frequency coefficient. 85 /* Representation of a DCT frequency coefficient.
96 * This should be a signed value of at least 16 bits; "short" is usually OK. 86 * This should be a signed value of at least 16 bits; "short" is usually OK.
97 * Again, we allocate large arrays of these, but you can change to int 87 * Again, we allocate large arrays of these, but you can change to int
98 * if you have memory to burn and "short" is really slow. 88 * if you have memory to burn and "short" is really slow.
99 */ 89 */
100 90
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 /* UINT16 must hold at least the values 0..65535. */ 136 /* UINT16 must hold at least the values 0..65535. */
147 137
148 #ifdef HAVE_UNSIGNED_SHORT 138 #ifdef HAVE_UNSIGNED_SHORT
149 typedef unsigned short UINT16; 139 typedef unsigned short UINT16;
150 #else /* not HAVE_UNSIGNED_SHORT */ 140 #else /* not HAVE_UNSIGNED_SHORT */
151 typedef unsigned int UINT16; 141 typedef unsigned int UINT16;
152 #endif /* HAVE_UNSIGNED_SHORT */ 142 #endif /* HAVE_UNSIGNED_SHORT */
153 143
154 /* INT16 must hold at least the values -32768..32767. */ 144 /* INT16 must hold at least the values -32768..32767. */
155 145
156 #ifndef XMD_H» » » /* X11/xmd.h correctly defines INT16 */ 146 #ifndef XMD_H /* X11/xmd.h correctly defines INT16 */
157 #ifndef _BASETSD_H_» » /* basetsd.h correctly defines INT32 */
158 typedef short INT16; 147 typedef short INT16;
159 #endif 148 #endif
149
150 /* INT32 must hold at least signed 32-bit values.
151 *
152 * NOTE: The INT32 typedef dates back to libjpeg v5 (1994.) Integers were
153 * sometimes 16-bit back then (MS-DOS), which is why INT32 is typedef'd to
154 * long. It also wasn't common (or at least as common) in 1994 for INT32 to be
155 * defined by platform headers. Since then, however, INT32 is defined in
156 * several other common places:
157 *
158 * Xmd.h (X11 header) typedefs INT32 to int on 64-bit platforms and long on
159 * 32-bit platforms (i.e always a 32-bit signed type.)
160 *
161 * basetsd.h (Win32 header) typedefs INT32 to int (always a 32-bit signed type
162 * on modern platforms.)
163 *
164 * qglobal.h (Qt header) typedefs INT32 to int (always a 32-bit signed type on
165 * modern platforms.)
166 *
167 * This is a recipe for conflict, since "long" and "int" aren't always
168 * compatible types. Since the definition of INT32 has technically been part
169 * of the libjpeg API for more than 20 years, we can't remove it, but we do not
170 * use it internally any longer. We instead define a separate type (JLONG)
171 * for internal use, which ensures that internal behavior will always be the
172 * same regardless of any external headers that may be included.
173 */
174
175 #ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
176 #ifndef _BASETSD_H_ /* Microsoft defines it in basetsd.h */
177 #ifndef _BASETSD_H /* MinGW is slightly different */
178 #ifndef QGLOBAL_H /* Qt defines it in qglobal.h */
179 typedef long INT32;
160 #endif 180 #endif
161 181 #endif
162 /* INT32 must hold at least signed 32-bit values. */
163
164 #ifndef XMD_H» » » /* X11/xmd.h correctly defines INT32 */
165 #ifndef _BASETSD_H_» » /* basetsd.h correctly defines INT32 */
166 typedef long INT32;
167 #endif 182 #endif
168 #endif 183 #endif
169 184
170 /* Datatype used for image dimensions. The JPEG standard only supports 185 /* Datatype used for image dimensions. The JPEG standard only supports
171 * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore 186 * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore
172 * "unsigned int" is sufficient on all machines. However, if you need to 187 * "unsigned int" is sufficient on all machines. However, if you need to
173 * handle larger images and you don't mind deviating from the spec, you 188 * handle larger images and you don't mind deviating from the spec, you
174 * can change this datatype. Note that changing this type will require 189 * can change this datatype. (Note that changing this datatype will
175 * potentially updating the assembly code to correctly use the new type 190 * potentially require modifying the SIMD code. The x86-64 SIMD extensions,
176 * size. 191 * in particular, assume a 32-bit JDIMENSION.)
177 */ 192 */
178 193
179 typedef unsigned int JDIMENSION; 194 typedef unsigned int JDIMENSION;
180 195
181 #define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */ 196 #define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */
182 197
183 198
184 /* These macros are used in all function definitions and extern declarations. 199 /* These macros are used in all function definitions and extern declarations.
185 * You could modify them if you need to change function linkage conventions; 200 * You could modify them if you need to change function linkage conventions;
186 * in particular, you'll need to do that to make the library a Windows DLL. 201 * in particular, you'll need to do that to make the library a Windows DLL.
187 * Another application is to make all functions global for use with debuggers 202 * Another application is to make all functions global for use with debuggers
188 * or code profilers that require it. 203 * or code profilers that require it.
189 */ 204 */
190 205
191 /* a function called through method pointers: */ 206 /* a function called through method pointers: */
192 #define METHODDEF(type)»» static type 207 #define METHODDEF(type) static type
193 /* a function used only in its module: */ 208 /* a function used only in its module: */
194 #define LOCAL(type)» » static type 209 #define LOCAL(type) static type
195 /* a function referenced thru EXTERNs: */ 210 /* a function referenced thru EXTERNs: */
196 #define GLOBAL(type)» » type 211 #define GLOBAL(type) type
197 /* a reference to a GLOBAL function: */ 212 /* a reference to a GLOBAL function: */
198 #define EXTERN(type)» » extern type 213 #define EXTERN(type) extern type
199 214
200 215
201 /* This macro is used to declare a "method", that is, a function pointer. 216 /* Originally, this macro was used as a way of defining function prototypes
202 * We want to supply prototype parameters if the compiler can cope. 217 * for both modern compilers as well as older compilers that did not support
203 * Note that the arglist parameter must be parenthesized! 218 * prototype parameters. libjpeg-turbo has never supported these older,
204 * Again, you can customize this if you need special linkage keywords. 219 * non-ANSI compilers, but the macro is still included because there is some
220 * software out there that uses it.
205 */ 221 */
206 222
207 #ifdef HAVE_PROTOTYPES
208 #define JMETHOD(type,methodname,arglist) type (*methodname) arglist 223 #define JMETHOD(type,methodname,arglist) type (*methodname) arglist
209 #else
210 #define JMETHOD(type,methodname,arglist) type (*methodname) ()
211 #endif
212 224
213 225
214 /* Here is the pseudo-keyword for declaring pointers that must be "far" 226 /* libjpeg-turbo no longer supports platforms that have far symbols (MS-DOS),
215 * on 80x86 machines. Most of the specialized coding for 80x86 is handled 227 * but again, some software relies on this macro.
216 * by just saying "FAR *" where such a pointer is needed. In a few places
217 * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.
218 */ 228 */
219 229
220 #ifndef FAR
221 #ifdef NEED_FAR_POINTERS
222 #ifndef FAR
223 #define FAR far
224 #endif
225 #else
226 #undef FAR 230 #undef FAR
227 #define FAR 231 #define FAR
228 #endif
229 #endif
230 232
231 233
232 /* 234 /*
233 * On a few systems, type boolean and/or its values FALSE, TRUE may appear 235 * On a few systems, type boolean and/or its values FALSE, TRUE may appear
234 * in standard header files. Or you may have conflicts with application- 236 * in standard header files. Or you may have conflicts with application-
235 * specific header files that you want to include together with these files. 237 * specific header files that you want to include together with these files.
236 * Defining HAVE_BOOLEAN before including jpeglib.h should make it work. 238 * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
237 */ 239 */
238 240
239 #ifndef HAVE_BOOLEAN 241 #ifndef HAVE_BOOLEAN
240 typedef int boolean; 242 typedef int boolean;
241 #endif 243 #endif
242 #ifndef FALSE» » » /* in case these macros already exist */ 244 #ifndef FALSE /* in case these macros already exist */
243 #define FALSE» 0» » /* values of boolean */ 245 #define FALSE 0 /* values of boolean */
244 #endif 246 #endif
245 #ifndef TRUE 247 #ifndef TRUE
246 #define TRUE» 1 248 #define TRUE 1
247 #endif 249 #endif
248 250
249 251
250 /* 252 /*
251 * The remaining options affect code selection within the JPEG library, 253 * The remaining options affect code selection within the JPEG library,
252 * but they don't need to be visible to most applications using the library. 254 * but they don't need to be visible to most applications using the library.
253 * To minimize application namespace pollution, the symbols won't be 255 * To minimize application namespace pollution, the symbols won't be
254 * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined. 256 * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.
255 */ 257 */
256 258
257 #ifdef JPEG_INTERNALS 259 #ifdef JPEG_INTERNALS
258 #define JPEG_INTERNAL_OPTIONS 260 #define JPEG_INTERNAL_OPTIONS
259 #endif 261 #endif
260 262
261 #ifdef JPEG_INTERNAL_OPTIONS 263 #ifdef JPEG_INTERNAL_OPTIONS
262 264
263 265
264 /* 266 /*
265 * These defines indicate whether to include various optional functions. 267 * These defines indicate whether to include various optional functions.
266 * Undefining some of these symbols will produce a smaller but less capable 268 * Undefining some of these symbols will produce a smaller but less capable
267 * library. Note that you can leave certain source files out of the 269 * library. Note that you can leave certain source files out of the
268 * compilation/linking process if you've #undef'd the corresponding symbols. 270 * compilation/linking process if you've #undef'd the corresponding symbols.
269 * (You may HAVE to do that if your compiler doesn't like null source files.) 271 * (You may HAVE to do that if your compiler doesn't like null source files.)
270 */ 272 */
271 273
272 /* Capability options common to encoder and decoder: */ 274 /* Capability options common to encoder and decoder: */
273 275
274 #define DCT_ISLOW_SUPPORTED» /* slow but accurate integer algorithm */ 276 #define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */
275 #define DCT_IFAST_SUPPORTED» /* faster, less accurate integer method */ 277 #define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */
276 #define DCT_FLOAT_SUPPORTED» /* floating-point: accurate, fast on fast HW */ 278 #define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */
277 279
278 /* Encoder capability options: */ 280 /* Encoder capability options: */
279 281
280 #define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ 282 #define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
281 #define C_PROGRESSIVE_SUPPORTED» /* Progressive JPEG? (Requires MULTISCAN)*/ 283 #define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
282 #define ENTROPY_OPT_SUPPORTED» /* Optimization of entropy coding parms? */ 284 #define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */
283 /* Note: if you selected 12-bit data precision, it is dangerous to turn off 285 /* Note: if you selected 12-bit data precision, it is dangerous to turn off
284 * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit 286 * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit
285 * precision, so jchuff.c normally uses entropy optimization to compute 287 * precision, so jchuff.c normally uses entropy optimization to compute
286 * usable tables for higher precision. If you don't want to do optimization, 288 * usable tables for higher precision. If you don't want to do optimization,
287 * you'll have to supply different default Huffman tables. 289 * you'll have to supply different default Huffman tables.
288 * The exact same statements apply for progressive JPEG: the default tables 290 * The exact same statements apply for progressive JPEG: the default tables
289 * don't work for progressive mode. (This may get fixed, however.) 291 * don't work for progressive mode. (This may get fixed, however.)
290 */ 292 */
291 #define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */ 293 #define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */
292 294
293 /* Decoder capability options: */ 295 /* Decoder capability options: */
294 296
295 #define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ 297 #define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
296 #define D_PROGRESSIVE_SUPPORTED» /* Progressive JPEG? (Requires MULTISCAN)*/ 298 #define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
297 #define SAVE_MARKERS_SUPPORTED» /* jpeg_save_markers() needed? */ 299 #define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
298 #define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */ 300 #define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
299 #define IDCT_SCALING_SUPPORTED» /* Output rescaling via IDCT? */ 301 #define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */
300 #undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */ 302 #undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */
301 #define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */ 303 #define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */
302 #define QUANT_1PASS_SUPPORTED» /* 1-pass color quantization? */ 304 #define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */
303 #define QUANT_2PASS_SUPPORTED» /* 2-pass color quantization? */ 305 #define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */
304 306
305 /* more capability options later, no doubt */ 307 /* more capability options later, no doubt */
306 308
307 309
308 /* 310 /*
309 * Ordering of RGB data in scanlines passed to or from the application. 311 * The RGB_RED, RGB_GREEN, RGB_BLUE, and RGB_PIXELSIZE macros are a vestigial
310 * If your application wants to deal with data in the order B,G,R, just 312 * feature of libjpeg. The idea was that, if an application developer needed
311 * change these macros. You can also deal with formats such as R,G,B,X 313 * to compress from/decompress to a BGR/BGRX/RGBX/XBGR/XRGB buffer, they could
312 * (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing 314 * change these macros, rebuild libjpeg, and link their application statically
313 * the offsets will also change the order in which colormap data is organized. 315 * with it. In reality, few people ever did this, because there were some
314 * RESTRICTIONS: 316 * severe restrictions involved (cjpeg and djpeg no longer worked properly,
315 * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats. 317 * compressing/decompressing RGB JPEGs no longer worked properly, and the color
316 * 2. These macros only affect RGB<=>YCbCr color conversion, so they are not 318 * quantizer wouldn't work with pixel sizes other than 3.) Further, since all
317 * useful if you are using JPEG color spaces other than YCbCr or grayscale. 319 * of the O/S-supplied versions of libjpeg were built with the default values
318 * 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE 320 * of RGB_RED, RGB_GREEN, RGB_BLUE, and RGB_PIXELSIZE, many applications have
319 * is not 3 (they don't understand about dummy color components!). So you 321 * come to regard these values as immutable.
320 * can't use color quantization if you change that value. 322 *
323 * The libjpeg-turbo colorspace extensions provide a much cleaner way of
324 * compressing from/decompressing to buffers with arbitrary component orders
325 * and pixel sizes. Thus, we do not support changing the values of RGB_RED,
326 * RGB_GREEN, RGB_BLUE, or RGB_PIXELSIZE. In addition to the restrictions
327 * listed above, changing these values will also break the SIMD extensions and
328 * the regression tests.
321 */ 329 */
322 330
323 #define RGB_RED»» 0» /* Offset of Red in an RGB scanline element */ 331 #define RGB_RED 0 /* Offset of Red in an RGB scanline element */
324 #define RGB_GREEN» 1» /* Offset of Green */ 332 #define RGB_GREEN 1 /* Offset of Green */
325 #define RGB_BLUE» 2» /* Offset of Blue */ 333 #define RGB_BLUE 2 /* Offset of Blue */
326 #define RGB_PIXELSIZE» 3» /* JSAMPLEs per RGB scanline element */ 334 #define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
327 335
328 #define JPEG_NUMCS 17 336 #define JPEG_NUMCS 17
329 337
330 #define EXT_RGB_RED 0 338 #define EXT_RGB_RED 0
331 #define EXT_RGB_GREEN 1 339 #define EXT_RGB_GREEN 1
332 #define EXT_RGB_BLUE 2 340 #define EXT_RGB_BLUE 2
333 #define EXT_RGB_PIXELSIZE 3 341 #define EXT_RGB_PIXELSIZE 3
334 342
335 #define EXT_RGBX_RED 0 343 #define EXT_RGBX_RED 0
336 #define EXT_RGBX_GREEN 1 344 #define EXT_RGBX_GREEN 1
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 395
388 /* Definitions for speed-related optimizations. */ 396 /* Definitions for speed-related optimizations. */
389 397
390 /* On some machines (notably 68000 series) "int" is 32 bits, but multiplying 398 /* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
391 * two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER 399 * two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER
392 * as short on such a machine. MULTIPLIER must be at least 16 bits wide. 400 * as short on such a machine. MULTIPLIER must be at least 16 bits wide.
393 */ 401 */
394 402
395 #ifndef MULTIPLIER 403 #ifndef MULTIPLIER
396 #ifndef WITH_SIMD 404 #ifndef WITH_SIMD
397 #define MULTIPLIER int»» /* type for fastest integer multiply */ 405 #define MULTIPLIER int /* type for fastest integer multiply */
398 #else 406 #else
399 #define MULTIPLIER short /* prefer 16-bit with SIMD for parellelism */ 407 #define MULTIPLIER short /* prefer 16-bit with SIMD for parellelism */
400 #endif 408 #endif
401 #endif 409 #endif
402 410
403 411
404 /* FAST_FLOAT should be either float or double, whichever is done faster 412 /* FAST_FLOAT should be either float or double, whichever is done faster
405 * by your compiler. (Note that this type is only used in the floating point 413 * by your compiler. (Note that this type is only used in the floating point
406 * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.) 414 * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)
407 * Typically, float is faster in ANSI C compilers, while double is faster in
408 * pre-ANSI compilers (because they insist on converting to double anyway).
409 * The code below therefore chooses float if we have ANSI-style prototypes.
410 */ 415 */
411 416
412 #ifndef FAST_FLOAT 417 #ifndef FAST_FLOAT
413 #ifdef HAVE_PROTOTYPES
414 #define FAST_FLOAT float 418 #define FAST_FLOAT float
415 #else
416 #define FAST_FLOAT double
417 #endif
418 #endif 419 #endif
419 420
420 #endif /* JPEG_INTERNAL_OPTIONS */ 421 #endif /* JPEG_INTERNAL_OPTIONS */
OLDNEW
« no previous file with comments | « jmemsys.h ('k') | jpeg_nbits_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698