適應性霍夫曼編碼

适应性霍夫曼编码(英語:Adaptive Huffman coding),又称动态霍夫曼编码Dynamic Huffman coding),是基於霍夫曼编码適自适应编码英语Adaptive coding技术。它允许在符号正在传输时构建代码,允许一次编码并适应数据中变化的条件,即随着数据流的到达,动态地收集和更新符号的概率频率)。一遍扫描的好处是使得源程序可以实时编码,但由于单个丢失会损坏整个代码,因此它对传输错误更加敏感。

霍夫曼編碼中,有個缺點是除了壓縮後的資料外,它還得傳送機率表給解碼端,否則解碼端無法正確地做解碼的工作。如果想要壓縮好一點,必須有更多的統計資料,但同時必須要送出更多的統計資料到解壓縮端。而適應性編碼可以利用已經讀過的資料機動的調整霍夫曼樹。適應性霍夫曼編碼中,演算法FGK的基本原則是根據兄弟性質(Sibling Property),由Gallager定義。


兄弟性質

一顆霍夫曼樹只是一棵在每個節點,包括樹葉與內節點,加上加權值的二元樹,除了樹根外,每一個節點都有一個兄弟節點與其共有一個父親節點。如果每一個節點可以按照加權值從小排列到大且每個節點又再自己的兄弟相鄰,稱為兄弟性質。修改、或更新一棵霍夫曼樹包括兩個步驟。第一個步驟是頻率次數的增加,先找到該葉子,把頻率加一,在往上找他的父親節點,也跟著加一,直到樹根皆照著此步驟。第二個步驟是如果增加加權值的動作使得兄弟性質不再滿足時,必須做調整的動作,藉由交換葉子改變頻率增加的順序,同時,交換位置後的父親節點加權值也要跟著更新,以此原則使之再度成為霍夫曼樹。

FGK演算法

在演算法FGK中,傳輸端與接收端同時動態的去改變霍夫曼樹,最初,解碼樹由單一葉子組成,稱之0端。0端是用來代表未出現過的訊息,當每一個訊息傳遞後,增加此訊息的出現頻率並調整霍夫曼樹保持兄弟性質。當有t個訊息傳遞後,之中有k個不同的訊息,代表此霍夫曼樹有k+1的葉子,k個葉子有訊息,1個代表0端。當下次傳遞新訊息時,此訊息夾帶未出現過的資訊,0端的葉子此時分成2片葉子,1片給新訊息,另一片為新的0端。

考慮適應性霍夫曼編碼的效能問題,更有效能的方法是確認編碼端不會浪費空間在不存在的符號上,一般的霍夫曼編碼容易做到是因為在建立霍夫曼樹之前,會統計所有的資料,就能先算出各訊息的頻率;相反的,適應性編碼不一樣,並不知資料出現的頻率,因此假設所有訊息長度都一樣是log_2⁡q個位元,伴隨著統計資料的增加,訊息的編碼長度會愈來愈短。但此方法有個缺點,在大部分情況會浪費許多空間,尤其在短訊息的情況,大部分未使用的符號會改變整個統計表,使得壓縮結果大打折扣。

舉例來說,符號源有256個符號,一開始的霍夫曼樹就有這256個符號,且加權值設為1,即使連續讀進16個e,也仍然需要四個位元以上來編碼e,因為其他沒出現的255個符號使得霍夫曼樹的調整速度變慢。

解決的方法可以一開始統計表都沒有東西,當訊息被讀進去時在加入到統計表內,假設一開始霍夫曼樹只有兩個符號,兩個符號加權值都是一,且都不改變,一個代表檔案結束,另一個符號較特別,如果辨識的符號,霍夫曼樹已經有了,就像上述正常的操作,如果霍夫曼樹沒出現過,先送出此符號,再送出此符號的ASCⅡ碼,最後將這個加入霍夫曼樹,設定加權值為1,調整霍夫曼樹。這種方法,如過訊息是連續16個e,除了第一個e是九個位元,後面的所有15個e都只需要一個位元表示。

Vitter演算法

編碼一樣是用樹狀結構表示,每個支點都有對應的權重及特定數字,數字從上到下、從左到右排列,權重要遵守兄弟性質,如果A是B的父親且B是C的父親,則

