[x265] [PATCH] fix vec/asm crash in COST_MV_X3_DIR: costs+3 is not aligned

Wenju He wenju at multicorewareinc.com
Sat Nov 2 16:24:23 CET 2013


# HG changeset patch
# User Wenju He <wenju at multicorewareinc.com>
# Date 1383405562 18000
#      Sat Nov 02 10:19:22 2013 -0500
# Node ID 8621008756ba1b910d383a1a1f0d2fd295dbdd38
# Parent  c51c35880df53def63953e95d81ad90b56ea67b9
fix vec/asm crash in COST_MV_X3_DIR: costs+3 is not aligned

diff -r c51c35880df5 -r 8621008756ba source/encoder/motion.cpp
--- a/source/encoder/motion.cpp	Wed Oct 30 16:59:47 2013 +0800
+++ b/source/encoder/motion.cpp	Sat Nov 02 10:19:22 2013 -0500
@@ -405,14 +405,14 @@
 #else // if 0
       /* equivalent to the above, but eliminates duplicate candidates */
         COST_MV_X3_DIR(-2, 0, -1, 2,  1, 2, costs);
-        COST_MV_X3_DIR(2, 0,  1, -2, -1, -2, costs + 3);
         bcost <<= 3;
         COPY1_IF_LT(bcost, (costs[0] << 3) + 2);
         COPY1_IF_LT(bcost, (costs[1] << 3) + 3);
         COPY1_IF_LT(bcost, (costs[2] << 3) + 4);
-        COPY1_IF_LT(bcost, (costs[3] << 3) + 5);
-        COPY1_IF_LT(bcost, (costs[4] << 3) + 6);
-        COPY1_IF_LT(bcost, (costs[5] << 3) + 7);
+        COST_MV_X3_DIR(2, 0,  1, -2, -1, -2, costs);
+        COPY1_IF_LT(bcost, (costs[0] << 3) + 5);
+        COPY1_IF_LT(bcost, (costs[1] << 3) + 6);
+        COPY1_IF_LT(bcost, (costs[2] << 3) + 7);
 
         if (bcost & 7)
         {


More information about the x265-devel mailing list