|
 |
|
|
 |
|
|
First, thank for your code. But I don't known how to compress many files in a folder into one file compressed only, with extension of file is..., example: *.huf (similar as *.zip) . Program can allow you view files compressed in file *.huf and choice one file in that to uncompress it. It's similar Winzip or Winzar but it's simpler. Can you help me?.
|
| Sign In·View Thread·PermaLink | 1.50/5 (3 votes) |
|
|
|
 |
|
|
When i compiling the program, a header files is missing. I dont remember the exact header file that missing.It sound like Tab.h. How can i get it from u???
HelpMe
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi! I have downloaded the source code and compiled it and there is no header file missing. You should check it again (perhaps the author has updated the sources). Best regards, Christian.
I am in love with VC++
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
One thing I miss from my Java programming days it had a data stream filter that would perform streaming compression (I think with the lzw algorithm). This is the closest thing I've seen in the world of C++/MFC... could it be modified to work as a streaming filter?
Perhaps I will take a crack at it.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
It may not be possible to use the pure Huffman algorithm to do streaming compression, because Huffman needs to make two passes through the data.
The first pass is used to determine the frequency of each byte and build the tree. The second pass does the actual coding.
If you knew the approximate frequency distribution of your input, you could build the Huffman tree once, then reuse the same tree for later input streams. i.e. you would skip the first pass. This would give you streaming compression, but if the composition of your input streams changed, you would no longer get optimal compression.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
I would not use this for any real world problem as huffman compression is by no means the best compression algorithm. Huffman compression is used mostly in computer science and maybe math or statistics classes because it is not too difficult to implement compaired to good algorithms like lzw. I would take it more as a learning tool. The big reason why algorithms like lzw (and its variants) are so much better than huffman is that they compress strings of characters into a few bits while huffman only does this for a single character.
John
-- modified at 8:55 Friday 16th September, 2005
[EDIT] I would like to point out one thing that I did not mention here. The above statement is for lossless compression only as JPEG (original and not JPEG2000) does use huffman but it uses it in a lossy fassion. [/EDIT]
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
That is not true. Huffman has a higher compression capability than LZW because it fully makes use of the frequency distribution throughout the whole sample. LZW doesn't have an overview of the whole sample and therefore it is trying to produce a better compression as it goes along the way.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Ok how does the compression of this application compare to bzip2? LZMA? I will try this myself...
[EDIT] I tried the executable from this article, zip and 7zip on the file STLport-5.0-0409.tar which you should still be able to find on the internet. The following is a directory listing of the file compressed by several different programs. Huf is this implementation of huffman. 7z(ip) is LZMA. I assume everybody knows zip. The gz(ip) file was the original I had to run gunzip to get the tar file. I did not bother to do any furthur testing as I stopped after the huf result...
6/24/05 0:20 519,810 STLport-5.0-0409.7z 2/16/02 22:55 748,295 STLport-5.0-0409.tar.gz 6/24/05 0:22 748,415 STLport-5.0-0409.zip 6/24/05 0:23 3,333,596 STLport-5.0-0409.tar.huf 4/10/02 0:51 5,120,000 STLport-5.0-0409.tar
[/EDIT]
Anonymous wrote: because it fully makes use of the frequency distribution throughout the whole sample.
It does do that however because it compresses fixed sized block (of only a few bytes ) into a few bits. While LZW works with variable sized strings which can get much longer into the same few bits.
John
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
well, there's adaptive huffman compression, 2 methods: vitter and FGK, i've coded fgk, vitter is a pain in the ass to code, but compresses more the whole point to it is that adaptive huffman coding can be used for streaming, hope it helps
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
A creative idea! Implementing Huffman Coding in a class provides much convience for us. But I think compressing a string is more useful than compressing a file. Why not providing a class for compressing a string, then we, programmers , put them into a file by our addtional codes ?
NewGhost
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Thank you for your suggestion. But I don't understand you quite well. If what you suggest is to encode the string, and then write to the file. Then I think it is unsuitable. Because the encoding method is not efficient for small files, and even if for strings. But after all, thank you for your idea, it reminds me to find another way to think about the question. Thank you!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hello
I think that he wanna say is to take a buffer to huffman input and the output be a buffer to. Thus allow transmit the buffer over a socket by example ... (Sorry my english, is not my official language
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Nice article and nice interface. 
Would be possible to add a short explanation of how the huffman tree compression works. 
|
| Sign In·View Thread·PermaLink | 3.00/5 (6 votes) |
|
|
|
 |
|
|
The Huffman coding method is the based on the probabilities of occurence of symbols in the file. This version of coding method first reads the file byte by byte, and record the occurence of each symbol. Then sort the symbols. Then build the Huffman tree. So when a symbol occurs most frequently, we assign one bit to represent it, and two bits for the second frequently one,... and so on. So the file can be compressed. If you still can't understand, I recommend you to read a book about information theorem. It's easy to understand. OK, it's the codes' work to keep the bit stream in order. So we used recursion to impliment it. It takes a little time to understand it. But it does not matter, this algorithm is very classical, you just use it!
|
| Sign In·View Thread·PermaLink | 3.83/5 (6 votes) |
|
|
|
 |
|
|
hi you didn't mention any book about the algurithm of huffman coding please, tell me that, i need it to write it by MATLAB yours amirhosein am_semsar@yahoo.com
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
|
GetMinFreq Get the maximum frequency of the symbols in the source file. GetMaxFreq Get the minimum frequency of the symbols in the source file.
Spot the mistake!!!
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |