[x265] [PATCH 1 of 4] remove reduce operators outside loop in FrameEncoder::processRowEncoder()

Min Chen chenm003 at 163.com
Thu Aug 13 05:22:15 CEST 2015


# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1439422527 25200
# Node ID f627a263bb5c1dcf274ab281a02670449ae891fc
# Parent  bc5a7c2ac38b06d2a232b983f10bc0394d252ad7
remove reduce operators outside loop in FrameEncoder::processRowEncoder()
---
 source/encoder/frameencoder.cpp |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff -r bc5a7c2ac38b -r f627a263bb5c source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp	Wed Aug 12 15:13:51 2015 +0530
+++ b/source/encoder/frameencoder.cpp	Wed Aug 12 16:35:27 2015 -0700
@@ -878,6 +878,10 @@
     const uint32_t lineStartCUAddr = row * numCols;
     bool bIsVbv = m_param->rc.vbvBufferSize > 0 && m_param->rc.vbvMaxBitrate > 0;
 
+    uint32_t maxBlockCols = (m_frame->m_fencPic->m_picWidth + (16 - 1)) / 16;
+    uint32_t maxBlockRows = (m_frame->m_fencPic->m_picHeight + (16 - 1)) / 16;
+    uint32_t noOfBlocks = g_maxCUSize / 16;
+
     while (curRow.completed < numCols)
     {
         ProfileScopeEvent(encodeCTU);
@@ -902,11 +906,8 @@
                 cuStat.baseQp = curEncData.m_rowStat[row].diagQp;
 
             /* TODO: use defines from slicetype.h for lowres block size */
-            uint32_t maxBlockCols = (m_frame->m_fencPic->m_picWidth + (16 - 1)) / 16;
-            uint32_t maxBlockRows = (m_frame->m_fencPic->m_picHeight + (16 - 1)) / 16;
-            uint32_t noOfBlocks = g_maxCUSize / 16;
-            uint32_t block_y = (cuAddr / curEncData.m_slice->m_sps->numCuInWidth) * noOfBlocks;
-            uint32_t block_x = (cuAddr * noOfBlocks) - block_y * curEncData.m_slice->m_sps->numCuInWidth;
+            uint32_t block_y = (ctu->m_cuPelY >> g_maxLog2CUSize) * noOfBlocks;
+            uint32_t block_x = (ctu->m_cuPelX >> g_maxLog2CUSize) * noOfBlocks;
             
             cuStat.vbvCost = 0;
             cuStat.intraVbvCost = 0;



More information about the x265-devel mailing list