fse

package
v0.0.0-...-e60ae61 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package fse provides Finite State Entropy encoding.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIncompressible = errors.New("input is not compressible")
	ErrUseRLE         = errors.New("input is single value repeated")
)

Compression sentinel errors.

Functions

func Compress

func Compress(in []byte, s *Scratch) ([]byte, error)

Compress returns the FSE-compressed form of in.

func Decompress

func Decompress(b []byte, s *Scratch) ([]byte, error)

Decompress returns the FSE-decompressed form of b.

Types

type Scratch

type Scratch struct {
	Out             []byte
	DecompressLimit int

	MaxSymbolValue uint8
	TableLog       uint8
	// contains filtered or unexported fields
}

Scratch holds reusable state for FSE compression and decompression.

func (*Scratch) Histogram

func (s *Scratch) Histogram() []uint32

Histogram returns the symbol count histogram.

func (*Scratch) HistogramFinished

func (s *Scratch) HistogramFinished(maxSymbol uint8, maxCount int)

HistogramFinished marks the histogram as externally populated.

Jump to

Keyboard shortcuts

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