Professional Documents
Culture Documents
Introduction
• Video and audio have much higher storage
requirements than text
• Data transmission rates (in terms of
bandwidth requirements) for sending
continuous media are considerably higher
than text
• Efficient compression of audio and video
data, including some compression standards,
will be considered in this chapter
Motivation for Compression
• Terminology
– 1 kbit = 1000 bit
– 1 Kbit = 1024 bit (= 210)
– 1 Mbit = 1024 x 1024 bit (= 210 * 210 = 220)
• Discrete Data: Considering a small window of 640 x
480 pixels on a display
– Text
– Vector Image
– Bitmap Image
• Continuous Data: Required storage space per
second
– Uncompressed speech of telephone quality
– Uncompressed stereo audio signal of CD quality
– Video sequence
Motivation for Compression:
Discrete Data
• Text
– Assuming 2 bytes are used for every 8 x 8 pixel character,
• Character per screen page = ...
• Storage required per screen page = ...
• Vector Image
– Assuming that a typical image consists of 500 lines, each of which
is defined by its coordinates in the x direction and the y direction,
and an 8-bit attribute field
• Coordinates in the x direction require ...
• Coordinates in the y direction require ...
• Bits per line = ...
• Storage required per screen page
Motivation for Compression:
• Bitmap Image
– Assuming using 256 colors requiring a single byte per pixel
• Storage required per screen page = ...
Continuous Data
• Uncompressed speech of telephone
quality
– Assuming being sampled at 8 kHz and
quantized using 8 bit per sample yielding a
data stream of 64 Kbit/second
• Storage space required per second = ...
Motivation for Compression:
• Uncompressed stereo audio signal of
CD quality
– Assuming being sampled at 44.1 kHz and
quantized using 16 bits
• Data rate = ...
• Storage space required per second = ...
Continuous Data
• Video sequence
Motivation for Compression:
– Assuming 25 full frames per second, luminance
and chrominance of each pixel are coded using
3 bytes, luminance sampled at 13.5 MHz while
chrominance (R-Y and B-Y) is sampled at 6.75
MHz, each, and samples are uniformly coded
using 8 bits.
• Bandwidth = ...
• Data Rate = ...
• Storage space required per second = ...
Motivation for Compression:
Continuous Data
• Processing uncompressed video data streams
requires
– Storage space in the gigabyte – Buffer space in
the megabyte
– Data transfer rates of 140 Mbit/s [per
unidirectional connection]
• These requirements can be considerably
lowered by employing compression
Can Multimedia Data be
Significantly Compressed?
• Redundancy can be exploited to do
compression
• Spatial redundancy
– correlation between neighboring pixels in
image/video
• Spectral redundancy
– correlation among colors
• Psycho-visual redundancy
– Perceptual properties of human visual system
What Makes “Good” Compression
• Quality of compressed and decompressed data
should be as good as possible
• Compression/decompression process should be as
simple as possible
• Decompression time must not exceed certain
thresholds
• [De]/Compression requirements can be divided
into
– Dialogue mode (video conferencing)
– Retrieval mode (digital libraries)
– Both
Coding Requirements: Dialogue
Mode
• End-to-end delay does not exceed 150
ms for compression and decompression
alone.
– Ideally, compression and decompression should
not exceed 50ms in order to ensure natural
dialogue.
• In addition
– delay in the network,
– communications protocol processing in the end system,
– data transfer to and from the respective input and output
devices.
Codes /
Codewords Decoder
B0 = # bits required before compression (decompression)
B1 = # bits required after compression
Output Data
Compression Ratio = B0 / B1.
Compression Techniques
Coding Type Basis Run- Technique
length Coding
Entropy Huffman Coding
Encoding Arithmetic Coding
DPCM
Prediction
DM
FFT
Transformation
DCT
Source Coding
Bit Position
Layered Coding Subsampling
Sub-band Coding
Vector Quantization
JPEG
MPEG
Hybrid Coding
H.263
Many Proprietary Systems
Compression Techniques
• Entropy Coding
– Semantics of the information to be encoded are ignored
– Lossless compression technique
– Can be used for different media regardless of their
characteristics
• Source Coding
– Takes into account the semantics of the information to be
encoded.
– Often lossy compression technique
– Characteristics of medium are exploited
• Hybrid Coding
– Most multimedia compression algorithms are hybrid techniques
Entropy Encoding
• Information theory is a discipline in applied mathematics involving
the quantification of data with the goal of enabling as much data as
possible to be reliably stored on a medium and/or communicated
over a channel.
• According to Claude E. Shannon, the entropy η(eta) of an
information source with alphabet S = {s1, s2, ..., sn} is defined as
pi
i=1 pi i=1
where pi is the probability that symbol si in S will occur.
Entropy Encoding
• In science, entropy is a measure of the disorder of a
system.
– More entropy means more disorder
– Negative entropy is added to a system when more order is
given to the system.
• The measure of data, known as information entropy, is
usually expressed by the average number of bits needed
for storage or communication.
– The Shannon Coding Theorem states that the entropy is the best
we can do (under certain conditions). i.e., for the average length
of the codewords produced by the encoder, l’,
η ≤ l’
Entropy Encoding
• Example 1: What is the entropy of an image with
uniform distributions of gray-level intensities (i.e.
pi = 1/256 for all i)?
• Example 2: What is the entropy of an image
whose histogram shows that one third of the
pixels are dark and two thirds are bright?
Entropy Encoding: Run-Length
• Data often contains sequences of identical bytes.
Replacing these repeated byte sequences with the
number of occurrences reduces considerably the
overall data size.
• Many variations of RLE
– One form of RLE is to use a special marker M-byte that
will indicate the number of occurrences of a character
• “c”!#
– How many bytes are used above? When do you think the M-byte
should be used?
• ABCCCCCCCCDEFGGG
is encoded as Note: This encoding is DIFFERENT
Entropy Encoding: Run-Length
from what is mentioned in your book
ABC!8DEFGGG
Huffman Coding
• Example