const uint RANS_BYTE_L = (1u << 23); // lower bound of our normalization interval
-uint last_offset = -1, ransbuf;
-
uint get_rans_byte(uint offset)
{
- if (last_offset != (offset >> 2)) {
- last_offset = offset >> 2;
- ransbuf = data_SSBO[offset >> 2];
- }
- return bitfieldExtract(ransbuf, 8 * int(offset & 3u), 8);
-
// We assume little endian.
-// return bitfieldExtract(data_SSBO[offset >> 2], 8 * int(offset & 3u), 8);
+ return bitfieldExtract(data_SSBO[offset >> 2], 8 * int(offset & 3u), 8);
}
uint RansDecInit(inout uint offset)