You are on page 1of 42

Introduction to Compression

Fundamentals


6/23/2014

2
Compression Fundamentals (1)
Digital images have very large storage, processing
and communication requirements.
Example: a 2kx2k, 8-bit gray-scale image needs:
4 Mbytes storage space
18 minutes to send on a 28Kbps channel
Compression saves storage space and channel
bandwidth
Compression is Enabling Technology in:
Multimedia computing, i.e., use of computers in printing,
publishing and video processing
Enhanced resolution of imaging sensors and television
Video conferencing, remote sensing, document and
medical imaging, Fax, etc.






6/23/2014

3
Compression Fundamentals (2)
Two types of compression schemes
Lossless: the decoded image is numerically
identical to the original image
Modest compression ratios: up to 4:1
Example: Huffman, arithmetic, Ziv-Lempel, JPEG-LS
Applications: storage of legal documents, medical
images, etc.
Lossy: Aim is to maximize the compression ratio
while maintaining the required level of signal
quality.
Some degradation allowed in visually less significant
areas
High compression ratios: up to 80:1



6/23/2014

4
Compression Fundamentals (3)
Lossy compression (contd..)
Example: DPCM, Fractal, DCT transform, Wavelet
Applications: consumer applications, telebrowsing,
etc.
Visually lossless is a type of lossy compression
Redundancy in image data
Interpixel redundancy
Spectral redundancy
Psychovisual redundancy (wait for next slide)
Coding redundancy




6/23/2014

5
Compression Fundamentals (4)
Interpixel redundancy
Values of adjacent pixels are
highly correlated, also known
as spatial redundancy
Interframe redundancy
Spectral redundancy
Correlation between different color planes or
spectral bands, e.g., RGB to YUV 4:1:1
Psychovisual redundancy
Human Visual System (HVS) does not respond
with equal sensitivity to all visual information


6/23/2014

6
Compression Fundamentals (5)
Psychovisual redundancy (contd..)
Some visual information has less relative importance
than other
For example, HVS is less sensitive to very high and
very low intensity than medium intensity. This can be
exploited in Quantization
HVS is more sensitive to edges or textures than
random intensity variations
Coding redundancy
Based on entropy of source data
Can be exploited by using variable length codes
e.g., Huffman codes, arithmetic codes


6/23/2014

7
Performance Parameters (1)
Two of the error metrics used to compare the various image
compression techniques are the Mean Square Error (MSE) and the
Signal to Noise Ratio (SNR).
The MSE is the cumulative squared error between the compressed
and the original image, whereas SNR is a measure of the peak
error.
Two objective measures are used:




