Disallow color quantization with lossless decomp

Color quantization is a legacy feature that serves little or no purpose
with lossless JPEG images.  9f756bc67a
eliminated interaction issues between the lossless decompressor and the
color quantizers related to out-of-range 12-bit samples, but referring
to #701, other interaction issues apparently still exist.  Such issues
are likely, given the fact that the color quantizers were not designed
with lossless decompression in mind.

This commit reverts 9f756bc67a, since the
issues it fixed are no longer relevant because of this commit and
2192560d74.

Fixed #672
Fixes #673
Fixes #674
Fixes #676
Fixes #677
Fixes #678
Fixes #679
Fixes #681
Fixes #683
Fixes #701
This commit is contained in:
DRC
2023-06-29 16:07:42 -04:00
parent c8d52f1c4c
commit bf9f319cb4
17 changed files with 66 additions and 92 deletions

View File

@@ -5,7 +5,7 @@ Copyright (C) 1994-2013, Thomas G. Lane, Guido Vollbeding.
Lossless JPEG Modifications:
Copyright (C) 1999, Ken Murchison.
libjpeg-turbo Modifications:
Copyright (C) 2010, 2014-2018, 2020, 2022, D. R. Commander.
Copyright (C) 2010, 2014-2018, 2020, 2022-2023, D. R. Commander.
Copyright (C) 2015, Google, Inc.
For conditions of distribution and use, see the accompanying README.ijg file.
@@ -120,8 +120,8 @@ supports 12-bit-per-component lossy or lossless JPEG if you set
cinfo->data_precision to 12 and 16-bit-per-component lossless JPEG if you set
cinfo->data_precision to 16. Note that this causes the sample size to be
larger than a char, so it affects the surrounding application's image data.
The sample applications cjpeg and djpeg can support 12-bit and 16-bit mode only
for PPM and GIF file formats.
The sample applications cjpeg and djpeg can support 12-bit mode only for PPM,
PGM, and GIF file formats and 16-bit mode only for PPM and PGM file formats.
Note that, when 12-bit data precision is enabled, the library always compresses
in Huffman optimization mode, in order to generate valid Huffman tables. This
@@ -1037,6 +1037,7 @@ jpeg_enable_lossless (j_compress_ptr cinfo, int predictor_selection_value,
* Downsampling/upsampling
* Color space conversion (the JPEG image will use the same color
space as the input image)
* Color quantization
* IDCT scaling
* Raw (downsampled) data input/output
* Transcoding of DCT coefficients