SlideShare a Scribd company logo
Text Compression  Chapter 2
[object Object],[object Object],Why Compress ? In almost all multimedia applications,  a technique known as  compression  is first applied to the source information prior to its  Transmission.  This is done either to reduce the volume of information to be transmitted –  text , fax and images or to reduce the bandwidth that is required for its  transmission – speech , audio and video.
Compression ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],Redundancy
Human Perception Factors ,[object Object],[object Object],[object Object]
Compression Principles  ,[object Object],[object Object],[object Object],[object Object]
Source Encoders and destination decoders  Prior to transmitting the source information relating to a  multimedia application , a compression algorithm is applied to it. This implies that in order for the destination to reproduce the original source information or in some instances, a nearly exact copy of it – a matching decompression algorithm must be applied to it.  The application of the compression algorithm is the main function carried out by the  source encoder  and the decompression algorithm is carried out by the  destination decoder .
Source Encoders and destination decoders  In applications which involve two computers communicating with each other, the time required to perform the compression and decompression algorithm is not always critical.  So both algorithms are normally implemented in software within the two computers. Source  information Source  encoder  program  Destination  Decoder  Program Copy of  Source  Information Network Source encoder / destination decoder : Software only  Source Computer Destination Computer
Source Encoders and destination decoders  In other applications, however the time required to perform the  compression and decompression algorithms in software is not acceptable  and instead the two algorithms must be performed by special processors  in separate units . Source  information Source  encoder  Processor Destination  Decoder  Processor Copy of  Source  Information Network Source Computer Destination Computer Source encoder / destination decoder : Special  processors/hardware
Classification  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],Lossless compression algorithm  the aim is to reduce the amount of source  Information to be transmitted in such a way that, when the compressed  information Is decompressed , there is no loss of information. Lossless compression is said therefore , to be reversible. An  example  application of lossless compression is for the transfer over a  network of a text file since , in such applications , it it normally imperative that  No part of the source information is lost during either the compression or  decompression operations.
[object Object],The aim of lossy compression algorithm is normally not to reproduce an  exact copy of the source information after decomposition but rather a  version of it which is perceived by the recipient as a true copy (approx) Example : digitized images and audio and video streams. In such cases, the sensitivity of the human eye or ear is such that any fine  details that may be missing from the original source signal after  decompression are not detectable.
[object Object],Entropy encoding is lossless and independent of the  type of information that is being compressed .  It is concerned solely with how the information is represented.  Run-length Encoding  Typical applications of this type of encoding are when the source information  Comprises long substrings of the same character or binary digit. Instead of transmitting in the form of independent code words or bits , it is transmitted  in the form of a different set of codewords which  indicate bits as well as number of bits  In the substring. Example :  input  : 00000001111111110000011……. output  : 0,7,1,10,0,5,1,2
Statistical Encoding   In this technique, patterns of bits (word) or that are more frequent are recorded  using shorter codes. It uses a set of variable length codewords  with the shortest codewords used to  represent the most frequently occurring symbols. For example :   In a string of text , the character A may occurs more frequently than say  the character P which occurs more frequently than the character Z , and so on…  Statistical encoding exploits this property by using a set of variable length  Codewords With the shortest codewords used to represent the most frequently  occurring symbols.
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
In practice , the use of variable-length codewords is not quite as straight forward as it first appears. Clearly as with run-length encoding , the destination must know the set of codewords being used by the source.  With variable length codewords , however in order for the decoding operation to  be carried out correctly , it is necessary to ensure that a shorter codeword in the set does not form the start of a longer codeword otherwise the decoder will interpret the string on the wrong codeword boundaries. A codeword set that avoids this happening is said to process the prefix and an  Encoding scheme that generates codewords that have this property is the  Huffman encoding algorithm.
Huffman Encoding ,[object Object],[object Object],“  An Encoding scheme that generates code words that have prefix property is called the  HUFFMAN ENCODING ALGORITHM “
Huffman Encoding ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Huffman code tree  ,[object Object],[object Object],[object Object],[object Object],[object Object]
Static Huffman Encoding 7  00 7  01 9  10 6  111 2  1100 4  1101 14 21 9 12 7 7 6 6 2 4 0 1 0 0 0 0 1 1 1 1
Decoding Algorithm  End  Is codeword already stored ? Begin  Set CODEWORD to empty Read next bit from BITSTREAM and append to  existing bits in CODEWORD Load matching ASCII Character into Receive _buffer  All bits in BITSTREAM Processed n n
Dynamic Huffman Coding  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 
Arithmetic Coding  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

