[x265] [PATCH 06 of 10 RFC] analysis: model the effectiveness of --limit-ref 2 with RD 5/6

Steve Borho steve at borho.org
Tue Mar 31 03:29:42 CEST 2015


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1426555173 18000
#      Mon Mar 16 20:19:33 2015 -0500
# Node ID 163b009d3699dfb289c5bea76a1783988b62352d
# Parent  23723c32cda19378c81a31e93433f0e1130fa7c3
analysis: model the effectiveness of --limit-ref 2 with RD 5/6

diff -r 23723c32cda1 -r 163b009d3699 source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Mon Mar 16 20:19:33 2015 -0500
+++ b/source/encoder/analysis.cpp	Mon Mar 16 20:19:33 2015 -0500
@@ -1133,6 +1133,26 @@
         checkInter_rd5_6(md.pred[PRED_2Nx2N], cuGeom, SIZE_2Nx2N, false, refMasks);
         checkBestMode(md.pred[PRED_2Nx2N], cuGeom.depth);
 
+        if (m_param->limitReferences & X265_REF_LIMIT_CU)
+        {
+            CUData& cu = md.pred[PRED_2Nx2N].cu;
+            int refMask;
+            switch (cu.m_interDir[0])
+            {
+            case 1:
+                refMask = 1 << cu.m_refIdx[0][0];
+                break;
+            case 2:
+                refMask = 1 << (cu.m_refIdx[1][0] + 16);
+                break;
+            case 3:
+                refMask = 1 << cu.m_refIdx[0][0];
+                refMask |= 1 << (cu.m_refIdx[1][0] + 16);
+                break;
+            }
+            allSplitRefs = splitRefs[0] = splitRefs[1] = splitRefs[2] = splitRefs[3] = refMask;
+        }
+
         if (m_slice->m_sliceType == B_SLICE)
         {
             md.pred[PRED_BIDIR].cu.initSubCU(parentCTU, cuGeom);


More information about the x265-devel mailing list