Skip to content

Commit 046a2a7

Browse files
Merge pull request #237 from ricardoquesada/jpeg_9b
Jpeg 9b
2 parents a0f0560 + a3b45c5 commit 046a2a7

File tree

9 files changed

+98
-27
lines changed

9 files changed

+98
-27
lines changed

jpeg/include/android/jconfig.h

100755100644
+9-1
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,19 @@
1818
/* Define this if you get warnings about undefined structures. */
1919
/* #undef INCOMPLETE_TYPES_BROKEN */
2020

21-
/* Define "boolean" as unsigned char, not int, on Windows systems. */
21+
/* Define "boolean" as unsigned char, not enum, on Windows systems. */
22+
#ifdef _WIN32
2223
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
2324
typedef unsigned char boolean;
2425
#endif
26+
#ifndef FALSE /* in case these macros already exist */
27+
#define FALSE 0 /* values of boolean */
28+
#endif
29+
#ifndef TRUE
30+
#define TRUE 1
31+
#endif
2532
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
33+
#endif
2634

2735
#ifdef JPEG_INTERNALS
2836

jpeg/include/android/jerror.h

100755100644
File mode changed.

jpeg/include/android/jmorecfg.h

100755100644
+68-12
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* jmorecfg.h
33
*
44
* Copyright (C) 1991-1997, Thomas G. Lane.
5-
* Modified 1997-2012 by Guido Vollbeding.
5+
* Modified 1997-2013 by Guido Vollbeding.
66
* This file is part of the Independent JPEG Group's software.
77
* For conditions of distribution and use, see the accompanying README file.
88
*
@@ -15,13 +15,22 @@
1515
/*
1616
* Define BITS_IN_JSAMPLE as either
1717
* 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
1821
* 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).
2231
*/
2332

24-
#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
33+
#define BITS_IN_JSAMPLE 8 /* use 8, 9, 10, 11, or 12 */
2534

2635

2736
/*
@@ -77,6 +86,48 @@ typedef char JSAMPLE;
7786
#endif /* BITS_IN_JSAMPLE == 8 */
7887

7988

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+
80131
#if BITS_IN_JSAMPLE == 12
81132
/* JSAMPLE should be the smallest type that will hold the values 0..4095.
82133
* On nearly all machines "short" will do nicely.
@@ -252,7 +303,10 @@ typedef void noreturn_t;
252303
* Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
253304
*/
254305

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;
256310
#ifndef FALSE /* in case these macros already exist */
257311
#define FALSE 0 /* values of boolean */
258312
#endif
@@ -262,6 +316,7 @@ typedef void noreturn_t;
262316
#else
263317
typedef enum { FALSE = 0, TRUE = 1 } boolean;
264318
#endif
319+
#endif
265320

266321

267322
/*
@@ -299,11 +354,12 @@ typedef enum { FALSE = 0, TRUE = 1 } boolean;
299354
#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
300355
#define DCT_SCALING_SUPPORTED /* Input rescaling via DCT? (Requires DCT_ISLOW)*/
301356
#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.
307363
* The exact same statements apply for progressive JPEG: the default tables
308364
* don't work for progressive mode. (This may get fixed, however.)
309365
*/
@@ -314,7 +370,7 @@ typedef enum { FALSE = 0, TRUE = 1 } boolean;
314370
#define D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
315371
#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
316372
#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)*/
318374
#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
319375
#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
320376
#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */

jpeg/include/android/jpeglib.h

100755100644
+20-13
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* jpeglib.h
33
*
44
* Copyright (C) 1991-1998, Thomas G. Lane.
5-
* Modified 2002-2012 by Guido Vollbeding.
5+
* Modified 2002-2015 by Guido Vollbeding.
66
* This file is part of the Independent JPEG Group's software.
77
* For conditions of distribution and use, see the accompanying README file.
88
*
@@ -39,12 +39,12 @@ extern "C" {
3939

4040
#define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */
4141
#define JPEG_LIB_VERSION_MAJOR 9
42-
#define JPEG_LIB_VERSION_MINOR 0
42+
#define JPEG_LIB_VERSION_MINOR 2
4343

4444

4545
/* Various constants determining the sizes of things.
46-
* All of these are specified by the JPEG standard, so don't change them
47-
* if you want to be compatible.
46+
* All of these are specified by the JPEG standard,
47+
* so don't change them if you want to be compatible.
4848
*/
4949

5050
#define DCTSIZE 8 /* The basic DCT block is 8x8 coefficients */
@@ -157,16 +157,21 @@ typedef struct {
157157
/* The downsampled dimensions are the component's actual, unpadded number
158158
* of samples at the main buffer (preprocessing/compression interface);
159159
* DCT scaling is included, so
160-
* downsampled_width = ceil(image_width * Hi/Hmax * DCT_h_scaled_size/DCTSIZE)
160+
* downsampled_width =
161+
* ceil(image_width * Hi/Hmax * DCT_h_scaled_size/block_size)
161162
* and similarly for height.
162163
*/
163164
JDIMENSION downsampled_width; /* actual width in samples */
164165
JDIMENSION downsampled_height; /* actual height in samples */
165-
/* This flag is used only for decompression. In cases where some of the
166-
* components will be ignored (eg grayscale output from YCbCr image),
167-
* we can skip most computations for the unused components.
166+
/* For decompression, in cases where some of the components will be
167+
* ignored (eg grayscale output from YCbCr image), we can skip most
168+
* computations for the unused components.
169+
* For compression, some of the components will need further quantization
170+
* scale by factor of 2 after DCT (eg BG_YCC output from normal RGB input).
171+
* The field is first set TRUE for decompression, FALSE for compression
172+
* in initial_setup, and then adapted in color conversion setup.
168173
*/
169-
boolean component_needed; /* do we need the value of this component? */
174+
boolean component_needed;
170175

171176
/* These values are computed before starting a scan of the component. */
172177
/* The decompressor output side may not use these variables. */
@@ -215,10 +220,12 @@ struct jpeg_marker_struct {
215220
typedef enum {
216221
JCS_UNKNOWN, /* error/unspecified */
217222
JCS_GRAYSCALE, /* monochrome */
218-
JCS_RGB, /* red/green/blue */
219-
JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */
223+
JCS_RGB, /* red/green/blue, standard RGB (sRGB) */
224+
JCS_YCbCr, /* Y/Cb/Cr (also known as YUV), standard YCC */
220225
JCS_CMYK, /* C/M/Y/K */
221-
JCS_YCCK /* Y/Cb/Cr/K */
226+
JCS_YCCK, /* Y/Cb/Cr/K */
227+
JCS_BG_RGB, /* big gamut red/green/blue, bg-sRGB */
228+
JCS_BG_YCC /* big gamut Y/Cb/Cr, bg-sYCC */
222229
} J_COLOR_SPACE;
223230

224231
/* Supported color transforms. */
@@ -972,7 +979,7 @@ EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,
972979
unsigned char ** outbuffer,
973980
unsigned long * outsize));
974981
EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,
975-
unsigned char * inbuffer,
982+
const unsigned char * inbuffer,
976983
unsigned long insize));
977984

978985
/* Default parameter setup for compression */
1.09 KB
Binary file not shown.

jpeg/prebuilt/android/armeabi-v7a/libjpeg.a

100755100644
-78.1 KB
Binary file not shown.

jpeg/prebuilt/android/armeabi/libjpeg.a

100755100644
-38 KB
Binary file not shown.

jpeg/prebuilt/android/x86/libjpeg.a

100755100644
259 KB
Binary file not shown.

version.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"prebuilt_libs_version":"v3-deps-102",
2+
"prebuilt_libs_version":"v3-deps-103",
33
"freetype":"2.5.5",
44
"curl":"7.48.0",
55
"jpeg":"9.0",

0 commit comments

Comments
 (0)