1 / 20

File Compression Techniques

File Compression Techniques. Alex Robertson. Outline. History Lossless vs Lossy Basics Huffman Coding Getting Advanced Lossy Explained Limitations Future. History, where this all started. The Problem! 1940s Shannon- Fano coding Properties

decker
Download Presentation

File Compression Techniques

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. File Compression Techniques Alex Robertson

  2. Outline • History • Lossless vsLossy • Basics • Huffman Coding • Getting Advanced • Lossy Explained • Limitations • Future

  3. History, where this all started • The Problem! • 1940s • Shannon-Fano coding • Properties • Different codes have different numbers of bits. • Codes for symbols with low probabilities have more bits, and codes for symbols with high probabilities have fewer bits. • Though the codes are of different bit lengths, they can be uniquely decoded.

  4. Lossless vsLossy • Lossless • DEFLATE • Data, every little detail is important • Lossy • JPEG • MP3 • Data can be lost and unnoticed

  5. Understanding the Basics • Properties • Different codes have different numbers of bits. • Codes for symbols with low probabilities have more bits, and codes for symbols with high probabilities have fewer bits. • Though the codes are of different bit lengths, they can be uniquely decoded. • Encode “SATA” S = 10 A = 0 T = 11

  6. Prefix Rule • S = 01 A = 0 T = 00 • SATA • SAAAA • STT 01 0 00 0 No code can be the prefix of another code. If 0 is a code, 0* can’t be a code.

  7. Make a Tree • Create a Tree A = 010 B = 11 C = 00 D = 10 R = 011

  8. Decode • 01011011010000101001011011010 A = 010 B = 11 C = 00 D = 10 R = 011 • Violates the property: • Codes for symbols with low probabilities have more bits, and codes for symbols with high probabilities have fewer bits.

  9. Huffman Coding • Create a Tree • Encode “ABRACADABRA” • Determine Frequencies • The two least frequent “nodes” are located. • A parent node is created from the two above nodes and it is given a weight equal to the sum of the two contain node frequencies. • One of the child nodes is given the 0 bit and the other the 1 bit • Repeat the above steps until only one node is left.

  10. Does it work? • Re-encode • 01011011010000101001011011010 • 29 bits

  11. It Works! 01011001110011110101100 = 23 bits ABRACADABRA = 11 character * 7 bits each = 77 bits but…

  12. It Works… With Issues. • Header includes the probability table • Not the best in certain cases Example. ‘A’ 100 times Huffman only reduces this to 100 bits (minus the header)

  13. Moving Forward • Arithmetic Method • Not Specific Code • Continuously changing single floating-point output number • Example

  14. “BILL GATES”

  15. Dictionary Based • Implemented in the late 70s • Uses previously seen words as a dictionary. • the quick brown fox jumped over the lazy dog • I bought a Mississippi Banana in Mississippi.

  16. Lossy Compression • Lossy Formula • Lossless Formula • My Sound!

  17. Mathematical Limitations • Claude E. Shannon • http://www.data-compression.com/theory.html

  18. Example • DEFLATE • http://en.wikipedia.org/wiki/DEFLATE

  19. Future • Hardware is getting better • Theories are the same

  20. Thanks You • Questions

More Related