binast / binjs-ref

Reference implementation for the JavaScript Binary AST format
https://binast.github.io/binjs-ref/binjs/index.html
Other
431 stars 38 forks source link

Context 0.1: Huffman tables #454

Open Yoric opened 5 years ago

Yoric commented 5 years ago

This is a first step towards decompressing Huffman content.

xtuc commented 5 years ago

I think it LGTM. I'm wondering if you couldn't use an existing implementation on crates.io? Looking at the results https://crates.io/search?q=huffman, they doesn't seem commonly used tho.

Yoric commented 5 years ago

I've looked at a few crates and they all seemed to use actual trees to represent Huffman codes, which makes them very slow for our use case.

dominiccooney commented 4 years ago

Happy to review... could you look at the failing test first?

Yoric commented 4 years ago

I've reworked the MultiLookupHuffmanTable to remove some assumptions on the prefix bit length.