[x265] [PATCH 01 of 14] motion: avoid extra iterations when no subpel motion found
Steve Borho
steve at borho.org
Sat Sep 20 18:46:00 CEST 2014
# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1411226340 -3600
# Sat Sep 20 16:19:00 2014 +0100
# Node ID 44f174426508ee9b03562d46f16ea7eaa2e0d493
# Parent c8f53398f8ceb9e536c2f1569fe4a2a2756aa014
motion: avoid extra iterations when no subpel motion found
subsequent iterations would have also returned zero, which would be pointless.
this is an adaption of a patch by Sheva Xu.
diff -r c8f53398f8ce -r 44f174426508 source/encoder/motion.cpp
--- a/source/encoder/motion.cpp Sat Sep 20 15:41:08 2014 +0100
+++ b/source/encoder/motion.cpp Sat Sep 20 16:19:00 2014 +0100
@@ -1097,7 +1097,10 @@
COPY2_IF_LT(bcost, cost, bdir, i);
}
- bmv += square1[bdir] * 2;
+ if (bdir)
+ bmv += square1[bdir] * 2;
+ else
+ break;
}
/* if HPEL search used SAD, remeasure with SATD before QPEL */
@@ -1114,7 +1117,10 @@
COPY2_IF_LT(bcost, cost, bdir, i);
}
- bmv += square1[bdir];
+ if (bdir)
+ bmv += square1[bdir];
+ else
+ break;
}
}
More information about the x265-devel
mailing list