<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 11, 2014 at 8:50 AM, Steve Borho <span dir="ltr"><<a href="mailto:steve@borho.org" target="_blank">steve@borho.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On 11/10, <a href="mailto:gopu@multicorewareinc.com">gopu@multicorewareinc.com</a> wrote:<br>
> # HG changeset patch<br>
> # User Gopu Govindaswamy <<a href="mailto:gopu@multicorewareinc.com">gopu@multicorewareinc.com</a>><br>
> # Date 1415611936 -19800<br>
> # Mon Nov 10 15:02:16 2014 +0530<br>
> # Node ID 31b6ed10054e753331b65a5e08e512f2f5b22b2d<br>
> # Parent 1e04e178a349ff3a27ed0207cca7bdd9f0db4ff8<br>
> analysis: Dump the best MV statistics and re-use this for analysis load mode<br>
><br>
> this patch is to fix the bug in inter information sharing when using<br>
> analysis=load|save mode, existing algorithm always dump and share the last part<br>
> best MV for each prediction, but there is multiple part's each with its own<br>
> prediction, the fix is to dump and share all part best MV's for each prediction<br>
><br>
> diff -r 1e04e178a349 -r 31b6ed10054e source/common/common.h<br>
> --- a/source/common/common.h Sun Nov 09 00:30:09 2014 -0600<br>
> +++ b/source/common/common.h Mon Nov 10 15:02:16 2014 +0530<br>
> @@ -291,6 +291,7 @@<br>
> #define MAX_NUM_REF 16 // max. number of entries in picture reference list<br>
><br>
> #define REF_NOT_VALID -1<br>
> +#define MAX_NUM_PART 4<br>
<br>
</span>in HEVC, inter cannot code NxN, so for the purpose of this data the max<br>
count is 2. If would be preferrable for this to be an enum in Mode<br>
rather than a general #define in common.h<br>
<div><div class="h5"><br>
> #define AMVP_NUM_CANDS 2 // number of AMVP candidates<br>
> #define MRG_MAX_NUM_CANDS 5 // max number of final merge candidates<br>
> diff -r 1e04e178a349 -r 31b6ed10054e source/encoder/analysis.cpp<br>
> --- a/source/encoder/analysis.cpp Sun Nov 09 00:30:09 2014 -0600<br>
> +++ b/source/encoder/analysis.cpp Mon Nov 10 15:02:16 2014 +0530<br>
> @@ -1407,12 +1407,16 @@<br>
><br>
> if (m_param->analysisMode == X265_ANALYSIS_LOAD && m_interAnalysisData)<br>
> {<br>
> - for (int32_t i = 0; i < numPredDir; i++)<br>
> + for (uint32_t part = 0; part < interMode.cu.getNumPartInter(); part++)<br>
> {<br>
> - interMode.bestME[i].costZero = !!m_interAnalysisData->costZero[i];<br>
> - interMode.bestME[i].mv.x = m_interAnalysisData->mvx[i];<br>
> - interMode.bestME[i].mv.y = m_interAnalysisData->mvy[i];<br>
> - interMode.bestME[i].ref = m_interAnalysisData->ref[i];<br>
> + for (int32_t i = 0; i < numPredDir; i++)<br>
> + {<br>
> + interMode.bestME[part][i].costZero = !!m_interAnalysisData->costZero[i];<br>
> + interMode.bestME[part][i].mv.x = m_interAnalysisData->mvx[i];<br>
> + interMode.bestME[part][i].mv.y = m_interAnalysisData->mvy[i];<br>
> + interMode.bestME[part][i].ref = m_interAnalysisData->ref[i];<br>
> + }<br>
> + m_interAnalysisData++;<br>
><br></div></div></blockquote><div>the pointers are incremented for load mode after copied into interMode.bestME</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="h5">
><br>
> }<br>
> }<br>
> if (predInterSearch(interMode, cuGeom, false, false))<br>
> @@ -1425,17 +1429,20 @@<br>
><br>
> if (m_param->analysisMode == X265_ANALYSIS_SAVE && m_interAnalysisData)<br>
> {<br>
> - for (int32_t i = 0; i < numPredDir; i++)<br>
> + for (uint32_t part = 0; part < interMode.cu.getNumPartInter(); part++)<br>
> {<br>
> - m_interAnalysisData->costZero[i] = interMode.bestME[i].costZero;<br>
> - m_interAnalysisData->mvx[i] = interMode.bestME[i].mv.x;<br>
> - m_interAnalysisData->mvy[i] = interMode.bestME[i].mv.y;<br>
> - m_interAnalysisData->ref[i] = interMode.bestME[i].ref;<br>
> + for (int32_t i = 0; i < numPredDir; i++)<br>
> + {<br>
> + m_interAnalysisData->costZero[i] = interMode.bestME[part][i].costZero;<br>
> + m_interAnalysisData->mvx[i] = interMode.bestME[part][i].mv.x;<br>
> + m_interAnalysisData->mvy[i] = interMode.bestME[part][i].mv.y;<br>
> + m_interAnalysisData->ref[i] = interMode.bestME[part][i].ref;<br>
> + }<br>
> + m_interAnalysisData->zOrder = cuGeom.encodeIdx;<br>
> + m_interAnalysisData->depth = cuGeom.depth;<br>
> + m_interAnalysisData++;<br></div></div></blockquote><div>the pointers are incremented for save mode after copied into interAnalysisData</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="h5">
> }<br>
> - m_interAnalysisData->zOrder = cuGeom.encodeIdx;<br>
> - m_interAnalysisData->depth = cuGeom.depth;<br>
> }<br>
> - m_interAnalysisData++;<br>
> }<br>
> else<br>
> {<br>
> @@ -1453,12 +1460,16 @@<br>
><br>
> if (m_param->analysisMode == X265_ANALYSIS_LOAD && m_interAnalysisData)<br>
> {<br>
> - for (int32_t i = 0; i < numPredDir; i++)<br>
> + for (uint32_t part = 0; part < interMode.cu.getNumPartInter(); part++)<br>
> {<br>
> - interMode.bestME[i].costZero = !!m_interAnalysisData->costZero[i];<br>
> - interMode.bestME[i].mv.x = m_interAnalysisData->mvx[i];<br>
> - interMode.bestME[i].mv.y = m_interAnalysisData->mvy[i];<br>
> - interMode.bestME[i].ref = m_interAnalysisData->ref[i];<br>
> + for (int32_t i = 0; i < numPredDir; i++)<br>
> + {<br>
> + interMode.bestME[part][i].costZero = !!m_interAnalysisData->costZero[i];<br>
> + interMode.bestME[part][i].mv.x = m_interAnalysisData->mvx[i];<br>
> + interMode.bestME[part][i].mv.y = m_interAnalysisData->mvy[i];<br>
> + interMode.bestME[part][i].ref = m_interAnalysisData->ref[i];<br>
> + }<br>
> + m_interAnalysisData++;<br>
> }<br>
> }<br>
> if (predInterSearch(interMode, cuGeom, bMergeOnly, true))<br>
> @@ -1467,17 +1478,20 @@<br>
> encodeResAndCalcRdInterCU(interMode, cuGeom);<br>
> if (m_param->analysisMode == X265_ANALYSIS_SAVE && m_interAnalysisData)<br>
> {<br>
> - for (int32_t i = 0; i < numPredDir; i++)<br>
> + for (uint32_t part = 0; part < interMode.cu.getNumPartInter(); part++)<br>
> {<br>
> - m_interAnalysisData->costZero[i] = interMode.bestME[i].costZero;<br>
> - m_interAnalysisData->mvx[i] = interMode.bestME[i].mv.x;<br>
> - m_interAnalysisData->mvy[i] = interMode.bestME[i].mv.y;<br>
> - m_interAnalysisData->ref[i] = interMode.bestME[i].ref;<br>
> + for (int32_t i = 0; i < numPredDir; i++)<br>
> + {<br>
> + m_interAnalysisData->costZero[i] = interMode.bestME[part][i].costZero;<br>
> + m_interAnalysisData->mvx[i] = interMode.bestME[part][i].mv.x;<br>
> + m_interAnalysisData->mvy[i] = interMode.bestME[part][i].mv.y;<br>
> + m_interAnalysisData->ref[i] = interMode.bestME[part][i].ref;<br>
> + }<br>
> + m_interAnalysisData->zOrder = cuGeom.encodeIdx;<br>
> + m_interAnalysisData->depth = cuGeom.depth;<br>
> + m_interAnalysisData++;<br>
> }<br>
> - m_interAnalysisData->zOrder = cuGeom.encodeIdx;<br>
> - m_interAnalysisData->depth = cuGeom.depth;<br>
> }<br>
> - m_interAnalysisData++;<br>
> }<br>
> else<br>
> {<br>
> diff -r 1e04e178a349 -r 31b6ed10054e source/encoder/search.cpp<br>
> --- a/source/encoder/search.cpp Sun Nov 09 00:30:09 2014 -0600<br>
> +++ b/source/encoder/search.cpp Mon Nov 10 15:02:16 2014 +0530<br>
> @@ -1907,15 +1907,15 @@<br>
><br>
> /* tie goes to the smallest ref ID, just like --no-pme */<br>
> ScopedLock _lock(master.m_outputLock);<br>
> - if (cost < interMode.bestME[list].cost ||<br>
> - (cost == interMode.bestME[list].cost && ref < interMode.bestME[list].ref))<br>
> + if (cost < interMode.bestME[part][list].cost ||<br>
> + (cost == interMode.bestME[part][list].cost && ref < interMode.bestME[part][list].ref))<br>
> {<br>
> - interMode.bestME[list].mv = outmv;<br>
> - interMode.bestME[list].mvp = mvp;<br>
> - interMode.bestME[list].mvpIdx = mvpIdx;<br>
> - interMode.bestME[list].ref = ref;<br>
> - interMode.bestME[list].cost = cost;<br>
> - interMode.bestME[list].bits = bits;<br>
> + interMode.bestME[part][list].mv = outmv;<br>
> + interMode.bestME[part][list].mvp = mvp;<br>
> + interMode.bestME[part][list].mvpIdx = mvpIdx;<br>
> + interMode.bestME[part][list].ref = ref;<br>
> + interMode.bestME[part][list].cost = cost;<br>
> + interMode.bestME[part][list].bits = bits;<br>
> }<br>
> }<br>
><br>
> @@ -1988,17 +1988,17 @@<br>
> uint32_t bidirCost = MAX_UINT;<br>
> int bidirBits = 0;<br>
<br>
</div></div>this would be a lot easier to read if you just declared:<br>
<br>
MotionData* bestME = interMode.bestME[puIdx];<br>
<div><div class="h5"><br>
><br>
> - interMode.bestME[0].cost = MAX_UINT;<br>
> - interMode.bestME[1].cost = MAX_UINT;<br>
> + interMode.bestME[puIdx][0].cost = MAX_UINT;<br>
> + interMode.bestME[puIdx][1].cost = MAX_UINT;<br>
><br>
> getBlkBits((PartSize)cu.m_partSize[0], slice->isInterP(), puIdx, lastMode, m_listSelBits);<br>
><br>
> /* Uni-directional prediction */<br>
> - if (m_param->analysisMode == X265_ANALYSIS_LOAD && interMode.bestME[0].ref >= 0)<br>
> + if (m_param->analysisMode == X265_ANALYSIS_LOAD && interMode.bestME[puIdx][0].ref >= 0)<br>
> {<br>
> for (int l = 0; l < numPredDir; l++)<br>
> {<br>
> - int ref = interMode.bestME[l].ref;<br>
> + int ref = interMode.bestME[puIdx][l].ref;<br>
> uint32_t bits = m_listSelBits[l] + MVP_IDX_BITS;<br>
> bits += getTUBits(ref, numRefIdx[l]);<br>
><br>
> @@ -2030,13 +2030,13 @@<br>
><br>
> MV mvmin, mvmax, outmv, mvp = interMode.amvpCand[l][ref][mvpIdx];<br>
> m_me.setMVP(mvp);<br>
> - MV bmv(interMode.bestME[l].mv.x, interMode.bestME[l].mv.y);<br>
> + MV bmv(interMode.bestME[puIdx][l].mv.x, interMode.bestME[puIdx][l].mv.y);<br>
><br>
> int satdCost;<br>
> - if (interMode.bestME[l].costZero)<br>
> + if (interMode.bestME[puIdx][l].costZero)<br>
> satdCost = m_me.mvcost(bmv);<br>
> else<br>
> - satdCost = interMode.bestME[l].cost;<br>
> + satdCost = interMode.bestME[puIdx][l].cost;<br>
><br>
> /* Get total cost of partition, but only include MV bit cost once */<br>
> bits += m_me.bitcost(bmv);<br>
> @@ -2045,14 +2045,14 @@<br>
> /* Refine MVP selection, updates: mvp, mvpIdx, bits, cost */<br>
> checkBestMVP(interMode.amvpCand[l][ref], outmv, mvp, mvpIdx, bits, cost);<br>
><br>
> - if (cost < interMode.bestME[l].cost)<br>
> + if (cost < interMode.bestME[puIdx][l].cost)<br>
> {<br>
> - interMode.bestME[l].mv = outmv;<br>
> - interMode.bestME[l].mvp = mvp;<br>
> - interMode.bestME[l].mvpIdx = mvpIdx;<br>
> - interMode.bestME[l].ref = ref;<br>
> - interMode.bestME[l].cost = cost;<br>
> - interMode.bestME[l].bits = bits;<br>
> + interMode.bestME[puIdx][l].mv = outmv;<br>
> + interMode.bestME[puIdx][l].mvp = mvp;<br>
> + interMode.bestME[puIdx][l].mvpIdx = mvpIdx;<br>
> + interMode.bestME[puIdx][l].ref = ref;<br>
> + interMode.bestME[puIdx][l].cost = cost;<br>
> + interMode.bestME[puIdx][l].bits = bits;<br>
> }<br>
> }<br>
> }<br>
> @@ -2148,31 +2148,31 @@<br>
> /* Refine MVP selection, updates: mvp, mvpIdx, bits, cost */<br>
> checkBestMVP(interMode.amvpCand[l][ref], outmv, mvp, mvpIdx, bits, cost);<br>
><br>
> - if (cost < interMode.bestME[l].cost)<br>
> + if (cost < interMode.bestME[puIdx][l].cost)<br>
> {<br>
> - interMode.bestME[l].mv = outmv;<br>
> - interMode.bestME[l].mvp = mvp;<br>
> - interMode.bestME[l].mvpIdx = mvpIdx;<br>
> - interMode.bestME[l].ref = ref;<br>
> - interMode.bestME[l].cost = cost;<br>
> - interMode.bestME[l].bits = bits;<br>
> + interMode.bestME[puIdx][l].mv = outmv;<br>
> + interMode.bestME[puIdx][l].mvp = mvp;<br>
> + interMode.bestME[puIdx][l].mvpIdx = mvpIdx;<br>
> + interMode.bestME[puIdx][l].ref = ref;<br>
> + interMode.bestME[puIdx][l].cost = cost;<br>
> + interMode.bestME[puIdx][l].bits = bits;<br>
> }<br>
> }<br>
> }<br>
> }<br>
><br>
> /* Bi-directional prediction */<br>
> - if (slice->isInterB() && !cu.isBipredRestriction() && interMode.bestME[0].cost != MAX_UINT && interMode.bestME[1].cost != MAX_UINT)<br>
> + if (slice->isInterB() && !cu.isBipredRestriction() && interMode.bestME[puIdx][0].cost != MAX_UINT && interMode.bestME[puIdx][1].cost != MAX_UINT)<br>
> {<br>
> - bidir[0] = interMode.bestME[0];<br>
> - bidir[1] = interMode.bestME[1];<br>
> + bidir[0] = interMode.bestME[puIdx][0];<br>
> + bidir[1] = interMode.bestME[puIdx][1];<br>
><br>
> /* Generate reference subpels */<br>
> - PicYuv* refPic0 = slice->m_refPicList[0][interMode.bestME[0].ref]->m_reconPic;<br>
> - PicYuv* refPic1 = slice->m_refPicList[1][interMode.bestME[1].ref]->m_reconPic;<br>
> + PicYuv* refPic0 = slice->m_refPicList[0][interMode.bestME[puIdx][0].ref]->m_reconPic;<br>
> + PicYuv* refPic1 = slice->m_refPicList[1][interMode.bestME[puIdx][1].ref]->m_reconPic;<br>
> Yuv* bidirYuv = m_rqt[cuGeom.depth].bidirPredYuv;<br>
> - predInterLumaPixel(bidirYuv[0], *refPic0, interMode.bestME[0].mv);<br>
> - predInterLumaPixel(bidirYuv[1], *refPic1, interMode.bestME[1].mv);<br>
> + predInterLumaPixel(bidirYuv[0], *refPic0, interMode.bestME[puIdx][0].mv);<br>
> + predInterLumaPixel(bidirYuv[1], *refPic1, interMode.bestME[puIdx][1].mv);<br>
><br>
> pixel *pred0 = bidirYuv[0].getLumaAddr(m_puAbsPartIdx);<br>
> pixel *pred1 = bidirYuv[1].getLumaAddr(m_puAbsPartIdx);<br>
> @@ -2181,10 +2181,10 @@<br>
> primitives.pixelavg_pp[partEnum](tmpPredYuv.m_buf[0], tmpPredYuv.m_size, pred0, bidirYuv[0].m_size, pred1, bidirYuv[1].m_size, 32);<br>
> int satdCost = m_me.bufSATD(tmpPredYuv.m_buf[0], tmpPredYuv.m_size);<br>
><br>
> - bidirBits = interMode.bestME[0].bits + interMode.bestME[1].bits + m_listSelBits[2] - (m_listSelBits[0] + m_listSelBits[1]);<br>
> + bidirBits = interMode.bestME[puIdx][0].bits + interMode.bestME[puIdx][1].bits + m_listSelBits[2] - (m_listSelBits[0] + m_listSelBits[1]);<br>
> bidirCost = satdCost + m_rdCost.getCost(bidirBits);<br>
><br>
> - bool bTryZero = interMode.bestME[0].mv.notZero() || interMode.bestME[1].mv.notZero();<br>
> + bool bTryZero = interMode.bestME[puIdx][0].mv.notZero() || interMode.bestME[puIdx][1].mv.notZero();<br>
> if (bTryZero)<br>
> {<br>
> /* Do not try zero MV if unidir motion predictors are beyond<br>
> @@ -2196,32 +2196,32 @@<br>
> mvmin <<= 2;<br>
> mvmax <<= 2;<br>
><br>
> - bTryZero &= interMode.bestME[0].mvp.checkRange(mvmin, mvmax);<br>
> - bTryZero &= interMode.bestME[1].mvp.checkRange(mvmin, mvmax);<br>
> + bTryZero &= interMode.bestME[puIdx][0].mvp.checkRange(mvmin, mvmax);<br>
> + bTryZero &= interMode.bestME[puIdx][1].mvp.checkRange(mvmin, mvmax);<br>
> }<br>
> if (bTryZero)<br>
> {<br>
> /* coincident blocks of the two reference pictures */<br>
> - pixel *ref0 = m_slice->m_mref[0][interMode.bestME[0].ref].getLumaAddr(cu.m_cuAddr, cuGeom.encodeIdx + m_puAbsPartIdx);<br>
> - pixel *ref1 = m_slice->m_mref[1][interMode.bestME[1].ref].getLumaAddr(cu.m_cuAddr, cuGeom.encodeIdx + m_puAbsPartIdx);<br>
> + pixel *ref0 = m_slice->m_mref[0][interMode.bestME[puIdx][0].ref].getLumaAddr(cu.m_cuAddr, cuGeom.encodeIdx + m_puAbsPartIdx);<br>
> + pixel *ref1 = m_slice->m_mref[1][interMode.bestME[puIdx][1].ref].getLumaAddr(cu.m_cuAddr, cuGeom.encodeIdx + m_puAbsPartIdx);<br>
> intptr_t refStride = slice->m_mref[0][0].lumaStride;<br>
><br>
> primitives.pixelavg_pp[partEnum](tmpPredYuv.m_buf[0], tmpPredYuv.m_size, ref0, refStride, ref1, refStride, 32);<br>
> satdCost = m_me.bufSATD(tmpPredYuv.m_buf[0], tmpPredYuv.m_size);<br>
><br>
> - MV mvp0 = interMode.bestME[0].mvp;<br>
> - int mvpIdx0 = interMode.bestME[0].mvpIdx;<br>
> - uint32_t bits0 = interMode.bestME[0].bits - m_me.bitcost(interMode.bestME[0].mv, mvp0) + m_me.bitcost(mvzero, mvp0);<br>
> -<br>
> - MV mvp1 = interMode.bestME[1].mvp;<br>
> - int mvpIdx1 = interMode.bestME[1].mvpIdx;<br>
> - uint32_t bits1 = interMode.bestME[1].bits - m_me.bitcost(interMode.bestME[1].mv, mvp1) + m_me.bitcost(mvzero, mvp1);<br>
> + MV mvp0 = interMode.bestME[puIdx][0].mvp;<br>
> + int mvpIdx0 = interMode.bestME[puIdx][0].mvpIdx;<br>
> + uint32_t bits0 = interMode.bestME[puIdx][0].bits - m_me.bitcost(interMode.bestME[puIdx][0].mv, mvp0) + m_me.bitcost(mvzero, mvp0);<br>
> +<br>
> + MV mvp1 = interMode.bestME[puIdx][1].mvp;<br>
> + int mvpIdx1 = interMode.bestME[puIdx][1].mvpIdx;<br>
> + uint32_t bits1 = interMode.bestME[puIdx][1].bits - m_me.bitcost(interMode.bestME[puIdx][1].mv, mvp1) + m_me.bitcost(mvzero, mvp1);<br>
><br>
> uint32_t cost = satdCost + m_rdCost.getCost(bits0) + m_rdCost.getCost(bits1);<br>
><br>
> /* refine MVP selection for zero mv, updates: mvp, mvpidx, bits, cost */<br>
> - checkBestMVP(interMode.amvpCand[0][interMode.bestME[0].ref], mvzero, mvp0, mvpIdx0, bits0, cost);<br>
> - checkBestMVP(interMode.amvpCand[1][interMode.bestME[1].ref], mvzero, mvp1, mvpIdx1, bits1, cost);<br>
> + checkBestMVP(interMode.amvpCand[0][interMode.bestME[puIdx][0].ref], mvzero, mvp0, mvpIdx0, bits0, cost);<br>
> + checkBestMVP(interMode.amvpCand[1][interMode.bestME[puIdx][1].ref], mvzero, mvp1, mvpIdx1, bits1, cost);<br>
><br>
> if (cost < bidirCost)<br>
> {<br>
> @@ -2243,7 +2243,7 @@<br>
> }<br>
><br>
> /* select best option and store into CU */<br>
> - if (mrgCost < bidirCost && mrgCost < interMode.bestME[0].cost && mrgCost < interMode.bestME[1].cost)<br>
> + if (mrgCost < bidirCost && mrgCost < interMode.bestME[puIdx][0].cost && mrgCost < interMode.bestME[puIdx][1].cost)<br>
> {<br>
> cu.m_mergeFlag[m_puAbsPartIdx] = true;<br>
> cu.m_mvpIdx[0][m_puAbsPartIdx] = merge.index; // merge candidate ID is stored in L0 MVP idx<br>
> @@ -2255,39 +2255,39 @@<br>
><br>
> totalmebits += merge.bits;<br>
> }<br>
> - else if (bidirCost < interMode.bestME[0].cost && bidirCost < interMode.bestME[1].cost)<br>
> + else if (bidirCost < interMode.bestME[puIdx][0].cost && bidirCost < interMode.bestME[puIdx][1].cost)<br>
> {<br>
> lastMode = 2;<br>
><br>
> cu.m_mergeFlag[m_puAbsPartIdx] = false;<br>
> cu.setPUInterDir(3, m_puAbsPartIdx, puIdx);<br>
> cu.setPUMv(0, bidir[0].mv, m_puAbsPartIdx, puIdx);<br>
> - cu.setPURefIdx(0, interMode.bestME[0].ref, m_puAbsPartIdx, puIdx);<br>
> + cu.setPURefIdx(0, interMode.bestME[puIdx][0].ref, m_puAbsPartIdx, puIdx);<br>
> cu.m_mvd[0][m_puAbsPartIdx] = bidir[0].mv - bidir[0].mvp;<br>
> cu.m_mvpIdx[0][m_puAbsPartIdx] = bidir[0].mvpIdx;<br>
><br>
> cu.setPUMv(1, bidir[1].mv, m_puAbsPartIdx, puIdx);<br>
> - cu.setPURefIdx(1, interMode.bestME[1].ref, m_puAbsPartIdx, puIdx);<br>
> + cu.setPURefIdx(1, interMode.bestME[puIdx][1].ref, m_puAbsPartIdx, puIdx);<br>
> cu.m_mvd[1][m_puAbsPartIdx] = bidir[1].mv - bidir[1].mvp;<br>
> cu.m_mvpIdx[1][m_puAbsPartIdx] = bidir[1].mvpIdx;<br>
><br>
> totalmebits += bidirBits;<br>
> }<br>
> - else if (interMode.bestME[0].cost <= interMode.bestME[1].cost)<br>
> + else if (interMode.bestME[puIdx][0].cost <= interMode.bestME[puIdx][1].cost)<br>
> {<br>
> lastMode = 0;<br>
><br>
> cu.m_mergeFlag[m_puAbsPartIdx] = false;<br>
> cu.setPUInterDir(1, m_puAbsPartIdx, puIdx);<br>
> - cu.setPUMv(0, interMode.bestME[0].mv, m_puAbsPartIdx, puIdx);<br>
> - cu.setPURefIdx(0, interMode.bestME[0].ref, m_puAbsPartIdx, puIdx);<br>
> - cu.m_mvd[0][m_puAbsPartIdx] = interMode.bestME[0].mv - interMode.bestME[0].mvp;<br>
> - cu.m_mvpIdx[0][m_puAbsPartIdx] = interMode.bestME[0].mvpIdx;<br>
> + cu.setPUMv(0, interMode.bestME[puIdx][0].mv, m_puAbsPartIdx, puIdx);<br>
> + cu.setPURefIdx(0, interMode.bestME[puIdx][0].ref, m_puAbsPartIdx, puIdx);<br>
> + cu.m_mvd[0][m_puAbsPartIdx] = interMode.bestME[puIdx][0].mv - interMode.bestME[puIdx][0].mvp;<br>
> + cu.m_mvpIdx[0][m_puAbsPartIdx] = interMode.bestME[puIdx][0].mvpIdx;<br>
><br>
> cu.setPURefIdx(1, REF_NOT_VALID, m_puAbsPartIdx, puIdx);<br>
> cu.setPUMv(1, mvzero, m_puAbsPartIdx, puIdx);<br>
><br>
> - totalmebits += interMode.bestME[0].bits;<br>
> + totalmebits += interMode.bestME[puIdx][0].bits;<br>
> }<br>
> else<br>
> {<br>
> @@ -2295,15 +2295,15 @@<br>
><br>
> cu.m_mergeFlag[m_puAbsPartIdx] = false;<br>
> cu.setPUInterDir(2, m_puAbsPartIdx, puIdx);<br>
> - cu.setPUMv(1, interMode.bestME[1].mv, m_puAbsPartIdx, puIdx);<br>
> - cu.setPURefIdx(1, interMode.bestME[1].ref, m_puAbsPartIdx, puIdx);<br>
> - cu.m_mvd[1][m_puAbsPartIdx] = interMode.bestME[1].mv - interMode.bestME[1].mvp;<br>
> - cu.m_mvpIdx[1][m_puAbsPartIdx] = interMode.bestME[1].mvpIdx;<br>
> + cu.setPUMv(1, interMode.bestME[puIdx][1].mv, m_puAbsPartIdx, puIdx);<br>
> + cu.setPURefIdx(1, interMode.bestME[puIdx][1].ref, m_puAbsPartIdx, puIdx);<br>
> + cu.m_mvd[1][m_puAbsPartIdx] = interMode.bestME[puIdx][1].mv - interMode.bestME[puIdx][1].mvp;<br>
> + cu.m_mvpIdx[1][m_puAbsPartIdx] = interMode.bestME[puIdx][1].mvpIdx;<br>
><br>
> cu.setPURefIdx(0, REF_NOT_VALID, m_puAbsPartIdx, puIdx);<br>
> cu.setPUMv(0, mvzero, m_puAbsPartIdx, puIdx);<br>
><br>
> - totalmebits += interMode.bestME[1].bits;<br>
> + totalmebits += interMode.bestME[puIdx][1].bits;<br>
> }<br>
><br>
> prepMotionCompensation(cu, cuGeom, puIdx);<br>
> diff -r 1e04e178a349 -r 31b6ed10054e source/encoder/search.h<br>
> --- a/source/encoder/search.h Sun Nov 09 00:30:09 2014 -0600<br>
> +++ b/source/encoder/search.h Mon Nov 10 15:02:16 2014 +0530<br>
> @@ -84,7 +84,7 @@<br>
> Yuv reconYuv;<br>
> Entropy contexts;<br>
><br>
> - MotionData bestME[2];<br>
> + MotionData bestME[MAX_NUM_PART][2];<br>
<br>
</div></div> enum { MAX_INTER_PARTS = 2 };<br>
MotionData bestME[MAX_INTER_PARTS][2];<br>
<span class=""><br>
> MV amvpCand[2][MAX_NUM_REF][AMVP_NUM_CANDS];<br>
><br>
> uint64_t rdCost; // sum of partition (psy) RD costs (sse(fenc, recon) + lambda2 * bits)<br>
<br>
</span>Don't changes need to be made to the allocation of the inter data<br>
buffers or where the pointers are incremented?<br>
<span class=""><font color="#888888"><br></font></span></blockquote><div>yes i need to increment the inter buffer allocation for part also <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class=""><font color="#888888">
--<br>
Steve Borho<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Thanks & Regards<br>Gopu G<br>Multicoreware Inc <br><br></div>
</div></div>