Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 8 – Compression Aims: Outline the objectives of compression.

Similar presentations


Presentation on theme: "Chapter 8 – Compression Aims: Outline the objectives of compression."— Presentation transcript:

1 Chapter 8 – Compression Aims: Outline the objectives of compression.
Define the key methods used to compress data. Outline methods used to compress images, video and audio.

2 Key factors in reducing the amount of data storage
Getting rid of redundant data. This involves determining the parts of the data that are not required Identifying irrelevant data. This involves identifying the parts of the data which are perceived to be irrelevant. Converting the data into a different format. This will typically involve changing the way that the data is processed and stored Reducing the quality of the data. Often the user does not require the specified quality of the data.

3 RGB #FF0000 (255,0,0) #00FF00 (0,255,0) #0000FF (0,0,255) #FFFFFF (255,255,255) # (0,0,0) #6496C8 (100,150,200) #C89664 (200,150,100) #64C896 (100,200,150)

4 Changes between images

5

6 Audio, image and video compression
JPEG/GIF. The JPEG (Joint Photographic Expert Group) compression technique is well matched to what the human eye and the brain perceive. MPEG. MPEG (Motion Picture Experts Group) uses many techniques to reduce the size of the motion video data. MPEG (MP-3). The digital storage of audio allows for the data to be compressed.

7 Compression process

8 Sampling

9 Quantization

10 Error and number of conversion bits
Bits (N) Quantization levels Accuracy (%) 1 2 25 8 256 0.2 4 12.5 12 4096 0.012 3 6.25 14 16384 0.003 16 3.125 65536

11 Lossy and lossless compression
Lossless compression. Where the data, once uncompressed, will be identical to the original uncompressed data. This will obviously be the case with computer-type data, such as data files, computer programs, and so on, as any loss of data may cause the file to be corrupted. Lossy compression. Where the data, once uncompressed, cannot be fully recovered. It normally involves analysing the data and determining which data has little effect on the perceived information.

12 Entropy and source coding
Entropy coding. This does not take into account any of the characteristics of the data and treats all the bits in the same way. As it does not know which parts of the data can be lost, it produces lossless coding. Typical coding techniques are: Statistical encoding. Analysing the occurrence and patterns of data. Suppressing repetitive sequences. Source encoding. This normally takes into account characteristics of the information.

13 Entropy coding Normally, general data compression does not take into account the type of data which is being compressed and is lossless. As it is lossless it can be applied to computer data files, documents, images, and so on. The two main techniques are statistical coding and repetitive sequence suppression. Huffman. Huffman coding uses a variable length code for each of the elements within the data. This normally involves analysing the data to determine the probability of its elements. The most probable elements are coded with a few bits and the least probable coded with a greater number of bits. This could be done on a character-by-character basis, in a text file, or could be achieved on a byte-by-byte basis for other files. Lempel-Ziv. Around 1977, Abraham Lempel and Jacob Ziv developed the Lempel–Ziv class of adaptive dictionary data compression techniques (also known as LZ-77 coding), which are now some of the most popular compression techniques.

14 ‘e’ ‘i’ ‘o’ ‘p’ ‘b’ ‘c’ 57 51 33 20 12 3 ‘e’ 11 ‘i’ 10 ‘o’ 00 ‘p’ 011
Huffman Letter: ‘b’ ‘c’ ‘e’ ‘i’ ‘o’ ‘p’ No. of occurrences: ‘e’ ‘i’ ‘o’ ‘p’ ‘b’ ‘c’ ‘e’ 11 ‘i’ 10 ‘o’ 00 ‘p’ 011 ‘b’ ‘c’ 0100

15 Huffman example (goals scored)

16 ‘e’ ‘o’ ‘p’ ‘c’ ‘i’ ‘p’ ‘c’
Huffman (cont.) will be decoded as: ‘e’ ‘o’ ‘p’ ‘c’ ‘i’ ‘p’ ‘c’ ‘e’ 11 ‘i’ 10 ‘o’ 00 ‘p’ 011 ‘b’ ‘c’ 0100

17 ‘The receiver#9#3quires a#20#5pt for it.
Lempel-Ziv ‘The receiver#9#3quires a#20#5pt for it. This is automatically sent wh#6#2 it #30#2#47#5ved.’

