<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 14, 2014 at 11:51 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 10/14, <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 1413260936 -19800<br>
> # Tue Oct 14 09:58:56 2014 +0530<br>
> # Node ID 585e8591cb95ef5a57e10f16e9f4bd61ec5a8913<br>
> # Parent f26e81eb555aa586380b34314c302ea9b148f357<br>
> search: dump best motion statistics for P and B slices into analysisdata file<br>
><br>
> diff -r f26e81eb555a -r 585e8591cb95 source/Lib/TLibCommon/TComRom.h<br>
> --- a/source/Lib/TLibCommon/TComRom.h Mon Oct 13 14:36:40 2014 +0530<br>
> +++ b/source/Lib/TLibCommon/TComRom.h Tue Oct 14 09:58:56 2014 +0530<br>
> @@ -68,6 +68,8 @@<br>
><br>
> #define SLFASE_CONSTANT 0x5f4e4a53<br>
><br>
> +#define MAX_RECURSIVE 85 //maximum recursive call for each cu<br>
> +<br>
> void initROM();<br>
> void destroyROM();<br>
><br>
> diff -r f26e81eb555a -r 585e8591cb95 source/encoder/analysis.cpp<br>
> --- a/source/encoder/analysis.cpp Mon Oct 13 14:36:40 2014 +0530<br>
> +++ b/source/encoder/analysis.cpp Tue Oct 14 09:58:56 2014 +0530<br>
> @@ -477,6 +477,9 @@<br>
> }<br>
> else<br>
> {<br>
> + if (m_param->analysisMode)<br>
> + m_interAnalysisData = ctu->m_pic->m_interData + (ctu->m_cuAddr * MAX_RECURSIVE);<br>
> +<br>
> if (m_param->rdLevel < 5)<br>
> {<br>
> TComDataCU* outBestCU = NULL;<br>
> @@ -712,8 +715,6 @@<br>
> for (uint32_t partUnitIdx = 0; partUnitIdx < 4; partUnitIdx++)<br>
> {<br>
> CU *child_cu = pic->getCU(outTempCU->m_cuAddr)->m_cuLocalData + cu->childIdx + partUnitIdx;<br>
> - int qp = outTempCU->getQP(0);<br>
> - subBestPartCU->initSubCU(outTempCU, child_cu, partUnitIdx, nextDepth, qp); // clear sub partition datas or init.<br>
> if (child_cu->flags & CU::PRESENT)<br>
> {<br>
> subTempPartCU->initSubCU(outTempCU, child_cu, partUnitIdx, nextDepth, qp); // clear sub partition datas or init.<br>
> @@ -964,6 +965,10 @@<br>
> m_bJobsQueued = false;<br>
> m_modeCompletionEvent.wait();<br>
><br>
> + /* increment the analysisData buffer for each recursive call */<br>
> + if (m_interAnalysisData)<br>
> + m_interAnalysisData++;<br>
<br>
</div></div>this seems unlikely to be the right place for this. if the data is<br>
per-mode it needs to be handled in the mode functions. if it is per CU,<br>
it should probably be incremented at the end of this function or at<br>
least after the best non-split choice is selected<br></blockquote><div><br></div><div> yes this analysisData buffer is per cu, this can be incremented at the end of function,<br></div><div>i will resend this patch <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5"><br>
> if (m_param->bEnableEarlySkip && m_bestMergeCU[depth]->isSkipped(0))<br>
> {<br>
> outBestCU = m_bestMergeCU[depth];<br>
> @@ -1450,6 +1455,10 @@<br>
> outTempCU->initEstData();<br>
> if (m_param->bEnableCbfFastMode)<br>
> doNotBlockPu = outBestCU->getQtRootCbf(0) != 0;<br>
> +<br>
> + /* increment the analysisData buffer for each recursive call */<br>
> + if (m_interAnalysisData)<br>
> + m_interAnalysisData++;<br>
> }<br>
> }<br>
><br>
> @@ -2093,7 +2102,7 @@<br>
> cu->m_totalDistortion = primitives.sa8d[sizeIdx](m_origYuv[depth]->getLumaAddr(), m_origYuv[depth]->getStride(), predYuv->getLumaAddr(), predYuv->getStride());<br>
> cu->m_sa8dCost = m_rdCost.calcRdSADCost(cu->m_totalDistortion, cu->m_totalBits);<br>
> }<br>
> - else if (predInterSearch(cu, cuData, predYuv, false, false))<br>
> + else if (predInterSearch(cu, cuData, predYuv, false, false, m_interAnalysisData))<br>
> {<br>
> int sizeIdx = cu->getLog2CUSize(0) - 2;<br>
> uint32_t distortion = primitives.sa8d[sizeIdx](m_origYuv[depth]->getLumaAddr(), m_origYuv[depth]->getStride(), predYuv->getLumaAddr(), predYuv->getStride());<br>
> @@ -2124,7 +2133,7 @@<br>
> checkDQP(tempCU);<br>
> checkBestMode(bestCU, tempCU, depth);<br>
> }<br>
> - else if (predInterSearch(tempCU, cuData, m_tmpPredYuv[depth], bMergeOnly, true))<br>
> + else if (predInterSearch(tempCU, cuData, m_tmpPredYuv[depth], bMergeOnly, true, m_interAnalysisData))<br>
> {<br>
> encodeResAndCalcRdInterCU(tempCU, cuData, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_bestResiYuv[depth], m_tmpRecoYuv[depth]);<br>
> checkDQP(tempCU);<br>
> diff -r f26e81eb555a -r 585e8591cb95 source/encoder/analysis.h<br>
> --- a/source/encoder/analysis.h Mon Oct 13 14:36:40 2014 +0530<br>
> +++ b/source/encoder/analysis.h Tue Oct 14 09:58:56 2014 +0530<br>
> @@ -109,6 +109,7 @@<br>
><br>
> StatisticLog m_sliceTypeLog[3];<br>
> StatisticLog* m_log;<br>
> + x265_inter_data* m_interAnalysisData; // To store the inter analysis data per CU<br>
><br>
> Analysis();<br>
> bool create(uint32_t totalDepth, uint32_t maxWidth, ThreadLocalData* tld);<br>
> diff -r f26e81eb555a -r 585e8591cb95 source/encoder/search.cpp<br>
> --- a/source/encoder/search.cpp Mon Oct 13 14:36:40 2014 +0530<br>
> +++ b/source/encoder/search.cpp Tue Oct 14 09:58:56 2014 +0530<br>
> @@ -1684,7 +1684,7 @@<br>
><br>
> /* search of the best candidate for inter prediction<br>
> * returns true if predYuv was filled with a motion compensated prediction */<br>
> -bool Search::predInterSearch(TComDataCU* cu, CU* cuData, TComYuv* predYuv, bool bMergeOnly, bool bChroma)<br>
> +bool Search::predInterSearch(TComDataCU* cu, CU* cuData, TComYuv* predYuv, bool bMergeOnly, bool bChroma, x265_inter_data* interAnalysisData)<br>
> {<br>
> MV amvpCand[2][MAX_NUM_REF][AMVP_NUM_CANDS];<br>
> MV mvc[(MD_ABOVE_LEFT + 1) * 2 + 1];<br>
> @@ -1755,6 +1755,11 @@<br>
> list[0].cost = MAX_UINT;<br>
> list[1].cost = MAX_UINT;<br>
><br>
> + /* require for sharing mode, if cost is zero no need to call subpelCompare<br>
> + * extract the best cost from mvcost and this is only for actual me, not required for<br>
> + * lowres me and isCostZero is NULL when the me is called from slicetype */<br>
<br>
</div></div>white-space<br>
<div><div class="h5"><br>
> + bool costZero[2];<br>
> +<br>
> getBlkBits(partSize, slice->isInterP(), partIdx, lastMode, listSelBits);<br>
><br>
> // Uni-directional prediction<br>
> @@ -1812,10 +1817,24 @@<br>
> list[l].ref = ref;<br>
> list[l].cost = cost;<br>
> list[l].bits = bits;<br>
> + costZero[l] = !!satdCost;<br>
> }<br>
> }<br>
> }<br>
><br>
> + if (m_param->analysisMode == X265_ANALYSIS_SAVE && interAnalysisData)<br>
> + {<br>
> + for (int32_t i = 0; i < 2; i++)<br>
> + {<br>
> + interAnalysisData->costZero[i] = costZero[i];<br>
> + interAnalysisData->mvx[i] = list[i].mv.x;<br>
> + interAnalysisData->mvy[i] = list[i].mv.y;<br>
> + interAnalysisData->ref[i] = list[i].ref;<br>
> + }<br>
> + interAnalysisData->zOrder = cu->m_absIdxInCTU;<br>
> + interAnalysisData->depth = cu->getDepth(0);<br>
> + }<br>
> +<br>
> // Bi-directional prediction<br>
> if (slice->isInterB() && !cu->isBipredRestriction() && list[0].cost != MAX_UINT && list[1].cost != MAX_UINT)<br>
> {<br>
> diff -r f26e81eb555a -r 585e8591cb95 source/encoder/search.h<br>
> --- a/source/encoder/search.h Mon Oct 13 14:36:40 2014 +0530<br>
> +++ b/source/encoder/search.h Tue Oct 14 09:58:56 2014 +0530<br>
> @@ -101,7 +101,7 @@<br>
> void estIntraPredChromaQT(TComDataCU* cu, CU* cuData, TComYuv* fencYuv, TComYuv* predYuv, ShortYuv* resiYuv, TComYuv* reconYuv);<br>
><br>
> // estimation inter prediction (non-skip)<br>
> - bool predInterSearch(TComDataCU* cu, CU* cuData, TComYuv* predYuv, bool bMergeOnly, bool bChroma);<br>
> + bool predInterSearch(TComDataCU* cu, CU* cuData, TComYuv* predYuv, bool bMergeOnly, bool bChroma, x265_inter_data* m_interAnalysisData);<br>
><br>
> // encode residual and compute rd-cost for inter mode<br>
> void encodeResAndCalcRdInterCU(TComDataCU* cu, CU* cuData, TComYuv* fencYuv, TComYuv* predYuv, ShortYuv* resiYuv, ShortYuv* bestResiYuv, TComYuv* reconYuv);<br>
</div></div>> _______________________________________________<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>
<span class="HOEnZb"><font color="#888888"><br>
--<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>Thanks & Regards<br>Gopu G<br>Multicoreware Inc <br><br>
</div></div>