september,2012 file compression 8/6/2015 1 compiled by:- solomon w. demissie

13
September,201 2 File Compression 03/25/22 1 Compiled By:- Solomon W. Demissie

Upload: mariah-heath

Post on 22-Dec-2015

216 views

Category:

Documents


1 download

TRANSCRIPT

September,2012

File Compression

04/19/23 1Compiled By:- Solomon W. Demissie

Introduction to Data Compression

• What is Data Compression?

• Why Data Compression?

• How is Data Compression possible?

• Lossless and Lossy Data Compression

• Static, Adaptive, and Hybrid Compression

• Compression Utilities and Formats

• Compress on Windows 7 04/19/23 2Compiled By:- Solomon W. Demissie

What is Data Compression?

• Data compression is the representation of an information source (e.g. a data file, a speech signal, an image, or a video signal) as accurately as possible using the fewest number of bits.

• Compressed data can only be understood if the decoding method is known by the receiver.

04/19/23 3Compiled By:- Solomon W. Demissie

Why Data Compression?

• Data storage and transmission cost money. This cost increases with the amount of data available.

• This cost can be reduced by processing the data so that it takes less memory and less transmission time.

• Disadvantage of Data compression: Compressed data must be decompressed to be viewed (or heard),

thus extra processing is required. • The design of data compression schemes therefore involve trade-offs

between various factors, including the degree of compression, the amount of distortion introduced (if using a lossy compression scheme), and the computational resources required to compress and uncompress the data. 04/19/23 4Compiled By:- Solomon W. Demissie

How is data compression possible?

Compression is possible because information usually contains redundancies, or information that is often repeated.

Examples include reoccurring letters, numbers or pixels

File compression programs remove this redundancy.

04/19/23 5Compiled By:- Solomon W. Demissie

Lossless and Lossy Compression Techniques

• Data compression techniques are broadly classified into lossless and lossy.

• Lossless techniques enable exact reconstruction of the original document from the compressed information.• Exploit redundancy in data• Applied to general data• Examples: Run-length, Huffman, LZ77, LZ78, and LZW

• Lossy compression - reduces a file by permanently eliminating certain redundant information • Exploit redundancy and human perception• Applied to audio, image, and video• Examples: JPEG and MPEG

• Lossy techniques usually achieve higher compression rates than lossless ones but the latter are more accurate.

04/19/23 6Compiled By:- Solomon W. Demissie

Compression Utilities and Formats

• Compression tool examples:• winzip, pkzip, compress, gzip• General compression formats:• .zip, .gz, rar• Common image compression formats:

JPEG, JPEG 2000, BMP, GIF, PCX, PNG, TGA, TIFF, WMP

• Common audio (sound) compression formats:MPEG-1 Layer III (known as MP3), RealAudio (RA, RAM, RP), AU, Vorbis, WMA, AIFF, WAVE, G.729a

• Common video (sound and image) compression formats:

MPEG-1, MPEG-2, MPEG-4, DivX, Quicktime (MOV), RealVideo (RM), Windows Media Video (WMV), Video for Windows (AVI), Flash video (FLV)

04/19/23 7Compiled By:- Solomon W. Demissie

How to Compress Files in Windows

04/19/23 8Compiled By:- Solomon W. Demissie

• Need to send someone a big batch of files? Don't attach one after another after another to your e-mail. Instead, compress the files into one smaller, easier-to-manage file. In other words, "Zip" them.

• The Zip file format has long been used to compress and archive data. Suppose you have, say, 50 Word documents that have a combined size of 5MB. By zipping them, you end up with a single file that's much smaller--maybe 1MB or even 500K.

04/19/23 Compiled By:- Solomon W. Demissie 9

Steps

• If you're already using a utility like PKZip or WinZip to compress and decompress files, there's little point in changing. But did you know Windows has Zip capabilities built right in? Here's how to use them on the fly, using the aforementioned e-mail as an example:

• 1. Compose your e-mail message, then click Attach File (or whatever is your mail client's equivalent).

• 2. Using the file selector that appears, find the files you want to attach. (They all need to be in the same folder.)

04/19/23 10Compiled By:- Solomon W. Demissie

Cont…

• 3. Select all the files you want to zip. (To select multiple files at a time, hold down the Ctrl key while clicking each one in turn.)

• 4. Right-click any of the selected files, then choose Send to, Compressed (zipped) folder.

• 5. Windows will quickly compress the files and create a new, zipped file that's immediately ready to be renamed (if necessary--if not, just press Enter).

• 6. Attach your newly created Zip file to the e-mail.04/19/23 11Compiled By:- Solomon W. Demissie

Exercises

1. Using the Huffman tree constructed in this session, decode the following sequence of bits, if possible. Otherwise, where does the decoding fail?

10100010111010001000010011

2. Using the Huffman tree constructed in this session, write the bit sequences that encode the messages:

test , state , telnet , notes

3. Mention one disadvantage of a lossless compression scheme and one disadvantage of a lossy compression scheme.

4. Write a Java program that implements the Huffman coding algorithm.

04/19/23 12Compiled By:- Solomon W. Demissie

Finaly

•Question and Feedback

You welcome 04/19/23 13Compiled By:- Solomon W. Demissie