Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pseudocode examples for Range Binary Values #242

Closed
wants to merge 1 commit into from
Closed

Add pseudocode examples for Range Binary Values #242

wants to merge 1 commit into from

Conversation

dwbuiten
Copy link
Contributor

@dwbuiten dwbuiten commented Oct 4, 2020

Addresses #230 and #231.

First pass at adding pseudocode for these (maybe a little rough). Please review.

I am particularily unsure that remaining_bits_in_bitstream() is the correct way to say "no bits left to read in the buffer".

CC: @michaelni @JeromeMartinez @dericed @mcr

```c
range = 0xFF00;
end = 0;
low = get_bits(16);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory, couldn't the bitstream be 1-byte long?
In my implementation of the range coder decoding I have something more like:

    range = 0xFF;
    end   = 0;
    low   = get_bits(8);
    refill();

(with refill() moved above this text)
The reference decoder does not handle a 1-byte Slice and in practice the specification currently prevents a so small Slice due to the count of fields in it, but in the future it could be the case.
Maybe we would update the spec at the same time as the reference decoder if a 1-byte Slice is possible in practice...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really have a strong opinion on the matter.

ffv1.md Outdated Show resolved Hide resolved
ffv1.md Outdated Show resolved Hide resolved
ffv1.md Outdated Show resolved Hide resolved
Addresses #230 and #231.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
@dwbuiten dwbuiten changed the title Add pseudocode exmaples for Range Binary Values Add pseudocode examples for Range Binary Values Oct 4, 2020
Copy link
Contributor

@dericed dericed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as well. @michaelni @mcr?

@michaelni michaelni closed this in 7f83e08 Oct 5, 2020
@dwbuiten dwbuiten deleted the pseudocode branch October 5, 2020 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants