rowcount[row]++;
while(1) {
d = sub->Data(ix++);
- //printf("%08x", d);
- for(int i = 0; i < 0x20; i++) {
- pixelprob[1152 * row + pos*0x20 + i] += d & 0x1;
- d = d >> 1;
+ //////loop over all bits, optimized for all-set and all-clear states
+ unsigned start = 1152 * row + pos*0x20;
+ if(d == 0) {}
+ else if(d == 0xFFFFFFFF) {
+ for(unsigned i = start; i < start + 0x20; i++) {
+ pixelprob[i] ++;
+ }
+ }
+ else {
+ for(unsigned i = start; i < start + 0x20; i++) {
+ pixelprob[i] += d & 0x1;
+ d >>= 1;
+ }
}
+ /////////////end add loop
+
pos++;
if(ix >= RocEnd) break;
}