[x265] [PATCH 2 of 3] improve duplicate MV check by reduce condition jump

Deepthi Nandakumar deepthi at multicorewareinc.com
Mon Jun 29 05:51:03 CEST 2015


Hi,

How does this improve the generated asm code/cycles taken?

On Sat, Jun 27, 2015 at 7:43 AM, Min Chen <chenm003 at 163.com> wrote:

> # HG changeset patch
> # User Min Chen <chenm003 at 163.com>
> # Date 1435370055 25200
> # Node ID a8198965fbf18d7ced2cd8e8acd07fcc4ee6a2b3
> # Parent  229602ba850eb11c171d8c3cbb049dda4b41abda
> improve duplicate MV check by reduce condition jump
> ---
>  source/encoder/motion.cpp |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff -r 229602ba850e -r a8198965fbf1 source/encoder/motion.cpp
> --- a/source/encoder/motion.cpp Fri Jun 26 18:54:13 2015 -0700
> +++ b/source/encoder/motion.cpp Fri Jun 26 18:54:15 2015 -0700
> @@ -645,7 +645,7 @@
>          for (int i = 0; i < numCandidates; i++)
>          {
>              MV m = mvc[i].clipped(qmvmin, qmvmax);
> -            if (m.notZero() && m != pmv && m != bestpre) // check already
> measured
> +            if (m.notZero() & (m != pmv ? 1 : 0) & (m != bestpre ? 1 :
> 0)) // check already measured
>              {
>                  int cost = ref->lowresQPelCost(fenc, blockOffset, m, sad)
> + mvcost(m);
>                  if (cost < bprecost)
> @@ -661,7 +661,7 @@
>          for (int i = 0; i < numCandidates; i++)
>          {
>              MV m = mvc[i].clipped(qmvmin, qmvmax);
> -            if (m.notZero() && m != pmv && m != bestpre) // check already
> measured
> +            if (m.notZero() & (m != pmv ? 1 : 0) & (m != bestpre ? 1 :
> 0)) // check already measured
>              {
>                  int cost = subpelCompare(ref, m, sad) + mvcost(m);
>                  if (cost < bprecost)
>
> _______________________________________________
> 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/20150629/af943d2f/attachment.html>


More information about the x265-devel mailing list