]> granicus.if.org Git - libjpeg-turbo/log
libjpeg-turbo
4 years agoj*huff.c: Remove crufty ASSIGN_STATE() macro dev
DRC [Thu, 17 Oct 2019 01:11:59 +0000 (20:11 -0500)]
j*huff.c: Remove crufty ASSIGN_STATE() macro

This macro is a relic of libjpeg's historic need to support a wide
variety of C compilers with varying degrees of compatibility.  Such was
necessary during the open systems era, because C compilers were often
supplied by the system vendor.  Prior to 1989, there was no C standard
per se, and even after ANSI C became a thing, there were still compilers
in use that didn't conform to it (libjpeg was first released in 1991.)

Realistically, only a handful of C compilers are in widespread use these
days, and all modern C compilers should support structure assignment.

4 years agoMerge branch 'master' into dev
DRC [Thu, 24 Oct 2019 07:13:23 +0000 (02:13 -0500)]
Merge branch 'master' into dev

4 years agoAppVeyor: Use MinGW-builds instead of MSYS2 MinGW master
DRC [Thu, 24 Oct 2019 06:50:35 +0000 (01:50 -0500)]
AppVeyor: Use MinGW-builds instead of MSYS2 MinGW

... to avoid backward compatibility issues with GCC 4-6 MinGW
toolchains.  Apparently GCC 7+ MinGW toolchains introduce a link-time
dependency with internal MinGW CRT functions that are meant to provide
compatibility with Microsoft's Universal CRT (ucrt) library, but those
internal functions are not available in GCC 4-6 MinGW toolchains.  This
made it impossible to use the official builds of libjpeg.a and
libturbojpeg.a with GCC 4-6 MinGW toolchains (a fatal link error--
"undefined reference to '__imp___acrt_iob_func'"-- occurred.)

This problem was not immediately apparent after switching to the MSYS2
implementation of MinGW (d6d7b539682abb50b04207abd21726573c0fb845)
because, for a while, MSYS2 was still using GCC 5 and 6.

Refer to libjpeg-turbo/libjpeg-turbo#382

4 years agoWin packaging: Fix 64-bit VC/GCC co-install issue
DRC [Wed, 23 Oct 2019 01:08:57 +0000 (20:08 -0500)]
Win packaging: Fix 64-bit VC/GCC co-install issue

4 years agoBump version to 2.0.4 to prepare for new commits
DRC [Wed, 23 Oct 2019 00:39:38 +0000 (19:39 -0500)]
Bump version to 2.0.4 to prepare for new commits

4 years agox86 SIMD: Consistify capitalization of NASM types
DRC [Fri, 18 Oct 2019 00:59:01 +0000 (19:59 -0500)]
x86 SIMD: Consistify capitalization of NASM types

byte, word, dword, qword, oword, and yword are all assembler keywords,
so it makes sense to use lowercase for these so as not to mistake them
for macros or constants.

4 years agox86 SIMD: Remove obsolete [TAB8] comments
DRC [Thu, 17 Oct 2019 16:21:32 +0000 (11:21 -0500)]
x86 SIMD: Remove obsolete [TAB8] comments

With apologies to Richard Hendricks, our assembly code no longer uses
tabs.

4 years agojc*huff.c: Consistify preproc directive formatting
DRC [Thu, 17 Oct 2019 02:16:43 +0000 (21:16 -0500)]
jc*huff.c: Consistify preproc directive formatting

The rest of the libjpeg API code uses "#if defined(condition)" rather
than "#if defined condition".

4 years agoRemove support for Apple's Java implementation
DRC [Fri, 4 Oct 2019 21:05:11 +0000 (16:05 -0500)]
Remove support for Apple's Java implementation

(AKA "Java for OS X systems.")  This implementation of Java 1.6 is long
obsolete and not supported on any version of macOS past High Sierra.
Oracle no longer provides a 32-bit JVM on macOS, so it is no longer
necessary to provide a 32-bit version of the TurboJPEG Java wrapper on
macOS.

4 years agoMerge branch 'master' into dev
DRC [Fri, 4 Oct 2019 20:53:30 +0000 (15:53 -0500)]
Merge branch 'master' into dev

4 years agoTravis: Fix macOS build
DRC [Fri, 4 Oct 2019 20:02:18 +0000 (15:02 -0500)]
Travis: Fix macOS build

Java 6 has moved to homebrew/cask-versions.

4 years agoBUILDING.md: Document need for CRB/PowerTools repo
DRC [Wed, 2 Oct 2019 21:35:17 +0000 (16:35 -0500)]
BUILDING.md: Document need for CRB/PowerTools repo

NASM and YASM are located in this non-default repository on
(respectively) RHEL and CentOS.

4 years agoMerge branch 'master' into dev
DRC [Wed, 4 Sep 2019 23:58:12 +0000 (18:58 -0500)]
Merge branch 'master' into dev

4 years agoREADME.md: Document memory debugger pitfalls 2.0.3
DRC [Fri, 30 Aug 2019 17:02:50 +0000 (12:02 -0500)]
README.md: Document memory debugger pitfalls

(more specifically, the need to disable libjpeg-turbo's SIMD extensions
when testing with valgrind, MSan, etc.)

Addresses a concern expressed in #365

4 years agoREADME.md: Remove vestigial autotools references
DRC [Fri, 30 Aug 2019 16:15:47 +0000 (11:15 -0500)]
README.md: Remove vestigial autotools references

4 years agotjDecodeYUV*: Fix err if TJ inst used for prog dec
DRC [Thu, 15 Aug 2019 18:24:25 +0000 (13:24 -0500)]
tjDecodeYUV*: Fix err if TJ inst used for prog dec

If the TurboJPEG instance passed to tjDecodeYUV[Planes]() was previously
used to decompress a progressive JPEG image, then we need to disable the
progressive decompression parameters in the underlying libjpeg instance
before calling jinit_master_decompress().

This commit also modifies the build system so that the "tjtest" target
will test for this issue, and it corrects a previous oversight in the
build system whereby tjbenchtest did not test progressive
compression/decompression unless WITH_JAVA was true.

4 years agoMerge branch 'master' into dev
DRC [Thu, 15 Aug 2019 03:08:59 +0000 (22:08 -0500)]
Merge branch 'master' into dev

4 years agoChangeLog.md: Wordsmithing
DRC [Thu, 15 Aug 2019 03:08:44 +0000 (22:08 -0500)]
ChangeLog.md: Wordsmithing

4 years agoSSE2 SIMD: Fix prog Huffman enc. error if Sl%16==0
DRC [Wed, 14 Aug 2019 18:17:11 +0000 (13:17 -0500)]
SSE2 SIMD: Fix prog Huffman enc. error if Sl%16==0

(regression introduced by 5b177b3cab5cfb661256c1e74df160158ec6c34e)

The SSE2 implementation of progressive Huffman encoding performed
extraneous iterations when the scan length was a multiple of 16.

Based on:
https://github.com/rouault/libjpeg-turbo/commit/bb7f1ef98305da915e581b59bd0ec2ef7bdb8468

Fixes #335
Closes #367

4 years agoTravis: Enable additional sanitizer tests
DRC [Tue, 13 Aug 2019 21:03:48 +0000 (16:03 -0500)]
Travis: Enable additional sanitizer tests

- Re-purpose the non-SIMD test to test with MSan as well.
- Re-purpose the ASan test to test with UBSan as well.
- Use the default Travis build environment rather than specifying Ubuntu
  14.04.  I think I added 'dist: trusty' back when 14.04 was newer than
  the default, but now it's older than the default.
- Enable verbose output for any unit tests that fail (so we can see the
  sanitizer output.)

4 years agoMerge branch 'master' into dev
DRC [Thu, 18 Jul 2019 20:18:27 +0000 (15:18 -0500)]
Merge branch 'master' into dev

4 years agoTravis: Cache Homebrew downloads
DRC [Thu, 18 Jul 2019 19:25:25 +0000 (14:25 -0500)]
Travis: Cache Homebrew downloads

... to speed up the Mac CI builds.

4 years agoTravis: Update Homebrew/fix Mac CI build
DRC [Thu, 18 Jul 2019 19:14:47 +0000 (14:14 -0500)]
Travis: Update Homebrew/fix Mac CI build

Updating Homebrew wasn't necessary when the CI build first started using
the xcode8.3 image (see c8e52741fdb623698a27a4c55cf63db93c95aa14), but
apparently it now is.

4 years agoTJBench.java: Remove space in method invocation
DRC [Fri, 12 Jul 2019 22:28:55 +0000 (17:28 -0500)]
TJBench.java: Remove space in method invocation

(to make checkstyle happy)

4 years agotjbench.c: Fix minor code formatting errors
DRC [Fri, 12 Jul 2019 22:27:37 +0000 (17:27 -0500)]
tjbench.c: Fix minor code formatting errors

(introduced by 2a9e3bd7430cfda1bc812d139e0609c6aca0b884)

4 years agotjutil.c: Fix compiler warning with Visual Studio
DRC [Thu, 11 Jul 2019 22:05:15 +0000 (17:05 -0500)]
tjutil.c: Fix compiler warning with Visual Studio

Apparently windows.h includes stdlib.h, which defines the max() and
min() macros, so we need to ensure that tjutil.h is included after
that.

4 years agoTurboJPEG: Properly handle gigapixel images
DRC [Thu, 11 Jul 2019 20:30:04 +0000 (15:30 -0500)]
TurboJPEG: Properly handle gigapixel images

