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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 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一区二区三区免费野_久草精品视频
欧美日韩一区三区| 91亚洲男人天堂| 婷婷开心久久网| 亚洲一卡二卡三卡四卡| 亚洲乱码国产乱码精品精98午夜 | 国产色91在线| 久久久不卡网国产精品二区| 2020国产成人综合网| 2024国产精品| 国产精品久久久久久久久免费相片 | 欧美日韩激情在线| 777午夜精品免费视频| 日韩一区二区三区在线| 欧美成va人片在线观看| 2022国产精品视频| 国产三区在线成人av| 亚洲国产精品av| 亚洲精品国产精华液| 亚洲午夜久久久久久久久电影网| 亚洲v日本v欧美v久久精品| 日韩精品成人一区二区三区| 狠狠久久亚洲欧美| av电影在线观看完整版一区二区| 日本福利一区二区| 欧美电影免费观看高清完整版在线| 久久伊99综合婷婷久久伊| 日韩美女视频一区二区 | 国产尤物一区二区| 不卡av在线免费观看| 欧美婷婷六月丁香综合色| 日韩美女视频在线| 国产精品区一区二区三区| 亚洲线精品一区二区三区八戒| 裸体健美xxxx欧美裸体表演| 成人午夜私人影院| 欧美一区二区人人喊爽| 欧美激情在线看| 日韩精品乱码av一区二区| 成人99免费视频| 日韩欧美亚洲国产精品字幕久久久 | 日韩一区二区三区免费观看| 中文字幕免费不卡| 日本成人在线一区| 色综合久久久久综合体| 精品国产一区二区三区不卡| 亚洲一本大道在线| a亚洲天堂av| 欧美成人性战久久| 首页综合国产亚洲丝袜| 99v久久综合狠狠综合久久| 精品国产第一区二区三区观看体验 | 91在线porny国产在线看| 欧美成人艳星乳罩| 日韩主播视频在线| 欧美性猛交xxxx乱大交退制版| 国产色综合久久| 精品一区二区三区av| 欧美高清激情brazzers| 亚洲制服丝袜av| 99精品一区二区| 亚洲欧洲一区二区在线播放| 国产精品亚洲第一区在线暖暖韩国 | 91视频www| 国产精品久久久99| 成人福利视频在线| 久久嫩草精品久久久久| 久久99国产精品尤物| 日韩视频在线你懂得| 午夜精品久久久久影视| 欧美日韩在线不卡| 亚洲高清免费观看高清完整版在线观看 | 国产不卡视频在线观看| 久久久青草青青国产亚洲免观| 成人av网址在线观看| 欧美精品一区二区三区一线天视频| 午夜日韩在线电影| 欧美一区二区三区思思人| 日韩和的一区二区| 日韩精品专区在线| 国产激情一区二区三区桃花岛亚洲 | 99精品视频中文字幕| 国产精品网站在线| 99久久精品国产导航| 国产精品国模大尺度视频| 97久久精品人人做人人爽50路| 综合激情网...| 在线观看日韩精品| 蜜臀精品一区二区三区在线观看 | 中文字幕一区二区在线播放| av电影在线观看一区| 一区二区三区中文字幕在线观看| 91久久一区二区| 日本美女一区二区| 国产日韩欧美激情| 99久久免费国产| 日韩av中文字幕一区二区三区 | 99国产一区二区三精品乱码| 亚洲免费成人av| 日韩精品一区二区三区蜜臀 | 亚洲免费资源在线播放| 欧美中文字幕一区| 国产一区二区福利视频| 亚洲另类春色国产| 日韩欧美视频一区| 99久久er热在这里只有精品15| 午夜精品一区二区三区电影天堂| 亚洲男人电影天堂| 91精品国产免费久久综合| 国产在线视视频有精品| 亚洲欧美日韩国产综合| 日韩视频在线永久播放| 一本久道久久综合中文字幕| 日本亚洲电影天堂| 综合久久久久综合| 精品人在线二区三区| 一本色道久久综合精品竹菊| 极品瑜伽女神91| 一区二区三区欧美日韩| 久久免费视频色| 欧美日韩一二区| 99精品欧美一区二区蜜桃免费 | 亚洲一区二区中文在线| 久久久久久电影| 欧美夫妻性生活| 91黄色免费版| 成人高清视频免费观看| 国产美女在线观看一区| 天堂午夜影视日韩欧美一区二区| 国产精品久久一级| 久久久久久久av麻豆果冻| 欧美一区二区三区啪啪| 色综合中文综合网| 国产在线不卡一区| 亚洲第一福利视频在线| 亚洲欧美自拍偷拍色图| 久久亚洲综合av| 欧美精品三级在线观看| 91国产免费看| 欧美一区二区播放| 欧美性极品少妇| 91亚洲男人天堂| 99国产精品久久久久久久久久久| 国产丶欧美丶日本不卡视频| 免费一级片91| 视频在线观看一区| 亚洲成人午夜电影| 天天操天天色综合| 婷婷夜色潮精品综合在线| 亚洲图片一区二区| 亚洲国产精品一区二区www在线| 中文字幕一区二区在线播放| 国产精品大尺度| 中文字幕一区二区三中文字幕| 中文字幕一区二区三区精华液| 欧美经典一区二区三区| 欧美国产亚洲另类动漫| 中文字幕精品在线不卡| 中文一区在线播放| 亚洲欧洲精品天堂一级| 亚洲男人天堂av网| 亚洲午夜久久久久久久久电影网| 亚洲一区二区三区在线| 婷婷国产v国产偷v亚洲高清| 亚洲a一区二区| 久88久久88久久久| 国产精品伊人色| 99久久久精品| 欧美高清激情brazzers| 欧美变态tickling挠脚心| 亚洲精品在线电影| 国产精品污www在线观看| 亚洲视频图片小说| 午夜私人影院久久久久| 毛片av中文字幕一区二区| 国产麻豆精品视频| 色综合久久久久综合体| 制服丝袜亚洲网站| 久久精品日韩一区二区三区| 国产精品久久三| 无码av免费一区二区三区试看| 久久99国产乱子伦精品免费| jvid福利写真一区二区三区| 在线观看av一区| 精品国产凹凸成av人网站| |精品福利一区二区三区| 日韩专区一卡二卡| 国产精品一区二区三区网站| 日本道免费精品一区二区三区| 日韩免费视频线观看| ...xxx性欧美| 久久99精品一区二区三区 | 亚洲美女视频一区| 美腿丝袜亚洲综合| 99热99精品| 欧美va日韩va| 一区二区三区在线观看欧美| 黑人巨大精品欧美一区| 日本高清成人免费播放| 欧美激情一区二区三区不卡| 日本亚洲电影天堂|