Class MapCompressor

Namespace
CHDSharp.Encoder
Assembly
CHDSharpLib.dll

Compresses a CHD v5 hunk map using RLE and Huffman encoding.

public static class MapCompressor
Inheritance
MapCompressor
Inherited Members

Methods

Compress(MapEntry[], uint, uint, uint)

Compresses the hunk map entries into a compact binary representation.

public static byte[] Compress(MapEntry[] entries, uint hunkCount, uint hunkBytes, uint unitBytes)

Parameters

entries MapEntry[]

The array of map entries to compress. SELF entries must carry the source hunk index in Offset with CompLength and Crc16 set to zero; PARENT entries carry the parent unit index (0-based, in units) in Offset, likewise with zero length and CRC.

hunkCount uint

The number of hunks in the image.

hunkBytes uint

The size of each hunk in bytes.

unitBytes uint

The unit size in bytes.

Returns

byte[]

A byte array containing the compressed map data.