FPC
FPC is a lossless codec that predicts binary64 bit patterns and encodes their XOR residuals with byte-granular length codes.
Prediction: FPC combines a finite-context predictor with a differential predictor. The latter models integer differences between bit patterns, not floating-point subtraction. Decoder and encoder update both predictors from reconstructed values. [1]
Coding: Each value has a one-bit predictor selector and a three-bit length code. Residual payload lengths are 0, 1, 2, 3, 5, 6, 7 or 8 bytes. A residual needing four bytes therefore occupies five. Two selectors and length codes share one byte. [2]
Worked bytes: Residual 0x0000000012345678 needs four ordinary bytes but five coded payload bytes. Two such residuals need 11 bytes including their shared control byte, before stream or block headers. This is residual accounting, not an end-to-end compression ratio. [4]
Memory: The reference interface's level x allocates two tables totaling 2^(x+4) bytes, excluding buffers. At x=20 that is 16 MiB. The level controls predictor memory, not retained numerical precision. [3]
Relations
- related
- pFPC, fpzip, Lossless compression
Citations
- Burtscher and Ratanaworabhan: FPC, IEEE Transactions on Computers 58(1), 18-31 (2009), section 2
- The FPC Double-Precision Floating-Point Compression Algorithm and its Implementation, sections 2 and 4
- FPC 1.1: reference interface, table-size parameter and little-endian input restrictions
- Hesela: exact FPC residual costs and pFPC predictor-memory accounting
Sources & caveats
- The 2009 study evaluated thirteen scientific datasets on four older processor architectures; its throughput is not a current hardware guarantee. [1]
- The supplied reference interface requires little-endian binary64 input, with byte length divisible by eight. [3]
- The linked ledger checks coding arithmetic only; it is neither a complete FPC encoder nor a replication of the paper's experiments. [4]