Class MapCompressor
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
entriesMapEntry[]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.
hunkCountuintThe number of hunks in the image.
hunkBytesuintThe size of each hunk in bytes.
unitBytesuintThe unit size in bytes.
Returns
- byte[]
A byte array containing the compressed map data.