Compute the degree of compression that can be achieved using (i) Huffman coding, and (ii) Run length coding, assuming two-bits to represent the pixel value and twobits to represent the run length.
To compute the degree of compression achieved using Huffman coding and Run-Length coding, let's first understand the concepts of these coding techniques.
1. Huffman Coding:
Huffman coding is a variable-length encoding algorithm that is used for lossless data compression. It assigns variable-length codes to input characters based on their frequencies. Characters that occur more frequently are assigned shorter codes, while less frequent characters are assigned longer codes.
In the given matrix I:
```
3 3 3 2
2 3 3 3
3 2 2 2
2 1 1 0
_____ _______ ___ _______ ______ ________ _________ ______.
_________ __________ ____ _____ ______ _______.
_______ _________ ________ ________ _____ ____ ____ _____ _______ _______.
________ ____ ______ ____ _____ ______ ___ ___ ___ _______ __________ ______.
______ ____ _____ _______ _______ ______ _____ ___ ___ _____ ____ __________.
_____ __________ ____ ____ ______ _______ __________.
___ ___ ___ ______ _________ ________ ____ _____ ________ _______ _________.
___ _______ _______ ___ ______ ________ __________ _______ _______ ____.
__________ _________ _________ ___ ___ ______.
___ __________ _______ ______ _________ ____ ____.
__________ _______ ________ _________ __________ ____ _______ _________ _____ ____ _______ _______.
_______ ________ ___ ____ ______ __________ ______ _________ ___.
____ _________ _________ ____ __________ ________ ________ _________ ________ __________ _________ __________.
______ _____ _______ _________ ____ _________ ___ __________ ____ ___ _____.
____ ______ _____ _________ ____ _______ __________ ________ ________ ________ ______.
_______ _________ _________ ____ ____ ________ ___ ________ ________ _________.
_____ _______ _________ _____ _________ ___ ____ ________ _____ ____ __________.
________ __________ _____ ___ _____ ____ __________ _________.
___ _________ ___ ____ _______ ________ ______ ___ ________ ___ ________.
_______ ____ ______ ________ ________ _______ ___ ______ _______ ______ ______.
____ _________ ______ _______ ___ _____ _________ ________ ______ ____.
____ ______ _________ ________ _________ ______ _____.
____ _______ ___ _____ ______ ______.
__________ __________ __________ ________ _______.
___ ___ _________ ____ ___ ______ __________ ___.
________ ____ ____ _________ _____ ______ __________ ________ _________ ________.
________ ___ _________ _______ ________.
__________ ________ _________ ____ ___.
_________ ______ ________ _________ ______ _________ _________ ____ __________ ______.
__________ _____ ___ ____ _________ __________ ________ __________ _________.
____ _______ _____ _________ ______.
_________ _______ ____ ______ ___ ___ _____ ______ __________ ______ ________ _______.
____ _____ ________ ____ ______ __________ _____ ________ _________ _____ _______ ________.
____ ___ _________ ________ _______ __________ ______ _______.
___ _________ __________ __________ ____ ________ __________.
_____ ______ _____ _____ _____ _________ _____.
______ ______ _______ _______ __________ ________ __________ ______.
____ ______ _______ __________ ___.
_______ _______ ______ ____ ___ _______ ____.
______ _________ __________ ___ _____ ____ _______ ________ ________ _________.
___ _______ ____ _________ __________ ________ ___ _________ __________ ___ _____.
_________ ________ _______ __________ _________ ___ ___ ______.
_________ ______ ____ ________ _______ _______ __________ _____ _____ _______ _____.
_________ ____ ________ ________ __________.
_________ _________ ___ _______ ______ _____.
_______ ____ ____ _____ ____ __________ _____ ____ ____ ______ ____ ___.
_______ ____ __________ _______ __________ ________ _______.
___ ______ _______ ________.
Get Full Answer on WhatsApp