權重用來計算支點編碼及其小孩(底下的支點)的數量,一樣權重的胝點會形成一個區塊,要得到每個支點的編碼,在二進位樹上,傳輸所有從樹根到此支點的路徑,往右走就寫1,往左走就寫0。需要有系統且簡單的方式去表示還沒傳遞(NYT),可以使用字母去傳遞二進位數字,編碼跟解碼都是從一個有最大數字的樹根開始,當傳遞NYT時,必須傳遞編碼到NYT支點,接著是普遍的支點,當每一個符號都完成後,只要傳遞編碼到自己的葉子支點即可。

參考來源

  • 資料壓縮,戴顯權編著
  • Vitter's original paper: J. S. Vitter, "Design and Analysis of Dynamic Huffman Codes", Journal of the ACM, 34 (4), October 1987, pp 825–845.
  • J. S. Vitter, "ALGORITHM 673 Dynamic Huffman Coding", ACM Transactions on Mathematical Software, 15 (2), June 1989, pp 158–167. Also appears in Collected Algorithms of ACM.
  • Donald E. Knuth, "Dynamic Huffman Coding", Journal of Algorithm, 6 (2), 1985, pp 163-180.


Read other articles:

CheyTac Intervention Senapan runduk CheyTac Intervention M-200 Jenis senapan runduk Negara asal  Amerika Serikat Sejarah produksi Produsen CheyTac LLC Diproduksi 2001—sekarang Varian M-200 M-200 Karabin M-200 CIV (Sipil) M-200 RK M-310 SS (Single Shot) M-310 R (Repeater) Spesifikasi Berat 31 lb (14 kg) tanpa alat bidik optik (M-200) Panjang 53 in (1.34 m) (popor dibuka), 46¾ in (1.18 m) (popor digeser / ditutup) (M-200) Panjang laras 29 (73.7 cm) twist standar 1:13 (M-200),...

 

Ceragenia Ceragenia bicornis Klasifikasi ilmiah Kerajaan: Animalia Filum: Arthropoda Kelas: Insecta Ordo: Coleoptera Famili: Cerambycidae Genus: Ceragenia Ceragenia adalah genus kumbang tanduk panjang yang tergolong famili Cerambycidae. Genus ini juga merupakan bagian dari ordo Coleoptera, kelas Insecta, filum Arthropoda, dan kingdom Animalia. Larva kumbang dalam genus ini biasanya mengebor ke dalam kayu dan dapat menyebabkan kerusakan pada batang kayu hidup atau kayu yang telah ditebang. Re...

 

Election in Alabama Main article: 2020 United States presidential election 2020 United States presidential election in Alabama ← 2016 November 3, 2020 2024 → Turnout63.1% 3.7 pp   Nominee Donald Trump Joe Biden Party Republican Democratic Home state Florida Delaware Running mate Mike Pence Kamala Harris Electoral vote 9 0 Popular vote 1,441,170 849,624 Percentage 62.03% 36.57% County results Congressional district results Precinct results Trump &...

2009 Polish historical documentary film Było sobie miasteczko...Ruins of Polish Church in Kisielin today,film screenshotWritten byTadeusz Arciuch,Maciej WojciechowskiDirected byTadeusz Arciuch,[1]Maciej WojciechowskiNarrated byOlgierd ŁukaszewiczTheme music composerKrzesimir DębskiCountry of originPolandOriginal languagePolishProductionProducerAdam Kruk[2]CinematographyJan Paweł PełechEditorGrzegorz LiwińskiRunning time49 minutesOriginal releaseRelease2009 (2009) By...

 

أكاديمية لارونج غار البوذيةمعلومات عامةالبداية 19801880[1] الاسم الأصل གསེར་རྟ་བླ་རུང་ལྔ་རིག་ནང་བསྟན་སློབ་གླིང་ (بالتبتية) الدِّين نيينغما[1] المؤسس Khenpo Jigme Puntsok (en) البلد الصين تقع في التقسيم الإداري Nupzur (en) الإحداثيات 32°09′10″N 100°28′08″E / ࿯...

 

