SlideShare a Scribd company logo
1 of 17
Download to read offline
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

What's hot

What's hot (20)

Huffman Coding
Huffman CodingHuffman Coding
Huffman Coding
 
Compression techniques
Compression techniquesCompression techniques
Compression techniques
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
 
Audio compression
Audio compressionAudio compression
Audio compression
 
Region based segmentation
Region based segmentationRegion based segmentation
Region based segmentation
 
Fundamentals and image compression models
Fundamentals and image compression modelsFundamentals and image compression models
Fundamentals and image compression models
 
Introduction to Image Compression
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image Compression
 
Digital Image Processing - Image Compression
Digital Image Processing - Image CompressionDigital Image Processing - Image Compression
Digital Image Processing - Image Compression
 
Chapter 9 morphological image processing
Chapter 9   morphological image processingChapter 9   morphological image processing
Chapter 9 morphological image processing
 
image compression ppt
image compression pptimage compression ppt
image compression ppt
 
Target language in compiler design
Target language in compiler designTarget language in compiler design
Target language in compiler design
 
Image segmentation
Image segmentation Image segmentation
Image segmentation
 
Region based segmentation
Region based segmentationRegion based segmentation
Region based segmentation
 
Image compression models
Image compression modelsImage compression models
Image compression models
 
Data compression huffman coding algoritham
Data compression huffman coding algorithamData compression huffman coding algoritham
Data compression huffman coding algoritham
 
IP Security
IP SecurityIP Security
IP Security
 
Run length encoding
Run length encodingRun length encoding
Run length encoding
 
Histogram Processing
Histogram ProcessingHistogram Processing
Histogram Processing
 
Simultaneous Smoothing and Sharpening of Color Images
Simultaneous Smoothing and Sharpening of Color ImagesSimultaneous Smoothing and Sharpening of Color Images
Simultaneous Smoothing and Sharpening of Color Images
 
Subband Coding
Subband CodingSubband Coding
Subband Coding
 

Viewers also liked

Ch 04 Arithmetic Coding (Ppt)
Ch 04 Arithmetic Coding (Ppt)Ch 04 Arithmetic Coding (Ppt)
Ch 04 Arithmetic Coding (Ppt)anithabalaprabhu
 
Lec7 8 9_10 coding techniques
Lec7 8 9_10 coding techniquesLec7 8 9_10 coding techniques
Lec7 8 9_10 coding techniquesDom Mike
 
Module 4 Arithmetic Coding
Module 4 Arithmetic CodingModule 4 Arithmetic Coding
Module 4 Arithmetic Codinganithabalaprabhu
 
Data compression
Data compressionData compression
Data compressionNizar Sbaih
 
Introduction for Data Compression
Introduction for Data Compression Introduction for Data Compression
Introduction for Data Compression MANISH T I
 
Compression project presentation
Compression project presentationCompression project presentation
Compression project presentationfaizang909
 
4 data compression
4 data compression4 data compression
4 data compressionRejin Thomas
 
video compression techique
video compression techiquevideo compression techique
video compression techiqueAshish Kumar
 
Chapter 5 - Data Compression
Chapter 5 - Data CompressionChapter 5 - Data Compression
Chapter 5 - Data CompressionPratik Pradhan
 
Data compression techniques
Data compression techniquesData compression techniques
Data compression techniquesDeep Bhatt
 
Data Compression In SQL
Data Compression In SQLData Compression In SQL
Data Compression In SQLBoosh Booshan
 
A new algorithm for data compression technique using vlsi
A new algorithm for data compression technique using vlsiA new algorithm for data compression technique using vlsi
A new algorithm for data compression technique using vlsiTejeswar Tej
 
Multimedia system, Architecture & Databases
Multimedia system, Architecture & DatabasesMultimedia system, Architecture & Databases
Multimedia system, Architecture & DatabasesHarshita Ved
 

Viewers also liked (19)

Ch 04 Arithmetic Coding (Ppt)
Ch 04 Arithmetic Coding (Ppt)Ch 04 Arithmetic Coding (Ppt)
Ch 04 Arithmetic Coding (Ppt)
 
Lec7 8 9_10 coding techniques
Lec7 8 9_10 coding techniquesLec7 8 9_10 coding techniques
Lec7 8 9_10 coding techniques
 
Module 4 Arithmetic Coding
Module 4 Arithmetic CodingModule 4 Arithmetic Coding
Module 4 Arithmetic Coding
 
06 Arithmetic 1
06 Arithmetic 106 Arithmetic 1
06 Arithmetic 1
 
Huffman Student
Huffman StudentHuffman Student
Huffman Student
 
Huffman coding
Huffman codingHuffman coding
Huffman coding
 
Data compression
Data compressionData compression
Data compression
 
Introduction for Data Compression
Introduction for Data Compression Introduction for Data Compression
Introduction for Data Compression
 
Compression project presentation
Compression project presentationCompression project presentation
Compression project presentation
 
Data compression
Data compressionData compression
Data compression
 
4 data compression
4 data compression4 data compression
4 data compression
 
video compression techique
video compression techiquevideo compression techique
video compression techique
 
Chapter 5 - Data Compression
Chapter 5 - Data CompressionChapter 5 - Data Compression
Chapter 5 - Data Compression
 
Data compression techniques
Data compression techniquesData compression techniques
Data compression techniques
 
Data Compression In SQL
Data Compression In SQLData Compression In SQL
Data Compression In SQL
 
Data compression
Data compressionData compression
Data compression
 
A new algorithm for data compression technique using vlsi
A new algorithm for data compression technique using vlsiA new algorithm for data compression technique using vlsi
A new algorithm for data compression technique using vlsi
 
Huffman Coding
Huffman CodingHuffman Coding
Huffman Coding
 
Multimedia system, Architecture & Databases
Multimedia system, Architecture & DatabasesMultimedia system, Architecture & Databases
Multimedia system, Architecture & Databases
 

Similar to Huffman and Arithmetic coding - Performance analysis

arithmetic coding for signal and multimedia processing
arithmetic coding for signal and multimedia processingarithmetic coding for signal and multimedia processing
arithmetic coding for signal and multimedia processingKaransingh415757
 
Huffman&Shannon-multimedia algorithms.ppt
Huffman&Shannon-multimedia algorithms.pptHuffman&Shannon-multimedia algorithms.ppt
Huffman&Shannon-multimedia algorithms.pptPrincessSaro
 
Lossless image compression.(1)
Lossless image compression.(1)Lossless image compression.(1)
Lossless image compression.(1)MohnishSatidasani
 
Information Theory and coding - Lecture 3
Information Theory and coding - Lecture 3Information Theory and coding - Lecture 3
Information Theory and coding - Lecture 3Aref35
 
Computer Graphics & Visualization - 06
Computer Graphics & Visualization - 06Computer Graphics & Visualization - 06
Computer Graphics & Visualization - 06Pankaj Debbarma
 
Huffman coding
Huffman codingHuffman coding
Huffman codingGeorge Ang
 
Implementation of Lossless Compression Algorithms for Text Data
Implementation of Lossless Compression Algorithms for Text DataImplementation of Lossless Compression Algorithms for Text Data
Implementation of Lossless Compression Algorithms for Text DataBRNSSPublicationHubI
 
image compresson
image compressonimage compresson
image compressonAjay Kumar
 
Image compression
Image compressionImage compression
Image compressionAle Johnsan
 
ImageCompression.ppt
ImageCompression.pptImageCompression.ppt
ImageCompression.pptdudoo1
 
ImageCompression.ppt
ImageCompression.pptImageCompression.ppt
ImageCompression.pptssuser6d1fca
 
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...Helan4
 
Presentation ppt 3.pptx
Presentation ppt 3.pptxPresentation ppt 3.pptx
Presentation ppt 3.pptxtemesgen545750
 

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

Lossless
LosslessLossless
Lossless
 
Lossless
LosslessLossless
Lossless
 
arithmetic coding for signal and multimedia processing
arithmetic coding for signal and multimedia processingarithmetic coding for signal and multimedia processing
arithmetic coding for signal and multimedia processing
 
add9.5.ppt
add9.5.pptadd9.5.ppt
add9.5.ppt
 
Huffman&Shannon-multimedia algorithms.ppt
Huffman&Shannon-multimedia algorithms.pptHuffman&Shannon-multimedia algorithms.ppt
Huffman&Shannon-multimedia algorithms.ppt
 
Lossless image compression.(1)
Lossless image compression.(1)Lossless image compression.(1)
Lossless image compression.(1)
 
Information Theory and coding - Lecture 3
Information Theory and coding - Lecture 3Information Theory and coding - Lecture 3
Information Theory and coding - Lecture 3
 
Computer Graphics & Visualization - 06
Computer Graphics & Visualization - 06Computer Graphics & Visualization - 06
Computer Graphics & Visualization - 06
 
Huffman coding
Huffman codingHuffman coding
Huffman coding
 
Compression Ii
Compression IiCompression Ii
Compression Ii
 
Compression Ii
Compression IiCompression Ii
Compression Ii
 
Implementation of Lossless Compression Algorithms for Text Data
Implementation of Lossless Compression Algorithms for Text DataImplementation of Lossless Compression Algorithms for Text Data
Implementation of Lossless Compression Algorithms for Text Data
 
image compresson
image compressonimage compresson
image compresson
 
Image compression
Image compressionImage compression
Image compression
 
Source coding
Source coding Source coding
Source coding
 
ImageCompression.ppt
ImageCompression.pptImageCompression.ppt
ImageCompression.ppt
 
ImageCompression.ppt
ImageCompression.pptImageCompression.ppt
ImageCompression.ppt
 
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
 
coding.pdf
coding.pdfcoding.pdf
coding.pdf
 
Presentation ppt 3.pptx
Presentation ppt 3.pptxPresentation ppt 3.pptx
Presentation ppt 3.pptx
 

More from Ramakant Soni

GATE 2021 Exam Information
GATE 2021 Exam InformationGATE 2021 Exam Information
GATE 2021 Exam InformationRamakant Soni
 
What is Algorithm - An Overview
What is Algorithm - An OverviewWhat is Algorithm - An Overview
What is Algorithm - An OverviewRamakant Soni
 
Role of Data Cleaning in Data Warehouse
Role of Data Cleaning in Data WarehouseRole of Data Cleaning in Data Warehouse
Role of Data Cleaning in Data WarehouseRamakant Soni
 
NOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQLNOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQLRamakant Soni
 
UML daigrams for Bank ATM system
UML daigrams for Bank ATM systemUML daigrams for Bank ATM system
UML daigrams for Bank ATM systemRamakant Soni
 
Collaboration diagram- UML diagram
Collaboration diagram- UML diagram Collaboration diagram- UML diagram
Collaboration diagram- UML diagram Ramakant Soni
 
Activity diagram-UML diagram
Activity diagram-UML diagramActivity diagram-UML diagram
Activity diagram-UML diagramRamakant Soni
 
Sequence diagram- UML diagram
Sequence diagram- UML diagramSequence diagram- UML diagram
Sequence diagram- UML diagramRamakant Soni
 
Class diagram- UML diagram
Class diagram- UML diagramClass diagram- UML diagram
Class diagram- UML diagramRamakant Soni
 
Use Case diagram-UML diagram-2
Use Case diagram-UML diagram-2Use Case diagram-UML diagram-2
Use Case diagram-UML diagram-2Ramakant Soni
 
Use Case diagram-UML diagram-1
Use Case diagram-UML diagram-1Use Case diagram-UML diagram-1
Use Case diagram-UML diagram-1Ramakant Soni
 
UML Diagrams- Unified Modeling Language Introduction
UML Diagrams- Unified Modeling Language IntroductionUML Diagrams- Unified Modeling Language Introduction
UML Diagrams- Unified Modeling Language IntroductionRamakant Soni
 

More from Ramakant Soni (13)

GATE 2021 Exam Information
GATE 2021 Exam InformationGATE 2021 Exam Information
GATE 2021 Exam Information
 
What is Algorithm - An Overview
What is Algorithm - An OverviewWhat is Algorithm - An Overview
What is Algorithm - An Overview
 
Role of Data Cleaning in Data Warehouse
Role of Data Cleaning in Data WarehouseRole of Data Cleaning in Data Warehouse
Role of Data Cleaning in Data Warehouse
 
Internet of things
Internet of thingsInternet of things
Internet of things
 
NOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQLNOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQL
 
UML daigrams for Bank ATM system
UML daigrams for Bank ATM systemUML daigrams for Bank ATM system
UML daigrams for Bank ATM system
 
Collaboration diagram- UML diagram
Collaboration diagram- UML diagram Collaboration diagram- UML diagram
Collaboration diagram- UML diagram
 
Activity diagram-UML diagram
Activity diagram-UML diagramActivity diagram-UML diagram
Activity diagram-UML diagram
 
Sequence diagram- UML diagram
Sequence diagram- UML diagramSequence diagram- UML diagram
Sequence diagram- UML diagram
 
Class diagram- UML diagram
Class diagram- UML diagramClass diagram- UML diagram
Class diagram- UML diagram
 
Use Case diagram-UML diagram-2
Use Case diagram-UML diagram-2Use Case diagram-UML diagram-2
Use Case diagram-UML diagram-2
 
Use Case diagram-UML diagram-1
Use Case diagram-UML diagram-1Use Case diagram-UML diagram-1
Use Case diagram-UML diagram-1
 
UML Diagrams- Unified Modeling Language Introduction
UML Diagrams- Unified Modeling Language IntroductionUML Diagrams- Unified Modeling Language Introduction
UML Diagrams- Unified Modeling Language Introduction
 

Recently uploaded

High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...Call girls in Ahmedabad High profile
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 

Recently uploaded (20)

High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 

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