Data Compression 3 - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

Data Compression 3

Description:

JPEG was designed for natural image compression ... The compression ratio and the quality of the decoded images is controlled by ... – PowerPoint PPT presentation

Number of Views:33
Avg rating:3.0/5.0
Slides: 20
Provided by: soeU
Category:

less

Transcript and Presenter's Notes

Title: Data Compression 3


1
Data Compression (3)
  • Hai Tao

2
JPEG Compression
  • JPEG is the image compression standard developed
    by the Joint Photographic Experts Group
  • JPEG was designed for natural image compression
  • It convert the original image into YIQ space and
    compress each channel as a separate gray image
  • The compression ratio and the quality of the
    decoded images is controlled by quality factor
    (1-100)
  • Quality factor gt 35 - no big difference
  • Quality factor lt 10 significant difference

3
Quality factor

Quality factor 20
Original
Quality factor 75
Quality factor 5
4
JPEG Compression Algorithm Overview
  • An input image is divided into 8x8 blocks. Each
    block is encoded based on DCT transform
  • DCT coefficients are quantized according to a
    quatization matrix
  • Entropy coding is used to encode positions and
    the magnitudes of the coefficients



5
Color space conversion
  • Human visual system has less resolution in color
    than in intensity. As a result, the original
    color images are converted into intensity and
    color channels. One such transformation is
    RGB-gtYIQ

6
JPEG 8x8 DCT Transformation
  • After DCT compression, only a few DCT
    coefficients have large values in each 8x8 block
  • These coefficients are floating-point numbers



7
Quantization of the DCT Coefficients
  • Each coefficients are converted into an integer
    number using quatization
  • The choices of quatization steps
  • Large quantization step - Large rounding errors,
    smaller quantized values
  • Small quatization step Small rounding errors,
    large quantized coefficients
  • The same quatization step for all coefficients ?
    Human visual system is more sensitive to
    relative low frequency changes in images, which
    implies that for high frequency coefficients,
    larger quantization steps can be used without
    causing noticeable image distortion
  • What does all this means ?

8
JPEG Quantization Matrix
  • The low frequency coefficients (upper-left
    corner) have smaller quantization steps,
    therefore more accurately encoded

9
JPEG Quantization Using the Quantization Matrix
After quantization
Before quantization
After reconstruction
10
Encoding
  • We need to compress the quantized coefficients
  • Lossless methods are used to
  • Encode the position of non-zero coefficients
  • Encode the magnitudes of these coefficients

11
Encoding
  • Zig-Zag encoding of coefficient positions
  • Non-zero coefficients and the number of 0s in
    front of them are encoded along the zig-zag path

12
Example
  • The following quantized coefficient matrix is
    represented as
  • (30,0), (-7,1), (-12, 0), (-8, 0), (-1, 0),
    (1,1),(6,0),(-5,0),(-7,0),(-3,0),
  • (1,1), (-1,3),(-3,1),(-4,0), (-1,0), (4,0),
    (3,0),(-3,11),(1,0), (-1,0),(end)
  • These pairs are encoded using a entropy coding
    method

13
JPEG bit stream

14
JPEG Bitstream
  • Terminology
  • Frame image
  • Block 8x8 image block
  • Segment a group of blocks
  • Frame header
  • Sample precision (width, height) of image
    number of components unique ID (for each
    component) horizontal/vertical sampling factors
    (for each component) quantization table to use
    (for each component)

15
JPEG Bitstream
  • Scan header
  • Number of components in scan component ID (for
    each component) Huffman table for each component
    (for each component)
  • Misc. (can occur between headers)
  • Quantization tables Huffman Tables Arithmetic
    Coding Tables Comments Application Data

16
Various JPEG modes
  • Baseline/Sequential
  • Lossless mode
  • Progressive mode
  • Display low quality image first, and then
    transmit and display more details
  • Method 1 Send DC components first, then a few
    low frequency components, and then more
    components
  • Method 2 Send significant bits first, then more
    less significant bits

17
Decoding
  • Decoding is the inverse process of the encoding
  • Recover the quantized coefficient matrix
  • Recover the coefficient matrix
  • IDCT
  • JPEG is lossy because of the quatization process

18
Evaluation
  • To evaluate an image compression algorithm, there
    are two criteria
  • Subjective - The visual quality vs. bit rate
    (subjective)
  • Objective - The rate distortion curve (Peak SNR
    vs. bit rate)

The difference image when the quality factor is 3
19
Evaluation
  • The rate distortion curve
Write a Comment
User Comments (0)
About PowerShow.com