Multimedia Communications

Download Report

Transcript Multimedia Communications

Image Compression
GIF, TIFF
1
GIF: Graphics Interchange Format
Basic mode
A LZW method
Dynamic mode
2
GIF Interlaced Mode
3
TIFF: Tagged Image File Format


Supports pixel resolution up to 48 bits (16x3)
Intended for transfer both images and digitized
documents in different formats



Code #1: uncompressed format
Code # 2, 3, 4: digitized document
Code # 5: LZW-compressed
4
Digitized Documents

FAX:



T4(Group 3)
T6 (Group 4) for ISDN
Use modified Huffman
codes
5
Image Compression
JPEG
6
What is the JPEG?

JPEG: Joint Photographic Experts Group



general-purpose compression standard of
for continuous-tone still image (gray scale and color)
jointly developed by ITU-T and ISO
Encoding modes




Lossless mode
Sequential DCT-based mode (baseline mode)
Progressive DCT-based mode
Hierarchical mode
7
JPEG Encoding
Sequential (baseline) mode
Hierarchical mode
Progressive mode
8
Progressive Mode

Each image component is encoded in multiple
scans


Bit rate is same with that of sequential mode


Successive refinement on a rough image untill
reaching the requested quality
a kind of data re-ordering
Preview image can be generated without he
need to completely decode the image
9
Hierarchical Mode



A progressive presentation
Encodes an image at multiple resolutions
For a low resolution display device a ‘best’ image is
available



Hierarchical mode : without receiving unnecessary data for
higher resolution
Progressive mode : only after the total transmission time for the
full-resolution
Hierarchical mode is more effective in network
environment
10
Major Steps of Image Compression

Picture (Image) Preparation



Picture (Image) Processing: source coding


forward DCT
Quantization: lossy


analogue-to-digital conversion through sampling
A picture is divided into blocks of 8x8 pixels
mapping of the real numbers into integers
Entropy Encoding: lossless


Run length coding
Huffman coding or Arithmetic coding
Picture
Uncompressed
Preparation
Picture
Picture
Processing
Quantization
Entropy
Encoding
Compressed
Picture
11
JPEG Encoder Schematic
12
Image Preparation

Separation of source image into color components

1 ~ 255 components (or plane)


Each component may have different horizontal resolution


e.g.) 1 component for gray-scale image, 3 components for RGB, or
YCbCr
e.g.) YUV: 4:2:0 format
Subdivision of components into 8x8 pixel blocks


noninterleaved date ordering: component by component
interleaved data ordering
13
Image/Block Preparation
Block preparation
14
JPEG Compression/Decompression
Compression Steps
Decompression Steps
15
Discrete Cosine Transform


One-dimensional DCT: used in audio
Two-dimensional DCT: used in image



Spatial or temporal domain  frequency domain
Each 8x8 block of samples is transformed
Intuition

Sampled values usually vary slightly from point to point



Coefficient of the low frequency  high value
Coefficient of high frequencies  small or zero
Human eyes is highly sensitive at low-intensity levels, whereas
its sensitivity is greatly reduced at high-intensity levels

A reduction of the number of high-frequency DCT coefficients
weakly affects image quality
16
Forward DCT (1)

In theory, DCT is lossless.


In practice, information is lost because of truncation
errors in calculation
Forward DCT
i  0,1,...,7, j  0,1,...,7
7
7
1
(2 x  1)i
((2 y  1) j
F [i, j ]  C (i)C ( j ) P[ x, y] cos
cos
,
4
16
16
x 0 y 0
where C (i)  C ( j ) 
1
2 , for i, j  0
1, otherwise
17
Forward DCT(2)
18
Forward DCT (3)
v
y
64 DCT
coefficients
FDCT
Spatial domain
x
u
Frequency domain
19
Quantization



64 DCT coefficients are
quantized according to an
quantization table specified by
application.
Lossy
Quantization levels are
different for each frequency



more precise level for low
freq.
determined by experiments
Quantization matrices are
suggested by JPEG
20
Entropy Encoding

DC coefficients from consecutive DCT blocks


AC coefficients


Differential encoding
Run-length encoding
Then, Huffman encoding is used
21
Vectoring using zig-zag scan

Data reordering: zigzag sequence

low frequency comes first (larger values come first)
22
Differential Encoding

DC coefficients in consecutive quantized blocks



12, 13, 11, 11, 10, …
 12, 1, -2, 0, -1, …
Encoded in the form (SSS, value), where SSS: # of
bits needed to encode the value
23
Run-length Encoding

Remaining 63 AC coefficients in the vector may
contain long strings of zeros

Use RLE: (skip, value),
where skip: # of zeros in the run, value: next nonzero
coefficient

(0,6)(0,7)(0,3)(0,3)(0,3)(0,2)(0,2)(0,2)(0,2)(0,0)
(0,0) indicates the end of the string for this block
The value field is encoded in the form SSS/value

24
Huffman Encoding

JPEG provides the Huffman code tables used
with DC and AC coefficients for both luminance
and chrominance

Arithmetic encoding is also specified in JPEG, but
protected by patent
25
Frame Building

Frame header contains


Width and height of a
complete image/picture
Number and type of
components


Digitization format



(CLUT, RGB, YCbCr)
(4:2:2, 4:2:0, etc)
Scan: contains a
component
Scan header contains



Identity of components
(R/G/B)
# of bits used to digitize
each component
Quantization table
26
JPEG Decoding


In progressive mode, first the DC and low-frequency coefficients of
each block are sent
In hierarchical mode, the total image is first sent using a low
resolution – i.e. 320x240 – then at high resolution 640x480
27