[x265] [PATCH 2 of 3 RFC] frameencoder: store reflagrows as a member variable

santhoshini at multicorewareinc.com santhoshini at multicorewareinc.com
Fri Jul 11 13:24:45 CEST 2014


# HG changeset patch
# User Santhoshini Sekar <santhoshini at multicorewareinc.com>
# Date 1405071932 -19800
#      Fri Jul 11 15:15:32 2014 +0530
# Node ID 7acd78cdabfee453ba3b44b034eb2c87e587c7e6
# Parent  902e1d37847f0bc222fdc05dcd4a7f6dd26b0751
frameencoder: store reflagrows as a member variable

diff -r 902e1d37847f -r 7acd78cdabfe source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp	Fri Jul 11 14:54:00 2014 +0530
+++ b/source/encoder/frameencoder.cpp	Fri Jul 11 15:15:32 2014 +0530
@@ -92,6 +92,12 @@
     m_rows = new CTURow[m_numRows];
     bool ok = !!m_numRows;
 
+    int range = m_param->searchRange; /* fpel search */
+    range    += 1;                        /* diamond search range check lag */
+    range    += 2;                        /* subpel refine */
+    range    += NTAPS_LUMA / 2;           /* subpel filter half-length */
+    m_refLagRows = 1 + ((range + g_maxCUSize - 1) / g_maxCUSize);
+
     // NOTE: 2 times of numRows because both Encoder and Filter in same queue
     if (!WaveFront::init(m_numRows * 2))
     {
@@ -706,11 +712,6 @@
 
     bool bUseWeightP = slice->getPPS()->getUseWP() && slice->getSliceType() == P_SLICE;
     bool bUseWeightB = slice->getPPS()->getWPBiPred() && slice->getSliceType() == B_SLICE;
-    int range = m_param->searchRange; /* fpel search */
-    range    += 1;                    /* diamond search range check lag */
-    range    += 2;                    /* subpel refine */
-    range    += NTAPS_LUMA / 2;       /* subpel filter half-length */
-    int refLagRows = 1 + ((range + g_maxCUSize - 1) / g_maxCUSize);
     int numPredDir = slice->isInterP() ? 1 : slice->isInterB() ? 2 : 0;
 
     m_SSDY = m_SSDU = m_SSDV = 0;
@@ -735,14 +736,14 @@
                     Frame *refpic = slice->getRefPic(l, ref);
 
                     int reconRowCount = refpic->m_reconRowCount.get();
-                    while ((reconRowCount != m_numRows) && (reconRowCount < row + refLagRows))
+                    while ((reconRowCount != m_numRows) && (reconRowCount < row + m_refLagRows))
                     {
                         reconRowCount = refpic->m_reconRowCount.waitForChange(reconRowCount);
                     }
 
                     if ((bUseWeightP || bUseWeightB) && m_mref[l][ref].isWeighted)
                     {
-                        m_mref[l][ref].applyWeight(row + refLagRows, m_numRows);
+                        m_mref[l][ref].applyWeight(row + m_refLagRows, m_numRows);
                     }
                 }
             }
@@ -774,14 +775,14 @@
                         Frame *refpic = slice->getRefPic(list, ref);
 
                         int reconRowCount = refpic->m_reconRowCount.get();
-                        while ((reconRowCount != m_numRows) && (reconRowCount < i + refLagRows))
+                        while ((reconRowCount != m_numRows) && (reconRowCount < i + m_refLagRows))
                         {
                             reconRowCount = refpic->m_reconRowCount.waitForChange(reconRowCount);
                         }
 
                         if ((bUseWeightP || bUseWeightB) && m_mref[l][ref].isWeighted)
                         {
-                            m_mref[list][ref].applyWeight(i + refLagRows, m_numRows);
+                            m_mref[list][ref].applyWeight(i + m_refLagRows, m_numRows);
                         }
                     }
                 }
diff -r 902e1d37847f -r 7acd78cdabfe source/encoder/frameencoder.h
--- a/source/encoder/frameencoder.h	Fri Jul 11 14:54:00 2014 +0530
+++ b/source/encoder/frameencoder.h	Fri Jul 11 15:15:32 2014 +0530
@@ -117,6 +117,7 @@
 
     int                      m_numRows;
     uint32_t                 m_numCols;
+    int                      m_refLagRows;
     CTURow*                  m_rows;
     TComSPS                  m_sps;
     TComPPS                  m_pps;


More information about the x265-devel mailing list