SlideShare a Scribd company logo
Basics of Compression
• Goals:
• to understand how image/audio/video signals are
compressed to save storage and increase
transmission efficiency
• to understand in detail common formats like GIF,
JPEG and MPEG
What does compression do
• Reduces signal size by taking advantage of
correlation
• Spatial
• Temporal
• Spectral
L in e a r P r e d ic t iv e A u t o R e g r e s s iv e P o ly n o m ia l F it t in g
M o d e l- B a s e d
H u ffm a n
S t a t is t ic a l
A r it h m e t ic L e m p e l- Z iv
U n iv e r s a l
L o s s le s s
S p a t ia l/ T im e - D o m a in
S u b b a n d W a v e le t
F ilt e r - B a s e d
F o u r ie r D C T
T r a n s fo r m - B a s e d
F r e q u e n c y - D o m a in
L o s s y
W a v e fo r m - B a s e d
C o m p r e s s io n M e t h o d s
Compression Issues
• Lossless compression
• Coding Efficiency
• Compression ratio
• Coder Complexity
• Memory needs
• Power needs
• Operations per second
• Coding Delay
Compression Issues
• Additional Issues for Lossy Compression
• Signal quality
• Bit error probability
• Signal/Noise ratio
• Mean opinion score
Compression Method Selection
• Constrained output signal quality? – TV
• Retransmission allowed? – interactive sessions
• Degradation type at decoder acceptable?
• Multiple decoding levels? – browsing and retrieving
• Encoding and decoding in tandem? – video editing
• Single-sample-based or block-based?
• Fixed coding delay, variable efficiency?
• Fixed output data size, variable rate?
• Fixed coding efficiency, variable signal quality? CBR
• Fixed quality, variable efficiency? VBR
Fundamental Ideas
• Run-length encoding
• Average Information Entropy
• For source S generating symbols S1through SN
• Self entropy: I(si) =
• Entropy of source S:
• Average number of bits to encode ≤ H(S) - Shannon
• Differential Encoding
• To improve the probability distribution of symbols
i
i
p
p
log
1
log −=
∑=
i
ii ppSH 2log)(
Huffman Encoding
• Let an alphabet have N symbols S1 … SN
• Let pi be the probability of occurrence of Si
• Order the symbols by their probabilities
p1 ≥ p2 ≥ p3 ≥ … ≥ pN
• Replace symbols SN-1 and SN by a new symbol HN-1
such that it has the probability pN-1+ pN
• Repeat until there is only one symbol
• This generates a binary tree
Huffman Encoding Example
• Symbols picked up as
• K+W
• {K,W}+?
• {K,W,?}+U
• {R,L}
• {K,W,?,U}+E
• {{K,W,?,U,E},{R,L}}
• Codewords are
generated in a tree-
traversal pattern
Symbol Probability Codeword
K 0.05 10101
L 0.2 01
U 0.1 100
W 0.05 10100
E 0.3 11
R 0.2 00
? 0.1 1011
Properties of Huffman Codes
• Fixed-length inputs become variable-length
outputs
• Average codeword length:
• Upper bound of average length: H(S) + pmax
• Code construction complexity: O(N log N)
• Prefix-condition code: no codeword is a prefix for
another
• Makes the code uniquely decodable
∑ iipl
Huffman Decoding
• Look-up table-based decoding
• Create a look-up table
• Let L be the longest codeword
• Let ci be the codeword corresponding to symbol si
• If ci has li bits, make an L-bit address such that the first li bits
are ci and the rest can be any combination of 0s and 1s.
• Make 2^(L-li) such addresses for each symbol
• At each entry, record, (si, li) pairs
• Decoding
• Read L bits in a buffer
• Get symbol sk, that has a length of lk
• Discard lk bits and fill up the L-bit buffer
Constraining Code Length
• The problem: the code length should be at most L bits
• Algorithm
• Let threshold T=2-L
• Partition S into subsets S1 and S2
• S1= {si|pi > T} … t-1 symbols
• S2= {si|pi ≤ T} … N-t+1 symbols
• Create special symbol Q whose frequency q =
• Create code word cq for symbol Q and normal
Huffman code for every other symbol in S1
• For any message string in S1, create regular code word
• For any message string in S2, first emit cq and then a regular
code for the number of symbols in S2
∑=
N
ti
ip
Constraining Code Length
• Another algorithm
• Set threshold t like before
• If for any symbol si, pi ≤ T, set pi = T
• Design the codebook
• If the resulting codebook violates the ordering of code
length according to symbol frequency, reorder the
codes
• How does this differ from the previous algorithm?
• What is its complexity?
Golomb-Rice Compression
• Take a source having symbols occurring with a geometric
probability distribution
• P(n)=(1-p0) pn
0 n≥0, 0<p0<1
• Here is P(n) the probability of run-length of n for any symbol
• Take a positive integer m and determine q, r where
n=mq+r.
• Gm code for n: 0…01 + bin(r)
• Optimal if
• m =
q has log2m bits if
r >sup(log2m)





 +
−
)log(
)1log(
0
0
p
p
Golomb-Rice Compression
• Now if m=2k
• Get q by k-bit right shift and r by last r bits of n
• Example:
• If m=4 and n=22 the code is 00000110
• Decoding G-R code:
• Count the number of 0s before the first 1. This gives q.
Skip the 1. The next k bits gives r
The Lossless JPEG standard
• Try to predict the value of pixel X as
prediction residual r=y-X
• y can be one of 0, a, b, c, a+b-c, a+(b-c)/2,b+
(a-c)/2
• The scan header records the choice of y
• Residual r is computed modulo 216
• The number of bits needed for r is called its
category, the binary value of r is its
magnitude
• The category is Huffman encoded
c b
a X

More Related Content

What's hot

Speech coding standards2
Speech coding standards2Speech coding standards2
Speech coding standards2
elroy25
 
Speech Analysis and synthesis using Vocoder
Speech Analysis and synthesis using VocoderSpeech Analysis and synthesis using Vocoder
Speech Analysis and synthesis using Vocoder
IJTET Journal
 
Linear Predictive Coding
Linear Predictive CodingLinear Predictive Coding
Linear Predictive Coding
Srishti Kakade
 
Basics of Coding Theory
Basics of Coding TheoryBasics of Coding Theory
Basics of Coding Theory
Piyush Mittal
 
Speech coding std
Speech coding stdSpeech coding std
Speech coding std
Swapnil Sonawane
 
Iain Richardson: An Introduction to Video Compression
Iain Richardson: An Introduction to Video CompressionIain Richardson: An Introduction to Video Compression
Iain Richardson: An Introduction to Video Compression
Iain Richardson
 
Speech compression-using-gsm
Speech compression-using-gsmSpeech compression-using-gsm
Speech compression-using-gsm
Nghĩa Trần Trung
 
Thesis_Presentation
Thesis_PresentationThesis_Presentation
Thesis_Presentation
Panagiotis Chatzi nikolaou
 
LPC for Speech Recognition
LPC for Speech RecognitionLPC for Speech Recognition
LPC for Speech Recognition
Dr. Uday Saikia
 
lpc and horn noise detection
lpc and horn noise detectionlpc and horn noise detection
lpc and horn noise detection
Pranathi V.N Vemuri
 
Linear predictive coding documentation
Linear predictive coding  documentationLinear predictive coding  documentation
Linear predictive coding documentation
chakravarthy Gopi
 
Video Compression Standards - History & Introduction
Video Compression Standards - History & IntroductionVideo Compression Standards - History & Introduction
Video Compression Standards - History & Introduction
Champ Yen
 
Introduction to H.264 Advanced Video Compression
Introduction to H.264 Advanced Video CompressionIntroduction to H.264 Advanced Video Compression
Introduction to H.264 Advanced Video Compression
Iain Richardson
 

What's hot (13)

Speech coding standards2
Speech coding standards2Speech coding standards2
Speech coding standards2
 
Speech Analysis and synthesis using Vocoder
Speech Analysis and synthesis using VocoderSpeech Analysis and synthesis using Vocoder
Speech Analysis and synthesis using Vocoder
 
Linear Predictive Coding
Linear Predictive CodingLinear Predictive Coding
Linear Predictive Coding
 
Basics of Coding Theory
Basics of Coding TheoryBasics of Coding Theory
Basics of Coding Theory
 
Speech coding std
Speech coding stdSpeech coding std
Speech coding std
 
Iain Richardson: An Introduction to Video Compression
Iain Richardson: An Introduction to Video CompressionIain Richardson: An Introduction to Video Compression
Iain Richardson: An Introduction to Video Compression
 
Speech compression-using-gsm
Speech compression-using-gsmSpeech compression-using-gsm
Speech compression-using-gsm
 
Thesis_Presentation
Thesis_PresentationThesis_Presentation
Thesis_Presentation
 
LPC for Speech Recognition
LPC for Speech RecognitionLPC for Speech Recognition
LPC for Speech Recognition
 
lpc and horn noise detection
lpc and horn noise detectionlpc and horn noise detection
lpc and horn noise detection
 
Linear predictive coding documentation
Linear predictive coding  documentationLinear predictive coding  documentation
Linear predictive coding documentation
 
Video Compression Standards - History & Introduction
Video Compression Standards - History & IntroductionVideo Compression Standards - History & Introduction
Video Compression Standards - History & Introduction
 
Introduction to H.264 Advanced Video Compression
Introduction to H.264 Advanced Video CompressionIntroduction to H.264 Advanced Video Compression
Introduction to H.264 Advanced Video Compression
 

Similar to Mmclass2

add9.5.ppt
add9.5.pptadd9.5.ppt
add9.5.ppt
AshenafiGirma5
 
SPEECH CODING
SPEECH CODINGSPEECH CODING
SPEECH CODING
Shradheshwar Verma
 
One time pad Encryption:
One time pad Encryption:One time pad Encryption:
One time pad Encryption:
Asad Ali
 
Lecture 2- Practical AD and DA Conveters (Online Learning).pptx
Lecture 2- Practical AD and DA Conveters (Online Learning).pptxLecture 2- Practical AD and DA Conveters (Online Learning).pptx
Lecture 2- Practical AD and DA Conveters (Online Learning).pptx
HamzaJaved306957
 
Multimedia Services: Audio
Multimedia Services: AudioMultimedia Services: Audio
Multimedia Services: Audio
Dani Gutiérrez Porset
 
Source coding
Source coding Source coding
Source coding
Shankar Gangaju
 
Compression techniques
Compression techniquesCompression techniques
Compression techniques
m_divya_bharathi
 
Proposal
ProposalProposal
Proposal
Shaikh M Karim
 
Lecture 1.pptx
Lecture 1.pptxLecture 1.pptx
Lecture 1.pptx
PhocasSebastian1
 
Turbo Codes
Turbo CodesTurbo Codes
Turbo Codes
vasanth_mtech
 
Digital Signal Processor evolution over the last 30 years
Digital Signal Processor evolution over the last 30 yearsDigital Signal Processor evolution over the last 30 years
Digital Signal Processor evolution over the last 30 years
Francois Charlot
 
Block ciphers &amp; public key cryptography
Block ciphers &amp; public key cryptographyBlock ciphers &amp; public key cryptography
Block ciphers &amp; public key cryptography
RAMPRAKASHT1
 
Digital Communication: Channel Coding
Digital Communication: Channel CodingDigital Communication: Channel Coding
Digital Communication: Channel Coding
Dr. Sanjay M. Gulhane
 
Pulse Code Modulation.pptx
Pulse Code Modulation.pptxPulse Code Modulation.pptx
Pulse Code Modulation.pptx
julie ailene asuncion
 
LiveCoding Package for Pharo
LiveCoding Package for PharoLiveCoding Package for Pharo
LiveCoding Package for Pharo
ESUG
 
QuadIron An open source library for number theoretic transform-based erasure ...
QuadIron An open source library for number theoretic transform-based erasure ...QuadIron An open source library for number theoretic transform-based erasure ...
QuadIron An open source library for number theoretic transform-based erasure ...
Scality
 
image compresson
image compressonimage compresson
image compresson
Ajay Kumar
 
Image compression
Image compressionImage compression
Image compression
Ale Johnsan
 
Speech Compression using LPC
Speech Compression using LPCSpeech Compression using LPC
Speech Compression using LPC
Disha Modi
 
03_04-AnalogDigital-HYanikomeroglu-12Jan2011_14Jan2011_Old1.ppt
03_04-AnalogDigital-HYanikomeroglu-12Jan2011_14Jan2011_Old1.ppt03_04-AnalogDigital-HYanikomeroglu-12Jan2011_14Jan2011_Old1.ppt
03_04-AnalogDigital-HYanikomeroglu-12Jan2011_14Jan2011_Old1.ppt
ZeyadAlabsy
 

Similar to Mmclass2 (20)

add9.5.ppt
add9.5.pptadd9.5.ppt
add9.5.ppt
 
SPEECH CODING
SPEECH CODINGSPEECH CODING
SPEECH CODING
 
One time pad Encryption:
One time pad Encryption:One time pad Encryption:
One time pad Encryption:
 
Lecture 2- Practical AD and DA Conveters (Online Learning).pptx
Lecture 2- Practical AD and DA Conveters (Online Learning).pptxLecture 2- Practical AD and DA Conveters (Online Learning).pptx
Lecture 2- Practical AD and DA Conveters (Online Learning).pptx
 
Multimedia Services: Audio
Multimedia Services: AudioMultimedia Services: Audio
Multimedia Services: Audio
 
Source coding
Source coding Source coding
Source coding
 
Compression techniques
Compression techniquesCompression techniques
Compression techniques
 
Proposal
ProposalProposal
Proposal
 
Lecture 1.pptx
Lecture 1.pptxLecture 1.pptx
Lecture 1.pptx
 
Turbo Codes
Turbo CodesTurbo Codes
Turbo Codes
 
Digital Signal Processor evolution over the last 30 years
Digital Signal Processor evolution over the last 30 yearsDigital Signal Processor evolution over the last 30 years
Digital Signal Processor evolution over the last 30 years
 
Block ciphers &amp; public key cryptography
Block ciphers &amp; public key cryptographyBlock ciphers &amp; public key cryptography
Block ciphers &amp; public key cryptography
 
Digital Communication: Channel Coding
Digital Communication: Channel CodingDigital Communication: Channel Coding
Digital Communication: Channel Coding
 
Pulse Code Modulation.pptx
Pulse Code Modulation.pptxPulse Code Modulation.pptx
Pulse Code Modulation.pptx
 
LiveCoding Package for Pharo
LiveCoding Package for PharoLiveCoding Package for Pharo
LiveCoding Package for Pharo
 
QuadIron An open source library for number theoretic transform-based erasure ...
QuadIron An open source library for number theoretic transform-based erasure ...QuadIron An open source library for number theoretic transform-based erasure ...
QuadIron An open source library for number theoretic transform-based erasure ...
 
image compresson
image compressonimage compresson
image compresson
 
Image compression
Image compressionImage compression
Image compression
 
Speech Compression using LPC
Speech Compression using LPCSpeech Compression using LPC
Speech Compression using LPC
 
03_04-AnalogDigital-HYanikomeroglu-12Jan2011_14Jan2011_Old1.ppt
03_04-AnalogDigital-HYanikomeroglu-12Jan2011_14Jan2011_Old1.ppt03_04-AnalogDigital-HYanikomeroglu-12Jan2011_14Jan2011_Old1.ppt
03_04-AnalogDigital-HYanikomeroglu-12Jan2011_14Jan2011_Old1.ppt
 

More from Hassan Dar

Mmclass9
Mmclass9Mmclass9
Mmclass9
Hassan Dar
 
Mmclass6
Mmclass6Mmclass6
Mmclass6
Hassan Dar
 
Mmclass5b
Mmclass5bMmclass5b
Mmclass5b
Hassan Dar
 
Mmclass5
Mmclass5Mmclass5
Mmclass5
Hassan Dar
 
Mmclass4
Mmclass4Mmclass4
Mmclass4
Hassan Dar
 
Mmclass3
Mmclass3Mmclass3
Mmclass3
Hassan Dar
 
Mmclass1
Mmclass1Mmclass1
Mmclass1
Hassan Dar
 
Lecture1
Lecture1Lecture1
Lecture1
Hassan Dar
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
Hassan Dar
 
Ch4
Ch4Ch4
Msd ch2 issues in multimedia
Msd ch2 issues in multimediaMsd ch2 issues in multimedia
Msd ch2 issues in multimedia
Hassan Dar
 
Mmclass10
Mmclass10Mmclass10
Mmclass10
Hassan Dar
 

More from Hassan Dar (12)

Mmclass9
Mmclass9Mmclass9
Mmclass9
 
Mmclass6
Mmclass6Mmclass6
Mmclass6
 
Mmclass5b
Mmclass5bMmclass5b
Mmclass5b
 
Mmclass5
Mmclass5Mmclass5
Mmclass5
 
Mmclass4
Mmclass4Mmclass4
Mmclass4
 
Mmclass3
Mmclass3Mmclass3
Mmclass3
 
Mmclass1
Mmclass1Mmclass1
Mmclass1
 
Lecture1
Lecture1Lecture1
Lecture1
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Ch4
Ch4Ch4
Ch4
 
Msd ch2 issues in multimedia
Msd ch2 issues in multimediaMsd ch2 issues in multimedia
Msd ch2 issues in multimedia
 
Mmclass10
Mmclass10Mmclass10
Mmclass10
 

Recently uploaded

ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
ihlasbinance2003
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
mamunhossenbd75
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
Aditya Rajan Patra
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
mamamaam477
 
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball playEric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
enizeyimana36
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
abbyasa1014
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
RadiNasr
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 

Recently uploaded (20)

ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
 
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball playEric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 

Mmclass2

  • 1. Basics of Compression • Goals: • to understand how image/audio/video signals are compressed to save storage and increase transmission efficiency • to understand in detail common formats like GIF, JPEG and MPEG
  • 2. What does compression do • Reduces signal size by taking advantage of correlation • Spatial • Temporal • Spectral L in e a r P r e d ic t iv e A u t o R e g r e s s iv e P o ly n o m ia l F it t in g M o d e l- B a s e d H u ffm a n S t a t is t ic a l A r it h m e t ic L e m p e l- Z iv U n iv e r s a l L o s s le s s S p a t ia l/ T im e - D o m a in S u b b a n d W a v e le t F ilt e r - B a s e d F o u r ie r D C T T r a n s fo r m - B a s e d F r e q u e n c y - D o m a in L o s s y W a v e fo r m - B a s e d C o m p r e s s io n M e t h o d s
  • 3. Compression Issues • Lossless compression • Coding Efficiency • Compression ratio • Coder Complexity • Memory needs • Power needs • Operations per second • Coding Delay
  • 4. Compression Issues • Additional Issues for Lossy Compression • Signal quality • Bit error probability • Signal/Noise ratio • Mean opinion score
  • 5. Compression Method Selection • Constrained output signal quality? – TV • Retransmission allowed? – interactive sessions • Degradation type at decoder acceptable? • Multiple decoding levels? – browsing and retrieving • Encoding and decoding in tandem? – video editing • Single-sample-based or block-based? • Fixed coding delay, variable efficiency? • Fixed output data size, variable rate? • Fixed coding efficiency, variable signal quality? CBR • Fixed quality, variable efficiency? VBR
  • 6. Fundamental Ideas • Run-length encoding • Average Information Entropy • For source S generating symbols S1through SN • Self entropy: I(si) = • Entropy of source S: • Average number of bits to encode ≤ H(S) - Shannon • Differential Encoding • To improve the probability distribution of symbols i i p p log 1 log −= ∑= i ii ppSH 2log)(
  • 7. Huffman Encoding • Let an alphabet have N symbols S1 … SN • Let pi be the probability of occurrence of Si • Order the symbols by their probabilities p1 ≥ p2 ≥ p3 ≥ … ≥ pN • Replace symbols SN-1 and SN by a new symbol HN-1 such that it has the probability pN-1+ pN • Repeat until there is only one symbol • This generates a binary tree
  • 8. Huffman Encoding Example • Symbols picked up as • K+W • {K,W}+? • {K,W,?}+U • {R,L} • {K,W,?,U}+E • {{K,W,?,U,E},{R,L}} • Codewords are generated in a tree- traversal pattern Symbol Probability Codeword K 0.05 10101 L 0.2 01 U 0.1 100 W 0.05 10100 E 0.3 11 R 0.2 00 ? 0.1 1011
  • 9. Properties of Huffman Codes • Fixed-length inputs become variable-length outputs • Average codeword length: • Upper bound of average length: H(S) + pmax • Code construction complexity: O(N log N) • Prefix-condition code: no codeword is a prefix for another • Makes the code uniquely decodable ∑ iipl
  • 10. Huffman Decoding • Look-up table-based decoding • Create a look-up table • Let L be the longest codeword • Let ci be the codeword corresponding to symbol si • If ci has li bits, make an L-bit address such that the first li bits are ci and the rest can be any combination of 0s and 1s. • Make 2^(L-li) such addresses for each symbol • At each entry, record, (si, li) pairs • Decoding • Read L bits in a buffer • Get symbol sk, that has a length of lk • Discard lk bits and fill up the L-bit buffer
  • 11. Constraining Code Length • The problem: the code length should be at most L bits • Algorithm • Let threshold T=2-L • Partition S into subsets S1 and S2 • S1= {si|pi > T} … t-1 symbols • S2= {si|pi ≤ T} … N-t+1 symbols • Create special symbol Q whose frequency q = • Create code word cq for symbol Q and normal Huffman code for every other symbol in S1 • For any message string in S1, create regular code word • For any message string in S2, first emit cq and then a regular code for the number of symbols in S2 ∑= N ti ip
  • 12. Constraining Code Length • Another algorithm • Set threshold t like before • If for any symbol si, pi ≤ T, set pi = T • Design the codebook • If the resulting codebook violates the ordering of code length according to symbol frequency, reorder the codes • How does this differ from the previous algorithm? • What is its complexity?
  • 13. Golomb-Rice Compression • Take a source having symbols occurring with a geometric probability distribution • P(n)=(1-p0) pn 0 n≥0, 0<p0<1 • Here is P(n) the probability of run-length of n for any symbol • Take a positive integer m and determine q, r where n=mq+r. • Gm code for n: 0…01 + bin(r) • Optimal if • m = q has log2m bits if r >sup(log2m)       + − )log( )1log( 0 0 p p
  • 14. Golomb-Rice Compression • Now if m=2k • Get q by k-bit right shift and r by last r bits of n • Example: • If m=4 and n=22 the code is 00000110 • Decoding G-R code: • Count the number of 0s before the first 1. This gives q. Skip the 1. The next k bits gives r
  • 15. The Lossless JPEG standard • Try to predict the value of pixel X as prediction residual r=y-X • y can be one of 0, a, b, c, a+b-c, a+(b-c)/2,b+ (a-c)/2 • The scan header records the choice of y • Residual r is computed modulo 216 • The number of bits needed for r is called its category, the binary value of r is its magnitude • The category is Huffman encoded c b a X