[x265] [PATCH 03 of 24] improve Parallel Deblock last row process

Min Chen chenm003 at 163.com
Tue Dec 8 00:54:40 CET 2015


# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1449511555 21600
# Node ID 2c6a7879eca09d28a8bcc467c0186f40b387fdd6
# Parent  6726fba8beab483428949404d6ffbd4f345e9149
improve Parallel Deblock last row process
---
 source/encoder/frameencoder.cpp |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff -r 6726fba8beab -r 2c6a7879eca0 source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp	Mon Dec 07 12:05:52 2015 -0600
+++ b/source/encoder/frameencoder.cpp	Mon Dec 07 12:05:55 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