arithmetic_coder

package
v0.0.0-...-0083697 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArithmeticCoder

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

func NewArithmeticCoder

func NewArithmeticCoder(num_bits int) *ArithmeticCoder

Constructs an arithmetic coder, which initializes the code range.

func (*ArithmeticCoder) SetVTable

func (self *ArithmeticCoder) SetVTable(v ArithmeticCoderVirtual)

func (*ArithmeticCoder) Shift

func (self *ArithmeticCoder) Shift()

Called to handle the situation when the top bit of 'low' and 'high' are equal.

func (*ArithmeticCoder) Underflow

func (self *ArithmeticCoder) Underflow()

Called to handle the situation when low=01(...) and high=10(...).

func (*ArithmeticCoder) Update

func (self *ArithmeticCoder) Update(freqs *frequency_table.FrequencyTable, symbol uint)

Updates the code range (low and high) of this arithmetic coder as a result of processing the specified symbol with the specified frequency table.

type ArithmeticCoderVirtual

type ArithmeticCoderVirtual interface {
	Shift()
	Underflow()
}

type ArithmeticDecoder

type ArithmeticDecoder struct {
	ArithmeticCoder
	// contains filtered or unexported fields
}

func NewArithmeticDecoder

func NewArithmeticDecoder(num_bits int, input bitstream.BitReader) *ArithmeticDecoder

func (*ArithmeticDecoder) Read

func (*ArithmeticDecoder) Shift

func (self *ArithmeticDecoder) Shift()

func (*ArithmeticDecoder) Underflow

func (self *ArithmeticDecoder) Underflow()

type ArithmeticEncoder

type ArithmeticEncoder struct {
	ArithmeticCoder
	// contains filtered or unexported fields
}

func NewArithmeticEncoder

func NewArithmeticEncoder(num_bits int, output bitstream.BitWriter) *ArithmeticEncoder

func (*ArithmeticEncoder) Finish

func (self *ArithmeticEncoder) Finish()

func (*ArithmeticEncoder) Shift

func (self *ArithmeticEncoder) Shift()

func (*ArithmeticEncoder) Underflow

func (self *ArithmeticEncoder) Underflow()

func (*ArithmeticEncoder) Write

func (self *ArithmeticEncoder) Write(freqs *frequency_table.FrequencyTable, symbol uint)

Jump to

Keyboard shortcuts

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