[x265] [PATCH 2 of 2] slicetype: fix fast-intra scan, calc +/- dist modes up front

Steve Borho steve at borho.org
Thu Jan 8 05:59:25 CET 2015


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1420693149 -19800
#      Thu Jan 08 10:29:09 2015 +0530
# Node ID bfaae3de4fde009255181c48707273c691837ded
# Parent  ad1beedf5dd689e1d59d5d41e8e9b53d87d4c75b
slicetype: fix fast-intra scan, calc +/- dist modes up front

If the minus mode was the new best, the plus mode ended up being the same as
the previous best mode from the first pass, so we never tried the other
direction.  [CHANGES OUTPUTS]

diff -r ad1beedf5dd6 -r bfaae3de4fde source/encoder/slicetype.cpp
--- a/source/encoder/slicetype.cpp	Thu Jan 08 09:28:57 2015 +0530
+++ b/source/encoder/slicetype.cpp	Thu Jan 08 10:29:09 2015 +0530
@@ -1733,14 +1733,17 @@
             }
             for (uint32_t dist = 2; dist >= 1; dist--)
             {
-                mode = lowmode - dist;
+                int minusmode = lowmode - dist;
+                int plusmode = lowmode + dist;
+
+                mode = minusmode;
                 if (mode < 18)
                     cost = satd(buf_trans, cuSize, &m_predictions[mode * predsize], cuSize);
                 else
                     cost = m_me.bufSATD(&m_predictions[mode * predsize], cuSize);
                 COPY2_IF_LT(acost, cost, lowmode, mode);
 
-                mode = lowmode + dist;
+                mode = plusmode;
                 if (mode < 18)
                     cost = satd(buf_trans, cuSize, &m_predictions[mode * predsize], cuSize);
                 else


More information about the x265-devel mailing list