1
votes

I am trying to do image compression using DCT (Discrete Cosine Transform). Can someone please help me understand how masking affects bit per pixel in DCT? How is the bit allocation done in the masking?

PS: By masking, I mean multiplying the DCT coefficients with a matrix like the one below (element wise multiplication, not matrix multiplication).

mask = [1 1 1 1 0 0 0 0
        1 1 1 0 0 0 0 0
        1 1 0 0 0 0 0 0
        1 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0]

Background on "Masking"

Compression using the DCT calculates the DCT of blocks of an image, in this case 8x8 pixels. High frequency components of an image are less important for the human perception of an image and thus can be discarded in order to save space.

The mask Matrix selects which DCT coefficients are kept and which ones get discarded in order to save space. Coefficients towards the top left corner represent low frequencies.

For more information visit Discrete Cosine Transform.

1
Can you update your question and clarify, what you mean by "masking"?bjoernz
@bjoernz, i have updated it. hope i am more clear this time.Muk
This question is not directly related to programming; it is more about signal processing and Mathematics. Thus you should consider moving it to Signal Processing Stack Exchange or Mathematics Stack Exchange.KasparJohannes

1 Answers

0
votes

This looks like a variation of quantization matrix.

Low frequencies are in top left, high frequencies are in bottom right. Eye is more sensitive to low frequencies, so removal of high frequency coefficients will remove less important details of the image.