?? 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 + -