Fix warnings
This commit is contained in:
parent
73cb02de2d
commit
7ec83051c0
|
@ -212,34 +212,30 @@ struct biimage_t
|
||||||
const char *
|
const char *
|
||||||
block_best (const biimage_t &bi, unsigned int *score, bool *inverse)
|
block_best (const biimage_t &bi, unsigned int *score, bool *inverse)
|
||||||
{
|
{
|
||||||
unsigned int row_sum[bi.height];
|
assert (bi.width <= CELL_W);
|
||||||
unsigned int col_sum[bi.width];
|
assert (bi.height <= CELL_H);
|
||||||
unsigned int row_sum_i[bi.height];
|
|
||||||
unsigned int col_sum_i[bi.width];
|
|
||||||
|
|
||||||
for (unsigned int i = 0; i < bi.height; i++)
|
unsigned int row_sum[CELL_H] = {0};
|
||||||
row_sum[i] = row_sum_i[i] = 0;
|
unsigned int col_sum[CELL_W] = {0};
|
||||||
for (unsigned int i = 0; i < bi.width; i++)
|
unsigned int row_sum_i[CELL_H] = {0};
|
||||||
col_sum[i] = col_sum_i[i] = 0;
|
unsigned int col_sum_i[CELL_W] = {0};
|
||||||
|
|
||||||
unsigned int total = 0;
|
|
||||||
unsigned int total_i = 0;
|
|
||||||
unsigned int quad[2][2] = {{0}};
|
unsigned int quad[2][2] = {{0}};
|
||||||
unsigned int quad_i[2][2] = {{0}};
|
unsigned int quad_i[2][2] = {{0}};
|
||||||
|
unsigned int total = 0;
|
||||||
|
unsigned int total_i = 0;
|
||||||
for (unsigned int y = 0; y < bi.height; y++)
|
for (unsigned int y = 0; y < bi.height; y++)
|
||||||
for (unsigned int x = 0; x < bi.width; x++) {
|
for (unsigned int x = 0; x < bi.width; x++) {
|
||||||
unsigned int c = bi (x, y);
|
unsigned int c = bi (x, y);
|
||||||
|
unsigned int c_i = 255 - c;
|
||||||
row_sum[y] += c;
|
row_sum[y] += c;
|
||||||
|
row_sum_i[y] += c_i;
|
||||||
col_sum[x] += c;
|
col_sum[x] += c;
|
||||||
|
col_sum_i[x] += c_i;
|
||||||
quad[2 * y / bi.height][2 * x / bi.width] += c;
|
quad[2 * y / bi.height][2 * x / bi.width] += c;
|
||||||
quad_i[2 * y / bi.height][2 * x / bi.width] += 255 - c;
|
quad_i[2 * y / bi.height][2 * x / bi.width] += c_i;
|
||||||
total += c;
|
total += c;
|
||||||
total_i += 255 - c;
|
total_i += c_i;
|
||||||
}
|
}
|
||||||
for (unsigned int i = 0; i < bi.height; i++)
|
|
||||||
row_sum_i[i] = 255 * bi.width - row_sum[i];
|
|
||||||
for (unsigned int i = 0; i < bi.width; i++)
|
|
||||||
col_sum_i[i] = 255 * bi.height - col_sum[i];
|
|
||||||
|
|
||||||
/* Make the sums cummulative */
|
/* Make the sums cummulative */
|
||||||
for (unsigned int i = 1; i < bi.height; i++) {
|
for (unsigned int i = 1; i < bi.height; i++) {
|
||||||
|
|
Loading…
Reference in New Issue