diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-08-09 22:34:31 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-08-09 22:34:31 +0100 |
| commit | c3178e1b08e1fc6faa1d6276983247309f0940a8 (patch) | |
| tree | 3e0e63da67f18fbe8239f96c7ce477e210121e57 /src | |
| parent | 1b38369e3b01132d2b6370c5397b421263d8e7db (diff) | |
Show maximum pixel error on equals().
Diffstat (limited to 'src')
| -rw-r--r-- | src/picture_asset.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/picture_asset.cc b/src/picture_asset.cc index f5c10ce3..c59664d9 100644 --- a/src/picture_asset.cc +++ b/src/picture_asset.cc @@ -238,6 +238,7 @@ PictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt) const vector<int> abs_diffs (image_A->comps[0].w * image_A->comps[0].h * image_A->numcomps); int d = 0; + int max_diff = 0; for (int c = 0; c < image_A->numcomps; ++c) { @@ -247,7 +248,9 @@ PictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt) const int const pixels = image_A->comps[c].w * image_A->comps[c].h; for (int j = 0; j < pixels; ++j) { - abs_diffs[d++] = abs (image_A->comps[c].data[j] - image_B->comps[c].data[j]); + int const t = abs (image_A->comps[c].data[j] - image_B->comps[c].data[j]); + abs_diffs[d++] = t; + max_diff = max (max_diff, t); } } @@ -270,7 +273,7 @@ PictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt) const } if (opt.verbose) { - cout << "\tmean pixel error " << mean << ", standard deviation " << std_dev << "\n"; + cout << "\tmax pixel error " << max_diff << ", mean pixel error " << mean << ", standard deviation " << std_dev << "\n"; } opj_image_destroy (image_A); |
