SlideShare a Scribd company logo
Data Compression
Methods
Run-length method
Huffman method
Rejin Thomas
B3GMCA2124
November 13, 2015 1B3GMCA2124
What is Data Compression?
Data compression is the process of reducing
the size of data.
Benefits
◦ Reduce storage needed
◦ Reduce transmission cost / bandwidth
November 13, 2015 2B3GMCA2124
Data Compression Methods
 Data compression is about storing and
sending a smaller number of bits.
 There’re two major categories for methods
to compress data: lossless and lossy
methods
November 13, 2015 3B3GMCA2124
Lossless Compression Methods
 . In lossless methods, original data and the
data after compression and decompression
are exactly the same.
 Redundant data is removed in compression
and added during decompression.
 Lossless methods are used when we can’t
afford to lose any data: legal and medical
documents, computer programs
November 13, 2015 4B3GMCA2124
The Huffman Coding
 developed by David Huffman.
In Huffman coding, you assign shorter codes to
symbols that occur more frequently and longer
codes to those that occur less frequently.
November 13, 2015 B3GMCA2124 5
Run-length encoding
Replace consecutive repeating occurrences of a
symbol by 1 occurrence of the symbol itself, then
followed by the number of occurrences.
Lempel Ziv Encoding
 It is dictionary-based encoding
 Basic idea:
 Create a dictionary(a table) of strings used
during communication.
 If both sender and receiver have a copy of the
dictionary, then previously-encountered strings
can be substituted by their index in the
dictionary.
November 13, 2015 6B3GMCA2124
Lempel Ziv Compression
 Have 2 phases:
 Building an indexed dictionary
 Compressing a string of symbols
• Algorithm:
 Extract the smallest substring that cannot be
found in the remaining uncompressed string.
 Store that substring in the dictionary as a new
entry and assign it an index value
 Substring is replaced with the index found in
the dictionary
 Insert the index and the last character of the
substring into the compressed string
November 13, 2015 7B3GMCA2124
Lossy Compression Methods
 Used for compressing images and video
files (our eyes cannot distinguish subtle
changes, so lossy data is acceptable).
 These methods are cheaper, less time and
space.
 Several methods:
 JPEG: compress pictures and graphics
 MPEG: compress video
 MP3: compress audio
November 13, 2015 8B3GMCA2124
Run-length encoding
 Simplest method of compression.
 How: replace consecutive repeating occurrences of a symbol
by 1 occurrence of the symbol itself, then followed by the
number of occurrences.
 The method can be more efficient if the data uses only 2
symbols (0s and 1s) in bit patterns and 1 symbol is more
frequent than another.
November 13, 2015 9B3GMCA2124
Huffman Coding
 Assign fewer bits to symbols that occur more
frequently and more bits to symbols appear less
often.
 Algorithm:
① Make a leaf node for each code symbol
Add the generation probability of each symbol to the leaf
node
② Take the two leaf nodes with the smallest probability and
connect them into a new node
Add 1 or 0 to each of the two branches
The probability of the new node is the sum of the
probabilities of the two connecting nodes
③ If there is only one node left, the code construction is
completed. If not, go back to (2)
November 13, 2015 10B3GMCA2124
Huffman Coding
 Example
November 13, 2015 11B3GMCA2124
Huffman Coding
 Encoding
 Decoding
November 13, 2015 12B3GMCA2124
References
 http://www.csie.kuas.edu.tw/course/cs/engli
sh/ch-15.ppt
 CS157B-Lecture 19 by Professor Lee
http://cs.sjsu.edu/~lee/cs157b/cs157b.html
 “The essentials of computer
organization and architecture” by Linda
Null and Julia Nobur.
November 13, 2015 13B3GMCA2124
Data Compression
QUESTION?
November 13, 2015 14B3GMCA2124

More Related Content

PPTX
Kalmanfilter
PPT
Huffman Coding
PPTX
Fundamentals of Data compression
PPTX
Phase shift keying
PPTX
Audio compression
PPT
Digital modulation techniques
PPT
Data compression
PPTX
comparision of lossy and lossless image compression using various algorithm
Kalmanfilter
Huffman Coding
Fundamentals of Data compression
Phase shift keying
Audio compression
Digital modulation techniques
Data compression
comparision of lossy and lossless image compression using various algorithm

