SlideShare a Scribd company logo
5
Most read
11
Most read
12
Most read
Performance Analysis of Huffman
and Arithmetic coding Compression
algorithms
1
By: Ramakant Soni
Data Compression
• It is the process of encoding information using fewer bits than the
original representation.
• It is the process of reducing the size of a data file, although its
formal name is source coding.
Compression types:
1. Lossless compression
2. Lossy compression
• Compression is useful because it helps reduce resources usage,
such as data storage space or transmission capacity.
• Data compression is subject to a space-time complexity trade-off.
2
Need of analysis
• Which compression algorithm is Better?
• Decision Factor: Complexity
Complexity (Computational complexity ) theory focuses on
classifying computational problems according to their inherent
difficulty.
Difficulty of problems mean the resources used to get the solution.
Resources:
1. Space
2. Time
3
Compression Algorithms for analysis
• Huffman Coding
• Arithmetic Coding
4
Huffman Coding
• Huffman coding is an entropy encoding algorithm used for lossless
data compression.
• It encodes a source symbol into variable-length code which is
derived in a particular way based on the estimated probability of
occurrence of the source symbol.
5
Huffman Coding Algorithm:
Algorithm:
1. Start with a list of symbols and their frequency in the alphabet.
2. Select two symbols with the lowest frequency.
3. Add their frequencies and reduce the symbols.
4. Repeat the process starting from step-2 until only two values
remain.
5. The algorithm creates a prefix code for each symbol from the
alphabet simply by traversing the symbols back. It assigns 0 and 1
for each frequency value in each phase .
6
Example: Huffman Coding
Input: Six symbols and their respective Probability / Frequency Values
Steps:
1. Arrange the symbols in descending order of frequency values.
2. Add the two lowest values and remove the symbols
3. At the end we will be left with only two values
7
Example: Huffman Coding
Steps:
1. Moving backward assign the bits to the values.
2. With each succession phase(reverse) add bit values using step 1
Result:
Symbols with variable length codes.
8
Huffman Coding Complexity analysis
• Huffman algorithm is based on greedy approach to get the optimal
result(code length).
• Using the pseudo code:
• Running Time Function: T(n)= N[n+ log(2n-1)]+ Sn
• Complexity: O(N )
9
2
Arithmetic Coding
• Arithmetic coding is a form of entropy encoding used in lossless
data compression.
• A string of characters is represented using a fixed number of bits
per character.
• When a string is converted to arithmetic encoding, frequently used
characters will be stored with fewer bits and not-so-frequently
occurring characters will be stored with more bits.
• Arithmetic coding encodes the entire message into a single number,
a fraction n where (0.0 ≤ n < 1.0)
10
Arithmetic Coding Algorithm:
Algorithm:
1. Take character and symbol with their probabilities value as input.
2. The encoder divides the current interval [0,1) into sub-intervals,
each representing a fraction of the current interval proportional to
the probability of that symbol in the current context.
3. Whichever interval corresponds to the actual symbol that is next
to be encoded becomes the interval used in the next step.
4. When symbols get encoded, the resulting interval unambiguously
identifies the sequence of symbols that produced it.
5. Using the final interval and model we can reconstruct the symbol
sequence that must have entered the encoder to result in that
final interval.
11
Example: Arithmetic Coding
Input: 3 symbols(x) with respective probabilities(p) and a character
X={0,1,2} P={P0, P1, P2}={0.2, 0.4, 0.4 } x1..x3=210
12
Arithmetic Coding Complexity analysis
ARITHMETIC_IDEAL_ENCODE(M)
Set L= 0 and R = 1
FOR i = 1 to |M| DO
END FOR
Transmit the shortest binary fractional number that lies in the interval [L, L+R)
END
13
Arithmetic Coding Complexity analysis
Running time Function:
T(n)=N[log n+ a]+ Sn
N Number of input symbols
n current number of unique symbols
S  Time to maintain internal data structure
Complexity: O(N log n)
14
Complexity comparison
15
Conclusion
• Arithmetic Coding surpasses the Huffman technique in its
compression ability.
• The Huffman method assigns an integral number of bits to each
symbol, while arithmetic coding assigns one long code to the entire
input string.
• Arithmetic coding consists of a few arithmetic operations due to
which its complexity is less.
• In terms of complexity Arithmetic coding is asymptotically better
than Huffman’s.
16
Thank You
17

More Related Content

PPTX
NGOs and their role in health
Nabeela Basha
 
PPTX
Child labour ppt.
gndu
 
PPTX
Concurrency Control in Database Management System
Janki Shah
 
PPTX
Public Switched Telephone Network
Haither Mithath
 
PPT
2. Entity Relationship Model in DBMS
koolkampus
 
PPTX
Basic of compiler
Abhishek Singh
 
PPTX
SPATIAL FILTERING IN IMAGE PROCESSING
muthu181188
 
PPTX
Infix to postfix conversion
Then Murugeshwari
 
NGOs and their role in health
Nabeela Basha
 
Child labour ppt.
gndu
 
Concurrency Control in Database Management System
Janki Shah
 
Public Switched Telephone Network
Haither Mithath
 
2. Entity Relationship Model in DBMS
koolkampus
 
Basic of compiler
Abhishek Singh
 
SPATIAL FILTERING IN IMAGE PROCESSING
muthu181188
 
Infix to postfix conversion
Then Murugeshwari
 

What's hot (20)

PPTX
Chapter 9 morphological image processing
Ahmed Daoud
 
PPTX
Color Models.pptx
ssuser9203ca
 
PPTX
NOISE FILTERS IN IMAGE PROCESSING
Animesh Singh Sengar
 
PPTX
Image Enhancement in Spatial Domain
DEEPASHRI HK
 
PPTX
Edge Detection using Hough Transform
Mrunal Selokar
 
PPTX
Region based segmentation
ramya marichamy
 
PPTX
1.arithmetic & logical operations
mukesh bhardwaj
 
PDF
Lecture 16 KL Transform in Image Processing
VARUN KUMAR
 
PPTX
digital image processing
Abinaya B
 
PDF
Morphological operations
National Institute of Technology Durgapur
 
PPTX
Predictive coding
p_ayal
 
PPT
Data Redundacy
Poonam Seth
 
PPTX
5. gray level transformation
MdFazleRabbi18
 
PDF
Lecture 4 Relationship between pixels
VARUN KUMAR
 
PPT
Huffman Coding
anithabalaprabhu
 
PPTX
Image Sampling and Quantization.pptx
RUBIN (A) JEBIN
 
PPT
Image degradation and noise by Md.Naseem Ashraf
MD Naseem Ashraf
 
Chapter 9 morphological image processing
Ahmed Daoud
 
Color Models.pptx
ssuser9203ca
 
NOISE FILTERS IN IMAGE PROCESSING
Animesh Singh Sengar
 
Image Enhancement in Spatial Domain
DEEPASHRI HK
 
Edge Detection using Hough Transform
Mrunal Selokar
 
Region based segmentation
ramya marichamy
 
1.arithmetic & logical operations
mukesh bhardwaj
 
Lecture 16 KL Transform in Image Processing
VARUN KUMAR
 
digital image processing
Abinaya B
 
Predictive coding
p_ayal
 
Data Redundacy
Poonam Seth
 
5. gray level transformation
MdFazleRabbi18
 
Lecture 4 Relationship between pixels
VARUN KUMAR
 
Huffman Coding
anithabalaprabhu
 
Image Sampling and Quantization.pptx
RUBIN (A) JEBIN
 
Image degradation and noise by Md.Naseem Ashraf
MD Naseem Ashraf
 
Ad

Viewers also liked (20)

PDF
Arithmetic Coding
anithabalaprabhu
 
PPT
Arithmetic coding
Vikas Goyal
 
PDF
Ch 04 Arithmetic Coding (Ppt)
anithabalaprabhu
 
PPT
Lec7 8 9_10 coding techniques
Dom Mike
 
PDF
Module 4 Arithmetic Coding
anithabalaprabhu
 
