Encoding and Decoding
Encoding:
- Scan the a x b blocks of the image. For each block find the nearest codeword in the code book and output its index.
- Nearest neighbor search.
Decoding:
- For each index output the codeword with that index into the destination image.
- Table lookup.