SlideShare a Scribd company logo
1 of 54
BY
Ziyad
Lossy Compression
Algorithms
•Distortion Measures
•The Rate-Distortion Theory
•Quantization
•Uniform Scalar Quantization
•Nonuniform Scalar Quantization
•Vector Quantization
•Transform Coding
•Discrete Cosine Transform (DCT)
outline
Outline
• 2D Discrete Cosine Transform (2D DCT)
• 1D Discrete Cosine Transform (1D DCT)
• 1D Inverse Discrete Cosine Transform
(1D-IDCT)
• One-Dimensional DCT
• The Cosine Basis Functions
• 2D Basis Functions
• Wavelet-Based Coding
• 2D Haar Wavelet Transform
• Discrete Wavelet Transform*
• 2D Discrete Wavelet Transform
What is lossy compression?
 The compressed data is not the same as
the original data, but a close approximation
of it.
Yields a much higher compression ratio than
that of lossless compression.
Distortion Measures
A distortion measure is a mathematical
quantity that specifies how close an
approximation is to its original, using
some distortion criteria. When looking at
compressed data, it is natural to think
the distortion :in terms of the numerical
difference between the original data and
the reconstructed data. However, when
the data to be
compressed is an image, such a measure
may not yield the intended result.
Distortion Measures
 The three most commonly used distortion measures in image
compression are:
 mean square error (MSE) σ2,
(8.1)
where xn, yn, and N are the input data sequence, reconstructed data
sequence, and length of the data sequence respectively.
 signal to noise ratio (SNR), in decibel units (dB),
(8.2)
where σ2 x is the average square value of the original data sequence
and σ2d is the MSE.
 peak signal to noise ratio (PSNR),
(8.3)
2
10 2
10log x
d
SNR



2
10 2
10log peak
d
x
PSNR


2 2
1
1 ( )
N
n n
n
x y
N


 
The Rate-Distortion Theory
 Lossy compression always involves a tradeoff
between rate and distortion. Rate is the average
number of bits required to represent each source
symbol. Within this framework, the tradeoff between
rate and distortion is represented in the form of
a rate-distortion function R(D).
 Intuitively, for a given source and a given distortion
measure, if D is a tolerable amount of distortion,
R(D) specifies the lowest rate at which the source
data can be encoded while keeping the distortion
bounded above by D. It is easy to see that when D =
0, we have a lossless compression of the source.
 The rate-distortion function is meant to describe a
fundamental limit for the performance of a coding
algorithm and so can be used to evaluate the
performance of different algorithms.
Figure 8.1 shows a typical rate-distortion function.
Notice that the minimum possible rate at D = 0, no
loss, is the entropy of the source data. The distortion
corresponding to a rate R(D) ⇒ 0 is the maximum
amount of distortion incurred when “ nothing ” is
coded.
Quantization
Quantization in some form is the heart of any
lossy scheme. Without quantization, we would
indeed be losing little information. Here, we
embark on a more detailed discussion of
quantization. The source
we are interested in compressing may contain
a large number of distinct output values
(or even infinite, if analog).
To efficiently represent the source output, we
have to reduce the number of distinct values
to a much smaller set, via quantization.
Quantization
Each algorithm (each quantizer) can be
uniquely determined by its partition of the
input range, on the encoder side, and the set
of output values, on the decoder side.
The input and output of each quantizer can be
either scalar values or vector values, thus
leading to scalar quantizers and vector
quantizers.
In this section, we examine the design of both
uniform and nonuniform scalar quantizers and
briefly introduce the topic of vector
quantization (VQ).
Uniform Scalar Quantization
A uniform scalar quantizer partitions the domain
of input values into equally spaced intervals,
except possibly at the two outer intervals. The
endpoints of partition intervals are called the
quantizer’s decision boundaries. The output or
reconstruction value corresponding to each
interval is taken to be the midpoint of the
interval.
The length of each interval is referred to as the
step size, denoted by the symbol .
Uniform scalar quantizers are of two types:
midrise and midtread.
A midrise quantizer is used with an even
number of output levels, and a midtread
quantizer with an odd number. The midrise
Uniform Scalar Quantization
 The midtread quantizer has zero as one of its
output values, hence, it is also known as dead-
zone quantizer, because it turns a range of
nonzero input values into the zero output.
 The midtread quantizer is important when source data
represents the zero value by fluctuating between
small positive and negative numbers. Applying the
midtread quantizer in this case would produce an
accurate and steady representation of the value zero.
For the special case = 1, we can simply compute
the output values for
 these quantizers as
Qmidrise(x) = [x]− 0.5
Uniform Scalar Quantization
 The goal for the design of a successful uniform quantizer is
