[x265] [PATCH] analysis: init depth and mode analysis buffer at the begining of CTU compression. Encoder nits

sagar at multicorewareinc.com sagar at multicorewareinc.com
Wed Mar 9 09:52:18 CET 2016


# HG changeset patch
# User Sagar Kotecha<sagar at multicorewareinc.com>
# Date 1457442015 -19800
#      Tue Mar 08 18:30:15 2016 +0530
# Node ID 8999a30d29f479d8dc8425046c26af8581cfa2ba
# Parent  67b63012de821913ecde12c000d09a5a8e5c76fa
analysis: init depth and mode analysis buffer at the begining of CTU compression. Encoder nits.

diff -r 67b63012de82 -r 8999a30d29f4 source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Tue Mar 08 11:14:52 2016 +0530
+++ b/source/encoder/analysis.cpp	Tue Mar 08 18:30:15 2016 +0530
@@ -147,6 +147,8 @@
         int numPredDir = m_slice->isInterP() ? 1 : 2;
         m_reuseInterDataCTU = (analysis_inter_data*)m_frame->m_analysisData.interData;
         m_reuseRef = &m_reuseInterDataCTU->ref[ctu.m_cuAddr * X265_MAX_PRED_MODE_PER_CTU * numPredDir];
+        m_reuseDepth = &m_reuseInterDataCTU->depth[ctu.m_cuAddr * ctu.m_numPartitions];
+        m_reuseModes = &m_reuseInterDataCTU->modes[ctu.m_cuAddr * ctu.m_numPartitions];
         if (m_param->analysisMode == X265_ANALYSIS_SAVE)
             for (int i = 0; i < X265_MAX_PRED_MODE_PER_CTU * numPredDir; i++)
                 m_reuseRef[i] = -1;
@@ -900,9 +902,7 @@
     bool foundSkip = false;
     if (m_param->analysisMode == X265_ANALYSIS_LOAD)
     {
-        uint8_t* reuseDepth = &m_reuseInterDataCTU->depth[parentCTU.m_cuAddr * parentCTU.m_numPartitions];
-        uint8_t* reuseModes = &m_reuseInterDataCTU->modes[parentCTU.m_cuAddr * parentCTU.m_numPartitions];
-        if (mightNotSplit && depth == reuseDepth[cuGeom.absPartIdx] && reuseModes[cuGeom.absPartIdx] == MODE_SKIP)
+        if (mightNotSplit && depth == m_reuseDepth[cuGeom.absPartIdx] && m_reuseModes[cuGeom.absPartIdx] == MODE_SKIP)
         {
             md.pred[PRED_MERGE].cu.initSubCU(parentCTU, cuGeom, qp);
             md.pred[PRED_SKIP].cu.initSubCU(parentCTU, cuGeom, qp);
diff -r 67b63012de82 -r 8999a30d29f4 source/encoder/analysis.h
--- a/source/encoder/analysis.h	Tue Mar 08 11:14:52 2016 +0530
+++ b/source/encoder/analysis.h	Tue Mar 08 18:30:15 2016 +0530
@@ -117,9 +117,11 @@
     Mode& compressCTU(CUData& ctu, Frame& frame, const CUGeom& cuGeom, const Entropy& initialContext);
 
 protected:
-    /* Analysis data for load/save modes, keeps getting incremented as CTU analysis proceeds and data is consumed or read */
+    /* Analysis data for save/load mode, writes/reads data based on absPartIdx */
     analysis_inter_data* m_reuseInterDataCTU;
     int32_t*             m_reuseRef;
+    uint8_t*             m_reuseDepth;
+    uint8_t*             m_reuseModes;
 
     uint32_t m_splitRefIdx[4];
     uint64_t* cacheCost;
diff -r 67b63012de82 -r 8999a30d29f4 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Tue Mar 08 11:14:52 2016 +0530
+++ b/source/encoder/encoder.cpp	Tue Mar 08 18:30:15 2016 +0530
@@ -2122,10 +2122,8 @@
                 absPartIdx += ctu->m_numPartitions >> (depth * 2);
             }
         }
-
     }
 
-
     /* calculate frameRecordSize */
     analysis->frameRecordSize = sizeof(analysis->frameRecordSize) + sizeof(depthBytes) + sizeof(analysis->poc) + sizeof(analysis->sliceType) +
                       sizeof(analysis->numCUsInFrame) + sizeof(analysis->numPartitions) + sizeof(analysis->bScenecut) + sizeof(analysis->satdCost);


More information about the x265-devel mailing list