Multimedia graphics and image data representation
Multimedia graphics and image data representationMultimedia graphics and image data representation
Multimedia graphics and image data representation
Mazin Alwaaly
 
Frequency Division Multiple Access (FDMA)
Frequency Division Multiple Access (FDMA)Frequency Division Multiple Access (FDMA)
Frequency Division Multiple Access (FDMA)
Miles Kevin Galario
 
Audio and Video Compression
Audio and Video CompressionAudio and Video Compression
Audio and Video Compression
Er. Ashish Pandey
 
IMAGE COMPRESSION AND DECOMPRESSION SYSTEM
IMAGE COMPRESSION AND DECOMPRESSION SYSTEMIMAGE COMPRESSION AND DECOMPRESSION SYSTEM
IMAGE COMPRESSION AND DECOMPRESSION SYSTEM
Vishesh Banga
 
Multimedia seminar ppt
Multimedia seminar pptMultimedia seminar ppt
Multimedia seminar ppt
Anandi Kumari
 
Hd tv
Hd tvHd tv
Multimedia technology
Multimedia technologyMultimedia technology
Multimedia technology
Vishnu Ram
 
Image compression
Image compressionImage compression
Image compression
PREEYANKAV
 
Fundamentals and image compression models
Fundamentals and image compression modelsFundamentals and image compression models
Fundamentals and image compression models
lavanya marichamy
 
digital image processing
digital image processingdigital image processing
digital image processing
Abinaya B
 
Comparison between Lossy and Lossless Compression
Comparison between Lossy and Lossless CompressionComparison between Lossy and Lossless Compression
Comparison between Lossy and Lossless Compression
rafikrokon
 
Transform coding
Transform codingTransform coding
Transform coding
Nancy K
 
Multimedia:Multimedia compression
Multimedia:Multimedia compression Multimedia:Multimedia compression
Multimedia:Multimedia compression
St Mary's College,Thrissur,Kerala
 
Chapter 5 - Data Compression
Chapter 5 - Data CompressionChapter 5 - Data Compression
Chapter 5 - Data Compression
Pratik Pradhan
 
Audio compression
Audio compressionAudio compression
Audio compression
Miled Othmen
 
Data Compression (Lossy and Lossless)
Data Compression (Lossy and Lossless)Data Compression (Lossy and Lossless)
Data Compression (Lossy and Lossless)
Project Student
 
Chapter 8 image compression
Chapter 8 image compressionChapter 8 image compression
Chapter 8 image compression
asodariyabhavesh
 
Hypermedia messageing (UNIT 5)
Hypermedia messageing (UNIT 5)Hypermedia messageing (UNIT 5)
Hypermedia messageing (UNIT 5)
nirmalbj
 
Voice morphing-
Voice morphing-Voice morphing-
Voice morphing-
Navneet Sharma
 
Introduction to Image Compression
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image Compression
Kalyan Acharjya
 

What's hot (20)

Multimedia graphics and image data representation
Multimedia graphics and image data representationMultimedia graphics and image data representation
Multimedia graphics and image data representation
 
Frequency Division Multiple Access (FDMA)
Frequency Division Multiple Access (FDMA)Frequency Division Multiple Access (FDMA)
Frequency Division Multiple Access (FDMA)
 
Audio and Video Compression
Audio and Video CompressionAudio and Video Compression
Audio and Video Compression
 
IMAGE COMPRESSION AND DECOMPRESSION SYSTEM
IMAGE COMPRESSION AND DECOMPRESSION SYSTEMIMAGE COMPRESSION AND DECOMPRESSION SYSTEM
IMAGE COMPRESSION AND DECOMPRESSION SYSTEM
 
Multimedia seminar ppt
Multimedia seminar pptMultimedia seminar ppt
Multimedia seminar ppt
 
