Compression Algorithms GCSE Computer Science Lossy Lossless Show

  • Slides: 17
Download presentation
Compression Algorithms GCSE Computer Science

Compression Algorithms GCSE Computer Science

Lossy & Lossless Show understanding of the principles of data compression (lossless and lossy)

Lossy & Lossless Show understanding of the principles of data compression (lossless and lossy) applied to music/video, photos and text files Click here for Topic Introduction

MP 3 / WMA PNG JPG ZIP MP 4

MP 3 / WMA PNG JPG ZIP MP 4

Data is removed to reduce the file size. Data is not lost & can

Data is removed to reduce the file size. Data is not lost & can be restored in full. Used when removing data would still make the file usable (eg. image, sound, or video) Used when removing data would make the file unusable (eg. text files & programming code)

JPEG Images JPEG image file sizes can be compressed using lossy techniques. By representing

JPEG Images JPEG image file sizes can be compressed using lossy techniques. By representing the image using luma & choma, the reduction in colour isn’t seen by the human eye because we notice changes in brightness more than colour. Image Source: http: //camerapixels. basic-pixels. com/index. php/2017/05/11/jpeg_or_tiff/

Run Length Encoding Show understanding of the principles of data compression (lossless and lossy)

Run Length Encoding Show understanding of the principles of data compression (lossless and lossy) applied to music/video, photos and text files Click here for Topic Introduction

Run Length Encoding is a method of lossless compression where runs of the same

Run Length Encoding is a method of lossless compression where runs of the same data are encoded together to save space. This can be uncompressed to create the original data. RLE can be used for both images and text. The last line of the image below, could be encoded as follows: WWRRRWW Or W 2 R 3 W 2

Run Length Encoding is a method of lossless compression where runs of the same

Run Length Encoding is a method of lossless compression where runs of the same data are encoded together to save space. This can be uncompressed to create the original data. RLE can be used for both images and text. How would the text below be encoded using RLE? LEEEEEROY!

Huffman Encoding Show understanding of the principles of data compression (lossless and lossy) applied

Huffman Encoding Show understanding of the principles of data compression (lossless and lossy) applied to music/video, photos and text files Click here for Topic Introduction thm gori l a A n e AQ is a h t n a f m o l Huff part sefu u s i s h t i whic , bu c e p s ss e! GCSE ssle o ryon l e v w e o h or to s on f i s s re comp

ABCDEF Huffman Encoding uses a reduced character set to save space when encoding text.

ABCDEF Huffman Encoding uses a reduced character set to save space when encoding text. By using as few binary digits as possible, it can make space savings for almost every character. BUT! Reducing the bits comes with a problem. . . Char Bit Pattern Reduced A 000 0 B 001 1 C 010 10 D 011 11 E 100 F 101 110101 = ? ? It’s ambiguous!

ABCDEF Huffman Encoding To make sure the bit pattern can be read, Huffman uses

ABCDEF Huffman Encoding To make sure the bit pattern can be read, Huffman uses a binary tree to create completely unique bit patterns for all characters.

BANANA COFFEE Huffman Encoding Using this approach of creating a binary tree is made

BANANA COFFEE Huffman Encoding Using this approach of creating a binary tree is made even more efficient by placing the most frequent letters at the top of the tree so their bit patterns are shorter.

Exam Questions Represent positive numbers in hexadecimal notation Show understanding of the reasons for

Exam Questions Represent positive numbers in hexadecimal notation Show understanding of the reasons for choosing hexadecimal notation to represent numbers Identify current uses of hexadecimal numbers in computing, such as defining colours in Hypertext Markup Language (HTML), Media Access Control (MAC) addresses, assembly languages and machine code, debugging Convert positive hexadecimal integers to and from denary (a maximum of four hexadecimal digits will be required) Convert positive hexadecimal integers to and from binary (a maximum of 16 bit binary numbers will be required)

Exam Question 1 hm which an algorit s i n a m f f

Exam Question 1 hm which an algorit s i n a m f f Hu pec, AQA GCSE s e h t f o t r is pa w lossless ful to sho e s u s i t u b yone! n for ever compressio

Exam Question 2 hm which an algorit s i n a m f f

Exam Question 2 hm which an algorit s i n a m f f Hu pec, AQA GCSE s e h t f o t r is pa w lossless ful to sho e s u s i t u b yone! n for ever compressio

Answers 0 1 10 111

Answers 0 1 10 111

Answers ASCII : 13 characters = 13 x 7 = 91 bits Huffman: A

Answers ASCII : 13 characters = 13 x 7 = 91 bits Huffman: A = 1 bit x 5 G = 2 bits x 4 = 8 S = 3 bits x 2 = 6 H = 3 bits x 2 = 6 Total = 25 bits Answer = 66 bits reduction