Repository navigation
Equal endpoints - #7
Merged
Merged
Conversation
…: a block whose two endpoint colors match carries a uniform index word (all 16 indices equal). a per-stream (BC1) / per-channel (BC4/BC5) flat index mode, decided once in the first pass, collapses it: mode 1 is selected when at least one block has identical endpoints and every such block has uniform indices, else mode 0. in mode 1 a flat block stores a single index value (2 bits for BC1, 3 bits per channel for BC4/BC5), expanded to all 16 indices on decode, instead of the top-table reference + mask + differences (BC1) or the 15 contextual symbols (BC4/BC5). the flag byte is written in the stream header (right after the top-table size for BC1, after the tile seeds for BC4/BC5) and is never needed for a non-flat block, so encoder and decoder always pick the same path; an encoder that leaves a non-uniform word on a flat block forces mode 0 and round-trips unchanged. the gpu decompressor mirrors the cpu; packed_*_maxsize grow by the alignment quantum to cover the header byte. new synthetic tests bc45_flat_uniform and bc3_flat_uniform exercise mode 1 (the existing flat tests keep mode 0). stream format is extended, hence the 1.0.0 version bump
…tead of storing one index value per flat block, the value now lives once in the stream header. the first pass requires every equal-endpoint block to hold the same uniform index value (2-bit for BC1, 3-bit per channel for BC4/BC5); a single shared value selects mode 1, in which a flat block stores no index payload at all and the decoder expands the header value to all 16 indices. an encoder that leaves a non-uniform or a differing word on a flat block forces mode 0, the classic per-block encoding, so the roundtrip stays byte-exact either way. the mode and the value share the existing header byte (mode | value << 1, right after the top-table size for BC1, one per channel after the tile seeds for BC4/BC5), so packed_*_maxsize are unchanged. the gpu decompressor mirrors the cpu. new synthetic tests: identical_colors_uniform_value / _divergent / _garbage / _mixed (BC1) and bc45_flat_uniform_word / _divergent (BC4+BC5); bc45_flat_uniform is re-documented, its 0x33 word is 6,3,1 repeating as 3-bit values (mode 0 all along), and bc45_flat_uniform_word with a truly uniform word is the real mode 1 coverage. 1.0.0 was never published, hence the 1.0.1 patch bump. release and asan builds: 43/43 tests, gpu bit-identical to cpu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Flat tiles (equal endpoints) better compression. (no change in the benchmark since test suite is more complex)