0% found this document useful (0 votes)
87 views52 pages

Chapter 3

Uploaded by

Dawit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views52 pages

Chapter 3

Uploaded by

Dawit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 52

CHAPTER THREE

Multimedia Data Compression 1


MULTIMEDIA DATA COMPRESSION
 Multimedia data compression involves reducing the size of
multimedia files (which can include text, audio, images, and
video) without excessively compromising their quality.
 This process is essential because multimedia files tend to be
large and can consume significant storage space and
bandwidth.
 Compression can be achieved through various techniques and
algorithms, aiming to make the storage, transmission, and
processing of multimedia data more efficient.

2
MULTIMEDIA DATA COMPRESSION
 Measuring data compression involves assessing the efficiency
of a compression algorithm in reducing the size of data.
 The primary metric used for this purpose is the compression
ratio, which compares the size of the compressed data to the
original size of the data.
 This ratio provides a quantitative measure of the effectiveness
of the compression.

3
MULTIMEDIA DATA COMPRESSION
 The formula for the compression ratio (CR) is:
 ​The compression ratio can be expressed as a ratio (e.g., 2:1) or
as a numerical value (e.g., 2).
 A higher compression ratio indicates more efficient
compression, meaning the compressed file is significantly
smaller than the original file.
 Another related measure is the space savings, which tells you the
percentage of space saved by compression.
 It is calculated as:
 This formula gives you the percentage reduction in size from the
original data to the compressed data, providing another
perspective on the efficiency of the compression process. 4
MULTIMEDIA DATA COMPRESSION
 Both the compression ratio and space savings are useful for
evaluating and comparing compression algorithms or settings,
especially when optimizing for storage space or transmission
speed while maintaining acceptable data quality.

5
DATA REDUNDANCY
 Data redundancy in multimedia data compression refers to the
presence of repetitive or unnecessary information within
multimedia files, including images, audio, and video.
 Reducing this redundancy is the key to effective compression,
allowing the file size to be minimized without significantly
impacting the perceived quality of the content.
 There are several types of data redundancy commonly targeted
in multimedia data compression:

6
DATA REDUNDANCY
1. Spatial Redundancy: This occurs when there are patterns,
textures, or areas of uniform color within an image or video
frame. Compression algorithms can exploit this redundancy
by encoding these areas more efficiently, storing information
about the patterns or colors once, rather than repeatedly.
2. Temporal Redundancy: In video data, temporal redundancy
happens when consecutive frames are similar or identical,
such as in a static scene with minimal movement. Video
compression techniques can take advantage of this by only
storing the differences between frames instead of the entire
frame each time.
7
DATA REDUNDANCY
3. Spectral Redundancy: This is relevant in color images and video,
where there is often correlation between the different color
channels (e.g., RGB). Compression algorithms can transform the
color space to a format where the redundancy can be more easily
reduced.
4. Psycho-visual Redundancy: This involves information that may
be present in the media but is imperceptible or less significant to
human perception. For example, certain audio frequencies may be
inaudible to humans, or small color changes in an image may not
be noticeable. Lossy compression techniques often reduce this
type of redundancy by prioritizing the retention of perceptually
significant information. 8
DATA REDUNDANCY
 Reducing data redundancy effectively requires a careful
balance to maintain the quality and integrity of the multimedia
content while achieving significant compression.
 The specific strategies and algorithms used can vary widely
depending on the type of media and the intended use of the
compressed file.

9
COMPRESSION WITH LOSS AND LOSSLESS
 Compression techniques, whether for data in general or
multimedia content specifically, can be broadly classified into
two categories based on how they handle the original data:
lossless compression and lossy compression.
 Both approaches aim to reduce file sizes, but they do so in
different ways and are suitable for different types of data and
applications.

10
LOSSLESS COMPRESSION
 Lossless compression reduces file size without any loss of
quality or data.
 When a file is decompressed after lossless compression, it will
