README.md (2119B)
1 # Improved JPEG encoder and decoder implementation 2 3 This subdirectory contains a JPEG encoder and decoder implementation that is 4 API and ABI compatible with libjpeg62. 5 6 ## Building 7 8 When building the parent libjxl project, two binaries, `tools/cjpegli` and 9 `tools/djpegli` will be built, as well as a 10 `lib/jpegli/libjpeg.so.62.3.0` shared library that can be used as a drop-in 11 replacement for the system library with the same name. 12 13 ## Encoder improvements 14 15 Improvements and new features used by the encoder include: 16 17 * Support for 16-bit unsigned and 32-bit floating point input buffers. 18 19 * Color space conversions, chroma subsampling and DCT are all done in floating 20 point precision, the conversion to integers happens first when producing 21 the final quantized DCT coefficients. 22 23 * The desired quality can be indicated by a distance parameter that is 24 analogous to the distance parameter of JPEG XL. The quantization tables 25 are chosen based on the distance and the chroma subsampling mode, with 26 different positions in the quantization matrix scaling differently, and the 27 red and blue chrominance channels have separate quantization tables. 28 29 * Adaptive dead-zone quantization. On noisy parts of the image, quantization 30 thresholds for zero coefficients are higher than on smoother parts of the 31 image. 32 33 * Support for more efficient compression of JPEGs with an ICC profile 34 representing the XYB colorspace. These JPEGs will not be converted to the 35 YCbCr colorspace, but specialized quantization tables will be chosen for 36 the original X, Y, B channels. 37 38 ## Decoder improvements 39 40 * Support for 16-bit unsigned and 32-bit floating point output buffers. 41 42 * Non-zero DCT coefficients are dequantized to the expectation value of their 43 respective quantization intervals assuming a Laplacian distribution of the 44 original unquantized DCT coefficients. 45 46 * After dequantization, inverse DCT, chroma upsampling and color space 47 conversions are all done in floating point precision, the conversion to 48 integer samples happens only in the final output phase (unless output to 49 floating point was requested).