亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? lzwtut.htm

?? LZW compression example with java
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<title>LZW Compression Tutorial</title>
</head>

<body>
<b>LZW Compression Tutorial Version 1.01</b>
<hr>
<p>
By Martin Zolnieryk aka Hard Rock. <br>
A Stars Dev Company Production (c) 2004<br>
This Version: Aug 5,2004<br> 
Email: <a href ="matilto:hard_rock_2@yahoo.com"> Hard_rock_2@yahoo.com</a><br>
<br>
</p>
<p>
<b>ChangeLog</b>
<hr>
<b>Version 1.01</b>
<ul>
<li>Lots of Spelling/Grammer Error Fixes</li>
</ul>
<b>Version 1.0</b>
<ul>
<li>First Release</li>
</ul>

<b>Table of Contents</b>
<hr>
<p>
<ul>
	  <li><a href = "#intro">1. Introduction</a>
		  		 <ul>
				 <li>a. About</li>
 		  		 <li>b. Compression</li>
		  		 <li>c. LZW</li>
				 </ul>
      </li>
	
  	  <li><a href = "#compression">2. Compression</a>
		  		 <ul>
				 <li>a. Psuedo Code</li>
 		  		 <li>b. How it works</li>
		  		 <li>c. Table</li>
				 </ul>
      </li>
	  <li><a href = "#decompression">3. Decompression</a>
		  		 <ul>
				 <li>a. How it Works</li>
 		  		 <li>b. Psuedo Code</li>
		  		 <li>c. Example</li>
				 </ul>
      </li>
	  <li><a href = "#gif">4. The Gif</a>
		  		 <ul>
				 <li>a. What is it?</li>
 		  		 <li>b. The Gif Format</li>
		  		 <li>c. Psuedo Code</li>
				 <li>d. Advanced GIF Topics</li>
				 </ul>
      </li>
	  <li><a href = "#code">5. Source Code</a>
		  		 <ul>
				 <li>a. About</li>
 		  		 <li>b. Notes</li>
		  		 <li>c. C Code</li>
				 <li>d. Java Code</li>
				 </ul>
      </li>
	  <li><a href = "#ref">6. References/The End</a>
		  		 <ul>
				 <li>a. Bibliography</li>
 		  		 <li>b. Other Sources</li>
		  		 <li>c. Patent</li>
				 <li>d. Libraries/Tools Used</li>
				 <li>e. The End</li>
				 </ul>
      </li>
</ul>
</p>






<a name = "intro"><b>Introduction</b></a>
<hr><br>
<b>1a. About</b>
<p>
Hey, welcome to my first tutorial. I've decided to write this tutorial on compression, specifically LZW and GIF, as the majority of tutorials on this subject I found, were hard to understand, therefore I started this tutorial to hopefully fill that gap. Compression admittedly takes some time to master so I've tried to make things as simple as I could. Once you've learned it however, you'll find it really simple. I've included a little list of references at the end of the tutorial, so hopefully if I missed something, or you're still unclear, you have some places to look. And if anyone finds any errors in this tutorial, email them to me at <a href = "mailto:hard_rock_2@yahoo.com">hard_rock_2@yahoo.com</a> and I will fix them as soon as I can. If you don't find any errors, or enjoyed reading this, then email me anyway since I like feedback. Maybe you'll even motivate me to write more tutorials! Of course source code is included with this tutorial, with sources of C/C++ and Java.
</p>
<b>1b.Compression</b>
<p>
 Now let抯 start off. There are millions practical uses of compression, and a common one being the method of transferring data over the Internet. For that most Windows users use either .zip or self extracting/installing .exe files both of which are compressed. (These are not all of course; there are hundreds of compression formats). Now that we know how to use it and what it is, we can start!
</p>

