[x265] [PATCH 3 of 7] slicetype: respect new m_param->lookaheadSlices param

Steve Borho steve at borho.org
Thu Mar 26 17:27:23 CET 2015


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1427386359 18000
#      Thu Mar 26 11:12:39 2015 -0500
# Node ID 75e5803b6fa3b5c29582d88c37595e86d133c4bf
# Parent  32b79736f12800111bd5066f324183e1a488afd1
slicetype: respect new m_param->lookaheadSlices param

diff -r 32b79736f128 -r 75e5803b6fa3 source/encoder/slicetype.cpp
--- a/source/encoder/slicetype.cpp	Thu Mar 26 10:56:11 2015 -0500
+++ b/source/encoder/slicetype.cpp	Thu Mar 26 11:12:39 2015 -0500
@@ -514,12 +514,16 @@
      * of work */
     m_bBatchFrameCosts = m_bBatchMotionSearch;
 
-    if (m_bBatchMotionSearch && 0 && m_pool->m_numWorkers > 12)
+    if (m_param->lookaheadSlices && !m_pool)
+        m_param->lookaheadSlices = 0;
+
+    if (m_param->lookaheadSlices > 1)
     {
-        m_numRowsPerSlice = m_8x8Height / (m_pool->m_numWorkers - 1);   // default to numWorkers - 1 slices
+        m_numRowsPerSlice = m_8x8Height / m_param->lookaheadSlices;
         m_numRowsPerSlice = X265_MAX(m_numRowsPerSlice, 10);            // at least 10 rows per slice
         m_numRowsPerSlice = X265_MIN(m_numRowsPerSlice, m_8x8Height);   // but no more than the full picture
         m_numCoopSlices = m_8x8Height / m_numRowsPerSlice;
+        m_param->lookaheadSlices = m_numCoopSlices;                     // report actual final slice count
     }
     else
     {


More information about the x265-devel mailing list