Merge "Fix signature of canDropMimeData used in code snippet"

This commit is contained in:
Albert Astals Cid 2021-03-03 16:01:13 +01:00 committed by Qt CI Bot
commit eeb4c0a1c9
28 changed files with 237 additions and 152 deletions

View File

@ -126,6 +126,7 @@ FILES="
jdmaster.c jdmaster.c
jdmaster.h jdmaster.h
jdmerge.c jdmerge.c
jdmerge.h
jdmrgext.c jdmrgext.c
jdmrg565.c jdmrg565.c
jdpostct.c jdpostct.c

View File

@ -2,9 +2,9 @@
#define JPEG_LIB_VERSION 80 #define JPEG_LIB_VERSION 80
#define LIBJPEG_TURBO_VERSION 2.0.5 #define LIBJPEG_TURBO_VERSION 2.0.6
#define LIBJPEG_TURBO_VERSION_NUMBER 2000005 #define LIBJPEG_TURBO_VERSION_NUMBER 2000006
#define C_ARITH_CODING_SUPPORTED 1 #define C_ARITH_CODING_SUPPORTED 1

View File

@ -8,7 +8,7 @@
#define PACKAGE_NAME "libjpeg-turbo" #define PACKAGE_NAME "libjpeg-turbo"
#define VERSION "2.0.5" #define VERSION "2.0.6"
#if SIZE_MAX == 0xffffffff #if SIZE_MAX == 0xffffffff
#define SIZEOF_SIZE_T 4 #define SIZEOF_SIZE_T 4

View File

@ -6,19 +6,20 @@
"Description": "The Independent JPEG Group's JPEG software", "Description": "The Independent JPEG Group's JPEG software",
"Homepage": "http://libjpeg-turbo.virtualgl.org/", "Homepage": "http://libjpeg-turbo.virtualgl.org/",
"Version": "2.0.5", "Version": "2.0.6",
"License": "Independent JPEG Group License", "License": "Independent JPEG Group License",
"LicenseId": "IJG", "LicenseId": "IJG",
"LicenseFile": "LICENSE", "LicenseFile": "LICENSE",
"Copyright": "Copyright (C) 2009-2020 D. R. Commander "Copyright": "Copyright (C) 2009-2020 D. R. Commander
Copyright (C) 2011-2016 Siarhei Siamashka Copyright (C) 2015, 2020 Google, Inc.
Copyright (C) 2019 Arm Limited
Copyright (C) 2015-2016, 2018 Matthieu Darbois Copyright (C) 2015-2016, 2018 Matthieu Darbois
Copyright (C) 2011-2016 Siarhei Siamashka
Copyright (C) 2015 Intel Corporation Copyright (C) 2015 Intel Corporation
Copyright (C) 2015 Google, Inc. Copyright (C) 2013-2014 Linaro Limited
Copyright (C) 2013-2014 MIPS Technologies, Inc. Copyright (C) 2013-2014 MIPS Technologies, Inc.
Copyright (C) 2013 Linaro Limited Copyright (C) 2009, 2012 Pierre Ossman for Cendio AB
Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies) Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)
Copyright (C) 2009 Pierre Ossman for Cendio AB
Copyright (C) 1999-2006 MIYASAKA Masaru Copyright (C) 1999-2006 MIYASAKA Masaru
Copyright (C) 1991-2016 Thomas G. Lane, Guido Vollbeding" Copyright (C) 1991-2017 Thomas G. Lane, Guido Vollbeding"
} }

View File