PDF
06 Arithmetic 1
anithabalaprabhu
 
PPT
Huffman Student
anithabalaprabhu
 
PPTX
Huffman coding
Bagus Nugroho
 
PPTX
Data compression
Nizar Sbaih
 
PPTX
Introduction for Data Compression
MANISH T I
 
PPTX
Compression project presentation
faizang909
 
PPTX
Data compression
Sir Issac Newton COllege
 
PPTX
4 data compression
Rejin Thomas
 
PPTX
video compression techique
Ashish Kumar
 
PDF
Chapter 5 - Data Compression
Pratik Pradhan
 
PPTX
Data compression techniques
Deep Bhatt
 
PPTX
Data Compression In SQL
Boosh Booshan
 
PDF
Data compression huffman coding algoritham
Rahul Khanwani
 
PPTX
Data compression
Sherif Abdelfattah
 
PPTX
A new algorithm for data compression technique using vlsi
Tejeswar Tej
 
Arithmetic Coding
anithabalaprabhu
 
Arithmetic coding
Vikas Goyal
 
Ch 04 Arithmetic Coding (Ppt)
anithabalaprabhu
 
Lec7 8 9_10 coding techniques
Dom Mike
 
Module 4 Arithmetic Coding
anithabalaprabhu
 
06 Arithmetic 1
anithabalaprabhu
 
Huffman Student
anithabalaprabhu
 
Huffman coding
Bagus Nugroho
 
Data compression
Nizar Sbaih
 
Introduction for Data Compression
MANISH T I
 
Compression project presentation
faizang909
 
Data compression
Sir Issac Newton COllege
 
4 data compression
Rejin Thomas
 
video compression techique
Ashish Kumar
 
Chapter 5 - Data Compression
Pratik Pradhan
 
Data compression techniques
Deep Bhatt
 
Data Compression In SQL
Boosh Booshan
 
Data compression huffman coding algoritham
Rahul Khanwani
 
Data compression
Sherif Abdelfattah
 
A new algorithm for data compression technique using vlsi
Tejeswar Tej
 
Ad

Similar to Huffman and Arithmetic coding - Performance analysis (20)

PPT
Lossless
anithabalaprabhu
 
PPT
Lossless
Vishal Suri
 
PPTX
arithmetic coding for signal and multimedia processing
Karansingh415757
 
PPT
add9.5.ppt
AshenafiGirma5
 
PPT
Huffman&Shannon-multimedia algorithms.ppt
PrincessSaro
 
PDF
Lossless image compression.(1)
MohnishSatidasani
 
PPTX
Text compression
Sammer Qader
 
PPTX
Information Theory and coding - Lecture 3
Aref35
 
PPTX
Computer Graphics & Visualization - 06
Pankaj Debbarma
 
PPT
Huffman coding
George Ang
 
PPT
Compression Ii
anithabalaprabhu
 
PPT
Compression Ii
anithabalaprabhu
 
PDF
Implementation of Lossless Compression Algorithms for Text Data
BRNSSPublicationHubI
 
PPT
image compresson
Ajay Kumar
 
PPT
Image compression
Ale Johnsan
 
PPT
Source coding
Shankar Gangaju
 
PPT
ImageCompression.ppt
ssuser6d1fca
 
PPT
ImageCompression.ppt
dudoo1
 
PPT
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
Helan4
 
PDF
coding.pdf
temesgen545750
 
Lossless
Vishal Suri
 
arithmetic coding for signal and multimedia processing
Karansingh415757
 
add9.5.ppt
AshenafiGirma5
 
Huffman&Shannon-multimedia algorithms.ppt
PrincessSaro
 
Lossless image compression.(1)
MohnishSatidasani
 
Text compression
Sammer Qader
 
Information Theory and coding - Lecture 3
Aref35
 
Computer Graphics & Visualization - 06
Pankaj Debbarma
 
Huffman coding
George Ang
 
Compression Ii
anithabalaprabhu
 
Compression Ii
anithabalaprabhu
 
Implementation of Lossless Compression Algorithms for Text Data
BRNSSPublicationHubI
 
image compresson
Ajay Kumar
 
Image compression
Ale Johnsan
 
Source coding
Shankar Gangaju
 
ImageCompression.ppt
ssuser6d1fca
 
ImageCompression.ppt
dudoo1
 
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
Helan4
 
coding.pdf
temesgen545750
 

More from Ramakant Soni (13)

PDF
GATE 2021 Exam Information
Ramakant Soni
 
PDF
What is Algorithm - An Overview
Ramakant Soni
 
PDF
Role of Data Cleaning in Data Warehouse
Ramakant Soni
 
PDF
Internet of things
Ramakant Soni
 
PDF
NOSQL- Presentation on NoSQL
Ramakant Soni
 
PDF
UML daigrams for Bank ATM system
Ramakant Soni
 
PDF
Collaboration diagram- UML diagram
Ramakant Soni
 
PDF
Activity diagram-UML diagram
Ramakant Soni
 
PDF
Sequence diagram- UML diagram
Ramakant Soni
 
PDF
Class diagram- UML diagram
Ramakant Soni
 
PDF
Use Case diagram-UML diagram-2
Ramakant Soni
 
PDF
Use Case diagram-UML diagram-1
Ramakant Soni
 
PDF
UML Diagrams- Unified Modeling Language Introduction
Ramakant Soni
 
GATE 2021 Exam Information
Ramakant Soni
 
What is Algorithm - An Overview
Ramakant Soni
 
Role of Data Cleaning in Data Warehouse
Ramakant Soni
 
Internet of things
Ramakant Soni
 
NOSQL- Presentation on NoSQL
Ramakant Soni
 
UML daigrams for Bank ATM system
Ramakant Soni
 
Collaboration diagram- UML diagram
Ramakant Soni
 
Activity diagram-UML diagram
Ramakant Soni
 
Sequence diagram- UML diagram
Ramakant Soni
 
Class diagram- UML diagram
Ramakant Soni
 
Use Case diagram-UML diagram-2
Ramakant Soni
 
Use Case diagram-UML diagram-1
Ramakant Soni
 
UML Diagrams- Unified Modeling Language Introduction
Ramakant Soni
 

Recently uploaded (20)

PDF
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
PDF
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
The Asian School
 
PPT
SCOPE_~1- technology of green house and poyhouse
bala464780
 
PDF
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 
PPTX
22PCOAM21 Data Quality Session 3 Data Quality.pptx
Guru Nanak Technical Institutions
 
PPTX
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
PPTX
ternal cell structure: leadership, steering
hodeeesite4
 
PDF
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 
PPT
Ppt for engineering students application on field effect
lakshmi.ec
 
PDF
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
PPTX
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
PPTX
easa module 3 funtamental electronics.pptx
tryanothert7
 
PDF
FLEX-LNG-Company-Presentation-Nov-2017.pdf
jbloggzs
 
PPTX
Color Model in Textile ( RGB, CMYK).pptx
auladhossain191
 
PDF
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
PPTX
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
PPT
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PPTX
business incubation centre aaaaaaaaaaaaaa
hodeeesite4
 
PPTX
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
The Asian School
 
SCOPE_~1- technology of green house and poyhouse
bala464780
 
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 
22PCOAM21 Data Quality Session 3 Data Quality.pptx
Guru Nanak Technical Institutions
 
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
ternal cell structure: leadership, steering
hodeeesite4
 
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 
Ppt for engineering students application on field effect
lakshmi.ec
 
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
easa module 3 funtamental electronics.pptx
tryanothert7
 
FLEX-LNG-Company-Presentation-Nov-2017.pdf
jbloggzs
 
Color Model in Textile ( RGB, CMYK).pptx
auladhossain191
 
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
business incubation centre aaaaaaaaaaaaaa
hodeeesite4
 
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 

