I suggest you to modify macro
And this patch depends on side effect of conditional statment, it is bad code 
style.

At 2016-03-08 22:48:49,[email protected] wrote:
># HG changeset patch
># User Praveen Tiwari <[email protected]>
># Date 1457448163 -19800
>#      Tue Mar 08 20:12:43 2016 +0530
># Node ID 519441d72cf723dc3b279a91a6080f329729cb49
># Parent  0e1b6472c05e3a53538d8e064e502d8a7508eb6e
>motion.cpp: optimize 'X265_DIA_SEARCH' by eliminating costly branch 
>instructions
>
>diff -r 0e1b6472c05e -r 519441d72cf7 source/encoder/motion.cpp
>--- a/source/encoder/motion.cpp        Tue Mar 08 19:08:57 2016 +0530
>+++ b/source/encoder/motion.cpp        Tue Mar 08 20:12:43 2016 +0530
>@@ -659,10 +659,10 @@
>         do
>         {
>             COST_MV_X4_DIR(0, -1, 0, 1, -1, 0, 1, 0, costs);
>-            COPY1_IF_LT(bcost, (costs[0] << 4) + 1);
>-            COPY1_IF_LT(bcost, (costs[1] << 4) + 3);
>-            COPY1_IF_LT(bcost, (costs[2] << 4) + 4);
>-            COPY1_IF_LT(bcost, (costs[3] << 4) + 12);
>+            (((costs[0] << 4) + 1) < bcost) && (bcost = ((costs[0] << 4) + 
>1));  // if ((y) < (x)) (x) = (y);
>+            (((costs[1] << 4) + 3) < bcost) && (bcost = ((costs[1] << 4) + 
>3));
>+            (((costs[2] << 4) + 4) < bcost) && (bcost = ((costs[2] << 4) + 
>4));
>+            (((costs[3] << 4) + 12) < bcost) && (bcost = ((costs[3] << 4) + 
>12));
>             if (!(bcost & 15))
>                 break;
>             bmv.x -= (bcost << 28) >> 30;
>_______________________________________________
>x265-devel mailing list
>[email protected]
>https://mailman.videolan.org/listinfo/x265-devel
_______________________________________________
x265-devel mailing list
[email protected]
https://mailman.videolan.org/listinfo/x265-devel

Reply via email to