From d9474702f6b7bcc50c4ff52f73dca48a5e2cf877 Mon Sep 17 00:00:00 2001 From: nagadomi Date: Mon, 11 Apr 2016 21:48:00 +0900 Subject: [PATCH] Fix NaN in benchmark script --- tools/benchmark.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/benchmark.lua b/tools/benchmark.lua index 2712384..eb0a087 100644 --- a/tools/benchmark.lua +++ b/tools/benchmark.lua @@ -72,7 +72,7 @@ local function MSE(x1, x2, color) end end local function PSNR(x1, x2, color) - local mse = MSE(x1, x2, color) + local mse = math.max(MSE(x1, x2, color), 1) return 10 * math.log10((255.0 * 255.0) / mse) end local function transform_jpeg(x, opt)