Skip to content

Commit d2b8546

Browse files
committed
Merge pull request opencv#17648 from alalek:update_libjpeg
2 parents 2e16505 + f061a0a commit d2b8546

27 files changed

+727
-589
lines changed

3rdparty/libjpeg/README

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
The Independent JPEG Group's JPEG software
22
==========================================
33

4-
README for release 9c of 14-Jan-2018
4+
README for release 9d of 12-Jan-2020
55
====================================
66

77
This distribution contains the ninth public release of the Independent JPEG
@@ -10,8 +10,8 @@ to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
1010

1111
This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone,
1212
Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,
13-
Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers,
14-
and other members of the Independent JPEG Group.
13+
John Korejwa, Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi,
14+
Ge' Weijers, and other members of the Independent JPEG Group.
1515

1616
IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee
1717
(previously known as JPEG, together with ITU-T SG16).
@@ -115,7 +115,7 @@ with respect to this software, its quality, accuracy, merchantability, or
115115
fitness for a particular purpose. This software is provided "AS IS", and you,
116116
its user, assume the entire risk as to its quality and accuracy.
117117

118-
This software is copyright (C) 1991-2018, Thomas G. Lane, Guido Vollbeding.
118+
This software is copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.
119119
All Rights Reserved except as specified below.
120120

121121
Permission is hereby granted to use, copy, modify, and distribute this
@@ -152,13 +152,6 @@ The same holds for its supporting scripts (config.guess, config.sub,
152152
ltmain.sh). Another support script, install-sh, is copyright by X Consortium
153153
but is also freely distributable.
154154

155-
The IJG distribution formerly included code to read and write GIF files.
156-
To avoid entanglement with the Unisys LZW patent (now expired), GIF reading
157-
support has been removed altogether, and the GIF writer has been simplified
158-
to produce "uncompressed GIFs". This technique does not use the LZW
159-
algorithm; the resulting GIF files are larger than usual, but are readable
160-
by all standard GIF decoders.
161-
162155

163156
REFERENCES
164157
==========
@@ -246,8 +239,8 @@ ARCHIVE LOCATIONS
246239
The "official" archive site for this software is www.ijg.org.
247240
The most recent released version can always be found there in
248241
directory "files". This particular version will be archived as
249-
http://www.ijg.org/files/jpegsrc.v9c.tar.gz, and in Windows-compatible
250-
"zip" archive format as http://www.ijg.org/files/jpegsr9c.zip.
242+
http://www.ijg.org/files/jpegsrc.v9d.tar.gz, and in Windows-compatible
243+
"zip" archive format as http://www.ijg.org/files/jpegsr9d.zip.
251244

252245
The JPEG FAQ (Frequently Asked Questions) article is a source of some
253246
general information about JPEG.

3rdparty/libjpeg/change.log

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,55 @@
11
CHANGE LOG for Independent JPEG Group's JPEG software
22

33

4+
Version 9d 12-Jan-2020
5+
-----------------------
6+
7+
Optimize the optimal Huffman code table generation to produce
8+
slightly smaller files. Thank to John Korejwa for suggestion.
9+
Note: Requires rebuild of testimgp.jpg.
10+
11+
Decoding Huffman: Use default tables if tables are not defined.
12+
Thank to Simone Azzalin for report (Motion JPEG),
13+
and to Martin Strunz for hint.
14+
15+
Add sanity check in optimal Huffman code table generation.
16+
Thank to Adam Farley for suggestion.
17+
18+
rdtarga.c: use read_byte(), with EOF check, instead of getc()
19+
in read_*_pixel().
20+
Thank to Chijin Zhou for cjpeg potential vulnerability report.
21+
22+
jmemnobs.c: respect the max_memory_to_use setting in
23+
jpeg_mem_available() computation. Thank to Sheng Shu and
24+
Dongdong She for djpeg potential vulnerability report.
25+
26+
jdarith.c, jdhuff.c: avoid left shift of negative value
27+
compiler warning in decode_mcu_AC_refine().
28+
Thank to Indu Bhagat for suggestion.
29+
30+
Add x64 (64-bit) platform support, avoid compiler warnings.
31+
Thank to Jonathan Potter, Feiyun Wang, and Sheng Shu for suggestion.
32+
33+
Adjust libjpeg version specification for pkg-config file.
34+
Thank to Chen Chen for suggestion.
35+
36+
Restore GIF read and write support from libjpeg version 6a.
37+
Thank to Wolfgang Werner (W.W.) Heinz for suggestion.
38+
39+
Improve consistency in raw (downsampled) image data processing mode.
40+
Thank to Zhongyuan Zhou for hint.
41+
42+
Avoid out of bounds array read (AC derived table pointers)
43+
in start pass in jdhuff.c. Thank to Peng Li for report.
44+
45+
Improve code sanity (jdhuff.c).
46+
Thank to Reza Mirzazade farkhani for reports.
47+
48+
Add jpegtran -drop option; add options to the crop extension and wipe
49+
to fill the extra area with content from the source image region,
50+
instead of gray out.
51+
52+
453
Version 9c 14-Jan-2018
554
-----------------------
655

3rdparty/libjpeg/jcarith.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* jcarith.c
33
*
4-
* Developed 1997-2013 by Guido Vollbeding.
4+
* Developed 1997-2019 by Guido Vollbeding.
55
* This file is part of the Independent JPEG Group's software.
66
* For conditions of distribution and use, see the accompanying README file.
77
*
@@ -181,11 +181,11 @@ finish_pass (j_compress_ptr cinfo)
181181
if (e->zc) /* output final pending zero bytes */
182182
do emit_byte(0x00, cinfo);
183183
while (--e->zc);
184-
emit_byte((e->c >> 19) & 0xFF, cinfo);
184+
emit_byte((int) ((e->c >> 19) & 0xFF), cinfo);
185185
if (((e->c >> 19) & 0xFF) == 0xFF)
186186
emit_byte(0x00, cinfo);
187187
if (e->c & 0x7F800L) {
188-
emit_byte((e->c >> 11) & 0xFF, cinfo);
188+
emit_byte((int) ((e->c >> 11) & 0xFF), cinfo);
189189
if (((e->c >> 11) & 0xFF) == 0xFF)
190190
emit_byte(0x00, cinfo);
191191
}
@@ -280,7 +280,8 @@ arith_encode (j_compress_ptr cinfo, unsigned char *st, int val)
280280
/* Note: The 3 spacer bits in the C register guarantee
281281
* that the new buffer byte can't be 0xFF here
282282
* (see page 160 in the P&M JPEG book). */
283-
e->buffer = temp & 0xFF; /* new output byte, might overflow later */
283+
/* New output byte, might overflow later */
284+
e->buffer = (int) (temp & 0xFF);
284285
} else if (temp == 0xFF) {
285286
++e->sc; /* stack 0xFF byte (which might overflow later) */
286287
} else {
@@ -302,7 +303,8 @@ arith_encode (j_compress_ptr cinfo, unsigned char *st, int val)
302303
emit_byte(0x00, cinfo);
303304
} while (--e->sc);
304305
}
305-
e->buffer = temp & 0xFF; /* new output byte (can still overflow) */
306+
/* New output byte (can still overflow) */
307+
e->buffer = (int) (temp & 0xFF);
306308
}
307309
e->c &= 0x7FFFFL;
308310
e->ct += 8;
@@ -926,9 +928,8 @@ jinit_arith_encoder (j_compress_ptr cinfo)
926928
arith_entropy_ptr entropy;
927929
int i;
928930

929-
entropy = (arith_entropy_ptr)
930-
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
931-
SIZEOF(arith_entropy_encoder));
931+
entropy = (arith_entropy_ptr) (*cinfo->mem->alloc_small)
932+
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(arith_entropy_encoder));
932933
cinfo->entropy = &entropy->pub;
933934
entropy->pub.start_pass = start_pass;
934935
entropy->pub.finish_pass = finish_pass;

0 commit comments

Comments
 (0)