{
  "slug": "frame-of-reference",
  "term": "Frame-of-reference encoding",
  "aliases": [
    "FOR encoding",
    "Frame of reference"
  ],
  "definition": "Frame-of-reference encoding represents integer values as offsets from a shared reference value, commonly a block minimum, so the offsets can use a reduced bit width.",
  "note": "Base: For 1000, 1001, 1003 and 1007, a base of 1000 leaves offsets 0, 1, 3 and 7. Three bits per offset give 12 payload bits; base, count, width and padding still need accounting. A constant block can use zero offset bits when its base and count are retained. [for-paper] [for-example]\n\nComposition: Parquet DELTA_BINARY_PACKED first computes adjacent differences, then subtracts the minimum difference in each block and packs residuals per miniblock. Its reference is a minimum delta, not a minimum original value. Counts, first value, block geometry and widths remain necessary decoding context. [parquet-delta]\n\nAccess: Recovering a plain FOR value is base plus offset once its block and metadata are located; this does not establish file-level constant-time access. Changing a base can change every reconstructed value without breaking the arithmetic. Terminology varies, and some FOR implementations use an implicit zero base. [for-paper] [for-example]\n\nArithmetic: Parquet requires two's-complement wraparound at the physical integer width for differences and reconstruction. The 64-bit transition from 2^63-1 to -2^63 therefore has wrapped delta 1, not the unbounded difference 1-2^64. [parquet-delta]",
  "related": [
    "bit-packing",
    "patched-frame-of-reference",
    "lossless-compression",
    "parquet"
  ],
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-17",
  "citations": [
    {
      "id": "for-paper",
      "title": "Lemire and Boytsov: Decoding billions of integers per second through vectorization, sections 2.6-2.8 and 5",
      "url": "https://arxiv.org/pdf/1209.2137v7",
      "accessed": "2026-11-17"
    },
    {
      "id": "parquet-delta",
      "title": "Apache Parquet: DELTA_BINARY_PACKED encoding",
      "url": "https://parquet.apache.org/docs/file-format/data-pages/encodings/#delta-encoding-delta_binary_packed--5",
      "accessed": "2026-11-17"
    },
    {
      "id": "for-example",
      "title": "Hesela: frame-of-reference arithmetic and exception example",
      "url": "https://hesela.com/analyses/compressed-archives-dictionary-dependencies/#frame-of-reference",
      "accessed": "2026-11-17"
    }
  ],
  "provenance": [
    "Primary-source synthesis plus a bounded signed-64-bit integer illustration; no native codec benchmark, format-compatibility claim or new empirical result."
  ]
}