Prevent several integer overflow issues and subsequent segfaults that
occurred when attempting to compress or decompress gigapixel images with
the TurboJPEG API:

- Modify tjBufSize(), tjBufSizeYUV2(), and tjPlaneSizeYUV() to avoid
  integer overflow when computing the return values and to return an
  error if such an overflow is unavoidable.
- Modify tjunittest to validate the above.
- Modify tjCompress2(), tjEncodeYUVPlanes(), tjDecompress2(), and
  tjDecodeYUVPlanes() to avoid integer overflow when computing the row
  pointers in the 64-bit TurboJPEG C API.
- Modify TJBench (both C and Java versions) to avoid overflowing the
  size argument to malloc()/new and to fail gracefully if such an
  overflow is unavoidable.

In general, this allows gigapixel images to be accommodated by the
64-bit TurboJPEG C API when using automatic JPEG buffer (re)allocation.
Such images cannot currently be accommodated without automatic JPEG
buffer (re)allocation, due to the fact that tjAlloc() accepts a 32-bit
integer argument (oops.)  Such images cannot be accommodated in the
TurboJPEG Java API due to the fact that Java always uses a signed 32-bit
integer as an array index.

Fixes #361

4 years agoBuild: Fix build/install with Xcode IDE
DRC [Tue, 2 Jul 2019 16:28:26 +0000 (11:28 -0500)]
Build: Fix build/install with Xcode IDE

Closes #355

4 years agoUse bias pattern for 4:4:0 (h1v2) fancy upsampling
Jonathan Wright [Thu, 9 May 2019 12:46:53 +0000 (13:46 +0100)]
Use bias pattern for 4:4:0 (h1v2) fancy upsampling

This commit modifies h1v2_fancy_upsample() so that it uses an ordered
dither pattern, similar to that of h2v1_fancy_upsample(), rounding up or
down the result for alternate pixels rather than always rounding down.
This ensures that the decompression error pattern for a 4:4:0 JPEG image
will be similar to the rotated decompression error pattern for a 4:2:2
JPEG image.  Thus, the final result will be similar regardless of
whether a 4:2:2 JPEG image is rotated or transposed before or after
decompression.

Closes #356

5 years agoBuild/packaging: Support macOS package/DMG signing
DRC [Sat, 18 May 2019 22:58:50 +0000 (17:58 -0500)]
Build/packaging: Support macOS package/DMG signing

5 years agoTravis: Fix iOS build
DRC [Fri, 10 May 2019 01:46:18 +0000 (20:46 -0500)]
Travis: Fix iOS build

The new libjpeg-turbo 2.1.x official build scripts expect Xcode to be
under /Applications/Xcode83.app.

5 years agoDiscontinue support for 32-bit iOS builds
DRC [Fri, 10 May 2019 01:36:51 +0000 (20:36 -0500)]
Discontinue support for 32-bit iOS builds

5 years agoMerge branch 'master' into dev
DRC [Fri, 10 May 2019 00:13:39 +0000 (19:13 -0500)]
Merge branch 'master' into dev

5 years agoTravis: Use xcode8.3 image
DRC [Thu, 9 May 2019 14:11:09 +0000 (09:11 -0500)]
Travis: Use xcode8.3 image

xcode7.3 is based on El Capitan, which is EOL, and Homebrew no longer
provides El Cap bottles (pre-compiled binaries.)  Thus, Homebrew was
trying to build GCC 5, YASM, and the other packages we need from source,
which caused the Mac CI builds to time out.  I tried goading Homebrew
into installing GCC 5.5.0_2 and YASM 1.3.0_1, which still have El Cap
bottles available, by using the URLs of those specific versions of the
formulae (from the Homebrew GitHub repository) as package names.  This
failed, however, because 'brew bundle' converted the URLs to all
lowercase.  I then tried explicitly installing the old formulae by using
'brew install' with the aforementioned URLs (bypassing the Travis
Homebrew addon), but Homebrew still tried to build all of the
dependencies from source.

Upgrading to Xcode 8.3.x necessitated regression testing the performance
on iOS, but that proved less of a pain than figuring out how to install
all of the old Homebrew bottles we needed.  Also, this future-proofs the
CI builds against the inevitable discontinuation of the xcode7.3 image.

Note that Xcode 8.3.x improves iOS 64-bit decompression performance
significantly relative to Xcode 7.2.x or 7.3.x.  iOS 32-bit performance
unfortunately regresses by as much as 5%, but it can't be helped (32-bit
iOS apps are no longer supported on iOS 11+ anyhow, and the next major
release of libjpeg-turbo will remove support for them as well.)

5 years agoMerge branch 'master' into dev
DRC [Tue, 23 Apr 2019 19:54:23 +0000 (14:54 -0500)]
Merge branch 'master' into dev

5 years agoFix code formatting/style issues ...
DRC [Tue, 23 Apr 2019 19:10:04 +0000 (14:10 -0500)]
Fix code formatting/style issues ...

... including, but not limited to:
- unused macros
- private functions not marked as static
- unprototyped global functions
- variable shadowing

(detected by various non-default GCC 8 warning options)

5 years agox86 SIMD: Check for CPUID leaf 07H before using
Chris Blume [Tue, 16 Apr 2019 00:55:47 +0000 (17:55 -0700)]
x86 SIMD: Check for CPUID leaf 07H before using

According to Intel's manual [1], "If a value entered for CPUID.EAX is
higher than the maximum input value for basic or extended function for
that processor then the data for the highest basic information leaf is
returned."

Right now, libjpeg-turbo doesn't first check that leaf 07H is supported
before attempting to use it, so the ostensible AVX2 bit (Bit 05) of the
CPUID result might actually be Bit 05 from a lower leaf.  That bit might
be set, even if the CPU doesn't support AVX2.

This commit modifies the x86 and x86-64 SIMD feature detection code so
that it first checks whether CPUID leaf 07H is supported before
attempting to use it to check for AVX2 instruction support.

DRC:
This commit should fix
https://bugzilla.mozilla.org/show_bug.cgi?id=1520760
However, I have not personally been able to reproduce that issue,
despite using a Nehalem (pre-AVX2) CPU on which the maximum CPUID leaf
has been limited via a BIOS setting.

Closes #348

[1]
"IntelĀ® 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (2A, 2B, 2C & 2D): Instruction Set Reference, A-Z", https://software.intel.com/sites/default/files/managed/a4/60/325383-sdm-vol-2abcd.pdf, page 3-192.

5 years agoMerge branch 'master' into dev
DRC [Mon, 15 Apr 2019 18:41:45 +0000 (13:41 -0500)]
Merge branch 'master' into dev

5 years agoChangeLog.md: Document 33011754
DRC [Mon, 15 Apr 2019 18:38:15 +0000 (13:38 -0500)]
ChangeLog.md: Document 33011754

5 years agojdhuff.c: Silence UBSan signed int overflow err #2
DRC [Fri, 12 Apr 2019 14:07:35 +0000 (09:07 -0500)]
jdhuff.c: Silence UBSan signed int overflow err #2

Same as d3a3a73f64041c6a6905faf6f9f9832e735fd880 but in the fast decode
path.  It was necessary to use a different-sized test image in order to
trigger the error in this location.

Refer to #347

5 years agoGitHub: Remove new lines from feature-request.md
DRC [Fri, 12 Apr 2019 13:53:45 +0000 (08:53 -0500)]
GitHub: Remove new lines from feature-request.md

(to make checkstyle happy)

5 years agoAndroid: Fix "using JNI after critical get" errors
DRC [Fri, 12 Apr 2019 13:47:28 +0000 (08:47 -0500)]
Android: Fix "using JNI after critical get" errors

5ea77d8b771bf7b0be7acc7fb70c255f8c9c8f77 was insufficient to fix all of
these.  In particular, we need to always release the primitive arrays
before throwing an exception, because throwing an exception qualifies as
"using JNI."

Refer to #300

5 years agoConsistify formatting of macros in TurboJPEG code
DRC [Fri, 12 Apr 2019 12:49:35 +0000 (07:49 -0500)]
Consistify formatting of macros in TurboJPEG code

5 years agoGitHub: Template tweaks
DRC [Wed, 10 Apr 2019 20:16:55 +0000 (15:16 -0500)]
GitHub: Template tweaks

CONTRIBUTING.md: Correct misuse of "as such" (Grammar Police)

bug-report.md: Clarify that the submitter should always test against the
latest stable code base.

5 years agojdhuff.c: Silence UBSan signed int overflow error
DRC [Wed, 10 Apr 2019 19:28:47 +0000 (14:28 -0500)]
jdhuff.c: Silence UBSan signed int overflow error

Some pathological test images have been created that can cause s to
overflow or underflow the signed int data type during decompression.
This is technically undefined behavior according to the C spec, although
every modern implementation I'm aware of will treat the signed int as a
2's complement unsigned int, thus causing the value to wrap around to
INT_MIN if it exceeds INT_MAX.  This commit simply makes that behavior
explicit in order to shut up UBSan.  At least when building for x86-64
or i386 using Clang or GCC, this commit does not change the
compiler-generated assembly code at all.

The code that triggered this error has existed in the libjpeg code base
for at least 20 years (and probably much longer), so the fact that it
hasn't produced a user-visible problem in all of that time strongly
suggests that UBSan is being overly pedantic here.  But if someone can
cough up a platform that doesn't wrap around to INT_MIN when 1 is added
to INT_MAX, then I'll happily change my opinion.

