Data Compression, Lossy and Lossless Data Compression,Classification of Lossy and Lossless Data Compression, Huffman Codding method, LZW method of Lossless Compression and Compression Ratio
3. Compression: Compression is a way to reduce the number
of bits in a frame but retaining its meaning.
Data Compression: Data compression is the process of
encoding data so that it takes less storage space or less
transmission time than it would if it were not compressed.
Data Compression
3/2/2019
3
4. Types of Data Compression
3/2/2019
4
Data Compression
Lossless Method
(text or program )
Lossy Method
(Image, video, audio )
5. 3/2/2019
5
Lossy compression:
A lossy data compression technique is one where
compressing data and its decompression retrieves data that
may will be different from the original.
Lossless compression:
The lossless data compression method can be seen in the
Part of the input data is used to predict the incoming data by
neural network predictor.
8. Huffman Coding Algorithm:
Huffman coding is an entropy encoding algorithm used for lossless data compression.
1. Initialization: Put all symbols on a list sorted according to their frequency counts.
2. Repeat until the list has only one symbol left:
From the list pick two symbols with the lowest frequency counts
Form a Huffman sub-tree that has these two symbols as child nodes and create a parent node.
Assign the sum of the childrens frequency counts to the parent and insert it into the list such that
the order is maintained.
Delete the children from the list.
3. Assign a codeword for each leaf based on the path from the root.
12. About LZW Compression
LZW is the first letter of the names of the scientists
Abraham Lempel, Jakob Ziv, and Terry Welch, who
developed this algorithm.
It is an improved version of LZ78 algorithm.
Published in 1984.
Is a lossless compression algorithm.
It is simple and dictionary based.
12
13. LZW Algorithm (Compression)
W = NULL;
while (there is input)
{
K = next symbol from input;
if (WK exists in the dictionary) ;
{
W = WK;
}
Else
{
output (index(W));
add WK to the dictionary;
W = K;
}
}
13
14. LZW Algorithm (Compression) example
The input string is
The initial dictionary containing symbols like A,B,C,D
with their index values as 1,2,3,4 respectively.
Now the input string is read from left to right starting from A.
14
A B D A B C
A 1
B 2
C 3
D 4
15. LZW Algorithm example (cont)
W = Null
K = A
WK = A
In the dictionary.
K = B.
WK = AB is not in the
dictionary
Add WK to dictionary
Output code for A.
Set W = B
15
Encoded o/p Index Entry
1 A
2 B
3 C
4 D
1 5 AB
2 6 BD
4 7 DA
5 8 ABC
Final output is 12453
A B D A B C
3 - C_
16. Application of LZW Coding
LZW compression can be used in a variety of file formats:
TIFF (tagged image file format )files
GIF (graphic interchange format ) files
PDF(portable document format) files
Unix Compress.
Suitable for compressing text files
16
17. The CR is given by:
CR =
巨 $
巨 $ 駒
It includes different parameters of compression. When the
compression ratio increases the cost of transmission of the
data to the monitoring center also reduces.
Compression Ratio (CR):