const uint prob_scale = 1 << prob_bits;
const uint NUM_SYMS = 256;
const uint ESCAPE_LIMIT = NUM_SYMS - 1;
+const uint BLOCKS_PER_STREAM = 320;
// These need to be folded into quant_matrix.
const float dc_scalefac = 8.0;
local_timing[0] = start;
#endif
+ const uint blocks_per_row = (imageSize(out_tex).x + 7) / 8;
+
const uint local_x = gl_LocalInvocationID.x % 8;
const uint local_y = (gl_LocalInvocationID.x / 8) % 8;
const uint local_z = gl_LocalInvocationID.x / 64;
pick_timer(start, local_timing[0]);
- for (uint block_idx = 40; block_idx --> 0; ) {
+ for (uint block_idx = BLOCKS_PER_STREAM / 8; block_idx --> 0; ) {
pick_timer(start, local_timing[1]);
// rANS decode one coefficient across eight blocks (so 64x8 coefficients).
pick_timer(start, local_timing[6]);
uint global_block_idx = (block_row * 40 + block_idx) * 8 + local_y;
- uint block_x = global_block_idx % 160;
- uint block_y = global_block_idx / 160;
+ uint block_x = global_block_idx % blocks_per_row;
+ uint block_y = global_block_idx / blocks_per_row;
uint y = block_y * 8;
uint x = block_x * 8 + local_x;