Famous CUHK graduatesShing-Tung Yau '69, mathematicianLap-Chee Tsui '72 & '74, geneticistSin Chung-kai '97, former Legislative Council memberSammy Leung '94, DJ, MC, and actorChow Chung-kong '81, chairman of Hong Kong Exchanges and ClearingCheung Man-kwong '78, former Legislative Council member This list of Chinese University of Hong Kong alumni includes notable graduates and non-graduate former students from the Chinese University of Hong Kong, a public research university in Shatin, Ho...

Building in New York City, United StatesThe Church of St. John ChrysostomGeneral informationArchitectural styleRomanesque RevivalTown or cityMorrisania, The Bronx, New York CityCountryUnited StatesCompleted1900 (for church);[1]1913 (for church interior)[2]1913 (Shrine of Our Lady of Lourdes)[2]ClientRoman Catholic Archdiocese of New YorkTechnical detailsStructural systemMasonry brick St. John Chrysostom's Church is a Roman Catholic parish church under the authority of ...

 

Voce principale: Vicenza Calcio. S.S. Lanerossi VicenzaStagione 1988-1989Sport calcio SquadraVicenza Calcio Allenatore Ernesto Galli (1ª-4ª) Battista Rota (5ª-30ª) Ernesto Galli (31ª-34ª) Presidente Gastone Celin Serie C13º Coppa ItaliaFase a gironi Coppa Italia Serie COttavi di finale Miglior marcatoreCampionato: Pizzi (16)Totale: Pizzi (17) StadioRomeo Menti 1987-1988 1989-1990 Si invita a seguire il modello di voce Indice 1 Stagione 2 Rosa 3 Calciomercato 4 Risultati 4.1 Serie C1 4...

 

Cyrillic letter Cyrillic letter HwePhonetic usage:/ħʷ/The Cyrillic scriptSlavic lettersАА̀А̂А̄ӒБВГҐДЂЃЕЀЕ̄Е̂ЁЄЖЗЗ́ЅИІЇꙆЍИ̂ӢЙЈКЛЉМНЊОО̀О̂ŌӦПРСС́ТЋЌУУ̀У̂ӮЎӰФХЦЧЏШЩꙎЪЪ̀ЫЬѢЭЮЮ̀ЯЯ̀Non-Slavic lettersӐА̊А̃Ӓ̄ӔӘӘ́Ә̃ӚВ̌ԜГ̑Г̇Г̣Г̌Г̂Г̆Г̈ҔҒӺҒ̌ӶД́Д̌Д̈Д̣Д̆ӖЕ̃Ё̄Є̈ԐԐ̈ҖӜӁЖ̣ҘӞЗ̌З̣З̆ӠИ̃ӤҊҚӃҠҞҜК̣ԚᴫЛ́ӅԮԒЛ̈ӍᵸН́ӉҢԨӇҤО̆О̃Ӧ...

Traditional Alsatian casserole dish BaeckeoffePlace of originFranceRegion or stateAlsaceMain ingredientsPotatoes, onions, mutton, beef, pork,[1] Alsatian white wine, juniper berries  Media: Baeckeoffe Another view of a baeckeoffe Baeckeoffe (English: baker’s oven)[2] is a casserole dish[3][4] that is typical in the French region of Alsace, situated on the border with Germany. In the Alsatian dialect, Baeckeoffe means baker's oven. It is a mix of slic...

 

German master builder and architect Matthäus Daniel Pöppelmann. Zwinger in Dresden, main work of Pöppelmann Monument to Matthaus Poppelmann, Dresden Castle Villa Schönfeld in Herford, Germany. Birthplace of Daniel Pöppelmann Matthäus Daniel Pöppelmann (1662–1736) was a German master builder and architect who helped to rebuild Dresden after the fire of 1685. His most famous work is the Zwinger Palace. Life Pöppelmann was born in Herford in Westphalia on 3 May 1662 the son of a sh...

 

Kereta khusus wanita pada KRL Commuter Line. Kereta khusus penumpang wanita adalah sebuah kereta penumpang yang digunakan khusus untuk wanita. Kereta penumpang tersebut telah ada di beberapa kereta di Jepang, India, Mesir, Iran, Brasil, Meksiko, Indonesia, Filipina, Malaysia, dan Uni Emirat Arab, sementara penumpang di beberapa negara lainnya belum diperkenalkan. Afrika Mesir Informasi lebih lanjut: Wanita di Mesir Di seluruh kereta Cairo Metro, dua kereta tengah (ke-4 dan ke-5) dari masing-m...

هذه المقالة عن المجموعة العرقية الأتراك وليس عن من يحملون جنسية الجمهورية التركية أتراكTürkler (بالتركية) التعداد الكليالتعداد 70~83 مليون نسمةمناطق الوجود المميزةالبلد  القائمة ... تركياألمانياسورياالعراقبلغارياالولايات المتحدةفرنساالمملكة المتحدةهولنداالنمساأسترالي�...

 

2020年夏季奥林匹克运动会波兰代表團波兰国旗IOC編碼POLNOC波蘭奧林匹克委員會網站olimpijski.pl(英文)(波兰文)2020年夏季奥林匹克运动会(東京)2021年7月23日至8月8日(受2019冠状病毒病疫情影响推迟,但仍保留原定名称)運動員206參賽項目24个大项旗手开幕式:帕维尔·科热尼奥夫斯基(游泳)和马娅·沃什乔夫斯卡(自行车)[1]闭幕式:卡罗利娜·纳亚(皮划艇)&#...

 

Translation of the Bible by Jerome Catholic Vulgate redirects here. For other uses, see Catholic Vulgate (disambiguation). VulgateTwo 8th-century Vulgate manuscripts: Codex Sangallensis 63 (left) and Codex Amiatinus (right). The Vulgate (/ˈvʌlɡeɪt, -ɡət/; also called Biblia Vulgata (Bible in common tongue), Latin: [ˈbɪbli.a wʊlˈɡaːta]), sometimes referred to as the Latin Vulgate, is a late-4th-century Latin translation of the Bible. The Vulgate is largely the work of Jerom...

Type of reference book This article is about the type of reference work. For the subnotebook computer, see Gateway HandBook. Pocket reference redirects here. For the all-purpose reference work by Thomas J. Glover, see Pocket Ref. Vademecum redirects here. For other uses, see Vademecum (disambiguation). A technician referring to an instructional handbook for the operation of a machine Early 20th century handbook for operating a motor car A handbook is a type of reference work, or other collect...

 

Submarine of the United States For other ships with the same name, see USS Edison. USS Thomas A. Edison History United States NameUSS Thomas A. Edison NamesakeThomas Edison (1847–1931) Ordered1 July 1959 BuilderElectric Boat Division of the General Dynamics Corporation Laid down15 March 1960 Launched15 June 1961 Sponsored byMrs. Madeleine Edison Sloane Commissioned10 March 1962 Decommissioned1 December 1983 Stricken30 April 1986 Motto Potentia Tenebras Repellendi (Power to Repel the Darknes...

 

Senator seumur hidup Rita Levi-MontalciniRita Levi-MontalciniLahir(1909-04-22)22 April 1909Torino, Kerajaan ItaliaMeninggal30 Desember 2012(2012-12-30) (umur 103)Roma, ItaliaKebangsaanItaliaAlmamaterSekolah Kedokteran Torino, Universitas TorinoDikenal atasFaktor pertumbuhan sarafPenghargaanPenghargaan Nobel dalam Fisiologi atau Kedokteran (1986) National Medal of Science (1987)Karier ilmiahBidangNeurologiInstitusiUniversitas Washington di St. Louis Rita Levi-Montalcini (22 April 1909...

この記事は検証可能な参考文献や出典が全く示されていないか、不十分です。出典を追加して記事の信頼性向上にご協力ください。(このテンプレートの使い方)出典検索?: 新くまのプーさん – ニュース · 書籍 · スカラー · CiNii · J-STAGE · NDL · dlib.jp · ジャパンサーチ · TWL(2013年4月) ポータル ディズニー 『新くまのプ...

 

Vascular blockage by air bubbles Medical conditionAir embolismOther namesGas embolismDrug injection can potentially be a cause for air embolisms.SpecialtyCritical care medicineSymptomsHypotension, headaches, vertigo, dizzinessComplicationsComaDurationRapidRisk factorsDivers, substance abuse, improper needle usage, decompression sickness An air embolism, also known as a gas embolism, is a blood vessel blockage caused by one or more bubbles of air or other gas in the circulatory system.[1&#...