fpzip
fpzip is a predictive codec for spatially correlated floating-point arrays that supports lossless encoding and optional low-bit truncation.
Mechanism: A scan through a regular array predicts each value from previously reconstructed neighbors, then encodes a correction in a mapped integer representation. The 1.3.0 build selects floating-point or integer prediction arithmetic. [3]
Precision: The prec field counts retained representation bits, not mantissa bits. For binary32, prec=24 preserves one sign bit, eight exponent bits and 15 stored fraction bits. For binary64, prec=32 leaves 20 stored fraction bits. Zero selects full precision. [1] [2]
Range: Version 1.3.0 accepts 2-32 bits for binary32 and even counts from 4-64 for binary64, plus zero. Below 9 or 12 respectively, truncation reaches the exponent. This is neither an absolute-error target nor a fixed compressed size. [1] [2]
Observed bytes: An eight-value binary32 fixture takes 36 bytes at prec=9 but 37 at prec=8, including the stream header. Reduced precision need not reduce every small stream. The full-precision fixture takes 59 bytes for 32 raw bytes; this is a constructed example, not a workload estimate. [4]
Relations
- related
- FPC, Lorenzo predictor, Lossless compression, zfp
Citations
- fpzip 1.3.0: API precision range, headers and floating-point portability
- fpzip 1.3.0: representation mapping and bit truncation
- fpzip 1.3.0: scan order, predictor modes and encoded corrections
- Hesela: fpzip precision ledger and exact-arithmetic Lorenzo examples
Further reading
Sources & caveats
- Pinned fpzip 1.3.0, FPZIP_FP_SAFE, GNU 13.3.0; sixteen constructed configurations agree byte-for-byte between Release and Debug.
- The native probe covers finite binary32/binary64 values and signed zeros. It does not establish cross-platform compatibility or cover infinities, NaNs and subnormals.
- Prediction arithmetic and format compatibility depend on build configuration; decoding requires the matching metadata and codec. [1]