A method for encoding and decoding frames by generating a key bitstream
such that the key bitstream never has to be stored is disclosed. The
method consists of a key generation algorithm using a threshold matrix to
generate a key that is very similar to original bitmap data. The key
generation algorithm searches the bitmap for equivalent image sets that
produce the same bitmaps. These equivalent image sets consist of
runlength of constant image values and the actual runlength.
Additionally, the image values for the runlengths are never explicitly
encoded. During compression a preprocess algorithm XORs the MINIMAL
number of hints required to find a equivalent image value for the
runlength. The postprocess algorithm is capable of distinguishing if a
single bit represents an image value adjustment hint or if it represents
the end of a runlength. By allowing the image value for each run length
to be represented by a series of hints it is possible to avoid specifying
the image value with an excessive amount of precession. Excessive
precision of the image value simply adds data to the data stream without
adding any additional information.