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

ashok at multicorewareinc.com ashok at multicorewareinc.com
Tue May 19 15:16:59 CEST 2015


# HG changeset patch
# User Ashok Kumar Mishra<ashok at multicorewareinc.com>
# Date 1431935793 -19800
#      Mon May 18 13:26:33 2015 +0530
# Node ID f6c9a1e184fe7a8c17744117120828458be43106
# Parent  5bc61c2bc0cec50dc33eda9638f215de21fb4bcf
analysis: model the effectiveness of --limit-ref with RD 0/4

diff -r 5bc61c2bc0ce -r f6c9a1e184fe source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Mon May 18 13:24:42 2015 +0530
+++ b/source/encoder/analysis.cpp	Mon May 18 13:26:33 2015 +0530
@@ -850,6 +850,26 @@
             md.pred[PRED_2Nx2N].cu.initSubCU(parentCTU, cuGeom, qp);
             checkInter_rd0_4(md.pred[PRED_2Nx2N], cuGeom, SIZE_2Nx2N, refMasks);
 
+            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