Add skipbits and index to decodeiterator#252
Open
markmentovai wants to merge 1 commit into
Open
Conversation
be55d9e to
3a64aa4
Compare
skipbits makes it possible to skip a portion of a bitarray that does not participate in the prefix coding. index can be used to determine the position of an iterator within its associated bitarray.
3a64aa4 to
1c06960
Compare
Author
|
Updated. I’ve tested this with 3.8 now. |
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.
skipbitsmakes it possible to skip a portion of abitarraythat does not participate in the prefix coding.indexcan be used to determine the position of an iterator within its associatedbitarray.Motivation: I’m decoding a bit stream that’s prefix-encoded, but with each symbol aligned to a 2-bit boundary. I introduced
decodeiterator.indexto determine the current position within the bit stream, anddecodeiterator.skipbitsto advance the iterator to the start of the next symbol.skipbitsalso returns the skipped-over bits so that I can validate that all bits used for alignment are 0.I exposed the
decodeiteratorclass to provide a clean way to document the new method and data descriptor. Strictly speaking,decodeiteratordoesn’t need to be exposed in this way, but that left me wondering how to best provide its documentation.Documentation and tests are present, and tests pass.