Just successfully solved the compression engine problem, and the next step is to embed it into my program to implement the compression function!
In the past few days, I've been surfing the Internet abroad and downloaded no less than dozens of sets of source codes! I've been shuttling through hundreds of files!
Finally found what I was looking for! Solved my problem
It's zlib!
The brief process is as follows:
1
Tried, the simple and old ones like
LZ, LZW, HUFFMAN, LZHUF, LZSS, LZHARC, LZ77, LZARI, LZRW1, etc., are not ideal. They are too old and inefficient, only suitable for teaching.
2
Looked at ARJ/UNARJ, there are many functions I don't want.
3
Once set on GZIP (BZIP2 is basically similar), it's very good, and I also think it's a bit suitable for me. The compression ratio and speed are both good, and there are compression ratio options from 1 to 9. I studied it for a few days and found that there is no in-memory compression, only file compression...
4
Saw a hint: zlib supports in-memory compression!
Decided on it!
(ZLIB and GZIP, PNG all use the same engine: a combination based on LZ77 and HUFFMAN. Of course, it's incomparable with the ancient and original versions mentioned earlier)
In this process, I contacted Li Zhi, the author of DDCOPY. Got the DDCOPY source code, which inspired me.
However, the compression of DDCOPY was not ideal. It took a long time and the compression ratio was low. Because the compression/decompression classes he used were relatively simple, just two files (using simple LZSS, the class written by Hu Yingzhuo, and later I also saw it on the Internet)
The compression engine to be adopted is the advanced latest version zlib-1.2.3 library (the same engine as GZIP, PNG images)
The compression ratio and compression speed are very fast, and the decompression speed is ridiculously fast!
In a WIN32 console program, compressing 50MB takes about 20 seconds, and compresses it to 25MB.
Decompression only takes about 3 seconds! Oh my god!
There are also compression ratio options from 1 to 9 (similar to GHOST)...
[ Last edited by GOTOmsdos on 2006-7-29 at 23:47 ]