Docsity

The JPEG Image Compression Standard: Principles and Techniques, Slides of Multimedia Applications

Partial preview of the text

Download The JPEG Image Compression Standard: Principles and Techniques and more Slides Multimedia Applications in PDF only on Docsity!

JPEG

The JPEG Standard

  • JPEG is an image compression standard which

was accepted as an international standard in

  • Developed by the Joint Photographic Expert Group of the ISO/IEC
  • For coding and compression of color/gray scale images
  • Yields acceptable compression in the 10:1 range

The JPEG Standard

  • JPEG is effective because of the following

three observations

  • Image data usually changes slowly across an image, especially within an 8x8 block - Therefore images contain much redundancy
  • Experiments indicate that humans are not very sensitive to the high frequency data images - Therefore we can remove much of this data using transform coding

The JPEG Standard

  • Humans are much more sensitive to

brightness (luminance) information than to

color (chrominance)

  • JPEG uses chroma subsampling (4:2:0)
  • The following slide gives an overview of the

various steps in JPEG compression

DCT on Image Blocks

  • The image is divided up into 8x8 blocks
    • 2D DCT is performed on each block
    • The DCT is performed independently for each block
    • This is why, when a high degree of compression is requested, JPEG gives a “blocky” image result

Quantization

  • Quantization in JPEG aims at reducing the

total number of bits in the compressed image

  • Divide each entry in the frequency space block by an integer, then round
  • Use a quantization matrix Q ( u , v )

Quantization

  • Multiple quantization matrices can be used

(perhaps by scaling the defaults), allowing the

user to choose how much compression to use

  • Trades off quality vs. compression ratio
  • More compression means larger entries in Q
  • An example of JPEG coding and decoding on one image block is shown next

Preparation for Entropy Coding

  • We have seen two main steps in JPEG coding:

DCT and quantization

  • The remaining steps all lead up to entropy

coding of the quantized DCT coefficients

  • These additional data compression steps are lossless
  • Most of the lossiness is in the quantization step

Zigzag Scan in JPEG

Run-Length Coding

  • Now the RLC step replaces values in a 64-vector

(previously an 8x8 block) by a pair (RUNLENGTH, VALUE), where RUNLENGTH is the number of zeroes in the run and VALUE is the next non-zero value

  • From the first example we have (32, 6, -1, -1, 0, -1, 0, 0, 0, - 1, 0, 0, 1, 0, 0, …, 0)
  • This becomes (0,6) (0,-1)(1,-1)(3,-1)(2,1)(0,0) - Note that DC coefficient is ignored

Entropy Coding

  • Now we apply entropy coding to the RLC coded AC

coefficients and the DPCM coded DC coefficients

  • The baseline entropy coding method uses Huffman coding on images with 8-bit components
  • DPCM-coded DC coefficients are represented by a pair of symbols (SIZE, AMPLITUDE) - SIZE = number of bits to represent coefficient - AMPLITUDE = the actual bits

Entropy Coding

  • The size category for the different possible

amplitudes is shown below

  • DPCM values might require more than 8 bits and might be negative

Huffman Coding for AC Coefficients

  • AC coefficients have been RL coded and

represented by symbol pairs (RUNLENGTH,

VALUE)

  • VALUE is really a (SIZE, AMPLITUDE) pair
    • RUNLENGTH and SIZE are each 4-bit values stored in a single byte - Symbol - For runs greater than 15, special code (15, 0) is used
    • Symbol2 is the AMPLITUDE
    • Symbol1 is run-length coded, Symbol 2 is not

JPEG Modes

  • JPEG supports several different modes
    • Sequential Mode
    • Progresssive Mode
    • Hierarchical Mode
    • Lossless Mode
  • Sequential is the default mode
    • Each image component is encoded in a single left- to-right, top-to-bottom scan - This is the mode we have been describing