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

Min Chen chenm003 at 163.com
Sat Jun 27 04:13:22 CEST 2015


# 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)



More information about the x265-devel mailing list