blocks_compare(struct image_dup_context *ctx, struct image_dup *dup1, struct image_dup *dup2, uns tab_col, uns tab_row, uns trans)
{
DBG("blocks_compare(tab_col=%d tab_row=%d trans=%d)", tab_col, tab_row, trans);
+ ctx->sum_pixels += 1 << (tab_col + tab_row);
byte *block1 = image_dup_block(dup1, tab_col, tab_row);
byte *block2;
int col_step, row_step;
{
struct image *img1 = &dup1->image;
struct image *img2 = &dup2->image;
+ ctx->sum_pixels += img1->cols * img1->rows;
byte *block1 = img1->pixels;
byte *block2 = img2->pixels;
int col_step, row_step;
if (flags & (1 << t))
{
DBG("Testing trans %d", t);
- for (uns i = MAX(cols, rows); i--; )
+ uns i = MAX(cols, rows), depth = 1;
+ while (i--)
{
+ depth++;
uns col = MAX(0, (int)(cols - i));
uns row = MAX(0, (int)(rows - i));
if (!blocks_compare(ctx, dup1, dup2, col, row, t))
break;
}
}
+ ctx->sum_depth += depth;
}
}
if (flags & 0xf0)
if (flags & (1 << t))
{
DBG("Testing trans %d", t);
- for (uns i = MAX(cols, rows); i--; )
+ uns i = MAX(cols, rows), depth = 1;
+ while (i--)
{
+ depth++;
uns col = MAX(0, (int)(cols - i));
uns row = MAX(0, (int)(rows - i));
if (!blocks_compare(ctx, dup1, dup2, col, row, t))
break;
}
}
+ ctx->sum_depth += depth;
}
}
return result;