SlideShare a Scribd company logo
1 of 27
Compression Techniques
Introduction
What is Compression?
Data compression requires the identification and
extraction of source redundancy.
In other words, data compression seeks to reduce
the number of bits used to store or transmit
information.
There are a wide range of compression methods
which can be so unlike one another that they have
little in common except that they compress data.
Compression can be categorized in
         two broad ways:

• Lossless compression
• Lossy compression
Lossless compression

• recover the exact original data after compression.

• mainly use for compressing database records,
spreadsheets or word processing files, where exact
replication of the original is essential.
Lossy compression.
• will result in a certain loss of accuracy in exchange for
   a substantial increase in compression.
• more effective when used to compress graphic images
and digitised voice where losses outside visual or aural
perception can be tolerated.
• Most lossy compression techniques can be adjusted to
different quality levels, gaining higher accuracy in
exchange for less effective compression.
The Need For Compression…
In terms of storage, the capacity of a storage
device can be effectively increased with methods
that compresses a body of data on its way to a
storage device and decompresses it when it is
retrieved.
 In terms of communications, the bandwidth of a
digital communication link can be effectively
increased by compressing data at the sending
end and decompressing data at the receiving
end.
A Brief History of Data
               Compression..
• The late 40's were the early years of Information
Theory, the idea of developing efficient new
coding methods was just starting to be fleshed
out. Ideas of entropy, information content and
redundancy were explored.
• One popular notion held that if the probability of
symbols in a message were known, there ought
to be a way to code the symbols so that the
message will take up less space.
• The first well-known method for compressing
digital signals is now known as Shannon- Fano
coding. Shannon and Fano [~1948]
simultaneously developed this algorithm which
assigns binary codewords to unique symbols that
appear within a given data file.
• While Shannon-Fano coding was a great leap
forward, it had the unfortunate luck to be quickly
superseded by an even more efficient coding
system : Huffman Coding.
• Huffman coding [1952] shares most
  characteristics of Shannon-Fano coding.
• Huffman coding could perform effective data
  compression by reducing the amount of
  redundancy in the coding of symbols.
• It has been proven to be the most efficient
  fixed-length coding method available
• In the last fifteen years, Huffman coding has
  been replaced by arithmetic coding.
• Arithmetic coding bypasses the idea of
  replacing an input symbol with a specific code.
• It replaces a stream of input symbols with a
  single floating-point output number.
• More bits are needed in the output number
  for longer, complex messages.
Terminology
• Compressor–Software (or hardware) device
  that compresses data
• Decompressor–Software (or hardware)
  device that decompresses data
• Codec–Software (or hardware) device that
  compresses and decompresses data
• Algorithm–The logic that governs the
  compression/decompression process
Lossless Compression
                Algorithms:
•   Repetitive Sequence Suppression
•   Run-length Encoding*
•   Pattern Substitution
•   Entropy Encoding*
     The Shannon-Fano Algorithm
     Huffman Coding*
     Arithmetic Coding*
Repetitive
• If a sequence aSequence Suppression
                 series on n successive tokens appears
• Replace series with a token and a count number of
occurrences.
• Usually need to have a special flag to denote when the
repeated token appears
• Example
89400000000000000000000000000000000
• we can replace with 894f32, where f is the flag for
  zero.
Run-length Encoding

Example:
• Original Sequence:
111122233333311112222
• can be encoded as:
(1,4),(2,3),(3,6),(1,4),(2,4)
Run-Length Encoding (RLE)
                   Method
Example:
Run-Length Encoding (RLE)
                   Method

Example:




 blue x 6, magenta x 7, red x 3, yellow x 3 and green x 4
Run-Length Encoding (RLE)
                Method
• Example:



    This would give:




     which is twice the size!
•   Uncompress
•   Blue White White White White White White Blue
•   White Blue White White White White White Blue
•   etc.
•   Compress
•   1XBlue 6XWhite 1XBlue
•   1XWhite 1XBlue 4Xwhite 1XBlue 1XWhite
•   etc.
The Shannon-Fano
                 Algorithm
