1
0
Fork 0
mirror of synced 2024-05-19 04:12:19 +12:00

Fix a inf in benchmark.lua

This commit is contained in:
nagadomi 2016-06-19 22:28:42 +09:00
parent f61d59d28a
commit 4379d4d0fd

View file

@ -110,7 +110,7 @@ local function PSNR(x1, x2, color)
return 10 * math.log10((255.0 * 255.0) / mse)
end
local function MSE2PSNR(mse)
return 10 * math.log10((255.0 * 255.0) / mse)
return 10 * math.log10((255.0 * 255.0) / math.max(mse, 1))
end
local function transform_jpeg(x, opt)