@ -1,3 +1,37 @@
2.0.6
=====
### Significant changes relative to 2.0.5:
1. Fixed "using JNI after critical get" errors that occurred on Android
platforms when using any of the YUV encoding/compression/decompression/decoding
methods in the TurboJPEG Java API.
2. Fixed or worked around multiple issues with `jpeg_skip_scanlines()`:
- Fixed segfaults or "Corrupt JPEG data: premature end of data segment"
errors in `jpeg_skip_scanlines()` that occurred when decompressing 4:2:2 or
4:2:0 JPEG images using merged (non-fancy) upsampling/color conversion (that
is, when setting `cinfo.do_fancy_upsampling` to `FALSE`.) 2.0.0[6] was a
similar fix, but it did not cover all cases.
- `jpeg_skip_scanlines()` now throws an error if two-pass color
quantization is enabled. Two-pass color quantization never worked properly
with `jpeg_skip_scanlines()`, and the issues could not readily be fixed.
- Fixed an issue whereby `jpeg_skip_scanlines()` always returned 0 when
skipping past the end of an image.
3. The Arm 64-bit (Armv8) Neon SIMD extensions can now be built using MinGW
toolchains targetting Arm64 (AArch64) Windows binaries.
4. Fixed unexpected visual artifacts that occurred when using
`jpeg_crop_scanline()` and interblock smoothing while decompressing only the DC
scan of a progressive JPEG image.
5. Fixed an issue whereby libjpeg-turbo would not build if 12-bit-per-component
JPEG support (`WITH_12BIT`) was enabled along with libjpeg v7 or libjpeg v8
API/ABI emulation (`WITH_JPEG7` or `WITH_JPEG8`.)
2.0.5 2.0.5
===== =====
@ -64,7 +98,7 @@ other user-visible errant behavior, and given that the lossless transformer
(unlike the decompressor) is not generally exposed to arbitrary data exploits, (unlike the decompressor) is not generally exposed to arbitrary data exploits,
this issue did not likely pose a security risk. this issue did not likely pose a security risk.
6. The ARM 64-bit (ARMv8) NEON SIMD assembly code now stores constants in a 6. The Arm 64-bit (Armv8) Neon SIMD assembly code now stores constants in a
separate read-only data section rather than in the text section, to support separate read-only data section rather than in the text section, to support
execute-only memory layouts. execute-only memory layouts.
@ -246,7 +280,7 @@ detect actual security issues, should they arise in the future.
1. Added AVX2 SIMD implementations of the colorspace conversion, chroma 1. Added AVX2 SIMD implementations of the colorspace conversion, chroma
downsampling and upsampling, integer quantization and sample conversion, and downsampling and upsampling, integer quantization and sample conversion, and
slow integer DCT/IDCT algorithms. When using the slow integer DCT/IDCT accurate integer DCT/IDCT algorithms. When using the accurate integer DCT/IDCT
algorithms on AVX2-equipped CPUs, the compression of RGB images is algorithms on AVX2-equipped CPUs, the compression of RGB images is
approximately 13-36% (avg. 22%) faster (relative to libjpeg-turbo 1.5.x) with approximately 13-36% (avg. 22%) faster (relative to libjpeg-turbo 1.5.x) with
64-bit code and 11-21% (avg. 17%) faster with 32-bit code, and the 64-bit code and 11-21% (avg. 17%) faster with 32-bit code, and the
@ -350,16 +384,16 @@ algorithm that caused incorrect dithering in the output image. This algorithm
now produces bitwise-identical results to the unmerged algorithms. now produces bitwise-identical results to the unmerged algorithms.
12. The SIMD function symbols for x86[-64]/ELF, MIPS/ELF, macOS/x86[-64] (if 12. The SIMD function symbols for x86[-64]/ELF, MIPS/ELF, macOS/x86[-64] (if
libjpeg-turbo is built with YASM), and iOS/ARM[64] builds are now private. libjpeg-turbo is built with YASM), and iOS/Arm[64] builds are now private.
This prevents those symbols from being exposed in applications or shared This prevents those symbols from being exposed in applications or shared
libraries that link statically with libjpeg-turbo. libraries that link statically with libjpeg-turbo.
13. Added Loongson MMI SIMD implementations of the RGB-to-YCbCr and 13. Added Loongson MMI SIMD implementations of the RGB-to-YCbCr and
YCbCr-to-RGB colorspace conversion, 4:2:0 chroma downsampling, 4:2:0 fancy YCbCr-to-RGB colorspace conversion, 4:2:0 chroma downsampling, 4:2:0 fancy
chroma upsampling, integer quantization, and slow integer DCT/IDCT algorithms. chroma upsampling, integer quantization, and accurate integer DCT/IDCT
When using the slow integer DCT/IDCT, this speeds up the compression of RGB algorithms. When using the accurate integer DCT/IDCT, this speeds up the
images by approximately 70-100% and the decompression of RGB images by compression of RGB images by approximately 70-100% and the decompression of RGB
approximately 2-3.5x. images by approximately 2-3.5x.
14. Fixed a build error when building with older MinGW releases (regression 14. Fixed a build error when building with older MinGW releases (regression
caused by 1.5.1[7].) caused by 1.5.1[7].)
@ -409,9 +443,9 @@ end of a single-scan (non-progressive) image, subsequent calls to
`jpeg_consume_input()` would return `JPEG_SUSPENDED` rather than `jpeg_consume_input()` would return `JPEG_SUSPENDED` rather than
`JPEG_REACHED_EOI`. `JPEG_REACHED_EOI`.
9. `jpeg_crop_scanlines()` now works correctly when decompressing grayscale 9. `jpeg_crop_scanline()` now works correctly when decompressing grayscale JPEG
JPEG images that were compressed with a sampling factor other than 1 (for images that were compressed with a sampling factor other than 1 (for instance,
instance, with `cjpeg -grayscale -sample 2x2`). with `cjpeg -grayscale -sample 2x2`).
1.5.2 1.5.2
@ -435,7 +469,7 @@ on PowerPC-based AmigaOS 4 and OpenBSD systems.
5. Fixed build and runtime errors on Windows that occurred when building 5. Fixed build and runtime errors on Windows that occurred when building
libjpeg-turbo with libjpeg v7 API/ABI emulation and the in-memory libjpeg-turbo with libjpeg v7 API/ABI emulation and the in-memory
source/destination managers. Due to an oversight, the `jpeg_skip_scanlines()` source/destination managers. Due to an oversight, the `jpeg_skip_scanlines()`
and `jpeg_crop_scanlines()` functions were not being included in jpeg7.dll when and `jpeg_crop_scanline()` functions were not being included in jpeg7.dll when
libjpeg-turbo was built with `-DWITH_JPEG7=1` and `-DWITH_MEMSRCDST=1`. libjpeg-turbo was built with `-DWITH_JPEG7=1` and `-DWITH_MEMSRCDST=1`.
6. Fixed "Bogus virtual array access" error that occurred when using the 6. Fixed "Bogus virtual array access" error that occurred when using the
@ -691,8 +725,8 @@ benchmarking or regression testing, SIMD-accelerated Huffman encoding can be
disabled by setting the `JSIMD_NOHUFFENC` environment variable to `1`. disabled by setting the `JSIMD_NOHUFFENC` environment variable to `1`.
13. Added ARM 64-bit (ARMv8) NEON SIMD implementations of the commonly-used 13. Added ARM 64-bit (ARMv8) NEON SIMD implementations of the commonly-used
compression algorithms (including the slow integer forward DCT and h2v2 & h2v1 compression algorithms (including the accurate integer forward DCT and h2v2 &
downsampling algorithms, which are not accelerated in the 32-bit NEON h2v1 downsampling algorithms, which are not accelerated in the 32-bit NEON
implementation.) This speeds up the compression of full-color JPEGs by about implementation.) This speeds up the compression of full-color JPEGs by about
75% on average on a Cavium ThunderX processor and by about 2-2.5x on average on 75% on average on a Cavium ThunderX processor and by about 2-2.5x on average on
Cortex-A53 and Cortex-A57 cores. Cortex-A53 and Cortex-A57 cores.
@ -823,8 +857,8 @@ platforms other than Windows or Linux. Oops.
7. Fixed an extremely rare bug in the Huffman encoder that caused 64-bit 7. Fixed an extremely rare bug in the Huffman encoder that caused 64-bit
builds of libjpeg-turbo to incorrectly encode a few specific test images when builds of libjpeg-turbo to incorrectly encode a few specific test images when
quality=98, an optimized Huffman table, and the slow integer forward DCT were quality=98, an optimized Huffman table, and the accurate integer forward DCT
used. were used.
8. The Windows (CMake) build system now supports building only static or only 8. The Windows (CMake) build system now supports building only static or only
shared libraries. This is accomplished by adding either `-DENABLE_STATIC=0` or shared libraries. This is accomplished by adding either `-DENABLE_STATIC=0` or
@ -983,8 +1017,8 @@ floating point inverse DCT (using code borrowed from libjpeg v8a and later.)
The accuracy of this implementation now matches the accuracy of the SSE/SSE2 The accuracy of this implementation now matches the accuracy of the SSE/SSE2
implementation. Note, however, that the floating point DCT/IDCT algorithms are implementation. Note, however, that the floating point DCT/IDCT algorithms are
mainly a legacy feature. They generally do not produce significantly better mainly a legacy feature. They generally do not produce significantly better
accuracy than the slow integer DCT/IDCT algorithms, and they are quite a bit accuracy than the accurate integer DCT/IDCT algorithms, and they are quite a
slower. bit slower.
8. Added a new output colorspace (`JCS_RGB565`) to the libjpeg API that allows 8. Added a new output colorspace (`JCS_RGB565`) to the libjpeg API that allows
for decompressing JPEG images into RGB565 (16-bit) pixels. If dithering is not for decompressing JPEG images into RGB565 (16-bit) pixels. If dithering is not
@ -1394,8 +1428,8 @@ cases.
2. Despite the above, the fast integer forward DCT still degrades somewhat for 2. Despite the above, the fast integer forward DCT still degrades somewhat for
JPEG qualities greater than 95, so the TurboJPEG wrapper will now automatically JPEG qualities greater than 95, so the TurboJPEG wrapper will now automatically
use the slow integer forward DCT when generating JPEG images of quality 96 or use the accurate integer forward DCT when generating JPEG images of quality 96
greater. This reduces compression performance by as much as 15% for these 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 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 lossless. It also ensures that the library can avoid the performance pitfall
created by [1]. created by [1].

View File

@ -223,12 +223,12 @@ https://www.iso.org/standard/54989.html and http://www.itu.int/rec/T-REC-T.871.
A PDF file of the older JFIF 1.02 specification is available at A PDF file of the older JFIF 1.02 specification is available at
http://www.w3.org/Graphics/JPEG/jfif3.pdf. http://www.w3.org/Graphics/JPEG/jfif3.pdf.
The TIFF 6.0 file format specification can be obtained by FTP from The TIFF 6.0 file format specification can be obtained from
ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme http://mirrors.ctan.org/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation
found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems. scheme found in the TIFF 6.0 spec of 3-June-92 has a number of serious
IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6). problems. IJG does not recommend use of the TIFF 6.0 design (TIFF Compression
Instead, we recommend the JPEG design proposed by TIFF Technical Note #2 tag 6). Instead, we recommend the JPEG design proposed by TIFF Technical Note
(Compression tag 7). Copies of this Note can be obtained from #2 (Compression tag 7). Copies of this Note can be obtained from
http://www.ijg.org/files/. It is expected that the next revision http://www.ijg.org/files/. It is expected that the next revision
of the TIFF spec will replace the 6.0 JPEG design with the Note's design. of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
Although IJG's own code does not support TIFF/JPEG, the free libtiff library Although IJG's own code does not support TIFF/JPEG, the free libtiff library
@ -243,14 +243,8 @@ The most recent released version can always be found there in
directory "files". directory "files".
The JPEG FAQ (Frequently Asked Questions) article is a source of some The JPEG FAQ (Frequently Asked Questions) article is a source of some
general information about JPEG. general information about JPEG. It is available at
It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/ http://www.faqs.org/faqs/jpeg-faq.
and other news.answers archive sites, including the official news.answers
archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.
If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu
with body
send usenet/news.answers/jpeg-faq/part1
send usenet/news.answers/jpeg-faq/part2
FILE FORMAT COMPATIBILITY FILE FORMAT COMPATIBILITY

View File

@ -2,7 +2,7 @@ Background
========== ==========
libjpeg-turbo is a JPEG image codec that uses SIMD instructions to accelerate libjpeg-turbo is a JPEG image codec that uses SIMD instructions to accelerate
baseline JPEG compression and decompression on x86, x86-64, ARM, PowerPC, and baseline JPEG compression and decompression on x86, x86-64, Arm, PowerPC, and
MIPS systems, as well as progressive JPEG compression on x86 and x86-64 MIPS systems, as well as progressive JPEG compression on x86 and x86-64
systems. On such systems, libjpeg-turbo is generally 2-6x as fast as libjpeg, systems. On such systems, libjpeg-turbo is generally 2-6x as fast as libjpeg,
all else being equal. On other types of systems, libjpeg-turbo can still all else being equal. On other types of systems, libjpeg-turbo can still
@ -179,8 +179,8 @@ supported and which aren't.
NOTE: As of this writing, extensive research has been conducted into the NOTE: As of this writing, extensive research has been conducted into the
usefulness of DCT scaling as a means of data reduction and SmartScale as a usefulness of DCT scaling as a means of data reduction and SmartScale as a
means of quality improvement. The reader is invited to peruse the research at means of quality improvement. Readers are invited to peruse the research at
<http://www.libjpeg-turbo.org/About/SmartScale> and draw his/her own conclusions, <http://www.libjpeg-turbo.org/About/SmartScale> and draw their own conclusions,
but it is the general belief of our project that these features have not but it is the general belief of our project that these features have not
demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo. demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
@ -287,12 +287,13 @@ following reasons:
(and slightly faster) floating point IDCT algorithm introduced in libjpeg (and slightly faster) floating point IDCT algorithm introduced in libjpeg
v8a as opposed to the algorithm used in libjpeg v6b. It should be noted, v8a as opposed to the algorithm used in libjpeg v6b. It should be noted,
however, that this algorithm basically brings the accuracy of the floating however, that this algorithm basically brings the accuracy of the floating
point IDCT in line with the accuracy of the slow integer IDCT. The floating point IDCT in line with the accuracy of the accurate integer IDCT. The
point DCT/IDCT algorithms are mainly a legacy feature, and they do not floating point DCT/IDCT algorithms are mainly a legacy feature, and they do
produce significantly more accuracy than the slow integer algorithms (to put not produce significantly more accuracy than the accurate integer algorithms
numbers on this, the typical difference in PNSR between the two algorithms (to put numbers on this, the typical difference in PNSR between the two
is less than 0.10 dB, whereas changing the quality level by 1 in the upper algorithms is less than 0.10 dB, whereas changing the quality level by 1 in
range of the quality scale is typically more like a 1.0 dB difference.) the upper range of the quality scale is typically more like a 1.0 dB
difference.)
- If the floating point algorithms in libjpeg-turbo are not implemented using - If the floating point algorithms in libjpeg-turbo are not implemented using
SIMD instructions on a particular platform, then the accuracy of the SIMD instructions on a particular platform, then the accuracy of the
@ -340,7 +341,7 @@ The algorithm used by the SIMD-accelerated quantization function cannot produce
correct results whenever the fast integer forward DCT is used along with a JPEG correct results whenever the fast integer forward DCT is used along with a JPEG
quality of 98-100. Thus, libjpeg-turbo must use the non-SIMD quantization quality of 98-100. Thus, libjpeg-turbo must use the non-SIMD quantization
function in those cases. This causes performance to drop by as much as 40%. function in those cases. This causes performance to drop by as much as 40%.
It is therefore strongly advised that you use the slow integer forward DCT It is therefore strongly advised that you use the accurate integer forward DCT
whenever encoding images with a JPEG quality of 98 or higher. whenever encoding images with a JPEG quality of 98 or higher.

View File

@ -34,10 +34,10 @@
* memory footprint by 64k, which is important for some mobile applications * memory footprint by 64k, which is important for some mobile applications
* that create many isolated instances of libjpeg-turbo (web browsers, for * that create many isolated instances of libjpeg-turbo (web browsers, for
* instance.) This may improve performance on some mobile platforms as well. * instance.) This may improve performance on some mobile platforms as well.
* This feature is enabled by default only on ARM processors, because some x86 * This feature is enabled by default only on Arm processors, because some x86
* chips have a slow implementation of bsr, and the use of clz/bsr cannot be * chips have a slow implementation of bsr, and the use of clz/bsr cannot be
* shown to have a significant performance impact even on the x86 chips that * shown to have a significant performance impact even on the x86 chips that
* have a fast implementation of it. When building for ARMv6, you can * have a fast implementation of it. When building for Armv6, you can
* explicitly disable the use of clz/bsr by adding -mthumb to the compiler * explicitly disable the use of clz/bsr by adding -mthumb to the compiler
* flags (this defines __thumb__). * flags (this defines __thumb__).
*/ */

View File

@ -1,8 +1,10 @@
/* /*
* jcinit.c * jcinit.c
* *
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane. * Copyright (C) 1991-1997, Thomas G. Lane.
* This file is part of the Independent JPEG Group's software. * libjpeg-turbo Modifications:
* Copyright (C) 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg * For conditions of distribution and use, see the accompanying README.ijg
* file. * file.
* *
@ -19,6 +21,7 @@
#define JPEG_INTERNALS #define JPEG_INTERNALS
#include "jinclude.h" #include "jinclude.h"
#include "jpeglib.h" #include "jpeglib.h"
#include "jpegcomp.h"
/* /*

View File

@ -43,10 +43,10 @@
* memory footprint by 64k, which is important for some mobile applications * memory footprint by 64k, which is important for some mobile applications
* that create many isolated instances of libjpeg-turbo (web browsers, for * that create many isolated instances of libjpeg-turbo (web browsers, for
* instance.) This may improve performance on some mobile platforms as well. * instance.) This may improve performance on some mobile platforms as well.
* This feature is enabled by default only on ARM processors, because some x86 * This feature is enabled by default only on Arm processors, because some x86
* chips have a slow implementation of bsr, and the use of clz/bsr cannot be * chips have a slow implementation of bsr, and the use of clz/bsr cannot be
* shown to have a significant performance impact even on the x86 chips that * shown to have a significant performance impact even on the x86 chips that
* have a fast implementation of it. When building for ARMv6, you can * have a fast implementation of it. When building for Armv6, you can
* explicitly disable the use of clz/bsr by adding -mthumb to the compiler * explicitly disable the use of clz/bsr by adding -mthumb to the compiler
* flags (this defines __thumb__). * flags (this defines __thumb__).
*/ */

View File

@ -4,8 +4,8 @@
* This file was part of the Independent JPEG Group's software: * This file was part of the Independent JPEG Group's software:
* Copyright (C) 1995-1998, Thomas G. Lane. * Copyright (C) 1995-1998, Thomas G. Lane.
* Modified 2000-2009 by Guido Vollbeding. * Modified 2000-2009 by Guido Vollbeding.
* It was modified by The libjpeg-turbo Project to include only code relevant * libjpeg-turbo Modifications:
* to libjpeg-turbo. * Copyright (C) 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg * For conditions of distribution and use, see the accompanying README.ijg
* file. * file.
* *
@ -17,6 +17,7 @@
#define JPEG_INTERNALS #define JPEG_INTERNALS
#include "jinclude.h" #include "jinclude.h"
#include "jpeglib.h" #include "jpeglib.h"
#include "jpegcomp.h"
/* Forward declarations */ /* Forward declarations */

View File

@ -4,7 +4,7 @@
* This file was part of the Independent JPEG Group's software: * This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1996, Thomas G. Lane. * Copyright (C) 1994-1996, Thomas G. Lane.
* libjpeg-turbo Modifications: * libjpeg-turbo Modifications:
* Copyright (C) 2010, 2015-2018, D. R. Commander. * Copyright (C) 2010, 2015-2018, 2020, D. R. Commander.
* Copyright (C) 2015, Google, Inc. * Copyright (C) 2015, Google, Inc.
* For conditions of distribution and use, see the accompanying README.ijg * For conditions of distribution and use, see the accompanying README.ijg
* file. * file.
@ -21,6 +21,8 @@
#include "jinclude.h" #include "jinclude.h"
#include "jdmainct.h" #include "jdmainct.h"
#include "jdcoefct.h" #include "jdcoefct.h"
#include "jdmaster.h"
#include "jdmerge.h"
#include "jdsample.h" #include "jdsample.h"
#include "jmemsys.h" #include "jmemsys.h"
@ -316,6 +318,8 @@ LOCAL(void)
read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines) read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
{ {
JDIMENSION n; JDIMENSION n;
my_master_ptr master = (my_master_ptr)cinfo->master;
JSAMPARRAY scanlines = NULL;
void (*color_convert) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, void (*color_convert) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf, JDIMENSION input_row, JSAMPARRAY output_buf,
int num_rows) = NULL; int num_rows) = NULL;
@ -332,8 +336,13 @@ read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
cinfo->cquantize->color_quantize = noop_quantize; cinfo->cquantize->color_quantize = noop_quantize;
} }
if (master->using_merged_upsample && cinfo->max_v_samp_factor == 2) {
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
scanlines = &upsample->spare_row;
}
for (n = 0; n < num_lines; n++) for (n = 0; n < num_lines; n++)
jpeg_read_scanlines(cinfo, NULL, 1); jpeg_read_scanlines(cinfo, scanlines, 1);
if (color_convert) if (color_convert)
cinfo->cconvert->color_convert = color_convert; cinfo->cconvert->color_convert = color_convert;
@ -353,6 +362,12 @@ increment_simple_rowgroup_ctr(j_decompress_ptr cinfo, JDIMENSION rows)
{ {
JDIMENSION rows_left; JDIMENSION rows_left;
my_main_ptr main_ptr = (my_main_ptr)cinfo->main; my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
my_master_ptr master = (my_master_ptr)cinfo->master;
if (master->using_merged_upsample && cinfo->max_v_samp_factor == 2) {
read_and_discard_scanlines(cinfo, rows);
return;
}
/* Increment the counter to the next row group after the skipped rows. */ /* Increment the counter to the next row group after the skipped rows. */
main_ptr->rowgroup_ctr += rows / cinfo->max_v_samp_factor; main_ptr->rowgroup_ctr += rows / cinfo->max_v_samp_factor;
@ -382,21 +397,27 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
{ {
my_main_ptr main_ptr = (my_main_ptr)cinfo->main; my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
my_coef_ptr coef = (my_coef_ptr)cinfo->coef; my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
my_master_ptr master = (my_master_ptr)cinfo->master;
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample; my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
JDIMENSION i, x; JDIMENSION i, x;
int y; int y;
JDIMENSION lines_per_iMCU_row, lines_left_in_iMCU_row, lines_after_iMCU_row; JDIMENSION lines_per_iMCU_row, lines_left_in_iMCU_row, lines_after_iMCU_row;
JDIMENSION lines_to_skip, lines_to_read; JDIMENSION lines_to_skip, lines_to_read;
/* Two-pass color quantization is not supported. */
if (cinfo->quantize_colors && cinfo->two_pass_quantize)
ERREXIT(cinfo, JERR_NOTIMPL);
if (cinfo->global_state != DSTATE_SCANNING) if (cinfo->global_state != DSTATE_SCANNING)
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
/* Do not skip past the bottom of the image. */ /* Do not skip past the bottom of the image. */
if (cinfo->output_scanline + num_lines >= cinfo->output_height) { if (cinfo->output_scanline + num_lines >= cinfo->output_height) {
num_lines = cinfo->output_height - cinfo->output_scanline;
cinfo->output_scanline = cinfo->output_height; cinfo->output_scanline = cinfo->output_height;
(*cinfo->inputctl->finish_input_pass) (cinfo); (*cinfo->inputctl->finish_input_pass) (cinfo);
cinfo->inputctl->eoi_reached = TRUE; cinfo->inputctl->eoi_reached = TRUE;
return cinfo->output_height - cinfo->output_scanline; return num_lines;
} }
if (num_lines == 0) if (num_lines == 0)
@ -445,8 +466,10 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
main_ptr->buffer_full = FALSE; main_ptr->buffer_full = FALSE;
main_ptr->rowgroup_ctr = 0; main_ptr->rowgroup_ctr = 0;
main_ptr->context_state = CTX_PREPARE_FOR_IMCU; main_ptr->context_state = CTX_PREPARE_FOR_IMCU;
upsample->next_row_out = cinfo->max_v_samp_factor; if (!master->using_merged_upsample) {
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline; upsample->next_row_out = cinfo->max_v_samp_factor;
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
}
} }
/* Skipping is much simpler when context rows are not required. */ /* Skipping is much simpler when context rows are not required. */
@ -458,8 +481,10 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
cinfo->output_scanline += lines_left_in_iMCU_row; cinfo->output_scanline += lines_left_in_iMCU_row;
main_ptr->buffer_full = FALSE; main_ptr->buffer_full = FALSE;
main_ptr->rowgroup_ctr = 0; main_ptr->rowgroup_ctr = 0;
upsample->next_row_out = cinfo->max_v_samp_factor; if (!master->using_merged_upsample) {
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline; upsample->next_row_out = cinfo->max_v_samp_factor;
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
}
} }
} }
@ -494,7 +519,8 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
cinfo->output_iMCU_row += lines_to_skip / lines_per_iMCU_row; cinfo->output_iMCU_row += lines_to_skip / lines_per_iMCU_row;
increment_simple_rowgroup_ctr(cinfo, lines_to_read); increment_simple_rowgroup_ctr(cinfo, lines_to_read);
} }
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline; if (!master->using_merged_upsample)
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
return num_lines; return num_lines;
} }
@ -535,7 +561,8 @@ jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
* bit odd, since "rows_to_go" seems to be redundantly keeping track of * bit odd, since "rows_to_go" seems to be redundantly keeping track of
* output_scanline. * output_scanline.
*/ */
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline; if (!master->using_merged_upsample)
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
/* Always skip the requested number of lines. */ /* Always skip the requested number of lines. */
return num_lines; return num_lines;

