Image Number 3 for United States Patent #5675382.
A spatial compression and decompression system for color video data wherein a video stream is generated by a charge-coupled device with red, green and blue pixel elements. In a first compression stage, the 5-bit color data from each element is processed in turn. This step involves reading out from a lookup memory a 3-bit category (or compressed value) and 5-bit output value based on the 5-bit color data, a 5-bit previous value that represents same color data for a neighboring pixel and a 1-bit table select signal that determines in which of two similar tables the lookup is performed. The 3-bit category data for a pixel's three elements are combined and used as a 9-bit index into a Huffman table that performs the second stage of compression. Each Huffman table entry includes a variable-length Huffman code that represents more common categories with fewer bits, which provides additional compression over the first stage. The Huffman table reads out the code of the particular 9-bit category used for the lookup. This code is packed into an output buffer and transmitted to the decompressor that will unpack for display or store the resulting compressed data stream. In the first decompression stage, each Huffman code in the compressed data stream is decoded using no more than two compares and one table lookup into an inverse Huffman decode table. The resulting 9-bit category is used as an index into one of two similar inverse lookup tables, which outputs the appropriate 16-bit uncompressed data value.