<div dir="ltr"><span style="font-size:12.8px">g_depthInc[] is also used in compressInterCU_rd5_6(). It can be removed completely once the analysis mode of </span><span style="font-size:12.8px">compressInterCU_rd5_6() is cleaned up.</span></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 9, 2015 at 1:11 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"><span class="">On 10/08, <a href="mailto:kavitha@multicorewareinc.com">kavitha@multicorewareinc.com</a> wrote:<br>
> # HG changeset patch<br>
> # User Kavitha Sampath <<a href="mailto:kavitha@multicorewareinc.com">kavitha@multicorewareinc.com</a>><br>
> # Date 1444306002 -19800<br>
> # Thu Oct 08 17:36:42 2015 +0530<br>
> # Node ID c4d4df4413b8ae67550e6f3240367b4f241cc4b2<br>
> # Parent bd8087bfd93f7564df436a27c22f7e44f6803c4a<br>
> Add optional parameter to setLambdaFromQP and calculateQpForCUSize functions<br>
><br>
> Inaddition, the zOrder is no more passed explicitly to compressIntraCU(),<br>
> instead used implicitly from cuGeom. This commit forms groundwork for<br>
> QP based RD refinement.<br>
<br>
</span>nice cleanup patch. is g_depthInc[] still used anywhere, or can it be<br>
also removed?<br>
<div><div class="h5"><br>
> diff -r bd8087bfd93f -r c4d4df4413b8 source/encoder/analysis.cpp<br>
> --- a/source/encoder/analysis.cpp Thu Oct 08 16:28:14 2015 +0530<br>
> +++ b/source/encoder/analysis.cpp Thu Oct 08 17:36:42 2015 +0530<br>
> @@ -150,7 +150,6 @@<br>
><br>
> ProfileCUScope(ctu, totalCTUTime, totalCTUs);<br>
><br>
> - uint32_t zOrder = 0;<br>
> if (m_slice->m_sliceType == I_SLICE)<br>
> {<br>
> analysis_intra_data* intraDataCTU = (analysis_intra_data*)m_frame->m_analysisData.intraData;<br>
> @@ -161,7 +160,7 @@<br>
> memcpy(ctu.m_partSize, &intraDataCTU->partSizes[ctu.m_cuAddr * numPartition], sizeof(char) * numPartition);<br>
> memcpy(ctu.m_chromaIntraDir, &intraDataCTU->chromaModes[ctu.m_cuAddr * numPartition], sizeof(uint8_t) * numPartition);<br>
> }<br>
> - compressIntraCU(ctu, cuGeom, zOrder, qp);<br>
> + compressIntraCU(ctu, cuGeom, qp);<br>
> if (m_param->analysisMode == X265_ANALYSIS_SAVE && intraDataCTU)<br>
> {<br>
> CUData* bestCU = &m_modeDepth[0].bestMode->cu;<br>
> @@ -190,6 +189,7 @@<br>
> compressInterCU_rd0_4(ctu, cuGeom, qp);<br>
> else<br>
> {<br>
> + uint32_t zOrder = 0;<br>
> compressInterCU_rd5_6(ctu, cuGeom, zOrder, qp);<br>
> if (m_param->analysisMode == X265_ANALYSIS_SAVE && m_frame->m_analysisData.interData)<br>
> {<br>
> @@ -228,7 +228,7 @@<br>
> }<br>
> }<br>
><br>
> -void Analysis::compressIntraCU(const CUData& parentCTU, const CUGeom& cuGeom, uint32_t& zOrder, int32_t qp)<br>
> +void Analysis::compressIntraCU(const CUData& parentCTU, const CUGeom& cuGeom, int32_t qp)<br>
> {<br>
> uint32_t depth = cuGeom.depth;<br>
> ModeDepth& md = m_modeDepth[depth];<br>
> @@ -302,7 +302,7 @@<br>
> if (m_slice->m_pps->bUseDQP && nextDepth <= m_slice->m_pps->maxCuDQPDepth)<br>
> nextQP = setLambdaFromQP(parentCTU, calculateQpforCuSize(parentCTU, childGeom));<br>
><br>
> - compressIntraCU(parentCTU, childGeom, zOrder, nextQP);<br>
> + compressIntraCU(parentCTU, childGeom, nextQP);<br>
><br>
> // Save best CU and pred data for this sub CU<br>
> splitCU->copyPartFrom(nd.bestMode->cu, childGeom, subPartIdx);<br>
> @@ -314,7 +314,6 @@<br>
> {<br>
> /* record the depth of this non-present sub-CU */<br>
> splitCU->setEmptyPart(childGeom, subPartIdx);<br>
> - zOrder += g_depthInc[g_maxCUDepth - 1][nextDepth];<br>
> }<br>
> }<br>
> nextContext->store(splitPred->contexts);<br>
> @@ -2137,10 +2136,10 @@<br>
> return false;<br>
> }<br>
><br>
> -int Analysis::calculateQpforCuSize(const CUData& ctu, const CUGeom& cuGeom)<br>
> +int Analysis::calculateQpforCuSize(const CUData& ctu, const CUGeom& cuGeom, double baseQp)<br>
> {<br>
> FrameData& curEncData = *m_frame->m_encData;<br>
> - double qp = curEncData.m_cuStat[ctu.m_cuAddr].baseQp;<br>
> + double qp = baseQp ? baseQp : curEncData.m_cuStat[ctu.m_cuAddr].baseQp;<br>
><br>
> /* Use cuTree offsets if cuTree enabled and frame is referenced, else use AQ offsets */<br>
> bool isReferenced = IS_REFERENCED(m_frame);<br>
> diff -r bd8087bfd93f -r c4d4df4413b8 source/encoder/analysis.h<br>
> --- a/source/encoder/analysis.h Thu Oct 08 16:28:14 2015 +0530<br>
> +++ b/source/encoder/analysis.h Thu Oct 08 17:36:42 2015 +0530<br>
> @@ -111,7 +111,7 @@<br>
> uint32_t m_splitRefIdx[4];<br>
><br>
> /* full analysis for an I-slice CU */<br>
> - void compressIntraCU(const CUData& parentCTU, const CUGeom& cuGeom, uint32_t &zOrder, int32_t qp);<br>
> + void compressIntraCU(const CUData& parentCTU, const CUGeom& cuGeom, int32_t qp);<br>
><br>
> /* full analysis for a P or B slice CU */<br>
> uint32_t compressInterCU_dist(const CUData& parentCTU, const CUGeom& cuGeom, int32_t qp);<br>
> @@ -141,7 +141,7 @@<br>
> /* generate residual and recon pixels for an entire CTU recursively (RD0) */<br>
> void encodeResidue(const CUData& parentCTU, const CUGeom& cuGeom);<br>
><br>
> - int calculateQpforCuSize(const CUData& ctu, const CUGeom& cuGeom);<br>
> + int calculateQpforCuSize(const CUData& ctu, const CUGeom& cuGeom, double baseQP = 0);<br>
><br>
> /* check whether current mode is the new best */<br>
> inline void checkBestMode(Mode& mode, uint32_t depth)<br>
> diff -r bd8087bfd93f -r c4d4df4413b8 source/encoder/search.cpp<br>
> --- a/source/encoder/search.cpp Thu Oct 08 16:28:14 2015 +0530<br>
> +++ b/source/encoder/search.cpp Thu Oct 08 17:36:42 2015 +0530<br>
> @@ -164,12 +164,12 @@<br>
> X265_FREE(m_tsRecon);<br>
> }<br>
><br>
> -int Search::setLambdaFromQP(const CUData& ctu, int qp)<br>
> +int Search::setLambdaFromQP(const CUData& ctu, int qp, int lambdaQp)<br>
> {<br>
> X265_CHECK(qp >= QP_MIN && qp <= QP_MAX_MAX, "QP used for lambda is out of range\n");<br>
><br>
> m_me.setQP(qp);<br>
> - m_rdCost.setQP(*m_slice, qp);<br>
> + m_rdCost.setQP(*m_slice, lambdaQp < 0 ? qp : lambdaQp);<br>
><br>
> int quantQP = x265_clip3(QP_MIN, QP_MAX_SPEC, qp);<br>
> m_quant.setQPforQuant(ctu, quantQP);<br>
> diff -r bd8087bfd93f -r c4d4df4413b8 source/encoder/search.h<br>
> --- a/source/encoder/search.h Thu Oct 08 16:28:14 2015 +0530<br>
> +++ b/source/encoder/search.h Thu Oct 08 17:36:42 2015 +0530<br>
> @@ -333,7 +333,7 @@<br>
> ~Search();<br>
><br>
> bool initSearch(const x265_param& param, ScalingList& scalingList);<br>
> - int setLambdaFromQP(const CUData& ctu, int qp); /* returns real quant QP in valid spec range */<br>
> + int setLambdaFromQP(const CUData& ctu, int qp, int lambdaQP = -1); /* returns real quant QP in valid spec range */<br>
><br>
> // mark temp RD entropy contexts as uninitialized; useful for finding loads without stores<br>
> void invalidateContexts(int fromDepth);<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" rel="noreferrer" 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" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><font color="#0000ff">Regards,<br>Kavitha</font></div></div>
</div>