[x265] [PATCH] introduce multi-level recursion skip

Santhoshini Sekar santhoshini at multicorewareinc.com
Thu Jun 23 06:47:18 CEST 2016


Will update and resend the patch.

On Thu, Jun 23, 2016 at 10:14 AM, Deepthi Nandakumar <
deepthi at multicorewareinc.com> wrote:

> Documentation, build version updates...
>
> On Thu, Jun 23, 2016 at 10:03 AM, <santhoshini at multicorewareinc.com>
> wrote:
>
>> # HG changeset patch
>> # User Santhoshini Sekar<santhoshini at multicorewareinc.com>
>> # Date 1466656132 -19800
>> #      Thu Jun 23 09:58:52 2016 +0530
>> # Node ID 20e1abc4b08ca2d2da24c340728e3db96d2806f8
>> # Parent  626fcbac7ffba723dabd3a9f0507c4c80f3e7bc9
>> introduce multi-level recursion skip
>>
>> diff -r 626fcbac7ffb -r 20e1abc4b08c source/common/param.cpp
>> --- a/source/common/param.cpp   Thu Jun 16 12:57:38 2016 +0530
>> +++ b/source/common/param.cpp   Thu Jun 23 09:58:52 2016 +0530
>> @@ -164,7 +164,7 @@
>>      param->bEnableWeightedPred = 1;
>>      param->bEnableWeightedBiPred = 0;
>>      param->bEnableEarlySkip = 0;
>> -    param->bEnableRecursionSkip = 1;
>> +    param->bEnableRecursionSkip = 2;
>>      param->bEnableAMP = 0;
>>      param->bEnableRectInter = 0;
>>      param->rdLevel = 3;
>> @@ -368,6 +368,7 @@
>>              param->maxNumMergeCand = 3;
>>              param->searchMethod = X265_STAR_SEARCH;
>>              param->maxNumReferences = 4;
>> +            param->bEnableRecursionSkip = 1;
>>              param->limitReferences = 2;
>>              param->limitModes = 1;
>>              param->bIntraInBFrames = 1;
>> @@ -389,7 +390,7 @@
>>              param->maxNumMergeCand = 4;
>>              param->searchMethod = X265_STAR_SEARCH;
>>              param->maxNumReferences = 5;
>> -            param->bEnableRecursionSkip = 0;
>> +            param->bEnableRecursionSkip = 1;
>>              param->limitReferences = 1;
>>              param->limitModes = 1;
>>              param->bIntraInBFrames = 1;
>> @@ -412,7 +413,7 @@
>>              param->maxNumMergeCand = 5;
>>              param->searchMethod = X265_STAR_SEARCH;
>>              param->bEnableTransformSkip = 1;
>> -            param->bEnableRecursionSkip = 0;
>> +            param->bEnableRecursionSkip = 1;
>>              param->maxNumReferences = 5;
>>              param->limitReferences = 0;
>>              param->bIntraInBFrames = 1;
>> @@ -620,7 +621,7 @@
>>      OPT("max-merge") p->maxNumMergeCand = (uint32_t)atoi(value);
>>      OPT("temporal-mvp") p->bEnableTemporalMvp = atobool(value);
>>      OPT("early-skip") p->bEnableEarlySkip = atobool(value);
>> -    OPT("recursion-skip") p->bEnableRecursionSkip = atobool(value);
>> +    OPT("rskip") p->bEnableRecursionSkip = atoi(value);
>>      OPT("rdpenalty") p->rdPenalty = atoi(value);
>>      OPT("tskip") p->bEnableTransformSkip = atobool(value);
>>      OPT("no-tskip-fast") p->bEnableTSkipFast = atobool(value);
>> @@ -1109,6 +1110,8 @@
>>            "RD Level is out of range");
>>      CHECK(param->rdoqLevel < 0 || param->rdoqLevel > 2,
>>          "RDOQ Level is out of range");
>> +    CHECK(param->bEnableRecursionSkip < 0 || param->bEnableRecursionSkip
>> > 2,
>> +          "rskip is out of range");
>>      CHECK(param->bframes && param->bframes >= param->lookaheadDepth &&
>> !param->rc.bStatRead,
>>            "Lookahead depth must be greater than the max consecutive
>> bframe count");
>>      CHECK(param->bframes < 0,
>> @@ -1351,7 +1354,7 @@
>>      TOOLVAL(param->psyRdoq, "psy-rdoq=%.2lf");
>>      TOOLOPT(param->bEnableRdRefine, "rd-refine");
>>      TOOLOPT(param->bEnableEarlySkip, "early-skip");
>> -    TOOLOPT(param->bEnableRecursionSkip, "recursion-skip");
>> +    TOOLVAL(param->bEnableRecursionSkip, "rskip=%d");
>>      TOOLVAL(param->noiseReductionIntra, "nr-intra=%d");
>>      TOOLVAL(param->noiseReductionInter, "nr-inter=%d");
>>      TOOLOPT(param->bEnableTSkipFast, "tskip-fast");
>> @@ -1410,7 +1413,7 @@
>>      s += sprintf(s, " max-merge=%d", p->maxNumMergeCand);
>>      BOOL(p->bEnableTemporalMvp, "temporal-mvp");
>>      BOOL(p->bEnableEarlySkip, "early-skip");
>> -    BOOL(p->bEnableRecursionSkip, "recursion-skip");
>> +    s += sprintf(s, "rskip=%d", p->bEnableRecursionSkip);
>>      s += sprintf(s, " rdpenalty=%d", p->rdPenalty);
>>      BOOL(p->bEnableTransformSkip, "tskip");
>>      BOOL(p->bEnableTSkipFast, "tskip-fast");
>> diff -r 626fcbac7ffb -r 20e1abc4b08c source/encoder/analysis.cpp
>> --- a/source/encoder/analysis.cpp       Thu Jun 16 12:57:38 2016 +0530
>> +++ b/source/encoder/analysis.cpp       Thu Jun 23 09:58:52 2016 +0530
>> @@ -949,7 +949,7 @@
>>          skipRecursion = md.bestMode->cu.isSkipped(0);
>>          if (mightSplit && depth >= minDepth && !skipRecursion)
>>          {
>> -            if (depth)
>> +            if (depth && m_param->bEnableRecursionSkip == 2)
>>                  skipRecursion = recursionDepthCheck(parentCTU, cuGeom,
>> *md.bestMode);
>>              if (m_bHD && !skipRecursion && m_param->rdLevel == 2 &&
>> md.fencYuv.m_size != MAX_CU_SIZE)
>>                  skipRecursion = complexityCheckCU(*md.bestMode);
>> @@ -1448,14 +1448,22 @@
>>      splitData[2].initSplitCUData();
>>      splitData[3].initSplitCUData();
>>
>> +    uint32_t allSplitRefs = splitData[0].splitRefs |
>> splitData[1].splitRefs | splitData[2].splitRefs | splitData[3].splitRefs;
>> +    uint32_t refMasks[2];
>>      /* Step 1. Evaluate Merge/Skip candidates for likely early-outs */
>>      if (mightNotSplit && !md.bestMode)
>>      {
>>          md.pred[PRED_SKIP].cu.initSubCU(parentCTU, cuGeom, qp);
>>          md.pred[PRED_MERGE].cu.initSubCU(parentCTU, cuGeom, qp);
>>          checkMerge2Nx2N_rd5_6(md.pred[PRED_SKIP], md.pred[PRED_MERGE],
>> cuGeom);
>> -        skipRecursion = m_param->bEnableRecursionSkip && md.bestMode &&
>> !md.bestMode->cu.getQtRootCbf(0);
>>          skipModes = m_param->bEnableEarlySkip && md.bestMode &&
>> !md.bestMode->cu.getQtRootCbf(0);
>> +        refMasks[0] = allSplitRefs;
>> +        md.pred[PRED_2Nx2N].cu.initSubCU(parentCTU, cuGeom, qp);
>> +        checkInter_rd5_6(md.pred[PRED_2Nx2N], cuGeom, SIZE_2Nx2N,
>> refMasks);
>> +        checkBestMode(md.pred[PRED_2Nx2N], cuGeom.depth);
>> +
>> +        if (m_param->bEnableRecursionSkip == 1 && depth &&
>> m_modeDepth[depth - 1].bestMode)
>> +            skipRecursion = md.bestMode &&
>> !md.bestMode->cu.getQtRootCbf(0);
>>      }
>>
>>      // estimate split cost
>> @@ -1511,7 +1519,7 @@
>>      /* Split CUs
>>       *   0  1
>>       *   2  3 */
>> -    uint32_t allSplitRefs = splitData[0].splitRefs |
>> splitData[1].splitRefs | splitData[2].splitRefs | splitData[3].splitRefs;
>> +    allSplitRefs = splitData[0].splitRefs | splitData[1].splitRefs |
>> splitData[2].splitRefs | splitData[3].splitRefs;
>>      /* Step 3. Evaluate ME (2Nx2N, rect, amp) and intra modes at current
>> depth */
>>      if (mightNotSplit)
>>      {
>> @@ -1522,9 +1530,6 @@
>>          {
>>              uint32_t refMasks[2];
>>              refMasks[0] = allSplitRefs;
>> -            md.pred[PRED_2Nx2N].cu.initSubCU(parentCTU, cuGeom, qp);
>> -            checkInter_rd5_6(md.pred[PRED_2Nx2N], cuGeom, SIZE_2Nx2N,
>> refMasks);
>> -            checkBestMode(md.pred[PRED_2Nx2N], cuGeom.depth);
>>
>>              if (m_param->limitReferences & X265_REF_LIMIT_CU)
>>              {
>> diff -r 626fcbac7ffb -r 20e1abc4b08c source/encoder/encoder.cpp
>> --- a/source/encoder/encoder.cpp        Thu Jun 16 12:57:38 2016 +0530
>> +++ b/source/encoder/encoder.cpp        Thu Jun 23 09:58:52 2016 +0530
>> @@ -2288,7 +2288,7 @@
>>      TOOLCMP(oldParam->maxNumReferences, newParam->maxNumReferences,
>> "ref=%d to %d\n");
>>      TOOLCMP(oldParam->bEnableFastIntra, newParam->bEnableFastIntra,
>> "fast-intra=%d to %d\n");
>>      TOOLCMP(oldParam->bEnableEarlySkip, newParam->bEnableEarlySkip,
>> "early-skip=%d to %d\n");
>> -    TOOLCMP(oldParam->bEnableRecursionSkip,
>> newParam->bEnableRecursionSkip, "recursion-skip=%d to %d\n");
>> +    TOOLCMP(oldParam->bEnableRecursionSkip,
>> newParam->bEnableRecursionSkip, "rskip=%d to %d\n");
>>      TOOLCMP(oldParam->searchMethod, newParam->searchMethod, "me=%d to
>> %d\n");
>>      TOOLCMP(oldParam->searchRange, newParam->searchRange, "merange=%d to
>> %d\n");
>>      TOOLCMP(oldParam->subpelRefine, newParam->subpelRefine, "subme= %d
>> to %d\n");
>> diff -r 626fcbac7ffb -r 20e1abc4b08c source/x265cli.h
>> --- a/source/x265cli.h  Thu Jun 16 12:57:38 2016 +0530
>> +++ b/source/x265cli.h  Thu Jun 23 09:58:52 2016 +0530
>> @@ -97,8 +97,7 @@
>>      { "amp",                  no_argument, NULL, 0 },
>>      { "no-early-skip",        no_argument, NULL, 0 },
>>      { "early-skip",           no_argument, NULL, 0 },
>> -    { "no-recursion-skip",    no_argument, NULL, 0 },
>> -    { "recursion-skip",       no_argument, NULL, 0 },
>> +    { "rskip",          required_argument, NULL, 0 },
>>      { "no-fast-cbf",          no_argument, NULL, 0 },
>>      { "fast-cbf",             no_argument, NULL, 0 },
>>      { "no-tskip",             no_argument, NULL, 0 },
>> @@ -314,7 +313,9 @@
>>      H0("   --[no-]psy-rdoq <0..50.0>     Strength of psycho-visual
>> optimization in RDO quantization, 0 to disable. Default %.1f\n",
>> param->psyRdoq);
>>      H0("   --[no-]rd-refine              Enable QP based RD refinement
>> for rd levels 5 and 6. Default %s\n", OPT(param->bEnableRdRefine));
>>      H0("   --[no-]early-skip             Enable early SKIP detection.
>> Default %s\n", OPT(param->bEnableEarlySkip));
>> -    H0("   --[no-]recursion-skip         Enable early exit from
>> recursion. Default %s\n", OPT(param->bEnableRecursionSkip));
>> +    H0("   --rskip <0..2>                0 - no early exit from
>> recursion,");
>> +    H0("                                 1 - Enable early exit from
>> recursion in rd 5,6,");
>> +    H0("                                 2 - Enable early exit from
>> recursion in rd 0-4. Default %s\n", OPT(param->bEnableRecursionSkip));
>>      H1("   --[no-]tskip-fast             Enable fast intra transform
>> skipping. Default %s\n", OPT(param->bEnableTSkipFast));
>>      H1("   --nr-intra <integer>          An integer value in range of 0
>> to 2000, which denotes strength of noise reduction in intra CUs. Default
>> 0\n");
>>      H1("   --nr-inter <integer>          An integer value in range of 0
>> to 2000, which denotes strength of noise reduction in inter CUs. Default
>> 0\n");
>> _______________________________________________
>> x265-devel mailing list
>> x265-devel at videolan.org
>> https://mailman.videolan.org/listinfo/x265-devel
>>
>
>
>
> --
> Deepthi Nandakumar
> Engineering Manager, x265
> Multicoreware, Inc
>
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20160623/c7571837/attachment-0001.html>


More information about the x265-devel mailing list