Open
Conversation
This table provides best performance but may only be used reasonably for small bit lengths due to its memory cost. We'll implement a more space-efficient (but not as fast) MultiLookupHuffmanTable in a followup patch.
Member
|
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. |
Collaborator
Author
|
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. |
Member
|
Happy to review... could you look at the failing test first? |
9d85128 to
1cf92cf
Compare
Collaborator
Author
|
I've reworked the |
dominiccooney
requested changes
Oct 1, 2019
| /// | ||
| /// If `bit_len` is larger than the number of bits, the prefix is padded with | ||
| /// lower-weight bits into `bit_len` bits. | ||
| pub fn split_bits(&self, bit_len: BitLen) -> (u32, u32) { |
Member
There was a problem hiding this comment.
I'm not sure of the naming of split_bits versus split... Does this need both these APIs? Can the names be made more distinct?
Collaborator
Author
There was a problem hiding this comment.
I renamed it into split_raw_bits, is that better?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a first step towards decompressing Huffman content.