Huffman again!

Hi there,

I have done the implementation of huffman code but i have a difficulty compressing .exe files:

1.The uncompressed file is different than the original file and thus doesn't work properly.(The size of the files are the same, just they function differently.)

2.The compression is not actually a compression since the size of the file not only does not decrease (in exe files or large file in general) but also gets bigger.

I want to know has anybody in this forum done and implementation of this coding method?if so please give your resaults and the compression ratio.

regards,

Capitan Haddock

[644 byte] By [CapitanHaddocka] at [2007-10-2 10:57:07]
# 1

> Hi there,

> I have done the implementation of huffman code but i

> have a difficulty compressing .exe files:

> 1.The uncompressed file is different than the

> original file and thus doesn't work properly.(The

> size of the files are the same, just they function

> differently.)

Ok, so you got some problems with your encoding or decoding. Run the program on some small data (just a few bytes) which you can verify by hand.

> 2.The compression is not actually a compression since

> the size of the file not only does not decrease (in

> exe files or large file in general) but also gets

> bigger.

What? You definately got some big problems.

> I want to know has anybody in this forum done and

> implementation of this coding method?if so please

> give your resaults and the compression ratio.

I wrote one in C++, but that was more than 10 years ago, so I can't remember, but it was usually pretty good, but it depends on the data.

Kaj

kajbja at 2007-7-13 3:23:13 > top of Java-index,Java Essentials,Java Programming...
# 2
Hufman's probably not the best thing for exe files. Try run length encoding first (exec files are full of zero bytes for a start).Hufman is really for text.
malcolmmca at 2007-7-13 3:23:13 > top of Java-index,Java Essentials,Java Programming...