Minor clean-up in tiny_ssim.c
authorJingning Han <jingning@google.com>
Tue, 2 Oct 2018 17:21:43 +0000 (10:21 -0700)
committerJingning Han <jingning@google.com>
Tue, 2 Oct 2018 17:22:56 +0000 (10:22 -0700)
Report the correct filename in error message.
Explicitly assign floating point value to double type.

Change-Id: I42fd2da6e16b1e3e7ec221d5d562a728a93c0196

tools/tiny_ssim.c

index 315d1c1..6f4b6d7 100644 (file)
@@ -605,7 +605,7 @@ int main(int argc, char *argv[]) {
   }
 
   if (open_input_file(argv[1], &in[0], w, h, bit_depth) < 0) {
-    fprintf(stderr, "File %s can't be opened or parsed!\n", argv[2]);
+    fprintf(stderr, "File %s can't be opened or parsed!\n", argv[1]);
     goto clean_up;
   }
 
@@ -617,7 +617,7 @@ int main(int argc, char *argv[]) {
   }
   if (bit_depth == 10) peak = 1023.0;
 
-  if (bit_depth == 12) peak = 4095;
+  if (bit_depth == 12) peak = 4095.0;
 
   if (open_input_file(argv[2], &in[1], w, h, bit_depth) < 0) {
     fprintf(stderr, "File %s can't be opened or parsed!\n", argv[2]);