[x265] [PATCH] encoder: disable WPP if not enough columns

Steve Borho steve at borho.org
Tue Jan 6 07:55:23 CET 2015


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1420526733 -19800
#      Tue Jan 06 12:15:33 2015 +0530
# Node ID c07be75099f22d796a8c7180f03538725e83d787
# Parent  feebd0ecda691aeaf9265c7cb20897169df6866a
encoder: disable WPP if not enough columns

Prevents deadlocks if there are not enough CTUs to start the second row. This
exposes the next problem, which is a crash in deblocking that needs to resolved
after this fix.

diff -r feebd0ecda69 -r c07be75099f2 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Mon Jan 05 18:57:20 2015 +0530
+++ b/source/encoder/encoder.cpp	Tue Jan 06 12:15:33 2015 +0530
@@ -95,9 +95,10 @@
     x265_param* p = m_param;
 
     int rows = (p->sourceHeight + p->maxCUSize - 1) >> g_log2Size[p->maxCUSize];
+    int cols = (p->sourceWidth  + p->maxCUSize - 1) >> g_log2Size[p->maxCUSize];
 
-    // Do not allow WPP if only one row, it is pointless and unstable
-    if (rows == 1)
+    // Do not allow WPP if only one row or fewer than 3 columns, it is pointless and unstable
+    if (rows == 1 || cols < 3)
         p->bEnableWavefront = 0;
 
     int poolThreadCount = p->poolNumThreads ? p->poolNumThreads : getCpuCount();


More information about the x265-devel mailing list