•   Example
•   Data:
•   ABBAAAACDEAAABBBDDEEAAA........
•   Count symbols in stream:
Arithmetic Coding
Example
• Raw data: BACA
Therefore
• A occurs with probability 0.5,
• B and C with probabilities 0.25
2/4=0.5
1/4=0.25
Cont..

• Start by assigning each symbol to the
• probability range 0–1.




   The first symbol in our example stream is B
Applications
             Lossless compression..
• The above is a very simple example of run-
  length encoding,
• wherein large runs of consecutive identical data
  values are replaced by a simple code with the
  data value and length of the run. This is an
  example of lossless data compression.
• It is often used to optimize disk space on office
  computers, or better use the connection
  bandwidth in a computer network
Lossy image compression


• is used in digital cameras,
• to increase storage capacities with minimal
  degradation of picture quality.
Algorthim of coding…
function LZW Decode(File)
function LZW Encode(File) n ReadIndex(File)
n.
.
ReadByte(File)

GetString(n)
while n
ÇEOF do Output(

)

ReadByte(File.) while n
ÇEOF do

n©ÃF GetIndex(n3) nÃF

ReadIndex(File)

while n©Ã .
$
do if IndexInDict?(n©Ã) then
Ç
.

nU.nà GetString(n©Ã)
ReadByte(File3
.) AddDict(n3
×v1è)

nÃGetIndex(n) else
3
.

Output(n) C’= AddDict(n×~1è)

3

Ã

AddDict(n) GetString(n)
C=x Output()
C= C’

More Related Content

What's hot

Dictionary Based Compression
Dictionary Based CompressionDictionary Based Compression
Dictionary Based Compressionanithabalaprabhu
 
Chapter 10 - Multimedia Over Atm
Chapter 10 - Multimedia Over AtmChapter 10 - Multimedia Over Atm
Chapter 10 - Multimedia Over AtmPratik Pradhan
 
Comparison between Lossy and Lossless Compression
Comparison between Lossy and Lossless CompressionComparison between Lossy and Lossless Compression
Comparison between Lossy and Lossless Compressionrafikrokon
 
digital image processing
digital image processingdigital image processing
digital image processingAbinaya B
 
Data compression techniques
Data compression techniquesData compression techniques
Data compression techniquesDeep Bhatt
 
Image compression in digital image processing
Image compression in digital image processingImage compression in digital image processing
Image compression in digital image processingDHIVYADEVAKI
 
Multimedia color in image and video
Multimedia color in image and videoMultimedia color in image and video
Multimedia color in image and videoMazin Alwaaly
 
Data Compression (Lossy and Lossless)
Data Compression (Lossy and Lossless)Data Compression (Lossy and Lossless)
Data Compression (Lossy and Lossless)Project Student
 
Compression: Images (JPEG)
Compression: Images (JPEG)Compression: Images (JPEG)
Compression: Images (JPEG)danishrafiq
 
data compression technique
data compression techniquedata compression technique
data compression techniqueCHINMOY PAUL
 
video compression techique
video compression techiquevideo compression techique
video compression techiqueAshish Kumar
 

What's hot (20)

Lzw coding technique for image compression
Lzw coding technique for image compressionLzw coding technique for image compression
Lzw coding technique for image compression
 
Multimedia compression
Multimedia compressionMultimedia compression
Multimedia compression
 
Dictionary Based Compression
Dictionary Based CompressionDictionary Based Compression
Dictionary Based Compression
 
Digital Audio
Digital AudioDigital Audio
Digital Audio
 
Chapter 10 - Multimedia Over Atm
Chapter 10 - Multimedia Over AtmChapter 10 - Multimedia Over Atm
Chapter 10 - Multimedia Over Atm
 
Comparison between Lossy and Lossless Compression
Comparison between Lossy and Lossless CompressionComparison between Lossy and Lossless Compression
Comparison between Lossy and Lossless Compression
 
