SlideShare ist ein Scribd-Unternehmen logo
1 von 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]

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction To Wireless Fading Channels
Introduction To Wireless Fading ChannelsIntroduction To Wireless Fading Channels
Introduction To Wireless Fading ChannelsNitin Jain
 
cell splitting and sectoring
cell splitting and sectoringcell splitting and sectoring
cell splitting and sectoringShwetanshu Gupta
 
Character generation techniques
Character generation techniquesCharacter generation techniques
Character generation techniquesMani Kanth
 
Ambient back scatter
Ambient back scatterAmbient back scatter
Ambient back scatterChe Tna
 
Physical Layer Numericals - Data Communication & Networking
Physical Layer  Numericals - Data Communication & NetworkingPhysical Layer  Numericals - Data Communication & Networking
Physical Layer Numericals - Data Communication & NetworkingDrishti Bhalla
 
Ece analog-communications
Ece analog-communicationsEce analog-communications
Ece analog-communicationsTeju Kotti
 
digital audio broadcasting
digital audio broadcastingdigital audio broadcasting
digital audio broadcastingRam B
 
raster and random scan
raster and random scanraster and random scan
raster and random scanSonia Pahuja
 
Video Compression Basics - MPEG2
Video Compression Basics - MPEG2Video Compression Basics - MPEG2
Video Compression Basics - MPEG2VijayKumarArya
 
Internet Technology
Internet TechnologyInternet Technology
Internet Technologyhome
 
Java Embedded System
Java Embedded SystemJava Embedded System
Java Embedded Systemmarksmith6183
 

Was ist angesagt? (20)

Introduction To Wireless Fading Channels
Introduction To Wireless Fading ChannelsIntroduction To Wireless Fading Channels
Introduction To Wireless Fading Channels
 
cell splitting and sectoring
cell splitting and sectoringcell splitting and sectoring
cell splitting and sectoring
 
Adaptive Huffman Coding
Adaptive Huffman CodingAdaptive Huffman Coding
Adaptive Huffman Coding
 
SPREAD SPECTRUM
SPREAD SPECTRUMSPREAD SPECTRUM
SPREAD SPECTRUM
 
Character generation techniques
Character generation techniquesCharacter generation techniques
Character generation techniques
 
Ambient back scatter
Ambient back scatterAmbient back scatter
Ambient back scatter
 
Audio compression
Audio compressionAudio compression
Audio compression
 
ELEMENTS OF CELLULAR RADIO SYSTEM DESIGN
ELEMENTS OF CELLULAR RADIO SYSTEM DESIGNELEMENTS OF CELLULAR RADIO SYSTEM DESIGN
ELEMENTS OF CELLULAR RADIO SYSTEM DESIGN
 
Fundamental of cellular system
Fundamental of cellular systemFundamental of cellular system
Fundamental of cellular system
 
Physical Layer Numericals - Data Communication & Networking
Physical Layer  Numericals - Data Communication & NetworkingPhysical Layer  Numericals - Data Communication & Networking
Physical Layer Numericals - Data Communication & Networking
 
Television standards and systems
Television standards and systemsTelevision standards and systems
Television standards and systems
 
Ece analog-communications
Ece analog-communicationsEce analog-communications
Ece analog-communications
 
digital audio broadcasting
digital audio broadcastingdigital audio broadcasting
digital audio broadcasting
 
raster and random scan
raster and random scanraster and random scan
raster and random scan
 
Cordless Technology
Cordless TechnologyCordless Technology
Cordless Technology
 
Video Compression Basics - MPEG2
Video Compression Basics - MPEG2Video Compression Basics - MPEG2
Video Compression Basics - MPEG2
 
CELLULAR MOBILE RADIO SYSTEMS
CELLULAR MOBILE RADIO SYSTEMSCELLULAR MOBILE RADIO SYSTEMS
CELLULAR MOBILE RADIO SYSTEMS
 
image compression ppt
image compression pptimage compression ppt
image compression ppt
 
Internet Technology
Internet TechnologyInternet Technology
Internet Technology
 
Java Embedded System
Java Embedded SystemJava Embedded System
Java Embedded System
 

Andere mochten auch

File compression sunzip (huffman algorithm)
File compression sunzip (huffman algorithm)File compression sunzip (huffman algorithm)
File compression sunzip (huffman algorithm)mini_61
 
Synopsis
SynopsisSynopsis
Synopsisnes
 
1
11
1nes
 
Requirement Specification2
Requirement Specification2Requirement Specification2
Requirement Specification2nes
 
multimedia
multimediamultimedia
multimedianes
 
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 microcontrollerMahadev Gopalakrishnan
 
Requirement Specification
Requirement SpecificationRequirement Specification
Requirement Specificationnes
 
Huffman data compression-decompression
Huffman data compression-decompressionHuffman data compression-decompression
Huffman data compression-decompressiondipugovind
 
Hufman coding basic
Hufman coding basicHufman coding basic
Hufman coding basicradthees
 
Introduction to multimedia
Introduction to multimedia Introduction to multimedia
Introduction to multimedia Selma Ibrahim
 
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 PythonMel Chua
 
Programer Dusan Zivanovic VII1
Programer Dusan Zivanovic VII1Programer Dusan Zivanovic VII1
Programer Dusan Zivanovic VII1dulovci
 

Andere mochten auch (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
 

Ähnlich wie 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 algorithmDr Sandeep Kumar Poonia
 
Paper id 24201469
Paper id 24201469Paper id 24201469
Paper id 24201469IJRAT
 
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 5Randa 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_compreLuisa 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 Introductionsangusajjan
 
Lecture 6 -_presentation_layer
Lecture 6 -_presentation_layerLecture 6 -_presentation_layer
Lecture 6 -_presentation_layerSerious_SamSoul
 

Ähnlich wie 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.