Sunteți pe pagina 1din 18

UNIT - IV

COMPRESSION TECHNIQUES

Need for Data compression / Advantages


Huge amount of data is generated in text, images, audio, speech and video. Because of compression. Transmission data rate is reduced Storage becomes less due to compression. Due to video compression it is possible to store one complete movie on two cds. Transportation of the data is easier

Drawbacks
Due

to compression, some of the data is lost Compression and Decompression increases complexity of the transmitter and receiver Coding time is increased due to compression and decompression.

Principles of Data Compression


Compression Decompression

Infn Source

Source Encoder

N/W

Destination Decoder

Receiver

Lossless Compression and Lossy Compression


Lossless Compression
No part of the original information is lost during compression

Lossy Compression
Some information lost during

compression.

Comparison between Lossless and Lossy Compression


Sr. No.
1
2

Lossless Compression
No Information is lost
Completely reversible

Lossy Compression
Some information is lost
It is not reversible

3
4 5

Used for text and data


Compression ratio is less Compression is independent of human response

Used for speech and video


High compression ratio Compression depends upon sensitivity of human ear, eyes etc.

Huffman coding, Run length Transform coding, vector coding are examples quantization are examples

Entropy Coding
Entropy Coding is based on entropy of the source It assign codes to the source alphabets according to probability of their occurrence. It is Lossless Compression Ex. Runlength coding, Prefix coding and Huffman Coding. They are used for compression of the text files.

Runlength Coding
Used for the data generated by scanning the documents, fax machine, typewriters etc. These information sources produce a data that contains large strings of 1s/0s and zeros. 1111110000000011110000.. The above string coded using Runlength coding as 1,6 ; 0,8 ; 1,4 ; 0,4

Statistical Encoding
Exploits the statistical properties of the information For e.g the alphabets e,a,i have higher probabilities of occurrence compared to alphabets like q,t,z etc. Huffman Coding is an example of Statistical encoding. Here shortlength codewords are assigned to frequently occurring alphabets and larger length codewords are assigned to rarely occurring alphabets. This is called also as Entropy

Source Encoding
Source Encoding is based on particular property of the source. Examples Differential Encoding Transform Encoding

Differential Encoding
The difference between two successive samples is encoded. Normally the values of samples are large but the difference between them is very small. Hence less number of bits are rquired to encode the difference. DPCM and Delta Modulation are based on this principle.

Transform Encoding
Transform Coding is much power full coding technique. Consider an image consisting of NxN pixel size. If these pixels are scanned horizontally, then an electric signal generated. The frquency of this signal is called Spatial Frequency.

Transform Encoding

Contd

Human eye much sensitive to low spatial frequencies compared to high spatial frequencies. Hence such higher sensitive components are redundant and they can be removed. This removal of high frequency components provides compression, since the overall size of the data is reduced. Conversion of the image in spatial frequency domain is obtained with the help of DCT(Discrete Cosine Transform). When Thresholding applied, some of the

Text Compression
Text Compression should be strictly lossless. Text Compression cannot be lossy. Therefore lossless compression techniques such as entropy coding is used. Two types of statistical encoding methods

1) Huffman Coding and Arithmetic Coding


Optimum set of codewords are derived for single characters

2) Lampel ziv (LZ) algorithm

The Coding used for text can be Static or Dynamic 1) Static Coding

The code words assigned to the alphabets does not change during compression.

2) Dynamic Coding
The code words are dynamically computed during compression. The code word for a particular alphabet or string does not remain fixed throughout the compression. Also called Adaptive Coding

Sr. No.
1

Static Coding
Codewords are fixed throughout compression Statistical characteristics of the data are known Receiver knows the set of codewords Ex. Static Huffman Coding

Dynamic Coding
Codewords change dynamically during compression Statistical characteristics of the data are not known Receiver dynamically calculates the codewords Ex. Dynamic Huffman Coding

Static Huffman Coding


In Static Huffman Coding, the character string to be transmitted is analyzed. The frequency of occurrence of each character is determined. The variable length codewords are then assigned to each character. This coding operation creates an unbalanced tree. It is also called Huffman coding tree.

Arithmetic Coding

S-ar putea să vă placă și