1 hour ago · Tech · 0 comments

The ASTC texture compression format has its “integer sequence encoding” to send small integers with a uniform probability distribution within their range. When that value range is [0,2k-1] for some integer k, this is straightforward: just send the values with k bits each. But ISE ups the ante by supporting not just power-of-2 sizes ranges, but also allowing a single prime factor of either 3 or 5 in the size of the range. So we can, for example, have some value x in the range [0,95], 96 total, where the low 5 bits are sent regularly, and then we have the “high trits” ⌊x/32⌋\lfloor x/32 \rfloor that are always in the range [0,2]. When the extra prime factor is 3, these trits are arranged in groups of 5. The number of possible combinations of 5 values in the range [0,2] is 35 = 243 < 256, so we can encode our 5 values in 8 bits. For 5 values in the range [0,95], that means we spend 5*5 + 8 = 33 bits; had we just used regular binary instead, we would have probably rounded up to 7 bits per…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.