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

Min Chen chenm003 at 163.com
Wed Aug 12 00:24:37 CEST 2015


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

diff -r cbdefdfca877 -r aeae99c6c245 source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp	Thu Aug 06 14:23:43 2015 +0530
+++ b/source/encoder/frameencoder.cpp	Tue Aug 11 15:13:55 2015 -0700
@@ -877,6 +877,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);
@@ -901,11 +905,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