|
FZGPUModules 2.0
GPU-accelerated modular compression pipelines
|
Header: modules/coders/rle/rle.h
Class: fz::RLEStage<T>
Category: Coder (lossless)
Run-length encoding. Lossless. Effective when data contains long runs of identical values — most useful after a predictor or quantizer stage that creates repetition.
Worst-case output is sizeof(uint32_t) + 2 × input_bytes (all elements are unique). RLEStage should only be used when the upstream stage reliably produces runs.
| Parameter | Constraint |
|---|---|
T | Element type (see available instantiations below) |
Only these types are compiled and linked — full 1/2/4/8-byte word-size coverage, matching the LC framework's RLE_1/2/4/8:
RLEStage<uint8_t> / RLEStage<int8_t>RLEStage<uint16_t> / RLEStage<int16_t>RLEStage<uint32_t> / RLEStage<int32_t>RLEStage<uint64_t> / RLEStage<int64_t>| Setter | Default | Meaning |
|---|---|---|
setChunkSize(bytes) | 0 | 0 = whole-array path. Non-zero cuts the input into independent chunks of bytes / sizeof(T) elements. Rounded down to a multiple of sizeof(T). |
Run detection and output packing are otherwise managed internally.
Whole-array mode:
Chunked mode (setChunkSize):
Run-length encoding is a standard lossless coding technique. This stage and its archive layout are original FZGPUModules code; no third-party implementation was copied. It is distributed under the repository's BSD-3-Clause license.