Fixes #347

5 years agoBump version to 2.0.3 to prepare for new commits
DRC [Wed, 10 Apr 2019 19:35:45 +0000 (14:35 -0500)]
Bump version to 2.0.3 to prepare for new commits

5 years agoGitHub: Formatting tweak to CONTRIBUTING.md
DRC [Tue, 5 Mar 2019 23:48:20 +0000 (17:48 -0600)]
GitHub: Formatting tweak to CONTRIBUTING.md

5 years agoGitHub: Tweak bug report template
DRC [Fri, 1 Mar 2019 19:13:27 +0000 (13:13 -0600)]
GitHub: Tweak bug report template

5 years agoGitHub: Add feature request template
DRC [Fri, 1 Mar 2019 19:11:11 +0000 (13:11 -0600)]
GitHub: Add feature request template

5 years agoGitHub: Add contributor guidelines
DRC [Fri, 1 Mar 2019 18:29:41 +0000 (12:29 -0600)]
GitHub: Add contributor guidelines

5 years agoGitHub: Add bug report template
DRC [Fri, 1 Mar 2019 16:07:51 +0000 (10:07 -0600)]
GitHub: Add bug report template

5 years agoMMI: Support 32-bit Loongson architectures
DRC [Wed, 27 Feb 2019 19:05:58 +0000 (13:05 -0600)]
MMI: Support 32-bit Loongson architectures

5 years agoMMI: Fix bug in jsimd_h2v1_merged_upsample_mmi()
DRC [Wed, 27 Feb 2019 19:17:35 +0000 (13:17 -0600)]
MMI: Fix bug in jsimd_h2v1_merged_upsample_mmi()

... that occurred when ((image width) & 1) != 0.

5 years agoMerge branch 'master' into dev
DRC [Sun, 17 Feb 2019 15:33:57 +0000 (09:33 -0600)]
Merge branch 'master' into dev

5 years agoturbojpeg.c: Fix compiler warning w/ -DNO_GETENV
DRC [Sun, 17 Feb 2019 15:06:42 +0000 (09:06 -0600)]
turbojpeg.c: Fix compiler warning w/ -DNO_GETENV

5 years agoappveyor.yml: Cache NASM binary package
DRC [Thu, 14 Feb 2019 16:01:16 +0000 (10:01 -0600)]
appveyor.yml: Cache NASM binary package

... since www.nasm.us seems to be down frequently.  This doesn't help us
at the moment, but hopefully once the site is back up this will prevent
future build failures.

5 years agoARMv7 NEON: #ifdef unused funcs/vars w/ -mfpu=neon
Chris Blume [Wed, 13 Feb 2019 01:35:10 +0000 (17:35 -0800)]
ARMv7 NEON: #ifdef unused funcs/vars w/ -mfpu=neon

When simd/arm/jsimd.c is compiled with __ARM_NEON__ defined (which will
be the case if -mfpu=neon is passed to the compiler), the
parse_proc_cpuinfo() and check_feature() functions and the bufsize
variable are unused and thus need to be #ifdef'ed out in order to avoid
compiler warnings.  Note that the bufsize variable was already #ifdef'ed
out on Linux but not on Android due to lack of parentheses (&& takes
precedence over ||.)

Closes #331

5 years agoChangeLog.md: "floating-point"="floating point" 2.0.2
DRC [Thu, 14 Feb 2019 04:03:31 +0000 (22:03 -0600)]
ChangeLog.md: "floating-point"="floating point"

5 years agoMerge branch 'master' into dev
DRC [Wed, 13 Feb 2019 23:05:26 +0000 (17:05 -0600)]
Merge branch 'master' into dev

5 years agorpm.spec.in: Fix "File listed twice" warning/error
DRC [Wed, 13 Feb 2019 22:22:18 +0000 (16:22 -0600)]
rpm.spec.in: Fix "File listed twice" warning/error

