1 / 13

Data Compression Michael J. Watts mike.watts.nz

Data Compression Michael J. Watts http://mike.watts.net.nz. Lecture Outline. What is compression? Huffman encoding Lempel-Ziv encoding Fraunhofer compression JPEG compression. What is Compression?. Reduction of the length of symbols used to represent data Symbols can be anything

Download Presentation

Data Compression Michael J. Watts mike.watts.nz

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. Data Compression Michael J. Watts http://mike.watts.net.nz

  2. Lecture Outline • What is compression? • Huffman encoding • Lempel-Ziv encoding • Fraunhofer compression • JPEG compression

  3. What is Compression? • Reduction of the length of symbols used to represent data • Symbols can be anything • Based on redundancy • Information theory • Lossless vs lossy • Degree of compression depends on amount of redundancy • Random data compression?

  4. What is Compression? • Represent symbols with codewords • One symbol == one codeword • Length of codeword < length of symbol • Many algorithms exist • Huffman • Lempel-Ziv • Fraunhofer

  5. Huffman Encoding • Based on probability (frequency) of symbols • Assign codewords as bits • Builds a binary tree based on probability • Frequent / high probability symbols at the top • Infrequent / low probability symbols lower down • Branches labelled with 0 and 1 • Frequent symbols get short bit strings • Infrequent symbols get longer bit strings

  6. Huffman Encoding • Algorithm • Arrange symbols in order of decreasing probability • Combine two symbols with lowest probability • Assign a new name, add their probabilities • Rebuild the list • Combine the next two lowest symbols • Repeat until there is one symbol, with probability of one • Build a binary tree • Form codewords by tracing down the tree to the symbol

  7. Huffman Encoding • Decompression is the opposite of compression • Follow bit sequence to a terminal node • Needs to see the entire data set • Must know symbol probabilities • Also combined with other techniques • MP3 encoding

  8. Lempel-Ziv • Dictionary based encoder • Lossless • Replaces phrases with tokens • Tokens smaller than the phrases • Converts input stream to compressed output stream • Doesn't need to see entire data set • Dictionary is built as it moves through the stream

  9. Lempel-Ziv • Separates input stream into tokens • Each token represents the shortest phrase that has not been seen • Tokens are numbered • Tokens contain other tokens • Compression is inefficient at the start • Better later • Larger dictionary

  10. Fraunhofer / MP3 Encoding • Lossy algorithm • Compression of audio data • Perceptual encoding • Psycho-acoustic model • Throws out what can't be heard • Frequency bands • Masking effects • Output is further compressed • Uses Huffman encoding

  11. MP3 Encoding • Only usable on audio • Part of the MPEG standard • DVDs • Rather widely used by itself

  12. JPEG Compression • Joint Photographic Experts Group • Used to compress images • Compresses groups of pixels • Uses a Discrete Cosine Transformation • DCT • Quantises the results of the DCT • Lossy! • Further compression is applied

  13. Summary • Compression is an application of information theory • Encodes long strings as shorter strings • All schemes depend on redundant / repetitive data • Common gotchas • A compression algorithm cannot compress its own output • Cannot easily compress completely random data • No / little redundancy

More Related