2
2
* jmorecfg.h
3
3
*
4
4
* Copyright (C) 1991-1997, Thomas G. Lane.
5
- * Modified 1997-2012 by Guido Vollbeding.
5
+ * Modified 1997-2013 by Guido Vollbeding.
6
6
* This file is part of the Independent JPEG Group's software.
7
7
* For conditions of distribution and use, see the accompanying README file.
8
8
*
15
15
/*
16
16
* Define BITS_IN_JSAMPLE as either
17
17
* 8 for 8-bit sample values (the usual setting)
18
+ * 9 for 9-bit sample values
19
+ * 10 for 10-bit sample values
20
+ * 11 for 11-bit sample values
18
21
* 12 for 12-bit sample values
19
- * Only 8 and 12 are legal data precisions for lossy JPEG according to the
20
- * JPEG standard, and the IJG code does not support anything else!
21
- * We do not support run-time selection of data precision, sorry.
22
+ * Only 8, 9, 10, 11, and 12 bits sample data precision are supported for
23
+ * full-feature DCT processing. Further depths up to 16-bit may be added
24
+ * later for the lossless modes of operation.
25
+ * Run-time selection and conversion of data precision will be added later
26
+ * and are currently not supported, sorry.
27
+ * Exception: The transcoding part (jpegtran) supports all settings in a
28
+ * single instance, since it operates on the level of DCT coefficients and
29
+ * not sample values. The DCT coefficients are of the same type (16 bits)
30
+ * in all cases (see below).
22
31
*/
23
32
24
- #define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
33
+ #define BITS_IN_JSAMPLE 8 /* use 8, 9, 10, 11, or 12 */
25
34
26
35
27
36
/*
@@ -77,6 +86,48 @@ typedef char JSAMPLE;
77
86
#endif /* BITS_IN_JSAMPLE == 8 */
78
87
79
88
89
+ #if BITS_IN_JSAMPLE == 9
90
+ /* JSAMPLE should be the smallest type that will hold the values 0..511.
91
+ * On nearly all machines "short" will do nicely.
92
+ */
93
+
94
+ typedef short JSAMPLE ;
95
+ #define GETJSAMPLE (value ) ((int) (value))
96
+
97
+ #define MAXJSAMPLE 511
98
+ #define CENTERJSAMPLE 256
99
+
100
+ #endif /* BITS_IN_JSAMPLE == 9 */
101
+
102
+
103
+ #if BITS_IN_JSAMPLE == 10
104
+ /* JSAMPLE should be the smallest type that will hold the values 0..1023.
105
+ * On nearly all machines "short" will do nicely.
106
+ */
107
+
108
+ typedef short JSAMPLE ;
109
+ #define GETJSAMPLE (value ) ((int) (value))
110
+
111
+ #define MAXJSAMPLE 1023
112
+ #define CENTERJSAMPLE 512
113
+
114
+ #endif /* BITS_IN_JSAMPLE == 10 */
115
+
116
+
117
+ #if BITS_IN_JSAMPLE == 11
118
+ /* JSAMPLE should be the smallest type that will hold the values 0..2047.
119
+ * On nearly all machines "short" will do nicely.
120
+ */
121
+
122
+ typedef short JSAMPLE ;
123
+ #define GETJSAMPLE (value ) ((int) (value))
124
+
125
+ #define MAXJSAMPLE 2047
126
+ #define CENTERJSAMPLE 1024
127
+
128
+ #endif /* BITS_IN_JSAMPLE == 11 */
129
+
130
+
80
131
#if BITS_IN_JSAMPLE == 12
81
132
/* JSAMPLE should be the smallest type that will hold the values 0..4095.
82
133
* On nearly all machines "short" will do nicely.
@@ -252,7 +303,10 @@ typedef void noreturn_t;
252
303
* Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
253
304
*/
254
305
255
- #ifdef HAVE_BOOLEAN
306
+ #ifndef HAVE_BOOLEAN
307
+ #if defined FALSE || defined TRUE || defined QGLOBAL_H
308
+ /* Qt3 defines FALSE and TRUE as "const" variables in qglobal.h */
309
+ typedef int boolean ;
256
310
#ifndef FALSE /* in case these macros already exist */
257
311
#define FALSE 0 /* values of boolean */
258
312
#endif
@@ -262,6 +316,7 @@ typedef void noreturn_t;
262
316
#else
263
317
typedef enum { FALSE = 0 , TRUE = 1 } boolean ;
264
318
#endif
319
+ #endif
265
320
266
321
267
322
/*
@@ -299,11 +354,12 @@ typedef enum { FALSE = 0, TRUE = 1 } boolean;
299
354
#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
300
355
#define DCT_SCALING_SUPPORTED /* Input rescaling via DCT? (Requires DCT_ISLOW)*/
301
356
#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */
302
- /* Note: if you selected 12-bit data precision, it is dangerous to turn off
303
- * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit
304
- * precision, so jchuff.c normally uses entropy optimization to compute
305
- * usable tables for higher precision. If you don't want to do optimization,
306
- * you'll have to supply different default Huffman tables.
357
+ /* Note: if you selected more than 8-bit data precision, it is dangerous to
358
+ * turn off ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only
359
+ * good for 8-bit precision, so arithmetic coding is recommended for higher
360
+ * precision. The Huffman encoder normally uses entropy optimization to
361
+ * compute usable tables for higher precision. Otherwise, you'll have to
362
+ * supply different default Huffman tables.
307
363
* The exact same statements apply for progressive JPEG: the default tables
308
364
* don't work for progressive mode. (This may get fixed, however.)
309
365
*/
@@ -314,7 +370,7 @@ typedef enum { FALSE = 0, TRUE = 1 } boolean;
314
370
#define D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
315
371
#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
316
372
#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
317
- #define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */
373
+ #define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? (Requires DCT_ISLOW) */
318
374
#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
319
375
#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
320
376
#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */
0 commit comments