Bit Map Compression of Binary Files


Bit Map

A bit map compression scheme consists of a bit map and a physical database which stores the non-constant values. The bit map is employed to indicate the presence or absence of non-constant data. The following example shows how the bit map compression scheme can be employed to implement a version of constant suppression.

Example:

Original data string
d1, c, c, d2, c, c, c, d3

Compressed data string
Bit map: 10010001.
Physical database: dl, d2, d3.

For the bit map compression method, the mapping mechanism must search the whole bit map for both forward and backward mapping. And thus, the access time for both forward and backward mapping is O(N), where N is the number of bits in the bit map or equivalently the number of elements in the database.

Program in CPP:
From the above theory, we have designed the program that is stated below. this program takes input from the secondary memory as binary (.bin) file.
thank you!
Continue reading “Bit Map Compression of Binary Files”

Run Length Encoding (RLE)

Run-Length Encoding: The application of run-length encoding to constant removal is that each consecutive run of constants (there can be a few different types of constants to be removed) is replaced by a triple consisting of a separator SEP, an encoding of the constant X to be removed and a counter C indicating the length of the run. To search a run-length encoded database for … Continue reading Run Length Encoding (RLE)