[x265-commits] [x265] motion: UMH fix to match x264 behavior

Steve Borho steve at borho.org
Thu Mar 20 02:06:49 CET 2014


details:   http://hg.videolan.org/x265/rev/fcb916ec982f
branches:  
changeset: 6560:fcb916ec982f
user:      Steve Borho <steve at borho.org>
date:      Wed Mar 19 17:13:38 2014 -0500
description:
motion: UMH fix to match x264 behavior
Subject: [x265] motion: add missing parens in COST_MV() macro (fixes #41)

details:   http://hg.videolan.org/x265/rev/221d8aee9aa1
branches:  
changeset: 6561:221d8aee9aa1
user:      Steve Borho <steve at borho.org>
date:      Wed Mar 19 18:26:14 2014 -0500
description:
motion: add missing parens in COST_MV() macro (fixes #41)

diffstat:

 source/encoder/motion.cpp |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 96d1d690d2ab -r 221d8aee9aa1 source/encoder/motion.cpp
--- a/source/encoder/motion.cpp	Wed Mar 19 11:46:10 2014 -0500
+++ b/source/encoder/motion.cpp	Wed Mar 19 18:26:14 2014 -0500
@@ -179,7 +179,7 @@ static inline int x265_predictor_differe
 #define COST_MV(mx, my) \
     do \
     { \
-        int cost = sad(fenc, FENC_STRIDE, fref + mx + my * stride, stride); \
+        int cost = sad(fenc, FENC_STRIDE, fref + (mx) + (my) * stride, stride); \
         cost += mvcost(MV(mx, my) << 2); \
         COPY2_IF_LT(bcost, cost, bmv, MV(mx, my)); \
     } while (0)
@@ -217,6 +217,7 @@ static inline int x265_predictor_differe
 
 #define COST_MV_X4(m0x, m0y, m1x, m1y, m2x, m2y, m3x, m3y) \
     { \
+        pixel *pix_base = fref + omv.x + omv.y * stride; \
         sad_x4(fenc, \
                pix_base + (m0x) + (m0y) * stride, \
                pix_base + (m1x) + (m1y) * stride, \
@@ -705,7 +706,6 @@ me_hex2:
 
         /* refine predictors */
         omv = bmv;
-        pixel *pix_base = fref + omv.x + omv.y * stride;
         ucost1 = bcost;
         DIA1_ITER(pmv.x, pmv.y);
         if (pmv.notZero())


More information about the x265-commits mailing list