<div dir="ltr"><div><br></div><div>In rd 3, best among the merge and mergeskip is selected based on rd cost and then best is compared with rd cost of rect inter modes and best is chosen among them</div><div>In rd 2, best among merge and rect inter modes is selected based on the sa8d cost and best is encoded and the best rd cost is compared with mergeskip rd cost .</div>
<div><br></div><div>By doing so, the best modes selected for each child cu is varying between rd 2 and rd3. so while finding the best merge canditates which depends on mvFieldNeighbours varies between rd2 and rd3 since mvFieldNeighbours  depends on modes selected in previous child cu while splitting the cu tree. So the merge cost, mergeskip cost starts varying between rd2 and rd3, so there are lot of chances that no:of: merge skips being selected in rd2 and rd3 modes varies a lot.</div>
<div><br></div><div>Regards</div><div>Sumalatha</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 14, 2014 at 4:29 PM, Deepthi Nandakumar <span dir="ltr"><<a href="mailto:deepthi@multicorewareinc.com" target="_blank">deepthi@multicorewareinc.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div></div><div class="gmail_extra"><br>
<br><div class="gmail_quote"><div><div class="h5">On Fri, Jan 10, 2014 at 2:10 PM,  <span dir="ltr"><<a href="mailto:sumalatha@multicorewareinc.com" target="_blank">sumalatha@multicorewareinc.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"># HG changeset patch<br>
# User Sumalatha Polureddy<br>
# Date 1389343212 -19800<br>
# Node ID 104fb077a9813f0f3bb94c370e134d0d6d180809<br>
# Parent  80b63c3ee144e6edbafbbe281ad3d1d8505be1f6<br>
rd Level: improve bitrate and psnr in rd level 2<br>
<br>
a. Always allow intra mode for mode decision<br>
b. increase more merge skips at each depth<br>
<br>
Results are below<br>
CLI: input.y4m -o bitstream.hevc -r recon.y4m --preset veryfast --rd 2<br>
<br>
rd3 / previous rd2 / latest rd2<br>
BasketballDrive_1920x1080_50<br>
fps: 4.24/5.615.7<br>
psnr: 33.67/33.95/33.677<br>
birate: 2211/2272/2188<br>
<br>
Kimono1_1920x1080_24<br>
fps: 5.45/6.11/6.1<br>
psnr: 35.004/35.144/34.835<br>
birate: 713/740/692<br>
<br>
FourPeople_1280x720_60<br>
fps: 7.99/10.86/11.46<br>
psnr: 34.93/35.17/34.931<br>
birate: 320/341/341<br>
<br>
big_buck_bunny_360p24<br>
fps: 38.98/49.32/44.46<br>
psnr: 33.21/33.36/33.167<br>
birate: 56/60/56<br>
<br>
Johnny_1280x720_60<br>
fps: 8.21/9.58/11.32<br>
psnr: 36.74/37.238/37.01<br>
birate: 203/204/206<br>
<br>
diff -r 80b63c3ee144 -r 104fb077a981 source/encoder/compress.cpp<br>
--- a/source/encoder/compress.cpp       Thu Jan 09 12:50:16 2014 +0550<br>
+++ b/source/encoder/compress.cpp       Fri Jan 10 14:10:12 2014 +0530<br>
@@ -517,12 +517,6 @@<br>
                         bdoIntra = (outBestCU->getCbf(0, TEXT_LUMA) ||  outBestCU->getCbf(0, TEXT_CHROMA_U) ||<br>
                                     outBestCU->getCbf(0, TEXT_CHROMA_V));<br>
                     }<br>
-                    else<br>
-                    {<br>
-                        uint32_t threshold[4] = { 20000, 6000, 1600, 500 };<br>
-                        int index = 4 - g_convertToBit[outBestCU->getWidth(0)];<br>
-                        bdoIntra = (outBestCU->m_totalDistortion > threshold[index]);<br>
-                    }<br></blockquote><div><br></div></div></div><div>This change is valid. <br> <br></div><div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

                     if (bdoIntra)<br>
                     {<br>
                         xComputeCostIntraInInter(m_intraInInterCU[depth], SIZE_2Nx2N);<br>
@@ -587,8 +581,12 @@<br>
                         }<br>
                         m_search->encodeResAndCalcRdInterCU(m_mergeCU[depth], m_origYuv[depth], bestMergePred, m_tmpResiYuv[depth],<br>
                                                             m_bestResiYuv[depth], m_tmpRecoYuv[depth], true);<br>
-<br>
-                        if (m_mergeCU[depth]->m_totalCost < outBestCU->m_totalCost)<br>
+                        double lambda[4];<br>
+                        lambda[0] = 1.06;<br>
+                        lambda[1] = 1.5;<br>
+                        lambda[2] = 1.1;<br>
+                        lambda[3] = 1.0;<br></blockquote><div><br></div></div><div>This part looks like an artificial way of forcing more skips. I'd like to understand why merge-skips have reduced so much in the first place in rd 2, and then fix the root cause. <br>

<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">
+                        if (m_mergeCU[depth]->m_totalCost < lambda[depth] * outBestCU->m_totalCost)<br>
                         {<br>
                             outBestCU = m_mergeCU[depth];<br>
                             tempYuv = m_bestRecoYuv[depth];<br></div>
_______________________________________________<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" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br></div></div>
<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>
<br></blockquote></div><br></div></div>