[x265] [PATCH] consider skip cost in lookahead cost estimation

Deepthi Nandakumar deepthi at multicorewareinc.com
Fri Nov 6 07:16:42 CET 2015


This patch got pushed accidentally, I think we still need some work here.

On Fri, Nov 6, 2015 at 10:15 AM, <sagar at multicorewareinc.com> wrote:

> # HG changeset patch
> # User sagar at multicorewareinc.com
> # Date 1446785051 -19800
> #      Fri Nov 06 10:14:11 2015 +0530
> # Node ID 4013786f7013c20b073cbd58ff02b64af8f4f15f
> # Parent  39c35f175c8c515860ae4ea8ec75e15bc115d530
> consider skip cost in lookahead cost estimation
>
> diff -r 39c35f175c8c -r 4013786f7013 source/encoder/slicetype.cpp
> --- a/source/encoder/slicetype.cpp      Thu Nov 05 16:01:25 2015 +0530
> +++ b/source/encoder/slicetype.cpp      Fri Nov 06 10:14:11 2015 +0530
> @@ -2088,6 +2088,7 @@
>      for (int i = 0; i < 1 + bBidir; i++)
>      {
>          int& fencCost = fenc->lowresMvCosts[i][listDist[i]][cuXY];
> +        int skipCost = INT_MAX;
>
>          if (!bDoSearch[i])
>          {
> @@ -2129,6 +2130,9 @@
>                  intptr_t stride = X265_LOWRES_CU_SIZE;
>                  pixel *src = fref->lowresMC(pelOffset, mvc[idx],
> subpelbuf, stride);
>                  int cost = tld.me.bufSATD(src, stride);
> +                /* Except for mv0 case, everyting else is likely to have
> enough residual to not trigger the skip. */
> +                if (!mvp.notZero() && bBidir)
> +                    skipCost = cost;
>

I'm not sure this assumption is true at all. HEVC has merge MV candidates
that make skip/merge much more cheaper. Where is mvp initialised - is this
a bug?


>                  COPY2_IF_LT(mvpcost, cost, mvp, mvc[idx]);
>              }
>          }
> @@ -2136,6 +2140,11 @@
>          /* ME will never return a cost larger than the cost @MVP, so we
> do not
>           * have to check that ME cost is more than the estimated merge
> cost */
>          fencCost = tld.me.motionEstimate(fref, mvmin, mvmax, mvp, 0,
> NULL, s_merange, *fencMV);
> +        if (skipCost < 64 && skipCost < fencCost && bBidir)
> +        {
> +            fencCost = skipCost;
> +            *fencMV = 0;
> +        }
>          COPY2_IF_LT(bcost, fencCost, listused, i + 1);
>      }
>
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>



-- 
Deepthi Nandakumar
Engineering Manager, x265
Multicoreware, Inc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20151106/ffab2839/attachment.html>


More information about the x265-devel mailing list