Chapter 3 Multimedia Data Compression
Chapter 3 Multimedia Data Compression
Multimedia DataCompression
1. Lossless and Lossy compression
2. Run Length Coding
3. Huffman coding
4. Dictionary-based coding (LZW)
3.1 Lossless and Lossy compression
• Compression: the process of coding that will effectively reduce the
total number of bits needed to represent certain information.
5. Remove these two minimum frequencies from Q and add the sum
into the list of frequencies (* denote the internal nodes in the figure
above).
6. Insert node z into the tree.
7. Repeat steps 3 to 5 for all the characters.
(a) (b)
8. For each non-leaf node, assign 0 to the left edge and 1 to the right
edge.
• For sending the above string over a network, we have to send the
tree as well as the above compressed-code. The total size is given by
the table below.
• Without encoding, the total size of the string was 120 bits. After
encoding the size is reduced to 32+15+28 = 75 bits.
Decoding the code
• For decoding the code, we can take the code and traverse through
the tree to find the character.
• Let 101 is to be decoded, we can traverse from the root as in the
figure below.
Example:2