N M
k j f k j f
NM
MSE
j k 0 0
2
)] , ( ' ) , ( [
1
MSE
signal peak
dB SNR
2
) _ (
log 10 ) (
10

Here, peak_signal represents peak-to-peak value of original image data




6/23/2014

8
Performance Parameters (2)
Compression ratio (CR)
Defined as ratio of original bit-rate to
compressed bit-rate
Also represented in terms of bits per pixel
(bpp) or bits per second (bps)
Complexity
Computational efforts required to implement
the encoding and decoding algorithms
Measured in terms of arithmetic capability and
memory requirements
Also measured in terms of code size and
power consumption


6/23/2014

9
Performance Parameters (3)
Communication delay
Complexity is also associated with processing
delay in the encoder and decoder
Very important in real time applications


6/23/2014

10
Image Compression System (1)
Basic structure of image compression systems
Source
Image

data
Encoder
model
Descriptors
Model tables
Encoder
statistical
model
Symbols
Entropy
encoder
Compressed
image
data
Entropy coding tables
JPEG entropy encoder
Source
image data
SourceE
ncoder
Compressed
image data
Source
Decoder
Reconstructed
image data
Encoder Structure:


6/23/2014

11
Image Compression System (2)
Decoder structure:
Reconstr.
image
data
Compressed
image
data
Decoder
model
Model tables
Entropy
decoder
Symbols
Decoder
statistical
model
Entropy coding tables
JPEG entropy decoder
Descriptors


6/23/2014

12
Entropy Coder
After the data has been quantized into a finite set of values, it can
be encoded using an Entropy Coder to give additional
compression.
By entropy, we mean the amount of information present in the
data, and an entropy coder encodes the given set of symbols
with the minimum number of bits required to represent them.
Two of the most popular entropy coding schemes are Huffman
coding and Arithmetic coding.
A good introduction to Huffman coding can be found in
"A Closer Look at Huffman Encoding" at
http://www.rasip.fer.hr/research/compress/algorithms/fund/huffman/
A good introduction to Arithmetic coding can be found in
"Arithmetic Coding+Statistical Modelling=Data Compression" at
http://dogma.net/markn/articles/arith/part1.htm
H.Witten, M.Neal and G.Cleary, "Arithmetic Coding For data
Compression",
Communications of the ACM, Vol. 30, No. 6 (June 1987), Pages 520-
540.



6/23/2014

13
Image Encoding
Original data
Mapper Quantizer
Symbol
Encoder
Compressed
data
Transforms original
Data
Gets the
transformed
coefficients
Quantizes the
Mapper output
coefficients
Encodes the
quantized
coefficients


6/23/2014

14
Image Decoding
Compressed
data
Symbol
Decoder
Dequantizer Inverse Mapper
decompressed
data
Decodes the
compressed data
De-quantizes
transformed
coefficients
Inverse transform
on the coefficients


6/23/2014

15
Image Encoding (1)
Mapper
Transforms input data into a format designed
to reduce interpixel redundancies
Facilitates exploitation of redundancies in the
later stages
Generally reversible operation
May or may not directly result in compression
Run-length coding
Discrete cosine transform
Prediction and error symbol in DPCM


6/23/2014

16
Image Encoding (2)
Quantizer
Reduces the accuracy of mappers output
Designed according to psychovisual
properties
Irreversible operation, not used in lossless
compression
Symbol Coder
Represents Quantizer output by fixed- or
variable length codes
e.g., assigns shortest code words to the most
frequently occurring symbols
Reversible


6/23/2014

17
Example: JPEG
DCT
Entropy
Coder
DCT
Original
Image
Compressed
Data
Quantizer
Quantization
Table
8x8 blocks
Deal with AC and DC terms separately
Fixed quantization table chosen by user input
parameter(s)
DC: Huffman Coder
AC: Arithmetic Coder


6/23/2014

18
Transforms
Discrete Cosine Transform (DCT):
good for very large size image (resolution
higher than 1024 by 1024)
Blocking Wavelet Transform:
less computation complexity than global
wavelet transform
Global Wavelet Transform:
good for small or middle size image


6/23/2014

19
Quantization (1)
Maps a continuous variable u into a discrete
variable u, which takes values from a finite
set {r
1
, r
2
, , r
L
} of numbers
Quantization rule:
Define {t
k
, k = 1, 2, , L+1} as a set of increasing
decision levels, of u
If u lies in interval [t
k
, t
k+1
], then it is mapped to r
k
,
the kth reconstruction level
In uniform quantization, transition and
reconstruction intervals are uniform


6/23/2014

20
Quantization (2)
u
u
r
1
r
2
r
L
r
k
t
1
t
L+1
t
k
t
2
Quantizer output
Input is 0.0 to 10.0
Quantization levels: 100
Quantization interval = 0.1
For input 5.25, Quantized
value is 5.25/0.1 = 53; r
k
=
53x0.1 = 5.3

Interval (t
k+1
- t
k
) = (r
k+1
- r
k
)
Quantization noise: 0 to
(t
k+1
- t
k
)/2 or (0 to 0.5)



t
L


6/23/2014

21
Material to be studied from Text Book
Coding Redundancy (Section 8.1.1)
Source Encoder and Decoder (Section
8.2.1)
Huffman Coding (Section 8.4.1, pages 441-
42)
Bit-plane Coding (Bit-plane decomposition;
pages 448-452)
Lossless Predictive coding (Section 8.4.4)
CLASS NOTES (Transform coding in
particular)


6/23/2014

22




Introduction to JPEG2000


6/23/2014

23
JPEG 2000 Standardization
JPEG stands for Joint Photographic Experts
Group
Web site: www.jpeg.org
ISO/IEC JTC 1/SC 29/WG 1


6/23/2014

24
JPEG2000 Objectives
Superior low bit rate compression
Lossless and lossy compression in a
single code-stream
Can handle large images: 64K by 64K
Progressive transmission by pixel
accuracy and resolution
Region of interest (ROI) coding capability
Transmission in noisy wireless
environments


6/23/2014

25
JPEG 2000 Applications
Internet
Mobile
Printing
Scanning
Digital Photography
Remote Sensing
Facsimile
Medical
Digital Libraries
E-Commerce


6/23/2014

26
JPEG 2000 vs. JPEG baseline (at 0.125 bpp)


6/23/2014

27
JPEG 2000 vs. JPEG baseline (at 0.25 bpp)


6/23/2014

28
JPEG 2000 Encoding Scheme


6/23/2014

29
Example: original bike image, 8 bpp, 2048x2560


6/23/2014

30
Example: progressive by quality, Visually lossless
bike_full, 3.065 bpp, PSNR = 49.33 dB


6/23/2014

31
Example: progressive by quality, bike_25, 0.25 bpp,
PSNR = 29.55 dB


6/23/2014

32
Example: progressive by quality, bike_125, 0.125
bpp, PSNR = 24.67 dB


6/23/2014

33
Example: progressive by quality, bike_0625, 0.0625
bpp, PSNR = 21.51 dB


6/23/2014

34
Example: progressive by quality, bike_03125,
0.03125 bpp, PSNR = 19.06 dB


6/23/2014

35
Example: Progressive by size (spatial resolution)
bike_half, 0.71 bpp, 32.9 dB
bike_quat
bike_oct
bike_hex


6/23/2014

36
Original image fr1782, 8 bpp, 640x480


6/23/2014

37
Example: Visually lossless image (3.19 bpp)


6/23/2014

38
Example: Progressive by quality (0.20 bpp)


6/23/2014

39
Example: Progressive by quality (0.10 bpp)


6/23/2014

40
Example: Progressive by quality (0.05 bpp)


6/23/2014

41
Region of Interest (ROI) (1)
Reconstruction of specific parts of image
with higher fidelity than rest of image
Two types:
ROI during encoding: useful when geometry of
desired region known before encoding
ROI during decoding: useful for example in
interactive browsing of image from a remote
database




6/23/2014

42
Example: ROI; image compressed at 0.05 bpp
ROI

You might also like