Reactos

[LIBJPEG] Update to version 9c. CORE-14291

+551 -381
+9 -6
dll/3rdparty/libjpeg/README
··· 1 1 The Independent JPEG Group's JPEG software 2 2 ========================================== 3 3 4 - README for release 9b of 17-Jan-2016 4 + README for release 9c of 14-Jan-2018 5 5 ==================================== 6 6 7 7 This distribution contains the ninth public release of the Independent JPEG ··· 115 115 fitness for a particular purpose. This software is provided "AS IS", and you, 116 116 its user, assume the entire risk as to its quality and accuracy. 117 117 118 - This software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding. 118 + This software is copyright (C) 1991-2018, Thomas G. Lane, Guido Vollbeding. 119 119 All Rights Reserved except as specified below. 120 120 121 121 Permission is hereby granted to use, copy, modify, and distribute this ··· 246 246 The "official" archive site for this software is www.ijg.org. 247 247 The most recent released version can always be found there in 248 248 directory "files". This particular version will be archived as 249 - http://www.ijg.org/files/jpegsrc.v9b.tar.gz, and in Windows-compatible 250 - "zip" archive format as http://www.ijg.org/files/jpegsr9b.zip. 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. 251 251 252 252 The JPEG FAQ (Frequently Asked Questions) article is a source of some 253 253 general information about JPEG. ··· 293 293 294 294 Thank to Andrew Finkenstadt for hosting the ijg.org site. 295 295 296 - Last but not least special thank to Thomas G. Lane for the original 297 - design and development of this singular software package. 296 + Thank to Thomas G. Lane for the original design and development of 297 + this singular software package. 298 + 299 + Thank to Lars Goehler, Andreas Heinecke, Sebastian Fuss, Yvonne Roebert, 300 + Andrej Werner, and Ulf-Dietrich Braumann for support and public relations. 298 301 299 302 300 303 FILE FORMAT WARS
+21
dll/3rdparty/libjpeg/change.log
··· 1 1 CHANGE LOG for Independent JPEG Group's JPEG software 2 2 3 3 4 + Version 9c 14-Jan-2018 5 + ----------------------- 6 + 7 + jpegtran: add an option to the -wipe switch to fill the region 8 + with the average of adjacent blocks, instead of gray out. 9 + Thank to Caitlyn Feddock and Maddie Ziegler for inspiration. 10 + 11 + Make range extension bits adjustable (in jpegint.h). 12 + Thank to Robin Watts for suggestion. 13 + 14 + Provide macros for fflush() and ferror() in jinclude.h in order 15 + to facilitate adaption by applications using an own FILE class. 16 + Thank to Gerhard Huber for suggestion. 17 + 18 + Add libjpeg pkg-config file. Thank to Mark Lavi, Vincent Torri, 19 + Patrick McMunn, and Huw Davies for suggestion. 20 + 21 + Add sanity checks in cjpeg image reader modules. 22 + Thank to Bingchang, Liu for reports. 23 + 24 + 4 25 Version 9b 17-Jan-2016 5 26 ----------------------- 6 27
+167 -2
dll/3rdparty/libjpeg/jcinit.c
··· 2 2 * jcinit.c 3 3 * 4 4 * Copyright (C) 1991-1997, Thomas G. Lane. 5 - * Modified 2003-2013 by Guido Vollbeding. 5 + * Modified 2003-2017 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 * ··· 22 22 23 23 24 24 /* 25 + * Compute JPEG image dimensions and related values. 26 + * NOTE: this is exported for possible use by application. 27 + * Hence it mustn't do anything that can't be done twice. 28 + */ 29 + 30 + GLOBAL(void) 31 + jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo) 32 + /* Do computations that are needed before master selection phase */ 33 + { 34 + /* Sanity check on input image dimensions to prevent overflow in 35 + * following calculations. 36 + * We do check jpeg_width and jpeg_height in initial_setup in jcmaster.c, 37 + * but image_width and image_height can come from arbitrary data, 38 + * and we need some space for multiplication by block_size. 39 + */ 40 + if (((long) cinfo->image_width >> 24) || ((long) cinfo->image_height >> 24)) 41 + ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION); 42 + 43 + #ifdef DCT_SCALING_SUPPORTED 44 + 45 + /* Compute actual JPEG image dimensions and DCT scaling choices. */ 46 + if (cinfo->scale_num >= cinfo->scale_denom * cinfo->block_size) { 47 + /* Provide block_size/1 scaling */ 48 + cinfo->jpeg_width = cinfo->image_width * cinfo->block_size; 49 + cinfo->jpeg_height = cinfo->image_height * cinfo->block_size; 50 + cinfo->min_DCT_h_scaled_size = 1; 51 + cinfo->min_DCT_v_scaled_size = 1; 52 + } else if (cinfo->scale_num * 2 >= cinfo->scale_denom * cinfo->block_size) { 53 + /* Provide block_size/2 scaling */ 54 + cinfo->jpeg_width = (JDIMENSION) 55 + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 2L); 56 + cinfo->jpeg_height = (JDIMENSION) 57 + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 2L); 58 + cinfo->min_DCT_h_scaled_size = 2; 59 + cinfo->min_DCT_v_scaled_size = 2; 60 + } else if (cinfo->scale_num * 3 >= cinfo->scale_denom * cinfo->block_size) { 61 + /* Provide block_size/3 scaling */ 62 + cinfo->jpeg_width = (JDIMENSION) 63 + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 3L); 64 + cinfo->jpeg_height = (JDIMENSION) 65 + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 3L); 66 + cinfo->min_DCT_h_scaled_size = 3; 67 + cinfo->min_DCT_v_scaled_size = 3; 68 + } else if (cinfo->scale_num * 4 >= cinfo->scale_denom * cinfo->block_size) { 69 + /* Provide block_size/4 scaling */ 70 + cinfo->jpeg_width = (JDIMENSION) 71 + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 4L); 72 + cinfo->jpeg_height = (JDIMENSION) 73 + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 4L); 74 + cinfo->min_DCT_h_scaled_size = 4; 75 + cinfo->min_DCT_v_scaled_size = 4; 76 + } else if (cinfo->scale_num * 5 >= cinfo->scale_denom * cinfo->block_size) { 77 + /* Provide block_size/5 scaling */ 78 + cinfo->jpeg_width = (JDIMENSION) 79 + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 5L); 80 + cinfo->jpeg_height = (JDIMENSION) 81 + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 5L); 82 + cinfo->min_DCT_h_scaled_size = 5; 83 + cinfo->min_DCT_v_scaled_size = 5; 84 + } else if (cinfo->scale_num * 6 >= cinfo->scale_denom * cinfo->block_size) { 85 + /* Provide block_size/6 scaling */ 86 + cinfo->jpeg_width = (JDIMENSION) 87 + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 6L); 88 + cinfo->jpeg_height = (JDIMENSION) 89 + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 6L); 90 + cinfo->min_DCT_h_scaled_size = 6; 91 + cinfo->min_DCT_v_scaled_size = 6; 92 + } else if (cinfo->scale_num * 7 >= cinfo->scale_denom * cinfo->block_size) { 93 + /* Provide block_size/7 scaling */ 94 + cinfo->jpeg_width = (JDIMENSION) 95 + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 7L); 96 + cinfo->jpeg_height = (JDIMENSION) 97 + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 7L); 98 + cinfo->min_DCT_h_scaled_size = 7; 99 + cinfo->min_DCT_v_scaled_size = 7; 100 + } else if (cinfo->scale_num * 8 >= cinfo->scale_denom * cinfo->block_size) { 101 + /* Provide block_size/8 scaling */ 102 + cinfo->jpeg_width = (JDIMENSION) 103 + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 8L); 104 + cinfo->jpeg_height = (JDIMENSION) 105 + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 8L); 106 + cinfo->min_DCT_h_scaled_size = 8; 107 + cinfo->min_DCT_v_scaled_size = 8; 108 + } else if (cinfo->scale_num * 9 >= cinfo->scale_denom * cinfo->block_size) { 109 + /* Provide block_size/9 scaling */ 110 + cinfo->jpeg_width = (JDIMENSION) 111 + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 9L); 112 + cinfo->jpeg_height = (JDIMENSION) 113 + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 9L); 114 + cinfo->min_DCT_h_scaled_size = 9; 115 + cinfo->min_DCT_v_scaled_size = 9; 116 + } else if (cinfo->scale_num * 10 >= cinfo->scale_denom * cinfo->block_size) { 117 + /* Provide block_size/10 scaling */ 118 + cinfo->jpeg_width = (JDIMENSION) 119 + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 10L); 120 + cinfo->jpeg_height = (JDIMENSION) 121 + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 10L); 122 + cinfo->min_DCT_h_scaled_size = 10; 123 + cinfo->min_DCT_v_scaled_size = 10; 124 + } else if (cinfo->scale_num * 11 >= cinfo->scale_denom * cinfo->block_size) { 125 + /* Provide block_size/11 scaling */ 126 + cinfo->jpeg_width = (JDIMENSION) 127 + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 11L); 128 + cinfo->jpeg_height = (JDIMENSION) 129 + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 11L); 130 + cinfo->min_DCT_h_scaled_size = 11; 131 + cinfo->min_DCT_v_scaled_size = 11; 132 + } else if (cinfo->scale_num * 12 >= cinfo->scale_denom * cinfo->block_size) { 133 + /* Provide block_size/12 scaling */ 134 + cinfo->jpeg_width = (JDIMENSION) 135 + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 12L); 136 + cinfo->jpeg_height = (JDIMENSION) 137 + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 12L); 138 + cinfo->min_DCT_h_scaled_size = 12; 139 + cinfo->min_DCT_v_scaled_size = 12; 140 + } else if (cinfo->scale_num * 13 >= cinfo->scale_denom * cinfo->block_size) { 141 + /* Provide block_size/13 scaling */ 142 + cinfo->jpeg_width = (JDIMENSION) 143 + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 13L); 144 + cinfo->jpeg_height = (JDIMENSION) 145 + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 13L); 146 + cinfo->min_DCT_h_scaled_size = 13; 147 + cinfo->min_DCT_v_scaled_size = 13; 148 + } else if (cinfo->scale_num * 14 >= cinfo->scale_denom * cinfo->block_size) { 149 + /* Provide block_size/14 scaling */ 150 + cinfo->jpeg_width = (JDIMENSION) 151 + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 14L); 152 + cinfo->jpeg_height = (JDIMENSION) 153 + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 14L); 154 + cinfo->min_DCT_h_scaled_size = 14; 155 + cinfo->min_DCT_v_scaled_size = 14; 156 + } else if (cinfo->scale_num * 15 >= cinfo->scale_denom * cinfo->block_size) { 157 + /* Provide block_size/15 scaling */ 158 + cinfo->jpeg_width = (JDIMENSION) 159 + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 15L); 160 + cinfo->jpeg_height = (JDIMENSION) 161 + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 15L); 162 + cinfo->min_DCT_h_scaled_size = 15; 163 + cinfo->min_DCT_v_scaled_size = 15; 164 + } else { 165 + /* Provide block_size/16 scaling */ 166 + cinfo->jpeg_width = (JDIMENSION) 167 + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 16L); 168 + cinfo->jpeg_height = (JDIMENSION) 169 + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 16L); 170 + cinfo->min_DCT_h_scaled_size = 16; 171 + cinfo->min_DCT_v_scaled_size = 16; 172 + } 173 + 174 + #else /* !DCT_SCALING_SUPPORTED */ 175 + 176 + /* Hardwire it to "no scaling" */ 177 + cinfo->jpeg_width = cinfo->image_width; 178 + cinfo->jpeg_height = cinfo->image_height; 179 + cinfo->min_DCT_h_scaled_size = DCTSIZE; 180 + cinfo->min_DCT_v_scaled_size = DCTSIZE; 181 + 182 + #endif /* DCT_SCALING_SUPPORTED */ 183 + } 184 + 185 + 186 + /* 25 187 * Master selection of compression modules. 26 188 * This is done once at the start of processing an image. We determine 27 189 * which modules will be used and give them appropriate initialization calls. ··· 37 199 if (cinfo->data_precision != BITS_IN_JSAMPLE) 38 200 ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision); 39 201 40 - /* Sanity check on image dimensions */ 202 + /* Sanity check on input image dimensions */ 41 203 if (cinfo->image_height <= 0 || cinfo->image_width <= 0 || 42 204 cinfo->input_components <= 0) 43 205 ERREXIT(cinfo, JERR_EMPTY_IMAGE); ··· 47 209 jd_samplesperrow = (JDIMENSION) samplesperrow; 48 210 if ((long) jd_samplesperrow != samplesperrow) 49 211 ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); 212 + 213 + /* Compute JPEG image dimensions and related values. */ 214 + jpeg_calc_jpeg_dimensions(cinfo); 50 215 51 216 /* Initialize master control (includes parameter checking/processing) */ 52 217 jinit_c_master_control(cinfo, FALSE /* full compression */);
+5 -187
dll/3rdparty/libjpeg/jcmaster.c
··· 2 2 * jcmaster.c 3 3 * 4 4 * Copyright (C) 1991-1997, Thomas G. Lane. 5 - * Modified 2003-2013 by Guido Vollbeding. 5 + * Modified 2003-2017 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 * ··· 43 43 * Support routines that do various essential calculations. 44 44 */ 45 45 46 - /* 47 - * Compute JPEG image dimensions and related values. 48 - * NOTE: this is exported for possible use by application. 49 - * Hence it mustn't do anything that can't be done twice. 50 - */ 51 - 52 - GLOBAL(void) 53 - jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo) 54 - /* Do computations that are needed before master selection phase */ 55 - { 56 - #ifdef DCT_SCALING_SUPPORTED 57 - 58 - /* Sanity check on input image dimensions to prevent overflow in 59 - * following calculation. 60 - * We do check jpeg_width and jpeg_height in initial_setup below, 61 - * but image_width and image_height can come from arbitrary data, 62 - * and we need some space for multiplication by block_size. 63 - */ 64 - if (((long) cinfo->image_width >> 24) || ((long) cinfo->image_height >> 24)) 65 - ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION); 66 - 67 - /* Compute actual JPEG image dimensions and DCT scaling choices. */ 68 - if (cinfo->scale_num >= cinfo->scale_denom * cinfo->block_size) { 69 - /* Provide block_size/1 scaling */ 70 - cinfo->jpeg_width = cinfo->image_width * cinfo->block_size; 71 - cinfo->jpeg_height = cinfo->image_height * cinfo->block_size; 72 - cinfo->min_DCT_h_scaled_size = 1; 73 - cinfo->min_DCT_v_scaled_size = 1; 74 - } else if (cinfo->scale_num * 2 >= cinfo->scale_denom * cinfo->block_size) { 75 - /* Provide block_size/2 scaling */ 76 - cinfo->jpeg_width = (JDIMENSION) 77 - jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 2L); 78 - cinfo->jpeg_height = (JDIMENSION) 79 - jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 2L); 80 - cinfo->min_DCT_h_scaled_size = 2; 81 - cinfo->min_DCT_v_scaled_size = 2; 82 - } else if (cinfo->scale_num * 3 >= cinfo->scale_denom * cinfo->block_size) { 83 - /* Provide block_size/3 scaling */ 84 - cinfo->jpeg_width = (JDIMENSION) 85 - jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 3L); 86 - cinfo->jpeg_height = (JDIMENSION) 87 - jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 3L); 88 - cinfo->min_DCT_h_scaled_size = 3; 89 - cinfo->min_DCT_v_scaled_size = 3; 90 - } else if (cinfo->scale_num * 4 >= cinfo->scale_denom * cinfo->block_size) { 91 - /* Provide block_size/4 scaling */ 92 - cinfo->jpeg_width = (JDIMENSION) 93 - jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 4L); 94 - cinfo->jpeg_height = (JDIMENSION) 95 - jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 4L); 96 - cinfo->min_DCT_h_scaled_size = 4; 97 - cinfo->min_DCT_v_scaled_size = 4; 98 - } else if (cinfo->scale_num * 5 >= cinfo->scale_denom * cinfo->block_size) { 99 - /* Provide block_size/5 scaling */ 100 - cinfo->jpeg_width = (JDIMENSION) 101 - jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 5L); 102 - cinfo->jpeg_height = (JDIMENSION) 103 - jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 5L); 104 - cinfo->min_DCT_h_scaled_size = 5; 105 - cinfo->min_DCT_v_scaled_size = 5; 106 - } else if (cinfo->scale_num * 6 >= cinfo->scale_denom * cinfo->block_size) { 107 - /* Provide block_size/6 scaling */ 108 - cinfo->jpeg_width = (JDIMENSION) 109 - jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 6L); 110 - cinfo->jpeg_height = (JDIMENSION) 111 - jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 6L); 112 - cinfo->min_DCT_h_scaled_size = 6; 113 - cinfo->min_DCT_v_scaled_size = 6; 114 - } else if (cinfo->scale_num * 7 >= cinfo->scale_denom * cinfo->block_size) { 115 - /* Provide block_size/7 scaling */ 116 - cinfo->jpeg_width = (JDIMENSION) 117 - jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 7L); 118 - cinfo->jpeg_height = (JDIMENSION) 119 - jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 7L); 120 - cinfo->min_DCT_h_scaled_size = 7; 121 - cinfo->min_DCT_v_scaled_size = 7; 122 - } else if (cinfo->scale_num * 8 >= cinfo->scale_denom * cinfo->block_size) { 123 - /* Provide block_size/8 scaling */ 124 - cinfo->jpeg_width = (JDIMENSION) 125 - jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 8L); 126 - cinfo->jpeg_height = (JDIMENSION) 127 - jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 8L); 128 - cinfo->min_DCT_h_scaled_size = 8; 129 - cinfo->min_DCT_v_scaled_size = 8; 130 - } else if (cinfo->scale_num * 9 >= cinfo->scale_denom * cinfo->block_size) { 131 - /* Provide block_size/9 scaling */ 132 - cinfo->jpeg_width = (JDIMENSION) 133 - jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 9L); 134 - cinfo->jpeg_height = (JDIMENSION) 135 - jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 9L); 136 - cinfo->min_DCT_h_scaled_size = 9; 137 - cinfo->min_DCT_v_scaled_size = 9; 138 - } else if (cinfo->scale_num * 10 >= cinfo->scale_denom * cinfo->block_size) { 139 - /* Provide block_size/10 scaling */ 140 - cinfo->jpeg_width = (JDIMENSION) 141 - jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 10L); 142 - cinfo->jpeg_height = (JDIMENSION) 143 - jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 10L); 144 - cinfo->min_DCT_h_scaled_size = 10; 145 - cinfo->min_DCT_v_scaled_size = 10; 146 - } else if (cinfo->scale_num * 11 >= cinfo->scale_denom * cinfo->block_size) { 147 - /* Provide block_size/11 scaling */ 148 - cinfo->jpeg_width = (JDIMENSION) 149 - jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 11L); 150 - cinfo->jpeg_height = (JDIMENSION) 151 - jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 11L); 152 - cinfo->min_DCT_h_scaled_size = 11; 153 - cinfo->min_DCT_v_scaled_size = 11; 154 - } else if (cinfo->scale_num * 12 >= cinfo->scale_denom * cinfo->block_size) { 155 - /* Provide block_size/12 scaling */ 156 - cinfo->jpeg_width = (JDIMENSION) 157 - jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 12L); 158 - cinfo->jpeg_height = (JDIMENSION) 159 - jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 12L); 160 - cinfo->min_DCT_h_scaled_size = 12; 161 - cinfo->min_DCT_v_scaled_size = 12; 162 - } else if (cinfo->scale_num * 13 >= cinfo->scale_denom * cinfo->block_size) { 163 - /* Provide block_size/13 scaling */ 164 - cinfo->jpeg_width = (JDIMENSION) 165 - jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 13L); 166 - cinfo->jpeg_height = (JDIMENSION) 167 - jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 13L); 168 - cinfo->min_DCT_h_scaled_size = 13; 169 - cinfo->min_DCT_v_scaled_size = 13; 170 - } else if (cinfo->scale_num * 14 >= cinfo->scale_denom * cinfo->block_size) { 171 - /* Provide block_size/14 scaling */ 172 - cinfo->jpeg_width = (JDIMENSION) 173 - jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 14L); 174 - cinfo->jpeg_height = (JDIMENSION) 175 - jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 14L); 176 - cinfo->min_DCT_h_scaled_size = 14; 177 - cinfo->min_DCT_v_scaled_size = 14; 178 - } else if (cinfo->scale_num * 15 >= cinfo->scale_denom * cinfo->block_size) { 179 - /* Provide block_size/15 scaling */ 180 - cinfo->jpeg_width = (JDIMENSION) 181 - jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 15L); 182 - cinfo->jpeg_height = (JDIMENSION) 183 - jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 15L); 184 - cinfo->min_DCT_h_scaled_size = 15; 185 - cinfo->min_DCT_v_scaled_size = 15; 186 - } else { 187 - /* Provide block_size/16 scaling */ 188 - cinfo->jpeg_width = (JDIMENSION) 189 - jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 16L); 190 - cinfo->jpeg_height = (JDIMENSION) 191 - jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 16L); 192 - cinfo->min_DCT_h_scaled_size = 16; 193 - cinfo->min_DCT_v_scaled_size = 16; 194 - } 195 - 196 - #else /* !DCT_SCALING_SUPPORTED */ 197 - 198 - /* Hardwire it to "no scaling" */ 199 - cinfo->jpeg_width = cinfo->image_width; 200 - cinfo->jpeg_height = cinfo->image_height; 201 - cinfo->min_DCT_h_scaled_size = DCTSIZE; 202 - cinfo->min_DCT_v_scaled_size = DCTSIZE; 203 - 204 - #endif /* DCT_SCALING_SUPPORTED */ 205 - } 206 - 207 - 208 46 LOCAL(void) 209 - jpeg_calc_trans_dimensions (j_compress_ptr cinfo) 210 - { 211 - if (cinfo->min_DCT_h_scaled_size != cinfo->min_DCT_v_scaled_size) 212 - ERREXIT2(cinfo, JERR_BAD_DCTSIZE, 213 - cinfo->min_DCT_h_scaled_size, cinfo->min_DCT_v_scaled_size); 214 - 215 - cinfo->block_size = cinfo->min_DCT_h_scaled_size; 216 - } 217 - 218 - 219 - LOCAL(void) 220 - initial_setup (j_compress_ptr cinfo, boolean transcode_only) 47 + initial_setup (j_compress_ptr cinfo) 221 48 /* Do computations that are needed before master selection phase */ 222 49 { 223 50 int ci, ssize; 224 51 jpeg_component_info *compptr; 225 - 226 - if (transcode_only) 227 - jpeg_calc_trans_dimensions(cinfo); 228 - else 229 - jpeg_calc_jpeg_dimensions(cinfo); 230 52 231 53 /* Sanity check on block_size */ 232 54 if (cinfo->block_size < 1 || cinfo->block_size > 16) ··· 414 236 * out-of-range reconstructed DC values during the first DC scan, 415 237 * which might cause problems for some decoders. 416 238 */ 417 - #if BITS_IN_JSAMPLE == 8 418 - #define MAX_AH_AL 10 419 - #else 420 - #define MAX_AH_AL 13 421 - #endif 422 239 if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 || 423 - Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL) 240 + Ah < 0 || Ah > (cinfo->data_precision > 8 ? 13 : 10) || 241 + Al < 0 || Al > (cinfo->data_precision > 8 ? 13 : 10)) 424 242 ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); 425 243 if (Ss == 0) { 426 244 if (Se != 0) /* DC and AC together not OK */ ··· 812 630 master->pub.is_last_pass = FALSE; 813 631 814 632 /* Validate parameters, determine derived values */ 815 - initial_setup(cinfo, transcode_only); 633 + initial_setup(cinfo); 816 634 817 635 if (cinfo->scan_info != NULL) { 818 636 #ifdef C_MULTISCAN_FILES_SUPPORTED
+21 -3
dll/3rdparty/libjpeg/jctrans.c
··· 2 2 * jctrans.c 3 3 * 4 4 * Copyright (C) 1995-1998, Thomas G. Lane. 5 - * Modified 2000-2013 by Guido Vollbeding. 5 + * Modified 2000-2017 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 * ··· 85 85 jpeg_set_defaults(dstinfo); 86 86 /* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB. 87 87 * Fix it to get the right header markers for the image colorspace. 88 - * Note: Entropy table assignment in jpeg_set_colorspace depends 89 - * on color_transform. 88 + * Note: Entropy table assignment in jpeg_set_colorspace 89 + * depends on color_transform. 90 + * Adaption is also required for setting the appropriate 91 + * entropy coding mode dependent on image data precision. 90 92 */ 91 93 dstinfo->color_transform = srcinfo->color_transform; 92 94 jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space); 93 95 dstinfo->data_precision = srcinfo->data_precision; 96 + dstinfo->arith_code = srcinfo->data_precision > 8 ? TRUE : FALSE; 94 97 dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling; 95 98 /* Copy the source's quantization tables. */ 96 99 for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) { ··· 157 160 } 158 161 159 162 163 + LOCAL(void) 164 + jpeg_calc_trans_dimensions (j_compress_ptr cinfo) 165 + /* Do computations that are needed before master selection phase */ 166 + { 167 + if (cinfo->min_DCT_h_scaled_size != cinfo->min_DCT_v_scaled_size) 168 + ERREXIT2(cinfo, JERR_BAD_DCTSIZE, 169 + cinfo->min_DCT_h_scaled_size, cinfo->min_DCT_v_scaled_size); 170 + 171 + cinfo->block_size = cinfo->min_DCT_h_scaled_size; 172 + } 173 + 174 + 160 175 /* 161 176 * Master selection of compression modules for transcoding. 162 177 * This substitutes for jcinit.c's initialization of the full compressor. ··· 166 181 transencode_master_selection (j_compress_ptr cinfo, 167 182 jvirt_barray_ptr * coef_arrays) 168 183 { 184 + /* Do computations that are needed before master selection phase */ 185 + jpeg_calc_trans_dimensions(cinfo); 186 + 169 187 /* Initialize master control (includes parameter checking/processing) */ 170 188 jinit_c_master_control(cinfo, TRUE /* transcode only */); 171 189
+3 -3
dll/3rdparty/libjpeg/jdatadst.c
··· 2 2 * jdatadst.c 3 3 * 4 4 * Copyright (C) 1994-1996, Thomas G. Lane. 5 - * Modified 2009-2012 by Guido Vollbeding. 5 + * Modified 2009-2017 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 * ··· 170 170 if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount) 171 171 ERREXIT(cinfo, JERR_FILE_WRITE); 172 172 } 173 - fflush(dest->outfile); 173 + JFFLUSH(dest->outfile); 174 174 /* Make sure we wrote the output file OK */ 175 - if (ferror(dest->outfile)) 175 + if (JFERROR(dest->outfile)) 176 176 ERREXIT(cinfo, JERR_FILE_WRITE); 177 177 } 178 178
+7 -1
dll/3rdparty/libjpeg/jdcolor.c
··· 2 2 * jdcolor.c 3 3 * 4 4 * Copyright (C) 1991-1997, Thomas G. Lane. 5 - * Modified 2011-2015 by Guido Vollbeding. 5 + * Modified 2011-2017 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 * ··· 12 12 #define JPEG_INTERNALS 13 13 #include "jinclude.h" 14 14 #include "jpeglib.h" 15 + 16 + 17 + #if RANGE_BITS < 2 18 + /* Deliberate syntax err */ 19 + Sorry, this code requires 2 or more range extension bits. 20 + #endif 15 21 16 22 17 23 /* Private subobject */
+4 -5
dll/3rdparty/libjpeg/jdhuff.c
··· 2 2 * jdhuff.c 3 3 * 4 4 * Copyright (C) 1991-1997, Thomas G. Lane. 5 - * Modified 2006-2013 by Guido Vollbeding. 5 + * Modified 2006-2016 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 * ··· 799 799 */ 800 800 if (! entropy->insufficient_data) { 801 801 802 - Se = cinfo->Se; 803 - Al = cinfo->Al; 804 - natural_order = cinfo->natural_order; 805 - 806 802 /* Load up working state. 807 803 * We can avoid loading/saving bitread state if in an EOB run. 808 804 */ ··· 814 810 EOBRUN--; /* ...process it now (we do nothing) */ 815 811 else { 816 812 BITREAD_LOAD_STATE(cinfo,entropy->bitstate); 813 + Se = cinfo->Se; 814 + Al = cinfo->Al; 815 + natural_order = cinfo->natural_order; 817 816 block = MCU_data[0]; 818 817 tbl = entropy->ac_derived_tbl; 819 818
+20 -26
dll/3rdparty/libjpeg/jdmainct.c
··· 2 2 * jdmainct.c 3 3 * 4 4 * Copyright (C) 1994-1996, Thomas G. Lane. 5 - * Modified 2002-2012 by Guido Vollbeding. 5 + * Modified 2002-2016 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 * ··· 26 26 * trivial. Its responsibility is to provide context rows for upsampling/ 27 27 * rescaling, and doing this in an efficient fashion is a bit tricky. 28 28 * 29 - * Postprocessor input data is counted in "row groups". A row group 30 - * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size) 29 + * Postprocessor input data is counted in "row groups". A row group is 30 + * defined to be (v_samp_factor * DCT_v_scaled_size / min_DCT_v_scaled_size) 31 31 * sample rows of each component. (We require DCT_scaled_size values to be 32 32 * chosen such that these numbers are integers. In practice DCT_scaled_size 33 33 * values will likely be powers of two, so we actually have the stronger ··· 37 37 * applying). 38 38 * 39 39 * The coefficient controller will deliver data to us one iMCU row at a time; 40 - * each iMCU row contains v_samp_factor * DCT_scaled_size sample rows, or 41 - * exactly min_DCT_scaled_size row groups. (This amount of data corresponds 40 + * each iMCU row contains v_samp_factor * DCT_v_scaled_size sample rows, or 41 + * exactly min_DCT_v_scaled_size row groups. (This amount of data corresponds 42 42 * to one row of MCUs when the image is fully interleaved.) Note that the 43 43 * number of sample rows varies across components, but the number of row 44 44 * groups does not. Some garbage sample rows may be included in the last iMCU ··· 75 75 * We could do this most simply by copying data around in our buffer, but 76 76 * that'd be very slow. We can avoid copying any data by creating a rather 77 77 * strange pointer structure. Here's how it works. We allocate a workspace 78 - * consisting of M+2 row groups (where M = min_DCT_scaled_size is the number 78 + * consisting of M+2 row groups (where M = min_DCT_v_scaled_size is the number 79 79 * of row groups per iMCU row). We create two sets of redundant pointers to 80 80 * the workspace. Labeling the physical row groups 0 to M+1, the synthesized 81 81 * pointer lists look like this: ··· 100 100 * the first or last sample row as necessary (this is cheaper than copying 101 101 * sample rows around). 102 102 * 103 - * This scheme breaks down if M < 2, ie, min_DCT_scaled_size is 1. In that 103 + * This scheme breaks down if M < 2, ie, min_DCT_v_scaled_size is 1. In that 104 104 * situation each iMCU row provides only one row group so the buffering logic 105 105 * must be different (eg, we must read two iMCU rows before we can emit the 106 106 * first row group). For now, we simply do not support providing context 107 - * rows when min_DCT_scaled_size is 1. That combination seems unlikely to 107 + * rows when min_DCT_v_scaled_size is 1. That combination seems unlikely to 108 108 * be worth providing --- if someone wants a 1/8th-size preview, they probably 109 109 * want it quick and dirty, so a context-free upsampler is sufficient. 110 110 */ ··· 118 118 /* Pointer to allocated workspace (M or M+2 row groups). */ 119 119 JSAMPARRAY buffer[MAX_COMPONENTS]; 120 120 121 - boolean buffer_full; /* Have we gotten an iMCU row from decoder? */ 122 121 JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */ 122 + JDIMENSION rowgroups_avail; /* row groups available to postprocessor */ 123 123 124 124 /* Remaining fields are only used in the context case. */ 125 + 126 + boolean buffer_full; /* Have we gotten an iMCU row from decoder? */ 125 127 126 128 /* These are the master pointers to the funny-order pointer lists. */ 127 129 JSAMPIMAGE xbuffer[2]; /* pointers to weird pointer lists */ 128 130 129 131 int whichptr; /* indicates which pointer set is now in use */ 130 132 int context_state; /* process_data state machine status */ 131 - JDIMENSION rowgroups_avail; /* row groups available to postprocessor */ 132 133 JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */ 133 134 } my_main_controller; 134 135 ··· 195 196 LOCAL(void) 196 197 make_funny_pointers (j_decompress_ptr cinfo) 197 198 /* Create the funny pointer lists discussed in the comments above. 198 - * The actual workspace is already allocated (in main->buffer), 199 + * The actual workspace is already allocated (in mainp->buffer), 199 200 * and the space for the pointer lists is allocated too. 200 201 * This routine just fills in the curiously ordered lists. 201 202 * This will be repeated at the beginning of each pass. ··· 317 318 mainp->whichptr = 0; /* Read first iMCU row into xbuffer[0] */ 318 319 mainp->context_state = CTX_PREPARE_FOR_IMCU; 319 320 mainp->iMCU_row_ctr = 0; 321 + mainp->buffer_full = FALSE; /* Mark buffer empty */ 320 322 } else { 321 323 /* Simple case with no context needed */ 322 324 mainp->pub.process_data = process_data_simple_main; 325 + mainp->rowgroup_ctr = mainp->rowgroups_avail; /* Mark buffer empty */ 323 326 } 324 - mainp->buffer_full = FALSE; /* Mark buffer empty */ 325 - mainp->rowgroup_ctr = 0; 326 327 break; 327 328 #ifdef QUANT_2PASS_SUPPORTED 328 329 case JBUF_CRANK_DEST: ··· 348 349 JDIMENSION out_rows_avail) 349 350 { 350 351 my_main_ptr mainp = (my_main_ptr) cinfo->main; 351 - JDIMENSION rowgroups_avail; 352 352 353 353 /* Read input data if we haven't filled the main buffer yet */ 354 - if (! mainp->buffer_full) { 354 + if (mainp->rowgroup_ctr >= mainp->rowgroups_avail) { 355 355 if (! (*cinfo->coef->decompress_data) (cinfo, mainp->buffer)) 356 356 return; /* suspension forced, can do nothing more */ 357 - mainp->buffer_full = TRUE; /* OK, we have an iMCU row to work with */ 357 + mainp->rowgroup_ctr = 0; /* OK, we have an iMCU row to work with */ 358 358 } 359 359 360 - /* There are always min_DCT_scaled_size row groups in an iMCU row. */ 361 - rowgroups_avail = (JDIMENSION) cinfo->min_DCT_v_scaled_size; 362 360 /* Note: at the bottom of the image, we may pass extra garbage row groups 363 361 * to the postprocessor. The postprocessor has to check for bottom 364 362 * of image anyway (at row resolution), so no point in us doing it too. ··· 366 364 367 365 /* Feed the postprocessor */ 368 366 (*cinfo->post->post_process_data) (cinfo, mainp->buffer, 369 - &mainp->rowgroup_ctr, rowgroups_avail, 370 - output_buf, out_row_ctr, out_rows_avail); 371 - 372 - /* Has postprocessor consumed all the data yet? If so, mark buffer empty */ 373 - if (mainp->rowgroup_ctr >= rowgroups_avail) { 374 - mainp->buffer_full = FALSE; 375 - mainp->rowgroup_ctr = 0; 376 - } 367 + &mainp->rowgroup_ctr, mainp->rowgroups_avail, 368 + output_buf, out_row_ctr, out_rows_avail); 377 369 } 378 370 379 371 ··· 498 490 alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */ 499 491 ngroups = cinfo->min_DCT_v_scaled_size + 2; 500 492 } else { 493 + /* There are always min_DCT_v_scaled_size row groups in an iMCU row. */ 501 494 ngroups = cinfo->min_DCT_v_scaled_size; 495 + mainp->rowgroups_avail = (JDIMENSION) ngroups; 502 496 } 503 497 504 498 for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+6 -7
dll/3rdparty/libjpeg/jdmaster.c
··· 2 2 * jdmaster.c 3 3 * 4 4 * Copyright (C) 1991-1997, Thomas G. Lane. 5 - * Modified 2002-2015 by Guido Vollbeding. 5 + * Modified 2002-2017 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 * ··· 237 237 JSAMPLE * table; 238 238 int i; 239 239 240 - table = (JSAMPLE *) 241 - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, 242 - 5 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE)); 240 + table = (JSAMPLE *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, 241 + JPOOL_IMAGE, (RANGE_CENTER * 2 + MAXJSAMPLE + 1) * SIZEOF(JSAMPLE)); 243 242 /* First segment of range limit table: limit[x] = 0 for x < 0 */ 244 - MEMZERO(table, 2 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE)); 245 - table += 2 * (MAXJSAMPLE+1); /* allow negative subscripts of table */ 243 + MEMZERO(table, RANGE_CENTER * SIZEOF(JSAMPLE)); 244 + table += RANGE_CENTER; /* allow negative subscripts of table */ 246 245 cinfo->sample_range_limit = table; 247 246 /* Main part of range limit table: limit[x] = x */ 248 247 for (i = 0; i <= MAXJSAMPLE; i++) 249 248 table[i] = (JSAMPLE) i; 250 249 /* End of range limit table: limit[x] = MAXJSAMPLE for x > MAXJSAMPLE */ 251 - for (; i < 3 * (MAXJSAMPLE+1); i++) 250 + for (; i <= MAXJSAMPLE + RANGE_CENTER; i++) 252 251 table[i] = MAXJSAMPLE; 253 252 } 254 253
+7 -1
dll/3rdparty/libjpeg/jdmerge.c
··· 2 2 * jdmerge.c 3 3 * 4 4 * Copyright (C) 1994-1996, Thomas G. Lane. 5 - * Modified 2013-2015 by Guido Vollbeding. 5 + * Modified 2013-2017 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 * ··· 38 38 #include "jpeglib.h" 39 39 40 40 #ifdef UPSAMPLE_MERGING_SUPPORTED 41 + 42 + 43 + #if RANGE_BITS < 2 44 + /* Deliberate syntax err */ 45 + Sorry, this code requires 2 or more range extension bits. 46 + #endif 41 47 42 48 43 49 /* Private subobject */
+2 -2
dll/3rdparty/libjpeg/jfdctflt.c
··· 2 2 * jfdctflt.c 3 3 * 4 4 * Copyright (C) 1994-1996, Thomas G. Lane. 5 - * Modified 2003-2015 by Guido Vollbeding. 5 + * Modified 2003-2017 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 * ··· 48 48 */ 49 49 50 50 #if DCTSIZE != 8 51 - Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ 51 + Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */ 52 52 #endif 53 53 54 54
+2 -2
dll/3rdparty/libjpeg/jfdctfst.c
··· 2 2 * jfdctfst.c 3 3 * 4 4 * Copyright (C) 1994-1996, Thomas G. Lane. 5 - * Modified 2003-2015 by Guido Vollbeding. 5 + * Modified 2003-2017 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 * ··· 44 44 */ 45 45 46 46 #if DCTSIZE != 8 47 - Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ 47 + Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */ 48 48 #endif 49 49 50 50
+2 -2
dll/3rdparty/libjpeg/jidctflt.c
··· 2 2 * jidctflt.c 3 3 * 4 4 * Copyright (C) 1994-1998, Thomas G. Lane. 5 - * Modified 2010-2015 by Guido Vollbeding. 5 + * Modified 2010-2017 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 * ··· 50 50 */ 51 51 52 52 #if DCTSIZE != 8 53 - Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ 53 + Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */ 54 54 #endif 55 55 56 56
+2 -2
dll/3rdparty/libjpeg/jidctfst.c
··· 2 2 * jidctfst.c 3 3 * 4 4 * Copyright (C) 1994-1998, Thomas G. Lane. 5 - * Modified 2015 by Guido Vollbeding. 5 + * Modified 2015-2017 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 * ··· 46 46 */ 47 47 48 48 #if DCTSIZE != 8 49 - Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ 49 + Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */ 50 50 #endif 51 51 52 52
+18 -17
dll/3rdparty/libjpeg/jidctint.c
··· 2 2 * jidctint.c 3 3 * 4 4 * Copyright (C) 1991-1998, Thomas G. Lane. 5 - * Modification developed 2002-2015 by Guido Vollbeding. 5 + * Modification developed 2002-2016 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 * ··· 166 166 /* 167 167 * Perform dequantization and inverse DCT on one block of coefficients. 168 168 * 169 + * Optimized algorithm with 12 multiplications in the 1-D kernel. 169 170 * cK represents sqrt(2) * cos(K*pi/16). 170 171 */ 171 172 ··· 428 429 429 430 /* 430 431 * Perform dequantization and inverse DCT on one block of coefficients, 431 - * producing a 7x7 output block. 432 + * producing a reduced-size 7x7 output block. 432 433 * 433 434 * Optimized algorithm with 12 multiplications in the 1-D kernel. 434 435 * cK represents sqrt(2) * cos(K*pi/14). ··· 2623 2624 tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); 2624 2625 tmp0 <<= CONST_BITS; 2625 2626 /* Add fudge factor here for final descale. */ 2626 - tmp0 += 1 << (CONST_BITS-PASS1_BITS-1); 2627 + tmp0 += ONE << (CONST_BITS-PASS1_BITS-1); 2627 2628 2628 2629 z1 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); 2629 2630 tmp1 = MULTIPLY(z1, FIX(1.306562965)); /* c4[16] = c2[8] */ ··· 2920 2921 * The rotator is c(-6). 2921 2922 */ 2922 2923 2923 - z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); 2924 - z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); 2925 - 2926 - z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */ 2927 - tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ 2928 - tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ 2929 - 2930 2924 z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); 2931 2925 z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); 2932 2926 z2 <<= CONST_BITS; ··· 2937 2931 tmp0 = z2 + z3; 2938 2932 tmp1 = z2 - z3; 2939 2933 2934 + z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); 2935 + z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); 2936 + 2937 + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */ 2938 + tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ 2939 + tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ 2940 + 2940 2941 tmp10 = tmp0 + tmp2; 2941 2942 tmp13 = tmp0 - tmp2; 2942 2943 tmp11 = tmp1 + tmp3; ··· 4883 4884 * The rotator is c(-6). 4884 4885 */ 4885 4886 4886 - z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); 4887 - z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); 4888 - 4889 - z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */ 4890 - tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ 4891 - tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ 4892 - 4893 4887 z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); 4894 4888 z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); 4895 4889 z2 <<= CONST_BITS; ··· 4899 4893 4900 4894 tmp0 = z2 + z3; 4901 4895 tmp1 = z2 - z3; 4896 + 4897 + z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); 4898 + z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); 4899 + 4900 + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */ 4901 + tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ 4902 + tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ 4902 4903 4903 4904 tmp10 = tmp0 + tmp2; 4904 4905 tmp13 = tmp0 - tmp2;
+25 -15
dll/3rdparty/libjpeg/rdbmp.c
··· 2 2 * rdbmp.c 3 3 * 4 4 * Copyright (C) 1994-1996, Thomas G. Lane. 5 - * Modified 2009-2010 by Guido Vollbeding. 5 + * Modified 2009-2017 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 * 9 9 * This file contains routines to read input images in Microsoft "BMP" 10 10 * format (MS Windows 3.x, OS/2 1.x, and OS/2 2.x flavors). 11 - * Currently, only 8-bit and 24-bit images are supported, not 1-bit or 11 + * Currently, only 8-, 24-, and 32-bit images are supported, not 1-bit or 12 12 * 4-bit (feeding such low-depth images into JPEG would be silly anyway). 13 13 * Also, we don't support RLE-compressed files. 14 14 * ··· 61 61 JDIMENSION source_row; /* Current source row number */ 62 62 JDIMENSION row_width; /* Physical width of scanlines in file */ 63 63 64 - int bits_per_pixel; /* remembers 8- or 24-bit format */ 64 + int bits_per_pixel; /* remembers 8-, 24-, or 32-bit format */ 65 + int cmap_length; /* colormap length */ 65 66 } bmp_source_struct; 66 67 67 68 ··· 121 122 /* This version is for reading 8-bit colormap indexes */ 122 123 { 123 124 bmp_source_ptr source = (bmp_source_ptr) sinfo; 124 - register JSAMPARRAY colormap = source->colormap; 125 125 JSAMPARRAY image_ptr; 126 - register int t; 127 126 register JSAMPROW inptr, outptr; 127 + register JSAMPARRAY colormap; 128 128 register JDIMENSION col; 129 + register int t; 130 + int cmaplen; 129 131 130 132 /* Fetch next row from virtual array */ 131 133 source->source_row--; ··· 136 138 /* Expand the colormap indexes to real data */ 137 139 inptr = image_ptr[0]; 138 140 outptr = source->pub.buffer[0]; 141 + colormap = source->colormap; 142 + cmaplen = source->cmap_length; 139 143 for (col = cinfo->image_width; col > 0; col--) { 140 144 t = GETJSAMPLE(*inptr++); 145 + if (t >= cmaplen) 146 + ERREXIT(cinfo, JERR_BMP_OUTOFRANGE); 141 147 *outptr++ = colormap[0][t]; /* can omit GETJSAMPLE() safely */ 142 148 *outptr++ = colormap[1][t]; 143 149 *outptr++ = colormap[2][t]; ··· 192 198 image_ptr = (*cinfo->mem->access_virt_sarray) 193 199 ((j_common_ptr) cinfo, source->whole_image, 194 200 source->source_row, (JDIMENSION) 1, FALSE); 201 + 195 202 /* Transfer data. Note source values are in BGR order 196 203 * (even though Microsoft's own documents say the opposite). 197 204 */ ··· 301 308 ERREXIT(cinfo, JERR_INPUT_EOF); 302 309 if (GET_2B(bmpfileheader,0) != 0x4D42) /* 'BM' */ 303 310 ERREXIT(cinfo, JERR_BMP_NOT); 304 - bfOffBits = (INT32) GET_4B(bmpfileheader,10); 311 + bfOffBits = GET_4B(bmpfileheader,10); 305 312 /* We ignore the remaining fileheader fields */ 306 313 307 314 /* The infoheader might be 12 bytes (OS/2 1.x), 40 bytes (Windows), ··· 309 316 */ 310 317 if (! ReadOK(source->pub.input_file, bmpinfoheader, 4)) 311 318 ERREXIT(cinfo, JERR_INPUT_EOF); 312 - headerSize = (INT32) GET_4B(bmpinfoheader,0); 319 + headerSize = GET_4B(bmpinfoheader,0); 313 320 if (headerSize < 12 || headerSize > 64) 314 321 ERREXIT(cinfo, JERR_BMP_BADHEADER); 315 322 if (! ReadOK(source->pub.input_file, bmpinfoheader+4, headerSize-4)) ··· 329 336 TRACEMS2(cinfo, 1, JTRC_BMP_OS2_MAPPED, (int) biWidth, (int) biHeight); 330 337 break; 331 338 case 24: /* RGB image */ 332 - TRACEMS2(cinfo, 1, JTRC_BMP_OS2, (int) biWidth, (int) biHeight); 339 + case 32: /* RGB image + Alpha channel */ 340 + TRACEMS3(cinfo, 1, JTRC_BMP_OS2, (int) biWidth, (int) biHeight, 341 + source->bits_per_pixel); 333 342 break; 334 343 default: 335 344 ERREXIT(cinfo, JERR_BMP_BADDEPTH); ··· 356 365 TRACEMS2(cinfo, 1, JTRC_BMP_MAPPED, (int) biWidth, (int) biHeight); 357 366 break; 358 367 case 24: /* RGB image */ 359 - TRACEMS2(cinfo, 1, JTRC_BMP, (int) biWidth, (int) biHeight); 360 - break; 361 368 case 32: /* RGB image + Alpha channel */ 362 - TRACEMS2(cinfo, 1, JTRC_BMP, (int) biWidth, (int) biHeight); 369 + TRACEMS3(cinfo, 1, JTRC_BMP, (int) biWidth, (int) biHeight, 370 + source->bits_per_pixel); 363 371 break; 364 372 default: 365 373 ERREXIT(cinfo, JERR_BMP_BADDEPTH); ··· 377 385 break; 378 386 default: 379 387 ERREXIT(cinfo, JERR_BMP_BADHEADER); 380 - return; 388 + return; /* avoid compiler warnings for uninitialized variables */ 381 389 } 382 390 383 - if (biWidth <= 0 || biHeight <= 0) 384 - ERREXIT(cinfo, JERR_BMP_EMPTY); 385 391 if (biPlanes != 1) 386 392 ERREXIT(cinfo, JERR_BMP_BADPLANES); 393 + /* Sanity check for buffer allocation below */ 394 + if (biWidth <= 0 || biHeight <= 0 || (biWidth >> 24) || (biHeight >> 24)) 395 + ERREXIT(cinfo, JERR_BMP_OUTOFRANGE); 387 396 388 397 /* Compute distance to bitmap data --- will adjust for colormap below */ 389 398 bPad = bfOffBits - (headerSize + 14); ··· 398 407 source->colormap = (*cinfo->mem->alloc_sarray) 399 408 ((j_common_ptr) cinfo, JPOOL_IMAGE, 400 409 (JDIMENSION) biClrUsed, (JDIMENSION) 3); 410 + source->cmap_length = (int) biClrUsed; 401 411 /* and read it from the file */ 402 412 read_colormap(source, (int) biClrUsed, mapentrysize); 403 413 /* account for size of colormap */ ··· 474 484 source->pub.start_input = start_input_bmp; 475 485 source->pub.finish_input = finish_input_bmp; 476 486 477 - return (cjpeg_source_ptr) source; 487 + return &source->pub; 478 488 } 479 489 480 490 #endif /* BMP_SUPPORTED */
+74 -28
dll/3rdparty/libjpeg/rdppm.c
··· 2 2 * rdppm.c 3 3 * 4 4 * Copyright (C) 1991-1997, Thomas G. Lane. 5 - * Modified 2009 by Bill Allombert, Guido Vollbeding. 5 + * Modified 2009-2017 by Bill Allombert, 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 * ··· 76 76 JSAMPROW pixrow; /* FAR pointer to same */ 77 77 size_t buffer_width; /* width of I/O buffer */ 78 78 JSAMPLE *rescale; /* => maxval-remapping array, or NULL */ 79 + unsigned int maxval; 79 80 } ppm_source_struct; 80 81 81 82 typedef ppm_source_struct * ppm_source_ptr; ··· 146 147 FILE * infile = source->pub.input_file; 147 148 register JSAMPROW ptr; 148 149 register JSAMPLE *rescale = source->rescale; 150 + unsigned int maxval = source->maxval; 149 151 JDIMENSION col; 150 152 151 153 ptr = source->pub.buffer[0]; 152 154 for (col = cinfo->image_width; col > 0; col--) { 153 - *ptr++ = rescale[read_pbm_integer(cinfo, infile)]; 155 + register unsigned int temp; 156 + temp = read_pbm_integer(cinfo, infile); 157 + if (temp > maxval) 158 + ERREXIT(cinfo, JERR_PPM_OUTOFRANGE); 159 + *ptr++ = rescale[temp]; 154 160 } 155 161 return 1; 156 162 } ··· 164 170 FILE * infile = source->pub.input_file; 165 171 register JSAMPROW ptr; 166 172 register JSAMPLE *rescale = source->rescale; 173 + unsigned int maxval = source->maxval; 167 174 JDIMENSION col; 168 175 169 176 ptr = source->pub.buffer[0]; 170 177 for (col = cinfo->image_width; col > 0; col--) { 171 - *ptr++ = rescale[read_pbm_integer(cinfo, infile)]; 172 - *ptr++ = rescale[read_pbm_integer(cinfo, infile)]; 173 - *ptr++ = rescale[read_pbm_integer(cinfo, infile)]; 178 + register unsigned int temp; 179 + temp = read_pbm_integer(cinfo, infile); 180 + if (temp > maxval) 181 + ERREXIT(cinfo, JERR_PPM_OUTOFRANGE); 182 + *ptr++ = rescale[temp]; 183 + temp = read_pbm_integer(cinfo, infile); 184 + if (temp > maxval) 185 + ERREXIT(cinfo, JERR_PPM_OUTOFRANGE); 186 + *ptr++ = rescale[temp]; 187 + temp = read_pbm_integer(cinfo, infile); 188 + if (temp > maxval) 189 + ERREXIT(cinfo, JERR_PPM_OUTOFRANGE); 190 + *ptr++ = rescale[temp]; 174 191 } 175 192 return 1; 176 193 } ··· 184 201 register JSAMPROW ptr; 185 202 register U_CHAR * bufferptr; 186 203 register JSAMPLE *rescale = source->rescale; 204 + unsigned int maxval = source->maxval; 187 205 JDIMENSION col; 188 206 189 207 if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width)) ··· 191 209 ptr = source->pub.buffer[0]; 192 210 bufferptr = source->iobuffer; 193 211 for (col = cinfo->image_width; col > 0; col--) { 194 - *ptr++ = rescale[UCH(*bufferptr++)]; 212 + register unsigned int temp; 213 + temp = (unsigned int) UCH(*bufferptr++); 214 + if (temp > maxval) 215 + ERREXIT(cinfo, JERR_PPM_OUTOFRANGE); 216 + *ptr++ = rescale[temp]; 195 217 } 196 218 return 1; 197 219 } ··· 205 227 register JSAMPROW ptr; 206 228 register U_CHAR * bufferptr; 207 229 register JSAMPLE *rescale = source->rescale; 230 + unsigned int maxval = source->maxval; 208 231 JDIMENSION col; 209 232 210 233 if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width)) ··· 212 235 ptr = source->pub.buffer[0]; 213 236 bufferptr = source->iobuffer; 214 237 for (col = cinfo->image_width; col > 0; col--) { 215 - *ptr++ = rescale[UCH(*bufferptr++)]; 216 - *ptr++ = rescale[UCH(*bufferptr++)]; 217 - *ptr++ = rescale[UCH(*bufferptr++)]; 238 + register unsigned int temp; 239 + temp = (unsigned int) UCH(*bufferptr++); 240 + if (temp > maxval) 241 + ERREXIT(cinfo, JERR_PPM_OUTOFRANGE); 242 + *ptr++ = rescale[temp]; 243 + temp = (unsigned int) UCH(*bufferptr++); 244 + if (temp > maxval) 245 + ERREXIT(cinfo, JERR_PPM_OUTOFRANGE); 246 + *ptr++ = rescale[temp]; 247 + temp = (unsigned int) UCH(*bufferptr++); 248 + if (temp > maxval) 249 + ERREXIT(cinfo, JERR_PPM_OUTOFRANGE); 250 + *ptr++ = rescale[temp]; 218 251 } 219 252 return 1; 220 253 } ··· 243 276 register JSAMPROW ptr; 244 277 register U_CHAR * bufferptr; 245 278 register JSAMPLE *rescale = source->rescale; 279 + unsigned int maxval = source->maxval; 246 280 JDIMENSION col; 247 281 248 282 if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width)) ··· 250 284 ptr = source->pub.buffer[0]; 251 285 bufferptr = source->iobuffer; 252 286 for (col = cinfo->image_width; col > 0; col--) { 253 - register int temp; 254 - temp = UCH(*bufferptr++) << 8; 255 - temp |= UCH(*bufferptr++); 287 + register unsigned int temp; 288 + temp = ((unsigned int) UCH(*bufferptr++)) << 8; 289 + temp |= (unsigned int) UCH(*bufferptr++); 290 + if (temp > maxval) 291 + ERREXIT(cinfo, JERR_PPM_OUTOFRANGE); 256 292 *ptr++ = rescale[temp]; 257 293 } 258 294 return 1; ··· 267 303 register JSAMPROW ptr; 268 304 register U_CHAR * bufferptr; 269 305 register JSAMPLE *rescale = source->rescale; 306 + unsigned int maxval = source->maxval; 270 307 JDIMENSION col; 271 308 272 309 if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width)) ··· 274 311 ptr = source->pub.buffer[0]; 275 312 bufferptr = source->iobuffer; 276 313 for (col = cinfo->image_width; col > 0; col--) { 277 - register int temp; 278 - temp = UCH(*bufferptr++) << 8; 279 - temp |= UCH(*bufferptr++); 314 + register unsigned int temp; 315 + temp = ((unsigned int) UCH(*bufferptr++)) << 8; 316 + temp |= (unsigned int) UCH(*bufferptr++); 317 + if (temp > maxval) 318 + ERREXIT(cinfo, JERR_PPM_OUTOFRANGE); 280 319 *ptr++ = rescale[temp]; 281 - temp = UCH(*bufferptr++) << 8; 282 - temp |= UCH(*bufferptr++); 320 + temp = ((unsigned int) UCH(*bufferptr++)) << 8; 321 + temp |= (unsigned int) UCH(*bufferptr++); 322 + if (temp > maxval) 323 + ERREXIT(cinfo, JERR_PPM_OUTOFRANGE); 283 324 *ptr++ = rescale[temp]; 284 - temp = UCH(*bufferptr++) << 8; 285 - temp |= UCH(*bufferptr++); 325 + temp = ((unsigned int) UCH(*bufferptr++)) << 8; 326 + temp |= (unsigned int) UCH(*bufferptr++); 327 + if (temp > maxval) 328 + ERREXIT(cinfo, JERR_PPM_OUTOFRANGE); 286 329 *ptr++ = rescale[temp]; 287 330 } 288 331 return 1; ··· 326 369 if (w <= 0 || h <= 0 || maxval <= 0) /* error check */ 327 370 ERREXIT(cinfo, JERR_PPM_NOT); 328 371 372 + if (((long) w >> 24) || /* sanity check for buffer allocation below */ 373 + ((long) maxval >> 16)) /* support max 16-bit (2-byte) sample values */ 374 + ERREXIT(cinfo, JERR_PPM_OUTOFRANGE); 375 + 329 376 cinfo->data_precision = BITS_IN_JSAMPLE; /* we always rescale data to this */ 330 377 cinfo->image_width = (JDIMENSION) w; 331 378 cinfo->image_height = (JDIMENSION) h; 379 + source->maxval = maxval; 332 380 333 381 /* initialize flags to most common settings */ 334 382 need_iobuffer = TRUE; /* do we need an I/O buffer? */ ··· 386 434 /* Allocate space for I/O buffer: 1 or 3 bytes or words/pixel. */ 387 435 if (need_iobuffer) { 388 436 source->buffer_width = (size_t) w * cinfo->input_components * 389 - ((maxval<=255) ? SIZEOF(U_CHAR) : (2*SIZEOF(U_CHAR))); 390 - source->iobuffer = (U_CHAR *) 391 - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, 392 - source->buffer_width); 437 + ((maxval <= 255) ? SIZEOF(U_CHAR) : (2 * SIZEOF(U_CHAR))); 438 + source->iobuffer = (U_CHAR *) (*cinfo->mem->alloc_small) 439 + ((j_common_ptr) cinfo, JPOOL_IMAGE, source->buffer_width); 393 440 } 394 441 395 442 /* Create compressor input buffer. */ ··· 413 460 INT32 val, half_maxval; 414 461 415 462 /* On 16-bit-int machines we have to be careful of maxval = 65535 */ 416 - source->rescale = (JSAMPLE *) 417 - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, 418 - (size_t) (((long) maxval + 1L) * SIZEOF(JSAMPLE))); 463 + source->rescale = (JSAMPLE *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, 464 + JPOOL_IMAGE, (size_t) (((long) maxval + 1L) * SIZEOF(JSAMPLE))); 419 465 half_maxval = maxval / 2; 420 466 for (val = 0; val <= (INT32) maxval; val++) { 421 467 /* The multiplication here must be done in 32 bits to avoid overflow */ 422 - source->rescale[val] = (JSAMPLE) ((val*MAXJSAMPLE + half_maxval)/maxval); 468 + source->rescale[val] = (JSAMPLE) ((val * MAXJSAMPLE + half_maxval) / maxval); 423 469 } 424 470 } 425 471 } ··· 453 499 source->pub.start_input = start_input_ppm; 454 500 source->pub.finish_input = finish_input_ppm; 455 501 456 - return (cjpeg_source_ptr) source; 502 + return &source->pub; 457 503 } 458 504 459 505 #endif /* PPM_SUPPORTED */
+18 -8
dll/3rdparty/libjpeg/rdtarga.c
··· 2 2 * rdtarga.c 3 3 * 4 4 * Copyright (C) 1991-1996, Thomas G. Lane. 5 + * Modified 2017 by Guido Vollbeding. 5 6 * This file is part of the Independent JPEG Group's software. 6 7 * For conditions of distribution and use, see the accompanying README file. 7 8 * ··· 62 63 U_CHAR tga_pixel[4]; 63 64 64 65 int pixel_size; /* Bytes per Targa pixel (1 to 4) */ 66 + int cmap_length; /* colormap length */ 65 67 66 68 /* State info for reading RLE-coded pixels; both counts must be init to 0 */ 67 69 int block_count; /* # of pixels remaining in RLE block */ ··· 177 179 tga_source_ptr source = (tga_source_ptr) sinfo; 178 180 register JSAMPROW ptr; 179 181 register JDIMENSION col; 180 - 182 + 181 183 ptr = source->pub.buffer[0]; 182 184 for (col = cinfo->image_width; col > 0; col--) { 183 185 (*source->read_pixel) (source); /* Load next pixel into tga_pixel */ ··· 191 193 /* This version is for reading 8-bit colormap indexes */ 192 194 { 193 195 tga_source_ptr source = (tga_source_ptr) sinfo; 194 - register int t; 195 196 register JSAMPROW ptr; 197 + register JSAMPARRAY colormap; 196 198 register JDIMENSION col; 197 - register JSAMPARRAY colormap = source->colormap; 199 + register int t; 200 + int cmaplen; 198 201 199 202 ptr = source->pub.buffer[0]; 203 + colormap = source->colormap; 204 + cmaplen = source->cmap_length; 200 205 for (col = cinfo->image_width; col > 0; col--) { 201 206 (*source->read_pixel) (source); /* Load next pixel into tga_pixel */ 202 207 t = UCH(source->tga_pixel[0]); 208 + if (t >= cmaplen) 209 + ERREXIT(cinfo, JERR_TGA_BADPARMS); 203 210 *ptr++ = colormap[0][t]; 204 211 *ptr++ = colormap[1][t]; 205 212 *ptr++ = colormap[2][t]; ··· 215 222 register int t; 216 223 register JSAMPROW ptr; 217 224 register JDIMENSION col; 218 - 225 + 219 226 ptr = source->pub.buffer[0]; 220 227 for (col = cinfo->image_width; col > 0; col--) { 221 228 (*source->read_pixel) (source); /* Load next pixel into tga_pixel */ ··· 242 249 tga_source_ptr source = (tga_source_ptr) sinfo; 243 250 register JSAMPROW ptr; 244 251 register JDIMENSION col; 245 - 252 + 246 253 ptr = source->pub.buffer[0]; 247 254 for (col = cinfo->image_width; col > 0; col--) { 248 255 (*source->read_pixel) (source); /* Load next pixel into tga_pixel */ ··· 361 368 interlace_type = flags >> 6; /* bits 6/7 are interlace code */ 362 369 363 370 if (cmaptype > 1 || /* cmaptype must be 0 or 1 */ 371 + width <= 0 || height <= 0 || 364 372 source->pixel_size < 1 || source->pixel_size > 4 || 365 373 (UCH(targaheader[16]) & 7) != 0 || /* bits/pixel must be multiple of 8 */ 366 374 interlace_type != 0) /* currently don't allow interlaced image */ 367 375 ERREXIT(cinfo, JERR_TGA_BADPARMS); 368 - 376 + 369 377 if (subtype > 8) { 370 378 /* It's an RLE-coded file */ 371 379 source->read_pixel = read_rle_pixel; ··· 440 448 source->pub.buffer_height = 1; 441 449 source->pub.get_pixel_rows = source->get_pixel_rows; 442 450 } 443 - 451 + 444 452 while (idlen--) /* Throw away ID field */ 445 453 (void) read_byte(source); 446 454 ··· 450 458 /* Allocate space to store the colormap */ 451 459 source->colormap = (*cinfo->mem->alloc_sarray) 452 460 ((j_common_ptr) cinfo, JPOOL_IMAGE, (JDIMENSION) maplen, (JDIMENSION) 3); 461 + source->cmap_length = (int) maplen; 453 462 /* and read it from the file */ 454 463 read_colormap(source, (int) maplen, UCH(targaheader[7])); 455 464 } else { 456 465 if (cmaptype) /* but you promised a cmap! */ 457 466 ERREXIT(cinfo, JERR_TGA_BADPARMS); 458 467 source->colormap = NULL; 468 + source->cmap_length = 0; 459 469 } 460 470 461 471 cinfo->input_components = components; ··· 494 504 source->pub.start_input = start_input_tga; 495 505 source->pub.finish_input = finish_input_tga; 496 506 497 - return (cjpeg_source_ptr) source; 507 + return &source->pub; 498 508 } 499 509 500 510 #endif /* TARGA_SUPPORTED */
+65 -10
dll/3rdparty/libjpeg/transupp.c
··· 1 1 /* 2 2 * transupp.c 3 3 * 4 - * Copyright (C) 1997-2013, Thomas G. Lane, Guido Vollbeding. 4 + * Copyright (C) 1997-2017, Thomas G. Lane, Guido Vollbeding. 5 5 * This file is part of the Independent JPEG Group's software. 6 6 * For conditions of distribution and use, see the accompanying README file. 7 7 * ··· 198 198 JDIMENSION drop_width, JDIMENSION drop_height) 199 199 /* Wipe - drop content of specified area, fill with zero (neutral gray) */ 200 200 { 201 - JDIMENSION comp_width, comp_height; 202 - JDIMENSION blk_y, x_wipe_blocks, y_wipe_blocks; 201 + JDIMENSION x_wipe_blocks, wipe_width; 202 + JDIMENSION y_wipe_blocks, wipe_bottom; 203 203 int ci, offset_y; 204 204 JBLOCKARRAY buffer; 205 205 jpeg_component_info *compptr; 206 206 207 207 for (ci = 0; ci < dstinfo->num_components; ci++) { 208 208 compptr = dstinfo->comp_info + ci; 209 - comp_width = drop_width * compptr->h_samp_factor; 210 - comp_height = drop_height * compptr->v_samp_factor; 209 + x_wipe_blocks = x_crop_offset * compptr->h_samp_factor; 210 + wipe_width = drop_width * compptr->h_samp_factor; 211 + y_wipe_blocks = y_crop_offset * compptr->v_samp_factor; 212 + wipe_bottom = drop_height * compptr->v_samp_factor + y_wipe_blocks; 213 + for (; y_wipe_blocks < wipe_bottom; 214 + y_wipe_blocks += compptr->v_samp_factor) { 215 + buffer = (*srcinfo->mem->access_virt_barray) 216 + ((j_common_ptr) srcinfo, src_coef_arrays[ci], y_wipe_blocks, 217 + (JDIMENSION) compptr->v_samp_factor, TRUE); 218 + for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) { 219 + FMEMZERO(buffer[offset_y] + x_wipe_blocks, 220 + wipe_width * SIZEOF(JBLOCK)); 221 + } 222 + } 223 + } 224 + } 225 + 226 + 227 + LOCAL(void) 228 + do_flatten (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, 229 + JDIMENSION x_crop_offset, JDIMENSION y_crop_offset, 230 + jvirt_barray_ptr *src_coef_arrays, 231 + JDIMENSION drop_width, JDIMENSION drop_height) 232 + /* Flatten - drop content of specified area, similar to wipe, 233 + * but fill with average of adjacent blocks, instead of zero. 234 + */ 235 + { 236 + JDIMENSION x_wipe_blocks, wipe_width, wipe_right; 237 + JDIMENSION y_wipe_blocks, wipe_bottom, blk_x; 238 + int ci, offset_y, dc_left_value, dc_right_value, average; 239 + JBLOCKARRAY buffer; 240 + jpeg_component_info *compptr; 241 + 242 + for (ci = 0; ci < dstinfo->num_components; ci++) { 243 + compptr = dstinfo->comp_info + ci; 211 244 x_wipe_blocks = x_crop_offset * compptr->h_samp_factor; 245 + wipe_width = drop_width * compptr->h_samp_factor; 246 + wipe_right = wipe_width + x_wipe_blocks; 212 247 y_wipe_blocks = y_crop_offset * compptr->v_samp_factor; 213 - for (blk_y = 0; blk_y < comp_height; blk_y += compptr->v_samp_factor) { 248 + wipe_bottom = drop_height * compptr->v_samp_factor + y_wipe_blocks; 249 + for (; y_wipe_blocks < wipe_bottom; 250 + y_wipe_blocks += compptr->v_samp_factor) { 214 251 buffer = (*srcinfo->mem->access_virt_barray) 215 - ((j_common_ptr) srcinfo, src_coef_arrays[ci], blk_y + y_wipe_blocks, 252 + ((j_common_ptr) srcinfo, src_coef_arrays[ci], y_wipe_blocks, 216 253 (JDIMENSION) compptr->v_samp_factor, TRUE); 217 254 for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) { 218 255 FMEMZERO(buffer[offset_y] + x_wipe_blocks, 219 - comp_width * SIZEOF(JBLOCK)); 256 + wipe_width * SIZEOF(JBLOCK)); 257 + if (x_wipe_blocks > 0) { 258 + dc_left_value = buffer[offset_y][x_wipe_blocks - 1][0]; 259 + if (wipe_right < compptr->width_in_blocks) { 260 + dc_right_value = buffer[offset_y][wipe_right][0]; 261 + average = (dc_left_value + dc_right_value) >> 1; 262 + } else { 263 + average = dc_left_value; 264 + } 265 + } else if (wipe_right < compptr->width_in_blocks) { 266 + average = buffer[offset_y][wipe_right][0]; 267 + } else continue; 268 + for (blk_x = x_wipe_blocks; blk_x < wipe_right; blk_x++) { 269 + buffer[offset_y][blk_x][0] = (JCOEF) average; 270 + } 220 271 } 221 272 } 222 273 } ··· 1626 1677 src_coef_arrays, dst_coef_arrays); 1627 1678 break; 1628 1679 case JXFORM_WIPE: 1629 - do_wipe(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset, 1630 - src_coef_arrays, info->drop_width, info->drop_height); 1680 + if (info->crop_width_set != JCROP_FORCE) 1681 + do_wipe(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset, 1682 + src_coef_arrays, info->drop_width, info->drop_height); 1683 + else 1684 + do_flatten(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset, 1685 + src_coef_arrays, info->drop_width, info->drop_height); 1631 1686 break; 1632 1687 } 1633 1688 }
+6 -5
dll/3rdparty/libjpeg/wrbmp.c
··· 2 2 * wrbmp.c 3 3 * 4 4 * Copyright (C) 1994-1996, Thomas G. Lane. 5 + * Modified 2017 by Guido Vollbeding. 5 6 * This file is part of the Independent JPEG Group's software. 6 7 * For conditions of distribution and use, see the accompanying README file. 7 8 * ··· 189 190 /* File size */ 190 191 headersize = 14 + 40 + cmap_entries * 4; /* Header and colormap */ 191 192 bfSize = headersize + (INT32) dest->row_width * (INT32) cinfo->output_height; 192 - 193 + 193 194 /* Set unused fields of header to 0 */ 194 195 MEMZERO(bmpfileheader, SIZEOF(bmpfileheader)); 195 196 MEMZERO(bmpinfoheader, SIZEOF(bmpinfoheader)); ··· 254 255 /* File size */ 255 256 headersize = 14 + 12 + cmap_entries * 3; /* Header and colormap */ 256 257 bfSize = headersize + (INT32) dest->row_width * (INT32) cinfo->output_height; 257 - 258 + 258 259 /* Set unused fields of header to 0 */ 259 260 MEMZERO(bmpfileheader, SIZEOF(bmpfileheader)); 260 261 MEMZERO(bmpcoreheader, SIZEOF(bmpcoreheader)); ··· 376 377 progress->completed_extra_passes++; 377 378 378 379 /* Make sure we wrote the output file OK */ 379 - fflush(outfile); 380 - if (ferror(outfile)) 380 + JFFLUSH(outfile); 381 + if (JFERROR(outfile)) 381 382 ERREXIT(cinfo, JERR_FILE_WRITE); 382 383 } 383 384 ··· 436 437 ((j_common_ptr) cinfo, JPOOL_IMAGE, row_width, (JDIMENSION) 1); 437 438 dest->pub.buffer_height = 1; 438 439 439 - return (djpeg_dest_ptr) dest; 440 + return &dest->pub; 440 441 } 441 442 442 443 #endif /* BMP_SUPPORTED */
+3 -3
dll/3rdparty/libjpeg/wrgif.c
··· 2 2 * wrgif.c 3 3 * 4 4 * Copyright (C) 1991-1997, Thomas G. Lane. 5 - * Modified 2015 by Guido Vollbeding. 5 + * Modified 2015-2017 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 * ··· 347 347 /* Write the GIF terminator mark */ 348 348 putc(';', dest->pub.output_file); 349 349 /* Make sure we wrote the output file OK */ 350 - fflush(dest->pub.output_file); 351 - if (ferror(dest->pub.output_file)) 350 + JFFLUSH(dest->pub.output_file); 351 + if (JFERROR(dest->pub.output_file)) 352 352 ERREXIT(cinfo, JERR_FILE_WRITE); 353 353 } 354 354
+2 -2
dll/3rdparty/libjpeg/wrjpgcom.c
··· 2 2 * wrjpgcom.c 3 3 * 4 4 * Copyright (C) 1994-1997, Thomas G. Lane. 5 - * Modified 2015 by Guido Vollbeding. 5 + * Modified 2015-2017 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 * ··· 254 254 if (length < 2) 255 255 ERREXIT("Erroneous JPEG marker length"); 256 256 length -= 2; 257 - /* Skip over the remaining bytes */ 257 + /* Copy the remaining bytes */ 258 258 while (length > 0) { 259 259 write_1_byte(read_1_byte()); 260 260 length--;
+4 -4
dll/3rdparty/libjpeg/wrppm.c
··· 2 2 * wrppm.c 3 3 * 4 4 * Copyright (C) 1991-1996, Thomas G. Lane. 5 - * Modified 2009 by Guido Vollbeding. 5 + * Modified 2009-2017 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 * ··· 206 206 finish_output_ppm (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) 207 207 { 208 208 /* Make sure we wrote the output file OK */ 209 - fflush(dinfo->output_file); 210 - if (ferror(dinfo->output_file)) 209 + JFFLUSH(dinfo->output_file); 210 + if (JFERROR(dinfo->output_file)) 211 211 ERREXIT(cinfo, JERR_FILE_WRITE); 212 212 } 213 213 ··· 263 263 dest->pub.put_pixel_rows = put_pixel_rows; 264 264 } 265 265 266 - return (djpeg_dest_ptr) dest; 266 + return &dest->pub; 267 267 } 268 268 269 269 #endif /* PPM_SUPPORTED */
+4 -3
dll/3rdparty/libjpeg/wrrle.c
··· 2 2 * wrrle.c 3 3 * 4 4 * Copyright (C) 1991-1996, Thomas G. Lane. 5 + * Modified 2017 by Guido Vollbeding. 5 6 * This file is part of the Independent JPEG Group's software. 6 7 * For conditions of distribution and use, see the accompanying README file. 7 8 * ··· 263 264 264 265 /* Emit file trailer */ 265 266 rle_puteof(&header); 266 - fflush(dest->pub.output_file); 267 - if (ferror(dest->pub.output_file)) 267 + JFFLUSH(dest->pub.output_file); 268 + if (JFERROR(dest->pub.output_file)) 268 269 ERREXIT(cinfo, JERR_FILE_WRITE); 269 270 } 270 271 ··· 299 300 (JDIMENSION) (cinfo->output_width * cinfo->output_components), 300 301 cinfo->output_height, (JDIMENSION) 1); 301 302 302 - return (djpeg_dest_ptr) dest; 303 + return &dest->pub; 303 304 } 304 305 305 306 #endif /* RLE_SUPPORTED */
+3 -3
dll/3rdparty/libjpeg/wrtarga.c
··· 2 2 * wrtarga.c 3 3 * 4 4 * Copyright (C) 1991-1996, Thomas G. Lane. 5 - * Modified 2015 by Guido Vollbeding. 5 + * Modified 2015-2017 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 * ··· 212 212 finish_output_tga (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) 213 213 { 214 214 /* Make sure we wrote the output file OK */ 215 - fflush(dinfo->output_file); 216 - if (ferror(dinfo->output_file)) 215 + JFFLUSH(dinfo->output_file); 216 + if (JFERROR(dinfo->output_file)) 217 217 ERREXIT(cinfo, JERR_FILE_WRITE); 218 218 } 219 219
+6 -5
sdk/include/reactos/libs/libjpeg/cderror.h
··· 2 2 * cderror.h 3 3 * 4 4 * Copyright (C) 1994-1997, Thomas G. Lane. 5 - * Modified 2009 by Guido Vollbeding. 5 + * Modified 2009-2017 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 * ··· 41 41 42 42 #ifdef BMP_SUPPORTED 43 43 JMESSAGE(JERR_BMP_BADCMAP, "Unsupported BMP colormap format") 44 - JMESSAGE(JERR_BMP_BADDEPTH, "Only 8- and 24-bit BMP files are supported") 44 + JMESSAGE(JERR_BMP_BADDEPTH, "Only 8-, 24-, and 32-bit BMP files are supported") 45 45 JMESSAGE(JERR_BMP_BADHEADER, "Invalid BMP file: bad header length") 46 46 JMESSAGE(JERR_BMP_BADPLANES, "Invalid BMP file: biPlanes not equal to 1") 47 47 JMESSAGE(JERR_BMP_COLORSPACE, "BMP output must be grayscale or RGB") 48 48 JMESSAGE(JERR_BMP_COMPRESSED, "Sorry, compressed BMPs not yet supported") 49 - JMESSAGE(JERR_BMP_EMPTY, "Empty BMP image") 50 49 JMESSAGE(JERR_BMP_NOT, "Not a BMP file - does not start with BM") 51 - JMESSAGE(JTRC_BMP, "%ux%u 24-bit BMP image") 50 + JMESSAGE(JERR_BMP_OUTOFRANGE, "Numeric value out of range in BMP file") 51 + JMESSAGE(JTRC_BMP, "%ux%u %d-bit BMP image") 52 52 JMESSAGE(JTRC_BMP_MAPPED, "%ux%u 8-bit colormapped BMP image") 53 - JMESSAGE(JTRC_BMP_OS2, "%ux%u 24-bit OS2 BMP image") 53 + JMESSAGE(JTRC_BMP_OS2, "%ux%u %d-bit OS2 BMP image") 54 54 JMESSAGE(JTRC_BMP_OS2_MAPPED, "%ux%u 8-bit colormapped OS2 BMP image") 55 55 #endif /* BMP_SUPPORTED */ 56 56 ··· 75 75 JMESSAGE(JERR_PPM_COLORSPACE, "PPM output must be grayscale or RGB") 76 76 JMESSAGE(JERR_PPM_NONNUMERIC, "Nonnumeric data in PPM file") 77 77 JMESSAGE(JERR_PPM_NOT, "Not a PPM/PGM file") 78 + JMESSAGE(JERR_PPM_OUTOFRANGE, "Numeric value out of range in PPM file") 78 79 JMESSAGE(JTRC_PGM, "%ux%u PGM image") 79 80 JMESSAGE(JTRC_PGM_TEXT, "%ux%u text PGM image") 80 81 JMESSAGE(JTRC_PPM, "%ux%u PPM image")
+5 -6
sdk/include/reactos/libs/libjpeg/jdct.h
··· 2 2 * jdct.h 3 3 * 4 4 * Copyright (C) 1994-1996, Thomas G. Lane. 5 - * Modified 2002-2015 by Guido Vollbeding. 5 + * Modified 2002-2017 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 * ··· 79 79 * converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could 80 80 * be quite far out of range if the input data is corrupt, so a bulletproof 81 81 * range-limiting step is required. We use a mask-and-table-lookup method 82 - * to do the combined operations quickly, assuming that MAXJSAMPLE+1 83 - * is a power of 2. See the comments with prepare_range_limit_table 84 - * (in jdmaster.c) for more info. 82 + * to do the combined operations quickly, assuming that RANGE_CENTER 83 + * (defined in jpegint.h) is a power of 2. See the comments with 84 + * prepare_range_limit_table (in jdmaster.c) for more info. 85 85 */ 86 86 87 - #define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */ 88 - #define RANGE_CENTER (MAXJSAMPLE * 2 + 2) 87 + #define RANGE_MASK (RANGE_CENTER * 2 - 1) 89 88 #define RANGE_SUBSET (RANGE_CENTER - CENTERJSAMPLE) 90 89 91 90 #define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit - RANGE_SUBSET)
+6
sdk/include/reactos/libs/libjpeg/jinclude.h
··· 2 2 * jinclude.h 3 3 * 4 4 * Copyright (C) 1991-1994, Thomas G. Lane. 5 + * Modified 2017 by Guido Vollbeding. 5 6 * This file is part of the Independent JPEG Group's software. 6 7 * For conditions of distribution and use, see the accompanying README file. 7 8 * ··· 83 84 * The modules that use fread() and fwrite() always invoke them through 84 85 * these macros. On some systems you may need to twiddle the argument casts. 85 86 * CAUTION: argument order is different from underlying functions! 87 + * 88 + * Furthermore, macros are provided for fflush() and ferror() in order 89 + * to facilitate adaption by applications using an own FILE class. 86 90 */ 87 91 88 92 #define JFREAD(file,buf,sizeofbuf) \ 89 93 ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) 90 94 #define JFWRITE(file,buf,sizeofbuf) \ 91 95 ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) 96 + #define JFFLUSH(file) fflush(file) 97 + #define JFERROR(file) ferror(file)
+14 -1
sdk/include/reactos/libs/libjpeg/jpegint.h
··· 2 2 * jpegint.h 3 3 * 4 4 * Copyright (C) 1991-1997, Thomas G. Lane. 5 - * Modified 1997-2013 by Guido Vollbeding. 5 + * Modified 1997-2017 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 * ··· 258 258 JMETHOD(void, finish_pass, (j_decompress_ptr cinfo)); 259 259 JMETHOD(void, new_color_map, (j_decompress_ptr cinfo)); 260 260 }; 261 + 262 + 263 + /* Definition of range extension bits for decompression processes. 264 + * See the comments with prepare_range_limit_table (in jdmaster.c) 265 + * for more info. 266 + * The recommended default value for normal applications is 2. 267 + * Applications with special requirements may use a different value. 268 + * For example, Ghostscript wants to use 3 for proper handling of 269 + * wacky images with oversize coefficient values. 270 + */ 271 + 272 + #define RANGE_BITS 2 273 + #define RANGE_CENTER (CENTERJSAMPLE << RANGE_BITS) 261 274 262 275 263 276 /* Miscellaneous useful macros */
+14 -14
sdk/include/reactos/libs/libjpeg/jpeglib.h
··· 2 2 * jpeglib.h 3 3 * 4 4 * Copyright (C) 1991-1998, Thomas G. Lane. 5 - * Modified 2002-2015 by Guido Vollbeding. 5 + * Modified 2002-2017 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 * ··· 39 39 40 40 #define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */ 41 41 #define JPEG_LIB_VERSION_MAJOR 9 42 - #define JPEG_LIB_VERSION_MINOR 2 42 + #define JPEG_LIB_VERSION_MINOR 3 43 43 44 44 45 45 /* Various constants determining the sizes of things. ··· 137 137 /* The decompressor output side may not use these variables. */ 138 138 int dc_tbl_no; /* DC entropy table selector (0..3) */ 139 139 int ac_tbl_no; /* AC entropy table selector (0..3) */ 140 - 140 + 141 141 /* Remaining fields should be treated as private by applications. */ 142 - 142 + 143 143 /* These values are computed during compression or decompression startup: */ 144 144 /* Component's size in DCT blocks. 145 145 * Any dummy blocks added to complete an MCU are not counted; therefore ··· 411 411 JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */ 412 412 /* The coefficient controller receives data in units of MCU rows as defined 413 413 * for fully interleaved scans (whether the JPEG file is interleaved or not). 414 - * There are v_samp_factor * DCTSIZE sample rows of each component in an 415 - * "iMCU" (interleaved MCU) row. 414 + * There are v_samp_factor * DCT_v_scaled_size sample rows of each component 415 + * in an "iMCU" (interleaved MCU) row. 416 416 */ 417 - 417 + 418 418 /* 419 419 * These fields are valid during any one scan. 420 420 * They describe the components and MCUs actually appearing in the scan. ··· 422 422 int comps_in_scan; /* # of JPEG components in this scan */ 423 423 jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; 424 424 /* *cur_comp_info[i] describes component that appears i'th in SOS */ 425 - 425 + 426 426 JDIMENSION MCUs_per_row; /* # of MCUs across the image */ 427 427 JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ 428 - 428 + 429 429 int blocks_in_MCU; /* # of DCT blocks per MCU */ 430 430 int MCU_membership[C_MAX_BLOCKS_IN_MCU]; 431 431 /* MCU_membership[i] is index in cur_comp_info of component owning */ ··· 636 636 * in fully interleaved JPEG scans, but are used whether the scan is 637 637 * interleaved or not. We define an iMCU row as v_samp_factor DCT block 638 638 * rows of each component. Therefore, the IDCT output contains 639 - * v_samp_factor*DCT_v_scaled_size sample rows of a component per iMCU row. 639 + * v_samp_factor * DCT_v_scaled_size sample rows of a component per iMCU row. 640 640 */ 641 641 642 642 JSAMPLE * sample_range_limit; /* table for fast range-limiting */ ··· 711 711 #define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */ 712 712 /* Reset error state variables at start of a new image */ 713 713 JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo)); 714 - 714 + 715 715 /* The message ID code and any parameters are saved here. 716 716 * A message can have one string parameter or up to 8 int parameters. 717 717 */ ··· 721 721 int i[8]; 722 722 char s[JMSG_STR_PARM_MAX]; 723 723 } msg_parm; 724 - 724 + 725 725 /* Standard state variables for error facility */ 726 - 726 + 727 727 int trace_level; /* max msg_level that will be displayed */ 728 - 728 + 729 729 /* For recoverable corrupt-data errors, we emit a warning message, 730 730 * but keep going unless emit_message chooses to abort. emit_message 731 731 * should count warnings in num_warnings. The surrounding application
+3 -3
sdk/include/reactos/libs/libjpeg/jversion.h
··· 1 1 /* 2 2 * jversion.h 3 3 * 4 - * Copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding. 4 + * Copyright (C) 1991-2018, Thomas G. Lane, Guido Vollbeding. 5 5 * This file is part of the Independent JPEG Group's software. 6 6 * For conditions of distribution and use, see the accompanying README file. 7 7 * ··· 9 9 */ 10 10 11 11 12 - #define JVERSION "9b 17-Jan-2016" 12 + #define JVERSION "9c 14-Jan-2018" 13 13 14 - #define JCOPYRIGHT "Copyright (C) 2016, Thomas G. Lane, Guido Vollbeding" 14 + #define JCOPYRIGHT "Copyright (C) 2018, Thomas G. Lane, Guido Vollbeding"
+3 -5
sdk/include/reactos/libs/libjpeg/rosdiff.patch
··· 1 - Index: include/reactos/libs/libjpeg/jmorecfg.h 2 - =================================================================== 3 - --- include/reactos/libs/libjpeg/jmorecfg.h (revision 66390) 4 - +++ include/reactos/libs/libjpeg/jmorecfg.h (working copy) 5 - @@ -238,14 +238,62 @@ 1 + --- a/sdk/include/reactos/libs/libjpeg/jmorecfg.h 2 + +++ b/sdk/include/reactos/libs/libjpeg/jmorecfg.h 3 + @@ -238,14 +238,62 @@ typedef unsigned int JDIMENSION; 6 4 * or code profilers that require it. 7 5 */ 8 6