[LIBJPEG] Update to version 9d. CORE-16686

This commit is contained in:
Thomas Faber 2020-02-09 21:15:50 +01:00
parent d152519a4a
commit 1d5741919d
No known key found for this signature in database
GPG key ID: 076E7C3D44720826
44 changed files with 2574 additions and 970 deletions

View file

@ -2,6 +2,7 @@
* cdjpeg.h
*
* Copyright (C) 1994-1997, Thomas G. Lane.
* Modified 2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@ -121,7 +122,8 @@ EXTERN(cjpeg_source_ptr) jinit_read_bmp JPP((j_compress_ptr cinfo));
EXTERN(djpeg_dest_ptr) jinit_write_bmp JPP((j_decompress_ptr cinfo,
boolean is_os2));
EXTERN(cjpeg_source_ptr) jinit_read_gif JPP((j_compress_ptr cinfo));
EXTERN(djpeg_dest_ptr) jinit_write_gif JPP((j_decompress_ptr cinfo));
EXTERN(djpeg_dest_ptr) jinit_write_gif JPP((j_decompress_ptr cinfo,
boolean is_lzw));
EXTERN(cjpeg_source_ptr) jinit_read_ppm JPP((j_compress_ptr cinfo));
EXTERN(djpeg_dest_ptr) jinit_write_ppm JPP((j_decompress_ptr cinfo));
EXTERN(cjpeg_source_ptr) jinit_read_rle JPP((j_compress_ptr cinfo));

View file

@ -2,7 +2,7 @@
* jdct.h
*
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2002-2017 by Guido Vollbeding.
* Modified 2002-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@ -358,13 +358,6 @@ EXTERN(void) jpeg_idct_1x2
#define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5))
/* Descale and correctly round an INT32 value that's scaled by N bits.
* We assume RIGHT_SHIFT rounds towards minus infinity, so adding
* the fudge factor is correct for either sign of X.
*/
#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
* This macro is used only when the two inputs will actually be no more than
* 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a

View file

@ -2,7 +2,7 @@
* jerror.h
*
* Copyright (C) 1994-1997, Thomas G. Lane.
* Modified 1997-2012 by Guido Vollbeding.
* Modified 1997-2018 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@ -84,7 +84,7 @@ JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan")
JMESSAGE(JERR_FILE_READ, "Input file read error")
JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow")
JMESSAGE(JERR_HUFF_CLEN_OUTOFBOUNDS, "Huffman code size table out of bounds")
JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")

View file

@ -2,7 +2,7 @@
* jpegint.h
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 1997-2017 by Guido Vollbeding.
* Modified 1997-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@ -302,6 +302,13 @@ struct jpeg_color_quantizer {
#define RIGHT_SHIFT(x,shft) ((x) >> (shft))
#endif
/* Descale and correctly round an INT32 value that's scaled by N bits.
* We assume RIGHT_SHIFT rounds towards minus infinity, so adding
* the fudge factor is correct for either sign of X.
*/
#define DESCALE(x,n) RIGHT_SHIFT((x) + ((INT32) 1 << ((n)-1)), n)
/* Short forms of external names for systems with brain-damaged linkers. */

View file

@ -2,7 +2,7 @@
* jpeglib.h
*
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2002-2017 by Guido Vollbeding.
* Modified 2002-2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@ -39,7 +39,7 @@ extern "C" {
#define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */
#define JPEG_LIB_VERSION_MAJOR 9
#define JPEG_LIB_VERSION_MINOR 3
#define JPEG_LIB_VERSION_MINOR 4
/* Various constants determining the sizes of things.
@ -909,6 +909,7 @@ typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));
#define jpeg_suppress_tables jSuppressTables
#define jpeg_alloc_quant_table jAlcQTable
#define jpeg_alloc_huff_table jAlcHTable
#define jpeg_std_huff_table jStdHTable
#define jpeg_start_compress jStrtCompress
#define jpeg_write_scanlines jWrtScanlines
#define jpeg_finish_compress jFinCompress
@ -977,10 +978,10 @@ EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile));
/* Data source and destination managers: memory buffers. */
EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,
unsigned char ** outbuffer,
unsigned long * outsize));
size_t * outsize));
EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,
const unsigned char * inbuffer,
unsigned long insize));
size_t insize));
/* Default parameter setup for compression */
EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));
@ -1005,6 +1006,8 @@ EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,
boolean suppress));
EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));
EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));
EXTERN(JHUFF_TBL *) jpeg_std_huff_table JPP((j_common_ptr cinfo,
boolean isDC, int tblno));
/* Main entry points for compression */
EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,