to minimize the distortion for a given source input with a
desired number of output values. This can be done by
adjusting the step size to match the input statistics.Let’s
examine the performance of an M level quantizer .
Let B = {b0, b1, . . . , bM} be the set of decision boundaries
and Y = {y1, y2, . . . , yM} be the set of
reconstruction or output values. Suppose the input is
uniformly distributed in the interval [−Xmax, Xmax].
The rate of the quantizer is:
 R = [log2 M].
 That is, R is the number of bits required to code M things—in this
case, the M output levels.
 The step size is given by
 = 2Xmax
 M
R = [-1.5,1.5] , M = 4 level , X = [1.2,-0.2 ,0.1,-
1.2]
2.Xmax
= m
= 2. 1.5 = 3 = 0.75
m 4
X = 0.75 + 1.5 = 1.125
2
EX:
Example
 For the following sequence {1.2,-0.2,-0.5,0.4,0.89,1.3…}, Quantize it using a
 uniform quantizer in the range of (-1.5,1.5) with 4 levels, and write the
quantized sequence.
 Solution: Q=3/4=0.75. Quantizer is illustrated below.
 Quantized sequence:
 {1.125,-0.375,-0.375,0.375,1.125,1.125}
 Yellow dots indicate the partition levels (boundaries between separate
quantization intervals)
 Red dots indicate the reconstruction levels (middle of each interval)
 1.2 fall between 0.75 and 1.5, and hence is quantized to 1.125
Nonuniform Scalar
Quantization
 If the input source is not uniformly distributed, a
uniform quantizer may be inefficient.
 Increasing the number of decision levels within
the region where the source is densely distributed
can effectively lower granular distortion. In
addition, without having to increase the total
number of decision levels, we can enlarge the
region in which the source is sparsely distributed.
Such nonuniform quantizers thus have
nonuniformly defined decision boundaries.
 There are two common approaches for
nonuniform quantization: the Lloyd–Max
quantizer and the companded
quantizer.
Vector Quantization
 One of the fundamental ideas in Shannon’s
original work on information theory is that any
compression system performs better if it operates
on vectors or groups of samples rather than on
individual symbols or samples . We can form
vectors of input samples by concatenating a
number of consecutive samples into a single
vector.
 For example, an input vector might be a segment
of a speech sample, a group of consecutive
pixels in an image, or a chunk of data in any other
format. The idea
behind vector quantization (VQ) is similar to that
Vector Quantization
Instead of representing values within an
interval in one-dimensional space by a
reconstruction value, as in scalar
quantization,
 VQ an n-component code vector represents
vectors that lie within a region in n-
dimensional space.
A collection of these code vectors forms the
codebook for the vector quantizer.
Transform Coding
 From basic principles of information theory, we know
that coding vectors is more efficient than coding
scalars. To carry out such an intention, we need to
group blocks of consecutive samples from the source
input into vectors.
 Let X = {x1, x2, . . . , xk }T be a vector of samples.
Whether our input data is an image, a piece of music,
an audio or video clip, or even a piece of text, there is
a good chance that a substantial amount of
correlation is inherent among neighboring samples xi .
 The rationale behind transform coding is that if Y is
the result of a linear transform T of the input vector X
in such a way that the components of Y are much
less correlated, then Y can be coded more efficiently
than X.
 Generally, the transform T itself does not
compress any data. The compressio n comes
Discrete Cosine Transform
(DCT)
 The Discrete Cosine Transform (DCT)
a widely used transform coding technique,
is able to perform decorrelation of the input signal in a
data-independent,
 Because of this, it has gained tremendous popularity .
Definition of DCT
Let’s start with the two-dimensional DCT. Given a
function f (i, j) over two integer variables i and j
(a piece of an image), the 2D DCT transforms it
into a new function F(u, v), with integer u and v
running over the same range as i and j .
The general definition of the transform is:
2D Discrete Cosine Transform (2D
DCT)
where i, j, u, v = 0, 1, . . . , 7, and the
constants C(u) and C(v) are determined by
Eq(8.16).
• The 2D transforms are applicable to
2D signals, such as digital images
1D Discrete Cosine Transform (1D
DCT)
1D Inverse Discrete Cosine Transform (1D-
IDCT)
where i = 0, 1, . . . , 7,u = 0, 1, . . . , 7and
the constants C(u) and C(v) is the same
as in Eq(8.16).
One-Dimensional DCT
Let’s examine the DCT for a one-dimensional
signal; almost all concepts are readily
extensible to the 2D DCT.
 An electrical signal with constant magnitude
is known as a DC (direct current) signal. A
common example is a battery that carries 1.5
or 9 volts DC.
 An electrical signal that changes its
magnitude periodically at a certain frequency
is known as an AC (alternating current) signal.
A good example is the household electric
power circuit, which carries electricity with
One-Dimensional DCT
 Most real signals are more complex. Speech signals or a
row of gray-level intensities in a digital image are examples
of such 1D signals.
 However, any signal can be expressed as a sum of
multiple signals that are sine or cosine waveforms at
various amplitudes and frequencies. This is known as
Fourier analysis.
 The terms DC and AC, originating in electrical engineering,
are carried over to describe these components of a signal
(usually) composed of one DC and several AC
components.
 If a cosine function is used, the process of determining the
amplitudes of the AC and DC components of the signal is
called a Cosine Transform, and the integer indices make it
a Discrete Cosine Transform. When u = 0, Eq. (8.19)
yields the DC coefficient; when u = 1, or 2,..., up to 7, it
yields the first or second, etc., up to the seventh AC
Example 8.1
= 0
The Cosine Basis Functions
For a better decomposition, the basis functions
should be orthogonal, so as to have the least
redundancy among them.
2D Basis Functions
Fig. 8.9 Graphical
illustration of 8 × 8 2D DCT
basis i
j
u
v
Wavelet-Based Coding
 Wavelets are a more general way to represent
and analyze multiresolution images
 Can also be applied to 1D signals
 Very useful for :
– image compression (e.g., in the JPG-2000
standard)
– removing noise
Wavelet Analysis
Wavelet-Based Coding
Decomposing the input signal into its
constituents allows us to apply coding
techniques suitable for each constituent, to
improve compression performance.
 time-dependent signal f (t) ,The
traditional method of signal decomposition
is the Fourier transform .
. If we carry out analysis based on both
sine and cosine, then a concise notation
assembles the results into a function F(w),
a complex-valued function of real-valued
Wavelet-Based Coding
the method of decomposition that has gained
a great deal of popularity in recent years is the
wavelet transform. It seeks to represent a
signal with good resolution in both time and
frequency, by using a set of basis functions
called wavelets.
There are two types of wavelet transforms.
the Continuous Wavelet Transform (CWT) and
the Discrete Wavelet Transform (DWT).
Wavelet-Based Coding
 The other kind of wavelet transform, the DWT, operates on
discrete samples of
the input signal. The DWT resembles other discrete linear
transforms, such as the
DFT or the DCT, and is very useful for image processing and
compression.
 let’s develop an intuition about this approach by going through
an example using the simplest wavelet transform, the so-called
Haar Wavelet Transform, to form averages and differences of a
sequence of float values.
 If we repeatedly take averages and differences and keep results
for every step, create a multiresolution analysis of the sequence.
 For images, this would be equivalent to creating smaller and
smaller summary images, one-quarter the size for each step,
and keeping track of differences from the average as well.
Mentally stacking the full-size image, the quarter-size image, the
2D HaarWavelet Transform
 We begin by applying a one-dimensional Haar
wavelet transform to each row of the input. The first
and last two rows of the input are trivial. After
performing the averaging and differencing operations
on the remaining rows, we obtain the intermediate
output shown in Fig. 8.14. (Intermediate output of the 2D
Haar Wavelet Transform) 00000000
00000000
032-3200191950
064-64001911910
064-64001911910
032-320095950
00000000
00000000
Discrete Wavelet Transform*
2D DiscreteWavelet Transform
2D Discrete Wavelet Transform
LL: The upper left quadrant consists of all coefficients, which were filtered by
the analysis
low pass filter ˜h along the rows and then filtered along the corresponding
columns with
the analysis low pass filter ˜h again. This subblock is denoted by LL and
represents the
approximated version of the original at half the resolution.
HL/LH: The lower left and the upper right blocks were filtered along the rows
and columns with
˜h and ˜g, alternatively.
The LH block contains vertical edges, mostly. In contrast, the HL
blocks shows horizontal edges very clearly.
HH: The lower right quadrant was derived analogously to the upper left
quadrant but with the
use of the analysis high pass filter ˜g which belongs to the given wavelet. We
can interpret
this block as the area, where we find edges of the original image in diagonal
direction.
 The two dimensional wavelet transform can be applied to the coarser version
 The inverse transform simply reverses the steps of
the forward transform.
1. For each stage of the transformed image, starting
with the last, separate each column into low-pass and
high-pass coefficients. Upsample each of the low-
pass and high-pass arrays by inserting a zero after
each coefficient.
2. Convolve the low-pass coefficients with h0[n] and
high-pass coefficients with h1[n] and add the two
resulting arrays.
3. After all columns have been processed, separate
each row into low-pass and high-pass coefficients and
upsample each of the two arrays by inserting a zero
after each coefficient.
4. Convolve the low-pass coefficients with h0[n] and
high-pass coefficients with h1[n] and add the two
Multimedia lossy compression algorithms

More Related Content

What's hot

What's hot (20)

Transform coding
Transform codingTransform coding
Transform coding
 
DCT image compression
DCT image compressionDCT image compression
DCT image compression
 
Image compression
Image compressionImage compression
Image compression
 
image compression ppt
image compression pptimage compression ppt
image compression ppt
 
Data compression
Data compressionData compression
Data compression
 
MD-5 : Algorithm
MD-5 : AlgorithmMD-5 : Algorithm
MD-5 : Algorithm
 
Audio compression
Audio compressionAudio compression
Audio compression
 
Interpixel redundancy
Interpixel redundancyInterpixel redundancy
Interpixel redundancy
 
Lossless predictive coding in Digital Image Processing
Lossless predictive coding in Digital Image ProcessingLossless predictive coding in Digital Image Processing
Lossless predictive coding in Digital Image Processing
 
Bit plane coding
Bit plane codingBit plane coding
Bit plane coding
 
Image Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain FiltersImage Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain Filters
 
Compression techniques
Compression techniquesCompression techniques
Compression techniques
 
Digital Image Processing - Image Compression
Digital Image Processing - Image CompressionDigital Image Processing - Image Compression
Digital Image Processing - Image Compression
 
Data compression
Data compression Data compression
Data compression
 
Multimedia lossless compression algorithms
Multimedia lossless compression algorithmsMultimedia lossless compression algorithms
Multimedia lossless compression algorithms
 
Fundamentals of Data compression
Fundamentals of Data compressionFundamentals of Data compression
Fundamentals of Data compression
 
Introduction to Image Compression
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image Compression
 
Data Redundacy
Data RedundacyData Redundacy
Data Redundacy
 
Audio compression
Audio compressionAudio compression
Audio compression
 
Lossless predictive coding
Lossless predictive codingLossless predictive coding
Lossless predictive coding
 

Similar to Multimedia lossy compression algorithms

Image processing
Image processingImage processing
Image processing
maheshpene
 
image compression in data compression
image compression in data compressionimage compression in data compression
image compression in data compression
Zaabir Ali
 
Error Detection N Correction
Error Detection N CorrectionError Detection N Correction
Error Detection N Correction
Ankan Adhikari
 

Similar to Multimedia lossy compression algorithms (20)

Dynamic time wrapping (dtw), vector quantization(vq), linear predictive codin...
Dynamic time wrapping (dtw), vector quantization(vq), linear predictive codin...Dynamic time wrapping (dtw), vector quantization(vq), linear predictive codin...
Dynamic time wrapping (dtw), vector quantization(vq), linear predictive codin...
 
Lossy
LossyLossy
Lossy
 
International Journal of Engineering Research and Development (IJERD)
 International Journal of Engineering Research and Development (IJERD) International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)
 
Vector Quantization Vs Scalar Quantization
Vector Quantization Vs Scalar Quantization Vector Quantization Vs Scalar Quantization
Vector Quantization Vs Scalar Quantization
 
E017263040
E017263040E017263040
E017263040
 
Lassy
LassyLassy
Lassy
 
Performance bounds for unequally punctured
Performance bounds for unequally puncturedPerformance bounds for unequally punctured
Performance bounds for unequally punctured
 
dsp
dspdsp
dsp
 
coding.pdf
coding.pdfcoding.pdf
coding.pdf
 
Real time signal processing
Real time signal processingReal time signal processing
Real time signal processing
 
Performance bounds for unequally punctured terminated convolutional codes
Performance bounds for unequally punctured terminated convolutional codesPerformance bounds for unequally punctured terminated convolutional codes
Performance bounds for unequally punctured terminated convolutional codes
 
My review on low density parity check codes
My review on low density parity check codesMy review on low density parity check codes
My review on low density parity check codes
 
Energy-Efficient LDPC Decoder using DVFS for binary sources
Energy-Efficient LDPC Decoder using DVFS for binary sourcesEnergy-Efficient LDPC Decoder using DVFS for binary sources
Energy-Efficient LDPC Decoder using DVFS for binary sources
 
LDPC Encoding
LDPC EncodingLDPC Encoding
LDPC Encoding
 
ma92008id393
ma92008id393ma92008id393
ma92008id393
 
Image processing
Image processingImage processing
Image processing
 
Convolutional Error Control Coding
Convolutional Error Control CodingConvolutional Error Control Coding
Convolutional Error Control Coding
 
Digital communication unit II
Digital communication unit IIDigital communication unit II
Digital communication unit II
 
image compression in data compression
image compression in data compressionimage compression in data compression
image compression in data compression
 
Error Detection N Correction
Error Detection N CorrectionError Detection N Correction
Error Detection N Correction
 

More from Mazin Alwaaly

More from Mazin Alwaaly (20)

Pattern recognition voice biometrics
Pattern recognition voice biometricsPattern recognition voice biometrics
Pattern recognition voice biometrics
 
