Class CdCompoundCodec
Shared implementation for the CD compound codecs ('cdzl', 'cdlz', 'cdzs'), matching
MAME's chd_cd_compressor<BaseCompressor, SubcodeCompressor>: frames are
deinterleaved into a data portion (frames × 2352) and a subcode portion (frames × 96);
sectors with a valid sync header and ECC get their sync header + ECC cleared and a
bitmap bit set (the decompressor regenerates them). The result is
[ecc bitmap][2/3-byte base length][base compressed][subcode compressed].
public abstract class CdCompoundCodec : IChdCodec
- Inheritance
-
CdCompoundCodec
- Implements
- Derived
- Inherited Members
Constructors
CdCompoundCodec(uint, IChdCodec, IChdCodec)
Creates a CD compound codec for CD-sized hunks.
protected CdCompoundCodec(uint hunkBytes, IChdCodec baseCodec, IChdCodec subcodeCodec)
Parameters
hunkBytesuintHunk size in bytes; must be a multiple of the CD frame size.
baseCodecIChdCodecCodec for the data portion (frames × 2352 bytes).
subcodeCodecIChdCodecCodec for the subcode portion (frames × 96 bytes).
Properties
Tag
The four-character codec tag (see CodecTags).
public abstract uint Tag { get; }
Property Value
Methods
Compress(byte[])
Compresses a full hunk. Returns null when the codec does not reduce the size.
public byte[]? Compress(byte[] data)
Parameters
databyte[]
Returns
- byte[]