Hi,
I've been reading in a stream of data from a data file where sometimes the
data is uncompressed, and other times it is compressed. The uncompressed
data is a list of longs - if I know there are 1001 data points, I do this:
long* plArray = new long[1001];
DWORD dwRead;
HRESULT hr = pStream->Read(m_plArray, 1001*sizeof(long), &dwRead);
However, every now and then I come across a chunk of data where I know that
I expect those 1001 data points, but the size of the data file is
approximately 1/4 the size it should be (.ie. instead of being 4004 bytes,
it might be say 1200 bytes). Its obviously been compressed - I'm guessing
there's no encryption involved. There is a boolean just before the data
stream starts that indicates whether compression has been applied or not, so
I don't need to guess that based on the data size.
If I know what the data _should_ be (I have a list of the what the
unencrypted data is), could anyone gives me any tips/pointers as to what
compression algorithm is being used?
I'm new to this compression side of things. I'm just reading now about
Shannon-Fano and Huffman coding for the first time. Maybe someone who's an
expert wouldn't mind giving me a start in working out the algorithm applied.
Thanks in advance,
Alain Dekker