be identical to its original state before compression.
 This method is essential for applications where the exact
preservation of data is critical, such as text documents,
executable files, and certain image formats (like PNG).

11
LOSSLESS COMPRESSION
 Advantages: No loss of information, allowing for perfect
reconstruction of the original data.
 Disadvantages: Generally, achieves lower compression ratios
compared to lossy compression, especially for media files like
images and videos where perceptual nuances can be exploited
for further size reduction.
Common Lossless Compression Algorithms:
 Huffman coding
 Lempel-Ziv-Welch (LZW)
 DEFLATE (used in ZIP files and PNG images)

12
LOSSY COMPRESSION
 Lossy compression significantly reduces file sizes by
permanently eliminating certain parts of the data deemed less
important, based on the intended use and perceptual
characteristics of the human senses.
 This approach is often used for multimedia data (audio,
images, videos) where a reduction in quality is acceptable if it
leads to substantial decreases in file size.

13
LOSSY COMPRESSION
 Advantages: Achieves much higher compression ratios than
lossless compression, making it ideal for reducing the storage
and bandwidth requirements of multimedia content.
 Disadvantages: The loss of data is irreversible, which might
result in a noticeable decrease in quality if compressed too
aggressively or if the compressed file is intended for use in a
high-quality setting.
Common Lossy Compression Techniques:
 JPEG (for images)
 MPEG and H.264/H.265 (for videos)
 MP3 and AAC (for audio)
14
CHOOSING B/N LOSSLESS AND LOSSY
COMPRESSION
 The choice between lossless and lossy compression depends
on the specific requirements of the application and the nature
of the data being compressed.
 For archival purposes or for data where precision is
paramount, lossless compression is necessary.
 On the other hand, for streaming media or where storage and
bandwidth are limited, the more substantial size reductions
offered by lossy compression might be preferable, as long as
the quality remains good enough for the intended audience.

15
ENTROPY CODING
 Entropy coding is a fundamental method used in multimedia
data compression to reduce the size of digital files, such as
images, audio, and video.
 It is a form of lossless compression that works by encoding
the more frequent elements in the data with shorter codes and
the less frequent elements with longer codes.
 The principle behind entropy coding is to take advantage of
the statistical properties of the data, particularly the varying
occurrence frequencies of different elements (e.g., pixels in an
image, audio samples, symbols in a text file).
16
ENTROPY CODING
 The concept of "entropy" in this context comes from
information theory, where it is a measure of the randomness or
unpredictability of information content.
 In practical terms, entropy coding aims to minimize the
average length of the codes assigned to each element, thereby
reducing the total amount of data required to represent the
original content without loss.
 Two widely used entropy coding techniques in multimedia
compression are:

17
ENTROPY CODING
1. Huffman Coding: This is a variable-length code method where the most
common symbols are represented with the shortest codes and the least
common symbols with the longest codes. Huffman coding is optimal in
the sense that it produces the lowest possible average code length for a
given set of symbol frequencies. It is used in many compression
standards, including JPEG for images.
2. Arithmetic Coding: Arithmetic coding is more complex than Huffman
coding but can achieve slightly better compression ratios. Instead of
assigning separate codes to individual symbols, it encodes the entire
message into a single number, a fraction in the range [0,1). It does this by
successively narrowing down the range of possible values based on the
sequence of symbols in the input. Arithmetic coding can effectively
handle symbols with probabilities that are not powers of two, making it
18
more efficient in some cases than Huffman coding.
ENTROPY CODING
 Both Huffman and arithmetic coding are examples of entropy
coding methods that rely on the statistical properties of the
data to achieve compression.
 These techniques are particularly effective for data with
significant redundancy and predictable patterns, making them
key components of lossless compression algorithms and used
in the final stages of many lossy compression schemes to
efficiently encode residual information.

19
HUFFMAN CODING
 Huffman coding is a widely used method of entropy coding used
