The Independent JPEG Group's JPEG software
==========================================
-README for release 9a of 19-Jan-2014
+README for release 9b of 17-Jan-2016
====================================
This distribution contains the ninth public release of the Independent JPEG
This package contains C software to implement JPEG image encoding, decoding,
and transcoding. JPEG (pronounced "jay-peg") is a standardized compression
-method for full-color and gray-scale images.
+method for full-color and grayscale images.
This software implements JPEG baseline, extended-sequential, and progressive
compression processes. Provision is made for supporting all variants of these
fitness for a particular purpose. This software is provided "AS IS", and you,
its user, assume the entire risk as to its quality and accuracy.
-This software is copyright (C) 1991-2014, Thomas G. Lane, Guido Vollbeding.
+This software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding.
All Rights Reserved except as specified below.
Permission is hereby granted to use, copy, modify, and distribute this
algorithm; the resulting GIF files are larger than usual, but are readable
by all standard GIF decoders.
-We are required to state that
- "The Graphics Interchange Format(c) is the Copyright property of
- CompuServe Incorporated. GIF(sm) is a Service Mark property of
- CompuServe Incorporated."
-
REFERENCES
==========
Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
(Adjacent articles in that issue discuss MPEG motion picture compression,
applications of JPEG, and related topics.) If you don't have the CACM issue
-handy, a PostScript file containing a revised version of Wallace's article is
-available at http://www.ijg.org/files/wallace.ps.gz. The file (actually
+handy, a PDF file containing a revised version of Wallace's article is
+available at http://www.ijg.org/files/Wallace.JPEG.pdf. The file (actually
a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
omits the sample images that appeared in CACM, but it includes corrections
and some added material. Note: the Wallace article is copyright ACM and IEEE,
France.
The JPEG standard does not specify all details of an interchangeable file
-format. For the omitted details we follow the "JFIF" conventions, revision
-1.02. JFIF 1.02 has been adopted as an Ecma International Technical Report
-and thus received a formal publication status. It is available as a free
-download in PDF format from
-http://www.ecma-international.org/publications/techreports/E-TR-098.htm.
-A PostScript version of the JFIF document is available at
-http://www.ijg.org/files/jfif.ps.gz. There is also a plain text version at
-http://www.ijg.org/files/jfif.txt.gz, but it is missing the figures.
+format. For the omitted details we follow the "JFIF" conventions, version 2.
+JFIF version 1 has been adopted as Recommendation ITU-T T.871 (05/2011) :
+Information technology - Digital compression and coding of continuous-tone
+still images: JPEG File Interchange Format (JFIF). It is available as a
+free download in PDF file format from http://www.itu.int/rec/T-REC-T.871.
+A PDF file of the older JFIF document is available at
+http://www.w3.org/Graphics/JPEG/jfif3.pdf.
The TIFF 6.0 file format specification can be obtained by FTP from
ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme
The "official" archive site for this software is www.ijg.org.
The most recent released version can always be found there in
directory "files". This particular version will be archived as
-http://www.ijg.org/files/jpegsrc.v9a.tar.gz, and in Windows-compatible
-"zip" archive format as http://www.ijg.org/files/jpegsr9a.zip.
+http://www.ijg.org/files/jpegsrc.v9b.tar.gz, and in Windows-compatible
+"zip" archive format as http://www.ijg.org/files/jpegsr9b.zip.
The JPEG FAQ (Frequently Asked Questions) article is a source of some
general information about JPEG.
CHANGE LOG for Independent JPEG Group's JPEG software
+Version 9b 17-Jan-2016
+-----------------------
+
+Improvements and optimizations in DCT and color calculations.
+Normalize range limit array composition and access pattern.
+Thank to Sia Furler and Maddie Ziegler for inspiration.
+
+Use merged upsample with scaled DCT sizes larger than 8.
+Thank to Taylor Hatala for inspiration.
+
+Check for excessive comment lengths in argument parsing in wrjpgcom.c.
+Thank to Julian Cohen for hint.
+
+Add makefile.b32 for use with Borland C++ 32-bit (bcc32).
+Thank to Joe Slater for contribution.
+
+Document 'f' specifier for jpegtran -crop specification.
+Thank to Michele Martone for suggestion.
+
+Use defined value from header instead of hardwired number in rdswitch.c.
+Thank to Robert Sprowson for hint.
+
+
Version 9a 19-Jan-2014
-----------------------
* djpeg.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
- * Modified 2009-2013 by Guido Vollbeding.
+ * Modified 2009-2015 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.
*
fprintf(stderr, " -colors N Reduce image to no more than N colors\n");
fprintf(stderr, " -fast Fast, low-quality processing\n");
fprintf(stderr, " -grayscale Force grayscale output\n");
+ fprintf(stderr, " -rgb Force RGB output\n");
#ifdef IDCT_SCALING_SUPPORTED
fprintf(stderr, " -scale M/N Scale output image by fraction M/N, eg, 1/8\n");
#endif
/* Force monochrome output. */
cinfo->out_color_space = JCS_GRAYSCALE;
+ } else if (keymatch(arg, "rgb", 3)) {
+ /* Force RGB output. */
+ cinfo->out_color_space = JCS_RGB;
+
} else if (keymatch(arg, "map", 3)) {
/* Quantize to a color map taken from an input file. */
if (++argn >= argc) /* advance to next argument */
/*
* jdarith.c
*
- * Developed 1997-2013 by Guido Vollbeding.
+ * Developed 1997-2015 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.
*
* (instead of fixed) with the bit shift counter CT.
* Thus, we also need only one (variable instead of
* fixed size) shift for the LPS/MPS decision, and
- * we can get away with any renormalization update
+ * we can do away with any renormalization update
* of C (except for new data insertion, of course).
*
* I've also introduced a new scheme for accessing
* jdatasrc.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
- * Modified 2009-2011 by Guido Vollbeding.
+ * Modified 2009-2015 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.
*
GLOBAL(void)
jpeg_mem_src (j_decompress_ptr cinfo,
- unsigned char * inbuffer, unsigned long insize)
+ const unsigned char * inbuffer, unsigned long insize)
{
struct jpeg_source_mgr * src;
src->resync_to_restart = jpeg_resync_to_restart; /* use default method */
src->term_source = term_source;
src->bytes_in_buffer = (size_t) insize;
- src->next_input_byte = (JOCTET *) inbuffer;
+ src->next_input_byte = (const JOCTET *) inbuffer;
}
* jdcolor.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
- * Modified 2011-2013 by Guido Vollbeding.
+ * Modified 2011-2015 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.
*
INT32 * Cr_g_tab; /* => table for Cr to G conversion */
INT32 * Cb_g_tab; /* => table for Cb to G conversion */
- JSAMPLE * range_limit; /* pointer to normal sample range limit table, */
- /* or extended sample range limit table for BG_YCC */
-
/* Private state for RGB->Y conversion */
INT32 * rgb_y_tab; /* => table for RGB to Y conversion */
} my_color_deconverter;
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(INT32));
- cconvert->range_limit = cinfo->sample_range_limit;
-
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(INT32));
- cconvert->range_limit = (JSAMPLE *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- 5 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
-
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
/* We also add in ONE_HALF so that need not do it in inner loop */
cconvert->Cb_g_tab[i] = (- FIX(0.688272572)) * x + ONE_HALF;
}
-
- /* Cb and Cr portions can extend to double range in wide gamut case,
- * so we prepare an appropriate extended range limit table.
- */
-
- /* First segment of range limit table: limit[x] = 0 for x < 0 */
- MEMZERO(cconvert->range_limit, 2 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
- cconvert->range_limit += 2 * (MAXJSAMPLE+1);
- /* Main part of range limit table: limit[x] = x */
- for (i = 0; i <= MAXJSAMPLE; i++)
- cconvert->range_limit[i] = (JSAMPLE) i;
- /* End of range limit table: limit[x] = MAXJSAMPLE for x > MAXJSAMPLE */
- for (; i < 3 * (MAXJSAMPLE+1); i++)
- cconvert->range_limit[i] = MAXJSAMPLE;
}
register JDIMENSION col;
JDIMENSION num_cols = cinfo->output_width;
/* copy these pointers into registers if possible */
- register JSAMPLE * range_limit = cconvert->range_limit;
+ register JSAMPLE * range_limit = cinfo->sample_range_limit;
register int * Crrtab = cconvert->Cr_r_tab;
register int * Cbbtab = cconvert->Cb_b_tab;
register INT32 * Crgtab = cconvert->Cr_g_tab;
* jdmaster.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
- * Modified 2002-2013 by Guido Vollbeding.
+ * Modified 2002-2015 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.
*
use_merged_upsample (j_decompress_ptr cinfo)
{
#ifdef UPSAMPLE_MERGING_SUPPORTED
- /* Merging is the equivalent of plain box-filter upsampling */
- if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling)
+ /* Merging is the equivalent of plain box-filter upsampling. */
+ /* The following condition is only needed if fancy shall select
+ * a different upsampling method. In our current implementation
+ * fancy only affects the DCT scaling, thus we can use fancy
+ * upsampling and merged upsample simultaneously, in particular
+ * with scaled DCT sizes larger than the default DCTSIZE.
+ */
+#if 0
+ if (cinfo->do_fancy_upsampling)
+ return FALSE;
+#endif
+ if (cinfo->CCIR601_sampling)
return FALSE;
/* jdmerge.c only supports YCC=>RGB color conversion */
- if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 ||
+ if ((cinfo->jpeg_color_space != JCS_YCbCr &&
+ cinfo->jpeg_color_space != JCS_BG_YCC) ||
+ cinfo->num_components != 3 ||
cinfo->out_color_space != JCS_RGB ||
cinfo->out_color_components != RGB_PIXELSIZE ||
cinfo->color_transform)
* These processes all use a common table prepared by the routine below.
*
* For most steps we can mathematically guarantee that the initial value
- * of x is within MAXJSAMPLE+1 of the legal range, so a table running from
- * -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient. But for the initial
- * limiting step (just after the IDCT), a wildly out-of-range value is
- * possible if the input data is corrupt. To avoid any chance of indexing
+ * of x is within 2*(MAXJSAMPLE+1) of the legal range, so a table running
+ * from -2*(MAXJSAMPLE+1) to 3*MAXJSAMPLE+2 is sufficient. But for the
+ * initial limiting step (just after the IDCT), a wildly out-of-range value
+ * is possible if the input data is corrupt. To avoid any chance of indexing
* off the end of memory and getting a bad-pointer trap, we perform the
* post-IDCT limiting thus:
- * x = range_limit[x & MASK];
+ * x = (sample_range_limit - SUBSET)[(x + CENTER) & MASK];
* where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit
* samples. Under normal circumstances this is more than enough range and
* a correct output will be generated; with bogus input data the mask will
* cause wraparound, and we will safely generate a bogus-but-in-range output.
* For the post-IDCT step, we want to convert the data from signed to unsigned
* representation by adding CENTERJSAMPLE at the same time that we limit it.
- * So the post-IDCT limiting table ends up looking like this:
- * CENTERJSAMPLE,CENTERJSAMPLE+1,...,MAXJSAMPLE,
- * MAXJSAMPLE (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
- * 0 (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
- * 0,1,...,CENTERJSAMPLE-1
- * Negative inputs select values from the upper half of the table after
- * masking.
- *
- * We can save some space by overlapping the start of the post-IDCT table
- * with the simpler range limiting table. The post-IDCT table begins at
- * sample_range_limit + CENTERJSAMPLE.
+ * This is accomplished with SUBSET = CENTER - CENTERJSAMPLE.
*
* Note that the table is allocated in near data space on PCs; it's small
* enough and used often enough to justify this.
table = (JSAMPLE *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- (5 * (MAXJSAMPLE+1) + CENTERJSAMPLE) * SIZEOF(JSAMPLE));
- table += (MAXJSAMPLE+1); /* allow negative subscripts of simple table */
+ 5 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
+ /* First segment of range limit table: limit[x] = 0 for x < 0 */
+ MEMZERO(table, 2 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
+ table += 2 * (MAXJSAMPLE+1); /* allow negative subscripts of table */
cinfo->sample_range_limit = table;
- /* First segment of "simple" table: limit[x] = 0 for x < 0 */
- MEMZERO(table - (MAXJSAMPLE+1), (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
- /* Main part of "simple" table: limit[x] = x */
+ /* Main part of range limit table: limit[x] = x */
for (i = 0; i <= MAXJSAMPLE; i++)
table[i] = (JSAMPLE) i;
- table += CENTERJSAMPLE; /* Point to where post-IDCT table starts */
- /* End of simple table, rest of first half of post-IDCT table */
- for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++)
+ /* End of range limit table: limit[x] = MAXJSAMPLE for x > MAXJSAMPLE */
+ for (; i < 3 * (MAXJSAMPLE+1); i++)
table[i] = MAXJSAMPLE;
- /* Second half of post-IDCT table */
- MEMZERO(table + (2 * (MAXJSAMPLE+1)),
- (2 * (MAXJSAMPLE+1) - CENTERJSAMPLE) * SIZEOF(JSAMPLE));
- MEMCOPY(table + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE),
- cinfo->sample_range_limit, CENTERJSAMPLE * SIZEOF(JSAMPLE));
}
* jdmerge.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
- * Modified 2013 by Guido Vollbeding.
+ * Modified 2013-2015 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.
*
* multiplications needed for color conversion.
*
* This file currently provides implementations for the following cases:
- * YCbCr => RGB color conversion only.
+ * YCC => RGB color conversion only (YCbCr or BG_YCC).
* Sampling ratios of 2h1v or 2h2v.
* No scaling needed at upsample time.
* Corner-aligned (non-CCIR601) sampling alignment.
/*
- * Initialize tables for YCC->RGB colorspace conversion.
+ * Initialize tables for YCbCr->RGB and BG_YCC->RGB colorspace conversion.
* This is taken directly from jdcolor.c; see that file for more info.
*/
LOCAL(void)
build_ycc_rgb_table (j_decompress_ptr cinfo)
+/* Normal case, sYCC */
{
my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
int i;
}
+LOCAL(void)
+build_bg_ycc_rgb_table (j_decompress_ptr cinfo)
+/* Wide gamut case, bg-sYCC */
+{
+ my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
+ int i;
+ INT32 x;
+ SHIFT_TEMPS
+
+ upsample->Cr_r_tab = (int *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (MAXJSAMPLE+1) * SIZEOF(int));
+ upsample->Cb_b_tab = (int *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (MAXJSAMPLE+1) * SIZEOF(int));
+ upsample->Cr_g_tab = (INT32 *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (MAXJSAMPLE+1) * SIZEOF(INT32));
+ upsample->Cb_g_tab = (INT32 *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (MAXJSAMPLE+1) * SIZEOF(INT32));
+
+ for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
+ /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
+ /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
+ /* Cr=>R value is nearest int to 2.804 * x */
+ upsample->Cr_r_tab[i] = (int)
+ RIGHT_SHIFT(FIX(2.804) * x + ONE_HALF, SCALEBITS);
+ /* Cb=>B value is nearest int to 3.544 * x */
+ upsample->Cb_b_tab[i] = (int)
+ RIGHT_SHIFT(FIX(3.544) * x + ONE_HALF, SCALEBITS);
+ /* Cr=>G value is scaled-up -1.428272572 * x */
+ upsample->Cr_g_tab[i] = (- FIX(1.428272572)) * x;
+ /* Cb=>G value is scaled-up -0.688272572 * x */
+ /* We also add in ONE_HALF so that need not do it in inner loop */
+ upsample->Cb_g_tab[i] = (- FIX(0.688272572)) * x + ONE_HALF;
+ }
+}
+
+
/*
* Initialize for an upsampling pass.
*/
/* Do the chroma part of the calculation */
cb = GETJSAMPLE(*inptr1++);
cr = GETJSAMPLE(*inptr2++);
- cred = Crrtab[cr];
+ cred = Crrtab[cr];
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
- cblue = Cbbtab[cb];
+ cblue = Cbbtab[cb];
/* Fetch 2 Y values and emit 2 pixels */
y = GETJSAMPLE(*inptr0++);
- outptr[RGB_RED] = range_limit[y + cred];
+ outptr[RGB_RED] = range_limit[y + cred];
outptr[RGB_GREEN] = range_limit[y + cgreen];
- outptr[RGB_BLUE] = range_limit[y + cblue];
+ outptr[RGB_BLUE] = range_limit[y + cblue];
outptr += RGB_PIXELSIZE;
y = GETJSAMPLE(*inptr0++);
- outptr[RGB_RED] = range_limit[y + cred];
+ outptr[RGB_RED] = range_limit[y + cred];
outptr[RGB_GREEN] = range_limit[y + cgreen];
- outptr[RGB_BLUE] = range_limit[y + cblue];
+ outptr[RGB_BLUE] = range_limit[y + cblue];
outptr += RGB_PIXELSIZE;
}
/* If image width is odd, do the last output column separately */
if (cinfo->output_width & 1) {
cb = GETJSAMPLE(*inptr1);
cr = GETJSAMPLE(*inptr2);
- cred = Crrtab[cr];
+ cred = Crrtab[cr];
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
- cblue = Cbbtab[cb];
+ cblue = Cbbtab[cb];
y = GETJSAMPLE(*inptr0);
- outptr[RGB_RED] = range_limit[y + cred];
+ outptr[RGB_RED] = range_limit[y + cred];
outptr[RGB_GREEN] = range_limit[y + cgreen];
- outptr[RGB_BLUE] = range_limit[y + cblue];
+ outptr[RGB_BLUE] = range_limit[y + cblue];
}
}
/* Do the chroma part of the calculation */
cb = GETJSAMPLE(*inptr1++);
cr = GETJSAMPLE(*inptr2++);
- cred = Crrtab[cr];
+ cred = Crrtab[cr];
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
- cblue = Cbbtab[cb];
+ cblue = Cbbtab[cb];
/* Fetch 4 Y values and emit 4 pixels */
y = GETJSAMPLE(*inptr00++);
- outptr0[RGB_RED] = range_limit[y + cred];
+ outptr0[RGB_RED] = range_limit[y + cred];
outptr0[RGB_GREEN] = range_limit[y + cgreen];
- outptr0[RGB_BLUE] = range_limit[y + cblue];
+ outptr0[RGB_BLUE] = range_limit[y + cblue];
outptr0 += RGB_PIXELSIZE;
y = GETJSAMPLE(*inptr00++);
- outptr0[RGB_RED] = range_limit[y + cred];
+ outptr0[RGB_RED] = range_limit[y + cred];
outptr0[RGB_GREEN] = range_limit[y + cgreen];
- outptr0[RGB_BLUE] = range_limit[y + cblue];
+ outptr0[RGB_BLUE] = range_limit[y + cblue];
outptr0 += RGB_PIXELSIZE;
y = GETJSAMPLE(*inptr01++);
- outptr1[RGB_RED] = range_limit[y + cred];
+ outptr1[RGB_RED] = range_limit[y + cred];
outptr1[RGB_GREEN] = range_limit[y + cgreen];
- outptr1[RGB_BLUE] = range_limit[y + cblue];
+ outptr1[RGB_BLUE] = range_limit[y + cblue];
outptr1 += RGB_PIXELSIZE;
y = GETJSAMPLE(*inptr01++);
- outptr1[RGB_RED] = range_limit[y + cred];
+ outptr1[RGB_RED] = range_limit[y + cred];
outptr1[RGB_GREEN] = range_limit[y + cgreen];
- outptr1[RGB_BLUE] = range_limit[y + cblue];
+ outptr1[RGB_BLUE] = range_limit[y + cblue];
outptr1 += RGB_PIXELSIZE;
}
/* If image width is odd, do the last output column separately */
if (cinfo->output_width & 1) {
cb = GETJSAMPLE(*inptr1);
cr = GETJSAMPLE(*inptr2);
- cred = Crrtab[cr];
+ cred = Crrtab[cr];
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
- cblue = Cbbtab[cb];
+ cblue = Cbbtab[cb];
y = GETJSAMPLE(*inptr00);
- outptr0[RGB_RED] = range_limit[y + cred];
+ outptr0[RGB_RED] = range_limit[y + cred];
outptr0[RGB_GREEN] = range_limit[y + cgreen];
- outptr0[RGB_BLUE] = range_limit[y + cblue];
+ outptr0[RGB_BLUE] = range_limit[y + cblue];
y = GETJSAMPLE(*inptr01);
- outptr1[RGB_RED] = range_limit[y + cred];
+ outptr1[RGB_RED] = range_limit[y + cred];
outptr1[RGB_GREEN] = range_limit[y + cgreen];
- outptr1[RGB_BLUE] = range_limit[y + cblue];
+ outptr1[RGB_BLUE] = range_limit[y + cblue];
}
}
upsample = (my_upsample_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_upsampler));
- cinfo->upsample = (struct jpeg_upsampler *) upsample;
+ cinfo->upsample = &upsample->pub;
upsample->pub.start_pass = start_pass_merged_upsample;
upsample->pub.need_context_rows = FALSE;
upsample->spare_row = NULL;
}
- build_ycc_rgb_table(cinfo);
+ if (cinfo->jpeg_color_space == JCS_BG_YCC)
+ build_bg_ycc_rgb_table(cinfo);
+ else
+ build_ycc_rgb_table(cinfo);
}
#endif /* UPSAMPLE_MERGING_SUPPORTED */
* jdsample.c
*
* Copyright (C) 1991-1996, Thomas G. Lane.
- * Modified 2002-2008 by Guido Vollbeding.
+ * Modified 2002-2015 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.
*
my_upsample_ptr upsample;
int ci;
jpeg_component_info * compptr;
- boolean need_buffer;
int h_in_group, v_in_group, h_out_group, v_out_group;
upsample = (my_upsample_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_upsampler));
- cinfo->upsample = (struct jpeg_upsampler *) upsample;
+ cinfo->upsample = &upsample->pub;
upsample->pub.start_pass = start_pass_upsample;
upsample->pub.upsample = sep_upsample;
upsample->pub.need_context_rows = FALSE; /* until we find out differently */
h_out_group = cinfo->max_h_samp_factor;
v_out_group = cinfo->max_v_samp_factor;
upsample->rowgroup_height[ci] = v_in_group; /* save for use later */
- need_buffer = TRUE;
if (! compptr->component_needed) {
/* Don't bother to upsample an uninteresting component. */
upsample->methods[ci] = noop_upsample;
- need_buffer = FALSE;
- } else if (h_in_group == h_out_group && v_in_group == v_out_group) {
+ continue; /* don't need to allocate buffer */
+ }
+ if (h_in_group == h_out_group && v_in_group == v_out_group) {
/* Fullsize components can be processed without any work. */
upsample->methods[ci] = fullsize_upsample;
- need_buffer = FALSE;
- } else if (h_in_group * 2 == h_out_group &&
- v_in_group == v_out_group) {
+ continue; /* don't need to allocate buffer */
+ }
+ if (h_in_group * 2 == h_out_group && v_in_group == v_out_group) {
/* Special case for 2h1v upsampling */
upsample->methods[ci] = h2v1_upsample;
} else if (h_in_group * 2 == h_out_group &&
upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group);
} else
ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
- if (need_buffer) {
- upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray)
- ((j_common_ptr) cinfo, JPOOL_IMAGE,
- (JDIMENSION) jround_up((long) cinfo->output_width,
- (long) cinfo->max_h_samp_factor),
- (JDIMENSION) cinfo->max_v_samp_factor);
- }
+ upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (JDIMENSION) jround_up((long) cinfo->output_width,
+ (long) cinfo->max_h_samp_factor),
+ (JDIMENSION) cinfo->max_v_samp_factor);
}
}
* jerror.c
*
* Copyright (C) 1991-1998, Thomas G. Lane.
- * Modified 2012 by Guido Vollbeding.
+ * Modified 2012-2015 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.
*
* These routines are used by both the compression and decompression code.
*/
+#ifdef USE_WINDOWS_MESSAGEBOX
+#include <windows.h>
+#endif
+
/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
#include "jinclude.h"
#include "jpeglib.h"
#include "jversion.h"
#include "jerror.h"
-#ifdef USE_WINDOWS_MESSAGEBOX
-#include <windows.h>
-#endif
-
#ifndef EXIT_FAILURE /* define exit() codes if not provided */
#define EXIT_FAILURE 1
#endif
* jfdctflt.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
- * Modified 2003-2009 by Guido Vollbeding.
+ * Modified 2003-2015 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.
*
/*
* Perform the forward DCT on one block of samples.
+ *
+ * cK represents cos(K*pi/16).
*/
GLOBAL(void)
tmp11 = tmp1 + tmp2;
tmp12 = tmp1 - tmp2;
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = tmp10 + tmp11 - 8 * CENTERJSAMPLE; /* phase 3 */
dataptr[4] = tmp10 - tmp11;
* jfdctfst.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
- * Modified 2003-2009 by Guido Vollbeding.
+ * Modified 2003-2015 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.
*
/*
* Perform the forward DCT on one block of samples.
+ *
+ * cK represents cos(K*pi/16).
*/
GLOBAL(void)
tmp11 = tmp1 + tmp2;
tmp12 = tmp1 - tmp2;
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = tmp10 + tmp11 - 8 * CENTERJSAMPLE; /* phase 3 */
dataptr[4] = tmp10 - tmp11;
* jfdctint.c
*
* Copyright (C) 1991-1996, Thomas G. Lane.
- * Modification developed 2003-2013 by Guido Vollbeding.
+ * Modification developed 2003-2015 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.
*
tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]);
tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << PASS1_BITS);
dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS);
tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[4]);
z1 = tmp0 + tmp2;
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
((z1 + tmp1 + tmp3 - 7 * CENTERJSAMPLE) << PASS1_BITS);
tmp3 += tmp3;
tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[4]);
tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[3]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
((tmp10 + tmp11 - 6 * CENTERJSAMPLE) << PASS1_BITS);
dataptr[2] = (DCTELEM)
tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[4]);
tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[3]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
((tmp10 + tmp2 - 5 * CENTERJSAMPLE) << (PASS1_BITS+1));
tmp11 = MULTIPLY(tmp11, FIX(0.790569415)); /* (c2+c4)/2 */
tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]);
tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+2));
dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+2));
tmp2 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[2]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
((tmp0 + tmp1 - 3 * CENTERJSAMPLE) << (PASS1_BITS+2));
dataptr[2] = (DCTELEM)
GLOBAL(void)
jpeg_fdct_2x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
{
- INT32 tmp0, tmp1, tmp2, tmp3;
+ DCTELEM tmp0, tmp1, tmp2, tmp3;
JSAMPROW elemptr;
/* Pre-zero output coefficient block. */
*/
/* Column 0 */
- /* Apply unsigned->signed conversion */
- data[DCTSIZE*0] = (DCTELEM) ((tmp0 + tmp2 - 4 * CENTERJSAMPLE) << 4);
- data[DCTSIZE*1] = (DCTELEM) ((tmp0 - tmp2) << 4);
+ /* Apply unsigned->signed conversion. */
+ data[DCTSIZE*0] = (tmp0 + tmp2 - 4 * CENTERJSAMPLE) << 4;
+ data[DCTSIZE*1] = (tmp0 - tmp2) << 4;
/* Column 1 */
- data[DCTSIZE*0+1] = (DCTELEM) ((tmp1 + tmp3) << 4);
- data[DCTSIZE*1+1] = (DCTELEM) ((tmp1 - tmp3) << 4);
+ data[DCTSIZE*0+1] = (tmp1 + tmp3) << 4;
+ data[DCTSIZE*1+1] = (tmp1 - tmp3) << 4;
}
GLOBAL(void)
jpeg_fdct_1x1 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
{
+ DCTELEM dcval;
+
/* Pre-zero output coefficient block. */
MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
+ dcval = GETJSAMPLE(sample_data[0][start_col]);
+
/* We leave the result scaled up by an overall factor of 8. */
/* We must also scale the output by (8/1)**2 = 2**6. */
- /* Apply unsigned->signed conversion */
- data[0] = (DCTELEM)
- ((GETJSAMPLE(sample_data[0][start_col]) - CENTERJSAMPLE) << 6);
+ /* Apply unsigned->signed conversion. */
+ data[0] = (dcval - CENTERJSAMPLE) << 6;
}
z1 = tmp0 + tmp2 + tmp3;
z2 = tmp1 + tmp4;
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) ((z1 + z2 - 9 * CENTERJSAMPLE) << 1);
dataptr[6] = (DCTELEM)
DESCALE(MULTIPLY(z1 - z2 - z2, FIX(0.707106781)), /* c6 */
tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[6]);
tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[5]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
((tmp10 + tmp11 + tmp12 - 10 * CENTERJSAMPLE) << 1);
tmp12 += tmp12;
tmp13 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[7]);
tmp14 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[6]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
((tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 - 11 * CENTERJSAMPLE) << 1);
tmp5 += tmp5;
tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[7]);
tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[6]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) (tmp10 + tmp11 + tmp12 - 12 * CENTERJSAMPLE);
dataptr[6] = (DCTELEM) (tmp13 - tmp14 - tmp15);
dataptr[4] = (DCTELEM)
tmp14 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[8]);
tmp15 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[7]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
(tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 + tmp6 - 13 * CENTERJSAMPLE);
tmp6 += tmp6;
tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[8]);
tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[7]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
(tmp10 + tmp11 + tmp12 + tmp13 - 14 * CENTERJSAMPLE);
tmp13 += tmp13;
z1 = tmp0 + tmp4 + tmp5;
z2 = tmp1 + tmp3 + tmp6;
z3 = tmp2 + tmp7;
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) (z1 + z2 + z3 - 15 * CENTERJSAMPLE);
z3 += z3;
dataptr[6] = (DCTELEM)
tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[9]);
tmp7 = GETJSAMPLE(elemptr[7]) - GETJSAMPLE(elemptr[8]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
((tmp10 + tmp11 + tmp12 + tmp13 - 16 * CENTERJSAMPLE) << PASS1_BITS);
dataptr[4] = (DCTELEM)
tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[9]);
tmp7 = GETJSAMPLE(elemptr[7]) - GETJSAMPLE(elemptr[8]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
((tmp10 + tmp11 + tmp12 + tmp13 - 16 * CENTERJSAMPLE) << PASS1_BITS);
dataptr[4] = (DCTELEM)
tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[8]);
tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[7]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
((tmp10 + tmp11 + tmp12 + tmp13 - 14 * CENTERJSAMPLE) << PASS1_BITS);
tmp13 += tmp13;
tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[7]);
tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[6]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
((tmp10 + tmp11 + tmp12 - 12 * CENTERJSAMPLE) << PASS1_BITS);
dataptr[6] = (DCTELEM) ((tmp13 - tmp14 - tmp15) << PASS1_BITS);
tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[6]);
tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[5]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
((tmp10 + tmp11 + tmp12 - 10 * CENTERJSAMPLE) << PASS1_BITS);
tmp12 += tmp12;
tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]);
tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << (PASS1_BITS+1));
dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << (PASS1_BITS+1));
tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[4]);
tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[3]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
((tmp10 + tmp11 - 6 * CENTERJSAMPLE) << (PASS1_BITS+1));
dataptr[2] = (DCTELEM)
tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]);
tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+3));
dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+3));
GLOBAL(void)
jpeg_fdct_2x1 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
{
- INT32 tmp0, tmp1;
+ DCTELEM tmp0, tmp1;
JSAMPROW elemptr;
/* Pre-zero output coefficient block. */
/* Even part */
- /* Apply unsigned->signed conversion */
- data[0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 5);
+ /* Apply unsigned->signed conversion. */
+ data[0] = (tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 5;
/* Odd part */
- data[1] = (DCTELEM) ((tmp0 - tmp1) << 5);
+ data[1] = (tmp0 - tmp1) << 5;
}
tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]);
tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << PASS1_BITS);
dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS);
tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[4]);
z1 = tmp0 + tmp2;
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
((z1 + tmp1 + tmp3 - 7 * CENTERJSAMPLE) << PASS1_BITS);
tmp3 += tmp3;
tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[4]);
tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[3]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
((tmp10 + tmp11 - 6 * CENTERJSAMPLE) << PASS1_BITS);
dataptr[2] = (DCTELEM)
tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[4]);
tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[3]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
((tmp10 + tmp2 - 5 * CENTERJSAMPLE) << PASS1_BITS);
tmp11 = MULTIPLY(tmp11, FIX(0.790569415)); /* (c2+c4)/2 */
tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]);
tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+1));
dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+1));
tmp2 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[2]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM)
((tmp0 + tmp1 - 3 * CENTERJSAMPLE) << (PASS1_BITS+1));
dataptr[2] = (DCTELEM)
tmp0 = GETJSAMPLE(elemptr[0]);
tmp1 = GETJSAMPLE(elemptr[1]);
- /* Apply unsigned->signed conversion */
+ /* Apply unsigned->signed conversion. */
dataptr[0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 3);
/* Odd part */
GLOBAL(void)
jpeg_fdct_1x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
{
- INT32 tmp0, tmp1;
+ DCTELEM tmp0, tmp1;
/* Pre-zero output coefficient block. */
MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
tmp0 = GETJSAMPLE(sample_data[0][start_col]);
tmp1 = GETJSAMPLE(sample_data[1][start_col]);
- /* Apply unsigned->signed conversion */
- data[DCTSIZE*0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 5);
+ /* Apply unsigned->signed conversion. */
+ data[DCTSIZE*0] = (tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 5;
/* Odd part */
- data[DCTSIZE*1] = (DCTELEM) ((tmp0 - tmp1) << 5);
+ data[DCTSIZE*1] = (tmp0 - tmp1) << 5;
}
#endif /* DCT_SCALING_SUPPORTED */
* jidctflt.c
*
* Copyright (C) 1994-1998, Thomas G. Lane.
- * Modified 2010 by Guido Vollbeding.
+ * Modified 2010-2015 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.
*
/*
* Perform dequantization and inverse DCT on one block of coefficients.
+ *
+ * cK represents cos(K*pi/16).
*/
GLOBAL(void)
FLOAT_MULT_TYPE * quantptr;
FAST_FLOAT * wsptr;
JSAMPROW outptr;
- JSAMPLE *range_limit = cinfo->sample_range_limit;
+ JSAMPLE *range_limit = IDCT_range_limit(cinfo);
int ctr;
FAST_FLOAT workspace[DCTSIZE2]; /* buffers data between passes */
* With typical images and quantization tables, half or more of the
* column DCT calculations can be simplified this way.
*/
-
+
if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&
inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&
inptr[DCTSIZE*7] == 0) {
/* AC terms all zero */
FAST_FLOAT dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
-
+
wsptr[DCTSIZE*0] = dcval;
wsptr[DCTSIZE*1] = dcval;
wsptr[DCTSIZE*2] = dcval;
wsptr[DCTSIZE*5] = dcval;
wsptr[DCTSIZE*6] = dcval;
wsptr[DCTSIZE*7] = dcval;
-
+
inptr++; /* advance pointers to next column */
quantptr++;
wsptr++;
continue;
}
-
+
/* Even part */
tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
tmp3 = tmp10 - tmp13;
tmp1 = tmp11 + tmp12;
tmp2 = tmp11 - tmp12;
-
+
/* Odd part */
tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
quantptr++;
wsptr++;
}
-
+
/* Pass 2: process rows from work array, store into output array. */
wsptr = workspace;
* the simplification applies less often (typically 5% to 10% of the time).
* And testing floats for zero is relatively expensive, so we don't bother.
*/
-
+
/* Even part */
- /* Apply signed->unsigned and prepare float->int conversion */
- z5 = wsptr[0] + ((FAST_FLOAT) CENTERJSAMPLE + (FAST_FLOAT) 0.5);
+ /* Prepare range-limit and float->int conversion */
+ z5 = wsptr[0] + (((FAST_FLOAT) RANGE_CENTER) + ((FAST_FLOAT) 0.5));
tmp10 = z5 + wsptr[4];
tmp11 = z5 - wsptr[4];
tmp13 = wsptr[2] + wsptr[6];
- tmp12 = (wsptr[2] - wsptr[6]) * ((FAST_FLOAT) 1.414213562) - tmp13;
+ tmp12 = (wsptr[2] - wsptr[6]) *
+ ((FAST_FLOAT) 1.414213562) - tmp13; /* 2*c4 */
tmp0 = tmp10 + tmp13;
tmp3 = tmp10 - tmp13;
z11 = wsptr[1] + wsptr[7];
z12 = wsptr[1] - wsptr[7];
- tmp7 = z11 + z13;
- tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562);
+ tmp7 = z11 + z13; /* phase 5 */
+ tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); /* 2*c4 */
z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */
tmp10 = z5 - z12 * ((FAST_FLOAT) 1.082392200); /* 2*(c2-c6) */
tmp12 = z5 - z10 * ((FAST_FLOAT) 2.613125930); /* 2*(c2+c6) */
- tmp6 = tmp12 - tmp7;
+ tmp6 = tmp12 - tmp7; /* phase 2 */
tmp5 = tmp11 - tmp6;
tmp4 = tmp10 - tmp5;
/* Final output stage: float->int conversion and range-limit */
- outptr[0] = range_limit[((int) (tmp0 + tmp7)) & RANGE_MASK];
- outptr[7] = range_limit[((int) (tmp0 - tmp7)) & RANGE_MASK];
- outptr[1] = range_limit[((int) (tmp1 + tmp6)) & RANGE_MASK];
- outptr[6] = range_limit[((int) (tmp1 - tmp6)) & RANGE_MASK];
- outptr[2] = range_limit[((int) (tmp2 + tmp5)) & RANGE_MASK];
- outptr[5] = range_limit[((int) (tmp2 - tmp5)) & RANGE_MASK];
- outptr[3] = range_limit[((int) (tmp3 + tmp4)) & RANGE_MASK];
- outptr[4] = range_limit[((int) (tmp3 - tmp4)) & RANGE_MASK];
-
+ outptr[0] = range_limit[(int) (tmp0 + tmp7) & RANGE_MASK];
+ outptr[7] = range_limit[(int) (tmp0 - tmp7) & RANGE_MASK];
+ outptr[1] = range_limit[(int) (tmp1 + tmp6) & RANGE_MASK];
+ outptr[6] = range_limit[(int) (tmp1 - tmp6) & RANGE_MASK];
+ outptr[2] = range_limit[(int) (tmp2 + tmp5) & RANGE_MASK];
+ outptr[5] = range_limit[(int) (tmp2 - tmp5) & RANGE_MASK];
+ outptr[3] = range_limit[(int) (tmp3 + tmp4) & RANGE_MASK];
+ outptr[4] = range_limit[(int) (tmp3 - tmp4) & RANGE_MASK];
+
wsptr += DCTSIZE; /* advance pointer to next row */
}
}
* jidctfst.c
*
* Copyright (C) 1994-1998, Thomas G. Lane.
+ * Modified 2015 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.
*
#endif
-/* Like DESCALE, but applies to a DCTELEM and produces an int.
- * We assume that int right shift is unsigned if INT32 right shift is.
- */
-
-#ifdef RIGHT_SHIFT_IS_UNSIGNED
-#define ISHIFT_TEMPS DCTELEM ishift_temp;
-#if BITS_IN_JSAMPLE == 8
-#define DCTELEMBITS 16 /* DCTELEM may be 16 or 32 bits */
-#else
-#define DCTELEMBITS 32 /* DCTELEM must be 32 bits */
-#endif
-#define IRIGHT_SHIFT(x,shft) \
- ((ishift_temp = (x)) < 0 ? \
- (ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \
- (ishift_temp >> (shft)))
-#else
-#define ISHIFT_TEMPS
-#define IRIGHT_SHIFT(x,shft) ((x) >> (shft))
-#endif
-
-#ifdef USE_ACCURATE_ROUNDING
-#define IDESCALE(x,n) ((int) IRIGHT_SHIFT((x) + (1 << ((n)-1)), n))
-#else
-#define IDESCALE(x,n) ((int) IRIGHT_SHIFT(x, n))
-#endif
-
-
/*
* Perform dequantization and inverse DCT on one block of coefficients.
+ *
+ * cK represents cos(K*pi/16).
*/
GLOBAL(void)
int ctr;
int workspace[DCTSIZE2]; /* buffers data between passes */
SHIFT_TEMPS /* for DESCALE */
- ISHIFT_TEMPS /* for IDESCALE */
+ ISHIFT_TEMPS /* for IRIGHT_SHIFT */
/* Pass 1: process columns from input, store into work array. */
tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */
z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */
- tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */
- tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */
+ tmp10 = z5 - MULTIPLY(z12, FIX_1_082392200); /* 2*(c2-c6) */
+ tmp12 = z5 - MULTIPLY(z10, FIX_2_613125930); /* 2*(c2+c6) */
tmp6 = tmp12 - tmp7; /* phase 2 */
tmp5 = tmp11 - tmp6;
- tmp4 = tmp10 + tmp5;
+ tmp4 = tmp10 - tmp5;
wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7);
wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7);
wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6);
wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5);
wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5);
- wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4);
- wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4);
+ wsptr[DCTSIZE*3] = (int) (tmp3 + tmp4);
+ wsptr[DCTSIZE*4] = (int) (tmp3 - tmp4);
inptr++; /* advance pointers to next column */
quantptr++;
wsptr++;
}
- /* Pass 2: process rows from work array, store into output array. */
- /* Note that we must descale the results by a factor of 8 == 2**3, */
- /* and also undo the PASS1_BITS scaling. */
+ /* Pass 2: process rows from work array, store into output array.
+ * Note that we must descale the results by a factor of 8 == 2**3,
+ * and also undo the PASS1_BITS scaling.
+ */
wsptr = workspace;
for (ctr = 0; ctr < DCTSIZE; ctr++) {
outptr = output_buf[ctr] + output_col;
+
+ /* Add range center and fudge factor for final descale and range-limit. */
+ z5 = (DCTELEM) wsptr[0] +
+ ((((DCTELEM) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (1 << (PASS1_BITS+2)));
+
/* Rows of zeroes can be exploited in the same way as we did with columns.
* However, the column calculation has created many nonzero AC terms, so
* the simplification applies less often (typically 5% to 10% of the time).
if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
/* AC terms all zero */
- JSAMPLE dcval = range_limit[IDESCALE(wsptr[0], PASS1_BITS+3)
+ JSAMPLE dcval = range_limit[(int) IRIGHT_SHIFT(z5, PASS1_BITS+3)
& RANGE_MASK];
outptr[0] = dcval;
/* Even part */
- tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]);
- tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]);
+ tmp10 = z5 + (DCTELEM) wsptr[4];
+ tmp11 = z5 - (DCTELEM) wsptr[4];
- tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]);
- tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6], FIX_1_414213562)
- - tmp13;
+ tmp13 = (DCTELEM) wsptr[2] + (DCTELEM) wsptr[6];
+ tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6],
+ FIX_1_414213562) - tmp13; /* 2*c4 */
tmp0 = tmp10 + tmp13;
tmp3 = tmp10 - tmp13;
tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */
z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */
- tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */
- tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */
+ tmp10 = z5 - MULTIPLY(z12, FIX_1_082392200); /* 2*(c2-c6) */
+ tmp12 = z5 - MULTIPLY(z10, FIX_2_613125930); /* 2*(c2+c6) */
tmp6 = tmp12 - tmp7; /* phase 2 */
tmp5 = tmp11 - tmp6;
- tmp4 = tmp10 + tmp5;
+ tmp4 = tmp10 - tmp5;
/* Final output stage: scale down by a factor of 8 and range-limit */
- outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3)
+ outptr[0] = range_limit[(int) IRIGHT_SHIFT(tmp0 + tmp7, PASS1_BITS+3)
& RANGE_MASK];
- outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3)
+ outptr[7] = range_limit[(int) IRIGHT_SHIFT(tmp0 - tmp7, PASS1_BITS+3)
& RANGE_MASK];
- outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3)
+ outptr[1] = range_limit[(int) IRIGHT_SHIFT(tmp1 + tmp6, PASS1_BITS+3)
& RANGE_MASK];
- outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3)
+ outptr[6] = range_limit[(int) IRIGHT_SHIFT(tmp1 - tmp6, PASS1_BITS+3)
& RANGE_MASK];
- outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3)
+ outptr[2] = range_limit[(int) IRIGHT_SHIFT(tmp2 + tmp5, PASS1_BITS+3)
& RANGE_MASK];
- outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3)
+ outptr[5] = range_limit[(int) IRIGHT_SHIFT(tmp2 - tmp5, PASS1_BITS+3)
& RANGE_MASK];
- outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3)
+ outptr[3] = range_limit[(int) IRIGHT_SHIFT(tmp3 + tmp4, PASS1_BITS+3)
& RANGE_MASK];
- outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3)
+ outptr[4] = range_limit[(int) IRIGHT_SHIFT(tmp3 - tmp4, PASS1_BITS+3)
& RANGE_MASK];
wsptr += DCTSIZE; /* advance pointer to next row */
* jidctint.c
*
* Copyright (C) 1991-1998, Thomas G. Lane.
- * Modification developed 2002-2013 by Guido Vollbeding.
+ * Modification developed 2002-2015 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.
*
* The rotator is c(-6).
*/
- z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
- z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
-
- z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
- tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
- tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
-
z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
z2 <<= CONST_BITS;
tmp0 = z2 + z3;
tmp1 = z2 - z3;
+ z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
+ z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
+
+ z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
+ tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
+ tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
+
tmp10 = tmp0 + tmp2;
tmp13 = tmp0 - tmp2;
tmp11 = tmp1 + tmp3;
wsptr = workspace;
for (ctr = 0; ctr < DCTSIZE; ctr++) {
outptr = output_buf[ctr] + output_col;
+
+ /* Add range center and fudge factor for final descale and range-limit. */
+ z2 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
+
/* Rows of zeroes can be exploited in the same way as we did with columns.
* However, the column calculation has created many nonzero AC terms, so
* the simplification applies less often (typically 5% to 10% of the time).
if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
/* AC terms all zero */
- JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3)
+ JSAMPLE dcval = range_limit[(int) RIGHT_SHIFT(z2, PASS1_BITS+3)
& RANGE_MASK];
outptr[0] = dcval;
* The rotator is c(-6).
*/
+ z3 = (INT32) wsptr[4];
+
+ tmp0 = (z2 + z3) << CONST_BITS;
+ tmp1 = (z2 - z3) << CONST_BITS;
+
z2 = (INT32) wsptr[2];
z3 = (INT32) wsptr[6];
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
- /* Add fudge factor here for final descale. */
- z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
- z3 = (INT32) wsptr[4];
-
- tmp0 = (z2 + z3) << CONST_BITS;
- tmp1 = (z2 - z3) << CONST_BITS;
-
tmp10 = tmp0 + tmp2;
tmp13 = tmp0 - tmp2;
tmp11 = tmp1 + tmp3;
/* Even part */
- /* Add fudge factor here for final descale. */
- tmp13 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ tmp13 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
tmp13 <<= CONST_BITS;
z1 = (INT32) wsptr[2];
/* Even part */
- /* Add fudge factor here for final descale. */
- tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ tmp0 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
tmp0 <<= CONST_BITS;
tmp2 = (INT32) wsptr[4];
tmp10 = MULTIPLY(tmp2, FIX(0.707106781)); /* c4 */
/* Even part */
- /* Add fudge factor here for final descale. */
- tmp12 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ tmp12 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
tmp12 <<= CONST_BITS;
tmp0 = (INT32) wsptr[2];
tmp1 = (INT32) wsptr[4];
/* Even part */
- /* Add fudge factor here for final descale. */
- tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ tmp0 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
tmp2 = (INT32) wsptr[2];
tmp10 = (tmp0 + tmp2) << CONST_BITS;
/* Even part */
- /* Add fudge factor here for final descale. */
- tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ tmp0 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
tmp0 <<= CONST_BITS;
tmp2 = (INT32) wsptr[2];
tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */
JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col)
{
- INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5;
+ DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5;
ISLOW_MULT_TYPE * quantptr;
JSAMPROW outptr;
JSAMPLE *range_limit = IDCT_range_limit(cinfo);
- SHIFT_TEMPS
+ ISHIFT_TEMPS
/* Pass 1: process columns from input. */
/* Column 0 */
tmp4 = DEQUANTIZE(coef_block[DCTSIZE*0], quantptr[DCTSIZE*0]);
tmp5 = DEQUANTIZE(coef_block[DCTSIZE*1], quantptr[DCTSIZE*1]);
- /* Add fudge factor here for final descale. */
- tmp4 += ONE << 2;
+ /* Add range center and fudge factor for final descale and range-limit. */
+ tmp4 += (((DCTELEM) RANGE_CENTER) << 3) + (1 << 2);
tmp0 = tmp4 + tmp5;
tmp2 = tmp4 - tmp5;
/* Row 0 */
outptr = output_buf[0] + output_col;
- outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK];
- outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK];
+ outptr[0] = range_limit[(int) IRIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK];
+ outptr[1] = range_limit[(int) IRIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK];
/* Row 1 */
outptr = output_buf[1] + output_col;
- outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp2 + tmp3, 3) & RANGE_MASK];
- outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp2 - tmp3, 3) & RANGE_MASK];
+ outptr[0] = range_limit[(int) IRIGHT_SHIFT(tmp2 + tmp3, 3) & RANGE_MASK];
+ outptr[1] = range_limit[(int) IRIGHT_SHIFT(tmp2 - tmp3, 3) & RANGE_MASK];
}
JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col)
{
- int dcval;
+ DCTELEM dcval;
ISLOW_MULT_TYPE * quantptr;
JSAMPLE *range_limit = IDCT_range_limit(cinfo);
- SHIFT_TEMPS
+ ISHIFT_TEMPS
/* 1x1 is trivial: just take the DC coefficient divided by 8. */
+
quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
+
dcval = DEQUANTIZE(coef_block[0], quantptr[0]);
- dcval = (int) DESCALE((INT32) dcval, 3);
+ /* Add range center and fudge factor for descale and range-limit. */
+ dcval += (((DCTELEM) RANGE_CENTER) << 3) + (1 << 2);
- output_buf[0][output_col] = range_limit[dcval & RANGE_MASK];
+ output_buf[0][output_col] =
+ range_limit[(int) IRIGHT_SHIFT(dcval, 3) & RANGE_MASK];
}
/* Even part */
- /* Add fudge factor here for final descale. */
- tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ tmp0 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
tmp0 <<= CONST_BITS;
z1 = (INT32) wsptr[2];
/* Even part */
- /* Add fudge factor here for final descale. */
- z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ z3 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
z3 <<= CONST_BITS;
z4 = (INT32) wsptr[4];
z1 = MULTIPLY(z4, FIX(1.144122806)); /* c4 */
/* Even part */
- /* Add fudge factor here for final descale. */
- tmp10 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ tmp10 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
tmp10 <<= CONST_BITS;
z1 = (INT32) wsptr[2];
/* Even part */
- /* Add fudge factor here for final descale. */
- z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ z3 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
z3 <<= CONST_BITS;
z4 = (INT32) wsptr[4];
/* Even part */
- /* Add fudge factor here for final descale. */
- z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ z1 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
z1 <<= CONST_BITS;
z2 = (INT32) wsptr[2];
/* Even part */
- /* Add fudge factor here for final descale. */
- z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ z1 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
z1 <<= CONST_BITS;
z4 = (INT32) wsptr[4];
z2 = MULTIPLY(z4, FIX(1.274162392)); /* c4 */
/* Even part */
- /* Add fudge factor here for final descale. */
- z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ z1 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
z1 <<= CONST_BITS;
z2 = (INT32) wsptr[2];
/* Even part */
- /* Add fudge factor here for final descale. */
- tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ tmp0 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
tmp0 <<= CONST_BITS;
z1 = (INT32) wsptr[4];
/* Even part */
- /* Add fudge factor here for final descale. */
- tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ tmp0 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
tmp0 <<= CONST_BITS;
z1 = (INT32) wsptr[4];
/* Even part */
- /* Add fudge factor here for final descale. */
- z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ z1 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
z1 <<= CONST_BITS;
z4 = (INT32) wsptr[4];
z2 = MULTIPLY(z4, FIX(1.274162392)); /* c4 */
/* Even part */
- /* Add fudge factor here for final descale. */
- z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ z3 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
z3 <<= CONST_BITS;
z4 = (INT32) wsptr[4];
/* Even part */
- /* Add fudge factor here for final descale. */
- z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ z3 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
z3 <<= CONST_BITS;
z4 = (INT32) wsptr[4];
z1 = MULTIPLY(z4, FIX(1.144122806)); /* c4 */
* The rotator is c(-6).
*/
+ /* Add range center and fudge factor for final descale and range-limit. */
+ z2 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
+ z3 = (INT32) wsptr[4];
+
+ tmp0 = (z2 + z3) << CONST_BITS;
+ tmp1 = (z2 - z3) << CONST_BITS;
+
z2 = (INT32) wsptr[2];
z3 = (INT32) wsptr[6];
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
- /* Add fudge factor here for final descale. */
- z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
- z3 = (INT32) wsptr[4];
-
- tmp0 = (z2 + z3) << CONST_BITS;
- tmp1 = (z2 - z3) << CONST_BITS;
-
tmp10 = tmp0 + tmp2;
tmp13 = tmp0 - tmp2;
tmp11 = tmp1 + tmp3;
/* Even part */
- /* Add fudge factor here for final descale. */
- tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ tmp0 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
tmp0 <<= CONST_BITS;
tmp2 = (INT32) wsptr[4];
tmp10 = MULTIPLY(tmp2, FIX(0.707106781)); /* c4 */
/* Even part */
- /* Add fudge factor here for final descale. */
- tmp0 = wsptr[0] + (ONE << 2);
+ /* Add range center and fudge factor for final descale and range-limit. */
+ tmp0 = wsptr[0] + ((((INT32) RANGE_CENTER) << 3) + (ONE << 2));
tmp2 = wsptr[2];
tmp10 = (tmp0 + tmp2) << CONST_BITS;
JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col)
{
- INT32 tmp0, tmp1;
+ DCTELEM tmp0, tmp1;
ISLOW_MULT_TYPE * quantptr;
JSAMPROW outptr;
JSAMPLE *range_limit = IDCT_range_limit(cinfo);
- SHIFT_TEMPS
+ ISHIFT_TEMPS
/* Pass 1: empty. */
/* Even part */
tmp0 = DEQUANTIZE(coef_block[0], quantptr[0]);
- /* Add fudge factor here for final descale. */
- tmp0 += ONE << 2;
+ /* Add range center and fudge factor for final descale and range-limit. */
+ tmp0 += (((DCTELEM) RANGE_CENTER) << 3) + (1 << 2);
/* Odd part */
/* Final output stage */
- outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK];
- outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK];
+ outptr[0] = range_limit[(int) IRIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK];
+ outptr[1] = range_limit[(int) IRIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK];
}
* The rotator is c(-6).
*/
+ /* Add range center and fudge factor for final descale and range-limit. */
+ z2 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
+ z3 = (INT32) wsptr[4];
+
+ tmp0 = (z2 + z3) << CONST_BITS;
+ tmp1 = (z2 - z3) << CONST_BITS;
+
z2 = (INT32) wsptr[2];
z3 = (INT32) wsptr[6];
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
- /* Add fudge factor here for final descale. */
- z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
- z3 = (INT32) wsptr[4];
-
- tmp0 = (z2 + z3) << CONST_BITS;
- tmp1 = (z2 - z3) << CONST_BITS;
-
tmp10 = tmp0 + tmp2;
tmp13 = tmp0 - tmp2;
tmp11 = tmp1 + tmp3;
/* Even part */
- /* Add fudge factor here for final descale. */
- tmp23 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ tmp23 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
tmp23 <<= CONST_BITS;
z1 = (INT32) wsptr[2];
/* Even part */
- /* Add fudge factor here for final descale. */
- tmp10 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ tmp10 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
tmp10 <<= CONST_BITS;
tmp12 = (INT32) wsptr[4];
tmp20 = MULTIPLY(tmp12, FIX(0.707106781)); /* c4 */
/* Even part */
- /* Add fudge factor here for final descale. */
- tmp12 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ tmp12 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
tmp12 <<= CONST_BITS;
tmp13 = (INT32) wsptr[2];
tmp14 = (INT32) wsptr[4];
/* Even part */
- /* Add fudge factor here for final descale. */
- tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ tmp0 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
tmp2 = (INT32) wsptr[2];
tmp10 = (tmp0 + tmp2) << CONST_BITS;
/* Even part */
- /* Add fudge factor here for final descale. */
- tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ tmp0 = (INT32) wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) +
+ (ONE << (PASS1_BITS+2)));
tmp0 <<= CONST_BITS;
tmp2 = (INT32) wsptr[2];
tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */
/* Even part */
- /* Add fudge factor here for final descale. */
- tmp10 = wsptr[0] + (ONE << (CONST_BITS+2));
+ /* Add range center and fudge factor for final descale and range-limit. */
+ tmp10 = wsptr[0] +
+ ((((INT32) RANGE_CENTER) << (CONST_BITS+3)) +
+ (ONE << (CONST_BITS+2)));
/* Odd part */
JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col)
{
- INT32 tmp0, tmp1;
+ DCTELEM tmp0, tmp1;
ISLOW_MULT_TYPE * quantptr;
JSAMPLE *range_limit = IDCT_range_limit(cinfo);
- SHIFT_TEMPS
+ ISHIFT_TEMPS
/* Process 1 column from input, store into output array. */
quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
/* Even part */
-
+
tmp0 = DEQUANTIZE(coef_block[DCTSIZE*0], quantptr[DCTSIZE*0]);
- /* Add fudge factor here for final descale. */
- tmp0 += ONE << 2;
+ /* Add range center and fudge factor for final descale and range-limit. */
+ tmp0 += (((DCTELEM) RANGE_CENTER) << 3) + (1 << 2);
/* Odd part */
/* Final output stage */
- output_buf[0][output_col] = range_limit[(int) RIGHT_SHIFT(tmp0 + tmp1, 3)
- & RANGE_MASK];
- output_buf[1][output_col] = range_limit[(int) RIGHT_SHIFT(tmp0 - tmp1, 3)
- & RANGE_MASK];
+ output_buf[0][output_col] =
+ range_limit[(int) IRIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK];
+ output_buf[1][output_col] =
+ range_limit[(int) IRIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK];
}
#endif /* IDCT_SCALING_SUPPORTED */
* rdswitch.c
*
* Copyright (C) 1991-1996, Thomas G. Lane.
+ * Modified 2003-2015 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.
*
return FALSE;
if ((ch1 != 'x' && ch1 != 'X') || ch2 != ',') /* syntax check */
return FALSE;
- if (val1 <= 0 || val1 > 4 || val2 <= 0 || val2 > 4) {
- fprintf(stderr, "JPEG sampling factors must be 1..4\n");
+ if (val1 <= 0 || val1 > MAX_SAMP_FACTOR ||
+ val2 <= 0 || val2 > MAX_SAMP_FACTOR) {
+ fprintf(stderr, "JPEG sampling factors must be 1..%d\n", MAX_SAMP_FACTOR);
return FALSE;
}
cinfo->comp_info[ci].h_samp_factor = val1;
* wrgif.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
+ * Modified 2015 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.
*
LOCAL(void)
emit_header (gif_dest_ptr dinfo, int num_colors, JSAMPARRAY colormap)
/* Output the GIF file header, including color map */
-/* If colormap==NULL, synthesize a gray-scale colormap */
+/* If colormap==NULL, synthesize a grayscale colormap */
{
int BitsPerPixel, ColorMapSize, InitCodeSize, FlagByte;
int cshift = dinfo->cinfo->data_precision - 8;
put_3bytes(dinfo, GETJSAMPLE(colormap[0][i]) >> cshift);
}
} else {
- /* Create a gray-scale map of num_colors values, range 0..255 */
+ /* Create a grayscale map of num_colors values, range 0..255 */
put_3bytes(dinfo, (i * 255 + (num_colors-1)/2) / (num_colors-1));
}
} else {
((j_common_ptr) cinfo, JPOOL_IMAGE, cinfo->output_width, (JDIMENSION) 1);
dest->pub.buffer_height = 1;
- return (djpeg_dest_ptr) dest;
+ return &dest->pub;
}
#endif /* GIF_SUPPORTED */
* wrjpgcom.c
*
* Copyright (C) 1994-1997, Thomas G. Lane.
+ * Modified 2015 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.
*
comment_arg = (char *) malloc((size_t) MAX_COM_LENGTH);
if (comment_arg == NULL)
ERREXIT("Insufficient memory");
+ if (strlen(argv[argn]+1) >= (size_t) MAX_COM_LENGTH) {
+ fprintf(stderr, "Comment text may not exceed %u bytes\n",
+ (unsigned int) MAX_COM_LENGTH);
+ exit(EXIT_FAILURE);
+ }
strcpy(comment_arg, argv[argn]+1);
for (;;) {
comment_length = (unsigned int) strlen(comment_arg);
}
if (++argn >= argc)
ERREXIT("Missing ending quote mark");
+ if (strlen(comment_arg) + 1 + strlen(argv[argn]) >=
+ (size_t) MAX_COM_LENGTH) {
+ fprintf(stderr, "Comment text may not exceed %u bytes\n",
+ (unsigned int) MAX_COM_LENGTH);
+ exit(EXIT_FAILURE);
+ }
strcat(comment_arg, " ");
strcat(comment_arg, argv[argn]);
}
+ } else if (strlen(comment_arg) >= (size_t) MAX_COM_LENGTH) {
+ fprintf(stderr, "Comment text may not exceed %u bytes\n",
+ (unsigned int) MAX_COM_LENGTH);
+ exit(EXIT_FAILURE);
}
comment_length = (unsigned int) strlen(comment_arg);
} else
* wrtarga.c
*
* Copyright (C) 1991-1996, Thomas G. Lane.
+ * Modified 2015 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.
*
targaheader[17] = 0x20; /* Top-down, non-interlaced */
if (cinfo->out_color_space == JCS_GRAYSCALE) {
- targaheader[2] = 3; /* image type = uncompressed gray-scale */
+ targaheader[2] = 3; /* image type = uncompressed grayscale */
targaheader[16] = 8; /* bits per pixel */
} else { /* must be RGB */
if (num_colors > 0) {
((j_common_ptr) cinfo, JPOOL_IMAGE, dest->buffer_width, (JDIMENSION) 1);
dest->pub.buffer_height = 1;
- return (djpeg_dest_ptr) dest;
+ return &dest->pub;
}
#endif /* TARGA_SUPPORTED */
#define HAVE_PROTOTYPES
#define HAVE_UNSIGNED_CHAR
#define HAVE_UNSIGNED_SHORT
-
+/* #define void char */
+/* #define const */
+#undef CHAR_IS_UNSIGNED
#define HAVE_STDDEF_H
#define HAVE_STDLIB_H
+#undef NEED_BSD_STRINGS
+#undef NEED_SYS_TYPES_H
+#undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */
+#undef NEED_SHORT_EXTERNAL_NAMES
+#undef INCOMPLETE_TYPES_BROKEN
/* Define "boolean" as unsigned char, not enum, per Windows custom */
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
#endif
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
-#undef NEED_BSD_STRINGS
-#undef NEED_SYS_TYPES_H
-#undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */
-#undef NEED_SHORT_EXTERNAL_NAMES
-#undef INCOMPLETE_TYPES_BROKEN
+
+#ifdef JPEG_INTERNALS
+
+#undef RIGHT_SHIFT_IS_UNSIGNED
+
+#endif /* JPEG_INTERNALS */
* jdct.h
*
* Copyright (C) 1994-1996, Thomas G. Lane.
+ * Modified 2002-2015 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.
*
* converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could
* be quite far out of range if the input data is corrupt, so a bulletproof
* range-limiting step is required. We use a mask-and-table-lookup method
- * to do the combined operations quickly. See the comments with
- * prepare_range_limit_table (in jdmaster.c) for more info.
+ * to do the combined operations quickly, assuming that MAXJSAMPLE+1
+ * is a power of 2. See the comments with prepare_range_limit_table
+ * (in jdmaster.c) for more info.
*/
-#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit + CENTERJSAMPLE)
-
#define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
+#define RANGE_CENTER (MAXJSAMPLE * 2 + 2)
+#define RANGE_SUBSET (RANGE_CENTER - CENTERJSAMPLE)
+
+#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit - RANGE_SUBSET)
/* Short forms of external names for systems with brain-damaged linkers. */
#ifndef MULTIPLY16V16 /* default definition */
#define MULTIPLY16V16(var1,var2) ((var1) * (var2))
#endif
+
+/* Like RIGHT_SHIFT, but applies to a DCTELEM.
+ * We assume that int right shift is unsigned if INT32 right shift is.
+ */
+
+#ifdef RIGHT_SHIFT_IS_UNSIGNED
+#define ISHIFT_TEMPS DCTELEM ishift_temp;
+#if BITS_IN_JSAMPLE == 8
+#define DCTELEMBITS 16 /* DCTELEM may be 16 or 32 bits */
+#else
+#define DCTELEMBITS 32 /* DCTELEM must be 32 bits */
+#endif
+#define IRIGHT_SHIFT(x,shft) \
+ ((ishift_temp = (x)) < 0 ? \
+ (ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \
+ (ishift_temp >> (shft)))
+#else
+#define ISHIFT_TEMPS
+#define IRIGHT_SHIFT(x,shft) ((x) >> (shft))
+#endif
* jpeglib.h
*
* Copyright (C) 1991-1998, Thomas G. Lane.
- * Modified 2002-2013 by Guido Vollbeding.
+ * Modified 2002-2015 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.
*
#define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */
#define JPEG_LIB_VERSION_MAJOR 9
-#define JPEG_LIB_VERSION_MINOR 1
+#define JPEG_LIB_VERSION_MINOR 2
/* Various constants determining the sizes of things.
unsigned char ** outbuffer,
unsigned long * outsize));
EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,
- unsigned char * inbuffer,
+ const unsigned char * inbuffer,
unsigned long insize));
/* Default parameter setup for compression */
/*
* jversion.h
*
- * Copyright (C) 1991-2014, Thomas G. Lane, Guido Vollbeding.
+ * Copyright (C) 1991-2016, 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.
*
*/
-#define JVERSION "9a 19-Jan-2014"
+#define JVERSION "9b 17-Jan-2016"
-#define JCOPYRIGHT "Copyright (C) 2014, Thomas G. Lane, Guido Vollbeding"
+#define JCOPYRIGHT "Copyright (C) 2016, Thomas G. Lane, Guido Vollbeding"