MCPcopy Index your code
hub / github.com/MROS/jpeg_tutorial / read_dht

Function read_dht

src/reader.rs:76–112  ·  view source on GitHub ↗

回傳值爲 (AC/DC, 編號, 霍夫曼表) 使用 hashmap 來儲存碼字與信源符號的對應關係 001 跟 1 雖然在編碼上代表不同含義,但是無法在數字上表示出來 必須再增加一個編碼長度的資訊,才能夠分辨開來,所以我將一個編碼表示爲一個 tuple 譬如說 001 使用 (3, 1) 來表示長度爲 3 ,數值爲 1 ,而 1 則用 (1, 1) 來表示長度爲 1 ,數值爲 1 有很多優化的方式,例如使用二元樹,但本處爲了程式碼清晰不優化

(reader: &mut BufReader<File>)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

data_readerFunction · 0.85

Calls 2

read_u8Function · 0.85
read_u16Function · 0.70

Tested by

no test coverage detected