Decoder is the arithmetic Decoder structure, used to decode the jbig2 Segments.
type Decoder struct { // ContextSize is the current decoder context size ContextSize []uint32 ReferedToContextSize []uint32 // contains filtered or unexported fields }
func New(r bitwise.StreamReader) (*Decoder, error)
New creates new arithmetic Decoder.
func (d *Decoder) DecodeBit(stats *DecoderStats) (int, error)
DecodeBit decodes a single bit using provided decoder stats.
func (d *Decoder) DecodeIAID(codeLen uint64, stats *DecoderStats) (int64, error)
DecodeIAID decodes the IAID procedure, Annex A.3.
func (d *Decoder) DecodeInt(stats *DecoderStats) (int32, error)
DecodeInt decodes the Integer from the arithmetic Decoder for the provided DecoderStats.
DecoderStats is the structure that contains arithmetic decode context.
type DecoderStats struct {
// contains filtered or unexported fields
}
func NewStats(contextSize int32, index int32) *DecoderStats
NewStats creates new DecoderStats of size 'contextSize'.
func (d *DecoderStats) Copy() *DecoderStats
Copy copies the DecoderStats.
func (d *DecoderStats) Overwrite(dNew *DecoderStats)
Overwrite overwrites the codingContextTable from new DecoderStats 'dNew'.
func (d *DecoderStats) Reset()
Reset resets current decoder stats.
func (d *DecoderStats) SetIndex(index int32)
SetIndex sets current decoder stats 'index'.
func (d *DecoderStats) String() string
String implements Stringer interface.