Hd tv
Hd tvHd tv
Hd tv
 
Multimedia technology
Multimedia technologyMultimedia technology
Multimedia technology
 
Image compression
Image compressionImage compression
Image compression
 
Fundamentals and image compression models
Fundamentals and image compression modelsFundamentals and image compression models
Fundamentals and image compression models
 
digital image processing
digital image processingdigital image processing
digital image processing
 
Comparison between Lossy and Lossless Compression
Comparison between Lossy and Lossless CompressionComparison between Lossy and Lossless Compression
Comparison between Lossy and Lossless Compression
 
Transform coding
Transform codingTransform coding
Transform coding
 
Multimedia:Multimedia compression
Multimedia:Multimedia compression Multimedia:Multimedia compression
Multimedia:Multimedia compression
 
Chapter 5 - Data Compression
Chapter 5 - Data CompressionChapter 5 - Data Compression
Chapter 5 - Data Compression
 
Audio compression
Audio compressionAudio compression
Audio compression
 
Data Compression (Lossy and Lossless)
Data Compression (Lossy and Lossless)Data Compression (Lossy and Lossless)
Data Compression (Lossy and Lossless)
 
Chapter 8 image compression
Chapter 8 image compressionChapter 8 image compression
Chapter 8 image compression
 
Hypermedia messageing (UNIT 5)
Hypermedia messageing (UNIT 5)Hypermedia messageing (UNIT 5)
Hypermedia messageing (UNIT 5)
 
Voice morphing-
Voice morphing-Voice morphing-
Voice morphing-
 
Introduction to Image Compression
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image Compression
 

Viewers also liked

File compression sunzip (huffman algorithm)
File compression sunzip (huffman algorithm)File compression sunzip (huffman algorithm)
File compression sunzip (huffman algorithm)
mini_61
 
Huffman Coding
Huffman CodingHuffman Coding
Huffman Coding
Ehtisham Ali
 
Compression
CompressionCompression
Compression
Ashish Kumar
 
Compression tech
Compression techCompression tech
Compression tech
Sharafat Husen
 
Komdat-Kompresi Data
Komdat-Kompresi DataKomdat-Kompresi Data
Komdat-Kompresi Data
mursalinfajri007
 
Synopsis
SynopsisSynopsis
Synopsis
nes
 
1
11
1
nes
 
Requirement Specification2
Requirement Specification2Requirement Specification2
Requirement Specification2
nes
 
multimedia
multimediamultimedia
multimedia
nes
 
How to play audio from a microcontroller
How to play audio from a microcontrollerHow to play audio from a microcontroller
How to play audio from a microcontroller
Mahadev Gopalakrishnan
 
Dip trace tutorial
Dip trace tutorialDip trace tutorial
Dip trace tutorial
Mahadev Gopalakrishnan
 
Requirement Specification
Requirement SpecificationRequirement Specification
Requirement Specification
nes
 
JS: Audio Data Processing
JS: Audio Data ProcessingJS: Audio Data Processing
JS: Audio Data Processing
Ingvar Stepanyan
 
Huffman data compression-decompression
Huffman data compression-decompressionHuffman data compression-decompression
Huffman data compression-decompression
dipugovind
 
Hufman coding basic
Hufman coding basicHufman coding basic
Hufman coding basic
radthees
 
Introduction to multimedia
Introduction to multimedia Introduction to multimedia
Introduction to multimedia
Selma Ibrahim
 
Multimedia
MultimediaMultimedia
Multimedia
KHUSHAL11112222
 
Digital signal processing through speech, hearing, and Python
Digital signal processing through speech, hearing, and PythonDigital signal processing through speech, hearing, and Python
Digital signal processing through speech, hearing, and Python
Mel Chua
 
Programer Dusan Zivanovic VII1
Programer Dusan Zivanovic VII1Programer Dusan Zivanovic VII1
Programer Dusan Zivanovic VII1
dulovci
 

Viewers also liked (20)

File compression sunzip (huffman algorithm)
File compression sunzip (huffman algorithm)File compression sunzip (huffman algorithm)
File compression sunzip (huffman algorithm)
 
Huffman Coding
Huffman CodingHuffman Coding
Huffman Coding
 
Compression
CompressionCompression
Compression
 
Compression tech
Compression techCompression tech
Compression tech
 
AJEESH DS 1
AJEESH DS 1AJEESH DS 1
AJEESH DS 1
 
Komdat-Kompresi Data
Komdat-Kompresi DataKomdat-Kompresi Data
Komdat-Kompresi Data
 
Synopsis
SynopsisSynopsis
Synopsis
 
1
11
1
 
Requirement Specification2
Requirement Specification2Requirement Specification2
Requirement Specification2
 
multimedia
multimediamultimedia
multimedia
 
How to play audio from a microcontroller
How to play audio from a microcontrollerHow to play audio from a microcontroller
How to play audio from a microcontroller
 
Dip trace tutorial
Dip trace tutorialDip trace tutorial
Dip trace tutorial
 
Requirement Specification
Requirement SpecificationRequirement Specification
Requirement Specification
 
JS: Audio Data Processing
JS: Audio Data ProcessingJS: Audio Data Processing
JS: Audio Data Processing
 
Huffman data compression-decompression
Huffman data compression-decompressionHuffman data compression-decompression
Huffman data compression-decompression
 
Hufman coding basic
Hufman coding basicHufman coding basic
Hufman coding basic
 
Introduction to multimedia
Introduction to multimedia Introduction to multimedia
Introduction to multimedia
 
Multimedia
MultimediaMultimedia
Multimedia
 
Digital signal processing through speech, hearing, and Python
Digital signal processing through speech, hearing, and PythonDigital signal processing through speech, hearing, and Python
Digital signal processing through speech, hearing, and Python
 
Programer Dusan Zivanovic VII1
Programer Dusan Zivanovic VII1Programer Dusan Zivanovic VII1
Programer Dusan Zivanovic VII1
 

Similar to Chapter%202%20 %20 Text%20compression(2)

Sunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithmSunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithm
Dr Sandeep Kumar Poonia
 
Compression
CompressionCompression
Compression
Vishal Suri
 
Compression
CompressionCompression
Compression
anithabalaprabhu
 
Image compression
Image compressionImage compression
Image compression
Bassam Kanber
 
Paper id 24201469
Paper id 24201469Paper id 24201469
Paper id 24201469
IJRAT
 
Huffman Coding
Huffman CodingHuffman Coding
Huffman Coding
Muhammad Saqib Rehan
 
Data comm4&5Data Communications (under graduate course) Lecture 3 of 5
Data comm4&5Data Communications (under graduate course) Lecture 3 of 5Data comm4&5Data Communications (under graduate course) Lecture 3 of 5
Data comm4&5Data Communications (under graduate course) Lecture 3 of 5
Randa Elanwar
 
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
Luisa Francisco
 
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
 
Ijrdtvlis11 140006
Ijrdtvlis11 140006Ijrdtvlis11 140006
Ijrdtvlis11 140006
Ijrdt Journal
 
Huffman ppt
Huffman ppt Huffman ppt
Huffman ppt
ALexHunter69
 
VII Compression Introduction
VII Compression IntroductionVII Compression Introduction
VII Compression Introduction
sangusajjan
 
Dn4301681689
Dn4301681689Dn4301681689
Dn4301681689
IJERA Editor
 
Text compression
Text compressionText compression
Text compression
Sammer Qader
 
Data representation
Data representationData representation
Data representation
Travis Leong Ping
 
Data representation
Data representationData representation
Data representation
Travis Leong Ping
 
B034205010
B034205010B034205010
B034205010
inventionjournals
 
Lecture 6 -_presentation_layer
Lecture 6 -_presentation_layerLecture 6 -_presentation_layer
Lecture 6 -_presentation_layer
Serious_SamSoul
 
Compressionbasics
CompressionbasicsCompressionbasics
Compressionbasics
Rohini R Iyer
 
Lossless
LosslessLossless

Similar to Chapter%202%20 %20 Text%20compression(2) (20)

Sunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithmSunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithm
 
Compression
CompressionCompression
Compression
 
Compression
CompressionCompression
Compression
 
Image compression
Image compressionImage compression
Image compression
 
Paper id 24201469
Paper id 24201469Paper id 24201469
Paper id 24201469
 
Huffman Coding
Huffman CodingHuffman Coding
Huffman Coding
 
Data comm4&5Data Communications (under graduate course) Lecture 3 of 5
Data comm4&5Data Communications (under graduate course) Lecture 3 of 5Data comm4&5Data Communications (under graduate course) Lecture 3 of 5
Data comm4&5Data Communications (under graduate course) Lecture 3 of 5
 
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
 
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...
 
Ijrdtvlis11 140006
Ijrdtvlis11 140006Ijrdtvlis11 140006
Ijrdtvlis11 140006
 
Huffman ppt
Huffman ppt Huffman ppt
Huffman ppt
 
VII Compression Introduction
VII Compression IntroductionVII Compression Introduction
VII Compression Introduction
 
Dn4301681689
Dn4301681689Dn4301681689
Dn4301681689
 
Text compression
Text compressionText compression
Text compression
 
Data representation
Data representationData representation
Data representation
 
Data representation
Data representationData representation
Data representation
 
B034205010
B034205010B034205010
B034205010
 
Lecture 6 -_presentation_layer
Lecture 6 -_presentation_layerLecture 6 -_presentation_layer
Lecture 6 -_presentation_layer
 
Compressionbasics
CompressionbasicsCompressionbasics
Compressionbasics
 
Lossless
LosslessLossless
Lossless
 

Chapter%202%20 %20 Text%20compression(2)

  • 1. Text Compression Chapter 2
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. Source Encoders and destination decoders Prior to transmitting the source information relating to a multimedia application , a compression algorithm is applied to it. This implies that in order for the destination to reproduce the original source information or in some instances, a nearly exact copy of it – a matching decompression algorithm must be applied to it. The application of the compression algorithm is the main function carried out by the source encoder and the decompression algorithm is carried out by the destination decoder .
  • 8. Source Encoders and destination decoders In applications which involve two computers communicating with each other, the time required to perform the compression and decompression algorithm is not always critical. So both algorithms are normally implemented in software within the two computers. Source information Source encoder program Destination Decoder Program Copy of Source Information Network Source encoder / destination decoder : Software only Source Computer Destination Computer
  • 9. Source Encoders and destination decoders In other applications, however the time required to perform the compression and decompression algorithms in software is not acceptable and instead the two algorithms must be performed by special processors in separate units . Source information Source encoder Processor Destination Decoder Processor Copy of Source Information Network Source Computer Destination Computer Source encoder / destination decoder : Special processors/hardware
  • 10.
  • 11.
  • 12.
  • 13.
  • 14. Statistical Encoding In this technique, patterns of bits (word) or that are more frequent are recorded using shorter codes. It uses a set of variable length codewords with the shortest codewords used to represent the most frequently occurring symbols. For example : In a string of text , the character A may occurs more frequently than say the character P which occurs more frequently than the character Z , and so on… Statistical encoding exploits this property by using a set of variable length Codewords With the shortest codewords used to represent the most frequently occurring symbols.
  • 15.
  • 16. In practice , the use of variable-length codewords is not quite as straight forward as it first appears. Clearly as with run-length encoding , the destination must know the set of codewords being used by the source. With variable length codewords , however in order for the decoding operation to be carried out correctly , it is necessary to ensure that a shorter codeword in the set does not form the start of a longer codeword otherwise the decoder will interpret the string on the wrong codeword boundaries. A codeword set that avoids this happening is said to process the prefix and an Encoding scheme that generates codewords that have this property is the Huffman encoding algorithm.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21. Static Huffman Encoding 7 00 7 01 9 10 6 111 2 1100 4 1101 14 21 9 12 7 7 6 6 2 4 0 1 0 0 0 0 1 1 1 1
  • 22. Decoding Algorithm End Is codeword already stored ? Begin Set CODEWORD to empty Read next bit from BITSTREAM and append to existing bits in CODEWORD Load matching ASCII Character into Receive _buffer All bits in BITSTREAM Processed n n
  • 23.
  • 24.  
  • 25.