Previous | Next --- Slide 35 of 82
Back to Lecture Thumbnails
manugopa

How would an image have a negative DC term in the DCT basis? Wouldn't this necessitate negative values in the image?

alpaca

Looks like an image is converted to [-128, 127] value range before computing DCT. After decoding, 128 is added to reconstruct values in [0, 255]: https://en.wikipedia.org/wiki/JPEG#Decoding "Rounding the output to integer values (since the original had integer values) results in an image with values (still shifted down by 128) and adding 128 to each entry ... In general, the decompression process may produce values outside the original input range of [0,255]. If this occurs, the decoder needs to clip the output values"

clairezb

How do we get the DCT result matrix? Through Fourier analysis?

mithrandir

It's like the Discrete Fourier Transform, but only real numbers (hence "cosine" -- symmetric about 0).

anthonychen

How is the quantization matrix constructed? What's the math behind it that makes it zero out many coefficients?

mapqh

I have the same question as @anthonychen, looks like there's no general way to construct a quantization matrix or at least the base quantization matrix?

mithrandir

If StackOverflow can be considered a reputable source of info, check this out (https://stackoverflow.com/questions/29215879/how-can-i-generalize-the-quantization-matrix-in-jpeg-compression)

TLDR: The quantization matrix & its generation algorithms are considered a trade secret often. The base quantization matrix is public though, and seems to be an industry standard(maybe arrived at through trial and error?). Good quantization matrices produce high SNR for the reconstructed image.

@anthonychen, it zero's out coefficients by rounding after the divide (hence, quantization). (EX: bottom right, 2/99 = 0.020202 approx 0)

mershy

It is interesting how the quantization matrix is not symmetric, implying that human eyes seem to be more picky about high frequency information in a horizontal or vertical axis depending on the frequency (neither axis has larger quantization bases for all frequencies).

jtmoore

Why does a sparse matrix (with lots of 0s) save time/memory, if every element is the same datatype (int/float/etc.)?

movissup2

"Most of the world is low frequency"

renderMyCatsNow

@jtmoore https://en.wikipedia.org/wiki/Sparse_matrix You can check the storging a sparse matrix in here. TLDR: "In the case of a sparse matrix, substantial memory requirement reductions can be realized by storing only the non-zero entries."

jochuang

Interesting that so much of the world (ie. basically all jpegs) rely on a heuristically tuned quantaization matrix - wondering if there's a way to define a parametrized version of this

Please log in to leave a comment.