Pattern recognition palm print authentication system
Pattern recognition palm print authentication systemPattern recognition palm print authentication system
Pattern recognition palm print authentication system
 
Pattern recognition on line signature
Pattern recognition on line signaturePattern recognition on line signature
Pattern recognition on line signature
 
Pattern recognition multi biometrics using face and ear
Pattern recognition multi biometrics using face and earPattern recognition multi biometrics using face and ear
Pattern recognition multi biometrics using face and ear
 
Pattern recognition IRIS recognition
Pattern recognition IRIS recognitionPattern recognition IRIS recognition
Pattern recognition IRIS recognition
 
Pattern recognition hand vascular pattern recognition
Pattern recognition hand vascular pattern recognitionPattern recognition hand vascular pattern recognition
Pattern recognition hand vascular pattern recognition
 
Pattern recognition Hand Geometry
Pattern recognition Hand GeometryPattern recognition Hand Geometry
Pattern recognition Hand Geometry
 
Pattern recognition forensic dental identification
Pattern recognition forensic dental identificationPattern recognition forensic dental identification
Pattern recognition forensic dental identification
 
Pattern recognition fingerprints
Pattern recognition fingerprintsPattern recognition fingerprints
Pattern recognition fingerprints
 
Pattern recognition facial recognition
Pattern recognition facial recognitionPattern recognition facial recognition
Pattern recognition facial recognition
 
Pattern recognition ear as a biometric
Pattern recognition ear as a biometricPattern recognition ear as a biometric
Pattern recognition ear as a biometric
 
Pattern recognition 3d face recognition
Pattern recognition 3d face recognitionPattern recognition 3d face recognition
Pattern recognition 3d face recognition
 
Multimedia multimedia over wireless and mobile networks
Multimedia multimedia over wireless and mobile networksMultimedia multimedia over wireless and mobile networks
Multimedia multimedia over wireless and mobile networks
 
Multimedia network services and protocols for multimedia communications
Multimedia network services and protocols for multimedia communicationsMultimedia network services and protocols for multimedia communications
Multimedia network services and protocols for multimedia communications
 
Multimedia content based retrieval in digital libraries
Multimedia content based retrieval in digital librariesMultimedia content based retrieval in digital libraries
Multimedia content based retrieval in digital libraries
 
Multimedia basic video compression techniques
Multimedia basic video compression techniquesMultimedia basic video compression techniques
Multimedia basic video compression techniques
 
Multimedia image compression standards
Multimedia image compression standardsMultimedia image compression standards
Multimedia image compression standards
 
Multimedia fundamental concepts in video
Multimedia fundamental concepts in videoMultimedia fundamental concepts in video
Multimedia fundamental concepts in video
 
Multimedia color in image and video
Multimedia color in image and videoMultimedia color in image and video
Multimedia color in image and video
 
Multimedia graphics and image data representation
Multimedia graphics and image data representationMultimedia graphics and image data representation
Multimedia graphics and image data representation
 

Recently uploaded

Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdf
PirithiRaju
 
Conjugation, transduction and transformation
Conjugation, transduction and transformationConjugation, transduction and transformation
Conjugation, transduction and transformation
Areesha Ahmad
 
development of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virusdevelopment of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virus
NazaninKarimi6
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Sérgio Sacani
 

Recently uploaded (20)

High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
 
High Profile 🔝 8250077686 📞 Call Girls Service in GTB Nagar🍑
High Profile 🔝 8250077686 📞 Call Girls Service in GTB Nagar🍑High Profile 🔝 8250077686 📞 Call Girls Service in GTB Nagar🍑
High Profile 🔝 8250077686 📞 Call Girls Service in GTB Nagar🍑
 
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
 
Molecular markers- RFLP, RAPD, AFLP, SNP etc.
Molecular markers- RFLP, RAPD, AFLP, SNP etc.Molecular markers- RFLP, RAPD, AFLP, SNP etc.
Molecular markers- RFLP, RAPD, AFLP, SNP etc.
 
GBSN - Microbiology (Unit 3)
GBSN - Microbiology (Unit 3)GBSN - Microbiology (Unit 3)
GBSN - Microbiology (Unit 3)
 
Clean In Place(CIP).pptx .
Clean In Place(CIP).pptx                 .Clean In Place(CIP).pptx                 .
Clean In Place(CIP).pptx .
 
Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdf
 
Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.
 
Conjugation, transduction and transformation
Conjugation, transduction and transformationConjugation, transduction and transformation
Conjugation, transduction and transformation
 
Thyroid Physiology_Dr.E. Muralinath_ Associate Professor
Thyroid Physiology_Dr.E. Muralinath_ Associate ProfessorThyroid Physiology_Dr.E. Muralinath_ Associate Professor
Thyroid Physiology_Dr.E. Muralinath_ Associate Professor
 
Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...
Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...
Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...
 
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 60009654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
 
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts ServiceJustdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
 
