FZGPUModules 2.0
GPU-accelerated modular compression pipelines
Loading...
Searching...
No Matches
rze_stage.h File Reference

Zero-Elimination Encoding stage — lossless byte-stream compressor. More...

#include "stage/stage.h"
#include "fzm_format.h"
#include <cuda_runtime.h>
#include <cstdint>
#include <cstring>
#include <stdexcept>
#include <string>
#include <unordered_map>
#include <vector>

Go to the source code of this file.

Classes

class  fz::RZEStage
 

Namespaces

namespace  fz
 

Detailed Description

Zero-Elimination Encoding stage — lossless byte-stream compressor.

Standalone port of the LC framework RZE component. Operates on a raw byte stream treated as word_size-byte words (1, 2, 4, or 8 → LC RZE_1/2/4/8; the _N suffix is the word size). Each chunk is processed independently:

  • Level 1 (ZE): compact non-zero words; emit a 1-bit-per-word bitmap.
  • The bitmap is then recursively RE-compressed (hierarchical 2048/256/32/4 byte levels), exactly as in the LC d_RZE<T> device function.

RZE is the zero-eliminating sibling of RREStage (which eliminates repeated values). Output stream layout (identical container to RREStage):

[uint32_t: original byte count]
[uint32_t: num_chunks]
[uint32_t × n_chunks: per-chunk compressed sizes (high bit → stored raw)]
[compressed chunk data...]

Serialized header (9 bytes): [0..3] chunk_size (uint32_t LE), [4] word_size (uint8_t), [5..8] cached_orig_bytes (uint32_t LE).