Huffman and Arithmetic coding - Performance analysis

  • 1. Performance Analysis of Huffman and Arithmetic coding Compression algorithms 1 By: Ramakant Soni
  • 2. Data Compression • It is the process of encoding information using fewer bits than the original representation. • It is the process of reducing the size of a data file, although its formal name is source coding. Compression types: 1. Lossless compression 2. Lossy compression • Compression is useful because it helps reduce resources usage, such as data storage space or transmission capacity. • Data compression is subject to a space-time complexity trade-off. 2
  • 3. Need of analysis • Which compression algorithm is Better? • Decision Factor: Complexity Complexity (Computational complexity ) theory focuses on classifying computational problems according to their inherent difficulty. Difficulty of problems mean the resources used to get the solution. Resources: 1. Space 2. Time 3
  • 4. Compression Algorithms for analysis • Huffman Coding • Arithmetic Coding 4
  • 5. Huffman Coding • Huffman coding is an entropy encoding algorithm used for lossless data compression. • It encodes a source symbol into variable-length code which is derived in a particular way based on the estimated probability of occurrence of the source symbol. 5
  • 6. Huffman Coding Algorithm: Algorithm: 1. Start with a list of symbols and their frequency in the alphabet. 2. Select two symbols with the lowest frequency. 3. Add their frequencies and reduce the symbols. 4. Repeat the process starting from step-2 until only two values remain. 5. The algorithm creates a prefix code for each symbol from the alphabet simply by traversing the symbols back. It assigns 0 and 1 for each frequency value in each phase . 6
  • 7. Example: Huffman Coding Input: Six symbols and their respective Probability / Frequency Values Steps: 1. Arrange the symbols in descending order of frequency values. 2. Add the two lowest values and remove the symbols 3. At the end we will be left with only two values 7
  • 8. Example: Huffman Coding Steps: 1. Moving backward assign the bits to the values. 2. With each succession phase(reverse) add bit values using step 1 Result: Symbols with variable length codes. 8
  • 9. Huffman Coding Complexity analysis • Huffman algorithm is based on greedy approach to get the optimal result(code length). • Using the pseudo code: • Running Time Function: T(n)= N[n+ log(2n-1)]+ Sn • Complexity: O(N ) 9 2
  • 10. Arithmetic Coding • Arithmetic coding is a form of entropy encoding used in lossless data compression. • A string of characters is represented using a fixed number of bits per character. • When a string is converted to arithmetic encoding, frequently used characters will be stored with fewer bits and not-so-frequently occurring characters will be stored with more bits. • Arithmetic coding encodes the entire message into a single number, a fraction n where (0.0 ≤ n < 1.0) 10
  • 11. Arithmetic Coding Algorithm: Algorithm: 1. Take character and symbol with their probabilities value as input. 2. The encoder divides the current interval [0,1) into sub-intervals, each representing a fraction of the current interval proportional to the probability of that symbol in the current context. 3. Whichever interval corresponds to the actual symbol that is next to be encoded becomes the interval used in the next step. 4. When symbols get encoded, the resulting interval unambiguously identifies the sequence of symbols that produced it. 5. Using the final interval and model we can reconstruct the symbol sequence that must have entered the encoder to result in that final interval. 11
  • 12. Example: Arithmetic Coding Input: 3 symbols(x) with respective probabilities(p) and a character X={0,1,2} P={P0, P1, P2}={0.2, 0.4, 0.4 } x1..x3=210 12
  • 13. Arithmetic Coding Complexity analysis ARITHMETIC_IDEAL_ENCODE(M) Set L= 0 and R = 1 FOR i = 1 to |M| DO END FOR Transmit the shortest binary fractional number that lies in the interval [L, L+R) END 13
  • 14. Arithmetic Coding Complexity analysis Running time Function: T(n)=N[log n+ a]+ Sn N Number of input symbols n current number of unique symbols S  Time to maintain internal data structure Complexity: O(N log n) 14
  • 16. Conclusion • Arithmetic Coding surpasses the Huffman technique in its compression ability. • The Huffman method assigns an integral number of bits to each symbol, while arithmetic coding assigns one long code to the entire input string. • Arithmetic coding consists of a few arithmetic operations due to which its complexity is less. • In terms of complexity Arithmetic coding is asymptotically better than Huffman’s. 16