<div dir="ltr">Please ignore this patch. Will be sharing an improved version soon.<div><br></div><div>Thanks.</div><div>Pooja.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 30, 2019 at 2:42 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 1559024172 -19800<br>
# Tue May 28 11:46:12 2019 +0530<br>
# Node ID 4d5ea449955a12f4704f7eef8ee9da30d674819b<br>
# Parent a46ded2c14116af1cafacdc1fb98be43259dc7d6<br>
Select the best among the tradition MVP and the Scaled MV as MVP<br>
from analysis-save encode in load mode for refine-inter levels.<br>
<br>
diff -r a46ded2c1411 -r 4d5ea449955a source/encoder/analysis.cpp<br>
--- a/source/encoder/analysis.cpp Tue May 28 14:01:54 2019 +0800<br>
+++ b/source/encoder/analysis.cpp Tue May 28 11:46:12 2019 +0530<br>
@@ -2488,10 +2488,14 @@<br>
MV mvp;<br>
<br>
int numMvc = mode.cu.getPMV(mode.interNeighbours, list, ref, mode.amvpCand[list][ref], mvc);<br>
- if (m_param->interRefine != 1)<br>
- mvp = mode.amvpCand[list][ref][mode.cu.m_mvpIdx[list][pu.puAbsPartIdx]];<br>
- else<br>
- mvp = interDataCTU->mv[list][cuIdx + part].word;<br>
+ mvp = mode.amvpCand[list][ref][mode.cu.m_mvpIdx[list][pu.puAbsPartIdx]];<br>
+ if(m_param->interRefine == 1)<br>
+ {<br>
+ mode.amvpCand[list][ref][!(mode.cu.m_mvpIdx[list][pu.puAbsPartIdx])] = interDataCTU->mv[list][cuIdx + part].word;<br>
+ int mvpIdx = selectMVP(<a href="http://mode.cu" rel="noreferrer" target="_blank">mode.cu</a>, pu, mode.amvpCand[list][ref], list, ref);<br>
+ if (mvpIdx != mode.cu.m_mvpIdx[list][pu.puAbsPartIdx])<br>
+ mvp = interDataCTU->mv[list][cuIdx + part].word;<br>
+ }<br>
if (m_param->mvRefine || m_param->interRefine == 1)<br>
{<br>
MV outmv;<br>
diff -r a46ded2c1411 -r 4d5ea449955a source/encoder/search.cpp<br>
--- a/source/encoder/search.cpp Tue May 28 14:01:54 2019 +0800<br>
+++ b/source/encoder/search.cpp Tue May 28 11:46:12 2019 +0530<br>
@@ -2196,7 +2196,7 @@<br>
bestME[1].cost = MAX_UINT;<br>
<br>
getBlkBits((PartSize)cu.m_partSize[0], slice->isInterP(), puIdx, lastMode, m_listSelBits);<br>
- bool bDoUnidir = true;<br>
+ bool bDoUnidir = true, bDoPme = m_param->bDistributeMotionEstimation;<br>
<br>
cu.getNeighbourMV(puIdx, pu.puAbsPartIdx, interMode.interNeighbours);<br>
/* Uni-directional prediction */<br>
@@ -2225,8 +2225,18 @@<br>
MV mvmin, mvmax, outmv, mvp;<br>
if (useAsMVP)<br>
{<br>
- mvp = interDataCTU->mv[list][cuIdx + puIdx].word;<br>
- mvpIdx = interDataCTU->mvpIdx[list][cuIdx + puIdx];<br>
+ interMode.amvpCand[list][ref][!mvpIdx] = interDataCTU->mv[list][cuIdx + puIdx].word;<br>
+ int mvpIdx0 = selectMVP(interMode.cu, pu, interMode.amvpCand[list][ref], list, ref);<br>
+ if (mvpIdx != mvpIdx0)<br>
+ {<br>
+ mvp = interDataCTU->mv[list][cuIdx + puIdx].word;<br>
+ mvpIdx = interDataCTU->mvpIdx[list][cuIdx + puIdx];<br>
+ }<br>
+ else<br>
+ {<br>
+ useAsMVP = false;<br>
+ break;<br>
+ }<br>
}<br>
else<br>
mvp = amvp[mvpIdx];<br>
@@ -2277,10 +2287,10 @@<br>
bestME[list].mvCost = mvCost;<br>
bestME[list].ref = ref;<br>
}<br>
- bDoUnidir = false;<br>
- } <br>
+ bDoUnidir = bDoPme = false;<br>
+ }<br>
}<br>
- else if (m_param->bDistributeMotionEstimation)<br>
+ if (bDoPme)<br>
{<br>
PME pme(*this, interMode, cuGeom, pu, puIdx);<br>
pme.m_jobTotal = 0;<br>
</blockquote></div>