<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 23, 2013 at 4:04 PM, Aarthi Thirumalai <span dir="ltr"><<a href="mailto:aarthi@multicorewareinc.com" target="_blank">aarthi@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 class="im"># HG changeset patch<br>
# User Aarthi Thirumalai<br>
</div># Date 1382524433 -19800<br>
# Wed Oct 23 16:03:53 2013 +0530<br>
# Node ID 49ef6218538704a89f30c6d2aa77bf2166d4f0fe<br>
<div class="im"># Parent 6d96d64c4e9a2c526b57274760a7147241328cb3<br>
slicetype: bug fix for estimated frame costs<br>
<br>
</div>diff -r 6d96d64c4e9a -r 49ef62185387 source/encoder/slicetype.cpp<br>
<div class="im">--- a/source/encoder/slicetype.cpp Tue Oct 22 23:36:36 2013 +0530<br>
</div>+++ b/source/encoder/slicetype.cpp Wed Oct 23 16:03:53 2013 +0530<br>
<div class=""><div class="h5">@@ -150,7 +150,7 @@<br>
break;<br>
case P_SLICE:<br>
d0 = poc - l0poc;<br>
- frames[0] = lastNonB;<br>
+ frames[0] = &pic->getSlice()->getRefPic(REF_PIC_LIST_0, 0)->m_lowres;<br>
frames[d0] = &pic->m_lowres;<br>
p0 = 0;<br>
p1 = d0;<br>
@@ -162,7 +162,7 @@<br>
{<br>
// L1 reference is truly in the future<br>
d1 = l1poc - poc;<br>
- frames[0] = lastNonB;<br>
+ frames[0] = &pic->getSlice()->getRefPic(REF_PIC_LIST_0, 0)->m_lowres;<br></div></div></blockquote><div><br></div><div>lastNonB is set in slicetypeDecide() for each frame - when bframes >0 . So , when bframes = 0, lastNonB always refer to the initial I frame instead of the nearest P frame reference when getEstimatedPictureCost() is invoked from Rate control. </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=""><div class="h5">
frames[d0] = &pic->m_lowres;<br>
frames[d0 + d1] = &pic->getSlice()->getRefPic(REF_PIC_LIST_1, 0)->m_lowres;<br>
p0 = 0;<br>
@@ -171,7 +171,7 @@<br>
}<br>
else<br>
{<br>
- frames[0] = lastNonB;<br>
+ frames[0] = &pic->getSlice()->getRefPic(REF_PIC_LIST_0, 0)->m_lowres;<br>
frames[d0] = &pic->m_lowres;<br>
p0 = 0;<br>
p1 = d0;<br>
</div></div></blockquote></div><br></div></div>