Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fine-tune quantization table coefficeints from DCT data #150

Open
kornelski opened this issue Jan 10, 2015 · 2 comments
Open

Fine-tune quantization table coefficeints from DCT data #150

kornelski opened this issue Jan 10, 2015 · 2 comments

Comments

@kornelski
Copy link
Member

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
gray background

quality = 6
white background

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:

  1. Gather unquantized DCT coefficients for the entire image
  2. For each quantization table coefficient check whether higher quantization divisor gives smaller quantization error
@JosePineiro
Copy link
Contributor

Is the same optimization that #81
And similar to #182

@jrmsmith
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants