README.md: Mention 4:4:0 math. incomp. vs. jpeg-6b

libjpeg-turbo implements 4:4:0 "fancy" (smooth) upsampling, which is
enabled by default when decompressing JPEG images that use 4:4:0
chrominance subsampling.  libjpeg did not and does not implement fancy
4:4:0 upsampling.
This commit is contained in:
DRC
2023-10-04 13:20:38 -04:00
parent 2c97a1ff07
commit 3d1d68cf96

View File

@@ -283,30 +283,35 @@ Mathematical Compatibility
========================== ==========================
For the most part, libjpeg-turbo should produce identical output to libjpeg For the most part, libjpeg-turbo should produce identical output to libjpeg
v6b. The one exception to this is when using the floating point DCT/IDCT, in v6b. There are two exceptions:
which case the outputs of libjpeg v6b and libjpeg-turbo can differ for the
following reasons:
- The SSE/SSE2 floating point DCT implementation in libjpeg-turbo is ever so 1. When decompressing a JPEG image that uses 4:4:0 chrominance subsampling, the
slightly more accurate than the implementation in libjpeg v6b, but not by outputs of libjpeg v6b and libjpeg-turbo can differ because libjpeg-turbo
any amount perceptible to human vision (generally in the range of 0.01 to implements a "fancy" (smooth) 4:4:0 upsampling algorithm and libjpeg did not.
0.08 dB gain in PNSR.)
2. When using the floating point DCT/IDCT, the outputs of libjpeg v6b and
libjpeg-turbo can differ for the following reasons:
- The SSE/SSE2 floating point DCT implementation in libjpeg-turbo is ever
so slightly more accurate than the implementation in libjpeg v6b, but not
by any amount perceptible to human vision (generally in the range of 0.01
to 0.08 dB gain in PNSR.)
- When not using the SIMD extensions, libjpeg-turbo uses the more accurate - When not using the SIMD extensions, libjpeg-turbo uses the more accurate
(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
point IDCT in line with the accuracy of the accurate integer IDCT. The floating point IDCT in line with the accuracy of the accurate integer
floating point DCT/IDCT algorithms are mainly a legacy feature, and they do IDCT. The floating point DCT/IDCT algorithms are mainly a legacy
not produce significantly more accuracy than the accurate integer algorithms feature, and they do not produce significantly more accuracy than the
(to put numbers on this, the typical difference in PNSR between the two accurate integer algorithms. (To put numbers on this, the typical
algorithms is less than 0.10 dB, whereas changing the quality level by 1 in difference in PNSR between the two algorithms is less than 0.10 dB,
the upper range of the quality scale is typically more like a 1.0 dB whereas changing the quality level by 1 in the upper range of the quality
difference.) 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
SIMD instructions on a particular platform, then the accuracy of the using SIMD instructions on a particular platform, then the accuracy of
floating point DCT/IDCT can depend on the compiler settings. the floating point DCT/IDCT can depend on the compiler settings.
While libjpeg-turbo does emulate the libjpeg v8 API/ABI, under the hood it is While libjpeg-turbo does emulate the libjpeg v8 API/ABI, under the hood it is
still using the same algorithms as libjpeg v6b, so there are several specific still using the same algorithms as libjpeg v6b, so there are several specific