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

ashok at multicorewareinc.com ashok at multicorewareinc.com
Tue Jun 23 17:17:19 CEST 2015


# HG changeset patch
# User Ashok Kumar Mishra<ashok at multicorewareinc.com>
# Date 1435071920 -19800
#      Tue Jun 23 20:35:20 2015 +0530
# Node ID 55085b7a911ef9486b5c5fd809e52904868a3d4d
# Parent  94cd345b70994ebfd1b2e1d3e7501d790c00670d
analysis: model the effectiveness of --limit-ref with RD 5/6

diff -r 94cd345b7099 -r 55085b7a911e source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Tue Jun 23 20:35:17 2015 +0530
+++ b/source/encoder/analysis.cpp	Tue Jun 23 20:35:20 2015 +0530
@@ -1254,6 +1254,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