summaryrefslogtreecommitdiff
path: root/test/util.h
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2016-08-08 20:12:42 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-08-08 20:12:42 +0000
commitcfd92dab18639c7f1198393ce04613e6d2b126eb (patch)
tree3875dc00655001eba8016ac83677ea31bfc7ae5b /test/util.h
parent6a8d4631a8b28c2fb0be87467d38174ea3c04e95 (diff)
parent2c17d54681bf6f529fac713d37075e8060e0c72a (diff)
downloadlibvpx-cfd92dab18639c7f1198393ce04613e6d2b126eb.tar
libvpx-cfd92dab18639c7f1198393ce04613e6d2b126eb.tar.gz
libvpx-cfd92dab18639c7f1198393ce04613e6d2b126eb.tar.bz2
libvpx-cfd92dab18639c7f1198393ce04613e6d2b126eb.zip
Merge changes from topic 'clang-tidy'
* changes: *_perf_test.cc: correct DoDecode signature test: apply clang-tidy google-readability-braces-around-statements
Diffstat (limited to 'test/util.h')
-rw-r--r--test/util.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/util.h b/test/util.h
index 0ef2ad8a5..1f2540ecf 100644
--- a/test/util.h
+++ b/test/util.h
@@ -28,12 +28,13 @@ inline double compute_psnr(const vpx_image_t *img1, const vpx_image_t *img2) {
unsigned int i, j;
int64_t sqrerr = 0;
- for (i = 0; i < height_y; ++i)
+ for (i = 0; i < height_y; ++i) {
for (j = 0; j < width_y; ++j) {
int64_t d = img1->planes[VPX_PLANE_Y][i * img1->stride[VPX_PLANE_Y] + j] -
img2->planes[VPX_PLANE_Y][i * img2->stride[VPX_PLANE_Y] + j];
sqrerr += d * d;
}
+ }
double mse = static_cast<double>(sqrerr) / (width_y * height_y);
double psnr = 100.0;
if (mse > 0.0) {