Skip to content

Releases

v2.1.5 BC4/5 improvements

Choose a tag to compare

@Geolm Geolm released this 14 Nov 17:00

v2.1.5

The focus of this release is improving BC4 flat/simple mask use cases. The font atlas in the test suite went from 1.7:1 to 2.4:1 for example. Since BC4 is often used for mask, font atlas, etc... I had to find solutions to improve those cases. There is no gain for noisy, normal map, complex ao case (not worst tho). BC3 and BC5 profits also, especially BC3 where the alpha channel is usually very simple. No change for BC1 (same as v1.0).

v2.0.0 — endpoint MTF-8 + static first-index model (BC4/BC5)

  • Optional per-channel endpoint MTF-8: instead of the two wrapped endpoint deltas, one 9-symbol rank into an 8-entry move-to-front list of the tile's recent distinct (endpoint0, endpoint1) pairs (rank 8 escapes to the deltas). Decided per channel by exact pricing in the first pass — atlas-style content with repeated pairs switches it on, natural textures keep the deltas.
  • Static first-index model: the block's first index is Rice-coded with a fitted 8-symbol model instead of a raw 3-bit field; the fitter's raw fallback self-gates, so a near-uniform first index costs the same as raw.
  • BC4 suite average 1.2839 → 1.3334 (+3.9%).

v2.1.0 — per-tile index-word dictionary (BC4/BC5)

  • A block whose 48-bit index word (six index bytes) repeats within the tile is replaced by one 256-symbol rank into a per-channel, per-tile move-to-front list of at most 255 distinct words; rank 255 escapes to the full payload. The decoder rebuilds the list from ranks alone — no lookup state.
  • Gated per tile by exact pricing in a third pre-pass (skipped hit payloads vs added rank symbols, under the fitted models); a channel with no enabled tile pays only a dummy model slot + its 8-byte tile word.
  • Font atlas 2.2396 → 2.4040; BC4 suite average → 1.3608.

Breaking changes

Both v2.0.0 and v2.1.0 extend the BC4/BC5 stream format (new model slots, the MTF flag in the flat-index header byte, the per-channel tile-enable word). Streams written by v1 do not decode with this release, and vice versa. The C API (bcp_compress_bc4/bc5, bcp_decompress_bc4/bc5, packed_bc4_maxsize/packed_bc5_maxsize) is unchanged; BC1 streams are untouched.

Notes

  • Verified lossless byte-exact on CPU and GPU (Metal, validation layers on), 51 unit tests incl. synthetic MTF/dictionary content classes.
  • Post-tag patches v2.1.1–v2.1.5: Linux GCC build fixes only, no format/API change.