Re: [x265] [PATCH 1 of 2] Add option to enable slice-based SAO filter

2019-09-16 Thread Mario *LigH* Rohkrämer

redbtn in the doom9 forums reported an issue in source/common/param.cpp:

po...@multicorewareinc.com schrieb am 11.09.2019 um 19:18:

@@ -1971,6 +1984,7 @@
  BOOL(p->bEnableSAO, "sao");
  BOOL(p->bSaoNonDeblocked, "sao-non-deblock");
  s += sprintf(s, " rd=%d", p->rdLevel);
+s += sprintf(s, "selective-sao=%d", p->selectiveSAO);
  BOOL(p->bEnableEarlySkip, "early-skip");
  BOOL(p->bEnableRecursionSkip, "rskip");
  BOOL(p->bEnableFastIntra, "fast-intra");


A missing space causes the embedded parameter string to be invalid.

-s += sprintf(s, "selective-sao=%d", p->selectiveSAO);
+s += sprintf(s, " selective-sao=%d", p->selectiveSAO);

--

Fun and success!

Mario *LigH* Rohkrämer
maito:cont...@ligh.de
___
x265-devel mailing list
x265-devel@videolan.org
https://mailman.videolan.org/listinfo/x265-devel


Re: [x265] [PATCH 1 of 2] Add option to enable slice-based SAO filter

2019-09-12 Thread Aruna Matheswaran
Pushed to default.

On Wed, Sep 11, 2019 at 10:48 PM  wrote:

> # HG changeset patch
> # User Pooja Venkatesan 
> # Date 1567500944 -19800
> #  Tue Sep 03 14:25:44 2019 +0530
> # Node ID 5e791399ec4a0a788f880a9967c9e21fbaa22fa3
> # Parent  a092e82e6acfe7afe6a9a381e9ef52323e4e2467
> Add option to enable slice-based SAO filter.
>
> diff -r a092e82e6acf -r 5e791399ec4a doc/reST/cli.rst
> --- a/doc/reST/cli.rst  Thu Aug 01 22:55:21 2019 +0200
> +++ b/doc/reST/cli.rst  Tue Sep 03 14:25:44 2019 +0530
> @@ -1996,6 +1996,24 @@
> on inter prediction mode, CTU spatial-domain correlations, and
> relations
> between luma and chroma.
> Default disabled
> +
> +.. option:: --selective-sao <0..4>
> +
> +   Toggles SAO at slice level. Default 4.
> +
> +   +--+---+
> +   | Level|  Description  |
> +   +==+===+
> +   |  0   | Disable SAO for all slices|
> +   +--+---+
> +   |  1   | Enable SAO only for I-slices  |
> +   +--+---+
> +   |  2   | Enable SAO for I-slices & P-slices|
> |
> +   +--+---+
> +   |  3   | Enable SAO for all reference slices   |
> +   +--+---+
> +   |  4   | Enable SAO for all slices |
> +   +--+---+
>
>  VUI (Video Usability Information) options
>  =
> diff -r a092e82e6acf -r 5e791399ec4a source/CMakeLists.txt
> --- a/source/CMakeLists.txt Thu Aug 01 22:55:21 2019 +0200
> +++ b/source/CMakeLists.txt Tue Sep 03 14:25:44 2019 +0530
> @@ -29,7 +29,7 @@
>  option(STATIC_LINK_CRT "Statically link C runtime for release builds" OFF)
>  mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)
>  # X265_BUILD must be incremented each time the public API is changed
> -set(X265_BUILD 178)
> +set(X265_BUILD 179)
>  configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
> "${PROJECT_BINARY_DIR}/x265.def")
>  configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
> diff -r a092e82e6acf -r 5e791399ec4a source/common/param.cpp
> --- a/source/common/param.cpp   Thu Aug 01 22:55:21 2019 +0200
> +++ b/source/common/param.cpp   Tue Sep 03 14:25:44 2019 +0530
> @@ -215,6 +215,7 @@
>  param->bEnableSAO = 1;
>  param->bSaoNonDeblocked = 0;
>  param->bLimitSAO = 0;
> +param->selectiveSAO = 4;
>
>  /* Coding Quality */
>  param->cbQpOffset = 0;
> @@ -375,6 +376,7 @@
>  param->subpelRefine = 0;
>  param->searchMethod = X265_DIA_SEARCH;
>  param->bEnableSAO = 0;
> +param->selectiveSAO = 0;
>  param->bEnableSignHiding = 0;
>  param->bEnableWeightedPred = 0;
>  param->rdLevel = 2;
> @@ -404,6 +406,7 @@
>  param->rc.hevcAq = 0;
>  param->rc.qgSize = 32;
>  param->bEnableSAO = 0;
> +param->selectiveSAO = 0;
>  param->bEnableFastIntra = 1;
>  }
>  else if (!strcmp(preset, "veryfast"))
> @@ -551,6 +554,7 @@
>  {
>  param->bEnableLoopFilter = 0;
>  param->bEnableSAO = 0;
> +param->selectiveSAO = 0;
>  param->bEnableWeightedPred = 0;
>  param->bEnableWeightedBiPred = 0;
>  param->bIntraInBFrames = 0;
> @@ -578,6 +582,7 @@
>  param->psyRd = 4.0;
>  param->psyRdoq = 10.0;
>  param->bEnableSAO = 0;
> +param->selectiveSAO = 0;
>  param->rc.bEnableConstVbv = 1;
>  }
>  else if (!strcmp(tune, "animation"))
> @@ -1282,6 +1287,10 @@
>  OPT("svt-pred-struct") x265_log(p, X265_LOG_WARNING, "Option %s
> is SVT-HEVC Encoder specific; Disabling it here \n", name);
>  OPT("svt-fps-in-vps") x265_log(p, X265_LOG_WARNING, "Option %s is
> SVT-HEVC Encoder specific; Disabling it here \n", name);
>  #endif
> +OPT("selective-sao")
> +{
> +p->selectiveSAO = atoi(value);
> +}
>  OPT("fades") p->bEnableFades = atobool(value);
>  OPT("field") p->bField = atobool( value );
>  OPT("cll") p->bEmitCLL = atobool(value);
> @@ -1686,6 +1695,8 @@
>  CHECK( (param->bFrameAdaptive==0), "Adaptive B-frame decision
> method should be closed for field feature.\n" );
>  // to do
>  }
> +CHECK(param->selectiveSAO < 0 || param->selectiveSAO > 4,
> +"Invalid SAO tune level. Value must be between 0 and 4
> (inclusive)");
>  #if !X86_64
>  CHECK(param->searchMethod == X265_SEA && (param->sourceWidth > 840 ||
> param->sourceHeight