DCT

Complete

Concept

Cosine transform

  • fourier transform but only with the cosine component
  • even signals can be represented with a linear combination of cosine fuctions
  • used in:
    • JPEG
    • MPEG

similarly, the DFT of an even signal real, but the DFT of an odd signal is imaginary

Discrete Cosine Transform(DCT)

  • like the DFT’s periodic assumption, but requiring symmetric extensions
  • different variations of tiling

dct_types.png

usually DCT-2 is used for compression

Even symmetry

  • symmetry removes the need for phase

DCT-2

  • tile by flipping

JPEG compression

  • lossy compression
  • 2D DCT and filtering out the high frequency components

Steps

  1. color space transform, RGB to YCbCr (Y = luminance, Cb = blue diff, Cr = red diff)
  2. image is divided into 8x8 chunks
  3. apply 2D DCT to each chunk
    • which yields an 8x8 set of coefficients for the 8x8 basis functions
      jpeg_dct_basis.png

note the high frequency allow for the most detail, filtering them out causes a loss in detail

  1. the coefficients are divided by the values in the quantization table and rounded
    • usually lowers the high frequencies until they are mostly 0
  2. RLE and huffman coding used to further compress the data
    • having many consecutive 0s is good for RLE

Frequency values

  • pixels(samples) can be represented by and transformed into independent basis functions(frequencies)