Documentation
¶
Overview ¶
Package boolcoder implements the VP9 boolean arithmetic coder — the entropy layer underneath every VP9 syntax element. This is the decoder (Reader) plus a matching encoder (Writer, see encoder.go) so the two can be roundtrip-tested bit-exactly without an external reference.
Probabilities are 8-bit: prob = P(bit == 0) scaled to 256 (so 128 ≈ 50/50). Original implementation of the standard range/probability arithmetic decoding described in the public VP9 specification (§9.2).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader decodes booleans from a VP9-coded byte slice.
func (*Reader) ReadLiteral ¶
ReadLiteral decodes an n-bit unsigned value MSB-first (equiprobable bits).
func (*Reader) ReadSigned ¶
ReadSigned decodes an n-bit magnitude followed by a sign bit (1 = negative).
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer is a VP9 boolean arithmetic encoder. It exists so the decoder can be roundtrip-tested bit-exactly (encode a sequence, decode it back, compare) with no external dependency. It implements the same split/renormalise arithmetic as the decoder, with standard carry-propagating byte emission.
func (*Writer) WriteLiteral ¶
WriteLiteral encodes an n-bit value MSB-first (equiprobable bits).