···11The Independent JPEG Group's JPEG software
22==========================================
3344-README for release 9b of 17-Jan-2016
44+README for release 9c of 14-Jan-2018
55====================================
6677This distribution contains the ninth public release of the Independent JPEG
···115115fitness for a particular purpose. This software is provided "AS IS", and you,
116116its user, assume the entire risk as to its quality and accuracy.
117117118118-This software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding.
118118+This software is copyright (C) 1991-2018, Thomas G. Lane, Guido Vollbeding.
119119All Rights Reserved except as specified below.
120120121121Permission is hereby granted to use, copy, modify, and distribute this
···246246The "official" archive site for this software is www.ijg.org.
247247The most recent released version can always be found there in
248248directory "files". This particular version will be archived as
249249-http://www.ijg.org/files/jpegsrc.v9b.tar.gz, and in Windows-compatible
250250-"zip" archive format as http://www.ijg.org/files/jpegsr9b.zip.
249249+http://www.ijg.org/files/jpegsrc.v9c.tar.gz, and in Windows-compatible
250250+"zip" archive format as http://www.ijg.org/files/jpegsr9c.zip.
251251252252The JPEG FAQ (Frequently Asked Questions) article is a source of some
253253general information about JPEG.
···293293294294Thank to Andrew Finkenstadt for hosting the ijg.org site.
295295296296-Last but not least special thank to Thomas G. Lane for the original
297297-design and development of this singular software package.
296296+Thank to Thomas G. Lane for the original design and development of
297297+this singular software package.
298298+299299+Thank to Lars Goehler, Andreas Heinecke, Sebastian Fuss, Yvonne Roebert,
300300+Andrej Werner, and Ulf-Dietrich Braumann for support and public relations.
298301299302300303FILE FORMAT WARS
+21
dll/3rdparty/libjpeg/change.log
···11CHANGE LOG for Independent JPEG Group's JPEG software
223344+Version 9c 14-Jan-2018
55+-----------------------
66+77+jpegtran: add an option to the -wipe switch to fill the region
88+with the average of adjacent blocks, instead of gray out.
99+Thank to Caitlyn Feddock and Maddie Ziegler for inspiration.
1010+1111+Make range extension bits adjustable (in jpegint.h).
1212+Thank to Robin Watts for suggestion.
1313+1414+Provide macros for fflush() and ferror() in jinclude.h in order
1515+to facilitate adaption by applications using an own FILE class.
1616+Thank to Gerhard Huber for suggestion.
1717+1818+Add libjpeg pkg-config file. Thank to Mark Lavi, Vincent Torri,
1919+Patrick McMunn, and Huw Davies for suggestion.
2020+2121+Add sanity checks in cjpeg image reader modules.
2222+Thank to Bingchang, Liu for reports.
2323+2424+425Version 9b 17-Jan-2016
526-----------------------
627
+167-2
dll/3rdparty/libjpeg/jcinit.c
···22 * jcinit.c
33 *
44 * Copyright (C) 1991-1997, Thomas G. Lane.
55- * Modified 2003-2013 by Guido Vollbeding.
55+ * Modified 2003-2017 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 *
···222223232424/*
2525+ * Compute JPEG image dimensions and related values.
2626+ * NOTE: this is exported for possible use by application.
2727+ * Hence it mustn't do anything that can't be done twice.
2828+ */
2929+3030+GLOBAL(void)
3131+jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo)
3232+/* Do computations that are needed before master selection phase */
3333+{
3434+ /* Sanity check on input image dimensions to prevent overflow in
3535+ * following calculations.
3636+ * We do check jpeg_width and jpeg_height in initial_setup in jcmaster.c,
3737+ * but image_width and image_height can come from arbitrary data,
3838+ * and we need some space for multiplication by block_size.
3939+ */
4040+ if (((long) cinfo->image_width >> 24) || ((long) cinfo->image_height >> 24))
4141+ ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
4242+4343+#ifdef DCT_SCALING_SUPPORTED
4444+4545+ /* Compute actual JPEG image dimensions and DCT scaling choices. */
4646+ if (cinfo->scale_num >= cinfo->scale_denom * cinfo->block_size) {
4747+ /* Provide block_size/1 scaling */
4848+ cinfo->jpeg_width = cinfo->image_width * cinfo->block_size;
4949+ cinfo->jpeg_height = cinfo->image_height * cinfo->block_size;
5050+ cinfo->min_DCT_h_scaled_size = 1;
5151+ cinfo->min_DCT_v_scaled_size = 1;
5252+ } else if (cinfo->scale_num * 2 >= cinfo->scale_denom * cinfo->block_size) {
5353+ /* Provide block_size/2 scaling */
5454+ cinfo->jpeg_width = (JDIMENSION)
5555+ jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 2L);
5656+ cinfo->jpeg_height = (JDIMENSION)
5757+ jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 2L);
5858+ cinfo->min_DCT_h_scaled_size = 2;
5959+ cinfo->min_DCT_v_scaled_size = 2;
6060+ } else if (cinfo->scale_num * 3 >= cinfo->scale_denom * cinfo->block_size) {
6161+ /* Provide block_size/3 scaling */
6262+ cinfo->jpeg_width = (JDIMENSION)
6363+ jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 3L);
6464+ cinfo->jpeg_height = (JDIMENSION)
6565+ jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 3L);
6666+ cinfo->min_DCT_h_scaled_size = 3;
6767+ cinfo->min_DCT_v_scaled_size = 3;
6868+ } else if (cinfo->scale_num * 4 >= cinfo->scale_denom * cinfo->block_size) {
6969+ /* Provide block_size/4 scaling */
7070+ cinfo->jpeg_width = (JDIMENSION)
7171+ jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 4L);
7272+ cinfo->jpeg_height = (JDIMENSION)
7373+ jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 4L);
7474+ cinfo->min_DCT_h_scaled_size = 4;
7575+ cinfo->min_DCT_v_scaled_size = 4;
7676+ } else if (cinfo->scale_num * 5 >= cinfo->scale_denom * cinfo->block_size) {
7777+ /* Provide block_size/5 scaling */
7878+ cinfo->jpeg_width = (JDIMENSION)
7979+ jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 5L);
8080+ cinfo->jpeg_height = (JDIMENSION)
8181+ jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 5L);
8282+ cinfo->min_DCT_h_scaled_size = 5;
8383+ cinfo->min_DCT_v_scaled_size = 5;
8484+ } else if (cinfo->scale_num * 6 >= cinfo->scale_denom * cinfo->block_size) {
8585+ /* Provide block_size/6 scaling */
8686+ cinfo->jpeg_width = (JDIMENSION)
8787+ jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 6L);
8888+ cinfo->jpeg_height = (JDIMENSION)
8989+ jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 6L);
9090+ cinfo->min_DCT_h_scaled_size = 6;
9191+ cinfo->min_DCT_v_scaled_size = 6;
9292+ } else if (cinfo->scale_num * 7 >= cinfo->scale_denom * cinfo->block_size) {
9393+ /* Provide block_size/7 scaling */
9494+ cinfo->jpeg_width = (JDIMENSION)
9595+ jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 7L);
9696+ cinfo->jpeg_height = (JDIMENSION)
9797+ jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 7L);
9898+ cinfo->min_DCT_h_scaled_size = 7;
9999+ cinfo->min_DCT_v_scaled_size = 7;
100100+ } else if (cinfo->scale_num * 8 >= cinfo->scale_denom * cinfo->block_size) {
101101+ /* Provide block_size/8 scaling */
102102+ cinfo->jpeg_width = (JDIMENSION)
103103+ jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 8L);
104104+ cinfo->jpeg_height = (JDIMENSION)
105105+ jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 8L);
106106+ cinfo->min_DCT_h_scaled_size = 8;
107107+ cinfo->min_DCT_v_scaled_size = 8;
108108+ } else if (cinfo->scale_num * 9 >= cinfo->scale_denom * cinfo->block_size) {
109109+ /* Provide block_size/9 scaling */
110110+ cinfo->jpeg_width = (JDIMENSION)
111111+ jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 9L);
112112+ cinfo->jpeg_height = (JDIMENSION)
113113+ jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 9L);
114114+ cinfo->min_DCT_h_scaled_size = 9;
115115+ cinfo->min_DCT_v_scaled_size = 9;
116116+ } else if (cinfo->scale_num * 10 >= cinfo->scale_denom * cinfo->block_size) {
117117+ /* Provide block_size/10 scaling */
118118+ cinfo->jpeg_width = (JDIMENSION)
119119+ jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 10L);
120120+ cinfo->jpeg_height = (JDIMENSION)
121121+ jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 10L);
122122+ cinfo->min_DCT_h_scaled_size = 10;
123123+ cinfo->min_DCT_v_scaled_size = 10;
124124+ } else if (cinfo->scale_num * 11 >= cinfo->scale_denom * cinfo->block_size) {
125125+ /* Provide block_size/11 scaling */
126126+ cinfo->jpeg_width = (JDIMENSION)
127127+ jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 11L);
128128+ cinfo->jpeg_height = (JDIMENSION)
129129+ jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 11L);
130130+ cinfo->min_DCT_h_scaled_size = 11;
131131+ cinfo->min_DCT_v_scaled_size = 11;
132132+ } else if (cinfo->scale_num * 12 >= cinfo->scale_denom * cinfo->block_size) {
133133+ /* Provide block_size/12 scaling */
134134+ cinfo->jpeg_width = (JDIMENSION)
135135+ jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 12L);
136136+ cinfo->jpeg_height = (JDIMENSION)
137137+ jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 12L);
138138+ cinfo->min_DCT_h_scaled_size = 12;
139139+ cinfo->min_DCT_v_scaled_size = 12;
140140+ } else if (cinfo->scale_num * 13 >= cinfo->scale_denom * cinfo->block_size) {
141141+ /* Provide block_size/13 scaling */
142142+ cinfo->jpeg_width = (JDIMENSION)
143143+ jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 13L);
144144+ cinfo->jpeg_height = (JDIMENSION)
145145+ jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 13L);
146146+ cinfo->min_DCT_h_scaled_size = 13;
147147+ cinfo->min_DCT_v_scaled_size = 13;
148148+ } else if (cinfo->scale_num * 14 >= cinfo->scale_denom * cinfo->block_size) {
149149+ /* Provide block_size/14 scaling */
150150+ cinfo->jpeg_width = (JDIMENSION)
151151+ jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 14L);
152152+ cinfo->jpeg_height = (JDIMENSION)
153153+ jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 14L);
154154+ cinfo->min_DCT_h_scaled_size = 14;
155155+ cinfo->min_DCT_v_scaled_size = 14;
156156+ } else if (cinfo->scale_num * 15 >= cinfo->scale_denom * cinfo->block_size) {
157157+ /* Provide block_size/15 scaling */
158158+ cinfo->jpeg_width = (JDIMENSION)
159159+ jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 15L);
160160+ cinfo->jpeg_height = (JDIMENSION)
161161+ jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 15L);
162162+ cinfo->min_DCT_h_scaled_size = 15;
163163+ cinfo->min_DCT_v_scaled_size = 15;
164164+ } else {
165165+ /* Provide block_size/16 scaling */
166166+ cinfo->jpeg_width = (JDIMENSION)
167167+ jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 16L);
168168+ cinfo->jpeg_height = (JDIMENSION)
169169+ jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 16L);
170170+ cinfo->min_DCT_h_scaled_size = 16;
171171+ cinfo->min_DCT_v_scaled_size = 16;
172172+ }
173173+174174+#else /* !DCT_SCALING_SUPPORTED */
175175+176176+ /* Hardwire it to "no scaling" */
177177+ cinfo->jpeg_width = cinfo->image_width;
178178+ cinfo->jpeg_height = cinfo->image_height;
179179+ cinfo->min_DCT_h_scaled_size = DCTSIZE;
180180+ cinfo->min_DCT_v_scaled_size = DCTSIZE;
181181+182182+#endif /* DCT_SCALING_SUPPORTED */
183183+}
184184+185185+186186+/*
25187 * Master selection of compression modules.
26188 * This is done once at the start of processing an image. We determine
27189 * which modules will be used and give them appropriate initialization calls.
···37199 if (cinfo->data_precision != BITS_IN_JSAMPLE)
38200 ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
392014040- /* Sanity check on image dimensions */
202202+ /* Sanity check on input image dimensions */
41203 if (cinfo->image_height <= 0 || cinfo->image_width <= 0 ||
42204 cinfo->input_components <= 0)
43205 ERREXIT(cinfo, JERR_EMPTY_IMAGE);
···47209 jd_samplesperrow = (JDIMENSION) samplesperrow;
48210 if ((long) jd_samplesperrow != samplesperrow)
49211 ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
212212+213213+ /* Compute JPEG image dimensions and related values. */
214214+ jpeg_calc_jpeg_dimensions(cinfo);
5021551216 /* Initialize master control (includes parameter checking/processing) */
52217 jinit_c_master_control(cinfo, FALSE /* full compression */);
+5-187
dll/3rdparty/libjpeg/jcmaster.c
···22 * jcmaster.c
33 *
44 * Copyright (C) 1991-1997, Thomas G. Lane.
55- * Modified 2003-2013 by Guido Vollbeding.
55+ * Modified 2003-2017 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 *
···4343 * Support routines that do various essential calculations.
4444 */
45454646-/*
4747- * Compute JPEG image dimensions and related values.
4848- * NOTE: this is exported for possible use by application.
4949- * Hence it mustn't do anything that can't be done twice.
5050- */
5151-5252-GLOBAL(void)
5353-jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo)
5454-/* Do computations that are needed before master selection phase */
5555-{
5656-#ifdef DCT_SCALING_SUPPORTED
5757-5858- /* Sanity check on input image dimensions to prevent overflow in
5959- * following calculation.
6060- * We do check jpeg_width and jpeg_height in initial_setup below,
6161- * but image_width and image_height can come from arbitrary data,
6262- * and we need some space for multiplication by block_size.
6363- */
6464- if (((long) cinfo->image_width >> 24) || ((long) cinfo->image_height >> 24))
6565- ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
6666-6767- /* Compute actual JPEG image dimensions and DCT scaling choices. */
6868- if (cinfo->scale_num >= cinfo->scale_denom * cinfo->block_size) {
6969- /* Provide block_size/1 scaling */
7070- cinfo->jpeg_width = cinfo->image_width * cinfo->block_size;
7171- cinfo->jpeg_height = cinfo->image_height * cinfo->block_size;
7272- cinfo->min_DCT_h_scaled_size = 1;
7373- cinfo->min_DCT_v_scaled_size = 1;
7474- } else if (cinfo->scale_num * 2 >= cinfo->scale_denom * cinfo->block_size) {
7575- /* Provide block_size/2 scaling */
7676- cinfo->jpeg_width = (JDIMENSION)
7777- jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 2L);
7878- cinfo->jpeg_height = (JDIMENSION)
7979- jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 2L);
8080- cinfo->min_DCT_h_scaled_size = 2;
8181- cinfo->min_DCT_v_scaled_size = 2;
8282- } else if (cinfo->scale_num * 3 >= cinfo->scale_denom * cinfo->block_size) {
8383- /* Provide block_size/3 scaling */
8484- cinfo->jpeg_width = (JDIMENSION)
8585- jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 3L);
8686- cinfo->jpeg_height = (JDIMENSION)
8787- jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 3L);
8888- cinfo->min_DCT_h_scaled_size = 3;
8989- cinfo->min_DCT_v_scaled_size = 3;
9090- } else if (cinfo->scale_num * 4 >= cinfo->scale_denom * cinfo->block_size) {
9191- /* Provide block_size/4 scaling */
9292- cinfo->jpeg_width = (JDIMENSION)
9393- jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 4L);
9494- cinfo->jpeg_height = (JDIMENSION)
9595- jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 4L);
9696- cinfo->min_DCT_h_scaled_size = 4;
9797- cinfo->min_DCT_v_scaled_size = 4;
9898- } else if (cinfo->scale_num * 5 >= cinfo->scale_denom * cinfo->block_size) {
9999- /* Provide block_size/5 scaling */
100100- cinfo->jpeg_width = (JDIMENSION)
101101- jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 5L);
102102- cinfo->jpeg_height = (JDIMENSION)
103103- jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 5L);
104104- cinfo->min_DCT_h_scaled_size = 5;
105105- cinfo->min_DCT_v_scaled_size = 5;
106106- } else if (cinfo->scale_num * 6 >= cinfo->scale_denom * cinfo->block_size) {
107107- /* Provide block_size/6 scaling */
108108- cinfo->jpeg_width = (JDIMENSION)
109109- jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 6L);
110110- cinfo->jpeg_height = (JDIMENSION)
111111- jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 6L);
112112- cinfo->min_DCT_h_scaled_size = 6;
113113- cinfo->min_DCT_v_scaled_size = 6;
114114- } else if (cinfo->scale_num * 7 >= cinfo->scale_denom * cinfo->block_size) {
115115- /* Provide block_size/7 scaling */
116116- cinfo->jpeg_width = (JDIMENSION)
117117- jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 7L);
118118- cinfo->jpeg_height = (JDIMENSION)
119119- jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 7L);
120120- cinfo->min_DCT_h_scaled_size = 7;
121121- cinfo->min_DCT_v_scaled_size = 7;
122122- } else if (cinfo->scale_num * 8 >= cinfo->scale_denom * cinfo->block_size) {
123123- /* Provide block_size/8 scaling */
124124- cinfo->jpeg_width = (JDIMENSION)
125125- jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 8L);
126126- cinfo->jpeg_height = (JDIMENSION)
127127- jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 8L);
128128- cinfo->min_DCT_h_scaled_size = 8;
129129- cinfo->min_DCT_v_scaled_size = 8;
130130- } else if (cinfo->scale_num * 9 >= cinfo->scale_denom * cinfo->block_size) {
131131- /* Provide block_size/9 scaling */
132132- cinfo->jpeg_width = (JDIMENSION)
133133- jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 9L);
134134- cinfo->jpeg_height = (JDIMENSION)
135135- jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 9L);
136136- cinfo->min_DCT_h_scaled_size = 9;
137137- cinfo->min_DCT_v_scaled_size = 9;
138138- } else if (cinfo->scale_num * 10 >= cinfo->scale_denom * cinfo->block_size) {
139139- /* Provide block_size/10 scaling */
140140- cinfo->jpeg_width = (JDIMENSION)
141141- jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 10L);
142142- cinfo->jpeg_height = (JDIMENSION)
143143- jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 10L);
144144- cinfo->min_DCT_h_scaled_size = 10;
145145- cinfo->min_DCT_v_scaled_size = 10;
146146- } else if (cinfo->scale_num * 11 >= cinfo->scale_denom * cinfo->block_size) {
147147- /* Provide block_size/11 scaling */
148148- cinfo->jpeg_width = (JDIMENSION)
149149- jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 11L);
150150- cinfo->jpeg_height = (JDIMENSION)
151151- jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 11L);
152152- cinfo->min_DCT_h_scaled_size = 11;
153153- cinfo->min_DCT_v_scaled_size = 11;
154154- } else if (cinfo->scale_num * 12 >= cinfo->scale_denom * cinfo->block_size) {
155155- /* Provide block_size/12 scaling */
156156- cinfo->jpeg_width = (JDIMENSION)
157157- jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 12L);
158158- cinfo->jpeg_height = (JDIMENSION)
159159- jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 12L);
160160- cinfo->min_DCT_h_scaled_size = 12;
161161- cinfo->min_DCT_v_scaled_size = 12;
162162- } else if (cinfo->scale_num * 13 >= cinfo->scale_denom * cinfo->block_size) {
163163- /* Provide block_size/13 scaling */
164164- cinfo->jpeg_width = (JDIMENSION)
165165- jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 13L);
166166- cinfo->jpeg_height = (JDIMENSION)
167167- jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 13L);
168168- cinfo->min_DCT_h_scaled_size = 13;
169169- cinfo->min_DCT_v_scaled_size = 13;
170170- } else if (cinfo->scale_num * 14 >= cinfo->scale_denom * cinfo->block_size) {
171171- /* Provide block_size/14 scaling */
172172- cinfo->jpeg_width = (JDIMENSION)
173173- jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 14L);
174174- cinfo->jpeg_height = (JDIMENSION)
175175- jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 14L);
176176- cinfo->min_DCT_h_scaled_size = 14;
177177- cinfo->min_DCT_v_scaled_size = 14;
178178- } else if (cinfo->scale_num * 15 >= cinfo->scale_denom * cinfo->block_size) {
179179- /* Provide block_size/15 scaling */
180180- cinfo->jpeg_width = (JDIMENSION)
181181- jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 15L);
182182- cinfo->jpeg_height = (JDIMENSION)
183183- jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 15L);
184184- cinfo->min_DCT_h_scaled_size = 15;
185185- cinfo->min_DCT_v_scaled_size = 15;
186186- } else {
187187- /* Provide block_size/16 scaling */
188188- cinfo->jpeg_width = (JDIMENSION)
189189- jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 16L);
190190- cinfo->jpeg_height = (JDIMENSION)
191191- jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 16L);
192192- cinfo->min_DCT_h_scaled_size = 16;
193193- cinfo->min_DCT_v_scaled_size = 16;
194194- }
195195-196196-#else /* !DCT_SCALING_SUPPORTED */
197197-198198- /* Hardwire it to "no scaling" */
199199- cinfo->jpeg_width = cinfo->image_width;
200200- cinfo->jpeg_height = cinfo->image_height;
201201- cinfo->min_DCT_h_scaled_size = DCTSIZE;
202202- cinfo->min_DCT_v_scaled_size = DCTSIZE;
203203-204204-#endif /* DCT_SCALING_SUPPORTED */
205205-}
206206-207207-20846LOCAL(void)
209209-jpeg_calc_trans_dimensions (j_compress_ptr cinfo)
210210-{
211211- if (cinfo->min_DCT_h_scaled_size != cinfo->min_DCT_v_scaled_size)
212212- ERREXIT2(cinfo, JERR_BAD_DCTSIZE,
213213- cinfo->min_DCT_h_scaled_size, cinfo->min_DCT_v_scaled_size);
214214-215215- cinfo->block_size = cinfo->min_DCT_h_scaled_size;
216216-}
217217-218218-219219-LOCAL(void)
220220-initial_setup (j_compress_ptr cinfo, boolean transcode_only)
4747+initial_setup (j_compress_ptr cinfo)
22148/* Do computations that are needed before master selection phase */
22249{
22350 int ci, ssize;
22451 jpeg_component_info *compptr;
225225-226226- if (transcode_only)
227227- jpeg_calc_trans_dimensions(cinfo);
228228- else
229229- jpeg_calc_jpeg_dimensions(cinfo);
2305223153 /* Sanity check on block_size */
23254 if (cinfo->block_size < 1 || cinfo->block_size > 16)
···414236 * out-of-range reconstructed DC values during the first DC scan,
415237 * which might cause problems for some decoders.
416238 */
417417-#if BITS_IN_JSAMPLE == 8
418418-#define MAX_AH_AL 10
419419-#else
420420-#define MAX_AH_AL 13
421421-#endif
422239 if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 ||
423423- Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL)
240240+ Ah < 0 || Ah > (cinfo->data_precision > 8 ? 13 : 10) ||
241241+ Al < 0 || Al > (cinfo->data_precision > 8 ? 13 : 10))
424242 ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
425243 if (Ss == 0) {
426244 if (Se != 0) /* DC and AC together not OK */
···812630 master->pub.is_last_pass = FALSE;
813631814632 /* Validate parameters, determine derived values */
815815- initial_setup(cinfo, transcode_only);
633633+ initial_setup(cinfo);
816634817635 if (cinfo->scan_info != NULL) {
818636#ifdef C_MULTISCAN_FILES_SUPPORTED
+21-3
dll/3rdparty/libjpeg/jctrans.c
···22 * jctrans.c
33 *
44 * Copyright (C) 1995-1998, Thomas G. Lane.
55- * Modified 2000-2013 by Guido Vollbeding.
55+ * Modified 2000-2017 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 *
···8585 jpeg_set_defaults(dstinfo);
8686 /* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB.
8787 * Fix it to get the right header markers for the image colorspace.
8888- * Note: Entropy table assignment in jpeg_set_colorspace depends
8989- * on color_transform.
8888+ * Note: Entropy table assignment in jpeg_set_colorspace
8989+ * depends on color_transform.
9090+ * Adaption is also required for setting the appropriate
9191+ * entropy coding mode dependent on image data precision.
9092 */
9193 dstinfo->color_transform = srcinfo->color_transform;
9294 jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space);
9395 dstinfo->data_precision = srcinfo->data_precision;
9696+ dstinfo->arith_code = srcinfo->data_precision > 8 ? TRUE : FALSE;
9497 dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling;
9598 /* Copy the source's quantization tables. */
9699 for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {
···157160}
158161159162163163+LOCAL(void)
164164+jpeg_calc_trans_dimensions (j_compress_ptr cinfo)
165165+/* Do computations that are needed before master selection phase */
166166+{
167167+ if (cinfo->min_DCT_h_scaled_size != cinfo->min_DCT_v_scaled_size)
168168+ ERREXIT2(cinfo, JERR_BAD_DCTSIZE,
169169+ cinfo->min_DCT_h_scaled_size, cinfo->min_DCT_v_scaled_size);
170170+171171+ cinfo->block_size = cinfo->min_DCT_h_scaled_size;
172172+}
173173+174174+160175/*
161176 * Master selection of compression modules for transcoding.
162177 * This substitutes for jcinit.c's initialization of the full compressor.
···166181transencode_master_selection (j_compress_ptr cinfo,
167182 jvirt_barray_ptr * coef_arrays)
168183{
184184+ /* Do computations that are needed before master selection phase */
185185+ jpeg_calc_trans_dimensions(cinfo);
186186+169187 /* Initialize master control (includes parameter checking/processing) */
170188 jinit_c_master_control(cinfo, TRUE /* transcode only */);
171189
+3-3
dll/3rdparty/libjpeg/jdatadst.c
···22 * jdatadst.c
33 *
44 * Copyright (C) 1994-1996, Thomas G. Lane.
55- * Modified 2009-2012 by Guido Vollbeding.
55+ * Modified 2009-2017 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 *
···170170 if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount)
171171 ERREXIT(cinfo, JERR_FILE_WRITE);
172172 }
173173- fflush(dest->outfile);
173173+ JFFLUSH(dest->outfile);
174174 /* Make sure we wrote the output file OK */
175175- if (ferror(dest->outfile))
175175+ if (JFERROR(dest->outfile))
176176 ERREXIT(cinfo, JERR_FILE_WRITE);
177177}
178178
+7-1
dll/3rdparty/libjpeg/jdcolor.c
···22 * jdcolor.c
33 *
44 * Copyright (C) 1991-1997, Thomas G. Lane.
55- * Modified 2011-2015 by Guido Vollbeding.
55+ * Modified 2011-2017 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 *
···1212#define JPEG_INTERNALS
1313#include "jinclude.h"
1414#include "jpeglib.h"
1515+1616+1717+#if RANGE_BITS < 2
1818+ /* Deliberate syntax err */
1919+ Sorry, this code requires 2 or more range extension bits.
2020+#endif
152116221723/* Private subobject */
+4-5
dll/3rdparty/libjpeg/jdhuff.c
···22 * jdhuff.c
33 *
44 * Copyright (C) 1991-1997, Thomas G. Lane.
55- * Modified 2006-2013 by Guido Vollbeding.
55+ * Modified 2006-2016 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 *
···799799 */
800800 if (! entropy->insufficient_data) {
801801802802- Se = cinfo->Se;
803803- Al = cinfo->Al;
804804- natural_order = cinfo->natural_order;
805805-806802 /* Load up working state.
807803 * We can avoid loading/saving bitread state if in an EOB run.
808804 */
···814810 EOBRUN--; /* ...process it now (we do nothing) */
815811 else {
816812 BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
813813+ Se = cinfo->Se;
814814+ Al = cinfo->Al;
815815+ natural_order = cinfo->natural_order;
817816 block = MCU_data[0];
818817 tbl = entropy->ac_derived_tbl;
819818
+20-26
dll/3rdparty/libjpeg/jdmainct.c
···22 * jdmainct.c
33 *
44 * Copyright (C) 1994-1996, Thomas G. Lane.
55- * Modified 2002-2012 by Guido Vollbeding.
55+ * Modified 2002-2016 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 *
···2626 * trivial. Its responsibility is to provide context rows for upsampling/
2727 * rescaling, and doing this in an efficient fashion is a bit tricky.
2828 *
2929- * Postprocessor input data is counted in "row groups". A row group
3030- * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size)
2929+ * Postprocessor input data is counted in "row groups". A row group is
3030+ * defined to be (v_samp_factor * DCT_v_scaled_size / min_DCT_v_scaled_size)
3131 * sample rows of each component. (We require DCT_scaled_size values to be
3232 * chosen such that these numbers are integers. In practice DCT_scaled_size
3333 * values will likely be powers of two, so we actually have the stronger
···3737 * applying).
3838 *
3939 * The coefficient controller will deliver data to us one iMCU row at a time;
4040- * each iMCU row contains v_samp_factor * DCT_scaled_size sample rows, or
4141- * exactly min_DCT_scaled_size row groups. (This amount of data corresponds
4040+ * each iMCU row contains v_samp_factor * DCT_v_scaled_size sample rows, or
4141+ * exactly min_DCT_v_scaled_size row groups. (This amount of data corresponds
4242 * to one row of MCUs when the image is fully interleaved.) Note that the
4343 * number of sample rows varies across components, but the number of row
4444 * groups does not. Some garbage sample rows may be included in the last iMCU
···7575 * We could do this most simply by copying data around in our buffer, but
7676 * that'd be very slow. We can avoid copying any data by creating a rather
7777 * strange pointer structure. Here's how it works. We allocate a workspace
7878- * consisting of M+2 row groups (where M = min_DCT_scaled_size is the number
7878+ * consisting of M+2 row groups (where M = min_DCT_v_scaled_size is the number
7979 * of row groups per iMCU row). We create two sets of redundant pointers to
8080 * the workspace. Labeling the physical row groups 0 to M+1, the synthesized
8181 * pointer lists look like this:
···100100 * the first or last sample row as necessary (this is cheaper than copying
101101 * sample rows around).
102102 *
103103- * This scheme breaks down if M < 2, ie, min_DCT_scaled_size is 1. In that
103103+ * This scheme breaks down if M < 2, ie, min_DCT_v_scaled_size is 1. In that
104104 * situation each iMCU row provides only one row group so the buffering logic
105105 * must be different (eg, we must read two iMCU rows before we can emit the
106106 * first row group). For now, we simply do not support providing context
107107- * rows when min_DCT_scaled_size is 1. That combination seems unlikely to
107107+ * rows when min_DCT_v_scaled_size is 1. That combination seems unlikely to
108108 * be worth providing --- if someone wants a 1/8th-size preview, they probably
109109 * want it quick and dirty, so a context-free upsampler is sufficient.
110110 */
···118118 /* Pointer to allocated workspace (M or M+2 row groups). */
119119 JSAMPARRAY buffer[MAX_COMPONENTS];
120120121121- boolean buffer_full; /* Have we gotten an iMCU row from decoder? */
122121 JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */
122122+ JDIMENSION rowgroups_avail; /* row groups available to postprocessor */
123123124124 /* Remaining fields are only used in the context case. */
125125+126126+ boolean buffer_full; /* Have we gotten an iMCU row from decoder? */
125127126128 /* These are the master pointers to the funny-order pointer lists. */
127129 JSAMPIMAGE xbuffer[2]; /* pointers to weird pointer lists */
128130129131 int whichptr; /* indicates which pointer set is now in use */
130132 int context_state; /* process_data state machine status */
131131- JDIMENSION rowgroups_avail; /* row groups available to postprocessor */
132133 JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */
133134} my_main_controller;
134135···195196LOCAL(void)
196197make_funny_pointers (j_decompress_ptr cinfo)
197198/* Create the funny pointer lists discussed in the comments above.
198198- * The actual workspace is already allocated (in main->buffer),
199199+ * The actual workspace is already allocated (in mainp->buffer),
199200 * and the space for the pointer lists is allocated too.
200201 * This routine just fills in the curiously ordered lists.
201202 * This will be repeated at the beginning of each pass.
···317318 mainp->whichptr = 0; /* Read first iMCU row into xbuffer[0] */
318319 mainp->context_state = CTX_PREPARE_FOR_IMCU;
319320 mainp->iMCU_row_ctr = 0;
321321+ mainp->buffer_full = FALSE; /* Mark buffer empty */
320322 } else {
321323 /* Simple case with no context needed */
322324 mainp->pub.process_data = process_data_simple_main;
325325+ mainp->rowgroup_ctr = mainp->rowgroups_avail; /* Mark buffer empty */
323326 }
324324- mainp->buffer_full = FALSE; /* Mark buffer empty */
325325- mainp->rowgroup_ctr = 0;
326327 break;
327328#ifdef QUANT_2PASS_SUPPORTED
328329 case JBUF_CRANK_DEST:
···348349 JDIMENSION out_rows_avail)
349350{
350351 my_main_ptr mainp = (my_main_ptr) cinfo->main;
351351- JDIMENSION rowgroups_avail;
352352353353 /* Read input data if we haven't filled the main buffer yet */
354354- if (! mainp->buffer_full) {
354354+ if (mainp->rowgroup_ctr >= mainp->rowgroups_avail) {
355355 if (! (*cinfo->coef->decompress_data) (cinfo, mainp->buffer))
356356 return; /* suspension forced, can do nothing more */
357357- mainp->buffer_full = TRUE; /* OK, we have an iMCU row to work with */
357357+ mainp->rowgroup_ctr = 0; /* OK, we have an iMCU row to work with */
358358 }
359359360360- /* There are always min_DCT_scaled_size row groups in an iMCU row. */
361361- rowgroups_avail = (JDIMENSION) cinfo->min_DCT_v_scaled_size;
362360 /* Note: at the bottom of the image, we may pass extra garbage row groups
363361 * to the postprocessor. The postprocessor has to check for bottom
364362 * of image anyway (at row resolution), so no point in us doing it too.
···366364367365 /* Feed the postprocessor */
368366 (*cinfo->post->post_process_data) (cinfo, mainp->buffer,
369369- &mainp->rowgroup_ctr, rowgroups_avail,
370370- output_buf, out_row_ctr, out_rows_avail);
371371-372372- /* Has postprocessor consumed all the data yet? If so, mark buffer empty */
373373- if (mainp->rowgroup_ctr >= rowgroups_avail) {
374374- mainp->buffer_full = FALSE;
375375- mainp->rowgroup_ctr = 0;
376376- }
367367+ &mainp->rowgroup_ctr, mainp->rowgroups_avail,
368368+ output_buf, out_row_ctr, out_rows_avail);
377369}
378370379371···498490 alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */
499491 ngroups = cinfo->min_DCT_v_scaled_size + 2;
500492 } else {
493493+ /* There are always min_DCT_v_scaled_size row groups in an iMCU row. */
501494 ngroups = cinfo->min_DCT_v_scaled_size;
495495+ mainp->rowgroups_avail = (JDIMENSION) ngroups;
502496 }
503497504498 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+6-7
dll/3rdparty/libjpeg/jdmaster.c
···22 * jdmaster.c
33 *
44 * Copyright (C) 1991-1997, Thomas G. Lane.
55- * Modified 2002-2015 by Guido Vollbeding.
55+ * Modified 2002-2017 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 *
···237237 JSAMPLE * table;
238238 int i;
239239240240- table = (JSAMPLE *)
241241- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
242242- 5 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
240240+ table = (JSAMPLE *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo,
241241+ JPOOL_IMAGE, (RANGE_CENTER * 2 + MAXJSAMPLE + 1) * SIZEOF(JSAMPLE));
243242 /* First segment of range limit table: limit[x] = 0 for x < 0 */
244244- MEMZERO(table, 2 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
245245- table += 2 * (MAXJSAMPLE+1); /* allow negative subscripts of table */
243243+ MEMZERO(table, RANGE_CENTER * SIZEOF(JSAMPLE));
244244+ table += RANGE_CENTER; /* allow negative subscripts of table */
246245 cinfo->sample_range_limit = table;
247246 /* Main part of range limit table: limit[x] = x */
248247 for (i = 0; i <= MAXJSAMPLE; i++)
249248 table[i] = (JSAMPLE) i;
250249 /* End of range limit table: limit[x] = MAXJSAMPLE for x > MAXJSAMPLE */
251251- for (; i < 3 * (MAXJSAMPLE+1); i++)
250250+ for (; i <= MAXJSAMPLE + RANGE_CENTER; i++)
252251 table[i] = MAXJSAMPLE;
253252}
254253
+7-1
dll/3rdparty/libjpeg/jdmerge.c
···22 * jdmerge.c
33 *
44 * Copyright (C) 1994-1996, Thomas G. Lane.
55- * Modified 2013-2015 by Guido Vollbeding.
55+ * Modified 2013-2017 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 *
···3838#include "jpeglib.h"
39394040#ifdef UPSAMPLE_MERGING_SUPPORTED
4141+4242+4343+#if RANGE_BITS < 2
4444+ /* Deliberate syntax err */
4545+ Sorry, this code requires 2 or more range extension bits.
4646+#endif
414742484349/* Private subobject */
+2-2
dll/3rdparty/libjpeg/jfdctflt.c
···22 * jfdctflt.c
33 *
44 * Copyright (C) 1994-1996, Thomas G. Lane.
55- * Modified 2003-2015 by Guido Vollbeding.
55+ * Modified 2003-2017 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 *
···4848 */
49495050#if DCTSIZE != 8
5151- Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
5151+ Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
5252#endif
53535454
+2-2
dll/3rdparty/libjpeg/jfdctfst.c
···22 * jfdctfst.c
33 *
44 * Copyright (C) 1994-1996, Thomas G. Lane.
55- * Modified 2003-2015 by Guido Vollbeding.
55+ * Modified 2003-2017 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 *
···4444 */
45454646#if DCTSIZE != 8
4747- Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
4747+ Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
4848#endif
49495050
+2-2
dll/3rdparty/libjpeg/jidctflt.c
···22 * jidctflt.c
33 *
44 * Copyright (C) 1994-1998, Thomas G. Lane.
55- * Modified 2010-2015 by Guido Vollbeding.
55+ * Modified 2010-2017 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 *
···5050 */
51515252#if DCTSIZE != 8
5353- Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
5353+ Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
5454#endif
55555656
+2-2
dll/3rdparty/libjpeg/jidctfst.c
···22 * jidctfst.c
33 *
44 * Copyright (C) 1994-1998, Thomas G. Lane.
55- * Modified 2015 by Guido Vollbeding.
55+ * Modified 2015-2017 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 *
···4646 */
47474848#if DCTSIZE != 8
4949- Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
4949+ Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
5050#endif
51515252
···22 * wrbmp.c
33 *
44 * Copyright (C) 1994-1996, Thomas G. Lane.
55+ * Modified 2017 by Guido Vollbeding.
56 * This file is part of the Independent JPEG Group's software.
67 * For conditions of distribution and use, see the accompanying README file.
78 *
···189190 /* File size */
190191 headersize = 14 + 40 + cmap_entries * 4; /* Header and colormap */
191192 bfSize = headersize + (INT32) dest->row_width * (INT32) cinfo->output_height;
192192-193193+193194 /* Set unused fields of header to 0 */
194195 MEMZERO(bmpfileheader, SIZEOF(bmpfileheader));
195196 MEMZERO(bmpinfoheader, SIZEOF(bmpinfoheader));
···254255 /* File size */
255256 headersize = 14 + 12 + cmap_entries * 3; /* Header and colormap */
256257 bfSize = headersize + (INT32) dest->row_width * (INT32) cinfo->output_height;
257257-258258+258259 /* Set unused fields of header to 0 */
259260 MEMZERO(bmpfileheader, SIZEOF(bmpfileheader));
260261 MEMZERO(bmpcoreheader, SIZEOF(bmpcoreheader));
···376377 progress->completed_extra_passes++;
377378378379 /* Make sure we wrote the output file OK */
379379- fflush(outfile);
380380- if (ferror(outfile))
380380+ JFFLUSH(outfile);
381381+ if (JFERROR(outfile))
381382 ERREXIT(cinfo, JERR_FILE_WRITE);
382383}
383384···436437 ((j_common_ptr) cinfo, JPOOL_IMAGE, row_width, (JDIMENSION) 1);
437438 dest->pub.buffer_height = 1;
438439439439- return (djpeg_dest_ptr) dest;
440440+ return &dest->pub;
440441}
441442442443#endif /* BMP_SUPPORTED */
+3-3
dll/3rdparty/libjpeg/wrgif.c
···22 * wrgif.c
33 *
44 * Copyright (C) 1991-1997, Thomas G. Lane.
55- * Modified 2015 by Guido Vollbeding.
55+ * Modified 2015-2017 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 *
···347347 /* Write the GIF terminator mark */
348348 putc(';', dest->pub.output_file);
349349 /* Make sure we wrote the output file OK */
350350- fflush(dest->pub.output_file);
351351- if (ferror(dest->pub.output_file))
350350+ JFFLUSH(dest->pub.output_file);
351351+ if (JFERROR(dest->pub.output_file))
352352 ERREXIT(cinfo, JERR_FILE_WRITE);
353353}
354354
+2-2
dll/3rdparty/libjpeg/wrjpgcom.c
···22 * wrjpgcom.c
33 *
44 * Copyright (C) 1994-1997, Thomas G. Lane.
55- * Modified 2015 by Guido Vollbeding.
55+ * Modified 2015-2017 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 *
···254254 if (length < 2)
255255 ERREXIT("Erroneous JPEG marker length");
256256 length -= 2;
257257- /* Skip over the remaining bytes */
257257+ /* Copy the remaining bytes */
258258 while (length > 0) {
259259 write_1_byte(read_1_byte());
260260 length--;
+4-4
dll/3rdparty/libjpeg/wrppm.c
···22 * wrppm.c
33 *
44 * Copyright (C) 1991-1996, Thomas G. Lane.
55- * Modified 2009 by Guido Vollbeding.
55+ * Modified 2009-2017 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 *
···206206finish_output_ppm (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
207207{
208208 /* Make sure we wrote the output file OK */
209209- fflush(dinfo->output_file);
210210- if (ferror(dinfo->output_file))
209209+ JFFLUSH(dinfo->output_file);
210210+ if (JFERROR(dinfo->output_file))
211211 ERREXIT(cinfo, JERR_FILE_WRITE);
212212}
213213···263263 dest->pub.put_pixel_rows = put_pixel_rows;
264264 }
265265266266- return (djpeg_dest_ptr) dest;
266266+ return &dest->pub;
267267}
268268269269#endif /* PPM_SUPPORTED */
+4-3
dll/3rdparty/libjpeg/wrrle.c
···22 * wrrle.c
33 *
44 * Copyright (C) 1991-1996, Thomas G. Lane.
55+ * Modified 2017 by Guido Vollbeding.
56 * This file is part of the Independent JPEG Group's software.
67 * For conditions of distribution and use, see the accompanying README file.
78 *
···263264264265 /* Emit file trailer */
265266 rle_puteof(&header);
266266- fflush(dest->pub.output_file);
267267- if (ferror(dest->pub.output_file))
267267+ JFFLUSH(dest->pub.output_file);
268268+ if (JFERROR(dest->pub.output_file))
268269 ERREXIT(cinfo, JERR_FILE_WRITE);
269270}
270271···299300 (JDIMENSION) (cinfo->output_width * cinfo->output_components),
300301 cinfo->output_height, (JDIMENSION) 1);
301302302302- return (djpeg_dest_ptr) dest;
303303+ return &dest->pub;
303304}
304305305306#endif /* RLE_SUPPORTED */
+3-3
dll/3rdparty/libjpeg/wrtarga.c
···22 * wrtarga.c
33 *
44 * Copyright (C) 1991-1996, Thomas G. Lane.
55- * Modified 2015 by Guido Vollbeding.
55+ * Modified 2015-2017 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 *
···212212finish_output_tga (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
213213{
214214 /* Make sure we wrote the output file OK */
215215- fflush(dinfo->output_file);
216216- if (ferror(dinfo->output_file))
215215+ JFFLUSH(dinfo->output_file);
216216+ if (JFERROR(dinfo->output_file))
217217 ERREXIT(cinfo, JERR_FILE_WRITE);
218218}
219219
+6-5
sdk/include/reactos/libs/libjpeg/cderror.h
···22 * cderror.h
33 *
44 * Copyright (C) 1994-1997, Thomas G. Lane.
55- * Modified 2009 by Guido Vollbeding.
55+ * Modified 2009-2017 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 *
···41414242#ifdef BMP_SUPPORTED
4343JMESSAGE(JERR_BMP_BADCMAP, "Unsupported BMP colormap format")
4444-JMESSAGE(JERR_BMP_BADDEPTH, "Only 8- and 24-bit BMP files are supported")
4444+JMESSAGE(JERR_BMP_BADDEPTH, "Only 8-, 24-, and 32-bit BMP files are supported")
4545JMESSAGE(JERR_BMP_BADHEADER, "Invalid BMP file: bad header length")
4646JMESSAGE(JERR_BMP_BADPLANES, "Invalid BMP file: biPlanes not equal to 1")
4747JMESSAGE(JERR_BMP_COLORSPACE, "BMP output must be grayscale or RGB")
4848JMESSAGE(JERR_BMP_COMPRESSED, "Sorry, compressed BMPs not yet supported")
4949-JMESSAGE(JERR_BMP_EMPTY, "Empty BMP image")
5049JMESSAGE(JERR_BMP_NOT, "Not a BMP file - does not start with BM")
5151-JMESSAGE(JTRC_BMP, "%ux%u 24-bit BMP image")
5050+JMESSAGE(JERR_BMP_OUTOFRANGE, "Numeric value out of range in BMP file")
5151+JMESSAGE(JTRC_BMP, "%ux%u %d-bit BMP image")
5252JMESSAGE(JTRC_BMP_MAPPED, "%ux%u 8-bit colormapped BMP image")
5353-JMESSAGE(JTRC_BMP_OS2, "%ux%u 24-bit OS2 BMP image")
5353+JMESSAGE(JTRC_BMP_OS2, "%ux%u %d-bit OS2 BMP image")
5454JMESSAGE(JTRC_BMP_OS2_MAPPED, "%ux%u 8-bit colormapped OS2 BMP image")
5555#endif /* BMP_SUPPORTED */
5656···7575JMESSAGE(JERR_PPM_COLORSPACE, "PPM output must be grayscale or RGB")
7676JMESSAGE(JERR_PPM_NONNUMERIC, "Nonnumeric data in PPM file")
7777JMESSAGE(JERR_PPM_NOT, "Not a PPM/PGM file")
7878+JMESSAGE(JERR_PPM_OUTOFRANGE, "Numeric value out of range in PPM file")
7879JMESSAGE(JTRC_PGM, "%ux%u PGM image")
7980JMESSAGE(JTRC_PGM_TEXT, "%ux%u text PGM image")
8081JMESSAGE(JTRC_PPM, "%ux%u PPM image")
+5-6
sdk/include/reactos/libs/libjpeg/jdct.h
···22 * jdct.h
33 *
44 * Copyright (C) 1994-1996, Thomas G. Lane.
55- * Modified 2002-2015 by Guido Vollbeding.
55+ * Modified 2002-2017 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 *
···7979 * converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could
8080 * be quite far out of range if the input data is corrupt, so a bulletproof
8181 * range-limiting step is required. We use a mask-and-table-lookup method
8282- * to do the combined operations quickly, assuming that MAXJSAMPLE+1
8383- * is a power of 2. See the comments with prepare_range_limit_table
8484- * (in jdmaster.c) for more info.
8282+ * to do the combined operations quickly, assuming that RANGE_CENTER
8383+ * (defined in jpegint.h) is a power of 2. See the comments with
8484+ * prepare_range_limit_table (in jdmaster.c) for more info.
8585 */
86868787-#define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
8888-#define RANGE_CENTER (MAXJSAMPLE * 2 + 2)
8787+#define RANGE_MASK (RANGE_CENTER * 2 - 1)
8988#define RANGE_SUBSET (RANGE_CENTER - CENTERJSAMPLE)
90899190#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit - RANGE_SUBSET)
+6
sdk/include/reactos/libs/libjpeg/jinclude.h
···22 * jinclude.h
33 *
44 * Copyright (C) 1991-1994, Thomas G. Lane.
55+ * Modified 2017 by Guido Vollbeding.
56 * This file is part of the Independent JPEG Group's software.
67 * For conditions of distribution and use, see the accompanying README file.
78 *
···8384 * The modules that use fread() and fwrite() always invoke them through
8485 * these macros. On some systems you may need to twiddle the argument casts.
8586 * CAUTION: argument order is different from underlying functions!
8787+ *
8888+ * Furthermore, macros are provided for fflush() and ferror() in order
8989+ * to facilitate adaption by applications using an own FILE class.
8690 */
87918892#define JFREAD(file,buf,sizeofbuf) \
8993 ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
9094#define JFWRITE(file,buf,sizeofbuf) \
9195 ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
9696+#define JFFLUSH(file) fflush(file)
9797+#define JFERROR(file) ferror(file)
+14-1
sdk/include/reactos/libs/libjpeg/jpegint.h
···22 * jpegint.h
33 *
44 * Copyright (C) 1991-1997, Thomas G. Lane.
55- * Modified 1997-2013 by Guido Vollbeding.
55+ * Modified 1997-2017 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 *
···258258 JMETHOD(void, finish_pass, (j_decompress_ptr cinfo));
259259 JMETHOD(void, new_color_map, (j_decompress_ptr cinfo));
260260};
261261+262262+263263+/* Definition of range extension bits for decompression processes.
264264+ * See the comments with prepare_range_limit_table (in jdmaster.c)
265265+ * for more info.
266266+ * The recommended default value for normal applications is 2.
267267+ * Applications with special requirements may use a different value.
268268+ * For example, Ghostscript wants to use 3 for proper handling of
269269+ * wacky images with oversize coefficient values.
270270+ */
271271+272272+#define RANGE_BITS 2
273273+#define RANGE_CENTER (CENTERJSAMPLE << RANGE_BITS)
261274262275263276/* Miscellaneous useful macros */
+14-14
sdk/include/reactos/libs/libjpeg/jpeglib.h
···22 * jpeglib.h
33 *
44 * Copyright (C) 1991-1998, Thomas G. Lane.
55- * Modified 2002-2015 by Guido Vollbeding.
55+ * Modified 2002-2017 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 *
···39394040#define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */
4141#define JPEG_LIB_VERSION_MAJOR 9
4242-#define JPEG_LIB_VERSION_MINOR 2
4242+#define JPEG_LIB_VERSION_MINOR 3
434344444545/* Various constants determining the sizes of things.
···137137 /* The decompressor output side may not use these variables. */
138138 int dc_tbl_no; /* DC entropy table selector (0..3) */
139139 int ac_tbl_no; /* AC entropy table selector (0..3) */
140140-140140+141141 /* Remaining fields should be treated as private by applications. */
142142-142142+143143 /* These values are computed during compression or decompression startup: */
144144 /* Component's size in DCT blocks.
145145 * Any dummy blocks added to complete an MCU are not counted; therefore
···411411 JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */
412412 /* The coefficient controller receives data in units of MCU rows as defined
413413 * for fully interleaved scans (whether the JPEG file is interleaved or not).
414414- * There are v_samp_factor * DCTSIZE sample rows of each component in an
415415- * "iMCU" (interleaved MCU) row.
414414+ * There are v_samp_factor * DCT_v_scaled_size sample rows of each component
415415+ * in an "iMCU" (interleaved MCU) row.
416416 */
417417-417417+418418 /*
419419 * These fields are valid during any one scan.
420420 * They describe the components and MCUs actually appearing in the scan.
···422422 int comps_in_scan; /* # of JPEG components in this scan */
423423 jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
424424 /* *cur_comp_info[i] describes component that appears i'th in SOS */
425425-425425+426426 JDIMENSION MCUs_per_row; /* # of MCUs across the image */
427427 JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
428428-428428+429429 int blocks_in_MCU; /* # of DCT blocks per MCU */
430430 int MCU_membership[C_MAX_BLOCKS_IN_MCU];
431431 /* MCU_membership[i] is index in cur_comp_info of component owning */
···636636 * in fully interleaved JPEG scans, but are used whether the scan is
637637 * interleaved or not. We define an iMCU row as v_samp_factor DCT block
638638 * rows of each component. Therefore, the IDCT output contains
639639- * v_samp_factor*DCT_v_scaled_size sample rows of a component per iMCU row.
639639+ * v_samp_factor * DCT_v_scaled_size sample rows of a component per iMCU row.
640640 */
641641642642 JSAMPLE * sample_range_limit; /* table for fast range-limiting */
···711711#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */
712712 /* Reset error state variables at start of a new image */
713713 JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));
714714-714714+715715 /* The message ID code and any parameters are saved here.
716716 * A message can have one string parameter or up to 8 int parameters.
717717 */
···721721 int i[8];
722722 char s[JMSG_STR_PARM_MAX];
723723 } msg_parm;
724724-724724+725725 /* Standard state variables for error facility */
726726-726726+727727 int trace_level; /* max msg_level that will be displayed */
728728-728728+729729 /* For recoverable corrupt-data errors, we emit a warning message,
730730 * but keep going unless emit_message chooses to abort. emit_message
731731 * should count warnings in num_warnings. The surrounding application
+3-3
sdk/include/reactos/libs/libjpeg/jversion.h
···11/*
22 * jversion.h
33 *
44- * Copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding.
44+ * Copyright (C) 1991-2018, Thomas G. Lane, 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 *
···99 */
101011111212-#define JVERSION "9b 17-Jan-2016"
1212+#define JVERSION "9c 14-Jan-2018"
13131414-#define JCOPYRIGHT "Copyright (C) 2016, Thomas G. Lane, Guido Vollbeding"
1414+#define JCOPYRIGHT "Copyright (C) 2018, Thomas G. Lane, Guido Vollbeding"
+3-5
sdk/include/reactos/libs/libjpeg/rosdiff.patch
···11-Index: include/reactos/libs/libjpeg/jmorecfg.h
22-===================================================================
33---- include/reactos/libs/libjpeg/jmorecfg.h (revision 66390)
44-+++ include/reactos/libs/libjpeg/jmorecfg.h (working copy)
55-@@ -238,14 +238,62 @@
11+--- a/sdk/include/reactos/libs/libjpeg/jmorecfg.h
22++++ b/sdk/include/reactos/libs/libjpeg/jmorecfg.h
33+@@ -238,14 +238,62 @@ typedef unsigned int JDIMENSION;
64 * or code profilers that require it.
75 */
86