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

Re: Compression algorithm question by lallous

lallous
Wed Jul 30 02:23:08 CDT 2003

Hello,

I guess it is hard to tell what algo is used and how it is being used...
Perhaps if you reverse engineer the application that is generating this file
you can then get hints on what algo is being used.

Regards,
Elias



Re: Compression algorithm question by Alain

Alain
Wed Jul 30 03:26:18 CDT 2003

A colleague at work suggested that, but to be honest, I wouldn't have a clue
where to start to do that, and while I know MFC/C++ very well, I know almost
no assembler.

Thanks for that suggestion, though.

Alain

"lallous" <lallous@lgwm.org> wrote in message
news:uw$3%23vmVDHA.2228@TK2MSFTNGP12.phx.gbl...
> Hello,
>
> I guess it is hard to tell what algo is used and how it is being used...
> Perhaps if you reverse engineer the application that is generating this
file
> you can then get hints on what algo is being used.
>
> Regards,
> Elias
>
>