arithmetic

package
v0.0.0-...-90a1d6d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2020 License: AGPL-3.0, AGPL-3.0-only Imports: 6 Imported by: 0

Documentation

Overview

Package arithmetic contains the jbig2 arithmetic decoder used to decode the jbig2 encoded segments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
	// ContextSize is the current decoder context size
	ContextSize          []uint32
	ReferedToContextSize []uint32
	// contains filtered or unexported fields
}

Decoder is the arithmetic Decoder structure, used to decode the jbig2 Segments.

func New

func New(r reader.StreamReader) (*Decoder, error)

New creates new arithmetic Decoder.

func (*Decoder) DecodeBit

func (d *Decoder) DecodeBit(stats *DecoderStats) (int, error)

DecodeBit decodes a single bit using provided decoder stats.

func (*Decoder) DecodeIAID

func (d *Decoder) DecodeIAID(codeLen uint64, stats *DecoderStats) (int64, error)

DecodeIAID decodes the IAID procedure, Annex A.3.

func (*Decoder) DecodeInt

func (d *Decoder) DecodeInt(stats *DecoderStats) (int32, error)

DecodeInt decodes the Integer from the arithmetic Decoder for the provided DecoderStats.

type DecoderStats

type DecoderStats struct {
	// contains filtered or unexported fields
}

DecoderStats is the structure that contains arithmetic decode context.

func NewStats

func NewStats(contextSize int32, index int32) *DecoderStats

NewStats creates new DecoderStats of size 'contextSize'.

func (*DecoderStats) Copy

func (d *DecoderStats) Copy() *DecoderStats

Copy copies the DecoderStats.

func (*DecoderStats) Overwrite

func (d *DecoderStats) Overwrite(dNew *DecoderStats)

Overwrite overwrites the codingContextTable from new DecoderStats 'dNew'.

func (*DecoderStats) Reset

func (d *DecoderStats) Reset()

Reset resets current decoder stats.

func (*DecoderStats) SetIndex

func (d *DecoderStats) SetIndex(index int32)

SetIndex sets current decoder stats 'index'.

func (*DecoderStats) String

func (d *DecoderStats) String() string

String implements Stringer interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL