MMS Chapter 5
MMS Chapter 5
MMS Chapter 5
DEPARTMENT OF INFORMATION
MMS chapter 5 TECHNOLOGY 1
Multimedia Data Compression
MMS chapter 5 7
Con…
As with any communication, compressed data communication
only works when both the sender and receiver of the
information understand the encoding scheme.
Thus, compressed data can only be understood if
the decoding method is known by the receiver.
Basically, its all about saving resources and
money
8
MMS chapter 5
Is compression useful?
•Use to reduce the consumption of expensive resources, such as hard
disk space or transmission bandwidth requirement.
• save storage space requirement: handy for storing files as they take up less
room.
• Speed up document transmission time convenient for transferring files across
the internet as smaller files transfer faster
•On the downside, compressed data must be decompressed to be used, and this
extra processing may be detrimental to some applications.
•For instance, a compression scheme for video may require expensive hardware
for the video to be decompressed fast enough to be viewed as it's being
decompressed
•The option of decompressing the video in full before watching it may be
inconvenient, and requires storage space for the decompressed video.
MMS chapter 5 9
Trade offs in Data Compression
•The design of data compression schemes therefore involves trade-offs among
various factors, including
• The degree of compression
– To what extent the data should be compressed?
• The amount of distortion introduced
– To what extent quality loss is tolerated?
• The computational resources required to compress and
uncompress the data.
– Do we have enough memory required for compressing and
uncompressing the data?
MMS chapter 5 10
Types of Compression
MMS chapter 5 11
Data Compression
How is compression possible?
• Redundancy in digital audio, image, and
video data
• Properties of human perception
MMS chapter 5 12
Lossless and Lossy Compression
• Lossless compression does not lose any data in the compression process.
• – Lossless compression is possible because most real-world data has statistical
redundancy.
• It packs data into a smaller file size by using a kind of internal shorthand to signify
redundant data.
• If an original file is 1.5MB, this technique can reduce up to half of the original size.
For example, in English text, the letter 'e' is more common than the letter 'z', and the
probability that the letter 'q' will be followed by the letter 'z' is very small.
MMS chapter 5 13
Con…
• Lossless compression can recover exact original data after compression.
Lossless compression is
• used where media quality is of utmost importance and the larger space requirements
may be justified.
• used when it is important that the original and the decompressed data be identical
• It is used mainly for compressing database records, MRI scan for medical
information, spreadsheets, texts, executable programs, etc., where exact
replication of the original is essential & changing even a single bit cannot be
tolerated.
• GIF image files and WinZip use lossless compression.
• For this reason zip software is popular for compressing program and data
files.
MMS chapter 5 14
con…
• Lossless compression has advantages and disadvantages.
– The advantage is that the compressed file will decompress to
an exact duplicate of the original file, mirroring its quality.
– The disadvantage is that the compression ratio is not all that
high precisely because no data is lost.
• To get a higher compression ratio -- to reduce a file
significantly beyond 50% -- you must use lossy
compression.
MMS chapter 5 15
con..
• Lossy Data Compression :Throw away nonessential(perceptually
less relevant) parts of the data stream.
– For visual & audio data, some loss of quality can be tolerated without losing the
essential nature of the data where losses outside visual or aural perception can be
tolerated.
– In audio compression, for instance, non-audible (or less audible) components of the
signal are removed.
– This type of compression is used for image, audio and video type of multimedia content.
• induces information loss.
• The data produced by decompression is similar but not an exact copy of the original
data.
• Removes unessential information such as noise and undetectable details
MMS chapter 5 16
con….
• Lossy compression will strip a file of some of its redundant data.
Because of this data loss, only certain applications are fit for lossy
compression, like graphics, audio, and video.
–Lossy compression necessarily reduces the quality of the file to arrive at the
resulting highly compressed size.
• Lossy data compression will be guided by research on how people
perceive the data in question.
–For example, the human eye is more sensitive to subtle variations in
luminance (i.e. brightness) than it is to variations in color.
–JPEG image compression works in part by "rounding off" some of this less-
important information.
MMS chapter 5 17
Lossless vs. Lossy compression
• Lossless & lossy compression have become part of our every day vocabulary due to the
popularity of MP3 music file, JPEG image file, MPEG video file, …
–A sound file in WAV format, converted to a MP3 file will lose much data as MP3 employs a lossy compression;
resulting in a file much smaller so that several dozen MP3 files can fit on a single storage device, vs. a handful of
WAV files. However the sound quality of the MP3 file will be slightly lower than the original WAV. Have you
noticed that?
–JPEG uses lossy compression, while GIF follows lossless compression techniques
• Hence GIF compresses only up to 25%; as a result of which converting a GIF file to JPEG format will reduce it
in size. It will also reduce the quality to some extent.
• To compress video, graphics or audio, it is our personal choice and good results depend heavily
on the quality of the original file.
Lossless compression preserves all information Lossy compression creates much smaller files Be careful when repeatedly editing
lossy-format files
MMS chapter 5 18
Con…
• Some compression algorithms are capable of using different compression
ratios – leading to different qualities – the required bandwidth can be
negotiated.
• One algorithm different from the other by speed, quality, etc
• Lossy compression Algorithms :
• They are commonly used for image, video, and audio
compression .
• It include DCT (Discreet Cosine Transform), Vector Quantisation, etc.
• Lossless compression Algorithms:
• This type of algorithms are important mostly for text file.
• Examples: Run Length Encoding, Lempel Ziv (LZ), Huffman Coding.
MMS chapter 5 19
con….
• For symbolic data such as spreadsheets, text, executable programs, etc., loss
lessness is essential because changing even a single bit cannot be tolerated.
• Quality might play an important part in diagnosing faults from digitally stored
medical images like X-ray plates and ultra-sonographs.
• For visual and audio data, some loss of quality can be tolerated without losing the
essential nature of the data.
–By taking advantage of the limitations of the human sensory system, a great deal of space can
be saved while producing an output which is nearly indistinguishable from the original.
–In audio compression, for instance, non-audible (or less audible) components of the signal are
removed.
• Lossy compression is used for:
–image compression in digital cameras, to increase storage capacities with minimal
degradation of picture quality
–audio compression for Internet telephony and CD ripping, which is decoded by audio players.
–video compression in DVDs with MPEG format.
MMS chapter 5 20
Lossless vs. Lossy compression
• Generally, the difference between the two compression technique is that:
– Lossless compression schemes are reversible so that the original data can be
reconstructed,
– Lossless compression implies the original data is not changed
permanently during compression
– Lossless compression is also used when it is important that the original and the
decompressed data be identical, or when no assumption can be made on
whether certain deviation is uncritical
– Lossy schemes accept some loss of data in order to achieve higher compression.
• These lossy data compression methods typically offer a three-way
tradeoff between
– Computer resource requirement (compression speed, memory consumption)
– compressed data size and
– quality loss.
MMS chapter 5 21
Lossless vs. Lossy compression
In Lossy compression techniques, parts of the original data are
discarded permanently to reduce file size.
After decompression the original data cannot be recovered
which leads to a degradation of media quality. However if done
correctly the quality loss may not be immediately apparent
because of the limitations of the human eye and ears
Compression ratios of the order of 10 to 50 times may be
achieved by this method
The more tolerance for loss, the smaller the file can be
compressed, and the faster the file can be transmitted over a
network
MMS chapter 5 22
Compression ratio
MMS chapter 5 23
Example
• A source image file (256 × 256 pixels) with 65 536
bytes is compressed into a file with 16 384 bytes.
• compression ratio is 65 536 /16 384= 4,
• the compression factor is 1/4, and the saving
percentage is 75%.
The higher the compression ratio, the better the
lossless compression scheme, as long as it is
computationally feasible.
MMS chapter 5 24
Review excercise
............................ is the reduction in size of data in order to
save space or transmission time
MMS chapter 5 26