Compression/decompression and other routines related to the RIF image format.