國
立
交
通
大
學
FGK
FGK dynamic compression algorithm support distributed
processing implementation of the system
FGK
FGK dynamic compression algorithm support distributed processing implementation of the system
Student
Chung-Cheng Hung
Advisor
Yu-Tai Ching
A Thesis
Submitted to Institute of Biomedical Engineering
College of Computer Science
National Chiao Tung University
in partial Fulfillment of the Requirements
for the Degree of
Master
in
Computer Science
June 2010
FGK
FGK
FGK
FGK
摘要
摘要
摘要
摘要
我們的研究目的是把一個複雜的運算,把它切割成較小的運算來做處理, 而較小的運算間再各自交給自己的處理器來做處理,如此可以免去單一運算所需 耗費的冗長的時間,而我們則是採取動態壓縮的演算法來面對我們傳輸所遇到的 問題,此種演算法有隨壓隨解的性質,可以先把解壓縮過後的資料來拿先做處理, 可以省去較多時間。 而我們還採取了網路傳輸的一些觀念,模擬多核心的架構,我們運用了 3~5 台的電腦來實做我們的系統架構,來達到我們的實驗需求,已獲得合理且有效的 實驗數據。FGK dynamic compression algorithm support distributed
processing implementation of the system
Student Chung-Cheng Hung Advisor Yu-Tai Ching
Institute of Biomedical Engineering
National Chiao Tung University
Abstract
Our aim is to a complex operation, it cut less computation to do processing, and smaller operations in their respective rooms to deal with their own processor to do so without having a single operator can spend the necessary the long time, and we are taking the dynamic compression algorithms to transmit the face of our problems, this algorithm has
properties of solutions with the pressure as can be first to come and collect the data after decompression do first processing, can save more time.
And we have also taken some ideas network transmission, analog multi-core architecture, we use the computer at 3 to 5 we implement our system architecture, to achieve our experimental needs, has been given a reasonable and effective experimental data .
在兩年多的日子裡,有著同學間彼此的照顧,實驗室間彼此的學習交流與成 長,讓我能在這段期間獲得良好的知識,與在交大這良好的學習環境中成長,感 謝教授的細心指導,批改與督促學生相關論文的完成與進度,感謝實驗室同學間 彼此的互相鼓勵,感謝清大的同學在實驗上給予指導和幫助,感謝台大的學長在 論文上的指點與指教,感謝中央的同學在修課上的幫助,在這些日子裡都有你們 的回憶在我心中,最後感謝家人在精神上與經濟上的支持,讓我能在這段日子中 有強烈的支持,讓我能在良好的學習環境中成長,在這裡感謝在這段期間有給我 溫暖的每一個師長、同學,謝謝你們 !
目錄
目錄
目錄
目錄
中文摘要 ………ii 英文摘要 ………iii 致謝 ………iv 目錄 ………v 第一章 緒論 ………1 1.1 簡介………1 1.2 論文架構………1 第二章 背景與理論基礎………2 2.1 前言………2 2.2 平行計算………3 2.3 Huffman 演算法介紹………5 2.4 FGK 演算法介紹………6 2.5 Gaussian filter 介紹………13 第 三 章 實 驗 實 作 流 程 … … … 1 4 3.1 實驗簡介………14 3.2 FGK 演算法………14 3.3 程式平行處理部分………20 3.4 檔案一切四和四合一部分………22 3.5 網路傳輸部分………23 3.6 即時動態壓縮影像系統總覽………24第四章 實驗結果分析………25 4.1 實驗簡介………25 4.2 實驗環境………25 4.3 實驗結果………26 第五章 結論與未來展望………38 參考文獻 ………39
圖表目錄
圖表目錄
圖表目錄
圖表目錄
1. .4 2. 4 3.(a)(b)(c) 104. symbol Dynamic Huffman tree 11
5.Gaussian filter 13 6. .22 7. .26 8. 27 9. 28 10. 29 11. 30 12. 30 13. 33 14. speedup 34
15. Recv Gaussian Total 36
1.1
2 4 server client client server1.2
2.1
, , processors , FGK Huffman 2-pass knuth FGK FGK FGK process2.2
CPU CPU
1.
CPU
2.3 Huffman
Huffman MIT David Huffman
Huffman Huffman 1. 2. 3. 4. 5. 1 0 6. 2 5 15 A 7 B 6 C 6 D 5 E Huffman
0 100 101 110 111 87bits
2.4 FGK
Faller Gallager Knuth
FGK t+1 (
t )
Knuth :
:
aj = j ; t = ; ut = ai1 ai2 ait t ; k = ; wj = aj ; lj = aj ; 1<=j k>=n 0<=wj<=t; : : (1) w1,w2 ,...wp (2) 2j-1 2 j ( ) 1 2 3 4 5 6
( ) 2.2-5 32 ( t=32 t ) 33 b 2 1 4 6 3 5 6 5,5,6 3 5 ( ) 10 ( ) 1.(a) 1.(b) 1 1 1.(b) 1.(c)
1.(c) 1 2
3.(a)(b)(c) k<n 0 0 0 2 0
3
4. symbol Dynamic Huffman tree
3 q
q
1 a b 8 9 4
2.5 Gaussian filter
(1)
(1) Gaussian
Gaussian Mask Mask Gaussian filter
Gaussian filter Gaussian
filter :
3.1
FGK process create
3.2 FGK
FGK Kunth Encode :Encode :
1. NYT node
short code NYT (1) leaf root
NYT node (2) short code
(3) update
2. : A
(1)
3. Update
code
FGK letter
:
Encode :1.Encode=> leaf root
update short code
decode
decode :
Decode=> root bit leaf decode
update decode
3.3
client port
server port port
5001 5002 5003 5004 server
:
3.4
4.10MB 50 pixel 0 : 6. 50pixel 0
overlapp
3.5
TCP FTP
client
Raw data byte network
server port data
3.6
:
一張原始的圖形 的檔案(.tif 檔) 把一張原始的檔 案切割成四個圖 檔來傳輸 經由 FGK 演算法 把四張圖先分別 做 Encode 且 client 端開始做 Decode 之後再把四張壓縮過 後的 Raw data 檔案, 傳到收端 client端等四個檔案同 時收齊之後,再接著做 處理 四張圖檔再同時進 行高斯處理的動作 之後四張經過高斯過 後的圖檔,經過 Encode 之後再傳送回來而 server端開始 Decode 等四個收到的檔收齊 Decode回來,把四張圖 overlapp的部分去掉 最後再合成一張經 過高斯過後的圖檔4.1
FGK (.tif) (.tif)4.2
Client : 1. CPU:Pentium 4 cpu 3.20 GHz 2. RAM:2.00 GB3. OS system:Microsoft Windows XP Professional Release mode 4. . Develoment environment: DevC++
Server :
2~4 server
4.3
1. : 2349 * 1823 4.10MB 7 (.tif) 7. 3.49MBFGK byte Raw data
server port port byte raw
byte Raw data server port
client byte Raw data
overlapp 8
2349*1823 9
10 :
10.
2349*1823 11
11.
1 2 1 4 : 4MB 49MB 110MB 196MB 306MB (s) 180 808 2113 3670 5793 Computer1 Gaussian(s) 11 42 117 162 254 Computer2 Gaussian(s) 38 123 233 392 609 Computer3 Gaussian(s) 20 103 112 208 317
Computer4 Gaussian(s) 13 97 167 371 471 Total time (s) 264 773 2650 3670 5793 Gaussian
Gaussian O(nk) K Gaussian kernel
n pixel speedup
operation
( Guassian ) delay delay
Delay 4 speedup 3104*4672 41.5MB 2349*1823 4.1MB 2349*1823 4.1MB 2349*1823 4.1MB
(s) 5921 1439 1278 1393 1 to 2 (s) 1650 373 352 329 1 to 2 speedup 3.58 3.86 3.63 4.23 1 to 4 (s) 1296 326 242 267 1 to 4 speedup 4.57 4.41 5.28 5.22 13. 0 1000 2000 3000 4000 5000 6000 7000 圖片 1 圖片 2 圖片 3 圖片 4 單一運算 1 to 2 運算 1 to 4 運算 所需花的時間統計 所需花的時間統計 所需花的時間統計 所需花的時間統計(S)
14. speedup 1 to 2 1 to 4 1 to 2 speedup 3.58 1 to 4 speedup 5.28 : 0 1 2 3 4 5 6 圖片 1 圖片 2 圖片 3 圖片 4 單一運算 1 to 2運算 1 to 4運算
4MB 49MB 110MB 196MB 306MB Computer1 Gaussian(s) 11 42 93 162 253 Computer2 Gaussian(s) 20 108 230 407 712 Computer3 Gaussian(s) 13 50 113 198 308 Computer4 Gaussian(s) 20 76 169 299 464 Total time (s) 47 180 422 843 1399 (s) 180 808 2113 3670 5793 speedup 3.83 4.49 5.00 4.35 4.14
15. Recv Gaussian Total
16. speedup 0 200 400 600 800 1000 1200 1400 1600 4MB 49MB 110MB 196MB 306MB G1 G2 G 3 G 4 Total 0 1 2 3 4 5 6 4M 49M 110M 196M 306M
speedup
speedup 所需花的時間統計 所需花的時間統計 所需花的時間統計 所需花的時間統計(S)1 to 4 4MB 306MB 3~5 speedup FGK
FGK process Huffman process FGK process
[1] R. G. GALLAGER. Variations on a theme by Huffman, IEEE Trans. Inform.
Theory IT-24 (1978). 668-674.
[2] D. E. KNUTH, Solution to problem E2307, Amer. Math. Monthly 79 (1972),
773-774.
[3] KNUTH, D. E. Dynamic Huffman coding. J. Algorithms 6 (1985), 163-180. [4] VIITER, J. S. Dynamic Huffman Coding. ACM Trans. Math. Sojlw. Submitted
1986.
[5] VITTER, J. S. Design and analysis of dynamic Huffman codes. J. ACM 34, 4
(Oct. 1987),825-845.
[6] BENTLEY, J. L., SLEATOR, D. D., TARJAN, R. E., AND WEI, V. K. A locally
adaptive data compression scheme. Commun. ACM 29,4 (Apr. 1986), 320-330.
[7] ELIAS, P. Interval and recency-rank source coding: Two online adaptive
variable-length schemes.IEEE Trans. InJ Theory. To be published.
[8]FALLER, N. An adaptive system for data compression. In Record ofthe 7th
Asilomar Conference on Circuits, Systems, and Computers. 1913, pp. 593-591
[9]VIITER, J. S., AND CHEN, W. C. Design and Analysis of Coalesced Hashing.
Oxford UniversityPress, New York, 1987.
[10]D. E. KNUTH, Solution to problem E2307, Amer. Math. Monthly 79 (1972),
[11]JEFFREY SCOTT VITTER “ALGORITHM 673 Dynamic Huffman Coding”
ACM Transactions on Mathematical Software, Vol. 15, No. 2, June 1989, Pages
158-167
[12] T.C. Bell J.G. Cleary and I.H. Witten Text Compression NJ: Prentice Hall
1990
[13]Ross N. Williams “Adaptive Data Compression”
[ 14 ] http://en.wikipedia.org/wiki/Speedup