Open kornelski opened 9 years ago
Is the same optimization that https://github.com/mozilla/mozjpeg/issues/81 And similar to https://github.com/mozilla/mozjpeg/issues/182
In my opinion, this is a waste of time. A time that would be better spent implementing #182 and #223 -- which provide the best quantization table and the best DCT coefficients.
Scaling of quantization tables assumes that smaller divisors are always better, but that's not always true due to rounding errors.
An especially obvious case is when DC is quantized in a way that prevents it from hitting maximum value (i.e. 128 isn't evenly divisible by the DC coefficient):
quality = 9
quality = 6
e.g. imagine a source image posterized to 16 levels. For such image a DC coefficient = 16 is ideal, and 8 < DC < 16 are all worse, even though they're used at higher qualities.
I think quantization tables can be made a little better: