<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 21, 2017 at 8:16 PM, <span dir="ltr"><<a href="mailto:ashok@multicorewareinc.com" target="_blank">ashok@multicorewareinc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Ashok Kumar Mishra <<a href="mailto:ashok@multicorewareinc.com">ashok@multicorewareinc.com</a>><br>
# Date 1498722236 -19800<br>
# Thu Jun 29 13:13:56 2017 +0530<br>
# Node ID 1a7edb6fd9932b09c2b5646c7dcc82<wbr>0a51795827<br>
# Parent f8ae7afc1f61ed0db3b2f23f5d5817<wbr>06fe6ed677<br>
deblock: removed bonded task group support in filtering<br>
Since filtering is very light weight process compared to encoding the ctu,<br>
there is no need to use bonded task group for filtering. There is little<br>
improvement in performance after removing bonded task group.<br></blockquote><div><br></div><div>LGTM - will push into default. Sorry for the delay!</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
diff -r f8ae7afc1f61 -r 1a7edb6fd993 source/encoder/frameencoder.<wbr>cpp<br>
--- a/source/encoder/frameencoder.<wbr>cpp Mon Sep 11 11:12:19 2017 +0530<br>
+++ b/source/encoder/frameencoder.<wbr>cpp Thu Jun 29 13:13:56 2017 +0530<br>
@@ -1264,10 +1264,7 @@<br>
if (bFirstRowInSlice && !curRow.completed)<br>
{<br>
// Load SBAC coder context from previous row and initialize row state.<br>
- //rowCoder.copyState(m_<wbr>initSliceContext);<br>
- //rowCoder.loadContexts(m_<wbr>rows[row - 1].bufferedEntropy);<br>
- rowCoder.load(m_<wbr>initSliceContext);<br>
- //m_rows[row - 1].bufferedEntropy.<wbr>loadContexts(m_<wbr>initSliceContext);<br>
+ rowCoder.load(m_<wbr>initSliceContext);<br>
}<br>
<br>
// calculate mean QP for consistent deltaQP signalling calculation<br>
@@ -1328,9 +1325,7 @@<br>
}<br>
curRow.avgQPComputed = 1;<br>
}<br>
- }<br>
-<br>
- // TODO: specially case handle on first and last row<br>
+ }<br>
<br>
// Initialize restrict on MV range in slices<br>
tld.analysis.m_sliceMinY = -(int16_t)(rowInSlice * m_param->maxCUSize * 4) + 3 * 4;<br>
@@ -1428,15 +1423,10 @@<br>
{<br>
// NOTE: in VBV mode, we may reencode anytime, so we can't do Deblock stage-Horizon and SAO<br>
if (!bIsVbv)<br>
- {<br>
- // TODO: Multiple Threading<br>
- // Delay ONE row to avoid Intra Prediction Conflict<br>
+ {<br>
+ // Delay one row to avoid intra prediction conflict<br>
if (m_pool && !bFirstRowInSlice)<br>
- {<br>
- // Waitting last threading finish<br>
- m_frameFilter.m_<wbr>parallelFilter[row - 1].waitForExit();<br>
-<br>
- // Processing new group<br>
+ {<br>
int allowCol = col;<br>
<br>
// avoid race condition on last column<br>
@@ -1446,15 +1436,11 @@<br>
: m_frameFilter.m_<wbr>parallelFilter[row - 2].m_lastCol.get()), (int)col);<br>
}<br>
m_frameFilter.m_<wbr>parallelFilter[row - 1].m_allowedCol.set(allowCol);<br>
- m_frameFilter.m_<wbr>parallelFilter[row - 1].tryBondPeers(*this, 1);<br>
}<br>
<br>
// Last Row may start early<br>
if (m_pool && bLastRowInSlice)<br>
{<br>
- // Waiting for the last thread to finish<br>
- m_frameFilter.m_<wbr>parallelFilter[row].<wbr>waitForExit();<br>
-<br>
// Deblocking last row<br>
int allowCol = col;<br>
<br>
@@ -1465,7 +1451,6 @@<br>
: m_frameFilter.m_<wbr>parallelFilter[row - 1].m_lastCol.get()), (int)col);<br>
}<br>
m_frameFilter.m_<wbr>parallelFilter[row].m_<wbr>allowedCol.set(allowCol);<br>
- m_frameFilter.m_<wbr>parallelFilter[row].<wbr>tryBondPeers(*this, 1);<br>
}<br>
} // end of !bIsVbv<br>
}<br>
@@ -1481,7 +1466,7 @@<br>
FrameStats frameLog;<br>
curEncData.m_rowStat[row].<wbr>sumQpAq += collectCTUStatistics(*ctu, &frameLog);<br>
<br>
- // copy no. of intra, inter Cu cnt per row into frame stats for 2 pass<br>
+ // copy number of intra, inter cu per row into frame stats for 2 pass<br>
if (m_param->rc.bStatWrite)<br>
{<br>
curRow.rowStats.mvBits += best.mvBits;<br>
@@ -1537,7 +1522,6 @@<br>
}<br>
<br>
// If current block is at row end checkpoint, call vbv ratecontrol.<br>
-<br>
if (!m_param->bEnableWavefront && col == numCols - 1)<br>
{<br>
double qpBase = curEncData.m_cuStat[cuAddr].<wbr>baseQp;<br>
@@ -1566,9 +1550,7 @@<br>
curEncData.m_rowStat[row].<wbr>sumQpAq = 0;<br>
}<br>
}<br>
-<br>
// If current block is at row diagonal checkpoint, call vbv ratecontrol.<br>
-<br>
else if (m_param->bEnableWavefront && row == col && row)<br>
{<br>
if (m_param->rc.bEnableConstVbv)<br>
@@ -1683,7 +1665,7 @@<br>
}<br>
}<br>
<br>
- /** this row of CTUs has been compressed **/<br>
+ /* this row of CTUs has been compressed */<br>
if (m_param->bEnableWavefront && m_param->rc.bEnableConstVbv)<br>
{<br>
if (row == m_numRows - 1)<br>
@@ -1740,13 +1722,10 @@<br>
/* Processing left Deblock block with current threading */<br>
if ((m_param->bEnableLoopFilter | m_param->bEnableSAO) & (rowInSlice >= 2))<br>
{<br>
- /* TODO: Multiple Threading */<br>
-<br>
/* Check conditional to start previous row process with current threading */<br>
if (m_frameFilter.m_<wbr>parallelFilter[row - 2].m_lastDeblocked.get() == (int)numCols)<br>
{<br>
/* stop threading on current row and restart it */<br>
- m_frameFilter.m_<wbr>parallelFilter[row - 1].waitForExit();<br>
m_frameFilter.m_<wbr>parallelFilter[row - 1].m_allowedCol.set(numCols);<br>
m_frameFilter.m_<wbr>parallelFilter[row - 1].processTasks(-1);<br>
}<br>
diff -r f8ae7afc1f61 -r 1a7edb6fd993 source/encoder/framefilter.cpp<br>
--- a/source/encoder/framefilter.<wbr>cpp Mon Sep 11 11:12:19 2017 +0530<br>
+++ b/source/encoder/framefilter.<wbr>cpp Thu Jun 29 13:13:56 2017 +0530<br>
@@ -582,10 +582,7 @@<br>
CUData* ctu = encData.getPicCTU(m_<wbr>parallelFilter[row].m_rowAddr)<wbr>;<br>
<br>
/* Processing left block Deblock with current threading */<br>
- {<br>
- /* stop threading on current row */<br>
- m_parallelFilter[row].<wbr>waitForExit();<br>
-<br>
+ {<br>
/* Check to avoid previous row process slower than current row */<br>
X265_CHECK(ctu->m_<wbr>bFirstRowInSlice || m_parallelFilter[row - 1].m_lastDeblocked.get() == m_numCols, "previous row not finish");<br>
<br>
@@ -618,7 +615,6 @@<br>
}<br>
<br>
// this row of CTUs has been encoded<br>
-<br>
if (!ctu->m_bFirstRowInSlice)<br>
processPostRow(row - 1);<br>
<br>
diff -r f8ae7afc1f61 -r 1a7edb6fd993 source/encoder/framefilter.h<br>
--- a/source/encoder/framefilter.h Mon Sep 11 11:12:19 2017 +0530<br>
+++ b/source/encoder/framefilter.h Thu Jun 29 13:13:56 2017 +0530<br>
@@ -62,7 +62,7 @@<br>
void* m_ssimBuf; /* Temp storage for ssim computation */<br>
<br>
#define MAX_PFILTER_CUS (4) /* maximum CUs for every thread */<br>
- class ParallelFilter : public BondedTaskGroup, public Deblock<br>
+ class ParallelFilter : public Deblock<br>
{<br>
public:<br>
uint32_t m_rowHeight;<br>
@@ -104,10 +104,6 @@<br>
{<br>
return m_rowHeight;<br>
}<br>
-<br>
- protected:<br>
-<br>
- ParallelFilter operator=(const ParallelFilter&);<br>
};<br>
<br>
ParallelFilter* m_parallelFilter;<br>
______________________________<wbr>_________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/x265-devel</a><br>
</blockquote></div><br></div></div>