View File

@ -6,7 +6,7 @@
* libjpeg-turbo Modifications: * libjpeg-turbo Modifications:
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2010, 2015-2016, D. R. Commander. * Copyright (C) 2010, 2015-2016, D. R. Commander.
* Copyright (C) 2015, Google, Inc. * Copyright (C) 2015, 2020, Google, Inc.
* For conditions of distribution and use, see the accompanying README.ijg * For conditions of distribution and use, see the accompanying README.ijg
* file. * file.
* *
@ -495,11 +495,13 @@ decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
if (first_row && block_row == 0) if (first_row && block_row == 0)
prev_block_row = buffer_ptr; prev_block_row = buffer_ptr;
else else
prev_block_row = buffer[block_row - 1]; prev_block_row = buffer[block_row - 1] +
cinfo->master->first_MCU_col[ci];
if (last_row && block_row == block_rows - 1) if (last_row && block_row == block_rows - 1)
next_block_row = buffer_ptr; next_block_row = buffer_ptr;
else else
next_block_row = buffer[block_row + 1]; next_block_row = buffer[block_row + 1] +
cinfo->master->first_MCU_col[ci];
/* We fetch the surrounding DC values using a sliding-register approach. /* We fetch the surrounding DC values using a sliding-register approach.
* Initialize all nine here so as to do the right thing on narrow pics. * Initialize all nine here so as to do the right thing on narrow pics.
*/ */

