]> granicus.if.org Git - libjpeg-turbo/log
libjpeg-turbo
9 years agoAdd JSIMD_NOHUFFENC environment variable for ARM
DRC [Fri, 15 Jan 2016 19:15:54 +0000 (13:15 -0600)]
Add JSIMD_NOHUFFENC environment variable for ARM

Useful in regression/performance testing

9 years agoComplete the ARM64 NEON SIMD implementation
DRC [Fri, 15 Jan 2016 15:29:11 +0000 (09:29 -0600)]
Complete the ARM64 NEON SIMD implementation

This adds 64-bit NEON coverage for all of the algorithms that are
covered by the 32-bit NEON implementation, except for h2v1 (4:2:2) fancy
upsampling (used when decompressing 4:2:2 JPEG images.)  It also adds
64-bit NEON SIMD coverage for:

* slow integer forward DCT (compressor)
* h2v2 (4:2:0) downsampling (compressor)
* h2v1 (4:2:2) downsampling (compressor)

which are not covered in the 32-bit implementation.

Compression speedups relative to libjpeg-turbo 1.4.2:
Apple A7 (iPhone 5S), iOS, 64-bit: 113-150% (reported)
48-core ThunderX (RunAbove ARM Cloud), Linux, 64-bit: 2.1-33% (avg. 15%)

Refer to #44 and #49 for discussion

This commit also removes the unnecessary

    if (simd_support & JSIMD_ARM_NEON)

statements from the jsimd* algorithm functions.  Since the jsimd_can*()
functions check for the existence of NEON, the corresponding algorithm
functions will never be called if NEON isn't available.

Based on:
https://github.com/mayeut/libjpeg-turbo/commit/dcd9d84f10fae192c0e3935818dc289bca9c3e29
https://github.com/mayeut/libjpeg-turbo/commit/b0d87b811f37bd560083deea8c6e7d704e5cd944
https://github.com/mayeut/libjpeg-turbo/commit/70cd5c8a493a67f4d54dd2067ae6dedb65d95389
https://github.com/mayeut/libjpeg-turbo/commit/3e58d9a064648503c57ec2650ee79880f749a52b
https://github.com/mayeut/libjpeg-turbo/commit/837b19542f53fa81af83e6ba002d559877aaf597
https://github.com/mayeut/libjpeg-turbo/commit/73dc43ccc870c2e10ba893e9764b8e48d6836585
https://github.com/mayeut/libjpeg-turbo/commit/a82b71a261b4c0213f558baf4bc745f1c27356d8
https://github.com/mayeut/libjpeg-turbo/commit/c1b1188c2106d6ea7b76644b6023b57edeb602e1
https://github.com/mayeut/libjpeg-turbo/commit/305c89284e1bb222b34fbc7261f697a0cc452a41
https://github.com/mayeut/libjpeg-turbo/commit/7f443f99950b4d7d442b9b879648eca5273209bd
https://github.com/mayeut/libjpeg-turbo/commit/4c2b53b77da5a20e30e2aadaeddb0efbfe24e06d

Unified version with fixes:
https://github.com/mayeut/libjpeg-turbo/commit/1004a3cd05870612a194b410efeaa1b4da76d246

9 years agoARM32 NEON SIMD implementation of Huffman encoding
DRC [Wed, 13 Jan 2016 09:13:20 +0000 (03:13 -0600)]
ARM32 NEON SIMD implementation of Huffman encoding

Full-color compression speedups relative to libjpeg-turbo 1.4.2:

800 MHz ARM Cortex-A9, iOS, 32-bit:  26-44% (avg. 32%)

Refer to #42 and #47 for discussion.

This commit also removes the unnecessary

    if (simd_support & JSIMD_ARM_NEON)

statements from the jsimd* algorithm functions.  Since the jsimd_can*()
functions check for the existence of NEON, the corresponding algorithm
functions will never be called if NEON isn't available.  Removing those
if statements improved performance across the board by a couple of
percent.

Based on:
https://github.com/mayeut/libjpeg-turbo/commit/fc023c880ce1d6c908fb78ccc25f5d5fd910ccc5

9 years agotjbench: Further tweaks to -nowrite feature
DRC [Wed, 13 Jan 2016 19:01:45 +0000 (13:01 -0600)]
tjbench: Further tweaks to -nowrite feature

* Do not compute compression error if -nowrite is specified
* Adjust formatting of -nowrite usage description

9 years agoBUILDING.md: Restore autotools processing instr.
DRC [Wed, 13 Jan 2016 18:25:03 +0000 (12:25 -0600)]
BUILDING.md: Restore autotools processing instr.

Partially reverts 54014d9c2a41905b7b766057af6728834da64b59.  When
building from a git sandbox, as opposed to from an official source
tarball, it is still necessary to run autoreconf.

Closes #48

9 years agoSSE2 SIMD implementation of Huffman encoding
DRC [Thu, 7 Jan 2016 06:19:43 +0000 (00:19 -0600)]
SSE2 SIMD implementation of Huffman encoding

Full-color compression speedups relative to libjpeg-turbo 1.4.2:

2.8 GHz Intel Xeon W3530, Linux, 64-bit:  2.2-18% (avg. 9.5%)
2.8 GHz Intel Xeon W3530, Linux, 32-bit:  10-25% (avg. 17%)

2.3 GHz AMD A10-4600M APU, Linux, 64-bit:  4.9-17% (avg. 11%)
2.3 GHz AMD A10-4600M APU, Linux, 32-bit:  8.8-19% (avg. 15%)

3.0 GHz Intel Core i7, OS X, 64-bit:  3.5-16% (avg. 10%)
3.0 GHz Intel Core i7, OS X, 32-bit:  4.8-14% (avg. 11%)

2.6 GHz AMD Athlon 64 X2 5050e:
Performance-neutral (give or take a few percent)

Full-color compression speedups relative to IPP:

2.8 GHz Intel Xeon W3530, Linux, 64-bit:  4.8-34% (avg. 19%)
2.8 GHz Intel Xeon W3530, Linux, 32-bit:  -19%-7.0% (avg. -7.0%)

Refer to #42 for discussion.  Numerous other approaches were attempted,
but this one proved to be the most performant across all platforms.

This commit also fixes #3 (works around, really-- the clang-compiled version
of jchuff.c still performs 20% worse than its GCC-compiled counterpart, but
that code is now bypassed by the new SSE2 Huffman algorithm.)

Based on:
https://github.com/mayeut/libjpeg-turbo/commit/2cb4d41330e1edc4469f6b97ba73b73abfbeb02f
https://github.com/mayeut/libjpeg-turbo/commit/36c94e050d117912adbff9fbcc6fe307df240168

9 years agoAdd -nowrite arg to TJBench to improve consistency
DRC [Tue, 12 Jan 2016 04:27:38 +0000 (22:27 -0600)]
Add -nowrite arg to TJBench to improve consistency

Prevents any images from being written to disk, thus making the
performance of the benchmark as CPU-bound as possible.

9 years agoAllow JSIMD_FORCENONE=1 env to disable x86-64 SIMD
DRC [Tue, 12 Jan 2016 04:03:16 +0000 (22:03 -0600)]
Allow JSIMD_FORCENONE=1 env to disable x86-64 SIMD

Traditionally, the x86-64 code did not call init_simd() because it had
no need to (only SSE2 was supported.)  However, having the ability to
disable SIMD at run time is a useful testing tool, and all of the other
SIMD implementations have this ability.

9 years agoMerge branch '1.4.x'
DRC [Thu, 7 Jan 2016 01:24:55 +0000 (19:24 -0600)]
Merge branch '1.4.x'

9 years agoRegression: Allow co-install of 32-bit/64-bit RPMs
DRC [Thu, 7 Jan 2016 01:17:54 +0000 (19:17 -0600)]
Regression: Allow co-install of 32-bit/64-bit RPMs

Fix a regression introduced in 1.4.1 that prevented 32-bit and 64-bit
libjpeg-turbo RPMs from being installed simultaneously on recent Red
Hat/Fedora distributions.  This was due to the addition of the
SIZEOF_SIZE_T macro in jconfig.h, which allows the Huffman codec to
determine the word size at compile time.  Since that macro differs
between 32-bit and 64-bit builds, this caused a conflict between the
i386 and x86_64 RPMs (any differing files, other than executables, are
not allowed when 32-bit and 64-bit RPMs are installed simultaneously.)
Since the macro is used only internally, it has been moved into
jconfigint.h.

9 years agoFix iOS ARM64 build broken by removal of .arch
DRC [Wed, 6 Jan 2016 20:02:27 +0000 (14:02 -0600)]
Fix iOS ARM64 build broken by removal of .arch

The unnecessary .arch directive was removed from the ARM64 SIMD code
in d70a5c12fcb72443483456a2cc8dd18a4c238618, thus allowing clang's
integrated assembler to assemble the code on Linux systems.  However,
this broke the detection mechanism in acinclude.m4 that tells the build
system whether it needs to use gas-preprocessor.pl.  Since one of the
primary motivators for using gas-preprocessor.pl with ARM64 builds is
the lack of .req/.unreq directives in Apple's implementation of clang,
acinclude.m4 now checks whether .req/.unreq can be properly assembled
and uses gas-preprocessor.pl if not.

Closes #33.

9 years agoMerge branch '1.4.x'
DRC [Sat, 19 Dec 2015 20:29:46 +0000 (14:29 -0600)]
Merge branch '1.4.x'

9 years agoBuild: Use FILEPATH type for NASM CMake variable
DRC [Sat, 19 Dec 2015 20:18:21 +0000 (14:18 -0600)]
Build: Use FILEPATH type for NASM CMake variable

This causes cmake-gui to to display the proper file chooser dialog
(as opposed to the directory chooser.)

Fixes #40

9 years agocjpeg: Adjust claims RE: image quality settings
DRC [Thu, 17 Dec 2015 16:41:51 +0000 (10:41 -0600)]
cjpeg: Adjust claims RE: image quality settings

Quality values > 95 are not useless.  They just may not provide as good
of a size vs. perceptual quality tradeoff as lower quality values.  This
also displays the default quality value in the cjpeg usage.

Closes #39

9 years agoRemove unnecessary .arch directive in ARM64 code
DRC [Mon, 14 Dec 2015 22:59:43 +0000 (16:59 -0600)]
Remove unnecessary .arch directive in ARM64 code

This directive was preventing the code from assembling using the
integrated assembler in clang.

Fixes #33

9 years agoFix compiler warnings under Visual C++
DRC [Thu, 15 Oct 2015 07:25:00 +0000 (02:25 -0500)]
Fix compiler warnings under Visual C++

A few of these are long-standing, but most were exposed when switching
from INT32 to JLONG.

9 years agoFix additional issues reported by UB sanitizers
DRC [Thu, 15 Oct 2015 03:26:25 +0000 (22:26 -0500)]
Fix additional issues reported by UB sanitizers

Most of these involved overrunning the signed 32-bit JLONG type whenever
building libjpeg-turbo with a 32-bit compiler.  These issues are not
believed to represent actual security threats, but eliminating them
makes it easier to detect such threats should they arise in the future.

9 years agoReplace INT32 with a new internal datatype (JLONG)
DRC [Wed, 14 Oct 2015 22:32:39 +0000 (17:32 -0500)]
Replace INT32 with a new internal datatype (JLONG)

These days, INT32 is a commonly-defined datatype in system headers.  We
cannot eliminate the definition of that datatype from jmorecfg.h, since
the INT32 typedef has technically been part of the libjpeg API since
version 5 (1994.)  However, using INT32 internally is risky, because the
inclusion of a particular header (Xmd.h, for instance) could change the
definition of INT32 from long to int on 64-bit platforms and thus change
the internal behavior of libjpeg-turbo in unexpected ways (for instance,
failing to correctly set __INT32_IS_ACTUALLY_LONG to match the INT32
typedef-- perhaps as a result of including the wrong version of
jpeglib.h-- could cause libjpeg-turbo to produce incorrect results.)

The library has always been built in environments in which INT32 is
effectively long (on Windows, long is always 32-bit, so effectively it's
the same as int), so it makes sense to turn INT32 into an explicitly
long datatype.  This ensures that libjpeg-turbo will always behave
consistently, regardless of the headers included at compile time.

Addresses a concern expressed in #26.

9 years agoChangeLog: acknowledge existence of 1.4.2
DRC [Tue, 13 Oct 2015 18:37:32 +0000 (13:37 -0500)]
ChangeLog: acknowledge existence of 1.4.2

9 years agoREADME.md: create link for jcstest.c
DRC [Sat, 10 Oct 2015 15:56:58 +0000 (10:56 -0500)]
README.md: create link for jcstest.c

9 years agoMarkdown versions of README, LICENSE, BUILDING
DRC [Sat, 10 Oct 2015 15:34:55 +0000 (10:34 -0500)]
Markdown versions of README, LICENSE, BUILDING

9 years agoRename README, LICENSE, BUILDING text files
DRC [Sat, 10 Oct 2015 15:25:46 +0000 (10:25 -0500)]
Rename README, LICENSE, BUILDING text files

The IJG README file has been renamed to README.ijg, in order to avoid
confusion (many people were assuming that that was our project's README
file and weren't reading README-turbo.txt) and to lay the groundwork for
markdown versions of the libjpeg-turbo README and build instructions.

9 years agoMerge branch '1.4.x'
DRC [Sat, 10 Oct 2015 01:03:59 +0000 (20:03 -0500)]
Merge branch '1.4.x'

9 years agoComment formatting tweaks
DRC [Sat, 10 Oct 2015 01:02:31 +0000 (20:02 -0500)]
Comment formatting tweaks

9 years agoFix 'make dist' 1.4.2
DRC [Mon, 21 Sep 2015 18:45:45 +0000 (13:45 -0500)]
Fix 'make dist'

9 years ago1.4.2
DRC [Mon, 21 Sep 2015 18:43:36 +0000 (13:43 -0500)]
1.4.2

9 years agoMerge branch '1.4.x'
DRC [Mon, 21 Sep 2015 18:13:44 +0000 (13:13 -0500)]
Merge branch '1.4.x'

9 years agoFix various issues reported by the UB sanitizers
DRC [Mon, 21 Sep 2015 17:57:41 +0000 (12:57 -0500)]
Fix various issues reported by the UB sanitizers
Most of these involved left shifting a negative number, which is
technically undefined (although every modern compiler I'm aware of
will implement this by treating the signed integer as a 2's complement
unsigned integer-- the LEFT_SHIFT() macro just makes this behavior
explicit in order to shut up ubsan.)  This also fixes a couple of
non-issues in the entropy codecs, whereby the sanitizer reported an
out-of-bounds index in the 4th argument of jpeg_make_d_derived_tbl().
In those cases, the index was actually out of bounds (caused by a
malformed JPEG image), but jpeg_make_d_derived_tbl() would have caught
the error and aborted prior to actually using the invalid address.  Here
again, the fix was to make our intentions explicit so as to shut up
ubsan.

9 years agoFix ChangeLog numbering biffed by previous merge
DRC [Thu, 17 Sep 2015 04:26:13 +0000 (23:26 -0500)]
Fix ChangeLog numbering biffed by previous merge

9 years agoMerge branch '1.4.x'
DRC [Thu, 17 Sep 2015 04:16:38 +0000 (23:16 -0500)]
Merge branch '1.4.x'

9 years agoFix MIPS DSPr2 4:2:0 upsample bug w/ small images
James Cowgill [Thu, 17 Sep 2015 04:05:46 +0000 (23:05 -0500)]
Fix MIPS DSPr2 4:2:0 upsample bug w/ small images
The DSPr2 code was errantly comparing the residual (t9, width & 0xF)
with the end pointer (t4, out + width) instead of the width directly
(a1).  This would give the wrong results with any image whose output
width was less than 16.  The other small changes (ulw to lw and removal
of the nop) are just some easy optimizations around this code.

This issue caused a buffer overrun and subsequent segfault on images
whose scaled output height was 1 pixel and whose scaled output width was
< 16 pixels.  Note that the "plain" (non-fancy and non-merged) upsample
routine, which was affected by this bug, is normally not used except
when decompressing a non-YCbCr JPEG image, but it is also used when
decompressing a single-row image (because the other upsampling
algorithms require at least two rows.)

Closes #16.

9 years agoFix x86-64 ABI conformance issue in SIMD code
Chandler Carruth [Tue, 15 Sep 2015 18:57:03 +0000 (11:57 -0700)]
Fix x86-64 ABI conformance issue in SIMD code
(descriptions cribbed by DRC from discussion in #20)
In the x86-64 ABI, the high (unused) DWORD of a 32-bit argument's
register is undefined, so it was incorrect to use a 64-bit mov
instruction to transfer a JDIMENSION argument in the 64-bit SSE2 SIMD
functions.  The code worked thus far only because the existing compiler
optimizers weren't smart enough to do anything else with the register in
question, so the upper 32 bits happened to be all zeroes-- for the past
6 years, on every x86-64 compiler previously known to mankind.

The bleeding-edge Clang/LLVM compiler has a smarter optimizer, and
under certain circumstances, it will attempt to load-combine adjacent
32-bit integers from one of the libjpeg structures into a single 64-bit
integer and pass that 64-bit integer as a 32-bit argument to one of the
SIMD functions (which is allowed by the ABI, since the upper 32 bits of
the 32-bit argument's register are undefined.)  This caused the
libjpeg-turbo regression tests to crash.

Also enhance the documentation of JDIMENSION to explain that its size
is significant to the implementation of the SIMD code.

Closes #20.  Refer also to http://crbug.com/532214.

9 years agoMerge branch '1.4.x'
DRC [Wed, 9 Sep 2015 00:02:18 +0000 (19:02 -0500)]
Merge branch '1.4.x'

9 years agoAdd file that explains the libjpeg-turbo licenses
DRC [Tue, 8 Sep 2015 23:59:37 +0000 (18:59 -0500)]
Add file that explains the libjpeg-turbo licenses
Previously this information was found in a page on libjpeg-turbo.org,
but there was still some confusion, because README-turbo.txt wasn't
clear as to which license applied to what.

9 years agoMerge branch '1.4.x'
DRC [Sat, 29 Aug 2015 23:15:25 +0000 (18:15 -0500)]
Merge branch '1.4.x'

9 years agoFix negative shift with IFAST FDCT and qual=100
DRC [Sat, 29 Aug 2015 23:05:43 +0000 (18:05 -0500)]
Fix negative shift with IFAST FDCT and qual=100
With certain images, compressing using quality=100 and the fast integer
forward DCT will cause the divisor passed to compute_reciprocal() to be
1.  In those cases, the library already disables the SIMD quantization
algorithm to avoid 16-bit overflow.  However, compute_reciprocal()
doesn't properly handle the divisor==1 case, so we need to use special
values in that case so that the C quantization algorithm will behave
like an identity function.

9 years agoFix build error when compiling MIPS SIMD w/ -mfpxx
James Cowgill [Sat, 15 Aug 2015 12:30:14 +0000 (13:30 +0100)]
Fix build error when compiling MIPS SIMD w/ -mfpxx

When compiled with -mfpxx (which is now the default on Debian), there are
some restrictions on the use of odd-numbered FP registers. More details
about FPXX can be found here:
https://dmz-portal.mips.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking

This commit simply changes all uses of FP registers to an even-numbered
equivalent like this:
 f0 -> f0
 f1 -> f2
 f2 -> f4
 ...
 f8 -> f16

This commit should have no observable effect except that the MIPS assembly
will now compile with -mfpxx.

Closes #11

9 years agoMerge branch '1.4.x'
DRC [Thu, 27 Aug 2015 01:31:13 +0000 (20:31 -0500)]
Merge branch '1.4.x'

9 years agoEliminate cppcheck false positive in turbojpeg.c
DRC [Thu, 27 Aug 2015 01:29:36 +0000 (20:29 -0500)]
Eliminate cppcheck false positive in turbojpeg.c

9 years agoFix 'make dist'
DRC [Sat, 15 Aug 2015 22:04:58 +0000 (17:04 -0500)]
Fix 'make dist'

9 years agoMerge branch '1.4.x'
DRC [Fri, 14 Aug 2015 16:48:05 +0000 (11:48 -0500)]
Merge branch '1.4.x'

9 years agoCheck range of integer values in PPM text file
Frank Bossen [Mon, 29 Dec 2014 18:42:20 +0000 (19:42 +0100)]
Check range of integer values in PPM text file

Add checks to ensure values are within the specified range.

Fixes mozilla/mozjpeg#141, closes #8

9 years agoCheck image size when reading targa file
Frank Bossen [Mon, 29 Dec 2014 17:38:36 +0000 (18:38 +0100)]
Check image size when reading targa file

Throw an error when image width or height is 0.

Fixes mozilla/mozjpeg#140, closes #7.

9 years agoFix cjpeg segfault when Windows BMP width/height<0
DRC [Thu, 13 Aug 2015 16:09:05 +0000 (11:09 -0500)]
Fix cjpeg segfault when Windows BMP width/height<0
rdbmp.c used the ambiguous INT32 datatype, which is sometimes typedef'ed
to long.  Windows bitmap headers use 32-bit signed integers for the
width and height, because height can sometimes be negative (this
indicates a top-down bitmap.)  If biWidth or biHeight was negative and
INT32 was a 64-bit long, then biWidth and biHeight were read as a
positive integer > INT32_MAX, which failed the test in line 385:

    if (biWidth <= 0 || biHeight <= 0)
        ERREXIT(cinfo, JERR_BMP_EMPTY);

This commit refactors rdbmp.c so that it uses the datatypes specified by
Microsoft for the Windows BMP header.

This closes #9 and also provides a better solution for mozilla/mozjpeg#153.

9 years agoDeclare source buffers in TurboJPEG C API as const
DRC [Fri, 14 Aug 2015 01:06:03 +0000 (20:06 -0500)]
Declare source buffers in TurboJPEG C API as const
This reassures the caller that the buffers will not be modified and also
allows read-only buffers to be passed to the functions.

Partially reverts 3947a19f25fc8186d3812dbcf8e70baea36ef652.

9 years agoMerge branch '1.4.x'
DRC [Thu, 13 Aug 2015 23:09:20 +0000 (18:09 -0500)]
Merge branch '1.4.x'

9 years agoTabs to spaces in turbojpeg.h
DRC [Thu, 13 Aug 2015 23:05:32 +0000 (18:05 -0500)]
Tabs to spaces in turbojpeg.h
This was a formatting regression in 1.4.x introduced when the new
TurboJPEG functions were added.

9 years agoMerge pull request #10 from pornel/const
DRC [Thu, 13 Aug 2015 21:51:08 +0000 (16:51 -0500)]
Merge pull request #10 from pornel/const

Declare inbuffer arg in jpeg_mem_src() to be const
This reassures the caller that the buffer will not be modified and also
allows read-only buffers to be passed to the function.

9 years agoDeclare inbuffer const
Kornel Lesiński [Thu, 8 Jan 2015 00:53:31 +0000 (00:53 +0000)]
Declare inbuffer const

9 years agoFix cjpeg segfault when Windows BMP width/height<0
DRC [Thu, 13 Aug 2015 16:09:05 +0000 (11:09 -0500)]
Fix cjpeg segfault when Windows BMP width/height<0
rdbmp.c used the ambiguous INT32 datatype, which is sometimes typedef'ed
to long.  Windows bitmap headers use 32-bit signed integers for the
width and height, because height can sometimes be negative (this
indicates a top-down bitmap.)  If biWidth or biHeight was negative and
INT32 was a 64-bit long, then biWidth and biHeight were read as a
positive integer > INT32_MAX, which failed the test in line 385:

    if (biWidth <= 0 || biHeight <= 0)
        ERREXIT(cinfo, JERR_BMP_EMPTY);

This commit refactors rdbmp.c so that it uses the datatypes specified by
Microsoft for the Windows BMP header.

This closes #9 and also provides a better solution for mozilla/mozjpeg#153.

9 years agoUpdate x86[-64] assembler recommendations
DRC [Tue, 4 Aug 2015 04:59:27 +0000 (23:59 -0500)]
Update x86[-64] assembler recommendations
NASM 2.11.08 has a bug that prevents it from properly assembling a
macho64 version of libjpeg-turbo (the resulting binary generates corrupt
images.)  2.11.09 works properly.  YASM also works properly and has been
a supported alternative since libjpeg-turbo 1.2.

9 years agoUpdate x86[-64] assembler recommendations
DRC [Tue, 4 Aug 2015 04:59:12 +0000 (23:59 -0500)]
Update x86[-64] assembler recommendations
NASM 2.11.08 has a bug that prevents it from properly assembling a
macho64 version of libjpeg-turbo (the resulting binary generates corrupt
images.)  2.11.09 works properly.  YASM also works properly and has been
a supported alternative since libjpeg-turbo 1.2.

9 years agoUpdate x86[-64] assembler recommendations
DRC [Tue, 4 Aug 2015 04:58:40 +0000 (23:58 -0500)]
Update x86[-64] assembler recommendations
NASM 2.11.08 has a bug that prevents it from properly assembling a
macho64 version of libjpeg-turbo (the resulting binary generates corrupt
images.)  2.11.09 works properly.  YASM also works properly and has been
a supported alternative since libjpeg-turbo 1.2.

9 years agoUpdate x86[-64] assembler recommendations
DRC [Tue, 4 Aug 2015 04:56:09 +0000 (23:56 -0500)]
Update x86[-64] assembler recommendations
NASM 2.11.08 has a bug that prevents it from properly assembling a
macho64 version of libjpeg-turbo (the resulting binary generates corrupt
images.)  2.11.09 works properly.  YASM also works properly and has been
a supported alternative since libjpeg-turbo 1.2.

9 years agoUpdate URL for our custom gas-preprocessor.pl
DRC [Mon, 3 Aug 2015 18:18:43 +0000 (13:18 -0500)]
Update URL for our custom gas-preprocessor.pl

9 years agoUpdate URL for our custom gas-preprocessor.pl
DRC [Mon, 3 Aug 2015 18:16:21 +0000 (13:16 -0500)]
Update URL for our custom gas-preprocessor.pl

9 years agoFix rare bug: right shift by a negative # of bits
DRC [Tue, 21 Jul 2015 21:43:39 +0000 (16:43 -0500)]
Fix rare bug: right shift by a negative # of bits
Under very rare circumstances, decompressing specific corrupt JPEG
images would create a situation whereby GET_BITS(1) was invoked
from within HUFF_DECODE_FAST() when bits_left=0. This produced a right
shift by a negative number of bits, which is undefined in C.

9 years agoFix rare bug: right shift by a negative # of bits
DRC [Tue, 21 Jul 2015 21:43:39 +0000 (16:43 -0500)]
Fix rare bug: right shift by a negative # of bits
Under very rare circumstances, decompressing specific corrupt JPEG
images would create a situation whereby GET_BITS(1) was invoked
from within HUFF_DECODE_FAST() when bits_left=0. This produced a right
shift by a negative number of bits, which is undefined in C.

9 years agoFix rare bug: right shift by a negative # of bits
DRC [Tue, 21 Jul 2015 21:43:39 +0000 (16:43 -0500)]
Fix rare bug: right shift by a negative # of bits
Under very rare circumstances, decompressing specific corrupt JPEG
images would create a situation whereby GET_BITS(1) was invoked
from within HUFF_DECODE_FAST() when bits_left=0. This produced a right
shift by a negative number of bits, which is undefined in C.

9 years agoConvert the BUILD stamp to AC_ARG_WITH argument, so we can make the build reproducible
Ondřej Surý [Tue, 28 Jul 2015 07:19:13 +0000 (09:19 +0200)]
Convert the BUILD stamp to AC_ARG_WITH argument, so we can make the build reproducible

9 years agoConvert svn:ignore properties to .gitignore
DRC [Mon, 27 Jul 2015 08:50:34 +0000 (03:50 -0500)]
Convert svn:ignore properties to .gitignore

9 years agoConvert svn:ignore properties to .gitignore 1.1.x
DRC [Mon, 27 Jul 2015 08:50:34 +0000 (03:50 -0500)]
Convert svn:ignore properties to .gitignore

9 years agoConvert svn:ignore properties to .gitignore 1.0.x
DRC [Mon, 27 Jul 2015 08:50:34 +0000 (03:50 -0500)]
Convert svn:ignore properties to .gitignore

9 years agoConvert svn:ignore properties to .gitignore
DRC [Mon, 27 Jul 2015 08:50:34 +0000 (03:50 -0500)]
Convert svn:ignore properties to .gitignore

9 years agoConvert svn:ignore properties to .gitignore
DRC [Mon, 27 Jul 2015 08:50:34 +0000 (03:50 -0500)]
Convert svn:ignore properties to .gitignore

9 years agoMerge pull request #4 from oerdnj/master
DRC [Tue, 28 Jul 2015 17:56:16 +0000 (12:56 -0500)]
Merge pull request #4 from oerdnj/master

Allow BUILD to be specified on the configure command line

9 years agoConvert the BUILD stamp to AC_ARG_WITH argument, so we can make the build reproducible
Ondřej Surý [Tue, 28 Jul 2015 07:19:13 +0000 (09:19 +0200)]
Convert the BUILD stamp to AC_ARG_WITH argument, so we can make the build reproducible

9 years agoConvert svn:ignore properties to .gitignore
DRC [Mon, 27 Jul 2015 08:50:34 +0000 (03:50 -0500)]
Convert svn:ignore properties to .gitignore

9 years agoFurther improvements to partial image decoding
DRC [Tue, 21 Jul 2015 22:36:18 +0000 (17:36 -0500)]
Further improvements to partial image decoding
When using context-based upsampling, use a dummy color conversion
routine instead of a dummy row buffer. This improves performance
(since the actual color conversion routine no longer has to be called),
and it also fixes valgrind errors when decompressing to RGB565.
Valgrind previously complained, because using the RGB565 color
converter with the dummy row buffer was causing a table lookup with
undefined indices.

9 years agoFix rare bug: right shift by a negative # of bits
DRC [Tue, 21 Jul 2015 21:43:39 +0000 (16:43 -0500)]
Fix rare bug: right shift by a negative # of bits
Under very rare circumstances, decompressing specific corrupt JPEG
images would create a situation whereby GET_BITS(1) was invoked
from within HUFF_DECODE_FAST() when bits_left=0. This produced a right
shift by a negative number of bits, which is undefined in C.

9 years agoFurther exception cleanup
DRC [Tue, 21 Jul 2015 14:34:02 +0000 (09:34 -0500)]
Further exception cleanup
Use a new checked exception type (TJException) when passing through
errors from the underlying C library. This gives the application a
choice of catching all exceptions or just those from TurboJPEG.

Throw IllegalArgumentException at the JNI level when arguments to the
JNI function are incorrect, and when one of the TurboJPEG "utility"
functions returns an error (because, per the C API specification, those
functions will only return an error if one of their arguments is out of
range.)

Remove "throws Exception" from the signature of any methods that no
longer pass through an error from the TurboJPEG C library.

Credit Viktor for the new code

Code formatting tweaks

9 years agoFix build whenever IDCT_SCALING_SUPPORTED is undefined
DRC [Tue, 14 Jul 2015 20:51:53 +0000 (20:51 +0000)]
Fix build whenever IDCT_SCALING_SUPPORTED is undefined

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.4.x@1597 632fc199-4ca6-4c93-a231-07263d6284db

9 years agoFix build whenever IDCT_SCALING_SUPPORTED is undefined
DRC [Tue, 14 Jul 2015 20:51:20 +0000 (20:51 +0000)]
Fix build whenever IDCT_SCALING_SUPPORTED is undefined

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1596 632fc199-4ca6-4c93-a231-07263d6284db

9 years agoThrow idiomatic unchecked exceptions from the Java classes and JNI wrapper if there...
DRC [Tue, 14 Jul 2015 20:42:52 +0000 (20:42 +0000)]
Throw idiomatic unchecked exceptions from the Java classes and JNI wrapper if there is an unrecoverable error caused by incorrect API usage (such as illegal arguments, etc.), and throw Errors if there is an unrecoverable error at the C level (such as a failed malloc() call.)

Change the behavior of the bailif0() macro in the JNI wrapper so that it doesn't throw an exception for an unexpected NULL condition.  In fact, in all cases, the underlying JNI API function (such as GetFieldID(), etc.) will throw an Error on its own whenever it returns NULL, so our custom exceptions were never being thrown in that case anyhow.  All we need to do is just detect the error and bail out of the C code.

This also corrects a couple of formatting issues (semicolons aren't needed at the end of class definitions, and @Override should be specified for the methods we're overriding from super-classes, so the compiler can sanity-check that we're actually overriding a method and not declaring a new one.)

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1595 632fc199-4ca6-4c93-a231-07263d6284db

9 years agoAllow TJCompressor and TJDecompressor to be used with a try-with-resources statement...
DRC [Tue, 7 Jul 2015 16:39:03 +0000 (16:39 +0000)]
Allow TJCompressor and TJDecompressor to be used with a try-with-resources statement in Java 7 and later.

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1594 632fc199-4ca6-4c93-a231-07263d6284db

9 years agoAdd additional protections against defining INT32 if another header has already defin...
DRC [Mon, 6 Jul 2015 16:04:04 +0000 (16:04 +0000)]
Add additional protections against defining INT32 if another header has already defined it (code borrowed from libjpeg v8.)  This isn't necessary when using the libjpeg-turbo build system on Windows, because the CMake generated jconfig.h defines INT32 and then defines XMD_H to trick jmorecfg.h into not redefining it.  However, some projects build libjpeg-turbo using their own build systems.

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.4.x@1593 632fc199-4ca6-4c93-a231-07263d6284db

9 years agoThe Independent JPEG Group's JPEG software v8d jpeg-8d
Guido Vollbeding [Sun, 15 Jan 2012 00:00:00 +0000 (00:00 +0000)]
The Independent JPEG Group's JPEG software v8d

9 years agoThe Independent JPEG Group's JPEG software v8c jpeg-8c
Guido Vollbeding [Sun, 16 Jan 2011 00:00:00 +0000 (00:00 +0000)]
The Independent JPEG Group's JPEG software v8c

9 years agoThe Independent JPEG Group's JPEG software v8b jpeg-8b
Guido Vollbeding [Sun, 16 May 2010 00:00:00 +0000 (00:00 +0000)]
The Independent JPEG Group's JPEG software v8b

9 years agoThe Independent JPEG Group's JPEG software v8a jpeg-8a
Guido Vollbeding [Sun, 28 Feb 2010 00:00:00 +0000 (00:00 +0000)]
The Independent JPEG Group's JPEG software v8a

9 years agoThe Independent JPEG Group's JPEG software v8 jpeg-8
Guido Vollbeding [Sun, 10 Jan 2010 00:00:00 +0000 (00:00 +0000)]
The Independent JPEG Group's JPEG software v8

9 years agoThe Independent JPEG Group's JPEG software v7 jpeg-7
Guido Vollbeding [Sat, 27 Jun 2009 00:00:00 +0000 (00:00 +0000)]
The Independent JPEG Group's JPEG software v7

9 years agoThe Independent JPEG Group's JPEG software v6b with arithmetic coding support jpeg-ari
Guido Vollbeding [Sat, 28 Mar 1998 00:00:00 +0000 (00:00 +0000)]
The Independent JPEG Group's JPEG software v6b with arithmetic coding support

9 years agoThe Independent JPEG Group's JPEG software v6b jpeg-6b
Thomas G. Lane [Fri, 27 Mar 1998 00:00:00 +0000 (00:00 +0000)]
The Independent JPEG Group's JPEG software v6b

9 years agoThe Independent JPEG Group's JPEG software v6a jpeg-6a
Thomas G. Lane [Wed, 7 Feb 1996 00:00:00 +0000 (00:00 +0000)]
The Independent JPEG Group's JPEG software v6a

9 years agoThe Independent JPEG Group's JPEG software v6 jpeg-6
Thomas G. Lane [Wed, 2 Aug 1995 00:00:00 +0000 (00:00 +0000)]
The Independent JPEG Group's JPEG software v6

9 years agoThe Independent JPEG Group's JPEG software v5b jpeg-5b
Thomas G. Lane [Wed, 15 Mar 1995 00:00:00 +0000 (00:00 +0000)]
The Independent JPEG Group's JPEG software v5b

9 years agoThe Independent JPEG Group's JPEG software v5a jpeg-5a
Thomas G. Lane [Wed, 7 Dec 1994 00:00:00 +0000 (00:00 +0000)]
The Independent JPEG Group's JPEG software v5a

9 years agoThe Independent JPEG Group's JPEG software v5 jpeg-5
Thomas G. Lane [Sat, 24 Sep 1994 00:00:00 +0000 (00:00 +0000)]
The Independent JPEG Group's JPEG software v5

9 years agoThe Independent JPEG Group's JPEG software v4a jpeg-4a
Thomas G. Lane [Thu, 18 Feb 1993 00:00:00 +0000 (00:00 +0000)]
The Independent JPEG Group's JPEG software v4a

9 years agoThe Independent JPEG Group's JPEG software v4 jpeg-4
Thomas G. Lane [Thu, 10 Dec 1992 00:00:00 +0000 (00:00 +0000)]
The Independent JPEG Group's JPEG software v4

9 years agoThe Independent JPEG Group's JPEG software v3 jpeg-3
Thomas G. Lane [Tue, 17 Mar 1992 00:00:00 +0000 (00:00 +0000)]
The Independent JPEG Group's JPEG software v3

9 years agoThe Independent JPEG Group's JPEG software v2 jpeg-2
Thomas G. Lane [Fri, 13 Dec 1991 00:00:00 +0000 (00:00 +0000)]
The Independent JPEG Group's JPEG software v2

9 years agoThe Independent JPEG Group's JPEG software v1 jpeg-1
Thomas G. Lane [Mon, 7 Oct 1991 00:00:00 +0000 (00:00 +0000)]
The Independent JPEG Group's JPEG software v1

9 years agoAdd additional protections against defining INT32 if another header has already defin...
DRC [Mon, 6 Jul 2015 16:02:57 +0000 (16:02 +0000)]
Add additional protections against defining INT32 if another header has already defined it (code borrowed from libjpeg v8.)  This isn't necessary when using the libjpeg-turbo build system on Windows, because the CMake generated jconfig.h defines INT32 and then defines XMD_H to trick jmorecfg.h into not redefining it.  However, some projects build libjpeg-turbo using their own build systems.

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1592 632fc199-4ca6-4c93-a231-07263d6284db

9 years agoFix a memory leak in jpeg_skip_scanlines()
DRC [Wed, 1 Jul 2015 16:56:44 +0000 (16:56 +0000)]
Fix a memory leak in jpeg_skip_scanlines()

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1591 632fc199-4ca6-4c93-a231-07263d6284db

9 years agoIncrement SO_AGE to reflect the addition of a new interface to the libjpeg API
DRC [Sat, 27 Jun 2015 08:10:34 +0000 (08:10 +0000)]
Increment SO_AGE to reflect the addition of a new interface to the libjpeg API

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1590 632fc199-4ca6-4c93-a231-07263d6284db

9 years agoAdd jpeg_skip_scanlines() to the Windows DLL export list.
DRC [Sat, 27 Jun 2015 08:10:33 +0000 (08:10 +0000)]
Add jpeg_skip_scanlines() to the Windows DLL export list.

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1589 632fc199-4ca6-4c93-a231-07263d6284db

9 years agoFix compiler warnings in jpeg_skip_scanlines() when building under Visual Studio.
DRC [Sat, 27 Jun 2015 08:10:32 +0000 (08:10 +0000)]
Fix compiler warnings in jpeg_skip_scanlines() when building under Visual Studio.

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1588 632fc199-4ca6-4c93-a231-07263d6284db

9 years agoAdd regression tests for jpeg_skip_scanlines(); change "stripe" to "strip" in djpeg...
DRC [Sat, 27 Jun 2015 08:10:31 +0000 (08:10 +0000)]
Add regression tests for jpeg_skip_scanlines(); change "stripe" to "strip" in djpeg; document -strip and -skip parameters in djpeg

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1587 632fc199-4ca6-4c93-a231-07263d6284db