<b>1c.LZW</b>
<p>
 The compression format that will be discussed in this tutorial, is Lempel-Ziv-Welch or LZW compression. Rather than fill you with a history of the format we'll get right down to how to use it within your own programs. Let's discuss LZW compression, how does it work? Basically LZW creates tables of strings while compressing/decompressing data, and then later outputs the ID of the string rather than the string itself saving space. Decompression reads this and it to build a table of strings as it reads, saving the compression from needing to write large string tables at the beginning of the file, thus making it very effective. If this confuses you, don't worry we have the whole tutorial to explain it, as well as many link to online references. Well let get started and focus on how it works, worrying about the technicalities later.
</p>

<a name = "compression"><b>Compression</b></a>
<hr><br>
<b>2a.Psuedo Code</b>
<p>
Now we will learn how to actually compress data! Wohooo! Are we excited yet? Let's show some simple pseudo code and then we'll dissect it to see how it works:

<br><br><b>Pseudo Code</b>
<pre>
Initialize String Table
Add next char from charstream to String_Buffer
START LOOP here
	get Next_Char from charstream
	if String_Buffer + Next_Char is in string table
		add Next_Char to String_Buffer
	else
		output code for String_Buffer
		add String_Buffer + Next_Char code to table
		clear String_Buffer and equal it to Next_Char
END LOOP when at end of charstream
</pre>
</p>
<b>2b.How it Works</b>
<p>
 Whoa, that looks sweet, it looks so easy! This is more or less how you'd actually do it, although there are a few minor gripes, but this is for explanation purposes only. Rather then try to explain piece by piece how it works, why not use an example?
