From 2a61c26b73b2ee8cf9d67cc2079d40573d98a340 Mon Sep 17 00:00:00 2001 From: zvezdochiot Date: Thu, 2 Feb 2023 02:42:23 +0300 Subject: [PATCH] 2.6.1: add MSE and MSEF metrics --- CHANGELOG | 5 ++ README.md | 23 +++--- man/man1/jpeg-compare.1 | 21 ++--- man/man1/jpeg-hash.1 | 2 +- man/man1/jpeg-recompress.1 | 21 ++--- man/man1/jpeg-zfpoint.1 | 2 +- man/man1/webp-compress.1 | 21 ++--- src/jmetrics.c | 155 ++++++++++++++++++++++++++++++++----- src/jmetrics.h | 9 ++- src/jpeg-compare.c | 8 +- src/jpeg-recompress.c | 6 +- src/webp-compress.c | 4 +- 12 files changed, 207 insertions(+), 70 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7d83e21..54be87e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,11 @@ JPEG Recompress https://github.com/ImageProcessing-ElectronicPublications/jpeg-recompress +2.6.1 "msef" + + Added MSE and MSEF metric. + Research: correct trends UM (44 images) + 2.6.0 "sum" Added VIFP 1 layer in SUM metric. diff --git a/README.md b/README.md index 51ea348..a6d849e 100644 --- a/README.md +++ b/README.md @@ -54,12 +54,14 @@ Name | Option | Description ----------- | ------------- | ----------- MPE | `-m mpe` | Mean pixel error (as used by [imgmin](https://github.com/rflynn/imgmin)) PSNR | `-m psnr` | [Peak signal-to-noise ratio](https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio) +MSE | `-m mse` | [Mean squared error](https://en.wikipedia.org/wiki/Mean_squared_error) +MSEF | `-m msef` | `sqrt(MSE/Variance)` +Correlation | `-m cor` | [Correlation](https://en.wikipedia.org/wiki/Correlation) SSIM | `-m ssim` | [Structural similarity](http://en.wikipedia.org/wiki/Structural_similarity) MS-SSIM* | `-m ms-ssim` | Multi-scale structural similarity (slow!) ([2008 paper](http://foulard.ece.cornell.edu/publications/dmr_hvei2008_paper.pdf)) VIFP1 | `-m vifp1` | [The visual information fidelity (VIF)](http://live.ece.utexas.edu/publications.php) 1 layer. SmallFry | `-m smallfry` | Linear-weighted BBCQ-like ([original project](https://github.com/dwbuiten/smallfry), [2011 BBCQ paper](http://spie.org/Publications/Proceedings/Paper/10.1117/12.872231) -> [LibSmallFry](https://github.com/ImageProcessing-ElectronicPublications/libsmallfry)) SharpenBad | `-m shbad` | Sharpen discrepancies ([LibSmallFry](https://github.com/ImageProcessing-ElectronicPublications/libsmallfry)) -Correlation | `-m cor` | [Correlation](https://en.wikipedia.org/wiki/Correlation) NHW | `-m nhw` | NHW convolutional metric ([original project](https://github.com/rcanut/NHW_Neatness_Metrics) -> [LibSmallFry](https://github.com/ImageProcessing-ElectronicPublications/libsmallfry)) 1 pair | `-m ssimfry` | `(ssim + smallfry) / 2` 2 pair | `-m ssimshb` | `(ssim + shbad) / 2` @@ -73,15 +75,16 @@ SUMMARY | `-m sum` | `(ssim + vipf1 + smallfry + shbad + nhw) / 5` **DE ``` Trends: ``` -UM = 2.99 * sqrt(sqrt(1.0 / MPE)) - 1.70 -UM = 1.00 * sqrt(PNSR) - 5.32 -UM = 2.07 * cor_sigma(cor_sigma(cor_sigma(SSIM))) - 0.26 +UM = 2.42 * sqrt(sqrt(1.0 / MPE)) - 1.38 +UM = 0.87 * sqrt(PNSR) - 4.70 +UM = 1.02 * sqrt(sqrt(1.0 / MSEF)) - 1.49 +UM = 2.87 * cor_sigma(cor_sigma(COR)) - 1.42 +UM = 1.73 * cor_sigma(cor_sigma(cor_sigma(SSIM))) - 0.11 UM = 1.59 * cor_sigma(cor_sigma(MS_SSIM)) + 0.01 -UM = 3.69 * cor_sigma(VIFP1) - 2.74 -UM = 0.0684 * SMALLFRY - 6.29 -UM = 1.17 * SHARPENBAD - 0.12 -UM = 3.03 * cor_sigma(cor_sigma(COR)) - 1.52 -UM = 0.40 * sqrt(sqrt(1.0 / NHW)) - 0.48 +UM = 1.12 * cor_sigma(cor_sigma(VIFP1)) - 0.03 +UM = 0.0658 * SMALLFRY - 6.07 +UM = 1.00 * SHARPENBAD + 0.05 +UM = 0.36 * sqrt(sqrt(1.0 / NHW)) - 0.41 cor_sigma(M) = 1.0 - sqrt(1.0 - M * M) ``` @@ -92,7 +95,7 @@ The JPEG format allows for subsampling of the color channels to save space. For #### Example Commands -```bash +```shell # Default settings jpeg-recompress image.jpg compressed.jpg diff --git a/man/man1/jpeg-compare.1 b/man/man1/jpeg-compare.1 index a9766d0..23a9ede 100644 --- a/man/man1/jpeg-compare.1 +++ b/man/man1/jpeg-compare.1 @@ -1,4 +1,4 @@ -.TH "jpeg-compare" 1 2.6.0 "31 Jan 2023" "User manual" +.TH "jpeg-compare" 1 2.6.1 "02 Feb 2023" "User manual" .SH NAME jpeg-compare @@ -17,7 +17,7 @@ jpeg-compare [options] image1.jpg image2.jpg output program help .TP \fB\-m\fR, \fB\-\-method\fR [arg] -set comparison method to one of 'fast', 'mpe', 'psnr', 'ssim', 'ms-ssim', 'vifp1', 'smallfry', 'shbad', 'cor', 'nhw', 'ssimfry', 'ssimshb', 'sum' [fast] +set comparison method to one of 'fast', 'mpe', 'psnr', 'mse', 'msef', 'cor', 'ssim', 'ms-ssim', 'vifp1', 'smallfry', 'shbad', 'nhw', 'ssimfry', 'ssimshb', 'sum' [fast] .TP \fB\-n\fR, \fB\-\-norm\fR UM scale metric @@ -74,15 +74,16 @@ jpeg-compare --method ssim image1.jpg image2.jpg .PP Trends: - UM = 2.99 * sqrt(sqrt(1.0 / MPE)) - 1.70 - UM = 1.00 * sqrt(PNSR) - 5.32 - UM = 2.07 * cor_sigma(cor_sigma(cor_sigma(SSIM))) - 0.26 + UM = 2.42 * sqrt(sqrt(1.0 / MPE)) - 1.38 + UM = 0.87 * sqrt(PNSR) - 4.70 + UM = 1.02 * sqrt(sqrt(1.0 / MSEF)) - 1.49 + UM = 2.87 * cor_sigma(cor_sigma(COR)) - 1.42 + UM = 1.73 * cor_sigma(cor_sigma(cor_sigma(SSIM))) - 0.11 UM = 1.59 * cor_sigma(cor_sigma(MS_SSIM)) + 0.01 - UM = 3.69 * cor_sigma(VIFP1) - 2.74 - UM = 0.0684 * SMALLFRY - 6.29 - UM = 1.17 * SHARPENBAD - 0.12 - UM = 3.03 * cor_sigma(cor_sigma(COR)) - 1.52 - UM = 0.40 * sqrt(sqrt(1.0 / NHW)) - 0.48 + UM = 1.12 * cor_sigma(cor_sigma(VIFP1)) - 0.03 + UM = 0.0658 * SMALLFRY - 6.07 + UM = 1.00 * SHARPENBAD + 0.05 + UM = 0.36 * sqrt(sqrt(1.0 / NHW)) - 0.41 cor_sigma(M) = 1.0 - sqrt(1.0 - M * M) .SH COPYRIGHT diff --git a/man/man1/jpeg-hash.1 b/man/man1/jpeg-hash.1 index 4110727..b434bc3 100644 --- a/man/man1/jpeg-hash.1 +++ b/man/man1/jpeg-hash.1 @@ -1,4 +1,4 @@ -.TH "jpeg-hash" 1 2.6.0 "31 Jan 2023" "User manual" +.TH "jpeg-hash" 1 2.6.1 "02 Feb 2023" "User manual" .SH NAME jpeg-hash diff --git a/man/man1/jpeg-recompress.1 b/man/man1/jpeg-recompress.1 index 887a11e..f64afdf 100644 --- a/man/man1/jpeg-recompress.1 +++ b/man/man1/jpeg-recompress.1 @@ -1,4 +1,4 @@ -.TH "jpeg-recompress" 1 2.6.0 "31 Jan 2023" "User manual" +.TH "jpeg-recompress" 1 2.6.1 "02 Feb 2023" "User manual" .SH NAME jpeg-recompress @@ -35,7 +35,7 @@ output program help set the number of runs to attempt [6] .TP \fB\-m\fR, \fB\-\-method\fR [arg] -set comparison method to one of 'mpe', 'psnr', 'ssim', 'ms-ssim', 'vifp1', 'smallfry', 'shbad', 'cor', 'nhw', 'ssimfry', 'ssimshb', 'sum' [sum] +set comparison method to one of 'mpe', 'psnr', 'mse', 'msef', 'cor', 'ssim', 'ms-ssim', 'vifp1', 'smallfry', 'shbad', 'nhw', 'ssimfry', 'ssimshb', 'sum' [sum] .TP \fB\-n\fR, \fB\-\-min\fR [arg] minimum JPEG quality [40] @@ -145,15 +145,16 @@ jpeg-recompress --quiet image.jpg compressed.jpg .PP Trends: - UM = 2.99 * sqrt(sqrt(1.0 / MPE)) - 1.70 - UM = 1.00 * sqrt(PNSR) - 5.32 - UM = 2.07 * cor_sigma(cor_sigma(cor_sigma(SSIM))) - 0.26 + UM = 2.42 * sqrt(sqrt(1.0 / MPE)) - 1.38 + UM = 0.87 * sqrt(PNSR) - 4.70 + UM = 1.02 * sqrt(sqrt(1.0 / MSEF)) - 1.49 + UM = 2.87 * cor_sigma(cor_sigma(COR)) - 1.42 + UM = 1.73 * cor_sigma(cor_sigma(cor_sigma(SSIM))) - 0.11 UM = 1.59 * cor_sigma(cor_sigma(MS_SSIM)) + 0.01 - UM = 3.69 * cor_sigma(VIFP1) - 2.74 - UM = 0.0684 * SMALLFRY - 6.29 - UM = 1.17 * SHARPENBAD - 0.12 - UM = 3.03 * cor_sigma(cor_sigma(COR)) - 1.52 - UM = 0.40 * sqrt(sqrt(1.0 / NHW)) - 0.48 + UM = 1.12 * cor_sigma(cor_sigma(VIFP1)) - 0.03 + UM = 0.0658 * SMALLFRY - 6.07 + UM = 1.00 * SHARPENBAD + 0.05 + UM = 0.36 * sqrt(sqrt(1.0 / NHW)) - 0.41 cor_sigma(M) = 1.0 - sqrt(1.0 - M * M) .SH COPYRIGHT diff --git a/man/man1/jpeg-zfpoint.1 b/man/man1/jpeg-zfpoint.1 index bb4276a..8fa6a8b 100644 --- a/man/man1/jpeg-zfpoint.1 +++ b/man/man1/jpeg-zfpoint.1 @@ -1,4 +1,4 @@ -.TH "jpeg-zfpoint" 1 2.6.0 "31 Jan 2023" "User manual" +.TH "jpeg-zfpoint" 1 2.6.1 "02 Feb 2023" "User manual" .SH NAME jpeg-zfpoint diff --git a/man/man1/webp-compress.1 b/man/man1/webp-compress.1 index 3a103cb..3e23312 100644 --- a/man/man1/webp-compress.1 +++ b/man/man1/webp-compress.1 @@ -1,4 +1,4 @@ -.TH "webp-compress" 1 2.6.0 "31 Jan 2023" "User manual" +.TH "webp-compress" 1 2.6.1 "02 Feb 2023" "User manual" .SH NAME webp-compress @@ -31,7 +31,7 @@ output program help set the number of runs to attempt [8] .TP \fB\-m\fR, \fB\-\-method\fR [arg] -set comparison method to one of 'mpe', 'psnr', 'ssim', 'ms-ssim', 'vifp1', 'smallfry', 'shbad', 'cor', 'nhw', 'ssimfry', 'ssimshb', 'sum' [sum] +set comparison method to one of 'mpe', 'psnr', 'mse', 'msef', 'cor', 'ssim', 'ms-ssim', 'vifp1', 'smallfry', 'shbad', 'nhw', 'ssimfry', 'ssimshb', 'sum' [sum] .TP \fB\-n\fR, \fB\-\-min\fR [arg] minimum quality [1] @@ -109,15 +109,16 @@ webp-compress --quiet image.jpg compressed.webp .PP Trends: - UM = 2.99 * sqrt(sqrt(1.0 / MPE)) - 1.70 - UM = 1.00 * sqrt(PNSR) - 5.32 - UM = 2.07 * cor_sigma(cor_sigma(cor_sigma(SSIM))) - 0.26 + UM = 2.42 * sqrt(sqrt(1.0 / MPE)) - 1.38 + UM = 0.87 * sqrt(PNSR) - 4.70 + UM = 1.02 * sqrt(sqrt(1.0 / MSEF)) - 1.49 + UM = 2.87 * cor_sigma(cor_sigma(COR)) - 1.42 + UM = 1.73 * cor_sigma(cor_sigma(cor_sigma(SSIM))) - 0.11 UM = 1.59 * cor_sigma(cor_sigma(MS_SSIM)) + 0.01 - UM = 3.69 * cor_sigma(VIFP1) - 2.74 - UM = 0.0684 * SMALLFRY - 6.29 - UM = 1.17 * SHARPENBAD - 0.12 - UM = 3.03 * cor_sigma(cor_sigma(COR)) - 1.52 - UM = 0.40 * sqrt(sqrt(1.0 / NHW)) - 0.48 + UM = 1.12 * cor_sigma(cor_sigma(VIFP1)) - 0.03 + UM = 0.0658 * SMALLFRY - 6.07 + UM = 1.00 * SHARPENBAD + 0.05 + UM = 0.36 * sqrt(sqrt(1.0 / NHW)) - 0.41 cor_sigma(M) = 1.0 - sqrt(1.0 - M * M) .SH COPYRIGHT diff --git a/src/jmetrics.c b/src/jmetrics.c index 732fb78..512b47f 100644 --- a/src/jmetrics.c +++ b/src/jmetrics.c @@ -77,7 +77,7 @@ int interpolate(const unsigned char *image, int width, int components, float x, return pix; } -float meanPixelError(const unsigned char *original, const unsigned char *compressed, int width, int height, int components) +float metric_mpe(const unsigned char *original, const unsigned char *compressed, int width, int height, int components) { int y, x, z; float delta, pmel, pme; @@ -104,6 +104,90 @@ float meanPixelError(const unsigned char *original, const unsigned char *compres return pme; } +float metric_mse(const unsigned char *ref, const unsigned char *cmp, int width, int height, int channels) +{ + float im1, im2; + float suml, sum, delta; + int y, x, d; + size_t k; + + k = 0; + sum = 0.0f; + for (y = 0; y < height; y++) + { + suml = 0.0f; + for (x = 0; x < width; x++) + { + for (d = 0; d < channels; d++) + { + im1 = (float)ref[k]; + im2 = (float)cmp[k]; + delta = (im1 > im2) ? (im1 - im2) : (im2 - im1); + suml += delta * delta; + k++; + } + } + sum += suml; + } + sum /= (float)k; + + return sum; +} + +float metric_stdev2(const unsigned char *ref, const unsigned char *cmp, int width, int height, int channels) +{ + float im1, im2; + float suml, sum, sumql, sumq, stdev2; + int y, x, d; + size_t k, n; + + n = 2 * width * height; + stdev2 = 0.0f; + for (d = 0; d < channels; d++) + { + k = d; + sum = 0.0f; + sumq = 0.0f; + for (y = 0; y < height; y++) + { + suml = 0.0f; + sumql = 0.0f; + for (x = 0; x < width; x++) + { + im1 = (float)ref[k]; + im2 = (float)cmp[k]; + suml += im1; + suml += im2; + sumql += (im1 * im1); + sumql += (im2 * im2); + k += channels; + } + sum += suml; + sumq += sumql; + } + sum /= (float)n; + sumq /= (float)n; + sumq -= sum * sum; + stdev2 += sumq; + } + stdev2 /= (float)channels; + + return stdev2; +} + +float metric_msef(const unsigned char *ref, const unsigned char *cmp, int width, int height, int channels) +{ + float mse, stdev2; + + mse = metric_mse(ref, cmp, width, height, channels); + stdev2 = metric_stdev2(ref, cmp, width, height, channels); + stdev2 = (stdev2 > 0.0f) ? stdev2 : 1.0f; + mse /= stdev2; + mse = sqrt(mse); + + return mse; +} + void defish(const unsigned char *input, unsigned char *output, int width, int height, int components, float strength, float zoom) { const int cx = width / 2; @@ -790,6 +874,10 @@ enum METHOD parseMethod(const char *s) return MPE; if (!strcmp("psnr", s)) return PSNR; + if (!strcmp("mse", s)) + return MSE; + if (!strcmp("msef", s)) + return MSEF; if (!strcmp("ssim", s)) return SSIM; if (!strcmp("ms-ssim", s)) @@ -817,14 +905,16 @@ float RescaleMetric(int currentmethod, float value) { switch (currentmethod) { + case MSE: + value = sqrt(value); case MPE: if (value > 0.0f) { value = 1.0f / value; value = sqrt(value); value = sqrt(value); - value *= 2.99f; - value -= 1.70f; + value *= 2.42f; + value -= 1.38f; } else { @@ -833,15 +923,29 @@ float RescaleMetric(int currentmethod, float value) break; case PSNR: value = sqrt(value); - value *= 1.00f; - value -= 5.32f; + value *= 0.87f; + value -= 4.70f; + break; + case MSEF: + if (value > 0.0f) + { + value = 1.0f / value; + value = sqrt(value); + value = sqrt(value); + value *= 1.02f; + value -= 1.49f; + } + else + { + value = 1.0f; + } break; case SSIM: value = MetricSigma(value); value = MetricSigma(value); value = MetricSigma(value); - value *= 2.07f; - value -= 0.26f; + value *= 1.73f; + value -= 0.11f; break; case MS_SSIM: value = MetricSigma(value); @@ -851,22 +955,23 @@ float RescaleMetric(int currentmethod, float value) break; case VIFP1: value = MetricSigma(value); - value *= 3.69f; - value -= 2.74f; + value = MetricSigma(value); + value *= 1.12f; + value -= 0.03f; break; case SMALLFRY: - value *= 0.0684f; - value -= 6.29f; + value *= 0.0658f; + value -= 6.07f; break; case SHARPENBAD: - value *= 1.17f; - value -= 0.12f; + value *= 1.00f; + value += 0.05f; break; case COR: value = MetricSigma(value); value = MetricSigma(value); - value *= 3.03f; - value -= 1.52f; + value *= 2.87f; + value -= 1.42f; break; case NHW: if (value > 0.0f) @@ -874,8 +979,8 @@ float RescaleMetric(int currentmethod, float value) value = 1.0f / value; value = sqrt(value); value = sqrt(value); - value *= 0.40f; - value -= 0.48f; + value *= 0.36f; + value -= 0.41f; } else { @@ -900,6 +1005,12 @@ char* MetricName(int currentmethod) case PSNR: value = "PSNR"; break; + case MSE: + value = "MSE"; + break; + case MSEF: + value = "MSEF"; + break; case SSIM: value = "SSIM"; break; @@ -961,11 +1072,17 @@ float MetricCalc(int method, unsigned char *image1, unsigned char *image2, int w switch (method) { case MPE: - diff = meanPixelError(image1, image2, width, height, components); + diff = metric_mpe(image1, image2, width, height, components); break; case PSNR: diff = iqa_psnr(image1, image2, width, height, width * components); break; + case MSE: + diff = metric_mse(image1, image2, width, height, components); + break; + case MSEF: + diff = metric_msef(image1, image2, width, height, components); + break; case SSIM: diff = iqa_ssim(image1, image2, width, height, width * components, 0, 0); break; @@ -1060,6 +1177,8 @@ int compareFromBuffer(int method, unsigned char *imageBuf1, long bufSize1, unsig { case MPE: case PSNR: + case MSE: + case MSEF: format = JCS_RGB; components = 3; break; diff --git a/src/jmetrics.h b/src/jmetrics.h index 51ea496..420659f 100644 --- a/src/jmetrics.h +++ b/src/jmetrics.h @@ -21,7 +21,7 @@ #define JMETRICS_H #ifndef JMVERSION -#define JMVERSION "2.6.0" +#define JMVERSION "2.6.1" #endif #define MIN(a, b) ((a) < (b) ? (a) : (b)) @@ -56,7 +56,9 @@ enum METHOD UNKNOWN, FAST, MPE, + MSE, PSNR, + MSEF, SSIM, MS_SSIM, VIFP1, @@ -98,7 +100,10 @@ int interpolate(const unsigned char *image, int width, int components, float x, /* Get mean error per pixel rate. */ -float meanPixelError(const unsigned char *original, const unsigned char *compressed, int width, int height, int components); +float metric_mpe(const unsigned char *original, const unsigned char *compressed, int width, int height, int components); +float metric_mse(const unsigned char *ref, const unsigned char *cmp, int width, int height, int channels); +float metric_stdev2(const unsigned char *ref, const unsigned char *cmp, int width, int height, int channels); +float metric_msef(const unsigned char *ref, const unsigned char *cmp, int width, int height, int channels); /* Remove fisheye distortion from an image. The amount of distortion is diff --git a/src/jpeg-compare.c b/src/jpeg-compare.c index 13d9ea4..17f4c5e 100644 --- a/src/jpeg-compare.c +++ b/src/jpeg-compare.c @@ -24,8 +24,8 @@ void usage(char *progname) printf("options:\n\n"); printf(" -h, --help output program help\n"); printf(" -m, --method [arg] set comparison method to one of:\n"); - printf(" 'fast', 'mpe', 'psnr', 'ssim', 'ms-ssim', 'vifp1', 'smallfry', 'shbad',\n"); - printf(" 'cor', 'nhw', 'ssimfry', 'ssimshb', 'sum' [fast]\n"); + printf(" 'fast', 'mpe', 'psnr', 'mse', 'msef', 'cor', 'ssim', 'ms-ssim', 'vifp1',\n"); + printf(" 'smallfry', 'shbad', 'nhw', 'ssimfry', 'ssimshb', 'sum' [fast]\n"); printf(" -n, --norm UM scale metric\n"); printf(" -r, --ppm parse first input as PPM instead of JPEG\n"); printf(" -s, --size [arg] set fast comparison image hash size\n"); @@ -160,8 +160,10 @@ int main (int argc, char **argv) return 255; } return compareFastFromBuffer(imageBuf1, bufSize1, imageBuf2, bufSize2, printPrefix, size); - case PSNR: case MPE: + case PSNR: + case MSE: + case MSEF: case SSIM: case MS_SSIM: case VIFP1: diff --git a/src/jpeg-recompress.c b/src/jpeg-recompress.c index 5ad74a3..d6ed63b 100644 --- a/src/jpeg-recompress.c +++ b/src/jpeg-recompress.c @@ -21,8 +21,8 @@ void usage(char *progname) printf(" -h, --help output program help\n"); printf(" -l, --loops [arg] set the number of runs to attempt [6]\n"); printf(" -m, --method [arg] set comparison method to one of:\n"); - printf(" 'mpe', 'psnr', 'ssim', 'ms-ssim', 'vifp1', 'smallfry', 'shbad',\n"); - printf(" 'cor', 'nhw', 'ssimfry', 'ssimshb', 'sum' [sum]\n"); + printf(" 'mpe', 'psnr', 'mse', 'msef', 'cor', 'ssim', 'ms-ssim', 'vifp1',\n"); + printf(" 'smallfry', 'shbad', 'nhw', 'ssimfry', 'ssimshb', 'sum' [sum]\n"); printf(" -n, --min [arg] minimum JPEG quality [40]\n"); printf(" -p, --no-progressive disable progressive encoding\n"); printf(" -q, --quality [arg] set a quality preset: low, medium, subhigh, high, veryhigh [medium]\n"); @@ -43,7 +43,7 @@ int main (int argc, char **argv) int method = SUMMET; // Number of binary search steps - int attempts = 6; + int attempts = 7; float target = 0.0f; int preset = MEDIUM; diff --git a/src/webp-compress.c b/src/webp-compress.c index 52cbad1..2386047 100644 --- a/src/webp-compress.c +++ b/src/webp-compress.c @@ -22,8 +22,8 @@ void usage(char *progname) printf(" -h, --help output program help\n"); printf(" -l, --loops [arg] set the number of runs to attempt [8]\n"); printf(" -m, --method [arg] set comparison method to one of:\n"); - printf(" 'mpe', 'psnr', 'ssim', 'ms-ssim', 'vifp1', 'smallfry', 'shbad',\n"); - printf(" 'cor', 'nhw', 'ssimfry', 'ssimshb', 'sum' [sum]\n"); + printf(" 'mpe', 'psnr', 'mse', 'msef', 'cor', 'ssim', 'ms-ssim', 'vifp1',\n"); + printf(" 'smallfry', 'shbad', 'nhw', 'ssimfry', 'ssimshb', 'sum' [sum]\n"); printf(" -n, --min [arg] minimum quality [1]\n"); printf(" -q, --quality [arg] set a quality preset: low, medium, subhigh, high, veryhigh [medium]\n"); printf(" -r, --ppm parse input as PPM\n");