| Stefano Brocchi 2008-04-01, 7:56 am |
| Hi,
in fact you are trying to save something quite similar to 32-bit
floating point numbers... The numbers you want to represent, without
considering the floating point, are about 2*10^9, that are something
less than 2^31, so for an 'uncompressed coding' you will need 31bits +
3 sign bits = 34bits.
Now for compression: writing some numbers with fewer bits will save
some bits for these less precise values, but will lose some for the
others as you will have to write something to distinguish the two
cases. Your gain will depend on how many numbers are in a class and
how many in the other.
Apart this, if you consider that any number may appear in an equally
probable way, you cannot compress your data, as it would be a random
sequence. Don't you have any information about the type of numbers you
will store ? If for example you can save values in order that could be
already something to exploit. Or maybe numbers in an interval are more
probable than others ? Or values close one to another have chances to
have similar values ? Consider these possibilities, and maybe there's
something you can do...
Hope this helps,
Stefano
|