for lossless data compression.
 Developed by David A. Huffman in the 1950s, it is a variable-
length code algorithm that assigns shorter codes to more frequent
symbols and longer codes to less frequent symbols based on their
occurrence probabilities.
 The result is an optimal way to reduce the average code length
and, thereby, the overall size of the data.

20
HUFFMAN CODING
Advantages of Huffman Coding:
 Efficiency: Huffman coding is optimal in the sense that it
minimizes the average code length, making it very efficient for
data compression.
 Flexibility: It can be applied to any type of data (text, images,
audio, etc.).
 Simplicity: The algorithm is straightforward to implement.
Disadvantages:
 Variable Length: Huffman codes are variable in length, which can
lead to inefficiencies if the symbol distribution is not well-suited to
this type of coding.
 Static Model: The standard Huffman coding algorithm does not 21
adapt to changing symbol frequencies within a data stream.
HUFFMAN CODING
 Huffman coding remains a cornerstone of many compression
algorithms and is often used in combination with other
compression techniques to achieve higher compression ratios.

22
ARITHMETIC CODING
 Arithmetic coding is a form of entropy coding used in lossless
data compression.
 Unlike other techniques that work by replacing symbols with
fixed-length codes or variable-length codes (like Huffman
coding), arithmetic coding encodes the entire message into a
single number, a fraction in the range between 0 and 1.
 This method can achieve higher compression ratios, especially
for sources with a high degree of redundancy, and is
particularly effective when dealing with symbols that have
very low probabilities of occurrence.
23
ARITHMETIC CODING
Advantages of Arithmetic Coding:
 Efficiency: Can achieve higher compression ratios than other
methods, especially for symbols with very low probabilities.
 Flexibility: Can be adapted to different symbol probabilities
dynamically, making it suitable for adaptive encoding.
Challenges with Arithmetic Coding:
 Computational Complexity: The encoding and decoding processes
involve multiple steps of multiplication and division, making
arithmetic coding more computationally intensive than some other
methods.
 Precision Requirements: Because the method narrows down an
interval to represent the entire message, it requires high precision 24
arithmetic to handle very small interval sizes, especially for long
PREDICTIVE CODING
 Predictive coding is a technique used in multimedia data
compression, especially for images and videos, which reduces
file size by exploiting the redundancy inherent in the data.
 Instead of encoding the actual content directly, predictive
coding encodes the differences (or residuals) between the
actual values of pixels (in images) or frames (in videos) and
their predicted values.
 These predicted values are calculated using algorithms based
on the properties of neighboring pixels or preceding frames.

25
PREDICTIVE CODING
 Predictive coding is particularly effective for data types with a
high degree of correlation between neighboring elements, such as
natural images and video sequences, where adjacent pixels or
consecutive frames often have similar values.
 By encoding only the differences, predictive coding significantly
reduces the amount of data needed to represent the original
content.
Two common applications of predictive coding are:
 Differential Pulse Code Modulation (DPCM) for audio and simple
image compression, where each sample is predicted from previous
samples.
 Motion Estimation and Compensation in video compression (e.g., 26
in MPEG and H.264 codecs), where the movement of objects
PREDICTIVE CODING
 Predictive coding can be used as part of both lossy and lossless
compression schemes. In lossless compression, the exact
differences are encoded, allowing perfect reconstruction of the
original data.
 In lossy compression, the differences may be further quantized to
achieve higher compression ratios at the cost of some loss of
fidelity.

27
ADAPTIVE CODING
 Adaptive coding, in the context of data compression, refers to
algorithms that adjust their encoding strategy based on the
data being processed, in real-time.
 Unlike static coding schemes, where the encoding process is
based on a fixed set of rules or patterns determined before the
compression starts, adaptive coding algorithms modify their
rules and parameters dynamically as they process the data.
 This allows them to efficiently handle diverse or changing
data characteristics, often resulting in better compression
ratios and more flexibility.
TYPES OF ADAPTIVE CODING
1. Adaptive Huffman Coding: This variant of Huffman coding updates its
frequency table and, consequently, the Huffman tree, as new data is
processed. It starts with no prior knowledge of the data frequencies and
adjusts as data comes in, allowing it to effectively compress data with
varying or unknown symbol distributions.
2. Adaptive Arithmetic Coding: Like adaptive Huffman coding, adaptive
arithmetic coding adjusts its probability model for symbols as it
encodes or decodes data. This allows it to maintain high efficiency even
when the data characteristics change over time.
3. Adaptive Run-Length Encoding (RLE): In cases where data contains
sequences of repeated symbols or patterns, an adaptive RLE algorithm
can adjust its encoding strategy based on the length and frequency of
these runs, optimizing its output for the current data. 29
ADAPTIVE CODING
Advantages of Adaptive Coding
 Flexibility: Adaptive coding can handle a wide range of data
types and distributions without needing prior knowledge of
the data characteristics.
 Efficiency: By continuously updating its model of the data,
adaptive coding can achieve higher compression ratios,
especially for data with changing patterns or distributions.
 Simplicity: For some applications, adaptive coding algorithms
can be simpler to implement than their static counterparts
because they don't require a separate step to build a model of
the data before compression.
30
ADAPTIVE CODING
Disadvantages of Adaptive Coding
 Computational Overhead: Continuously updating the encoding model
requires additional computations, which can increase the processing
time and resource consumption, especially for large datasets.
 Initial Compression Efficiency: At the start of the compression process,
when less data has been seen, the efficiency of adaptive coding may be
lower than static methods pre-tuned to the data characteristics.
 Adaptive coding is particularly useful in scenarios where the data
characteristics are not fully known in advance or when those
characteristics may change over time.
 It's widely used in streaming data compression, real-time
communication systems, and applications where the data is generated or
collected incrementally. 31
DICTIONARY-BASED CODING (LZW) LEMPEL-
ZIVWELCH
 Lempel-Ziv-Welch (LZW) is a dictionary-based coding
algorithm for lossless data compression.
 It was developed by Abraham Lempel, Jacob Ziv, and Terry
Welch in the early 1980s.
 LZW is notable for its simplicity and efficiency, especially in
scenarios where the data contains repeated sequences or
patterns.
 It's widely used in various applications, including file
compression (like in the .zip format), GIF images, and the
TIFF image format.
32
DICTIONARY-BASED CODING (LZW) LEMPEL-
ZIVWELCH
How LZW Works:
 LZW compression builds a dictionary of substrings
encountered in the input data stream and encodes the data as a
series of codes (indices into the dictionary), which are
typically shorter than the original sequences.
 The algorithm starts with a dictionary containing all possible
single-character strings (given the alphabet used in the data),
and then dynamically adds new entries for longer sequences
encountered in the input.

33
AUDIO COMPRESSION
 Audio compression is a technique used to reduce the size of
audio files or streams without significantly impacting the
quality of the audio experience for listeners.
 It can be applied through either lossless or lossy methods,
depending on the requirements for audio quality, file size, and
application context.

34
DPCM AUDIO COMPRESSION
 Differential Pulse Code Modulation (DPCM) is a method of
digitally representing analog signals that is widely used in
audio compression.
 The core principle behind DPCM is to exploit the
predictability of the successive samples in an audio signal to
reduce the bitrate needed for digital representation.
 Instead of encoding the absolute value of each sample, DPCM
encodes the difference between an actual audio sample and its
predicted value, based on previous samples.
 This difference is generally smaller than the original signal
values, which leads to a more efficient, compressed digital
35
representation.
DPCM AUDIO COMPRESSION
Advantages of DPCM:
 Bitrate Reduction: By encoding differences that are typically smaller