18 LZW The Lempel–Ziv–Welsh (LZW) algorithm (also known LZ-78) builds a dictionary of frequently used groups of characters (or 8-bit binary values A simple example is to use a six-character alphabet and a 16-entry dictionary, thus the resulting code word will have 4 bits. If the transmitted message is: ababacdcdaaaaaaef Then the transmitter and receiver would initially add the following to its dictionary: 0000 ‘a’ ‘b’ 0010 ‘c’ ‘d’ 0100 ‘e’ ‘f’ 0110–1111 empty

19 LZW (cont.) 0000 ‘a’ ‘b’ 0010 ‘c’ ‘d’ 0100 ‘e’ ‘f’ 0110–1111 empty 0110 ‘ab’ 0111–1111 empty

20 Morse coding Pure coding (example) Statistical coding
Statistical encoding is an entropy technique which identifies certain sequences within the data. These ‘patterns’ are then coded so that they have fewer bits. Frequently used patterns are coded with fewer bits than less common patterns. For example, text files normally contain many more ‘e’ characters than ‘z’ characters. Thus the ‘e’ character could be encoded with a few bits and the ‘z’ with many bits a 00000 b 00001 c 00010 d 00011 e 00100 f 00101 g 00110 h 00111 i 01000 j 01001 k 01010 l 01011 m 01100 n 01101 o 01110 p 01111 q 10000 r 10001 s 10010 t 10011 u 10100 v 10101 w 10110 x 10111 y 11000 z 11001 SP 11010 Morse coding a 01 b 1000 c 1010 d 100 e f 0010 g 110 h 0000 i 00 j 0111 k 101 l 0100 m 11 n 10 o 111 p 0110 q 1101 r 010 s 000 t 1 u 001 v 0001 w 011 x 1001 y 1011 z 1100 SP 0011 Pure coding (example)

21 Repetitive character sequence suppression
Repetitive sequence suppression involves representing long runs of a certain bit sequence with a special character. A special bit sequence is then used to represent that character, followed by the number of times it appears in sequence. could be coded as: 8.32F11 where F is a special flag.

22 Source compression Source compression takes into account the type of information that is being compressed, and is typically used with image, video and audio information. For example the following might be integer values for the samples: 321, 322, 324, 324, 320, 317, 310, 311 This could be coded as difference values as: 321, +1, +2, 0, –4, –3, –7, +1

23 Image compression File Compression type Max. resolution or colours
TIFF Huffman RLE and/or LZW 48-bit colour TIFF (tagged image file format) is typically used to transfer graphics from one computer system to another. It allows high resolutions and colours of up to 48 bits (16 bits for red, green and blue). GIF LZW 65,563 65,536 (24-bit colour, but only 256 displayable colours) Standardized graphics file format which can be read by most graphics packages. It has similar graphics characteristics to PCX files and allows multiple images in a single file and interlaced graphics. JPG JPEG compression (DCT, quantization and Huffman) Depends on the compression Excellent compression technique which produces lossy compression. It normally results in much greater compression than the methods outlined above.

24 Image with a good deal of repetition Image with a good deal of changes
Image compression Image with a good deal of repetition Image with a good deal of changes Type Size(B) Compression (%) BMP 308278 100.0 BMP, RBG encoded (640480, 256 colours) 301584 97.8 BMP, RLE encoded GIF 124304 40.3 GIF, Version 89a, non-interlaced 127849 41.5 GIF, Version 89a, interlaced TIF 136276 44.2 TIF, LZW compressed 81106 26.3 TIF, CCITT Group 3, MONOCHROME JPG 28271 9.2 JPEG – JFIF Complaint (Standard coding) 26511 8.6 JPEG – JFIF Complaint (Progressive coding) Type Size (B) Compression (%) BMP 750054 100.0 BMP, RBG encoded (500500, 16.7M colours) 7832 1.0 BMP, RLE encoded (256 colours) PCX 31983 4.3 PCX, Version 5 (256 colours) GIF 4585 0.6 GIF, Version 89a, non-interlaced (256 colours) TIF 26072 3.5 TIF, LZW compressed (16.7M colours) JPG 15800 2.1 JPEG (Standard coding, 16.7M colours) 12600 1.7 JPEG (Progressive coding, 16.7M colours)

25 JPEG It is a compression technique for grey-scale or colour images and uses a combination of discrete cosine transform, quantization, run-length and Huffman coding. The components are computed from the RGB components: Y = 0.299R+0.587G+0.114B Cb = R–0.3313G+0.5B Cr = 0.5R–0.4187G B

26 MPEG

27 Segmentation

28 I, P and B-frames Intra frame (I-frame). An intra frame, or I-frame, is a complete image and does not require any extra information to be added to it to make it complete. As it is a complete frame, it cannot contain any motion estimation processing. It is typically used as a starting point for other referenced frames, and is usually the first frame to be sent. Predictive frame (P-frame). The predictive frame, or P-frame, uses the preceding I-frame as its reference and has motion estimation processing. Each macroblock in this frame is supplied as referenced to an I-frame as either a vector and difference, or if no match was found, as a completely encoded macroblock (called an intracoded macroblock). The decoder must thus retain all I-frame information to allow the P-frame to be decoded. Bidirectional frame (B-frame). The bidirectional frame, or B-frame, is similar to the P-frame except that it references frames to the nearest preceding or future I- or P-frame. When compressing the data, the motion estimation works on the future frame first, followed by the past frame. If this does not give a good match, an average of the two frames is used. If all else fails, the macroblock can be intracoded.

29 Audio compression Digitized audio signal rate = 44.116 kbps = kbps

30 Psycho-acoustic model


Download ppt "Chapter 8 – Compression Aims: Outline the objectives of compression."

Similar presentations


Ads by Google