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

GPULZ stage — GPU LZSS (LZ77 + flag-bit literal/match coding) lossless byte-stream compressor. More...

#include "stage/stage.h"
#include "fzm_format.h"
#include "backend/types.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::GPULZStage
 

Namespaces

namespace  fz
 

Detailed Description

GPULZ stage — GPU LZSS (LZ77 + flag-bit literal/match coding) lossless byte-stream compressor.

Operates on a raw byte stream treated as word_size-byte words (1, 2, 4, or 8). The stream is split into fixed-size chunks (chunk_size, default 2048 bytes); each chunk is compressed independently by a single CUDA thread block that keeps the whole chunk resident in shared memory and searches a sliding window (32 words) for repeated word sequences, exactly as in the upstream GPULZ paper/reference implementation.

Output stream layout:

[uint32_t: original byte count]
[uint32_t: num_chunks]
[ (uint32_t flag_size, uint32_t data_size) x n_chunks ] // flag_size high bit -> chunk stored raw
[ per-chunk payload: flag bytes, then compressed-data bytes (or raw bytes if flagged) ... ]

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