BC6H BCPack: fix speckles after one-region to two-region mode changes #15
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/holdmysocks--SixNG!15
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/15/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@holdmysocks on GitHub · 2026-11-22 20:28 UTC · original
holdmysocks:claude/bc6-mode-change→master· +158 −134 · 3 files · 1 commits · merged 2026-11-22 20:43 UTCFixes the speckles in BC6H BCPack textures where the reference chain changes BC6H mode.
Cause. When a one-region block (modes 11–14) is followed by a block that predicts from it in a two-region mode, the region-1 first endpoint (y) predicted from the wrong state. The decoder copied w into the y state. For transformed one-region modes the encoder instead leaves w written into the y field's delta width, offset by half its range:
y_state = (w << (16 - delta_bits)) ^ 0x8000. Untransformed mode 11 (10-bit) still copies w.How it was found. Endpoint-only scoring is lenient on y, so earlier analyses could not see it. Fitting each mode-change block's endpoints with its decoded indices against the parent mip showed that the gross errors were y alone. After one-region parents, the implied y prediction matched the new rule in 96 % of cases, against 22 % for the copy. With the fix, y predictions on mode changes into two-region modes match in 98.6 % of clean cases.
Results (preset tables refitted under the new rule; textures with a plain neighbour mip):
Adds a unit test for the new state rule and updates the module doc and README.