Presentation is loading. Please wait.

Presentation is loading. Please wait.

Compression techniques Adaptive and non-adaptive.

Similar presentations


Presentation on theme: "Compression techniques Adaptive and non-adaptive."— Presentation transcript:

1 Compression techniques Adaptive and non-adaptive

2 non-adaptive Non-adaptive encoders contain a static dictionary of predefined substrings that are known to occur with high frequency in the data to be encoded A non-adaptive encoder designed specifically to compress English language text would contain a dictionary with predefined substrings such as "and", "but", "of", and "the", because these substrings appear very frequently in English text.

3 adaptive An adaptive encoder, on the other hand, carries no preconceived heuristics about the data it is to compress. Adaptive compressors, such as LZW, achieve data independence by building their dictionaries completely from scratch. They do not have a predefined list of static substrings and instead build phrases dynamically as they encode. dynamically adjusts the algorithm used based on the content of the data being compressed.

4 Huffman Encoding

5 Simple Example And Algorithm

6 Binary tree structure is needed. This binary tree differs from standard binary trees by the fact that it is most easily constructed from the bottom to the top: from the leaves to the root, in other words. The procedure is as follows: first, list all the letters used, including the "space" character, along with the repetition with which they occur in the message.

7 Simple Example And Algorithm LetterFrequencies A64 B13 C12 D16 E9 F5 Assume that we have a text and this table of letters frequencies. Then follow the following steps.

8 Simple Example And Algorithm

9 The resulting code table LetterCode A0 B101 C100 D111 E1101 F1100

10 Huffman Tree Construction example 2 LetterProbability A3 C5 E8 H2 I7 Assume that we have a text and this table of letters frequencies. Then follow the following steps.

11 Huffman Tree Construction example 2 3 58 2 7 A CE H I

12 3 58 2 75 5 A CE H I

13 5 87 C EI 10 32 5 5AH

14 Huffman Tree Construction example 2 3 5 8 2 7 5 5 A C E H I 10 15

15 Huffman Tree Construction example 2 5 87 C EI 10 1 0 15 1 0 25 1 0 32 5 5 1 0 AH

16 Huffman Tree Construction example 2 Lettercode A011 C00 E11 H010 I10 Letters Table Code. Input ACE  Output (011)(00)(11)

17 Huffman Code Algorithm Overview Decoding – Read compressed file & binary tree – Use binary tree to decode file Follow path from root to leaf

18 Huffman Decoding 1 5 87 C EI 10 1 0 15 1 0 25 1 0 0 32 5 5 1 0 AH 0110011

19 Huffman Decoding 2 5 87 C EI 10 1 1 0 15 1 0 25 1 0 0 32 5 5 1 0 AH 0110011

20 Huffman Decoding 3 5 87 C EI 10 1 1 0 15 1 0 25 1 0 0 32 5 5 1 1 0 AH 0110011 A

21 Huffman Decoding 4 5 87 C EI 10 1 0 15 1 0 25 1 0 32 5 5 1 0 AH 0110011 A

22 Huffman Decoding 5 5 87 C EI 10 1 0 15 1 0 25 1 0 32 5 5 1 0 AH 0110011 ACAC

23 Huffman Decoding 6 5 87 C EI 10 1 0 15 1 0 25 1 0 32 5 5 1 0 AH 0110011 ACAC

24 Huffman Decoding 7 5 87 C EI 10 1 0 15 1 0 25 1 0 32 5 5 1 0 AH 0110011 ACEACE

25 Exercise For the first Example compress the following text “ABCF” For the first example what is the text that represent that code “01011001100”


Download ppt "Compression techniques Adaptive and non-adaptive."

Similar presentations


Ads by Google