I'm looking to devise a scheme for compressing integers which have a known sampled distribution (they might be clustered around a value, say, or have several areas of differing density). So far, I've centred my thinking around the deflate concept of encoding a value as a huffman symbol representing a (power-of-two sized) range base, followed by a number of bits to offset from the base.
My first question is, does this seem reasonable, or is there a more efficient scheme (I'm not sure what search terms to use to find research on this)?
Secondly, if the above does seem a sensible route, can anyone suggest an efficient algorithm for selecting a number of ranges, their sizes and bases (I guess the ranges might as well be allowed to overlap) which minimises the number of bits needed to encode numbers following the given arbitrary distribution.