The functions in this domain can be
divided into two types: the functions that actually compress data,
and transformation functions. The latters do not compress data but only
modify them and prepare for further compression. The examples of
such transformation are the Burrows-Weller Transform, or MoveToFront algorithm.
To do data compression efficient, you should develop the proper
consequence of functions of different type that will transform data
and then compress them.
Compression ratio depends on the statistics of input data. For
some types of input data no compression could be achieved at all.
The size of memory required for the output of data compression
functions typically is not obvious. As a rule encoding functions
uses less memory for output than the size of the input buffer, on
the contrary decoding functions use more memory for output than the
size of the input buffer. You should account these issues and allocate
the proper quantity of output memory using the techniques provided
by functions in this domain. For example, you can use a double-pointer
technique for automatic shifting the user submitted pointer. For
some other functions it is possible to compute the upper limit of the
size of the required output buffer.