Data Redundacy
Data RedundacyData Redundacy
Data Redundacy
 
digital image processing
digital image processingdigital image processing
digital image processing
 
Data compression techniques
Data compression techniquesData compression techniques
Data compression techniques
 
Image compression in digital image processing
Image compression in digital image processingImage compression in digital image processing
Image compression in digital image processing
 
Image compression
Image compressionImage compression
Image compression
 
Data compression
Data compressionData compression
Data compression
 
Multimedia color in image and video
Multimedia color in image and videoMultimedia color in image and video
Multimedia color in image and video
 
Data Compression (Lossy and Lossless)
Data Compression (Lossy and Lossless)Data Compression (Lossy and Lossless)
Data Compression (Lossy and Lossless)
 
Image compression
Image compression Image compression
Image compression
 
Data compression
Data  compressionData  compression
Data compression
 
Compression: Images (JPEG)
Compression: Images (JPEG)Compression: Images (JPEG)
Compression: Images (JPEG)
 
data compression technique
data compression techniquedata compression technique
data compression technique
 
Audio compression
Audio compressionAudio compression
Audio compression
 
video compression techique
video compression techiquevideo compression techique
video compression techique
 

Similar to Compression techniques

Teknik Pengkodean (2).pptx
Teknik Pengkodean (2).pptxTeknik Pengkodean (2).pptx
Teknik Pengkodean (2).pptxzulhelmanz
 
Module-IV 093.pdf
Module-IV 093.pdfModule-IV 093.pdf
Module-IV 093.pdfSamrajECE
 
Computer Graphics & Visualization - 06
Computer Graphics & Visualization - 06Computer Graphics & Visualization - 06
Computer Graphics & Visualization - 06Pankaj Debbarma
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.pptAllamJayaPrakash
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.pptAllamJayaPrakash
 
Chapter%202%20 %20 Text%20compression(2)
Chapter%202%20 %20 Text%20compression(2)Chapter%202%20 %20 Text%20compression(2)
Chapter%202%20 %20 Text%20compression(2)nes
 
Lec6 compression
Lec6 compressionLec6 compression
Lec6 compressionShona Hira
 
Lec6 compression
Lec6 compressionLec6 compression
Lec6 compressionDom Mike
 
Lec6 compression
Lec6 compressionLec6 compression
Lec6 compressionDom Mike
 
VII Compression Introduction
VII Compression IntroductionVII Compression Introduction
VII Compression Introductionsangusajjan
 
Fundamentals of Data compression
Fundamentals of Data compressionFundamentals of Data compression
Fundamentals of Data compressionM.k. Praveen
 
A research paper_on_lossless_data_compre
A research paper_on_lossless_data_compreA research paper_on_lossless_data_compre
A research paper_on_lossless_data_compreLuisa Francisco
 
Affable Compression through Lossless Column-Oriented Huffman Coding Technique
Affable Compression through Lossless Column-Oriented Huffman Coding TechniqueAffable Compression through Lossless Column-Oriented Huffman Coding Technique
Affable Compression through Lossless Column-Oriented Huffman Coding TechniqueIOSR Journals
 
Steganography presentation
Steganography presentationSteganography presentation
Steganography presentationAshwin Prasad
 
notes_Image Compression_edited.ppt
notes_Image Compression_edited.pptnotes_Image Compression_edited.ppt
notes_Image Compression_edited.pptHarisMasood20
 
ImageCompression.ppt
ImageCompression.pptImageCompression.ppt
ImageCompression.pptdudoo1
 

Similar to Compression techniques (20)

Teknik Pengkodean (2).pptx
Teknik Pengkodean (2).pptxTeknik Pengkodean (2).pptx
Teknik Pengkodean (2).pptx
 
Module-IV 093.pdf
Module-IV 093.pdfModule-IV 093.pdf
Module-IV 093.pdf
 
Computer Graphics & Visualization - 06
Computer Graphics & Visualization - 06Computer Graphics & Visualization - 06
Computer Graphics & Visualization - 06
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt
 
