📄 lzss.htm
字号:
<html><head><meta http-equiv=Content-Type content="text/html; charset=gb2312"><meta name=GENERATOR content="Microsoft FrontPage 4.0"><meta name="Microsoft Border" content=none><title>对LZSS压缩算法的深入应用</title></head><body><p align=center><big><big><big><font face=楷体_GB2312 color=#FF0000>对</font><font
color=#FF0000 face=Arial>LZSS</font><font face=楷体_GB2312 color=#FF0000>压缩算法的深入应用</font></big></big></big></p><p align=left><font color=#000000><span
style=font-family:宋体,宋体;font-size:15> 本文所提供的程序分两个文件:LZSS.H与LZSS.CPP,在编程时加入#include"LZSS.H"语句以申明LZSS压缩程序的存在,在编译时将LZSS.CPP连入一起进行编译。</span></font></p><p align=left><font color=#000000><span
style=font-family:宋体,宋体;font-size:15> 这套程序的使用相当简单,完全以C++的类形式书写。下面讲述如何使用这一程序。</span></font></p><p align=left><font color=#000000><span
style=font-family:宋体,宋体;font-size:15>一、压缩数据,本程序提供了三个压缩入口,格式如下:</span></font></p><ol><li><p align=left><em><B><font face="Times New Roman">unsigned long Compress(unsigned char *InData,unsigned long Size,unsigned char *OutData)</font></B></em><font
color=#000000><span style=font-family:宋体,宋体;font-size:15><br>输入数据:</span></font><em><B><font face="Times New Roman">InData</font></B></em><font
color=#000000><span style=font-family:宋体,宋体;font-size:15>,压缩前的数据内存指针<br> </span></font><em><B><font face="Times New Roman">Size</font></B></em><font
color=#000000><span style=font-family:宋体,宋体;font-size:15>,压缩前的数据长度,以字节为单位<br> </span></font><em><B><font face="Times New Roman">OutData</font></B></em><font
color=#000000><span style=font-family:宋体,宋体;font-size:15>,压缩后保存数据用的内存指针(必须是已分配好内存了)<br>输出数据:压缩后的数据长度,以字节为单位</span></font></p></li><li><p align=left><font face="Times New Roman"><em><B>unsigned long Compress(unsigned char *InData,unsigned long Size,FILE *OutFile)</B></em></font><font color=#000000><span
style=font-family:宋体,宋体;font-size:15><br>输入数据:</span></font><em><B><font face="Times New Roman">InData</font></B></em><font
color=#000000><span style=font-family:宋体,宋体;font-size:15>,压缩前的数据内存指针<br> </span></font><em><B><font face="Times New Roman">Size</font></B></em><font
color=#000000><span style=font-family:宋体,宋体;font-size:15>,压缩前的数据长度,以字节为单位<br> </span></font><em><B><font face="Times New Roman">OutFile</font></B></em><font
color=#000000><span style=font-family:宋体,宋体;font-size:15>,压缩后用于数据输出的文件指针<br>输出数据:压缩后的数据长度,以字节为单位</span></font></p></li><li><p align=left><font face="Times New Roman"><em><B>unsigned long Compress(FILE *InFile,unsigned long Size,FILE *OutFile)<br></B></em></font><font color=#000000><span
style=font-family:宋体,宋体;font-size:15>输入数据:</span></font><em><B><font
face="Times New Roman">InFile</font></B></em><font color=#000000><span
style=font-family:宋体,宋体;font-size:15>,压缩前的文件指针<br> </span></font><em><B><font face="Times New Roman">Size</font></B></em><font
color=#000000><span style=font-family:宋体,宋体;font-size:15>,压缩前的数据长度,以字节为单位<br> </span></font><em><B><font face="Times New Roman">OutFile</font></B></em><font
color=#000000><span style=font-family:宋体,宋体;font-size:15>,压缩后用于数据输出的文件指针<br>输出数据:压缩后的数据长度,以字节为单位</span></font></p></li></ol><p align=left><font color=#000000><span
style=font-family:宋体,宋体;font-size:15>二、解压数据,同压缩入口一样,本程序提供三个解压入口,格式如下:</span></font></p><ol><li><p align=left><em><B><font face="Times New Roman">unsigned long UnCompress(unsigned char *InData,unsigned long Size,unsigned char *OutData)<br></font></B></em><font color=#000000><span
style=font-family:宋体,宋体;font-size:15>输入数据:</span></font><em><B><font
face="Times New Roman">InData</font></B></em><font color=#000000><span
style=font-family:宋体,宋体;font-size:15>,解压前的数据内存指针<br> </span></font><em><B><font face="Times New Roman">Size</font></B></em><font
color=#000000><span style=font-family:宋体,宋体;font-size:15>,解压前的数据长度,以字节为单位<br> </span></font><em><B><font face="Times New Roman">OutData</font></B></em><font
color=#000000><span style=font-family:宋体,宋体;font-size:15>,解压后保存数据用的内存指针(必须是已分配好内存了)<br>输出数据:解压后的数据长度,以字节为单位</span></font></p></li><li><p align=left><em><B><font face="Times New Roman">unsigned long UnCompress(FILE *InFile,unsigned long Size,unsigned char *OutData)</font></B></em><br><font color=#000000><span style=font-family:宋体,宋体;font-size:15>输入数据:</span></font><em><B><font
face="Times New Roman">InFile</font></B></em><font color=#000000><span
style=font-family:宋体,宋体;font-size:15>,解压前的文件指针<br> </span></font><em><B><font face="Times New Roman">Size</font></B></em><font
color=#000000><span style=font-family:宋体,宋体;font-size:15>,解压前的数据长度,以字节为单位<br> </span></font><em><B><font face="Times New Roman">OutData</font></B></em><font
color=#000000><span style=font-family:宋体,宋体;font-size:15>,解压后保存数据用的内存指针(必须是已分配好内存了)<br>输出数据:解压后的数据长度,以字节为单位</span></font></p></li><li><p align=left><em><B><font face="Times New Roman">unsigned long UnCompress(FILE *InFile,unsigned long Size,FILE *OutFile)</font></B></em><br><font color=#000000><span style=font-family:宋体,宋体;font-size:15>输入数据:</span></font><em><B><font
face="Times New Roman">InFile</font></B></em><font color=#000000><span
style=font-family:宋体,宋体;font-size:15>,解压前的文件指针<br> </span></font><em><B><font face="Times New Roman">Size</font></B></em><font
color=#000000><span style=font-family:宋体,宋体;font-size:15>,解压前的数据长度,以字节为单位<br> </span></font><em><B><font face="Times New Roman">OutData</font></B></em><font
color=#000000><span style=font-family:宋体,宋体;font-size:15>,解压后用于数据输出的文件指针<br>输出数据:解压后的数据长度,以字节为单位</span></font></p></li></ol><p>程序下载:<a href=LZSS.H target=_blank>LZSS.H</a>、<a
href=LZSS.CPP target=_blank>LZSS.CPP</a></p><p> 本程序若有算法上的问题请不要问我,若有其它方面的问题可写在留言本上或来<a href="mailto:hyz@elong.com">E-mail</a>。</p></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -