[x265] [PATCH 03 of 15] improve Parallel Deblock last row process
Min Chen
chenm003 at 163.com
Wed Dec 2 18:28:26 CET 2015
# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1449076347 21600
# Node ID c6e9344c5d47c029344369099ac63d5a52bdb3ed
# Parent 06510200bc514313f3fe0d4ee6a0b2592b2235a7
improve Parallel Deblock last row process
---
source/encoder/frameencoder.cpp | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff -r 06510200bc51 -r c6e9344c5d47 source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp Wed Dec 02 11:12:24 2015 -0600
+++ b/source/encoder/frameencoder.cpp Wed Dec 02 11:12:27 2015 -0600
@@ -1110,6 +1110,18 @@
m_frameFilter.m_pdeblock[row - 1].m_allowedCol.set(allowCol);
m_frameFilter.m_pdeblock[row - 1].tryBondPeers(*this, 1);
}
+
+ // Last Row may start early
+ if (row == m_numRows - 1)
+ {
+ // Waitting last threading finish
+ m_frameFilter.m_pdeblock[row].waitForExit();
+
+ // Processing last row
+ const int allowCol = ((row >= 2) ? X265_MIN(m_frameFilter.m_pdeblock[row - 1].m_lastCol.get(), (int)col) : col);
+ m_frameFilter.m_pdeblock[row].m_allowedCol.set(allowCol);
+ m_frameFilter.m_pdeblock[row].tryBondPeers(*this, 1);
+ }
}
if (m_param->bEnableWavefront && curRow.completed >= 2 && row < m_numRows - 1 &&
@@ -1208,6 +1220,7 @@
X265_CHECK(m_frameFilter.m_pdeblock[row - 1].m_allowedCol.get() == (int)numCols, "Deblock m_EncodedCol check failed");
/* NOTE: Last Row not execute before, so didn't need wait */
+ m_frameFilter.m_pdeblock[row].waitForExit();
m_frameFilter.m_pdeblock[row].m_allowedCol.set(numCols);
m_frameFilter.m_pdeblock[row].processTasks(-1);
}
More information about the x265-devel
mailing list