<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 10, 2013 at 3:29 AM, <span dir="ltr"><<a href="mailto:gopu@multicorewareinc.com" target="_blank">gopu@multicorewareinc.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User ggopu<br>
# Date 1373444960 -19800<br>
# Node ID 6521ffbcacf590c2dab886e192ec19c321dc32ca<br>
# Parent ae3cf6062c1ac55006e71a591e1ab8766f332ecc<br>
TEncodeSearch : Cleanup Removed un used codes, white space and Removed Hungarian Notation<br></blockquote><div><br></div><div style>I had hoped you would take my hint from the follow-on commits for your last patches. When you remove the hungarian notation you are supposed to make the variables start with a lower-case character.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
diff -r ae3cf6062c1a -r 6521ffbcacf5 source/Lib/TLibEncoder/TEncSearch.cpp<br>
--- a/source/Lib/TLibEncoder/TEncSearch.cpp Wed Jul 10 00:41:02 2013 -0500<br>
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp Wed Jul 10 13:59:20 2013 +0530<br>
@@ -274,13 +274,11 @@<br>
m_pcTrQuant->setLambda(lambdaLuma, lambdaChroma);<br>
}<br>
<br>
-__inline Void TEncSearch::xTZSearchHelp(TComPattern* pcPatternKey, IntTZSearchStruct& rcStruct, const Int iSearchX, const Int iSearchY, const UChar ucPointNr, const UInt uiDistance)<br>
+__inline Void TEncSearch::xTZSearchHelp(TComPattern* pcPatternKey, IntTZSearchStruct& rcStruct, const Int SearchX, const Int SearchY, const UChar PointNr, const UInt Distance)<br>
{<br>
- UInt uiSad;<br>
-<br>
- Pel* piRefSrch = rcStruct.piRefY + iSearchY * rcStruct.iYStride + iSearchX;<br>
-<br>
- m_pcRdCost->setDistParam(pcPatternKey, piRefSrch, rcStruct.iYStride, m_cDistParam);<br>
+ UInt Sad;<br>
+ Pel* RefSrch = rcStruct.piRefY + SearchY * rcStruct.iYStride + SearchX;<br>
+ m_pcRdCost->setDistParam(pcPatternKey, RefSrch, rcStruct.iYStride, m_cDistParam);<br>
<br>
if (m_cDistParam.iRows > 12)<br>
{<br>
@@ -290,142 +288,142 @@<br>
<br>
// distortion<br>
m_cDistParam.bitDepth = g_bitDepthY;<br>
- uiSad = m_cDistParam.DistFunc(&m_cDistParam);<br>
+ Sad = m_cDistParam.DistFunc(&m_cDistParam);<br>
<br>
// motion cost<br>
- uiSad += m_bc.mvcost(MV(iSearchX, iSearchY) << m_pcRdCost->m_iCostScale);<br>
-<br>
- if (uiSad < rcStruct.uiBestSad)<br>
+ Sad += m_bc.mvcost(MV(SearchX, SearchY) << m_pcRdCost->m_iCostScale);<br>
+<br>
+ if (Sad < rcStruct.uiBestSad)<br>
{<br>
- rcStruct.uiBestSad = uiSad;<br>
- rcStruct.iBestX = iSearchX;<br>
- rcStruct.iBestY = iSearchY;<br>
- rcStruct.uiBestDistance = uiDistance;<br>
+ rcStruct.uiBestSad = Sad;<br>
+ rcStruct.iBestX = SearchX;<br>
+ rcStruct.iBestY = SearchY;<br>
+ rcStruct.uiBestDistance = Distance;<br>
rcStruct.uiBestRound = 0;<br>
- rcStruct.ucPointNr = ucPointNr;<br>
+ rcStruct.ucPointNr = PointNr;<br>
}<br>
}<br>
<br>
__inline Void TEncSearch::xTZ2PointSearch(TComPattern* pcPatternKey, IntTZSearchStruct& rcStruct, MV* pcMvSrchRngLT, MV* pcMvSrchRngRB)<br>
{<br>
- Int iSrchRngHorLeft = pcMvSrchRngLT->x;<br>
- Int iSrchRngHorRight = pcMvSrchRngRB->x;<br>
- Int iSrchRngVerTop = pcMvSrchRngLT->y;<br>
- Int iSrchRngVerBottom = pcMvSrchRngRB->y;<br>
+ Int SrchRngHorLeft = pcMvSrchRngLT->x;<br>
+ Int SrchRngHorRight = pcMvSrchRngRB->x;<br>
+ Int SrchRngVerTop = pcMvSrchRngLT->y;<br>
+ Int SrchRngVerBottom = pcMvSrchRngRB->y;<br>
<br>
// 2 point search, // 1 2 3<br>
// check only the 2 untested points // 4 0 5<br>
// around the start point // 6 7 8<br>
- Int iStartX = rcStruct.iBestX;<br>
- Int iStartY = rcStruct.iBestY;<br>
+ Int StartX = rcStruct.iBestX;<br>
+ Int StartY = rcStruct.iBestY;<br>
<br>
switch (rcStruct.ucPointNr)<br>
{<br>
case 1:<br>
{<br>
- if ((iStartX - 1) >= iSrchRngHorLeft)<br>
+ if ((StartX - 1) >= SrchRngHorLeft)<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX - 1, iStartY, 0, 2);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX - 1, StartY, 0, 2);<br>
}<br>
- if ((iStartY - 1) >= iSrchRngVerTop)<br>
+ if ((StartY - 1) >= SrchRngVerTop)<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX, iStartY - 1, 0, 2);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX, StartY - 1, 0, 2);<br>
}<br>
}<br>
break;<br>
case 2:<br>
{<br>
- if ((iStartY - 1) >= iSrchRngVerTop)<br>
+ if ((StartY - 1) >= SrchRngVerTop)<br>
{<br>
- if ((iStartX - 1) >= iSrchRngHorLeft)<br>
+ if ((StartX - 1) >= SrchRngHorLeft)<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX - 1, iStartY - 1, 0, 2);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX - 1, StartY - 1, 0, 2);<br>
}<br>
- if ((iStartX + 1) <= iSrchRngHorRight)<br>
+ if ((StartX + 1) <= SrchRngHorRight)<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX + 1, iStartY - 1, 0, 2);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX + 1, StartY - 1, 0, 2);<br>
}<br>
}<br>
}<br>
break;<br>
case 3:<br>
{<br>
- if ((iStartY - 1) >= iSrchRngVerTop)<br>
+ if ((StartY - 1) >= SrchRngVerTop)<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX, iStartY - 1, 0, 2);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX, StartY - 1, 0, 2);<br>
}<br>
- if ((iStartX + 1) <= iSrchRngHorRight)<br>
+ if ((StartX + 1) <= SrchRngHorRight)<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX + 1, iStartY, 0, 2);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX + 1, StartY, 0, 2);<br>
}<br>
}<br>
break;<br>
case 4:<br>
{<br>
- if ((iStartX - 1) >= iSrchRngHorLeft)<br>
+ if ((StartX - 1) >= SrchRngHorLeft)<br>
{<br>
- if ((iStartY + 1) <= iSrchRngVerBottom)<br>
+ if ((StartY + 1) <= SrchRngVerBottom)<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX - 1, iStartY + 1, 0, 2);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX - 1, StartY + 1, 0, 2);<br>
}<br>
- if ((iStartY - 1) >= iSrchRngVerTop)<br>
+ if ((StartY - 1) >= SrchRngVerTop)<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX - 1, iStartY - 1, 0, 2);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX - 1, StartY - 1, 0, 2);<br>
}<br>
}<br>
}<br>
break;<br>
case 5:<br>
{<br>
- if ((iStartX + 1) <= iSrchRngHorRight)<br>
+ if ((StartX + 1) <= SrchRngHorRight)<br>
{<br>
- if ((iStartY - 1) >= iSrchRngVerTop)<br>
+ if ((StartY - 1) >= SrchRngVerTop)<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX + 1, iStartY - 1, 0, 2);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX + 1, StartY - 1, 0, 2);<br>
}<br>
- if ((iStartY + 1) <= iSrchRngVerBottom)<br>
+ if ((StartY + 1) <= SrchRngVerBottom)<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX + 1, iStartY + 1, 0, 2);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX + 1, StartY + 1, 0, 2);<br>
}<br>
}<br>
}<br>
break;<br>
case 6:<br>
{<br>
- if ((iStartX - 1) >= iSrchRngHorLeft)<br>
+ if ((StartX - 1) >= SrchRngHorLeft)<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX - 1, iStartY, 0, 2);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX - 1, StartY, 0, 2);<br>
}<br>
- if ((iStartY + 1) <= iSrchRngVerBottom)<br>
+ if ((StartY + 1) <= SrchRngVerBottom)<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX, iStartY + 1, 0, 2);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX, StartY + 1, 0, 2);<br>
}<br>
}<br>
break;<br>
case 7:<br>
{<br>
- if ((iStartY + 1) <= iSrchRngVerBottom)<br>
+ if ((StartY + 1) <= SrchRngVerBottom)<br>
{<br>
- if ((iStartX - 1) >= iSrchRngHorLeft)<br>
+ if ((StartX - 1) >= SrchRngHorLeft)<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX - 1, iStartY + 1, 0, 2);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX - 1, StartY + 1, 0, 2);<br>
}<br>
- if ((iStartX + 1) <= iSrchRngHorRight)<br>
+ if ((StartX + 1) <= SrchRngHorRight)<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX + 1, iStartY + 1, 0, 2);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX + 1, StartY + 1, 0, 2);<br>
}<br>
}<br>
}<br>
break;<br>
case 8:<br>
{<br>
- if ((iStartX + 1) <= iSrchRngHorRight)<br>
+ if ((StartX + 1) <= SrchRngHorRight)<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX + 1, iStartY, 0, 2);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX + 1, StartY, 0, 2);<br>
}<br>
- if ((iStartY + 1) <= iSrchRngVerBottom)<br>
+ if ((StartY + 1) <= SrchRngVerBottom)<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX, iStartY + 1, 0, 2);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX, StartY + 1, 0, 2);<br>
}<br>
}<br>
break;<br>
@@ -437,166 +435,165 @@<br>
} // switch( rcStruct.ucPointNr )<br>
}<br>
<br>
-__inline Void TEncSearch::xTZ8PointDiamondSearch(TComPattern* pcPatternKey, IntTZSearchStruct& rcStruct, MV* pcMvSrchRngLT, MV* pcMvSrchRngRB, const Int iStartX, const Int iStartY, const Int iDist)<br>
+__inline Void TEncSearch::xTZ8PointDiamondSearch(TComPattern* pcPatternKey, IntTZSearchStruct& rcStruct, MV* pcMvSrchRngLT, MV* pcMvSrchRngRB, const Int StartX, const Int StartY, const Int Dist)<br>
{<br>
- Int iSrchRngHorLeft = pcMvSrchRngLT->x;<br>
- Int iSrchRngHorRight = pcMvSrchRngRB->x;<br>
- Int iSrchRngVerTop = pcMvSrchRngLT->y;<br>
- Int iSrchRngVerBottom = pcMvSrchRngRB->y;<br>
-<br>
- assert(iDist != 0);<br>
- const Int iTop = iStartY - iDist;<br>
- const Int iBottom = iStartY + iDist;<br>
- const Int iLeft = iStartX - iDist;<br>
- const Int iRight = iStartX + iDist;<br>
+ assert(Dist != 0);<br>
+ Int SrchRngHorLeft = pcMvSrchRngLT->x;<br>
+ Int SrchRngHorRight = pcMvSrchRngRB->x;<br>
+ Int SrchRngVerTop = pcMvSrchRngLT->y;<br>
+ Int SrchRngVerBottom = pcMvSrchRngRB->y;<br>
+ const Int Top = StartY - Dist;<br>
+ const Int Bottom = StartY + Dist;<br>
+ const Int Left = StartX - Dist;<br>
+ const Int Right = StartX + Dist;<br>
rcStruct.uiBestRound += 1;<br>
<br>
- if (iDist == 1) // iDist == 1<br>
+ if (Dist == 1) // iDist == 1<br>
{<br>
- if (iTop >= iSrchRngVerTop) // check top<br>
+ if (Top >= SrchRngVerTop) // check top<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX, iTop, 2, iDist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX, Top, 2, Dist);<br>
}<br>
- if (iLeft >= iSrchRngHorLeft) // check middle left<br>
+ if (Left >= SrchRngHorLeft) // check middle left<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iLeft, iStartY, 4, iDist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, Left, StartY, 4, Dist);<br>
}<br>
- if (iRight <= iSrchRngHorRight) // check middle right<br>
+ if (Right <= SrchRngHorRight) // check middle right<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iRight, iStartY, 5, iDist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, Right, StartY, 5, Dist);<br>
}<br>
- if (iBottom <= iSrchRngVerBottom) // check bottom<br>
+ if (Bottom <= SrchRngVerBottom) // check bottom<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX, iBottom, 7, iDist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX, Bottom, 7, Dist);<br>
}<br>
}<br>
- else if (iDist <= 8)<br>
+ else if (Dist <= 8)<br>
{<br>
- const Int iTop_2 = iStartY - (iDist >> 1);<br>
- const Int iBottom_2 = iStartY + (iDist >> 1);<br>
- const Int iLeft_2 = iStartX - (iDist >> 1);<br>
- const Int iRight_2 = iStartX + (iDist >> 1);<br>
-<br>
- if (iTop >= iSrchRngVerTop && iLeft >= iSrchRngHorLeft &&<br>
- iRight <= iSrchRngHorRight && iBottom <= iSrchRngVerBottom) // check border<br>
+ const Int Top_2 = StartY - (Dist >> 1);<br>
+ const Int Bottom_2 = StartY + (Dist >> 1);<br>
+ const Int Left_2 = StartX - (Dist >> 1);<br>
+ const Int Right_2 = StartX + (Dist >> 1);<br>
+<br>
+ if (Top >= SrchRngVerTop && Left >= SrchRngHorLeft &&<br>
+ Right <= SrchRngHorRight && Bottom <= SrchRngVerBottom) // check border<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX, iTop, 2, iDist);<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iLeft_2, iTop_2, 1, iDist >> 1);<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iRight_2, iTop_2, 3, iDist >> 1);<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iLeft, iStartY, 4, iDist);<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iRight, iStartY, 5, iDist);<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iLeft_2, iBottom_2, 6, iDist >> 1);<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iRight_2, iBottom_2, 8, iDist >> 1);<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX, iBottom, 7, iDist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX, Top, 2, Dist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, Left_2, Top_2, 1, Dist >> 1);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, Right_2, Top_2, 3, Dist >> 1);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, Left, StartY, 4, Dist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, Right, StartY, 5, Dist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, Left_2, Bottom_2, 6, Dist >> 1);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, Right_2, Bottom_2, 8, Dist >> 1);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX, Bottom, 7, Dist);<br>
}<br>
else // check border for each mv<br>
{<br>
- if (iTop >= iSrchRngVerTop) // check top<br>
+ if (Top >= SrchRngVerTop) // check top<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX, iTop, 2, iDist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX, Top, 2, Dist);<br>
}<br>
- if (iTop_2 >= iSrchRngVerTop) // check half top<br>
+ if (Top_2 >= SrchRngVerTop) // check half top<br>
{<br>
- if (iLeft_2 >= iSrchRngHorLeft) // check half left<br>
+ if (Left_2 >= SrchRngHorLeft) // check half left<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iLeft_2, iTop_2, 1, (iDist >> 1));<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, Left_2, Top_2, 1, (Dist >> 1));<br>
}<br>
- if (iRight_2 <= iSrchRngHorRight) // check half right<br>
+ if (Right_2 <= SrchRngHorRight) // check half right<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iRight_2, iTop_2, 3, (iDist >> 1));<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, Right_2, Top_2, 3, (Dist >> 1));<br>
}<br>
} // check half top<br>
- if (iLeft >= iSrchRngHorLeft) // check left<br>
+ if (Left >= SrchRngHorLeft) // check left<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iLeft, iStartY, 4, iDist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, Left, StartY, 4, Dist);<br>
}<br>
- if (iRight <= iSrchRngHorRight) // check right<br>
+ if (Right <= SrchRngHorRight) // check right<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iRight, iStartY, 5, iDist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, Right, StartY, 5, Dist);<br>
}<br>
- if (iBottom_2 <= iSrchRngVerBottom) // check half bottom<br>
+ if (Bottom_2 <= SrchRngVerBottom) // check half bottom<br>
{<br>
- if (iLeft_2 >= iSrchRngHorLeft) // check half left<br>
+ if (Left_2 >= SrchRngHorLeft) // check half left<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iLeft_2, iBottom_2, 6, (iDist >> 1));<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, Left_2, Bottom_2, 6, (Dist >> 1));<br>
}<br>
- if (iRight_2 <= iSrchRngHorRight) // check half right<br>
+ if (Right_2 <= SrchRngHorRight) // check half right<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iRight_2, iBottom_2, 8, (iDist >> 1));<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, Right_2, Bottom_2, 8, (Dist >> 1));<br>
}<br>
} // check half bottom<br>
- if (iBottom <= iSrchRngVerBottom) // check bottom<br>
+ if (Bottom <= SrchRngVerBottom) // check bottom<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX, iBottom, 7, iDist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX, Bottom, 7, Dist);<br>
}<br>
} // check border for each mv<br>
}<br>
else // iDist > 8<br>
{<br>
- if (iTop >= iSrchRngVerTop && iLeft >= iSrchRngHorLeft &&<br>
- iRight <= iSrchRngHorRight && iBottom <= iSrchRngVerBottom) // check border<br>
+ if (Top >= SrchRngVerTop && Left >= SrchRngHorLeft &&<br>
+ Right <= SrchRngHorRight && Bottom <= SrchRngVerBottom) // check border<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX, iTop, 0, iDist);<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iLeft, iStartY, 0, iDist);<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iRight, iStartY, 0, iDist);<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX, iBottom, 0, iDist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX, Top, 0, Dist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, Left, StartY, 0, Dist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, Right, StartY, 0, Dist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX, Bottom, 0, Dist);<br>
for (Int index = 1; index < 4; index++)<br>
{<br>
- Int iPosYT = iTop + ((iDist >> 2) * index);<br>
- Int iPosYB = iBottom - ((iDist >> 2) * index);<br>
- Int iPosXL = iStartX - ((iDist >> 2) * index);<br>
- Int iPosXR = iStartX + ((iDist >> 2) * index);<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iPosXL, iPosYT, 0, iDist);<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iPosXR, iPosYT, 0, iDist);<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iPosXL, iPosYB, 0, iDist);<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iPosXR, iPosYB, 0, iDist);<br>
+ Int PosYT = Top + ((Dist >> 2) * index);<br>
+ Int PosYB = Bottom - ((Dist >> 2) * index);<br>
+ Int PosXL = StartX - ((Dist >> 2) * index);<br>
+ Int PosXR = StartX + ((Dist >> 2) * index);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, PosXL, PosYT, 0, Dist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, PosXR, PosYT, 0, Dist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, PosXL, PosYB, 0, Dist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, PosXR, PosYB, 0, Dist);<br>
}<br>
}<br>
else // check border for each mv<br>
{<br>
- if (iTop >= iSrchRngVerTop) // check top<br>
+ if (Top >= SrchRngVerTop) // check top<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX, iTop, 0, iDist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX, Top, 0, Dist);<br>
}<br>
- if (iLeft >= iSrchRngHorLeft) // check left<br>
+ if (Left >= SrchRngHorLeft) // check left<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iLeft, iStartY, 0, iDist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, Left, StartY, 0, Dist);<br>
}<br>
- if (iRight <= iSrchRngHorRight) // check right<br>
+ if (Right <= SrchRngHorRight) // check right<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iRight, iStartY, 0, iDist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, Right, StartY, 0, Dist);<br>
}<br>
- if (iBottom <= iSrchRngVerBottom) // check bottom<br>
+ if (Bottom <= SrchRngVerBottom) // check bottom<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iStartX, iBottom, 0, iDist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, StartX, Bottom, 0, Dist);<br>
}<br>
for (Int index = 1; index < 4; index++)<br>
{<br>
- Int iPosYT = iTop + ((iDist >> 2) * index);<br>
- Int iPosYB = iBottom - ((iDist >> 2) * index);<br>
- Int iPosXL = iStartX - ((iDist >> 2) * index);<br>
- Int iPosXR = iStartX + ((iDist >> 2) * index);<br>
-<br>
- if (iPosYT >= iSrchRngVerTop) // check top<br>
+ Int PosYT = Top + ((Dist >> 2) * index);<br>
+ Int PosYB = Bottom - ((Dist >> 2) * index);<br>
+ Int PosXL = StartX - ((Dist >> 2) * index);<br>
+ Int PosXR = StartX + ((Dist >> 2) * index);<br>
+<br>
+ if (PosYT >= SrchRngVerTop) // check top<br>
{<br>
- if (iPosXL >= iSrchRngHorLeft) // check left<br>
+ if (PosXL >= SrchRngHorLeft) // check left<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iPosXL, iPosYT, 0, iDist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, PosXL, PosYT, 0, Dist);<br>
}<br>
- if (iPosXR <= iSrchRngHorRight) // check right<br>
+ if (PosXR <= SrchRngHorRight) // check right<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iPosXR, iPosYT, 0, iDist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, PosXR, PosYT, 0, Dist);<br>
}<br>
} // check top<br>
- if (iPosYB <= iSrchRngVerBottom) // check bottom<br>
+ if (PosYB <= SrchRngVerBottom) // check bottom<br>
{<br>
- if (iPosXL >= iSrchRngHorLeft) // check left<br>
+ if (PosXL >= SrchRngHorLeft) // check left<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iPosXL, iPosYB, 0, iDist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, PosXL, PosYB, 0, Dist);<br>
}<br>
- if (iPosXR <= iSrchRngHorRight) // check right<br>
+ if (PosXR <= SrchRngHorRight) // check right<br>
{<br>
- xTZSearchHelp(pcPatternKey, rcStruct, iPosXR, iPosYB, 0, iDist);<br>
+ xTZSearchHelp(pcPatternKey, rcStruct, PosXR, PosYB, 0, Dist);<br>
}<br>
} // check bottom<br>
} // for ...<br>
@@ -3584,91 +3581,76 @@<br>
return m_pcRdCost->calcRdSADCost(uiCost, m_auiMVPIdxCost[iMVPIdx][iMVPNum]);<br>
}<br>
<br>
-Void TEncSearch::xMotionEstimation(TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, RefPicList eRefPicList, MV* pcMvPred, Int iRefIdxPred, MV& rcMv, UInt& ruiBits, UInt& ruiCost, Bool bBi)<br>
+Void TEncSearch::xMotionEstimation(TComDataCU* pcCU, TComYuv* pcYuvOrg, Int PartIdx, RefPicList eRefPicList, MV* pcMvPred, Int RefIdxPred, MV& rcMv, UInt& ruiBits, UInt& ruiCost, Bool Bi)<br>
{<br>
CYCLE_COUNTER_START(ME);<br>
- UInt uiPartAddr;<br>
- Int iRoiWidth;<br>
- Int iRoiHeight;<br>
-<br>
- MV cMvHalf, cMvQter;<br>
- MV cMvSrchRngLT;<br>
- MV cMvSrchRngRB;<br>
-<br>
- TComYuv* pcYuv = pcYuvOrg;<br>
-<br>
- m_iSearchRange = m_aaiAdaptSR[eRefPicList][iRefIdxPred];<br>
-<br>
- Int iSrchRng = (bBi ? m_bipredSearchRange : m_iSearchRange);<br>
+ int cost_shift = 0;<br>
+ UInt PartAddr;<br>
+ Int RoiWidth;<br>
+ Int RoiHeight;<br>
+<br>
+ MV cMvHalf, cMvQter;<br>
+ MV cMvSrchRngLT;<br>
+ MV cMvSrchRngRB;<br>
+<br>
+ TComYuv* pcYuv = pcYuvOrg;<br>
+ m_iSearchRange = m_aaiAdaptSR[eRefPicList][RefIdxPred];<br>
+ Int SrchRng = (Bi ? m_bipredSearchRange : m_iSearchRange);<br>
TComPattern* pcPatternKey = pcCU->getPattern();<br>
-<br>
- int cost_shift = 0;<br>
-<br>
- pcCU->getPartIndexAndSize(iPartIdx, uiPartAddr, iRoiWidth, iRoiHeight);<br>
-<br>
- if (bBi)<br>
+ pcCU->getPartIndexAndSize(PartIdx, PartAddr, RoiWidth, RoiHeight);<br>
+<br>
+ if (Bi)<br>
{<br>
TComYuv* pcYuvOther = &m_acYuvPred[1 - (Int)eRefPicList];<br>
- pcYuv = &m_cYuvPredTemp;<br>
-<br>
- pcYuvOrg->copyPartToPartYuv(pcYuv, uiPartAddr, iRoiWidth, iRoiHeight);<br>
-<br>
- pcYuv->removeHighFreq(pcYuvOther, uiPartAddr, iRoiWidth, iRoiHeight);<br>
-<br>
+ pcYuv = &m_cYuvPredTemp;<br>
+ pcYuvOrg->copyPartToPartYuv(pcYuv, PartAddr, RoiWidth, RoiHeight);<br>
+ pcYuv->removeHighFreq(pcYuvOther, PartAddr, RoiWidth, RoiHeight);<br>
cost_shift = 1;<br>
}<br>
<br>
// Search key pattern initialization<br>
- pcPatternKey->initPattern(pcYuv->getLumaAddr(uiPartAddr),<br>
- pcYuv->getCbAddr(uiPartAddr),<br>
- pcYuv->getCrAddr(uiPartAddr),<br>
- iRoiWidth,<br>
- iRoiHeight,<br>
- pcYuv->getStride(),<br>
- 0, 0);<br>
-<br>
- Pel* piRefY = pcCU->getSlice()->getRefPic(eRefPicList, iRefIdxPred)->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr);<br>
- Int iRefStride = pcCU->getSlice()->getRefPic(eRefPicList, iRefIdxPred)->getPicYuvRec()->getStride();<br>
-<br>
- TComPicYuv* refPic = pcCU->getSlice()->getRefPic(eRefPicList, iRefIdxPred)->getPicYuvRec(); //For new xPatternSearchFracDiff<br>
-<br>
- MV cMvPred = *pcMvPred;<br>
-<br>
- if (bBi)<br>
- xSetSearchRange(pcCU, rcMv, iSrchRng, cMvSrchRngLT, cMvSrchRngRB);<br>
+ pcPatternKey->initPattern(pcYuv->getLumaAddr(PartAddr), pcYuv->getCbAddr(PartAddr), pcYuv->getCrAddr(PartAddr), RoiWidth, RoiHeight, pcYuv->getStride(), 0, 0);<br>
+<br>
+ Pel* piRefY = pcCU->getSlice()->getRefPic(eRefPicList, RefIdxPred)->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), pcCU->getZorderIdxInCU() + PartAddr);<br>
+ Int RefStride = pcCU->getSlice()->getRefPic(eRefPicList, RefIdxPred)->getPicYuvRec()->getStride();<br>
+ TComPicYuv* refPic = pcCU->getSlice()->getRefPic(eRefPicList, RefIdxPred)->getPicYuvRec(); //For new xPatternSearchFracDiff<br>
+<br>
+ MV cMvPred = *pcMvPred;<br>
+<br>
+ if (Bi)<br>
+ xSetSearchRange(pcCU, rcMv, SrchRng, cMvSrchRngLT, cMvSrchRngRB);<br>
else<br>
- xSetSearchRange(pcCU, cMvPred, iSrchRng, cMvSrchRngLT, cMvSrchRngRB);<br>
+ xSetSearchRange(pcCU, cMvPred, SrchRng, cMvSrchRngLT, cMvSrchRngRB);<br>
<br>
// Configure the MV bit cost calculator<br>
m_bc.setMVP(*pcMvPred);<br>
<br>
- setWpScalingDistParam(pcCU, iRefIdxPred, eRefPicList);<br>
+ setWpScalingDistParam(pcCU, RefIdxPred, eRefPicList);<br>
<br>
// Do integer search<br>
m_pcRdCost->setCostScale(2);<br>
- if (bBi || m_iSearchMethod == X265_FULL_SEARCH)<br>
+ if (Bi || m_iSearchMethod == X265_FULL_SEARCH)<br>
{<br>
- xPatternSearch(pcPatternKey, piRefY, iRefStride, &cMvSrchRngLT, &cMvSrchRngRB, rcMv, ruiCost);<br>
+ xPatternSearch(pcPatternKey, piRefY, RefStride, &cMvSrchRngLT, &cMvSrchRngRB, rcMv, ruiCost);<br>
}<br>
else<br>
{<br>
rcMv = *pcMvPred;<br>
- xPatternSearchFast(pcCU, pcPatternKey, piRefY, iRefStride, &cMvSrchRngLT, &cMvSrchRngRB, rcMv, ruiCost);<br>
+ xPatternSearchFast(pcCU, pcPatternKey, piRefY, RefStride, &cMvSrchRngLT, &cMvSrchRngRB, rcMv, ruiCost);<br>
}<br>
<br>
m_pcRdCost->setCostScale(1);<br>
-<br>
- xPatternSearchFracDIF(pcCU, pcPatternKey, piRefY, iRefStride, &rcMv, cMvHalf, cMvQter, ruiCost, bBi, refPic, uiPartAddr);<br>
-<br>
+ xPatternSearchFracDIF(pcCU, pcPatternKey, piRefY, RefStride, &rcMv, cMvHalf, cMvQter, ruiCost, Bi, refPic, PartAddr);<br>
m_pcRdCost->setCostScale(0);<br>
+<br>
rcMv <<= 2;<br>
rcMv += (cMvHalf <<= 1);<br>
rcMv += cMvQter;<br>
<br>
- UInt uiMvBits = m_bc.bitcost(rcMv);<br>
-<br>
- ruiBits += uiMvBits;<br>
- ruiCost = ((ruiCost - m_pcRdCost->getCost(uiMvBits)) >> cost_shift) + m_pcRdCost->getCost(ruiBits);<br>
+ UInt MvBits = m_bc.bitcost(rcMv);<br>
+<br>
+ ruiBits += MvBits;<br>
+ ruiCost = ((ruiCost - m_pcRdCost->getCost(MvBits)) >> cost_shift) + m_pcRdCost->getCost(ruiBits);<br>
<br>
CYCLE_COUNTER_STOP(ME);<br>
}<br>
@@ -3688,127 +3670,89 @@<br>
mvmax >>= 2;<br>
}<br>
<br>
-Void TEncSearch::xPatternSearch(TComPattern* pcPatternKey, Pel* piRefY, Int iRefStride, MV* pcMvSrchRngLT, MV* pcMvSrchRngRB, MV& rcMv, UInt& ruiSAD)<br>
+Void TEncSearch::xPatternSearch(TComPattern* pcPatternKey, Pel* RefY, Int RefStride, MV* pcMvSrchRngLT, MV* pcMvSrchRngRB, MV& rcMv, UInt& ruiSAD)<br>
{<br>
- Int iSrchRngHorLeft = pcMvSrchRngLT->x;<br>
- Int iSrchRngHorRight = pcMvSrchRngRB->x;<br>
- Int iSrchRngVerTop = pcMvSrchRngLT->y;<br>
- Int iSrchRngVerBottom = pcMvSrchRngRB->y;<br>
-<br>
- m_pcRdCost->setDistParam(pcPatternKey, piRefY, iRefStride, m_cDistParam);<br>
+ Int SrchRngHorLeft = pcMvSrchRngLT->x;<br>
+ Int SrchRngHorRight = pcMvSrchRngRB->x;<br>
+ Int SrchRngVerTop = pcMvSrchRngLT->y;<br>
+ Int SrchRngVerBottom = pcMvSrchRngRB->y;<br>
+<br>
+ m_pcRdCost->setDistParam(pcPatternKey, RefY, RefStride, m_cDistParam);<br>
m_cDistParam.bitDepth = g_bitDepthY;<br>
- piRefY += (iSrchRngVerTop * iRefStride);<br>
+ RefY += (SrchRngVerTop * RefStride);<br>
<br>
// find min. distortion position<br>
- UInt uiSadBest = MAX_UINT;<br>
- for (Int y = iSrchRngVerTop; y <= iSrchRngVerBottom; y++)<br>
+ UInt SadBest = MAX_UINT;<br>
+ for (Int y = SrchRngVerTop; y <= SrchRngVerBottom; y++)<br>
{<br>
- for (Int x = iSrchRngHorLeft; x <= iSrchRngHorRight; x++)<br>
+ for (Int x = SrchRngHorLeft; x <= SrchRngHorRight; x++)<br>
{<br>
MV mv(x, y);<br>
- m_cDistParam.pCur = piRefY + x;<br>
- UInt uiSad = m_cDistParam.DistFunc(&m_cDistParam) + m_bc.mvcost(mv << 2);<br>
-<br>
- if (uiSad < uiSadBest)<br>
+ m_cDistParam.pCur = RefY + x;<br>
+ UInt Sad = m_cDistParam.DistFunc(&m_cDistParam) + m_bc.mvcost(mv << 2);<br>
+<br>
+ if (Sad < SadBest)<br>
{<br>
- uiSadBest = uiSad;<br>
+ SadBest = Sad;<br>
rcMv = mv;<br>
}<br>
}<br>
-<br>
- piRefY += iRefStride;<br>
+ RefY += RefStride;<br>
}<br>
-<br>
- ruiSAD = uiSadBest - m_bc.mvcost(rcMv << 2);<br>
+ ruiSAD = SadBest - m_bc.mvcost(rcMv << 2);<br>
}<br>
<br>
-Void TEncSearch::xPatternSearchFast(TComDataCU* pcCU, TComPattern* pcPatternKey, Pel* piRefY, Int iRefStride, MV* pcMvSrchRngLT, MV* pcMvSrchRngRB, MV& rcMv, UInt& ruiSAD)<br>
+Void TEncSearch::xPatternSearchFast(TComDataCU* pcCU, TComPattern* pcPatternKey, Pel* RefY, Int RefStride, MV* pcMvSrchRngLT, MV* pcMvSrchRngRB, MV& rcMv, UInt& ruiSAD)<br>
{<br>
- const Int iRaster = 5;<br>
- const Bool bTestOtherPredictedMV = 0;<br>
- const Bool bTestZeroVector = 1;<br>
- const Bool bTestZeroVectorStart = 0;<br>
- const Bool bTestZeroVectorStop = 0;<br>
- const Bool bFirstSearchStop = 1;<br>
- const UInt uiFirstSearchRounds = 3; /* first search stop X rounds after best match (must be >=1) */<br>
- const Bool bEnableRasterSearch = 1;<br>
- const Bool bAlwaysRasterSearch = 0; /* ===== 1: BETTER but factor 2 slower ===== */<br>
- const Bool bRasterRefinementEnable = 0; /* enable either raster refinement or star refinement */<br>
- const Bool bStarRefinementEnable = 1; /* enable either star refinement or raster refinement */<br>
- const Bool bStarRefinementStop = 0;<br>
- const UInt uiStarRefinementRounds = 2; /* star refinement stop X rounds after best match (must be >=1) */<br>
-<br>
- Int iSrchRngHorLeft = pcMvSrchRngLT->x;<br>
- Int iSrchRngHorRight = pcMvSrchRngRB->x;<br>
- Int iSrchRngVerTop = pcMvSrchRngLT->y;<br>
- Int iSrchRngVerBottom = pcMvSrchRngRB->y;<br>
-<br>
- UInt uiSearchRange = m_iSearchRange;<br>
+ const Int Raster = 5;<br>
+ const Bool AlwaysRasterSearch = 0;<br>
+ const Bool TestZeroVector = 1;<br>
+ const Bool FirstSearchStop = 1;<br>
+ const UInt FirstSearchRounds = 3; /* first search stop X rounds after best match (must be >=1) */<br>
+ const Bool EnableRasterSearch = 1;<br>
+ const Bool StarRefinementEnable = 1; /* enable either star refinement or raster refinement */<br>
+ const UInt StarRefinementRounds = 2; /* star refinement stop X rounds after best match (must be >=1) */<br>
+<br>
+ Int SrchRngHorLeft = pcMvSrchRngLT->x;<br>
+ Int SrchRngHorRight = pcMvSrchRngRB->x;<br>
+ Int SrchRngVerTop = pcMvSrchRngLT->y;<br>
+ Int SrchRngVerBottom = pcMvSrchRngRB->y;<br>
+ UInt SearchRange = m_iSearchRange;<br>
<br>
pcCU->clipMv(rcMv);<br>
rcMv >>= 2;<br>
<br>
// init TZSearchStruct<br>
IntTZSearchStruct cStruct;<br>
- cStruct.iYStride = iRefStride;<br>
- cStruct.piRefY = piRefY;<br>
+ cStruct.iYStride = RefStride;<br>
+ cStruct.piRefY = RefY;<br>
cStruct.uiBestSad = MAX_UINT;<br>
<br>
// set rcMv (Median predictor) as start point and as best point<br>
xTZSearchHelp(pcPatternKey, cStruct, rcMv.x, rcMv.y, 0, 0);<br>
<br>
- // test whether one of PRED_A, PRED_B, PRED_C MV is better start point than Median predictor<br>
- if (bTestOtherPredictedMV)<br>
- {<br>
- for (UInt index = 0; index < 3; index++)<br>
- {<br>
- MV cMv = m_acMvPredictors[index];<br>
- pcCU->clipMv(cMv);<br>
- cMv >>= 2;<br>
- xTZSearchHelp(pcPatternKey, cStruct, cMv.x, cMv.y, 0, 0);<br>
- }<br>
- }<br>
-<br>
// test whether zero Mv is better start point than Median predictor<br>
- if (bTestZeroVector)<br>
+ if (TestZeroVector)<br>
{<br>
xTZSearchHelp(pcPatternKey, cStruct, 0, 0, 0, 0);<br>
}<br>
<br>
// start search<br>
- Int iDist = 0;<br>
- Int iStartX = cStruct.iBestX;<br>
- Int iStartY = cStruct.iBestY;<br>
+ Int Dist = 0;<br>
+ Int StartX = cStruct.iBestX;<br>
+ Int StartY = cStruct.iBestY;<br>
<br>
// first search<br>
- for (iDist = 1; iDist <= (Int)uiSearchRange; iDist *= 2)<br>
+ for (Dist = 1; Dist <= (Int)SearchRange; Dist *= 2)<br>
{<br>
- xTZ8PointDiamondSearch(pcPatternKey, cStruct, pcMvSrchRngLT, pcMvSrchRngRB, iStartX, iStartY, iDist);<br>
-<br>
- if (bFirstSearchStop && (cStruct.uiBestRound >= uiFirstSearchRounds)) // stop criterion<br>
+ xTZ8PointDiamondSearch(pcPatternKey, cStruct, pcMvSrchRngLT, pcMvSrchRngRB, StartX, StartY, Dist);<br>
+<br>
+ if (FirstSearchStop && (cStruct.uiBestRound >= FirstSearchRounds)) // stop criterion<br>
{<br>
break;<br>
}<br>
}<br>
<br>
- // test whether zero Mv is a better start point than Median predictor<br>
- if (bTestZeroVectorStart && ((cStruct.iBestX != 0) || (cStruct.iBestY != 0)))<br>
- {<br>
- xTZSearchHelp(pcPatternKey, cStruct, 0, 0, 0, 0);<br>
- if ((cStruct.iBestX == 0) && (cStruct.iBestY == 0))<br>
- {<br>
- // test its neighborhood<br>
- for (iDist = 1; iDist <= (Int)uiSearchRange; iDist *= 2)<br>
- {<br>
- xTZ8PointDiamondSearch(pcPatternKey, cStruct, pcMvSrchRngLT, pcMvSrchRngRB, 0, 0, iDist);<br>
- if (bTestZeroVectorStop && (cStruct.uiBestRound > 0)) // stop criterion<br>
- {<br>
- break;<br>
- }<br>
- }<br>
- }<br>
- }<br>
-<br>
// calculate only 2 missing points instead 8 points if cStruct.uiBestDistance == 1<br>
if (cStruct.uiBestDistance == 1)<br>
{<br>
@@ -3817,59 +3761,30 @@<br>
}<br>
<br>
// raster search if distance is too big<br>
- if (bEnableRasterSearch && (((Int)(cStruct.uiBestDistance) > iRaster) || bAlwaysRasterSearch))<br>
+ if (EnableRasterSearch && (((Int)(cStruct.uiBestDistance) > Raster) || AlwaysRasterSearch))<br>
{<br>
- cStruct.uiBestDistance = iRaster;<br>
- for (iStartY = iSrchRngVerTop; iStartY <= iSrchRngVerBottom; iStartY += iRaster)<br>
+ cStruct.uiBestDistance = Raster;<br>
+ for (StartY = SrchRngVerTop; StartY <= SrchRngVerBottom; StartY += Raster)<br>
{<br>
- for (iStartX = iSrchRngHorLeft; iStartX <= iSrchRngHorRight; iStartX += iRaster)<br>
+ for (StartX = SrchRngHorLeft; StartX <= SrchRngHorRight; StartX += Raster)<br>
{<br>
- xTZSearchHelp(pcPatternKey, cStruct, iStartX, iStartY, 0, iRaster);<br>
+ xTZSearchHelp(pcPatternKey, cStruct, StartX, StartY, 0, Raster);<br>
}<br>
}<br>
}<br>
<br>
- // raster refinement<br>
- if (bRasterRefinementEnable && cStruct.uiBestDistance > 0)<br>
+ // start refinement<br>
+ if (StarRefinementEnable && cStruct.uiBestDistance > 0)<br>
{<br>
while (cStruct.uiBestDistance > 0)<br>
{<br>
- iStartX = cStruct.iBestX;<br>
- iStartY = cStruct.iBestY;<br>
- if (cStruct.uiBestDistance > 1)<br>
- {<br>
- iDist = cStruct.uiBestDistance >>= 1;<br>
- xTZ8PointDiamondSearch(pcPatternKey, cStruct, pcMvSrchRngLT, pcMvSrchRngRB, iStartX, iStartY, iDist);<br>
- }<br>
-<br>
- // calculate only 2 missing points instead 8 points if cStruct.uiBestDistance == 1<br>
- if (cStruct.uiBestDistance == 1)<br>
- {<br>
- cStruct.uiBestDistance = 0;<br>
- if (cStruct.ucPointNr != 0)<br>
- {<br>
- xTZ2PointSearch(pcPatternKey, cStruct, pcMvSrchRngLT, pcMvSrchRngRB);<br>
- }<br>
- }<br>
- }<br>
- }<br>
-<br>
- // start refinement<br>
- if (bStarRefinementEnable && cStruct.uiBestDistance > 0)<br>
- {<br>
- while (cStruct.uiBestDistance > 0)<br>
- {<br>
- iStartX = cStruct.iBestX;<br>
- iStartY = cStruct.iBestY;<br>
+ StartX = cStruct.iBestX;<br>
+ StartY = cStruct.iBestY;<br>
cStruct.uiBestDistance = 0;<br>
cStruct.ucPointNr = 0;<br>
- for (iDist = 1; iDist < (Int)uiSearchRange + 1; iDist *= 2)<br>
+ for (Dist = 1; Dist < (Int)SearchRange + 1; Dist *= 2)<br>
{<br>
- xTZ8PointDiamondSearch(pcPatternKey, cStruct, pcMvSrchRngLT, pcMvSrchRngRB, iStartX, iStartY, iDist);<br>
- if (bStarRefinementStop && (cStruct.uiBestRound >= uiStarRefinementRounds)) // stop criterion<br>
- {<br>
- break;<br>
- }<br>
+ xTZ8PointDiamondSearch(pcPatternKey, cStruct, pcMvSrchRngLT, pcMvSrchRngRB, StartX, StartY, Dist);<br>
}<br>
<br>
// calculate only 2 missing points instead 8 points if cStrukt.uiBestDistance == 1<br>
<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="http://mailman.videolan.org/listinfo/x265-devel" target="_blank">http://mailman.videolan.org/listinfo/x265-devel</a><br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Steve Borho
</div></div>