compression

package
v0.0.0-...-3a25cc1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DataMaxSize = 0x8000
View Source
const LengthBits = 4
View Source
const LiteralBits = 8
View Source
const MaxCoded = MaxUncoded + (1 << LengthBits)
View Source
const MaxUncoded = 2
View Source
const OffsetBits = 11

OffsetBits Number of bits for the Window offset. From this the WindowSize will be calculated In other LZSS implementations, this is usually set to 12

View Source
const WindowFillValue = 0x20

WindowFillValue Initial value to fill Window[0 : WindowInitialIndex] In other LZSS implementations, this is usually set to 0x20, but Window[] is filled entirely

View Source
const WindowInitialIndex = WindowSize - 0x10 - 1

WindowInitialIndex The windowIndex needs to be set to this before compression/decompression In other LZSS implementations, this is usually set to 0

View Source
const WindowSize = 1 << OffsetBits

Variables

This section is empty.

Functions

func FirmwareBlockCompress

func FirmwareBlockCompress(data []byte, exhaustive bool) (output []byte, err error)

func FirmwareBlockDecompress

func FirmwareBlockDecompress(data []byte) (output []byte, err error)

Types

type Window

type Window [WindowSize]byte

func CreateWindow

func CreateWindow() (t Window)

func (*Window) Find

func (t *Window) Find(windowIndex int, buf []byte, exhaustive bool) (offsetIndex, length int)

func (*Window) GetByte

func (t *Window) GetByte(offsetIndex int) byte

func (*Window) GetSet

func (t *Window) GetSet(offsetIndex, windowIndex, length int, buf []byte) (int, []byte)

func (*Window) GetSetByte

func (t *Window) GetSetByte(offsetIndex, windowIndex int) (int, byte)

func (*Window) Index

func (t *Window) Index(i int) int

func (*Window) Peek

func (t *Window) Peek(offsetIndex, length int, buf []byte) []byte

func (*Window) Set

func (t *Window) Set(windowIndex int, buf []byte) int

func (*Window) SetByte

func (t *Window) SetByte(windowIndex int, data byte) int

Jump to

Keyboard shortcuts

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