View File

@ -571,11 +571,10 @@ ycck_cmyk_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
* RGB565 conversion * RGB565 conversion
*/ */
#define PACK_SHORT_565_LE(r, g, b) ((((r) << 8) & 0xF800) | \ #define PACK_SHORT_565_LE(r, g, b) \
(((g) << 3) & 0x7E0) | ((b) >> 3)) ((((r) << 8) & 0xF800) | (((g) << 3) & 0x7E0) | ((b) >> 3))
#define PACK_SHORT_565_BE(r, g, b) (((r) & 0xF8) | ((g) >> 5) | \ #define PACK_SHORT_565_BE(r, g, b) \
(((g) << 11) & 0xE000) | \ (((r) & 0xF8) | ((g) >> 5) | (((g) << 11) & 0xE000) | (((b) << 5) & 0x1F00))
(((b) << 5) & 0x1F00))
#define PACK_TWO_PIXELS_LE(l, r) ((r << 16) | l) #define PACK_TWO_PIXELS_LE(l, r) ((r << 16) | l)
#define PACK_TWO_PIXELS_BE(l, r) ((l << 16) | r) #define PACK_TWO_PIXELS_BE(l, r) ((l << 16) | r)

View File

@ -5,7 +5,7 @@
* Copyright (C) 1994-1996, Thomas G. Lane. * Copyright (C) 1994-1996, Thomas G. Lane.
* libjpeg-turbo Modifications: * libjpeg-turbo Modifications:
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2009, 2011, 2014-2015, D. R. Commander. * Copyright (C) 2009, 2011, 2014-2015, 2020, D. R. Commander.
* Copyright (C) 2013, Linaro Limited. * Copyright (C) 2013, Linaro Limited.
* For conditions of distribution and use, see the accompanying README.ijg * For conditions of distribution and use, see the accompanying README.ijg
* file. * file.
@ -40,41 +40,13 @@
#define JPEG_INTERNALS #define JPEG_INTERNALS
#include "jinclude.h" #include "jinclude.h"
#include "jpeglib.h" #include "jpeglib.h"
#include "jdmerge.h"
#include "jsimd.h" #include "jsimd.h"
#include "jconfigint.h" #include "jconfigint.h"
#ifdef UPSAMPLE_MERGING_SUPPORTED #ifdef UPSAMPLE_MERGING_SUPPORTED
/* Private subobject */
typedef struct {
struct jpeg_upsampler pub; /* public fields */
/* Pointer to routine to do actual upsampling/conversion of one row group */
void (*upmethod) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
/* Private state for YCC->RGB conversion */
int *Cr_r_tab; /* => table for Cr to R conversion */
int *Cb_b_tab; /* => table for Cb to B conversion */
JLONG *Cr_g_tab; /* => table for Cr to G conversion */
JLONG *Cb_g_tab; /* => table for Cb to G conversion */
/* For 2:1 vertical sampling, we produce two output rows at a time.
* We need a "spare" row buffer to hold the second output row if the
* application provides just a one-row buffer; we also use the spare
* to discard the dummy last row if the image height is odd.
*/
JSAMPROW spare_row;
boolean spare_full; /* T if spare buffer is occupied */
JDIMENSION out_row_width; /* samples per output row */
JDIMENSION rows_to_go; /* counts rows remaining in image */
} my_upsampler;
typedef my_upsampler *my_upsample_ptr;
#define SCALEBITS 16 /* speediest right-shift on some machines */ #define SCALEBITS 16 /* speediest right-shift on some machines */
#define ONE_HALF ((JLONG)1 << (SCALEBITS - 1)) #define ONE_HALF ((JLONG)1 << (SCALEBITS - 1))
#define FIX(x) ((JLONG)((x) * (1L << SCALEBITS) + 0.5)) #define FIX(x) ((JLONG)((x) * (1L << SCALEBITS) + 0.5))
@ -189,7 +161,7 @@ typedef my_upsampler *my_upsample_ptr;
LOCAL(void) LOCAL(void)
build_ycc_rgb_table(j_decompress_ptr cinfo) build_ycc_rgb_table(j_decompress_ptr cinfo)
{ {
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample; my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
int i; int i;
JLONG x; JLONG x;
SHIFT_TEMPS SHIFT_TEMPS
@ -232,7 +204,7 @@ build_ycc_rgb_table(j_decompress_ptr cinfo)
METHODDEF(void) METHODDEF(void)
start_pass_merged_upsample(j_decompress_ptr cinfo) start_pass_merged_upsample(j_decompress_ptr cinfo)
{ {
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample; my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
/* Mark the spare buffer empty */ /* Mark the spare buffer empty */
upsample->spare_full = FALSE; upsample->spare_full = FALSE;
@ -254,7 +226,7 @@ merged_2v_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail) JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
/* 2:1 vertical sampling case: may need a spare row. */ /* 2:1 vertical sampling case: may need a spare row. */
{ {
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample; my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
JSAMPROW work_ptrs[2]; JSAMPROW work_ptrs[2];
JDIMENSION num_rows; /* number of rows returned to caller */ JDIMENSION num_rows; /* number of rows returned to caller */
@ -305,7 +277,7 @@ merged_1v_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail) JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
/* 1:1 vertical sampling case: much easier, never need a spare row. */ /* 1:1 vertical sampling case: much easier, never need a spare row. */
{ {
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample; my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
/* Just do the upsampling. */ /* Just do the upsampling. */
(*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr,
@ -420,11 +392,10 @@ h2v2_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
* RGB565 conversion * RGB565 conversion
*/ */
#define PACK_SHORT_565_LE(r, g, b) ((((r) << 8) & 0xF800) | \ #define PACK_SHORT_565_LE(r, g, b) \
(((g) << 3) & 0x7E0) | ((b) >> 3)) ((((r) << 8) & 0xF800) | (((g) << 3) & 0x7E0) | ((b) >> 3))
#define PACK_SHORT_565_BE(r, g, b) (((r) & 0xF8) | ((g) >> 5) | \ #define PACK_SHORT_565_BE(r, g, b) \
(((g) << 11) & 0xE000) | \ (((r) & 0xF8) | ((g) >> 5) | (((g) << 11) & 0xE000) | (((b) << 5) & 0x1F00))
(((b) << 5) & 0x1F00))
#define PACK_TWO_PIXELS_LE(l, r) ((r << 16) | l) #define PACK_TWO_PIXELS_LE(l, r) ((r << 16) | l)
#define PACK_TWO_PIXELS_BE(l, r) ((l << 16) | r) #define PACK_TWO_PIXELS_BE(l, r) ((l << 16) | r)
@ -566,11 +537,11 @@ h2v2_merged_upsample_565D(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
GLOBAL(void) GLOBAL(void)
jinit_merged_upsampler(j_decompress_ptr cinfo) jinit_merged_upsampler(j_decompress_ptr cinfo)
{ {
my_upsample_ptr upsample; my_merged_upsample_ptr upsample;
upsample = (my_upsample_ptr) upsample = (my_merged_upsample_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE, (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
sizeof(my_upsampler)); sizeof(my_merged_upsampler));
cinfo->upsample = (struct jpeg_upsampler *)upsample; cinfo->upsample = (struct jpeg_upsampler *)upsample;
upsample->pub.start_pass = start_pass_merged_upsample; upsample->pub.start_pass = start_pass_merged_upsample;
upsample->pub.need_context_rows = FALSE; upsample->pub.need_context_rows = FALSE;

47
src/3rdparty/libjpeg/src/jdmerge.h vendored Normal file
View File

@ -0,0 +1,47 @@
/*
* jdmerge.h
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1996, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*/
#define JPEG_INTERNALS
#include "jpeglib.h"
#ifdef UPSAMPLE_MERGING_SUPPORTED
/* Private subobject */
typedef struct {
struct jpeg_upsampler pub; /* public fields */
/* Pointer to routine to do actual upsampling/conversion of one row group */
void (*upmethod) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
/* Private state for YCC->RGB conversion */
int *Cr_r_tab; /* => table for Cr to R conversion */
int *Cb_b_tab; /* => table for Cb to B conversion */
JLONG *Cr_g_tab; /* => table for Cr to G conversion */
JLONG *Cb_g_tab; /* => table for Cb to G conversion */
/* For 2:1 vertical sampling, we produce two output rows at a time.
* We need a "spare" row buffer to hold the second output row if the
* application provides just a one-row buffer; we also use the spare
* to discard the dummy last row if the image height is odd.
*/
JSAMPROW spare_row;
boolean spare_full; /* T if spare buffer is occupied */
JDIMENSION out_row_width; /* samples per output row */
JDIMENSION rows_to_go; /* counts rows remaining in image */
} my_merged_upsampler;
typedef my_merged_upsampler *my_merged_upsample_ptr;
#endif /* UPSAMPLE_MERGING_SUPPORTED */

View File

@ -5,7 +5,7 @@
* Copyright (C) 1994-1996, Thomas G. Lane. * Copyright (C) 1994-1996, Thomas G. Lane.
* libjpeg-turbo Modifications: * libjpeg-turbo Modifications:
* Copyright (C) 2013, Linaro Limited. * Copyright (C) 2013, Linaro Limited.
* Copyright (C) 2014-2015, 2018, D. R. Commander. * Copyright (C) 2014-2015, 2018, 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg * For conditions of distribution and use, see the accompanying README.ijg
* file. * file.
* *
@ -19,7 +19,7 @@ h2v1_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION in_row_group_ctr, JDIMENSION in_row_group_ctr,
JSAMPARRAY output_buf) JSAMPARRAY output_buf)
{ {
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample; my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
register int y, cred, cgreen, cblue; register int y, cred, cgreen, cblue;
int cb, cr; int cb, cr;
register JSAMPROW outptr; register JSAMPROW outptr;
@ -90,7 +90,7 @@ h2v1_merged_upsample_565D_internal(j_decompress_ptr cinfo,
JDIMENSION in_row_group_ctr, JDIMENSION in_row_group_ctr,
JSAMPARRAY output_buf) JSAMPARRAY output_buf)
{ {
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample; my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
register int y, cred, cgreen, cblue; register int y, cred, cgreen, cblue;
int cb, cr; int cb, cr;
register JSAMPROW outptr; register JSAMPROW outptr;
@ -163,7 +163,7 @@ h2v2_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION in_row_group_ctr, JDIMENSION in_row_group_ctr,
JSAMPARRAY output_buf) JSAMPARRAY output_buf)
{ {
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample; my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
register int y, cred, cgreen, cblue; register int y, cred, cgreen, cblue;
int cb, cr; int cb, cr;
register JSAMPROW outptr0, outptr1; register JSAMPROW outptr0, outptr1;
@ -259,7 +259,7 @@ h2v2_merged_upsample_565D_internal(j_decompress_ptr cinfo,
JDIMENSION in_row_group_ctr, JDIMENSION in_row_group_ctr,
JSAMPARRAY output_buf) JSAMPARRAY output_buf)
{ {
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample; my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
register int y, cred, cgreen, cblue; register int y, cred, cgreen, cblue;
int cb, cr; int cb, cr;
register JSAMPROW outptr0, outptr1; register JSAMPROW outptr0, outptr1;

View File

@ -4,7 +4,7 @@
* This file was part of the Independent JPEG Group's software: * This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1996, Thomas G. Lane. * Copyright (C) 1994-1996, Thomas G. Lane.
* libjpeg-turbo Modifications: * libjpeg-turbo Modifications:
* Copyright (C) 2011, 2015, D. R. Commander. * Copyright (C) 2011, 2015, 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg * For conditions of distribution and use, see the accompanying README.ijg
* file. * file.
* *
@ -25,7 +25,7 @@ h2v1_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION in_row_group_ctr, JDIMENSION in_row_group_ctr,
JSAMPARRAY output_buf) JSAMPARRAY output_buf)
{ {
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample; my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
register int y, cred, cgreen, cblue; register int y, cred, cgreen, cblue;
int cb, cr; int cb, cr;
register JSAMPROW outptr; register JSAMPROW outptr;
@ -97,7 +97,7 @@ h2v2_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION in_row_group_ctr, JDIMENSION in_row_group_ctr,
JSAMPARRAY output_buf) JSAMPARRAY output_buf)
{ {
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample; my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
register int y, cred, cgreen, cblue; register int y, cred, cgreen, cblue;
int cb, cr; int cb, cr;
register JSAMPROW outptr0, outptr1; register JSAMPROW outptr0, outptr1;

View File

@ -3,8 +3,8 @@
* *
* This file was part of the Independent JPEG Group's software: * This file was part of the Independent JPEG Group's software:
* Copyright (C) 1995-1997, Thomas G. Lane. * Copyright (C) 1995-1997, Thomas G. Lane.
* It was modified by The libjpeg-turbo Project to include only code relevant * libjpeg-turbo Modifications:
* to libjpeg-turbo. * Copyright (C) 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg * For conditions of distribution and use, see the accompanying README.ijg
* file. * file.
* *
@ -16,6 +16,7 @@
#define JPEG_INTERNALS #define JPEG_INTERNALS
#include "jinclude.h" #include "jinclude.h"
#include "jpeglib.h" #include "jpeglib.h"
#include "jpegcomp.h"
/* Forward declarations */ /* Forward declarations */

View File

@ -4,11 +4,11 @@
* This file was part of the Independent JPEG Group's software: * This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1996, Thomas G. Lane. * Copyright (C) 1991-1996, Thomas G. Lane.
* libjpeg-turbo Modifications: * libjpeg-turbo Modifications:
* Copyright (C) 2015, D. R. Commander. * Copyright (C) 2015, 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg * For conditions of distribution and use, see the accompanying README.ijg
* file. * file.
* *
* This file contains a slow-but-accurate integer implementation of the * This file contains a slower but more accurate integer implementation of the
* forward DCT (Discrete Cosine Transform). * forward DCT (Discrete Cosine Transform).
* *
* A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT

View File

@ -5,11 +5,11 @@
* Copyright (C) 1991-1998, Thomas G. Lane. * Copyright (C) 1991-1998, Thomas G. Lane.
* Modification developed 2002-2009 by Guido Vollbeding. * Modification developed 2002-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications: * libjpeg-turbo Modifications:
* Copyright (C) 2015, D. R. Commander. * Copyright (C) 2015, 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg * For conditions of distribution and use, see the accompanying README.ijg
* file. * file.
* *
* This file contains a slow-but-accurate integer implementation of the * This file contains a slower but more accurate integer implementation of the
* inverse DCT (Discrete Cosine Transform). In the IJG code, this routine * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine
* must also perform dequantization of the input coefficients. * must also perform dequantization of the input coefficients.
* *

View File

@ -5,7 +5,7 @@
* Copyright (C) 1991-1997, Thomas G. Lane. * Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 1997-2009 by Guido Vollbeding. * Modified 1997-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications: * libjpeg-turbo Modifications:
* Copyright (C) 2009, 2011, 2014-2015, 2018, D. R. Commander. * Copyright (C) 2009, 2011, 2014-2015, 2018, 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg * For conditions of distribution and use, see the accompanying README.ijg
* file. * file.
* *
@ -273,9 +273,9 @@ typedef int boolean;
/* Capability options common to encoder and decoder: */ /* Capability options common to encoder and decoder: */
#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */ #define DCT_ISLOW_SUPPORTED /* accurate integer method */
#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */ #define DCT_IFAST_SUPPORTED /* less accurate int method [legacy feature] */
#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */ #define DCT_FLOAT_SUPPORTED /* floating-point method [legacy feature] */
/* Encoder capability options: */ /* Encoder capability options: */

View File

@ -1,7 +1,7 @@
/* /*
* jpegcomp.h * jpegcomp.h
* *
* Copyright (C) 2010, D. R. Commander. * Copyright (C) 2010, 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg * For conditions of distribution and use, see the accompanying README.ijg
* file. * file.
* *
@ -19,6 +19,7 @@
#define _min_DCT_v_scaled_size min_DCT_v_scaled_size #define _min_DCT_v_scaled_size min_DCT_v_scaled_size
#define _jpeg_width jpeg_width #define _jpeg_width jpeg_width
#define _jpeg_height jpeg_height #define _jpeg_height jpeg_height
#define JERR_ARITH_NOTIMPL JERR_NOT_COMPILED
#else #else
#define _DCT_scaled_size DCT_scaled_size #define _DCT_scaled_size DCT_scaled_size
#define _DCT_h_scaled_size DCT_scaled_size #define _DCT_h_scaled_size DCT_scaled_size

View File

@ -5,7 +5,7 @@
* Copyright (C) 1991-1998, Thomas G. Lane. * Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2002-2009 by Guido Vollbeding. * Modified 2002-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications: * libjpeg-turbo Modifications:
* Copyright (C) 2009-2011, 2013-2014, 2016-2017, D. R. Commander. * Copyright (C) 2009-2011, 2013-2014, 2016-2017, 2020, D. R. Commander.
* Copyright (C) 2015, Google, Inc. * Copyright (C) 2015, Google, Inc.
* For conditions of distribution and use, see the accompanying README.ijg * For conditions of distribution and use, see the accompanying README.ijg
* file. * file.
@ -244,9 +244,9 @@ typedef enum {
/* DCT/IDCT algorithm options. */ /* DCT/IDCT algorithm options. */
typedef enum { typedef enum {
JDCT_ISLOW, /* slow but accurate integer algorithm */ JDCT_ISLOW, /* accurate integer method */
JDCT_IFAST, /* faster, less accurate integer method */ JDCT_IFAST, /* less accurate integer method [legacy feature] */
JDCT_FLOAT /* floating-point: accurate, fast on fast HW */ JDCT_FLOAT /* floating-point method [legacy feature] */
} J_DCT_METHOD; } J_DCT_METHOD;
#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */ #ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */

View File

@ -4,7 +4,7 @@
* This file was part of the Independent JPEG Group's software: * This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1996, Thomas G. Lane. * Copyright (C) 1991-1996, Thomas G. Lane.
* libjpeg-turbo Modifications: * libjpeg-turbo Modifications:
* Copyright (C) 2009, 2014-2015, D. R. Commander. * Copyright (C) 2009, 2014-2015, 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg * For conditions of distribution and use, see the accompanying README.ijg
* file. * file.
* *
@ -1145,7 +1145,7 @@ start_pass_2_quant(j_decompress_ptr cinfo, boolean is_pre_scan)
int i; int i;
/* Only F-S dithering or no dithering is supported. */ /* Only F-S dithering or no dithering is supported. */
/* If user asks for ordered dither, give him F-S. */ /* If user asks for ordered dither, give them F-S. */
if (cinfo->dither_mode != JDITHER_NONE) if (cinfo->dither_mode != JDITHER_NONE)
cinfo->dither_mode = JDITHER_FS; cinfo->dither_mode = JDITHER_FS;
@ -1263,7 +1263,7 @@ jinit_2pass_quantizer(j_decompress_ptr cinfo)
cquantize->sv_colormap = NULL; cquantize->sv_colormap = NULL;
/* Only F-S dithering or no dithering is supported. */ /* Only F-S dithering or no dithering is supported. */
/* If user asks for ordered dither, give him F-S. */ /* If user asks for ordered dither, give them F-S. */
if (cinfo->dither_mode != JDITHER_NONE) if (cinfo->dither_mode != JDITHER_NONE)
cinfo->dither_mode = JDITHER_FS; cinfo->dither_mode = JDITHER_FS;

View File

@ -30,23 +30,25 @@
* NOTE: It is our convention to place the authors in the following order: * NOTE: It is our convention to place the authors in the following order:
* - libjpeg-turbo authors (2009-) in descending order of the date of their * - libjpeg-turbo authors (2009-) in descending order of the date of their
* most recent contribution to the project, then in ascending order of the * most recent contribution to the project, then in ascending order of the
* date of their first contribution to the project * date of their first contribution to the project, then in alphabetical
* order
* - Upstream authors in descending order of the date of the first inclusion of * - Upstream authors in descending order of the date of the first inclusion of
* their code * their code
*/ */
#define JCOPYRIGHT \ #define JCOPYRIGHT \
"Copyright (C) 2009-2020 D. R. Commander\n" \ "Copyright (C) 2009-2020 D. R. Commander\n" \
"Copyright (C) 2011-2016 Siarhei Siamashka\n" \ "Copyright (C) 2015, 2020 Google, Inc.\n" \
"Copyright (C) 2019 Arm Limited\n" \
"Copyright (C) 2015-2016, 2018 Matthieu Darbois\n" \ "Copyright (C) 2015-2016, 2018 Matthieu Darbois\n" \
"Copyright (C) 2011-2016 Siarhei Siamashka\n" \
"Copyright (C) 2015 Intel Corporation\n" \ "Copyright (C) 2015 Intel Corporation\n" \
"Copyright (C) 2015 Google, Inc.\n" \ "Copyright (C) 2013-2014 Linaro Limited\n" \
"Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \ "Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \
"Copyright (C) 2013 Linaro Limited\n" \ "Copyright (C) 2009, 2012 Pierre Ossman for Cendio AB\n" \
"Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \ "Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \
"Copyright (C) 2009 Pierre Ossman for Cendio AB\n" \
"Copyright (C) 1999-2006 MIYASAKA Masaru\n" \ "Copyright (C) 1999-2006 MIYASAKA Masaru\n" \
"Copyright (C) 1991-2016 Thomas G. Lane, Guido Vollbeding" "Copyright (C) 1991-2017 Thomas G. Lane, Guido Vollbeding"
#define JCOPYRIGHT_SHORT \ #define JCOPYRIGHT_SHORT \
"Copyright (C) 1991-2020 The libjpeg-turbo Project and many others" "Copyright (C) 1991-2020 The libjpeg-turbo Project and many others"

View File

@ -66,7 +66,7 @@ DragDropListModel::DragDropListModel(const QStringList &strings,
//! [0] //! [0]
bool DragDropListModel::canDropMimeData(const QMimeData *data, bool DragDropListModel::canDropMimeData(const QMimeData *data,
Qt::DropAction action, int row, int column, const QModelIndex &parent) Qt::DropAction action, int row, int column, const QModelIndex &parent) const
{ {
Q_UNUSED(action); Q_UNUSED(action);
Q_UNUSED(row); Q_UNUSED(row);

View File

@ -64,7 +64,7 @@ public:
Qt::ItemFlags flags(const QModelIndex &index) const override; Qt::ItemFlags flags(const QModelIndex &index) const override;
bool canDropMimeData(const QMimeData *data, Qt::DropAction action, bool canDropMimeData(const QMimeData *data, Qt::DropAction action,
int row, int column, const QModelIndex &parent) override; int row, int column, const QModelIndex &parent) const override;
bool dropMimeData(const QMimeData *data, Qt::DropAction action, bool dropMimeData(const QMimeData *data, Qt::DropAction action,
int row, int column, const QModelIndex &parent) override; int row, int column, const QModelIndex &parent) override;
QMimeData *mimeData(const QModelIndexList &indexes) const override; QMimeData *mimeData(const QModelIndexList &indexes) const override;