[x265] [PATCH 1 of 5] Add CLI options for turning on PSNR, SSIM metrics

Steve Borho steve at borho.org
Mon Sep 30 21:36:04 CEST 2013


On Fri, Sep 27, 2013 at 11:52 PM, Aarthi Thirumalai <
aarthi at multicorewareinc.com> wrote:

> # HG changeset patch
> # User Aarthi Thirumalai
> # Date 1380342254 -19800
> #      Sat Sep 28 09:54:14 2013 +0530
> # Node ID 0fa415d022c56451e6580c5b2bee793498d986c8
> # Parent  4014edcf215747ba4ac8147b1168f8edc6f5d64c
> Add CLI options for turning on PSNR, SSIM metrics.
> By default , PSNR is turned on , SSIM is off.
>

I've changed this to:

cli: add options for toggling PSNR and SSIM metrics

By default (for now) PSNR is turned on, SSIM is off.


>
> diff -r 4014edcf2157 -r 0fa415d022c5 source/common/common.cpp
> --- a/source/common/common.cpp  Fri Sep 27 02:18:36 2013 -0500
> +++ b/source/common/common.cpp  Sat Sep 28 09:54:14 2013 +0530
> @@ -178,6 +178,10 @@
>      param->rc.qpStep = 4;
>      param->rc.rateControlMode = X265_RC_CQP;
>      param->rc.qp = 32;
> +
> +    /* Quality Measurement Metrics */
> +    param->bEnablePsnr = 1;
> +    param->bEnableSsim = 0;
>  }
>
>  extern "C"
> @@ -428,6 +432,8 @@
>      }
>      TOOLOPT(param->bEnableWeightedPred, "weightp");
>      TOOLOPT(param->bEnableWeightedBiPred, "weightbp");
> +    TOOLOPT(param->bEnableSsim, "ssim");
> +    TOOLOPT(param->bEnablePsnr, "psnr");
>

these aren't coding tools, and it will be apparent from the log which are
enabled. dropping these



>      fprintf(stderr, "\n");
>      fflush(stderr);
>  }
> diff -r 4014edcf2157 -r 0fa415d022c5 source/x265.h
> --- a/source/x265.h     Fri Sep 27 02:18:36 2013 -0500
> +++ b/source/x265.h     Sat Sep 28 09:54:14 2013 +0530
> @@ -266,6 +266,9 @@
>      // debugging
>      int       decodedPictureHashSEI;           ///<
> Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI
> message
>
> +    //Quality Measurement Metrics
> +    int        bEnablePsnr;
> +    int        bEnableSsim;
>

white-space cleaned up, changed comment to "// quality metrics" to match
comments above


>      struct
>      {
>          int       bitrate;
> diff -r 4014edcf2157 -r 0fa415d022c5 source/x265opts.h
> --- a/source/x265opts.h Fri Sep 27 02:18:36 2013 -0500
> +++ b/source/x265opts.h Sat Sep 28 09:54:14 2013 +0530
> @@ -96,3 +96,7 @@
>
>  HELP("SEI options:")
>  OPT("hash",            param->decodedPictureHashSEI,  required_argument,
> 0, "Decoded Picture Hash SEI 0: disabled, 1: MD5, 2: CRC, 3: Checksum ")
> +
> +HELP("Quality Measurement metrices: ")
> +OPT("ssim",            param->bEnableSsim,
>  required_argument, 0, "Log SSIM metric 0:disabled (defaullt), 1: enabled")
> +OPT("psnr",            param->bEnablePsnr,
>  required_argument, 0, "Log PSNR metric 0:disabled, 1: enabled(default)")
>

boolean options are handled differently.  I changed these to:

+HELP("Quality reporting metrics: ")
+OPT("no-ssim",         param->bEnableSsim,                  no_argument,
0, "Disable reporting SSIM metric scores")
+OPT("ssim",            param->bEnableSsim,                  no_argument,
0, "Enable reporting SSIM metric scores")
+OPT("no-psnr",         param->bEnablePsnr,                  no_argument,
0, "Disable reporting PSNR metric scores")
+OPT("psnr",            param->bEnablePsnr,                  no_argument,
0, "Enable reporting PSNR metric scores")

and moved them above the debugging hash option.  Note that it's not
required to document defaults in these help strings because they are
reported separately.

--
Steve Borho
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20130930/99696c81/attachment.html>


More information about the x265-devel mailing list