SlideShare une entreprise Scribd logo
1  sur  25
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]

Contenu connexe

Tendances

Audio and video compression
Audio and video compressionAudio and video compression
Audio and video compression
neeraj9217
 
Image encryption using aes key expansion
Image encryption using aes key expansionImage encryption using aes key expansion
Image encryption using aes key expansion
Sreeda Perikamana
 
Digitization of Audio.ppt
Digitization of Audio.pptDigitization of Audio.ppt
Digitization of Audio.ppt
Videoguy
 

Tendances (20)

Audio and video compression
Audio and video compressionAudio and video compression
Audio and video compression
 
Spread spectrum modulation
Spread spectrum modulationSpread spectrum modulation
Spread spectrum modulation
 
Image Steganography Project Report
Image Steganography Project ReportImage Steganography Project Report
Image Steganography Project Report
 
IMAGE STEGANOGRAPHY JAVA PROJECT SYNOPSIS
IMAGE STEGANOGRAPHY JAVA PROJECT SYNOPSISIMAGE STEGANOGRAPHY JAVA PROJECT SYNOPSIS
IMAGE STEGANOGRAPHY JAVA PROJECT SYNOPSIS
 
Transmission modes
Transmission modesTransmission modes
Transmission modes
 
microwave communication
microwave communicationmicrowave communication
microwave communication
 
Mpeg 2
Mpeg 2Mpeg 2
Mpeg 2
 
Image encryption using aes key expansion
Image encryption using aes key expansionImage encryption using aes key expansion
Image encryption using aes key expansion
 
Introduction To Video Compression
Introduction To Video CompressionIntroduction To Video Compression
Introduction To Video Compression
 
Lzw compression ppt
Lzw compression pptLzw compression ppt
Lzw compression ppt
 
Digitization of Audio.ppt
Digitization of Audio.pptDigitization of Audio.ppt
Digitization of Audio.ppt
 
Audio compression
Audio compressionAudio compression
Audio compression
 
Video Compression
Video CompressionVideo Compression
Video Compression
 
Channel assignment strategies
Channel assignment strategiesChannel assignment strategies
Channel assignment strategies
 
Video compression
Video compressionVideo compression
Video compression
 
Lz77 (sliding window)
Lz77 (sliding window)Lz77 (sliding window)
Lz77 (sliding window)
 
Wireless local loop
Wireless local loopWireless local loop
Wireless local loop
 
Gifi technology full seminar report
Gifi technology full seminar reportGifi technology full seminar report
Gifi technology full seminar report
 
signal and channel bandwidth
signal and channel bandwidthsignal and channel bandwidth
signal and channel bandwidth
 
Signal encoding techniques
Signal encoding techniquesSignal encoding techniques
Signal encoding techniques
 

En vedette

File compression sunzip (huffman algorithm)
File compression sunzip (huffman algorithm)File compression sunzip (huffman algorithm)
File compression sunzip (huffman algorithm)
mini_61
 
Synopsis
SynopsisSynopsis
Synopsis
nes
 
1
11
1
nes
 
Requirement Specification2
Requirement Specification2Requirement Specification2
Requirement Specification2
nes
 
Requirement Specification
Requirement SpecificationRequirement Specification
Requirement Specification
nes
 
Huffman data compression-decompression
Huffman data compression-decompressionHuffman data compression-decompression
Huffman data compression-decompression
dipugovind
 
Programer Dusan Zivanovic VII1
Programer Dusan Zivanovic VII1Programer Dusan Zivanovic VII1
Programer Dusan Zivanovic VII1
dulovci
 

En vedette (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
 

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

Paper id 24201469
Paper id 24201469Paper id 24201469
Paper id 24201469
IJRAT
 
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
 
VII Compression Introduction
VII Compression IntroductionVII Compression Introduction
VII Compression Introduction
sangusajjan
 

Similaire à 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
 
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
 
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.