View file

@ -1,7 +1,7 @@
/*
* jversion.h
*
* Copyright (C) 1991-2018, Thomas G. Lane, Guido Vollbeding.
* Copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@ -9,6 +9,6 @@
*/
#define JVERSION "9c 14-Jan-2018"
#define JVERSION "9d 12-Jan-2020"
#define JCOPYRIGHT "Copyright (C) 2018, Thomas G. Lane, Guido Vollbeding"
#define JCOPYRIGHT "Copyright (C) 2020, Thomas G. Lane, Guido Vollbeding"

View file

@ -1,7 +1,7 @@
/*
* transupp.h
*
* Copyright (C) 1997-2013, Thomas G. Lane, Guido Vollbeding.
* Copyright (C) 1997-2019, Thomas G. Lane, Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@ -61,6 +61,11 @@
*
* A complementary lossless-wipe option is provided to discard (gray out) data
* inside a given image region while losslessly preserving what is outside.
* Another option is lossless-drop, which replaces data at a given image
* position by another image. Both source images must have the same
* subsampling values. It is best if they also have the same quantization,
* otherwise quantization adaption occurs. The trim option can be used with
* the drop option to requantize the drop file to the source file.
*
* We also provide a lossless-resize option, which is kind of a lossless-crop
* operation in the DCT coefficient block domain - it discards higher-order
@ -106,20 +111,22 @@ typedef enum {
JXFORM_ROT_90, /* 90-degree clockwise rotation */
JXFORM_ROT_180, /* 180-degree rotation */
JXFORM_ROT_270, /* 270-degree clockwise (or 90 ccw) */
JXFORM_WIPE /* wipe */
JXFORM_WIPE, /* wipe */
JXFORM_DROP /* drop */
} JXFORM_CODE;
/*
* Codes for crop parameters, which can individually be unspecified,
* positive or negative for xoffset or yoffset,
* positive or forced for width or height.
* positive or force or reflect for width or height.
*/
typedef enum {
JCROP_UNSET,
JCROP_POS,
JCROP_NEG,
JCROP_FORCE
JCROP_UNSET,
JCROP_POS,
JCROP_NEG,
JCROP_FORCE,
JCROP_REFLECT
} JCROP_CODE;
/*
@ -134,20 +141,24 @@ typedef struct {
boolean perfect; /* if TRUE, fail if partial MCUs are requested */
boolean trim; /* if TRUE, trim partial MCUs as needed */
boolean force_grayscale; /* if TRUE, convert color image to grayscale */
boolean crop; /* if TRUE, crop or wipe source image */
boolean crop; /* if TRUE, crop or wipe source image, or drop */
/* Crop parameters: application need not set these unless crop is TRUE.
* These can be filled in by jtransform_parse_crop_spec().
*/
JDIMENSION crop_width; /* Width of selected region */
JCROP_CODE crop_width_set; /* (forced disables adjustment) */
JCROP_CODE crop_width_set; /* (force disables adjustment) */
JDIMENSION crop_height; /* Height of selected region */
JCROP_CODE crop_height_set; /* (forced disables adjustment) */
JCROP_CODE crop_height_set; /* (force disables adjustment) */
JDIMENSION crop_xoffset; /* X offset of selected region */
JCROP_CODE crop_xoffset_set; /* (negative measures from right edge) */
JDIMENSION crop_yoffset; /* Y offset of selected region */
JCROP_CODE crop_yoffset_set; /* (negative measures from bottom edge) */
/* Drop parameters: set by caller for drop request */
j_decompress_ptr drop_ptr;
jvirt_barray_ptr * drop_coef_arrays;
/* Internal workspace: caller should not touch these */
int num_components; /* # of components in workspace */
jvirt_barray_ptr * workspace_coef_arrays; /* workspace for transformations */