Expand description
CAVS-1 binary container format: types, writer and reader.
CAVS-1 (Content-Addressable Versioned Streaming, v1) is a packaging layer for game content (builds, packs, bundles, patches) — and, secondarily, video. It stores deduplicated, content-hashed chunks plus the tables needed to reconstruct the original files byte-for-byte (raw assets, or fMP4/CMAF segments and playlists when packaging video).
On-disk layout (little-endian throughout):
+-----------------------------+ offset 0
| Superblock (64 bytes) |
+-----------------------------+ offset 64
| DATA section (chunk bytes) | streamed while packing
+-----------------------------+
| TRACKS section |
| DICT section |
| CHUNKS section |
| SEGMENTS section |
| META section |
| INTEGRITY section |
+-----------------------------+
| Section directory | pointed to by the superblock
+-----------------------------+See FORMAT.md at the workspace root for the full byte-level spec.
Structs§
- Chunk
Record - Chunk-table record.
data_offsetis relative to the DATA section start. - Integrity
- Integrity section contents.
- Pack
Stats - Summary of a finished pack, for reporting.
- Reader
- Section
Entry - One entry of the section directory.
- Segment
Record - Segment-directory record. Reconstruction of the segment payload is the
ordered concatenation of the raw bytes of
chunks. - Superblock
- Superblock contents.
- Track
Record - Track-table record.
- Verify
Report - Result of a full-file verification pass.
- Writer
Enums§
- Format
Error - Section
Type - Section identifiers.
- Signature
Status - Outcome of a content-signature check.
- Track
Kind - Track kinds.
Constants§
- CHUNK_
FLAG_ ZSTD - Chunk flag bit: payload stored zstd-compressed.
- COMPRESSION_
NONE - Compression algorithm ids (superblock default and per-chunk flag).
- COMPRESSION_
ZSTD - MAGIC
- File magic: “CAVS”.
- MAX_
CHUNK_ RAW - Upper bound on a single chunk’s uncompressed size (256 MiB). Larger than any chunker’s max; used to cap decompression allocations from untrusted or corrupted files.
- SECTION_
DIR_ ENTRY_ LEN - Size of one section-directory entry: type(4) + offset(8) + len(8) + hash(32).
- SEGMENT_
FLAG_ RANDOM_ ACCESS - Segment flag bit: random-access point (keyframe bundle boundary).
- SUPERBLOCK_
LEN - Fixed superblock size in bytes.
- VERSION_
MAJOR - VERSION_
MINOR