Class HuffCodec

Namespace
CHDSharp.Encoder
Assembly
CHDSharpLib.dll

MAME generic Huffman codec ('huff'), matching chd_huffman_compressor / huffman_8bit_encoder: the hunk is histogrammed, a canonical tree with codes of at most 16 bits is built (weight-scaled), the tree is exported Huffman-encoded via a 24-symbol/6-bit small tree, and the data follows. Decodable by CHDSharpLib's ChdReaders.Huffman and chdman.

public sealed class HuffCodec : IChdCodec
Inheritance
HuffCodec
Implements
Inherited Members

Properties

Tag

The four-character codec tag (see CodecTags).

public uint Tag { get; }

Property Value

uint

Methods

Compress(byte[])

Compresses a full hunk. Returns null when the codec does not reduce the size.

public byte[]? Compress(byte[] data)

Parameters

data byte[]

Returns

byte[]