- for (y = 0; y<h; y++) {
- for (x = 0; x<w; x++) {
- uint8_t *d = &rect->data[0][x + y*stride];
- int v = *d;
- int l_m = list[v];
- int l_l = x ? L(-1, 0) : 1;
- int l_r = x+1<w ? L( 1, 0) : 1;
- int l_t = y ? L( 0,-1) : 1;
- int l_b = y+1<h ? L( 0, 1) : 1;
- if (l_m)
- continue;
- scoretab[v] += l_l + l_r + l_t + l_b;
- }
- }