From: DRC Date: Sat, 2 Apr 2011 05:37:49 +0000 (+0000) Subject: Ensure that image_width and image_height are initialized if libjpeg v8 emulation... X-Git-Tag: 1.1.90~117 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df48945d2d965346c974d4e0a34a9711bdff18d4;p=libjpeg-turbo Ensure that image_width and image_height are initialized if libjpeg v8 emulation is enabled. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@564 632fc199-4ca6-4c93-a231-07263d6284db --- df48945d2d965346c974d4e0a34a9711bdff18d4 diff --cc ChangeLog.txt index d039c66,0000000..4fc1c9d mode 100644,000000..100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@@ -1,175 -1,0 +1,180 @@@ +1.1.90 (1.2 beta1) +================== + +[1] Added a JNI wrapper for TurboJPEG/OSS. See java/README for more details. + +[2] TurboJPEG/OSS can now scale down images during decompression. + +[3] Added SIMD routines for RGB-to-grayscale color conversion, which +significantly improves the performance of grayscale JPEG compression from an +RGB source image. + +[4] Improved performance for non-x86 machines. + +[5] Added a function to the TurboJPEG API which performs lossless transforms. +This function uses the same back end as jpegtran, but it performs transcoding +entirely in memory and allows multiple transforms and/or crop operations to be +batched together, so the source coefficients only need to be read once. This +is useful when generating image tiles from a single source JPEG. + +[6] Modified jpgtest to benchmark the new scaled decompression and lossless +transform features in TurboJPEG/OSS. + +[7] Added support for 4:4:0 (transposed 4:2:2) subsampling in TurboJPEG, which +was necessary in order for it to read 4:2:2 JPEG files that had been losslessly +transposed or rotated 90 degrees. + +[8] Fixed a regression bug in the NSIS script that caused the Windows installer +build to fail when using the Visual Studio IDE. + ++[9] Fixed a bug in jpeg_read_coefficients() whereby it would not initialize ++cinfo->image_width and cinfo->image_height if libjpeg v8 emulation was enabled. ++This specifically caused the jpegoptim program to fail if it was linked against ++a version of libjpeg-turbo that was built with libjpeg v8 emulation. ++ + +1.1.1 +===== + +[1] Fixed a 1-pixel error in row 0, column 21 of the luminance plane generated +by tjEncodeYUV(). + +[2] Fixed the accelerated Huffman decoder so that it mimics the behavior of +the unaccelerated decoder and throws a warning if an unexpected marker is found +in the middle of the JPEG data stream. + +[3] Older versions of MinGW64 prefixed symbol names with underscores by +default, which differed from the behavior of 64-bit Visual C++. MinGW64 1.0 +has adopted the behavior of 64-bit Visual C++ as the default, so to accommodate +this, the libjpeg-turbo SIMD function names are no longer prefixed with an +underscore when building with MinGW64. This means that, when building +libjpeg-turbo with older versions of MinGW64, you will now have to add +-fno-leading-underscore to the CFLAGS. + + +1.1.0 +===== + +[1] The algorithm used by the SIMD quantization function cannot produce correct +results when the JPEG quality is >= 98 and the fast integer forward DCT is +used. Thus, the non-SIMD quantization function is now used for those cases, +and libjpeg-turbo should now produce identical output to libjpeg v6b in all +cases. + +[2] Despite the above, the fast integer forward DCT still degrades somewhat for +JPEG qualities greater than 95, so TurboJPEG/OSS will now automatically use the +slow integer forward DCT when generating JPEG images of quality 96 or greater. +This reduces compression performance by as much as 15% for these high-quality +images but is necessary to ensure that the images are perceptually lossless. +It also ensures that the library can avoid the performance pitfall created by +[1]. + +[3] Ported jpgtest.cxx to pure C to avoid the need for a C++ compiler. + +[4] Fixed visual artifacts in grayscale JPEG compression caused by a typo in +the RGB-to-chrominance lookup tables. + +[5] The Windows distribution packages now include the libjpeg run-time programs +(cjpeg, etc.) + +[6] All packages now include jpgtest. + +[7] The TurboJPEG dynamic library now uses versioned symbols. + +[8] Added two new TurboJPEG API functions, tjEncodeYUV() and +tjDecompressToYUV(), to replace the somewhat hackish TJ_YUV flag. + + +1.0.90 (1.1 beta1) +================== + +[1] Added emulation of the libjpeg v7 and v8 APIs and ABIs. See +README-turbo.txt for more details. This feature was sponsored by CamTrace SAS. + +[2] Created a new CMake-based build system for the Visual C++ and MinGW builds. + +[3] TurboJPEG/OSS can now compress from/decompress to grayscale bitmaps. + +[4] jpgtest can now be used to test decompression performance with existing +JPEG images. + +[5] If the default install prefix (/opt/libjpeg-turbo) is used, then +'make install' now creates /opt/libjpeg-turbo/lib32 and +/opt/libjpeg-turbo/lib64 sym links to duplicate the behavior of the binary +packages. + +[6] All symbols in the libjpeg-turbo dynamic library are now versioned, even +when the library is built with libjpeg v6b emulation. + +[7] Added arithmetic encoding and decoding support (can be disabled with +configure or CMake options) + +[8] Added a TJ_YUV flag to TurboJPEG/OSS which causes both the compressor and +decompressor to output planar YUV images. + +[9] Added an extended version of tjDecompressHeader() to TurboJPEG/OSS which +allows the caller to determine the type of subsampling used in a JPEG image. + +[10] Added further protections against invalid Huffman codes. + + +1.0.1 +===== + +[1] The Huffman decoder will now handle erroneous Huffman codes (for instance, +from a corrupt JPEG image.) Previously, these would cause libjpeg-turbo to +crash under certain circumstances. + +[2] Fixed typo in SIMD dispatch routines which was causing 4:2:2 upsampling to +be used instead of 4:2:0 when decompressing JPEG images using SSE2 code. + +[3] configure script will now automatically determine whether the +INCOMPLETE_TYPES_BROKEN macro should be defined. + + +1.0.0 +===== + +[1] 2983700: Further FreeBSD build tweaks (no longer necessary to specify +--host when configuring on a 64-bit system) + +[2] Created sym. links in the Unix/Linux packages so that the TurboJPEG +include file can always be found in /opt/libjpeg-turbo/include, the 32-bit +static libraries can always be found in /opt/libjpeg-turbo/lib32, and the +64-bit static libraries can always be found in /opt/libjpeg-turbo/lib64. + +[3] The Unix/Linux distribution packages now include the libjpeg run-time +programs (cjpeg, etc.) and man pages. + +[4] Created a 32-bit supplementary package for amd64 Debian systems which +contains just the 32-bit libjpeg-turbo libraries. + +[5] Moved the libraries from */lib32 to */lib in the i386 Debian package. + +[6] Include distribution package for Cygwin + +[7] No longer necessary to specify --without-simd on non-x86 architectures, and +unit tests now work on those architectures. + + +0.0.93 +====== + +[1] 2982659, Fixed x86-64 build on FreeBSD systems + +[2] 2988188: Added support for Windows 64-bit systems + + +0.0.91 +====== + +[1] Added documentation to .deb packages + +[2] 2968313: Fixed data corruption issues when decompressing large JPEG images +and/or using buffered I/O with the libjpeg-turbo decompressor + + +0.0.90 +====== + +Initial release diff --cc jdtrans.c index 9d9c1b1,22dd47f..f0cd0ae --- a/jdtrans.c +++ b/jdtrans.c @@@ -99,22 -100,14 +99,27 @@@ transdecode_master_selection (j_decompr /* This is effectively a buffered-image operation. */ cinfo->buffered_image = TRUE; ++#if JPEG_LIB_VERSION >= 80 + /* Compute output image dimensions and related values. */ + jpeg_core_output_dimensions(cinfo); ++#endif + /* Entropy decoding: either Huffman or arithmetic coding. */ - if (cinfo->arith_code) + if (cinfo->arith_code) { +#ifdef D_ARITH_CODING_SUPPORTED jinit_arith_decoder(cinfo); - else { - jinit_huff_decoder(cinfo); +#else + ERREXIT(cinfo, JERR_ARITH_NOTIMPL); +#endif + } else { + if (cinfo->progressive_mode) { +#ifdef D_PROGRESSIVE_SUPPORTED + jinit_phuff_decoder(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else + jinit_huff_decoder(cinfo); } /* Always get a full-image coefficient buffer. */