[x265] [PATCH] motion: skip the ME search if any of MVC sad cost is zero

Steve Borho steve at borho.org
Fri Jun 26 21:08:30 CEST 2015


On 06/26, gopu at multicorewareinc.com wrote:
> # HG changeset patch
> # User Gopu Govindaswamy <gopu at multicorewareinc.com>
> # Date 1435296461 -19800
> #      Fri Jun 26 10:57:41 2015 +0530
> # Node ID 6d7b0c5585cc6498ef40ddcf4a0d3c241892d5bf
> # Parent  09193c05af52b2024635037dbf9fa19d4b978e4b
> motion: skip the ME search if any of MVC sad cost is zero

the change looks reasonable, but this is an output changing commit and
thus I'd expect to see mention in the commit message about what effect
this has on performance and quality.

> diff -r 09193c05af52 -r 6d7b0c5585cc source/encoder/motion.cpp
> --- a/source/encoder/motion.cpp	Fri Jun 26 10:16:29 2015 +0530
> +++ b/source/encoder/motion.cpp	Fri Jun 26 10:57:41 2015 +0530
> @@ -646,7 +646,15 @@
>          MV m = mvc[i].clipped(qmvmin, qmvmax);
>          if (m.notZero() && m != pmv && m != bestpre) // check already measured
>          {
> -            int cost = subpelCompare(ref, m, sad) + mvcost(m);
> +            int cost = subpelCompare(ref, m, sad);
> +            // skip ME Search if any of MVC sad cost is zero
> +            if (!cost)
> +            {
> +                outQMv = m;
> +                return mvcost(m);
> +            }
> +            else
> +                cost += mvcost(m);
>              if (cost < bprecost)
>              {
>                  bprecost = cost;
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel

-- 
Steve Borho


More information about the x265-devel mailing list