%{_libdir}/pkgconfig is a directory and should thus be prefixed by
%{dir} (oops.)  This issue caused the debuginfo build under RHEL 8
(which is apparently now enabled by default-- regardless of whether the
RPM actually contains debug info, but that's another matter) to fail
with:

RPM build errors:
  File listed twice: /opt/libjpeg-turbo/lib64/pkgconfig/libjpeg.pc
  File listed twice: /opt/libjpeg-turbo/lib64/pkgconfig/libturbojpeg.pc

5 years agorpm.spec.in: Fix doc packaging issues w/ RHEL 7+
DRC [Wed, 13 Feb 2019 21:20:34 +0000 (15:20 -0600)]
rpm.spec.in: Fix doc packaging issues w/ RHEL 7+

On RHEL 7 and later (not sure exactly whether this is a product of the
newer RPM release or something distro-specific), macros are lazily
expanded, so we need to set _docdir using %global (which expands at
definition time) and prior to _prefix and _datarootdir (which affect
_defaultdocdir.)  Otherwise, _docdir is set to a subdirectory of
/opt/libjpeg-turbo/share/doc or /opt/libjpeg-turbo/doc.  The former
(which happens on RHEL 7) leads to incorrect documentation packaging
(the docs should be packaged under /usr/share/doc per Red Hat
standards), and the latter (which happens on RHEL 8) leads to an RPM
build error.

5 years agorpm.spec.in: Update deprecated [Build]Prereq tags
DRC [Tue, 12 Feb 2019 21:37:21 +0000 (15:37 -0600)]
rpm.spec.in: Update deprecated [Build]Prereq tags

AFAICT, Requires and BuildRequires subsumed the functionality of Prereq
and BuildPrereq in RPM 4.0, and none of the platforms we support with
libjpeg-turbo 2.0.x has RPM < 4.4.

5 years agoMerge branch 'master' into dev
DRC [Tue, 12 Feb 2019 19:42:57 +0000 (13:42 -0600)]
Merge branch 'master' into dev

5 years agoGNUInstallDirs.cmake: Silence CMP0054 warning ...
DRC [Tue, 12 Feb 2019 19:30:15 +0000 (13:30 -0600)]
GNUInstallDirs.cmake: Silence CMP0054 warning ...

in CMake 3.11 and later

5 years agotjbench.c: Fix GCC 8 compiler warning
DRC [Tue, 12 Feb 2019 04:43:15 +0000 (22:43 -0600)]
tjbench.c: Fix GCC 8 compiler warning

5 years agoBuild: Optionally install PDB files for MSVC DLLs
DRC [Mon, 11 Feb 2019 19:10:09 +0000 (13:10 -0600)]
Build: Optionally install PDB files for MSVC DLLs

Based on
https://github.com/Youw/libjpeg-turbo/commit/333a36ae984a52e547ddeb23848873d3cc798047

Closes #329
Closes #324

5 years agoMMI: Fix unaligned decomp. perf. for 32-bit PFs
DRC [Fri, 1 Feb 2019 07:16:13 +0000 (01:16 -0600)]
MMI: Fix unaligned decomp. perf. for 32-bit PFs

(Oversight from db84125fcb05bbc48430b53d45b89392a8f3609e)

5 years agoMMI: Use unaligned stores w/ merged upsampling
DRC [Fri, 1 Feb 2019 06:42:09 +0000 (00:42 -0600)]
MMI: Use unaligned stores w/ merged upsampling

... when necessary.  This was an oversight from
2f9e7c84d1a95c1bae8bb8d38fbc2adaeecf4d41

5 years agoMerge branch 'master' into dev
DRC [Fri, 1 Feb 2019 07:01:38 +0000 (01:01 -0600)]
Merge branch 'master' into dev

5 years agoMMI: Fix unaligned comp. perf. for 32-bit PFs also
DRC [Fri, 1 Feb 2019 06:56:02 +0000 (00:56 -0600)]
MMI: Fix unaligned comp. perf. for 32-bit PFs also

(Oversight from 1c2d3cfaaf7324d9091ba3cc4e900f60a16fe1aa)

5 years agoMMI: Fix formatting issue detected by checkstyle
DRC [Fri, 1 Feb 2019 06:24:09 +0000 (00:24 -0600)]
MMI: Fix formatting issue detected by checkstyle

5 years agoLoongson MMI h2v1 and h2v2 merged upsampling
DRC [Fri, 1 Feb 2019 03:24:13 +0000 (21:24 -0600)]
Loongson MMI h2v1 and h2v2 merged upsampling

Based on:
https://github.com/zhanglixia-hf/libjpeg-turbo/commit/e8f5cee5aa83e2d1b0af3a7bd0aaa2391c930fb2

5 years agoLoongson MMI h2v1 fancy upsampling
DRC [Thu, 31 Jan 2019 22:22:31 +0000 (16:22 -0600)]
Loongson MMI h2v1 fancy upsampling

Based on:
https://github.com/zhanglixia-hf/libjpeg-turbo/commit/e8f5cee5aa83e2d1b0af3a7bd0aaa2391c930fb2

5 years agoLoongson MMI RGB-to-Grayscale conversion
DRC [Thu, 31 Jan 2019 19:54:46 +0000 (13:54 -0600)]
Loongson MMI RGB-to-Grayscale conversion

Based on:
https://github.com/zhanglixia-hf/libjpeg-turbo/commit/e8f5cee5aa83e2d1b0af3a7bd0aaa2391c930fb2

5 years agoImprove readability of Loongson MMI code
DRC [Thu, 31 Jan 2019 04:41:57 +0000 (22:41 -0600)]
Improve readability of Loongson MMI code

We have more than eight registers to work with, as well as three-operand
intrinsics, so there's no need for the implementation to be such a
literal port of the MMX code.

5 years agoMMI: Use aligned store instructions when possible
DRC [Wed, 30 Jan 2019 20:12:06 +0000 (14:12 -0600)]
MMI: Use aligned store instructions when possible

This improves decompression performance by 2-5%.

5 years agoLoongson MMI fast forward/inverse DCT
DRC [Wed, 30 Jan 2019 01:51:08 +0000 (19:51 -0600)]
Loongson MMI fast forward/inverse DCT

Based on:
https://github.com/zhanglixia-hf/libjpeg-turbo/commit/32a9ca222d7e4c8e01bb75cd137f204a0587b383

5 years agoMerge branch 'master' into dev
DRC [Thu, 31 Jan 2019 21:30:25 +0000 (15:30 -0600)]
Merge branch 'master' into dev

5 years agoMMI: Fix comp. perf. issue w/ unaligned image rows
DRC [Wed, 30 Jan 2019 18:43:45 +0000 (12:43 -0600)]
MMI: Fix comp. perf. issue w/ unaligned image rows

Using ldc1 with a non-64-bit-aligned memory location causes as much as a
10x slow-down in overall compression performance.

5 years agoBuild: Fix install of static build w/ VStudio IDE
DRC [Fri, 25 Jan 2019 22:46:02 +0000 (16:46 -0600)]
Build: Fix install of static build w/ VStudio IDE

Unfortunately, this hack is necessary because:
- install(TARGETS, ...) doesn't support the RENAME option.
- We can't modify OUTPUT_NAME for the "-static" targets without breaking
  the regression tests.
- ${CMAKE_CFG_INTDIR} doesn't seem to work properly in an install()
  command.

Refer to #307

5 years agowrbmp.c, wrtarga.c: Remove unused variables
DRC [Wed, 23 Jan 2019 22:18:41 +0000 (16:18 -0600)]
wrbmp.c, wrtarga.c: Remove unused variables

(should have been done with the previous commit)

5 years agoEliminate support for compilers w/o unsigned char
DRC [Wed, 23 Jan 2019 20:58:24 +0000 (14:58 -0600)]
Eliminate support for compilers w/o unsigned char

libjpeg-turbo has never really supported such compilers, since (AFAIK)
they are non-existent on any modern computing platform and thus
impossible for us to test.  (Also, the TurboJPEG API would break without
unsigned chars.)

Furthermore, the unified CMake-based build system introduced in 2.0
always defines HAVE_UNSIGNED_CHAR, so retaining other code paths is
pointless.  Eliminating support for compilers without unsigned char
eliminates the need for the GETJSAMPLE() macro, which improves the
readability of many parts of the code as well as improving the
performance of writing Targa and Windows BMP files.

Fixes #317

5 years agoMerge branch 'master' into dev
DRC [Wed, 23 Jan 2019 17:20:11 +0000 (11:20 -0600)]
Merge branch 'master' into dev

5 years agoLICENSE.md: Clarifications RE: BSD & zlib licenses
DRC [Wed, 23 Jan 2019 14:27:45 +0000 (08:27 -0600)]
LICENSE.md: Clarifications RE: BSD & zlib licenses

Including the license templates was confusing to some, since it made
it appear as if the copyright year and author were unspecified for the
libjpeg-turbo source.  Thus, rather than include the zlib License
template, link to that template on opensource.org.  For the Modified BSD
License, include a roll-up of copyright years and authors, since the
terms of that license require the text of it to be included in product
documentation for binary distributions without accompanying source code.

5 years agoBUILDING.md: Update/simplify Android build instr.
DRC [Tue, 22 Jan 2019 18:11:03 +0000 (12:11 -0600)]
BUILDING.md: Update/simplify Android build instr.

Use the android.toolchain.cmake toolchain file in the NDK (v13b or
later), since this toolchain file generally takes care of setting the
approprate compiler flags and dealing with the differences between
GCC and Clang.  Our custom Android build procedure did not work with
Clang-based NDK toolchains, which meant that it could not be made to
work with NDK v18b or later.

Fixes #309

5 years agoBuild: Fix regression test failure w/ ctest -j
Orivej Desh [Mon, 21 Jan 2019 22:56:56 +0000 (22:56 +0000)]
Build: Fix regression test failure w/ ctest -j

The djpeg rgb-islow-icc-cmp test must run after the djpeg rgb-islow
test, since the latter generates testout_rgb_islow.icc.

5 years agodjpeg: Fix PPM output regression w/ color quant.
DRC [Mon, 21 Jan 2019 22:25:02 +0000 (16:25 -0600)]
djpeg: Fix PPM output regression w/ color quant.

Regression caused by aa7459050d7a50e1d8a99488902d41fbc118a50f

Fix based on:
https://github.com/sinic/libjpeg-turbo/commit/03fbacb8ebf1fffc3f2d2db26ddf4db8b1f6aa7b

Closes #310

5 years agoTurboJPEG: Decompress 4:4:4 JPEGs with unusual SFs
DRC [Mon, 21 Jan 2019 19:57:55 +0000 (13:57 -0600)]
TurboJPEG: Decompress 4:4:4 JPEGs with unusual SFs

Normally, 4:4:4 JPEGs have horizontal x vertical luminance & chrominance
sampling factors of 1x1.  However, it is technically legal to create
4:4:4 JPEGs with sampling factors of 2x1, 1x2, 3x1, or 1x3, since the
sums of the products of those sampling factors are still <= 10.  The
libjpeg API correctly decodes such images, so the TurboJPEG API should
as well.

Fixes #323

5 years agoMerge branch 'master' into dev
DRC [Wed, 2 Jan 2019 03:53:19 +0000 (21:53 -0600)]
Merge branch 'master' into dev

5 years agoMerge branch 'master' into dev
DRC [Wed, 2 Jan 2019 03:52:21 +0000 (21:52 -0600)]
Merge branch 'master' into dev

5 years agoTravis: Use Homebrew addon to improve performance
Stephen [Wed, 2 Jan 2019 03:36:03 +0000 (19:36 -0800)]
Travis: Use Homebrew addon to improve performance

5 years agoTJBench Java: Properly handle transform warnings
DRC [Wed, 2 Jan 2019 03:16:33 +0000 (21:16 -0600)]
TJBench Java: Properly handle transform warnings

+ warnings from TJDecompressor.decompressHeader()

5 years agoTJBench: Fix FPE when decompressing 0-width JPEG
DRC [Wed, 2 Jan 2019 03:08:27 +0000 (21:08 -0600)]
TJBench: Fix FPE when decompressing 0-width JPEG

Fixes #319

5 years agowrbmp.c: Don't allow quantization w/ non-RGB CS
DRC [Wed, 2 Jan 2019 02:32:40 +0000 (20:32 -0600)]
wrbmp.c: Don't allow quantization w/ non-RGB CS

If cinfo->quantize_colors == 1, then jpeg_calc_output_dimensions() will
set cinfo->output_components to 1, and if cinfo->out_color_space is not
RGB (or extended RGB), hilarity will ensue.

Fixes #305

5 years agowrbmp.c: Use IsExtRGB() macro where appropriate
DRC [Wed, 2 Jan 2019 02:15:25 +0000 (20:15 -0600)]
wrbmp.c: Use IsExtRGB() macro where appropriate

(to improve readability)

5 years agotjLoadImage(): Fix int overflow/segfault w/big BMP
DRC [Wed, 2 Jan 2019 00:57:36 +0000 (18:57 -0600)]
tjLoadImage(): Fix int overflow/segfault w/big BMP

Fixes #304

5 years agojversion.h: Bump copyright year to 2019
DRC [Wed, 2 Jan 2019 00:29:55 +0000 (18:29 -0600)]
jversion.h: Bump copyright year to 2019

5 years agoBuild: Fix regr. that nuked RPATH in Mac/iOS build
DRC [Tue, 1 Jan 2019 20:26:48 +0000 (14:26 -0600)]
Build: Fix regr. that nuked RPATH in Mac/iOS build

Caused by 950580eb0c020598a4c6c8aa46c86e31062e1ddc.  Since the code that
sets CMAKE_INSTALL_RPATH now depends on ENABLE_SHARED, that code needed
to be moved to after the point at which ENABLE_SHARED is defined.

5 years agoBump version to 2.0.2 to prepare for new commits
DRC [Tue, 1 Jan 2019 19:55:01 +0000 (13:55 -0600)]
Bump version to 2.0.2 to prepare for new commits

5 years agoTravis: Fetch GPG key from libjpeg-turbo.org
DRC [Wed, 21 Nov 2018 04:52:36 +0000 (22:52 -0600)]
Travis: Fetch GPG key from libjpeg-turbo.org

I give up on the public keyserver.  It inexplicably just fails
sometimes.  I was trying to use it out of an abundance of caution
(<cough> paranoia <cough>), but it seems like most open source projects
just serve up their public keys from their project web sites.  The
private and public pre-release keys are still stored on separate sites,
the private key is still strongly encrypted by Travis, and we use a
separate key for pre-releases anyhow, so even if it's compromised, we
can quickly and easily deploy a new one.