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