Let say we have a set of words say:<br>
__________________________<br>
CatCatInTheHatAndTheRat  <br>
__________________________<br>
(This makes absolutely no sense I know, but it'll provide a good test bed for our code here, capitalization used to make reader friendly)<br>

Here are the steps are program would take:<br>
<ol>
<li>C is added to the String_Buffer.</li>
<li>Now it reads Next_Char, Next_Char = 'a', "Ca" and it is not in the string table so we output "C" to the file. "Ca" is given the code of 256 (0-255 are ASCII codes).</li>
<li>String_Buffer is now set to only equal Next_Char, "A"</li>
<li>Now it reads Next_Char, Next_Char = 't', "at" is not in string table so we output "a" to the file. "at" is given the code of 257.</li>
<li>Now it reads Next_Char, Next_Char = 'C', "tC" is not in string table so we output "t" to the file. "tC" is given the code of 258.</li>
<li>Whoa, Wait a second. Now when Next_Char is read, Next_Char = 'a', "Ca" and it is IN the string table! So now String_Buffer = "Ca"</li>
<li>Now it reads Next_Char, Next_Char = 't', "Cat" is not in string table so we output "256" to the file. "Cat" is given the code of 259.</li>
</ol>
This is basically how it would go on, until the entire file is complete! Cool eh! Now the Results are:<br>
__________________________________________<br>
CatCatInTheHatAndTheRat     (uncompressed)<br>
__________________________________________<br>
Cat256TInTheH257And263eR257 (compressed)<br>
__________________________________________<br>

Sweet huh? We dropped, what 4 whole bytes! But realize that because when you compress, you have to use more bits per character to write out everything in order to write a code. Here a minimum of 9 bits (up to code 511) is required so in reality we haven't dropped 4 bytes, using 9 bits we would have dropped a single byte. This type of compression is a lot more effective when you have a larger amount of data, so the overhead goes away and the compression really starts to work! But really, would you normally try compressing a 23 byte files? I think not. 
Still a little confused? Let抯 take a look at a table of values:
</p>
<b>2c. Table</b>
<p>
<pre>
String_	Next_	Code	Code	Output
Buffer	Char		Value
C	a	256	Ca	C
a	t	257	at	a
t	C	258	tC	t
Ca	t	259	Cat	256
t	I	260	tI	t
I	n	261	In	I
n	t	262	nt	n
T	h	263	Th	T
h	e	264	he	h
e	H	265	eH	e
H	a	266	Ha	H
at	a	267	atA	257
A	n	268	An	A
n	d	269	nd	n
d	T	270	dT	d
Th	e	271	Th	263
e	R	272	eR	e
R	a	273	Ra	R
at	-	---	---	257
</pre>
You have to only look at the table and see how easy it really is to use this compression, it抯 not that complicated right? And be sure to check out the source code to see exactly how it works! Right now let抯 march onto...
</p>

<a name = "decompression"><b>Decompression</b></a>
<hr><br>
<b>3a.How it works</b>
<p>
 Were moving along at blinding speed here!
Compression of course, can be pretty useless if you can抰 use the compressed data, and that's what decompression is for, so we can use that now compressed data, so lets get started. Remember those cool string tables you saw earlier aren't saved, so once again we'll have to generate them as we go. Also there is an exception we have to check for, is if a code is listed but not in the table, this usually happens with highly repetitive data, and is easily remedied. Let抯 get some pseudo-code and see what we have:
</p>
<b>3b. Pseudo Code</b>
<p>
<pre>
Initialize String Table
get First_Code from charstream
output First_Code
START LOOP here
	get Next_Code from charstream
	if Next_Code is NOT in the string table
		String_Buffer = translated First_code + 
    first byte of First_Code
	else
		String_Buffer = Translation of Next_Code
	add translated First_code + first byte of 
First_Code to the table
	First_Code = Next_Code
	output String_Buffer
END LOOP when at end of charstream
</pre>
I don't think there will be much explanation needed, now that you know how the compression algorithm works, it shouldn't be too difficult to decipher this code. Just remember that the compressor has already done all the work and we need to continue to build the string table both when compressing and decompressing data.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看www91| 国产91精品一区二区麻豆网站 | 精品国产制服丝袜高跟| 亚洲成av人影院| 欧美精品久久99| 日日夜夜免费精品视频| 日韩精品中文字幕在线不卡尤物| 免费的国产精品| 久久嫩草精品久久久久| k8久久久一区二区三区| 亚洲午夜精品在线| 欧美大肚乱孕交hd孕妇| 国产91丝袜在线18| 伊人婷婷欧美激情| 欧美一区二区三区在线观看| 精品无人区卡一卡二卡三乱码免费卡| 精品国产成人系列| 99精品在线观看视频| 午夜久久福利影院| 精品88久久久久88久久久| 99精品一区二区三区| 午夜精品福利一区二区蜜股av | 日韩女优视频免费观看| 国产99久久精品| 亚洲高清一区二区三区| xfplay精品久久| 在线日韩av片| 国产成人免费av在线| 亚洲图片欧美色图| 中文字幕欧美三区| 欧美少妇一区二区| 成人午夜av在线| 视频在线观看一区| 中文字幕一区av| 欧美精品一区二区三区高清aⅴ| 色综合久久精品| 久久机这里只有精品| 亚洲综合丝袜美腿| 国产日韩欧美激情| 日韩一区二区电影在线| 91在线观看高清| 国产精品一区二区在线观看不卡 | 欧美午夜宅男影院| 国产精品影视网| 免费的国产精品| 亚洲一区在线视频观看| 日本一区二区综合亚洲| 欧美一级久久久| 91成人免费电影| 不卡视频一二三| 国产剧情在线观看一区二区| 亚洲成在人线免费| 亚洲综合在线电影| 亚洲三级久久久| 国产精品女同互慰在线看| 欧美成人vr18sexvr| 欧美日韩高清一区二区不卡| 99re66热这里只有精品3直播| 国精品**一区二区三区在线蜜桃| 午夜久久久影院| 午夜欧美在线一二页| 亚洲精品日韩一| 亚洲青青青在线视频| 日本一区二区三区视频视频| 欧美mv日韩mv国产| 91精品婷婷国产综合久久竹菊| 在线观看91视频| 色哟哟国产精品| 成人一级视频在线观看| 国产尤物一区二区| 国产尤物一区二区| 韩国成人福利片在线播放| 麻豆精品视频在线| 奇米一区二区三区av| 亚洲www啪成人一区二区麻豆 | 欧美tk—视频vk| 精品国产一区二区三区四区四| 在线成人av网站| 欧美老肥妇做.爰bbww视频| 欧美在线影院一区二区| 色欲综合视频天天天| 日本精品一区二区三区高清 | 福利91精品一区二区三区| 国产乱色国产精品免费视频| 国产一区二区三区四区五区入口 | 国产在线国偷精品免费看| 美女爽到高潮91| 国精产品一区一区三区mba桃花 | 色老汉一区二区三区| 成人三级在线视频| 成人av在线看| 91亚洲男人天堂| 欧美亚洲愉拍一区二区| 欧美伦理影视网| 日韩一区二区三区免费看| 欧美一区二区成人6969| 欧美va亚洲va| 久久久久久免费| 国产午夜精品一区二区三区视频| 久久亚洲精华国产精华液| 久久先锋资源网| 中文字幕一区在线观看视频| 亚洲欧美视频在线观看视频| 亚洲欧美日韩国产另类专区| 亚洲国产精品尤物yw在线观看| 亚洲国产成人91porn| 美女国产一区二区三区| 国产成人精品www牛牛影视| www.亚洲精品| 日韩欧美在线123| 国产精品久久久久久久午夜片| 一区av在线播放| 国产综合久久久久久鬼色| 99久久国产综合精品麻豆| 在线不卡欧美精品一区二区三区| 欧美日韩一区久久| 精品国产a毛片| 亚洲图片激情小说| 视频在线观看91| 成人综合激情网| 6080国产精品一区二区| 亚洲国产高清在线| 蜜桃av一区二区三区电影| 成人h精品动漫一区二区三区| 欧美日韩国产大片| 成人免费在线播放视频| 麻豆国产精品777777在线| 91亚洲男人天堂| 久久久久高清精品| 亚洲高清视频在线| 成人av资源站| 欧美精品一区二区精品网| 亚洲第一狼人社区| 国产成人av电影| 日韩欧美综合一区| 一区二区三区资源| 国产高清精品久久久久| 538prom精品视频线放| 成人免费在线播放视频| 激情小说亚洲一区| 欧美日韩一本到| 亚洲色图欧美激情| 福利视频网站一区二区三区| 日韩免费观看高清完整版| 亚洲私人黄色宅男| 国产成人精品一区二区三区四区 | 色婷婷一区二区三区四区| 精品久久99ma| 欧美aaa在线| 欧美精三区欧美精三区| 亚洲欧洲日本在线| 成人性色生活片| 国产欧美一区二区三区在线老狼| 久久99精品一区二区三区三区| 精品1区2区3区| 亚洲日本在线看| 91丨porny丨在线| 中文字幕亚洲综合久久菠萝蜜| 国产成人亚洲综合a∨猫咪| 亚洲精品视频自拍| gogogo免费视频观看亚洲一| 精品国产伦一区二区三区观看方式| 午夜精品福利在线| 欧美日韩久久久一区| 夜夜亚洲天天久久| 91极品视觉盛宴| 一区二区三区在线视频观看58| 97精品视频在线观看自产线路二| 国产精品情趣视频| 大胆亚洲人体视频| 久久精品在线观看| 国产91丝袜在线观看| 国产精品久久久久久妇女6080| 成人国产精品免费观看视频| 久久九九影视网| 成人性生交大片免费看视频在线| 中文字幕一区二区日韩精品绯色| 99久久精品免费观看| 亚洲欧美日韩国产另类专区| 欧美中文字幕不卡| 日韩成人免费在线| 久久综合国产精品| 97国产一区二区| 亚洲激情男女视频| 5566中文字幕一区二区电影| 久久国产三级精品| 国产精品美女久久福利网站| 色综合中文字幕国产| 国产精品久久三区| 欧洲av一区二区嗯嗯嗯啊| 五月婷婷综合在线| 2020国产精品| 97精品久久久久中文字幕| 亚洲成人激情av| 欧美精品一区二区三区很污很色的 | 91国偷自产一区二区开放时间| 水蜜桃久久夜色精品一区的特点| 精品久久久久久久久久久久久久久久久 | 亚洲人成影院在线观看| 色综合色狠狠综合色|