Compression of Multimedia Data
• The growth of computing and multimedia
technology has also resulted in an increasing
demand for massive multimedia data and
applications.
• It is not unusual to become so frustrated waiting
for a huge graphic to download and open.
What is Compression why is it important?
• Compression is a process of deriving more
compact or smaller representations of data.
• E.g An uncompressed image with a resolution of
640 x 480 pixels has a total of 307200 pixels.
• A true colour (24 bit) image of that size takes
about 1 MB of storage space (each pixel uses 3
How much space then is needed to store an
uncompressed 2-hour video on a full screen of 1024
x 768 pixels?
Quality of Service (QoS) is increasingly becoming
an important issue in distributed multimedia
systems
Therefore compression is necessary especially of
video. This is because video consumes the largest
size of storage space compared to other elements of
multimedia like animation, graphics, and text.
Compression reduces the memory space.
Hence to provide cost effective solutions most
multimedia systems use compression techniques.
2
Furthermore sending multimedia data over a
computer network consumes large amounts of
bandwidth.
Relying on higher bandwidths is not a good option
M25 Syndrome: traffic will always increase to fill
the current bandwidth limit whatever this is.
Compression HAS TO BE part of the representation
of audio, image, and video formats.
Multimedia data compression is thus very important
as it affects computing performance.
3
Compression basically employs redundancy in the
data:
Temporal in 1D data, 1D signals, audio, between
video frames etc.
Spatial correlation between neighbouring pixels or
data items.
Spectral e.g. correlation between colour or
luminescence components. This uses the frequency
domain to exploit relationships between frequency of
change in data.
Psycho-visual exploit perceptual properties of the
human visual system.
4
Lossy and Lossless Compression
•Compression techniques or algorithms can be divided
into two main groups namely, lossy and lossless.
•Lossy and lossless compressions are terms used to
describe whether or not, in the compression of a
file, all original data can be recovered when the file is
decompressed.
•When you want to compress lets say a Word
document, you must be able to decompress it back later
to a perfect original file without losing even a single
character.
•This type of compression is known as lossless
compression.
•With this type of compression, every single bit of data
that was originally in the file still remains after the file5
However, for audio and video which are large (data
size), you may need to compress it down to as little
as 5% of its original size.
In this case you need the lossy compression
technique. With lossy compression however, some
data is actually lost.
However, being ordinary human beings, we are not
able to notice the tiny losses with our naked eye.
6
Lossless Compression
•Lossless type of data compression refers to the way
of reducing the number of data bits.
•With lossless compression each bit of original data in
the file remains after the file is decompressed.
•Traditional lossless data compression techniques can
potentially free up more than 50% of the memory
resources (Ekman and Stenstrom, 2005).
•A lossless type of algorithm will not affect or change
the contents of the data. There will be no significant
change in the data.
•Lossless data compression allows the exact original
data to be reconstructed from the decompressed data,
as opposed to lossy data compression
7
Lossless data compression is used in the popular
ZIP file format for WinZip applications.
Some image file formats such as Portable Network
Graphics (PNG), Graphics Interchange Format
(GIF), and Tagged Image File Format (TIFF) also
use lossless compression.
Lossless compression is also used in audio file
formats like Windows Media Audio (WMA
Lossless) and RealPlayer.
Examples of Lossless compression
1. Simple Repetition Suppression
If a sequence a series on n successive tokens appears;
• Replace series with a token and a count number of
occurrences. 8
Usually need to have a special flag to denote when
the repeated token appears.
Example:
89400000000000000000000000000000000
Can be replaced with:
894f32 where f is the flag for zero.
• Fairly straight forward to understand and
implement.
• Simplicity is however its downfall:
• Has poor compression ratios.
• Compression savings depend on the content of the
data.
9
Applications of this simple compression technique
include:
•Suppression of zeros in a file (Zero Length
Suppression)
•Silence in audio data, pauses in conversation etc.
• Sparse matrices.
•Component of JPEG.
•Bitmaps, e.g. backgrounds in simple images.
•Blanks in text or program source files.
2. Run-length Encoding (RLE)
•This encoding method is frequently applied to
graphics-type images (or pixels in a scan line)
•It is also a component used in JPEG compression
pipeline 10
Basic RLE Approach (e.g. for images):
•Sequences of image elements X 1,X2,...,X1 (row by
row).
•Mapped to pairs (c1,L1),(c2,L2),...,(cn,L1), where ci
represent image intensity or colour and Li the length of
the i-th run of pixels.
•(Not dissimilar to zero length suppression above.)
Example
Original sequence: 111122233333311112222
can be encoded as: (1,4),(2,3),(3,6),(1,4),(2,4)
How Much Compression?
The savings are dependent on the data: In the worst
case (random noise) encoding is more heavy than
original file: 2×integer rather than 1×integer if original
data is integer vector/array. 11
3. Basic Pattern Substitution
Replace all occurrences of pattern of characters ‘and’
with the predefined code ’&’. So: and you and I
becomes: & you & I
12
Lossy Compression
•The main reason we use the lossy type of compression
is to control the size of the multimedia data.
•However, when the data is decompressed, it must
be still in the original quality, if not 100% perfect.
•The percentage of lossy compression usually is larger
in magnitude compared to lossless techniques.
•Therefore this technique is the most suitable way to
compress audio and video.
•The weakness with lossy compression formats is that
they suffer from generation loss. This means that when
you repeatedly compress and decompress the file, the
quality will gradually decrease.
13
For image compression, the lossy compression
standard that is often used is that of the Joint
Photographic Experts Group (JPEG).
For video compression, the techniques are those of
the Moving Picture Experts Group(MPEG) and
Flash.
For Audio compression, MP3 (MPEG-1 Audio
Layer 3) is the best technique.
An original CD-quality can be compressed down to
1/10th of its original size, and yet the quality still
remains superb
14