Sunteți pe pagina 1din 20

Preface and Introduction

C.M. Liu
Perceptual Lab, College of Computer Science
National Chiao-Tung University
http://www.cs.nctu.edu.tw/~cmliu/Courses/Compression/

Office: EC538
(03)5731877

cmliu@cs.nctu.edu.tw

Why Compress?
2

In the physical world

Not enough space and bandwidth

What about the digital world?


Q: Bandwidth/capacity grows exponentially--why bother?
A: Data is generated even faster!
Examples:
1 sec of CDDA audio:

44100 samples x 2 channels x 16 bits/sample = 1,411,200 bits

1 sec

of HD audio:

192,000 x 2 x 24/32 = 9,216,000/12,288,000 bits

1 sec

of CCIR 601 video = 20+ MB


1 VGA frame (RGB):

1024 x 768 x 24 = 18,874,368 bits

Why Compress? (2)


3

More examples
HDTV:
Up

to 2,985 Mbps (1920 x 1080 x 24 x 60)


HDMI cable 5-10 Gpbs
NHKs

8K:

7680

x 4320 x 24 x 30 = 23,880 Gpbs (!)


Compression
28Mbps 7-28Mbps
Video 24Gbps 180-600 Mbps
Audio

Why Compress? (3)


4

Bottom line--without compression:

Many applications/services will still not be feasible


E.g.,

Many others will be much more expensive


E.g.

streaming video
analog vs. digital cell phones

Why not keep data compressed at all times?

It is difficult to live out of a suitcase

Similarly, non-compressed data formats are related to data


acquisition/consumption, not efficient storage

Basic Terminology
5

original

Encoder

decompressed
Decoder

Lossless compression: x = x
A.k.a.

compressed

entropy coding, reversible coding

Lossy compression: x x
A.k.a.

irreversible coding

Basic Terminology (2)


6

Compression ratio: |x|/|y|


|x|

represents the number of bits in x

E.g.: |x|

= 65,536, |y| = 16384, compression = 4:1


Alt., data has been reduced by (|x|-|y|)/|y| = 75%

Other measures of coding performance


Bits

per sample

E.g.

ASCII: 8 bits/char, RGB: 24/48/72 bits/pixel

Distortion (lossy

methods)

The human-perceived/mathematical difference between x

and x

Modeling & Coding


7

Developing compression algorithms:


Phase

I: Modeling

Develop the

means to extract redundancy information


Redundancy => predictability
Phase

II: Coding

Binary representation of

the difference between the


model and the observed data
A.k.a. residual

Modeling & Coding Example #1


8

Consider the sequence:

Consider the model:

n = n + 8:
9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20

The residual

Sn = 9, 11, 11, 11, 14, 13, 15, 17, 16, 17, 20, 21
Binary encoding requires 5 bits/sample

en = Sn - n: 0, 1, 0, -1, 1, -1, 0, 1, -1, -1, 1, 1


Ex. coding: 00 <=> -1, 01 <=> 0, 10 <=> 1
2 bits/sample

Compression scheme == model + residual

Note that model also needs to be encoded (usually in the algorithm)

Modeling & Coding Example #2


9

Consider the sequence:

Consider the model:

1 = 0; n = Sn-1 for n > 1


0, 27, 28, 29, 30, 30, 32, 31, 31, 29, 28

The residual

Sn = 27, 28, 29, 30, 30, 32, 31, 31, 29, 28, 27

{en}= 27, 1, 1, 1, 0, 2, -1, 0, -2, -1, -1


Can be encoded with much fewer bits

Predictive coding

The use of previous samples to predict future samples


Very useful in exploiting temporal redundancies

E.g. in audio & video

Real-World Coding: Braille (1821)


10

Real-World Coding: Morse (1844)


11

Note differences in code lengths

Morse Code vs. Letter Frequencies


12

Generally, high/low frequency => short/long code

Not 100% consistent (e.g. l vs. m)

This is the rationale behind encoding scheme exploiting statistical


redundancy

Psychoacoustic Model

Psychoacoustic Modeling

Just-noticeable
Distortion

Frequency (kHz)

12

16

Visual Model

Image perceptual Models

Spectral Absorption of
Three Types of Cones

5. Error-Free Compression
Lossless Predictive Coding (c.2)

Laplacian
pdf

1 2e e
pe (e)
e
2 e

Summary
16

Notion of data compression


Lossless
Lossy

Basic approach behind compression algorithms:

Modeling + Coding + Perceptual Model

Presented some early examples of international


standardized encoding schemes:

Braille, Morse

Textbook(s)/Other Sources
17

Textbook:
Introduction to Data Compression, 3rd ed. by Khalid Sayood.
ISBN-10: 0-12-620862-X.
Presentation Materials Reference

http://roussev.net/6990/slides/
By Prof. Vassil Roussev

Other References
Image/Video/Audio Books

Preliminary List of Topics


18

Lossless compression
Intro/math

preliminaries (1 wk)
Huffman coding (1 wks)
Arithmetic coding (1 wks)
Dictionary techniques (1 wks)
Context-based compression (1 wk)

Preliminary List of Topics (2)

Lossy compression
Math

preliminaries (1 wk)
Perceptual Model (2 wks)
Scalar quantization (1 wk)
Vector quantization (1 wk)
Transform/Subband Coding (1 wk)
Audio coding (2 wks)
Video compression(2 wks)
Final on everything w/ emphasis on 2nd half
19

Grading & Time


20

Grade
Programming Assignments
Written Homework
Midterm Exam
Final Exam

Time

Monday: 9:00 -10:00. EC 022

Homework Review

Monday: 4:30 -6:30. EC???

Presentation

25%
20%
30%
30%

S-ar putea să vă placă și