Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Computer Science - Lecture 4

Similar presentations


Presentation on theme: "Introduction to Computer Science - Lecture 4"— Presentation transcript:

1 Introduction to Computer Science - Lecture 4
Data compression

2 Is it possible to compress information?
According to our knowledge from previous lectures, the amount of information depends entirely on the probability of its occurence. This means that it is impossible to change the amount of information without changing the information itself.

3 Is it possible to compress information?
However, when it comes to data - encoded information - it is possible to use different codings. As we know, different codings may have different redundancy. The algorithm of translating a coding into another coding whose redundancy is lower is called a lossless compression algorithm.

4 Compression There is also another possibility - we can replace a coding with a “similar” coding which offers much lower redundancy. This technique is called lossy compression.

5 Compression rate Compression rate is the proportion of the size of data before compression to the size of data after compression. The better the compression algorithm the higher the compression rate. Compression rate is always computed for actual data, not for the algorithm. Compression algorithms specialize in specific data types.

6 Text compression - RLE The Run-length Encoding algorithm is designed for compression of data containing repetitive sequences of bits. These sequences are converted into a code [sequence][number of repetitions]

7 Text compression The Huffman coding algorithm is often used for textual data compression. Just as RLE, Huffman coding is a lossless compression algorithm.

8 Text compression The algorithm Lempel-Ziv was designed in late 1970’s.
There are two versions of this algorithm: LZ77 (also called LZ1) and LZ78 (LZ2) The LZ algorithm makes use of a dictionary of bit sequences.

9 Text compression Popular text compression algorithms:
DEFLATE – Combines Lempel-Ziv compression with Huffman coding, used by ZIP, gzip, and PNG images Lempel–Ziv–Markov chain algorithm (LZMA) – Very high compression ratio, used by 7zip and xz Lempel–Ziv–Oberhumer (LZO) – Designed for compression/decompression speed at the expense of compression ratios Lempel–Ziv–Storer–Szymanski (LZSS) – Used by WinRAR in tandem with Huffman coding

10 Image compression The most popular image compression algorithms include: JPEG PNG GIF

11 Image compression - JPEG
The name comes from Joint Photographic Experts Group It is the most popular format in photography and in the World Wide Web

12 Image compression - JPEG
Quality and compression rate can be adjusted (image taken from Wikipedia):

13 Image compression - JPEG
The JPEG algorithm relies on the Discrete Cosine Transform and performs lossy compression. Its idea is to create stains of the same color out of the parts of the image, whose color does not change significantly (quantization). If the output quality is set too low, the stains become visible.

14 Image compression - PNG
PNG (Portable Network Graphics) implements lossless compression with the use of the DEFLATE algorithm. Supports multiple graphical parameters, including the alpha channel. Offers very high compression rate.

15 Video compression Video compression algorithms are implemented in programs called codecs. One algorithm can be implemented by many codecs. Lossless codec: FFv1: written by Michael Niedermayer, published as a part of FFmpeg under the GNU GPL license Huffyuv: fast Windows codec, written by Ben Rudiak-Gould (GNU GPL) Lagarith: newer version of Huffyuv YULS x264 (in lossless mode)

16 Video compression Codecs for the algorithm MPEG-4 Part 2/MPEG-4 ASP
DivX Pro Codec: Proprietary codec owned by DivX, Inc. Xvid: Free implementation of MPEG-4 ASP FFmpeg MPEG-4: included in the library libavcoded, used in Linux 3ivx: Proprietary codec by 3ivx Technologies

17 Video compression Codecs for the algorithm H.264/MPEG-4 AVC
x264: implementation under GPL; encoding only Nero Digital: Proprietary implementation of MPEG-4 ASP and AVC, created by Nero AG QuickTime H.264: Implementation of H.264 by Apple DivX Pro Codec: Encoder and decoder of H.264 was added in version 7

18 Thank you for your attention!


Download ppt "Introduction to Computer Science - Lecture 4"

Similar presentations


Ads by Google