Re: DCT coefficient quantization factors




In JPEG, after passing the pixel values thru DCT computation, we
quantatize it b4 encoding the code. I understand tat the quantization
matrix given can be scaled by a factor.
This is one way to setup a quantization matrix for an arbitrary quality. This is definitely not the only way to do it, but only a *recommendation*.


yes, for example, my implementation makes a pass over all the output DCT blocks, calculates the general energy distributions, and uses this, along with the quality factor, to attempt to come up with a "good" set of quantization values.

You can compute these by means of a lagrangian optimization, very much like JPEG2000 does, but you need to collect the data first. There's a nice work on this in the conference proceedings of the IEEE ISM this year. It helped to improve the PSNR a bit.

JPEG-1 does have a lossless mode, but that works completely different,
and not by setting quality to 100.


usually though, since 0 makes no sense in a quantizer table, one clamps the range to 1..255.

closest one can get to 100% quality is a quantizer table filled with all 1's...

That's in fact the best you can signal in the codestream, correct.

So long,
Thomas
.