[x265] [PATCH 4 of 4] simplify get cu address on loopfilter
Min Chen
chenm003 at 163.com
Sat Jun 21 01:41:41 CEST 2014
# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1403307685 25200
# Node ID 521c0206fc6ed96e97ce7fac62e269cdbe80aa68
# Parent 20a73ed13f54b3fea69e97ed8f8a4f907f1d7373
simplify get cu address on loopfilter
diff -r 20a73ed13f54 -r 521c0206fc6e source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp Fri Jun 20 16:41:11 2014 -0700
+++ b/source/encoder/frameencoder.cpp Fri Jun 20 16:41:25 2014 -0700
@@ -951,6 +951,7 @@
const uint32_t numCols = m_numCols;
const uint32_t lineStartCUAddr = row * numCols;
bool bIsVbv = m_param->rc.vbvBufferSize > 0 && m_param->rc.vbvMaxBitrate > 0;
+ TComDataCU* filterCuStart = m_pic->getCU(lineStartCUAddr - m_filterRowDelayCus + curRow.m_completed);
while (curRow.m_completed < numCols)
{
@@ -1080,16 +1081,14 @@
if (m_param->bEnableLoopFilter && row >= m_filterRowDelay)
{
- TComDataCU* tmpCu;
- tmpCu = m_pic->getCU(cuAddr - m_filterRowDelayCus);
- m_frameFilter.m_loopFilter.loopFilterCU(tmpCu, EDGE_VER, tld.edgeFilter, tld.blockingStrength);
+ m_frameFilter.m_loopFilter.loopFilterCU(filterCuStart, EDGE_VER, tld.edgeFilter, tld.blockingStrength);
if (col > 0)
{
- tmpCu = m_pic->getCU(cuAddr - m_filterRowDelayCus - 1);
- m_frameFilter.m_loopFilter.loopFilterCU(tmpCu, EDGE_HOR, tld.edgeFilter, tld.blockingStrength);
+ m_frameFilter.m_loopFilter.loopFilterCU(filterCuStart - 1, EDGE_HOR, tld.edgeFilter, tld.blockingStrength);
}
+ filterCuStart++;
}
}
@@ -1120,30 +1119,25 @@
// this row of CTUs has been encoded
if (m_param->bEnableLoopFilter)
{
- TComDataCU* tmpCu;
-
+ // NOTE: in here, filterCuStart is first cu at next row
if (row >= m_filterRowDelay)
{
- tmpCu = m_pic->getCU(lineStartCUAddr - m_filterRowDelayCus + numCols - 1);
- m_frameFilter.m_loopFilter.loopFilterCU(tmpCu, EDGE_HOR, tld.edgeFilter, tld.blockingStrength);
+ m_frameFilter.m_loopFilter.loopFilterCU(filterCuStart - 1, EDGE_HOR, tld.edgeFilter, tld.blockingStrength);
}
if (row == m_numRows - 1)
{
- TComDataCU* prevTmpCu;
- tmpCu = m_pic->getCU(lineStartCUAddr + 0);
- m_frameFilter.m_loopFilter.loopFilterCU(tmpCu, EDGE_VER, tld.edgeFilter, tld.blockingStrength);
+ m_frameFilter.m_loopFilter.loopFilterCU(filterCuStart, EDGE_VER, tld.edgeFilter, tld.blockingStrength);
+ filterCuStart++;
- prevTmpCu = tmpCu;
for(uint32_t i = 1; i < numCols; i++)
{
- tmpCu = m_pic->getCU(lineStartCUAddr + i);
- m_frameFilter.m_loopFilter.loopFilterCU(tmpCu, EDGE_VER, tld.edgeFilter, tld.blockingStrength);
- m_frameFilter.m_loopFilter.loopFilterCU(prevTmpCu, EDGE_HOR, tld.edgeFilter, tld.blockingStrength);
- prevTmpCu = tmpCu;
+ m_frameFilter.m_loopFilter.loopFilterCU(filterCuStart, EDGE_VER, tld.edgeFilter, tld.blockingStrength);
+ m_frameFilter.m_loopFilter.loopFilterCU(filterCuStart - 1, EDGE_HOR, tld.edgeFilter, tld.blockingStrength);
+ filterCuStart++;
}
- m_frameFilter.m_loopFilter.loopFilterCU(prevTmpCu, EDGE_HOR, tld.edgeFilter, tld.blockingStrength);
+ m_frameFilter.m_loopFilter.loopFilterCU(filterCuStart - 1, EDGE_HOR, tld.edgeFilter, tld.blockingStrength);
}
}
More information about the x265-devel
mailing list