<div dir="ltr">Pushed to Release_3.2 and grafted the fix to default.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 24, 2019 at 4:17 PM <<a href="mailto:pooja@multicorewareinc.com">pooja@multicorewareinc.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"># HG changeset patch<br>
# User Pooja Venkatesan <<a href="mailto:pooja@multicorewareinc.com" target="_blank">pooja@multicorewareinc.com</a>><br>
# Date 1571755477 -19800<br>
# Tue Oct 22 20:14:37 2019 +0530<br>
# Branch Release_3.2<br>
# Node ID 7fa570ead8d361bf6055cd2a881a8e15f12110ae<br>
# Parent a3a088a7262fcc02560bc8b71d0a3cf5b9c69fe3<br>
Fix output change in analysis load<br>
<br>
diff -r a3a088a7262f -r 7fa570ead8d3 source/encoder/search.cpp<br>
--- a/source/encoder/search.cpp Mon Oct 14 14:33:16 2019 +0530<br>
+++ b/source/encoder/search.cpp Tue Oct 22 20:14:37 2019 +0530<br>
@@ -2156,14 +2156,17 @@<br>
{<br>
CUData& cu = interMode.cu;<br>
MV mv, mvmin, mvmax;<br>
- cu.clipMv(mv);<br>
int cand = 0, bestcost = INT_MAX;<br>
- do<br>
+ while (cand < m_param->mvRefine)<br>
{<br>
- if (cand && (mvp[cand] == mvp[cand - 1] || (cand == 2 && mvp[cand] == mvp[cand - 2])))<br>
+ if ((cand && mvp[cand] == mvp[cand - 1]) || (cand == 2 && (mvp[cand] == mvp[cand - 2] || mvp[cand] == mvp[cand - 1])))<br>
+ {<br>
+ cand++;<br>
continue;<br>
+ }<br>
MV bestMV;<br>
- mv = mvp[cand];<br>
+ mv = mvp[cand++];<br>
+ cu.clipMv(mv);<br>
setSearchRange(cu, mv, m_param->searchRange, mvmin, mvmax);<br>
int cost = m_me.motionEstimate(&m_slice->m_mref[list][ref], mvmin, mvmax, mv, numMvc, mvc, m_param->searchRange, bestMV, m_param->maxSlices,<br>
m_param->bSourceReferenceEstimation ? m_slice->m_refFrameList[list][ref]->m_fencPic->getLumaAddr(0) : 0);<br>
@@ -2172,7 +2175,7 @@<br>
bestcost = cost;<br>
outmv = bestMV;<br>
}<br>
- }while (++cand < m_param->mvRefine);<br>
+ }<br>
}<br>
/* find the best inter prediction for each PU of specified mode */<br>
void Search::predInterSearch(Mode& interMode, const CUGeom& cuGeom, bool bChromaMC, uint32_t refMasks[2])<br>
@@ -2246,7 +2249,13 @@<br>
const MV* amvp = interMode.amvpCand[list][ref];<br>
int mvpIdx = selectMVP(cu, pu, amvp, list, ref);<br>
MV mvmin, mvmax, outmv, mvp;<br>
- mvp = amvp[mvpIdx];<br>
+ if (useAsMVP)<br>
+ {<br>
+ mvp = interDataCTU->mv[list][cuIdx + puIdx].word;<br>
+ mvpIdx = interDataCTU->mvpIdx[list][cuIdx + puIdx];<br>
+ }<br>
+ else<br>
+ mvp = amvp[mvpIdx];<br>
if (m_param->searchMethod == X265_SEA)<br>
{<br>
int puX = puIdx & 1;<br>
@@ -2259,28 +2268,26 @@<br>
int satdCost;<br>
if (m_param->analysisMultiPassRefine && m_param->rc.bStatRead && mvpIdx == bestME[list].mvpIdx)<br>
mvpIn = bestME[list].mv;<br>
- if (useAsMVP)<br>
+ if (useAsMVP && m_param->mvRefine > 1)<br>
{<br>
MV bestmv, mvpSel[3];<br>
int mvpIdxSel[3];<br>
satdCost = m_me.COST_MAX;<br>
- mvpSel[0] = interDataCTU->mv[list][cuIdx + puIdx].word;<br>
- mvpIdxSel[0] = interDataCTU->mvpIdx[list][cuIdx + puIdx];<br>
- if (m_param->mvRefine > 1)<br>
+ mvpSel[0] = mvp;<br>
+ mvpIdxSel[0] = mvpIdx;<br>
+ mvpIdx = selectMVP(cu, pu, amvp, list, ref);<br>
+ mvpSel[1] = interMode.amvpCand[list][ref][mvpIdx];<br>
+ mvpIdxSel[1] = mvpIdx;<br>
+ if (m_param->mvRefine > 2)<br>
{<br>
- mvpSel[1] = interMode.amvpCand[list][ref][mvpIdx];<br>
- mvpIdxSel[1] = mvpIdx;<br>
- if (m_param->mvRefine > 2)<br>
- {<br>
- mvpSel[2] = interMode.amvpCand[list][ref][!mvpIdx];<br>
- mvpIdxSel[2] = !mvpIdx;<br>
- }<br>
+ mvpSel[2] = interMode.amvpCand[list][ref][!mvpIdx];<br>
+ mvpIdxSel[2] = !mvpIdx;<br>
}<br>
for (int cand = 0; cand < m_param->mvRefine; cand++)<br>
{<br>
if (cand && (mvpSel[cand] == mvpSel[cand - 1] || (cand == 2 && mvpSel[cand] == mvpSel[cand - 2])))<br>
continue;<br>
- setSearchRange(cu, mvp, m_param->searchRange, mvmin, mvmax);<br>
+ setSearchRange(cu, mvpSel[cand], m_param->searchRange, mvmin, mvmax);<br>
int bcost = m_me.motionEstimate(&m_slice->m_mref[list][ref], mvmin, mvmax, mvpSel[cand], numMvc, mvc, m_param->searchRange, bestmv, m_param->maxSlices,<br>
m_param->bSourceReferenceEstimation ? m_slice->m_refFrameList[list][ref]->m_fencPic->getLumaAddr(0) : 0);<br>
if (satdCost > bcost)<br>
@@ -2291,6 +2298,7 @@<br>
mvpIdx = mvpIdxSel[cand];<br>
}<br>
}<br>
+ mvpIn = mvp;<br>
}<br>
else<br>
{<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org" target="_blank">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><font face="georgia, serif">Regards,</font><div><font face="georgia, serif">Aruna</font></div></div></div>