compress

package
v0.0.0-...-7050c4f Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

compress/bwt.go

compress/chain.go

compress/compress.go

compress/huffman.go

compress/lzw.go

compress/rle.go

compress/shannon_fano.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BWTCompressor

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

func NewBWTCompressor

func NewBWTCompressor(blockSize int) *BWTCompressor

func (*BWTCompressor) Compress

func (bwt *BWTCompressor) Compress(data []byte) ([]byte, error)

func (*BWTCompressor) Decompress

func (bwt *BWTCompressor) Decompress(compressed []byte) ([]byte, error)

type CompressionChain

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

func NewCompressionChain

func NewCompressionChain(compressors ...Compressor) *CompressionChain

func (*CompressionChain) Compress

func (cc *CompressionChain) Compress(data []byte) ([]byte, error)

func (*CompressionChain) Decompress

func (cc *CompressionChain) Decompress(data []byte) ([]byte, error)

type Compressor

type Compressor interface {
	Compress(data []byte) ([]byte, error)
	Decompress(data []byte) ([]byte, error)
}

type Dictionary

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

func NewDictionary

func NewDictionary() *Dictionary

type HuffmanCompressor

type HuffmanCompressor struct{}

func NewHuffmanCompressor

func NewHuffmanCompressor() *HuffmanCompressor

func (*HuffmanCompressor) Compress

func (hc *HuffmanCompressor) Compress(data []byte) ([]byte, error)

func (*HuffmanCompressor) Decompress

func (hc *HuffmanCompressor) Decompress(compressed []byte) ([]byte, error)

type HuffmanHeap

type HuffmanHeap []*HuffmanNode

func (HuffmanHeap) Len

func (h HuffmanHeap) Len() int

func (HuffmanHeap) Less

func (h HuffmanHeap) Less(i, j int) bool

func (*HuffmanHeap) Pop

func (h *HuffmanHeap) Pop() interface{}

func (*HuffmanHeap) Push

func (h *HuffmanHeap) Push(x interface{})

func (HuffmanHeap) Swap

func (h HuffmanHeap) Swap(i, j int)

type HuffmanNode

type HuffmanNode struct {
	Char  byte
	Freq  int
	Left  *HuffmanNode
	Right *HuffmanNode
}

type LZWCompressor

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

func NewLZWCompressor

func NewLZWCompressor() *LZWCompressor

func (*LZWCompressor) Compress

func (lzw *LZWCompressor) Compress(data []byte) ([]byte, error)

func (*LZWCompressor) Decompress

func (lzw *LZWCompressor) Decompress(compressed []byte) ([]byte, error)

type RLECompressor

type RLECompressor struct{}

func NewRLECompressor

func NewRLECompressor() *RLECompressor

func (*RLECompressor) Compress

func (rc *RLECompressor) Compress(data []byte) ([]byte, error)

func (*RLECompressor) Decompress

func (rc *RLECompressor) Decompress(data []byte) ([]byte, error)

type SFNode

type SFNode struct {
	Symbol byte
	Freq   int
	Code   string
}

type ShannonFanoCompressor

type ShannonFanoCompressor struct{}

func NewShannonFanoCompressor

func NewShannonFanoCompressor() *ShannonFanoCompressor

func (*ShannonFanoCompressor) Compress

func (sf *ShannonFanoCompressor) Compress(data []byte) ([]byte, error)

func (*ShannonFanoCompressor) Decompress

func (sf *ShannonFanoCompressor) Decompress(compressed []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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