development of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virusdevelopment of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virus
 
Sector 62, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 62, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Model Escorts | 100% verified
 
PSYCHOSOCIAL NEEDS. in nursing II sem pptx
PSYCHOSOCIAL NEEDS. in nursing II sem pptxPSYCHOSOCIAL NEEDS. in nursing II sem pptx
PSYCHOSOCIAL NEEDS. in nursing II sem pptx
 
Factory Acceptance Test( FAT).pptx .
Factory Acceptance Test( FAT).pptx       .Factory Acceptance Test( FAT).pptx       .
Factory Acceptance Test( FAT).pptx .
 
GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
 
9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service
 

Multimedia lossy compression algorithms

  • 2. •Distortion Measures •The Rate-Distortion Theory •Quantization •Uniform Scalar Quantization •Nonuniform Scalar Quantization •Vector Quantization •Transform Coding •Discrete Cosine Transform (DCT) outline
  • 3. Outline • 2D Discrete Cosine Transform (2D DCT) • 1D Discrete Cosine Transform (1D DCT) • 1D Inverse Discrete Cosine Transform (1D-IDCT) • One-Dimensional DCT • The Cosine Basis Functions • 2D Basis Functions • Wavelet-Based Coding • 2D Haar Wavelet Transform • Discrete Wavelet Transform* • 2D Discrete Wavelet Transform
  • 4. What is lossy compression?  The compressed data is not the same as the original data, but a close approximation of it. Yields a much higher compression ratio than that of lossless compression.
  • 5. Distortion Measures A distortion measure is a mathematical quantity that specifies how close an approximation is to its original, using some distortion criteria. When looking at compressed data, it is natural to think the distortion :in terms of the numerical difference between the original data and the reconstructed data. However, when the data to be compressed is an image, such a measure may not yield the intended result.
  • 6. Distortion Measures  The three most commonly used distortion measures in image compression are:  mean square error (MSE) σ2, (8.1) where xn, yn, and N are the input data sequence, reconstructed data sequence, and length of the data sequence respectively.  signal to noise ratio (SNR), in decibel units (dB), (8.2) where σ2 x is the average square value of the original data sequence and σ2d is the MSE.  peak signal to noise ratio (PSNR), (8.3) 2 10 2 10log x d SNR    2 10 2 10log peak d x PSNR   2 2 1 1 ( ) N n n n x y N    
  • 7. The Rate-Distortion Theory  Lossy compression always involves a tradeoff between rate and distortion. Rate is the average number of bits required to represent each source symbol. Within this framework, the tradeoff between rate and distortion is represented in the form of a rate-distortion function R(D).  Intuitively, for a given source and a given distortion measure, if D is a tolerable amount of distortion, R(D) specifies the lowest rate at which the source data can be encoded while keeping the distortion bounded above by D. It is easy to see that when D = 0, we have a lossless compression of the source.  The rate-distortion function is meant to describe a fundamental limit for the performance of a coding algorithm and so can be used to evaluate the performance of different algorithms.
  • 8. Figure 8.1 shows a typical rate-distortion function. Notice that the minimum possible rate at D = 0, no loss, is the entropy of the source data. The distortion corresponding to a rate R(D) ⇒ 0 is the maximum amount of distortion incurred when “ nothing ” is coded.
  • 9. Quantization Quantization in some form is the heart of any lossy scheme. Without quantization, we would indeed be losing little information. Here, we embark on a more detailed discussion of quantization. The source we are interested in compressing may contain a large number of distinct output values (or even infinite, if analog). To efficiently represent the source output, we have to reduce the number of distinct values to a much smaller set, via quantization.
  • 10. Quantization Each algorithm (each quantizer) can be uniquely determined by its partition of the input range, on the encoder side, and the set of output values, on the decoder side. The input and output of each quantizer can be either scalar values or vector values, thus leading to scalar quantizers and vector quantizers. In this section, we examine the design of both uniform and nonuniform scalar quantizers and briefly introduce the topic of vector quantization (VQ).
  • 11. Uniform Scalar Quantization A uniform scalar quantizer partitions the domain of input values into equally spaced intervals, except possibly at the two outer intervals. The endpoints of partition intervals are called the quantizer’s decision boundaries. The output or reconstruction value corresponding to each interval is taken to be the midpoint of the interval. The length of each interval is referred to as the step size, denoted by the symbol . Uniform scalar quantizers are of two types: midrise and midtread. A midrise quantizer is used with an even number of output levels, and a midtread quantizer with an odd number. The midrise
  • 12.
  • 13. Uniform Scalar Quantization  The midtread quantizer has zero as one of its output values, hence, it is also known as dead- zone quantizer, because it turns a range of nonzero input values into the zero output.  The midtread quantizer is important when source data represents the zero value by fluctuating between small positive and negative numbers. Applying the midtread quantizer in this case would produce an accurate and steady representation of the value zero. For the special case = 1, we can simply compute the output values for  these quantizers as Qmidrise(x) = [x]− 0.5
  • 14. Uniform Scalar Quantization  The goal for the design of a successful uniform quantizer is to minimize the distortion for a given source input with a desired number of output values. This can be done by adjusting the step size to match the input statistics.Let’s examine the performance of an M level quantizer . Let B = {b0, b1, . . . , bM} be the set of decision boundaries and Y = {y1, y2, . . . , yM} be the set of reconstruction or output values. Suppose the input is uniformly distributed in the interval [−Xmax, Xmax]. The rate of the quantizer is:  R = [log2 M].  That is, R is the number of bits required to code M things—in this case, the M output levels.  The step size is given by  = 2Xmax  M
  • 15. R = [-1.5,1.5] , M = 4 level , X = [1.2,-0.2 ,0.1,- 1.2] 2.Xmax = m = 2. 1.5 = 3 = 0.75 m 4 X = 0.75 + 1.5 = 1.125 2 EX:
  • 16. Example  For the following sequence {1.2,-0.2,-0.5,0.4,0.89,1.3…}, Quantize it using a  uniform quantizer in the range of (-1.5,1.5) with 4 levels, and write the quantized sequence.  Solution: Q=3/4=0.75. Quantizer is illustrated below.  Quantized sequence:  {1.125,-0.375,-0.375,0.375,1.125,1.125}  Yellow dots indicate the partition levels (boundaries between separate quantization intervals)  Red dots indicate the reconstruction levels (middle of each interval)  1.2 fall between 0.75 and 1.5, and hence is quantized to 1.125
  • 17. Nonuniform Scalar Quantization  If the input source is not uniformly distributed, a uniform quantizer may be inefficient.  Increasing the number of decision levels within the region where the source is densely distributed can effectively lower granular distortion. In addition, without having to increase the total number of decision levels, we can enlarge the region in which the source is sparsely distributed. Such nonuniform quantizers thus have nonuniformly defined decision boundaries.  There are two common approaches for nonuniform quantization: the Lloyd–Max quantizer and the companded quantizer.
  • 18. Vector Quantization  One of the fundamental ideas in Shannon’s original work on information theory is that any compression system performs better if it operates on vectors or groups of samples rather than on individual symbols or samples . We can form vectors of input samples by concatenating a number of consecutive samples into a single vector.  For example, an input vector might be a segment of a speech sample, a group of consecutive pixels in an image, or a chunk of data in any other format. The idea behind vector quantization (VQ) is similar to that
  • 19. Vector Quantization Instead of representing values within an interval in one-dimensional space by a reconstruction value, as in scalar quantization,  VQ an n-component code vector represents vectors that lie within a region in n- dimensional space. A collection of these code vectors forms the codebook for the vector quantizer.
  • 20.
  • 21. Transform Coding  From basic principles of information theory, we know that coding vectors is more efficient than coding scalars. To carry out such an intention, we need to group blocks of consecutive samples from the source input into vectors.  Let X = {x1, x2, . . . , xk }T be a vector of samples. Whether our input data is an image, a piece of music, an audio or video clip, or even a piece of text, there is a good chance that a substantial amount of correlation is inherent among neighboring samples xi .  The rationale behind transform coding is that if Y is the result of a linear transform T of the input vector X in such a way that the components of Y are much less correlated, then Y can be coded more efficiently than X.  Generally, the transform T itself does not compress any data. The compressio n comes
  • 22.
  • 23. Discrete Cosine Transform (DCT)  The Discrete Cosine Transform (DCT) a widely used transform coding technique, is able to perform decorrelation of the input signal in a data-independent,  Because of this, it has gained tremendous popularity . Definition of DCT Let’s start with the two-dimensional DCT. Given a function f (i, j) over two integer variables i and j (a piece of an image), the 2D DCT transforms it into a new function F(u, v), with integer u and v running over the same range as i and j . The general definition of the transform is:
  • 24.
  • 25. 2D Discrete Cosine Transform (2D DCT) where i, j, u, v = 0, 1, . . . , 7, and the constants C(u) and C(v) are determined by Eq(8.16). • The 2D transforms are applicable to 2D signals, such as digital images
  • 26. 1D Discrete Cosine Transform (1D DCT)
  • 27. 1D Inverse Discrete Cosine Transform (1D- IDCT) where i = 0, 1, . . . , 7,u = 0, 1, . . . , 7and the constants C(u) and C(v) is the same as in Eq(8.16).
  • 28. One-Dimensional DCT Let’s examine the DCT for a one-dimensional signal; almost all concepts are readily extensible to the 2D DCT.  An electrical signal with constant magnitude is known as a DC (direct current) signal. A common example is a battery that carries 1.5 or 9 volts DC.  An electrical signal that changes its magnitude periodically at a certain frequency is known as an AC (alternating current) signal. A good example is the household electric power circuit, which carries electricity with
  • 29. One-Dimensional DCT  Most real signals are more complex. Speech signals or a row of gray-level intensities in a digital image are examples of such 1D signals.  However, any signal can be expressed as a sum of multiple signals that are sine or cosine waveforms at various amplitudes and frequencies. This is known as Fourier analysis.  The terms DC and AC, originating in electrical engineering, are carried over to describe these components of a signal (usually) composed of one DC and several AC components.  If a cosine function is used, the process of determining the amplitudes of the AC and DC components of the signal is called a Cosine Transform, and the integer indices make it a Discrete Cosine Transform. When u = 0, Eq. (8.19) yields the DC coefficient; when u = 1, or 2,..., up to 7, it yields the first or second, etc., up to the seventh AC
  • 31.
  • 32.
  • 33. = 0
  • 34. The Cosine Basis Functions For a better decomposition, the basis functions should be orthogonal, so as to have the least redundancy among them.
  • 35.
  • 37. Fig. 8.9 Graphical illustration of 8 × 8 2D DCT basis i j u v
  • 38. Wavelet-Based Coding  Wavelets are a more general way to represent and analyze multiresolution images  Can also be applied to 1D signals  Very useful for : – image compression (e.g., in the JPG-2000 standard) – removing noise
  • 40.
  • 41. Wavelet-Based Coding Decomposing the input signal into its constituents allows us to apply coding techniques suitable for each constituent, to improve compression performance.  time-dependent signal f (t) ,The traditional method of signal decomposition is the Fourier transform . . If we carry out analysis based on both sine and cosine, then a concise notation assembles the results into a function F(w), a complex-valued function of real-valued
  • 42. Wavelet-Based Coding the method of decomposition that has gained a great deal of popularity in recent years is the wavelet transform. It seeks to represent a signal with good resolution in both time and frequency, by using a set of basis functions called wavelets. There are two types of wavelet transforms. the Continuous Wavelet Transform (CWT) and the Discrete Wavelet Transform (DWT).
  • 43. Wavelet-Based Coding  The other kind of wavelet transform, the DWT, operates on discrete samples of the input signal. The DWT resembles other discrete linear transforms, such as the DFT or the DCT, and is very useful for image processing and compression.  let’s develop an intuition about this approach by going through an example using the simplest wavelet transform, the so-called Haar Wavelet Transform, to form averages and differences of a sequence of float values.  If we repeatedly take averages and differences and keep results for every step, create a multiresolution analysis of the sequence.  For images, this would be equivalent to creating smaller and smaller summary images, one-quarter the size for each step, and keeping track of differences from the average as well. Mentally stacking the full-size image, the quarter-size image, the
  • 44.
  • 45. 2D HaarWavelet Transform  We begin by applying a one-dimensional Haar wavelet transform to each row of the input. The first and last two rows of the input are trivial. After performing the averaging and differencing operations on the remaining rows, we obtain the intermediate output shown in Fig. 8.14. (Intermediate output of the 2D Haar Wavelet Transform) 00000000 00000000 032-3200191950 064-64001911910 064-64001911910 032-320095950 00000000 00000000
  • 47.
  • 48.
  • 50. 2D Discrete Wavelet Transform LL: The upper left quadrant consists of all coefficients, which were filtered by the analysis low pass filter ˜h along the rows and then filtered along the corresponding columns with the analysis low pass filter ˜h again. This subblock is denoted by LL and represents the approximated version of the original at half the resolution. HL/LH: The lower left and the upper right blocks were filtered along the rows and columns with ˜h and ˜g, alternatively. The LH block contains vertical edges, mostly. In contrast, the HL blocks shows horizontal edges very clearly. HH: The lower right quadrant was derived analogously to the upper left quadrant but with the use of the analysis high pass filter ˜g which belongs to the given wavelet. We can interpret this block as the area, where we find edges of the original image in diagonal direction.  The two dimensional wavelet transform can be applied to the coarser version
  • 51.
  • 52.
  • 53.  The inverse transform simply reverses the steps of the forward transform. 1. For each stage of the transformed image, starting with the last, separate each column into low-pass and high-pass coefficients. Upsample each of the low- pass and high-pass arrays by inserting a zero after each coefficient. 2. Convolve the low-pass coefficients with h0[n] and high-pass coefficients with h1[n] and add the two resulting arrays. 3. After all columns have been processed, separate each row into low-pass and high-pass coefficients and upsample each of the two arrays by inserting a zero after each coefficient. 4. Convolve the low-pass coefficients with h0[n] and high-pass coefficients with h1[n] and add the two