From 86bb0f6d0e8ebaebaae0facc321fa270d7958f2d Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Fri, 11 Oct 2013 13:09:33 -0400 Subject: [PATCH] Add SSIM report to command line tools... --- CLTool/src/clunix.cpp | 9 +++++++++ CLTool/src/clwin32.cpp | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/CLTool/src/clunix.cpp b/CLTool/src/clunix.cpp index 131f414..303e42b 100644 --- a/CLTool/src/clunix.cpp +++ b/CLTool/src/clunix.cpp @@ -260,6 +260,15 @@ int main(int argc, char **argv) { fprintf(stderr, "Error computing PSNR\n"); } + double MSSIM; + double SSIM = img.ComputeSSIM(ci, &MSSIM); + if(SSIM > 0.0) { + fprintf(stdout, "SSIM: %.9f\n", SSIM); + fprintf(stdout, "MSSIM: %.9f\n", MSSIM); + } else { + fprintf(stderr, "Error computing MSSIM\n"); + } + if(format == eCompressionFormat_BPTC) { strcat(basename, "-bc7.png"); } else if(format == eCompressionFormat_PVRTC) { diff --git a/CLTool/src/clwin32.cpp b/CLTool/src/clwin32.cpp index cd24835..a24418a 100644 --- a/CLTool/src/clwin32.cpp +++ b/CLTool/src/clwin32.cpp @@ -264,6 +264,15 @@ int _tmain(int argc, _TCHAR* argv[]) fprintf(stderr, "Error computing PSNR\n"); } + double MSSIM; + double SSIM = img.ComputeSSIM(ci, &MSSIM); + if(SSIM > 0.0) { + fprintf(stdout, "SSIM: %.9f\n", SSIM); + fprintf(stdout, "MSSIM: %.9f\n", MSSIM); + } else { + fprintf(stderr, "Error computing MSSIM\n"); + } + if(format == eCompressionFormat_BPTC) { strcat_s(basename, "-bc7.png"); } else if(format == eCompressionFormat_PVRTC) {