picture shows relation between amount of used bytes (x axis) and compression ratio in % (y axis)



What's this?

the readme file:
modcomp can compress and decompress data

algorithm works by checking how many bytes are used in sourcefile
and then changing the base of the file to that amount.
in a uncompressed file the base is 256 (1 byte).
if for instance 90 bytes are used, the new base is 90.

good things:
compression ratio can be calculated in constant time and only
depends on amount of used bytes.

bad things:
needed time per byte per byte > 0. (some say O(n^2) but i ain't sure)
bad compression ratio on average files ;)
VERY slow.
NOT block alignable without wasting space.
  (although some students at university of stuttgart, germany thought so)
output of this programm cannot be compressed by gzip or bzip2 (the
  size INCREASES by those programs ;)

so what do you learn from this ?
it is a REAL bad idea to compress by changing bases!
it is only good if new base is 2^x. and then you could
do it with bitshifts and it is trivial.

sincerly yours,

erikyyy at erikyyy dot de

Back to the homepage