Compression I - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

Compression I

Description:

String number. The next char from input. Example. LZW (variant of LZ78) ... [1] Initialize string table; [2] Prefix [C] empty; [3] K next character in charstream; ... – PowerPoint PPT presentation

Number of Views:24
Avg rating:3.0/5.0
Slides: 17
Provided by: Jie7
Category:

less

Transcript and Presenter's Notes

Title: Compression I


1
Compression (I)
  • RPI ECSE DocLab
  • Jie Zou

2
Compression is complicated!
  • Why so many algorithms?
  • Source coding / channel coding
  • Storage / Transmission
  • Lossy / Lossless compression
  • Visual files / General binary or ASCII files
  • Image / Video
  • Document image / Natural image / Graphics
  • We discuss only source coding, and mainly on
    document and natural image compression.

3
Typical Environment for Image Coding
Transmitter
Source encoder
Channel encoder
Image Source
Channel
Receiver
Channel decoder
Source decoder
Recovered image
4
Todays topics
  • Lossless compression algorithm
  • Run Length Coding (RLC)
  • Huffman coding
  • Dictionary based methods (LZW)
  • Lossy compression standards
  • JPEG / JPEG2000
  • MPEG-1, -2, -4

5
Run Length Coding (RLC)
  • Utilize the repetition of characters.
  • Mostly used for binary pictures (document
    images)
  • Examples
  • 0001111100111 ? 3523
  • 0011100011101 ? 233311
  • 101000000000 ? 01119

6
Dictionary Based Method
  • Principle replacing substrings with a codeword
    that identifies that substring in a dictionary.
  • All adaptive dictionary methods are based on the
    method proposed by Ziv and Lempel in 70.
  • LZ77, LZ78, LZW

7
LZ77
  • Codeword is a triple.
  • How far back to look
  • How long the phase is
  • The next char from input
  • Example
  • Gzip (variant of LZ77)

8
LZ78
  • Codeword is a pair
  • String number
  • The next char from input
  • Example
  • LZW (variant of LZ78)
  • More widely known and very interesting
  • Used in UNIX compress command, and GIF

9
LZW encoder
  • 1 Initialize string table
  • 2 Prefix C ? empty
  • 3 K ? next character in charstream
  • 4 Is CK in string table?
  • (Yes C ? CK)
  • (No add CK to the string table
  • output the code for C to the codestream
  • C ? K)
  • 5 Goto 3

10
LZW decoder
  • 1 Initialize string table
  • 2 Get first code ltcodegt
  • 3 Output the string for ltcodegt to the
    charstream
  • 4 ltoldgt ltcodegt
  • 5 ltcodegt ? next code in codestream
  • 6 Is ltcodegt in the string table?
  • (Yes output the string for ltcodegt to the
    charstream
  • ? translation of ltoldgt
  • K ? first character of translation for ltcodegt
  • add K to the string table)
  • (No ? translation for ltoldgt
  • K ? first character of
  • output K to charstream and add it to string
    table)
  • 7 ltoldgt ? ltcodegt
  • 8 Goto 5

11
Entropy
  • Entropy can be interpreted as the average amount
    of information that a message contains.
  • Entropy is the theoretically minimum possible
    average bit rate required in coding a message.

12
Huffman Coding
  • Shorter bits for more frequently appeared
    messages and longer bits for less frequently
    appeared messages.
  • Example 1.
  • Huffman coding is near optimal, but in general
    the average bits can not be as low as entropy.
  • Example 2.

13
Compression Standards
  • Bilevel images (documents, FAX)
  • CCITT G3, G4, JBIG, JBIG2 (Prof. Nagy will
    discuss them.)
  • Grayscale and color still images
  • JPEG (Joint Photographic Experts Group)
  • JPEG2000
  • Video
  • CCITT H.261, ITU-T H.320 and H.324, CCIR721 and
    723.
  • MPEG 1, 2, 4 (Moving Picture Experts Group ).

14
Baseline JPEG
15
Zigzag Scanning
16
MPEG Technique Overview Video Basics
  • I Frame, P Frame and B Frame
  • I Frame Intra Frame (similar to JPEG)
  • P Frame forward Predict future Frame
  • B Frame Bi-directional interpolated prediction
    frames
  • Motion Estimation
  • Basic premise most change due to movement
  • Coding only Residual Errors
Write a Comment
User Comments (0)
About PowerShow.com