1 / 7

Lossless Compression Page 294-298

Lossless Compression Page 294-298. Lauren D’Arcangelo. Overview . Dictionary encoding: create a dictionary (a table) of strings used during the communication session. Steps to compression Steps to decompression. Compression…. Decompressed String: BAABABBBAABBBBAA

Download Presentation

Lossless Compression Page 294-298

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lossless CompressionPage 294-298 Lauren D’Arcangelo

  2. Overview • Dictionary encoding: create a dictionary (a table) of strings used during the communication session. • Steps to compression • Steps to decompression

  3. Compression… • Decompressed String:BAABABBBAABBBBAA • Step 1:Extract smallest substring from original string (B). • B is index 1. • B is inserted in the compressed string. • Remaining String: AABABBBAABBBBAA • Step 2:Extract next smallest substring from the remaining string (A). • A is index 2. • A is inserted in the compressed string. • Remaining String: ABABBBAABBBBAA

  4. Compression… • Remaining String: ABABBBAABBBBAA • Step 3: Extract the next smallest substring from the original string, that isn’t in the dictionary (AB). • AB is index 3 • Find the substring without the last character (A). • The index for A is 2, replace A with 2 and insert 2B in the compressed string.

  5. Compression… • Remaining String:ABBBAABBBBAA • Step 4:Extract ABB, because A and AB are already in the dictionary. • ABB is index 4. • Find the index of the substring without the last character (AB) which is 3. • 3B is inserted into the compressed string. • When the steps are completed the final compressed string is: B, A, 2B, 3B, 1A, 4B, 5A

  6. Decompression • Compressed String:B, A, 2B, 3B, 1A, 4B, 5A • Step 1: Find first substring of the compressed string (B). B has no index; B is inserted to decomposed string. • Step 2: Find the second substring (A). Insert A into the decompressed string. • Step 3: Find the third substring (2B). Search the dictionary and replace the index 2 with the substring A. AB is added to the decomposed string. • Step 4: Find the fourth substring (3B). Search the dictionary and replace the index 3 with the substring AB. The substring ABB is added to decompressed string. • The final decompressed string is: BAABABBBAABBBBAA

  7. THE END

More Related