Class CdCompoundCodec

Namespace
CHDSharp.Encoder
Assembly
CHDSharpLib.dll

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

hunkBytes uint

Hunk size in bytes; must be a multiple of the CD frame size.

baseCodec IChdCodec

Codec for the data portion (frames × 2352 bytes).

subcodeCodec IChdCodec

Codec for the subcode portion (frames × 96 bytes).

Properties

Tag

The four-character codec tag (see CodecTags).

public abstract 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[]