than the absolute sample values, DPCM can achieve a lower bitrate
compared to PCM (Pulse Code Modulation), which encodes the
absolute values directly.
 Adaptability: The predictor in DPCM can be adapted to the
characteristics of the signal, allowing for better performance in terms of
signal-to-noise ratio (SNR) for specific types of audio content.
Limitations:
 Quantization Noise: The quantization step introduces noise, which can
become perceptible if the quantization step size is too large compared
to the signal variation.
 Predictor Complexity: The effectiveness of DPCM greatly depends on 36
DPCM AUDIO COMPRESSION
 DPCM is especially effective for signals where consecutive
samples do not vary greatly, such as in speech signals or in
audio signals with limited high-frequency content.
 It serves as a basis for more advanced audio compression
techniques, including Adaptive DPCM (ADPCM), which
dynamically adjusts the quantization step size and the
predictor coefficients based on the signal characteristics to
further improve compression efficiency and signal quality.

37
ADPCM AUDIO COMPRESSION
 Adaptive Differential Pulse Code Modulation (ADPCM) is an
audio compression technique that extends the principles of
Differential Pulse Code Modulation (DPCM) by adapting the
quantization step size dynamically based on the signal's
characteristics.
 ADPCM aims to achieve higher compression ratios than
standard PCM and DPCM while maintaining good audio
quality.
 It does so by more efficiently encoding the range of
differences between predicted and actual audio samples,
adjusting to the signal's variability over time.
38
ADPCM AUDIO COMPRESSION
Advantages of ADPCM:
 Efficiency: By adjusting the quantization step size, ADPCM
can more efficiently compress a wider range of audio signals
compared to PCM and DPCM, offering a good compromise
between file size and quality.
 Flexibility: The adaptive nature of the quantization allows
ADPCM to handle diverse audio content, from human speech
to complex music, more effectively than non-adaptive
methods.
 Low Complexity: Despite its adaptiveness, ADPCM remains
relatively simple and low in computational complexity,
39
making it suitable for real-time applications and devices with
LPC AUDIO COMPRESSION
 Linear Predictive Coding (LPC) is an advanced audio
compression technique primarily used for speech signals.
 LPC operates on the principle that a speech signal can be
approximated as a linear combination of past signal samples.
 This method is particularly effective for compressing voice
audio because it models the human vocal tract's behavior,
which produces speech sounds through a series of filters.

40
LPC AUDIO COMPRESSION
Advantages of LPC:
 High Compression Ratio: LPC can achieve high compression
ratios, especially for speech audio, by efficiently modeling the
vocal tract with a small number of parameters.
 Low Bitrate: It is suitable for applications requiring low-
bitrate transmission, such as telecommunications and voice
assistants, due to its efficient representation of speech.
 Quality: While highly compressed, LPC-generated speech
retains intelligibility and can be of sufficient quality for many
applications involving voice communication.
41
LPC AUDIO COMPRESSION
 LPC's focus on modeling the vocal tract and its effectiveness
in compressing speech audio make it distinct from other
general audio compression techniques that might prioritize
music or broader ranges of sound.
 Its use in voice-related technologies highlights its importance
in facilitating efficient digital communication.

42
CELP AUDIO COMPRESSION
 Code-Excited Linear Prediction (CELP) is an advanced audio
compression technique predominantly used for speech
compression.
 CELP combines the principles of Linear Predictive Coding
(LPC) with codebook-driven excitation, making it highly
efficient for compressing speech signals with good quality at
low bit rates.
 It's especially favored in telecommunications, such as mobile
telephony and Voice over IP (VoIP), due to its balance between
compression efficiency and audio quality.
43
CELP AUDIO COMPRESSION
Advantages of CELP:
 High Quality at Low Bit Rates: CELP achieves high-quality
speech reproduction at low bit rates (ranging from 4.8 kbps to
16 kbps), making it ideal for bandwidth-constrained
applications.
 Flexibility: The technique is adaptable to various speech
characteristics, ensuring consistent quality across different
speakers and speech content.
 Widespread Use: CELP and its variants (such as Enhanced
Variable Rate Codec, EVRC, and Adaptive Multi-Rate, AMR)
are standardized and used widely in mobile and digital
44
telephony systems.
CELP AUDIO COMPRESSION
 CELP's efficient handling of speech signals, balancing
compression and quality, has made it a cornerstone in digital
voice communication, enabling clear and intelligible speech
transmission even under limited bandwidth conditions.

45
IMAGE COMPRESSION
 Image compression is a process used to reduce the size of
digital images, thereby decreasing storage requirements, and
speeding up file transfers without significantly impacting the
visual quality for the intended use.
 This process is crucial for web development, digital
photography, and online content sharing, where bandwidth and
storage efficiency are important.
 Image compression can be either lossless or lossy, depending
on whether the process allows for perfect reconstruction of the
original image.
46
IMAGE COMPRESSION
Lossless Compression
 Description: Lossless compression algorithms reduce the file
size without losing any image data or quality. The original
image can be perfectly reconstructed from the compressed
version.
 Techniques: Common lossless image compression algorithms
include Run-Length Encoding (RLE), Huffman Coding, and
PNG (Portable Network Graphics) format.
 Use Cases: Essential for applications where image integrity is
critical, such as medical imaging, technical drawings, and
archival purposes.
47
IMAGE COMPRESSION
Lossy Compression
 Description: Lossy compression algorithms achieve higher
compression ratios by selectively discarding less important
information, leading to a reduction in image quality that might
be imperceptible to the human eye.
 Techniques: Widely used lossy compression methods include
JPEG (Joint Photographic Experts Group) and WebP formats,
which are particularly effective for compressing photographic
images.
 Use Cases: Commonly used for web images, social media,
digital photography, and any application where slight
48
decreases in image quality are acceptable in exchange for
IMAGE COMPRESSION
Key Concepts in Image Compression
 Bit Depth: Refers to the number of bits used to represent each
pixel's color in an image. Reducing bit depth can decrease file
size but also reduces color fidelity.
 Resolution: Lowering the resolution (number of pixels) of an
image reduces its file size but also affects its clarity and detail,
especially when viewed at large sizes or on high-resolution
displays.
 Chroma Subsampling: A technique used in lossy compression
for color images, based on the principle that the human eye is
less sensitive to color detail than to luminance. It reduces the
49
resolution of the chroma (color) information more than the
JPEG
 JPEG (Joint Photographic Experts Group) image compression
is one of the most widely used methods for compressing
photographic images.
 The JPEG standard utilizes a lossy compression technique,
which means that some original image information is lost
during the compression process, but in such a way that the
loss is generally imperceptible to the human eye.
 This allows JPEG files to be significantly smaller than their
uncompressed counterparts, making them ideal for use on the
web, in digital photography, and for storing large numbers of
images where disk space is at a premium.
50
JPEG
Advantages of JPEG Compression:
 Efficiency: JPEG can achieve high compression ratios,
significantly reducing file sizes without noticeable loss in
image quality for most applications.
 Flexibility: The compression level can be adjusted, allowing a
trade-off between image quality and file size according to the
user's needs.
 Popularity and Compatibility: JPEG is supported by virtually
all web browsers, image editing software, and digital cameras,
making it a universal format for digital images.
51
JPEG
Considerations:
 Lossy Compression: The lossy nature of JPEG means that
some original image detail is permanently lost, which can
become noticeable at high compression levels or after
repeatedly saving the image.
 Artifacts: High levels of compression can lead to visible
artifacts such as blackiness, blurring, and "ringing" around
edges.
 JPEG's balance between compression efficiency and image
quality, along with its widespread support, has made it the
format of choice for a vast array of digital imaging
52
applications.

You might also like