Selaa lähdekoodia

Fix a inf in benchmark.lua

nagadomi 9 vuotta sitten
vanhempi
commit
4379d4d0fd
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      tools/benchmark.lua

+ 1 - 1
tools/benchmark.lua

@@ -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)