Chapter%202%20 %20 Text%20compression(2)
Chapter%202%20 %20 Text%20compression(2)Chapter%202%20 %20 Text%20compression(2)
Chapter%202%20 %20 Text%20compression(2)
 
Compressionbasics
CompressionbasicsCompressionbasics
Compressionbasics
 
Lec6 compression
Lec6 compressionLec6 compression
Lec6 compression
 
Lec6 compression
Lec6 compressionLec6 compression
Lec6 compression
 
Lec6 compression
Lec6 compressionLec6 compression
Lec6 compression
 
VII Compression Introduction
VII Compression IntroductionVII Compression Introduction
VII Compression Introduction
 
Fundamentals of Data compression
Fundamentals of Data compressionFundamentals of Data compression
Fundamentals of Data compression
 
A research paper_on_lossless_data_compre
A research paper_on_lossless_data_compreA research paper_on_lossless_data_compre
A research paper_on_lossless_data_compre
 
Affable Compression through Lossless Column-Oriented Huffman Coding Technique
Affable Compression through Lossless Column-Oriented Huffman Coding TechniqueAffable Compression through Lossless Column-Oriented Huffman Coding Technique
Affable Compression through Lossless Column-Oriented Huffman Coding Technique
 
Lecture 1.pptx
Lecture 1.pptxLecture 1.pptx
Lecture 1.pptx
 
Steganography presentation
Steganography presentationSteganography presentation
Steganography presentation
 
add9.5.ppt
add9.5.pptadd9.5.ppt
add9.5.ppt
 
Image compression
Image compressionImage compression
Image compression
 
notes_Image Compression_edited.ppt
notes_Image Compression_edited.pptnotes_Image Compression_edited.ppt
notes_Image Compression_edited.ppt
 
ImageCompression.ppt
ImageCompression.pptImageCompression.ppt
ImageCompression.ppt
 

More from m_divya_bharathi

More from m_divya_bharathi (10)

Wvtr and otr
Wvtr and otrWvtr and otr
Wvtr and otr
 
Recycling of paper and board
Recycling of paper and boardRecycling of paper and board
Recycling of paper and board
 
Sustainable packaging
Sustainable packagingSustainable packaging
Sustainable packaging
 
Palm fibre packaging
Palm fibre packagingPalm fibre packaging
Palm fibre packaging
 
Paper unit i
Paper unit iPaper unit i
Paper unit i
 
The principles of design
The principles of designThe principles of design
The principles of design
 
Thermal physics
Thermal physicsThermal physics
Thermal physics
 
Quality
QualityQuality
Quality
 
afforestation and deforestation relating printing
afforestation and deforestation relating printingafforestation and deforestation relating printing
afforestation and deforestation relating printing
 
Personality development
Personality developmentPersonality development
Personality development
 

Recently uploaded

Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 

Recently uploaded (20)

TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 

Compression techniques

  • 2. Introduction What is Compression? Data compression requires the identification and extraction of source redundancy. In other words, data compression seeks to reduce the number of bits used to store or transmit information. There are a wide range of compression methods which can be so unlike one another that they have little in common except that they compress data.
  • 3. Compression can be categorized in two broad ways: • Lossless compression • Lossy compression
  • 4. Lossless compression • recover the exact original data after compression. • mainly use for compressing database records, spreadsheets or word processing files, where exact replication of the original is essential.
  • 5. Lossy compression. • will result in a certain loss of accuracy in exchange for a substantial increase in compression. • more effective when used to compress graphic images and digitised voice where losses outside visual or aural perception can be tolerated. • Most lossy compression techniques can be adjusted to different quality levels, gaining higher accuracy in exchange for less effective compression.
  • 6. The Need For Compression… In terms of storage, the capacity of a storage device can be effectively increased with methods that compresses a body of data on its way to a storage device and decompresses it when it is retrieved.  In terms of communications, the bandwidth of a digital communication link can be effectively increased by compressing data at the sending end and decompressing data at the receiving end.
  • 7. A Brief History of Data Compression.. • The late 40's were the early years of Information Theory, the idea of developing efficient new coding methods was just starting to be fleshed out. Ideas of entropy, information content and redundancy were explored. • One popular notion held that if the probability of symbols in a message were known, there ought to be a way to code the symbols so that the message will take up less space.
  • 8. • The first well-known method for compressing digital signals is now known as Shannon- Fano coding. Shannon and Fano [~1948] simultaneously developed this algorithm which assigns binary codewords to unique symbols that appear within a given data file. • While Shannon-Fano coding was a great leap forward, it had the unfortunate luck to be quickly superseded by an even more efficient coding system : Huffman Coding.
  • 9. • Huffman coding [1952] shares most characteristics of Shannon-Fano coding. • Huffman coding could perform effective data compression by reducing the amount of redundancy in the coding of symbols. • It has been proven to be the most efficient fixed-length coding method available
  • 10. • In the last fifteen years, Huffman coding has been replaced by arithmetic coding. • Arithmetic coding bypasses the idea of replacing an input symbol with a specific code. • It replaces a stream of input symbols with a single floating-point output number. • More bits are needed in the output number for longer, complex messages.
  • 11. Terminology • Compressor–Software (or hardware) device that compresses data • Decompressor–Software (or hardware) device that decompresses data • Codec–Software (or hardware) device that compresses and decompresses data • Algorithm–The logic that governs the compression/decompression process
  • 12. Lossless Compression Algorithms: • Repetitive Sequence Suppression • Run-length Encoding* • Pattern Substitution • Entropy Encoding* The Shannon-Fano Algorithm Huffman Coding* Arithmetic Coding*
  • 13. Repetitive • If a sequence aSequence Suppression series on n successive tokens appears • Replace series with a token and a count number of occurrences. • Usually need to have a special flag to denote when the repeated token appears • Example 89400000000000000000000000000000000 • we can replace with 894f32, where f is the flag for zero.
  • 14. Run-length Encoding Example: • Original Sequence: 111122233333311112222 • can be encoded as: (1,4),(2,3),(3,6),(1,4),(2,4)
  • 15. Run-Length Encoding (RLE) Method Example:
  • 16. Run-Length Encoding (RLE) Method Example: blue x 6, magenta x 7, red x 3, yellow x 3 and green x 4
  • 17. Run-Length Encoding (RLE) Method • Example: This would give: which is twice the size!
  • 18. Uncompress • Blue White White White White White White Blue • White Blue White White White White White Blue • etc. • Compress • 1XBlue 6XWhite 1XBlue • 1XWhite 1XBlue 4Xwhite 1XBlue 1XWhite • etc.
  • 19. The Shannon-Fano Algorithm • Example • Data: • ABBAAAACDEAAABBBDDEEAAA........ • Count symbols in stream:
  • 20. Arithmetic Coding Example • Raw data: BACA Therefore • A occurs with probability 0.5, • B and C with probabilities 0.25 2/4=0.5 1/4=0.25
  • 21. Cont.. • Start by assigning each symbol to the • probability range 0–1. The first symbol in our example stream is B
  • 22. Applications Lossless compression.. • The above is a very simple example of run- length encoding, • wherein large runs of consecutive identical data values are replaced by a simple code with the data value and length of the run. This is an example of lossless data compression. • It is often used to optimize disk space on office computers, or better use the connection bandwidth in a computer network
  • 23. Lossy image compression • is used in digital cameras, • to increase storage capacities with minimal degradation of picture quality.
  • 24. Algorthim of coding… function LZW Decode(File) function LZW Encode(File) n ReadIndex(File) n. . ReadByte(File)  GetString(n) while n ÇEOF do Output( 
  • 25. ) ReadByte(File.) while n ÇEOF do n©ÃF GetIndex(n3) nÃF  ReadIndex(File) while n©Ã . $ do if IndexInDict?(n©Ã) then