Suppose we have a 2x2 image as follows:
What does each dequantised image look like after it has first been quantised to 7, 4 and 2 bits respectively?
I solve this question by initially quantising as follows.
- Into 7 bits : 8 bits - 7 bits = 1 bit and 2 to the power of 1 is 2 so, 232 / 2 = 116, 127 / 2 = 63, 169 / 2 = 84 and 27 / 2 = 13. Therefore, we have:
- Into 4 bits: 8 bits - 4 bits = 4 bits and 2 to the power of 4 equals 16. Thus, 232/16 = 14, 127 / 16 = 7, 169 / 16 = 10, 27 / 16 = 1.
- Into 2 bits: 8 bits - 2 bits = 6 bits and 2 to the power of 6 is 128 so, 232 / 128 = 1, 127 / 128 = 0, 169 / 128 = 1 and 27 / 128 = 0 hence, we have:
Now, to dequantise the results we simply multiply each cell value by the number we initially used for quantisation. The above matrices will be as follows respectively:
Are all steps in my solution correct, if not where should be modified?
EDIT
According to what @Hilmar detected, 2 to the power of 6 is 64 and the quantisation into 2 bits should be changed to: 232 / 64 = 3, 127 / 64 = 1, 169 / 64 = 2 and 27 / 64 = 0 hence, we have: