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

ashok at multicorewareinc.com ashok at multicorewareinc.com
Mon May 25 17:03:06 CEST 2015


# HG changeset patch
# User Ashok Kumar Mishra<ashok at multicorewareinc.com>
# Date 1432566054 -19800
#      Mon May 25 20:30:54 2015 +0530
# Node ID 96fd40f552e235581bc79f141137d320b90d266e
# Parent  16dcf6bf3b8545cd6e0f9c0b837f6764048930af
analysis: model the effectiveness of --limit-ref with RD 5/6

diff -r 16dcf6bf3b85 -r 96fd40f552e2 source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Mon May 25 20:30:54 2015 +0530
+++ b/source/encoder/analysis.cpp	Mon May 25 20:30:54 2015 +0530
@@ -1251,6 +1251,26 @@
             checkInter_rd5_6(md.pred[PRED_2Nx2N], cuGeom, SIZE_2Nx2N, 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, qp);


More information about the x265-devel mailing list