BC7 BCPack: fit the last 34 endpoint preset slots #31

Manually merged
github merged 1 commit from gh-pr/31/head into gh-pr/31/base 2026-11-26 20:04:20 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-23 03:47 UTC · original
holdmysocks:claude/bc7-last-slots → master · +35 −35 · 2 files · 1 commits · merged 2026-11-23 04:01 UTC

With this, a decode of every BCPack chunk in the install (108,605 chunks, six codecs) leaves no unfitted block in any codec. Only the generated BC7 table file and one README passage change.

What was missing: 34 BC7 endpoint preset slots, reached only by textures with no plain neighbour mip: 839,119 blocks in 251 chunks (1.05 % of BC7 blocks; 17.7 % in the content-pack stores).

How they were fitted: against the library's own decode of the next smaller mip, in two passes (first only child mips that decode from fitted slots, 59 % of the blocks; then all), plus a small block-edge continuity term.

Why not edges alone: where every block of a texture starts from the slot, a constant offset per channel keeps all edges continuous. An edge-only fit left blue shifted by up to 129 levels.

mip 0 vs mip 1 on the 71 affected textures edge-only this PR
median 27.2 dB 33.4 dB
at 30 dB or better 27 53
under 20 dB 21 4

The four textures still under 20 dB did not move between passes, so their error has another cause (to be looked at with the existing-slot refinement).

Score on the 1,029 chunks with plain references is unchanged. Library tests pass.

**@⁠holdmysocks** on GitHub · 2026-11-23 03:47 UTC · [original](https://github.com/holdmysocks/SixNG/pull/31) `holdmysocks:claude/bc7-last-slots` → `master` · +35 −35 · 2 files · 1 commits · merged 2026-11-23 04:01 UTC With this, a decode of every BCPack chunk in the install (108,605 chunks, six codecs) leaves no unfitted block in any codec. Only the generated BC7 table file and one README passage change. **What was missing:** 34 BC7 endpoint preset slots, reached only by textures with no plain neighbour mip: 839,119 blocks in 251 chunks (1.05 % of BC7 blocks; 17.7 % in the content-pack stores). **How they were fitted:** against the library's own decode of the next smaller mip, in two passes (first only child mips that decode from fitted slots, 59 % of the blocks; then all), plus a small block-edge continuity term. **Why not edges alone:** where every block of a texture starts from the slot, a constant offset per channel keeps all edges continuous. An edge-only fit left blue shifted by up to 129 levels. | mip 0 vs mip 1 on the 71 affected textures | edge-only | this PR | |---|---|---| | median | 27.2 dB | 33.4 dB | | at 30 dB or better | 27 | 53 | | under 20 dB | 21 | 4 | The four textures still under 20 dB did not move between passes, so their error has another cause (to be looked at with the existing-slot refinement). Score on the 1,029 chunks with plain references is unchanged. Library tests pass.
The slots are reached only by textures with no plain neighbour mip
(839,119 blocks in 251 chunks, 1.05 % of BC7 blocks). They are fitted
against the library's own decode of the next smaller mip, in two passes:
first with child mips that decode from fitted slots only (59 % of the
blocks), then with all of them, with a small block-edge continuity term.

Edge continuity alone leaves a constant offset per channel undetermined
when every block of a texture starts from the slot; that fit left blue
shifted by up to 129 levels (mip 0 vs mip 1 median 27 dB, 21 of 71
textures under 20 dB). With the child-mip term: median 33.4 dB, 53 of 71
at 30 dB or better, 4 under 20 dB.

A decode of every BC7 chunk of the install (5,167) leaves no unfitted
block. The score on the 1,029 chunks with plain references is unchanged.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:04:18 +00:00
github manually merged commit 6b7d18924c into gh-pr/31/base 2026-11-26 20:04:20 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.