Download presentation
Presentation is loading. Please wait.
Published byCoral Morton Modified over 8 years ago
1
Computer Sciences Department1
2
2 Data Compression and techniques
3
The idea of Compression Lossless and lossy Compression RLE method LZW method Computer Sciences Department3 Objectives
4
Compression is the art of representing the information in a compact form rather than its original. Benefits: Reduce the size of data. Reduces storage space and storage cost. Reduces time to retrieve and transmit data Computer Sciences Department4 Data Compression
5
Thus a representation that compresses a 10MB file to 2MB has a compression ratio of 10/2 = 5, often notated as an explicit ratio, 5:1 = five in one Computer Sciences Department5 Compression Ratio Compression Ratio is the ratio between the size of the compressed file and the size of the source file. Thus a representation that compresses a 10MB file to 2MB has a compression ratio of 2/10 = 0.2 = 5:1
6
Saving Percentage % : calculates the shrinkage of the source file as a percentage. Computer Sciences Department6 Saving Percentage
7
compressedData = compress(originalData) decompressedData = decompress(compressedData) if originalData = decompressedData, the compression is lossless. If originalData != decompressedData, the compression is lossy. Computer Sciences Department7 Lossless and lossy Compression - 1 Procedure
8
Lossless compression is essential in applications such as text file compression. Popular text compressors such as zip and Unix’s compress are based on the LZW (Lempel-Ziv-Welch) method. Lossy compression is acceptable in many imaging applications (multimedia). Computer Sciences Department8 Lossless and lossy Compression - 1
9
Computer Sciences Department9 Pixel
10
Computer Sciences Department10
11
It checks whether there are any repeating symbols or not, and is based on those redundancies and their lengths. Computer Sciences Department11 Run Length Encoding Algorithm
12
Computer Sciences Department12 Example - RLE
13
Character sequences in the original text are replaced by codes that are dynamically determined. The code table is not encoded into the compressed text, because it may be reconstructed from the compressed text during decompression. Compression is done by scanning the original text from left to right then Create the code table. Computer Sciences Department13 LZW Compression
14
codeProcedure Data c1128, 96 c2200,30,10 c350,240 Computer Sciences Department14 Example
15
Computer Sciences Department15 Decompress- try
16
Compression: O(n) expected time, where n is the length of the text that is being compressed. Decompression: O(n) time, where n is the length of the decompressed text. Computer Sciences Department16 Time Complexity
17
Some of the main lossless data compression techniques are the Huffman Coding, Run Length Encoding, Arithmetic Encoding and Dictionary Based Encoding……etc. Time Complexity of Compression and Decompression…… Computer Sciences Department17 Conclusion
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.