What's hot (20)

PPTX
Audio compression
PPTX
Jpeg compression
PPTX
Codecs
PPTX
Audio compression
PDF
Presentation on Image Compression
PPTX
Video compression
PDF
Unit 1 Introduction to Data Compression
PPTX
Shannon Fano
PPTX
PPTX
Video compression
PPTX
Equalization
PPTX
Error control
PPTX
BCH Codes
PPTX
PSK (PHASE SHIFT KEYING )
PPT
Pulse code modulation
PPTX
Presentation1 (2)
PPTX
Linear Predictive Coding
DOCX
Arithmetic coding
PPTX
Data compression techniques
PDF
Compression: Video Compression (MPEG and others)
Audio compression
Jpeg compression
Codecs
Audio compression
Presentation on Image Compression
Video compression
Unit 1 Introduction to Data Compression
Shannon Fano
Video compression
Equalization
Error control
BCH Codes
PSK (PHASE SHIFT KEYING )
Pulse code modulation
Presentation1 (2)
Linear Predictive Coding
Arithmetic coding
Data compression techniques
Compression: Video Compression (MPEG and others)
Ad

Viewers also liked (15)

PPTX
Data compression
PPTX
Data compression
PPTX
Data compression
PPTX
data compression technique
PPTX
Introduction for Data Compression
PDF
Chapter 5 - Data Compression
PPTX
Data compression
PPTX
A new algorithm for data compression technique using vlsi
PPTX
Data Compression (Lossy and Lossless)
PPTX
Data compression in Modern Application
PPT
Lecture3
PDF
Letter of Reco - Eric
DOC
Sudan Counselor Inspected China Wanda Group on March 7th 2016
DOCX
Last updated Resume Jan 2017
PPTX
Green computing
Data compression
Data compression
Data compression
data compression technique
Introduction for Data Compression
Chapter 5 - Data Compression
Data compression
A new algorithm for data compression technique using vlsi
Data Compression (Lossy and Lossless)
Data compression in Modern Application
Lecture3
Letter of Reco - Eric
Sudan Counselor Inspected China Wanda Group on March 7th 2016
Last updated Resume Jan 2017
Green computing
Ad

Similar to 4 data compression (20)

PPTX
Data compression
PPTX
Data compression
PDF
A research paper_on_lossless_data_compre
PDF
2019188026 Data Compression (1) (1).pdf
PPT
Data Compression
PPT
Data compression
PPT
datacompression-150127035138-conversion-gate01.ppt
PDF
Image compression
PPTX
Unit 3 Image Compression and Segmentation.pptx
PDF
Introduction Data Compression/ Data compression, modelling and coding,Image C...
PPTX
Data compression algorithms
PPT
Compression techniques
PPTX
Text compression
PPT
111111111111111111111111111111111789.ppt
PPTX
image basics and image compression
PDF
Module-IV 093.pdf
PPT
Lec5 Compression
PDF
Dictionary Based Compression
PPT
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
Data compression
Data compression
A research paper_on_lossless_data_compre
2019188026 Data Compression (1) (1).pdf
Data Compression
Data compression
datacompression-150127035138-conversion-gate01.ppt
Image compression
Unit 3 Image Compression and Segmentation.pptx
Introduction Data Compression/ Data compression, modelling and coding,Image C...
Data compression algorithms
Compression techniques
Text compression
111111111111111111111111111111111789.ppt
image basics and image compression
Module-IV 093.pdf
Lec5 Compression
Dictionary Based Compression
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...

Recently uploaded (20)

PDF
August Patch Tuesday
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Mushroom cultivation and it's methods.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Chapter 5: Probability Theory and Statistics
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
project resource management chapter-09.pdf
PDF
A novel scalable deep ensemble learning framework for big data classification...
PPTX
TLE Review Electricity (Electricity).pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Web App vs Mobile App What Should You Build First.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PPTX
Tartificialntelligence_presentation.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
1. Introduction to Computer Programming.pptx
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
1 - Historical Antecedents, Social Consideration.pdf
August Patch Tuesday
Heart disease approach using modified random forest and particle swarm optimi...
Mushroom cultivation and it's methods.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Chapter 5: Probability Theory and Statistics
Assigned Numbers - 2025 - Bluetooth® Document
project resource management chapter-09.pdf
A novel scalable deep ensemble learning framework for big data classification...
TLE Review Electricity (Electricity).pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Web App vs Mobile App What Should You Build First.pdf
cloud_computing_Infrastucture_as_cloud_p
Tartificialntelligence_presentation.pptx
Approach and Philosophy of On baking technology
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
1. Introduction to Computer Programming.pptx
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
1 - Historical Antecedents, Social Consideration.pdf

4 data compression

  • 1. Data Compression Methods Run-length method Huffman method Rejin Thomas B3GMCA2124 November 13, 2015 1B3GMCA2124
  • 2. What is Data Compression? Data compression is the process of reducing the size of data. Benefits ◦ Reduce storage needed ◦ Reduce transmission cost / bandwidth November 13, 2015 2B3GMCA2124
  • 3. Data Compression Methods  Data compression is about storing and sending a smaller number of bits.  There’re two major categories for methods to compress data: lossless and lossy methods November 13, 2015 3B3GMCA2124
  • 4. Lossless Compression Methods  . In lossless methods, original data and the data after compression and decompression are exactly the same.  Redundant data is removed in compression and added during decompression.  Lossless methods are used when we can’t afford to lose any data: legal and medical documents, computer programs November 13, 2015 4B3GMCA2124
  • 5. The Huffman Coding  developed by David Huffman. In Huffman coding, you assign shorter codes to symbols that occur more frequently and longer codes to those that occur less frequently. November 13, 2015 B3GMCA2124 5 Run-length encoding Replace consecutive repeating occurrences of a symbol by 1 occurrence of the symbol itself, then followed by the number of occurrences.
  • 6. Lempel Ziv Encoding  It is dictionary-based encoding  Basic idea:  Create a dictionary(a table) of strings used during communication.  If both sender and receiver have a copy of the dictionary, then previously-encountered strings can be substituted by their index in the dictionary. November 13, 2015 6B3GMCA2124
  • 7. Lempel Ziv Compression  Have 2 phases:  Building an indexed dictionary  Compressing a string of symbols • Algorithm:  Extract the smallest substring that cannot be found in the remaining uncompressed string.  Store that substring in the dictionary as a new entry and assign it an index value  Substring is replaced with the index found in the dictionary  Insert the index and the last character of the substring into the compressed string November 13, 2015 7B3GMCA2124
  • 8. Lossy Compression Methods  Used for compressing images and video files (our eyes cannot distinguish subtle changes, so lossy data is acceptable).  These methods are cheaper, less time and space.  Several methods:  JPEG: compress pictures and graphics  MPEG: compress video  MP3: compress audio November 13, 2015 8B3GMCA2124
  • 9. Run-length encoding  Simplest method of compression.  How: replace consecutive repeating occurrences of a symbol by 1 occurrence of the symbol itself, then followed by the number of occurrences.  The method can be more efficient if the data uses only 2 symbols (0s and 1s) in bit patterns and 1 symbol is more frequent than another. November 13, 2015 9B3GMCA2124
  • 10. Huffman Coding  Assign fewer bits to symbols that occur more frequently and more bits to symbols appear less often.  Algorithm: ① Make a leaf node for each code symbol Add the generation probability of each symbol to the leaf node ② Take the two leaf nodes with the smallest probability and connect them into a new node Add 1 or 0 to each of the two branches The probability of the new node is the sum of the probabilities of the two connecting nodes ③ If there is only one node left, the code construction is completed. If not, go back to (2) November 13, 2015 10B3GMCA2124
  • 11. Huffman Coding  Example November 13, 2015 11B3GMCA2124
  • 12. Huffman Coding  Encoding  Decoding November 13, 2015 12B3GMCA2124
  • 13. References  http://www.csie.kuas.edu.tw/course/cs/engli sh/ch-15.ppt  CS157B-Lecture 19 by Professor Lee http://cs.sjsu.edu/~lee/cs157b/cs157b.html  “The essentials of computer organization and architecture” by Linda Null and Julia Nobur. November 13, 2015 13B3GMCA2124